diff --git a/ForgeGradle-2.1-20151213.034144-13.jar.1 b/ForgeGradle-2.1-20151213.034144-13.jar.1 new file mode 100644 index 000000000..68587665d Binary files /dev/null and b/ForgeGradle-2.1-20151213.034144-13.jar.1 differ diff --git a/GardenOfGlass.jar b/GardenOfGlass.jar index 9dad1c9f3..a6c9ea5b4 100644 Binary files a/GardenOfGlass.jar and b/GardenOfGlass.jar differ diff --git a/README.md b/README.md index 2fb6af838..627fb083e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ -![](https://github.com/Vazkii/Botania/blob/master/web/img/logo.png) -Welcome to the Botania repository. +![](https://github.com/Vazkii/BotaniaV2/blob/master/web/img/logo.png) +Welcome to the BotaniaV2 repository. Botania is a [Minecraft](https://minecraft.net/) mod based on adding natural magic to the game. It's inspired by other magic mods, such as [Thaumcraft](http://www.minecraftforum.net/topic/2011841-) or [Blood Magic](http://www.minecraftforum.net/topic/1899223-). -Botania by Vazkii is licensed under the [Botania License](http://botaniamod.net/license.php) +This version is a fork of williewillus' fork of my Botania mod, so in a way we've just gone in a big circle. + +Botania is licensed under the [Botania License](http://botaniamod.net/license.php) diff --git a/alt_resources/alternate_textures_futureazoo.zip b/alt_resources/alternate_textures_futureazoo.zip new file mode 100644 index 000000000..243e513d9 Binary files /dev/null and b/alt_resources/alternate_textures_futureazoo.zip differ diff --git a/alt_resources/alternate_textures_futureazoo_1.8andbelow.zip b/alt_resources/alternate_textures_futureazoo_1.8andbelow.zip new file mode 100644 index 000000000..cd9a93b01 Binary files /dev/null and b/alt_resources/alternate_textures_futureazoo_1.8andbelow.zip differ diff --git a/src/main/resources/assets/botania/textures/blocks/alt/agricarnation.png b/alt_resources/assets/botania/textures/blocks/agricarnation.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/agricarnation.png rename to alt_resources/assets/botania/textures/blocks/agricarnation.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/agricarnationChibi.png b/alt_resources/assets/botania/textures/blocks/agricarnationChibi.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/agricarnationChibi.png rename to alt_resources/assets/botania/textures/blocks/agricarnationChibi.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/arcanerose.png b/alt_resources/assets/botania/textures/blocks/arcanerose.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/arcanerose.png rename to alt_resources/assets/botania/textures/blocks/arcanerose.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/bellethorn.png b/alt_resources/assets/botania/textures/blocks/bellethorn.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/bellethorn.png rename to alt_resources/assets/botania/textures/blocks/bellethorn.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/bellethornChibi.png b/alt_resources/assets/botania/textures/blocks/bellethornChibi.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/bellethornChibi.png rename to alt_resources/assets/botania/textures/blocks/bellethornChibi.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/bubbell.png b/alt_resources/assets/botania/textures/blocks/bubbell.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/bubbell.png rename to alt_resources/assets/botania/textures/blocks/bubbell.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/bubbellChibi.png b/alt_resources/assets/botania/textures/blocks/bubbellChibi.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/bubbellChibi.png rename to alt_resources/assets/botania/textures/blocks/bubbellChibi.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/clayconia.png b/alt_resources/assets/botania/textures/blocks/clayconia.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/clayconia.png rename to alt_resources/assets/botania/textures/blocks/clayconia.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/daffomill.png b/alt_resources/assets/botania/textures/blocks/daffomill.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/daffomill.png rename to alt_resources/assets/botania/textures/blocks/daffomill.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/dandelifeon.png b/alt_resources/assets/botania/textures/blocks/dandelifeon.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/dandelifeon.png rename to alt_resources/assets/botania/textures/blocks/dandelifeon.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/dandelifeon.png.mcmeta b/alt_resources/assets/botania/textures/blocks/dandelifeon.png.mcmeta similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/dandelifeon.png.mcmeta rename to alt_resources/assets/botania/textures/blocks/dandelifeon.png.mcmeta diff --git a/src/main/resources/assets/botania/textures/blocks/alt/daybloom.png b/alt_resources/assets/botania/textures/blocks/daybloom.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/daybloom.png rename to alt_resources/assets/botania/textures/blocks/daybloom.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/daybloomDecor.png b/alt_resources/assets/botania/textures/blocks/daybloomDecor.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/daybloomDecor.png rename to alt_resources/assets/botania/textures/blocks/daybloomDecor.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/daybloomPrime.png b/alt_resources/assets/botania/textures/blocks/daybloomPrime.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/daybloomPrime.png rename to alt_resources/assets/botania/textures/blocks/daybloomPrime.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/dreadthorn.png b/alt_resources/assets/botania/textures/blocks/dreadthorn.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/dreadthorn.png rename to alt_resources/assets/botania/textures/blocks/dreadthorn.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/endoflame.png b/alt_resources/assets/botania/textures/blocks/endoflame.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/endoflame.png rename to alt_resources/assets/botania/textures/blocks/endoflame.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/entropinnyum.png b/alt_resources/assets/botania/textures/blocks/entropinnyum.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/entropinnyum.png rename to alt_resources/assets/botania/textures/blocks/entropinnyum.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/exoflame.png b/alt_resources/assets/botania/textures/blocks/exoflame.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/exoflame.png rename to alt_resources/assets/botania/textures/blocks/exoflame.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/fallenKanade.png b/alt_resources/assets/botania/textures/blocks/fallenKanade.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/fallenKanade.png rename to alt_resources/assets/botania/textures/blocks/fallenKanade.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower0.png b/alt_resources/assets/botania/textures/blocks/flower0.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower0.png rename to alt_resources/assets/botania/textures/blocks/flower0.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower0Tall0.png b/alt_resources/assets/botania/textures/blocks/flower0Tall0.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower0Tall0.png rename to alt_resources/assets/botania/textures/blocks/flower0Tall0.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower0Tall1.png b/alt_resources/assets/botania/textures/blocks/flower0Tall1.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower0Tall1.png rename to alt_resources/assets/botania/textures/blocks/flower0Tall1.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower1.png b/alt_resources/assets/botania/textures/blocks/flower1.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower1.png rename to alt_resources/assets/botania/textures/blocks/flower1.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower10.png b/alt_resources/assets/botania/textures/blocks/flower10.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower10.png rename to alt_resources/assets/botania/textures/blocks/flower10.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower10Tall0.png b/alt_resources/assets/botania/textures/blocks/flower10Tall0.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower10Tall0.png rename to alt_resources/assets/botania/textures/blocks/flower10Tall0.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower10Tall1.png b/alt_resources/assets/botania/textures/blocks/flower10Tall1.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower10Tall1.png rename to alt_resources/assets/botania/textures/blocks/flower10Tall1.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower11.png b/alt_resources/assets/botania/textures/blocks/flower11.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower11.png rename to alt_resources/assets/botania/textures/blocks/flower11.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower11Tall0.png b/alt_resources/assets/botania/textures/blocks/flower11Tall0.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower11Tall0.png rename to alt_resources/assets/botania/textures/blocks/flower11Tall0.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower11Tall1.png b/alt_resources/assets/botania/textures/blocks/flower11Tall1.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower11Tall1.png rename to alt_resources/assets/botania/textures/blocks/flower11Tall1.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower12.png b/alt_resources/assets/botania/textures/blocks/flower12.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower12.png rename to alt_resources/assets/botania/textures/blocks/flower12.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower12Tall0.png b/alt_resources/assets/botania/textures/blocks/flower12Tall0.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower12Tall0.png rename to alt_resources/assets/botania/textures/blocks/flower12Tall0.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower12Tall1.png b/alt_resources/assets/botania/textures/blocks/flower12Tall1.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower12Tall1.png rename to alt_resources/assets/botania/textures/blocks/flower12Tall1.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower13.png b/alt_resources/assets/botania/textures/blocks/flower13.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower13.png rename to alt_resources/assets/botania/textures/blocks/flower13.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower13Tall0.png b/alt_resources/assets/botania/textures/blocks/flower13Tall0.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower13Tall0.png rename to alt_resources/assets/botania/textures/blocks/flower13Tall0.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower13Tall1.png b/alt_resources/assets/botania/textures/blocks/flower13Tall1.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower13Tall1.png rename to alt_resources/assets/botania/textures/blocks/flower13Tall1.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower14.png b/alt_resources/assets/botania/textures/blocks/flower14.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower14.png rename to alt_resources/assets/botania/textures/blocks/flower14.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower14Tall0.png b/alt_resources/assets/botania/textures/blocks/flower14Tall0.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower14Tall0.png rename to alt_resources/assets/botania/textures/blocks/flower14Tall0.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower14Tall1.png b/alt_resources/assets/botania/textures/blocks/flower14Tall1.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower14Tall1.png rename to alt_resources/assets/botania/textures/blocks/flower14Tall1.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower15.png b/alt_resources/assets/botania/textures/blocks/flower15.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower15.png rename to alt_resources/assets/botania/textures/blocks/flower15.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower15Tall0.png b/alt_resources/assets/botania/textures/blocks/flower15Tall0.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower15Tall0.png rename to alt_resources/assets/botania/textures/blocks/flower15Tall0.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower15Tall1.png b/alt_resources/assets/botania/textures/blocks/flower15Tall1.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower15Tall1.png rename to alt_resources/assets/botania/textures/blocks/flower15Tall1.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower16.png b/alt_resources/assets/botania/textures/blocks/flower16.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower16.png rename to alt_resources/assets/botania/textures/blocks/flower16.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower1Tall0.png b/alt_resources/assets/botania/textures/blocks/flower1Tall0.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower1Tall0.png rename to alt_resources/assets/botania/textures/blocks/flower1Tall0.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower1Tall1.png b/alt_resources/assets/botania/textures/blocks/flower1Tall1.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower1Tall1.png rename to alt_resources/assets/botania/textures/blocks/flower1Tall1.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower2.png b/alt_resources/assets/botania/textures/blocks/flower2.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower2.png rename to alt_resources/assets/botania/textures/blocks/flower2.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower2Tall0.png b/alt_resources/assets/botania/textures/blocks/flower2Tall0.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower2Tall0.png rename to alt_resources/assets/botania/textures/blocks/flower2Tall0.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower2Tall1.png b/alt_resources/assets/botania/textures/blocks/flower2Tall1.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower2Tall1.png rename to alt_resources/assets/botania/textures/blocks/flower2Tall1.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower3.png b/alt_resources/assets/botania/textures/blocks/flower3.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower3.png rename to alt_resources/assets/botania/textures/blocks/flower3.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower3Tall0.png b/alt_resources/assets/botania/textures/blocks/flower3Tall0.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower3Tall0.png rename to alt_resources/assets/botania/textures/blocks/flower3Tall0.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower3Tall1.png b/alt_resources/assets/botania/textures/blocks/flower3Tall1.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower3Tall1.png rename to alt_resources/assets/botania/textures/blocks/flower3Tall1.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower4.png b/alt_resources/assets/botania/textures/blocks/flower4.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower4.png rename to alt_resources/assets/botania/textures/blocks/flower4.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower4Tall0.png b/alt_resources/assets/botania/textures/blocks/flower4Tall0.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower4Tall0.png rename to alt_resources/assets/botania/textures/blocks/flower4Tall0.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower4Tall1.png b/alt_resources/assets/botania/textures/blocks/flower4Tall1.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower4Tall1.png rename to alt_resources/assets/botania/textures/blocks/flower4Tall1.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower5.png b/alt_resources/assets/botania/textures/blocks/flower5.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower5.png rename to alt_resources/assets/botania/textures/blocks/flower5.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower5Tall0.png b/alt_resources/assets/botania/textures/blocks/flower5Tall0.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower5Tall0.png rename to alt_resources/assets/botania/textures/blocks/flower5Tall0.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower5Tall1.png b/alt_resources/assets/botania/textures/blocks/flower5Tall1.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower5Tall1.png rename to alt_resources/assets/botania/textures/blocks/flower5Tall1.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower6.png b/alt_resources/assets/botania/textures/blocks/flower6.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower6.png rename to alt_resources/assets/botania/textures/blocks/flower6.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower6Tall0.png b/alt_resources/assets/botania/textures/blocks/flower6Tall0.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower6Tall0.png rename to alt_resources/assets/botania/textures/blocks/flower6Tall0.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower6Tall1.png b/alt_resources/assets/botania/textures/blocks/flower6Tall1.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower6Tall1.png rename to alt_resources/assets/botania/textures/blocks/flower6Tall1.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower7.png b/alt_resources/assets/botania/textures/blocks/flower7.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower7.png rename to alt_resources/assets/botania/textures/blocks/flower7.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower7Tall0.png b/alt_resources/assets/botania/textures/blocks/flower7Tall0.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower7Tall0.png rename to alt_resources/assets/botania/textures/blocks/flower7Tall0.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower7Tall1.png b/alt_resources/assets/botania/textures/blocks/flower7Tall1.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower7Tall1.png rename to alt_resources/assets/botania/textures/blocks/flower7Tall1.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower8.png b/alt_resources/assets/botania/textures/blocks/flower8.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower8.png rename to alt_resources/assets/botania/textures/blocks/flower8.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower8Tall0.png b/alt_resources/assets/botania/textures/blocks/flower8Tall0.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower8Tall0.png rename to alt_resources/assets/botania/textures/blocks/flower8Tall0.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower8Tall1.png b/alt_resources/assets/botania/textures/blocks/flower8Tall1.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower8Tall1.png rename to alt_resources/assets/botania/textures/blocks/flower8Tall1.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower9.png b/alt_resources/assets/botania/textures/blocks/flower9.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower9.png rename to alt_resources/assets/botania/textures/blocks/flower9.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower9Tall0.png b/alt_resources/assets/botania/textures/blocks/flower9Tall0.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower9Tall0.png rename to alt_resources/assets/botania/textures/blocks/flower9Tall0.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flower9Tall1.png b/alt_resources/assets/botania/textures/blocks/flower9Tall1.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flower9Tall1.png rename to alt_resources/assets/botania/textures/blocks/flower9Tall1.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flowerGlimmering0.png b/alt_resources/assets/botania/textures/blocks/flowerGlimmering0.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flowerGlimmering0.png rename to alt_resources/assets/botania/textures/blocks/flowerGlimmering0.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flowerGlimmering1.png b/alt_resources/assets/botania/textures/blocks/flowerGlimmering1.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flowerGlimmering1.png rename to alt_resources/assets/botania/textures/blocks/flowerGlimmering1.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flowerGlimmering10.png b/alt_resources/assets/botania/textures/blocks/flowerGlimmering10.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flowerGlimmering10.png rename to alt_resources/assets/botania/textures/blocks/flowerGlimmering10.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flowerGlimmering11.png b/alt_resources/assets/botania/textures/blocks/flowerGlimmering11.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flowerGlimmering11.png rename to alt_resources/assets/botania/textures/blocks/flowerGlimmering11.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flowerGlimmering12.png b/alt_resources/assets/botania/textures/blocks/flowerGlimmering12.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flowerGlimmering12.png rename to alt_resources/assets/botania/textures/blocks/flowerGlimmering12.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flowerGlimmering13.png b/alt_resources/assets/botania/textures/blocks/flowerGlimmering13.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flowerGlimmering13.png rename to alt_resources/assets/botania/textures/blocks/flowerGlimmering13.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flowerGlimmering14.png b/alt_resources/assets/botania/textures/blocks/flowerGlimmering14.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flowerGlimmering14.png rename to alt_resources/assets/botania/textures/blocks/flowerGlimmering14.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flowerGlimmering15.png b/alt_resources/assets/botania/textures/blocks/flowerGlimmering15.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flowerGlimmering15.png rename to alt_resources/assets/botania/textures/blocks/flowerGlimmering15.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flowerGlimmering2.png b/alt_resources/assets/botania/textures/blocks/flowerGlimmering2.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flowerGlimmering2.png rename to alt_resources/assets/botania/textures/blocks/flowerGlimmering2.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flowerGlimmering3.png b/alt_resources/assets/botania/textures/blocks/flowerGlimmering3.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flowerGlimmering3.png rename to alt_resources/assets/botania/textures/blocks/flowerGlimmering3.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flowerGlimmering4.png b/alt_resources/assets/botania/textures/blocks/flowerGlimmering4.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flowerGlimmering4.png rename to alt_resources/assets/botania/textures/blocks/flowerGlimmering4.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flowerGlimmering5.png b/alt_resources/assets/botania/textures/blocks/flowerGlimmering5.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flowerGlimmering5.png rename to alt_resources/assets/botania/textures/blocks/flowerGlimmering5.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flowerGlimmering6.png b/alt_resources/assets/botania/textures/blocks/flowerGlimmering6.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flowerGlimmering6.png rename to alt_resources/assets/botania/textures/blocks/flowerGlimmering6.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flowerGlimmering7.png b/alt_resources/assets/botania/textures/blocks/flowerGlimmering7.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flowerGlimmering7.png rename to alt_resources/assets/botania/textures/blocks/flowerGlimmering7.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flowerGlimmering8.png b/alt_resources/assets/botania/textures/blocks/flowerGlimmering8.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flowerGlimmering8.png rename to alt_resources/assets/botania/textures/blocks/flowerGlimmering8.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/flowerGlimmering9.png b/alt_resources/assets/botania/textures/blocks/flowerGlimmering9.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/flowerGlimmering9.png rename to alt_resources/assets/botania/textures/blocks/flowerGlimmering9.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/gourmaryllis.png b/alt_resources/assets/botania/textures/blocks/gourmaryllis.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/gourmaryllis.png rename to alt_resources/assets/botania/textures/blocks/gourmaryllis.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/heiseiDream.png b/alt_resources/assets/botania/textures/blocks/heiseiDream.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/heiseiDream.png rename to alt_resources/assets/botania/textures/blocks/heiseiDream.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/hopperhock.png b/alt_resources/assets/botania/textures/blocks/hopperhock.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/hopperhock.png rename to alt_resources/assets/botania/textures/blocks/hopperhock.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/hopperhockChibi.png b/alt_resources/assets/botania/textures/blocks/hopperhockChibi.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/hopperhockChibi.png rename to alt_resources/assets/botania/textures/blocks/hopperhockChibi.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/hyacidus.png b/alt_resources/assets/botania/textures/blocks/hyacidus.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/hyacidus.png rename to alt_resources/assets/botania/textures/blocks/hyacidus.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/hydroangeas.png b/alt_resources/assets/botania/textures/blocks/hydroangeas.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/hydroangeas.png rename to alt_resources/assets/botania/textures/blocks/hydroangeas.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/hydroangeasDecor.png b/alt_resources/assets/botania/textures/blocks/hydroangeasDecor.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/hydroangeasDecor.png rename to alt_resources/assets/botania/textures/blocks/hydroangeasDecor.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/jadedAmaranthus.png b/alt_resources/assets/botania/textures/blocks/jadedAmaranthus.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/jadedAmaranthus.png rename to alt_resources/assets/botania/textures/blocks/jadedAmaranthus.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/jiyuulia.png b/alt_resources/assets/botania/textures/blocks/jiyuulia.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/jiyuulia.png rename to alt_resources/assets/botania/textures/blocks/jiyuulia.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/kekimurus.png b/alt_resources/assets/botania/textures/blocks/kekimurus.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/kekimurus.png rename to alt_resources/assets/botania/textures/blocks/kekimurus.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/loonium.png b/alt_resources/assets/botania/textures/blocks/loonium.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/loonium.png rename to alt_resources/assets/botania/textures/blocks/loonium.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/manastar.png b/alt_resources/assets/botania/textures/blocks/manastar.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/manastar.png rename to alt_resources/assets/botania/textures/blocks/manastar.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/marimorphosis.png b/alt_resources/assets/botania/textures/blocks/marimorphosis.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/marimorphosis.png rename to alt_resources/assets/botania/textures/blocks/marimorphosis.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/marimorphosisChibi.png b/alt_resources/assets/botania/textures/blocks/marimorphosisChibi.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/marimorphosisChibi.png rename to alt_resources/assets/botania/textures/blocks/marimorphosisChibi.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/medumone.png b/alt_resources/assets/botania/textures/blocks/medumone.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/medumone.png rename to alt_resources/assets/botania/textures/blocks/medumone.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/munchdew.png b/alt_resources/assets/botania/textures/blocks/munchdew.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/munchdew.png rename to alt_resources/assets/botania/textures/blocks/munchdew.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/narslimmus.png b/alt_resources/assets/botania/textures/blocks/narslimmus.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/narslimmus.png rename to alt_resources/assets/botania/textures/blocks/narslimmus.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/nightshade.png b/alt_resources/assets/botania/textures/blocks/nightshade.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/nightshade.png rename to alt_resources/assets/botania/textures/blocks/nightshade.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/nightshadeDecor.png b/alt_resources/assets/botania/textures/blocks/nightshadeDecor.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/nightshadeDecor.png rename to alt_resources/assets/botania/textures/blocks/nightshadeDecor.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/nightshadePrime.png b/alt_resources/assets/botania/textures/blocks/nightshadePrime.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/nightshadePrime.png rename to alt_resources/assets/botania/textures/blocks/nightshadePrime.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/orechid.png b/alt_resources/assets/botania/textures/blocks/orechid.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/orechid.png rename to alt_resources/assets/botania/textures/blocks/orechid.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/orechidIgnem.png b/alt_resources/assets/botania/textures/blocks/orechidIgnem.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/orechidIgnem.png rename to alt_resources/assets/botania/textures/blocks/orechidIgnem.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/pollidisiac.png b/alt_resources/assets/botania/textures/blocks/pollidisiac.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/pollidisiac.png rename to alt_resources/assets/botania/textures/blocks/pollidisiac.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/puredaisy.png b/alt_resources/assets/botania/textures/blocks/puredaisy.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/puredaisy.png rename to alt_resources/assets/botania/textures/blocks/puredaisy.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/rafflowsia.png b/alt_resources/assets/botania/textures/blocks/rafflowsia.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/rafflowsia.png rename to alt_resources/assets/botania/textures/blocks/rafflowsia.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/rannuncarpus.png b/alt_resources/assets/botania/textures/blocks/rannuncarpus.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/rannuncarpus.png rename to alt_resources/assets/botania/textures/blocks/rannuncarpus.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/rannuncarpusChibi.png b/alt_resources/assets/botania/textures/blocks/rannuncarpusChibi.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/rannuncarpusChibi.png rename to alt_resources/assets/botania/textures/blocks/rannuncarpusChibi.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/solegnolia.png b/alt_resources/assets/botania/textures/blocks/solegnolia.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/solegnolia.png rename to alt_resources/assets/botania/textures/blocks/solegnolia.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/solegnoliaChibi.png b/alt_resources/assets/botania/textures/blocks/solegnoliaChibi.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/solegnoliaChibi.png rename to alt_resources/assets/botania/textures/blocks/solegnoliaChibi.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/spectranthemum.png b/alt_resources/assets/botania/textures/blocks/spectranthemum.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/spectranthemum.png rename to alt_resources/assets/botania/textures/blocks/spectranthemum.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/spectrolus.png b/alt_resources/assets/botania/textures/blocks/spectrolus.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/spectrolus.png rename to alt_resources/assets/botania/textures/blocks/spectrolus.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/tangleberrie.png b/alt_resources/assets/botania/textures/blocks/tangleberrie.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/tangleberrie.png rename to alt_resources/assets/botania/textures/blocks/tangleberrie.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/thermalily.png b/alt_resources/assets/botania/textures/blocks/thermalily.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/thermalily.png rename to alt_resources/assets/botania/textures/blocks/thermalily.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/tigerseye.png b/alt_resources/assets/botania/textures/blocks/tigerseye.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/tigerseye.png rename to alt_resources/assets/botania/textures/blocks/tigerseye.png diff --git a/src/main/resources/assets/botania/textures/blocks/alt/vinculotus.png b/alt_resources/assets/botania/textures/blocks/vinculotus.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/alt/vinculotus.png rename to alt_resources/assets/botania/textures/blocks/vinculotus.png diff --git a/alt_resources/pack.mcmeta b/alt_resources/pack.mcmeta new file mode 100644 index 000000000..6efa38a56 --- /dev/null +++ b/alt_resources/pack.mcmeta @@ -0,0 +1,6 @@ +{ + "pack": { + "pack_format": 2, + "description": "Alternate Botania textures by Futureazoo" + } +} \ No newline at end of file diff --git a/build.gradle b/build.gradle index f77470da7..2a8899ae0 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,6 @@ +import groovy.json.JsonSlurper +import groovy.json.JsonOutput + buildscript { repositories { mavenCentral() @@ -11,19 +14,24 @@ buildscript { } } dependencies { - classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT' + classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT' + classpath 'com.matthewprenger:CurseGradle:1.0-SNAPSHOT' } } repositories { + mavenCentral() maven { name = "chickenbones" url = "http://chickenbones.net/maven/" } + maven { + url "http://dvs1.progwml6.com/files/maven" + } } -apply plugin: 'forge' -apply plugin: 'curseforge' +apply plugin: 'net.minecraftforge.gradle.forge' +apply plugin: 'com.matthewprenger.cursegradle' ext.configFile = file('build.properties') @@ -36,20 +44,19 @@ archivesBaseName = config.mod_name minecraft { version = "${config.mc_version}-${config.forge_version}" - assetDir = "eclipse/assets" + runDir = "eclipse/assets" + mappings = config.mc_mappings //This, does the token replacement. //Though, I reccomend this to be replaced with a token such as @VERSION@ replace 'GRADLE:BUILD', config.build_number replace 'GRADLE:VERSION', config.version replaceIn 'LibMisc.java' //I may have missed another file, though I can only find it in here. + useDepAts = true } //This here is for SCP -repositories { - mavenCentral() -} configurations { sshAntTask } @@ -60,15 +67,20 @@ dependencies { compile files( 'Baubles-deobf.jar' ) - compile "codechicken:CodeChickenLib:1.7.10-1.1.1.109:dev" - compile "codechicken:CodeChickenCore:1.7.10-1.0.2.9:dev" - compile "codechicken:NotEnoughItems:1.7.10-1.0.2.15:dev" - compile "codechicken:ForgeMultipart:1.7.10-1.1.1.320:dev" + deobfCompile "mezz.jei:jei_1.10.2:3.7.8.234" //and a bit more for SCP sshAntTask "org.apache.ant:ant-jsch:1.7.1", "jsch:jsch:0.1.29" } +compileJava { + sourceCompatibility = 1.8 + targetCompatibility = 1.8 +} + +sourceCompatibility = 1.8 +targetCompatibility = 1.8 + processResources { // replace stuff in mcmod.info, nothing else from(sourceSets.main.resources.srcDirs) { @@ -89,7 +101,7 @@ processResources { */ task deobfJar(type: Jar) { from(sourceSets.main.output) - archiveName = "${baseName} ${version}-deobf.${extension}" + archiveName = "${baseName}.${version}-deobf.${extension}" } artifacts { @@ -98,12 +110,14 @@ artifacts { /** * Increments the buildnumber in your config file, and saves it */ -task incrementBuildNumber(dependsOn: 'reobf') << { +task incrementBuildNumber(dependsOn: 'reobfJar') << { config.build_number = (config.build_number.toString().toInteger()) + 1 configFile.withWriter { config.toProperties().store(it, "") } + // todo make this flexibile - collection of supported mc versions + file('web/versions.ini').append("\n${version}=${minecraft.version}") file("${config.dir_repo}/version/${minecraft.version}.txt").write("${version}") } @@ -145,9 +159,7 @@ task sort(type: Delete) { delete "${config.dir_output}/${deobfJar.archiveName}", "${config.dir_output}/wtf" } -/** - * This is the upload task from the build.xml - */ +// This is the upload task from the build.xml task upload() << { scp('/files') { fileset(file: jar.archivePath) @@ -163,9 +175,7 @@ task upload() << { } } -/** - * This is deply_web task - */ +// This is deploy_web task task deployWeb << { scp('/') { fileset(dir: 'web') //everything from the web directory @@ -194,6 +204,7 @@ def scp(String dir, Closure antFileset = {}) { } } + def parseConfig(File config) { config.withReader { def prop = new Properties() @@ -204,17 +215,22 @@ def parseConfig(File config) { jar { //rename the default output, for some better... sanity with scipts - archiveName = "${baseName} ${version}.${extension}" + archiveName = "${baseName}-unofficial.${version}.${extension}" } -curse { +curseforge { apiKey = priv.cfkey - projectId = "225643" - changelog = """ - See http://botaniamod.net/changelog.php#${version} - """ - releaseType = "release" - relatedProject 'baubles': 'requiredLibrary' + project { + id = "225643" + changelog = """ + See http://botaniamod.net/changelog.php#${version} + """ + releaseType = "beta" + addGameVersion "${config.cf_meta_version}" + relations { + requiredLibrary 'baubles' + } + } } defaultTasks 'clean', 'build', 'sort', 'forgecraft', 'incrementBuildNumber', 'curse', 'upload' diff --git a/build.properties b/build.properties index a5bfa79bb..1ceab45d7 100644 --- a/build.properties +++ b/build.properties @@ -1,9 +1,11 @@ # -#Thu Feb 25 19:50:43 GMT 2016 -version=r1.8 +#Sun Aug 28 08:42:14 CDT 2016 +version=r2.0 dir_output=../Build Output/Botania/ +mc_mappings=snapshot_20160518 +forge_version=12.18.1.2076 +mc_version=1.10.2 +cf_meta_version=1.10.2 dir_repo=./ -forge_version=10.13.2.1291 -mc_version=1.7.10 -build_number=250 -mod_name=Botania +build_number=321 +mod_name=Botania \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 3d0dee6e8..30d399d8d 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 211ae5a57..ca2b663a0 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Oct 27 18:34:11 EDT 2014 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.1-bin.zip +#Sat May 28 11:56:22 CDT 2016 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-all.zip diff --git a/gradlew.bat b/gradlew.bat new file mode 100755 index 000000000..aec99730b --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/src/api/java/buildcraft/api/core/BCLog.java b/src/api/java/buildcraft/api/core/BCLog.java index 7f2896de1..1ba70725c 100644 --- a/src/api/java/buildcraft/api/core/BCLog.java +++ b/src/api/java/buildcraft/api/core/BCLog.java @@ -1,60 +1,42 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.core; -import java.lang.reflect.Method; - import org.apache.logging.log4j.Level; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; public final class BCLog { + public static final Logger logger = LogManager.getLogger("BuildCraft"); - public static final Logger logger = LogManager.getLogger("BuildCraft"); - - /** - * Deactivate constructor - */ - private BCLog() { - } - - public static void initLog() { - - logger.info("Starting BuildCraft " + getVersion()); - logger.info("Copyright (c) SpaceToad, 2011-2015"); - logger.info("http://www.mod-buildcraft.com"); - } + /** Deactivate constructor */ + private BCLog() {} + @Deprecated public static void logErrorAPI(String mod, Throwable error, Class classFile) { - StringBuilder msg = new StringBuilder(mod); - msg.append(" API error, please update your mods. Error: ").append(error); - StackTraceElement[] stackTrace = error.getStackTrace(); - if (stackTrace.length > 0) { - msg.append(", ").append(stackTrace[0]); - } + logErrorAPI(error, classFile); + } - logger.log(Level.ERROR, msg.toString()); + public static void logErrorAPI(Throwable error, Class classFile) { + StringBuilder msg = new StringBuilder("API error! Please update your mods. Error: "); + msg.append(error); + StackTraceElement[] stackTrace = error.getStackTrace(); + if (stackTrace.length > 0) { + msg.append(", ").append(stackTrace[0]); + } - if (classFile != null) { - msg = new StringBuilder(mod); - msg.append(" API error: ").append(classFile.getSimpleName()).append(" is loaded from ").append(classFile.getProtectionDomain().getCodeSource().getLocation()); - logger.log(Level.ERROR, msg.toString()); - } - } + logger.log(Level.ERROR, msg.toString()); - public static String getVersion() { - try { - Class clazz = Class.forName("buildcraft.core.Version"); - Method method = clazz.getDeclaredMethod("getVersion"); - return String.valueOf(method.invoke(null)); - } catch (Exception e) { - return "UNKNOWN VERSION"; + if (classFile != null) { + msg.append("API error: ").append(classFile.getSimpleName()).append(" is loaded from ").append(classFile.getProtectionDomain().getCodeSource().getLocation()); + logger.log(Level.ERROR, msg.toString()); } } + + @Deprecated + public static String getVersion() { + return BuildCraftAPI.getVersion(); + } } diff --git a/src/api/java/buildcraft/api/core/BlockIndex.java b/src/api/java/buildcraft/api/core/BlockIndex.java deleted file mode 100644 index 8c295fa8f..000000000 --- a/src/api/java/buildcraft/api/core/BlockIndex.java +++ /dev/null @@ -1,115 +0,0 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ -package buildcraft.api.core; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -/** - * This class is a comparable container for integer block positions. - */ -public class BlockIndex implements Comparable { - - public int x; - public int y; - public int z; - - public BlockIndex() { - - } - - /** - * Creates an index for a block located on x, y. z - */ - public BlockIndex(int x, int y, int z) { - - this.x = x; - this.y = y; - this.z = z; - } - - public BlockIndex(NBTTagCompound c) { - this.x = c.getInteger("i"); - this.y = c.getInteger("j"); - this.z = c.getInteger("k"); - } - - public BlockIndex(Entity entity) { - x = (int) Math.floor(entity.posX); - y = (int) Math.floor(entity.posY); - z = (int) Math.floor(entity.posZ); - } - - public BlockIndex(TileEntity entity) { - this(entity.xCoord, entity.yCoord, entity.zCoord); - } - - /** - * Provides a deterministic and complete ordering of block positions. - */ - @Override - public int compareTo(BlockIndex o) { - - if (o.x < x) { - return 1; - } else if (o.x > x) { - return -1; - } else if (o.z < z) { - return 1; - } else if (o.z > z) { - return -1; - } else if (o.y < y) { - return 1; - } else if (o.y > y) { - return -1; - } else { - return 0; - } - } - - public void writeTo(NBTTagCompound c) { - c.setInteger("i", x); - c.setInteger("j", y); - c.setInteger("k", z); - } - - public Block getBlock(World world) { - return world.getBlock(x, y, z); - } - - @Override - public String toString() { - return "{" + x + ", " + y + ", " + z + "}"; - } - - @Override - public boolean equals(Object obj) { - if (obj instanceof BlockIndex) { - BlockIndex b = (BlockIndex) obj; - - return b.x == x && b.y == y && b.z == z; - } - - return false; - } - - @Override - public int hashCode() { - return (x * 37 + y) * 37 + z; - } - - public boolean nextTo(BlockIndex blockIndex) { - return (Math.abs(blockIndex.x - x) <= 1 && blockIndex.y == y && blockIndex.z == z) - || (blockIndex.x == x && Math.abs(blockIndex.y - y) <= 1 && blockIndex.z == z) - || (blockIndex.x == x && blockIndex.y == y && Math.abs(blockIndex.z - z) <= 1); - } -} diff --git a/src/api/java/buildcraft/api/core/BuildCraftAPI.java b/src/api/java/buildcraft/api/core/BuildCraftAPI.java index 9cb0b07e2..cc883d610 100644 --- a/src/api/java/buildcraft/api/core/BuildCraftAPI.java +++ b/src/api/java/buildcraft/api/core/BuildCraftAPI.java @@ -1,45 +1,52 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.core; +import java.lang.reflect.Method; import java.util.HashMap; -import java.util.HashSet; import java.util.Set; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; + import net.minecraft.block.Block; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public final class BuildCraftAPI { - public static ICoreProxy proxy; + public static ICoreProxy proxy; - public static final Set softBlocks = new HashSet(); - public static final HashMap worldProperties = new HashMap(); + public static final Set softBlocks = Sets.newHashSet(); + public static final HashMap worldProperties = Maps.newHashMap(); - /** - * Deactivate constructor - */ - private BuildCraftAPI() { - } + /** Deactivate constructor */ + private BuildCraftAPI() {} - public static IWorldProperty getWorldProperty(String name) { - return worldProperties.get(name); - } - - public static void registerWorldProperty(String name, IWorldProperty property) { - if (worldProperties.containsKey(name)) { - BCLog.logger.warn("The WorldProperty key '" + name + "' is being overidden with " + property.getClass().getSimpleName() + "!"); + public static String getVersion() { + try { + Class clazz = Class.forName("buildcraft.core.Version"); + Method method = clazz.getDeclaredMethod("getVersion"); + return String.valueOf(method.invoke(null)); + } catch (Exception e) { + return "UNKNOWN VERSION"; } - worldProperties.put(name, property); } - public static boolean isSoftBlock(World world, int x, int y, int z) { - return worldProperties.get("soft").get(world, x, y, z); - } + public static IWorldProperty getWorldProperty(String name) { + return worldProperties.get(name); + } + + public static void registerWorldProperty(String name, IWorldProperty property) { + if (worldProperties.containsKey(name)) { + BCLog.logger.warn("The WorldProperty key '" + name + "' is being overidden with " + property.getClass().getSimpleName() + "!"); + } + worldProperties.put(name, property); + } + + public static boolean isSoftBlock(World world, BlockPos pos) { + return worldProperties.get("soft").get(world, pos); + } } diff --git a/src/api/java/buildcraft/api/core/ConfigAccessor.java b/src/api/java/buildcraft/api/core/ConfigAccessor.java new file mode 100644 index 000000000..a66346ac5 --- /dev/null +++ b/src/api/java/buildcraft/api/core/ConfigAccessor.java @@ -0,0 +1,48 @@ +package buildcraft.api.core; + +import java.util.Map; + +import com.google.common.collect.Maps; + +import net.minecraftforge.common.config.Property; + +/** Use this to access the various config options. It is recommended that you use this as opposed to the variables in + * the mod, as users may only install the modules that they want, and not the one you may have refereed to. */ +@Deprecated +public final class ConfigAccessor { + public enum EMod { + CORE, + BUILDERS, + ENERGY, + FACTORY, + ROBITICS, + SILICON, + TRANSPORT + } + + private static Map mods = Maps.newHashMap(); + + private ConfigAccessor() {} + + public static Property getOption(EMod mod, String name) { + if (mods.containsKey(mod)) { + return mods.get(mod).getOption(name); + } else { + return null; + } + } + + public static boolean getBoolean(EMod mod, String name, boolean defaultBoolean) { + Property prop = getOption(mod, name); + if (prop == null) { + return defaultBoolean; + } else { + return prop.getBoolean(defaultBoolean); + } + } + + /** WARNING: INTERNAL USE ONLY! */ + public static void addMod(EMod mod, IBuildCraftMod actual) { + mods.put(mod, actual); + } +} diff --git a/src/api/java/buildcraft/api/core/EnumColor.java b/src/api/java/buildcraft/api/core/EnumColor.java index 2147e7261..14449b303 100644 --- a/src/api/java/buildcraft/api/core/EnumColor.java +++ b/src/api/java/buildcraft/api/core/EnumColor.java @@ -1,201 +1,150 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.core; import java.util.Locale; import java.util.Random; -import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.util.IStringSerializable; +import net.minecraft.util.ResourceLocation; -public enum EnumColor { +import net.minecraft.util.text.translation.I18n; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; - BLACK, - RED, - GREEN, - BROWN, - BLUE, - PURPLE, - CYAN, - LIGHT_GRAY, - GRAY, - PINK, - LIME, - YELLOW, - LIGHT_BLUE, - MAGENTA, - ORANGE, - WHITE; +import javax.annotation.Nonnull; - public static final EnumColor[] VALUES = values(); - public static final String[] DYES = { - "dyeBlack", - "dyeRed", - "dyeGreen", - "dyeBrown", - "dyeBlue", - "dyePurple", - "dyeCyan", - "dyeLightGray", - "dyeGray", - "dyePink", - "dyeLime", - "dyeYellow", - "dyeLightBlue", - "dyeMagenta", - "dyeOrange", - "dyeWhite"}; - public static final String[] NAMES = { - "Black", - "Red", - "Green", - "Brown", - "Blue", - "Purple", - "Cyan", - "LightGray", - "Gray", - "Pink", - "Lime", - "Yellow", - "LightBlue", - "Magenta", - "Orange", - "White"}; - public static final int[] DARK_HEX = { - 0x2D2D2D, - 0xA33835, - 0x394C1E, - 0x5C3A24, - 0x3441A2, - 0x843FBF, - 0x36809E, - 0x888888, - 0x444444, - 0xE585A0, - 0x3FAA36, - 0xCFC231, - 0x7F9AD1, - 0xFF64FF, - 0xFF6A00, - 0xFFFFFF}; - public static final int[] LIGHT_HEX = { - 0x181414, - 0xBE2B27, - 0x007F0E, - 0x89502D, - 0x253193, - 0x7e34bf, - 0x299799, - 0xa0a7a7, - 0x7A7A7A, - 0xD97199, - 0x39D52E, - 0xFFD91C, - 0x66AAFF, - 0xD943C6, - 0xEA7835, - 0xe4e4e4}; +/** Use minecraft's EnumDyeColor in as many places as possible. */ +@Deprecated +public enum EnumColor implements IStringSerializable { - @SideOnly(Side.CLIENT) - private static IIcon[] brushIcons; + BLACK, + RED, + GREEN, + BROWN, + BLUE, + PURPLE, + CYAN, + LIGHT_GRAY, + GRAY, + PINK, + LIME, + YELLOW, + LIGHT_BLUE, + MAGENTA, + ORANGE, + WHITE; - public int getDarkHex() { - return DARK_HEX[ordinal()]; - } + public static final EnumColor[] VALUES = values(); + public static final String[] DYES = { "dyeBlack", "dyeRed", "dyeGreen", "dyeBrown", "dyeBlue", "dyePurple", "dyeCyan", "dyeLightGray", "dyeGray", + "dyePink", "dyeLime", "dyeYellow", "dyeLightBlue", "dyeMagenta", "dyeOrange", "dyeWhite" }; + public static final String[] NAMES = { "Black", "Red", "Green", "Brown", "Blue", "Purple", "Cyan", "LightGray", "Gray", "Pink", "Lime", "Yellow", + "LightBlue", "Magenta", "Orange", "White" }; + public static final int[] DARK_HEX = { 0x2D2D2D, 0xA33835, 0x394C1E, 0x5C3A24, 0x3441A2, 0x843FBF, 0x36809E, 0x888888, 0x444444, 0xE585A0, + 0x3FAA36, 0xCFC231, 0x7F9AD1, 0xFF64FF, 0xFF6A00, 0xFFFFFF }; + public static final int[] LIGHT_HEX = { 0x181414, 0xBE2B27, 0x007F0E, 0x89502D, 0x253193, 0x7e34bf, 0x299799, 0xa0a7a7, 0x7A7A7A, 0xD97199, + 0x39D52E, 0xFFD91C, 0x66AAFF, 0xD943C6, 0xEA7835, 0xe4e4e4 }; - public int getLightHex() { - return LIGHT_HEX[ordinal()]; - } + @SideOnly(Side.CLIENT) + private static ResourceLocation iconSheet; - public static EnumColor fromId(int id) { - if (id < 0 || id >= VALUES.length) { - return WHITE; - } - return VALUES[id]; - } + @SideOnly(Side.CLIENT) + private static TextureAtlasSprite[] brushSprites; - public static EnumColor fromDye(String dyeTag) { - for (int id = 0; id < DYES.length; id++) { - if (DYES[id].equals(dyeTag)) { - return VALUES[id]; - } - } - return null; - } + public int getDarkHex() { + return DARK_HEX[ordinal()]; + } - public static EnumColor fromName(String name) { - for (int id = 0; id < NAMES.length; id++) { - if (NAMES[id].equals(name)) { - return VALUES[id]; - } - } - return null; - } + public int getLightHex() { + return LIGHT_HEX[ordinal()]; + } - public static EnumColor getRand() { - return VALUES[new Random().nextInt(VALUES.length)]; - } + public static EnumColor fromId(int id) { + if (id < 0 || id >= VALUES.length) { + return WHITE; + } + return VALUES[id]; + } - public EnumColor getNext() { - EnumColor next = VALUES[(ordinal() + 1) % VALUES.length]; - return next; - } + public static EnumColor fromDye(String dyeTag) { + for (int id = 0; id < DYES.length; id++) { + if (DYES[id].equals(dyeTag)) { + return VALUES[id]; + } + } + return null; + } - public EnumColor getPrevious() { - EnumColor previous = VALUES[(ordinal() + VALUES.length - 1) % VALUES.length]; - return previous; - } + public static EnumColor fromName(String name) { + for (int id = 0; id < NAMES.length; id++) { + if (NAMES[id].equals(name)) { + return VALUES[id]; + } + } + return null; + } - public EnumColor inverse() { - return EnumColor.VALUES[15 - ordinal()]; - } + public static EnumColor getRand() { + return VALUES[new Random().nextInt(VALUES.length)]; + } - public String getTag() { - return "color." + name().replace("_", ".").toLowerCase(Locale.ENGLISH); - } + public EnumColor getNext() { + EnumColor next = VALUES[(ordinal() + 1) % VALUES.length]; + return next; + } - public String getBasicTag() { - return name().replace("_", ".").toLowerCase(Locale.ENGLISH); - } + public EnumColor getPrevious() { + EnumColor previous = VALUES[(ordinal() + VALUES.length - 1) % VALUES.length]; + return previous; + } - public String getName() { - return NAMES[ordinal()]; - } + public EnumColor inverse() { + return EnumColor.VALUES[15 - ordinal()]; + } - public String getLocalizedName() { - return StatCollector.translateToLocal(getTag()); - } + public String getTag() { + return "color." + name().replace("_", ".").toLowerCase(Locale.ENGLISH); + } - public String getDye() { - return DYES[ordinal()]; - } + public String getBasicTag() { + return name().replace("_", ".").toLowerCase(Locale.ENGLISH); + } - @Override - public String toString() { - String s = name().replace("_", " "); - String[] words = s.split(" "); - StringBuilder b = new StringBuilder(); - for (String word : words) { - b.append(word.charAt(0)).append(word.substring(1).toLowerCase(Locale.ENGLISH)).append(" "); - } - return b.toString().trim(); - } + @Nonnull + @Override + public String getName() { + return NAMES[ordinal()]; + } - public static void setIconArray(IIcon[] icons) { - brushIcons = icons; - } + public String getLocalizedName() { + return I18n.translateToLocal(getTag()); + } - @SideOnly(Side.CLIENT) - public IIcon getIcon() { - return brushIcons [ordinal()]; - } + public String getDye() { + return DYES[ordinal()]; + } + + @Override + public String toString() { + String s = name().replace("_", " "); + String[] words = s.split(" "); + StringBuilder b = new StringBuilder(); + for (String word : words) { + b.append(word.charAt(0)).append(word.substring(1).toLowerCase(Locale.ENGLISH)).append(" "); + } + return b.toString().trim(); + } + + @SideOnly(Side.CLIENT) + public static void registerSprites(TextureAtlasSprite[] sprites) { + brushSprites = sprites; + } + + @SideOnly(Side.CLIENT) + public TextureAtlasSprite getSprite() { + return brushSprites[ordinal()]; + } } diff --git a/src/api/java/buildcraft/api/core/EnumPipePart.java b/src/api/java/buildcraft/api/core/EnumPipePart.java new file mode 100644 index 000000000..f515ff92b --- /dev/null +++ b/src/api/java/buildcraft/api/core/EnumPipePart.java @@ -0,0 +1,118 @@ +package buildcraft.api.core; + +import java.util.Locale; +import java.util.Map; + +import com.google.common.collect.Maps; + +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTPrimitive; +import net.minecraft.nbt.NBTTagString; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.IStringSerializable; + +import io.netty.buffer.ByteBuf; + +public enum EnumPipePart implements IStringSerializable,INetworkLoadable_BC8 { + DOWN(EnumFacing.DOWN), + UP(EnumFacing.UP), + NORTH(EnumFacing.NORTH), + SOUTH(EnumFacing.SOUTH), + WEST(EnumFacing.WEST), + EAST(EnumFacing.EAST), + /** CENTER, UNKNOWN and ALL are all valid uses of this constant. */ + CENTER(null); + + private static final Map facingMap = Maps.newEnumMap(EnumFacing.class); + private static final Map nameMap = Maps.newHashMap(); + private static final int MAX_VALUES = values().length; + + public final EnumFacing face; + + static { + for (EnumPipePart part : values()) { + nameMap.put(part.name(), part); + if (part.face != null) facingMap.put(part.face, part); + } + } + + public static EnumPipePart fromFacing(EnumFacing face) { + if (face == null) return EnumPipePart.CENTER; + return facingMap.get(face); + } + + public static EnumPipePart[] validFaces() { + return new EnumPipePart[] { DOWN, UP, NORTH, SOUTH, WEST, EAST }; + } + + public static EnumPipePart fromMeta(int meta) { + if (meta < 0 || meta >= MAX_VALUES) return EnumPipePart.CENTER; + return values()[meta]; + } + + private EnumPipePart(EnumFacing face) { + this.face = face; + } + + public int getIndex() { + if (face == null) return 6; + return face.getIndex(); + } + + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } + + public EnumPipePart next() { + switch (this) { + case DOWN: + return EAST; + case EAST: + return NORTH; + case NORTH: + return SOUTH; + case SOUTH: + return UP; + case UP: + return WEST; + case WEST: + return DOWN; + default: + return DOWN; + } + } + + public EnumPipePart opposite() { + if (this == CENTER) return CENTER; + return fromFacing(face.getOpposite()); + } + + public static EnumPipePart readFromNBT(NBTBase base) { + if (base == null) return CENTER; + if (base instanceof NBTTagString) { + NBTTagString nbtString = (NBTTagString) base; + String string = nbtString.getString(); + return nameMap.containsKey(string) ? nameMap.get(string) : CENTER; + } else { + byte ord = ((NBTPrimitive) base).getByte(); + if (ord < 0 || ord > 6) return CENTER; + return values()[ord]; + } + } + + public NBTBase writeToNBT() { + return new NBTTagString(name()); + } + + @Override + public EnumPipePart readFromByteBuf(ByteBuf buf) { + byte ord = buf.readByte(); + return fromMeta(ord); + } + + @Override + public void writeToByteBuf(ByteBuf buf) { + buf.writeByte(ordinal()); + } +} diff --git a/src/api/java/buildcraft/api/core/IAreaProvider.java b/src/api/java/buildcraft/api/core/IAreaProvider.java index 4abcf6e95..02bcf0ca9 100644 --- a/src/api/java/buildcraft/api/core/IAreaProvider.java +++ b/src/api/java/buildcraft/api/core/IAreaProvider.java @@ -1,31 +1,17 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.core; -/** - * To be implemented by TileEntities able to provide a square area on the world, typically BuildCraft markers. - */ +import net.minecraft.util.math.BlockPos; + +/** To be implemented by TileEntities able to provide a square area on the world, typically BuildCraft markers. */ public interface IAreaProvider { - int xMin(); + BlockPos min(); - int yMin(); + BlockPos max(); - int zMin(); - - int xMax(); - - int yMax(); - - int zMax(); - - /** - * Remove from the world all objects used to define the area. - */ - void removeFromWorld(); + /** Remove from the world all objects used to define the area. */ + void removeFromWorld(); } diff --git a/src/api/java/buildcraft/api/core/IBox.java b/src/api/java/buildcraft/api/core/IBox.java index e1e6f7d80..fd9add8e7 100644 --- a/src/api/java/buildcraft/api/core/IBox.java +++ b/src/api/java/buildcraft/api/core/IBox.java @@ -1,23 +1,20 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.core; + +import net.minecraft.util.math.BlockPos; + public interface IBox extends IZone { + IBox expand(int amount); - IBox expand(int amount); + IBox contract(int amount); - IBox contract(int amount); + BlockPos min(); - Position pMin(); - - Position pMax(); - - void createLaserData(); + BlockPos max(); + void createLaserData(); } diff --git a/src/api/java/buildcraft/api/core/IBuildCraftMod.java b/src/api/java/buildcraft/api/core/IBuildCraftMod.java new file mode 100644 index 000000000..c287088b1 --- /dev/null +++ b/src/api/java/buildcraft/api/core/IBuildCraftMod.java @@ -0,0 +1,7 @@ +package buildcraft.api.core; + +import net.minecraftforge.common.config.Property; + +public interface IBuildCraftMod { + Property getOption(String name); +} diff --git a/src/api/java/buildcraft/api/core/ICoreProxy.java b/src/api/java/buildcraft/api/core/ICoreProxy.java index 272faebfd..fc10bc092 100755 --- a/src/api/java/buildcraft/api/core/ICoreProxy.java +++ b/src/api/java/buildcraft/api/core/ICoreProxy.java @@ -1,11 +1,7 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.core; import java.lang.ref.WeakReference; @@ -14,5 +10,5 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.WorldServer; public interface ICoreProxy { - WeakReference getBuildCraftPlayer(WorldServer world); + WeakReference getBuildCraftPlayer(WorldServer world); } diff --git a/src/api/java/buildcraft/api/core/IIconProvider.java b/src/api/java/buildcraft/api/core/IIconProvider.java index fa8657e64..418c08a00 100644 --- a/src/api/java/buildcraft/api/core/IIconProvider.java +++ b/src/api/java/buildcraft/api/core/IIconProvider.java @@ -1,31 +1,13 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ package buildcraft.api.core; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.util.IIcon; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; public interface IIconProvider { + public TextureAtlasSprite getIcon(int iconIndex); - /** - * @param iconIndex - */ - @SideOnly(Side.CLIENT) - IIcon getIcon(int iconIndex); - - /** - * A call for the provider to register its Icons. This may be called multiple times but should only be executed once per provider - * @param iconRegister - */ - @SideOnly(Side.CLIENT) - void registerIcons(IIconRegister iconRegister); - + @SideOnly(Side.CLIENT) + public void registerIcons(TextureMap iconRegister); } diff --git a/src/api/java/buildcraft/api/core/IInvSlot.java b/src/api/java/buildcraft/api/core/IInvSlot.java index ea7a7fa30..a047a2f87 100644 --- a/src/api/java/buildcraft/api/core/IInvSlot.java +++ b/src/api/java/buildcraft/api/core/IInvSlot.java @@ -1,21 +1,15 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.core; import net.minecraft.item.ItemStack; public interface IInvSlot { - /** - * Returns the slot number of the underlying Inventory. + /** Returns the slot number of the underlying Inventory. * - * @return the slot number - */ + * @return the slot number */ int getIndex(); boolean canPutStackInSlot(ItemStack stack); @@ -24,7 +18,7 @@ public interface IInvSlot { boolean isItemValidForSlot(ItemStack stack); - ItemStack decreaseStackInSlot(int amount); + ItemStack decreaseStackInSlot(int amount); ItemStack getStackInSlot(); diff --git a/src/api/java/buildcraft/api/core/INBTLoadable_BC8.java b/src/api/java/buildcraft/api/core/INBTLoadable_BC8.java new file mode 100644 index 000000000..8005bcf53 --- /dev/null +++ b/src/api/java/buildcraft/api/core/INBTLoadable_BC8.java @@ -0,0 +1,14 @@ +package buildcraft.api.core; + +import net.minecraft.nbt.NBTBase; + +/** @param The type that will be loaded from and saved too. This essentially allows Immutable objects to be safely + * loaded without helper methods everywhere. However you are allowed to return this if you are a mutable + * object */ +public interface INBTLoadable_BC8 { + /** @return An object that has the properties loaded. WARNIG! This might be the same object as the one this method + * was called on! (You should always replace the object you have stored with whatever this returns) */ + T readFromNBT(NBTBase nbt); + + NBTBase writeToNBT(); +} diff --git a/src/api/java/buildcraft/api/core/INBTStoreable.java b/src/api/java/buildcraft/api/core/INBTStoreable.java index 669eed33c..c34c134ac 100644 --- a/src/api/java/buildcraft/api/core/INBTStoreable.java +++ b/src/api/java/buildcraft/api/core/INBTStoreable.java @@ -2,7 +2,11 @@ package buildcraft.api.core; import net.minecraft.nbt.NBTTagCompound; +/** Use {@link INBTLoadable_BC8} instead of this, as this gives you more control over what NBT goes where, and what + * objects are allowed to do. */ +@Deprecated public interface INBTStoreable { - void readFromNBT(NBTTagCompound tag); - void writeToNBT(NBTTagCompound tag); + void readFromNBT(NBTTagCompound tag); + + void writeToNBT(NBTTagCompound tag); } diff --git a/src/api/java/buildcraft/api/core/INetworkLoadable_BC8.java b/src/api/java/buildcraft/api/core/INetworkLoadable_BC8.java new file mode 100644 index 000000000..de0f99e95 --- /dev/null +++ b/src/api/java/buildcraft/api/core/INetworkLoadable_BC8.java @@ -0,0 +1,9 @@ +package buildcraft.api.core; + +import io.netty.buffer.ByteBuf; + +public interface INetworkLoadable_BC8 { + T readFromByteBuf(ByteBuf buf); + + void writeToByteBuf(ByteBuf buf); +} diff --git a/src/api/java/buildcraft/api/core/IPathProvider.java b/src/api/java/buildcraft/api/core/IPathProvider.java index 2ff392a92..3903c6e81 100644 --- a/src/api/java/buildcraft/api/core/IPathProvider.java +++ b/src/api/java/buildcraft/api/core/IPathProvider.java @@ -2,9 +2,14 @@ package buildcraft.api.core; import java.util.List; -/** - * To be implemented by TileEntities able to provide a path on the world, typically BuildCraft path markers. - */ +import net.minecraft.util.math.BlockPos; + +/** To be implemented by TileEntities able to provide a path on the world, typically BuildCraft path markers. */ public interface IPathProvider { - List getPath(); + List getPath(); + + /** + * Remove from the world all objects used to define the path. + */ + void removeFromWorld(); } diff --git a/src/api/java/buildcraft/api/core/ISerializable.java b/src/api/java/buildcraft/api/core/ISerializable.java index a7d011ebb..77d56d541 100644 --- a/src/api/java/buildcraft/api/core/ISerializable.java +++ b/src/api/java/buildcraft/api/core/ISerializable.java @@ -1,30 +1,21 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ + * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents + * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ package buildcraft.api.core; import io.netty.buffer.ByteBuf; -/** - * Implemented by classes representing serializable packet state - */ +/** Use {@link INetworkLoadable_BC8} instead, as that gives you more control over how you use objects */ +@Deprecated public interface ISerializable { - /** - * Serializes the state to the stream - * - * @param data - */ - void writeData(ByteBuf data); + /** Serializes the state to the stream + * + * @param data */ + void writeData(ByteBuf data); - /** - * Deserializes the state from the stream - * - * @param data - */ - void readData(ByteBuf data); + /** Deserializes the state from the stream + * + * @param data */ + void readData(ByteBuf data); } diff --git a/src/api/java/buildcraft/api/core/IWorldProperty.java b/src/api/java/buildcraft/api/core/IWorldProperty.java index a55bef1fc..415dc12d1 100755 --- a/src/api/java/buildcraft/api/core/IWorldProperty.java +++ b/src/api/java/buildcraft/api/core/IWorldProperty.java @@ -1,17 +1,14 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.core; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public interface IWorldProperty { - boolean get(World world, int x, int y, int z); + boolean get(World world, BlockPos pos); - void clear(); + void clear(); } diff --git a/src/api/java/buildcraft/api/core/IZone.java b/src/api/java/buildcraft/api/core/IZone.java index 55ef4f80e..21a5df210 100755 --- a/src/api/java/buildcraft/api/core/IZone.java +++ b/src/api/java/buildcraft/api/core/IZone.java @@ -1,23 +1,26 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.core; import java.util.Random; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Vec3d; + public interface IZone { + /** Returns the smallest possible distance that the index would have to be changed by in order for + * {@link #contains(Vec3d)} to return true. If the position is already inside then this will return 0 */ + double distanceTo(BlockPos index); - double distanceTo(BlockIndex index); + /** Returns {@link #distanceTo(BlockPos)} but squared. Usually this will be quicker to calculate. */ + double distanceToSquared(BlockPos index); - double distanceToSquared(BlockIndex index); - - boolean contains(double x, double y, double z); - - BlockIndex getRandomBlockIndex(Random rand); + /** Returns true if the point is enclosed by this zone, such that none of the coordinates lie outside the range + * specified by this zone. */ + boolean contains(Vec3d point); + /** Gets a random position that {@link #contains(Vec3d)} will return true. */ + BlockPos getRandomBlockPos(Random rand); } diff --git a/src/api/java/buildcraft/api/core/JavaTools.java b/src/api/java/buildcraft/api/core/JavaTools.java index e8dd4d898..7b7eb513c 100755 --- a/src/api/java/buildcraft/api/core/JavaTools.java +++ b/src/api/java/buildcraft/api/core/JavaTools.java @@ -1,43 +1,39 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.core; import java.util.Arrays; public final class JavaTools { - private JavaTools(){ - - } - - public static T[] concat(T[] first, T[] second) { - T[] result = Arrays.copyOf(first, first.length + second.length); - System.arraycopy(second, 0, result, first.length, second.length); - return result; - } + private JavaTools() { - public static int[] concat(int[] first, int[] second) { - int[] result = Arrays.copyOf(first, first.length + second.length); - System.arraycopy(second, 0, result, first.length, second.length); - return result; - } + } - public static float[] concat(float[] first, float[] second) { - float[] result = Arrays.copyOf(first, first.length + second.length); - System.arraycopy(second, 0, result, first.length, second.length); - return result; - } + public static T[] concat(T[] first, T[] second) { + T[] result = Arrays.copyOf(first, first.length + second.length); + System.arraycopy(second, 0, result, first.length, second.length); + return result; + } - public static String surroundWithQuotes(String stringToSurroundWithQuotes) { - return String.format("\"%s\"", stringToSurroundWithQuotes); - } + public static int[] concat(int[] first, int[] second) { + int[] result = Arrays.copyOf(first, first.length + second.length); + System.arraycopy(second, 0, result, first.length, second.length); + return result; + } - public static String stripSurroundingQuotes(String stringToStripQuotes) { - return stringToStripQuotes.replaceAll("^\"|\"$", ""); - } + public static float[] concat(float[] first, float[] second) { + float[] result = Arrays.copyOf(first, first.length + second.length); + System.arraycopy(second, 0, result, first.length, second.length); + return result; + } + + public static String surroundWithQuotes(String stringToSurroundWithQuotes) { + return String.format("\"%s\"", stringToSurroundWithQuotes); + } + + public static String stripSurroundingQuotes(String stringToStripQuotes) { + return stringToStripQuotes.replaceAll("^\"|\"$", ""); + } } diff --git a/src/api/java/buildcraft/api/core/Position.java b/src/api/java/buildcraft/api/core/Position.java deleted file mode 100644 index 426e09f40..000000000 --- a/src/api/java/buildcraft/api/core/Position.java +++ /dev/null @@ -1,200 +0,0 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ -package buildcraft.api.core; - -import io.netty.buffer.ByteBuf; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; - -public class Position implements ISerializable { - - public double x, y, z; - public ForgeDirection orientation; - - public Position() { - x = 0; - y = 0; - z = 0; - orientation = ForgeDirection.UNKNOWN; - } - - public Position(double ci, double cj, double ck) { - x = ci; - y = cj; - z = ck; - orientation = ForgeDirection.UNKNOWN; - } - - public Position(double ci, double cj, double ck, ForgeDirection corientation) { - x = ci; - y = cj; - z = ck; - orientation = corientation; - - if (orientation == null) { - orientation = ForgeDirection.UNKNOWN; - } - } - - public Position(Position p) { - x = p.x; - y = p.y; - z = p.z; - orientation = p.orientation; - } - - public Position(NBTTagCompound nbttagcompound) { - readFromNBT(nbttagcompound); - } - - public Position(TileEntity tile) { - x = tile.xCoord; - y = tile.yCoord; - z = tile.zCoord; - orientation = ForgeDirection.UNKNOWN; - } - - public Position(BlockIndex index) { - x = index.x; - y = index.y; - z = index.z; - orientation = ForgeDirection.UNKNOWN; - } - - public void moveRight(double step) { - switch (orientation) { - case SOUTH: - x = x - step; - break; - case NORTH: - x = x + step; - break; - case EAST: - z = z + step; - break; - case WEST: - z = z - step; - break; - default: - } - } - - public void moveLeft(double step) { - moveRight(-step); - } - - public void moveForwards(double step) { - switch (orientation) { - case UP: - y = y + step; - break; - case DOWN: - y = y - step; - break; - case SOUTH: - z = z + step; - break; - case NORTH: - z = z - step; - break; - case EAST: - x = x + step; - break; - case WEST: - x = x - step; - break; - default: - } - } - - public void moveBackwards(double step) { - moveForwards(-step); - } - - public void moveUp(double step) { - switch (orientation) { - case SOUTH: - case NORTH: - case EAST: - case WEST: - y = y + step; - break; - default: - } - - } - - public void moveDown(double step) { - moveUp(-step); - } - - public void writeToNBT(NBTTagCompound nbttagcompound) { - if (orientation == null) { - orientation = ForgeDirection.UNKNOWN; - } - - nbttagcompound.setDouble("i", x); - nbttagcompound.setDouble("j", y); - nbttagcompound.setDouble("k", z); - nbttagcompound.setByte("orientation", (byte) orientation.ordinal()); - } - - public void readFromNBT(NBTTagCompound nbttagcompound) { - x = nbttagcompound.getDouble("i"); - y = nbttagcompound.getDouble("j"); - z = nbttagcompound.getDouble("k"); - orientation = ForgeDirection.values() [nbttagcompound.getByte("orientation")]; - } - - @Override - public String toString() { - return "{" + x + ", " + y + ", " + z + "}"; - } - - public Position min(Position p) { - return new Position(p.x > x ? x : p.x, p.y > y ? y : p.y, p.z > z ? z : p.z); - } - - public Position max(Position p) { - return new Position(p.x < x ? x : p.x, p.y < y ? y : p.y, p.z < z ? z : p.z); - } - - public boolean isClose(Position newPosition, float f) { - double dx = x - newPosition.x; - double dy = y - newPosition.y; - double dz = z - newPosition.z; - - double sqrDis = dx * dx + dy * dy + dz * dz; - - return !(sqrDis > f * f); - } - - @Override - public void readData(ByteBuf stream) { - x = stream.readDouble(); - y = stream.readDouble(); - z = stream.readDouble(); - orientation = ForgeDirection.getOrientation(stream.readByte()); - } - - @Override - public void writeData(ByteBuf stream) { - stream.writeDouble(x); - stream.writeDouble(y); - stream.writeDouble(z); - stream.writeByte(orientation.ordinal()); - } - - @Override - public int hashCode() { - return (51 * (int) x) + (13 * (int) y) + (int) z; - } -} diff --git a/src/api/java/buildcraft/api/core/SafeTimeTracker.java b/src/api/java/buildcraft/api/core/SafeTimeTracker.java index 3e56ee989..9390d87e7 100644 --- a/src/api/java/buildcraft/api/core/SafeTimeTracker.java +++ b/src/api/java/buildcraft/api/core/SafeTimeTracker.java @@ -1,85 +1,68 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.core; import net.minecraft.world.World; public class SafeTimeTracker { - private long lastMark = Long.MIN_VALUE; - private long duration = -1; - private long randomRange = 0; - private long lastRandomDelay = 0; - private long internalDelay = 1; + private long lastMark = Long.MIN_VALUE; + private long duration = -1; + private long randomRange = 0; + private long lastRandomDelay = 0; + private long internalDelay = 1; - /** - * @deprecated should use constructors with parameters instead - */ - public SafeTimeTracker () { + /** Only use this if the delay time changes (say, if you use this to determine when a refining should be complete */ + public SafeTimeTracker() { - } + } - public SafeTimeTracker (long delay) { - internalDelay = delay; - } + public SafeTimeTracker(long delay) { + internalDelay = delay; + } - /** - * In many situations, it is a bad idea to have all objects of the same - * kind to be waiting for the exact same amount of time, as that can lead - * to some situation where they're all synchronized and got to work all - * at the same time. When created with a random range, the mark that is set - * when reaching the expect delay will be added with a random number - * between [0, range[, meaning that the event will take between 0 and range - * more tick to run. - */ - public SafeTimeTracker (long delay, long random) { - internalDelay = delay; - randomRange = random; - } + /** In many situations, it is a bad idea to have all objects of the same kind to be waiting for the exact same + * amount of time, as that can lead to some situation where they're all synchronized and got to work all at the same + * time. When created with a random range, the mark that is set when reaching the expect delay will be added with a + * random number between [0, range[, meaning that the event will take between 0 and range more tick to run. */ + public SafeTimeTracker(long delay, long random) { + internalDelay = delay; + randomRange = random; + } - public boolean markTimeIfDelay(World world) { - return markTimeIfDelay(world, internalDelay); - } + public boolean markTimeIfDelay(World world) { + return markTimeIfDelay(world, internalDelay); + } - /** - * Return true if a given delay has passed since last time marked was called - * successfully. - * - * @deprecated should use the constructor with a delay instead, and call - * this function without a parameter - */ - public boolean markTimeIfDelay(World world, long delay) { - if (world == null) { - return false; - } + /** Return true if a given delay has passed since last time marked was called successfully. */ + public boolean markTimeIfDelay(World world, long delay) { + if (world == null) { + return false; + } - long currentTime = world.getTotalWorldTime(); + long currentTime = world.getTotalWorldTime(); - if (currentTime < lastMark) { - lastMark = currentTime; - return false; - } else if (lastMark + delay + lastRandomDelay <= currentTime) { - duration = currentTime - lastMark; - lastMark = currentTime; - lastRandomDelay = (int) (Math.random() * randomRange); + if (currentTime < lastMark) { + lastMark = currentTime; + return false; + } else if (lastMark + delay + lastRandomDelay <= currentTime) { + duration = currentTime - lastMark; + lastMark = currentTime; + lastRandomDelay = (int) (Math.random() * randomRange); - return true; - } else { - return false; - } - } + return true; + } else { + return false; + } + } - public long durationOfLastDelay() { - return duration > 0 ? duration : 0; - } + public long durationOfLastDelay() { + return duration > 0 ? duration : 0; + } - public void markTime(World world) { - lastMark = world.getTotalWorldTime(); - } -} \ No newline at end of file + public void markTime(World world) { + lastMark = world.getTotalWorldTime(); + } +} diff --git a/src/api/java/buildcraft/api/core/StackKey.java b/src/api/java/buildcraft/api/core/StackKey.java index 776aaafdf..97ee4b8b4 100644 --- a/src/api/java/buildcraft/api/core/StackKey.java +++ b/src/api/java/buildcraft/api/core/StackKey.java @@ -1,11 +1,7 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.core; import net.minecraft.block.Block; @@ -13,122 +9,118 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -/** - * This class is used whenever stacks needs to be stored as keys. - */ +/** This class is used whenever stacks needs to be stored as keys. */ public final class StackKey { - public final ItemStack stack; - public final FluidStack fluidStack; + public final ItemStack stack; + public final FluidStack fluidStack; - public StackKey(FluidStack fluidStack) { - this(null, fluidStack); - } + public StackKey(FluidStack fluidStack) { + this(null, fluidStack); + } - public StackKey(ItemStack stack) { - this(stack, null); - } + public StackKey(ItemStack stack) { + this(stack, null); + } - public StackKey(ItemStack stack, FluidStack fluidStack) { - this.stack = stack; - this.fluidStack = fluidStack; - } + public StackKey(ItemStack stack, FluidStack fluidStack) { + this.stack = stack; + this.fluidStack = fluidStack; + } - public static StackKey stack(Item item, int amount, int damage) { - return new StackKey(new ItemStack(item, amount, damage)); - } + public static StackKey stack(Item item, int amount, int damage) { + return new StackKey(new ItemStack(item, amount, damage)); + } - public static StackKey stack(Block block, int amount, int damage) { - return new StackKey(new ItemStack(block, amount, damage)); - } + public static StackKey stack(Block block, int amount, int damage) { + return new StackKey(new ItemStack(block, amount, damage)); + } - public static StackKey stack(Item item) { - return new StackKey(new ItemStack(item, 1, 0)); - } + public static StackKey stack(Item item) { + return new StackKey(new ItemStack(item, 1, 0)); + } - public static StackKey stack(Block block) { - return new StackKey(new ItemStack(block, 1, 0)); - } + public static StackKey stack(Block block) { + return new StackKey(new ItemStack(block, 1, 0)); + } - public static StackKey stack(ItemStack itemStack) { - return new StackKey(itemStack); - } + public static StackKey stack(ItemStack itemStack) { + return new StackKey(itemStack); + } - public static StackKey fluid(Fluid fluid, int amount) { - return new StackKey(new FluidStack(fluid, amount)); - } + public static StackKey fluid(Fluid fluid, int amount) { + return new StackKey(new FluidStack(fluid, amount)); + } - public static StackKey fluid(Fluid fluid) { - return new StackKey(new FluidStack(fluid, FluidContainerRegistry.BUCKET_VOLUME)); - } + public static StackKey fluid(Fluid fluid) { + return new StackKey(new FluidStack(fluid, FluidContainerRegistry.BUCKET_VOLUME)); + } - public static StackKey fluid(FluidStack fluidStack) { - return new StackKey(fluidStack); - } + public static StackKey fluid(FluidStack fluidStack) { + return new StackKey(fluidStack); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || o.getClass() != StackKey.class) { - return false; - } - StackKey k = (StackKey) o; - if ((stack == null ^ k.stack == null) || (fluidStack == null ^ k.fluidStack == null)) { - return false; - } - if (stack != null) { - if (stack.getItem() != k.stack.getItem() || - stack.getHasSubtypes() && stack.getItemDamage() != k.stack.getItemDamage() || - !objectsEqual(stack.getTagCompound(), k.stack.getTagCompound())) { - return false; - } - } - if (fluidStack != null) { - if (fluidStack.getFluid().getID() != k.fluidStack.getFluid().getID() || - fluidStack.amount != k.fluidStack.amount || - !objectsEqual(fluidStack.tag, k.fluidStack.tag)) { - return false; - } - } - return true; - } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || o.getClass() != StackKey.class) { + return false; + } + StackKey k = (StackKey) o; + if ((stack == null ^ k.stack == null) || (fluidStack == null ^ k.fluidStack == null)) { + return false; + } + if (stack != null) { + if (stack.getItem() != k.stack.getItem() || stack.getHasSubtypes() && stack.getItemDamage() != k.stack.getItemDamage() || !objectsEqual( + stack.getTagCompound(), k.stack.getTagCompound())) { + return false; + } + } + if (fluidStack != null) { + if (fluidStack.getFluid() != k.fluidStack.getFluid() || fluidStack.amount != k.fluidStack.amount || !objectsEqual( + fluidStack.tag, k.fluidStack.tag)) { + return false; + } + } + return true; + } - @Override - public int hashCode() { - int result = 7; - if (stack != null) { - result = 31 * result + stack.getItem().hashCode(); - result = 31 * result + stack.getItemDamage(); - result = 31 * result + objectHashCode(stack.getTagCompound()); - } - result = 31 * result + 7; - if (fluidStack != null) { - result = 31 * result + fluidStack.getFluid().getID(); - result = 31 * result + fluidStack.amount; - result = 31 * result + objectHashCode(fluidStack.tag); - } - return result; - } + @Override + public int hashCode() { + int result = 7; + if (stack != null) { + result = 31 * result + stack.getItem().hashCode(); + result = 31 * result + stack.getItemDamage(); + result = 31 * result + objectHashCode(stack.getTagCompound()); + } + result = 31 * result + 7; + if (fluidStack != null) { + result = 31 * result + FluidRegistry.getFluidID(fluidStack.getFluid()); + result = 31 * result + fluidStack.amount; + result = 31 * result + objectHashCode(fluidStack.tag); + } + return result; + } - private boolean objectsEqual(Object o1, Object o2) { - if (o1 == null && o2 == null) { - return true; - } else if (o1 == null || o2 == null) { - return false; - } else { - return o1.equals(o2); - } - } - - private int objectHashCode(Object o) { - return o != null ? o.hashCode() : 0; - } + private boolean objectsEqual(Object o1, Object o2) { + if (o1 == null && o2 == null) { + return true; + } else if (o1 == null || o2 == null) { + return false; + } else { + return o1.equals(o2); + } + } - public StackKey copy() { - return new StackKey(stack != null ? stack.copy() : null, - fluidStack != null ? fluidStack.copy() : null); - } + private int objectHashCode(Object o) { + return o != null ? o.hashCode() : 0; + } + + public StackKey copy() { + return new StackKey(stack != null ? stack.copy() : null, fluidStack != null ? fluidStack.copy() : null); + } } diff --git a/src/api/java/buildcraft/api/core/package-info.java b/src/api/java/buildcraft/api/core/package-info.java index 0fc4db4cc..12cc9ea13 100644 --- a/src/api/java/buildcraft/api/core/package-info.java +++ b/src/api/java/buildcraft/api/core/package-info.java @@ -1,12 +1,10 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * * The BuildCraft API is distributed under the terms of the MIT License. * Please check the contents of the license, which should be located * as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "1.5", owner = "BuildCraft|Core", provides = "BuildCraftAPI|core") +@API(apiVersion = "2.0", owner = "BuildCraft|Core", provides = "BuildCraftAPI|core") package buildcraft.api.core; -import cpw.mods.fml.common.API; +import net.minecraftforge.fml.common.API; diff --git a/src/api/java/buildcraft/api/core/render/ICullable.java b/src/api/java/buildcraft/api/core/render/ICullable.java index b800c0851..2399a6927 100644 --- a/src/api/java/buildcraft/api/core/render/ICullable.java +++ b/src/api/java/buildcraft/api/core/render/ICullable.java @@ -1,32 +1,27 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ + * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents + * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ package buildcraft.api.core.render; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; -import net.minecraftforge.common.util.ForgeDirection; -/* - * This interface designates a block as a state machine responsible for culling - * For implementation details look into FakeBlock implementation - */ +/* This interface designates a block as a state machine responsible for culling For implementation details look into + * FakeBlock implementation */ public interface ICullable { - //Side Rendering States - //They are used to effectively cull obstructed sides while processing facades. - //Make sure your implementation is correct otherwise expect FPS drop - - void setRenderSide(ForgeDirection side, boolean render); - - void setRenderAllSides(); - - boolean shouldSideBeRendered(IBlockAccess blockAccess, int x, int y, int z, int side); - - void setRenderMask(int mask); - + // Side Rendering States + // They are used to effectively cull obstructed sides while processing facades. + // Make sure your implementation is correct otherwise expect FPS drop + + void setRenderSide(EnumFacing side, boolean render); + + void setRenderAllSides(); + + boolean shouldSideBeRendered(IBlockAccess blockAccess, BlockPos pos, int side); + + void setRenderMask(int mask); + } diff --git a/src/api/java/buildcraft/api/core/render/ITextureStateManager.java b/src/api/java/buildcraft/api/core/render/ITextureStateManager.java index 8161d6b93..e401b3e2e 100644 --- a/src/api/java/buildcraft/api/core/render/ITextureStateManager.java +++ b/src/api/java/buildcraft/api/core/render/ITextureStateManager.java @@ -1,7 +1,7 @@ package buildcraft.api.core.render; -import net.minecraft.util.IIcon; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; public interface ITextureStateManager { - void set(IIcon icon); + void set(TextureAtlasSprite icon); } diff --git a/src/api/java/buildcraft/api/core/render/ITextureStates.java b/src/api/java/buildcraft/api/core/render/ITextureStates.java index 835caf7fe..593534f6c 100644 --- a/src/api/java/buildcraft/api/core/render/ITextureStates.java +++ b/src/api/java/buildcraft/api/core/render/ITextureStates.java @@ -1,22 +1,18 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ + * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents + * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ package buildcraft.api.core.render; import net.minecraft.block.Block; -import net.minecraft.util.IIcon; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; public interface ITextureStates extends ICullable { - ITextureStateManager getTextureState(); - - IIcon getIcon(int side, int meta); - - Block getBlock(); - + ITextureStateManager getTextureState(); + + TextureAtlasSprite getIcon(int side, int meta); + + Block getBlock(); + } diff --git a/src/api/java/buildcraft/api/gates/GateExpansionController.java b/src/api/java/buildcraft/api/gates/GateExpansionController.java index e37ae20a5..749de86f7 100644 --- a/src/api/java/buildcraft/api/gates/GateExpansionController.java +++ b/src/api/java/buildcraft/api/gates/GateExpansionController.java @@ -1,11 +1,7 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.gates; import java.util.List; @@ -20,45 +16,39 @@ import buildcraft.api.statements.ITriggerInternal; public abstract class GateExpansionController { - public final IGateExpansion type; - public final TileEntity pipeTile; + public final IGateExpansion type; + public final TileEntity pipeTile; - public GateExpansionController(IGateExpansion type, TileEntity pipeTile) { - this.pipeTile = pipeTile; - this.type = type; - } + public GateExpansionController(IGateExpansion type, TileEntity pipeTile) { + this.pipeTile = pipeTile; + this.type = type; + } - public IGateExpansion getType() { - return type; - } + public IGateExpansion getType() { + return type; + } - public boolean isActive() { - return false; - } + public boolean isActive() { + return false; + } - public void tick(IGate gate) { - } + public void tick(IGate gate) {} - public void startResolution() { - } + public void startResolution() {} - public boolean resolveAction(IStatement action, int count) { - return false; - } + public boolean resolveAction(IStatement action, int count) { + return false; + } - public boolean isTriggerActive(IStatement trigger, IStatementParameter[] parameters) { - return false; - } + public boolean isTriggerActive(IStatement trigger, IStatementParameter[] parameters) { + return false; + } - public void addTriggers(List list) { - } + public void addTriggers(List list) {} - public void addActions(List list) { - } + public void addActions(List list) {} - public void writeToNBT(NBTTagCompound nbt) { - } + public void writeToNBT(NBTTagCompound nbt) {} - public void readFromNBT(NBTTagCompound nbt) { - } + public void readFromNBT(NBTTagCompound nbt) {} } diff --git a/src/api/java/buildcraft/api/gates/GateExpansions.java b/src/api/java/buildcraft/api/gates/GateExpansions.java index bc667f58e..b1e600371 100644 --- a/src/api/java/buildcraft/api/gates/GateExpansions.java +++ b/src/api/java/buildcraft/api/gates/GateExpansions.java @@ -1,11 +1,7 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.gates; import java.util.ArrayList; @@ -19,48 +15,47 @@ import com.google.common.collect.HashBiMap; import net.minecraft.item.ItemStack; public final class GateExpansions { - private static final Map expansions = new HashMap(); - private static final ArrayList expansionIDs = new ArrayList(); - private static final Map recipes = HashBiMap.create(); + private static final Map expansions = new HashMap(); + private static final ArrayList expansionIDs = new ArrayList(); + private static final Map recipes = HashBiMap.create(); - private GateExpansions() { - } + private GateExpansions() {} - public static void registerExpansion(IGateExpansion expansion) { - registerExpansion(expansion.getUniqueIdentifier(), expansion); - } + public static void registerExpansion(IGateExpansion expansion) { + registerExpansion(expansion.getUniqueIdentifier(), expansion); + } - public static void registerExpansion(String identifier, IGateExpansion expansion) { - expansions.put(identifier, expansion); - expansionIDs.add(expansion); - } + public static void registerExpansion(String identifier, IGateExpansion expansion) { + expansions.put(identifier, expansion); + expansionIDs.add(expansion); + } - public static void registerExpansion(IGateExpansion expansion, ItemStack addedRecipe) { - registerExpansion(expansion.getUniqueIdentifier(), expansion); - recipes.put(expansion, addedRecipe); - } + public static void registerExpansion(IGateExpansion expansion, ItemStack addedRecipe) { + registerExpansion(expansion.getUniqueIdentifier(), expansion); + recipes.put(expansion, addedRecipe); + } - public static IGateExpansion getExpansion(String identifier) { - return expansions.get(identifier); - } + public static IGateExpansion getExpansion(String identifier) { + return expansions.get(identifier); + } - public static Set getExpansions() { - Set set = new HashSet(); - set.addAll(expansionIDs); - return set; - } + public static Set getExpansions() { + Set set = new HashSet(); + set.addAll(expansionIDs); + return set; + } - public static Map getRecipesForPostInit() { - return recipes; - } - - // The code below is used by networking. - - public static IGateExpansion getExpansionByID(int id) { - return expansionIDs.get(id); - } - - public static int getExpansionID(IGateExpansion expansion) { - return expansionIDs.indexOf(expansion); - } + public static Map getRecipesForPostInit() { + return recipes; + } + + // The code below is used by networking. + + public static IGateExpansion getExpansionByID(int id) { + return expansionIDs.get(id); + } + + public static int getExpansionID(IGateExpansion expansion) { + return expansionIDs.indexOf(expansion); + } } diff --git a/src/api/java/buildcraft/api/gates/IGate.java b/src/api/java/buildcraft/api/gates/IGate.java index 6127caadb..df2364937 100644 --- a/src/api/java/buildcraft/api/gates/IGate.java +++ b/src/api/java/buildcraft/api/gates/IGate.java @@ -1,11 +1,7 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.gates; import java.util.List; @@ -17,16 +13,18 @@ import buildcraft.api.statements.containers.ISidedStatementContainer; import buildcraft.api.transport.IPipe; public interface IGate extends ISidedStatementContainer { - @Deprecated - void setPulsing(boolean pulse); + @Deprecated + void setPulsing(boolean pulse); - IPipe getPipe(); + IPipe getPipe(); - List getTriggers(); - List getActions(); + List getTriggers(); - List getActiveActions(); + List getActions(); - List getTriggerParameters(int index); - List getActionParameters(int index); + List getActiveActions(); + + List getTriggerParameters(int index); + + List getActionParameters(int index); } diff --git a/src/api/java/buildcraft/api/gates/IGateExpansion.java b/src/api/java/buildcraft/api/gates/IGateExpansion.java index ad61fad66..f197c0ca7 100644 --- a/src/api/java/buildcraft/api/gates/IGateExpansion.java +++ b/src/api/java/buildcraft/api/gates/IGateExpansion.java @@ -1,30 +1,34 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.gates; -import net.minecraft.client.renderer.texture.IIconRegister; +import java.util.List; + +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.vertex.VertexFormat; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; + +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; public interface IGateExpansion { - String getUniqueIdentifier(); + String getUniqueIdentifier(); - String getDisplayName(); + String getDisplayName(); - GateExpansionController makeController(TileEntity pipeTile); + GateExpansionController makeController(TileEntity pipeTile); - void registerBlockOverlay(IIconRegister iconRegister); + @SideOnly(Side.CLIENT) + void textureStitch(TextureMap map); - void registerItemOverlay(IIconRegister iconRegister); + @SideOnly(Side.CLIENT) + IGateStaticRenderState getRenderState(); - IIcon getOverlayBlock(); - - IIcon getOverlayItem(); + public interface IGateStaticRenderState { + List bake(VertexFormat format); + } } diff --git a/src/api/java/buildcraft/api/gates/package-info.java b/src/api/java/buildcraft/api/gates/package-info.java index 83cb2a2c4..b86ad48bd 100644 --- a/src/api/java/buildcraft/api/gates/package-info.java +++ b/src/api/java/buildcraft/api/gates/package-info.java @@ -1,12 +1,8 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ @API(apiVersion = "4.1", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|gates") package buildcraft.api.gates; -import cpw.mods.fml.common.API; +import net.minecraftforge.fml.common.API; diff --git a/src/api/java/buildcraft/api/statements/ActionState.java b/src/api/java/buildcraft/api/statements/ActionState.java index 72e4d58ba..15f547c07 100755 --- a/src/api/java/buildcraft/api/statements/ActionState.java +++ b/src/api/java/buildcraft/api/statements/ActionState.java @@ -1,11 +1,7 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.statements; public class ActionState { diff --git a/src/api/java/buildcraft/api/statements/IActionExternal.java b/src/api/java/buildcraft/api/statements/IActionExternal.java index 1d6e2eb54..21ffc92c4 100644 --- a/src/api/java/buildcraft/api/statements/IActionExternal.java +++ b/src/api/java/buildcraft/api/statements/IActionExternal.java @@ -1,16 +1,12 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.statements; import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.util.EnumFacing; public interface IActionExternal extends IStatement { - void actionActivate(TileEntity target, ForgeDirection side, IStatementContainer source, IStatementParameter[] parameters); + void actionActivate(TileEntity target, EnumFacing side, IStatementContainer source, IStatementParameter[] parameters); } diff --git a/src/api/java/buildcraft/api/statements/IActionInternal.java b/src/api/java/buildcraft/api/statements/IActionInternal.java index 6a019a459..c3c77a4b1 100644 --- a/src/api/java/buildcraft/api/statements/IActionInternal.java +++ b/src/api/java/buildcraft/api/statements/IActionInternal.java @@ -1,15 +1,11 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.statements; public interface IActionInternal extends IStatement { - void actionActivate(IStatementContainer source, IStatementParameter[] parameters); - + void actionActivate(IStatementContainer source, IStatementParameter[] parameters); + } diff --git a/src/api/java/buildcraft/api/statements/IActionProvider.java b/src/api/java/buildcraft/api/statements/IActionProvider.java index 147d4d39d..63625b05a 100644 --- a/src/api/java/buildcraft/api/statements/IActionProvider.java +++ b/src/api/java/buildcraft/api/statements/IActionProvider.java @@ -1,28 +1,19 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.statements; import java.util.Collection; import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.util.EnumFacing; public interface IActionProvider { - /** - * Returns the list of actions that are available from the statement container holding the - * gate. - */ - Collection getInternalActions(IStatementContainer container); + /** Returns the list of actions that are available from the statement container holding the gate. */ + Collection getInternalActions(IStatementContainer container); - /** - * Returns the list of actions available to a gate next to the given block. - */ - Collection getExternalActions(ForgeDirection side, TileEntity tile); + /** Returns the list of actions available to a gate next to the given block. */ + Collection getExternalActions(EnumFacing side, TileEntity tile); } diff --git a/src/api/java/buildcraft/api/statements/IActionReceptor.java b/src/api/java/buildcraft/api/statements/IActionReceptor.java index db7cea027..34155b86a 100644 --- a/src/api/java/buildcraft/api/statements/IActionReceptor.java +++ b/src/api/java/buildcraft/api/statements/IActionReceptor.java @@ -1,13 +1,9 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.statements; public interface IActionReceptor { - void actionActivated(IStatement statement, IStatementParameter[] parameters); + void actionActivated(IStatement statement, IStatementParameter[] parameters); } diff --git a/src/api/java/buildcraft/api/statements/IOverrideDefaultStatements.java b/src/api/java/buildcraft/api/statements/IOverrideDefaultStatements.java index c9c7db8ed..cb2dc78e1 100644 --- a/src/api/java/buildcraft/api/statements/IOverrideDefaultStatements.java +++ b/src/api/java/buildcraft/api/statements/IOverrideDefaultStatements.java @@ -1,16 +1,13 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.statements; import java.util.List; public interface IOverrideDefaultStatements { - List overrideTriggers(); - List overrideActions(); + List overrideTriggers(); + + List overrideActions(); } diff --git a/src/api/java/buildcraft/api/statements/IStatement.java b/src/api/java/buildcraft/api/statements/IStatement.java index e466efd2b..dc0254332 100644 --- a/src/api/java/buildcraft/api/statements/IStatement.java +++ b/src/api/java/buildcraft/api/statements/IStatement.java @@ -1,56 +1,36 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.statements; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.util.IIcon; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; public interface IStatement { - /** - * Every statement needs a unique tag, it should be in the format of - * "<modid>:<name>. - * - * @return the unique id - */ - String getUniqueTag(); + /** Every statement needs a unique tag, it should be in the format of "<modid>:<name>. + * + * @return the unique id */ + String getUniqueTag(); - @SideOnly(Side.CLIENT) - IIcon getIcon(); + /** Return the maximum number of parameter this statement can have, 0 if none. */ + int maxParameters(); - @SideOnly(Side.CLIENT) - void registerIcons(IIconRegister iconRegister); + /** Return the minimum number of parameter this statement can have, 0 if none. */ + int minParameters(); - /** - * Return the maximum number of parameter this statement can have, 0 if none. - */ - int maxParameters(); + /** Return the statement description in the UI */ + String getDescription(); - /** - * Return the minimum number of parameter this statement can have, 0 if none. - */ - int minParameters(); + /** Create parameters for the statement. */ + IStatementParameter createParameter(int index); - /** - * Return the statement description in the UI - */ - String getDescription(); + /** This returns the statement after a left rotation. Used in particular in blueprints orientation. */ + IStatement rotateLeft(); - /** - * Create parameters for the statement. - */ - IStatementParameter createParameter(int index); - - /** - * This returns the statement after a left rotation. Used in particular in - * blueprints orientation. - */ - IStatement rotateLeft(); + /** This should return the icon for this statement, suitable for rending directly into a GUI. This should refer to a + * texture on the map block texture map. */ + @SideOnly(Side.CLIENT) + TextureAtlasSprite getGuiSprite(); } diff --git a/src/api/java/buildcraft/api/statements/IStatementContainer.java b/src/api/java/buildcraft/api/statements/IStatementContainer.java index 43a4f51ef..f4a73465f 100644 --- a/src/api/java/buildcraft/api/statements/IStatementContainer.java +++ b/src/api/java/buildcraft/api/statements/IStatementContainer.java @@ -1,19 +1,12 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.statements; import net.minecraft.tileentity.TileEntity; -/** - * This is implemented by objects containing Statements, such as - * Gates and TileEntities. - */ +/** This is implemented by objects containing Statements, such as Gates and TileEntities. */ public interface IStatementContainer { - TileEntity getTile(); + TileEntity getTile(); } diff --git a/src/api/java/buildcraft/api/statements/IStatementParameter.java b/src/api/java/buildcraft/api/statements/IStatementParameter.java index 9a9e397cd..7ef29c793 100755 --- a/src/api/java/buildcraft/api/statements/IStatementParameter.java +++ b/src/api/java/buildcraft/api/statements/IStatementParameter.java @@ -1,59 +1,36 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.statements; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.IIcon; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; public interface IStatementParameter { - - /** - * Every parameter needs a unique tag, it should be in the format of - * "<modi>:<name>". - * - * @return the unique id - */ - String getUniqueTag(); - - @SideOnly(Side.CLIENT) - IIcon getIcon(); - ItemStack getItemStack(); + /** Every parameter needs a unique tag, it should be in the format of "<modid>:<name>". + * + * @return the unique id */ + String getUniqueTag(); - /** - * Something that is initially unintuitive: you HAVE to - * keep your icons as static variables, due to the fact - * that every IStatementParameter is instantiated upon creation, - * in opposition to IStatements which are singletons (due to the - * fact that they, unlike Parameters, store no additional data) - */ - @SideOnly(Side.CLIENT) - void registerIcons(IIconRegister iconRegister); - - /** - * Return the parameter description in the UI - */ - String getDescription(); + @SideOnly(Side.CLIENT) + TextureAtlasSprite getIcon(); - void onClick(IStatementContainer source, IStatement stmt, ItemStack stack, StatementMouseClick mouse); + ItemStack getItemStack(); - void readFromNBT(NBTTagCompound compound); + /** Return the parameter description in the UI */ + String getDescription(); - void writeToNBT(NBTTagCompound compound); + void onClick(IStatementContainer source, IStatement stmt, ItemStack stack, StatementMouseClick mouse); - /** - * This returns the parameter after a left rotation. Used in particular in - * blueprints orientation. - */ - IStatementParameter rotateLeft(); + void readFromNBT(NBTTagCompound compound); + + void writeToNBT(NBTTagCompound compound); + + /** This returns the parameter after a left rotation. Used in particular in blueprints orientation. */ + IStatementParameter rotateLeft(); } diff --git a/src/api/java/buildcraft/api/statements/ITriggerExternal.java b/src/api/java/buildcraft/api/statements/ITriggerExternal.java index 532f67a5f..3db589cbc 100644 --- a/src/api/java/buildcraft/api/statements/ITriggerExternal.java +++ b/src/api/java/buildcraft/api/statements/ITriggerExternal.java @@ -1,18 +1,14 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.statements; import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.util.EnumFacing; public interface ITriggerExternal extends IStatement { - boolean isTriggerActive(TileEntity target, ForgeDirection side, IStatementContainer source, IStatementParameter[] parameters); - + boolean isTriggerActive(TileEntity target, EnumFacing side, IStatementContainer source, IStatementParameter[] parameters); + } diff --git a/src/api/java/buildcraft/api/statements/ITriggerExternalOverride.java b/src/api/java/buildcraft/api/statements/ITriggerExternalOverride.java index 7103c06ac..b8628deec 100644 --- a/src/api/java/buildcraft/api/statements/ITriggerExternalOverride.java +++ b/src/api/java/buildcraft/api/statements/ITriggerExternalOverride.java @@ -1,17 +1,16 @@ package buildcraft.api.statements; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.util.EnumFacing; -/** - * This interface can be used by tiles to override external trigger - * behaviour. +/** This interface can be used by tiles to override external trigger behaviour. * - * Please use wisely. - */ + * Please use wisely. */ public interface ITriggerExternalOverride { - public enum Result { - TRUE, FALSE, IGNORE - } + public enum Result { + TRUE, + FALSE, + IGNORE + } - Result override(ForgeDirection side, IStatementContainer source, IStatementParameter[] parameters); + Result override(EnumFacing side, IStatementContainer source, IStatementParameter[] parameters); } diff --git a/src/api/java/buildcraft/api/statements/ITriggerInternal.java b/src/api/java/buildcraft/api/statements/ITriggerInternal.java index a4241d3da..610a5728b 100755 --- a/src/api/java/buildcraft/api/statements/ITriggerInternal.java +++ b/src/api/java/buildcraft/api/statements/ITriggerInternal.java @@ -1,15 +1,11 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.statements; public interface ITriggerInternal extends IStatement { - boolean isTriggerActive(IStatementContainer source, IStatementParameter[] parameters); + boolean isTriggerActive(IStatementContainer source, IStatementParameter[] parameters); } diff --git a/src/api/java/buildcraft/api/statements/ITriggerProvider.java b/src/api/java/buildcraft/api/statements/ITriggerProvider.java index 548f107bf..d6ffbd42f 100644 --- a/src/api/java/buildcraft/api/statements/ITriggerProvider.java +++ b/src/api/java/buildcraft/api/statements/ITriggerProvider.java @@ -1,28 +1,20 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.statements; import java.util.Collection; import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.util.EnumFacing; public interface ITriggerProvider { - /** - * Returns the list of triggers that are available from the object holding the gate. - */ - Collection getInternalTriggers(IStatementContainer container); + /** Returns the list of triggers that are available from the object holding the gate. */ + Collection getInternalTriggers(IStatementContainer container); - /** - * Returns the list of triggers available to a gate next to the given block. - */ - Collection getExternalTriggers(ForgeDirection side, TileEntity tile); + /** Returns the list of triggers available to a gate next to the given block. */ + Collection getExternalTriggers(EnumFacing side, TileEntity tile); } diff --git a/src/api/java/buildcraft/api/statements/StatementManager.java b/src/api/java/buildcraft/api/statements/StatementManager.java index fec7d9510..419ee1d07 100644 --- a/src/api/java/buildcraft/api/statements/StatementManager.java +++ b/src/api/java/buildcraft/api/statements/StatementManager.java @@ -1,11 +1,7 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.statements; import java.util.Collection; @@ -14,169 +10,168 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.tileentity.TileEntity; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.util.EnumFacing; + +import buildcraft.api.core.BCLog; public final class StatementManager { - public static Map statements = new HashMap(); - public static Map> parameters = new HashMap>(); - private static List triggerProviders = new LinkedList(); - private static List actionProviders = new LinkedList(); + public static Map statements = new HashMap(); + public static Map> parameters = new HashMap>(); + private static List triggerProviders = new LinkedList(); + private static List actionProviders = new LinkedList(); - /** - * Deactivate constructor - */ - private StatementManager() { - } + /** Deactivate constructor */ + private StatementManager() {} - public static void registerTriggerProvider(ITriggerProvider provider) { - if (provider != null && !triggerProviders.contains(provider)) { - triggerProviders.add(provider); - } - } + public static void registerTriggerProvider(ITriggerProvider provider) { + if (provider != null && !triggerProviders.contains(provider)) { + triggerProviders.add(provider); + } + } - public static void registerActionProvider(IActionProvider provider) { - if (provider != null && !actionProviders.contains(provider)) { - actionProviders.add(provider); - } - } + public static void registerActionProvider(IActionProvider provider) { + if (provider != null && !actionProviders.contains(provider)) { + actionProviders.add(provider); + } + } - public static void registerStatement(IStatement statement) { - statements.put(statement.getUniqueTag(), statement); - } + public static void registerStatement(IStatement statement) { + statements.put(statement.getUniqueTag(), statement); + } - public static void registerParameterClass(Class param) { - parameters.put(createParameter(param).getUniqueTag(), param); - } - - @Deprecated - public static void registerParameterClass(String name, Class param) { - parameters.put(name, param); - } + public static void registerParameterClass(Class param) { + parameters.put(createParameter(param).getUniqueTag(), param); + } - public static List getExternalTriggers(ForgeDirection side, TileEntity entity) { - List result; + @Deprecated + public static void registerParameterClass(String name, Class param) { + parameters.put(name, param); + } - if (entity instanceof IOverrideDefaultStatements) { - result = ((IOverrideDefaultStatements) entity).overrideTriggers(); - if (result != null) { - return result; - } - } + public static List getExternalTriggers(EnumFacing side, TileEntity entity) { + List result; + + if (entity instanceof IOverrideDefaultStatements) { + result = ((IOverrideDefaultStatements) entity).overrideTriggers(); + if (result != null) { + return result; + } + } + + result = new LinkedList(); + + for (ITriggerProvider provider : triggerProviders) { + Collection toAdd = provider.getExternalTriggers(side, entity); + + if (toAdd != null) { + for (ITriggerExternal t : toAdd) { + if (!result.contains(t)) { + result.add(t); + } + } + } + } + + return result; + } + + public static List getExternalActions(EnumFacing side, TileEntity entity) { + List result = new LinkedList(); + + if (entity instanceof IOverrideDefaultStatements) { + result = ((IOverrideDefaultStatements) entity).overrideActions(); + if (result != null) { + return result; + } + } + + result = new LinkedList(); - result = new LinkedList(); - - for (ITriggerProvider provider : triggerProviders) { - Collection toAdd = provider.getExternalTriggers(side, entity); + for (IActionProvider provider : actionProviders) { + Collection toAdd = provider.getExternalActions(side, entity); - if (toAdd != null) { - for (ITriggerExternal t : toAdd) { - if (!result.contains(t)) { - result.add(t); - } - } - } - } + if (toAdd != null) { + for (IActionExternal t : toAdd) { + if (!result.contains(t)) { + result.add(t); + } + } + } + } - return result; - } + return result; + } - public static List getExternalActions(ForgeDirection side, TileEntity entity) { - List result = new LinkedList(); + public static List getInternalTriggers(IStatementContainer container) { + List result = new LinkedList(); - if (entity instanceof IOverrideDefaultStatements) { - result = ((IOverrideDefaultStatements) entity).overrideActions(); - if (result != null) { - return result; - } else { - result = new LinkedList(); - } - } - - for (IActionProvider provider : actionProviders) { - Collection toAdd = provider.getExternalActions(side, entity); + for (ITriggerProvider provider : triggerProviders) { + Collection toAdd = provider.getInternalTriggers(container); - if (toAdd != null) { - for (IActionExternal t : toAdd) { - if (!result.contains(t)) { - result.add(t); - } - } - } - } + if (toAdd != null) { + for (ITriggerInternal t : toAdd) { + if (!result.contains(t)) { + result.add(t); + } + } + } + } - return result; - } + return result; + } - public static List getInternalTriggers(IStatementContainer container) { - List result = new LinkedList(); + public static List getInternalActions(IStatementContainer container) { + List result = new LinkedList(); - for (ITriggerProvider provider : triggerProviders) { - Collection toAdd = provider.getInternalTriggers(container); + for (IActionProvider provider : actionProviders) { + Collection toAdd = provider.getInternalActions(container); - if (toAdd != null) { - for (ITriggerInternal t : toAdd) { - if (!result.contains(t)) { - result.add(t); - } - } - } - } + if (toAdd != null) { + for (IActionInternal t : toAdd) { + if (!result.contains(t)) { + result.add(t); + } + } + } + } - return result; - } + return result; + } - public static List getInternalActions(IStatementContainer container) { - List result = new LinkedList(); + public static IStatementParameter createParameter(String kind) { + return createParameter(parameters.get(kind)); + } - for (IActionProvider provider : actionProviders) { - Collection toAdd = provider.getInternalActions(container); + private static IStatementParameter createParameter(Class param) { + try { + return param.newInstance(); + } catch (InstantiationException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } catch (Error error) { + BCLog.logErrorAPI(error, IStatementParameter.class); + throw error; + } - if (toAdd != null) { - for (IActionInternal t : toAdd) { - if (!result.contains(t)) { - result.add(t); - } - } - } - } + return null; + } - return result; - } - - public static IStatementParameter createParameter(String kind) { - return createParameter(parameters.get(kind)); - } - - private static IStatementParameter createParameter(Class param) { - try { - return param.newInstance(); - } catch (InstantiationException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - - return null; - } - - /** - * Generally, this function should be called by every mod implementing - * the Statements API ***as a container*** (that is, adding its own gates) - * on the client side from a given Item of choice. - */ - @SideOnly(Side.CLIENT) - public static void registerIcons(IIconRegister register) { - for (IStatement statement : statements.values()) { - statement.registerIcons(register); - } - - for (Class parameter : parameters.values()) { - createParameter(parameter).registerIcons(register); - } - } + // /** + // * Generally, this function should be called by every mod implementing + // * the Statements API ***as a container*** (that is, adding its own gates) + // * on the client side from a given Item of choice. + // */ + // @SideOnly(Side.CLIENT) + // public static void registerIcons(TextureAtlasSpriteRegister register) { + // for (IStatement statement : statements.values()) { + // statement.registerIcons(register); + // } + // + // for (Class parameter : parameters.values()) { + // createParameter(parameter).registerIcons(register); + // } + // } } diff --git a/src/api/java/buildcraft/api/statements/StatementMouseClick.java b/src/api/java/buildcraft/api/statements/StatementMouseClick.java index 54688ebb8..c39ed336f 100644 --- a/src/api/java/buildcraft/api/statements/StatementMouseClick.java +++ b/src/api/java/buildcraft/api/statements/StatementMouseClick.java @@ -1,27 +1,23 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.statements; public final class StatementMouseClick { - private int button; - private boolean shift; - - public StatementMouseClick(int button, boolean shift) { - this.button = button; - this.shift = shift; - } - - public boolean isShift() { - return shift; - } - - public int getButton() { - return button; - } + private int button; + private boolean shift; + + public StatementMouseClick(int button, boolean shift) { + this.button = button; + this.shift = shift; + } + + public boolean isShift() { + return shift; + } + + public int getButton() { + return button; + } } diff --git a/src/api/java/buildcraft/api/statements/StatementParameterItemStack.java b/src/api/java/buildcraft/api/statements/StatementParameterItemStack.java index 3bccda5d3..def3c36ac 100755 --- a/src/api/java/buildcraft/api/statements/StatementParameterItemStack.java +++ b/src/api/java/buildcraft/api/statements/StatementParameterItemStack.java @@ -1,88 +1,83 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.statements; -import net.minecraft.client.renderer.texture.IIconRegister; + +import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.IIcon; public class StatementParameterItemStack implements IStatementParameter { - - protected ItemStack stack; - @Override - public IIcon getIcon() { - return null; - } + protected ItemStack stack; - @Override - public ItemStack getItemStack() { - return stack; - } + @Override + public TextureAtlasSprite getIcon() { + return null; + } - @Override - public void onClick(IStatementContainer source, IStatement stmt, ItemStack stack, StatementMouseClick mouse) { - if (stack != null) { - this.stack = stack.copy(); - this.stack.stackSize = 1; - } else { - this.stack = null; - } - } + @Override + public ItemStack getItemStack() { + return stack; + } - @Override - public void writeToNBT(NBTTagCompound compound) { - if (stack != null) { - NBTTagCompound tagCompound = new NBTTagCompound(); - stack.writeToNBT(tagCompound); - compound.setTag("stack", tagCompound); - } - } + @Override + public void onClick(IStatementContainer source, IStatement stmt, ItemStack stack, StatementMouseClick mouse) { + if (stack != null) { + this.stack = stack.copy(); + this.stack.stackSize = 1; + } else { + this.stack = null; + } + } - @Override - public void readFromNBT(NBTTagCompound compound) { - stack = ItemStack.loadItemStackFromNBT(compound.getCompoundTag("stack")); - } + @Override + public void writeToNBT(NBTTagCompound compound) { + if (stack != null) { + NBTTagCompound tagCompound = new NBTTagCompound(); + stack.writeToNBT(tagCompound); + compound.setTag("stack", tagCompound); + } + } - @Override - public boolean equals(Object object) { - if (object instanceof StatementParameterItemStack) { - StatementParameterItemStack param = (StatementParameterItemStack) object; + @Override + public void readFromNBT(NBTTagCompound compound) { + stack = ItemStack.loadItemStackFromNBT(compound.getCompoundTag("stack")); + } - return ItemStack.areItemStacksEqual(stack, param.stack) - && ItemStack.areItemStackTagsEqual(stack, param.stack); - } else { - return false; - } - } + @Override + public boolean equals(Object object) { + if (object instanceof StatementParameterItemStack) { + StatementParameterItemStack param = (StatementParameterItemStack) object; - @Override - public String getDescription() { - if (stack != null) { - return stack.getDisplayName(); - } else { - return ""; - } - } + return ItemStack.areItemStacksEqual(stack, param.stack) && ItemStack.areItemStackTagsEqual(stack, param.stack); + } else { + return false; + } + } - @Override - public String getUniqueTag() { - return "buildcraft:stack"; - } + @Override + public String getDescription() { + if (stack != null) { + return stack.getDisplayName(); + } else { + return ""; + } + } - @Override - public void registerIcons(IIconRegister iconRegister) { - - } + @Override + public String getUniqueTag() { + return "buildcraft:stack"; + } - @Override - public IStatementParameter rotateLeft() { - return this; - } + // @Override + // public void registerIcons(TextureAtlasSpriteRegister iconRegister) { + // + // } + + @Override + public IStatementParameter rotateLeft() { + return this; + } } diff --git a/src/api/java/buildcraft/api/statements/StatementSlot.java b/src/api/java/buildcraft/api/statements/StatementSlot.java old mode 100644 new mode 100755 index 6d8c1c2ce..11d5441fe --- a/src/api/java/buildcraft/api/statements/StatementSlot.java +++ b/src/api/java/buildcraft/api/statements/StatementSlot.java @@ -1,36 +1,32 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ + * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents + * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ package buildcraft.api.statements; public class StatementSlot { - public IStatement statement; - public IStatementParameter[] parameters; + public IStatement statement; + public IStatementParameter[] parameters; - @Override - public boolean equals(Object o) { - if (o == null || !(o instanceof StatementSlot)) { - return false; - } - StatementSlot s = (StatementSlot) o; - if (s.statement != statement || parameters.length != s.parameters.length) { - return false; - } - for (int i = 0; i < parameters.length; i++) { - IStatementParameter p1 = parameters[i]; - IStatementParameter p2 = s.parameters[i]; - if (p1 == null && p2 != null) { - return false; - } - if (!(p1.equals(p2))) { - return false; - } - } - return true; - } + @Override + public boolean equals(Object o) { + if (o == null || !(o instanceof StatementSlot)) { + return false; + } + StatementSlot s = (StatementSlot) o; + if (s.statement != statement || parameters.length != s.parameters.length) { + return false; + } + for (int i = 0; i < parameters.length; i++) { + IStatementParameter p1 = parameters[i]; + IStatementParameter p2 = s.parameters[i]; + if (p1 == null && p2 != null) { + return false; + } + if (!(p1.equals(p2))) { + return false; + } + } + return true; + } } diff --git a/src/api/java/buildcraft/api/statements/containers/IRedstoneStatementContainer.java b/src/api/java/buildcraft/api/statements/containers/IRedstoneStatementContainer.java index 0856041cb..5b34bfd94 100644 --- a/src/api/java/buildcraft/api/statements/containers/IRedstoneStatementContainer.java +++ b/src/api/java/buildcraft/api/statements/containers/IRedstoneStatementContainer.java @@ -1,19 +1,17 @@ package buildcraft.api.statements.containers; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.util.EnumFacing; public interface IRedstoneStatementContainer { - /** - * Get the redstone input from a given side. - * @param side The side - use "UNKNOWN" for maximum input. - * @return The redstone input, from 0 to 15. - */ - int getRedstoneInput(ForgeDirection side); + /** Get the redstone input from a given side. + * + * @param side The side - use "UNKNOWN" for maximum input. + * @return The redstone input, from 0 to 15. */ + int getRedstoneInput(EnumFacing side); - /** - * Set the redstone input for a given side. - * @param side The side - use "UNKNOWN" for all sides. - * @return Whether the set was successful. - */ - boolean setRedstoneOutput(ForgeDirection side, int value); + /** Set the redstone input for a given side. + * + * @param side The side - use "UNKNOWN" for all sides. + * @return Whether the set was successful. */ + boolean setRedstoneOutput(EnumFacing side, int value); } diff --git a/src/api/java/buildcraft/api/statements/containers/ISidedStatementContainer.java b/src/api/java/buildcraft/api/statements/containers/ISidedStatementContainer.java index 6262bf2f8..b65ace45a 100644 --- a/src/api/java/buildcraft/api/statements/containers/ISidedStatementContainer.java +++ b/src/api/java/buildcraft/api/statements/containers/ISidedStatementContainer.java @@ -1,12 +1,10 @@ package buildcraft.api.statements.containers; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.util.EnumFacing; import buildcraft.api.statements.IStatementContainer; -/** - * Created by asie on 3/14/15. - */ +/** Created by asie on 3/14/15. */ public interface ISidedStatementContainer extends IStatementContainer { - ForgeDirection getSide(); + EnumFacing getSide(); } diff --git a/src/api/java/buildcraft/api/statements/package-info.java b/src/api/java/buildcraft/api/statements/package-info.java index ed7613ea2..7dd2c74e6 100644 --- a/src/api/java/buildcraft/api/statements/package-info.java +++ b/src/api/java/buildcraft/api/statements/package-info.java @@ -1,12 +1,8 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ @API(apiVersion = "1.1", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|statements") package buildcraft.api.statements; -import cpw.mods.fml.common.API; +import net.minecraftforge.fml.common.API; diff --git a/src/api/java/buildcraft/api/transport/ICustomPipeConnection.java b/src/api/java/buildcraft/api/transport/ICustomPipeConnection.java new file mode 100644 index 000000000..37c44f6b9 --- /dev/null +++ b/src/api/java/buildcraft/api/transport/ICustomPipeConnection.java @@ -0,0 +1,12 @@ +package buildcraft.api.transport; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public interface ICustomPipeConnection { + /** @return How long the connecting pipe should extend for. Values less than -4/16 indicate that the pipe will not + * connect at all, and will render as it it was not connected. */ + public float getExtension(World world, BlockPos pos, EnumFacing face, IBlockState state); +} diff --git a/src/api/java/buildcraft/api/transport/IInjectable.java b/src/api/java/buildcraft/api/transport/IInjectable.java index 6a05a688a..0de9e2005 100644 --- a/src/api/java/buildcraft/api/transport/IInjectable.java +++ b/src/api/java/buildcraft/api/transport/IInjectable.java @@ -1,23 +1,18 @@ package buildcraft.api.transport; +import net.minecraft.item.EnumDyeColor; import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; - -import buildcraft.api.core.EnumColor; +import net.minecraft.util.EnumFacing; public interface IInjectable { - boolean canInjectItems(ForgeDirection from); + boolean canInjectItems(EnumFacing from); - /** - * Offers an ItemStack for 3addition to the pipe. Will be rejected if the - * pipe doesn't accept items from that side. - * - * @param stack ItemStack offered for addition. Do not manipulate this! - * @param doAdd If false no actual addition should take place. Implementors - * should simulate. - * @param from Orientation the ItemStack is offered from. - * @param color The color of the item to be added to the pipe, or null for no color. - * @return Amount of items used from the passed stack. - */ - int injectItem(ItemStack stack, boolean doAdd, ForgeDirection from, EnumColor color); + /** Offers an ItemStack for 3addition to the pipe. Will be rejected if the pipe doesn't accept items from that side. + * + * @param stack ItemStack offered for addition. Do not manipulate this! + * @param doAdd If false no actual addition should take place. Implementors should simulate. + * @param from Orientation the ItemStack is offered from. + * @param color The color of the item to be added to the pipe, or null for no color. + * @return Amount of items used from the passed stack. */ + int injectItem(ItemStack stack, boolean doAdd, EnumFacing from, EnumDyeColor color); } diff --git a/src/api/java/buildcraft/api/transport/IItemPipe.java b/src/api/java/buildcraft/api/transport/IItemPipe.java index f5f766775..c943a81a6 100644 --- a/src/api/java/buildcraft/api/transport/IItemPipe.java +++ b/src/api/java/buildcraft/api/transport/IItemPipe.java @@ -1,16 +1,11 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ + * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents + * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ package buildcraft.api.transport; -/** - * To be implemented by the real item pipe in Transport mod, but leaves knowledge for classes that do not have direct dependency on transport. - */ +/** To be implemented by the real item pipe in Transport mod, but leaves knowledge for classes that do not have direct + * dependency on transport. */ public interface IItemPipe { } diff --git a/src/api/java/buildcraft/api/transport/IPipe.java b/src/api/java/buildcraft/api/transport/IPipe.java index 94b021d02..96a7a764c 100755 --- a/src/api/java/buildcraft/api/transport/IPipe.java +++ b/src/api/java/buildcraft/api/transport/IPipe.java @@ -1,25 +1,21 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.transport; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.util.EnumFacing; import buildcraft.api.gates.IGate; public interface IPipe { - IPipeTile getTile(); + IPipeTile getTile(); - IGate getGate(ForgeDirection side); - - boolean hasGate(ForgeDirection side); - - boolean isWired(PipeWire wire); - - boolean isWireActive(PipeWire wire); + IGate getGate(EnumFacing side); + + boolean hasGate(EnumFacing side); + + boolean isWired(PipeWire wire); + + boolean isWireActive(PipeWire wire); } diff --git a/src/api/java/buildcraft/api/transport/IPipeConnection.java b/src/api/java/buildcraft/api/transport/IPipeConnection.java index 4899f24bd..0b25ec818 100644 --- a/src/api/java/buildcraft/api/transport/IPipeConnection.java +++ b/src/api/java/buildcraft/api/transport/IPipeConnection.java @@ -1,29 +1,24 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.transport; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.util.EnumFacing; public interface IPipeConnection { - enum ConnectOverride { + enum ConnectOverride { - CONNECT, DISCONNECT, DEFAULT - } + CONNECT, + DISCONNECT, + DEFAULT + } - /** - * Allows you to override pipe connection logic. - * - * @param type - * @param with - * @return CONNECT to force a connection, DISCONNECT to force no connection, - * and DEFAULT to let the pipe decide. - */ - ConnectOverride overridePipeConnection(IPipeTile.PipeType type, ForgeDirection with); + /** Allows you to override pipe connection logic. + * + * @param type + * @param with + * @return CONNECT to force a connection, DISCONNECT to force no connection, and DEFAULT to let the pipe decide. */ + ConnectOverride overridePipeConnection(IPipeTile.PipeType type, EnumFacing with); } diff --git a/src/api/java/buildcraft/api/transport/IPipeTile.java b/src/api/java/buildcraft/api/transport/IPipeTile.java index 1bdd04f09..5ed528422 100644 --- a/src/api/java/buildcraft/api/transport/IPipeTile.java +++ b/src/api/java/buildcraft/api/transport/IPipeTile.java @@ -1,62 +1,51 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.transport; import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumFacing; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import buildcraft.api.core.EnumColor; import buildcraft.api.transport.pluggable.PipePluggable; public interface IPipeTile extends IInjectable { - enum PipeType { - ITEM, FLUID, POWER, STRUCTURE - } + enum PipeType { + ITEM, + FLUID, + POWER, + STRUCTURE + } - PipeType getPipeType(); + PipeType getPipeType(); - World getWorld(); + World getWorldBC(); - int x(); + /** True if the pipe is connected to the block/pipe in the specific direction + * + * @param with + * @return true if connect */ + boolean isPipeConnected(EnumFacing with); - int y(); + Block getNeighborBlock(EnumFacing dir); - int z(); + TileEntity getNeighborTile(EnumFacing dir); - /** - * True if the pipe is connected to the block/pipe in the specific direction - * - * @param with - * @return true if connect - */ - boolean isPipeConnected(ForgeDirection with); + IPipe getNeighborPipe(EnumFacing dir); - Block getNeighborBlock(ForgeDirection dir); - TileEntity getNeighborTile(ForgeDirection dir); - IPipe getNeighborPipe(ForgeDirection dir); - - IPipe getPipe(); - int getPipeColor(); + IPipe getPipe(); - PipePluggable getPipePluggable(ForgeDirection direction); // Now in IPluggableProvider - boolean hasPipePluggable(ForgeDirection direction); // Now in IPluggableProvider - boolean hasBlockingPluggable(ForgeDirection direction); + int getPipeColor(); - void scheduleNeighborChange(); - void scheduleRenderUpdate(); + PipePluggable getPipePluggable(EnumFacing direction); // Now in IPluggableProvider - // For compatibility with BC 6.2.x and below - int injectItem(ItemStack stack, boolean doAdd, ForgeDirection from, EnumColor color); + boolean hasPipePluggable(EnumFacing direction); // Now in IPluggableProvider - @Deprecated // Now in IInjectable - int injectItem(ItemStack stack, boolean doAdd, ForgeDirection from); + boolean hasBlockingPluggable(EnumFacing direction); + + void scheduleNeighborChange(); + + void scheduleRenderUpdate(); } diff --git a/src/api/java/buildcraft/api/transport/IStripesActivator.java b/src/api/java/buildcraft/api/transport/IStripesActivator.java index 47308ae0a..540346d7b 100644 --- a/src/api/java/buildcraft/api/transport/IStripesActivator.java +++ b/src/api/java/buildcraft/api/transport/IStripesActivator.java @@ -1,17 +1,14 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.transport; import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.util.EnumFacing; public interface IStripesActivator { - void sendItem(ItemStack itemStack, ForgeDirection direction); - void dropItem(ItemStack itemStack, ForgeDirection direction); + void sendItem(ItemStack itemStack, EnumFacing direction); + + void dropItem(ItemStack itemStack, EnumFacing direction); } diff --git a/src/api/java/buildcraft/api/transport/IStripesHandler.java b/src/api/java/buildcraft/api/transport/IStripesHandler.java index a9cc011f6..d96b78e44 100644 --- a/src/api/java/buildcraft/api/transport/IStripesHandler.java +++ b/src/api/java/buildcraft/api/transport/IStripesHandler.java @@ -1,28 +1,24 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.transport; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.EnumFacing; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; public interface IStripesHandler { - enum StripesHandlerType { - ITEM_USE, - BLOCK_BREAK - } - - StripesHandlerType getType(); - - boolean shouldHandle(ItemStack stack); - - boolean handle(World world, int x, int y, int z, ForgeDirection direction, - ItemStack stack, EntityPlayer player, IStripesActivator activator); + enum StripesHandlerType { + ITEM_USE, + BLOCK_BREAK + } + + StripesHandlerType getType(); + + boolean shouldHandle(ItemStack stack); + + boolean handle(World world, BlockPos pos, EnumFacing direction, ItemStack stack, EntityPlayer player, IStripesActivator activator); } diff --git a/src/api/java/buildcraft/api/transport/IStripesPipe.java b/src/api/java/buildcraft/api/transport/IStripesPipe.java index 30a8452d5..569c53954 100644 --- a/src/api/java/buildcraft/api/transport/IStripesPipe.java +++ b/src/api/java/buildcraft/api/transport/IStripesPipe.java @@ -1,12 +1,9 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.transport; -public interface IStripesPipe extends IPipe, IStripesActivator { -} +import cofh.api.energy.IEnergyHandler; + +public interface IStripesPipe extends IPipe, IStripesActivator, IEnergyHandler {} diff --git a/src/api/java/buildcraft/api/transport/PipeConnectionAPI.java b/src/api/java/buildcraft/api/transport/PipeConnectionAPI.java new file mode 100644 index 000000000..28f497243 --- /dev/null +++ b/src/api/java/buildcraft/api/transport/PipeConnectionAPI.java @@ -0,0 +1,48 @@ +package buildcraft.api.transport; + +import java.util.Map; + +import com.google.common.collect.Maps; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +/** Use this class to register blocks with custom block sizes so that pipes can connect to them properly. Note that you + * do not need to register a custom pipe connection if your block implements ICustomPipeConnection. The registered + * version does not override your own implementation. */ +public final class PipeConnectionAPI { + private static final Map connections = Maps.newHashMap(); + private static final ICustomPipeConnection NOTHING = new ICustomPipeConnection() { + @Override + public float getExtension(World world, BlockPos pos, EnumFacing face, IBlockState state) { + return 0; + } + }; + + /** Register a block with a custom connection. Useful if you don't own the block class or are adding it for some-one + * + * @param block The block instance + * @param connection The connection instance */ + public static void registerConnection(Block block, ICustomPipeConnection connection) { + connections.put(block, connection); + } + + public static void registerConnectionAsNothing(Block block) { + connections.put(block, NOTHING); + } + + /** Gets the current custom connection that the block uses. Will be null if nothing has been set. */ + public static ICustomPipeConnection getCustomConnection(Block block) { + if (block instanceof ICustomPipeConnection) { + return (ICustomPipeConnection) block; + } + ICustomPipeConnection connection = connections.get(block); + if (connection != null) { + return connection; + } + return null; + } +} diff --git a/src/api/java/buildcraft/api/transport/PipeManager.java b/src/api/java/buildcraft/api/transport/PipeManager.java index 896f08210..81030e638 100755 --- a/src/api/java/buildcraft/api/transport/PipeManager.java +++ b/src/api/java/buildcraft/api/transport/PipeManager.java @@ -1,11 +1,7 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.transport; import java.util.ArrayList; @@ -15,64 +11,61 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import buildcraft.api.transport.pluggable.PipePluggable; public abstract class PipeManager { - public static List stripesHandlers = new ArrayList(); - public static ArrayList> pipePluggables = new ArrayList>(); - private static Map> pipePluggableNames = - new HashMap>(); - private static Map, String> pipePluggableByNames = - new HashMap, String>(); - private static Map stripesHandlerPriorities = - new HashMap(); + public static List stripesHandlers = new ArrayList(); + public static ArrayList> pipePluggables = new ArrayList>(); + private static Map> pipePluggableNames = new HashMap>(); + private static Map, String> pipePluggableByNames = new HashMap, String>(); + private static Map stripesHandlerPriorities = new HashMap(); - @Deprecated - public static boolean canExtractItems(Object extractor, World world, int i, int j, int k) { - return true; - } + @Deprecated + public static boolean canExtractItems(Object extractor, World world, BlockPos pos) { + return true; + } - @Deprecated - public static boolean canExtractFluids(Object extractor, World world, int i, int j, int k) { - return true; - } + @Deprecated + public static boolean canExtractFluids(Object extractor, World world, BlockPos pos) { + return true; + } - @Deprecated - public static void registerStripesHandler(IStripesHandler handler) { - registerStripesHandler(handler, 0); - } + @Deprecated + public static void registerStripesHandler(IStripesHandler handler) { + registerStripesHandler(handler, 0); + } - /** - * Register a Stripes Pipe handler. - * @param handler The handler. - * @param priority The priority - 0 is normal, higher numbers have higher priority. - */ - public static void registerStripesHandler(IStripesHandler handler, int priority) { - stripesHandlers.add(handler); - stripesHandlerPriorities.put(handler, priority); + /** Register a Stripes Pipe handler. + * + * @param handler The handler. + * @param priority The priority - 0 is normal, higher numbers have higher priority. */ + public static void registerStripesHandler(IStripesHandler handler, int priority) { + stripesHandlers.add(handler); + stripesHandlerPriorities.put(handler, priority); - Collections.sort(stripesHandlers, new Comparator() { - @Override - public int compare(IStripesHandler o1, IStripesHandler o2) { - return stripesHandlerPriorities.get(o2) - stripesHandlerPriorities.get(o1); - } - }); - } + Collections.sort(stripesHandlers, new Comparator() { + @Override + public int compare(IStripesHandler o1, IStripesHandler o2) { + return stripesHandlerPriorities.get(o2) - stripesHandlerPriorities.get(o1); + } + }); + } - public static void registerPipePluggable(Class pluggable, String name) { - pipePluggables.add(pluggable); - pipePluggableNames.put(name, pluggable); - pipePluggableByNames.put(pluggable, name); - } + public static void registerPipePluggable(Class pluggable, String name) { + pipePluggables.add(pluggable); + pipePluggableNames.put(name, pluggable); + pipePluggableByNames.put(pluggable, name); + } - public static Class getPluggableByName(String pluggableName) { - return pipePluggableNames.get(pluggableName); - } + public static Class getPluggableByName(String pluggableName) { + return pipePluggableNames.get(pluggableName); + } - public static String getPluggableName(Class aClass) { - return pipePluggableByNames.get(aClass); - } + public static String getPluggableName(Class aClass) { + return pipePluggableByNames.get(aClass); + } } diff --git a/src/api/java/buildcraft/api/transport/PipeWire.java b/src/api/java/buildcraft/api/transport/PipeWire.java index eb8665e15..5864db9c3 100644 --- a/src/api/java/buildcraft/api/transport/PipeWire.java +++ b/src/api/java/buildcraft/api/transport/PipeWire.java @@ -1,11 +1,7 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.transport; import java.util.Locale; @@ -15,60 +11,63 @@ import net.minecraft.item.ItemStack; public enum PipeWire { - RED, BLUE, GREEN, YELLOW; - public static Item item; - public static final PipeWire[] VALUES = values(); + RED, + BLUE, + GREEN, + YELLOW; + public static Item item; + public static final PipeWire[] VALUES = values(); - public PipeWire reverse() { - switch (this) { - case RED: - return YELLOW; - case BLUE: - return GREEN; - case GREEN: - return BLUE; - default: - return RED; - } - } + public PipeWire reverse() { + switch (this) { + case RED: + return YELLOW; + case BLUE: + return GREEN; + case GREEN: + return BLUE; + default: + return RED; + } + } - public String getTag() { - return name().toLowerCase(Locale.ENGLISH) + "PipeWire"; - } + public String getTag() { + return name().toLowerCase(Locale.ENGLISH) + "PipeWire"; + } - public String getColor() { - String name = this.toString().toLowerCase(Locale.ENGLISH); - char first = Character.toUpperCase(name.charAt(0)); - return first + name.substring(1); - } + public String getColor() { + String name = this.toString().toLowerCase(Locale.ENGLISH); + char first = Character.toUpperCase(name.charAt(0)); + return first + name.substring(1); + } - public ItemStack getStack() { - return getStack(1); - } + public ItemStack getStack() { + return getStack(1); + } - public ItemStack getStack(int qty) { - if (item == null) { - return null; - } else { - return new ItemStack(item, qty, ordinal()); - } - } + public ItemStack getStack(int qty) { + if (item == null) { + return null; + } else { + return new ItemStack(item, qty, ordinal()); + } + } - public boolean isPipeWire(ItemStack stack) { - if (stack == null) { - return false; - } else if (stack.getItem() != item) { - return false; - } else { - return stack.getItemDamage() == ordinal(); - } - } + public boolean isPipeWire(ItemStack stack) { + if (stack == null) { + return false; + } else if (stack.getItem() != item) { + return false; + } else { + return stack.getItemDamage() == ordinal(); + } + } - public static PipeWire fromOrdinal(int ordinal) { - if (ordinal < 0 || ordinal >= VALUES.length) { - return RED; - } else { - return VALUES[ordinal]; - } - } + public static PipeWire fromOrdinal(int ordinal) { + if (ordinal < 0 || ordinal >= VALUES.length) { + return RED; + } else { + return VALUES[ordinal]; + } + } } diff --git a/src/api/java/buildcraft/api/transport/package-info.java b/src/api/java/buildcraft/api/transport/package-info.java index b670143c6..7ab0064d3 100644 --- a/src/api/java/buildcraft/api/transport/package-info.java +++ b/src/api/java/buildcraft/api/transport/package-info.java @@ -1,12 +1,8 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ @API(apiVersion = "4.1", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|transport") package buildcraft.api.transport; -import cpw.mods.fml.common.API; +import net.minecraftforge.fml.common.API; diff --git a/src/api/java/buildcraft/api/transport/pluggable/IConnectionMatrix.java b/src/api/java/buildcraft/api/transport/pluggable/IConnectionMatrix.java new file mode 100644 index 000000000..4bede4d03 --- /dev/null +++ b/src/api/java/buildcraft/api/transport/pluggable/IConnectionMatrix.java @@ -0,0 +1,7 @@ +package buildcraft.api.transport.pluggable; + +import net.minecraft.util.EnumFacing; + +public interface IConnectionMatrix { + boolean isConnected(EnumFacing face); +} diff --git a/src/api/java/buildcraft/api/transport/pluggable/IFacadePluggable.java b/src/api/java/buildcraft/api/transport/pluggable/IFacadePluggable.java index 6289714ac..a3ad9f329 100644 --- a/src/api/java/buildcraft/api/transport/pluggable/IFacadePluggable.java +++ b/src/api/java/buildcraft/api/transport/pluggable/IFacadePluggable.java @@ -1,13 +1,11 @@ package buildcraft.api.transport.pluggable; -import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; public interface IFacadePluggable { - Block getCurrentBlock(); + IBlockState getCurrentState(); - int getCurrentMetadata(); + boolean isTransparent(); - boolean isTransparent(); - - boolean isHollow(); + boolean isHollow(); } diff --git a/src/api/java/buildcraft/api/transport/pluggable/IPipePluggableDynamicRenderer.java b/src/api/java/buildcraft/api/transport/pluggable/IPipePluggableDynamicRenderer.java index 614c65ff9..2601a356d 100644 --- a/src/api/java/buildcraft/api/transport/pluggable/IPipePluggableDynamicRenderer.java +++ b/src/api/java/buildcraft/api/transport/pluggable/IPipePluggableDynamicRenderer.java @@ -1,9 +1,9 @@ package buildcraft.api.transport.pluggable; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.util.EnumFacing; import buildcraft.api.transport.IPipe; public interface IPipePluggableDynamicRenderer { - void renderPluggable(IPipe pipe, ForgeDirection side, PipePluggable pipePluggable, double x, double y, double z); + void renderDynamicPluggable(IPipe pipe, EnumFacing side, PipePluggable pipePluggable, double x, double y, double z); } diff --git a/src/api/java/buildcraft/api/transport/pluggable/IPipePluggableItem.java b/src/api/java/buildcraft/api/transport/pluggable/IPipePluggableItem.java index 0ac208905..b9295e5f0 100644 --- a/src/api/java/buildcraft/api/transport/pluggable/IPipePluggableItem.java +++ b/src/api/java/buildcraft/api/transport/pluggable/IPipePluggableItem.java @@ -1,10 +1,10 @@ package buildcraft.api.transport.pluggable; import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.util.EnumFacing; import buildcraft.api.transport.IPipe; public interface IPipePluggableItem { - PipePluggable createPipePluggable(IPipe pipe, ForgeDirection side, ItemStack stack); + PipePluggable createPipePluggable(IPipe pipe, EnumFacing side, ItemStack stack); } diff --git a/src/api/java/buildcraft/api/transport/pluggable/IPipePluggableRenderer.java b/src/api/java/buildcraft/api/transport/pluggable/IPipePluggableRenderer.java deleted file mode 100644 index 2cd4bc276..000000000 --- a/src/api/java/buildcraft/api/transport/pluggable/IPipePluggableRenderer.java +++ /dev/null @@ -1,13 +0,0 @@ -package buildcraft.api.transport.pluggable; - -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraftforge.common.util.ForgeDirection; - -import buildcraft.api.core.render.ITextureStates; -import buildcraft.api.transport.IPipe; - -public interface IPipePluggableRenderer { - void renderPluggable(RenderBlocks renderblocks, IPipe pipe, ForgeDirection side, - PipePluggable pipePluggable, ITextureStates blockStateMachine, - int renderPass, int x, int y, int z); -} diff --git a/src/api/java/buildcraft/api/transport/pluggable/IPipePluggableState.java b/src/api/java/buildcraft/api/transport/pluggable/IPipePluggableState.java new file mode 100644 index 000000000..7b657dfd0 --- /dev/null +++ b/src/api/java/buildcraft/api/transport/pluggable/IPipePluggableState.java @@ -0,0 +1,9 @@ +package buildcraft.api.transport.pluggable; + +import net.minecraft.util.EnumFacing; + +public interface IPipePluggableState { + IConnectionMatrix getPluggableConnections(); + + PipePluggable getPluggable(EnumFacing face); +} diff --git a/src/api/java/buildcraft/api/transport/pluggable/IPipePluggableStaticRenderer.java b/src/api/java/buildcraft/api/transport/pluggable/IPipePluggableStaticRenderer.java new file mode 100644 index 000000000..e4bfc3f60 --- /dev/null +++ b/src/api/java/buildcraft/api/transport/pluggable/IPipePluggableStaticRenderer.java @@ -0,0 +1,19 @@ +package buildcraft.api.transport.pluggable; + +import java.util.List; + +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.util.EnumFacing; + +import buildcraft.api.transport.IPipe; + +public interface IPipePluggableStaticRenderer { + List bakeCutout(IPipeRenderState render, IPipePluggableState pluggableState, IPipe pipe, PipePluggable pluggable, EnumFacing face); + + /** Use this if you need to render in the translucent pass. */ + public interface Translucent extends IPipePluggableStaticRenderer { + /** For performance return a list that is as small as possible */ + List bakeTranslucent(IPipeRenderState render, IPipePluggableState pluggableState, IPipe pipe, PipePluggable pluggable, + EnumFacing face); + } +} diff --git a/src/api/java/buildcraft/api/transport/pluggable/IPipeRenderState.java b/src/api/java/buildcraft/api/transport/pluggable/IPipeRenderState.java new file mode 100644 index 000000000..d923061fd --- /dev/null +++ b/src/api/java/buildcraft/api/transport/pluggable/IPipeRenderState.java @@ -0,0 +1,5 @@ +package buildcraft.api.transport.pluggable; + +public interface IPipeRenderState { + IConnectionMatrix getPipeConnectionMatrix(); +} diff --git a/src/api/java/buildcraft/api/transport/pluggable/PipePluggable.java b/src/api/java/buildcraft/api/transport/pluggable/PipePluggable.java old mode 100644 new mode 100755 index 223ce7096..0a944e389 --- a/src/api/java/buildcraft/api/transport/pluggable/PipePluggable.java +++ b/src/api/java/buildcraft/api/transport/pluggable/PipePluggable.java @@ -1,67 +1,60 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com +/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * - * The BuildCraft API is distributed under the terms of the MIT License. - * Please check the contents of the license, which should be located - * as "LICENSE.API" in the BuildCraft source code distribution. - */ + * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which + * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ package buildcraft.api.transport.pluggable; import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.EnumFacing; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import buildcraft.api.core.INBTStoreable; import buildcraft.api.core.ISerializable; import buildcraft.api.transport.IPipeTile; -/** - * An IPipePluggable MUST have an empty constructor for client-side - * rendering! - */ +/** An IPipePluggable MUST have an empty constructor for client-side rendering! */ public abstract class PipePluggable implements INBTStoreable, ISerializable { - public abstract ItemStack[] getDropItems(IPipeTile pipe); + public abstract ItemStack[] getDropItems(IPipeTile pipe); - public void update(IPipeTile pipe, ForgeDirection direction) { + public void update(IPipeTile pipe, EnumFacing direction) { - } + } - public void onAttachedPipe(IPipeTile pipe, ForgeDirection direction) { - validate(pipe, direction); - } + public void onAttachedPipe(IPipeTile pipe, EnumFacing direction) { + validate(pipe, direction); + } - public void onDetachedPipe(IPipeTile pipe, ForgeDirection direction) { - invalidate(); - } + public void onDetachedPipe(IPipeTile pipe, EnumFacing direction) { + invalidate(); + } - public abstract boolean isBlocking(IPipeTile pipe, ForgeDirection direction); + public abstract boolean isBlocking(IPipeTile pipe, EnumFacing direction); - public void invalidate() { + public void invalidate() { - } + } - public void validate(IPipeTile pipe, ForgeDirection direction) { + public void validate(IPipeTile pipe, EnumFacing direction) { - } + } - public boolean isSolidOnSide(IPipeTile pipe, ForgeDirection direction) { - return false; - } + public boolean isSolidOnSide(IPipeTile pipe, EnumFacing direction) { + return false; + } - public abstract AxisAlignedBB getBoundingBox(ForgeDirection side); + public abstract AxisAlignedBB getBoundingBox(EnumFacing side); - @SideOnly(Side.CLIENT) - public abstract IPipePluggableRenderer getRenderer(); + @SideOnly(Side.CLIENT) + public abstract IPipePluggableStaticRenderer getRenderer(); - @SideOnly(Side.CLIENT) - public IPipePluggableDynamicRenderer getDynamicRenderer() { - return null; - } + @SideOnly(Side.CLIENT) + public IPipePluggableDynamicRenderer getDynamicRenderer() { + return null; + } - public boolean requiresRenderUpdate(PipePluggable old) { - return true; - } + public boolean requiresRenderUpdate(PipePluggable old) { + return true; + } } diff --git a/src/api/java/cofh/api/energy/IEnergyConnection.java b/src/api/java/cofh/api/energy/IEnergyConnection.java index fd2968537..29ef0a1ce 100644 --- a/src/api/java/cofh/api/energy/IEnergyConnection.java +++ b/src/api/java/cofh/api/energy/IEnergyConnection.java @@ -1,21 +1,22 @@ package cofh.api.energy; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.util.EnumFacing; + /** * Implement this interface on TileEntities which should connect to energy transportation blocks. This is intended for blocks which generate energy but do not * accept it; otherwise just use IEnergyHandler. - * + *

* Note that {@link IEnergyHandler} is an extension of this. - * + * * @author King Lemming - * + * */ public interface IEnergyConnection { /** * Returns TRUE if the TileEntity can connect on a given side. */ - boolean canConnectEnergy(ForgeDirection from); + boolean canConnectEnergy(EnumFacing from); -} \ No newline at end of file +} diff --git a/src/api/java/cofh/api/energy/IEnergyHandler.java b/src/api/java/cofh/api/energy/IEnergyHandler.java new file mode 100644 index 000000000..16b236e7a --- /dev/null +++ b/src/api/java/cofh/api/energy/IEnergyHandler.java @@ -0,0 +1,27 @@ +package cofh.api.energy; + +import net.minecraft.util.EnumFacing; + +/** + * Implement this interface on Tile Entities which should handle energy, generally storing it in one or more internal {@link IEnergyStorage} objects. + *

+ * A reference implementation is provided {@link TileEnergyHandler}. + *

+ * Note that {@link IEnergyReceiver} and {@link IEnergyProvider} are extensions of this. + * + * @author King Lemming + * + */ +public interface IEnergyHandler extends IEnergyConnection { + + /** + * Returns the amount of energy currently stored. + */ + int getEnergyStored(EnumFacing from); + + /** + * Returns the maximum amount of energy that can be stored. + */ + int getMaxEnergyStored(EnumFacing from); + +} diff --git a/src/api/java/cofh/api/energy/IEnergyProvider.java b/src/api/java/cofh/api/energy/IEnergyProvider.java new file mode 100644 index 000000000..ef0e09d06 --- /dev/null +++ b/src/api/java/cofh/api/energy/IEnergyProvider.java @@ -0,0 +1,29 @@ +package cofh.api.energy; + +import net.minecraft.util.EnumFacing; + + +/** + * Implement this interface on Tile Entities which should provide energy, generally storing it in one or more internal {@link IEnergyStorage} objects. + *

+ * A reference implementation is provided {@link TileEnergyHandler}. + * + * @author King Lemming + * + */ +public interface IEnergyProvider extends IEnergyHandler { + + /** + * Remove energy from an IEnergyProvider, internal distribution is left entirely to the IEnergyProvider. + * + * @param from + * Orientation the energy is extracted from. + * @param maxExtract + * Maximum amount of energy to extract. + * @param simulate + * If TRUE, the extraction will only be simulated. + * @return Amount of energy that was (or would have been, if simulated) extracted. + */ + int extractEnergy(EnumFacing from, int maxExtract, boolean simulate); + +} diff --git a/src/api/java/cofh/api/energy/IEnergyReceiver.java b/src/api/java/cofh/api/energy/IEnergyReceiver.java index a048056b8..989e9baa5 100644 --- a/src/api/java/cofh/api/energy/IEnergyReceiver.java +++ b/src/api/java/cofh/api/energy/IEnergyReceiver.java @@ -1,38 +1,29 @@ -package cofh.api.energy; - -import net.minecraftforge.common.util.ForgeDirection; - -/** - * Implement this interface on Tile Entities which should receive energy, generally storing it in one or more internal {@link IEnergyStorage} objects. - *

- * A reference implementation is provided {@link TileEnergyHandler}. - * - * @author King Lemming - * - */ -public interface IEnergyReceiver extends IEnergyConnection { - - /** - * Add energy to an IEnergyReceiver, internal distribution is left entirely to the IEnergyReceiver. - * - * @param from - * Orientation the energy is received from. - * @param maxReceive - * Maximum amount of energy to receive. - * @param simulate - * If TRUE, the charge will only be simulated. - * @return Amount of energy that was (or would have been, if simulated) received. - */ - int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate); - - /** - * Returns the amount of energy currently stored. - */ - int getEnergyStored(ForgeDirection from); - - /** - * Returns the maximum amount of energy that can be stored. - */ - int getMaxEnergyStored(ForgeDirection from); - -} +package cofh.api.energy; + +import net.minecraft.util.EnumFacing; + + +/** + * Implement this interface on Tile Entities which should receive energy, generally storing it in one or more internal {@link IEnergyStorage} objects. + *

+ * A reference implementation is provided {@link TileEnergyHandler}. + * + * @author King Lemming + * + */ +public interface IEnergyReceiver extends IEnergyHandler { + + /** + * Add energy to an IEnergyReceiver, internal distribution is left entirely to the IEnergyReceiver. + * + * @param from + * Orientation the energy is received from. + * @param maxReceive + * Maximum amount of energy to receive. + * @param simulate + * If TRUE, the charge will only be simulated. + * @return Amount of energy that was (or would have been, if simulated) received. + */ + int receiveEnergy(EnumFacing from, int maxReceive, boolean simulate); + +} diff --git a/src/api/java/thaumcraft/api/crafting/IInfusionStabiliser.java b/src/api/java/thaumcraft/api/crafting/IInfusionStabiliser.java index 768b25ffc..79d597d9f 100644 --- a/src/api/java/thaumcraft/api/crafting/IInfusionStabiliser.java +++ b/src/api/java/thaumcraft/api/crafting/IInfusionStabiliser.java @@ -1,19 +1,20 @@ -package thaumcraft.api.crafting; - -import net.minecraft.world.World; - -/** - * - * @author Azanor - * - * Blocks that implement this interface act as infusion crafting stabilisers like candles and skulls - * - */ -public interface IInfusionStabiliser { - - /** - * returns true if the block can stabilise things - */ - public boolean canStabaliseInfusion(World world, int x, int y, int z); - -} \ No newline at end of file +package thaumcraft.api.crafting; + +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +/** + * + * @author Azanor + * + * Blocks that implement this interface act as infusion crafting stabilisers like candles and skulls + * + */ +public interface IInfusionStabiliser { + + /** + * returns true if the block can stabilise things + */ + public boolean canStabaliseInfusion(World world, BlockPos pos); + +} diff --git a/src/api/java/thaumcraft/api/IGoggles.java b/src/api/java/thaumcraft/api/items/IGoggles.java similarity index 73% rename from src/api/java/thaumcraft/api/IGoggles.java rename to src/api/java/thaumcraft/api/items/IGoggles.java index 2f53d8163..8dcb4aa63 100644 --- a/src/api/java/thaumcraft/api/IGoggles.java +++ b/src/api/java/thaumcraft/api/items/IGoggles.java @@ -1,22 +1,22 @@ -package thaumcraft.api; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.ItemStack; - -/** - * - * @author Azanor - * - * Equipped head slot items that extend this class will be able to perform most functions that - * goggles of revealing can apart from view nodes which is handled by IRevealer. - * - */ - -public interface IGoggles { - - /* - * If this method returns true things like block essentia contents will be shown. - */ - public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player); - -} +package thaumcraft.api.items; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemStack; + +/** + * + * @author Azanor + * + * Equipped or held items that extend this class will be able to perform most functions that + * goggles of revealing can apart from view nodes which is handled by IRevealer. + * + */ + +public interface IGoggles { + + /* + * If this method returns true things like block essentia contents will be shown. + */ + public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player); + +} diff --git a/src/api/java/thaumcraft/api/nodes/IRevealer.java b/src/api/java/thaumcraft/api/items/IRevealer.java similarity index 66% rename from src/api/java/thaumcraft/api/nodes/IRevealer.java rename to src/api/java/thaumcraft/api/items/IRevealer.java index 14a19b54d..63916b135 100644 --- a/src/api/java/thaumcraft/api/nodes/IRevealer.java +++ b/src/api/java/thaumcraft/api/items/IRevealer.java @@ -1,22 +1,22 @@ -package thaumcraft.api.nodes; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.ItemStack; - -/** - * - * @author Azanor - * - * Equipped head slot items that extend this class will make nodes visible in world. - * - */ - -public interface IRevealer { - - /* - * If this method returns true the nodes will be visible. - */ - public boolean showNodes(ItemStack itemstack, EntityLivingBase player); - - -} +package thaumcraft.api.items; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemStack; + +/** + * + * @author Azanor + * + * Equipped or held items that extend this class will make nodes or related objects visible in world. + * + */ + +public interface IRevealer { + + /* + * If this method returns true the nodes will be visible. + */ + public boolean showNodes(ItemStack itemstack, EntityLivingBase player); + + +} diff --git a/src/api/java/thaumcraft/api/IRunicArmor.java b/src/api/java/thaumcraft/api/items/IRunicArmor.java similarity index 90% rename from src/api/java/thaumcraft/api/IRunicArmor.java rename to src/api/java/thaumcraft/api/items/IRunicArmor.java index 5dd311006..4e4cc6b4e 100644 --- a/src/api/java/thaumcraft/api/IRunicArmor.java +++ b/src/api/java/thaumcraft/api/items/IRunicArmor.java @@ -1,22 +1,22 @@ -package thaumcraft.api; - -import net.minecraft.item.ItemStack; - -/** - * - * @author Azanor - * - * Armor or bauble slot items that implement this interface can provide runic shielding. - * Recharging, hardening, etc. is handled internally by thaumcraft. - * - */ - -public interface IRunicArmor { - - /** - * returns how much charge this item can provide. This is the base shielding value - any hardening is stored and calculated internally. - */ - public int getRunicCharge(ItemStack itemstack); - - -} +package thaumcraft.api.items; + +import net.minecraft.item.ItemStack; + +/** + * + * @author Azanor + * + * Armor or bauble slot items that implement this interface can provide runic shielding. + * Recharging, hardening, etc. is handled internally by thaumcraft. + * + */ + +public interface IRunicArmor { + + /** + * returns how much charge this item can provide. This is the base shielding value - any hardening is stored and calculated internally. + */ + public int getRunicCharge(ItemStack itemstack); + + +} diff --git a/src/api/java/thaumcraft/api/IScribeTools.java b/src/api/java/thaumcraft/api/items/IScribeTools.java similarity index 76% rename from src/api/java/thaumcraft/api/IScribeTools.java rename to src/api/java/thaumcraft/api/items/IScribeTools.java index 7a450056e..006c363c3 100644 --- a/src/api/java/thaumcraft/api/IScribeTools.java +++ b/src/api/java/thaumcraft/api/items/IScribeTools.java @@ -1,14 +1,14 @@ -package thaumcraft.api; - - -/** - * - * @author Azanor - * - * Interface used to identify scribing tool items used in research table - * - */ - -public interface IScribeTools { - -} \ No newline at end of file +package thaumcraft.api.items; + + +/** + * + * @author Azanor + * + * Interface used to identify scribing tool items used in research table + * + */ + +public interface IScribeTools { + +} diff --git a/src/main/java/vazkii/botania/api/BotaniaAPI.java b/src/main/java/vazkii/botania/api/BotaniaAPI.java index 96acba8b5..cee6ca7af 100644 --- a/src/main/java/vazkii/botania/api/BotaniaAPI.java +++ b/src/main/java/vazkii/botania/api/BotaniaAPI.java @@ -2,26 +2,29 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + * * Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php - * + * * File Created @ [Jan 14, 2014, 6:15:28 PM (GMT)] */ package vazkii.botania.api; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - +import com.google.common.base.Preconditions; +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; import net.minecraft.block.Block; +import net.minecraft.block.BlockCarpet; +import net.minecraft.block.BlockColored; +import net.minecraft.block.BlockStainedGlass; +import net.minecraft.block.BlockStainedGlassPane; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; import net.minecraft.init.Blocks; import net.minecraft.init.Items; +import net.minecraft.init.SoundEvents; +import net.minecraft.item.EnumDyeColor; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.Item.ToolMaterial; @@ -29,8 +32,11 @@ import net.minecraft.item.ItemArmor.ArmorMaterial; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; -import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.SoundEvent; +import net.minecraft.util.text.TextFormatting; import net.minecraftforge.common.util.EnumHelper; +import net.minecraftforge.fml.common.Loader; +import net.minecraftforge.fml.common.LoaderState; import net.minecraftforge.oredict.OreDictionary; import vazkii.botania.api.brew.Brew; import vazkii.botania.api.internal.DummyMethodHandler; @@ -53,63 +59,72 @@ import vazkii.botania.api.wiki.IWikiProvider; import vazkii.botania.api.wiki.SimpleWikiProvider; import vazkii.botania.api.wiki.WikiHooks; -import com.google.common.collect.BiMap; -import com.google.common.collect.HashBiMap; - -import cpw.mods.fml.common.Loader; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; public final class BotaniaAPI { - private static List categories = new ArrayList(); - private static List allEntries = new ArrayList(); + private static final List categories = new ArrayList<>(); + private static final List allEntries = new ArrayList<>(); - public static Map knowledgeTypes = new HashMap(); + public static final Map knowledgeTypes = new HashMap<>(); - public static Map brewMap = new LinkedHashMap(); - - public static List disposableBlocks = new ArrayList(); - public static List semiDisposableBlocks = new ArrayList(); + public static final Map brewMap = new LinkedHashMap<>(); - public static List petalRecipes = new ArrayList(); - public static List pureDaisyRecipes = new ArrayList(); - public static List manaInfusionRecipes = new ArrayList(); - public static List runeAltarRecipes = new ArrayList(); - public static List elvenTradeRecipes = new ArrayList(); - public static List brewRecipes = new ArrayList(); - public static List miniFlowerRecipes = new ArrayList(); + public static final List disposableBlocks = new ArrayList<>(); + public static final List semiDisposableBlocks = new ArrayList<>(); - private static BiMap> subTiles = HashBiMap.> create(); - private static Map, SubTileSignature> subTileSignatures = new HashMap, SubTileSignature>(); - public static Set subtilesForCreativeMenu = new LinkedHashSet(); - public static Map subTileMods = new HashMap(); - public static BiMap miniFlowers = HashBiMap. create(); + public static final List petalRecipes = new ArrayList<>(); + public static final List pureDaisyRecipes = new ArrayList<>(); + public static final List manaInfusionRecipes = new ArrayList<>(); + public static final List runeAltarRecipes = new ArrayList<>(); + public static final List elvenTradeRecipes = new ArrayList<>(); + public static final List brewRecipes = new ArrayList<>(); + public static final List miniFlowerRecipes = new ArrayList<>(); - public static Map oreWeights = new HashMap(); - public static Map oreWeightsNether = new HashMap(); - public static Map seeds = new HashMap(); - public static Set looniumBlacklist = new LinkedHashSet(); - public static Set paintableBlocks = new LinkedHashSet(); - public static Set magnetBlacklist = new LinkedHashSet(); - public static Set> gravityRodBlacklist = new LinkedHashSet>(); + private static final BiMap> subTiles = HashBiMap.create(); + private static final Map, SubTileSignature> subTileSignatures = new HashMap<>(); + public static final Set subtilesForCreativeMenu = new LinkedHashSet<>(); + public static final Map subTileMods = new HashMap<>(); + public static final BiMap miniFlowers = HashBiMap.create(); - public static ArmorMaterial manasteelArmorMaterial = EnumHelper.addArmorMaterial("MANASTEEL", 16, new int[] { 2, 6, 5, 2 }, 18); - public static ToolMaterial manasteelToolMaterial = EnumHelper.addToolMaterial("MANASTEEL", 3, 300, 6.2F, 2F, 20); + public static final Map oreWeights = new HashMap<>(); + public static final Map oreWeightsNether = new HashMap<>(); + public static final Map seeds = new HashMap<>(); - public static ArmorMaterial elementiumArmorMaterial = EnumHelper.addArmorMaterial("B_ELEMENTIUM", 18, new int[] { 2, 6, 5, 2 }, 18); - public static ToolMaterial elementiumToolMaterial = EnumHelper.addToolMaterial("B_ELEMENTIUM", 3, 720, 6.2F, 2F, 20); + public static final Set looniumBlacklist = new LinkedHashSet<>(); + public static final Map> paintableBlocks = new LinkedHashMap<>(); + public static final Set magnetBlacklist = new LinkedHashSet<>(); + public static final Set> gravityRodBlacklist = new LinkedHashSet<>(); - public static ArmorMaterial terrasteelArmorMaterial = EnumHelper.addArmorMaterial("TERRASTEEL", 34, new int[] {3, 8, 6, 3}, 26); - public static ToolMaterial terrasteelToolMaterial = EnumHelper.addToolMaterial("TERRASTEEL", 4, 2300, 9F, 3F, 26); - public static ArmorMaterial manaweaveArmorMaterial = EnumHelper.addArmorMaterial("MANAWEAVE", 5, new int[] { 1, 2, 2, 1 }, 18); + public static final ArmorMaterial manasteelArmorMaterial = EnumHelper.addArmorMaterial("MANASTEEL", "manasteel", 16, + new int[] { 2, 6, 5, 2 }, 18, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 0); + public static final ToolMaterial manasteelToolMaterial = EnumHelper.addToolMaterial("MANASTEEL", 3, 300, 6.2F, 2F, 20); - public static EnumRarity rarityRelic = EnumHelper.addRarity("RELIC", EnumChatFormatting.GOLD, "Relic"); + public static final ArmorMaterial elementiumArmorMaterial = EnumHelper.addArmorMaterial("B_ELEMENTIUM", "b_elementium", 18, + new int[] { 2, 6, 5, 2 }, 18, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 0); + public static final ToolMaterial elementiumToolMaterial = EnumHelper.addToolMaterial("B_ELEMENTIUM", 3, 720, 6.2F, 2F, 20); - public static KnowledgeType basicKnowledge; - public static KnowledgeType elvenKnowledge; + public static final ArmorMaterial terrasteelArmorMaterial = EnumHelper.addArmorMaterial("TERRASTEEL", "terrasteel", 34, + new int[] { 3, 8, 6, 3 }, 26, SoundEvents.ITEM_ARMOR_EQUIP_DIAMOND, 3F); + public static final ToolMaterial terrasteelToolMaterial = EnumHelper.addToolMaterial("TERRASTEEL", 4, 2300, 9F, 3F, 26); + + public static final ArmorMaterial manaweaveArmorMaterial = EnumHelper.addArmorMaterial("MANAWEAVE", "manaweave", 5, + new int[] { 1, 2, 2, 1 }, 18, SoundEvents.ITEM_ARMOR_EQUIP_LEATHER, 0); + + public static final EnumRarity rarityRelic = EnumHelper.addRarity("RELIC", TextFormatting.GOLD, "Relic"); + + public static final KnowledgeType basicKnowledge; + public static final KnowledgeType elvenKnowledge; // This is here for completeness sake, but you shouldn't use it - public static KnowledgeType relicKnowledge; + public static final KnowledgeType relicKnowledge; // All of these categories are initialized during botania's PreInit stage. public static LexiconCategory categoryBasics; @@ -123,14 +138,14 @@ public final class BotaniaAPI { public static LexiconCategory categoryAlfhomancy; public static LexiconCategory categoryMisc; - public static Brew fallbackBrew = new Brew("fallback", "botania.brew.fallback", 0, 0); + public static final Brew fallbackBrew = new Brew("fallback", "botania.brew.fallback", 0, 0); static { registerSubTile("", DummySubTile.class); - basicKnowledge = registerKnowledgeType("minecraft", EnumChatFormatting.RESET, true); - elvenKnowledge = registerKnowledgeType("alfheim", EnumChatFormatting.DARK_GREEN, false); - relicKnowledge = registerKnowledgeType("relic", EnumChatFormatting.DARK_PURPLE, false); + basicKnowledge = registerKnowledgeType("minecraft", TextFormatting.RESET, true); + elvenKnowledge = registerKnowledgeType("alfheim", TextFormatting.DARK_GREEN, false); + relicKnowledge = registerKnowledgeType("relic", TextFormatting.DARK_PURPLE, false); addOreWeight("oreAluminum", 3940); // Tinkers' Construct addOreWeight("oreAmber", 2075); // Thaumcraft @@ -201,12 +216,12 @@ public final class BotaniaAPI { addOreWeightNether("oreOnyx", 500); // SimpleOres 2 addOreWeightNether("oreHaditeCoal", 500); // Hadite - addSeed(Items.wheat_seeds, Blocks.wheat); - addSeed(Items.potato, Blocks.potatoes); - addSeed(Items.carrot, Blocks.carrots); - addSeed(Items.nether_wart, Blocks.nether_wart); - addSeed(Items.pumpkin_seeds, Blocks.pumpkin_stem); - addSeed(Items.melon_seeds, Blocks.melon_stem); + addSeed(Items.WHEAT_SEEDS, Blocks.WHEAT); + addSeed(Items.POTATO, Blocks.POTATOES); + addSeed(Items.CARROT, Blocks.CARROTS); + addSeed(Items.NETHER_WART, Blocks.NETHER_WART); + addSeed(Items.PUMPKIN_SEEDS, Blocks.PUMPKIN_STEM); + addSeed(Items.MELON_SEEDS, Blocks.MELON_STEM); registerModWiki("Minecraft", new SimpleWikiProvider("Minecraft Wiki", "http://minecraft.gamepedia.com/%s")); @@ -236,21 +251,21 @@ public final class BotaniaAPI { registerModWiki("GanysNether", new SimpleWikiProvider("Gany's Nether Wiki", "http://ganys-nether.wikia.com/wiki/%s")); registerModWiki("GanysEnd", new SimpleWikiProvider("Gany's End Wiki", "http://ganys-end.wikia.com/wiki/%s")); - registerPaintableBlock(Blocks.stained_glass); - registerPaintableBlock(Blocks.stained_glass_pane); - registerPaintableBlock(Blocks.stained_hardened_clay); - registerPaintableBlock(Blocks.wool); - registerPaintableBlock(Blocks.carpet); - + registerPaintableBlock(Blocks.STAINED_GLASS, BlockStainedGlass.COLOR); + registerPaintableBlock(Blocks.STAINED_GLASS_PANE, BlockStainedGlassPane.COLOR); + registerPaintableBlock(Blocks.STAINED_HARDENED_CLAY, BlockColored.COLOR); + registerPaintableBlock(Blocks.WOOL, BlockColored.COLOR); + registerPaintableBlock(Blocks.CARPET, BlockCarpet.COLOR); + registerDisposableBlock("dirt"); // Vanilla registerDisposableBlock("sand"); // Vanilla registerDisposableBlock("gravel"); // Vanilla registerDisposableBlock("cobblestone"); // Vanilla registerDisposableBlock("netherrack"); // Vanilla - registerSemiDisposableBlock("stoneAndesite"); // Botania - registerSemiDisposableBlock("stoneBasalt"); // Botania - registerSemiDisposableBlock("stoneDiorite"); // Botania - registerSemiDisposableBlock("stoneGranite"); // Botania + registerSemiDisposableBlock("stoneAndesite"); // Vanilla + registerSemiDisposableBlock("stoneBasalt"); // Vanilla + registerSemiDisposableBlock("stoneDiorite"); // Vanilla + registerSemiDisposableBlock("stoneGranite"); // Vanilla } /** @@ -266,7 +281,7 @@ public final class BotaniaAPI { * @param id The ID for this knowledge type. * @param color The color to display this knowledge type as. */ - public static KnowledgeType registerKnowledgeType(String id, EnumChatFormatting color, boolean autoUnlock) { + public static KnowledgeType registerKnowledgeType(String id, TextFormatting color, boolean autoUnlock) { KnowledgeType type = new KnowledgeType(id, color, autoUnlock); knowledgeTypes.put(id, type); return type; @@ -290,45 +305,46 @@ public final class BotaniaAPI { return fallbackBrew; } - /* + /** * Registers a Block as disposable using its Ore Dictionary Name. */ public static void registerDisposableBlock(String oreDictName) { disposableBlocks.add(oreDictName); } - - /* + + /** * Registers a Block as semi disposable using its Ore Dictionary Name. * This means it will not be trashed when sneaking. */ public static void registerSemiDisposableBlock(String oreDictName) { semiDisposableBlocks.add(oreDictName); } - + /** * Registers a paintableBlock and returns it. + * You must also provide the PropertyEnum that this block uses to express its color */ - public static Block registerPaintableBlock(Block paintable){ - paintableBlocks.add(paintable); + public static Block registerPaintableBlock(Block paintable, PropertyEnum colorProp){ + paintableBlocks.put(paintable, colorProp); return paintable; } - /* + /** * Blacklists an Entity from being affected by the Rod of the Shaded Mesa. * Pass in the class for the Entity, e.g. EntityCow.class */ - public static void blacklistEntityFromGravityRod(Class entity) { + public static void blacklistEntityFromGravityRod(Class entity) { gravityRodBlacklist.add(entity); } - - /* + + /** * Checks if the provided Entity is contained in the Blacklist. * Pass in the class for the Entity, e.g. entity.getClass() */ public static boolean isEntityBlacklistedFromGravityRod(Class entity) { return gravityRodBlacklist.contains(entity); } - + /** * Blacklists an item from being pulled by the Ring of Magnetization. * Short.MAX_VALUE can be used as the stack's damage for a wildcard. @@ -350,11 +366,11 @@ public final class BotaniaAPI { public static boolean isItemBlacklistedFromMagnet(ItemStack stack) { return isItemBlacklistedFromMagnet(stack, 0); } - + public static boolean isItemBlacklistedFromMagnet(ItemStack stack, int recursion) { if(recursion > 5) return false; - + if(stack.getItemDamage() != Short.MAX_VALUE) { ItemStack copy = new ItemStack(stack.getItem(), 0, Short.MAX_VALUE); boolean general = isItemBlacklistedFromMagnet(copy, recursion + 1); @@ -365,7 +381,11 @@ public final class BotaniaAPI { String key = getMagnetKey(stack); return magnetBlacklist.contains(key); } - + + public static boolean isBlockBlacklistedFromMagnet(IBlockState state) { + return isBlockBlacklistedFromMagnet(state.getBlock(), state.getBlock().getMetaFromState(state)); + } + public static boolean isBlockBlacklistedFromMagnet(Block block, int meta) { return isBlockBlacklistedFromMagnet(block, meta, 0); } @@ -373,7 +393,7 @@ public final class BotaniaAPI { public static boolean isBlockBlacklistedFromMagnet(Block block, int meta, int recursion) { if(recursion >= 5) return false; - + if(meta != Short.MAX_VALUE) { boolean general = isBlockBlacklistedFromMagnet(block, Short.MAX_VALUE, recursion + 1); if(general) @@ -392,20 +412,32 @@ public final class BotaniaAPI { * @return The recipe created. */ public static RecipePetals registerPetalRecipe(ItemStack output, Object... inputs) { + Preconditions.checkArgument(inputs.length <= 16); RecipePetals recipe = new RecipePetals(output, inputs); petalRecipes.add(recipe); return recipe; } /** - * Registers a Pure Daisy Recipe. + * Registers a Pure Daisy Recipe with the default time * @param input The block that works as an input for the recipe. Can be a Block or an oredict String. - * @param output The block to be placed upon recipe completion. - * @param outputMeta The metadata to be placed upon recipe completion. + * @param outputState The blockstate to be placed upon recipe completion. * @return The recipe created. */ - public static RecipePureDaisy registerPureDaisyRecipe(Object input, Block output, int outputMeta) { - RecipePureDaisy recipe = new RecipePureDaisy(input, output, outputMeta); + public static RecipePureDaisy registerPureDaisyRecipe(Object input, IBlockState outputState) { + return registerPureDaisyRecipe(input, outputState, RecipePureDaisy.DEFAULT_TIME); + } + + /** + * Registers a Pure Daisy Recipe. + * @param input The block that works as an input for the recipe. Can be a Block or an oredict String. + * @param outputState The blockstate to be placed upon recipe completion. + * @param time The amount of time in ticks to complete this recipe. Note that this is ticks on your block, not total time. + * The Pure Daisy only ticks one block at a time in a round robin fashion. + * @return The recipe created. + */ + public static RecipePureDaisy registerPureDaisyRecipe(Object input, IBlockState outputState, int time) { + RecipePureDaisy recipe = new RecipePureDaisy(input, outputState, time); pureDaisyRecipes.add(recipe); return recipe; } @@ -419,6 +451,7 @@ public final class BotaniaAPI { * @return The recipe created. */ public static RecipeRuneAltar registerRuneAltarRecipe(ItemStack output, int mana, Object... inputs) { + Preconditions.checkArgument(inputs.length <= 16); RecipeRuneAltar recipe = new RecipeRuneAltar(output, mana, inputs); runeAltarRecipes.add(recipe); return recipe; @@ -432,6 +465,7 @@ public final class BotaniaAPI { * @return The recipe created. */ public static RecipeManaInfusion registerManaInfusionRecipe(ItemStack output, Object input, int mana) { + Preconditions.checkArgument(mana <= 1000000); RecipeManaInfusion recipe = new RecipeManaInfusion(output, input, mana); manaInfusionRecipes.add(recipe); return recipe; @@ -444,7 +478,7 @@ public final class BotaniaAPI { */ public static RecipeManaInfusion registerManaAlchemyRecipe(ItemStack output, Object input, int mana) { RecipeManaInfusion recipe = registerManaInfusionRecipe(output, input, mana); - recipe.setAlchemy(true); + recipe.setCatalyst(RecipeManaInfusion.alchemyState); return recipe; } @@ -455,28 +489,39 @@ public final class BotaniaAPI { */ public static RecipeManaInfusion registerManaConjurationRecipe(ItemStack output, Object input, int mana) { RecipeManaInfusion recipe = registerManaInfusionRecipe(output, input, mana); - recipe.setConjuration(true); + recipe.setCatalyst(RecipeManaInfusion.conjurationState); return recipe; } /** * Registers a Elven Trade recipe (throw an item in an Alfheim Portal). - * @param output The ItemStack to return. + * @param outputs The ItemStacks to return. * @param inputs The items required, can be ItemStack or ore dictionary entry string. * @return The recipe created. */ - public static RecipeElvenTrade registerElvenTradeRecipe(ItemStack output, Object... inputs) { - RecipeElvenTrade recipe = new RecipeElvenTrade(output, inputs); + public static RecipeElvenTrade registerElvenTradeRecipe(ItemStack[] outputs, Object... inputs) { + RecipeElvenTrade recipe = new RecipeElvenTrade(outputs, inputs); elvenTradeRecipes.add(recipe); return recipe; } + /** + * Registers a Elven Trade recipe (throw an item into an Alfeim Portal). + * @param output The ItemStack to return + * @param inputs The items required, can be an ItemStack or an Ore Dictionary entry string. + * @return The recipe created. + */ + public static RecipeElvenTrade registerElvenTradeRecipe(ItemStack output, Object... inputs) { + return registerElvenTradeRecipe(new ItemStack[]{ output }, inputs); + } + /** * Registers a Brew Recipe (for the Botanical Brewery). * @param brew The brew in to be set in this recipe. - * @inputs The items used in the recipe, no more than 6. + * @param inputs The items used in the recipe, no more than 6. */ public static RecipeBrew registerBrewRecipe(Brew brew, Object... inputs) { + Preconditions.checkArgument(inputs.length <= 6); RecipeBrew recipe = new RecipeBrew(brew, inputs); brewRecipes.add(recipe); return recipe; @@ -484,9 +529,10 @@ public final class BotaniaAPI { /** * Registers a SubTileEntity, a new special flower. Look in the subtile package of the API. - * If you call this after PostInit you're a failiure and we are very disappointed in you. + * Call this in preInit, and don't forget to register a model in BotaniaAPIClient. */ public static void registerSubTile(String key, Class subtileClass) { + Preconditions.checkArgument(Loader.instance().isInState(LoaderState.PREINITIALIZATION)); subTiles.put(key, subtileClass); subTileMods.put(key, Loader.instance().activeModContainer().getModId()); } @@ -632,7 +678,7 @@ public final class BotaniaAPI { */ public static List getLatestAddedRecipes(int x) { List list = CraftingManager.getInstance().getRecipeList(); - List newList = new ArrayList(); + List newList = new ArrayList<>(); for(int i = x - 1; i >= 0; i--) newList.add(list.get(list.size() - 1 - i)); @@ -641,7 +687,7 @@ public final class BotaniaAPI { /** * Registers a Wiki provider for a mod so it uses that instead of the fallback - * FTB wiki. Make sure to call this on PostInit only! + * FTB wiki. */ public static void registerModWiki(String mod, IWikiProvider provider) { WikiHooks.registerModWiki(mod, provider); diff --git a/src/main/java/vazkii/botania/api/BotaniaAPIClient.java b/src/main/java/vazkii/botania/api/BotaniaAPIClient.java new file mode 100644 index 000000000..fc13589fe --- /dev/null +++ b/src/main/java/vazkii/botania/api/BotaniaAPIClient.java @@ -0,0 +1,108 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

+ * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.api; + +import com.google.common.base.Preconditions; +import com.google.common.collect.Maps; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraftforge.fml.common.Loader; +import net.minecraftforge.fml.common.LoaderState; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.api.item.IFloatingFlower; +import vazkii.botania.api.subtile.SubTileEntity; + +import java.util.Collections; +import java.util.Map; + +/** + * Class for API calls that must be made clientside + */ +@SideOnly(Side.CLIENT) +public final class BotaniaAPIClient { + + private static final Map subtileBlockModels = Maps.newHashMap(); + private static final Map subtileItemModels = Maps.newHashMap(); + private static final Map islandTypeModels = Maps.newHashMap(); + + private BotaniaAPIClient() { + } + + /** + * Register your model for the given subtile class here. + * Call this DURING PREINIT. Calling it anytime after blockModels have already baked does not guarantee that your model will work. + * Your model json must specify key "tintindex" in all the faces it wants tint applied. + * Tint is applied whenever a player recolors the flower using floral dye + * + * @param subTileName The String ID of the subtile + * @param model A path to a blockstate json and variant to be used for this subtile + * @param itemModel A path to a blockstate json and variant to be used for this subtile's item form + */ + public static void registerSubtileModel(String subTileName, ModelResourceLocation model, ModelResourceLocation itemModel) { + Preconditions.checkState(Loader.instance().isInState(LoaderState.PREINITIALIZATION)); + subtileBlockModels.put(subTileName, model); + subtileItemModels.put(subTileName, itemModel); + } + + /** + * Register your model for the given subtile class here. + * Call this DURING PREINIT. + * Your model json must specify key "tintindex" in all the faces it wants tint applied. + * Tint is applied whenever a player recolors the flower using floral dye + * + * @param subTileName The String ID of the subtile + * @param model A path to a blockstate json and variant to be used the block. The item model will be drawn from the same blockstate json, from variant "inventory" + */ + public static void registerSubtileModel(String subTileName, ModelResourceLocation model) { + registerSubtileModel(subTileName, model, new ModelResourceLocation(model.getResourceDomain() + ":" + model.getResourcePath(), "inventory")); + } + + // Convenience overloads for the above two calls + public static void registerSubtileModel(Class clazz, ModelResourceLocation model) { + registerSubtileModel(BotaniaAPI.getSubTileStringMapping(clazz), model); + } + + public static void registerSubtileModel(Class clazz, ModelResourceLocation model, ModelResourceLocation itemModel) { + registerSubtileModel(BotaniaAPI.getSubTileStringMapping(clazz), model, itemModel); + } + + /** + * @return An immutable and live view of the registered subtile block model map + */ + public static Map getRegisteredSubtileBlockModels() { + return Collections.unmodifiableMap(subtileBlockModels); + } + + /** + * @return An immutable and live view of the registered subtile item model map + */ + public static Map getRegisteredSubtileItemModels() { + return Collections.unmodifiableMap(subtileItemModels); + } + + /** + * Registers your model for island type islandType here. + * Call this DURING PREINIT. + * + * @param islandType The islandtype to register + * @param model The variant within a blockstate json to use as the islandtype's model + */ + public static void registerIslandTypeModel(IFloatingFlower.IslandType islandType, ModelResourceLocation model) { + Preconditions.checkState(Loader.instance().isInState(LoaderState.PREINITIALIZATION)); + islandTypeModels.put(islandType, model); + } + + /** + * @return An immutable and live view of the registered island type model map + */ + public static Map getRegisteredIslandTypeModels() { + return Collections.unmodifiableMap(islandTypeModels); + } + +} diff --git a/src/main/java/vazkii/botania/api/boss/IBotaniaBoss.java b/src/main/java/vazkii/botania/api/boss/IBotaniaBoss.java index d337e6ae8..5ba3b5f87 100644 --- a/src/main/java/vazkii/botania/api/boss/IBotaniaBoss.java +++ b/src/main/java/vazkii/botania/api/boss/IBotaniaBoss.java @@ -10,30 +10,25 @@ */ package vazkii.botania.api.boss; -import java.awt.Rectangle; - import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.entity.boss.IBossDisplayData; import net.minecraft.util.ResourceLocation; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.api.internal.ShaderCallback; + +import java.awt.*; +import java.util.UUID; /** - * An extension of IBossDisplayData. This counts as a botania boss and as a normal - * minecraft boss since it has IBossDisplayData. Instead of using the typical - * BossStatus.setBossStatus(entity, true) to set the health bar in the render use - * BotaniaAPI.internalMethodHandler.setBossStatus(entity);

- * Alternatively, you can check if botania is loaded and use the vanilla one - * if that's not the case. + * A Botania boss, that is subject to special rendering. */ -public interface IBotaniaBoss extends IBossDisplayData { +public interface IBotaniaBoss { /** * The ResourceLocation to bind for this boss's boss bar. * You can use BotaniaAPI.internalMethodHandler.getDefaultBossBarTexture() to get * the one used by botania bosses. */ - @SideOnly(Side.CLIENT) public ResourceLocation getBossBarTexture(); /** @@ -41,7 +36,6 @@ public interface IBotaniaBoss extends IBossDisplayData { * boss bar texture. This is for the background, not the bar that shows * the HP. */ - @SideOnly(Side.CLIENT) public Rectangle getBossBarTextureRect(); /** @@ -50,13 +44,38 @@ public interface IBotaniaBoss extends IBossDisplayData { * HP the boss has. The width of the rectangle will be multiplied by the * faction of the boss's current HP by max HP. */ - @SideOnly(Side.CLIENT) public Rectangle getBossBarHPTextureRect(); /** - * A callback for when this boss's boss bar renders, you can do aditional rendering + * A callback for when this boss's boss bar renders, you can do additional rendering * here if needed. + * @return How tall your auxiliary renders were */ @SideOnly(Side.CLIENT) - public void bossBarRenderCallback(ScaledResolution res, int x, int y); + public int bossBarRenderCallback(ScaledResolution res, int x, int y); + + /** + * Get the serverside UUID of the {@link net.minecraft.world.BossInfoServer} instance tracking this boss + * Note that this is NOT the entity's UUID, nor is it the clientside UUID of the BossInfoServer instance! + * You will most likely need to sync this yourself using the datawatcher + * @return The uuid. + */ + public UUID getBossInfoUuid(); + + /** + * The Shader Program to use for this boss's bar. Return 0 case + * you don't want a shader to be used. You can use separate shaders + * for the background and foreground. + * @param background True if rendering the background of the boss bar, + * false if rendering the bar itself that shows the HP. + * @return OpenGL program ID of the shader to use + */ + public int getBossBarShaderProgram(boolean background); + + /** + * A callback for the shader, used to pass in uniforms. Return null for no callback. + * @return a ShaderCallback to use. If getBossBarShaderProgram returns an invalid shader the result of this method is ignored. + */ + public ShaderCallback getBossBarShaderCallback(boolean background, int shader); + } diff --git a/src/main/java/vazkii/botania/api/boss/IBotaniaBossWithShader.java b/src/main/java/vazkii/botania/api/boss/IBotaniaBossWithShader.java deleted file mode 100644 index 82221d37e..000000000 --- a/src/main/java/vazkii/botania/api/boss/IBotaniaBossWithShader.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Oct 29, 2014, 6:13:21 PM (GMT)] - */ -package vazkii.botania.api.boss; - -import vazkii.botania.api.internal.ShaderCallback; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * A Botania boss whose HP bar makes use of shaders. Shaders - * used through this have a few uniforms available: - *

  • int time - The amount of total ticks elapsed.
  • - *
  • int startX - The U coordinate passed in for the render of this bar's texture.
  • - *
  • int startY - The V coordinate passed in for the render of this bar's texture.
  • - */ -public interface IBotaniaBossWithShader extends IBotaniaBoss { - - /** - * The Shader Program to use for this boss bar. Return 0 case - * you don't want a shader to be used. You can use separate shaders - * for the background and foreground. - * @param background True if rendering the background of the boss bar, - * false if rendering the bar itself that shows the HP. - */ - @SideOnly(Side.CLIENT) - public int getBossBarShaderProgram(boolean background); - - /** - * A callback for the shader, used to pass in uniforms. Return null for no callback. - */ - @SideOnly(Side.CLIENT) - public ShaderCallback getBossBarShaderCallback(boolean background, int shader); - -} diff --git a/src/main/java/vazkii/botania/api/brew/Brew.java b/src/main/java/vazkii/botania/api/brew/Brew.java index d0dd6ba4d..2e5a26142 100644 --- a/src/main/java/vazkii/botania/api/brew/Brew.java +++ b/src/main/java/vazkii/botania/api/brew/Brew.java @@ -10,25 +10,24 @@ */ package vazkii.botania.api.brew; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - +import com.google.common.collect.ImmutableList; import net.minecraft.item.ItemStack; import net.minecraft.potion.PotionEffect; +import java.util.List; + /** * The class for a Brew definition, each one is a singleton. */ public class Brew { - String key; - String name; - int color; - int cost; - List effects; - boolean canInfuseBloodPendant = true; - boolean canInfuseIncense = true; + private final String key; + private final String name; + private final int color; + private final int cost; + private final List effects; + private boolean canInfuseBloodPendant = true; + private boolean canInfuseIncense = true; /** * @param name The unlocalized name of this potion. @@ -42,7 +41,7 @@ public class Brew { this.name = name; this.color = color; this.cost = cost; - this.effects = new ArrayList(Arrays.asList(effects)); + this.effects = ImmutableList.copyOf(effects); } /** @@ -115,7 +114,7 @@ public class Brew { } /** - * Gets the list of potion effects for the ItemStack passed in. + * Gets the list of vanilla PotionEffects for the ItemStack passed in. * Note that for the lexicon, this passes in a botania Managlass * Vial or an Alfglass Flask at all times. */ diff --git a/src/main/java/vazkii/botania/api/corporea/CorporeaHelper.java b/src/main/java/vazkii/botania/api/corporea/CorporeaHelper.java index d4934d7da..5bb7808ac 100644 --- a/src/main/java/vazkii/botania/api/corporea/CorporeaHelper.java +++ b/src/main/java/vazkii/botania/api/corporea/CorporeaHelper.java @@ -9,35 +9,34 @@ * File Created @ [Feb 14, 2015, 3:28:54 PM (GMT)] */ package vazkii.botania.api.corporea; + +import com.google.common.base.Predicates; +import com.google.common.collect.ImmutableList; +import net.minecraft.entity.Entity; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import vazkii.botania.api.BotaniaAPI; + import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.WeakHashMap; import java.util.regex.Pattern; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.util.ForgeDirection; -import vazkii.botania.api.BotaniaAPI; - public final class CorporeaHelper { - private static final List empty = Collections.unmodifiableList(new ArrayList()); - private static final WeakHashMap, List> cachedNetworks = new WeakHashMap(); - private static final List autoCompleteControllers = new ArrayList(); + private static final List empty = ImmutableList.of(); + private static final WeakHashMap, List> cachedNetworks = new WeakHashMap<>(); + private static final List autoCompleteControllers = new ArrayList<>(); private static final Pattern patternControlCode = Pattern.compile("(?i)\\u00A7[0-9A-FK-OR]"); - public static final String[] WILDCARD_STRINGS = new String[] { - "...", "~", "+", "?" , "*" - }; + public static final String[] WILDCARD_STRINGS = { "...", "~", "+", "?" , "*" }; /** * How many items were matched in the last request. If java had "out" params like C# this wouldn't be needed :V @@ -52,23 +51,23 @@ public final class CorporeaHelper { * Gets a list of all the inventories on this spark network. This list is cached for use once every tick, * and if something changes during that tick it'll still have the first result. */ - public static List getInventoriesOnNetwork(ICorporeaSpark spark) { + public static List getInventoriesOnNetwork(ICorporeaSpark spark) { ICorporeaSpark master = spark.getMaster(); if(master == null) return empty; List network = master.getConnections(); if(cachedNetworks.containsKey(network)) { - List cache = cachedNetworks.get(network); + List cache = cachedNetworks.get(network); if(cache != null) return cache; } - List inventories = new ArrayList(); + List inventories = new ArrayList<>(); if(network != null) for(ICorporeaSpark otherSpark : network) if(otherSpark != null) { - IInventory inv = otherSpark.getInventory(); + InvWithLocation inv = otherSpark.getSparkInventory(); if(inv != null) inventories.add(inv); } @@ -83,7 +82,7 @@ public final class CorporeaHelper { * called instead if the context for those exists to avoid having to get the values again. */ public static int getCountInNetwork(ItemStack stack, ICorporeaSpark spark, boolean checkNBT) { - List inventories = getInventoriesOnNetwork(spark); + List inventories = getInventoriesOnNetwork(spark); return getCountInNetwork(stack, inventories, checkNBT); } @@ -92,18 +91,18 @@ public final class CorporeaHelper { * The higher level function that use a Map< IInventory, Integer > should be * called instead if the context for this exists to avoid having to get the value again. */ - public static int getCountInNetwork(ItemStack stack, List inventories, boolean checkNBT) { - Map map = getInventoriesWithItemInNetwork(stack, inventories, checkNBT); + public static int getCountInNetwork(ItemStack stack, List inventories, boolean checkNBT) { + Map map = getInventoriesWithItemInNetwork(stack, inventories, checkNBT); return getCountInNetwork(stack, map, checkNBT); } /** * Gets the amount of available items in the network of the type passed in, checking NBT or not. */ - public static int getCountInNetwork(ItemStack stack, Map inventories, boolean checkNBT) { + public static int getCountInNetwork(ItemStack stack, Map inventories, boolean checkNBT) { int count = 0; - for(IInventory inv : inventories.keySet()) + for(InvWithLocation inv : inventories.keySet()) count += inventories.get(inv); return count; @@ -114,8 +113,8 @@ public final class CorporeaHelper { * The higher level function that use a List< IInventory > should be * called instead if the context for this exists to avoid having to get the value again. */ - public static Map getInventoriesWithItemInNetwork(ItemStack stack, ICorporeaSpark spark, boolean checkNBT) { - List inventories = getInventoriesOnNetwork(spark); + public static Map getInventoriesWithItemInNetwork(ItemStack stack, ICorporeaSpark spark, boolean checkNBT) { + List inventories = getInventoriesOnNetwork(spark); return getInventoriesWithItemInNetwork(stack, inventories, checkNBT); } @@ -124,8 +123,8 @@ public final class CorporeaHelper { * The deeper level function that use a List< IInventory > should be * called instead if the context for this exists to avoid having to get the value again. */ - public static Map getInventoriesWithItemInNetwork(ItemStack stack,List inventories, boolean checkNBT) { - Map countMap = new HashMap(); + public static Map getInventoriesWithItemInNetwork(ItemStack stack, List inventories, boolean checkNBT) { + Map countMap = new HashMap<>(); List wrappedInventories = BotaniaAPI.internalHandler.wrapInventory(inventories); for (IWrappedInventory inv : wrappedInventories) { CorporeaRequest request = new CorporeaRequest(stack, checkNBT, -1); @@ -166,12 +165,13 @@ public final class CorporeaHelper { * purposes of counting huge amounts. */ public static List requestItem(Object matcher, int itemCount, ICorporeaSpark spark, boolean checkNBT, boolean doit) { - List stacks = new ArrayList(); + List stacks = new ArrayList<>(); CorporeaRequestEvent event = new CorporeaRequestEvent(matcher, itemCount, spark, checkNBT, doit); if(MinecraftForge.EVENT_BUS.post(event)) return stacks; - List inventories = getInventoriesOnNetwork(spark); + List inventories = getInventoriesOnNetwork(spark); + List inventoriesW = BotaniaAPI.internalHandler.wrapInventory(inventories); Map interceptors = new HashMap(); @@ -179,9 +179,9 @@ public final class CorporeaHelper { for(IWrappedInventory inv : inventoriesW) { ICorporeaSpark invSpark = inv.getSpark(); - Object originalInventory = inv.getWrappedObject(); - if(originalInventory instanceof ICorporeaInterceptor) { - ICorporeaInterceptor interceptor = (ICorporeaInterceptor) originalInventory; + InvWithLocation originalInventory = inv.getWrappedObject(); + if(originalInventory.world.getTileEntity(originalInventory.pos) instanceof ICorporeaInterceptor) { + ICorporeaInterceptor interceptor = (ICorporeaInterceptor) originalInventory.world.getTileEntity(originalInventory.pos); interceptor.interceptRequest(matcher, itemCount, invSpark, spark, stacks, inventories, doit); interceptors.put(interceptor, invSpark); } @@ -205,36 +205,26 @@ public final class CorporeaHelper { /** * Gets the spark attached to the inventory passed case it's a TileEntity. */ - public static ICorporeaSpark getSparkForInventory(IInventory inv) { - if(!(inv instanceof TileEntity)) - return null; - - TileEntity tile = (TileEntity) inv; - return getSparkForBlock(tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord); + public static ICorporeaSpark getSparkForInventory(InvWithLocation inv) { + TileEntity tile = inv.world.getTileEntity(inv.pos); + return getSparkForBlock(tile.getWorld(), tile.getPos()); } /** * Gets the spark attached to the block in the coords passed in. Note that the coords passed * in are for the block that the spark will be on, not the coords of the spark itself. */ - public static ICorporeaSpark getSparkForBlock(World world, int x, int y, int z) { - List sparks = world.getEntitiesWithinAABB(ICorporeaSpark.class, AxisAlignedBB.getBoundingBox(x, y + 1, z, x + 1, y + 2, z + 1)); - return sparks.isEmpty() ? null : sparks.get(0); + public static ICorporeaSpark getSparkForBlock(World world, BlockPos pos) { + List sparks = world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(pos.up(), pos.add(1, 2, 1)), Predicates.instanceOf(ICorporeaSpark.class)); + return sparks.isEmpty() ? null : ((ICorporeaSpark) sparks.get(0)); } /** * Gets if the block in the coords passed in has a spark attached. Note that the coords passed * in are for the block that the spark will be on, not the coords of the spark itself. */ - public static boolean doesBlockHaveSpark(World world, int x, int y, int z) { - return getSparkForBlock(world, x, y, z) != null; - } - - /** - * Gets if the slot passed in can be extracted from by a spark. - */ - public static boolean isValidSlot(IInventory inv, int slot) { - return !(inv instanceof ISidedInventory) || arrayHas(((ISidedInventory) inv).getAccessibleSlotsFromSide(ForgeDirection.UP.ordinal()), slot) && ((ISidedInventory) inv).canExtractItem(slot, inv.getStackInSlot(slot), ForgeDirection.UP.ordinal()); + public static boolean doesBlockHaveSpark(World world, BlockPos pos) { + return getSparkForBlock(world, pos) != null; } /** @@ -279,17 +269,6 @@ public final class CorporeaHelper { cachedNetworks.clear(); } - /** - * Helper method to check if an int array contains an int. - */ - public static boolean arrayHas(int[] arr, int val) { - for (int element : arr) - if(element == val) - return true; - - return false; - } - /** * Helper method to make stacksMatch() less messy. */ diff --git a/src/main/java/vazkii/botania/api/corporea/CorporeaRequest.java b/src/main/java/vazkii/botania/api/corporea/CorporeaRequest.java index b1156e584..576062879 100644 --- a/src/main/java/vazkii/botania/api/corporea/CorporeaRequest.java +++ b/src/main/java/vazkii/botania/api/corporea/CorporeaRequest.java @@ -10,8 +10,8 @@ package vazkii.botania.api.corporea; public class CorporeaRequest { - public Object matcher; - public boolean checkNBT; + public final Object matcher; + public final boolean checkNBT; public int count; public int foundItems = 0; public int extractedItems = 0; diff --git a/src/main/java/vazkii/botania/api/corporea/CorporeaRequestEvent.java b/src/main/java/vazkii/botania/api/corporea/CorporeaRequestEvent.java index a55ef7b75..ea628ef56 100644 --- a/src/main/java/vazkii/botania/api/corporea/CorporeaRequestEvent.java +++ b/src/main/java/vazkii/botania/api/corporea/CorporeaRequestEvent.java @@ -10,8 +10,8 @@ */ package vazkii.botania.api.corporea; -import cpw.mods.fml.common.eventhandler.Cancelable; -import cpw.mods.fml.common.eventhandler.Event; +import net.minecraftforge.fml.common.eventhandler.Cancelable; +import net.minecraftforge.fml.common.eventhandler.Event; /** * Fired when a corporea request is initiated. Can be cancelled. diff --git a/src/main/java/vazkii/botania/api/corporea/ICorporeaAutoCompleteController.java b/src/main/java/vazkii/botania/api/corporea/ICorporeaAutoCompleteController.java index fc0a3e9b9..1017006c6 100644 --- a/src/main/java/vazkii/botania/api/corporea/ICorporeaAutoCompleteController.java +++ b/src/main/java/vazkii/botania/api/corporea/ICorporeaAutoCompleteController.java @@ -10,9 +10,6 @@ */ package vazkii.botania.api.corporea; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - /** * An interface for systems which may control if the item auto complete system should be active */ @@ -21,7 +18,6 @@ public interface ICorporeaAutoCompleteController { /** * Return true if auto completion should be enabled. */ - @SideOnly(Side.CLIENT) public boolean shouldAutoComplete(); } diff --git a/src/main/java/vazkii/botania/api/corporea/ICorporeaInterceptor.java b/src/main/java/vazkii/botania/api/corporea/ICorporeaInterceptor.java index eeea16a79..c7d7f4609 100644 --- a/src/main/java/vazkii/botania/api/corporea/ICorporeaInterceptor.java +++ b/src/main/java/vazkii/botania/api/corporea/ICorporeaInterceptor.java @@ -10,11 +10,10 @@ */ package vazkii.botania.api.corporea; -import java.util.List; - -import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; +import java.util.List; + /** * A TileEntity that implements this will be able to intercept corporea * requests case there is a Corporea Spark on top. @@ -26,13 +25,13 @@ public interface ICorporeaInterceptor { * at this point, but the list of stacks is not complete. The request parameter can * be either a String or ItemStack. */ - public void interceptRequest(Object request, int count, ICorporeaSpark spark, ICorporeaSpark source, List stacks, List inventories, boolean doit); + public void interceptRequest(Object request, int count, ICorporeaSpark spark, ICorporeaSpark source, List stacks, List inventories, boolean doit); /** * Intercepts a request after all the stacks have been found and processed. Both the * list of inventories and stacks is complete at this point. The request parameter can * be either a String or ItemStack. */ - public void interceptRequestLast(Object request, int count, ICorporeaSpark spark, ICorporeaSpark source, List stacks, List inventories, boolean doit); + public void interceptRequestLast(Object request, int count, ICorporeaSpark spark, ICorporeaSpark source, List stacks, List inventories, boolean doit); } diff --git a/src/main/java/vazkii/botania/api/corporea/ICorporeaSpark.java b/src/main/java/vazkii/botania/api/corporea/ICorporeaSpark.java index 943e29e72..f44048595 100644 --- a/src/main/java/vazkii/botania/api/corporea/ICorporeaSpark.java +++ b/src/main/java/vazkii/botania/api/corporea/ICorporeaSpark.java @@ -10,11 +10,11 @@ */ package vazkii.botania.api.corporea; -import java.util.List; - -import net.minecraft.inventory.IInventory; +import net.minecraft.item.EnumDyeColor; import net.minecraft.item.ItemStack; +import java.util.List; + /** * An interface for a Corporea Spark. Includes functions for handling * connections. @@ -38,7 +38,7 @@ public interface ICorporeaSpark { /** * Gets the inventory this spark is bound to, generally the one right below it. */ - public IInventory getInventory(); + public InvWithLocation getSparkInventory(); /** * Gets the list of sparks this spark is connected to, see registerConnections(). This list @@ -82,6 +82,6 @@ public interface ICorporeaSpark { * Gets the network that this spark is on, or the color it's displaying. Sparks may only connect to others * of the same network, and on changing network should trigger a re-cache of the previous network. */ - public int getNetwork(); + public EnumDyeColor getNetwork(); } diff --git a/src/main/java/vazkii/botania/api/corporea/IWrappedInventory.java b/src/main/java/vazkii/botania/api/corporea/IWrappedInventory.java index 0b588f238..96f863af3 100644 --- a/src/main/java/vazkii/botania/api/corporea/IWrappedInventory.java +++ b/src/main/java/vazkii/botania/api/corporea/IWrappedInventory.java @@ -9,11 +9,10 @@ */ package vazkii.botania.api.corporea; -import java.util.List; - -import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; +import java.util.List; + /** * This interface wraps IInventory corporea works with in order to provide * compatibility with different storage mods. @@ -24,7 +23,7 @@ public interface IWrappedInventory { /** * Break encapsulation and exposes original inventory. */ - IInventory getWrappedObject(); + InvWithLocation getWrappedObject(); /** * Counts items in the inventory matching the request diff --git a/src/main/java/vazkii/botania/api/corporea/InvWithLocation.java b/src/main/java/vazkii/botania/api/corporea/InvWithLocation.java new file mode 100644 index 000000000..6fdff5a7d --- /dev/null +++ b/src/main/java/vazkii/botania/api/corporea/InvWithLocation.java @@ -0,0 +1,32 @@ +package vazkii.botania.api.corporea; + +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraftforge.items.IItemHandler; + +public class InvWithLocation { + + public final IItemHandler handler; + public final World world; + public final BlockPos pos; + + public InvWithLocation(IItemHandler itemHandler, World world, BlockPos pos) { + this.handler = itemHandler; + this.world = world; + this.pos = pos; + } + + @Override + public int hashCode() { + return 31 * handler.hashCode() ^ world.hashCode() ^ pos.hashCode(); + } + + @Override + public boolean equals(Object o) { + return o instanceof InvWithLocation + && handler.equals(((InvWithLocation) o).handler) + && world == ((InvWithLocation) o).world + && pos.equals(((InvWithLocation) o).pos); + } + +} diff --git a/src/main/java/vazkii/botania/api/internal/DummyManaNetwork.java b/src/main/java/vazkii/botania/api/internal/DummyManaNetwork.java index f74d0cac9..f28a7c9b2 100644 --- a/src/main/java/vazkii/botania/api/internal/DummyManaNetwork.java +++ b/src/main/java/vazkii/botania/api/internal/DummyManaNetwork.java @@ -10,41 +10,39 @@ */ package vazkii.botania.api.internal; -import java.util.ArrayList; -import java.util.List; - +import com.google.common.collect.ImmutableSet; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import vazkii.botania.api.mana.TileSignature; +import java.util.Set; + public class DummyManaNetwork implements IManaNetwork { public static final DummyManaNetwork instance = new DummyManaNetwork(); @Override - public void clear() { - // NO-OP - } + public void clear() {} @Override - public TileEntity getClosestPool(ChunkCoordinates pos, World world, int limit) { + public TileEntity getClosestPool(BlockPos pos, World world, int limit) { return null; } @Override - public TileEntity getClosestCollector(ChunkCoordinates pos, World world, int limit) { + public TileEntity getClosestCollector(BlockPos pos, World world, int limit) { return null; } @Override - public List getAllCollectorsInWorld(World world) { - return new ArrayList(); + public Set getAllCollectorsInWorld(World world) { + return ImmutableSet.of(); } @Override - public List getAllPoolsInWorld(World world) { - return new ArrayList(); + public Set getAllPoolsInWorld(World world) { + return ImmutableSet.of(); } } diff --git a/src/main/java/vazkii/botania/api/internal/DummyMethodHandler.java b/src/main/java/vazkii/botania/api/internal/DummyMethodHandler.java index 88ddf474d..b1f724be2 100644 --- a/src/main/java/vazkii/botania/api/internal/DummyMethodHandler.java +++ b/src/main/java/vazkii/botania/api/internal/DummyMethodHandler.java @@ -10,10 +10,8 @@ */ package vazkii.botania.api.internal; -import java.util.List; - import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -22,11 +20,13 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import vazkii.botania.api.boss.IBotaniaBoss; +import net.minecraftforge.items.IItemHandlerModifiable; import vazkii.botania.api.corporea.IWrappedInventory; +import vazkii.botania.api.corporea.InvWithLocation; import vazkii.botania.api.lexicon.LexiconPage; import vazkii.botania.api.lexicon.multiblock.MultiblockSet; import vazkii.botania.api.recipe.RecipeBrew; @@ -36,6 +36,8 @@ import vazkii.botania.api.recipe.RecipePetals; import vazkii.botania.api.recipe.RecipeRuneAltar; import vazkii.botania.api.subtile.SubTileEntity; +import java.util.List; + public class DummyMethodHandler implements IInternalMethodHandler { @Override @@ -119,7 +121,7 @@ public class DummyMethodHandler implements IInternalMethodHandler { @Override public ItemStack getSubTileAsStack(String subTile) { - return new ItemStack(Blocks.stone, 0, 0); + return new ItemStack(Blocks.STONE, 0, 0); } @Override @@ -133,13 +135,13 @@ public class DummyMethodHandler implements IInternalMethodHandler { } @Override - public IIcon getSubTileIconForName(String name) { - return Blocks.red_flower.getIcon(0, 0); + public ModelResourceLocation getSubTileBlockModelForName(String name) { + return new ModelResourceLocation("builtin/missing", "missing"); } @Override - public void registerBasicSignatureIcons(String name, IIconRegister register) { - // NO-OP + public ModelResourceLocation getSubTileItemModelForName(String name) { + return new ModelResourceLocation("builtin/missing", "missing"); } @Override @@ -148,35 +150,32 @@ public class DummyMethodHandler implements IInternalMethodHandler { } @Override - public void drawSimpleManaHUD(int color, int mana, int maxMana, String name, ScaledResolution res) { - // NO-OP - } + public void drawSimpleManaHUD(int color, int mana, int maxMana, String name, ScaledResolution res) {} @Override - public void drawComplexManaHUD(int color, int mana, int maxMana, String name, ScaledResolution res, ItemStack bindDisplay, boolean properlyBound) { - // NO-OP - } + public void drawComplexManaHUD(int color, int mana, int maxMana, String name, ScaledResolution res, ItemStack bindDisplay, boolean properlyBound) {} @Override public ItemStack getBindDisplayForFlowerType(SubTileEntity e) { - return new ItemStack(Blocks.stone, 0, 0); + return new ItemStack(Blocks.STONE, 0, 0); } @Override - public void renderLexiconText(int x, int y, int width, int height, String unlocalizedText) { - // NO-OP - } + public void renderLexiconText(int x, int y, int width, int height, String unlocalizedText) {} @Override - public void sparkleFX(World world, double x, double y, double z, float r, float g, float b, float size, int m) { - // NO-OP - } + public void sparkleFX(World world, double x, double y, double z, float r, float g, float b, float size, int m) {} @Override public IInventory getBaublesInventory(EntityPlayer player) { return null; } + @Override + public IItemHandlerModifiable getBaublesInventoryWrapped(EntityPlayer player) { + return null; + } + @Override public boolean shouldForceCheck() { return true; @@ -192,20 +191,13 @@ public class DummyMethodHandler implements IInternalMethodHandler { return null; } - @Override - public void setBossStatus(IBotaniaBoss status) { - // NO-OP - } - @Override public boolean isBuildcraftPipe(TileEntity tile) { return false; } @Override - public void breakOnAllCursors(EntityPlayer player, Item item, ItemStack stack, int x, int y, int z, int side) { - // NO-OP - } + public void breakOnAllCursors(EntityPlayer player, Item item, ItemStack stack, BlockPos pos, EnumFacing side) {} @Override public boolean hasSolegnoliaAround(Entity e) { @@ -218,17 +210,15 @@ public class DummyMethodHandler implements IInternalMethodHandler { } @Override - public boolean isBotaniaFlower(World world, int x, int y, int z) { + public boolean isBotaniaFlower(World world, BlockPos pos) { return false; } @Override - public void sendBaubleUpdatePacket(EntityPlayer player, int slot) { - // NO-OP - } + public void sendBaubleUpdatePacket(EntityPlayer player, int slot) {} @Override - public List wrapInventory(List inventories) { + public List wrapInventory(List inventories) { return null; } diff --git a/src/main/java/vazkii/botania/api/internal/DummyPage.java b/src/main/java/vazkii/botania/api/internal/DummyPage.java index 843198c41..3c5db7166 100644 --- a/src/main/java/vazkii/botania/api/internal/DummyPage.java +++ b/src/main/java/vazkii/botania/api/internal/DummyPage.java @@ -10,9 +10,9 @@ */ package vazkii.botania.api.internal; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.LexiconPage; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; /** * A dummy page. It does absolutely nothing and is only @@ -27,8 +27,6 @@ public class DummyPage extends LexiconPage { @Override @SideOnly(Side.CLIENT) - public void renderScreen(IGuiLexiconEntry gui, int x, int y) { - // NO-OP - } + public void renderScreen(IGuiLexiconEntry gui, int x, int y) {} } diff --git a/src/main/java/vazkii/botania/api/internal/IGuiLexiconEntry.java b/src/main/java/vazkii/botania/api/internal/IGuiLexiconEntry.java index b0d4d6ef4..f7703eea1 100644 --- a/src/main/java/vazkii/botania/api/internal/IGuiLexiconEntry.java +++ b/src/main/java/vazkii/botania/api/internal/IGuiLexiconEntry.java @@ -10,11 +10,11 @@ */ package vazkii.botania.api.internal; -import java.util.List; - import net.minecraft.client.gui.GuiButton; import vazkii.botania.api.lexicon.LexiconEntry; +import java.util.List; + /** * Internal interface for the Lexicon Entry GUI. This contains * everything that can be accessed from it. It's safe to cast diff --git a/src/main/java/vazkii/botania/api/internal/IInternalMethodHandler.java b/src/main/java/vazkii/botania/api/internal/IInternalMethodHandler.java index b0e3d10bd..a28793a87 100644 --- a/src/main/java/vazkii/botania/api/internal/IInternalMethodHandler.java +++ b/src/main/java/vazkii/botania/api/internal/IInternalMethodHandler.java @@ -10,10 +10,8 @@ */ package vazkii.botania.api.internal; -import java.util.List; - import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; @@ -21,11 +19,15 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import vazkii.botania.api.boss.IBotaniaBoss; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import net.minecraftforge.items.IItemHandlerModifiable; import vazkii.botania.api.corporea.IWrappedInventory; +import vazkii.botania.api.corporea.InvWithLocation; import vazkii.botania.api.lexicon.LexiconPage; import vazkii.botania.api.lexicon.multiblock.MultiblockSet; import vazkii.botania.api.recipe.RecipeBrew; @@ -34,8 +36,8 @@ import vazkii.botania.api.recipe.RecipeManaInfusion; import vazkii.botania.api.recipe.RecipePetals; import vazkii.botania.api.recipe.RecipeRuneAltar; import vazkii.botania.api.subtile.SubTileEntity; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; /** * Any methods that refer to internal methods in Botania are here. @@ -84,9 +86,11 @@ public interface IInternalMethodHandler { public String getStackSubTileKey(ItemStack stack); - public IIcon getSubTileIconForName(String name); + @SideOnly(Side.CLIENT) + public ModelResourceLocation getSubTileBlockModelForName(String name); - public void registerBasicSignatureIcons(String name, IIconRegister register); + @SideOnly(Side.CLIENT) + public ModelResourceLocation getSubTileItemModelForName(String name); public boolean shouldForceCheck(); @@ -94,7 +98,9 @@ public interface IInternalMethodHandler { public IInventory getBaublesInventory(EntityPlayer player); - public void breakOnAllCursors(EntityPlayer player, Item item, ItemStack stack, int x, int y, int z, int side); + public IItemHandlerModifiable getBaublesInventoryWrapped(EntityPlayer player); + + public void breakOnAllCursors(EntityPlayer player, Item item, ItemStack stack, BlockPos pos, EnumFacing side); public boolean hasSolegnoliaAround(Entity e); @@ -104,31 +110,25 @@ public interface IInternalMethodHandler { @SideOnly(Side.CLIENT) public void drawComplexManaHUD(int color, int mana, int maxMana, String name, ScaledResolution res, ItemStack bindDisplay, boolean properlyBound); - @SideOnly(Side.CLIENT) public ItemStack getBindDisplayForFlowerType(SubTileEntity e); - @SideOnly(Side.CLIENT) public void renderLexiconText(int x, int y, int width, int height, String unlocalizedText); - @SideOnly(Side.CLIENT) public ResourceLocation getDefaultBossBarTexture(); - @SideOnly(Side.CLIENT) - public void setBossStatus(IBotaniaBoss status); - public boolean isBuildcraftPipe(TileEntity tile); public void sparkleFX(World world, double x, double y, double z, float r, float g, float b, float size, int m); public long getWorldElapsedTicks(); - public boolean isBotaniaFlower(World world, int x, int y, int z); + public boolean isBotaniaFlower(World world, BlockPos pos); public void sendBaubleUpdatePacket(EntityPlayer player, int slot); /** * Wrap inventories in the network into wrappers providing compatibility for storage mods. */ - List wrapInventory(List inventories); + List wrapInventory(List inventories); } diff --git a/src/main/java/vazkii/botania/api/internal/IManaBurst.java b/src/main/java/vazkii/botania/api/internal/IManaBurst.java index 945aa9916..099e402d7 100644 --- a/src/main/java/vazkii/botania/api/internal/IManaBurst.java +++ b/src/main/java/vazkii/botania/api/internal/IManaBurst.java @@ -10,64 +10,64 @@ */ package vazkii.botania.api.internal; -import java.util.UUID; - import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.math.BlockPos; + +import java.util.UUID; /** * Interface for the Mana Burst entity. This can safely be casted to EntityThrowable. */ public interface IManaBurst { - public boolean isFake(); + boolean isFake(); - public void setMotion(double x, double y, double z); + void setMotion(double x, double y, double z); - public int getColor(); + int getColor(); - public void setColor(int color); + void setColor(int color); - public int getMana(); + int getMana(); - public void setMana(int mana); + void setMana(int mana); - public int getStartingMana(); + int getStartingMana(); - public void setStartingMana(int mana); + void setStartingMana(int mana); - public int getMinManaLoss(); + int getMinManaLoss(); - public void setMinManaLoss(int minManaLoss); + void setMinManaLoss(int minManaLoss); - public float getManaLossPerTick(); + float getManaLossPerTick(); - public void setManaLossPerTick(float mana); + void setManaLossPerTick(float mana); - public float getGravity(); + float getGravity(); - public void setGravity(float gravity); + void setGravity(float gravity); - public ChunkCoordinates getBurstSourceChunkCoordinates(); + BlockPos getBurstSourceBlockPos(); - public void setBurstSourceCoords(int x, int y, int z); + void setBurstSourceCoords(BlockPos pos); - public ItemStack getSourceLens(); + ItemStack getSourceLens(); - public void setSourceLens(ItemStack lens); + void setSourceLens(ItemStack lens); - public boolean hasAlreadyCollidedAt(int x, int y, int z); + boolean hasAlreadyCollidedAt(BlockPos pos); - public void setCollidedAt(int x, int y, int z); + void setCollidedAt(BlockPos pos); - public int getTicksExisted(); + int getTicksExisted(); - public void setFake(boolean fake); + void setFake(boolean fake); - public void setShooterUUID(UUID uuid); + void setShooterUUID(UUID uuid); - public UUID getShooterUIID(); + UUID getShooterUUID(); - public void ping(); + void ping(); } diff --git a/src/main/java/vazkii/botania/api/internal/IManaNetwork.java b/src/main/java/vazkii/botania/api/internal/IManaNetwork.java index fc4553e46..95e169c90 100644 --- a/src/main/java/vazkii/botania/api/internal/IManaNetwork.java +++ b/src/main/java/vazkii/botania/api/internal/IManaNetwork.java @@ -10,13 +10,13 @@ */ package vazkii.botania.api.internal; -import java.util.List; - import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import vazkii.botania.api.mana.TileSignature; +import java.util.Set; + /** * A basic interface for a world's Mana Network. * @see IInternalMethodHandler#getManaNetworkInstance() @@ -38,7 +38,7 @@ public interface IManaNetwork { * @param limit The maximum distance the closest block can be, if the closest block * is farther away than that, null will be returned instead. */ - public TileEntity getClosestCollector(ChunkCoordinates pos, World world, int limit); + public TileEntity getClosestCollector(BlockPos pos, World world, int limit); /** * Gets the closest Mana Pool in the network to the Chunk Coordinates passed in, @@ -49,19 +49,19 @@ public interface IManaNetwork { * @param limit The maximum distance the closest block can be, if the closest block * is farther away than that, null will be returned instead. */ - public TileEntity getClosestPool(ChunkCoordinates pos, World world, int limit); + public TileEntity getClosestPool(BlockPos pos, World world, int limit); /** - * Gets the list of all Mana Collectors (eg. Mana Spreader) in the dimension - * passed in. Note that this is the actual list and not a copy, make sure to - * clone the list if you intend to change it in any way. + * Gets the set of all Mana Collectors (eg. Mana Spreader) in the dimension + * passed in. Note that this is the actual set and not a copy, make sure to + * clone the set if you intend to change it in any way. */ - public List getAllCollectorsInWorld(World world); + public Set getAllCollectorsInWorld(World world); /** - * Gets the list of all Mana Pools in the dimension passed in. Note that this - * is the actual list and not a copy, make sure to clone the list if you intend + * Gets the set of all Mana Pools in the dimension passed in. Note that this + * is the actual set and not a copy, make sure to clone the set if you intend * to change it in any way. */ - public List getAllPoolsInWorld(World world); + public Set getAllPoolsInWorld(World world); } diff --git a/src/main/java/vazkii/botania/api/internal/ShaderCallback.java b/src/main/java/vazkii/botania/api/internal/ShaderCallback.java index 12186a231..26ac40a42 100644 --- a/src/main/java/vazkii/botania/api/internal/ShaderCallback.java +++ b/src/main/java/vazkii/botania/api/internal/ShaderCallback.java @@ -13,8 +13,9 @@ package vazkii.botania.api.internal; /** * A Callback for when a shader is called. Used to define shader uniforms. */ -public abstract class ShaderCallback { +@FunctionalInterface +public interface ShaderCallback { - public abstract void call(int shader); + void call(int shader); } diff --git a/src/main/java/vazkii/botania/api/internal/VanillaPacketDispatcher.java b/src/main/java/vazkii/botania/api/internal/VanillaPacketDispatcher.java index dff8b9636..6d66580ed 100644 --- a/src/main/java/vazkii/botania/api/internal/VanillaPacketDispatcher.java +++ b/src/main/java/vazkii/botania/api/internal/VanillaPacketDispatcher.java @@ -10,27 +10,24 @@ */ package vazkii.botania.api.internal; -import java.util.List; - +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.play.server.SPacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraft.world.WorldServer; public final class VanillaPacketDispatcher { public static void dispatchTEToNearbyPlayers(TileEntity tile) { - World world = tile.getWorldObj(); - List players = world.playerEntities; - for(Object player : players) - if(player instanceof EntityPlayerMP) { - EntityPlayerMP mp = (EntityPlayerMP) player; - if(pointDistancePlane(mp.posX, mp.posZ, tile.xCoord + 0.5, tile.zCoord + 0.5) < 64) - ((EntityPlayerMP) player).playerNetServerHandler.sendPacket(tile.getDescriptionPacket()); - } + IBlockState state = tile.getWorld().getBlockState(tile.getPos()); + tile.getWorld().notifyBlockUpdate(tile.getPos(), state, state, 8); } - public static void dispatchTEToNearbyPlayers(World world, int x, int y, int z) { - TileEntity tile = world.getTileEntity(x, y, z); + public static void dispatchTEToNearbyPlayers(World world, BlockPos pos) { + TileEntity tile = world.getTileEntity(pos); if(tile != null) dispatchTEToNearbyPlayers(tile); } diff --git a/src/main/java/vazkii/botania/api/item/IAvatarTile.java b/src/main/java/vazkii/botania/api/item/IAvatarTile.java index c89f903b2..5112d5cec 100644 --- a/src/main/java/vazkii/botania/api/item/IAvatarTile.java +++ b/src/main/java/vazkii/botania/api/item/IAvatarTile.java @@ -10,13 +10,19 @@ */ package vazkii.botania.api.item; -import net.minecraft.inventory.IInventory; +import net.minecraftforge.items.IItemHandler; import vazkii.botania.api.mana.IManaReceiver; /** * A TileEntity that implements this is considered an Avatar. */ -public interface IAvatarTile extends IInventory, IManaReceiver { +public interface IAvatarTile extends IManaReceiver { + + /** + * Gets the avatar's inventory + * @return An IItemhandler representing the avatar's inventory + */ + public IItemHandler getInventory(); /** * Gets the amount of ticks that have elapsed on this avatar while it's functional diff --git a/src/main/java/vazkii/botania/api/item/IBaubleRender.java b/src/main/java/vazkii/botania/api/item/IBaubleRender.java index d98a29434..6eb04fcc0 100644 --- a/src/main/java/vazkii/botania/api/item/IBaubleRender.java +++ b/src/main/java/vazkii/botania/api/item/IBaubleRender.java @@ -10,15 +10,10 @@ */ package vazkii.botania.api.item; -import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraftforge.client.event.RenderPlayerEvent; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.util.math.MathHelper; /** * A Bauble Item that implements this will be have hooks to render something on @@ -35,30 +30,72 @@ public interface IBaubleRender { * rendering. Will not be called if the item is a ICosmeticAttachable and * has a cosmetic bauble attached to it. */ - @SideOnly(Side.CLIENT) - public void onPlayerBaubleRender(ItemStack stack, RenderPlayerEvent event, RenderType type); + public void onPlayerBaubleRender(ItemStack stack, EntityPlayer player, RenderType type, float partialTicks); /** * A few helper methods for the render. */ - public static class Helper { + final class Helper { + /** + * Rotates the render for a bauble correctly if the player is sneaking. + * Use for renders under {@link RenderType#BODY}. + */ public static void rotateIfSneaking(EntityPlayer player) { if(player.isSneaking()) applySneakingRotation(); } + /** + * Rotates the render for a bauble correctly for a sneaking player. + * Use for renders under {@link RenderType#BODY}. + */ public static void applySneakingRotation() { - GL11.glRotatef(28.64789F, 1.0F, 0.0F, 0.0F); + GlStateManager.translate(0F, 0.2F, 0F); + GlStateManager.rotate(90F / (float) Math.PI, 1.0F, 0.0F, 0.0F); } + /** + * Shifts the render for a bauble correctly to the head, including sneaking rotation. + * Use for renders under {@link RenderType#HEAD}. + */ public static void translateToHeadLevel(EntityPlayer player) { - GL11.glTranslated(0, (player != Minecraft.getMinecraft().thePlayer ? 1.68F : 0F) - player.getDefaultEyeHeight() + (player.isSneaking() ? 0.0625 : 0), 0); + GlStateManager.translate(0, -player.getDefaultEyeHeight(), 0); + if (player.isSneaking()) + GlStateManager.translate(0.25F * MathHelper.sin(player.rotationPitch * (float) Math.PI / 180), 0.25F * MathHelper.cos(player.rotationPitch * (float) Math.PI / 180), 0F); + } + + /** + * Shifts the render for a bauble correctly to the face. + * Use for renders under {@link RenderType#HEAD}, and usually after calling {@link Helper#translateToHeadLevel(EntityPlayer)}. + */ + public static void translateToFace() { + GlStateManager.rotate(90F, 0F, 1F, 0F); + GlStateManager.rotate(180F, 1F, 0F, 0F); + GlStateManager.translate(0f, -4.35f, -1.27f); + } + + /** + * Scales down the render to a correct size. + * Use for any render. + */ + public static void defaultTransforms() { + GlStateManager.translate(0.0, 3.0, 1.0); + GlStateManager.scale(0.55, 0.55, 0.55); + } + + /** + * Shifts the render for a bauble correctly to the chest. + * Use for renders under {@link RenderType#BODY}, and usually after calling {@link Helper#rotateIfSneaking(EntityPlayer)}. + */ + public static void translateToChest() { + GlStateManager.rotate(180F, 1F, 0F, 0F); + GlStateManager.translate(0F, -3.2F, -0.85F); } } - public static enum RenderType { + enum RenderType { /** * Render Type for the player's body, translations apply on the player's rotation. * Sneaking is not handled and should be done during the render. @@ -68,7 +105,7 @@ public interface IBaubleRender { /** * Render Type for the player's body, translations apply on the player's head rotations. - * Sneaking is not handled and should be done during the render.~ + * Sneaking is not handled and should be done during the render. * @see IBaubleRender.Helper */ HEAD; diff --git a/src/main/java/vazkii/botania/api/item/IDyablePool.java b/src/main/java/vazkii/botania/api/item/IDyablePool.java deleted file mode 100644 index 8bb8e94eb..000000000 --- a/src/main/java/vazkii/botania/api/item/IDyablePool.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 18, 2015, 12:20:44 AM (GMT)] - */ -package vazkii.botania.api.item; - - -/** - * Used to define a Mana Pool that can be dyed through floral powder. - */ -public interface IDyablePool { - - public int getColor(); - - public void setColor(int color); - - -} diff --git a/src/main/java/vazkii/botania/api/item/IExtendedWireframeCoordinateListProvider.java b/src/main/java/vazkii/botania/api/item/IExtendedWireframeCoordinateListProvider.java deleted file mode 100644 index 7713eaa5b..000000000 --- a/src/main/java/vazkii/botania/api/item/IExtendedWireframeCoordinateListProvider.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Apr 30, 2015, 1:43:17 PM (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; - -/** - * An extension of IWireframeCoordinateListProvider that allows for - * rendering a single thicker wireframe. - */ -public interface IExtendedWireframeCoordinateListProvider extends IWireframeCoordinateListProvider { - - /** - * Gets the source wireframe to draw, this one will be drawn thicker. - */ - public ChunkCoordinates getSourceWireframe(EntityPlayer player, ItemStack stack); - -} diff --git a/src/main/java/vazkii/botania/api/item/IFloatingFlower.java b/src/main/java/vazkii/botania/api/item/IFloatingFlower.java new file mode 100644 index 000000000..b685b8c92 --- /dev/null +++ b/src/main/java/vazkii/botania/api/item/IFloatingFlower.java @@ -0,0 +1,63 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + * + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + * + * File Created @ [Nov 17, 2014, 6:05:18 PM (GMT)] + */ +package vazkii.botania.api.item; + +import net.minecraft.item.ItemStack; + +import java.util.HashMap; + +public interface IFloatingFlower { + + public ItemStack getDisplayStack(); + + public IslandType getIslandType(); + + public void setIslandType(IslandType type); + + public class IslandType { + private static final HashMap registry = new HashMap<>(); + + public static final IslandType GRASS = new IslandType("GRASS"); + public static final IslandType PODZOL = new IslandType("PODZOL"); + public static final IslandType MYCEL = new IslandType("MYCEL"); + public static final IslandType SNOW = new IslandType("SNOW"); + public static final IslandType DRY = new IslandType("DRY"); + public static final IslandType GOLDEN = new IslandType("GOLDEN"); + public static final IslandType VIVID = new IslandType("VIVID"); + public static final IslandType SCORCHED = new IslandType("SCORCHED"); + public static final IslandType INFUSED = new IslandType("INFUSED"); + public static final IslandType MUTATED = new IslandType("MUTATED"); + + private final String typeName; + + /** + * Instantiates and registers a new floating flower island type + * Note that you need to register the model for this island type, see BotaniaAPIClient + * @param name The name of this floating flower island type + */ + public IslandType(String name) { + if (registry.containsKey(name)) throw new IllegalArgumentException(name+" already registered!"); + this.typeName = name; + registry.put(name, this); + } + + public static IslandType ofType(String typeStr) { + IslandType type = registry.get(typeStr); + return type == null ? GRASS : type; + } + + public String toString() { + return this.typeName; + } + + } + +} diff --git a/src/main/java/vazkii/botania/api/item/IFlowerPlaceable.java b/src/main/java/vazkii/botania/api/item/IFlowerPlaceable.java index 05f1f1f40..bfdf24789 100644 --- a/src/main/java/vazkii/botania/api/item/IFlowerPlaceable.java +++ b/src/main/java/vazkii/botania/api/item/IFlowerPlaceable.java @@ -9,8 +9,9 @@ * File Created @ [17/11/2015, 20:10:53 (GMT)] */ package vazkii.botania.api.item; -import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.item.ItemStack; +import net.minecraft.util.math.BlockPos; import vazkii.botania.api.subtile.SubTileEntity; /** @@ -19,9 +20,15 @@ import vazkii.botania.api.subtile.SubTileEntity; public interface IFlowerPlaceable { /** - * Gets the block to be placed, return null to not place anything. + * Gets the state to be placed, return null to not place anything. */ - public Block getBlockToPlaceByFlower(ItemStack stack, SubTileEntity flower, int x, int y, int z); + public IBlockState getBlockToPlaceByFlower(ItemStack stack, SubTileEntity flower, BlockPos pos); - public void onBlockPlacedByFlower(ItemStack stack, SubTileEntity flower, int x, int y, int z); + /** + * Called after the block is placed. + * @param stack The stack that was placed. + * @param flower The flower doing the placing. + * @param pos The position that was placed at. + */ + public void onBlockPlacedByFlower(ItemStack stack, SubTileEntity flower, BlockPos pos); } diff --git a/src/main/java/vazkii/botania/api/item/IFlowerlessBiome.java b/src/main/java/vazkii/botania/api/item/IFlowerlessBiome.java index 16543e4c9..bff791bb5 100644 --- a/src/main/java/vazkii/botania/api/item/IFlowerlessBiome.java +++ b/src/main/java/vazkii/botania/api/item/IFlowerlessBiome.java @@ -11,7 +11,7 @@ package vazkii.botania.api.item; import net.minecraft.world.World; /** - * A BiomeGenBase that implements this will not have Botania flowers generated. + * A Biome that implements this will not have Botania flowers generated. */ public interface IFlowerlessBiome { /** diff --git a/src/main/java/vazkii/botania/api/item/IGrassHornExcempt.java b/src/main/java/vazkii/botania/api/item/IGrassHornExcempt.java deleted file mode 100644 index 601ad9113..000000000 --- a/src/main/java/vazkii/botania/api/item/IGrassHornExcempt.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Oct 29, 2014, 4:52:04 PM (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.world.World; - -/** - * A BlockBush can implement this to check if it can be broken - * by a Horn/Drum of the Wild or not. - * @Deprecated Use IHornHarvestable instead - */ -@Deprecated -public interface IGrassHornExcempt { - - public boolean canUproot(World world, int x, int y, int z); - -} diff --git a/src/main/java/vazkii/botania/api/item/IHornHarvestable.java b/src/main/java/vazkii/botania/api/item/IHornHarvestable.java index a74af38dc..a6ef982fc 100644 --- a/src/main/java/vazkii/botania/api/item/IHornHarvestable.java +++ b/src/main/java/vazkii/botania/api/item/IHornHarvestable.java @@ -11,6 +11,7 @@ package vazkii.botania.api.item; import net.minecraft.item.ItemStack; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; /** @@ -22,20 +23,20 @@ public interface IHornHarvestable { * Returns true if this block can be uprooted. * Note that the stack param can be null if it's a drum breaking it. */ - public boolean canHornHarvest(World world, int x, int y, int z, ItemStack stack, EnumHornType hornType); + public boolean canHornHarvest(World world, BlockPos pos, ItemStack stack, EnumHornType hornType); /** * Returns true if harvestByHorn() should be called. If false it just uses the normal * block breaking method. * Note that the stack param can be null if it's a drum breaking it. */ - public boolean hasSpecialHornHarvest(World world, int x, int y, int z, ItemStack stack, EnumHornType hornType); + public boolean hasSpecialHornHarvest(World world, BlockPos pos, ItemStack stack, EnumHornType hornType); /** * Called to harvest by a horn. * Note that the stack param can be null if it's a drum breaking it. */ - public void harvestByHorn(World world, int x, int y, int z, ItemStack stack, EnumHornType hornType); + public void harvestByHorn(World world, BlockPos pos, ItemStack stack, EnumHornType hornType); public static enum EnumHornType { diff --git a/src/main/java/vazkii/botania/api/item/IManaDissolvable.java b/src/main/java/vazkii/botania/api/item/IManaDissolvable.java index 0d9ad5d4e..8e389ff63 100644 --- a/src/main/java/vazkii/botania/api/item/IManaDissolvable.java +++ b/src/main/java/vazkii/botania/api/item/IManaDissolvable.java @@ -22,7 +22,7 @@ public interface IManaDissolvable { /** * Called for every tick the item is on a mana pool. If the stack has stack - * size 0 the item is killed. This is called in both the server and client. + * size 0 the item is killed. This is called serverside. */ public void onDissolveTick(IManaPool pool, ItemStack stack, EntityItem item); diff --git a/src/main/java/vazkii/botania/api/item/IManaProficiencyArmor.java b/src/main/java/vazkii/botania/api/item/IManaProficiencyArmor.java index 595e800db..bce037fa3 100644 --- a/src/main/java/vazkii/botania/api/item/IManaProficiencyArmor.java +++ b/src/main/java/vazkii/botania/api/item/IManaProficiencyArmor.java @@ -11,6 +11,7 @@ package vazkii.botania.api.item; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -23,16 +24,18 @@ import net.minecraft.item.ItemStack; */ public interface IManaProficiencyArmor { - public boolean shouldGiveProficiency(ItemStack stack, int slot, EntityPlayer player); + public boolean shouldGiveProficiency(ItemStack stack, EntityEquipmentSlot slot, EntityPlayer player); public final static class Helper { public static boolean hasProficiency(EntityPlayer player) { - for(int i = 0; i < 4; i++) { - ItemStack armor = player.getCurrentArmor(i); + for(EntityEquipmentSlot e: EntityEquipmentSlot.values()) { + if(e.getSlotType() != EntityEquipmentSlot.Type.ARMOR) + continue; + ItemStack armor = player.getItemStackFromSlot(e); if(armor != null) { Item item = armor.getItem(); - if(item instanceof IManaProficiencyArmor && ((IManaProficiencyArmor) item).shouldGiveProficiency(armor, i, player)) + if(item instanceof IManaProficiencyArmor && ((IManaProficiencyArmor) item).shouldGiveProficiency(armor, e, player)) return true; } } diff --git a/src/main/java/vazkii/botania/api/item/IRelic.java b/src/main/java/vazkii/botania/api/item/IRelic.java index aecd1cde4..39e7528a3 100644 --- a/src/main/java/vazkii/botania/api/item/IRelic.java +++ b/src/main/java/vazkii/botania/api/item/IRelic.java @@ -13,6 +13,8 @@ package vazkii.botania.api.item; import net.minecraft.item.ItemStack; import net.minecraft.stats.Achievement; +import java.util.UUID; + /** * An item that implements this counts as a Relic item. This is purely for interaction * and other mod items should not implement this interface. @@ -22,13 +24,31 @@ public interface IRelic { /** * Binds to the player name passed in. */ + @Deprecated public void bindToUsername(String playerName, ItemStack stack); /** - * Gets the username of the person this relic is bound to. + * Gets the username of the person this relic is bound to, or the empty String if the username field is empty. + * You should not use this to determine if a relic is bound, use UUIDs instead. */ + @Deprecated public String getSoulbindUsername(ItemStack stack); + /** + * Binds to the UUID passed in. + */ + public void bindToUUID(UUID uuid, ItemStack stack); + + /** + * Gets the UUID of the person this relic is bound to, or null if a well-formed UUID could not be found + */ + public UUID getSoulbindUUID(ItemStack stack); + + /** + * Checks if the relic contains a well-formed UUID. + */ + public boolean hasUUID(ItemStack stack); + /** * Sets the achievement that this relic binds to. */ diff --git a/src/main/java/vazkii/botania/api/item/ISequentialBreaker.java b/src/main/java/vazkii/botania/api/item/ISequentialBreaker.java index 87af2d04d..6d7969468 100644 --- a/src/main/java/vazkii/botania/api/item/ISequentialBreaker.java +++ b/src/main/java/vazkii/botania/api/item/ISequentialBreaker.java @@ -12,6 +12,8 @@ package vazkii.botania.api.item; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; /** * An item that implements this can break multiple blocks at once @@ -20,7 +22,7 @@ import net.minecraft.item.ItemStack; */ public interface ISequentialBreaker { - public void breakOtherBlock(EntityPlayer player, ItemStack stack, int x, int y, int z, int originX, int originY, int originZ, int side); + public void breakOtherBlock(EntityPlayer player, ItemStack stack, BlockPos pos, BlockPos originPos, EnumFacing side); public boolean disposeOfTrashBlocks(ItemStack stack); diff --git a/src/main/java/vazkii/botania/api/item/IWireframeCoordinateListProvider.java b/src/main/java/vazkii/botania/api/item/IWireframeCoordinateListProvider.java index ae0863ce7..91786ad12 100644 --- a/src/main/java/vazkii/botania/api/item/IWireframeCoordinateListProvider.java +++ b/src/main/java/vazkii/botania/api/item/IWireframeCoordinateListProvider.java @@ -10,13 +10,11 @@ */ package vazkii.botania.api.item; -import java.util.List; - import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.util.math.BlockPos; + +import java.util.List; /** * An item that implements this will allow for various wireframes to be drawn @@ -26,10 +24,17 @@ import cpw.mods.fml.relauncher.SideOnly; public interface IWireframeCoordinateListProvider { /** - * Returns a list of ChunkCoordinates for the wireframes to draw. - * Can be null. + * Returns a list of BlockPos for the wireframes to draw. + * Will not be null. */ - @SideOnly(Side.CLIENT) - public List getWireframesToDraw(EntityPlayer player, ItemStack stack); + public List getWireframesToDraw(EntityPlayer player, ItemStack stack); + + /** + * Gets a wireframe to draw thicker than the rest. + * This is useful to indicate the precedence of some position over the others. + * @return The position of a single wireframe to draw thicker than all the others. + */ + public BlockPos getSourceWireframe(EntityPlayer player, ItemStack stack); + } diff --git a/src/main/java/vazkii/botania/api/item/TinyPotatoRenderEvent.java b/src/main/java/vazkii/botania/api/item/TinyPotatoRenderEvent.java index 8b51c2634..440004a12 100644 --- a/src/main/java/vazkii/botania/api/item/TinyPotatoRenderEvent.java +++ b/src/main/java/vazkii/botania/api/item/TinyPotatoRenderEvent.java @@ -11,28 +11,26 @@ package vazkii.botania.api.item; import net.minecraft.tileentity.TileEntity; -import cpw.mods.fml.common.eventhandler.Event; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraftforge.fml.common.eventhandler.Event; /** * Why would you ever want this ._. */ -@SideOnly(Side.CLIENT) public class TinyPotatoRenderEvent extends Event { public final TileEntity tile; public final String name; public final double x, y, z; public final float partTicks; + public final int destroyStage; - public TinyPotatoRenderEvent(TileEntity tile, String name, double x, double y, double z, float partTicks) { + public TinyPotatoRenderEvent(TileEntity tile, String name, double x, double y, double z, float partTicks, int destroyStage) { this.tile = tile; this.name = name; this.x = x; this.y = y; this.z = z; this.partTicks = partTicks; + this.destroyStage = destroyStage; } - -} +} \ No newline at end of file diff --git a/src/main/java/vazkii/botania/api/lexicon/BotaniaTutorialStartEvent.java b/src/main/java/vazkii/botania/api/lexicon/BotaniaTutorialStartEvent.java index c082572b8..73ec1c9b0 100644 --- a/src/main/java/vazkii/botania/api/lexicon/BotaniaTutorialStartEvent.java +++ b/src/main/java/vazkii/botania/api/lexicon/BotaniaTutorialStartEvent.java @@ -10,9 +10,9 @@ */ package vazkii.botania.api.lexicon; -import java.util.Queue; +import net.minecraftforge.fml.common.eventhandler.Event; -import cpw.mods.fml.common.eventhandler.Event; +import java.util.Queue; /** * Fired when the Lexica Botania's tutorial is started. You can add your diff --git a/src/main/java/vazkii/botania/api/lexicon/ILexiconable.java b/src/main/java/vazkii/botania/api/lexicon/ILexiconable.java index 5baff9f51..13b076278 100644 --- a/src/main/java/vazkii/botania/api/lexicon/ILexiconable.java +++ b/src/main/java/vazkii/botania/api/lexicon/ILexiconable.java @@ -12,6 +12,7 @@ package vazkii.botania.api.lexicon; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; /** @@ -23,6 +24,6 @@ public interface ILexiconable { /** * Gets the lexicon entry to open at this location. null works too. */ - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon); + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon); } diff --git a/src/main/java/vazkii/botania/api/lexicon/KnowledgeType.java b/src/main/java/vazkii/botania/api/lexicon/KnowledgeType.java index 5a08c9ceb..26c182067 100644 --- a/src/main/java/vazkii/botania/api/lexicon/KnowledgeType.java +++ b/src/main/java/vazkii/botania/api/lexicon/KnowledgeType.java @@ -1,14 +1,14 @@ package vazkii.botania.api.lexicon; -import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.text.TextFormatting; public class KnowledgeType { public final String id; - public final EnumChatFormatting color; + public final TextFormatting color; public final boolean autoUnlock; - public KnowledgeType(String id, EnumChatFormatting color, boolean autoUnlock) { + public KnowledgeType(String id, TextFormatting color, boolean autoUnlock) { this.id = id; this.color = color; this.autoUnlock = autoUnlock; diff --git a/src/main/java/vazkii/botania/api/lexicon/LexiconCategory.java b/src/main/java/vazkii/botania/api/lexicon/LexiconCategory.java index 06f678d0d..88d339381 100644 --- a/src/main/java/vazkii/botania/api/lexicon/LexiconCategory.java +++ b/src/main/java/vazkii/botania/api/lexicon/LexiconCategory.java @@ -10,17 +10,18 @@ */ package vazkii.botania.api.lexicon; +import net.minecraft.util.ResourceLocation; + +import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.List; -import net.minecraft.util.ResourceLocation; - public class LexiconCategory implements Comparable { private static int count = 0; public final String unlocalizedName; - public final List entries = new ArrayList(); + public final List entries = new ArrayList<>(); private final int sortingId; private ResourceLocation icon; private int priority = 5; @@ -70,7 +71,7 @@ public class LexiconCategory implements Comparable { } @Override - public int compareTo(LexiconCategory category) { + public int compareTo(@Nonnull LexiconCategory category) { return priority == category.priority ? sortingId - category.sortingId : category.priority - priority; } } diff --git a/src/main/java/vazkii/botania/api/lexicon/LexiconEntry.java b/src/main/java/vazkii/botania/api/lexicon/LexiconEntry.java index 2bc025065..22ad55673 100644 --- a/src/main/java/vazkii/botania/api/lexicon/LexiconEntry.java +++ b/src/main/java/vazkii/botania/api/lexicon/LexiconEntry.java @@ -10,16 +10,17 @@ */ package vazkii.botania.api.lexicon; +import net.minecraft.item.ItemStack; +import net.minecraft.util.text.translation.I18n; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.api.BotaniaAPI; + +import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; -import vazkii.botania.api.BotaniaAPI; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - public class LexiconEntry implements Comparable { public final String unlocalizedName; @@ -27,11 +28,11 @@ public class LexiconEntry implements Comparable { private KnowledgeType type = BotaniaAPI.basicKnowledge; - public List pages = new ArrayList(); + public final List pages = new ArrayList<>(); private boolean priority = false; private ItemStack icon = null; - private List extraDisplayedRecipes = new ArrayList(); + private final List extraDisplayedRecipes = new ArrayList<>(); /** * @param unlocalizedName The unlocalized name of this entry. This will be localized by the client display. @@ -122,16 +123,16 @@ public class LexiconEntry implements Comparable { } public final String getNameForSorting() { - return (priority ? 0 : 1) + StatCollector.translateToLocal(getUnlocalizedName()); + return (priority ? 0 : 1) + I18n.translateToLocal(getUnlocalizedName()); } public List getDisplayedRecipes() { - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList<>(); for(LexiconPage page : pages) { List l = page.getDisplayedRecipes(); if(l != null) { - ArrayList itemsAddedThisPage = new ArrayList(); + ArrayList itemsAddedThisPage = new ArrayList<>(); for(ItemStack s : l) { addItem: { @@ -159,7 +160,7 @@ public class LexiconEntry implements Comparable { } @Override - public int compareTo(LexiconEntry o) { + public int compareTo(@Nonnull LexiconEntry o) { return getNameForSorting().compareTo(o.getNameForSorting()); } diff --git a/src/main/java/vazkii/botania/api/lexicon/LexiconPage.java b/src/main/java/vazkii/botania/api/lexicon/LexiconPage.java index 9880b9e9e..9fa6fbe49 100644 --- a/src/main/java/vazkii/botania/api/lexicon/LexiconPage.java +++ b/src/main/java/vazkii/botania/api/lexicon/LexiconPage.java @@ -10,13 +10,13 @@ */ package vazkii.botania.api.lexicon; -import java.util.List; - import net.minecraft.client.gui.GuiButton; import net.minecraft.item.ItemStack; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.internal.IGuiLexiconEntry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public abstract class LexiconPage { @@ -40,9 +40,7 @@ public abstract class LexiconPage { * Called per update tick. Non gui-sensitive version, kept for backwards compatibility only. */ @SideOnly(Side.CLIENT) - public void updateScreen() { - // NO-OP - } + public void updateScreen() {} /** * Called per update tick. Feel free to override fully, the @@ -58,41 +56,31 @@ public abstract class LexiconPage { * You can add buttons and whatever you'd do on initGui() here. */ @SideOnly(Side.CLIENT) - public void onOpened(IGuiLexiconEntry gui) { - // NO-OP - } + public void onOpened(IGuiLexiconEntry gui) {} /** * Called when this page is opened, be it via closing the gui or when the player changes page. * Make sure to dispose of anything you don't use any more, such as buttons in the gui's buttonList. */ @SideOnly(Side.CLIENT) - public void onClosed(IGuiLexiconEntry gui) { - // NO-OP - } + public void onClosed(IGuiLexiconEntry gui) {} /** * Called when a button is pressed, equivalent to GuiScreen.actionPerformed. */ @SideOnly(Side.CLIENT) - public void onActionPerformed(IGuiLexiconEntry gui, GuiButton button) { - // NO-OP - } + public void onActionPerformed(IGuiLexiconEntry gui, GuiButton button) {} /** * Called when a key is pressed. */ @SideOnly(Side.CLIENT) - public void onKeyPressed(char c, int key) { - // NO-OP - } + public void onKeyPressed(char c, int key) {} /** * Called when {@link LexiconEntry#setLexiconPages(LexiconPage...)} is called. */ - public void onPageAdded(LexiconEntry entry, int index) { - // NO-OP - } + public void onPageAdded(LexiconEntry entry, int index) {} /** * Shows the list of recipes present in this page for display in the category diff --git a/src/main/java/vazkii/botania/api/lexicon/LexiconRecipeMappings.java b/src/main/java/vazkii/botania/api/lexicon/LexiconRecipeMappings.java index 8202a40a7..156d34298 100644 --- a/src/main/java/vazkii/botania/api/lexicon/LexiconRecipeMappings.java +++ b/src/main/java/vazkii/botania/api/lexicon/LexiconRecipeMappings.java @@ -10,12 +10,13 @@ */ package vazkii.botania.api.lexicon; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; +import vazkii.botania.api.mana.IManaItem; + import java.util.HashMap; import java.util.Map; -import net.minecraft.item.ItemStack; -import vazkii.botania.api.mana.IManaItem; - /** * This class contains mappings for which entry and page correspond to each * craftable ItemStack. Use the map method to map an ItemStack to a page in @@ -23,7 +24,7 @@ import vazkii.botania.api.mana.IManaItem; */ public final class LexiconRecipeMappings { - private static Map mappings = new HashMap(); + private static final Map mappings = new HashMap<>(); /** * Maps the given stack to the given page of the entry. @@ -47,21 +48,28 @@ public final class LexiconRecipeMappings { } public static EntryData getDataForStack(ItemStack stack) { + String wildKey = stackToString(stack, true); + if (mappings.containsKey(wildKey)) + return mappings.get(wildKey); return mappings.get(stackToString(stack)); } public static String stackToString(ItemStack stack) { + return stackToString(stack, false); + } + + public static String stackToString(ItemStack stack, boolean forceIgnore) { if(stack == null || stack.getItem() == null) return "NULL"; - + if(stack.hasTagCompound() && stack.getItem() instanceof IRecipeKeyProvider) return ((IRecipeKeyProvider) stack.getItem()).getKey(stack); - return stack.getUnlocalizedName() + (ignoreMeta(stack) ? "" : "~" + stack.getItemDamage()); + return stack.getUnlocalizedName() + (forceIgnore || ignoreMeta(stack) ? "" : "~" + stack.getItemDamage()); } public static boolean ignoreMeta(ItemStack stack) { - return stack.isItemStackDamageable() || stack.getItem() instanceof IManaItem; + return stack.isItemStackDamageable() || stack.getItem() instanceof IManaItem || stack.getItemDamage() == OreDictionary.WILDCARD_VALUE; } public static class EntryData { diff --git a/src/main/java/vazkii/botania/api/lexicon/multiblock/IMultiblockRenderHook.java b/src/main/java/vazkii/botania/api/lexicon/multiblock/IMultiblockRenderHook.java index 9d05c40d9..c94a90932 100644 --- a/src/main/java/vazkii/botania/api/lexicon/multiblock/IMultiblockRenderHook.java +++ b/src/main/java/vazkii/botania/api/lexicon/multiblock/IMultiblockRenderHook.java @@ -10,23 +10,23 @@ */ package vazkii.botania.api.lexicon.multiblock; -import java.util.HashMap; -import java.util.Map; - import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.block.state.IBlockState; import net.minecraft.world.IBlockAccess; import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent; +import java.util.HashMap; +import java.util.Map; + /** * A hook for rendering blocks in the multiblock display. */ public interface IMultiblockRenderHook { - public static Map renderHooks = new HashMap(); + public static Map renderHooks = new HashMap<>(); - public void renderBlockForMultiblock(IBlockAccess world, Multiblock mb, Block block, int meta, RenderBlocks renderBlocks, MultiblockComponent comp, float alpha); + public void renderBlockForMultiblock(IBlockAccess world, Multiblock mb, IBlockState state, MultiblockComponent comp); - public boolean needsTranslate(Block block); + public boolean needsTranslate(IBlockState state); } diff --git a/src/main/java/vazkii/botania/api/lexicon/multiblock/Multiblock.java b/src/main/java/vazkii/botania/api/lexicon/multiblock/Multiblock.java index 4cf34b858..b37bc101d 100644 --- a/src/main/java/vazkii/botania/api/lexicon/multiblock/Multiblock.java +++ b/src/main/java/vazkii/botania/api/lexicon/multiblock/Multiblock.java @@ -10,15 +10,17 @@ */ package vazkii.botania.api.lexicon.multiblock; +import net.minecraft.block.state.IBlockState; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent; + import java.util.ArrayList; -import java.util.Arrays; +import java.util.EnumMap; import java.util.HashMap; import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; -import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent; +import java.util.Map; /** * This class describes a Mutiblock object. It's used to display a @@ -27,22 +29,24 @@ import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent; */ public class Multiblock { - public List components = new ArrayList(); - public List materials = new ArrayList(); + public final List components = new ArrayList<>(); + public final List materials = new ArrayList<>(); - public int minX, minY, minZ, maxX, maxY, maxZ, offX, offY, offZ; + public BlockPos minPos = BlockPos.ORIGIN; + public BlockPos maxPos = BlockPos.ORIGIN; + public BlockPos offPos = BlockPos.ORIGIN; - public HashMap, MultiblockComponent> locationCache = new HashMap, MultiblockComponent>(); + public final HashMap locationCache = new HashMap<>(); /** * Adds a multiblock component to this multiblock. The component's x y z * coords should be pivoted to the center of the structure. */ public void addComponent(MultiblockComponent component) { - if(getComponentForLocation(component.relPos.posX, component.relPos.posY, component.relPos.posZ) != null) + if(getComponentForLocation(component.getRelativePosition()) != null) throw new IllegalArgumentException("Location in multiblock already occupied"); components.add(component); - changeAxisForNewComponent(component.relPos.posX, component.relPos.posY, component.relPos.posZ); + changeAxisForNewComponent(component.getRelativePosition()); calculateCostForNewComponent(component); addComponentToLocationCache(component); } @@ -51,25 +55,25 @@ public class Multiblock { * Constructs and adds a multiblock component to this multiblock. The x y z * coords should be pivoted to the center of the structure. */ - public void addComponent(int x, int y, int z, Block block, int meta) { - addComponent(new MultiblockComponent(new ChunkCoordinates(x, y, z), block, meta)); + public void addComponent(BlockPos pos, IBlockState state) { + addComponent(new MultiblockComponent(pos, state)); } - private void changeAxisForNewComponent(int x, int y, int z) { - if(x < minX) - minX = x; - else if(x > maxX) - maxX = x; + private void changeAxisForNewComponent(BlockPos pos) { + if(pos.getX() < minPos.getX()) + minPos = new BlockPos(pos.getX(), minPos.getY(), minPos.getZ()); + else if(pos.getX() > maxPos.getX()) + maxPos = new BlockPos(pos.getX(), maxPos.getY(), maxPos.getZ()); - if(y < minY) - minY = y; - else if(y > maxY) - maxY = y; + if(pos.getY() < minPos.getY()) + minPos = new BlockPos(minPos.getX(), pos.getY(), minPos.getZ()); + else if(pos.getY() > maxPos.getY()) + maxPos = new BlockPos(maxPos.getX(), pos.getY(), maxPos.getZ()); - if(z < minZ) - minZ = z; - else if(z > maxZ) - maxZ = z; + if(pos.getZ() < minPos.getZ()) + minPos = new BlockPos(minPos.getX(), minPos.getY(), pos.getZ()); + else if(pos.getZ() > maxPos.getZ()) + maxPos = new BlockPos(maxPos.getX(), maxPos.getY(), pos.getZ()); } private void calculateCostForNewComponent(MultiblockComponent comp) { @@ -92,10 +96,8 @@ public class Multiblock { materials.add(stack); } - public void setRenderOffset(int x, int y, int z) { - offX = x; - offY = y; - offZ = z; + public void setRenderOffset(BlockPos pos) { + offPos = pos; } public List getComponents() { @@ -125,17 +127,21 @@ public class Multiblock { * to render this multiblock in the world relevant to the 4 cardinal * orientations. */ - public Multiblock[] createRotations() { - Multiblock[] blocks = new Multiblock[4]; - blocks[0] = this; - blocks[1] = blocks[0].copy(); - blocks[1].rotate(Math.PI / 2); - blocks[2] = blocks[1].copy(); - blocks[2].rotate(Math.PI / 2); - blocks[3] = blocks[2].copy(); - blocks[3].rotate(Math.PI / 2); + public Map createRotations() { + Map ret = new EnumMap<>(EnumFacing.class); - return blocks; + ret.put(EnumFacing.SOUTH, this); + + ret.put(EnumFacing.WEST, ret.get(EnumFacing.SOUTH).copy()); + ret.get(EnumFacing.WEST).rotate(Math.PI / 2); + + ret.put(EnumFacing.NORTH, ret.get(EnumFacing.WEST).copy()); + ret.get(EnumFacing.NORTH).rotate(Math.PI / 2); + + ret.put(EnumFacing.EAST, ret.get(EnumFacing.NORTH).copy()); + ret.get(EnumFacing.EAST).rotate(Math.PI / 2); + + return ret; } /** @@ -147,15 +153,15 @@ public class Multiblock { } public int getXSize() { - return Math.abs(minX) + Math.abs(maxX) + 1; + return Math.abs(minPos.getX()) + Math.abs(maxPos.getX()) + 1; } public int getYSize() { - return Math.abs(minY) + Math.abs(maxY) + 1; + return Math.abs(minPos.getY()) + Math.abs(maxPos.getY()) + 1; } public int getZSize() { - return Math.abs(minZ) + Math.abs(maxZ) + 1; + return Math.abs(minPos.getZ()) + Math.abs(maxPos.getZ()) + 1; } /** @@ -171,18 +177,16 @@ public class Multiblock { * Adds a single component to the location cache */ private void addComponentToLocationCache(MultiblockComponent comp) { - ChunkCoordinates pos = comp.getRelativePosition(); - locationCache.put(Arrays.asList( - pos.posX, - pos.posY, - pos.posZ - ), comp); + BlockPos pos = comp.getRelativePosition(); + locationCache.put(pos, comp); } /** * Gets the component for a given location + * @param pos */ - public MultiblockComponent getComponentForLocation(int x, int y, int z) { - return locationCache.get(Arrays.asList(x, y, z)); + public MultiblockComponent getComponentForLocation(BlockPos pos) { + return locationCache.get(pos); } + } diff --git a/src/main/java/vazkii/botania/api/lexicon/multiblock/MultiblockSet.java b/src/main/java/vazkii/botania/api/lexicon/multiblock/MultiblockSet.java index c0435f81e..ebc675e1a 100644 --- a/src/main/java/vazkii/botania/api/lexicon/multiblock/MultiblockSet.java +++ b/src/main/java/vazkii/botania/api/lexicon/multiblock/MultiblockSet.java @@ -11,33 +11,28 @@ package vazkii.botania.api.lexicon.multiblock; import net.minecraft.entity.Entity; -import net.minecraft.util.MathHelper; +import net.minecraft.util.EnumFacing; + +import java.util.Collections; +import java.util.Map; /** * A set of Multiblock objects for various rotations. */ public class MultiblockSet { - private final Multiblock[] mbs; - - public MultiblockSet(Multiblock[] mbs) { - this.mbs = mbs; - } + private final Map mbs; public MultiblockSet(Multiblock mb) { - this(mb.createRotations()); + mbs = Collections.unmodifiableMap(mb.createRotations()); } public Multiblock getForEntity(Entity e) { - return getForRotation(e.rotationYaw); + return getForFacing(e.getHorizontalFacing()); } - public Multiblock getForRotation(double rotation) { - int facing = MathHelper.floor_double(rotation * 4.0 / 360.0 + 0.5) & 3; - return getForIndex(facing); + public Multiblock getForFacing(EnumFacing facing) { + return mbs.get(facing); } - public Multiblock getForIndex(int index) { - return mbs[Math.min(mbs.length - 1, index)]; - } } diff --git a/src/main/java/vazkii/botania/api/lexicon/multiblock/component/AnyComponent.java b/src/main/java/vazkii/botania/api/lexicon/multiblock/component/AnyComponent.java index f7a159b20..99ef62906 100644 --- a/src/main/java/vazkii/botania/api/lexicon/multiblock/component/AnyComponent.java +++ b/src/main/java/vazkii/botania/api/lexicon/multiblock/component/AnyComponent.java @@ -10,8 +10,8 @@ */ package vazkii.botania.api.lexicon.multiblock.component; -import net.minecraft.block.Block; -import net.minecraft.util.ChunkCoordinates; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; /** @@ -19,14 +19,14 @@ import net.minecraft.world.World; */ public class AnyComponent extends MultiblockComponent { - public AnyComponent(ChunkCoordinates relPos, Block block, int meta) { - super(relPos, block, meta); + public AnyComponent(BlockPos relPos, IBlockState state) { + super(relPos, state); } @Override - public boolean matches(World world, int x, int y, int z) { - Block block = world.getBlock(x, y, z); - return !block.isAir(world, x, y, z) && block.getCollisionBoundingBoxFromPool(world, x, y, z) != null; + public boolean matches(World world, BlockPos pos) { + IBlockState state = world.getBlockState(pos); + return !state.getBlock().isAir(state, world, pos) && state.getCollisionBoundingBox(world, pos) != null; } } diff --git a/src/main/java/vazkii/botania/api/lexicon/multiblock/component/ColorSwitchingComponent.java b/src/main/java/vazkii/botania/api/lexicon/multiblock/component/ColorSwitchingComponent.java index 27eb32ae2..60d54bf07 100644 --- a/src/main/java/vazkii/botania/api/lexicon/multiblock/component/ColorSwitchingComponent.java +++ b/src/main/java/vazkii/botania/api/lexicon/multiblock/component/ColorSwitchingComponent.java @@ -11,7 +11,10 @@ package vazkii.botania.api.lexicon.multiblock.component; import net.minecraft.block.Block; -import net.minecraft.util.ChunkCoordinates; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.IBlockState; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import vazkii.botania.api.BotaniaAPI; @@ -21,23 +24,26 @@ import vazkii.botania.api.BotaniaAPI; */ public class ColorSwitchingComponent extends MultiblockComponent { - public ColorSwitchingComponent(ChunkCoordinates relPos, Block block) { - super(relPos, block, -1); + private final PropertyEnum colorProp; + + public ColorSwitchingComponent(BlockPos relPos, Block block, PropertyEnum colorProp) { + super(relPos, block.getDefaultState()); + this.colorProp = colorProp; } @Override - public int getMeta() { - return (int) (BotaniaAPI.internalHandler.getWorldElapsedTicks() / 20) % 16; + public IBlockState getBlockState() { + return state.withProperty(colorProp, EnumDyeColor.byMetadata((int) (BotaniaAPI.internalHandler.getWorldElapsedTicks() / 20) % 16)); } @Override - public boolean matches(World world, int x, int y, int z) { - return world.getBlock(x, y, z) == getBlock(); + public boolean matches(World world, BlockPos pos) { + return world.getBlockState(pos).getBlock() == getBlockState().getBlock(); } @Override public MultiblockComponent copy() { - return new ColorSwitchingComponent(relPos, block); + return new ColorSwitchingComponent(getRelativePosition(), getBlockState().getBlock(), colorProp); } } diff --git a/src/main/java/vazkii/botania/api/lexicon/multiblock/component/FlowerComponent.java b/src/main/java/vazkii/botania/api/lexicon/multiblock/component/FlowerComponent.java index 8a4f0ad72..2ce755b55 100644 --- a/src/main/java/vazkii/botania/api/lexicon/multiblock/component/FlowerComponent.java +++ b/src/main/java/vazkii/botania/api/lexicon/multiblock/component/FlowerComponent.java @@ -11,27 +11,28 @@ package vazkii.botania.api.lexicon.multiblock.component; import net.minecraft.block.Block; -import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import vazkii.botania.api.BotaniaAPI; +import vazkii.botania.api.state.BotaniaStateProps; /** * A multiblock component that matches any botania flower. */ public class FlowerComponent extends ColorSwitchingComponent { - public FlowerComponent(ChunkCoordinates relPos, Block block) { - super(relPos, block); + public FlowerComponent(BlockPos relPos, Block block) { + super(relPos, block, BotaniaStateProps.COLOR); } @Override - public boolean matches(World world, int x, int y, int z) { - return BotaniaAPI.internalHandler.isBotaniaFlower(world, x, y, z); + public boolean matches(World world, BlockPos pos) { + return BotaniaAPI.internalHandler.isBotaniaFlower(world, pos); } @Override public MultiblockComponent copy() { - return new FlowerComponent(relPos, block); + return new FlowerComponent(relPos, state.getBlock()); } } diff --git a/src/main/java/vazkii/botania/api/lexicon/multiblock/component/MultiblockComponent.java b/src/main/java/vazkii/botania/api/lexicon/multiblock/component/MultiblockComponent.java index b1a7d895f..43859286c 100644 --- a/src/main/java/vazkii/botania/api/lexicon/multiblock/component/MultiblockComponent.java +++ b/src/main/java/vazkii/botania/api/lexicon/multiblock/component/MultiblockComponent.java @@ -10,13 +10,13 @@ */ package vazkii.botania.api.lexicon.multiblock.component; -import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; /** * A component of a multiblock, the normal one @@ -24,65 +24,59 @@ import cpw.mods.fml.relauncher.SideOnly; */ public class MultiblockComponent { - public ChunkCoordinates relPos; - public final Block block; - public final int meta; - public final TileEntity tileEntity; - public boolean doFancyRender; + protected BlockPos relPos; + protected final IBlockState state; + protected final TileEntity tileEntity; + private final boolean doFancyRender; - public MultiblockComponent(ChunkCoordinates relPos, Block block, int meta) { - this(relPos, block, meta, null); + public MultiblockComponent(BlockPos relPos, IBlockState state) { + this(relPos, state, null); } - public MultiblockComponent(ChunkCoordinates relPos, Block block, int meta, boolean doFancyRender) { - this(relPos, block, meta, doFancyRender, null); + public MultiblockComponent(BlockPos relPos, IBlockState state, boolean doFancyRender) { + this(relPos, state, doFancyRender, null); } - public MultiblockComponent(ChunkCoordinates relPos, Block block, int meta, TileEntity tileEntity) { - this(relPos, block, meta, block.hasTileEntity() == (tileEntity != null), tileEntity); + public MultiblockComponent(BlockPos relPos, IBlockState state, TileEntity tileEntity) { + this(relPos, state, state.getBlock().hasTileEntity(state) == (tileEntity != null), tileEntity); } - public MultiblockComponent(ChunkCoordinates relPos, Block block, int meta, boolean doFancyRender, TileEntity tileEntity) { + public MultiblockComponent(BlockPos relPos, IBlockState state, boolean doFancyRender, TileEntity tileEntity) { this.relPos = relPos; - this.block = block; - this.meta = meta; + this.state = state; this.tileEntity = tileEntity; this.doFancyRender = doFancyRender; } - public ChunkCoordinates getRelativePosition() { + public BlockPos getRelativePosition() { return relPos; } - public Block getBlock() { - return block; + public IBlockState getBlockState() { + return state; } - public int getMeta() { - return meta; - } - - public boolean matches(World world, int x, int y, int z) { - return world.getBlock(x, y, z) == getBlock() && (meta == -1 || world.getBlockMetadata(x, y, z) == meta); + public boolean matches(World world, BlockPos pos) { + return world.getBlockState(pos) == state; } public ItemStack[] getMaterials() { - return new ItemStack[] { new ItemStack(block, 1, meta) }; + return new ItemStack[] { new ItemStack(state.getBlock(), 1, state.getBlock().getMetaFromState(state)) }; } public void rotate(double angle) { - double x = relPos.posX; - double z = relPos.posZ; + double x = relPos.getX(); + double z = relPos.getZ(); double sin = Math.sin(angle); double cos = Math.cos(angle); double xn = x * cos - z * sin; double zn = x * sin + z * cos; - relPos = new ChunkCoordinates((int) Math.round(xn), relPos.posY, (int) Math.round(zn)); + relPos = new BlockPos((int) Math.round(xn), relPos.getY(), (int) Math.round(zn)); } public MultiblockComponent copy() { - return new MultiblockComponent(relPos, block, meta, tileEntity); + return new MultiblockComponent(relPos, state, tileEntity); } public TileEntity getTileEntity() { @@ -93,4 +87,5 @@ public class MultiblockComponent { public boolean shouldDoFancyRender() { return doFancyRender; } + } diff --git a/src/main/java/vazkii/botania/api/lexicon/multiblock/component/StateInsensitiveComponent.java b/src/main/java/vazkii/botania/api/lexicon/multiblock/component/StateInsensitiveComponent.java new file mode 100644 index 000000000..1f5bcf353 --- /dev/null +++ b/src/main/java/vazkii/botania/api/lexicon/multiblock/component/StateInsensitiveComponent.java @@ -0,0 +1,24 @@ +package vazkii.botania.api.lexicon.multiblock.component; + +import net.minecraft.block.Block; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +// Multiblock component that only compares blocks, not blockstates +public class StateInsensitiveComponent extends MultiblockComponent { + + public StateInsensitiveComponent(BlockPos relPos, Block block) { + super(relPos, block.getDefaultState(), false, null); + } + + @Override + public boolean matches(World world, BlockPos pos) { + return world.getBlockState(pos).getBlock() == this.getBlockState().getBlock(); + } + + @Override + public MultiblockComponent copy() { + return new StateInsensitiveComponent(getRelativePosition(), getBlockState().getBlock()); + } + +} diff --git a/src/main/java/vazkii/botania/api/mana/IDirectioned.java b/src/main/java/vazkii/botania/api/mana/IDirectioned.java index ff856f774..49fc53ccd 100644 --- a/src/main/java/vazkii/botania/api/mana/IDirectioned.java +++ b/src/main/java/vazkii/botania/api/mana/IDirectioned.java @@ -17,8 +17,32 @@ package vazkii.botania.api.mana; */ public interface IDirectioned { + /** + * @return The X rotation, in degrees + */ public float getRotationX(); + /** + * @return The Y rotation, in degrees + */ public float getRotationY(); + /** + * Set the X rotation + * @param rot X rotation, in degrees + */ + public void setRotationX(float rot); + + /** + * Set the Y rotation + * @param rot Y rotation, in degrees + */ + public void setRotationY(float rot); + + /** + * This should be called after rotation setting is done to allow + * for the block to re-calculate. + */ + public void commitRedirection(); + } diff --git a/src/main/java/vazkii/botania/api/mana/IIdentifiable.java b/src/main/java/vazkii/botania/api/mana/IIdentifiable.java deleted file mode 100644 index 65f2edc02..000000000 --- a/src/main/java/vazkii/botania/api/mana/IIdentifiable.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jun 19, 2015, 10:05:24 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import java.util.UUID; - -/** - * This interface marks a TileEntity that can be identified through - * an UUID. This UUID must presist between sessions. - */ -public interface IIdentifiable { - - public UUID getIdentifier(); - -} diff --git a/src/main/java/vazkii/botania/api/mana/ILaputaImmobile.java b/src/main/java/vazkii/botania/api/mana/ILaputaImmobile.java index dfa294513..e6fdb3d91 100644 --- a/src/main/java/vazkii/botania/api/mana/ILaputaImmobile.java +++ b/src/main/java/vazkii/botania/api/mana/ILaputaImmobile.java @@ -10,6 +10,7 @@ */ package vazkii.botania.api.mana; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; /** @@ -17,6 +18,6 @@ import net.minecraft.world.World; */ public interface ILaputaImmobile { - public boolean canMove(World world, int x, int y, int z); + public boolean canMove(World world, BlockPos pos); } diff --git a/src/main/java/vazkii/botania/api/mana/ILens.java b/src/main/java/vazkii/botania/api/mana/ILens.java index d125e5729..7b7405ec3 100644 --- a/src/main/java/vazkii/botania/api/mana/ILens.java +++ b/src/main/java/vazkii/botania/api/mana/ILens.java @@ -11,15 +11,12 @@ package vazkii.botania.api.mana; import net.minecraft.item.ItemStack; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; /** * Have an Item implement this to be counted as a lens for the mana spreader. */ public interface ILens extends ILensEffect { - @SideOnly(Side.CLIENT) public int getLensColor(ItemStack stack); /** diff --git a/src/main/java/vazkii/botania/api/mana/ILensEffect.java b/src/main/java/vazkii/botania/api/mana/ILensEffect.java index 4c88f5524..9cac0414b 100644 --- a/src/main/java/vazkii/botania/api/mana/ILensEffect.java +++ b/src/main/java/vazkii/botania/api/mana/ILensEffect.java @@ -11,7 +11,7 @@ package vazkii.botania.api.mana; import net.minecraft.item.ItemStack; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.math.RayTraceResult; import vazkii.botania.api.internal.IManaBurst; /** @@ -31,7 +31,7 @@ public interface ILensEffect { * any block. This is called after the collision is handled. * @return True to kill the burst. False to keep it alive. */ - public boolean collideBurst(IManaBurst burst, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack); + public boolean collideBurst(IManaBurst burst, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack); /** * Called when a mana burst fired from a mana spreader with this focus is updated. diff --git a/src/main/java/vazkii/botania/api/mana/IManaCollector.java b/src/main/java/vazkii/botania/api/mana/IManaCollector.java index 280e46007..f62352864 100644 --- a/src/main/java/vazkii/botania/api/mana/IManaCollector.java +++ b/src/main/java/vazkii/botania/api/mana/IManaCollector.java @@ -18,7 +18,7 @@ import vazkii.botania.api.internal.IManaBurst; * * Implementation Instructions:
    * - Override invalidate() and onChunkUnload(), calling ManaNetworkEvent.removeCollector(this); on both.
    - * - On the first tick of onUpdate(), call ManaNetworkEvent.addCollector(this); + * - On the first tick of update() (or onLoad() in Forge build 1606 or higher), call ManaNetworkEvent.addCollector(this); */ public interface IManaCollector extends IManaReceiver { diff --git a/src/main/java/vazkii/botania/api/mana/IManaCollisionGhost.java b/src/main/java/vazkii/botania/api/mana/IManaCollisionGhost.java index 76b537ed1..99de9d14e 100644 --- a/src/main/java/vazkii/botania/api/mana/IManaCollisionGhost.java +++ b/src/main/java/vazkii/botania/api/mana/IManaCollisionGhost.java @@ -10,12 +10,16 @@ */ package vazkii.botania.api.mana; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + /** - * Any TileEntity that implements this can be counted as a "ghost" block of + * Any Block that implements this can be counted as a "ghost" block of * sorts, that won't call the collision code for the mana bursts. */ public interface IManaCollisionGhost { - public boolean isGhost(); + public boolean isGhost(IBlockState state, World world, BlockPos pos); } diff --git a/src/main/java/vazkii/botania/api/mana/IManaPool.java b/src/main/java/vazkii/botania/api/mana/IManaPool.java index df523a62c..e6df9ff7c 100644 --- a/src/main/java/vazkii/botania/api/mana/IManaPool.java +++ b/src/main/java/vazkii/botania/api/mana/IManaPool.java @@ -10,6 +10,8 @@ */ package vazkii.botania.api.mana; +import net.minecraft.item.EnumDyeColor; + /** * Any TileEntity that implements this is considered a Mana Pool, * by which nearby functional flowers will pull mana from it.
    @@ -27,4 +29,15 @@ public interface IManaPool extends IManaReceiver { */ public boolean isOutputtingPower(); + /** + * @return The color of this pool. + */ + public EnumDyeColor getColor(); + + /** + * Sets the color of this pool. + * @param color The color to set. + */ + public void setColor(EnumDyeColor color); + } diff --git a/src/main/java/vazkii/botania/api/mana/IManaTrigger.java b/src/main/java/vazkii/botania/api/mana/IManaTrigger.java index 61aadfcaa..b6eb8403b 100644 --- a/src/main/java/vazkii/botania/api/mana/IManaTrigger.java +++ b/src/main/java/vazkii/botania/api/mana/IManaTrigger.java @@ -10,6 +10,7 @@ */ package vazkii.botania.api.mana; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import vazkii.botania.api.internal.IManaBurst; @@ -18,6 +19,6 @@ import vazkii.botania.api.internal.IManaBurst; */ public interface IManaTrigger { - public void onBurstCollision(IManaBurst burst, World world, int x, int y, int z); + public void onBurstCollision(IManaBurst burst, World world, BlockPos pos); } diff --git a/src/main/java/vazkii/botania/api/mana/IPingable.java b/src/main/java/vazkii/botania/api/mana/IPingable.java index 1605b428e..dec5fe57d 100644 --- a/src/main/java/vazkii/botania/api/mana/IPingable.java +++ b/src/main/java/vazkii/botania/api/mana/IPingable.java @@ -10,15 +10,15 @@ */ package vazkii.botania.api.mana; -import java.util.UUID; - import vazkii.botania.api.internal.IManaBurst; +import java.util.UUID; + /** * This describes an interface of a Mana Sender block that should be able to pingbackable * by a burst to tell it that the burst is still alive. */ -public interface IPingable extends IIdentifiable { +public interface IPingable { /** * Pings this object back, telling it that the burst passed in is still alive @@ -28,4 +28,9 @@ public interface IPingable extends IIdentifiable { */ public void pingback(IManaBurst burst, UUID expectedIdentity); + /** + * @return A unique and persistent identifier for this IPingable + */ + public UUID getIdentifier(); + } diff --git a/src/main/java/vazkii/botania/api/mana/IPoolOverlayProvider.java b/src/main/java/vazkii/botania/api/mana/IPoolOverlayProvider.java index e443e2c1b..fd3288d8d 100644 --- a/src/main/java/vazkii/botania/api/mana/IPoolOverlayProvider.java +++ b/src/main/java/vazkii/botania/api/mana/IPoolOverlayProvider.java @@ -10,8 +10,11 @@ */ package vazkii.botania.api.mana; -import net.minecraft.util.IIcon; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; /** * A block that implements this can provide an IIcon (block icons only) @@ -20,6 +23,7 @@ import net.minecraft.world.World; */ public interface IPoolOverlayProvider { - public IIcon getIcon(World world, int x, int y, int z); + @SideOnly(Side.CLIENT) + public TextureAtlasSprite getIcon(World world, BlockPos pos); } diff --git a/src/main/java/vazkii/botania/api/mana/IRedirectable.java b/src/main/java/vazkii/botania/api/mana/IRedirectable.java deleted file mode 100644 index 00a1b6aa7..000000000 --- a/src/main/java/vazkii/botania/api/mana/IRedirectable.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [15/11/2015, 19:28:18 (GMT)] - */ -package vazkii.botania.api.mana; - -/** - * This is an extension of IDirectioned for TileEntities - * that allow for their rotation to be public and modifiable outside. - * This is used in botania for the Redirective mana lens. - */ -public interface IRedirectable extends IDirectioned { - - public void setRotationX(float rot); - - public void setRotationY(float rot); - - /** - * This should be called after rotation setting is done to allow - * for the block to re-calculate. - */ - public void commitRedirection(); -} diff --git a/src/main/java/vazkii/botania/api/mana/ManaDiscountEvent.java b/src/main/java/vazkii/botania/api/mana/ManaDiscountEvent.java new file mode 100644 index 000000000..0e8a0fb58 --- /dev/null +++ b/src/main/java/vazkii/botania/api/mana/ManaDiscountEvent.java @@ -0,0 +1,39 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + * + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + * + * File Created @ [Jul 25, 2016, 9:02:12 PM (GMT)] + */ +package vazkii.botania.api.mana; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.common.eventhandler.Event; + +public class ManaDiscountEvent extends Event { + + private final EntityPlayer entityPlayer; + private float discount; + + public ManaDiscountEvent(EntityPlayer entityPlayer, float discount) { + this.entityPlayer = entityPlayer; + this.discount = discount; + } + + public EntityPlayer getEntityPlayer() { + return entityPlayer; + } + + public float getDiscount() { + return discount; + } + + public void setDiscount(float discount) { + this.discount = discount; + } +} diff --git a/src/main/java/vazkii/botania/api/mana/ManaItemHandler.java b/src/main/java/vazkii/botania/api/mana/ManaItemHandler.java index d261d5503..66ad83043 100644 --- a/src/main/java/vazkii/botania/api/mana/ManaItemHandler.java +++ b/src/main/java/vazkii/botania/api/mana/ManaItemHandler.java @@ -13,6 +13,7 @@ package vazkii.botania.api.mana; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; +import net.minecraftforge.common.MinecraftForge; import vazkii.botania.api.BotaniaAPI; public final class ManaItemHandler { @@ -145,7 +146,7 @@ public final class ManaItemHandler { if(stack.getItem() instanceof IManaItem && !((IManaItem) stack.getItem()).canExportManaToItem(stack, stackInSlot)) continue; - int received = 0; + int received; if(manaItemSlot.getMana(stackInSlot) + manaToSend <= manaItemSlot.getMaxMana(stackInSlot)) received = manaToSend; else received = manaToSend - (manaItemSlot.getMana(stackInSlot) + manaToSend - manaItemSlot.getMaxMana(stackInSlot)); @@ -249,6 +250,10 @@ public final class ManaItemHandler { if(armor != null && armor.getItem() instanceof IManaDiscountArmor) discount += ((IManaDiscountArmor) armor.getItem()).getDiscount(armor, i, player); } + + ManaDiscountEvent event = new ManaDiscountEvent(player, discount); + MinecraftForge.EVENT_BUS.post(event); + discount = event.getDiscount(); return discount; } diff --git a/src/main/java/vazkii/botania/api/mana/ManaNetworkEvent.java b/src/main/java/vazkii/botania/api/mana/ManaNetworkEvent.java index 9116602c5..747b19379 100644 --- a/src/main/java/vazkii/botania/api/mana/ManaNetworkEvent.java +++ b/src/main/java/vazkii/botania/api/mana/ManaNetworkEvent.java @@ -12,7 +12,7 @@ package vazkii.botania.api.mana; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.MinecraftForge; -import cpw.mods.fml.common.eventhandler.Event; +import net.minecraftforge.fml.common.eventhandler.Event; public class ManaNetworkEvent extends Event { diff --git a/src/main/java/vazkii/botania/api/mana/TileSignature.java b/src/main/java/vazkii/botania/api/mana/TileSignature.java index 5573670da..06261a919 100644 --- a/src/main/java/vazkii/botania/api/mana/TileSignature.java +++ b/src/main/java/vazkii/botania/api/mana/TileSignature.java @@ -4,12 +4,32 @@ import net.minecraft.tileentity.TileEntity; public class TileSignature { - public final TileEntity tile; - public final boolean remoteWorld; + private final TileEntity tile; + private final boolean remoteWorld; public TileSignature(TileEntity tile, boolean remoteWorld) { this.tile = tile; this.remoteWorld = remoteWorld; } + public TileEntity getTile() { + return tile; + } + + public boolean isRemote() { + return remoteWorld; + } + + @Override + public int hashCode() { + return Boolean.hashCode(remoteWorld) ^ System.identityHashCode(tile); + } + + @Override + public boolean equals(Object o) { + return o instanceof TileSignature + && tile == ((TileSignature) o).tile + && remoteWorld == ((TileSignature) o).remoteWorld; + } + } diff --git a/src/main/java/vazkii/botania/api/mana/spark/ISparkAttachable.java b/src/main/java/vazkii/botania/api/mana/spark/ISparkAttachable.java index 880e169fe..6a924671c 100644 --- a/src/main/java/vazkii/botania/api/mana/spark/ISparkAttachable.java +++ b/src/main/java/vazkii/botania/api/mana/spark/ISparkAttachable.java @@ -38,15 +38,7 @@ public interface ISparkAttachable extends IManaReceiver { /** * Gets the Spark that is attached to this block. A common implementation is - * to check for Spark entities above: - * - List sparks = worldObj.getEntitiesWithinAABB(ISparkEntity.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord + 1, zCoord, xCoord + 1, yCoord + 2, zCoord + 1)); - if(sparks.size() == 1) { - Entity e = (Entity) sparks.get(0); - return (ISparkEntity) e; - } - - return null; + * to check for Spark entities above using world.getEntitiesWithinAABB() */ public ISparkEntity getAttachedSpark(); diff --git a/src/main/java/vazkii/botania/api/mana/spark/ISparkEntity.java b/src/main/java/vazkii/botania/api/mana/spark/ISparkEntity.java index e35076ceb..81f6d14ca 100644 --- a/src/main/java/vazkii/botania/api/mana/spark/ISparkEntity.java +++ b/src/main/java/vazkii/botania/api/mana/spark/ISparkEntity.java @@ -19,15 +19,7 @@ public interface ISparkEntity { /** * Which TileEntity is this Spark attached to? A common implementation is checking the block below. - * - int x = MathHelper.floor_double(posX); - int y = MathHelper.floor_double(posY) - 1; - int z = MathHelper.floor_double(posZ); - TileEntity tile = worldObj.getTileEntity(x, y, z); - if(tile != null && tile instanceof ISparkAttachable) - return (ISparkAttachable) tile; - - return null; + * using world.getTileEntity(new BlockPos(this).down()) */ public ISparkAttachable getAttachedTile(); @@ -49,12 +41,12 @@ public interface ISparkEntity { * 3: Recessive
    * 4: Isolated */ - public int getUpgrade(); + public SparkUpgradeType getUpgrade(); /** * Sets the upgrade on this Spark. See {@link ISparkEntity#getUpgrade} */ - public void setUpgrade(int upgrade); + public void setUpgrade(SparkUpgradeType upgrade); /** * See {@link ISparkAttachable#areIncomingTranfersDone()} diff --git a/src/main/java/vazkii/botania/api/mana/spark/SparkHelper.java b/src/main/java/vazkii/botania/api/mana/spark/SparkHelper.java index 7351036cf..82bcd0214 100644 --- a/src/main/java/vazkii/botania/api/mana/spark/SparkHelper.java +++ b/src/main/java/vazkii/botania/api/mana/spark/SparkHelper.java @@ -10,11 +10,13 @@ */ package vazkii.botania.api.mana.spark; -import java.util.List; - -import net.minecraft.util.AxisAlignedBB; +import com.google.common.base.Predicates; +import net.minecraft.entity.Entity; +import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.world.World; +import java.util.List; + public final class SparkHelper { public static final int SPARK_SCAN_RANGE = 12; @@ -25,8 +27,8 @@ public final class SparkHelper { public static List getEntitiesAround(Class clazz, World world, double x, double y, double z) { int r = SPARK_SCAN_RANGE; - List entities = world.getEntitiesWithinAABB(clazz, AxisAlignedBB.getBoundingBox(x - r, y - r, z - r, x + r, y + r, z + r)); - return entities; + List entities = world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(x - r, y - r, z - r, x + r, y + r, z + r), Predicates.instanceOf(clazz)); + return ((List) entities); } } diff --git a/src/main/java/vazkii/botania/api/mana/spark/SparkUpgradeType.java b/src/main/java/vazkii/botania/api/mana/spark/SparkUpgradeType.java new file mode 100644 index 000000000..cdfc48a40 --- /dev/null +++ b/src/main/java/vazkii/botania/api/mana/spark/SparkUpgradeType.java @@ -0,0 +1,9 @@ +package vazkii.botania.api.mana.spark; + +public enum SparkUpgradeType { + NONE, + DISPERSIVE, + DOMINANT, + RECESSIVE, + ISOLATED +} diff --git a/src/main/java/vazkii/botania/api/package-info.java b/src/main/java/vazkii/botania/api/package-info.java index f5ba9c024..8e9ef9a77 100644 --- a/src/main/java/vazkii/botania/api/package-info.java +++ b/src/main/java/vazkii/botania/api/package-info.java @@ -1,4 +1,4 @@ -@API(owner = "Botania", apiVersion = "76", provides = "BotaniaAPI") +@API(owner = "Botania", apiVersion = "79", provides = "BotaniaAPI") package vazkii.botania.api; -import cpw.mods.fml.common.API; +import net.minecraftforge.fml.common.API; diff --git a/src/main/java/vazkii/botania/api/recipe/ElvenPortalUpdateEvent.java b/src/main/java/vazkii/botania/api/recipe/ElvenPortalUpdateEvent.java index 40d971359..605243ab6 100644 --- a/src/main/java/vazkii/botania/api/recipe/ElvenPortalUpdateEvent.java +++ b/src/main/java/vazkii/botania/api/recipe/ElvenPortalUpdateEvent.java @@ -10,12 +10,12 @@ */ package vazkii.botania.api.recipe; -import java.util.List; - import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import cpw.mods.fml.common.eventhandler.Event; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraftforge.fml.common.eventhandler.Event; + +import java.util.List; /** * An event fired when an Elven Portal TE updates. The portal's @@ -29,7 +29,7 @@ public class ElvenPortalUpdateEvent extends Event { */ public final TileEntity portalTile; public final AxisAlignedBB aabb; - public boolean open; + public final boolean open; public final List stacksInside; public ElvenPortalUpdateEvent(TileEntity te, AxisAlignedBB aabb, boolean open, List stacks) { diff --git a/src/main/java/vazkii/botania/api/recipe/IFlowerComponent.java b/src/main/java/vazkii/botania/api/recipe/IFlowerComponent.java index ca4612412..329ad9ce2 100644 --- a/src/main/java/vazkii/botania/api/recipe/IFlowerComponent.java +++ b/src/main/java/vazkii/botania/api/recipe/IFlowerComponent.java @@ -10,15 +10,15 @@ */ package vazkii.botania.api.recipe; -import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; +import vazkii.botania.api.item.IPetalApothecary; /** * Have an Item implement this to allow it to be used in the Petal Apothecary. */ public interface IFlowerComponent { - public boolean canFit(ItemStack stack, IInventory apothecary); + public boolean canFit(ItemStack stack, IPetalApothecary apothecary); public int getParticleColor(ItemStack stack); diff --git a/src/main/java/vazkii/botania/api/recipe/RecipeBrew.java b/src/main/java/vazkii/botania/api/recipe/RecipeBrew.java index 95577784e..ebb05cae3 100644 --- a/src/main/java/vazkii/botania/api/recipe/RecipeBrew.java +++ b/src/main/java/vazkii/botania/api/recipe/RecipeBrew.java @@ -10,38 +10,39 @@ */ package vazkii.botania.api.recipe; -import java.util.ArrayList; -import java.util.List; - +import com.google.common.collect.ImmutableList; import net.minecraft.init.Items; -import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; +import net.minecraftforge.items.IItemHandler; import net.minecraftforge.oredict.OreDictionary; import vazkii.botania.api.brew.Brew; import vazkii.botania.api.brew.IBrewContainer; +import java.util.ArrayList; +import java.util.List; + public class RecipeBrew { - Brew brew; - List inputs; + private final Brew brew; + private final ImmutableList inputs; public RecipeBrew(Brew brew, Object... inputs) { this.brew = brew; - List inputsToSet = new ArrayList(); + ImmutableList.Builder inputsToSet = ImmutableList.builder(); for(Object obj : inputs) { if(obj instanceof String || obj instanceof ItemStack) inputsToSet.add(obj); else throw new IllegalArgumentException("Invalid input"); } - this.inputs = inputsToSet; + this.inputs = inputsToSet.build(); } - public boolean matches(IInventory inv) { - List inputsMissing = new ArrayList(inputs); + public boolean matches(IItemHandler inv) { + List inputsMissing = new ArrayList<>(inputs); - for(int i = 0; i < inv.getSizeInventory(); i++) { + for(int i = 0; i < inv.getSlots(); i++) { ItemStack stack = inv.getStackInSlot(i); if(stack == null) break; @@ -87,12 +88,12 @@ public class RecipeBrew { return inputsMissing.isEmpty(); } - boolean simpleAreStacksEqual(ItemStack stack, ItemStack stack2) { + private boolean simpleAreStacksEqual(ItemStack stack, ItemStack stack2) { return stack.getItem() == stack2.getItem() && stack.getItemDamage() == stack2.getItemDamage(); } public List getInputs() { - return new ArrayList(inputs); + return new ArrayList<>(inputs); } public Brew getBrew() { @@ -105,10 +106,22 @@ public class RecipeBrew { public ItemStack getOutput(ItemStack stack) { if(stack == null || !(stack.getItem() instanceof IBrewContainer)) - return new ItemStack(Items.glass_bottle); // Fallback... + return new ItemStack(Items.GLASS_BOTTLE); // Fallback... IBrewContainer container = (IBrewContainer) stack.getItem(); return container.getItemForBrew(brew, stack); } + @Override + public int hashCode() { + return 31 * brew.hashCode() ^ inputs.hashCode(); + } + + @Override + public boolean equals(Object o) { + return o instanceof RecipeBrew + && brew == ((RecipeBrew) o).brew + && inputs.equals(((RecipeBrew) o).inputs); + } + } diff --git a/src/main/java/vazkii/botania/api/recipe/RecipeElvenTrade.java b/src/main/java/vazkii/botania/api/recipe/RecipeElvenTrade.java index dbea13e86..834d5993f 100644 --- a/src/main/java/vazkii/botania/api/recipe/RecipeElvenTrade.java +++ b/src/main/java/vazkii/botania/api/recipe/RecipeElvenTrade.java @@ -1,32 +1,33 @@ package vazkii.botania.api.recipe; +import com.google.common.collect.ImmutableList; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + import java.util.ArrayList; import java.util.List; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; - public class RecipeElvenTrade { - ItemStack output; - List inputs; + private final ImmutableList outputs; + private final ImmutableList inputs; - public RecipeElvenTrade(ItemStack output, Object... inputs) { - this.output = output; + public RecipeElvenTrade(ItemStack[] outputs, Object... inputs) { + this.outputs = ImmutableList.copyOf(outputs); - List inputsToSet = new ArrayList(); + ImmutableList.Builder inputsToSet = ImmutableList.builder(); for(Object obj : inputs) { if(obj instanceof String || obj instanceof ItemStack) inputsToSet.add(obj); else throw new IllegalArgumentException("Invalid input"); } - this.inputs = inputsToSet; + this.inputs = inputsToSet.build(); } public boolean matches(List stacks, boolean remove) { - List inputsMissing = new ArrayList(inputs); - List stacksToRemove = new ArrayList(); + List inputsMissing = new ArrayList<>(inputs); + List stacksToRemove = new ArrayList<>(); for(ItemStack stack : stacks) { if(stack == null) { @@ -79,16 +80,16 @@ public class RecipeElvenTrade { return inputsMissing.isEmpty(); } - boolean simpleAreStacksEqual(ItemStack stack, ItemStack stack2) { + private boolean simpleAreStacksEqual(ItemStack stack, ItemStack stack2) { return stack.getItem() == stack2.getItem() && stack.getItemDamage() == stack2.getItemDamage(); } public List getInputs() { - return new ArrayList(inputs); + return inputs; } - public ItemStack getOutput() { - return output; + public List getOutputs() { + return outputs; } } diff --git a/src/main/java/vazkii/botania/api/recipe/RecipeManaInfusion.java b/src/main/java/vazkii/botania/api/recipe/RecipeManaInfusion.java index 368c8d4c4..be05608c6 100644 --- a/src/main/java/vazkii/botania/api/recipe/RecipeManaInfusion.java +++ b/src/main/java/vazkii/botania/api/recipe/RecipeManaInfusion.java @@ -10,18 +10,22 @@ */ package vazkii.botania.api.recipe; -import java.util.List; - +import net.minecraft.block.state.IBlockState; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; +import javax.annotation.Nullable; +import java.util.List; + public class RecipeManaInfusion { - ItemStack output; - Object input; - int mana; - boolean isAlchemy = false; - boolean isConjuration = false; + private final ItemStack output; + private final Object input; + private final int mana; + private @Nullable IBlockState catalystState; + + public static IBlockState alchemyState; + public static IBlockState conjurationState; public RecipeManaInfusion(ItemStack output, Object input, int mana) { this.output = output; @@ -54,20 +58,12 @@ public class RecipeManaInfusion { return false; } - public void setAlchemy(boolean alchemy) { - isAlchemy = alchemy; + public IBlockState getCatalyst() { + return catalystState; } - public boolean isAlchemy() { - return isAlchemy; - } - - public void setConjuration(boolean conjuration) { - isConjuration = conjuration; - } - - public boolean isConjuration() { - return isConjuration; + public void setCatalyst(IBlockState catalyst) { + catalystState = catalyst; } public Object getInput() { @@ -81,5 +77,37 @@ public class RecipeManaInfusion { public int getManaToConsume() { return mana; } + + /** + * @deprecated Use {@link RecipeManaInfusion#setCatalyst(IBlockState)} instead + */ + @Deprecated + public void setAlchemy(boolean alchemy) { + catalystState = alchemy ? alchemyState : null; + } + + /** + * @deprecated Use {@link RecipeManaInfusion#getCatalyst()} instead + */ + @Deprecated + public boolean isAlchemy() { + return catalystState == alchemyState; + } + + /** + * @deprecated Use {@link RecipeManaInfusion#setCatalyst(IBlockState)} instead + */ + @Deprecated + public void setConjuration(boolean conjuration) { + catalystState = conjuration ? conjurationState : null; + } + + /** + * @deprecated Use {@link RecipeManaInfusion#getCatalyst()} instead + */ + @Deprecated + public boolean isConjuration() { + return catalystState == conjurationState; + } } diff --git a/src/main/java/vazkii/botania/api/recipe/RecipeMiniFlower.java b/src/main/java/vazkii/botania/api/recipe/RecipeMiniFlower.java index 92908c0a7..351b9639a 100644 --- a/src/main/java/vazkii/botania/api/recipe/RecipeMiniFlower.java +++ b/src/main/java/vazkii/botania/api/recipe/RecipeMiniFlower.java @@ -17,13 +17,13 @@ public class RecipeMiniFlower extends RecipeManaInfusion { public RecipeMiniFlower(String flower, String mini, int mana) { super(BotaniaAPI.internalHandler.getSubTileAsStack(flower), BotaniaAPI.internalHandler.getSubTileAsStack(mini), mana); - setAlchemy(true); + setCatalyst(RecipeManaInfusion.alchemyState); } @Override public boolean matches(ItemStack stack) { String key = BotaniaAPI.internalHandler.getStackSubTileKey(stack); - String input = this.input instanceof String ? (String) this.input : BotaniaAPI.internalHandler.getStackSubTileKey((ItemStack) this.input); + String input = this.getInput() instanceof String ? (String) this.getInput() : BotaniaAPI.internalHandler.getStackSubTileKey((ItemStack) this.getInput()); return key != null && key.equals(input); } diff --git a/src/main/java/vazkii/botania/api/recipe/RecipePetals.java b/src/main/java/vazkii/botania/api/recipe/RecipePetals.java index 60e46357f..7f0072791 100644 --- a/src/main/java/vazkii/botania/api/recipe/RecipePetals.java +++ b/src/main/java/vazkii/botania/api/recipe/RecipePetals.java @@ -10,35 +10,36 @@ */ package vazkii.botania.api.recipe; +import com.google.common.collect.ImmutableList; +import net.minecraft.item.ItemStack; +import net.minecraftforge.items.IItemHandler; +import net.minecraftforge.oredict.OreDictionary; + import java.util.ArrayList; import java.util.List; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; - public class RecipePetals { - ItemStack output; - List inputs; + private final ItemStack output; + private final ImmutableList inputs; public RecipePetals(ItemStack output, Object... inputs) { this.output = output; - List inputsToSet = new ArrayList(); + ImmutableList.Builder inputsToSet = ImmutableList.builder(); for(Object obj : inputs) { if(obj instanceof String || obj instanceof ItemStack) inputsToSet.add(obj); else throw new IllegalArgumentException("Invalid input"); } - this.inputs = inputsToSet; + this.inputs = inputsToSet.build(); } - public boolean matches(IInventory inv) { - List inputsMissing = new ArrayList(inputs); + public boolean matches(IItemHandler inv) { + List inputsMissing = new ArrayList<>(inputs); - for(int i = 0; i < inv.getSizeInventory(); i++) { + for(int i = 0; i < inv.getSlots(); i++) { ItemStack stack = inv.getStackInSlot(i); if(stack == null) break; @@ -81,12 +82,12 @@ public class RecipePetals { return inputsMissing.isEmpty(); } - boolean simpleAreStacksEqual(ItemStack stack, ItemStack stack2) { + private boolean simpleAreStacksEqual(ItemStack stack, ItemStack stack2) { return stack.getItem() == stack2.getItem() && stack.getItemDamage() == stack2.getItemDamage(); } public List getInputs() { - return new ArrayList(inputs); + return inputs; } public ItemStack getOutput() { diff --git a/src/main/java/vazkii/botania/api/recipe/RecipePureDaisy.java b/src/main/java/vazkii/botania/api/recipe/RecipePureDaisy.java index 19248e69b..51aea7e31 100644 --- a/src/main/java/vazkii/botania/api/recipe/RecipePureDaisy.java +++ b/src/main/java/vazkii/botania/api/recipe/RecipePureDaisy.java @@ -10,29 +10,37 @@ */ package vazkii.botania.api.recipe; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - +import com.google.common.base.Preconditions; import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.item.ItemStack; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.oredict.OreDictionary; import vazkii.botania.api.subtile.SubTileEntity; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + public class RecipePureDaisy { - private static final Map> oreMap = new HashMap(); + public static final int DEFAULT_TIME = 150; + private static final Map> oreMap = new HashMap<>(); - Object input; - Block output; - int outputMeta; + private final Object input; + private final IBlockState outputState; + private final int time; - public RecipePureDaisy(Object input, Block output, int outputMeta) { + public RecipePureDaisy(Object input, IBlockState state) { + this(input, state, DEFAULT_TIME); + } + + public RecipePureDaisy(Object input, IBlockState state, int time) { + Preconditions.checkArgument(time >= 0, "Time must be nonnegative"); this.input = input; - this.output = output; - this.outputMeta = outputMeta; - + this.outputState = state; + this.time = time; if(input != null && !(input instanceof String || input instanceof Block)) throw new IllegalArgumentException("input must be an oredict String or a Block."); } @@ -40,16 +48,16 @@ public class RecipePureDaisy { /** * This gets called every tick, please be careful with your checks. */ - public boolean matches(World world, int x, int y, int z, SubTileEntity pureDaisy, Block block, int meta) { + public boolean matches(World world, BlockPos pos, SubTileEntity pureDaisy, IBlockState state) { if(input instanceof Block) - return block == input; + return state.getBlock() == input; - ItemStack stack = new ItemStack(block, 1, meta); + ItemStack stack = new ItemStack(state.getBlock(), 1, state.getBlock().damageDropped(state)); String oredict = (String) input; return isOreDict(stack, oredict); } - public boolean isOreDict(ItemStack stack, String entry) { + private boolean isOreDict(ItemStack stack, String entry) { if(stack == null || stack.getItem() == null) return false; @@ -78,9 +86,9 @@ public class RecipePureDaisy { * Should only place the block if !world.isRemote, but should return true if it would've placed * it otherwise. You may return false to cancel the normal particles and do your own. */ - public boolean set(World world, int x, int y, int z, SubTileEntity pureDaisy) { + public boolean set(World world, BlockPos pos, SubTileEntity pureDaisy) { if(!world.isRemote) - world.setBlock(x, y, z, output, outputMeta, 1 | 2); + world.setBlockState(pos, outputState, 1 | 2); return true; } @@ -88,12 +96,12 @@ public class RecipePureDaisy { return input; } - public Block getOutput() { - return output; + public IBlockState getOutputState() { + return outputState; } - public int getOutputMeta() { - return outputMeta; + public int getTime() { + return time; } } diff --git a/src/main/java/vazkii/botania/api/recipe/RecipeRuneAltar.java b/src/main/java/vazkii/botania/api/recipe/RecipeRuneAltar.java index f8bb211c1..22c6dcf37 100644 --- a/src/main/java/vazkii/botania/api/recipe/RecipeRuneAltar.java +++ b/src/main/java/vazkii/botania/api/recipe/RecipeRuneAltar.java @@ -14,7 +14,7 @@ import net.minecraft.item.ItemStack; public class RecipeRuneAltar extends RecipePetals { - int mana; + private final int mana; public RecipeRuneAltar(ItemStack output, int mana, Object... inputs) { super(output, inputs); diff --git a/src/main/java/vazkii/botania/api/sound/BotaniaSoundEvents.java b/src/main/java/vazkii/botania/api/sound/BotaniaSoundEvents.java new file mode 100644 index 000000000..a5bcb6eb3 --- /dev/null +++ b/src/main/java/vazkii/botania/api/sound/BotaniaSoundEvents.java @@ -0,0 +1,62 @@ +package vazkii.botania.api.sound; + +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.SoundEvent; + +/** + * Use these to play Botania sounds. + * Do not access this class before Botania preinits! + */ +public final class BotaniaSoundEvents { + + public static final SoundEvent airRod = getRegisteredSoundEvent("botania:airRod"); + public static final SoundEvent agricarnation = getRegisteredSoundEvent("botania:agricarnation"); + public static final SoundEvent altarCraft = getRegisteredSoundEvent("botania:altarCraft"); + public static final SoundEvent babylonAttack = getRegisteredSoundEvent("botania:babylonAttack"); + public static final SoundEvent babylonSpawn = getRegisteredSoundEvent("botania:babylonSpawn"); + public static final SoundEvent bellows = getRegisteredSoundEvent("botania:bellows"); + public static final SoundEvent bifrostRod = getRegisteredSoundEvent("botania:bifrostRod"); + public static final SoundEvent blackLotus = getRegisteredSoundEvent("botania:blackLotus"); + public static final SoundEvent dash = getRegisteredSoundEvent("botania:dash"); + public static final SoundEvent ding = getRegisteredSoundEvent("botania:ding"); + public static final SoundEvent divaCharm = getRegisteredSoundEvent("botania:divaCharm"); + public static final SoundEvent divinationRod = getRegisteredSoundEvent("botania:divinationRod"); + public static final SoundEvent doit = getRegisteredSoundEvent("botania:doit"); + public static final SoundEvent enchanterFade = getRegisteredSoundEvent("botania:enchanterForm"); + public static final SoundEvent enchanterForm = getRegisteredSoundEvent("botania:enchanterFade"); + public static final SoundEvent enchanterEnchant = getRegisteredSoundEvent("botania:enchanterEnchant"); + public static final SoundEvent endoflame = getRegisteredSoundEvent("botania:endoflame"); + public static final SoundEvent equipBauble = getRegisteredSoundEvent("botania:equipBauble"); + public static final SoundEvent gaiaTrap = getRegisteredSoundEvent("botania:gaiaTrap"); + public static final SoundEvent goldenLaurel = getRegisteredSoundEvent("botania:goldenLaurel"); + public static final SoundEvent holyCloak = getRegisteredSoundEvent("botania:holyCloak"); + public static final SoundEvent laputaStart = getRegisteredSoundEvent("botania:laputaStart"); + public static final SoundEvent lexiconOpen = getRegisteredSoundEvent("botania:lexiconOpen"); + public static final SoundEvent lexiconPage = getRegisteredSoundEvent("botania:lexiconPage"); + public static final SoundEvent lightRelay = getRegisteredSoundEvent("botania:lightRelay"); + public static final SoundEvent manaBlaster = getRegisteredSoundEvent("botania:manaBlaster"); + public static final SoundEvent manaPoolCraft = getRegisteredSoundEvent("botania:manaPoolCraft"); + public static final SoundEvent missile = getRegisteredSoundEvent("botania:missile"); + public static final SoundEvent orechid = getRegisteredSoundEvent("botania:orechid"); + public static final SoundEvent potionCreate = getRegisteredSoundEvent("botania:potionCreate"); + public static final SoundEvent runeAltarCraft = getRegisteredSoundEvent("botania:runeAltarCraft"); + public static final SoundEvent runeAltarStart = getRegisteredSoundEvent("botania:runeAltarStart"); + public static final SoundEvent spreaderFire = getRegisteredSoundEvent("botania:spreaderFire"); + public static final SoundEvent starcaller = getRegisteredSoundEvent("botania:starcaller"); + public static final SoundEvent terraBlade = getRegisteredSoundEvent("botania:terraBlade"); + public static final SoundEvent terraformRod = getRegisteredSoundEvent("botania:terraformRod"); + public static final SoundEvent terraPickMode = getRegisteredSoundEvent("botania:terraPickMode"); + public static final SoundEvent terrasteelCraft = getRegisteredSoundEvent("botania:terrasteelCraft"); + public static final SoundEvent thermalily = getRegisteredSoundEvent("botania:thermalily"); + public static final SoundEvent unholyCloak = getRegisteredSoundEvent("botania:unholyCloak"); + public static final SoundEvent way = getRegisteredSoundEvent("botania:way"); + + public static final SoundEvent gaiaMusic1 = getRegisteredSoundEvent("botania:music.gaia1"); + public static final SoundEvent gaiaMusic2 = getRegisteredSoundEvent("botania:music.gaia2"); + + private static SoundEvent getRegisteredSoundEvent(String name) { + return SoundEvent.REGISTRY.getObject(new ResourceLocation(name)); + } + + private BotaniaSoundEvents() {} +} diff --git a/src/main/java/vazkii/botania/api/state/BotaniaStateProps.java b/src/main/java/vazkii/botania/api/state/BotaniaStateProps.java new file mode 100644 index 000000000..f31df9465 --- /dev/null +++ b/src/main/java/vazkii/botania/api/state/BotaniaStateProps.java @@ -0,0 +1,185 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.api.state; + +import com.google.common.base.Predicate; +import com.google.common.base.Predicates; +import net.minecraft.block.BlockRailBase; +import net.minecraft.block.BlockRailPowered; +import net.minecraft.block.BlockRotatedPillar; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.IBlockState; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; +import vazkii.botania.api.item.IFloatingFlower; +import vazkii.botania.api.state.enums.AlfPortalState; +import vazkii.botania.api.state.enums.AltGrassVariant; +import vazkii.botania.api.state.enums.AltarVariant; +import vazkii.botania.api.state.enums.BiomeBrickVariant; +import vazkii.botania.api.state.enums.BiomeStoneVariant; +import vazkii.botania.api.state.enums.CratePattern; +import vazkii.botania.api.state.enums.CrateVariant; +import vazkii.botania.api.state.enums.CustomBrickVariant; +import vazkii.botania.api.state.enums.DrumVariant; +import vazkii.botania.api.state.enums.LivingRockVariant; +import vazkii.botania.api.state.enums.LivingWoodVariant; +import vazkii.botania.api.state.enums.LuminizerVariant; +import vazkii.botania.api.state.enums.PlatformVariant; +import vazkii.botania.api.state.enums.PoolVariant; +import vazkii.botania.api.state.enums.PylonVariant; +import vazkii.botania.api.state.enums.QuartzVariant; +import vazkii.botania.api.state.enums.SpreaderVariant; +import vazkii.botania.api.state.enums.StorageVariant; + +/** + * Holds all Botania block state properties. Use these to set botania blockstates + */ +public final class BotaniaStateProps { + + /** Unlisted properties **/ + + // The property for specialFlower subtile id + public static final PropertyObject SUBTILE_ID = new PropertyObject<>("subtile_id", String.class); + + // The property for floating flower island type + public static final PropertyObject ISLAND_TYPE = new PropertyObject<>("islandtype", IFloatingFlower.IslandType.class); + + // The property for platform held blockstate id + public static final PropertyObject HELD_STATE = new PropertyObject<>("held_state", IBlockState.class); + + // The property for platform world object + public static final PropertyObject HELD_WORLD = new PropertyObject<>("held_world", IBlockAccess.class); + + // The proeprty for platform world pos + public static final PropertyObject HELD_POS = new PropertyObject<>("held_pos", BlockPos.class); + + /** Common properties to all blocks to use **/ + + // The 16 Minecraft colors + public static final PropertyEnum COLOR = PropertyEnum.create("color", EnumDyeColor.class); + + // The four cardinal directions + public static final PropertyEnum CARDINALS = PropertyEnum.create("facing", EnumFacing.class, EnumFacing.Plane.HORIZONTAL); + + // All 6 directions + public static final PropertyEnum FACING = PropertyEnum.create("facing", EnumFacing.class); + + // Redstone power - boolean + // Also for any other simple boolean "on/off" state + public static final PropertyBool POWERED = PropertyBool.create("powered"); + + /** Properties for certain kinds of blocks **/ + + // The axis directions (think quartz pillars and wood logs) + public static final PropertyEnum AXIS_FACING = BlockRotatedPillar.AXIS; + + // Extra Quartz Blocks + public static final PropertyEnum QUARTZ_VARIANT = PropertyEnum.create("variant", QuartzVariant.class); + + /** Properties for individual blocks **/ + + // BlockAlfPortal + public static final PropertyEnum ALFPORTAL_STATE = PropertyEnum.create("state", AlfPortalState.class); + + // BlockAltar + public static final PropertyEnum ALTAR_VARIANT = PropertyEnum.create("variant", AltarVariant.class); + + // BlockAltGrass + public static final PropertyEnum ALTGRASS_VARIANT = PropertyEnum.create("variant", AltGrassVariant.class); + + // BlockBiomeStoneA + public static final PropertyEnum BIOMESTONE_VARIANT = PropertyEnum.create("variant", BiomeStoneVariant.class); + + // BlockBiomeStoneB + public static final PropertyEnum BIOMEBRICK_VARIANT = PropertyEnum.create("variant", BiomeBrickVariant.class); + + // BlockBiomeStoneWall + public static final PropertyEnum BIOMESTONEWALL_VARIANT = PropertyEnum.create("bswall_variant", BiomeStoneVariant.class, new Predicate() { + @Override + public boolean apply(BiomeStoneVariant input) { + return input.getName().contains("cobble"); + } + }); + + // BlockCustomBrick + public static final PropertyEnum CUSTOMBRICK_VARIANT = PropertyEnum.create("variant", CustomBrickVariant.class); + + // BlockDreamWood, BlockLivingWood + public static final PropertyEnum LIVINGWOOD_VARIANT = PropertyEnum.create("variant", LivingWoodVariant.class); + + // BlockEnchanter + public static final PropertyEnum ENCHANTER_DIRECTION = PropertyEnum.create("facing", EnumFacing.Axis.class, Predicates.not(Predicates.equalTo(EnumFacing.Axis.Y))); + + // BlockForestDrum + public static final PropertyEnum DRUM_VARIANT = PropertyEnum.create("variant", DrumVariant.class); + + // BlockGhostRail + public static final PropertyEnum RAIL_DIRECTION = BlockRailPowered.SHAPE; + + // BlockLightRelay + public static final PropertyEnum LUMINIZER_VARIANT = PropertyEnum.create("variant", LuminizerVariant.class); + + // BlockLivingRock + public static final PropertyEnum LIVINGROCK_VARIANT = PropertyEnum.create("variant", LivingRockVariant.class); + + // BlockModDoubleFlower (white to gray) + public static final PropertyEnum DOUBLEFLOWER_VARIANT_1 = PropertyEnum.create("df_variant", EnumDyeColor.class, new Predicate() { + @Override + public boolean apply(EnumDyeColor input) { + return input.ordinal() >= 0 && input.ordinal() <= 7; + } + }); + + // (silver to black) + public static final PropertyEnum DOUBLEFLOWER_VARIANT_2 = PropertyEnum.create("df_variant", EnumDyeColor.class, new Predicate() { + @Override + public boolean apply(EnumDyeColor input) { + return input.ordinal() >= 8 && input.ordinal() <= 15; + } + }); + + // BlockOpenCrate + public static final PropertyEnum CRATE_VARIANT = PropertyEnum.create("variant", CrateVariant.class); + public static final PropertyEnum CRATE_PATTERN = PropertyEnum.create("pattern", CratePattern.class); + + // BlockPavement + public static final PropertyEnum PAVEMENT_COLOR = PropertyEnum.create("color", EnumDyeColor.class, new Predicate() { + @Override + public boolean apply(EnumDyeColor color) { + return color == EnumDyeColor.WHITE || color == EnumDyeColor.BLACK + || color == EnumDyeColor.BLUE || color == EnumDyeColor.RED + || color == EnumDyeColor.YELLOW || color == EnumDyeColor.GREEN; + } + }); + + // BlockPlatform + public static final PropertyEnum PLATFORM_VARIANT = PropertyEnum.create("variant", PlatformVariant.class); + + // BlockPool + public static final PropertyEnum POOL_VARIANT = PropertyEnum.create("variant", PoolVariant.class); + + // BlockPrism + public static final PropertyBool HAS_LENS = PropertyBool.create("has_lens"); + + // BlockPylon + public static final PropertyEnum PYLON_VARIANT = PropertyEnum.create("variant", PylonVariant.class); + + // BlockSpreader + public static final PropertyEnum SPREADER_VARIANT = PropertyEnum.create("variant", SpreaderVariant.class); + + // BlockStorage + public static final PropertyEnum STORAGE_VARIANT = PropertyEnum.create("variant", StorageVariant.class); + + private BotaniaStateProps() { + } + +} diff --git a/src/main/java/vazkii/botania/api/state/PropertyObject.java b/src/main/java/vazkii/botania/api/state/PropertyObject.java new file mode 100644 index 000000000..8dd5ac757 --- /dev/null +++ b/src/main/java/vazkii/botania/api/state/PropertyObject.java @@ -0,0 +1,61 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.api.state; + +import com.google.common.base.Function; +import com.google.common.base.Predicate; +import com.google.common.base.Predicates; +import net.minecraftforge.common.property.IUnlistedProperty; + +import java.util.Objects; + +// Generic base class for unlisted properties +public class PropertyObject implements IUnlistedProperty { + + private final String name; + private final Class clazz; + private final Predicate validator; + private final Function stringFunction; + + public PropertyObject(String name, Class clazz, Predicate validator, Function stringFunction) { + this.name = name; + this.clazz = clazz; + this.validator = validator; + this.stringFunction = stringFunction; + } + + public PropertyObject(String name, Class clazz) { + this(name, clazz, Predicates.alwaysTrue(), new Function() { + @Override + public String apply(T input) { + return Objects.toString(input); + } + }); + } + + @Override + public String getName() { + return name; + } + + @Override + public boolean isValid(T value) { + return validator.apply(value); + } + + @Override + public Class getType() { + return clazz; + } + + @Override + public String valueToString(T value) { + return stringFunction.apply(value); + } +} diff --git a/src/main/java/vazkii/botania/api/state/enums/AlfPortalState.java b/src/main/java/vazkii/botania/api/state/enums/AlfPortalState.java new file mode 100644 index 000000000..91d52e25d --- /dev/null +++ b/src/main/java/vazkii/botania/api/state/enums/AlfPortalState.java @@ -0,0 +1,25 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.api.state.enums; + +import net.minecraft.util.IStringSerializable; + +import java.util.Locale; + +public enum AlfPortalState implements IStringSerializable { + OFF, + ON_Z, + ON_X; + + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } + +} diff --git a/src/main/java/vazkii/botania/api/state/enums/AltGrassVariant.java b/src/main/java/vazkii/botania/api/state/enums/AltGrassVariant.java new file mode 100644 index 000000000..612742b73 --- /dev/null +++ b/src/main/java/vazkii/botania/api/state/enums/AltGrassVariant.java @@ -0,0 +1,28 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.api.state.enums; + +import net.minecraft.util.IStringSerializable; + +import java.util.Locale; + +public enum AltGrassVariant implements IStringSerializable { + DRY, + GOLDEN, + VIVID, + SCORCHED, + INFUSED, + MUTATED; + + @Override + public String getName() { + return this.name().toLowerCase(Locale.ROOT); + } + +} diff --git a/src/main/java/vazkii/botania/api/state/enums/AltarVariant.java b/src/main/java/vazkii/botania/api/state/enums/AltarVariant.java new file mode 100644 index 000000000..056b2b428 --- /dev/null +++ b/src/main/java/vazkii/botania/api/state/enums/AltarVariant.java @@ -0,0 +1,32 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.api.state.enums; + +import net.minecraft.util.IStringSerializable; + +import java.util.Locale; + +public enum AltarVariant implements IStringSerializable { + DEFAULT, + FOREST, + PLAINS, + MOUNTAIN, + FUNGAL, + SWAMP, + DESERT, + TAIGA, + MESA, + MOSSY; + + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } + +} diff --git a/src/main/java/vazkii/botania/api/state/enums/BiomeBrickVariant.java b/src/main/java/vazkii/botania/api/state/enums/BiomeBrickVariant.java new file mode 100644 index 000000000..4808a5893 --- /dev/null +++ b/src/main/java/vazkii/botania/api/state/enums/BiomeBrickVariant.java @@ -0,0 +1,38 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.api.state.enums; + +import net.minecraft.util.IStringSerializable; + +import java.util.Locale; + +public enum BiomeBrickVariant implements IStringSerializable { + FOREST, + PLAINS, + MOUNTAIN, + FUNGAL, + SWAMP, + DESERT, + TAIGA, + MESA, + CHISELED_FOREST, + CHISELED_PLAINS, + CHISELED_MOUNTAIN, + CHISELED_FUNGAL, + CHISELED_SWAMP, + CHISELED_DESERT, + CHISELED_TAIGA, + CHISELED_MESA; + + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } + +} diff --git a/src/main/java/vazkii/botania/api/state/enums/BiomeStoneVariant.java b/src/main/java/vazkii/botania/api/state/enums/BiomeStoneVariant.java new file mode 100644 index 000000000..946e8fee0 --- /dev/null +++ b/src/main/java/vazkii/botania/api/state/enums/BiomeStoneVariant.java @@ -0,0 +1,38 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.api.state.enums; + +import net.minecraft.util.IStringSerializable; + +import java.util.Locale; + +public enum BiomeStoneVariant implements IStringSerializable { + FOREST, + PLAINS, + MOUNTAIN, + FUNGAL, + SWAMP, + DESERT, + TAIGA, + MESA, + FOREST_COBBLE, + PLAINS_COBBLE, + MOUNTAIN_COBBLE, + FUNGAL_COBBLE, + SWAMP_COBBLE, + DESERT_COBBLE, + TAIGA_COBBLE, + MESA_COBBLE; + + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } + +} diff --git a/src/main/java/vazkii/botania/api/state/enums/CratePattern.java b/src/main/java/vazkii/botania/api/state/enums/CratePattern.java new file mode 100644 index 000000000..653a29776 --- /dev/null +++ b/src/main/java/vazkii/botania/api/state/enums/CratePattern.java @@ -0,0 +1,31 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.api.state.enums; + +import net.minecraft.util.IStringSerializable; + +import java.util.Locale; + +public enum CratePattern implements IStringSerializable { + NONE, + CRAFTY_1_1, + CRAFTY_2_2, + CRAFTY_1_2, + CRAFTY_2_1, + CRAFTY_1_3, + CRAFTY_3_1, + CRAFTY_2_3, + CRAFTY_3_2, + CRAFTY_DONUT; + + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } +} diff --git a/src/main/java/vazkii/botania/api/state/enums/CrateVariant.java b/src/main/java/vazkii/botania/api/state/enums/CrateVariant.java new file mode 100644 index 000000000..ba2fa8784 --- /dev/null +++ b/src/main/java/vazkii/botania/api/state/enums/CrateVariant.java @@ -0,0 +1,24 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.api.state.enums; + +import net.minecraft.util.IStringSerializable; + +import java.util.Locale; + +public enum CrateVariant implements IStringSerializable { + OPEN, + CRAFTY; + + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } + +} diff --git a/src/main/java/vazkii/botania/api/state/enums/CustomBrickVariant.java b/src/main/java/vazkii/botania/api/state/enums/CustomBrickVariant.java new file mode 100644 index 000000000..182a4c019 --- /dev/null +++ b/src/main/java/vazkii/botania/api/state/enums/CustomBrickVariant.java @@ -0,0 +1,38 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.api.state.enums; + +import net.minecraft.util.IStringSerializable; + +import java.util.Locale; + +public enum CustomBrickVariant implements IStringSerializable { + HELLISH_BRICK, + SOUL_BRICK, + FROSTY_BRICK, + ROOF_TILE, + AZULEJO_1, + AZULEJO_2, + AZULEJO_3, + AZULEJO_4, + AZULEJO_5, + AZULEJO_6, + AZULEJO_7, + AZULEJO_8, + AZULEJO_9, + AZULEJO_10, + AZULEJO_11, + AZULEJO_12; + + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } + +} diff --git a/src/main/java/vazkii/botania/api/state/enums/DrumVariant.java b/src/main/java/vazkii/botania/api/state/enums/DrumVariant.java new file mode 100644 index 000000000..50d954002 --- /dev/null +++ b/src/main/java/vazkii/botania/api/state/enums/DrumVariant.java @@ -0,0 +1,25 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.api.state.enums; + +import net.minecraft.util.IStringSerializable; + +import java.util.Locale; + +public enum DrumVariant implements IStringSerializable { + WILD, + GATHERING, + CANOPY; + + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } + +} diff --git a/src/main/java/vazkii/botania/api/state/enums/LivingRockVariant.java b/src/main/java/vazkii/botania/api/state/enums/LivingRockVariant.java new file mode 100644 index 000000000..bd28a9730 --- /dev/null +++ b/src/main/java/vazkii/botania/api/state/enums/LivingRockVariant.java @@ -0,0 +1,27 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.api.state.enums; + +import net.minecraft.util.IStringSerializable; + +import java.util.Locale; + +public enum LivingRockVariant implements IStringSerializable { + DEFAULT, + BRICK, + MOSSY_BRICK, + CRACKED_BRICK, + CHISELED_BRICK; + + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } + +} diff --git a/src/main/java/vazkii/botania/api/state/enums/LivingWoodVariant.java b/src/main/java/vazkii/botania/api/state/enums/LivingWoodVariant.java new file mode 100644 index 000000000..e9d27c2f1 --- /dev/null +++ b/src/main/java/vazkii/botania/api/state/enums/LivingWoodVariant.java @@ -0,0 +1,28 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.api.state.enums; + +import net.minecraft.util.IStringSerializable; + +import java.util.Locale; + +public enum LivingWoodVariant implements IStringSerializable { + DEFAULT, + PLANKS, + MOSSY_PLANKS, + FRAMED, + PATTERN_FRAMED, + GLIMMERING; + + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } + +} diff --git a/src/main/java/vazkii/botania/api/state/enums/LuminizerVariant.java b/src/main/java/vazkii/botania/api/state/enums/LuminizerVariant.java new file mode 100644 index 000000000..26b74ee8f --- /dev/null +++ b/src/main/java/vazkii/botania/api/state/enums/LuminizerVariant.java @@ -0,0 +1,24 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.api.state.enums; + +import net.minecraft.util.IStringSerializable; + +import java.util.Locale; + +public enum LuminizerVariant implements IStringSerializable { + DEFAULT, + DETECTOR; + + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } + +} diff --git a/src/main/java/vazkii/botania/api/state/enums/PlatformVariant.java b/src/main/java/vazkii/botania/api/state/enums/PlatformVariant.java new file mode 100644 index 000000000..37c2e64db --- /dev/null +++ b/src/main/java/vazkii/botania/api/state/enums/PlatformVariant.java @@ -0,0 +1,25 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.api.state.enums; + +import net.minecraft.util.IStringSerializable; + +import java.util.Locale; + +public enum PlatformVariant implements IStringSerializable { + ABSTRUSE, + SPECTRAL, + INFRANGIBLE; + + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } + +} diff --git a/src/main/java/vazkii/botania/api/state/enums/PoolVariant.java b/src/main/java/vazkii/botania/api/state/enums/PoolVariant.java new file mode 100644 index 000000000..fe2a2e702 --- /dev/null +++ b/src/main/java/vazkii/botania/api/state/enums/PoolVariant.java @@ -0,0 +1,26 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.api.state.enums; + +import net.minecraft.util.IStringSerializable; + +import java.util.Locale; + +public enum PoolVariant implements IStringSerializable { + DEFAULT, + CREATIVE, + DILUTED, + FABULOUS; + + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } + +} diff --git a/src/main/java/vazkii/botania/api/state/enums/PylonVariant.java b/src/main/java/vazkii/botania/api/state/enums/PylonVariant.java new file mode 100644 index 000000000..3a4ed9f09 --- /dev/null +++ b/src/main/java/vazkii/botania/api/state/enums/PylonVariant.java @@ -0,0 +1,25 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.api.state.enums; + +import net.minecraft.util.IStringSerializable; + +import java.util.Locale; + +public enum PylonVariant implements IStringSerializable { + MANA, + NATURA, + GAIA; + + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } + +} diff --git a/src/main/java/vazkii/botania/api/state/enums/QuartzVariant.java b/src/main/java/vazkii/botania/api/state/enums/QuartzVariant.java new file mode 100644 index 000000000..3bb9a1ea2 --- /dev/null +++ b/src/main/java/vazkii/botania/api/state/enums/QuartzVariant.java @@ -0,0 +1,27 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.api.state.enums; + +import net.minecraft.util.IStringSerializable; + +import java.util.Locale; + +public enum QuartzVariant implements IStringSerializable { + NORMAL, + CHISELED, + PILLAR_Y, + PILLAR_X, + PILLAR_Z; + + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } + +} diff --git a/src/main/java/vazkii/botania/api/state/enums/SpreaderVariant.java b/src/main/java/vazkii/botania/api/state/enums/SpreaderVariant.java new file mode 100644 index 000000000..3794b113f --- /dev/null +++ b/src/main/java/vazkii/botania/api/state/enums/SpreaderVariant.java @@ -0,0 +1,26 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.api.state.enums; + +import net.minecraft.util.IStringSerializable; + +import java.util.Locale; + +public enum SpreaderVariant implements IStringSerializable { + MANA, + REDSTONE, + ELVEN, + GAIA; + + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } + +} diff --git a/src/main/java/vazkii/botania/api/state/enums/StorageVariant.java b/src/main/java/vazkii/botania/api/state/enums/StorageVariant.java new file mode 100644 index 000000000..6626730d4 --- /dev/null +++ b/src/main/java/vazkii/botania/api/state/enums/StorageVariant.java @@ -0,0 +1,27 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.api.state.enums; + +import net.minecraft.util.IStringSerializable; + +import java.util.Locale; + +public enum StorageVariant implements IStringSerializable { + MANASTEEL, + TERRASTEEL, + ELEMENTIUM, + MANA_DIAMOND, + DRAGONSTONE; + + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } + +} diff --git a/src/main/java/vazkii/botania/api/subtile/RadiusDescriptor.java b/src/main/java/vazkii/botania/api/subtile/RadiusDescriptor.java index f57b6fa71..a9f322fba 100644 --- a/src/main/java/vazkii/botania/api/subtile/RadiusDescriptor.java +++ b/src/main/java/vazkii/botania/api/subtile/RadiusDescriptor.java @@ -10,8 +10,8 @@ */ package vazkii.botania.api.subtile; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; /** * This object describes the Radius of a SubTileEntity. It can either be @@ -19,13 +19,13 @@ import net.minecraft.util.ChunkCoordinates; */ public class RadiusDescriptor { - final ChunkCoordinates subtileCoords; + private final BlockPos subtileCoords; - public RadiusDescriptor(ChunkCoordinates subtileCoords) { + public RadiusDescriptor(BlockPos subtileCoords) { this.subtileCoords = subtileCoords; } - public ChunkCoordinates getSubtileCoords() { + public BlockPos getSubtileCoords() { return subtileCoords; } @@ -45,7 +45,7 @@ public class RadiusDescriptor { final double radius; - public Circle(ChunkCoordinates subtileCoords, double radius) { + public Circle(BlockPos subtileCoords, double radius) { super(subtileCoords); this.radius = radius; } @@ -66,7 +66,7 @@ public class RadiusDescriptor { final AxisAlignedBB aabb; - public Rectangle(ChunkCoordinates subtileCoords, AxisAlignedBB aabb) { + public Rectangle(BlockPos subtileCoords, AxisAlignedBB aabb) { super(subtileCoords); this.aabb = aabb; } @@ -80,8 +80,8 @@ public class RadiusDescriptor { public static class Square extends Rectangle { - public Square(ChunkCoordinates subtileCoords, int expand) { - super(subtileCoords, AxisAlignedBB.getBoundingBox(subtileCoords.posX - expand, subtileCoords.posY, subtileCoords.posZ - expand, subtileCoords.posX + 1 + expand, subtileCoords.posY, subtileCoords.posZ + 1 + expand)); + public Square(BlockPos subtileCoords, int expand) { + super(subtileCoords, new AxisAlignedBB(subtileCoords.add(-expand, 0, -expand), subtileCoords.add(expand + 1, 0, expand + 1))); } } diff --git a/src/main/java/vazkii/botania/api/subtile/SubTileEntity.java b/src/main/java/vazkii/botania/api/subtile/SubTileEntity.java index 2b98121c1..a9fbbf435 100644 --- a/src/main/java/vazkii/botania/api/subtile/SubTileEntity.java +++ b/src/main/java/vazkii/botania/api/subtile/SubTileEntity.java @@ -10,24 +10,27 @@ */ package vazkii.botania.api.subtile; -import java.util.ArrayList; - +import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.internal.VanillaPacketDispatcher; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.wand.IWandBindable; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; /** * A Sub-TileEntity, this is used for the flower system. Make sure to map subclasses @@ -49,12 +52,16 @@ public class SubTileEntity { public static final String TAG_TYPE = "type"; public static final String TAG_TICKS_EXISTED = "ticksExisted"; - public void setSupertile(TileEntity tile) { - supertile = tile; + public final BlockPos getPos() { + return supertile.getPos(); } - public boolean canUpdate() { - return true; + public final World getWorld() { + return supertile.getWorld(); + } + + public void setSupertile(TileEntity tile) { + supertile = tile; } public void onUpdate() { @@ -95,11 +102,19 @@ public class SubTileEntity { } /** - * Gets the icon for this SubTileEntity, this is a block icon. + * Gets the block model path for this subtile */ @SideOnly(Side.CLIENT) - public IIcon getIcon() { - return BotaniaAPI.internalHandler.getSubTileIconForName(getUnlocalizedName()); + public ModelResourceLocation getBlockModel() { + return BotaniaAPI.internalHandler.getSubTileBlockModelForName(getUnlocalizedName()); + } + + /** + * Gets the item model path for this subtile + */ + @SideOnly(Side.CLIENT) + public ModelResourceLocation getItemModel() { + return BotaniaAPI.internalHandler.getSubTileItemModelForName(getUnlocalizedName()); } /** @@ -113,33 +128,27 @@ public class SubTileEntity { /** * Called when this sub tile is placed in the world (by an entity). */ - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) { - // NO-OP - } + public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase entity, ItemStack stack) {} /** * Called when a player right clicks this sub tile. */ - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { return false; } + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing side, float hitX, float hitY, float hitZ) { return false; } /** * Called when this sub tile is added to the world. */ - public void onBlockAdded(World world, int x, int y, int z) { - //NO-OP - } + public void onBlockAdded(World world, BlockPos pos, IBlockState state) {} /** * Called when this sub tile is harvested */ - public void onBlockHarvested(World world, int x, int y, int z, int side, EntityPlayer player) { - //NO-OP - } + public void onBlockHarvested(World world, BlockPos pos, IBlockState state, EntityPlayer player) {} /** * Allows additional processing of sub tile drops */ - public ArrayList getDrops(ArrayList list) { + public List getDrops(List list) { return list; } @@ -155,7 +164,7 @@ public class SubTileEntity { * when the sub tile is being hovered with a wand of the forest. */ @SideOnly(Side.CLIENT) - public ChunkCoordinates getBinding() { + public BlockPos getBinding() { return null; } @@ -169,23 +178,23 @@ public class SubTileEntity { } /** - * Gets a ChunkCoordinates instance with the position of this sub tile. + * Gets a BlockPos instance with the position of this sub tile. */ - public ChunkCoordinates toChunkCoordinates() { - return new ChunkCoordinates(supertile.xCoord, supertile.yCoord, supertile.zCoord); + public BlockPos toBlockPos() { + return supertile.getPos(); } /** - * @see IWandBindable#canSelect(EntityPlayer, ItemStack, int, int, int, int) + * @see IWandBindable#canSelect(EntityPlayer, ItemStack, net.minecraft.util.math.BlockPos, net.minecraft.util.EnumFacing) */ - public boolean canSelect(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { + public boolean canSelect(EntityPlayer player, ItemStack wand, BlockPos pos, EnumFacing side) { return false; } /** - * @see IWandBindable#bindTo(EntityPlayer, ItemStack, int, int, int, int) + * @see IWandBindable#bindTo(EntityPlayer, ItemStack, net.minecraft.util.math.BlockPos, net.minecraft.util.EnumFacing) */ - public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { + public boolean bindTo(EntityPlayer player, ItemStack wand, BlockPos pos, EnumFacing side) { return false; } @@ -194,28 +203,26 @@ public class SubTileEntity { * Used to render a HUD portraying some data from this sub tile. */ @SideOnly(Side.CLIENT) - public void renderHUD(Minecraft mc, ScaledResolution res) { - // NO-OP - } + public void renderHUD(Minecraft mc, ScaledResolution res) {} /** * Gets the light value for this SubTileEntity, this is a int (-1 to default to the flower) */ public int getLightValue() { - return -1; + return 0; } /** * Gets the comparator input value for this SubTileEntity */ - public int getComparatorInputOverride(int side) { + public int getComparatorInputOverride() { return 0; } /** * Gets the redstone power level for this SubTileEntity */ - public int getPowerLevel(int side) { + public int getPowerLevel(EnumFacing side) { return 0; } diff --git a/src/main/java/vazkii/botania/api/subtile/SubTileFunctional.java b/src/main/java/vazkii/botania/api/subtile/SubTileFunctional.java index d6156eafe..5c13a3a54 100644 --- a/src/main/java/vazkii/botania/api/subtile/SubTileFunctional.java +++ b/src/main/java/vazkii/botania/api/subtile/SubTileFunctional.java @@ -10,27 +10,31 @@ */ package vazkii.botania.api.subtile; -import java.awt.Color; - import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.StatCollector; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.BlockPos; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.internal.IManaNetwork; import vazkii.botania.api.mana.IManaPool; +import vazkii.botania.api.sound.BotaniaSoundEvents; + +import java.awt.*; /** * The basic class for a Functional Flower. */ public class SubTileFunctional extends SubTileEntity { - public static final int RANGE = 10; + public static final int LINK_RANGE = 10; private static final String TAG_MANA = "mana"; @@ -46,7 +50,7 @@ public class SubTileFunctional extends SubTileEntity { TileEntity linkedPool = null; public int knownMana = -1; - ChunkCoordinates cachedPoolCoordinates = null; + BlockPos cachedPoolCoordinates = null; /** * If set to true, redstoneSignal will be updated every tick. @@ -72,17 +76,17 @@ public class SubTileFunctional extends SubTileEntity { if(acceptsRedstone()) { redstoneSignal = 0; - for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { - int redstoneSide = supertile.getWorldObj().getIndirectPowerLevelTo(supertile.xCoord + dir.offsetX, supertile.yCoord + dir.offsetY, supertile.zCoord + dir.offsetZ, dir.ordinal()); + for(EnumFacing dir : EnumFacing.VALUES) { + int redstoneSide = supertile.getWorld().getRedstonePower(supertile.getPos().offset(dir), dir); redstoneSignal = Math.max(redstoneSignal, redstoneSide); } } - if(supertile.getWorldObj().isRemote) { + if(supertile.getWorld().isRemote) { double particleChance = 1F - (double) mana / (double) getMaxMana() / 3.5F; Color color = new Color(getColor()); if(Math.random() > particleChance) - BotaniaAPI.internalHandler.sparkleFX(supertile.getWorldObj(), supertile.xCoord + 0.3 + Math.random() * 0.5, supertile.yCoord + 0.5 + Math.random() * 0.5, supertile.zCoord + 0.3 + Math.random() * 0.5, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random(), 5); + BotaniaAPI.internalHandler.sparkleFX(supertile.getWorld(), supertile.getPos().getX() + 0.3 + Math.random() * 0.5, supertile.getPos().getY() + 0.5 + Math.random() * 0.5, supertile.getPos().getZ() + 0.3 + Math.random() * 0.5, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random(), 5); } } @@ -93,9 +97,9 @@ public class SubTileFunctional extends SubTileEntity { if(cachedPoolCoordinates != null) { needsNew = false; - if(supertile.getWorldObj().blockExists(cachedPoolCoordinates.posX, cachedPoolCoordinates.posY, cachedPoolCoordinates.posZ)) { + if(supertile.getWorld().isBlockLoaded(cachedPoolCoordinates)) { needsNew = true; - TileEntity tileAt = supertile.getWorldObj().getTileEntity(cachedPoolCoordinates.posX, cachedPoolCoordinates.posY, cachedPoolCoordinates.posZ); + TileEntity tileAt = supertile.getWorld().getTileEntity(cachedPoolCoordinates); if(tileAt != null && tileAt instanceof IManaPool && !tileAt.isInvalid()) { linkedPool = tileAt; needsNew = false; @@ -104,17 +108,16 @@ public class SubTileFunctional extends SubTileEntity { } } } else { - TileEntity tileAt = supertile.getWorldObj().getTileEntity(linkedPool.xCoord, linkedPool.yCoord, linkedPool.zCoord); + TileEntity tileAt = supertile.getWorld().getTileEntity(linkedPool.getPos()); if(tileAt != null && tileAt instanceof IManaPool) linkedPool = tileAt; } if(needsNew && ticksExisted == 1) { // Only for new flowers IManaNetwork network = BotaniaAPI.internalHandler.getManaNetworkInstance(); - int size = network.getAllPoolsInWorld(supertile.getWorldObj()).size(); + int size = network.getAllPoolsInWorld(supertile.getWorld()).size(); if(BotaniaAPI.internalHandler.shouldForceCheck() || size != sizeLastCheck) { - ChunkCoordinates coords = new ChunkCoordinates(supertile.xCoord, supertile.yCoord, supertile.zCoord); - linkedPool = network.getClosestPool(coords, supertile.getWorldObj(), RANGE); + linkedPool = network.getClosestPool(supertile.getPos(), supertile.getWorld(), LINK_RANGE); sizeLastCheck = size; } } @@ -134,7 +137,7 @@ public class SubTileFunctional extends SubTileEntity { return false; knownMana = mana; - player.worldObj.playSoundAtEntity(player, "botania:ding", 0.1F, 1F); + player.worldObj.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.ding, SoundCategory.PLAYERS, 0.1F, 1F); return super.onWanded(player, wand); } @@ -155,7 +158,7 @@ public class SubTileFunctional extends SubTileEntity { int y = cmp.getInteger(TAG_POOL_Y); int z = cmp.getInteger(TAG_POOL_Z); - cachedPoolCoordinates = y < 0 ? null : new ChunkCoordinates(x, y, z); + cachedPoolCoordinates = y < 0 ? null : new BlockPos(x, y, z); } @Override @@ -163,13 +166,13 @@ public class SubTileFunctional extends SubTileEntity { cmp.setInteger(TAG_MANA, mana); if(cachedPoolCoordinates != null) { - cmp.setInteger(TAG_POOL_X, cachedPoolCoordinates.posX); - cmp.setInteger(TAG_POOL_Y, cachedPoolCoordinates.posY); - cmp.setInteger(TAG_POOL_Z, cachedPoolCoordinates.posZ); + cmp.setInteger(TAG_POOL_X, cachedPoolCoordinates.getX()); + cmp.setInteger(TAG_POOL_Y, cachedPoolCoordinates.getY()); + cmp.setInteger(TAG_POOL_Z, cachedPoolCoordinates.getZ()); } else { - int x = linkedPool == null ? 0 : linkedPool.xCoord; - int y = linkedPool == null ? -1 : linkedPool.yCoord; - int z = linkedPool == null ? 0 : linkedPool.zCoord; + int x = linkedPool == null ? 0 : linkedPool.getPos().getX(); + int y = linkedPool == null ? -1 : linkedPool.getPos().getY(); + int z = linkedPool == null ? 0 : linkedPool.getPos().getZ(); cmp.setInteger(TAG_POOL_X, x); cmp.setInteger(TAG_POOL_Y, y); @@ -178,25 +181,25 @@ public class SubTileFunctional extends SubTileEntity { } @Override - public ChunkCoordinates getBinding() { + public BlockPos getBinding() { if(linkedPool == null) return null; - return new ChunkCoordinates(linkedPool.xCoord, linkedPool.yCoord, linkedPool.zCoord); + return linkedPool.getPos(); } @Override - public boolean canSelect(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { + public boolean canSelect(EntityPlayer player, ItemStack wand, BlockPos pos, EnumFacing side) { return true; } @Override - public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { + public boolean bindTo(EntityPlayer player, ItemStack wand, BlockPos pos, EnumFacing side) { int range = 10; range *= range; - double dist = (x - supertile.xCoord) * (x - supertile.xCoord) + (y - supertile.yCoord) * (y - supertile.yCoord) + (z - supertile.zCoord) * (z - supertile.zCoord); + double dist = pos.distanceSq(supertile.getPos()); if(range >= dist) { - TileEntity tile = player.worldObj.getTileEntity(x, y, z); + TileEntity tile = player.worldObj.getTileEntity(pos); if(tile instanceof IManaPool) { linkedPool = tile; return true; @@ -207,12 +210,13 @@ public class SubTileFunctional extends SubTileEntity { } public boolean isValidBinding() { - return linkedPool != null && !linkedPool.isInvalid() && supertile.getWorldObj().getTileEntity(linkedPool.xCoord, linkedPool.yCoord, linkedPool.zCoord) == linkedPool; + return linkedPool != null && linkedPool.hasWorldObj() && !linkedPool.isInvalid() && supertile.getWorld().isBlockLoaded(linkedPool.getPos(), false) && supertile.getWorld().getTileEntity(linkedPool.getPos()) == linkedPool; } + @SideOnly(Side.CLIENT) @Override public void renderHUD(Minecraft mc, ScaledResolution res) { - String name = StatCollector.translateToLocal("tile.botania:flower." + getUnlocalizedName() + ".name"); + String name = I18n.format("tile.botania:flower." + getUnlocalizedName() + ".name"); int color = getColor(); BotaniaAPI.internalHandler.drawComplexManaHUD(color, knownMana, getMaxMana(), name, res, BotaniaAPI.internalHandler.getBindDisplayForFlowerType(this), isValidBinding()); } diff --git a/src/main/java/vazkii/botania/api/subtile/SubTileGenerating.java b/src/main/java/vazkii/botania/api/subtile/SubTileGenerating.java index 02f7a23af..b715827b4 100644 --- a/src/main/java/vazkii/botania/api/subtile/SubTileGenerating.java +++ b/src/main/java/vazkii/botania/api/subtile/SubTileGenerating.java @@ -10,33 +10,37 @@ */ package vazkii.botania.api.subtile; -import java.awt.Color; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.resources.I18n; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.StatCollector; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.internal.IManaNetwork; import vazkii.botania.api.mana.IManaCollector; +import vazkii.botania.api.sound.BotaniaSoundEvents; + +import java.awt.*; +import java.util.List; /** * The basic class for a Generating Flower. */ public class SubTileGenerating extends SubTileEntity { - public static final int RANGE = 6; + public static final int LINK_RANGE = 6; private static final String TAG_MANA = "mana"; @@ -54,7 +58,7 @@ public class SubTileGenerating extends SubTileEntity { public int knownMana = -1; public int passiveDecayTicks; - ChunkCoordinates cachedCollectorCoordinates = null; + BlockPos cachedCollectorCoordinates = null; /** * If set to true, redstoneSignal will be updated every tick. @@ -71,7 +75,7 @@ public class SubTileGenerating extends SubTileEntity { if(canGeneratePassively()) { int delay = getDelayBetweenPassiveGeneration(); - if(delay > 0 && ticksExisted % delay == 0 && !supertile.getWorldObj().isRemote) { + if(delay > 0 && ticksExisted % delay == 0 && !supertile.getWorld().isRemote) { if(shouldSyncPassiveGeneration()) sync(); addMana(getValueForPassiveGeneration()); @@ -81,28 +85,29 @@ public class SubTileGenerating extends SubTileEntity { if(acceptsRedstone()) { redstoneSignal = 0; - for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { - int redstoneSide = supertile.getWorldObj().getIndirectPowerLevelTo(supertile.xCoord + dir.offsetX, supertile.yCoord + dir.offsetY, supertile.zCoord + dir.offsetZ, dir.ordinal()); + for(EnumFacing dir : EnumFacing.VALUES) { + int redstoneSide = supertile.getWorld().getRedstonePower(supertile.getPos().offset(dir), dir); redstoneSignal = Math.max(redstoneSignal, redstoneSide); } } - if(supertile.getWorldObj().isRemote) { + if(supertile.getWorld().isRemote) { double particleChance = 1F - (double) mana / (double) getMaxMana() / 3.5F; Color color = new Color(getColor()); if(Math.random() > particleChance) - BotaniaAPI.internalHandler.sparkleFX(supertile.getWorldObj(), supertile.xCoord + 0.3 + Math.random() * 0.5, supertile.yCoord + 0.5 + Math.random() * 0.5, supertile.zCoord + 0.3 + Math.random() * 0.5, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random(), 5); + BotaniaAPI.internalHandler.sparkleFX(supertile.getWorld(), supertile.getPos().getX() + 0.3 + Math.random() * 0.5, supertile.getPos().getY() + 0.5 + Math.random() * 0.5, supertile.getPos().getZ() + 0.3 + Math.random() * 0.5, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random(), 5); } boolean passive = isPassiveFlower(); - if(!supertile.getWorldObj().isRemote) { + if(!supertile.getWorld().isRemote) { int muhBalance = BotaniaAPI.internalHandler.getPassiveFlowerDecay(); if(passive && muhBalance > 0 && passiveDecayTicks > muhBalance) { - supertile.getWorldObj().playAuxSFX(2001, supertile.xCoord, supertile.yCoord, supertile.zCoord, Block.getIdFromBlock(supertile.getBlockType())); - if(supertile.getWorldObj().getBlock(supertile.xCoord, supertile.yCoord - 1, supertile.zCoord).isSideSolid(supertile.getWorldObj(), supertile.xCoord, supertile.yCoord - 1, supertile.zCoord, ForgeDirection.UP)) - supertile.getWorldObj().setBlock(supertile.xCoord, supertile.yCoord, supertile.zCoord, Blocks.deadbush); - else supertile.getWorldObj().setBlockToAir(supertile.xCoord, supertile.yCoord, supertile.zCoord); + IBlockState state = supertile.getWorld().getBlockState(supertile.getPos()); + supertile.getWorld().playEvent(2001, supertile.getPos(), Block.getStateId(state)); + if(supertile.getWorld().getBlockState(supertile.getPos().down()).isSideSolid(supertile.getWorld(), supertile.getPos().down(), EnumFacing.UP)) + supertile.getWorld().setBlockState(supertile.getPos(), Blocks.DEADBUSH.getDefaultState()); + else supertile.getWorld().setBlockToAir(supertile.getPos()); } } @@ -117,9 +122,9 @@ public class SubTileGenerating extends SubTileEntity { if(cachedCollectorCoordinates != null) { needsNew = false; - if(supertile.getWorldObj().blockExists(cachedCollectorCoordinates.posX, cachedCollectorCoordinates.posY, cachedCollectorCoordinates.posZ)) { + if(supertile.getWorld().isBlockLoaded(cachedCollectorCoordinates)) { needsNew = true; - TileEntity tileAt = supertile.getWorldObj().getTileEntity(cachedCollectorCoordinates.posX, cachedCollectorCoordinates.posY, cachedCollectorCoordinates.posZ); + TileEntity tileAt = supertile.getWorld().getTileEntity(cachedCollectorCoordinates); if(tileAt != null && tileAt instanceof IManaCollector && !tileAt.isInvalid()) { linkedCollector = tileAt; needsNew = false; @@ -128,17 +133,16 @@ public class SubTileGenerating extends SubTileEntity { } } } else { - TileEntity tileAt = supertile.getWorldObj().getTileEntity(linkedCollector.xCoord, linkedCollector.yCoord, linkedCollector.zCoord); + TileEntity tileAt = supertile.getWorld().getTileEntity(linkedCollector.getPos()); if(tileAt != null && tileAt instanceof IManaCollector) linkedCollector = tileAt; } if(needsNew && ticksExisted == 1) { // New flowers only IManaNetwork network = BotaniaAPI.internalHandler.getManaNetworkInstance(); - int size = network.getAllCollectorsInWorld(supertile.getWorldObj()).size(); + int size = network.getAllCollectorsInWorld(supertile.getWorld()).size(); if(BotaniaAPI.internalHandler.shouldForceCheck() || size != sizeLastCheck) { - ChunkCoordinates coords = new ChunkCoordinates(supertile.xCoord, supertile.yCoord, supertile.zCoord); - linkedCollector = network.getClosestCollector(coords, supertile.getWorldObj(), RANGE); + linkedCollector = network.getClosestCollector(supertile.getPos(), supertile.getWorld(), LINK_RANGE); sizeLastCheck = size; } } @@ -184,8 +188,8 @@ public class SubTileGenerating extends SubTileEntity { } @Override - public ArrayList getDrops(ArrayList list) { - ArrayList drops = super.getDrops(list); + public List getDrops(List list) { + List drops = super.getDrops(list); populateDropStackNBTs(drops); return drops; } @@ -203,8 +207,8 @@ public class SubTileGenerating extends SubTileEntity { } @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) { - super.onBlockPlacedBy(world, x, y, z, entity, stack); + public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase entity, ItemStack stack) { + super.onBlockPlacedBy(world, pos, state, entity, stack); if(isPassiveFlower()) { NBTTagCompound cmp = stack.getTagCompound(); passiveDecayTicks = cmp.getInteger(TAG_PASSIVE_DECAY_TICKS); @@ -220,7 +224,7 @@ public class SubTileGenerating extends SubTileEntity { sync(); knownMana = mana; - player.worldObj.playSoundAtEntity(player, "botania:ding", 0.1F, 1F); + player.worldObj.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.ding, SoundCategory.PLAYERS, 0.1F, 1F); return super.onWanded(player, wand); } @@ -242,7 +246,7 @@ public class SubTileGenerating extends SubTileEntity { int y = cmp.getInteger(TAG_COLLECTOR_Y); int z = cmp.getInteger(TAG_COLLECTOR_Z); - cachedCollectorCoordinates = y < 0 ? null : new ChunkCoordinates(x, y, z); + cachedCollectorCoordinates = y < 0 ? null : new BlockPos(x, y, z); } @Override @@ -252,13 +256,13 @@ public class SubTileGenerating extends SubTileEntity { cmp.setInteger(TAG_PASSIVE_DECAY_TICKS, passiveDecayTicks); if(cachedCollectorCoordinates != null) { - cmp.setInteger(TAG_COLLECTOR_X, cachedCollectorCoordinates.posX); - cmp.setInteger(TAG_COLLECTOR_Y, cachedCollectorCoordinates.posY); - cmp.setInteger(TAG_COLLECTOR_Z, cachedCollectorCoordinates.posZ); + cmp.setInteger(TAG_COLLECTOR_X, cachedCollectorCoordinates.getX()); + cmp.setInteger(TAG_COLLECTOR_Y, cachedCollectorCoordinates.getY()); + cmp.setInteger(TAG_COLLECTOR_Z, cachedCollectorCoordinates.getZ()); } else { - int x = linkedCollector == null ? 0 : linkedCollector.xCoord; - int y = linkedCollector == null ? -1 : linkedCollector.yCoord; - int z = linkedCollector == null ? 0 : linkedCollector.zCoord; + int x = linkedCollector == null ? 0 : linkedCollector.getPos().getX(); + int y = linkedCollector == null ? -1 : linkedCollector.getPos().getY(); + int z = linkedCollector == null ? 0 : linkedCollector.getPos().getZ(); cmp.setInteger(TAG_COLLECTOR_X, x); cmp.setInteger(TAG_COLLECTOR_Y, y); @@ -267,25 +271,25 @@ public class SubTileGenerating extends SubTileEntity { } @Override - public ChunkCoordinates getBinding() { + public BlockPos getBinding() { if(linkedCollector == null) return null; - return new ChunkCoordinates(linkedCollector.xCoord, linkedCollector.yCoord, linkedCollector.zCoord); + return linkedCollector.getPos(); } @Override - public boolean canSelect(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { + public boolean canSelect(EntityPlayer player, ItemStack wand, BlockPos pos, EnumFacing side) { return true; } @Override - public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { + public boolean bindTo(EntityPlayer player, ItemStack wand, BlockPos pos, EnumFacing side) { int range = 6; range *= range; - double dist = (x - supertile.xCoord) * (x - supertile.xCoord) + (y - supertile.yCoord) * (y - supertile.yCoord) + (z - supertile.zCoord) * (z - supertile.zCoord); + double dist = pos.distanceSq(supertile.getPos()); if(range >= dist) { - TileEntity tile = player.worldObj.getTileEntity(x, y, z); + TileEntity tile = player.worldObj.getTileEntity(pos); if(tile instanceof IManaCollector) { linkedCollector = tile; return true; @@ -297,12 +301,13 @@ public class SubTileGenerating extends SubTileEntity { public boolean isValidBinding() { - return linkedCollector != null && !linkedCollector.isInvalid() && supertile.getWorldObj().getTileEntity(linkedCollector.xCoord, linkedCollector.yCoord, linkedCollector.zCoord) == linkedCollector; + return linkedCollector != null && !linkedCollector.isInvalid() && supertile.getWorld().getTileEntity(linkedCollector.getPos()) == linkedCollector; } + @SideOnly(Side.CLIENT) @Override public void renderHUD(Minecraft mc, ScaledResolution res) { - String name = StatCollector.translateToLocal("tile.botania:flower." + getUnlocalizedName() + ".name"); + String name = I18n.format("tile.botania:flower." + getUnlocalizedName() + ".name"); int color = getColor(); BotaniaAPI.internalHandler.drawComplexManaHUD(color, knownMana, getMaxMana(), name, res, BotaniaAPI.internalHandler.getBindDisplayForFlowerType(this), isValidBinding()); } diff --git a/src/main/java/vazkii/botania/api/subtile/signature/BasicSignature.java b/src/main/java/vazkii/botania/api/subtile/signature/BasicSignature.java index b3f5e47ce..5bfa0433b 100644 --- a/src/main/java/vazkii/botania/api/subtile/signature/BasicSignature.java +++ b/src/main/java/vazkii/botania/api/subtile/signature/BasicSignature.java @@ -10,40 +10,28 @@ */ package vazkii.botania.api.subtile.signature; -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.util.text.translation.I18n; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.subtile.SubTileEntity; import vazkii.botania.api.subtile.SubTileFunctional; import vazkii.botania.api.subtile.SubTileGenerating; +import java.util.List; + /** * A basic (and fallback) implementation of SubTileSignature. */ public class BasicSignature extends SubTileSignature { - final String name; + private final String name; public BasicSignature(String name) { this.name = name; } - @Override - public void registerIcons(IIconRegister register) { - BotaniaAPI.internalHandler.registerBasicSignatureIcons(name, register); - } - - @Override - public IIcon getIconForStack(ItemStack stack) { - return BotaniaAPI.internalHandler.getSubTileIconForName(name); - } - @Override public String getUnlocalizedNameForStack(ItemStack stack) { return unlocalizedName(""); @@ -64,9 +52,6 @@ public class BasicSignature extends SubTileSignature { if(clazz == null) return "uwotm8"; - if(clazz.getAnnotation(PassiveFlower.class) != null) - return "botania.flowerType.passiveGenerating"; - if(SubTileGenerating.class.isAssignableFrom(clazz)) return "botania.flowerType.generating"; @@ -78,7 +63,7 @@ public class BasicSignature extends SubTileSignature { @Override public void addTooltip(ItemStack stack, EntityPlayer player, List tooltip) { - tooltip.add(EnumChatFormatting.BLUE + StatCollector.translateToLocal(getType())); + tooltip.add(TextFormatting.BLUE + I18n.translateToLocal(getType())); } private String unlocalizedName(String end) { diff --git a/src/main/java/vazkii/botania/api/subtile/signature/PassiveFlower.java b/src/main/java/vazkii/botania/api/subtile/signature/PassiveFlower.java deleted file mode 100644 index 008fa83b6..000000000 --- a/src/main/java/vazkii/botania/api/subtile/signature/PassiveFlower.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [04/12/2015, 16:47:01 (GMT)] - */ -package vazkii.botania.api.subtile.signature; - -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - * This annotation used for detecting whether a SubTileEntity - * is a passive flower without having to instantiate it. This - * is used for the flowers' tooltips. - */ -@Retention(value = RUNTIME) -@Target(value = TYPE) -public @interface PassiveFlower { - -} diff --git a/src/main/java/vazkii/botania/api/subtile/signature/SubTileSignature.java b/src/main/java/vazkii/botania/api/subtile/signature/SubTileSignature.java index 65fac2265..31b8c75b6 100644 --- a/src/main/java/vazkii/botania/api/subtile/signature/SubTileSignature.java +++ b/src/main/java/vazkii/botania/api/subtile/signature/SubTileSignature.java @@ -10,12 +10,10 @@ */ package vazkii.botania.api.subtile.signature; -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; + +import java.util.List; /** * A singleton instance for a SubTileEntity, this is called for a few methods. @@ -24,16 +22,6 @@ public abstract class SubTileSignature { public static final String SPECIAL_FLOWER_PREFIX = "flower."; - /** - * Equivalent to Block.registerBlockIcons. - */ - public abstract void registerIcons(IIconRegister register); - - /** - * Gets the icon to display for the flower item. - */ - public abstract IIcon getIconForStack(ItemStack stack); - /** * Gets the display name for the flower item. */ @@ -49,8 +37,6 @@ public abstract class SubTileSignature { /** * Adds additional text to the tooltip. This text is added after getUnlocalizedLoreTextForStack. */ - public void addTooltip(ItemStack stack, EntityPlayer player, List tooltip) { - // NO-OP - } + public void addTooltip(ItemStack stack, EntityPlayer player, List tooltip) {} } diff --git a/src/main/java/vazkii/botania/api/wand/ICoordBoundItem.java b/src/main/java/vazkii/botania/api/wand/ICoordBoundItem.java index f7c8036d7..8d3321f44 100644 --- a/src/main/java/vazkii/botania/api/wand/ICoordBoundItem.java +++ b/src/main/java/vazkii/botania/api/wand/ICoordBoundItem.java @@ -1,9 +1,7 @@ package vazkii.botania.api.wand; import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.util.math.BlockPos; /** * The item equivalent of ITileBound, renders when the @@ -12,7 +10,6 @@ import cpw.mods.fml.relauncher.SideOnly; */ public interface ICoordBoundItem { - @SideOnly(Side.CLIENT) - public ChunkCoordinates getBinding(ItemStack stack); + public BlockPos getBinding(ItemStack stack); } diff --git a/src/main/java/vazkii/botania/api/wand/ITileBound.java b/src/main/java/vazkii/botania/api/wand/ITileBound.java index 199390b5a..6468870cd 100644 --- a/src/main/java/vazkii/botania/api/wand/ITileBound.java +++ b/src/main/java/vazkii/botania/api/wand/ITileBound.java @@ -10,9 +10,7 @@ */ package vazkii.botania.api.wand; -import net.minecraft.util.ChunkCoordinates; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.util.math.BlockPos; /** * Any TileEntity that implements this is technically bound @@ -24,7 +22,6 @@ public interface ITileBound { /** * Gets where this block is bound to, can return null. */ - @SideOnly(Side.CLIENT) - public ChunkCoordinates getBinding(); + public BlockPos getBinding(); } diff --git a/src/main/java/vazkii/botania/api/wand/IWandBindable.java b/src/main/java/vazkii/botania/api/wand/IWandBindable.java index 0c5786c12..49506f91c 100644 --- a/src/main/java/vazkii/botania/api/wand/IWandBindable.java +++ b/src/main/java/vazkii/botania/api/wand/IWandBindable.java @@ -12,6 +12,8 @@ package vazkii.botania.api.wand; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; /** * A TileEntity that implements this can be bound to another block @@ -23,12 +25,12 @@ public interface IWandBindable extends ITileBound { /** * Return true if the Wand can select this tile. */ - public boolean canSelect(EntityPlayer player, ItemStack wand, int x, int y, int z, int side); + public boolean canSelect(EntityPlayer player, ItemStack wand, BlockPos pos, EnumFacing side); /** * Call to bind the TileEntity to where the player clicked. Return true to deselect * the TileEntity for another bind or false case the TileEntity should stay selected. */ - public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z, int side); + public boolean bindTo(EntityPlayer player, ItemStack wand, BlockPos pos, EnumFacing side); } diff --git a/src/main/java/vazkii/botania/api/wand/IWandHUD.java b/src/main/java/vazkii/botania/api/wand/IWandHUD.java index a75e44abc..a61860877 100644 --- a/src/main/java/vazkii/botania/api/wand/IWandHUD.java +++ b/src/main/java/vazkii/botania/api/wand/IWandHUD.java @@ -12,7 +12,10 @@ package vazkii.botania.api.wand; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; /** * Any block that implements this has a HUD rendered when being hovered @@ -20,6 +23,7 @@ import net.minecraft.world.World; */ public interface IWandHUD { - public void renderHUD(Minecraft mc, ScaledResolution res, World world, int x, int y, int z); + @SideOnly(Side.CLIENT) + public void renderHUD(Minecraft mc, ScaledResolution res, World world, BlockPos pos); } diff --git a/src/main/java/vazkii/botania/api/wand/IWandable.java b/src/main/java/vazkii/botania/api/wand/IWandable.java index 52349fa05..13997803e 100644 --- a/src/main/java/vazkii/botania/api/wand/IWandable.java +++ b/src/main/java/vazkii/botania/api/wand/IWandable.java @@ -12,6 +12,8 @@ package vazkii.botania.api.wand; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; /** @@ -23,6 +25,6 @@ public interface IWandable { * Called when the block is used by a wand. Note that the player parameter can be null * if this function is called from a dispenser. */ - public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int side); + public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, BlockPos pos, EnumFacing side); } diff --git a/src/main/java/vazkii/botania/api/wand/IWireframeAABBProvider.java b/src/main/java/vazkii/botania/api/wand/IWireframeAABBProvider.java index 3b6e807e7..d41acb51d 100644 --- a/src/main/java/vazkii/botania/api/wand/IWireframeAABBProvider.java +++ b/src/main/java/vazkii/botania/api/wand/IWireframeAABBProvider.java @@ -10,7 +10,8 @@ */ package vazkii.botania.api.wand; -import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; /** @@ -19,6 +20,6 @@ import net.minecraft.world.World; */ public interface IWireframeAABBProvider { - public AxisAlignedBB getWireframeAABB(World world, int x, int y, int z); + public AxisAlignedBB getWireframeAABB(World world, BlockPos pos); } diff --git a/src/main/java/vazkii/botania/api/wiki/IWikiProvider.java b/src/main/java/vazkii/botania/api/wiki/IWikiProvider.java index 285c1549e..c7ef0b27a 100644 --- a/src/main/java/vazkii/botania/api/wiki/IWikiProvider.java +++ b/src/main/java/vazkii/botania/api/wiki/IWikiProvider.java @@ -10,7 +10,8 @@ */ package vazkii.botania.api.wiki; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; /** @@ -23,16 +24,16 @@ public interface IWikiProvider { /** * Gets the name of the block being looked at for display. */ - public String getBlockName(World world, MovingObjectPosition pos); + public String getBlockName(World world, RayTraceResult pos, EntityPlayer player); /** * Gets the URL to open when the block is clicked. */ - public String getWikiURL(World world, MovingObjectPosition pos); + public String getWikiURL(World world, RayTraceResult pos, EntityPlayer player); /** * Gets the name of the wiki for display. */ - public String getWikiName(World world, MovingObjectPosition pos); + public String getWikiName(World world, RayTraceResult pos, EntityPlayer player); } diff --git a/src/main/java/vazkii/botania/api/wiki/SimpleWikiProvider.java b/src/main/java/vazkii/botania/api/wiki/SimpleWikiProvider.java index f03e07c8c..b8baba53e 100644 --- a/src/main/java/vazkii/botania/api/wiki/SimpleWikiProvider.java +++ b/src/main/java/vazkii/botania/api/wiki/SimpleWikiProvider.java @@ -10,17 +10,18 @@ */ package vazkii.botania.api.wiki; -import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; - import org.apache.commons.lang3.text.WordUtils; public class SimpleWikiProvider implements IWikiProvider { - final String name, urlBase, replacement; - final boolean lowercase; + private final String name, urlBase, replacement; + private final boolean lowercase; public SimpleWikiProvider(String name, String urlBase) { this(name, urlBase, "%20"); @@ -45,19 +46,14 @@ public class SimpleWikiProvider implements IWikiProvider { } @Override - public String getBlockName(World world, MovingObjectPosition pos) { - int x = pos.blockX; - int y = pos.blockY; - int z = pos.blockZ; + public String getBlockName(World world, RayTraceResult pos, EntityPlayer player) { + BlockPos bPos = pos.getBlockPos(); + IBlockState state = world.getBlockState(bPos); - Block block = world.getBlock(x, y, z); - if(block == null) - return null; - - ItemStack stack = block.getPickBlock(pos, world, x, y, z); + ItemStack stack = state.getBlock().getPickBlock(state, pos, world, bPos, player); if(stack == null || stack.getItem() == null) - stack = new ItemStack(block, 1, world.getBlockMetadata(x, y, z)); + stack = new ItemStack(state.getBlock(), 1, state.getBlock().damageDropped(state)); if(stack.getItem() == null) return null; @@ -70,8 +66,8 @@ public class SimpleWikiProvider implements IWikiProvider { } @Override - public String getWikiURL(World world, MovingObjectPosition pos) { - String name = getBlockName(world, pos); + public String getWikiURL(World world, RayTraceResult pos, EntityPlayer player) { + String name = getBlockName(world, pos, player); if(name == null) return null; @@ -83,7 +79,7 @@ public class SimpleWikiProvider implements IWikiProvider { } @Override - public String getWikiName(World world, MovingObjectPosition pos) { + public String getWikiName(World world, RayTraceResult pos, EntityPlayer player) { return name; } diff --git a/src/main/java/vazkii/botania/api/wiki/WikiHooks.java b/src/main/java/vazkii/botania/api/wiki/WikiHooks.java index ae42fd82e..2c28a1208 100644 --- a/src/main/java/vazkii/botania/api/wiki/WikiHooks.java +++ b/src/main/java/vazkii/botania/api/wiki/WikiHooks.java @@ -10,22 +10,21 @@ */ package vazkii.botania.api.wiki; +import net.minecraft.block.Block; +import net.minecraft.util.ResourceLocation; + import java.util.HashMap; import java.util.Map; -import net.minecraft.block.Block; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier; - public class WikiHooks { private static final IWikiProvider FALLBACK_PROVIDER = new SimpleWikiProvider("FTB Wiki", "http://ftb.gamepedia.com/%s"); - private static final Map modWikis = new HashMap(); + private static final Map modWikis = new HashMap<>(); public static IWikiProvider getWikiFor(Block block) { - UniqueIdentifier mod = GameRegistry.findUniqueIdentifierFor(block); - return getWikiFor(mod == null ? "" : mod.modId.toLowerCase()); + ResourceLocation mod = Block.REGISTRY.getNameForObject(block); + return getWikiFor(mod == null ? "" : mod.getResourceDomain().toLowerCase()); } public static IWikiProvider getWikiFor(String mod) { diff --git a/src/main/java/vazkii/botania/client/challenge/EnumChallengeLevel.java b/src/main/java/vazkii/botania/client/challenge/EnumChallengeLevel.java index 8abb8ca4a..5fe690ac9 100644 --- a/src/main/java/vazkii/botania/client/challenge/EnumChallengeLevel.java +++ b/src/main/java/vazkii/botania/client/challenge/EnumChallengeLevel.java @@ -17,7 +17,7 @@ public enum EnumChallengeLevel { HARD("botania.challengelevel.hard"), LUNATIC("botania.challengelevel.lunatic"); - String name; + final String name; private EnumChallengeLevel(String name) { this.name = name; diff --git a/src/main/java/vazkii/botania/client/challenge/ModChallenges.java b/src/main/java/vazkii/botania/client/challenge/ModChallenges.java index 4e1ba5e31..f3839130f 100644 --- a/src/main/java/vazkii/botania/client/challenge/ModChallenges.java +++ b/src/main/java/vazkii/botania/client/challenge/ModChallenges.java @@ -10,11 +10,6 @@ */ package vazkii.botania.client.challenge; -import java.util.ArrayList; -import java.util.EnumMap; -import java.util.HashMap; -import java.util.List; - import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; @@ -23,40 +18,46 @@ import vazkii.botania.common.item.ModItems; import vazkii.botania.common.item.block.ItemBlockSpecialFlower; import vazkii.botania.common.lib.LibBlockNames; +import java.util.ArrayList; +import java.util.EnumMap; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + public final class ModChallenges { - public static final EnumMap> challenges = new EnumMap(EnumChallengeLevel.class); - public static final HashMap challengeLookup = new HashMap(); + public static final Map> challenges = new EnumMap<>(EnumChallengeLevel.class); + public static final Map challengeLookup = new HashMap<>(); public static void init() { for(EnumChallengeLevel level : EnumChallengeLevel.class.getEnumConstants()) - challenges.put(level, new ArrayList()); + challenges.put(level, new ArrayList<>()); addChallenge(EnumChallengeLevel.EASY, "flowerFarm", new ItemStack(ModBlocks.flower, 1, 6)); - addChallenge(EnumChallengeLevel.EASY, "recordFarm", new ItemStack(Items.record_13)); - addChallenge(EnumChallengeLevel.EASY, "reedFarm", new ItemStack(Items.reeds)); - addChallenge(EnumChallengeLevel.EASY, "cobbleGen", new ItemStack(Blocks.cobblestone)); + addChallenge(EnumChallengeLevel.EASY, "recordFarm", new ItemStack(Items.RECORD_13)); + addChallenge(EnumChallengeLevel.EASY, "reedFarm", new ItemStack(Items.REEDS)); + addChallenge(EnumChallengeLevel.EASY, "cobbleGen", new ItemStack(Blocks.COBBLESTONE)); addChallenge(EnumChallengeLevel.EASY, "pureDaisy", ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_PUREDAISY)); addChallenge(EnumChallengeLevel.EASY, "battery", new ItemStack(ModBlocks.pool)); addChallenge(EnumChallengeLevel.NORMAL, "apothecaryRefill", new ItemStack(ModBlocks.altar)); - addChallenge(EnumChallengeLevel.NORMAL, "treeFarm", new ItemStack(Blocks.sapling)); - addChallenge(EnumChallengeLevel.NORMAL, "fullCropFarm", new ItemStack(Items.wheat_seeds)); - addChallenge(EnumChallengeLevel.NORMAL, "animalFarm", new ItemStack(Items.leather)); - addChallenge(EnumChallengeLevel.NORMAL, "boneMealFarm", new ItemStack(Items.dye, 1, 15)); + addChallenge(EnumChallengeLevel.NORMAL, "treeFarm", new ItemStack(Blocks.SAPLING)); + addChallenge(EnumChallengeLevel.NORMAL, "fullCropFarm", new ItemStack(Items.WHEAT_SEEDS)); + addChallenge(EnumChallengeLevel.NORMAL, "animalFarm", new ItemStack(Items.LEATHER)); + addChallenge(EnumChallengeLevel.NORMAL, "boneMealFarm", new ItemStack(Items.DYE, 1, 15)); addChallenge(EnumChallengeLevel.NORMAL, "orechid", ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_ORECHID)); - addChallenge(EnumChallengeLevel.HARD, "mobTower", new ItemStack(Items.bone)); + addChallenge(EnumChallengeLevel.HARD, "mobTower", new ItemStack(Items.BONE)); addChallenge(EnumChallengeLevel.HARD, "entropinnyumSetup", ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_ENTROPINNYUM)); addChallenge(EnumChallengeLevel.HARD, "spectrolusSetup", ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_SPECTROLUS)); addChallenge(EnumChallengeLevel.HARD, "potionBrewer", new ItemStack(ModBlocks.brewery)); addChallenge(EnumChallengeLevel.LUNATIC, "kekimurusSetup", ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_KEKIMURUS)); - addChallenge(EnumChallengeLevel.LUNATIC, "autoQuarry", new ItemStack(Items.diamond_pickaxe)); + addChallenge(EnumChallengeLevel.LUNATIC, "autoQuarry", new ItemStack(Items.DIAMOND_PICKAXE)); addChallenge(EnumChallengeLevel.LUNATIC, "runeCrafter", new ItemStack(ModItems.rune)); } - public static void addChallenge(EnumChallengeLevel level, String name, ItemStack icon) { + private static void addChallenge(EnumChallengeLevel level, String name, ItemStack icon) { Challenge c = new Challenge("botania.challenge." + name, icon, level); challenges.get(level).add(c); challengeLookup.put(c.unlocalizedName, c); diff --git a/src/main/java/vazkii/botania/client/core/handler/BaubleRenderHandler.java b/src/main/java/vazkii/botania/client/core/handler/BaubleRenderHandler.java index 460e7363c..38b1c7f38 100644 --- a/src/main/java/vazkii/botania/client/core/handler/BaubleRenderHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/BaubleRenderHandler.java @@ -10,22 +10,20 @@ */ package vazkii.botania.client.core.handler; -import java.awt.Color; - +import baubles.common.container.InventoryBaubles; +import baubles.common.lib.PlayerHandler; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.OpenGlHelper; -import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; +import net.minecraft.client.renderer.entity.layers.LayerRenderer; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.MobEffects; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.util.IIcon; -import net.minecraftforge.client.event.RenderPlayerEvent; - import org.lwjgl.opengl.GL11; - import vazkii.botania.api.item.IBaubleRender; import vazkii.botania.api.item.IBaubleRender.Helper; import vazkii.botania.api.item.IBaubleRender.RenderType; @@ -34,43 +32,40 @@ import vazkii.botania.api.item.IPhantomInkable; import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.item.equipment.armor.terrasteel.ItemTerrasteelHelm; -import baubles.common.container.InventoryBaubles; -import baubles.common.lib.PlayerHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -public final class BaubleRenderHandler { +import javax.annotation.Nonnull; - @SubscribeEvent - public void onPlayerRender(RenderPlayerEvent.Specials.Post event) { - if(!ConfigHandler.renderBaubles || event.entityLiving.getActivePotionEffect(Potion.invisibility) != null) +public final class BaubleRenderHandler implements LayerRenderer { + + @Override + public void doRenderLayer(@Nonnull EntityPlayer player, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) { + if(!ConfigHandler.renderBaubles || player.getActivePotionEffect(MobEffects.INVISIBILITY) != null) return; - EntityPlayer player = event.entityPlayer; InventoryBaubles inv = PlayerHandler.getPlayerBaubles(player); - dispatchRenders(inv, event, RenderType.BODY); + dispatchRenders(inv, player, RenderType.BODY, partialTicks); if(inv.getStackInSlot(3) != null) - renderManaTablet(event); + renderManaTablet(player); - float yaw = player.prevRotationYawHead + (player.rotationYawHead - player.prevRotationYawHead) * event.partialRenderTick; - float yawOffset = player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * event.partialRenderTick; - float pitch = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * event.partialRenderTick; + float yaw = player.prevRotationYawHead + (player.rotationYawHead - player.prevRotationYawHead) * partialTicks; + float yawOffset = player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * partialTicks; + float pitch = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * partialTicks; - GL11.glPushMatrix(); - GL11.glRotatef(yawOffset, 0, -1, 0); - GL11.glRotatef(yaw - 270, 0, 1, 0); - GL11.glRotatef(pitch, 0, 0, 1); - dispatchRenders(inv, event, RenderType.HEAD); + GlStateManager.pushMatrix(); + GlStateManager.rotate(yawOffset, 0, -1, 0); + GlStateManager.rotate(yaw - 270, 0, 1, 0); + GlStateManager.rotate(pitch, 0, 0, 1); + dispatchRenders(inv, player, RenderType.HEAD, partialTicks); ItemStack helm = player.inventory.armorItemInSlot(3); if(helm != null && helm.getItem() instanceof ItemTerrasteelHelm) - ItemTerrasteelHelm.renderOnPlayer(helm, event); + ItemTerrasteelHelm.renderOnPlayer(helm, player); - ContributorFancinessHandler.render(event); - GL11.glPopMatrix(); + GlStateManager.popMatrix(); } - private void dispatchRenders(InventoryBaubles inv, RenderPlayerEvent event, RenderType type) { + private void dispatchRenders(InventoryBaubles inv, EntityPlayer player, RenderType type, float partialTicks) { for(int i = 0; i < inv.getSizeInventory(); i++) { ItemStack stack = inv.getStackInSlot(i); if(stack != null) { @@ -86,57 +81,55 @@ public final class BaubleRenderHandler { ICosmeticAttachable attachable = (ICosmeticAttachable) item; ItemStack cosmetic = attachable.getCosmeticItem(stack); if(cosmetic != null) { - GL11.glPushMatrix(); - GL11.glColor4f(1F, 1F, 1F, 1F); - ((IBaubleRender) cosmetic.getItem()).onPlayerBaubleRender(cosmetic, event, type); - GL11.glPopMatrix(); + GlStateManager.pushMatrix(); + GL11.glColor3ub(((byte) 255), ((byte) 255), ((byte) 255)); // Some of the baubles use this so we must restore it manually as well + GlStateManager.color(1F, 1F, 1F, 1F); + ((IBaubleRender) cosmetic.getItem()).onPlayerBaubleRender(cosmetic, player, type, partialTicks); + GlStateManager.popMatrix(); continue; } } if(item instanceof IBaubleRender) { - GL11.glPushMatrix(); - GL11.glColor4f(1F, 1F, 1F, 1F); - ((IBaubleRender) stack.getItem()).onPlayerBaubleRender(stack, event, type); - GL11.glPopMatrix(); + GlStateManager.pushMatrix(); + GL11.glColor3ub(((byte) 255), ((byte) 255), ((byte) 255)); // Some of the baubles use this so we must restore it manually as well + GlStateManager.color(1F, 1F, 1F, 1F); + ((IBaubleRender) stack.getItem()).onPlayerBaubleRender(stack, player, type, partialTicks); + GlStateManager.popMatrix(); } } } } - private void renderManaTablet(RenderPlayerEvent event) { - EntityPlayer player = event.entityPlayer; + @SuppressWarnings("deprecation") + private void renderManaTablet(EntityPlayer player) { boolean renderedOne = false; for(int i = 0; i < player.inventory.getSizeInventory(); i++) { ItemStack stack = player.inventory.getStackInSlot(i); if(stack != null && stack.getItem() == ModItems.manaTablet) { - Item item = stack.getItem(); - GL11.glPushMatrix(); - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); - Helper.rotateIfSneaking(event.entityPlayer); - boolean armor = event.entityPlayer.getCurrentArmor(1) != null; - GL11.glRotatef(180F, 1F, 0F, 0F); - GL11.glRotatef(90F, 0F, 1F, 0F); - GL11.glTranslatef(-0.25F, -0.85F, renderedOne ? armor ? 0.2F : 0.28F : armor ? -0.3F : -0.25F); - GL11.glScalef(0.5F, 0.5F, 0.5F); + GlStateManager.pushMatrix(); + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + Helper.rotateIfSneaking(player); + boolean armor = player.getItemStackFromSlot(EntityEquipmentSlot.LEGS) != null; + GlStateManager.rotate(90, 0, 1, 0); + GlStateManager.rotate(180, 0, 0, 1); + GlStateManager.translate(0, -0.6, 0); + GlStateManager.scale(0.55, 0.55, 0.55); - GL11.glColor3f(1F, 1F, 1F); + if (renderedOne) + GlStateManager.translate(0F, 0F, armor ? 0.55F : 0.5F); + else + GlStateManager.translate(0F, 0F, armor ? -0.55F : -0.5F); + + GlStateManager.scale(0.75F, 0.75F, 0.75F); + + GlStateManager.color(1F, 1F, 1F); int light = 15728880; int lightmapX = light % 65536; int lightmapY = light / 65536; OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapX, lightmapY); - for(int j = 0; j < 2; j++) { - IIcon icon = item.getIcon(stack, j); - float f = icon.getMinU(); - float f1 = icon.getMaxU(); - float f2 = icon.getMinV(); - float f3 = icon.getMaxV(); - ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F); - - Color color = new Color(item.getColorFromItemStack(stack, 1)); - GL11.glColor3ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue()); - } - GL11.glPopMatrix(); + Minecraft.getMinecraft().getRenderItem().renderItem(stack, ItemCameraTransforms.TransformType.NONE); + GlStateManager.popMatrix(); if(renderedOne) return; @@ -145,5 +138,8 @@ public final class BaubleRenderHandler { } } - + @Override + public boolean shouldCombineTextures() { + return false; + } } diff --git a/src/main/java/vazkii/botania/client/core/handler/BossBarHandler.java b/src/main/java/vazkii/botania/client/core/handler/BossBarHandler.java index ec61a9366..037f0a538 100644 --- a/src/main/java/vazkii/botania/client/core/handler/BossBarHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/BossBarHandler.java @@ -10,76 +10,74 @@ */ package vazkii.botania.client.core.handler; -import java.awt.Rectangle; - import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.util.ResourceLocation; - +import net.minecraftforge.client.event.RenderGameOverlayEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import org.lwjgl.opengl.ARBShaderObjects; import org.lwjgl.opengl.GL11; - import vazkii.botania.api.boss.IBotaniaBoss; -import vazkii.botania.api.boss.IBotaniaBossWithShader; import vazkii.botania.api.internal.ShaderCallback; import vazkii.botania.client.core.helper.RenderHelper; import vazkii.botania.client.core.helper.ShaderHelper; import vazkii.botania.client.lib.LibResources; -import vazkii.botania.common.core.helper.MathHelper; + +import java.awt.*; +import java.util.Collections; +import java.util.Set; +import java.util.UUID; +import java.util.WeakHashMap; public final class BossBarHandler { - public static final ResourceLocation defaultBossBar = new ResourceLocation(LibResources.GUI_BOSS_BAR); - static IBotaniaBoss currentBoss; + private BossBarHandler() {} + // Only access on the client thread! + public static final Set bosses = Collections.newSetFromMap(new WeakHashMap<>()); + public static final ResourceLocation defaultBossBar = new ResourceLocation(LibResources.GUI_BOSS_BAR); private static final BarCallback barUniformCallback = new BarCallback(); - public static void setCurrentBoss(IBotaniaBoss status) { - currentBoss = status; + @SubscribeEvent + public static void onBarRender(RenderGameOverlayEvent.BossInfo evt) { + UUID infoUuid = evt.getBossInfo().getUniqueId(); + for(IBotaniaBoss currentBoss : bosses) { + if(currentBoss.getBossInfoUuid().equals(infoUuid)) { + evt.setCanceled(true); + + Minecraft mc = Minecraft.getMinecraft(); + Rectangle bgRect = currentBoss.getBossBarTextureRect(); + Rectangle fgRect = currentBoss.getBossBarHPTextureRect(); + String name = evt.getBossInfo().getName().getFormattedText(); + int c = evt.getResolution().getScaledWidth() / 2; + int x = evt.getX(); + int y = evt.getY(); + int xf = x + (bgRect.width - fgRect.width) / 2; + int yf = y + (bgRect.height - fgRect.height) / 2; + int fw = (int) ((double) fgRect.width * (evt.getBossInfo().getPercent())); + int tx = c - mc.fontRendererObj.getStringWidth(name) / 2; + + GlStateManager.color(1F, 1F, 1F, 1F); + int auxHeight = currentBoss.bossBarRenderCallback(evt.getResolution(), x, y); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + mc.renderEngine.bindTexture(currentBoss.getBossBarTexture()); + drawBar(currentBoss, x, y, bgRect.x, bgRect.y, bgRect.width, bgRect.height, true); + drawBar(currentBoss, xf, yf, fgRect.x, fgRect.y, fw, fgRect.height, false); + mc.fontRendererObj.drawStringWithShadow(name, tx, y - 10, 0xA2018C); + GlStateManager.enableBlend(); + evt.setIncrement(Math.max(bgRect.height, fgRect.height) + auxHeight + mc.fontRendererObj.FONT_HEIGHT); + } + } } - public static void render(ScaledResolution res) { - if(currentBoss == null) - return; + private static void drawBar(IBotaniaBoss currentBoss, int x, int y, int u, int v, int w, int h, boolean bg) { + int program = currentBoss.getBossBarShaderProgram(bg); + boolean useShader = program > 0; - Minecraft mc = Minecraft.getMinecraft(); - Rectangle bgRect = currentBoss.getBossBarTextureRect(); - Rectangle fgRect = currentBoss.getBossBarHPTextureRect(); - String name = currentBoss.func_145748_c_().getFormattedText(); - int c = res.getScaledWidth() / 2; - int x = c - bgRect.width / 2; - int y = 20; - int xf = x + (bgRect.width - fgRect.width) / 2; - int yf = y + (bgRect.height - fgRect.height) / 2; - int fw = (int) ((double) fgRect.width * (currentBoss.getHealth() / currentBoss.getMaxHealth())); - int tx = c - mc.fontRenderer.getStringWidth(name) / 2; - - GL11.glColor4f(1F, 1F, 1F, 1F); - currentBoss.bossBarRenderCallback(res, x, y); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - mc.renderEngine.bindTexture(currentBoss.getBossBarTexture()); - drawBar(x, y, bgRect.x, bgRect.y, bgRect.width, bgRect.height, true); - drawBar(xf, yf, fgRect.x, fgRect.y, fw, fgRect.height, false); - mc.fontRenderer.drawStringWithShadow(name, tx, y - 10, 0xA2018C); - GL11.glEnable(GL11.GL_BLEND); - - Entity e = (Entity) currentBoss; - EntityPlayer p = mc.thePlayer; - if(e.isDead || !p.worldObj.loadedEntityList.contains(e) || MathHelper.pointDistanceSpace(e.posX, e.posY, e.posZ, p.posX, p.posY, p.posZ) > 32) - currentBoss = null; - } - - public static void drawBar(int x, int y, int u, int v, int w, int h, boolean bg) { - boolean useShader = currentBoss instanceof IBotaniaBossWithShader; if(useShader) { - IBotaniaBossWithShader shader = (IBotaniaBossWithShader) currentBoss; - int program = shader.getBossBarShaderProgram(bg); - ShaderCallback callback = program == 0 ? null : shader.getBossBarShaderCallback(bg, program); + ShaderCallback callback = currentBoss.getBossBarShaderCallback(bg, program); barUniformCallback.set(u, v, callback); - ShaderHelper.useShader(program, barUniformCallback); } @@ -89,7 +87,7 @@ public final class BossBarHandler { ShaderHelper.releaseShader(); } - static class BarCallback extends ShaderCallback { + private static class BarCallback implements ShaderCallback { int x, y; ShaderCallback callback; diff --git a/src/main/java/vazkii/botania/client/core/handler/BotaniaPlayerController.java b/src/main/java/vazkii/botania/client/core/handler/BotaniaPlayerController.java index a9610ad3a..7170e0603 100644 --- a/src/main/java/vazkii/botania/client/core/handler/BotaniaPlayerController.java +++ b/src/main/java/vazkii/botania/client/core/handler/BotaniaPlayerController.java @@ -13,17 +13,17 @@ package vazkii.botania.client.core.handler; import net.minecraft.client.Minecraft; import net.minecraft.client.multiplayer.PlayerControllerMP; import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.item.IExtendedPlayerController; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class BotaniaPlayerController extends PlayerControllerMP implements IExtendedPlayerController { private float distance = 0F; - public BotaniaPlayerController(Minecraft p_i45062_1_, NetHandlerPlayClient p_i45062_2_) { - super(p_i45062_1_, p_i45062_2_); + public BotaniaPlayerController(Minecraft mc, NetHandlerPlayClient netHandler) { + super(mc, netHandler); } @Override diff --git a/src/main/java/vazkii/botania/client/core/handler/BoundTileRenderer.java b/src/main/java/vazkii/botania/client/core/handler/BoundTileRenderer.java index 232d8a310..db585084f 100644 --- a/src/main/java/vazkii/botania/client/core/handler/BoundTileRenderer.java +++ b/src/main/java/vazkii/botania/client/core/handler/BoundTileRenderer.java @@ -10,133 +10,140 @@ */ package vazkii.botania.client.core.handler; -import java.awt.Color; -import java.util.List; - import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.client.event.RenderWorldLastEvent; - +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.items.CapabilityItemHandler; +import net.minecraftforge.items.IItemHandler; +import net.minecraftforge.items.IItemHandlerModifiable; +import net.minecraftforge.items.wrapper.CombinedInvWrapper; import org.lwjgl.opengl.GL11; - import vazkii.botania.api.BotaniaAPI; -import vazkii.botania.api.item.IExtendedWireframeCoordinateListProvider; import vazkii.botania.api.item.IWireframeCoordinateListProvider; import vazkii.botania.api.wand.ICoordBoundItem; import vazkii.botania.api.wand.IWireframeAABBProvider; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +import java.awt.*; +import java.util.List; public final class BoundTileRenderer { - @SubscribeEvent - public void onWorldRenderLast(RenderWorldLastEvent event) { - GL11.glPushMatrix(); - GL11.glPushAttrib(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_DEPTH_TEST); - GL11.glDisable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_BLEND); + private BoundTileRenderer() {} - Tessellator.renderingWorldRenderer = false; + @SubscribeEvent + public static void onWorldRenderLast(RenderWorldLastEvent event) { + GlStateManager.pushMatrix(); + GL11.glPushAttrib(GL11.GL_LIGHTING_BIT); + GlStateManager.disableDepth(); + GlStateManager.disableTexture2D(); + GlStateManager.enableBlend(); EntityPlayer player = Minecraft.getMinecraft().thePlayer; - ItemStack stack = player.getCurrentEquippedItem(); int color = Color.HSBtoRGB(ClientTickHandler.ticksInGame % 200 / 200F, 0.6F, 1F); - if(stack != null && stack.getItem() instanceof ICoordBoundItem) { - ChunkCoordinates coords = ((ICoordBoundItem) stack.getItem()).getBinding(stack); + + if(player.getHeldItemMainhand() != null && player.getHeldItemMainhand().getItem() instanceof ICoordBoundItem) { + BlockPos coords = ((ICoordBoundItem) player.getHeldItemMainhand().getItem()).getBinding(player.getHeldItemMainhand()); if(coords != null) renderBlockOutlineAt(coords, color); } - IInventory mainInv = player.inventory; - IInventory baublesInv = BotaniaAPI.internalHandler.getBaublesInventory(player); + if(player.getHeldItemOffhand() != null && player.getHeldItemOffhand().getItem() instanceof ICoordBoundItem) { + BlockPos coords = ((ICoordBoundItem) player.getHeldItemOffhand().getItem()).getBinding(player.getHeldItemOffhand()); + if(coords != null) + renderBlockOutlineAt(coords, color); + } - int invSize = mainInv.getSizeInventory(); - int size = invSize; - if(baublesInv != null) - size += baublesInv.getSizeInventory(); + IItemHandlerModifiable mainInv = ((IItemHandlerModifiable) player.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, EnumFacing.UP)); + IItemHandlerModifiable baublesInv = BotaniaAPI.internalHandler.getBaublesInventoryWrapped(player); + IItemHandler joined = baublesInv != null ? new CombinedInvWrapper(mainInv, baublesInv) : mainInv; - for(int i = 0; i < size; i++) { - boolean useBaubles = i >= invSize; - IInventory inv = useBaubles ? baublesInv : mainInv; - ItemStack stackInSlot = inv.getStackInSlot(i - (useBaubles ? invSize : 0)); + for(int i = 0; i < joined.getSlots(); i++) { + ItemStack stackInSlot = joined.getStackInSlot(i); if(stackInSlot != null && stackInSlot.getItem() instanceof IWireframeCoordinateListProvider) { IWireframeCoordinateListProvider provider = (IWireframeCoordinateListProvider) stackInSlot.getItem(); - List coordsList = provider.getWireframesToDraw(player, stackInSlot); + List coordsList = provider.getWireframesToDraw(player, stackInSlot); if(coordsList != null) - for(ChunkCoordinates coords : coordsList) + for(BlockPos coords : coordsList) renderBlockOutlineAt(coords, color); - if(stackInSlot.getItem() instanceof IExtendedWireframeCoordinateListProvider) { - ChunkCoordinates coords = ((IExtendedWireframeCoordinateListProvider) stackInSlot.getItem()).getSourceWireframe(player, stackInSlot); - if(coords != null && coords.posY > -1) - renderBlockOutlineAt(coords, color, 5F); - } + BlockPos coords = provider.getSourceWireframe(player, stackInSlot); + if(coords != null && coords.getY() > -1) + renderBlockOutlineAt(coords, color, 5F); } } - GL11.glEnable(GL11.GL_DEPTH_TEST); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_BLEND); + GlStateManager.enableDepth(); + GlStateManager.enableTexture2D(); + GlStateManager.disableBlend(); GL11.glPopAttrib(); - GL11.glPopMatrix(); + GlStateManager.popMatrix(); } - private void renderBlockOutlineAt(ChunkCoordinates pos, int color) { + private static void renderBlockOutlineAt(BlockPos pos, int color) { renderBlockOutlineAt(pos, color, 1F); } - private void renderBlockOutlineAt(ChunkCoordinates pos, int color, float thickness) { - GL11.glPushMatrix(); - GL11.glTranslated(pos.posX - RenderManager.renderPosX, pos.posY - RenderManager.renderPosY, pos.posZ - RenderManager.renderPosZ + 1); + private static void renderBlockOutlineAt(BlockPos pos, int color, float thickness) { + double renderPosX, renderPosY, renderPosZ; + + try { + renderPosX = (double) ClientMethodHandles.renderPosX_getter.invokeExact(Minecraft.getMinecraft().getRenderManager()); + renderPosY = (double) ClientMethodHandles.renderPosY_getter.invokeExact(Minecraft.getMinecraft().getRenderManager()); + renderPosZ = (double) ClientMethodHandles.renderPosZ_getter.invokeExact(Minecraft.getMinecraft().getRenderManager()); + } catch (Throwable t) { + return; + } + + GlStateManager.pushMatrix(); + GlStateManager.translate(pos.getX() - renderPosX, pos.getY() - renderPosY, pos.getZ() - renderPosZ + 1); Color colorRGB = new Color(color); GL11.glColor4ub((byte) colorRGB.getRed(), (byte) colorRGB.getGreen(), (byte) colorRGB.getBlue(), (byte) 255); World world = Minecraft.getMinecraft().theWorld; - Block block = world.getBlock(pos.posX, pos.posY, pos.posZ); + IBlockState state = world.getBlockState(pos); + Block block = state.getBlock(); drawWireframe : { if(block != null) { AxisAlignedBB axis; if(block instanceof IWireframeAABBProvider) - axis = ((IWireframeAABBProvider) block).getWireframeAABB(world, pos.posX, pos.posY, pos.posZ); - else axis = block.getSelectedBoundingBoxFromPool(world, pos.posX, pos.posY, pos.posZ); + axis = ((IWireframeAABBProvider) block).getWireframeAABB(world, pos); + else axis = state.getSelectedBoundingBox(world, pos); if(axis == null) break drawWireframe; - axis.minX -= pos.posX; - axis.maxX -= pos.posX; - axis.minY -= pos.posY; - axis.maxY -= pos.posY; - axis.minZ -= pos.posZ + 1; - axis.maxZ -= pos.posZ + 1; + axis = axis.offset(-pos.getX(), -pos.getY(), -(pos.getZ() + 1)); - GL11.glScalef(1F, 1F, 1F); + GlStateManager.scale(1F, 1F, 1F); GL11.glLineWidth(thickness); renderBlockOutline(axis); GL11.glLineWidth(thickness + 3F); - GL11.glColor4ub((byte) colorRGB.getRed(), (byte) colorRGB.getGreen(), (byte) colorRGB.getBlue(), (byte) 64); + GL11.glColor4ub((byte) colorRGB.getRed(), (byte) colorRGB.getGreen(), (byte) colorRGB.getBlue(), ((byte) 64)); renderBlockOutline(axis); } } - GL11.glPopMatrix(); + GL11.glColor4ub(((byte) 255), ((byte) 255), ((byte) 255), ((byte) 255)); + GlStateManager.popMatrix(); } - private void renderBlockOutline(AxisAlignedBB aabb) { - Tessellator tessellator = Tessellator.instance; + private static void renderBlockOutline(AxisAlignedBB aabb) { + Tessellator tessellator = Tessellator.getInstance(); double ix = aabb.minX; double iy = aabb.minY; @@ -145,42 +152,42 @@ public final class BoundTileRenderer { double ay = aabb.maxY; double az = aabb.maxZ; - tessellator.startDrawing(GL11.GL_LINES); - tessellator.addVertex(ix, iy, iz); - tessellator.addVertex(ix, ay, iz); + tessellator.getBuffer().begin(GL11.GL_LINES, DefaultVertexFormats.POSITION); + tessellator.getBuffer().pos(ix, iy, iz).endVertex(); + tessellator.getBuffer().pos(ix, ay, iz).endVertex(); - tessellator.addVertex(ix, ay, iz); - tessellator.addVertex(ax, ay, iz); + tessellator.getBuffer().pos(ix, ay, iz).endVertex(); + tessellator.getBuffer().pos(ax, ay, iz).endVertex(); - tessellator.addVertex(ax, ay, iz); - tessellator.addVertex(ax, iy, iz); + tessellator.getBuffer().pos(ax, ay, iz).endVertex(); + tessellator.getBuffer().pos(ax, iy, iz).endVertex(); - tessellator.addVertex(ax, iy, iz); - tessellator.addVertex(ix, iy, iz); + tessellator.getBuffer().pos(ax, iy, iz).endVertex(); + tessellator.getBuffer().pos(ix, iy, iz).endVertex(); - tessellator.addVertex(ix, iy, az); - tessellator.addVertex(ix, ay, az); + tessellator.getBuffer().pos(ix, iy, az).endVertex(); + tessellator.getBuffer().pos(ix, ay, az).endVertex(); - tessellator.addVertex(ix, iy, az); - tessellator.addVertex(ax, iy, az); + tessellator.getBuffer().pos(ix, iy, az).endVertex(); + tessellator.getBuffer().pos(ax, iy, az).endVertex(); - tessellator.addVertex(ax, iy, az); - tessellator.addVertex(ax, ay, az); + tessellator.getBuffer().pos(ax, iy, az).endVertex(); + tessellator.getBuffer().pos(ax, ay, az).endVertex(); - tessellator.addVertex(ix, ay, az); - tessellator.addVertex(ax, ay, az); + tessellator.getBuffer().pos(ix, ay, az).endVertex(); + tessellator.getBuffer().pos(ax, ay, az).endVertex(); - tessellator.addVertex(ix, iy, iz); - tessellator.addVertex(ix, iy, az); + tessellator.getBuffer().pos(ix, iy, iz).endVertex(); + tessellator.getBuffer().pos(ix, iy, az).endVertex(); - tessellator.addVertex(ix, ay, iz); - tessellator.addVertex(ix, ay, az); + tessellator.getBuffer().pos(ix, ay, iz).endVertex(); + tessellator.getBuffer().pos(ix, ay, az).endVertex(); - tessellator.addVertex(ax, iy, iz); - tessellator.addVertex(ax, iy, az); + tessellator.getBuffer().pos(ax, iy, iz).endVertex(); + tessellator.getBuffer().pos(ax, iy, az).endVertex(); - tessellator.addVertex(ax, ay, iz); - tessellator.addVertex(ax, ay, az); + tessellator.getBuffer().pos(ax, ay, iz).endVertex(); + tessellator.getBuffer().pos(ax, ay, az).endVertex(); tessellator.draw(); } diff --git a/src/main/java/vazkii/botania/client/core/handler/ClientMethodHandles.java b/src/main/java/vazkii/botania/client/core/handler/ClientMethodHandles.java new file mode 100644 index 000000000..cd87afeb2 --- /dev/null +++ b/src/main/java/vazkii/botania/client/core/handler/ClientMethodHandles.java @@ -0,0 +1,59 @@ +package vazkii.botania.client.core.handler; + +import com.google.common.base.Throwables; +import net.minecraft.client.renderer.EntityRenderer; +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraftforge.fml.relauncher.ReflectionHelper; +import vazkii.botania.common.Botania; +import vazkii.botania.common.lib.LibObfuscation; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.reflect.Field; +import java.lang.reflect.Method; + +public final class ClientMethodHandles { + + public static final MethodHandle + renderPosX_getter, renderPosY_getter, renderPosZ_getter, // RenderManager + starGLCallList_getter, starVBO_getter, glSkyList_getter, skyVBO_getter; // RenderGlobal + + static { + try { + Field f = ReflectionHelper.findField(RenderManager.class, LibObfuscation.RENDERPOSX); + f.setAccessible(true); + renderPosX_getter = MethodHandles.publicLookup().unreflectGetter(f); + + f = ReflectionHelper.findField(RenderManager.class, LibObfuscation.RENDERPOSY); + f.setAccessible(true); + renderPosY_getter = MethodHandles.publicLookup().unreflectGetter(f); + + f = ReflectionHelper.findField(RenderManager.class, LibObfuscation.RENDERPOSZ); + f.setAccessible(true); + renderPosZ_getter = MethodHandles.publicLookup().unreflectGetter(f); + + f = ReflectionHelper.findField(RenderGlobal.class, LibObfuscation.STAR_GL_CALL_LIST); + f.setAccessible(true); + starGLCallList_getter = MethodHandles.publicLookup().unreflectGetter(f); + + f = ReflectionHelper.findField(RenderGlobal.class, LibObfuscation.STAR_VBO); + f.setAccessible(true); + starVBO_getter = MethodHandles.publicLookup().unreflectGetter(f); + + f = ReflectionHelper.findField(RenderGlobal.class, LibObfuscation.GL_SKY_LIST); + f.setAccessible(true); + glSkyList_getter = MethodHandles.publicLookup().unreflectGetter(f); + + f = ReflectionHelper.findField(RenderGlobal.class, LibObfuscation.SKY_VBO); + f.setAccessible(true); + skyVBO_getter = MethodHandles.publicLookup().unreflectGetter(f); + } catch (IllegalAccessException e) { + Botania.LOGGER.fatal("Couldn't initialize client methodhandles! Things will be broken!"); + e.printStackTrace(); + throw Throwables.propagate(e); + } + } + + private ClientMethodHandles() {} +} diff --git a/src/main/java/vazkii/botania/client/core/handler/ClientTickHandler.java b/src/main/java/vazkii/botania/client/core/handler/ClientTickHandler.java index 3f88f926a..1fa7197b0 100644 --- a/src/main/java/vazkii/botania/client/core/handler/ClientTickHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/ClientTickHandler.java @@ -10,28 +10,27 @@ */ package vazkii.botania.client.core.handler; -import java.util.ArrayList; -import java.util.List; - +import com.google.common.collect.ImmutableList; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; +import net.minecraftforge.fml.common.gameevent.TickEvent.RenderTickEvent; import vazkii.botania.api.mana.IManaCollector; import vazkii.botania.api.mana.TileSignature; -import vazkii.botania.client.core.handler.LightningHandler.LightningBolt; import vazkii.botania.client.gui.lexicon.GuiLexicon; import vazkii.botania.common.block.subtile.functional.SubTileVinculotus; import vazkii.botania.common.block.tile.corporea.TileCorporeaIndex; import vazkii.botania.common.core.handler.ManaNetworkHandler; -import vazkii.botania.common.item.ItemTwigWand; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent; -import cpw.mods.fml.common.gameevent.TickEvent.Phase; -import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; +import vazkii.botania.common.core.helper.PlayerHelper; +import vazkii.botania.common.item.ModItems; -public class ClientTickHandler { +public final class ClientTickHandler { + + private ClientTickHandler() {} public static int ticksWithLexicaOpen = 0; public static int pageFlipTicks = 0; @@ -40,26 +39,24 @@ public class ClientTickHandler { public static float delta = 0; public static float total = 0; - private void calcDelta() { + private static void calcDelta() { float oldTotal = total; total = ticksInGame + partialTicks; delta = total - oldTotal; } @SubscribeEvent - public void renderTick(RenderTickEvent event) { + public static void renderTick(RenderTickEvent event) { if(event.phase == Phase.START) partialTicks = event.renderTickTime; else { - TooltipAdditionDisplayHandler.render(); calcDelta(); } } @SubscribeEvent - public void clientTickEnd(ClientTickEvent event) { + public static void clientTickEnd(ClientTickEvent event) { if(event.phase == Phase.END) { - LightningBolt.update(); RedStringRenderer.tick(); ItemsRemainingRenderHandler.tick(); @@ -76,14 +73,12 @@ public class ClientTickHandler { EntityPlayer player = Minecraft.getMinecraft().thePlayer; if(player != null) { - ItemStack stack = player.getCurrentEquippedItem(); - if(stack != null && stack.getItem() instanceof ItemTwigWand) { - List list = new ArrayList(ManaNetworkHandler.instance.getAllCollectorsInWorld(Minecraft.getMinecraft().theWorld)); - for(TileSignature sig : list) { - if(!sig.remoteWorld) + if(PlayerHelper.hasHeldItemClass(player, ModItems.twigWand)) { + for(TileSignature sig : ImmutableList.copyOf(ManaNetworkHandler.instance.getAllCollectorsInWorld(Minecraft.getMinecraft().theWorld))) { + if(!sig.isRemote()) continue; - TileEntity tile = sig.tile; + TileEntity tile = sig.getTile(); if(tile instanceof IManaCollector) ((IManaCollector) tile).onClientDisplayTick(); } diff --git a/src/main/java/vazkii/botania/client/core/handler/ColorHandler.java b/src/main/java/vazkii/botania/client/core/handler/ColorHandler.java new file mode 100644 index 000000000..4b662e619 --- /dev/null +++ b/src/main/java/vazkii/botania/client/core/handler/ColorHandler.java @@ -0,0 +1,165 @@ +package vazkii.botania.client.core.handler; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.color.BlockColors; +import net.minecraft.client.renderer.color.IBlockColor; +import net.minecraft.client.renderer.color.ItemColors; +import net.minecraft.init.Blocks; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.fml.common.registry.RegistryDelegate; +import net.minecraftforge.fml.relauncher.ReflectionHelper; +import vazkii.botania.api.BotaniaAPI; +import vazkii.botania.api.brew.Brew; +import vazkii.botania.api.brew.IBrewItem; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.PoolVariant; +import vazkii.botania.api.state.enums.SpreaderVariant; +import vazkii.botania.common.Botania; +import vazkii.botania.common.block.BlockCamo; +import vazkii.botania.common.block.ModBlocks; +import vazkii.botania.common.block.tile.TileCamo; +import vazkii.botania.common.block.tile.mana.TilePool; +import vazkii.botania.common.entity.EntityManaBurst; +import vazkii.botania.common.item.ItemManaGun; +import vazkii.botania.common.item.ItemManaMirror; +import vazkii.botania.common.item.ItemManaTablet; +import vazkii.botania.common.item.ItemSignalFlare; +import vazkii.botania.common.item.ItemTwigWand; +import vazkii.botania.common.item.ModItems; +import vazkii.botania.common.item.equipment.bauble.ItemBloodPendant; +import vazkii.botania.common.item.equipment.tool.terrasteel.ItemTerraPick; +import vazkii.botania.common.item.lens.ItemLens; + +import java.awt.*; +import java.util.Map; + +public final class ColorHandler { + + public static void init() { + BlockColors blocks = Minecraft.getMinecraft().getBlockColors(); + Map, IBlockColor> map = ReflectionHelper.getPrivateValue(BlockColors.class, blocks, "blockColorMap"); + + // Steal vine colorer + blocks.registerBlockColorHandler(map.get(Blocks.VINE.delegate), ModBlocks.solidVines); + + // 16 colors + blocks.registerBlockColorHandler( + (state, world, pos, tintIndex) -> state.getValue(BotaniaStateProps.COLOR).getMapColor().colorValue, + ModBlocks.specialFlower, ModBlocks.manaBeacon, ModBlocks.petalBlock, ModBlocks.unstableBlock); + + // Pool + blocks.registerBlockColorHandler( + (state, world, pos, tintIndex) -> { + if (state.getValue(BotaniaStateProps.POOL_VARIANT) == PoolVariant.FABULOUS) { + float time = ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks; + return Color.HSBtoRGB(time * 0.005F, 0.6F, 1F); + } else { + return state.getValue(BotaniaStateProps.COLOR).getMapColor().colorValue; + } + }, + ModBlocks.pool + ); + + // Spreader + blocks.registerBlockColorHandler( + (state, world, pos, tintIndex) -> { + if(state.getValue(BotaniaStateProps.SPREADER_VARIANT) != SpreaderVariant.GAIA) + return 0xFFFFFF; + float time = ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks; + return Color.HSBtoRGB((time * 5) % 360 / 360F, 0.4F, 0.9F); + }, + ModBlocks.spreader + ); + + // Platforms + blocks.registerBlockColorHandler( + (state, world, pos, tintIndex) -> { + if (world != null && pos != null) { + TileEntity tile = world.getTileEntity(pos); + if(tile instanceof TileCamo) { + TileCamo camo = (TileCamo) tile; + IBlockState camoState = camo.camoState; + if(camoState != null) + return camoState.getBlock() instanceof BlockCamo + ? 0xFFFFFF + : Minecraft.getMinecraft().getBlockColors().colorMultiplier(camoState, world, pos, tintIndex); + } + } + return 0xFFFFFF; + }, ModBlocks.platform); + + ItemColors items = Minecraft.getMinecraft().getItemColors(); + + items.registerItemColorHandler((s, t) -> (s.getItemDamage() == 5 || s.getItemDamage() == 14) + ? Color.HSBtoRGB(Botania.proxy.getWorldElapsedTicks() * 2 % 360 / 360F, 0.25F, 1F) : -1, + ModItems.manaResource); + + items.registerItemColorHandler((s, t) -> + t == 1 ? EnumDyeColor.byMetadata(ItemTwigWand.getColor1(s)).getMapColor().colorValue + : t == 2 ? EnumDyeColor.byMetadata(ItemTwigWand.getColor2(s)).getMapColor().colorValue + : -1, + ModItems.twigWand); + + items.registerItemColorHandler((s, t) -> EnumDyeColor.byMetadata(s.getItemDamage()).getMapColor().colorValue, ModItems.dye, ModItems.petal); + + items.registerItemColorHandler((s, t) -> Minecraft.getMinecraft().getBlockColors().colorMultiplier(((ItemBlock)s.getItem()).block.getStateFromMeta(s.getMetadata()), null, null, t), + ModBlocks.manaBeacon, ModBlocks.petalBlock, ModBlocks.unstableBlock, ModBlocks.pool, ModBlocks.spreader); + + items.registerItemColorHandler((s, t) -> t == 1 ? Color.HSBtoRGB(0.528F, ((ItemManaMirror) ModItems.manaMirror).getMana(s) / TilePool.MAX_MANA, 1F) : -1, ModItems.manaMirror); + + items.registerItemColorHandler((s, t) -> t == 1 ? Color.HSBtoRGB(0.528F, ((ItemManaTablet) ModItems.manaTablet).getMana(s) / ItemManaTablet.MAX_MANA, 1F) : -1, ModItems.manaTablet); + + items.registerItemColorHandler((s, t) -> t == 1 ? EnumDyeColor.byMetadata(ItemSignalFlare.getColor(s)).getMapColor().colorValue : -1, ModItems.signalFlare); + + items.registerItemColorHandler((s, t) -> Color.HSBtoRGB(0.55F, ((float) s.getMaxDamage() - (float) s.getItemDamage()) / s.getMaxDamage() * 0.5F, 1F), ModItems.spellCloth); + + items.registerItemColorHandler((s, t) -> { + if(t != 1) + return -1; + + Brew brew = ((IBrewItem) s.getItem()).getBrew(s); + if(brew == BotaniaAPI.fallbackBrew) + return s.getItem() instanceof ItemBloodPendant ? 0xC6000E : 0x989898; + + Color color = new Color(brew.getColor(s)); + double speed = s.getItem() == ModItems.brewFlask || s.getItem() == ModItems.brewVial ? 0.1 : 0.2; + int add = (int) (Math.sin(ClientTickHandler.ticksInGame * speed) * 24); + + int r = Math.max(0, Math.min(255, color.getRed() + add)); + int g = Math.max(0, Math.min(255, color.getGreen() + add)); + int b = Math.max(0, Math.min(255, color.getBlue() + add)); + + return r << 16 | g << 8 | b; + }, ModItems.bloodPendant, ModItems.incenseStick, ModItems.brewFlask, ModItems.brewVial); + + items.registerItemColorHandler((s, t) -> { + ItemStack lens = ItemManaGun.getLens(s); + if(lens != null && t == 0) + return Minecraft.getMinecraft().getItemColors().getColorFromItemstack(lens, t); + + if(t == 2) { + EntityManaBurst burst = ((ItemManaGun) s.getItem()).getBurst(Minecraft.getMinecraft().thePlayer, s, false); + Color color = new Color(burst == null ? 0x20FF20 : burst.getColor()); + + float mul = (float) (Math.sin((double) ClientTickHandler.ticksInGame / 5) * 0.15F); + int c = (int) (255 * mul); + + return new Color(Math.max(0, Math.min(255, color.getRed() + c)), Math.max(0, Math.min(255, color.getGreen() + c)), Math.max(0, Math.min(255, color.getBlue() + c))).getRGB(); + } else return -1; + }, ModItems.manaGun); + + items.registerItemColorHandler((s, t) -> t == 1 ? Color.HSBtoRGB(0.75F, 1F, 1.5F - (float) Math.min(1F, Math.sin(System.currentTimeMillis() / 100D) * 0.5 + 1.2F)) : -1, ModItems.enderDagger); + + items.registerItemColorHandler((s, t) -> t == 1 && ItemTerraPick.isEnabled(s) ? Color.HSBtoRGB(0.375F, (float) Math.min(1F, Math.sin(System.currentTimeMillis() / 200D) * 0.5 + 1F), 1F) : -1, ModItems.terraPick); + + items.registerItemColorHandler((s, t) -> t == 0 ? ((ItemLens) s.getItem()).getLensColor(s) : -1, ModItems.lens); + } + + private ColorHandler() {} + +} diff --git a/src/main/java/vazkii/botania/client/core/handler/ContributorFancinessHandler.java b/src/main/java/vazkii/botania/client/core/handler/ContributorFancinessHandler.java index 91210ade0..93d8d64ab 100644 --- a/src/main/java/vazkii/botania/client/core/handler/ContributorFancinessHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/ContributorFancinessHandler.java @@ -10,55 +10,75 @@ */ package vazkii.botania.client.core.handler; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; +import net.minecraft.client.renderer.entity.layers.LayerRenderer; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EnumPlayerModelParts; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import vazkii.botania.api.BotaniaAPI; +import vazkii.botania.api.BotaniaAPIClient; +import vazkii.botania.api.item.IBaubleRender.Helper; +import vazkii.botania.api.subtile.signature.SubTileSignature; +import vazkii.botania.client.core.helper.IconHelper; +import vazkii.botania.client.core.helper.ShaderHelper; +import vazkii.botania.common.Botania; +import vazkii.botania.common.block.ModBlocks; +import vazkii.botania.common.core.version.VersionChecker; +import vazkii.botania.common.item.block.ItemBlockSpecialFlower; + +import javax.annotation.Nonnull; +import java.io.IOException; import java.io.InputStreamReader; import java.net.URL; import java.util.HashMap; import java.util.Map; import java.util.Properties; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.ItemRenderer; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.client.settings.GameSettings.Options; -import net.minecraft.util.IIcon; -import net.minecraftforge.client.event.RenderPlayerEvent; +public final class ContributorFancinessHandler implements LayerRenderer { -import org.lwjgl.opengl.GL11; - -import vazkii.botania.api.BotaniaAPI; -import vazkii.botania.api.item.IBaubleRender.Helper; -import vazkii.botania.api.subtile.signature.SubTileSignature; -import vazkii.botania.client.core.helper.ShaderHelper; -import vazkii.botania.common.block.ModBlocks; -import vazkii.botania.common.core.version.VersionChecker; -import vazkii.botania.common.item.ModItems; -import vazkii.botania.common.item.block.ItemBlockSpecialFlower; -import vazkii.botania.common.item.material.ItemManaResource; -import cpw.mods.fml.common.FMLLog; - -public final class ContributorFancinessHandler { - - public volatile static Map flowerMap = null; + public volatile static Map flowerMap = null; private volatile static boolean startedLoading = false; - private static boolean phi = true; + private static final boolean phi = false; - public static void render(RenderPlayerEvent.Specials event) { - String name = event.entityPlayer.getDisplayName(); + @Override + public void doRenderLayer(@Nonnull EntityPlayer player, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) { + String name = player.getDisplayName().getUnformattedText(); + + float yaw = player.prevRotationYawHead + (player.rotationYawHead - player.prevRotationYawHead) * partialTicks; + float yawOffset = player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * partialTicks; + float pitch = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * partialTicks; + + GlStateManager.pushMatrix(); + GlStateManager.rotate(yawOffset, 0, -1, 0); + GlStateManager.rotate(yaw - 270, 0, 1, 0); + GlStateManager.rotate(pitch, 0, 0, 1); if(name.equals("Vazkii") || name.equals("_phi")) { if(phi) - renderPhiFlower(event); - else renderTwintails(event); + renderPhiFlower(player); + else renderTwintails(player, partialTicks); } else if(name.equals("haighyorkie")) - renderGoldfish(event); + renderGoldfish(player); firstStart(); - + name = name.toLowerCase(); - if(Minecraft.getMinecraft().gameSettings.getOptionOrdinalValue(Options.SHOW_CAPE) && flowerMap != null && flowerMap.containsKey(name)) - renderFlower(event, flowerMap.get(name)); + if(player.isWearing(EnumPlayerModelParts.CAPE) && flowerMap != null && flowerMap.containsKey(name)) + renderFlower(player, flowerMap.get(name)); + + GlStateManager.popMatrix(); + } + + @Override + public boolean shouldCombineTextures() { + return false; } public static void firstStart() { @@ -69,7 +89,7 @@ public final class ContributorFancinessHandler { } public static void load(Properties props) { - flowerMap = new HashMap(); + flowerMap = new HashMap<>(); for(String key : props.stringPropertyNames()) { String value = props.getProperty(key); @@ -77,103 +97,97 @@ public final class ContributorFancinessHandler { int i = Integer.parseInt(value); if(i < 0 || i >= 16) throw new NumberFormatException(); - flowerMap.put(key, ModBlocks.flower.func_149735_b(0, i)); + flowerMap.put(key, new ItemStack(ModBlocks.flower, 1, i)); } catch(NumberFormatException e) { - SubTileSignature sig = BotaniaAPI.getSignatureForName(value); - if(sig != null) - flowerMap.put(key, ItemBlockSpecialFlower.ofType(value).getIconIndex()); + flowerMap.put(key, ItemBlockSpecialFlower.ofType(value)); } } } - private static void renderTwintails(RenderPlayerEvent event) { - GL11.glPushMatrix(); - IIcon icon = ((ItemManaResource) ModItems.manaResource).tailIcon; + private static void renderTwintails(EntityPlayer player, float partialTicks) { + GlStateManager.pushMatrix(); + TextureAtlasSprite icon = MiscellaneousIcons.INSTANCE.tailIcon; float f = icon.getMinU(); float f1 = icon.getMaxU(); float f2 = icon.getMinV(); float f3 = icon.getMaxV(); - Helper.translateToHeadLevel(event.entityPlayer); - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); - GL11.glColor4f(1F, 1F, 1F, 1F); - GL11.glRotatef(90F, 0F, 1F, 0F); + Helper.translateToHeadLevel(player); + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + GlStateManager.color(1F, 1F, 1F, 1F); + GlStateManager.rotate(90F, 0F, 1F, 0F); + GlStateManager.translate(0, 1.62, 0); float t = 0.13F; - GL11.glTranslatef(t, -0.5F, -0.1F); - if(event.entityPlayer.motionY < 0) - GL11.glRotatef((float) event.entityPlayer.motionY * 20F, 1F, 0F, 0F); + GlStateManager.translate(t, -0.5F, -0.1F); + if(player.motionY < 0) + GlStateManager.rotate((float) player.motionY * 20F, 1F, 0F, 0F); - float r = -18F + (float) Math.sin((ClientTickHandler.ticksInGame + event.partialRenderTick) * 0.05F) * 2F; - GL11.glRotatef(r, 0F, 0F, 1F); + float r = -18F + (float) Math.sin((ClientTickHandler.ticksInGame + partialTicks) * 0.1F) * 2F; + GlStateManager.rotate(r, 0F, 0F, 1F); float s = 0.9F; - GL11.glScalef(s, s, s); - ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F); - GL11.glRotatef(-r, 0F, 0F, 1F); - GL11.glTranslatef(-t, -0F, 0F); - GL11.glScalef(-1F, 1F, 1F); - GL11.glTranslatef(t, -0F, 0F); - GL11.glRotatef(r, 0F, 0F, 1F); - ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F); - GL11.glPopMatrix(); + GlStateManager.scale(s, s, s); + IconHelper.renderIconIn3D(Tessellator.getInstance(), f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F); + GlStateManager.rotate(-r, 0F, 0F, 1F); + GlStateManager.translate(-t, -0F, 0F); + GlStateManager.scale(-1F, 1F, 1F); + GlStateManager.translate(t, -0F, 0F); + GlStateManager.rotate(r, 0F, 0F, 1F); + IconHelper.renderIconIn3D(Tessellator.getInstance(), f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F); + GlStateManager.popMatrix(); } - private static void renderPhiFlower(RenderPlayerEvent event) { - GL11.glPushMatrix(); - IIcon icon = ((ItemManaResource) ModItems.manaResource).phiFlowerIcon; + private static void renderPhiFlower(EntityPlayer player) { + GlStateManager.pushMatrix(); + TextureAtlasSprite icon = MiscellaneousIcons.INSTANCE.phiFlowerIcon; float f = icon.getMinU(); float f1 = icon.getMaxU(); float f2 = icon.getMinV(); float f3 = icon.getMaxV(); - Helper.translateToHeadLevel(event.entityPlayer); - GL11.glRotatef(90F, 0F, 1F, 0F); - GL11.glRotatef(180F, 1F, 0F, 0F); - GL11.glTranslatef(-0.4F, 0.1F, -0.25F); - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); - GL11.glRotatef(90F, 0F, 1F, 0F); - GL11.glScalef(0.4F, 0.4F, 0.4F); - GL11.glTranslatef(-1.2F, 0.2F, 0.125F); - GL11.glRotatef(20F, 1F, 0F, 0F); - ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F); - GL11.glPopMatrix(); + Helper.translateToHeadLevel(player); + GlStateManager.rotate(90F, 0F, 1F, 0F); + GlStateManager.rotate(180F, 1F, 0F, 0F); + GlStateManager.translate(-0.4F, 0.1F, -0.25F); + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + GlStateManager.rotate(90F, 0F, 1F, 0F); + GlStateManager.scale(0.4F, 0.4F, 0.4F); + GlStateManager.translate(-1F, -3.5F, 0.125F); + GlStateManager.rotate(20F, 1F, 0F, 0F); + IconHelper.renderIconIn3D(Tessellator.getInstance(), f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F); + GlStateManager.popMatrix(); } - private static void renderGoldfish(RenderPlayerEvent event) { - GL11.glPushMatrix(); - IIcon icon = ((ItemManaResource) ModItems.manaResource).goldfishIcon; + private static void renderGoldfish(EntityPlayer player) { + GlStateManager.pushMatrix(); + TextureAtlasSprite icon = MiscellaneousIcons.INSTANCE.goldfishIcon; float f = icon.getMinU(); float f1 = icon.getMaxU(); float f2 = icon.getMinV(); float f3 = icon.getMaxV(); - Helper.rotateIfSneaking(event.entityPlayer); - GL11.glRotatef(90F, 0F, 1F, 0F); - GL11.glRotatef(180F, 0F, 0F, 1F); - GL11.glTranslatef(-0.75F, 0.5F, 0F); - GL11.glScalef(0.4F, 0.4F, 0.4F); - GL11.glTranslatef(1.2F, 0.5F, 0F); - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); - ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F); - GL11.glPopMatrix(); + Helper.rotateIfSneaking(player); + GlStateManager.rotate(180F, 0F, 0F, 1F); + GlStateManager.rotate(90F, 0F, 1F, 0F); + GlStateManager.scale(0.4F, 0.4F, 0.4F); + GlStateManager.translate(-0.5F, 1.6F, 0F); + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + IconHelper.renderIconIn3D(Tessellator.getInstance(), f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F); + GlStateManager.popMatrix(); } - private static void renderFlower(RenderPlayerEvent event, IIcon icon) { - GL11.glPushMatrix(); - Helper.translateToHeadLevel(event.entityPlayer); - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); - float f = icon.getMinU(); - float f1 = icon.getMaxU(); - float f2 = icon.getMinV(); - float f3 = icon.getMaxV(); - GL11.glRotatef(180F, 0F, 0F, 1F); - GL11.glRotatef(90F, 0F, 1F, 0F); - GL11.glScalef(0.5F, 0.5F, 0.5F); - GL11.glTranslatef(-0.5F, 0.7F, 0F); - + @SuppressWarnings("deprecation") + private static void renderFlower(EntityPlayer player, ItemStack flower) { + GlStateManager.pushMatrix(); + Helper.translateToHeadLevel(player); + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + GlStateManager.rotate(180, 0, 0, 1); + GlStateManager.translate(0, -0.85, 0); + GlStateManager.rotate(-90, 0, 1, 0); + GlStateManager.scale(0.5, 0.5, 0.5); ShaderHelper.useShader(ShaderHelper.gold); - ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F); + Minecraft.getMinecraft().getRenderItem().renderItem(flower, player, ItemCameraTransforms.TransformType.NONE, false); ShaderHelper.releaseShader(); - GL11.glPopMatrix(); + GlStateManager.popMatrix(); } - public static class ThreadContributorListLoader extends Thread { + private static class ThreadContributorListLoader extends Thread { public ThreadContributorListLoader() { setName("Botania Contributor Fanciness Thread"); @@ -186,11 +200,12 @@ public final class ContributorFancinessHandler { try { URL url = new URL("https://raw.githubusercontent.com/Vazkii/Botania/master/contributors.properties"); Properties props = new Properties(); - props.load(new InputStreamReader(url.openStream())); - load(props); - } catch(Exception e) { - FMLLog.info("[Botania] Could not load contributors list. Either you're offline or github is down. Nothing to worry about, carry on~"); - e.printStackTrace(); + try (InputStreamReader reader = new InputStreamReader(url.openStream())) { + props.load(reader); + load(props); + } + } catch (IOException e) { + Botania.LOGGER.info("Could not load contributors list. Either you're offline or github is down. Nothing to worry about, carry on~"); } VersionChecker.doneChecking = true; } diff --git a/src/main/java/vazkii/botania/client/core/handler/CorporeaAutoCompleteHandler.java b/src/main/java/vazkii/botania/client/core/handler/CorporeaAutoCompleteHandler.java index b33560e04..dd1a091e6 100644 --- a/src/main/java/vazkii/botania/client/core/handler/CorporeaAutoCompleteHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/CorporeaAutoCompleteHandler.java @@ -10,52 +10,44 @@ */ package vazkii.botania.client.core.handler; +import com.google.common.collect.ImmutableList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiChat; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.text.TextComponentString; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; +import net.minecraftforge.fml.relauncher.ReflectionHelper; +import org.lwjgl.input.Keyboard; +import vazkii.botania.api.corporea.CorporeaHelper; +import vazkii.botania.common.lib.LibObfuscation; + +import javax.annotation.Nonnull; import java.util.ArrayList; -import java.util.Comparator; import java.util.Iterator; import java.util.List; import java.util.SortedSet; import java.util.TreeSet; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.gui.GuiTextField; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChatComponentText; - -import org.lwjgl.input.Keyboard; - -import vazkii.botania.api.corporea.CorporeaHelper; -import vazkii.botania.common.lib.LibObfuscation; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent; -import cpw.mods.fml.common.gameevent.TickEvent.Phase; -import cpw.mods.fml.relauncher.ReflectionHelper; - public class CorporeaAutoCompleteHandler { - boolean isAutoCompleted = false; - String originalString = ""; - List completions = new ArrayList(); - int position; + private boolean isAutoCompleted = false; + private String originalString = ""; + private List completions = new ArrayList<>(); + private int position; - static TreeSet itemNames = new TreeSet( - new Comparator() { - @Override - public int compare(String arg0, String arg1) { - return arg0.compareToIgnoreCase(arg1); - } - }); + static final TreeSet itemNames = new TreeSet<>(String::compareToIgnoreCase); private boolean tabLastTick = false; public static void updateItemList() { itemNames.clear(); - Iterator iterator = Item.itemRegistry.iterator(); - ArrayList curList = new ArrayList(); + Iterator iterator = Item.REGISTRY.iterator(); + ArrayList curList = new ArrayList<>(); while(iterator.hasNext()) { Item item = iterator.next(); @@ -63,7 +55,7 @@ public class CorporeaAutoCompleteHandler { if(item != null && item.getCreativeTab() != null) { curList.clear(); try { - item.getSubItems(item, (CreativeTabs) null, curList); + item.getSubItems(item, null, curList); for(ItemStack stack : curList) itemNames.add(CorporeaHelper.stripControlCodes(stack.getDisplayName().trim())); } @@ -136,17 +128,17 @@ public class CorporeaAutoCompleteHandler { stringbuilder.append(", "); } - Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessageWithOptionalDeletion(new ChatComponentText(stringbuilder.toString()), 1); + Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessageWithOptionalDeletion(new TextComponentString(stringbuilder.toString()), 1); isAutoCompleted = true; originalString = inputField.getText(); } - private ArrayList getNames(String prefix) { + private List getNames(String prefix) { String s = prefix.trim(); if(s.isEmpty()) - return new ArrayList(); + return ImmutableList.of(); - TreeSet result = new TreeSet(); + TreeSet result = new TreeSet<>(); String[] words = s.split(" "); int i = words.length - 1; String curPrefix = words[i]; @@ -156,11 +148,11 @@ public class CorporeaAutoCompleteHandler { if(i >= 0) curPrefix = words[i] + " " + curPrefix; } - return new ArrayList(result); + return new ArrayList<>(result); } private List getNamesStartingWith(String prefix) { - ArrayList result = new ArrayList(); + ArrayList result = new ArrayList<>(); int length = prefix.length(); SortedSet after = itemNames.tailSet(prefix); for(String str : after) { @@ -173,8 +165,8 @@ public class CorporeaAutoCompleteHandler { private static class CompletionData implements Comparable { - private String string; - private int prefixLength; + private final String string; + private final int prefixLength; public CompletionData(String string, int prefixLength) { this.string = string; @@ -182,7 +174,7 @@ public class CorporeaAutoCompleteHandler { } @Override - public int compareTo(CompletionData arg0) { + public int compareTo(@Nonnull CompletionData arg0) { return string.compareTo(arg0.string); } } diff --git a/src/main/java/vazkii/botania/client/core/handler/DebugHandler.java b/src/main/java/vazkii/botania/client/core/handler/DebugHandler.java index 9e6055b7a..bb3acc68e 100644 --- a/src/main/java/vazkii/botania/client/core/handler/DebugHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/DebugHandler.java @@ -10,57 +10,92 @@ */ package vazkii.botania.client.core.handler; +import com.google.common.base.Optional; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; -import net.minecraft.util.EnumChatFormatting; +import net.minecraft.entity.Entity; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; import net.minecraftforge.client.event.RenderGameOverlayEvent; - +import net.minecraftforge.common.property.IExtendedBlockState; +import net.minecraftforge.common.property.IUnlistedProperty; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import org.lwjgl.opengl.ARBFragmentShader; import org.lwjgl.opengl.ContextCapabilities; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL20; import org.lwjgl.opengl.GLContext; - import vazkii.botania.client.fx.ParticleRenderDispatcher; import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.core.handler.ManaNetworkHandler; import vazkii.botania.common.lib.LibMisc; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +import java.util.Map; +import java.util.UUID; public final class DebugHandler { - private static final String PREFIX = EnumChatFormatting.GREEN + "[Botania] " + EnumChatFormatting.RESET; + private DebugHandler() {} + + private static final String PREFIX = TextFormatting.GREEN + "[Botania] " + TextFormatting.RESET; @SubscribeEvent - public void onDrawDebugText(RenderGameOverlayEvent.Text event) { + public static void onDrawDebugText(RenderGameOverlayEvent.Text event) { World world = Minecraft.getMinecraft().theWorld; if(Minecraft.getMinecraft().gameSettings.showDebugInfo) { - event.left.add(null); + event.getLeft().add(""); String version = LibMisc.VERSION; if(version.contains("GRADLE")) version = "N/A"; - event.left.add(PREFIX + "pS: " + ParticleRenderDispatcher.sparkleFxCount + ", pFS: " + ParticleRenderDispatcher.fakeSparkleFxCount + ", pW: " + ParticleRenderDispatcher.wispFxCount + ", pDIW: " + ParticleRenderDispatcher.depthIgnoringWispFxCount + ", pLB: " + ParticleRenderDispatcher.lightningCount); - event.left.add(PREFIX + "netColl: " + ManaNetworkHandler.instance.getAllCollectorsInWorld(world).size() + ", netPool: " + ManaNetworkHandler.instance.getAllPoolsInWorld(world).size() + ", rv: " + version); + event.getLeft().add(PREFIX + "pS: " + ParticleRenderDispatcher.sparkleFxCount + ", pFS: " + ParticleRenderDispatcher.fakeSparkleFxCount + ", pW: " + ParticleRenderDispatcher.wispFxCount + ", pDIW: " + ParticleRenderDispatcher.depthIgnoringWispFxCount + ", pLB: " + ParticleRenderDispatcher.lightningCount); + event.getLeft().add(PREFIX + "(CLIENT) netColl: " + ManaNetworkHandler.instance.getAllCollectorsInWorld(world).size() + ", netPool: " + ManaNetworkHandler.instance.getAllPoolsInWorld(world).size() + ", rv: " + version); + + if (Minecraft.getMinecraft().isSingleplayer()) { + UUID id = Minecraft.getMinecraft().thePlayer.getUniqueID(); + Entity ent = Minecraft.getMinecraft().getIntegratedServer().getEntityFromUuid(id); + if (ent != null) { + World serverWorld = Minecraft.getMinecraft().getIntegratedServer().getEntityFromUuid(id).worldObj; + event.getLeft().add(PREFIX + String.format("(INTEGRATED SERVER DIM %d) netColl : %d, netPool: %d", serverWorld.provider.getDimension(), ManaNetworkHandler.instance.getAllCollectorsInWorld(serverWorld).size(), ManaNetworkHandler.instance.getAllPoolsInWorld(serverWorld).size())); + } + } if(GuiScreen.isCtrlKeyDown() && GuiScreen.isShiftKeyDown()) { - event.left.add(PREFIX + "Config Context"); - event.left.add(" shaders.enabled: " + ConfigHandler.useShaders); - event.left.add(" shaders.secondaryUnit: " + ConfigHandler.glSecondaryTextureUnit); + event.getLeft().add(PREFIX + "Config Context"); + event.getLeft().add(" shaders.enabled: " + ConfigHandler.useShaders); + event.getLeft().add(" shaders.secondaryUnit: " + ConfigHandler.glSecondaryTextureUnit); ContextCapabilities caps = GLContext.getCapabilities(); - event.left.add(PREFIX + "OpenGL Context"); - event.left.add(" GL_VERSION: " + GL11.glGetString(GL11.GL_VERSION)); - event.left.add(" GL_RENDERER: " + GL11.glGetString(GL11.GL_RENDERER)); - event.left.add(" GL_SHADING_LANGUAGE_VERSION: " + GL11.glGetString(GL20.GL_SHADING_LANGUAGE_VERSION)); - event.left.add(" GL_MAX_TEXTURE_IMAGE_UNITS_ARB: " + GL11.glGetInteger(ARBFragmentShader.GL_MAX_TEXTURE_IMAGE_UNITS_ARB)); - event.left.add(" GL_ARB_multitexture: " + caps.GL_ARB_multitexture); - event.left.add(" GL_ARB_texture_non_power_of_two: " + caps.GL_ARB_texture_non_power_of_two); - event.left.add(" OpenGL13: " + caps.OpenGL13); - } else if(Minecraft.isRunningOnMac) - event.left.add(PREFIX + "SHIFT+CMD for context"); - else event.left.add(PREFIX + "SHIFT+CTRL for context"); + event.getLeft().add(PREFIX + "OpenGL Context"); + event.getLeft().add(" GL_VERSION: " + GL11.glGetString(GL11.GL_VERSION)); + event.getLeft().add(" GL_RENDERER: " + GL11.glGetString(GL11.GL_RENDERER)); + event.getLeft().add(" GL_SHADING_LANGUAGE_VERSION: " + GL11.glGetString(GL20.GL_SHADING_LANGUAGE_VERSION)); + event.getLeft().add(" GL_MAX_TEXTURE_IMAGE_UNITS_ARB: " + GL11.glGetInteger(ARBFragmentShader.GL_MAX_TEXTURE_IMAGE_UNITS_ARB)); + event.getLeft().add(" GL_ARB_multitexture: " + caps.GL_ARB_multitexture); + event.getLeft().add(" GL_ARB_texture_non_power_of_two: " + caps.GL_ARB_texture_non_power_of_two); + event.getLeft().add(" OpenGL13: " + caps.OpenGL13); + + if (Minecraft.getMinecraft().objectMouseOver != null + && Minecraft.getMinecraft().objectMouseOver.getBlockPos() != null) { + BlockPos pos = Minecraft.getMinecraft().objectMouseOver.getBlockPos(); + IBlockState state = world.getBlockState(pos); + state = state.getActualState(world, pos); + state = state.getBlock().getExtendedState(state, world, pos); + if (state instanceof IExtendedBlockState) { + try { + for (Map.Entry, Optional> e : ((IExtendedBlockState) state).getUnlistedProperties().entrySet()) { + event.getRight().add(TextFormatting.LIGHT_PURPLE + e.getKey().getName() + ": " + TextFormatting.RESET + e.getValue().orNull()); + } + } catch (Throwable t) { + event.getRight().add("Error getting extended state"); + } + } + } + } else if(Minecraft.IS_RUNNING_ON_MAC) + event.getLeft().add(PREFIX + "SHIFT+CMD for context"); + else event.getLeft().add(PREFIX + "SHIFT+CTRL for context"); } } diff --git a/src/main/java/vazkii/botania/client/core/handler/HUDHandler.java b/src/main/java/vazkii/botania/client/core/handler/HUDHandler.java index 576ae446e..c6c1c83c4 100644 --- a/src/main/java/vazkii/botania/client/core/handler/HUDHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/HUDHandler.java @@ -10,34 +10,33 @@ */ package vazkii.botania.client.core.handler; -import java.awt.Color; - +import baubles.common.lib.PlayerHandler; import net.minecraft.block.Block; import net.minecraft.block.BlockLiquid; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.GuiChat; import net.minecraft.client.gui.GuiIngame; import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.profiler.Profiler; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.text.TextFormatting; import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; - +import net.minecraftforge.fml.common.eventhandler.EventPriority; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.relauncher.ReflectionHelper; import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - -import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.lexicon.ILexicon; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; @@ -58,6 +57,7 @@ import vazkii.botania.common.block.tile.corporea.TileCorporeaCrystalCube; import vazkii.botania.common.block.tile.corporea.TileCorporeaIndex; import vazkii.botania.common.block.tile.mana.TilePool; import vazkii.botania.common.core.handler.ConfigHandler; +import vazkii.botania.common.core.helper.PlayerHelper; import vazkii.botania.common.item.ItemCraftingHalo; import vazkii.botania.common.item.ItemSextant; import vazkii.botania.common.item.ItemTwigWand; @@ -65,26 +65,26 @@ import vazkii.botania.common.item.ModItems; import vazkii.botania.common.item.equipment.bauble.ItemFlightTiara; import vazkii.botania.common.item.equipment.bauble.ItemMonocle; import vazkii.botania.common.lib.LibObfuscation; -import baubles.common.lib.PlayerHandler; -import cpw.mods.fml.common.eventhandler.EventPriority; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.ReflectionHelper; + +import java.awt.*; public final class HUDHandler { + private HUDHandler() {} + public static final ResourceLocation manaBar = new ResourceLocation(LibResources.GUI_MANA_HUD); @SubscribeEvent(priority = EventPriority.HIGHEST) - public void onDrawScreenPre(RenderGameOverlayEvent.Pre event) { + public static void onDrawScreenPre(RenderGameOverlayEvent.Pre event) { Minecraft mc = Minecraft.getMinecraft(); Profiler profiler = mc.mcProfiler; - if(event.type == ElementType.HEALTH) { + if(event.getType() == ElementType.HEALTH) { profiler.startSection("botania-hud"); ItemStack amulet = PlayerHandler.getPlayerBaubles(mc.thePlayer).getStackInSlot(0); if(amulet != null && amulet.getItem() == ModItems.flightTiara) { profiler.startSection("flugelTiara"); - ItemFlightTiara.renderHUD(event.resolution, mc.thePlayer, amulet); + ItemFlightTiara.renderHUD(event.getResolution(), mc.thePlayer, amulet); profiler.endSection(); } profiler.endSection(); @@ -92,131 +92,138 @@ public final class HUDHandler { } @SubscribeEvent - public void onDrawScreenPost(RenderGameOverlayEvent.Post event) { + public static void onDrawScreenPost(RenderGameOverlayEvent.Post event) { Minecraft mc = Minecraft.getMinecraft(); Profiler profiler = mc.mcProfiler; - ItemStack equippedStack = mc.thePlayer.getCurrentEquippedItem(); + ItemStack main = mc.thePlayer.getHeldItemMainhand(); + ItemStack offhand = mc.thePlayer.getHeldItemOffhand(); - if(event.type == ElementType.ALL) { + if(event.getType() == ElementType.ALL) { profiler.startSection("botania-hud"); - MovingObjectPosition pos = mc.objectMouseOver; + RayTraceResult pos = mc.objectMouseOver; if(pos != null) { - Block block = mc.theWorld.getBlock(pos.blockX, pos.blockY, pos.blockZ); - TileEntity tile = mc.theWorld.getTileEntity(pos.blockX, pos.blockY, pos.blockZ); + IBlockState state = pos.typeOfHit == RayTraceResult.Type.BLOCK ? mc.theWorld.getBlockState(pos.getBlockPos()) : null; + Block block = state == null ? null : state.getBlock(); + TileEntity tile = pos.typeOfHit == RayTraceResult.Type.BLOCK ? mc.theWorld.getTileEntity(pos.getBlockPos()) : null; - if(equippedStack != null) { - if(pos != null && equippedStack.getItem() == ModItems.twigWand) { - renderWandModeDisplay(event.resolution); + if(PlayerHelper.hasAnyHeldItem(mc.thePlayer)) { + if(pos != null && PlayerHelper.hasHeldItem(mc.thePlayer, ModItems.twigWand)) { + renderWandModeDisplay(PlayerHelper.getFirstHeldItem(mc.thePlayer, ModItems.twigWand), event.getResolution()); if(block instanceof IWandHUD) { profiler.startSection("wandItem"); - ((IWandHUD) block).renderHUD(mc, event.resolution, mc.theWorld, pos.blockX, pos.blockY, pos.blockZ); + ((IWandHUD) block).renderHUD(mc, event.getResolution(), mc.theWorld, pos.getBlockPos()); profiler.endSection(); } - } else if(pos != null && equippedStack.getItem() instanceof ILexicon) - drawLexiconHUD(mc.thePlayer.getCurrentEquippedItem(), block, pos, event.resolution); - if(tile != null && tile instanceof TilePool) - renderPoolRecipeHUD(event.resolution, (TilePool) tile, equippedStack); + } else if(block != null && PlayerHelper.hasHeldItemClass(mc.thePlayer, ILexicon.class)) + drawLexiconHUD(PlayerHelper.getFirstHeldItemClass(mc.thePlayer, ILexicon.class), state, pos, event.getResolution()); + if(tile != null && tile instanceof TilePool && mc.thePlayer.getHeldItemMainhand() != null) + renderPoolRecipeHUD(event.getResolution(), (TilePool) tile, mc.thePlayer.getHeldItemMainhand()); } if(tile != null && tile instanceof TileAltar) - ((TileAltar) tile).renderHUD(mc, event.resolution); + ((TileAltar) tile).renderHUD(mc, event.getResolution()); else if(tile != null && tile instanceof TileRuneAltar) - ((TileRuneAltar) tile).renderHUD(mc, event.resolution); + ((TileRuneAltar) tile).renderHUD(mc, event.getResolution()); if(tile != null && tile instanceof TileCorporeaCrystalCube) - renderCrystalCubeHUD(event.resolution, (TileCorporeaCrystalCube) tile); + renderCrystalCubeHUD(event.getResolution(), (TileCorporeaCrystalCube) tile); } if(!TileCorporeaIndex.getInputHandler().getNearbyIndexes(mc.thePlayer).isEmpty() && mc.currentScreen != null && mc.currentScreen instanceof GuiChat) { profiler.startSection("nearIndex"); - renderNearIndexDisplay(event.resolution); + renderNearIndexDisplay(event.getResolution()); profiler.endSection(); } if(MultiblockRenderHandler.currentMultiblock != null && MultiblockRenderHandler.anchor == null) { profiler.startSection("multiblockRightClick"); - String s = StatCollector.translateToLocal("botaniamisc.rightClickToAnchor"); - mc.fontRenderer.drawStringWithShadow(s, event.resolution.getScaledWidth() / 2 - mc.fontRenderer.getStringWidth(s) / 2, event.resolution.getScaledHeight() / 2 - 30, 0xFFFFFF); + String s = I18n.format("botaniamisc.rightClickToAnchor"); + mc.fontRendererObj.drawStringWithShadow(s, event.getResolution().getScaledWidth() / 2 - mc.fontRendererObj.getStringWidth(s) / 2, event.getResolution().getScaledHeight() / 2 - 30, 0xFFFFFF); profiler.endSection(); } - if(equippedStack != null && equippedStack.getItem() instanceof ItemCraftingHalo) { - profiler.startSection("craftingHalo"); - ItemCraftingHalo.renderHUD(event.resolution, mc.thePlayer, equippedStack); + if(main != null && main.getItem() instanceof ItemCraftingHalo) { + profiler.startSection("craftingHalo_main"); + ItemCraftingHalo.renderHUD(event.getResolution(), mc.thePlayer, main); + profiler.endSection(); + } else if(offhand != null && offhand.getItem() instanceof ItemCraftingHalo) { + profiler.startSection("craftingHalo_off"); + ItemCraftingHalo.renderHUD(event.getResolution(), mc.thePlayer, offhand); profiler.endSection(); } - if(equippedStack != null && equippedStack.getItem() instanceof ItemSextant) { + if(main != null && main.getItem() instanceof ItemSextant) { profiler.startSection("sextant"); - ItemSextant.renderHUD(event.resolution, mc.thePlayer, equippedStack); + ItemSextant.renderHUD(event.getResolution(), mc.thePlayer, main); profiler.endSection(); } /*if(equippedStack != null && equippedStack.getItem() == ModItems.flugelEye) { profiler.startSection("flugelEye"); - ItemFlugelEye.renderHUD(event.resolution, mc.thePlayer, equippedStack); + ItemFlugelEye.renderHUD(event.getResolution(), mc.thePlayer, equippedStack); profiler.endSection(); }*/ if(Botania.proxy.isClientPlayerWearingMonocle()) { profiler.startSection("monocle"); - ItemMonocle.renderHUD(event.resolution, mc.thePlayer); + ItemMonocle.renderHUD(event.getResolution(), mc.thePlayer); profiler.endSection(); } profiler.startSection("manaBar"); + EntityPlayer player = mc.thePlayer; - int totalMana = 0; - int totalMaxMana = 0; - boolean anyRequest = false; - boolean creative = false; + if(!player.isSpectator()) { + int totalMana = 0; + int totalMaxMana = 0; + boolean anyRequest = false; + boolean creative = false; - IInventory mainInv = player.inventory; - IInventory baublesInv = PlayerHandler.getPlayerBaubles(player); + IInventory mainInv = player.inventory; + IInventory baublesInv = PlayerHandler.getPlayerBaubles(player); - int invSize = mainInv.getSizeInventory(); - int size = invSize; - if(baublesInv != null) - size += baublesInv.getSizeInventory(); + int invSize = mainInv.getSizeInventory(); + int size = invSize; + if(baublesInv != null) + size += baublesInv.getSizeInventory(); - for(int i = 0; i < size; i++) { - boolean useBaubles = i >= invSize; - IInventory inv = useBaubles ? baublesInv : mainInv; - ItemStack stack = inv.getStackInSlot(i - (useBaubles ? invSize : 0)); + for(int i = 0; i < size; i++) { + boolean useBaubles = i >= invSize; + IInventory inv = useBaubles ? baublesInv : mainInv; + ItemStack stack = inv.getStackInSlot(i - (useBaubles ? invSize : 0)); - if(stack != null) { - Item item = stack.getItem(); - if(item instanceof IManaUsingItem) - anyRequest = anyRequest || ((IManaUsingItem) item).usesMana(stack); + if(stack != null) { + Item item = stack.getItem(); + if(item instanceof IManaUsingItem) + anyRequest = anyRequest || ((IManaUsingItem) item).usesMana(stack); - if(item instanceof IManaItem) { - if(!((IManaItem) item).isNoExport(stack)) { - totalMana += ((IManaItem) item).getMana(stack); - totalMaxMana += ((IManaItem) item).getMaxMana(stack); + if(item instanceof IManaItem) { + if(!((IManaItem) item).isNoExport(stack)) { + totalMana += ((IManaItem) item).getMana(stack); + totalMaxMana += ((IManaItem) item).getMaxMana(stack); + } } - } - if(item instanceof ICreativeManaProvider && ((ICreativeManaProvider) item).isCreative(stack)) - creative = true; + if(item instanceof ICreativeManaProvider && ((ICreativeManaProvider) item).isCreative(stack)) + creative = true; + } } + + if(anyRequest) + renderManaInvBar(event.getResolution(), creative, totalMana, totalMaxMana); } - if(anyRequest) - renderManaInvBar(event.resolution, creative, totalMana, totalMaxMana); - - profiler.endStartSection("bossBar"); - BossBarHandler.render(event.resolution); profiler.endStartSection("itemsRemaining"); - ItemsRemainingRenderHandler.render(event.resolution, event.partialTicks); + ItemsRemainingRenderHandler.render(event.getResolution(), event.getPartialTicks()); profiler.endSection(); profiler.endSection(); - GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.color(1F, 1F, 1F, 1F); } } - private void renderWandModeDisplay(ScaledResolution res) { + private static void renderWandModeDisplay(ItemStack stack, ScaledResolution res) { Minecraft mc = Minecraft.getMinecraft(); Profiler profiler = mc.mcProfiler; @@ -226,20 +233,20 @@ public final class HUDHandler { if(ticks > 0) { int alpha = Math.min(255, (int) (ticks * 256.0F / 10.0F)); int color = 0x00CC00 + (alpha << 24); - String disp = StatCollector.translateToLocal(ItemTwigWand.getModeString(mc.thePlayer.getCurrentEquippedItem())); + String disp = I18n.format(ItemTwigWand.getModeString(stack)); - int x = res.getScaledWidth() / 2 - mc.fontRenderer.getStringWidth(disp) / 2; + int x = res.getScaledWidth() / 2 - mc.fontRendererObj.getStringWidth(disp) / 2; int y = res.getScaledHeight() - 70; - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - mc.fontRenderer.drawStringWithShadow(disp, x, y, color); - GL11.glDisable(GL11.GL_BLEND); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + mc.fontRendererObj.drawStringWithShadow(disp, x, y, color); + GlStateManager.disableBlend(); } profiler.endSection(); } - private void renderManaInvBar(ScaledResolution res, boolean hasCreative, int totalMana, int totalMaxMana) { + private static void renderManaInvBar(ScaledResolution res, boolean hasCreative, int totalMana, int totalMaxMana) { Minecraft mc = Minecraft.getMinecraft(); int width = 182; int x = res.getScaledWidth() / 2 - width / 2; @@ -261,50 +268,46 @@ public final class HUDHandler { GL11.glColor4ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue(), (byte) (255 - color.getRed())); mc.renderEngine.bindTexture(manaBar); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); RenderHelper.drawTexturedModalRect(x, y, 0, 0, 251, width, 5); - GL11.glDisable(GL11.GL_BLEND); + GlStateManager.disableBlend(); + GL11.glColor4ub(((byte) 255), ((byte) 255), ((byte) 255), ((byte) 255)); } - private void renderPoolRecipeHUD(ScaledResolution res, TilePool tile, ItemStack stack) { + private static void renderPoolRecipeHUD(ScaledResolution res, TilePool tile, ItemStack stack) { Minecraft mc = Minecraft.getMinecraft(); Profiler profiler = mc.mcProfiler; profiler.startSection("poolRecipe"); - for(RecipeManaInfusion recipe : BotaniaAPI.manaInfusionRecipes) { - if(recipe.matches(stack)) { - if((!recipe.isAlchemy() || tile.alchemy) && (!recipe.isConjuration() || tile.conjuration)) { - int x = res.getScaledWidth() / 2 - 11; - int y = res.getScaledHeight() / 2 + 10; + RecipeManaInfusion recipe = TilePool.getMatchingRecipe(stack, tile.getWorld().getBlockState(tile.getPos().down())); + if(recipe != null) { + int x = res.getScaledWidth() / 2 - 11; + int y = res.getScaledHeight() / 2 + 10; - int u = tile.getCurrentMana() >= recipe.getManaToConsume() ? 0 : 22; - int v = mc.thePlayer.getCommandSenderName().equals("haighyorkie") && mc.thePlayer.isSneaking() ? 23 : 8; + int u = tile.getCurrentMana() >= recipe.getManaToConsume() ? 0 : 22; + int v = mc.thePlayer.getName().equals("haighyorkie") && mc.thePlayer.isSneaking() ? 23 : 8; - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - mc.renderEngine.bindTexture(manaBar); - RenderHelper.drawTexturedModalRect(x, y, 0, u, v, 22, 15); - GL11.glColor4f(1F, 1F, 1F, 1F); + mc.renderEngine.bindTexture(manaBar); + RenderHelper.drawTexturedModalRect(x, y, 0, u, v, 22, 15); + GlStateManager.color(1F, 1F, 1F, 1F); - net.minecraft.client.renderer.RenderHelper.enableGUIStandardItemLighting(); - RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, stack, x - 20, y); - RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, recipe.getOutput(), x + 26, y); - RenderItem.getInstance().renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, recipe.getOutput(), x + 26, y); - net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting(); + net.minecraft.client.renderer.RenderHelper.enableGUIStandardItemLighting(); + mc.getRenderItem().renderItemAndEffectIntoGUI(stack, x - 20, y); + mc.getRenderItem().renderItemAndEffectIntoGUI(recipe.getOutput(), x + 26, y); + mc.getRenderItem().renderItemOverlayIntoGUI(mc.fontRendererObj, recipe.getOutput(), x + 26, y, ""); + net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting(); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_BLEND); - - break; - } - } + GlStateManager.disableLighting(); + GlStateManager.disableBlend(); } profiler.endSection(); } - private void renderCrystalCubeHUD(ScaledResolution res, TileCorporeaCrystalCube tile) { + private static void renderCrystalCubeHUD(ScaledResolution res, TileCorporeaCrystalCube tile) { Minecraft mc = Minecraft.getMinecraft(); Profiler profiler = mc.mcProfiler; @@ -313,59 +316,60 @@ public final class HUDHandler { if(target != null) { String s1 = target.getDisplayName(); String s2 = tile.getItemCount() + "x"; - int strlen = Math.max(mc.fontRenderer.getStringWidth(s1), mc.fontRenderer.getStringWidth(s2)); + int strlen = Math.max(mc.fontRendererObj.getStringWidth(s1), mc.fontRendererObj.getStringWidth(s2)); int w = res.getScaledWidth(); int h = res.getScaledHeight(); Gui.drawRect(w / 2 + 8, h / 2 - 12, w / 2 + strlen + 32, h / 2 + 10, 0x44000000); Gui.drawRect(w / 2 + 6, h / 2 - 14, w / 2 + strlen + 34, h / 2 + 12, 0x44000000); - mc.fontRenderer.drawStringWithShadow(target.getDisplayName(), w / 2 + 30, h / 2 - 10, 0x6666FF); - mc.fontRenderer.drawStringWithShadow(tile.getItemCount() + "x", w / 2 + 30, h / 2, 0xFFFFFF); + mc.fontRendererObj.drawStringWithShadow(target.getDisplayName(), w / 2 + 30, h / 2 - 10, 0x6666FF); + mc.fontRendererObj.drawStringWithShadow(tile.getItemCount() + "x", w / 2 + 30, h / 2, 0xFFFFFF); net.minecraft.client.renderer.RenderHelper.enableGUIStandardItemLighting(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, target, w / 2 + 10, h / 2 - 10); + GlStateManager.enableRescaleNormal(); + mc.getRenderItem().renderItemAndEffectIntoGUI(target, w / 2 + 10, h / 2 - 10); net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting(); } profiler.endSection(); } - private void drawLexiconHUD(ItemStack stack, Block block, MovingObjectPosition pos, ScaledResolution res) { + private static void drawLexiconHUD(ItemStack stack, IBlockState state, RayTraceResult pos, ScaledResolution res) { Minecraft mc = Minecraft.getMinecraft(); + Block block = state.getBlock(); Profiler profiler = mc.mcProfiler; profiler.startSection("lexicon"); - FontRenderer font = mc.fontRenderer; + FontRenderer font = mc.fontRendererObj; boolean draw = false; String drawStr = ""; String secondLine = ""; - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); int sx = res.getScaledWidth() / 2 - 17; int sy = res.getScaledHeight() / 2 + 2; if(block instanceof ILexiconable) { - LexiconEntry entry = ((ILexiconable) block).getEntry(mc.theWorld, pos.blockX, pos.blockY, pos.blockZ, mc.thePlayer, mc.thePlayer.getCurrentEquippedItem()); + LexiconEntry entry = ((ILexiconable) block).getEntry(mc.theWorld, pos.getBlockPos(), mc.thePlayer, stack); if(entry != null) { if(!((ILexicon) stack.getItem()).isKnowledgeUnlocked(stack, entry.getKnowledgeType())) font = mc.standardGalacticFontRenderer; - drawStr = StatCollector.translateToLocal(entry.getUnlocalizedName()); - secondLine = EnumChatFormatting.ITALIC + StatCollector.translateToLocal(entry.getTagline()); + drawStr = I18n.format(entry.getUnlocalizedName()); + secondLine = TextFormatting.ITALIC + I18n.format(entry.getTagline()); draw = true; } } if(!draw && pos.entityHit == null) { profiler.startSection("wikiLookup"); - if(!block.isAir(mc.theWorld, pos.blockX, pos.blockY, pos.blockZ) && !(block instanceof BlockLiquid)) { + if(!block.isAir(state, mc.theWorld, pos.getBlockPos()) && !(block instanceof BlockLiquid)) { IWikiProvider provider = WikiHooks.getWikiFor(block); - String url = provider.getWikiURL(mc.theWorld, pos); + String url = provider.getWikiURL(mc.theWorld, pos, mc.thePlayer); if(url != null && !url.isEmpty()) { - String name = provider.getBlockName(mc.theWorld, pos); - String wikiName = provider.getWikiName(mc.theWorld, pos); - drawStr = name + " @ " + EnumChatFormatting.AQUA + wikiName; + String name = provider.getBlockName(mc.theWorld, pos, mc.thePlayer); + String wikiName = provider.getWikiName(mc.theWorld, pos, mc.thePlayer); + drawStr = name + " @ " + TextFormatting.AQUA + wikiName; draw = true; } } @@ -376,56 +380,56 @@ public final class HUDHandler { if(!mc.thePlayer.isSneaking()) { drawStr = "?"; secondLine = ""; - font = mc.fontRenderer; + font = mc.fontRendererObj; } - RenderItem.getInstance().renderItemIntoGUI(mc.fontRenderer, mc.renderEngine, new ItemStack(ModItems.lexicon), sx, sy); - GL11.glDisable(GL11.GL_LIGHTING); - font.drawStringWithShadow(drawStr, sx + 10, sy + 8, 0xFFFFFFFF); - font.drawStringWithShadow(secondLine, sx + 10, sy + 18, 0xFFAAAAAA); + mc.getRenderItem().renderItemIntoGUI(new ItemStack(ModItems.lexicon), sx, sy); + GlStateManager.disableLighting(); + font.drawStringWithShadow(drawStr, sx + 20, sy + 4, 0xFFFFFFFF); + font.drawStringWithShadow(secondLine, sx + 20, sy + 14, 0xFFAAAAAA); if(!mc.thePlayer.isSneaking()) { - GL11.glScalef(0.5F, 0.5F, 1F); - mc.fontRenderer.drawStringWithShadow(EnumChatFormatting.BOLD + "Shift", (sx + 10) * 2 - 16, (sy + 8) * 2 + 20, 0xFFFFFFFF); - GL11.glScalef(2F, 2F, 1F); + GlStateManager.scale(0.5F, 0.5F, 1F); + mc.fontRendererObj.drawStringWithShadow(TextFormatting.BOLD + "Shift", (sx + 10) * 2 - 16, (sy + 8) * 2 + 20, 0xFFFFFFFF); + GlStateManager.scale(2F, 2F, 1F); } } - GL11.glDisable(GL11.GL_BLEND); - GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.disableBlend(); + GlStateManager.color(1F, 1F, 1F, 1F); profiler.endSection(); } - private void renderNearIndexDisplay(ScaledResolution res) { + private static void renderNearIndexDisplay(ScaledResolution res) { Minecraft mc = Minecraft.getMinecraft(); - String txt0 = StatCollector.translateToLocal("botaniamisc.nearIndex0"); - String txt1 = EnumChatFormatting.GRAY + StatCollector.translateToLocal("botaniamisc.nearIndex1"); - String txt2 = EnumChatFormatting.GRAY + StatCollector.translateToLocal("botaniamisc.nearIndex2"); + String txt0 = I18n.format("botaniamisc.nearIndex0"); + String txt1 = TextFormatting.GRAY + I18n.format("botaniamisc.nearIndex1"); + String txt2 = TextFormatting.GRAY + I18n.format("botaniamisc.nearIndex2"); - int l = Math.max(mc.fontRenderer.getStringWidth(txt0), Math.max(mc.fontRenderer.getStringWidth(txt1), mc.fontRenderer.getStringWidth(txt2))) + 20; + int l = Math.max(mc.fontRendererObj.getStringWidth(txt0), Math.max(mc.fontRendererObj.getStringWidth(txt1), mc.fontRendererObj.getStringWidth(txt2))) + 20; int x = res.getScaledWidth() - l - 20; int y = res.getScaledHeight() - 60; Gui.drawRect(x - 6, y - 6, x + l + 6, y + 37, 0x44000000); Gui.drawRect(x - 4, y - 4, x + l + 4, y + 35, 0x44000000); net.minecraft.client.renderer.RenderHelper.enableGUIStandardItemLighting(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, new ItemStack(ModBlocks.corporeaIndex), x, y + 10); + GlStateManager.enableRescaleNormal(); + mc.getRenderItem().renderItemAndEffectIntoGUI(new ItemStack(ModBlocks.corporeaIndex), x, y + 10); net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting(); - mc.fontRenderer.drawStringWithShadow(txt0, x + 20, y, 0xFFFFFF); - mc.fontRenderer.drawStringWithShadow(txt1, x + 20, y + 14, 0xFFFFFF); - mc.fontRenderer.drawStringWithShadow(txt2, x + 20, y + 24, 0xFFFFFF); + mc.fontRendererObj.drawStringWithShadow(txt0, x + 20, y, 0xFFFFFF); + mc.fontRendererObj.drawStringWithShadow(txt1, x + 20, y + 14, 0xFFFFFF); + mc.fontRendererObj.drawStringWithShadow(txt2, x + 20, y + 24, 0xFFFFFF); } public static void drawSimpleManaHUD(int color, int mana, int maxMana, String name, ScaledResolution res) { - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); Minecraft mc = Minecraft.getMinecraft(); - int x = res.getScaledWidth() / 2 - mc.fontRenderer.getStringWidth(name) / 2; + int x = res.getScaledWidth() / 2 - mc.fontRendererObj.getStringWidth(name) / 2; int y = res.getScaledHeight() / 2 + 10; - mc.fontRenderer.drawStringWithShadow(name, x, y, color); + mc.fontRendererObj.drawStringWithShadow(name, x, y, color); x = res.getScaledWidth() / 2 - 51; y += 10; @@ -433,13 +437,13 @@ public final class HUDHandler { renderManaBar(x, y, color, mana < 0 ? 0.5F : 1F, mana, maxMana); if(mana < 0) { - String text = StatCollector.translateToLocal("botaniamisc.statusUnknown"); - x = res.getScaledWidth() / 2 - mc.fontRenderer.getStringWidth(text) / 2; + String text = I18n.format("botaniamisc.statusUnknown"); + x = res.getScaledWidth() / 2 - mc.fontRendererObj.getStringWidth(text) / 2; y -= 1; - mc.fontRenderer.drawString(text, x, y, color); + mc.fontRendererObj.drawString(text, x, y, color); } - GL11.glDisable(GL11.GL_BLEND); + GlStateManager.disableBlend(); } public static void drawComplexManaHUD(int color, int mana, int maxMana, String name, ScaledResolution res, ItemStack bindDisplay, boolean properlyBound) { @@ -451,25 +455,25 @@ public final class HUDHandler { int y = res.getScaledHeight() / 2 + 12; net.minecraft.client.renderer.RenderHelper.enableGUIStandardItemLighting(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, bindDisplay, x, y); + GlStateManager.enableRescaleNormal(); + mc.getRenderItem().renderItemAndEffectIntoGUI(bindDisplay, x, y); net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting(); - GL11.glDisable(GL11.GL_DEPTH_TEST); + GlStateManager.disableDepth(); if(properlyBound) { - mc.fontRenderer.drawStringWithShadow("\u2714", x + 10, y + 9, 0x004C00); - mc.fontRenderer.drawStringWithShadow("\u2714", x + 10, y + 8, 0x0BD20D); + mc.fontRendererObj.drawStringWithShadow("\u2714", x + 10, y + 9, 0x004C00); + mc.fontRendererObj.drawStringWithShadow("\u2714", x + 10, y + 8, 0x0BD20D); } else { - mc.fontRenderer.drawStringWithShadow("\u2718", x + 10, y + 9, 0x4C0000); - mc.fontRenderer.drawStringWithShadow("\u2718", x + 10, y + 8, 0xD2080D); + mc.fontRendererObj.drawStringWithShadow("\u2718", x + 10, y + 9, 0x4C0000); + mc.fontRendererObj.drawStringWithShadow("\u2718", x + 10, y + 8, 0xD2080D); } - GL11.glEnable(GL11.GL_DEPTH_TEST); + GlStateManager.enableDepth(); } public static void renderManaBar(int x, int y, int color, float alpha, int mana, int maxMana) { Minecraft mc = Minecraft.getMinecraft(); - GL11.glColor4f(1F, 1F, 1F, alpha); + GlStateManager.color(1F, 1F, 1F, alpha); mc.renderEngine.bindTexture(manaBar); RenderHelper.drawTexturedModalRect(x, y, 0, 0, 0, 102, 5); @@ -483,5 +487,6 @@ public final class HUDHandler { Color color_ = new Color(color); GL11.glColor4ub((byte) color_.getRed(), (byte) color_.getGreen(),(byte) color_.getBlue(), (byte) (255F * alpha)); RenderHelper.drawTexturedModalRect(x + 1, y + 1, 0, 0, 5, Math.min(100, manaPercentage), 3); + GL11.glColor4ub(((byte) 255), ((byte) 255), ((byte) 255), ((byte) 255)); } } diff --git a/src/main/java/vazkii/botania/client/core/handler/ItemsRemainingRenderHandler.java b/src/main/java/vazkii/botania/client/core/handler/ItemsRemainingRenderHandler.java index 4e41b8c15..0a76127c5 100644 --- a/src/main/java/vazkii/botania/client/core/handler/ItemsRemainingRenderHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/ItemsRemainingRenderHandler.java @@ -10,26 +10,23 @@ */ package vazkii.botania.client.core.handler; -import java.util.regex.Pattern; - import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; - +import net.minecraft.util.text.TextFormatting; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import java.util.regex.Pattern; public final class ItemsRemainingRenderHandler { - private static int maxTicks = 30; - private static int leaveTicks = 20; + private static final int maxTicks = 30; + private static final int leaveTicks = 20; private static ItemStack stack; private static int ticks, count; @@ -45,24 +42,24 @@ public final class ItemsRemainingRenderHandler { int start = maxTicks - leaveTicks; float alpha = ticks + partTicks > start ? 1F : (ticks + partTicks) / start; - GL11.glDisable(GL11.GL_ALPHA_TEST); - GL11.glEnable(GL11.GL_BLEND); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.disableAlpha(); + GlStateManager.enableBlend(); + GlStateManager.enableRescaleNormal(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1F, 1F, 1F, alpha); + GlStateManager.color(1F, 1F, 1F, alpha); RenderHelper.enableGUIStandardItemLighting(); int xp = x + (int) (16F * (1F - alpha)); - GL11.glTranslatef(xp, y, 0F); - GL11.glScalef(alpha, 1F, 1F); - RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, stack, 0, 0); - GL11.glScalef(1F / alpha,1F, 1F); - GL11.glTranslatef(-xp, -y, 0F); + GlStateManager.translate(xp, y, 0F); + GlStateManager.scale(alpha, 1F, 1F); + mc.getRenderItem().renderItemAndEffectIntoGUI(stack, 0, 0); + GlStateManager.scale(1F / alpha,1F, 1F); + GlStateManager.translate(-xp, -y, 0F); RenderHelper.disableStandardItemLighting(); - GL11.glColor4f(1F, 1F, 1F, 1F); - GL11.glEnable(GL11.GL_BLEND); + GlStateManager.color(1F, 1F, 1F, 1F); + GlStateManager.enableBlend(); - String text = EnumChatFormatting.GREEN + stack.getDisplayName(); + String text = TextFormatting.GREEN + stack.getDisplayName(); if(count >= 0) { int max = stack.getMaxStackSize(); int stacks = count / max; @@ -70,15 +67,15 @@ public final class ItemsRemainingRenderHandler { if(stacks == 0) text = "" + count; - else text = count + " (" + EnumChatFormatting.AQUA + stacks + EnumChatFormatting.RESET + "*" + EnumChatFormatting.GRAY + max + EnumChatFormatting.RESET + "+" + EnumChatFormatting.YELLOW + rem + EnumChatFormatting.RESET + ")"; + else text = count + " (" + TextFormatting.AQUA + stacks + TextFormatting.RESET + "*" + TextFormatting.GRAY + max + TextFormatting.RESET + "+" + TextFormatting.YELLOW + rem + TextFormatting.RESET + ")"; } else if(count == -1) text = "\u221E"; int color = 0x00FFFFFF | (int) (alpha * 0xFF) << 24; - mc.fontRenderer.drawStringWithShadow(text, x + 20, y + 6, color); + mc.fontRendererObj.drawStringWithShadow(text, x + 20, y + 6, color); - GL11.glDisable(GL11.GL_BLEND); - GL11.glEnable(GL11.GL_ALPHA_TEST); + GlStateManager.disableBlend(); + GlStateManager.enableAlpha(); } } diff --git a/src/main/java/vazkii/botania/client/core/handler/LightningHandler.java b/src/main/java/vazkii/botania/client/core/handler/LightningHandler.java index d66b638a3..a14cb4bd9 100644 --- a/src/main/java/vazkii/botania/client/core/handler/LightningHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/LightningHandler.java @@ -10,54 +10,35 @@ */ package vazkii.botania.client.core.handler; -import java.awt.Color; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Random; -import java.util.concurrent.ConcurrentLinkedQueue; - -import net.minecraft.block.Block; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.ActiveRenderInfo; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.entity.Entity; import net.minecraft.profiler.Profiler; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; import net.minecraftforge.client.event.RenderWorldLastEvent; - +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import org.lwjgl.opengl.GL11; - -import vazkii.botania.client.core.handler.LightningHandler.LightningBolt.Segment; +import vazkii.botania.client.fx.FXLightning; import vazkii.botania.client.fx.ParticleRenderDispatcher; import vazkii.botania.client.lib.LibResources; -import vazkii.botania.common.core.helper.Vector3; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +import java.util.ArrayDeque; +import java.util.Deque; public class LightningHandler { + private LightningHandler() {} + + private static final int BATCH_THRESHOLD = 200; private static final ResourceLocation outsideResource = new ResourceLocation(LibResources.MISC_WISP_LARGE); private static final ResourceLocation insideResource = new ResourceLocation(LibResources.MISC_WISP_SMALL); - - static double interpPosX; - static double interpPosY; - static double interpPosZ; - - private static Vector3 getRelativeViewVector(Vector3 pos) { - Entity renderEntity = Minecraft.getMinecraft().renderViewEntity; - return new Vector3((float) renderEntity.posX - pos.x, (float) renderEntity.posY + renderEntity.getEyeHeight() - pos.y, (float) renderEntity.posZ - pos.z); - } + public static final Deque queuedLightningBolts = new ArrayDeque<>(); @SubscribeEvent - public void onRenderWorldLast(RenderWorldLastEvent event) { + public static void onRenderWorldLast(RenderWorldLastEvent event) { Profiler profiler = Minecraft.getMinecraft().mcProfiler; profiler.startSection("botania-particles"); @@ -66,435 +47,63 @@ public class LightningHandler { RedStringRenderer.renderAll(); profiler.endStartSection("lightning"); - float frame = event.partialTicks; + float frame = event.getPartialTicks(); Entity entity = Minecraft.getMinecraft().thePlayer; TextureManager render = Minecraft.getMinecraft().renderEngine; - interpPosX = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * frame; - interpPosY = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * frame; - interpPosZ = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * frame; + double interpPosX = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * frame; + double interpPosY = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * frame; + double interpPosZ = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * frame; - GL11.glPushMatrix(); - GL11.glTranslated(-interpPosX, -interpPosY, -interpPosZ); + GlStateManager.pushMatrix(); + GlStateManager.translate(-interpPosX, -interpPosY, -interpPosZ); - Tessellator tessellator = Tessellator.instance; + Tessellator tessellator = Tessellator.getInstance(); - GL11.glDepthMask(false); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.depthMask(false); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); ParticleRenderDispatcher.lightningCount = 0; render.bindTexture(outsideResource); - tessellator.startDrawingQuads(); - tessellator.setBrightness(0xF000F0); - for(LightningBolt bolt : LightningBolt.boltlist) - renderBolt(bolt, tessellator, frame, ActiveRenderInfo.rotationX, ActiveRenderInfo.rotationXZ, ActiveRenderInfo.rotationZ, ActiveRenderInfo.rotationXY, 0, false); + int counter = 0; + + tessellator.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_LMAP_COLOR); + for (FXLightning bolt : queuedLightningBolts) { + bolt.renderBolt(0, false); + if(counter % BATCH_THRESHOLD == BATCH_THRESHOLD - 1) { + tessellator.draw(); + tessellator.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_LMAP_COLOR); + } + counter++; + } tessellator.draw(); render.bindTexture(insideResource); - tessellator.startDrawingQuads(); - tessellator.setBrightness(0xF000F0); - for(LightningBolt bolt : LightningBolt.boltlist) - renderBolt(bolt, tessellator, frame, ActiveRenderInfo.rotationX, ActiveRenderInfo.rotationXZ, ActiveRenderInfo.rotationZ, ActiveRenderInfo.rotationXY, 1, true); + counter = 0; + + tessellator.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_LMAP_COLOR); + for (FXLightning bolt : queuedLightningBolts) { + bolt.renderBolt(1, true); + if(counter % BATCH_THRESHOLD == BATCH_THRESHOLD - 1) { + tessellator.draw(); + tessellator.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_LMAP_COLOR); + } + counter++; + } tessellator.draw(); - GL11.glDisable(GL11.GL_BLEND); - GL11.glDepthMask(true); + queuedLightningBolts.clear(); - GL11.glTranslated(interpPosX, interpPosY, interpPosZ); - GL11.glPopMatrix(); + GlStateManager.disableBlend(); + GlStateManager.depthMask(true); + + GlStateManager.translate(interpPosX, interpPosY, interpPosZ); + GlStateManager.popMatrix(); profiler.endSection(); profiler.endSection(); } - - public static void spawnLightningBolt(World world, Vector3 vectorStart, Vector3 vectorEnd, float ticksPerMeter, long seed, int colorOuter, int colorInner) { - LightningBolt bolt = new LightningBolt(world, vectorStart, vectorEnd, ticksPerMeter, seed, colorOuter, colorInner); - bolt.defaultFractal(); - bolt.finalizeBolt(); - LightningBolt.boltlist.add(bolt); - } - - private void renderBolt(LightningBolt bolt, Tessellator tessellator, float partialframe, float cosyaw, float cospitch, float sinyaw, float cossinpitch, int pass, boolean inner) { - ParticleRenderDispatcher.lightningCount++; - float boltage = bolt.particleAge < 0 ? 0 : (float) bolt.particleAge / (float) bolt.particleMaxAge; - float mainalpha = 1; - if(pass == 0) - mainalpha = (1 - boltage) * 0.4F; - else mainalpha = 1 - boltage * 0.5F; - - int expandTime = (int) (bolt.length * bolt.speed); - - int renderstart = (int) ((expandTime / 2 - bolt.particleMaxAge + bolt.particleAge) / (float) (expandTime / 2) * bolt.numsegments0); - int renderend = (int) ((bolt.particleAge + expandTime) / (float) expandTime * bolt.numsegments0); - - for(Segment rendersegment : bolt.segments) { - if(rendersegment.segmentno < renderstart || rendersegment.segmentno > renderend) - continue; - - Vector3 playervec = getRelativeViewVector(rendersegment.startpoint.point).multiply(-1); - - double width = 0.025F * (playervec.mag() / 5 + 1) * (1 + rendersegment.light) * 0.5F; - - Vector3 diff1 = playervec.copy().crossProduct(rendersegment.prevdiff).normalize().multiply(width / rendersegment.sinprev); - Vector3 diff2 = playervec.copy().crossProduct(rendersegment.nextdiff).normalize().multiply(width / rendersegment.sinnext); - - Vector3 startvec = rendersegment.startpoint.point; - Vector3 endvec = rendersegment.endpoint.point; - - int color = inner ? bolt.colorInner : bolt.colorOuter; - tessellator.setColorRGBA_I(color, (int) (mainalpha * rendersegment.light * new Color(color).getAlpha())); - - tessellator.addVertexWithUV(endvec.x - diff2.x, endvec.y - diff2.y, endvec.z - diff2.z, 0.5, 0); - tessellator.addVertexWithUV(startvec.x - diff1.x, startvec.y - diff1.y, startvec.z - diff1.z, 0.5, 0); - tessellator.addVertexWithUV(startvec.x + diff1.x, startvec.y + diff1.y, startvec.z + diff1.z, 0.5, 1); - tessellator.addVertexWithUV(endvec.x + diff2.x, endvec.y + diff2.y, endvec.z + diff2.z, 0.5, 1); - - if(rendersegment.next == null) { - Vector3 roundend = rendersegment.endpoint.point.copy().add(rendersegment.diff.copy().normalize().multiply(width)); - - tessellator.addVertexWithUV(roundend.x - diff2.x, roundend.y - diff2.y, roundend.z - diff2.z, 0, 0); - tessellator.addVertexWithUV(endvec.x - diff2.x, endvec.y - diff2.y, endvec.z - diff2.z, 0.5, 0); - tessellator.addVertexWithUV(endvec.x + diff2.x, endvec.y + diff2.y, endvec.z + diff2.z, 0.5, 1); - tessellator.addVertexWithUV(roundend.x + diff2.x, roundend.y + diff2.y, roundend.z + diff2.z, 0, 1); - } - - if(rendersegment.prev == null) { - Vector3 roundend = rendersegment.startpoint.point.copy().subtract(rendersegment.diff.copy().normalize().multiply(width)); - - tessellator.addVertexWithUV(startvec.x - diff1.x, startvec.y - diff1.y, startvec.z - diff1.z, 0.5, 0); - tessellator.addVertexWithUV(roundend.x - diff1.x, roundend.y - diff1.y, roundend.z - diff1.z, 0, 0); - tessellator.addVertexWithUV(roundend.x + diff1.x, roundend.y + diff1.y, roundend.z + diff1.z, 0, 1); - tessellator.addVertexWithUV(startvec.x + diff1.x, startvec.y + diff1.y, startvec.z + diff1.z, 0.5, 1); - } - } - } - - public static class LightningBolt { - - public ArrayList segments = new ArrayList(); - public Vector3 start; - public Vector3 end; - ChunkCoordinates target; - HashMap splitparents = new HashMap(); - - public double length; - public int numsegments0; - private int numsplits; - private boolean finalized; - private Random rand; - public long seed; - - public int particleAge; - public int particleMaxAge; - public boolean isDead; - private AxisAlignedBB boundingBox; - - private World world; - private Entity source; - - public static ConcurrentLinkedQueue boltlist = new ConcurrentLinkedQueue(); - - public float speed = 1.5F; - public static final int fadetime = 20; - - public static int playerdamage = 1; - public static int entitydamage = 1; - - public int colorOuter; - public int colorInner; - - public class BoltPoint { - - public BoltPoint(Vector3 basepoint, Vector3 offsetvec) { - point = basepoint.copy().add(offsetvec); - this.basepoint = basepoint; - this.offsetvec = offsetvec; - } - - public Vector3 point; - Vector3 basepoint; - Vector3 offsetvec; - } - - public class SegmentSorter implements Comparator { - - @Override - public int compare(Segment o1, Segment o2) { - int comp = Integer.valueOf(o1.splitno).compareTo(o2.splitno); - if(comp == 0) - return Integer.valueOf(o1.segmentno).compareTo(o2.segmentno); - else return comp; - } - } - - public class SegmentLightSorter implements Comparator { - @Override - public int compare(Segment o1, Segment o2) { - return Float.compare(o2.light, o1.light); - } - } - - public class Segment { - public Segment(BoltPoint start, BoltPoint end, float light, int segmentnumber, int splitnumber) { - startpoint = start; - endpoint = end; - this.light = light; - segmentno = segmentnumber; - splitno = splitnumber; - - calcDiff(); - } - - public Segment(Vector3 start, Vector3 end) { - this(new BoltPoint(start, new Vector3(0, 0, 0)), new BoltPoint(end, new Vector3(0, 0, 0)), 1, 0, 0); - } - - public void calcDiff() { - diff = endpoint.point.copy().subtract(startpoint.point); - } - - public void calcEndDiffs() { - if(prev != null) { - Vector3 prevdiffnorm = prev.diff.copy().normalize(); - Vector3 thisdiffnorm = diff.copy().normalize(); - - prevdiff = thisdiffnorm.copy().add(prevdiffnorm).normalize(); - sinprev = (float) Math.sin(thisdiffnorm.angle(prevdiffnorm.multiply(-1)) / 2); - } else { - prevdiff = diff.copy().normalize(); - sinprev = 1; - } - - if(next != null) { - Vector3 nextdiffnorm = next.diff.copy().normalize(); - Vector3 thisdiffnorm = diff.copy().normalize(); - - nextdiff = thisdiffnorm.add(nextdiffnorm).normalize(); - sinnext = (float) Math.sin(thisdiffnorm.angle(nextdiffnorm.multiply(-1)) / 2); - } else { - nextdiff = diff.copy().normalize(); - sinnext = 1; - } - } - - @Override - public String toString() { - return startpoint.point.toString() + " " + endpoint.point.toString(); - } - - public BoltPoint startpoint; - public BoltPoint endpoint; - - public Vector3 diff; - - public Segment prev; - public Segment next; - - public Vector3 nextdiff; - public Vector3 prevdiff; - - public float sinprev; - public float sinnext; - public float light; - - public int segmentno; - public int splitno; - } - - public LightningBolt(World world, Vector3 sourcevec, Vector3 targetvec, float ticksPerMeter, long seed, int colorOuter, int colorInner) { - this.world = world; - this.seed = seed; - rand = new Random(seed); - - start = sourcevec; - end = targetvec; - - speed = ticksPerMeter; - - this.colorOuter = colorOuter; - this.colorInner = colorInner; - - numsegments0 = 1; - - length = end.copy().subtract(start).mag(); - particleMaxAge = fadetime + rand.nextInt(fadetime) - fadetime / 2; - particleAge = -(int) (length * speed); - - boundingBox = AxisAlignedBB.getBoundingBox(0, 0, 0, 0, 0, 0); - boundingBox.setBB(AxisAlignedBB.getBoundingBox(Math.min(start.x, end.x), Math.min(start.y, end.y), Math.min(start.z, end.z), Math.max(start.x, end.x), Math.max(start.y, end.y), Math.max(start.z, end.z)).expand(length / 2, length / 2, length / 2)); - - segments.add(new Segment(start, end)); - } - - public static Vector3 getFocalPoint(TileEntity tile) { - return Vector3.fromTileEntityCenter(tile); - } - - public LightningBolt(World world, Vector3 sourcevec, TileEntity target, float ticksPerMeter, long seed, int colorOuter, int colorInner) { - this(world, sourcevec, getFocalPoint(target), ticksPerMeter, seed, colorOuter, colorInner); - this.target = new ChunkCoordinates(target.xCoord, target.yCoord, target.zCoord); - } - - public void setWrapper(Entity entity) { - source = entity; - } - - public void fractal(int splits, double amount, double splitchance, double splitlength, double splitangle) { - if(finalized) - return; - - ArrayList oldsegments = segments; - segments = new ArrayList(); - - Segment prev = null; - - for(Segment segment : oldsegments) { - prev = segment.prev; - - Vector3 subsegment = segment.diff.copy().multiply(1F / splits); - - BoltPoint[] newpoints = new BoltPoint[splits + 1]; - - Vector3 startpoint = segment.startpoint.point; - newpoints[0] = segment.startpoint; - newpoints[splits] = segment.endpoint; - - for(int i = 1; i < splits; i++) { - Vector3 randoff = segment.diff.copy().perpendicular().normalize().rotate(rand.nextFloat() * 360, segment.diff); - randoff.multiply((rand.nextFloat() - 0.5F) * amount * 2); - - Vector3 basepoint = startpoint.copy().add(subsegment.copy().multiply(i)); - - newpoints[i] = new BoltPoint(basepoint, randoff); - } - - for(int i = 0; i < splits; i++) { - Segment next = new Segment(newpoints[i], newpoints[i + 1], segment.light, segment.segmentno * splits + i, segment.splitno); - next.prev = prev; - if (prev != null) - prev.next = next; - - if(i != 0 && rand.nextFloat() < splitchance) { - Vector3 splitrot = next.diff.copy().xCrossProduct().rotate(rand.nextFloat() * 360, next.diff); - Vector3 diff = next.diff.copy().rotate((rand.nextFloat() * 0.66F + 0.33F) * splitangle, splitrot).multiply(splitlength); - - numsplits++; - splitparents.put(numsplits, next.splitno); - - Segment split = new Segment(newpoints[i], new BoltPoint(newpoints[i + 1].basepoint, newpoints[i + 1].offsetvec.copy().add(diff)), segment.light / 2F, next.segmentno, numsplits); - split.prev = prev; - - segments.add(split); - } - - prev = next; - segments.add(next); - } - - if(segment.next != null) - segment.next.prev = prev; - } - - numsegments0 *= splits; - } - - public void defaultFractal() { - fractal(2, length / 1.5, 0.7F, 0.7F, 45); - fractal(2, length / 4, 0.5F, 0.8F, 50); - fractal(2, length / 15, 0.5F, 0.9F, 55); - fractal(2, length / 30, 0.5F, 1.0F, 60); - fractal(2, length / 60, 0, 0, 0); - fractal(2, length / 100, 0, 0, 0); - fractal(2, length / 400, 0, 0, 0); - } - - private float rayTraceResistance(Vector3 start, Vector3 end, float prevresistance) { - MovingObjectPosition mop = world.rayTraceBlocks(start.toVec3D(), end.toVec3D()); - - if(mop == null) - return prevresistance; - - if(mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { - Block block = world.getBlock(mop.blockX, mop.blockY, mop.blockZ); - - if(world.isAirBlock(mop.blockX, mop.blockY, mop.blockZ)) - return prevresistance; - - return prevresistance + block.getExplosionResistance(source) + 0.3F; - } else return prevresistance; - } - - private void calculateCollisionAndDiffs() { - HashMap lastactivesegment = new HashMap(); - - Collections.sort(segments, new SegmentSorter()); - - int lastsplitcalc = 0; - int lastactiveseg = 0;// unterminated - float splitresistance = 0; - - for(Segment segment : segments) { - if(segment.splitno > lastsplitcalc) { - lastactivesegment.put(lastsplitcalc, lastactiveseg); - lastsplitcalc = segment.splitno; - lastactiveseg = lastactivesegment.get(splitparents.get(segment.splitno)); - splitresistance = lastactiveseg < segment.segmentno ? 50 : 0; - } - - if(splitresistance >= 40 * segment.light) - continue; - - splitresistance = rayTraceResistance(segment.startpoint.point, segment.endpoint.point, splitresistance); - lastactiveseg = segment.segmentno; - } - lastactivesegment.put(lastsplitcalc, lastactiveseg); - - lastsplitcalc = 0; - lastactiveseg = lastactivesegment.get(0); - for(Iterator iterator = segments.iterator(); iterator.hasNext();) { - Segment segment = iterator.next(); - if(lastsplitcalc != segment.splitno) { - lastsplitcalc = segment.splitno; - lastactiveseg = lastactivesegment.get(segment.splitno); - } - - if(segment.segmentno > lastactiveseg) - iterator.remove(); - segment.calcEndDiffs(); - } - } - - public void finalizeBolt() { - if(finalized) - return; - finalized = true; - - calculateCollisionAndDiffs(); - - Collections.sort(segments, new SegmentLightSorter()); - - boltlist.add(this); - } - - public void onUpdate() { - particleAge++; - - if (particleAge >= particleMaxAge) - isDead = true; - } - - // Called in ClientTickHandler - public static void update() { - for(Iterator iterator = boltlist.iterator(); iterator.hasNext();) { - LightningBolt bolt = iterator.next(); - - bolt.onUpdate(); - if(bolt.isDead) - iterator.remove(); - } - } - } } \ No newline at end of file diff --git a/src/main/java/vazkii/botania/client/core/handler/MiscellaneousIcons.java b/src/main/java/vazkii/botania/client/core/handler/MiscellaneousIcons.java new file mode 100644 index 000000000..de96858f4 --- /dev/null +++ b/src/main/java/vazkii/botania/client/core/handler/MiscellaneousIcons.java @@ -0,0 +1,210 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + * + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.client.core.handler; + +import com.google.common.collect.Maps; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.block.model.IBakedModel; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.launchwrapper.Launch; +import net.minecraftforge.client.event.ModelBakeEvent; +import net.minecraftforge.client.event.TextureStitchEvent; +import net.minecraftforge.event.entity.player.ArrowLooseEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.apache.commons.lang3.text.WordUtils; +import org.lwjgl.BufferUtils; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import vazkii.botania.client.core.helper.IconHelper; +import vazkii.botania.client.model.FloatingFlowerModel; +import vazkii.botania.client.model.GunModel; +import vazkii.botania.client.model.LexiconModel; +import vazkii.botania.client.model.PlatformModel; +import vazkii.botania.common.Botania; +import vazkii.botania.common.integration.buildcraft.TriggerManaLevel; +import vazkii.botania.common.item.ItemSparkUpgrade; +import vazkii.botania.common.item.equipment.bauble.ItemFlightTiara; +import vazkii.botania.common.item.relic.ItemKingKey; + +import javax.imageio.ImageIO; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import java.nio.IntBuffer; +import java.util.Map; + +public class MiscellaneousIcons { + + public static final MiscellaneousIcons INSTANCE = new MiscellaneousIcons(); + + public TextureAtlasSprite + alfPortalTex, + lightRelayWorldIcon, + lightRelayWorldIconRed, + alchemyCatalystOverlay, + conjurationCatalystOverlay, + enchanterOverlay, + manaVoidOverlay, + manaWater, + terraPlateOverlay, + corporeaWorldIcon, + corporeaWorldIconMaster, + corporeaIconStar, + sparkWorldIcon, + manaDetectorIcon, + runeAltarTriggerIcon, + terrasteelHelmWillIcon; + + public TextureAtlasSprite[] sparkUpgradeIcons; + public TextureAtlasSprite[] kingKeyWeaponIcons; + public final Map manaLevelTriggerIcons = Maps.newEnumMap(TriggerManaLevel.State.class); + public TextureAtlasSprite[] tiaraWingIcons; + + // begin dank_memes + public TextureAtlasSprite tailIcon = null; + public TextureAtlasSprite phiFlowerIcon = null; + public TextureAtlasSprite goldfishIcon = null; + public TextureAtlasSprite nerfBatIcon = null; + // end dank_memes + + // Icons for baubles that don't render their own model on the player + public TextureAtlasSprite + bloodPendantChain, + bloodPendantGem, + snowflakePendantGem, + itemFinderGem, + pyroclastGem, + crimsonGem; + + + @SubscribeEvent + public void onModelBake(ModelBakeEvent evt) { + // Floating flowers + FloatingFlowerModel model = new FloatingFlowerModel(); + evt.getModelRegistry().putObject(new ModelResourceLocation("botania:miniIsland", "normal"), model); + evt.getModelRegistry().putObject(new ModelResourceLocation("botania:miniIsland", "inventory"), model); + evt.getModelRegistry().putObject(new ModelResourceLocation("botania:floatingSpecialFlower", "normal"), model); + evt.getModelRegistry().putObject(new ModelResourceLocation("botania:floatingSpecialFlower", "inventory"), model); + + // Platforms + evt.getModelRegistry().putObject(new ModelResourceLocation("botania:platform", "normal"), new PlatformModel()); + + // Lexicon + evt.getModelRegistry().putObject(new ModelResourceLocation("botania:lexicon", "inventory"), new LexiconModel()); + + // Mana Blaster + ModelResourceLocation key = new ModelResourceLocation("botania:manaGun", "inventory"); + IBakedModel originalModel = evt.getModelRegistry().getObject(key); + evt.getModelRegistry().putObject(key, new GunModel(originalModel)); + + key = new ModelResourceLocation("botania:manaGunClip", "inventory"); + originalModel = evt.getModelRegistry().getObject(key); + evt.getModelRegistry().putObject(key, new GunModel(originalModel)); + } + + @SubscribeEvent + public void onTextureStitch(TextureStitchEvent.Pre evt) { + alfPortalTex = IconHelper.forName(evt.getMap(), "alfheimPortalInside", "blocks"); + lightRelayWorldIcon = IconHelper.forName(evt.getMap(), "lightRelay1", "blocks"); + lightRelayWorldIconRed = IconHelper.forName(evt.getMap(), "lightRelay3", "blocks"); + alchemyCatalystOverlay = IconHelper.forName(evt.getMap(), "alchemyCatalyst3", "blocks"); + conjurationCatalystOverlay = IconHelper.forName(evt.getMap(), "conjurationCatalyst3", "blocks"); + enchanterOverlay = IconHelper.forName(evt.getMap(), "enchanterOverlay", "blocks"); + manaVoidOverlay = IconHelper.forName(evt.getMap(), "manaVoid1", "blocks"); + manaWater = IconHelper.forName(evt.getMap(), "manaWater", "blocks"); + terraPlateOverlay = IconHelper.forName(evt.getMap(), "terraPlateOverlay", "blocks"); + corporeaWorldIcon = IconHelper.forName(evt.getMap(), "corporeaSpark1", "items"); + corporeaWorldIconMaster = IconHelper.forName(evt.getMap(), "corporeaSpark3", "items"); + corporeaIconStar = IconHelper.forName(evt.getMap(), "corporeaSparkStar", "items"); + sparkWorldIcon = IconHelper.forName(evt.getMap(), "spark1", "items"); + + sparkUpgradeIcons = new TextureAtlasSprite[ItemSparkUpgrade.VARIANTS]; + for(int i = 0; i < ItemSparkUpgrade.VARIANTS; i++) { + sparkUpgradeIcons[i] = IconHelper.forName(evt.getMap(), "sparkUpgradeL" + i, "items"); + } + + tailIcon = IconHelper.forName(evt.getMap(), "tail", "items"); + phiFlowerIcon = IconHelper.forName(evt.getMap(), "phiFlower", "items"); + goldfishIcon = IconHelper.forName(evt.getMap(), "goldfish", "items"); + nerfBatIcon = IconHelper.forName(evt.getMap(), "nerfBat", "items"); + + kingKeyWeaponIcons = new TextureAtlasSprite[ItemKingKey.WEAPON_TYPES]; + for(int i = 0; i < ItemKingKey.WEAPON_TYPES; i++) + kingKeyWeaponIcons[i] = IconHelper.forName(evt.getMap(), "gateWeapon" + i, "items"); + + manaDetectorIcon = IconHelper.forName(evt.getMap(), "triggers/manaDetector", "items"); + runeAltarTriggerIcon = IconHelper.forName(evt.getMap(), "triggers/runeAltarCanCraft", "items"); + + for (TriggerManaLevel.State s : TriggerManaLevel.State.values()) { + manaLevelTriggerIcons.put(s, IconHelper.forName(evt.getMap(), "triggers/mana" + WordUtils.capitalizeFully(s.name()), "items")); + } + + tiaraWingIcons = new TextureAtlasSprite[ItemFlightTiara.WING_TYPES]; + for (int i = 0; i < tiaraWingIcons.length; i++) { + tiaraWingIcons[i] = IconHelper.forName(evt.getMap(), "flightTiara" + (i + 1), "items"); + } + + terrasteelHelmWillIcon = IconHelper.forName(evt.getMap(), "willFlame", "items"); + + bloodPendantChain = IconHelper.forName(evt.getMap(), "bloodPendant2", "items"); + bloodPendantGem = IconHelper.forName(evt.getMap(), "bloodPendant3", "items"); + snowflakePendantGem = IconHelper.forName(evt.getMap(), "icePendantGem", "items"); + itemFinderGem = IconHelper.forName(evt.getMap(), "itemFinderGem", "items"); + pyroclastGem = IconHelper.forName(evt.getMap(), "lavaPendantGem", "items"); + crimsonGem = IconHelper.forName(evt.getMap(), "superLavaPendantGem", "items"); + } + + @SubscribeEvent + public void dumpAtlas(ArrowLooseEvent evt) { + if (!evt.getEntityPlayer().worldObj.isRemote || !((Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment")) + || !evt.getEntityPlayer().isSneaking()) + return; + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + + int width = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_WIDTH); + int height = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_HEIGHT); + + Botania.LOGGER.debug("Dumped atlas %d wide by %d tall%n", width, height); + + int pixels = width * height; + + IntBuffer buffer = BufferUtils.createIntBuffer(pixels); + int[] pixelValues = new int[pixels]; + + GL11.glPixelStorei(GL11.GL_PACK_ALIGNMENT, 1); + GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1); + + GL11.glGetTexImage(GL11.GL_TEXTURE_2D, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, buffer); + + buffer.get(pixelValues); + + BufferedImage bufferedimage = new BufferedImage(width, height, 2); + + for (int k = 0; k < height; ++k) + { + for (int l = 0; l < width; ++l) + { + bufferedimage.setRGB(l, k, pixelValues[k * width + l]); + } + } + + File mcFolder = Minecraft.getMinecraft().mcDataDir; + File result = new File(mcFolder, "atlas.png"); + + try { + ImageIO.write(bufferedimage, "png", result); + } catch (IOException e) { + Botania.LOGGER.warn("Failed to dump debug atlas"); + } + } + + private MiscellaneousIcons() {} +} diff --git a/src/main/java/vazkii/botania/client/core/handler/ModelHandler.java b/src/main/java/vazkii/botania/client/core/handler/ModelHandler.java new file mode 100644 index 000000000..f3044ac53 --- /dev/null +++ b/src/main/java/vazkii/botania/client/core/handler/ModelHandler.java @@ -0,0 +1,219 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + * + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.client.core.handler; + +import java.util.Locale; +import java.util.Map; +import java.util.function.IntFunction; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.block.statemap.DefaultStateMapper; +import net.minecraft.client.renderer.block.statemap.IStateMapper; +import net.minecraft.item.Item; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.client.model.ModelLoaderRegistry; +import net.minecraftforge.client.model.obj.OBJLoader; +import net.minecraftforge.fml.common.registry.RegistryDelegate; +import net.minecraftforge.fml.relauncher.ReflectionHelper; +import vazkii.botania.api.BotaniaAPIClient; +import vazkii.botania.api.item.IFloatingFlower; +import vazkii.botania.client.model.SpecialFlowerModel; +import vazkii.botania.client.render.IModelRegister; +import vazkii.botania.common.block.subtile.SubTileManastar; +import vazkii.botania.common.block.subtile.SubTilePureDaisy; +import vazkii.botania.common.block.subtile.functional.SubTileAgricarnation; +import vazkii.botania.common.block.subtile.functional.SubTileBellethorn; +import vazkii.botania.common.block.subtile.functional.SubTileBergamute; +import vazkii.botania.common.block.subtile.functional.SubTileBubbell; +import vazkii.botania.common.block.subtile.functional.SubTileClayconia; +import vazkii.botania.common.block.subtile.functional.SubTileDaffomill; +import vazkii.botania.common.block.subtile.functional.SubTileDreadthorn; +import vazkii.botania.common.block.subtile.functional.SubTileExoflame; +import vazkii.botania.common.block.subtile.functional.SubTileFallenKanade; +import vazkii.botania.common.block.subtile.functional.SubTileHeiseiDream; +import vazkii.botania.common.block.subtile.functional.SubTileHopperhock; +import vazkii.botania.common.block.subtile.functional.SubTileHyacidus; +import vazkii.botania.common.block.subtile.functional.SubTileJadedAmaranthus; +import vazkii.botania.common.block.subtile.functional.SubTileJiyuulia; +import vazkii.botania.common.block.subtile.functional.SubTileLoonuim; +import vazkii.botania.common.block.subtile.functional.SubTileMarimorphosis; +import vazkii.botania.common.block.subtile.functional.SubTileMedumone; +import vazkii.botania.common.block.subtile.functional.SubTileOrechid; +import vazkii.botania.common.block.subtile.functional.SubTileOrechidIgnem; +import vazkii.botania.common.block.subtile.functional.SubTilePollidisiac; +import vazkii.botania.common.block.subtile.functional.SubTileRannuncarpus; +import vazkii.botania.common.block.subtile.functional.SubTileSolegnolia; +import vazkii.botania.common.block.subtile.functional.SubTileSpectranthemum; +import vazkii.botania.common.block.subtile.functional.SubTileTangleberrie; +import vazkii.botania.common.block.subtile.functional.SubTileTigerseye; +import vazkii.botania.common.block.subtile.functional.SubTileVinculotus; +import vazkii.botania.common.block.subtile.generating.SubTileArcaneRose; +import vazkii.botania.common.block.subtile.generating.SubTileDandelifeon; +import vazkii.botania.common.block.subtile.generating.SubTileEndoflame; +import vazkii.botania.common.block.subtile.generating.SubTileEntropinnyum; +import vazkii.botania.common.block.subtile.generating.SubTileGourmaryllis; +import vazkii.botania.common.block.subtile.generating.SubTileHydroangeas; +import vazkii.botania.common.block.subtile.generating.SubTileKekimurus; +import vazkii.botania.common.block.subtile.generating.SubTileMunchdew; +import vazkii.botania.common.block.subtile.generating.SubTileNarslimmus; +import vazkii.botania.common.block.subtile.generating.SubTileRafflowsia; +import vazkii.botania.common.block.subtile.generating.SubTileSpectrolus; +import vazkii.botania.common.block.subtile.generating.SubTileThermalily; +import vazkii.botania.common.lib.LibBlockNames; +import vazkii.botania.common.lib.LibMisc; + +public final class ModelHandler { + + public static void registerModels() { + ModelLoaderRegistry.registerLoader(SpecialFlowerModel.Loader.INSTANCE); + OBJLoader.INSTANCE.addDomain(LibMisc.MOD_ID.toLowerCase(Locale.ROOT)); + + registerSubtiles(); + + for(Block block : Block.REGISTRY) { + if(block instanceof IModelRegister) + ((IModelRegister) block).registerModels(); + } + + for(Item item : Item.REGISTRY) { + if(item instanceof IModelRegister) + ((IModelRegister) item).registerModels(); + } + } + + private static void registerSubtiles() { + BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.GRASS, new ModelResourceLocation("botania:miniIsland", "variant=grass")); + BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.PODZOL, new ModelResourceLocation("botania:miniIsland", "variant=podzol")); + BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.MYCEL, new ModelResourceLocation("botania:miniIsland", "variant=mycel")); + BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.SNOW, new ModelResourceLocation("botania:miniIsland", "variant=snow")); + BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.DRY, new ModelResourceLocation("botania:miniIsland", "variant=dry")); + BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.GOLDEN, new ModelResourceLocation("botania:miniIsland", "variant=golden")); + BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.VIVID, new ModelResourceLocation("botania:miniIsland", "variant=vivid")); + BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.SCORCHED, new ModelResourceLocation("botania:miniIsland", "variant=scorched")); + BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.INFUSED, new ModelResourceLocation("botania:miniIsland", "variant=infused")); + BotaniaAPIClient.registerIslandTypeModel(IFloatingFlower.IslandType.MUTATED, new ModelResourceLocation("botania:miniIsland", "variant=mutated")); + + BotaniaAPIClient.registerSubtileModel(SubTileManastar.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_MANASTAR)); + BotaniaAPIClient.registerSubtileModel(SubTilePureDaisy.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_PUREDAISY)); + + BotaniaAPIClient.registerSubtileModel(SubTileEndoflame.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_ENDOFLAME)); + BotaniaAPIClient.registerSubtileModel(SubTileHydroangeas.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_HYDROANGEAS)); + BotaniaAPIClient.registerSubtileModel(SubTileThermalily.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_THERMALILY)); + BotaniaAPIClient.registerSubtileModel(SubTileArcaneRose.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_ARCANE_ROSE)); + BotaniaAPIClient.registerSubtileModel(SubTileMunchdew.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_MUNCHDEW)); + BotaniaAPIClient.registerSubtileModel(SubTileEntropinnyum.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_ENTROPINNYUM)); + BotaniaAPIClient.registerSubtileModel(SubTileKekimurus.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_KEKIMURUS)); + BotaniaAPIClient.registerSubtileModel(SubTileGourmaryllis.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_GOURMARYLLIS)); + BotaniaAPIClient.registerSubtileModel(SubTileNarslimmus.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_NARSLIMMUS)); + BotaniaAPIClient.registerSubtileModel(SubTileSpectrolus.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_SPECTROLUS)); + BotaniaAPIClient.registerSubtileModel(SubTileDandelifeon.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_DANDELIFEON)); + BotaniaAPIClient.registerSubtileModel(SubTileRafflowsia.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_RAFFLOWSIA)); + + BotaniaAPIClient.registerSubtileModel(SubTileBellethorn.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_BELLETHORN)); + BotaniaAPIClient.registerSubtileModel(SubTileBellethorn.Mini.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_BELLETHORN + "Chibi")); + BotaniaAPIClient.registerSubtileModel(SubTileDreadthorn.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_DREADTHORN)); + BotaniaAPIClient.registerSubtileModel(SubTileHeiseiDream.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_HEISEI_DREAM)); + BotaniaAPIClient.registerSubtileModel(SubTileTigerseye.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_TIGERSEYE)); + BotaniaAPIClient.registerSubtileModel(SubTileJadedAmaranthus.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_JADED_AMARANTHUS)); + BotaniaAPIClient.registerSubtileModel(SubTileOrechid.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_ORECHID)); + BotaniaAPIClient.registerSubtileModel(SubTileOrechidIgnem.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_ORECHID_IGNEM)); + BotaniaAPIClient.registerSubtileModel(SubTileFallenKanade.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_FALLEN_KANADE)); + BotaniaAPIClient.registerSubtileModel(SubTileExoflame.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_EXOFLAME)); + BotaniaAPIClient.registerSubtileModel(SubTileAgricarnation.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_AGRICARNATION)); + BotaniaAPIClient.registerSubtileModel(SubTileAgricarnation.Mini.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_AGRICARNATION + "Chibi")); + BotaniaAPIClient.registerSubtileModel(SubTileHopperhock.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_HOPPERHOCK)); + BotaniaAPIClient.registerSubtileModel(SubTileHopperhock.Mini.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_HOPPERHOCK + "Chibi")); + BotaniaAPIClient.registerSubtileModel(SubTileTangleberrie.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_TANGLEBERRIE)); + BotaniaAPIClient.registerSubtileModel(SubTileJiyuulia.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_JIYUULIA)); + BotaniaAPIClient.registerSubtileModel(SubTileRannuncarpus.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_RANNUNCARPUS)); + BotaniaAPIClient.registerSubtileModel(SubTileRannuncarpus.Mini.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_RANNUNCARPUS + "Chibi")); + BotaniaAPIClient.registerSubtileModel(SubTileHyacidus.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_HYACIDUS)); + BotaniaAPIClient.registerSubtileModel(SubTilePollidisiac.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_POLLIDISIAC)); + BotaniaAPIClient.registerSubtileModel(SubTileClayconia.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_CLAYCONIA)); + BotaniaAPIClient.registerSubtileModel(SubTileClayconia.Mini.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_CLAYCONIA + "Chibi")); + BotaniaAPIClient.registerSubtileModel(SubTileLoonuim.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_LOONIUM)); + BotaniaAPIClient.registerSubtileModel(SubTileDaffomill.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_DAFFOMILL)); + BotaniaAPIClient.registerSubtileModel(SubTileVinculotus.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_VINCULOTUS)); + BotaniaAPIClient.registerSubtileModel(SubTileSpectranthemum.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_SPECTRANTHEMUM)); + BotaniaAPIClient.registerSubtileModel(SubTileMedumone.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_MEDUMONE)); + BotaniaAPIClient.registerSubtileModel(SubTileMarimorphosis.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_MARIMORPHOSIS)); + BotaniaAPIClient.registerSubtileModel(SubTileMarimorphosis.Mini.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_MARIMORPHOSIS + "Chibi")); + BotaniaAPIClient.registerSubtileModel(SubTileBubbell.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_BUBBELL)); + BotaniaAPIClient.registerSubtileModel(SubTileBubbell.Mini.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_BUBBELL + "Chibi")); + BotaniaAPIClient.registerSubtileModel(SubTileSolegnolia.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_SOLEGNOLIA)); + BotaniaAPIClient.registerSubtileModel(SubTileSolegnolia.Mini.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_SOLEGNOLIA + "Chibi")); + BotaniaAPIClient.registerSubtileModel(SubTileBergamute.class, new ModelResourceLocation("botania:" + LibBlockNames.SUBTILE_BERGAMUTE)); + } + + public static void registerItemAllMeta(Item item, int range) { + registerItemMetas(item, range, i -> item.getRegistryName().getResourcePath()); + } + + public static void registerItemAppendMeta(Item item, int maxExclusive, String loc) { + registerItemMetas(item, maxExclusive, i -> loc + i); + } + + public static void registerItemMetas(Item item, int maxExclusive, IntFunction metaToName) { + for (int i = 0; i < maxExclusive; i++) { + ModelLoader.setCustomModelResourceLocation( + item, i, + new ModelResourceLocation(LibMisc.MOD_ID + ":" + metaToName.apply(i), "inventory") + ); + } + } + + private static final Map, IStateMapper> customStateMappers = ReflectionHelper.getPrivateValue(ModelLoader.class, null, "customStateMappers"); + private static final DefaultStateMapper fallbackMapper = new DefaultStateMapper(); + + private static ModelResourceLocation getMrlForState(IBlockState state) { + return customStateMappers + .getOrDefault(state.getBlock().delegate, fallbackMapper) + .putStateModelLocations(state.getBlock()) + .get(state); + } + + public static void registerBlockToState(Block b, int meta, IBlockState state) { + ModelLoader.setCustomModelResourceLocation( + Item.getItemFromBlock(b), + meta, + getMrlForState(state) + ); + } + + public static void registerBlockToState(Block b, int maxExclusive) { + for(int i = 0; i < maxExclusive; i++) + registerBlockToState(b, i, b.getStateFromMeta(i)); + } + + // Registers the ItemBlock to models/item/#inventory + public static void registerInventoryVariant(Block b) { + ModelLoader.setCustomModelResourceLocation( + Item.getItemFromBlock(b), 0, + new ModelResourceLocation(b.getRegistryName(), "inventory")); + } + + // Registers the ItemBlock to a custom path in models/item/itemblock/ + public static void registerCustomItemblock(Block b, String path) { + registerCustomItemblock(b, 1, i -> path); + } + + public static void registerCustomItemblock(Block b, int maxExclusive, IntFunction metaToPath) { + Item item = Item.getItemFromBlock(b); + for (int i = 0; i < maxExclusive; i++) { + ModelLoader.setCustomModelResourceLocation( + item, i, + new ModelResourceLocation(LibMisc.MOD_ID + ":itemblock/" + metaToPath.apply(i), "inventory") + ); + } + } + + private ModelHandler() {} +} diff --git a/src/main/java/vazkii/botania/client/core/handler/MultiblockBlockAccess.java b/src/main/java/vazkii/botania/client/core/handler/MultiblockBlockAccess.java index c59ac2505..768cdec89 100644 --- a/src/main/java/vazkii/botania/client/core/handler/MultiblockBlockAccess.java +++ b/src/main/java/vazkii/botania/client/core/handler/MultiblockBlockAccess.java @@ -10,123 +10,108 @@ */ package vazkii.botania.client.core.handler; -import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.world.WorldType; +import net.minecraft.world.biome.Biome; import vazkii.botania.api.lexicon.multiblock.Multiblock; import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent; +import javax.annotation.Nonnull; + /** * This class acts as a wrapper around a block access to * replace blocks with the blocks involved in the multiblock specified */ public class MultiblockBlockAccess implements IBlockAccess { - protected IBlockAccess originalBlockAccess; - protected boolean hasBlockAccess = false; + private IBlockAccess originalBlockAccess; + private boolean hasBlockAccess = false; + private BlockPos anchorPos; protected Multiblock multiblock; - protected int anchorX, anchorY, anchorZ; + @Nonnull @Override - public Block getBlock(int x, int y, int z) { - MultiblockComponent comp=getComponent(x, y, z); + public IBlockState getBlockState(@Nonnull BlockPos pos) { + MultiblockComponent comp=getComponent(pos); if(comp != null) - return comp.getBlock(); + return comp.getBlockState(); if(hasBlockAccess) - return originalBlockAccess.getBlock(x, y, z); - return Blocks.air; + return originalBlockAccess.getBlockState(pos); + return Blocks.AIR.getDefaultState(); } @Override - public TileEntity getTileEntity(int x, int y, int z) { - MultiblockComponent comp=getComponent(x, y, z); + public TileEntity getTileEntity(@Nonnull BlockPos pos) { + MultiblockComponent comp=getComponent(pos); if(comp != null) return comp.getTileEntity(); if(hasBlockAccess) - return originalBlockAccess.getTileEntity(x, y, z); + return originalBlockAccess.getTileEntity(pos); return null; } @Override - public int getLightBrightnessForSkyBlocks(int x, int y, int z, int p_72802_4_) { + public int getCombinedLight(@Nonnull BlockPos pos, int lightValue) { if(hasBlockAccess) - return originalBlockAccess.getLightBrightnessForSkyBlocks(x,y,z,p_72802_4_); + return originalBlockAccess.getCombinedLight(pos, lightValue); return 15728640; } @Override - public int getBlockMetadata(int x, int y, int z) { - MultiblockComponent comp=getComponent(x, y, z); - if(comp != null) - return comp.getMeta(); - if(hasBlockAccess) - return originalBlockAccess.getBlockMetadata(x, y, z); + public int getStrongPower(@Nonnull BlockPos pos, @Nonnull EnumFacing direction) { return 0; } + @Nonnull @Override - public int isBlockProvidingPowerTo(int x, int y, int z, int direction) { - return 0; + public WorldType getWorldType() { + return WorldType.DEFAULT; } @Override - public boolean isAirBlock(int x, int y, int z) { - MultiblockComponent comp=getComponent(x, y, z); + public boolean isAirBlock(@Nonnull BlockPos pos) { + MultiblockComponent comp=getComponent(pos); if(comp != null) return false; if(hasBlockAccess) - return originalBlockAccess.isAirBlock(x, y, z); + return originalBlockAccess.isAirBlock(pos); return true; } + @Nonnull @Override - public BiomeGenBase getBiomeGenForCoords(int x, int z) { + public Biome getBiomeGenForCoords(@Nonnull BlockPos pos) { if(hasBlockAccess) - return originalBlockAccess.getBiomeGenForCoords(x, z); + return originalBlockAccess.getBiomeGenForCoords(pos); return null; } @Override - public int getHeight() { + public boolean isSideSolid(@Nonnull BlockPos pos, @Nonnull EnumFacing side, boolean _default) { if(hasBlockAccess) - return originalBlockAccess.getHeight(); - return 256; - } - - @Override - public boolean extendedLevelsInChunkCache() { - if(hasBlockAccess) - return originalBlockAccess.extendedLevelsInChunkCache(); - return false; - } - - @Override - public boolean isSideSolid(int x, int y, int z, ForgeDirection side, boolean _default) { - if(hasBlockAccess) - return originalBlockAccess.isSideSolid(x, y, z, side, _default); + return originalBlockAccess.isSideSolid(pos, side, _default); return _default; } /** * Updates the block access to the new parameters */ - public void update(IBlockAccess access, Multiblock mb, int anchorX, int anchorY, int anchorZ) { + public void update(IBlockAccess access, Multiblock mb, BlockPos anchorPos) { originalBlockAccess = access; multiblock = mb; - this.anchorX = anchorX; - this.anchorY = anchorY; - this.anchorZ = anchorZ; + this.anchorPos = anchorPos; hasBlockAccess = access != null; } /** * Returns the multiblock component for the coordinates, adjusted based on the anchor */ - protected MultiblockComponent getComponent(int x, int y, int z) { - MultiblockComponent comp = multiblock.getComponentForLocation(x - anchorX, y - anchorY, z - anchorZ); - return comp; + private MultiblockComponent getComponent(BlockPos pos) { + return multiblock.getComponentForLocation(pos.add(new BlockPos(-anchorPos.getX(), -anchorPos.getY(), -anchorPos.getZ()))); } } diff --git a/src/main/java/vazkii/botania/client/core/handler/MultiblockRenderHandler.java b/src/main/java/vazkii/botania/client/core/handler/MultiblockRenderHandler.java index 14295ff78..47c8add7f 100644 --- a/src/main/java/vazkii/botania/client/core/handler/MultiblockRenderHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/MultiblockRenderHandler.java @@ -10,182 +10,188 @@ */ package vazkii.botania.client.core.handler; -import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.BlockRendererDispatcher; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.block.model.IBakedModel; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.util.ChatStyle; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.MathHelper; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.text.Style; +import net.minecraft.util.text.TextComponentTranslation; +import net.minecraft.util.text.TextFormatting; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.client.event.RenderWorldLastEvent; import net.minecraftforge.event.entity.player.PlayerInteractEvent; -import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action; - +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.lwjgl.opengl.ARBShaderObjects; import org.lwjgl.opengl.GL11; - import vazkii.botania.api.lexicon.multiblock.IMultiblockRenderHook; import vazkii.botania.api.lexicon.multiblock.Multiblock; import vazkii.botania.api.lexicon.multiblock.MultiblockSet; import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import vazkii.botania.client.core.helper.ShaderHelper; +import vazkii.botania.common.block.ModBlocks; public final class MultiblockRenderHandler { + private MultiblockRenderHandler() {} + + private static final MultiblockBlockAccess blockAccess = new MultiblockBlockAccess(); + private static int dimension; + public static boolean rendering = false; - - private static MultiblockBlockAccess blockAccess = new MultiblockBlockAccess(); - - private static RenderBlocks blockRender = RenderBlocks.getInstance(); public static MultiblockSet currentMultiblock; - public static ChunkCoordinates anchor; - public static int angle; - public static int dimension; + public static BlockPos anchor; + public static EnumFacing angle; + + static { + // todo 1.8.8 temporary shim, because cannot renderBlockBrightness directly, see MinecraftForge issue 2353 + IMultiblockRenderHook.renderHooks.put(ModBlocks.pylon, new IMultiblockRenderHook() { + @Override + public void renderBlockForMultiblock(IBlockAccess world, Multiblock mb, IBlockState state, MultiblockComponent comp) { + // Steal itemstack model since it has the proper group visibilities configured + ItemStack stack = new ItemStack(ModBlocks.pylon, 1, state.getBlock().getMetaFromState(state)); + IBakedModel model = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getItemModel(stack); + GlStateManager.scale(0.65F, 0.65, 0.65F); + GlStateManager.translate(0.5F, -0.75F, 0.5F); + Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelRenderer().renderModelBrightness(model, state, 1.0F, false); + } + + @Override + public boolean needsTranslate(IBlockState state) { + return true; + } + }); + } public static void setMultiblock(MultiblockSet set) { currentMultiblock = set; anchor = null; - angle = 0; + angle = EnumFacing.SOUTH; Minecraft mc = Minecraft.getMinecraft(); if(mc.theWorld != null) - dimension = mc.theWorld.provider.dimensionId; + dimension = mc.theWorld.provider.getDimension(); } @SubscribeEvent - public void onWorldRenderLast(RenderWorldLastEvent event) { + public static void onWorldRenderLast(RenderWorldLastEvent event) { Minecraft mc = Minecraft.getMinecraft(); - if(mc.thePlayer != null && mc.objectMouseOver != null && (!mc.thePlayer.isSneaking() || anchor != null)) { - mc.thePlayer.getCurrentEquippedItem(); + if(mc.thePlayer != null && mc.objectMouseOver != null && mc.objectMouseOver.getBlockPos() != null && (!mc.thePlayer.isSneaking() || anchor != null)) { renderPlayerLook(mc.thePlayer, mc.objectMouseOver); } } @SubscribeEvent - public void onPlayerInteract(PlayerInteractEvent event) { - if(currentMultiblock != null && anchor == null && event.action == Action.RIGHT_CLICK_BLOCK && event.entityPlayer == Minecraft.getMinecraft().thePlayer) { - anchor = new ChunkCoordinates(event.x, event.y, event.z); - angle = MathHelper.floor_double(event.entityPlayer.rotationYaw * 4.0 / 360.0 + 0.5) & 3; + public static void onPlayerInteract(PlayerInteractEvent.RightClickBlock event) { + if(currentMultiblock != null && anchor == null && event.getEntityPlayer() == Minecraft.getMinecraft().thePlayer) { + anchor = event.getPos(); + angle = event.getEntityPlayer().getHorizontalFacing(); event.setCanceled(true); } } - private void renderPlayerLook(EntityPlayer player, MovingObjectPosition src) { - if(currentMultiblock != null && dimension == player.worldObj.provider.dimensionId) { - int anchorX = anchor != null ? anchor.posX : src.blockX; - int anchorY = anchor != null ? anchor.posY : src.blockY; - int anchorZ = anchor != null ? anchor.posZ : src.blockZ; + private static void renderPlayerLook(EntityPlayer player, RayTraceResult src) { + if(currentMultiblock != null && dimension == player.worldObj.provider.getDimension()) { + BlockPos anchorPos = anchor != null ? anchor : src.getBlockPos(); - GL11.glPushMatrix(); - GL11.glPushAttrib(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glDisable(GL11.GL_LIGHTING); + GlStateManager.pushMatrix(); + GL11.glPushAttrib(GL11.GL_LIGHTING_BIT); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.disableLighting(); rendering = true; - Multiblock mb = anchor != null ? currentMultiblock.getForIndex(angle) : currentMultiblock.getForEntity(player); + Multiblock mb = anchor != null ? currentMultiblock.getForFacing(angle) : currentMultiblock.getForEntity(player); boolean didAny = false; - blockAccess.update(player.worldObj, mb, anchorX, anchorY, anchorZ); + blockAccess.update(player.worldObj, mb, anchorPos); - for(MultiblockComponent comp : mb.getComponents()) - if(renderComponentInWorld(player.worldObj, mb, comp, anchorX, anchorY, anchorZ)) + ShaderHelper.useShader(ShaderHelper.alpha, shader -> { + int alpha = ARBShaderObjects.glGetUniformLocationARB(shader, "alpha"); + ARBShaderObjects.glUniform1fARB(alpha, 0.4F); + }); + + for(MultiblockComponent comp : mb.getComponents()) { + if(renderComponentInWorld(player.worldObj, mb, comp, anchorPos)) didAny = true; + } + + ShaderHelper.releaseShader(); + rendering = false; GL11.glPopAttrib(); - GL11.glPopMatrix(); + GlStateManager.popMatrix(); if(!didAny) { setMultiblock(null); - player.addChatComponentMessage(new ChatComponentTranslation("botaniamisc.structureComplete").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GREEN))); + player.addChatComponentMessage(new TextComponentTranslation("botaniamisc.structureComplete").setStyle(new Style().setColor(TextFormatting.GREEN))); } } } - private boolean renderComponentInWorld(World world, Multiblock mb, MultiblockComponent comp, int anchorX, int anchorY, int anchorZ) { - ChunkCoordinates pos = comp.getRelativePosition(); - int x = pos.posX + anchorX; - int y = pos.posY + anchorY; - int z = pos.posZ + anchorZ; - if(anchor != null && comp.matches(world, x, y, z)) + private static boolean renderComponentInWorld(World world, Multiblock mb, MultiblockComponent comp, BlockPos anchorPos) { + double renderPosX, renderPosY, renderPosZ; + + try { + renderPosX = (double) ClientMethodHandles.renderPosX_getter.invokeExact(Minecraft.getMinecraft().getRenderManager()); + renderPosY = (double) ClientMethodHandles.renderPosY_getter.invokeExact(Minecraft.getMinecraft().getRenderManager()); + renderPosZ = (double) ClientMethodHandles.renderPosZ_getter.invokeExact(Minecraft.getMinecraft().getRenderManager()); + } catch (Throwable t) { + return true; + } + + BlockPos pos = comp.getRelativePosition(); + BlockPos pos_ = pos.add(anchorPos); + if(anchor != null && comp.matches(world, pos_)) return false; - GL11.glPushMatrix(); - GL11.glTranslated(-RenderManager.renderPosX, -RenderManager.renderPosY, -RenderManager.renderPosZ); - GL11.glDisable(GL11.GL_DEPTH_TEST); - doRenderComponent(mb, comp, x, y, z, 0.4F); - GL11.glPopMatrix(); + GlStateManager.pushMatrix(); + GlStateManager.translate(-renderPosX, -renderPosY, -renderPosZ); + GlStateManager.disableDepth(); + doRenderComponent(mb, comp, pos_); + GlStateManager.popMatrix(); return true; } public static void renderMultiblockOnPage(Multiblock mb) { - GL11.glTranslated(-0.5, -0.5, -0.5); - blockAccess.update(null, mb, mb.offX, mb.offY, mb.offZ); + GlStateManager.translate(-0.5, -0.5, -0.5); + blockAccess.update(null, mb, mb.offPos); for(MultiblockComponent comp : mb.getComponents()) { - ChunkCoordinates pos = comp.getRelativePosition(); - doRenderComponent(mb, comp, pos.posX + mb.offX, pos.posY + mb.offY, pos.posZ + mb.offZ, 1); + BlockPos pos = comp.getRelativePosition(); + doRenderComponent(mb, comp, pos.add(mb.offPos)); } } - private static void doRenderComponent(Multiblock mb, MultiblockComponent comp, int x, int y, int z, float alpha) { - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - Block block = comp.getBlock(); - int meta = comp.getMeta(); - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); - blockRender.useInventoryTint = false; - if(block == null) + private static void doRenderComponent(Multiblock mb, MultiblockComponent comp, BlockPos pos) { + GlStateManager.pushMatrix(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + IBlockState state = comp.getBlockState(); + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + if(state == null) return; - if(IMultiblockRenderHook.renderHooks.containsKey(block)) { - GL11.glColor4f(1F, 1F, 1F, alpha); - IMultiblockRenderHook renderHook = IMultiblockRenderHook.renderHooks.get(block); - if(renderHook.needsTranslate(block)) { - GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5); + if(IMultiblockRenderHook.renderHooks.containsKey(state.getBlock())) { + GlStateManager.color(1F, 1F, 1F, 1F); + IMultiblockRenderHook renderHook = IMultiblockRenderHook.renderHooks.get(state.getBlock()); + if(renderHook.needsTranslate(state)) { + GlStateManager.translate(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5); } - renderHook.renderBlockForMultiblock(blockAccess, mb, block, comp.getMeta(), blockRender, comp, alpha); + renderHook.renderBlockForMultiblock(blockAccess, mb, state, comp); } else { - if(comp.shouldDoFancyRender()) { - int color = block.colorMultiplier(blockAccess, x, y, z); - float red = (color >> 16 & 255) / 255.0F; - float green = (color >> 8 & 255) / 255.0F; - float blue = (color & 255) / 255.0F; - GL11.glColor4f(red, green, blue, alpha); - IBlockAccess oldBlockAccess = blockRender.blockAccess; - blockRender.blockAccess = blockAccess; - Tessellator tessellator = Tessellator.instance; - blockRender.renderAllFaces = true; - tessellator.startDrawingQuads(); - tessellator.disableColor(); - try { - blockRender.renderBlockByRenderType(block, x, y, z); - } - catch(Exception e) { - comp.doFancyRender = false; - } - tessellator.draw(); - blockRender.renderAllFaces = false; - blockRender.blockAccess = oldBlockAccess; - } - else { - int color = block.getRenderColor(meta); - float red = (color >> 16 & 255) / 255.0F; - float green = (color >> 8 & 255) / 255.0F; - float blue = (color & 255) / 255.0F; - GL11.glColor4f(red, green, blue, alpha); - GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5); - blockRender.renderBlockAsItem(block, meta, 1F); - } + BlockRendererDispatcher brd = Minecraft.getMinecraft().getBlockRendererDispatcher(); + GlStateManager.translate(pos.getX(), pos.getY(), pos.getZ() + 1); + GlStateManager.color(1, 1, 1, 1); + brd.renderBlockBrightness(state, 1.0F); } - GL11.glColor4f(1F, 1F, 1F, 1F); - GL11.glEnable(GL11.GL_DEPTH_TEST); - GL11.glPopMatrix(); + GlStateManager.color(1F, 1F, 1F, 1F); + GlStateManager.enableDepth(); + GlStateManager.popMatrix(); } } diff --git a/src/main/java/vazkii/botania/client/core/handler/PersistentVariableHelper.java b/src/main/java/vazkii/botania/client/core/handler/PersistentVariableHelper.java index 3cceab243..ed308d773 100644 --- a/src/main/java/vazkii/botania/client/core/handler/PersistentVariableHelper.java +++ b/src/main/java/vazkii/botania/client/core/handler/PersistentVariableHelper.java @@ -10,13 +10,6 @@ */ package vazkii.botania.client.core.handler; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.List; -import java.util.Set; - import net.minecraft.nbt.CompressedStreamTools; import net.minecraft.nbt.NBTTagCompound; import vazkii.botania.client.challenge.Challenge; @@ -24,6 +17,13 @@ import vazkii.botania.client.challenge.ModChallenges; import vazkii.botania.client.gui.lexicon.GuiLexicon; import vazkii.botania.common.lib.LibMisc; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.List; +import java.util.Set; + public final class PersistentVariableHelper { private static final String TAG_FIRST_LOAD = "firstLoad"; @@ -101,7 +101,7 @@ public final class PersistentVariableHelper { if(cmp.hasKey(TAG_LEXICON_NOTES)) { NBTTagCompound notesCmp = cmp.getCompoundTag(TAG_LEXICON_NOTES); - Set keys = notesCmp.func_150296_c(); + Set keys = notesCmp.getKeySet(); GuiLexicon.notes.clear(); for(String key : keys) GuiLexicon.notes.put(key, notesCmp.getString(key)); @@ -128,24 +128,23 @@ public final class PersistentVariableHelper { cacheFile = f; } - public static File getCacheFile() throws IOException { + private static File getCacheFile() throws IOException { if(!cacheFile.exists()) cacheFile.createNewFile(); return cacheFile; } - public static NBTTagCompound getCacheCompound() throws IOException { + private static NBTTagCompound getCacheCompound() throws IOException { return getCacheCompound(getCacheFile()); } - public static NBTTagCompound getCacheCompound(File cache) throws IOException { + private static NBTTagCompound getCacheCompound(File cache) throws IOException { if(cache == null) throw new RuntimeException("No cache file!"); try { - NBTTagCompound cmp = CompressedStreamTools.readCompressed(new FileInputStream(cache)); - return cmp; + return CompressedStreamTools.readCompressed(new FileInputStream(cache)); } catch(IOException e) { NBTTagCompound cmp = new NBTTagCompound(); CompressedStreamTools.writeCompressed(cmp, new FileOutputStream(cache)); @@ -153,7 +152,7 @@ public final class PersistentVariableHelper { } } - public static void injectNBTToFile(NBTTagCompound cmp, File f) { + private static void injectNBTToFile(NBTTagCompound cmp, File f) { try { CompressedStreamTools.writeCompressed(cmp, new FileOutputStream(f)); } catch(IOException e) { diff --git a/src/main/java/vazkii/botania/client/core/handler/RedStringRenderer.java b/src/main/java/vazkii/botania/client/core/handler/RedStringRenderer.java index fdcd0a268..292eea138 100644 --- a/src/main/java/vazkii/botania/client/core/handler/RedStringRenderer.java +++ b/src/main/java/vazkii/botania/client/core/handler/RedStringRenderer.java @@ -10,54 +10,53 @@ */ package vazkii.botania.client.core.handler; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import org.lwjgl.opengl.GL11; +import vazkii.botania.common.block.tile.string.TileRedString; +import vazkii.botania.common.core.helper.PlayerHelper; +import vazkii.botania.common.core.helper.Vector3; +import vazkii.botania.common.item.ModItems; + import java.util.ArrayDeque; import java.util.Queue; import java.util.Random; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.ChunkCoordinates; -import net.minecraftforge.common.util.ForgeDirection; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.common.block.tile.string.TileRedString; -import vazkii.botania.common.core.helper.Vector3; -import vazkii.botania.common.item.ModItems; - public final class RedStringRenderer { - public static final Queue redStringTiles = new ArrayDeque(); - static float sizeAlpha = 0F; + public static final Queue redStringTiles = new ArrayDeque<>(); + private static float sizeAlpha = 0F; public static void renderAll() { if(!redStringTiles.isEmpty()) { - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_TEXTURE_2D); - GL11.glEnable(GL11.GL_BLEND); - GL11.glPushAttrib(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1F, 0F, 0F, sizeAlpha); + GlStateManager.pushMatrix(); + GlStateManager.disableTexture2D(); + GlStateManager.enableBlend(); + GL11.glPushAttrib(GL11.GL_LIGHTING_BIT); + GlStateManager.disableLighting(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.color(1F, 0F, 0F, sizeAlpha); - Tessellator.renderingWorldRenderer = false; TileRedString tile; while((tile = redStringTiles.poll()) != null) renderTile(tile); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_BLEND); + GlStateManager.enableTexture2D(); + GlStateManager.disableBlend(); GL11.glPopAttrib(); - GL11.glPopMatrix(); + GlStateManager.popMatrix(); } } public static void tick() { EntityPlayer player = Minecraft.getMinecraft().thePlayer; - boolean hasWand = player != null && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == ModItems.twigWand; + boolean hasWand = player != null && PlayerHelper.hasHeldItem(player, ModItems.twigWand); if(sizeAlpha > 0F && !hasWand) sizeAlpha -= 0.1F; else if(sizeAlpha < 1F &&hasWand) @@ -65,49 +64,59 @@ public final class RedStringRenderer { } private static void renderTile(TileRedString tile) { - ForgeDirection dir = ForgeDirection.getOrientation(tile.getBlockMetadata()); - ChunkCoordinates bind = tile.getBinding(); + double renderPosX, renderPosY, renderPosZ; + + try { + renderPosX = (double) ClientMethodHandles.renderPosX_getter.invokeExact(Minecraft.getMinecraft().getRenderManager()); + renderPosY = (double) ClientMethodHandles.renderPosY_getter.invokeExact(Minecraft.getMinecraft().getRenderManager()); + renderPosZ = (double) ClientMethodHandles.renderPosZ_getter.invokeExact(Minecraft.getMinecraft().getRenderManager()); + } catch (Throwable t) { + return; + } + + EnumFacing dir = tile.getOrientation(); + BlockPos bind = tile.getBinding(); if(bind != null) { - GL11.glPushMatrix(); - GL11.glTranslated(tile.xCoord + 0.5 - RenderManager.renderPosX, tile.yCoord + 0.5 - RenderManager.renderPosY, tile.zCoord + 0.5 - RenderManager.renderPosZ); - Vector3 vecOrig = new Vector3(bind.posX - tile.xCoord, bind.posY - tile.yCoord, bind.posZ - tile.zCoord); - Vector3 vecNorm = vecOrig.copy().normalize(); - Vector3 vecMag = vecNorm.copy().multiply(0.025); - Vector3 vecApply = vecMag.copy(); + GlStateManager.pushMatrix(); + GlStateManager.translate(tile.getPos().getX() + 0.5 - renderPosX, tile.getPos().getY() + 0.5 - renderPosY, tile.getPos().getZ() + 0.5 - renderPosZ); + Vector3 vecOrig = new Vector3(bind.getX() - tile.getPos().getX(), bind.getY() - tile.getPos().getY(), bind.getZ() - tile.getPos().getZ()); + Vector3 vecNorm = vecOrig.normalize(); + Vector3 vecMag = vecNorm.multiply(0.025); + Vector3 vecApply = vecMag; int stages = (int) (vecOrig.mag() / vecMag.mag()); - Tessellator tessellator = Tessellator.instance; + Tessellator tessellator = Tessellator.getInstance(); GL11.glLineWidth(1F); - tessellator.startDrawing(GL11.GL_LINES); + tessellator.getBuffer().begin(GL11.GL_LINES, DefaultVertexFormats.POSITION); - double len = (double) -ClientTickHandler.ticksInGame / 100F + new Random(dir.ordinal() ^ tile.xCoord ^ tile.yCoord ^ tile.zCoord).nextInt(10000); + double len = (double) -ClientTickHandler.ticksInGame / 100F + new Random(dir.ordinal() ^ tile.getPos().hashCode()).nextInt(10000); double add = vecMag.mag(); double rand = Math.random() - 0.5; for(int i = 0; i < stages; i++) { addVertexAtWithTranslation(tessellator, dir, vecApply.x, vecApply.y, vecApply.z, rand, len); rand = Math.random() - 0.5; - vecApply.add(vecMag); + vecApply = vecApply.add(vecMag); len += add; addVertexAtWithTranslation(tessellator, dir, vecApply.x, vecApply.y, vecApply.z, rand, len); } tessellator.draw(); - GL11.glPopMatrix(); + GlStateManager.popMatrix(); } } - private static void addVertexAtWithTranslation(Tessellator tess, ForgeDirection dir, double xpos, double ypos, double zpos, double rand, double l) { + private static void addVertexAtWithTranslation(Tessellator tess, EnumFacing dir, double xpos, double ypos, double zpos, double rand, double l) { double freq = 20; double ampl = (0.15 * (Math.sin(l * 2F) * 0.5 + 0.5) + 0.1) * sizeAlpha; double randMul = 0.05; - double x = xpos + Math.sin(l * freq) * ampl * Math.abs(Math.abs(dir.offsetX) - 1) + rand * randMul; - double y = ypos + Math.cos(l * freq) * ampl * Math.abs(Math.abs(dir.offsetY) - 1) + rand * randMul; - double z = zpos + (dir.offsetY == 0 ? Math.sin(l * freq) : Math.cos(l * freq)) * ampl * Math.abs(Math.abs(dir.offsetZ) - 1) + rand * randMul; + double x = xpos + Math.sin(l * freq) * ampl * Math.abs(Math.abs(dir.getFrontOffsetX()) - 1) + rand * randMul; + double y = ypos + Math.cos(l * freq) * ampl * Math.abs(Math.abs(dir.getFrontOffsetY()) - 1) + rand * randMul; + double z = zpos + (dir.getFrontOffsetY() == 0 ? Math.sin(l * freq) : Math.cos(l * freq)) * ampl * Math.abs(Math.abs(dir.getFrontOffsetZ()) - 1) + rand * randMul; - tess.addVertex(x, y, z); + tess.getBuffer().pos(x, y, z).endVertex(); } } diff --git a/src/main/java/vazkii/botania/client/core/handler/RenderLexicon.java b/src/main/java/vazkii/botania/client/core/handler/RenderLexicon.java new file mode 100644 index 000000000..77c243747 --- /dev/null +++ b/src/main/java/vazkii/botania/client/core/handler/RenderLexicon.java @@ -0,0 +1,171 @@ +package vazkii.botania.client.core.handler; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.model.ModelBook; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumHand; +import net.minecraft.util.EnumHandSide; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.text.TextFormatting; +import net.minecraftforge.client.event.RenderHandEvent; +import net.minecraftforge.client.event.RenderSpecificHandEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.lwjgl.util.glu.Project; +import vazkii.botania.client.gui.lexicon.GuiLexicon; +import vazkii.botania.client.lib.LibResources; +import vazkii.botania.common.Botania; +import vazkii.botania.common.core.handler.ConfigHandler; +import vazkii.botania.common.core.helper.PlayerHelper; +import vazkii.botania.common.item.ItemLexicon; +import vazkii.botania.common.item.ModItems; + +// Hacky way to render 3D lexicon, will be reevaluated in the future. +public class RenderLexicon { + + private final ModelBook model = new ModelBook(); + private final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_LEXICA); + + @SubscribeEvent + public void renderItem(RenderSpecificHandEvent evt) { + Minecraft mc = Minecraft.getMinecraft(); + if(!ConfigHandler.lexicon3dModel + || mc.gameSettings.thirdPersonView != 0 + || mc.thePlayer.getHeldItem(evt.getHand()) == null + || mc.thePlayer.getHeldItem(evt.getHand()).getItem() != ModItems.lexicon) + return; + evt.setCanceled(true); + try { + renderItemInFirstPerson(mc.thePlayer, evt.getPartialTicks(), evt.getInterpolatedPitch(), evt.getHand(), evt.getSwingProgress(), evt.getItemStack(), evt.getEquipProgress()); + } catch (Throwable throwable) { + Botania.LOGGER.warn("Failed to render lexicon"); + } + } + + private void renderItemInFirstPerson(AbstractClientPlayer player, float partialTicks, float interpPitch, EnumHand hand, float swingProgress, ItemStack stack, float equipProgress) throws Throwable { + // Cherry picked from ItemRenderer.renderItemInFirstPerson + boolean flag = hand == EnumHand.MAIN_HAND; + EnumHandSide enumhandside = flag ? player.getPrimaryHand() : player.getPrimaryHand().opposite(); + GlStateManager.pushMatrix(); + boolean flag1 = enumhandside == EnumHandSide.RIGHT; + float f = -0.4F * MathHelper.sin(MathHelper.sqrt_float(swingProgress) * (float)Math.PI); + float f1 = 0.2F * MathHelper.sin(MathHelper.sqrt_float(swingProgress) * ((float)Math.PI * 2F)); + float f2 = -0.2F * MathHelper.sin(swingProgress * (float)Math.PI); + int i = flag1 ? 1 : -1; + GlStateManager.translate((float)i * f, f1, f2); + this.transformSideFirstPerson(enumhandside, equipProgress); + this.transformFirstPerson(enumhandside, swingProgress); + doRender(enumhandside, partialTicks, stack); + GlStateManager.popMatrix(); + } + + private void doRender(EnumHandSide side, float partialTicks, ItemStack stack) { + Minecraft mc = Minecraft.getMinecraft(); + + GlStateManager.pushMatrix(); + mc.renderEngine.bindTexture(texture); + float opening; + float pageFlip; + + float ticks = ClientTickHandler.ticksWithLexicaOpen; + if(ticks > 0 && ticks < 10) { + if(Minecraft.getMinecraft().currentScreen instanceof GuiLexicon) + ticks += partialTicks; + else ticks -= partialTicks; + } + + GlStateManager.translate(0.3F + 0.02F * ticks, 0.475F + 0.01F * ticks, -0.2F - 0.01F * ticks); + GlStateManager.rotate(87.5F + ticks * (side == EnumHandSide.RIGHT ? 5 : 10), 0F, 1F, 0F); + GlStateManager.rotate(ticks * 2.85F, 0F, 0F, 1F); + opening = ticks / 12F; + + float pageFlipTicks = ClientTickHandler.pageFlipTicks; + if(pageFlipTicks > 0) + pageFlipTicks -= ClientTickHandler.partialTicks; + + pageFlip = pageFlipTicks / 5F; + + model.render(null, 0F, 0F, pageFlip, opening, 0F, 1F / 16F); + if(ticks < 3) { + FontRenderer font = Minecraft.getMinecraft().fontRendererObj; + GlStateManager.rotate(180F, 0F, 0F, 1F); + GlStateManager.translate(-0.3F, -0.21F, -0.07F); + GlStateManager.scale(0.0035F, 0.0035F, -0.0035F); + boolean bevo = mc.thePlayer.getName().equalsIgnoreCase("BevoLJ"); + boolean saice = mc.thePlayer.getName().equalsIgnoreCase("saice"); + + String title = ModItems.lexicon.getItemStackDisplayName(null); + String origTitle = title; + + if(stack != null) + title = stack.getDisplayName(); + if(title.equals(origTitle) && bevo) + title = I18n.format("item.botania:lexicon.bevo"); + if(title.equals(origTitle) && saice) + title = I18n.format("item.botania:lexicon.saice"); + + font.drawString(font.trimStringToWidth(title, 80), 0, 0, 0xD69700); + GlStateManager.translate(0F, 10F, 0F); + GlStateManager.scale(0.6F, 0.6F, 0.6F); + font.drawString(TextFormatting.ITALIC + "" + TextFormatting.BOLD + I18n.format("botaniamisc.edition", ItemLexicon.getEdition()), 0, 0, 0xA07100); + + GlStateManager.translate(0F, 15F, 0F); + font.drawString(I18n.format("botaniamisc.lexiconcover0"), 0, 0, 0x79ff92); + + GlStateManager.translate(0F, 10F, 0F); + font.drawString(I18n.format("botaniamisc.lexiconcover1"), 0, 0, 0x79ff92); + + GlStateManager.translate(0F, 50F, 0F); + font.drawString(I18n.format("botaniamisc.lexiconcover2"), 0, 0, 0x79ff92); + + GlStateManager.translate(0F, 10F, 0F); + font.drawString(TextFormatting.UNDERLINE + "" + TextFormatting.ITALIC + I18n.format("botaniamisc.lexiconcover3"), 0, 0, 0x79ff92); + + if(bevo || saice) { + GlStateManager.translate(0F, 10F, 0F); + font.drawString(I18n.format("botaniamisc.lexiconcover" + (bevo ? 4 : 5)), 0, 0, 0x79ff92); + } + + GlStateManager.color(1F, 1F, 1F); + } + + GlStateManager.popMatrix(); + } + + // Copy - ItemRenderer.transformSideFirstPerson + // Arg - Side, EquipProgress + private void transformSideFirstPerson(EnumHandSide p_187459_1_, float p_187459_2_) + { + int i = p_187459_1_ == EnumHandSide.RIGHT ? 1 : -1; + GlStateManager.translate((float)i * 0.56F, -0.52F + p_187459_2_ * -0.6F, -0.72F); + } + + // Copy with modification - ItemRenderer.transformFirstPerson + // Arg - Side, SwingProgress + private void transformFirstPerson(EnumHandSide p_187453_1_, float p_187453_2_) + { + int i = p_187453_1_ == EnumHandSide.RIGHT ? 1 : -1; + // Botania - added + GlStateManager.translate(p_187453_1_ == EnumHandSide.RIGHT ? 0.5F : 0.3F, -0.25F, 0.2F); + GlStateManager.rotate(90F, 0F, 1F, 0F); + GlStateManager.rotate(12F, 0F, 0F, -1F); + // End add + float f = MathHelper.sin(p_187453_2_ * p_187453_2_ * (float)Math.PI); + GlStateManager.rotate((float)i * (45.0F + f * -20.0F), 0.0F, 1.0F, 0.0F); + float f1 = MathHelper.sin(MathHelper.sqrt_float(p_187453_2_) * (float)Math.PI); + GlStateManager.rotate((float)i * f1 * -20.0F, 0.0F, 0.0F, 1.0F); + GlStateManager.rotate(f1 * -80.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate((float)i * -45.0F, 0.0F, 1.0F, 0.0F); + } + +} diff --git a/src/main/java/vazkii/botania/client/core/handler/SubTileRadiusRenderHandler.java b/src/main/java/vazkii/botania/client/core/handler/SubTileRadiusRenderHandler.java index ca1333223..914c2ade6 100644 --- a/src/main/java/vazkii/botania/client/core/handler/SubTileRadiusRenderHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/SubTileRadiusRenderHandler.java @@ -10,52 +10,50 @@ */ package vazkii.botania.client.core.handler; -import java.awt.Color; - import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import net.minecraftforge.client.event.RenderWorldLastEvent; - +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import org.lwjgl.opengl.GL11; - import vazkii.botania.api.subtile.ISubTileContainer; import vazkii.botania.api.subtile.RadiusDescriptor; import vazkii.botania.api.subtile.SubTileEntity; import vazkii.botania.common.Botania; +import vazkii.botania.common.core.helper.PlayerHelper; import vazkii.botania.common.item.ItemTwigWand; import vazkii.botania.common.item.ModItems; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +import java.awt.*; public final class SubTileRadiusRenderHandler { + private SubTileRadiusRenderHandler() {} + @SubscribeEvent - public void onWorldRenderLast(RenderWorldLastEvent event) { + public static void onWorldRenderLast(RenderWorldLastEvent event) { Minecraft mc = Minecraft.getMinecraft(); - MovingObjectPosition pos = mc.objectMouseOver; + RayTraceResult pos = mc.objectMouseOver; if(!Botania.proxy.isClientPlayerWearingMonocle() || pos == null || pos.entityHit != null) return; - int x = pos.blockX; - int y = pos.blockY; - int z = pos.blockZ; + BlockPos bPos = pos.getBlockPos(); - ItemStack stackHeld = mc.thePlayer.getCurrentEquippedItem(); - if(stackHeld != null && stackHeld.getItem() == ModItems.twigWand && ItemTwigWand.getBindMode(stackHeld)) { - ChunkCoordinates coords = ItemTwigWand.getBoundTile(stackHeld); - if(coords.posY != -1) { - x = coords.posX; - y = coords.posY; - z = coords.posZ; + ItemStack stackHeld = PlayerHelper.getFirstHeldItem(mc.thePlayer, ModItems.twigWand); + if(stackHeld != null && ItemTwigWand.getBindMode(stackHeld)) { + BlockPos coords = ItemTwigWand.getBoundTile(stackHeld); + if(coords.getY() != -1) { + bPos = coords; } } - TileEntity tile = mc.theWorld.getTileEntity(x, y, z); + TileEntity tile = mc.theWorld.getTileEntity(bPos); if(tile == null || !(tile instanceof ISubTileContainer)) return; ISubTileContainer container = (ISubTileContainer) tile; @@ -66,27 +64,36 @@ public final class SubTileRadiusRenderHandler { if(descriptor == null) return; - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_TEXTURE_2D); - GL11.glPushAttrib(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - Tessellator.renderingWorldRenderer = false; + GlStateManager.pushMatrix(); + GlStateManager.disableTexture2D(); + GL11.glPushAttrib(GL11.GL_LIGHTING_BIT); + GlStateManager.disableLighting(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); if(descriptor.isCircle()) renderCircle(descriptor.getSubtileCoords(), descriptor.getCircleRadius()); else renderRectangle(descriptor.getAABB()); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_BLEND); + GlStateManager.enableTexture2D(); + GlStateManager.disableBlend(); GL11.glPopAttrib(); - GL11.glPopMatrix(); + GlStateManager.popMatrix(); } - public void renderRectangle(AxisAlignedBB aabb) { - GL11.glPushMatrix(); - GL11.glTranslated(aabb.minX - RenderManager.renderPosX, aabb.minY - RenderManager.renderPosY, aabb.minZ - RenderManager.renderPosZ); + private static void renderRectangle(AxisAlignedBB aabb) { + double renderPosX, renderPosY, renderPosZ; + + try { + renderPosX = (double) ClientMethodHandles.renderPosX_getter.invokeExact(Minecraft.getMinecraft().getRenderManager()); + renderPosY = (double) ClientMethodHandles.renderPosY_getter.invokeExact(Minecraft.getMinecraft().getRenderManager()); + renderPosZ = (double) ClientMethodHandles.renderPosZ_getter.invokeExact(Minecraft.getMinecraft().getRenderManager()); + } catch (Throwable t) { + return; + } + + GlStateManager.pushMatrix(); + GlStateManager.translate(aabb.minX - renderPosX, aabb.minY - renderPosY, aabb.minZ - renderPosZ); int color = Color.HSBtoRGB(ClientTickHandler.ticksInGame % 200 / 200F, 0.6F, 1F); Color colorRGB = new Color(color); @@ -96,34 +103,45 @@ public final class SubTileRadiusRenderHandler { double x = aabb.maxX - aabb.minX - f; double z = aabb.maxZ - aabb.minZ - f; - Tessellator tessellator = Tessellator.instance; - tessellator.startDrawingQuads(); - tessellator.addVertex(x, f, f); - tessellator.addVertex(f, f, f); - tessellator.addVertex(f, f, z); - tessellator.addVertex(x, f, z); + Tessellator tessellator = Tessellator.getInstance(); + tessellator.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION); + tessellator.getBuffer().pos(x, f, f).endVertex(); + tessellator.getBuffer().pos(f, f, f).endVertex(); + tessellator.getBuffer().pos(f, f, z).endVertex(); + tessellator.getBuffer().pos(x, f, z).endVertex(); tessellator.draw(); x += f; z += f; double f1 = f + f / 4F; GL11.glColor4ub((byte) colorRGB.getRed(), (byte) colorRGB.getGreen(), (byte) colorRGB.getBlue(), (byte) 64); - tessellator.startDrawingQuads(); - tessellator.addVertex(x, f1, 0); - tessellator.addVertex(0, f1, 0); - tessellator.addVertex(0, f1, z); - tessellator.addVertex(x, f1, z); + tessellator.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION); + tessellator.getBuffer().pos(x, f1, 0).endVertex(); + tessellator.getBuffer().pos(0, f1, 0).endVertex(); + tessellator.getBuffer().pos(0, f1, z).endVertex(); + tessellator.getBuffer().pos(x, f1, z).endVertex(); tessellator.draw(); - GL11.glPopMatrix(); + GL11.glColor4ub(((byte) 255), ((byte) 255), ((byte) 255), ((byte) 255)); + GlStateManager.popMatrix(); } - public void renderCircle(ChunkCoordinates center, double radius) { - GL11.glPushMatrix(); - double x = center.posX + 0.5; - double y = center.posY; - double z = center.posZ + 0.5; - GL11.glTranslated(x - RenderManager.renderPosX, y - RenderManager.renderPosY, z - RenderManager.renderPosZ); + private static void renderCircle(BlockPos center, double radius) { + double renderPosX, renderPosY, renderPosZ; + + try { + renderPosX = (double) ClientMethodHandles.renderPosX_getter.invokeExact(Minecraft.getMinecraft().getRenderManager()); + renderPosY = (double) ClientMethodHandles.renderPosY_getter.invokeExact(Minecraft.getMinecraft().getRenderManager()); + renderPosZ = (double) ClientMethodHandles.renderPosZ_getter.invokeExact(Minecraft.getMinecraft().getRenderManager()); + } catch (Throwable t) { + return; + } + + GlStateManager.pushMatrix(); + double x = center.getX() + 0.5; + double y = center.getY(); + double z = center.getZ() + 0.5; + GlStateManager.translate(x - renderPosX, y - renderPosY, z - renderPosZ); int color = Color.HSBtoRGB(ClientTickHandler.ticksInGame % 200 / 200F, 0.6F, 1F); Color colorRGB = new Color(color); @@ -136,32 +154,33 @@ public final class SubTileRadiusRenderHandler { int step = totalAngles / drawAngles; radius -= f; - Tessellator tessellator = Tessellator.instance; - tessellator.startDrawing(GL11.GL_TRIANGLE_FAN); - tessellator.addVertex(0, f, 0); + Tessellator tessellator = Tessellator.getInstance(); + tessellator.getBuffer().begin(GL11.GL_TRIANGLE_FAN, DefaultVertexFormats.POSITION); + tessellator.getBuffer().pos(0, f, 0).endVertex(); for(int i = 0; i < totalAngles + 1; i += step) { double rad = (totalAngles - i) * Math.PI / 180.0; double xp = Math.cos(rad) * radius; double zp = Math.sin(rad) * radius; - tessellator.addVertex(xp, f, zp); + tessellator.getBuffer().pos(xp, f, zp).endVertex(); } - tessellator.addVertex(0, f, 0); + tessellator.getBuffer().pos(0, f, 0).endVertex(); tessellator.draw(); radius += f; double f1 = f + f / 4F; GL11.glColor4ub((byte) colorRGB.getRed(), (byte) colorRGB.getGreen(), (byte) colorRGB.getBlue(), (byte) 64); - tessellator.startDrawing(GL11.GL_TRIANGLE_FAN); - tessellator.addVertex(0, f1, 0); + tessellator.getBuffer().begin(GL11.GL_TRIANGLE_FAN, DefaultVertexFormats.POSITION); + tessellator.getBuffer().pos(0, f1, 0).endVertex(); for(int i = 0; i < totalAngles + 1; i += step) { double rad = (totalAngles - i) * Math.PI / 180.0; double xp = Math.cos(rad) * radius; double zp = Math.sin(rad) * radius; - tessellator.addVertex(xp, f1, zp); + tessellator.getBuffer().pos(xp, f1, zp).endVertex(); } - tessellator.addVertex(0, f1, 0); + tessellator.getBuffer().pos(0, f1, 0).endVertex(); tessellator.draw(); - GL11.glPopMatrix(); + GL11.glColor4ub(((byte) 255), ((byte) 255), ((byte) 255), ((byte) 255)); + GlStateManager.popMatrix(); } } diff --git a/src/main/java/vazkii/botania/client/core/handler/TooltipAdditionDisplayHandler.java b/src/main/java/vazkii/botania/client/core/handler/TooltipAdditionDisplayHandler.java index e7e7b8337..a4ec22c11 100644 --- a/src/main/java/vazkii/botania/client/core/handler/TooltipAdditionDisplayHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/TooltipAdditionDisplayHandler.java @@ -10,26 +10,26 @@ */ package vazkii.botania.client.core.handler; -import java.awt.Color; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.VertexBuffer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; - +import net.minecraft.util.text.TextFormatting; +import net.minecraftforge.client.event.RenderTooltipEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.relauncher.ReflectionHelper; import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; - import vazkii.botania.api.lexicon.ILexicon; import vazkii.botania.api.lexicon.LexiconRecipeMappings; import vazkii.botania.api.lexicon.LexiconRecipeMappings.EntryData; @@ -40,136 +40,114 @@ import vazkii.botania.common.item.ItemLexicon; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.item.equipment.tool.terrasteel.ItemTerraPick; import vazkii.botania.common.lib.LibObfuscation; -import cpw.mods.fml.relauncher.ReflectionHelper; + +import java.awt.*; +import java.util.ArrayList; +import java.util.List; public final class TooltipAdditionDisplayHandler { private static float lexiconLookupTime = 0F; - public static void render() { + @SubscribeEvent + public static void onToolTipRender(RenderTooltipEvent.PostText evt) { + if(evt.getStack() == null) + return; + + ItemStack stack = evt.getStack(); Minecraft mc = Minecraft.getMinecraft(); - GuiScreen gui = mc.currentScreen; - if(gui != null && gui instanceof GuiContainer && mc.thePlayer != null && mc.thePlayer.inventory.getItemStack() == null) { - GuiContainer container = (GuiContainer) gui; - Slot slot = ReflectionHelper.getPrivateValue(GuiContainer.class, container, LibObfuscation.THE_SLOT); - if(slot != null && slot.getHasStack()) { - ItemStack stack = slot.getStack(); - if(stack != null) { - ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - FontRenderer font = mc.fontRenderer; - int mouseX = Mouse.getX() * res.getScaledWidth() / mc.displayWidth; - int mouseY = res.getScaledHeight() - Mouse.getY() * res.getScaledHeight() / mc.displayHeight; + int width = evt.getWidth(); + int height = 3; + int tooltipX = evt.getX(); + int tooltipY = evt.getY() - 4; + FontRenderer font = evt.getFontRenderer(); - List tooltip; - try { - tooltip = stack.getTooltip(mc.thePlayer, mc.gameSettings.advancedItemTooltips); - } catch(Exception e) { - tooltip = new ArrayList(); + if(stack.getItem() instanceof ItemTerraPick) + drawTerraPick(stack, tooltipX, tooltipY, width, height, font); + else if(stack.getItem() instanceof IManaTooltipDisplay) + drawManaBar(stack, (IManaTooltipDisplay) stack.getItem(), tooltipX, tooltipY, width, height); + + EntryData data = LexiconRecipeMappings.getDataForStack(stack); + if(data != null) { + int lexSlot = -1; + ItemStack lexiconStack = null; + + for(int i = 0; i < InventoryPlayer.getHotbarSize(); i++) { + ItemStack stackAt = mc.thePlayer.inventory.getStackInSlot(i); + if(stackAt != null && stackAt.getItem() instanceof ILexicon && ((ILexicon) stackAt.getItem()).isKnowledgeUnlocked(stackAt, data.entry.getKnowledgeType())) { + lexiconStack = stackAt; + lexSlot = i; + break; + } + } + + if(lexSlot > -1) { + int x = tooltipX - 34; + GlStateManager.disableDepth(); + + Gui.drawRect(x - 4, tooltipY - 4, x + 20, tooltipY + 26, 0x44000000); + Gui.drawRect(x - 6, tooltipY - 6, x + 22, tooltipY + 28, 0x44000000); + + if(ConfigHandler.useShiftForQuickLookup ? GuiScreen.isShiftKeyDown() : GuiScreen.isCtrlKeyDown()) { + lexiconLookupTime += ClientTickHandler.delta; + + int cx = x + 8; + int cy = tooltipY + 8; + float r = 12; + float time = 20F; + float angles = lexiconLookupTime / time * 360F; + + GlStateManager.disableLighting(); + GlStateManager.disableTexture2D(); + GlStateManager.shadeModel(GL11.GL_SMOOTH); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + + VertexBuffer buf = Tessellator.getInstance().getBuffer(); + buf.begin(GL11.GL_TRIANGLE_FAN, DefaultVertexFormats.POSITION_COLOR); + + float a = 0.5F + 0.2F * ((float) Math.cos((double) (ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks) / 10) * 0.5F + 0.5F); + buf.pos(cx, cy, 0).color(0F, 0.5F, 0F, a).endVertex(); + + for(float i = angles; i > 0; i--) { + double rad = (i - 90) / 180F * Math.PI; + buf.pos(cx + Math.cos(rad) * r, cy + Math.sin(rad) * r, 0).color(0F, 1F, 0F, 1F).endVertex(); } - int width = 0; - for(String s : tooltip) - width = Math.max(width, font.getStringWidth(s) + 2); - int tooltipHeight = (tooltip.size() - 1) * 10 + 5; - int height = 3; - int offx = 11; - int offy = 17; + buf.pos(cx, cy, 0).color(0F, 1F, 0F, 0F).endVertex(); + Tessellator.getInstance().draw(); - boolean offscreen = mouseX + width + 19 >= res.getScaledWidth(); + GlStateManager.disableBlend(); + GlStateManager.enableTexture2D(); + GlStateManager.shadeModel(GL11.GL_FLAT); - int fixY = res.getScaledHeight() - (mouseY + tooltipHeight); - if(fixY < 0) - offy -= fixY; - if(offscreen) - offx = -13 - width; + if(lexiconLookupTime >= time) { + mc.thePlayer.inventory.currentItem = lexSlot; + Botania.proxy.setEntryToOpen(data.entry); + Botania.proxy.setLexiconStack(lexiconStack); + mc.thePlayer.closeScreen(); + ItemLexicon.openBook(mc.thePlayer, lexiconStack, mc.theWorld, false); - if(stack.getItem() instanceof ItemTerraPick) - drawTerraPick(stack, mouseX, mouseY, offx, offy, width, height, font); - else if(stack.getItem() instanceof IManaTooltipDisplay) - drawManaBar(stack, (IManaTooltipDisplay) stack.getItem(), mouseX, mouseY, offx, offy, width, height); - - EntryData data = LexiconRecipeMappings.getDataForStack(stack); - if(data != null) { - int lexSlot = -1; - ItemStack lexiconStack = null; - - for(int i = 0; i < InventoryPlayer.getHotbarSize(); i++) { - ItemStack stackAt = mc.thePlayer.inventory.getStackInSlot(i); - if(stackAt != null && stackAt.getItem() instanceof ILexicon && ((ILexicon) stackAt.getItem()).isKnowledgeUnlocked(stackAt, data.entry.getKnowledgeType())) { - lexiconStack = stackAt; - lexSlot = i; - break; - } - } - - if(lexSlot > -1) { - int x = mouseX + offx - 34; - int y = mouseY - offy; - GL11.glDisable(GL11.GL_DEPTH_TEST); - - Gui.drawRect(x - 4, y - 4, x + 20, y + 26, 0x44000000); - Gui.drawRect(x - 6, y - 6, x + 22, y + 28, 0x44000000); - - if(ConfigHandler.useShiftForQuickLookup ? GuiScreen.isShiftKeyDown() : GuiScreen.isCtrlKeyDown()) { - lexiconLookupTime += ClientTickHandler.delta; - - int cx = x + 8; - int cy = y + 8; - float r = 12; - float time = 20F; - float angles = lexiconLookupTime / time * 360F; - - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_TEXTURE_2D); - GL11.glShadeModel(GL11.GL_SMOOTH); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glBegin(GL11.GL_TRIANGLE_FAN); - - float a = 0.5F + 0.2F * ((float) Math.cos((double) (ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks) / 10) * 0.5F + 0.5F); - GL11.glColor4f(0F, 0.5F, 0F, a); - GL11.glVertex2i(cx, cy); - GL11.glColor4f(0F, 1F, 0F, 1F); - - for(float i = angles; i > 0; i--) { - double rad = (i - 90) / 180F * Math.PI; - GL11.glVertex2d(cx + Math.cos(rad) * r, cy + Math.sin(rad) * r); - } - GL11.glVertex2i(cx, cy); - GL11.glEnd(); - - GL11.glDisable(GL11.GL_BLEND); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glShadeModel(GL11.GL_FLAT); - - if(lexiconLookupTime >= time) { - mc.thePlayer.inventory.currentItem = lexSlot; - Botania.proxy.setEntryToOpen(data.entry); - Botania.proxy.setLexiconStack(lexiconStack); - mc.thePlayer.closeScreen(); - ItemLexicon.openBook(mc.thePlayer, lexiconStack, mc.theWorld, false); - - } - } else lexiconLookupTime = 0F; - - RenderItem.getInstance().renderItemIntoGUI(mc.fontRenderer, mc.renderEngine, new ItemStack(ModItems.lexicon), x, y); - GL11.glDisable(GL11.GL_LIGHTING); - - font.drawStringWithShadow("?", x + 10, y + 8, 0xFFFFFFFF); - GL11.glScalef(0.5F, 0.5F, 1F); - boolean mac = Minecraft.isRunningOnMac; - mc.fontRenderer.drawStringWithShadow(EnumChatFormatting.BOLD + (ConfigHandler.useShiftForQuickLookup ? "Shift" : mac ? "Cmd" : "Ctrl"), (x + 10) * 2 - 16, (y + 8) * 2 + 20, 0xFFFFFFFF); - GL11.glScalef(2F, 2F, 1F); - - GL11.glEnable(GL11.GL_DEPTH_TEST); - } else lexiconLookupTime = 0F; - } else lexiconLookupTime = 0F; + } } else lexiconLookupTime = 0F; + + mc.getRenderItem().renderItemIntoGUI(new ItemStack(ModItems.lexicon), x, tooltipY); + GlStateManager.disableLighting(); + + font.drawStringWithShadow("?", x + 10, tooltipY + 8, 0xFFFFFFFF); + GlStateManager.scale(0.5F, 0.5F, 1F); + boolean mac = Minecraft.IS_RUNNING_ON_MAC; + + mc.fontRendererObj.drawStringWithShadow(TextFormatting.BOLD + (ConfigHandler.useShiftForQuickLookup ? "Shift" : mac ? "Cmd" : "Ctrl"), (x + 10) * 2 - 16, (tooltipY + 8) * 2 + 20, 0xFFFFFFFF); + GlStateManager.scale(2F, 2F, 1F); + + + GlStateManager.enableDepth(); } else lexiconLookupTime = 0F; } else lexiconLookupTime = 0F; } - private static void drawTerraPick(ItemStack stack, int mouseX, int mouseY, int offx, int offy, int width, int height, FontRenderer font) { + private static void drawTerraPick(ItemStack stack, int mouseX, int mouseY, int width, int height, FontRenderer font) { int level = ItemTerraPick.getLevel(stack); int max = ItemTerraPick.LEVELS[Math.min(ItemTerraPick.LEVELS.length - 1, level + 1)]; boolean ss = level >= ItemTerraPick.LEVELS.length - 1; @@ -179,32 +157,34 @@ public final class TooltipAdditionDisplayHandler { float huePer = width == 0 ? 0F : 1F / width; float hueOff = (ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks) * 0.01F; - GL11.glDisable(GL11.GL_DEPTH_TEST); - Gui.drawRect(mouseX + offx - 1, mouseY - offy - height - 1, mouseX + offx + width + 1, mouseY - offy, 0xFF000000); + GlStateManager.disableDepth(); + Gui.drawRect(mouseX - 1, mouseY - height - 1, mouseX + width + 1, mouseY, 0xFF000000); for(int i = 0; i < rainbowWidth; i++) - Gui.drawRect(mouseX + offx + i, mouseY - offy - height, mouseX + offx + i + 1, mouseY - offy, Color.HSBtoRGB(hueOff + huePer * i, 1F, 1F)); - Gui.drawRect(mouseX + offx + rainbowWidth, mouseY - offy - height, mouseX + offx + width, mouseY - offy, 0xFF555555); + Gui.drawRect(mouseX + i, mouseY - height, mouseX + i + 1, mouseY, Color.HSBtoRGB(hueOff + huePer * i, 1F, 1F)); + Gui.drawRect(mouseX + rainbowWidth, mouseY - height, mouseX + width, mouseY, 0xFF555555); - String rank = StatCollector.translateToLocal("botania.rank" + level).replaceAll("&", "\u00a7"); - GL11.glPushAttrib(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_LIGHTING); - font.drawStringWithShadow(rank, mouseX + offx, mouseY - offy - 12, 0xFFFFFF); + String rank = I18n.format("botania.rank" + level).replaceAll("&", "\u00a7"); + + GL11.glPushAttrib(GL11.GL_LIGHTING_BIT); + GlStateManager.disableLighting(); + font.drawStringWithShadow(rank, mouseX, mouseY - 12, 0xFFFFFF); if(!ss) { - rank = StatCollector.translateToLocal("botania.rank" + (level + 1)).replaceAll("&", "\u00a7"); - font.drawStringWithShadow(rank, mouseX + offx + width - font.getStringWidth(rank), mouseY - offy - 12, 0xFFFFFF); + rank = I18n.format("botania.rank" + (level + 1)).replaceAll("&", "\u00a7"); + font.drawStringWithShadow(rank, mouseX + width - font.getStringWidth(rank), mouseY - 12, 0xFFFFFF); } - GL11.glEnable(GL11.GL_DEPTH_TEST); + GlStateManager.enableLighting(); + GlStateManager.enableDepth(); GL11.glPopAttrib(); } - private static void drawManaBar(ItemStack stack, IManaTooltipDisplay display, int mouseX, int mouseY, int offx, int offy, int width, int height) { + private static void drawManaBar(ItemStack stack, IManaTooltipDisplay display, int mouseX, int mouseY, int width, int height) { float fraction = display.getManaFractionForDisplay(stack); int manaBarWidth = (int) Math.ceil(width * fraction); - GL11.glDisable(GL11.GL_DEPTH_TEST); - Gui.drawRect(mouseX + offx - 1, mouseY - offy - height - 1, mouseX + offx + width + 1, mouseY - offy, 0xFF000000); - Gui.drawRect(mouseX + offx, mouseY - offy - height, mouseX + offx + manaBarWidth, mouseY - offy, Color.HSBtoRGB(0.528F, ((float) Math.sin((ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks) * 0.2) + 1F) * 0.3F + 0.4F, 1F)); - Gui.drawRect(mouseX + offx + manaBarWidth, mouseY - offy - height, mouseX + offx + width, mouseY - offy, 0xFF555555); + GlStateManager.disableDepth(); + Gui.drawRect(mouseX - 1, mouseY - height - 1, mouseX + width + 1, mouseY, 0xFF000000); + Gui.drawRect(mouseX, mouseY - height, mouseX + manaBarWidth, mouseY, Color.HSBtoRGB(0.528F, ((float) Math.sin((ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks) * 0.2) + 1F) * 0.3F + 0.4F, 1F)); + Gui.drawRect(mouseX + manaBarWidth, mouseY - height, mouseX + width, mouseY, 0xFF555555); } } diff --git a/src/main/java/vazkii/botania/client/core/handler/TooltipHandler.java b/src/main/java/vazkii/botania/client/core/handler/TooltipHandler.java index 6d1ae432e..8394b13ed 100644 --- a/src/main/java/vazkii/botania/client/core/handler/TooltipHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/TooltipHandler.java @@ -10,30 +10,24 @@ */ package vazkii.botania.client.core.handler; +import net.minecraft.client.resources.I18n; import net.minecraft.init.Blocks; import net.minecraft.item.Item; -import net.minecraft.util.StatCollector; import net.minecraftforge.event.entity.player.ItemTooltipEvent; +import net.minecraftforge.fml.common.eventhandler.EventPriority; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.item.ItemKeepIvy; import vazkii.botania.common.item.ItemRegenIvy; -import cpw.mods.fml.common.eventhandler.EventPriority; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; public final class TooltipHandler { @SubscribeEvent(priority = EventPriority.HIGHEST) - public void onTooltipEvent(ItemTooltipEvent event) { - if(event.itemStack.getItem() == Item.getItemFromBlock(Blocks.dirt) && event.itemStack.getItemDamage() == 1) { - event.toolTip.add(StatCollector.translateToLocal("botaniamisc.coarseDirt0")); - event.toolTip.add(StatCollector.translateToLocal("botaniamisc.coarseDirt1")); - } else if(event.itemStack.getItem() == Item.getItemFromBlock(Blocks.mob_spawner) && event.entityPlayer.capabilities.isCreativeMode) - event.toolTip.add(StatCollector.translateToLocal("botaniamisc.spawnerTip")); - - if(ItemNBTHelper.detectNBT(event.itemStack) && ItemNBTHelper.getBoolean(event.itemStack, ItemRegenIvy.TAG_REGEN, false)) - event.toolTip.add(StatCollector.translateToLocal("botaniamisc.hasIvy")); - if(ItemNBTHelper.detectNBT(event.itemStack) && ItemNBTHelper.getBoolean(event.itemStack, ItemKeepIvy.TAG_KEEP, false)) - event.toolTip.add(StatCollector.translateToLocal("botaniamisc.hasKeepIvy")); + public static void onTooltipEvent(ItemTooltipEvent event) { + if(ItemNBTHelper.detectNBT(event.getItemStack()) && ItemNBTHelper.getBoolean(event.getItemStack(), ItemRegenIvy.TAG_REGEN, false)) + event.getToolTip().add(I18n.format("botaniamisc.hasIvy")); + if(ItemNBTHelper.detectNBT(event.getItemStack()) && ItemNBTHelper.getBoolean(event.getItemStack(), ItemKeepIvy.TAG_KEEP, false)) + event.getToolTip().add(I18n.format("botaniamisc.hasKeepIvy")); } } diff --git a/src/main/java/vazkii/botania/client/core/helper/FontHelper.java b/src/main/java/vazkii/botania/client/core/helper/FontHelper.java index e1f5ed5c0..49ce8994d 100644 --- a/src/main/java/vazkii/botania/client/core/helper/FontHelper.java +++ b/src/main/java/vazkii/botania/client/core/helper/FontHelper.java @@ -12,12 +12,12 @@ package vazkii.botania.client.core.helper; public final class FontHelper { - public static boolean isFormatColor(char par0) { - return par0 >= 48 && par0 <= 57 || par0 >= 97 && par0 <= 102 || par0 >= 65 && par0 <= 70; + private static boolean isFormatColor(char par0) { + return par0 >= '0' && par0 <= '9' || par0 >= 'a' && par0 <= 'f' || par0 >= 'A' && par0 <= 'F'; } - public static boolean isFormatSpecial(char par0) { - return par0 >= 107 && par0 <= 111 || par0 >= 75 && par0 <= 79 || par0 == 114 || par0 == 82; + private static boolean isFormatSpecial(char par0) { + return par0 >= 'k' && par0 <= 'o' || par0 >= 'K' && par0 <= 'O' || par0 == 'r' || par0 == 'R'; } public static String getFormatFromString(String par0Str) { @@ -25,7 +25,7 @@ public final class FontHelper { int i = -1; int j = par0Str.length(); - while ((i = par0Str.indexOf(167, i + 1)) != -1) { + while ((i = par0Str.indexOf('w', i + 1)) != -1) { if (i < j - 1) { char c0 = par0Str.charAt(i + 1); diff --git a/src/main/java/vazkii/botania/client/core/helper/IconHelper.java b/src/main/java/vazkii/botania/client/core/helper/IconHelper.java index bf3c2304b..6892e9caa 100644 --- a/src/main/java/vazkii/botania/client/core/helper/IconHelper.java +++ b/src/main/java/vazkii/botania/client/core/helper/IconHelper.java @@ -10,52 +10,104 @@ */ package vazkii.botania.client.core.helper; -import net.minecraft.block.Block; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.item.Item; -import net.minecraft.util.IIcon; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.VertexBuffer; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; import vazkii.botania.client.lib.LibResources; public final class IconHelper { - public static IIcon forName(IIconRegister ir, String name) { - return ir.registerIcon(LibResources.PREFIX_MOD + name); + public static TextureAtlasSprite forName(TextureMap ir, String name) { + return ir.registerSprite(new ResourceLocation(LibResources.PREFIX_MOD + name)); } - public static IIcon forName(IIconRegister ir, String name, String dir) { - return ir.registerIcon(LibResources.PREFIX_MOD + dir + "/" + name); + public static TextureAtlasSprite forName(TextureMap ir, String name, String dir) { + return ir.registerSprite(new ResourceLocation(LibResources.PREFIX_MOD + dir + "/" + name)); } - public static IIcon forBlock(IIconRegister ir, Block block) { - return forName(ir, block.getUnlocalizedName().replaceAll("tile\\.", "")); - } + /** + * Renders a sprite from the spritesheet with depth, like a "builtin/generated" item model. + * Adapted from ItemRenderer.renderItemIn2D, 1.7.10 + */ + public static void renderIconIn3D(Tessellator tess, float p_78439_1_, float p_78439_2_, float p_78439_3_, float p_78439_4_, int width, int height, float thickness) { + VertexBuffer wr = tess.getBuffer(); + wr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_NORMAL); + wr.pos(0.0D, 0.0D, 0.0D).tex(p_78439_1_, p_78439_4_).normal(0, 0, 1).endVertex(); + wr.pos(1.0D, 0.0D, 0.0D).tex(p_78439_3_, p_78439_4_).normal(0, 0, 1).endVertex(); + wr.pos(1.0D, 1.0D, 0.0D).tex(p_78439_3_, p_78439_2_).normal(0, 0, 1).endVertex(); + wr.pos(0.0D, 1.0D, 0.0D).tex(p_78439_1_, p_78439_2_).normal(0, 0, 1).endVertex(); + tess.draw(); + wr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_NORMAL); + wr.pos(0.0D, 1.0D, (0.0F - thickness)).tex(p_78439_1_, p_78439_2_).normal(0, 0, -1).endVertex(); + wr.pos(1.0D, 1.0D, (0.0F - thickness)).tex(p_78439_3_, p_78439_2_).normal(0, 0, -1).endVertex(); + wr.pos(1.0D, 0.0D, (0.0F - thickness)).tex(p_78439_3_, p_78439_4_).normal(0, 0, -1).endVertex(); + wr.pos(0.0D, 0.0D, (0.0F - thickness)).tex(p_78439_1_, p_78439_4_).normal(0, 0, -1).endVertex(); + tess.draw(); + float f5 = 0.5F * (p_78439_1_ - p_78439_3_) / (float)width; + float f6 = 0.5F * (p_78439_4_ - p_78439_2_) / (float)height; + wr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_NORMAL); + int k; + float f7; + float f8; - public static IIcon forBlock(IIconRegister ir, Block block, int i) { - return forBlock(ir, block, Integer.toString(i)); - } + for (k = 0; k < width; ++k) + { + f7 = (float)k / (float)width; + f8 = p_78439_1_ + (p_78439_3_ - p_78439_1_) * f7 - f5; + wr.pos(f7, 0.0D, (0.0F - thickness)).tex(f8, p_78439_4_).normal(-1, 0, 0).endVertex(); + wr.pos(f7, 0.0D, 0.0D).tex(f8, p_78439_4_).normal(-1, 0, 0).endVertex(); + wr.pos(f7, 1.0D, 0.0D).tex(f8, p_78439_2_).normal(-1, 0, 0).endVertex(); + wr.pos(f7, 1.0D, (0.0F - thickness)).tex(f8, p_78439_2_).normal(-1, 0, 0).endVertex(); + } - public static IIcon forBlock(IIconRegister ir, Block block, int i, String dir) { - return forBlock(ir, block, Integer.toString(i), dir); - } + tess.draw(); + wr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_NORMAL); + float f9; - public static IIcon forBlock(IIconRegister ir, Block block, String s) { - return forName(ir, block.getUnlocalizedName().replaceAll("tile\\.", "") + s); - } + for (k = 0; k < width; ++k) + { + f7 = (float)k / (float)width; + f8 = p_78439_1_ + (p_78439_3_ - p_78439_1_) * f7 - f5; + f9 = f7 + 1.0F / (float)width; + wr.pos(f9, 1.0D, (0.0F - thickness)).tex(f8, p_78439_2_).normal(1, 0, 0).endVertex(); + wr.pos(f9, 1.0D, 0.0D).tex(f8, p_78439_2_).normal(1, 0, 0).endVertex(); + wr.pos(f9, 0.0D, 0.0D).tex(f8, p_78439_4_).normal(1, 0, 0).endVertex(); + wr.pos(f9, 0.0D, (0.0F - thickness)).tex(f8, p_78439_4_).normal(1, 0, 0).endVertex(); + } - public static IIcon forBlock(IIconRegister ir, Block block, String s, String dir) { - return forName(ir, block.getUnlocalizedName().replaceAll("tile\\.", "") + s, dir); - } + tess.draw(); + wr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_NORMAL); - public static IIcon forItem(IIconRegister ir, Item item) { - return forName(ir, item.getUnlocalizedName().replaceAll("item\\.", "")); - } + for (k = 0; k < height; ++k) + { + f7 = (float)k / (float)height; + f8 = p_78439_4_ + (p_78439_2_ - p_78439_4_) * f7 - f6; + f9 = f7 + 1.0F / (float)height; + wr.pos(0.0D, f9, 0.0D).tex(p_78439_1_, f8).normal(0, 1, 0).endVertex(); + wr.pos(1.0D, f9, 0.0D).tex(p_78439_3_, f8).normal(0, 1, 0).endVertex(); + wr.pos(1.0D, f9, (0.0F - thickness)).tex(p_78439_3_, f8).normal(0, 1, 0).endVertex(); + wr.pos(0.0D, f9, (0.0F - thickness)).tex(p_78439_1_, f8).normal(0, 1, 0).endVertex(); + } - public static IIcon forItem(IIconRegister ir, Item item, int i) { - return forItem(ir, item, Integer.toString(i)); - } + tess.draw(); + wr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_NORMAL); + + for (k = 0; k < height; ++k) + { + f7 = (float)k / (float)height; + f8 = p_78439_4_ + (p_78439_2_ - p_78439_4_) * f7 - f6; + wr.pos(1.0D, f7, 0.0D).tex(p_78439_3_, f8).normal(0, -1, 0).endVertex(); + wr.pos(0.0D, f7, 0.0D).tex(p_78439_1_, f8).normal(0, -1, 0).endVertex(); + wr.pos(0.0D, f7, (0.0F - thickness)).tex(p_78439_1_, f8).normal(0, -1, 0).endVertex(); + wr.pos(1.0D, f7, (0.0F - thickness)).tex(p_78439_3_, f8).normal(0, -1, 0).endVertex(); + } + + tess.draw(); - public static IIcon forItem(IIconRegister ir, Item item, String s) { - return forName(ir, item.getUnlocalizedName().replaceAll("item\\.", "") + s); } } \ No newline at end of file diff --git a/src/main/java/vazkii/botania/client/core/helper/RenderHelper.java b/src/main/java/vazkii/botania/client/core/helper/RenderHelper.java index ff177cbd1..3db962e08 100644 --- a/src/main/java/vazkii/botania/client/core/helper/RenderHelper.java +++ b/src/main/java/vazkii/botania/client/core/helper/RenderHelper.java @@ -10,23 +10,23 @@ */ package vazkii.botania.client.core.helper; -import java.util.List; -import java.util.Random; - import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.VertexBuffer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.client.settings.KeyBinding; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; - import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.GL11; - import vazkii.botania.client.core.handler.ClientTickHandler; import vazkii.botania.client.lib.LibResources; +import java.util.List; +import java.util.Random; + public final class RenderHelper { public static void renderTooltip(int x, int y, List tooltipData) { @@ -59,7 +59,7 @@ public final class RenderHelper { int var5 = 0; int var6; int var7; - FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer; + FontRenderer fontRenderer = Minecraft.getMinecraft().fontRendererObj; for (var6 = 0; var6 < tooltipData.size(); ++var6) { var7 = fontRenderer.getStringWidth(tooltipData.get(var6)); if (var7 > var5) @@ -82,7 +82,7 @@ public final class RenderHelper { drawGradientRect(var6 - 3, var7 - 3, z, var6 + var5 + 3, var7 - 3 + 1, color, color); drawGradientRect(var6 - 3, var7 + var9 + 2, z, var6 + var5 + 3, var7 + var9 + 3, var12, var12); - GL11.glDisable(GL11.GL_DEPTH_TEST); + GlStateManager.disableDepth(); for (int var13 = 0; var13 < tooltipData.size(); ++var13) { String var14 = tooltipData.get(var13); fontRenderer.drawStringWithShadow(var14, var6, var7, -1); @@ -90,11 +90,11 @@ public final class RenderHelper { var7 += 2; var7 += 10; } - GL11.glEnable(GL11.GL_DEPTH_TEST); + GlStateManager.enableDepth(); } if(!lighting) net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting(); - GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.color(1F, 1F, 1F, 1F); } public static void drawGradientRect(int par1, int par2, float z, int par3, int par4, int par5, int par6) { @@ -106,24 +106,22 @@ public final class RenderHelper { float var12 = (par6 >> 16 & 255) / 255F; float var13 = (par6 >> 8 & 255) / 255F; float var14 = (par6 & 255) / 255F; - GL11.glDisable(GL11.GL_TEXTURE_2D); - GL11.glEnable(GL11.GL_BLEND); - GL11.glDisable(GL11.GL_ALPHA_TEST); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glShadeModel(GL11.GL_SMOOTH); - Tessellator var15 = Tessellator.instance; - var15.startDrawingQuads(); - var15.setColorRGBA_F(var8, var9, var10, var7); - var15.addVertex(par3, par2, z); - var15.addVertex(par1, par2, z); - var15.setColorRGBA_F(var12, var13, var14, var11); - var15.addVertex(par1, par4, z); - var15.addVertex(par3, par4, z); + GlStateManager.disableTexture2D(); + GlStateManager.enableBlend(); + GlStateManager.disableAlpha(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.shadeModel(GL11.GL_SMOOTH); + Tessellator var15 = Tessellator.getInstance(); + var15.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_COLOR); + var15.getBuffer().pos(par3, par2, z).color(var8, var9, var10, var7).endVertex(); + var15.getBuffer().pos(par1, par2, z).color(var8, var9, var10, var7).endVertex(); + var15.getBuffer().pos(par1, par4, z).color(var12, var13, var14, var11).endVertex(); + var15.getBuffer().pos(par3, par4, z).color(var12, var13, var14, var11).endVertex(); var15.draw(); - GL11.glShadeModel(GL11.GL_FLAT); - GL11.glDisable(GL11.GL_BLEND); - GL11.glEnable(GL11.GL_ALPHA_TEST); - GL11.glEnable(GL11.GL_TEXTURE_2D); + GlStateManager.shadeModel(GL11.GL_FLAT); + GlStateManager.disableBlend(); + GlStateManager.enableAlpha(); + GlStateManager.enableTexture2D(); } public static void drawTexturedModalRect(int par1, int par2, float z, int par3, int par4, int par5, int par6) { @@ -131,17 +129,17 @@ public final class RenderHelper { } public static void drawTexturedModalRect(int par1, int par2, float z, int par3, int par4, int par5, int par6, float f, float f1) { - Tessellator tessellator = Tessellator.instance; - tessellator.startDrawingQuads(); - tessellator.addVertexWithUV(par1 + 0, par2 + par6, z, (par3 + 0) * f, (par4 + par6) * f1); - tessellator.addVertexWithUV(par1 + par5, par2 + par6, z, (par3 + par5) * f, (par4 + par6) * f1); - tessellator.addVertexWithUV(par1 + par5, par2 + 0, z, (par3 + par5) * f, (par4 + 0) * f1); - tessellator.addVertexWithUV(par1 + 0, par2 + 0, z, (par3 + 0) * f, (par4 + 0) * f1); + Tessellator tessellator = Tessellator.getInstance(); + tessellator.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); + tessellator.getBuffer().pos(par1, par2 + par6, z).tex((par3) * f, (par4 + par6) * f1).endVertex(); + tessellator.getBuffer().pos(par1 + par5, par2 + par6, z).tex((par3 + par5) * f, (par4 + par6) * f1).endVertex(); + tessellator.getBuffer().pos(par1 + par5, par2, z).tex((par3 + par5) * f, (par4) * f1).endVertex(); + tessellator.getBuffer().pos(par1, par2, z).tex((par3) * f, (par4) * f1).endVertex(); tessellator.draw(); } public static void renderStar(int color, float xScale, float yScale, float zScale, long seed) { - Tessellator tessellator = Tessellator.instance; + Tessellator tessellator = Tessellator.getInstance(); int ticks = ClientTickHandler.ticksInGame % 200; if (ticks >= 100) @@ -153,58 +151,59 @@ public final class RenderHelper { f2 = (f1 - 0.7F) / 0.2F; Random random = new Random(seed); - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_TEXTURE_2D); - GL11.glShadeModel(GL11.GL_SMOOTH); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(770, 1); - GL11.glDisable(GL11.GL_ALPHA_TEST); - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glDepthMask(false); - GL11.glScalef(xScale, yScale, zScale); + GlStateManager.pushMatrix(); + GlStateManager.disableTexture2D(); + GlStateManager.shadeModel(GL11.GL_SMOOTH); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); + GlStateManager.disableAlpha(); + GlStateManager.enableCull(); + GlStateManager.depthMask(false); + GlStateManager.scale(xScale, yScale, zScale); for (int i = 0; i < (f1 + f1 * f1) / 2F * 90F + 30F; i++) { - GL11.glRotatef(random.nextFloat() * 360F, 1F, 0F, 0F); - GL11.glRotatef(random.nextFloat() * 360F, 0F, 1F, 0F); - GL11.glRotatef(random.nextFloat() * 360F, 0F, 0F, 1F); - GL11.glRotatef(random.nextFloat() * 360F, 1F, 0F, 0F); - GL11.glRotatef(random.nextFloat() * 360F, 0F, 1F, 0F); - GL11.glRotatef(random.nextFloat() * 360F + f1 * 90F, 0F, 0F, 1F); - tessellator.startDrawing(GL11.GL_TRIANGLE_FAN); + GlStateManager.rotate(random.nextFloat() * 360F, 1F, 0F, 0F); + GlStateManager.rotate(random.nextFloat() * 360F, 0F, 1F, 0F); + GlStateManager.rotate(random.nextFloat() * 360F, 0F, 0F, 1F); + GlStateManager.rotate(random.nextFloat() * 360F, 1F, 0F, 0F); + GlStateManager.rotate(random.nextFloat() * 360F, 0F, 1F, 0F); + GlStateManager.rotate(random.nextFloat() * 360F + f1 * 90F, 0F, 0F, 1F); + tessellator.getBuffer().begin(GL11.GL_TRIANGLE_FAN, DefaultVertexFormats.POSITION_COLOR); float f3 = random.nextFloat() * 20F + 5F + f2 * 10F; float f4 = random.nextFloat() * 2F + 1F + f2 * 2F; - tessellator.setColorRGBA_I(color, (int) (255F * (1F - f2))); - tessellator.addVertex(0, 0, 0); - tessellator.setColorRGBA_F(0F, 0F, 0F, 0); - tessellator.addVertex(-0.866D * f4, f3, -0.5F * f4); - tessellator.addVertex(0.866D * f4, f3, -0.5F * f4); - tessellator.addVertex(0, f3, 1F * f4); - tessellator.addVertex(-0.866D * f4, f3, -0.5F * f4); + float r = ((color & 0xFF0000) >> 16) / 255F; + float g = ((color & 0xFF00) >> 8) / 255F; + float b = (color & 0xFF) / 255F; + tessellator.getBuffer().pos(0, 0, 0).color(r, g, b, 1F - f2).endVertex(); + tessellator.getBuffer().pos(-0.866D * f4, f3, -0.5F * f4).color(0, 0, 0, 0).endVertex(); + tessellator.getBuffer().pos(0.866D * f4, f3, -0.5F * f4).color(0, 0, 0, 0).endVertex(); + tessellator.getBuffer().pos(0, f3, 1F * f4).color(0, 0, 0, 0).endVertex(); + tessellator.getBuffer().pos(-0.866D * f4, f3, -0.5F * f4).color(0, 0, 0, 0).endVertex(); tessellator.draw(); } - GL11.glDepthMask(true); - GL11.glDisable(GL11.GL_CULL_FACE); - GL11.glDisable(GL11.GL_BLEND); - GL11.glShadeModel(GL11.GL_FLAT); - GL11.glColor4f(1F, 1F, 1F, 1F); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glEnable(GL11.GL_ALPHA_TEST); - GL11.glPopMatrix(); + GlStateManager.depthMask(true); + GlStateManager.disableCull(); + GlStateManager.disableBlend(); + GlStateManager.shadeModel(GL11.GL_FLAT); + GlStateManager.color(1F, 1F, 1F, 1F); + GlStateManager.enableTexture2D(); + GlStateManager.enableAlpha(); + GlStateManager.popMatrix(); } public static void renderProgressPie(int x, int y, float progress, ItemStack stack) { Minecraft mc = Minecraft.getMinecraft(); - RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, stack, x, y); + mc.getRenderItem().renderItemAndEffectIntoGUI(stack, x, y); - GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); + GlStateManager.clear(GL11.GL_DEPTH_BUFFER_BIT); GL11.glEnable(GL11.GL_STENCIL_TEST); - GL11.glColorMask(false, false, false, false); - GL11.glDepthMask(false); + GlStateManager.colorMask(false, false, false, false); + GlStateManager.depthMask(false); GL11.glStencilFunc(GL11.GL_NEVER, 1, 0xFF); GL11.glStencilOp(GL11.GL_REPLACE, GL11.GL_KEEP, GL11.GL_KEEP); GL11.glStencilMask(0xFF); - RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, stack, x, y); + mc.getRenderItem().renderItemAndEffectIntoGUI(stack, x, y); mc.renderEngine.bindTexture(new ResourceLocation(LibResources.GUI_MANA_HUD)); int r = 10; @@ -213,28 +212,31 @@ public final class RenderHelper { int degs = (int) (360 * progress); float a = 0.5F + 0.2F * ((float) Math.cos((double) (ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks) / 10) * 0.5F + 0.5F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_TEXTURE_2D); - GL11.glShadeModel(GL11.GL_SMOOTH); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColorMask(true, true, true, true); - GL11.glDepthMask(true); + GlStateManager.disableLighting(); + GlStateManager.disableTexture2D(); + GlStateManager.shadeModel(GL11.GL_SMOOTH); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.colorMask(true, true, true, true); + GlStateManager.depthMask(true); GL11.glStencilMask(0x00); GL11.glStencilFunc(GL11.GL_EQUAL, 1, 0xFF); - GL11.glBegin(GL11.GL_TRIANGLE_FAN); - GL11.glColor4f(0F, 0.5F, 0.5F, a); - GL11.glVertex2i(centerX, centerY); - GL11.glColor4f(0F, 1F, 0.5F, a); + + VertexBuffer buf = Tessellator.getInstance().getBuffer(); + buf.begin(GL11.GL_TRIANGLE_FAN, DefaultVertexFormats.POSITION_COLOR); + buf.pos(centerX, centerY, 0).color(0, 0.5F, 0.5F, a).endVertex(); + for(int i = degs; i > 0; i--) { double rad = (i - 90) / 180F * Math.PI; - GL11.glVertex2d(centerX + Math.cos(rad) * r, centerY + Math.sin(rad) * r); + buf.pos(centerX + Math.cos(rad) * r, centerY + Math.sin(rad) * r, 0).color(0F, 1F, 0.5F, a).endVertex(); } - GL11.glVertex2i(centerX, centerY); - GL11.glEnd(); - GL11.glDisable(GL11.GL_BLEND); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glShadeModel(GL11.GL_FLAT); + + buf.pos(centerX, centerY, 0).color(0F, 1F, 0.5F, a).endVertex(); + Tessellator.getInstance().draw(); + + GlStateManager.disableBlend(); + GlStateManager.enableTexture2D(); + GlStateManager.shadeModel(GL11.GL_FLAT); GL11.glDisable(GL11.GL_STENCIL_TEST); } @@ -243,7 +245,7 @@ public final class RenderHelper { KeyBinding[] keys = Minecraft.getMinecraft().gameSettings.keyBindings; for(KeyBinding otherKey : keys) if(otherKey.getKeyDescription().equals(keyName)) { - key = Keyboard.getKeyName(otherKey.getKeyCode()); + key = otherKey.getDisplayName(); break; } diff --git a/src/main/java/vazkii/botania/client/core/helper/ShaderHelper.java b/src/main/java/vazkii/botania/client/core/helper/ShaderHelper.java index 1923a011b..309749722 100644 --- a/src/main/java/vazkii/botania/client/core/helper/ShaderHelper.java +++ b/src/main/java/vazkii/botania/client/core/helper/ShaderHelper.java @@ -10,23 +10,21 @@ */ package vazkii.botania.client.core.helper; -import java.io.BufferedReader; -import java.io.InputStream; -import java.io.InputStreamReader; - import net.minecraft.client.renderer.OpenGlHelper; - -import org.apache.logging.log4j.Level; import org.lwjgl.opengl.ARBFragmentShader; import org.lwjgl.opengl.ARBShaderObjects; import org.lwjgl.opengl.ARBVertexShader; import org.lwjgl.opengl.GL11; - import vazkii.botania.api.internal.ShaderCallback; import vazkii.botania.client.core.handler.ClientTickHandler; import vazkii.botania.client.lib.LibResources; +import vazkii.botania.common.Botania; import vazkii.botania.common.core.handler.ConfigHandler; -import cpw.mods.fml.common.FMLLog; + +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.stream.Collectors; public final class ShaderHelper { @@ -43,6 +41,7 @@ public final class ShaderHelper { public static int filmGrain = 0; public static int gold = 0; public static int categoryButton = 0; + public static int alpha = 0; public static void initShaders() { if(!useShaders()) @@ -58,6 +57,7 @@ public final class ShaderHelper { filmGrain = createProgram(null, LibResources.SHADER_FILM_GRAIN_FRAG); gold = createProgram(null, LibResources.SHADER_GOLD_FRAG); categoryButton = createProgram(null, LibResources.SHADER_CATEGORY_BUTTON_FRAG); + alpha = createProgram(LibResources.SHADER_ALPHA_VERT, LibResources.SHADER_ALPHA_FRAG); } public static void useShader(int shader, ShaderCallback callback) { @@ -91,7 +91,7 @@ public final class ShaderHelper { // http://lwjgl.org/wiki/index.php?title=GLSL_Shaders_with_LWJGL private static int createProgram(String vert, String frag) { - int vertId = 0, fragId = 0, program = 0; + int vertId = 0, fragId = 0, program; if(vert != null) vertId = createShader(vert, VERT); if(frag != null) @@ -108,13 +108,13 @@ public final class ShaderHelper { ARBShaderObjects.glLinkProgramARB(program); if(ARBShaderObjects.glGetObjectParameteriARB(program, ARBShaderObjects.GL_OBJECT_LINK_STATUS_ARB) == GL11.GL_FALSE) { - FMLLog.log(Level.ERROR, getLogInfo(program)); + Botania.LOGGER.error(getLogInfo(program)); return 0; } ARBShaderObjects.glValidateProgramARB(program); if (ARBShaderObjects.glGetObjectParameteriARB(program, ARBShaderObjects.GL_OBJECT_VALIDATE_STATUS_ARB) == GL11.GL_FALSE) { - FMLLog.log(Level.ERROR, getLogInfo(program)); + Botania.LOGGER.error(getLogInfo(program)); return 0; } @@ -149,52 +149,14 @@ public final class ShaderHelper { } private static String readFileAsString(String filename) throws Exception { - StringBuilder source = new StringBuilder(); InputStream in = ShaderHelper.class.getResourceAsStream(filename); - Exception exception = null; - BufferedReader reader; if(in == null) return ""; - try { - reader = new BufferedReader(new InputStreamReader(in, "UTF-8")); - - Exception innerExc= null; - try { - String line; - while((line = reader.readLine()) != null) - source.append(line).append('\n'); - } catch(Exception exc) { - exception = exc; - } finally { - try { - reader.close(); - } catch(Exception exc) { - if(innerExc == null) - innerExc = exc; - else exc.printStackTrace(); - } - } - - if(innerExc != null) - throw innerExc; - } catch(Exception exc) { - exception = exc; - } finally { - try { - in.close(); - } catch(Exception exc) { - if(exception == null) - exception = exc; - else exc.printStackTrace(); - } - - if(exception != null) - throw exception; + try (BufferedReader reader = new BufferedReader(new InputStreamReader(in, "UTF-8"))) { + return reader.lines().collect(Collectors.joining("\n")); } - - return source.toString(); } } diff --git a/src/main/java/vazkii/botania/client/core/proxy/ClientProxy.java b/src/main/java/vazkii/botania/client/core/proxy/ClientProxy.java index 265950bf3..5bf0db83c 100644 --- a/src/main/java/vazkii/botania/client/core/proxy/ClientProxy.java +++ b/src/main/java/vazkii/botania/client/core/proxy/ClientProxy.java @@ -10,32 +10,35 @@ */ package vazkii.botania.client.core.proxy; -import java.awt.Desktop; -import java.io.File; -import java.io.IOException; -import java.net.URI; -import java.util.Calendar; - import net.minecraft.block.Block; import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBiped; import net.minecraft.client.multiplayer.PlayerControllerMP; import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.client.renderer.entity.RenderPlayer; import net.minecraft.client.renderer.entity.RenderSnowball; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemRecord; import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntitySkull; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; -import net.minecraft.world.WorldSettings.GameType; -import net.minecraftforge.client.MinecraftForgeClient; +import net.minecraftforge.client.model.animation.AnimationTESR; import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.client.registry.ClientRegistry; +import net.minecraftforge.fml.client.registry.RenderingRegistry; +import net.minecraftforge.fml.common.FMLCommonHandler; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; +import net.minecraftforge.fml.relauncher.ReflectionHelper; +import net.minecraftforge.fml.relauncher.Side; +import vazkii.botania.api.boss.IBotaniaBoss; import vazkii.botania.api.item.IExtendedPlayerController; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.api.lexicon.multiblock.IMultiblockRenderHook; import vazkii.botania.api.lexicon.multiblock.Multiblock; import vazkii.botania.api.lexicon.multiblock.MultiblockSet; import vazkii.botania.api.lexicon.multiblock.component.AnyComponent; @@ -43,44 +46,32 @@ import vazkii.botania.api.wiki.IWikiProvider; import vazkii.botania.api.wiki.WikiHooks; import vazkii.botania.client.challenge.ModChallenges; import vazkii.botania.client.core.handler.BaubleRenderHandler; +import vazkii.botania.client.core.handler.BossBarHandler; import vazkii.botania.client.core.handler.BotaniaPlayerController; import vazkii.botania.client.core.handler.BoundTileRenderer; import vazkii.botania.client.core.handler.ClientTickHandler; +import vazkii.botania.client.core.handler.ColorHandler; +import vazkii.botania.client.core.handler.ContributorFancinessHandler; import vazkii.botania.client.core.handler.CorporeaAutoCompleteHandler; import vazkii.botania.client.core.handler.DebugHandler; import vazkii.botania.client.core.handler.HUDHandler; import vazkii.botania.client.core.handler.LightningHandler; +import vazkii.botania.client.core.handler.MiscellaneousIcons; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.client.core.handler.MultiblockRenderHandler; import vazkii.botania.client.core.handler.PersistentVariableHelper; +import vazkii.botania.client.core.handler.RenderLexicon; import vazkii.botania.client.core.handler.SubTileRadiusRenderHandler; +import vazkii.botania.client.core.handler.TooltipAdditionDisplayHandler; import vazkii.botania.client.core.handler.TooltipHandler; import vazkii.botania.client.core.helper.ShaderHelper; +import vazkii.botania.client.fx.FXLightning; import vazkii.botania.client.fx.FXSparkle; import vazkii.botania.client.fx.FXWisp; import vazkii.botania.client.gui.lexicon.GuiLexicon; import vazkii.botania.client.gui.lexicon.GuiLexiconEntry; import vazkii.botania.client.gui.lexicon.GuiLexiconIndex; -import vazkii.botania.client.integration.nei.NEIGuiHooks; -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.client.render.block.RenderAltar; -import vazkii.botania.client.render.block.RenderAvatar; -import vazkii.botania.client.render.block.RenderBellows; -import vazkii.botania.client.render.block.RenderBrewery; -import vazkii.botania.client.render.block.RenderCocoon; -import vazkii.botania.client.render.block.RenderCorporeaCrystalCube; -import vazkii.botania.client.render.block.RenderCorporeaIndex; -import vazkii.botania.client.render.block.RenderDoubleFlower; -import vazkii.botania.client.render.block.RenderFloatingFlower; -import vazkii.botania.client.render.block.RenderHourglass; -import vazkii.botania.client.render.block.RenderIncensePlate; -import vazkii.botania.client.render.block.RenderPool; -import vazkii.botania.client.render.block.RenderPump; -import vazkii.botania.client.render.block.RenderPylon; -import vazkii.botania.client.render.block.RenderSpawnerClaw; -import vazkii.botania.client.render.block.RenderSpecialFlower; -import vazkii.botania.client.render.block.RenderSpreader; -import vazkii.botania.client.render.block.RenderTeruTeruBozu; -import vazkii.botania.client.render.block.RenderTinyPotato; +import vazkii.botania.client.render.entity.LayerGaiaHead; import vazkii.botania.client.render.entity.RenderBabylonWeapon; import vazkii.botania.client.render.entity.RenderCorporeaSpark; import vazkii.botania.client.render.entity.RenderDoppleganger; @@ -88,13 +79,8 @@ import vazkii.botania.client.render.entity.RenderManaStorm; import vazkii.botania.client.render.entity.RenderPinkWither; import vazkii.botania.client.render.entity.RenderPixie; import vazkii.botania.client.render.entity.RenderPoolMinecart; +import vazkii.botania.client.render.entity.RenderSnowballStack; import vazkii.botania.client.render.entity.RenderSpark; -import vazkii.botania.client.render.entity.RenderThornChakram; -import vazkii.botania.client.render.item.RenderBow; -import vazkii.botania.client.render.item.RenderFloatingFlowerItem; -import vazkii.botania.client.render.item.RenderLens; -import vazkii.botania.client.render.item.RenderLexicon; -import vazkii.botania.client.render.item.RenderTransparentItem; import vazkii.botania.client.render.tile.RenderTileAlfPortal; import vazkii.botania.client.render.tile.RenderTileAltar; import vazkii.botania.client.render.tile.RenderTileAvatar; @@ -110,13 +96,11 @@ import vazkii.botania.client.render.tile.RenderTileIncensePlate; import vazkii.botania.client.render.tile.RenderTileLightRelay; import vazkii.botania.client.render.tile.RenderTilePool; import vazkii.botania.client.render.tile.RenderTilePrism; -import vazkii.botania.client.render.tile.RenderTilePump; import vazkii.botania.client.render.tile.RenderTilePylon; import vazkii.botania.client.render.tile.RenderTileRedString; import vazkii.botania.client.render.tile.RenderTileRuneAltar; -import vazkii.botania.client.render.tile.RenderTileSkullOverride; +import vazkii.botania.client.render.tile.RenderTileGaiaHead; import vazkii.botania.client.render.tile.RenderTileSparkChanger; -import vazkii.botania.client.render.tile.RenderTileSpawnerClaw; import vazkii.botania.client.render.tile.RenderTileSpreader; import vazkii.botania.client.render.tile.RenderTileStarfield; import vazkii.botania.client.render.tile.RenderTileTerraPlate; @@ -124,7 +108,7 @@ import vazkii.botania.client.render.tile.RenderTileTeruTeruBozu; import vazkii.botania.client.render.tile.RenderTileTinyPotato; import vazkii.botania.client.render.world.SkyblockRenderEvents; import vazkii.botania.common.Botania; -import vazkii.botania.common.block.ModBlocks; +import vazkii.botania.common.block.subtile.functional.BergamuteEventHandler; import vazkii.botania.common.block.tile.TileAlfPortal; import vazkii.botania.common.block.tile.TileAltar; import vazkii.botania.common.block.tile.TileAvatar; @@ -140,7 +124,6 @@ import vazkii.botania.common.block.tile.TileLightRelay; import vazkii.botania.common.block.tile.TilePylon; import vazkii.botania.common.block.tile.TileRuneAltar; import vazkii.botania.common.block.tile.TileSparkChanger; -import vazkii.botania.common.block.tile.TileSpawnerClaw; import vazkii.botania.common.block.tile.TileStarfield; import vazkii.botania.common.block.tile.TileTerraPlate; import vazkii.botania.common.block.tile.TileTeruTeruBozu; @@ -156,7 +139,7 @@ import vazkii.botania.common.block.tile.string.TileRedString; import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.core.helper.MathHelper; import vazkii.botania.common.core.helper.Vector3; -import vazkii.botania.common.core.proxy.CommonProxy; +import vazkii.botania.common.core.proxy.IProxy; import vazkii.botania.common.core.version.AdaptorNotifier; import vazkii.botania.common.core.version.VersionChecker; import vazkii.botania.common.entity.EntityBabylonWeapon; @@ -175,21 +158,25 @@ import vazkii.botania.common.item.ModItems; import vazkii.botania.common.item.equipment.bauble.ItemMonocle; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibObfuscation; -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.FMLLog; -import cpw.mods.fml.common.Optional; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.relauncher.ReflectionHelper; -public class ClientProxy extends CommonProxy { +import java.awt.*; +import java.io.File; +import java.io.IOException; +import java.net.URI; +import java.time.LocalDateTime; +import java.time.Month; +import java.util.Map; + +public class ClientProxy implements IProxy { public static boolean jingleTheBells = false; public static boolean dootDoot = false; + private static final ModelBiped EMPTY_MODEL = new ModelBiped(); + static { + EMPTY_MODEL.setInvisible(true); + } + @Override public void preInit(FMLPreInitializationEvent event) { PersistentVariableHelper.setCacheFile(new File(Minecraft.getMinecraft().mcDataDir, "BotaniaVars.dat")); @@ -197,114 +184,57 @@ public class ClientProxy extends CommonProxy { PersistentVariableHelper.load(); PersistentVariableHelper.save(); } catch (IOException e) { - FMLLog.severe("Botania's persistent Variables couldn't load!"); - e.printStackTrace(); - } - - super.preInit(event); - } - - @Override - public void init(FMLInitializationEvent event) { - super.init(event); - - ModChallenges.init(); - - FMLCommonHandler.instance().bus().register(new ClientTickHandler()); - MinecraftForge.EVENT_BUS.register(new HUDHandler()); - MinecraftForge.EVENT_BUS.register(new LightningHandler()); - if(ConfigHandler.boundBlockWireframe) - MinecraftForge.EVENT_BUS.register(new BoundTileRenderer()); - MinecraftForge.EVENT_BUS.register(new TooltipHandler()); - MinecraftForge.EVENT_BUS.register(new BaubleRenderHandler()); - MinecraftForge.EVENT_BUS.register(new DebugHandler()); - MinecraftForge.EVENT_BUS.register(new SubTileRadiusRenderHandler()); - MinecraftForge.EVENT_BUS.register(new MultiblockRenderHandler()); - MinecraftForge.EVENT_BUS.register(new SkyblockRenderEvents()); - FMLCommonHandler.instance().bus().register(new CorporeaAutoCompleteHandler()); - - if(ConfigHandler.useAdaptativeConfig) - FMLCommonHandler.instance().bus().register(new AdaptorNotifier()); - if(ConfigHandler.versionCheckEnabled) - new VersionChecker().init(); - - if(ConfigHandler.enableSeasonalFeatures) { - Calendar calendar = Calendar.getInstance(); - if((calendar.get(2) == 11 && calendar.get(5) >= 16) || (calendar.get(2) == 0 && calendar.get(5) <= 2)) - jingleTheBells = true; - if(calendar.get(2) == 9) - dootDoot = true; + Botania.LOGGER.fatal("Persistent Variables couldn't load!!"); } + MinecraftForge.EVENT_BUS.register(MiscellaneousIcons.INSTANCE); + ModelHandler.registerModels(); initRenderers(); } + @Override + public void init(FMLInitializationEvent event) { + ColorHandler.init(); + initAuxiliaryRender(); + + ModChallenges.init(); + + MinecraftForge.EVENT_BUS.register(ClientTickHandler.class); + MinecraftForge.EVENT_BUS.register(HUDHandler.class); + MinecraftForge.EVENT_BUS.register(LightningHandler.class); + if(ConfigHandler.boundBlockWireframe) + MinecraftForge.EVENT_BUS.register(BoundTileRenderer.class); + MinecraftForge.EVENT_BUS.register(TooltipHandler.class); + MinecraftForge.EVENT_BUS.register(TooltipAdditionDisplayHandler.class); + MinecraftForge.EVENT_BUS.register(DebugHandler.class); + MinecraftForge.EVENT_BUS.register(SubTileRadiusRenderHandler.class); + MinecraftForge.EVENT_BUS.register(MultiblockRenderHandler.class); + MinecraftForge.EVENT_BUS.register(SkyblockRenderEvents.class); + MinecraftForge.EVENT_BUS.register(new RenderLexicon()); + MinecraftForge.EVENT_BUS.register(BossBarHandler.class); + MinecraftForge.EVENT_BUS.register(BergamuteEventHandler.class); + + if(ConfigHandler.useAdaptativeConfig) + MinecraftForge.EVENT_BUS.register(AdaptorNotifier.class); + if(ConfigHandler.versionCheckEnabled) + VersionChecker.init(); + + if(ConfigHandler.enableSeasonalFeatures) { + LocalDateTime now = LocalDateTime.now(); + if ((now.getMonth() == Month.DECEMBER && now.getDayOfMonth() >= 16) || (now.getMonth() == Month.JANUARY && now.getDayOfMonth() <= 2)) + jingleTheBells = true; + if(now.getMonth() == Month.OCTOBER) + dootDoot = true; + } + + } + @Override public void postInit(FMLPostInitializationEvent event) { - super.postInit(event); CorporeaAutoCompleteHandler.updateItemList(); } private void initRenderers() { - LibRenderIDs.idAltar = RenderingRegistry.getNextAvailableRenderId(); - LibRenderIDs.idSpecialFlower = RenderingRegistry.getNextAvailableRenderId(); - LibRenderIDs.idSpreader = RenderingRegistry.getNextAvailableRenderId(); - LibRenderIDs.idPool = RenderingRegistry.getNextAvailableRenderId(); - LibRenderIDs.idPylon = RenderingRegistry.getNextAvailableRenderId(); - LibRenderIDs.idMiniIsland = RenderingRegistry.getNextAvailableRenderId(); - LibRenderIDs.idTinyPotato = RenderingRegistry.getNextAvailableRenderId(); - LibRenderIDs.idSpawnerClaw = RenderingRegistry.getNextAvailableRenderId(); - LibRenderIDs.idBrewery = RenderingRegistry.getNextAvailableRenderId(); - LibRenderIDs.idCorporeaIndex = RenderingRegistry.getNextAvailableRenderId(); - LibRenderIDs.idPump = RenderingRegistry.getNextAvailableRenderId(); - LibRenderIDs.idDoubleFlower = RenderingRegistry.getNextAvailableRenderId(); - LibRenderIDs.idCorporeaCrystalCybe = RenderingRegistry.getNextAvailableRenderId(); - LibRenderIDs.idIncensePlate = RenderingRegistry.getNextAvailableRenderId(); - LibRenderIDs.idHourglass = RenderingRegistry.getNextAvailableRenderId(); - LibRenderIDs.idCocoon = RenderingRegistry.getNextAvailableRenderId(); - LibRenderIDs.idLightRelay = RenderingRegistry.getNextAvailableRenderId(); - LibRenderIDs.idBellows = RenderingRegistry.getNextAvailableRenderId(); - LibRenderIDs.idTeruTeruBozu = RenderingRegistry.getNextAvailableRenderId(); - LibRenderIDs.idAvatar = RenderingRegistry.getNextAvailableRenderId(); - - RenderSpecialFlower specialFlowerRender = new RenderSpecialFlower(LibRenderIDs.idSpecialFlower); - RenderingRegistry.registerBlockHandler(new RenderAltar()); - RenderingRegistry.registerBlockHandler(specialFlowerRender); - RenderingRegistry.registerBlockHandler(new RenderSpreader()); - RenderingRegistry.registerBlockHandler(new RenderPool()); - RenderingRegistry.registerBlockHandler(new RenderPylon()); - RenderingRegistry.registerBlockHandler(new RenderFloatingFlower()); - RenderingRegistry.registerBlockHandler(new RenderTinyPotato()); - RenderingRegistry.registerBlockHandler(new RenderSpawnerClaw()); - RenderingRegistry.registerBlockHandler(new RenderBrewery()); - RenderingRegistry.registerBlockHandler(new RenderCorporeaIndex()); - RenderingRegistry.registerBlockHandler(new RenderPump()); - RenderingRegistry.registerBlockHandler(new RenderDoubleFlower()); - RenderingRegistry.registerBlockHandler(new RenderCorporeaCrystalCube()); - RenderingRegistry.registerBlockHandler(new RenderIncensePlate()); - RenderingRegistry.registerBlockHandler(new RenderHourglass()); - RenderingRegistry.registerBlockHandler(new RenderCocoon()); - RenderingRegistry.registerBlockHandler(new RenderBellows()); - RenderingRegistry.registerBlockHandler(new RenderTeruTeruBozu()); - RenderingRegistry.registerBlockHandler(new RenderAvatar()); - - IMultiblockRenderHook.renderHooks.put(ModBlocks.flower, specialFlowerRender); - IMultiblockRenderHook.renderHooks.put(ModBlocks.shinyFlower, specialFlowerRender); - - RenderTransparentItem renderTransparentItem = new RenderTransparentItem(); - RenderFloatingFlowerItem renderFloatingFlower = new RenderFloatingFlowerItem(); - RenderBow renderBow = new RenderBow(); - - MinecraftForgeClient.registerItemRenderer(ModItems.lens, new RenderLens()); - if(ConfigHandler.lexicon3dModel) - MinecraftForgeClient.registerItemRenderer(ModItems.lexicon, new RenderLexicon()); - MinecraftForgeClient.registerItemRenderer(ModItems.glassPick, renderTransparentItem); - MinecraftForgeClient.registerItemRenderer(ModItems.spark, renderTransparentItem); - MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.floatingFlower), renderFloatingFlower); - MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.floatingSpecialFlower), renderFloatingFlower); - MinecraftForgeClient.registerItemRenderer(ModItems.livingwoodBow, renderBow); - MinecraftForgeClient.registerItemRenderer(ModItems.crystalBow, renderBow); - RenderTileFloatingFlower renderTileFloatingFlower = new RenderTileFloatingFlower(); ClientRegistry.bindTileEntitySpecialRenderer(TileAltar.class, new RenderTileAltar()); ClientRegistry.bindTileEntitySpecialRenderer(TileSpreader.class, new RenderTileSpreader()); @@ -316,14 +246,13 @@ public class ClientProxy extends CommonProxy { ClientRegistry.bindTileEntitySpecialRenderer(TileFloatingFlower.class, renderTileFloatingFlower); ClientRegistry.bindTileEntitySpecialRenderer(TileFloatingSpecialFlower.class, renderTileFloatingFlower); ClientRegistry.bindTileEntitySpecialRenderer(TileTinyPotato.class, new RenderTileTinyPotato()); - ClientRegistry.bindTileEntitySpecialRenderer(TileSpawnerClaw.class, new RenderTileSpawnerClaw()); ClientRegistry.bindTileEntitySpecialRenderer(TileStarfield.class, new RenderTileStarfield()); ClientRegistry.bindTileEntitySpecialRenderer(TileBrewery.class, new RenderTileBrewery()); ClientRegistry.bindTileEntitySpecialRenderer(TileTerraPlate.class, new RenderTileTerraPlate()); ClientRegistry.bindTileEntitySpecialRenderer(TileRedString.class, new RenderTileRedString()); ClientRegistry.bindTileEntitySpecialRenderer(TilePrism.class, new RenderTilePrism()); ClientRegistry.bindTileEntitySpecialRenderer(TileCorporeaIndex.class, new RenderTileCorporeaIndex()); - ClientRegistry.bindTileEntitySpecialRenderer(TilePump.class, new RenderTilePump()); + ClientRegistry.bindTileEntitySpecialRenderer(TilePump.class, new AnimationTESR<>()); ClientRegistry.bindTileEntitySpecialRenderer(TileCorporeaCrystalCube.class, new RenderTileCorporeaCrystalCube()); ClientRegistry.bindTileEntitySpecialRenderer(TileIncensePlate.class, new RenderTileIncensePlate()); ClientRegistry.bindTileEntitySpecialRenderer(TileHourglass.class, new RenderTileHourglass()); @@ -331,31 +260,38 @@ public class ClientProxy extends CommonProxy { ClientRegistry.bindTileEntitySpecialRenderer(TileCocoon.class, new RenderTileCocoon()); ClientRegistry.bindTileEntitySpecialRenderer(TileLightRelay.class, new RenderTileLightRelay()); ClientRegistry.bindTileEntitySpecialRenderer(TileBellows.class, new RenderTileBellows()); - ClientRegistry.bindTileEntitySpecialRenderer(TileGaiaHead.class, new RenderTileSkullOverride()); + ClientRegistry.bindTileEntitySpecialRenderer(TileGaiaHead.class, new RenderTileGaiaHead()); ClientRegistry.bindTileEntitySpecialRenderer(TileTeruTeruBozu.class, new RenderTileTeruTeruBozu()); ClientRegistry.bindTileEntitySpecialRenderer(TileAvatar.class, new RenderTileAvatar()); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySkull.class, new RenderTileSkullOverride()); + RenderingRegistry.registerEntityRenderingHandler(EntityPixie.class, RenderPixie::new); + RenderingRegistry.registerEntityRenderingHandler(EntityDoppleganger.class, RenderDoppleganger::new); + RenderingRegistry.registerEntityRenderingHandler(EntitySpark.class, RenderSpark::new); + RenderingRegistry.registerEntityRenderingHandler(EntityCorporeaSpark.class, RenderCorporeaSpark::new); + RenderingRegistry.registerEntityRenderingHandler(EntityPoolMinecart.class, RenderPoolMinecart::new); + RenderingRegistry.registerEntityRenderingHandler(EntityPinkWither.class, RenderPinkWither::new); + RenderingRegistry.registerEntityRenderingHandler(EntityManaStorm.class, RenderManaStorm::new); + RenderingRegistry.registerEntityRenderingHandler(EntityBabylonWeapon.class, RenderBabylonWeapon::new); - RenderingRegistry.registerEntityRenderingHandler(EntityPixie.class, new RenderPixie()); - RenderingRegistry.registerEntityRenderingHandler(EntityVineBall.class, new RenderSnowball(ModItems.vineBall)); - RenderingRegistry.registerEntityRenderingHandler(EntityDoppleganger.class, new RenderDoppleganger()); - RenderingRegistry.registerEntityRenderingHandler(EntitySpark.class, new RenderSpark()); - RenderingRegistry.registerEntityRenderingHandler(EntityThornChakram.class, new RenderThornChakram()); - RenderingRegistry.registerEntityRenderingHandler(EntityCorporeaSpark.class, new RenderCorporeaSpark()); - RenderingRegistry.registerEntityRenderingHandler(EntityEnderAirBottle.class, new RenderSnowball(ModItems.manaResource, 15)); - RenderingRegistry.registerEntityRenderingHandler(EntityPoolMinecart.class, new RenderPoolMinecart()); - RenderingRegistry.registerEntityRenderingHandler(EntityPinkWither.class, new RenderPinkWither()); - RenderingRegistry.registerEntityRenderingHandler(EntityManaStorm.class, new RenderManaStorm()); - RenderingRegistry.registerEntityRenderingHandler(EntityBabylonWeapon.class, new RenderBabylonWeapon()); + RenderingRegistry.registerEntityRenderingHandler(EntityThornChakram.class, renderManager -> new RenderSnowballStack<>(renderManager, ModItems.thornChakram, Minecraft.getMinecraft().getRenderItem(), entity -> new ItemStack(ModItems.thornChakram, 1, entity.isFire() ? 1 : 0))); + RenderingRegistry.registerEntityRenderingHandler(EntityVineBall.class, renderManager -> new RenderSnowball(renderManager, ModItems.vineBall, Minecraft.getMinecraft().getRenderItem())); + RenderingRegistry.registerEntityRenderingHandler(EntityEnderAirBottle.class, renderManager -> new RenderSnowballStack<>(renderManager, ModItems.manaResource, Minecraft.getMinecraft().getRenderItem(), entity -> new ItemStack(ModItems.manaResource, 1, 15))); ShaderHelper.initShaders(); } - @Override - @Optional.Method(modid = "NotEnoughItems") - public void registerNEIStuff() { - NEIGuiHooks.init(); + private void initAuxiliaryRender() { + Map skinMap = Minecraft.getMinecraft().getRenderManager().getSkinMap(); + RenderPlayer render; + render = skinMap.get("default"); + render.addLayer(new ContributorFancinessHandler()); + render.addLayer(new BaubleRenderHandler()); + render.addLayer(new LayerGaiaHead(render.getMainModel().bipedHead)); + + render = skinMap.get("slim"); + render.addLayer(new ContributorFancinessHandler()); + render.addLayer(new BaubleRenderHandler()); + render.addLayer(new LayerGaiaHead(render.getMainModel().bipedHead)); } @Override @@ -379,6 +315,11 @@ public class ClientProxy extends CommonProxy { return entity == Minecraft.getMinecraft().thePlayer; } + @Override + public EntityPlayer getClientPlayer() { + return Minecraft.getMinecraft().thePlayer; + } + @Override public boolean isClientPlayerWearingMonocle() { return ItemMonocle.hasMonocle(Minecraft.getMinecraft().thePlayer); @@ -386,17 +327,15 @@ public class ClientProxy extends CommonProxy { @Override public void setExtraReach(EntityLivingBase entity, float reach) { - super.setExtraReach(entity, reach); Minecraft mc = Minecraft.getMinecraft(); EntityPlayer player = mc.thePlayer; if(entity == player) { if(!(mc.playerController instanceof IExtendedPlayerController)) { - GameType type = ReflectionHelper.getPrivateValue(PlayerControllerMP.class, mc.playerController, LibObfuscation.CURRENT_GAME_TYPE); NetHandlerPlayClient net = ReflectionHelper.getPrivateValue(PlayerControllerMP.class, mc.playerController, LibObfuscation.NET_CLIENT_HANDLER); BotaniaPlayerController controller = new BotaniaPlayerController(mc, net); boolean isFlying = player.capabilities.isFlying; boolean allowFlying = player.capabilities.allowFlying; - controller.setGameType(type); + controller.setGameType(mc.playerController.getCurrentGameType()); player.capabilities.isFlying = isFlying; player.capabilities.allowFlying = allowFlying; mc.playerController = controller; @@ -407,9 +346,9 @@ public class ClientProxy extends CommonProxy { } @Override - public boolean openWikiPage(World world, Block block, MovingObjectPosition pos) { + public boolean openWikiPage(World world, Block block, RayTraceResult pos) { IWikiProvider wiki = WikiHooks.getWikiFor(block); - String url = wiki.getWikiURL(world, pos); + String url = wiki.getWikiURL(world, pos, Minecraft.getMinecraft().thePlayer); if(url != null && !url.isEmpty()) { try { Desktop.getDesktop().browse(new URI(url)); @@ -436,12 +375,12 @@ public class ClientProxy extends CommonProxy { } @Override - public void playRecordClientSided(World world, int x, int y, int z, ItemRecord record) { + public void playRecordClientSided(World world, BlockPos pos, ItemRecord record) { Minecraft mc = Minecraft.getMinecraft(); if(record == null) - world.playAuxSFXAtEntity(null, 1005, x, y, z, 0); + world.playEvent(null, 1010, pos, 0); else { - world.playAuxSFXAtEntity(null, 1005, x, y, z, Item.getIdFromItem(record)); + world.playEvent(null, 1010, pos, Item.getIdFromItem(record)); mc.ingameGUI.setRecordPlayingMessage(record.getRecordNameLocal()); } } @@ -460,19 +399,20 @@ public class ClientProxy extends CommonProxy { for(int j = 0; j < iradius * 2 + 1; j++) { int xp = x + i - iradius; int zp = z + j - iradius; - if((int) Math.floor(MathHelper.pointDistancePlane(xp, zp, x, z)) == iradius - 1) - mb.addComponent(new AnyComponent(new ChunkCoordinates(xp - x, 1, zp - z), block, 0)); + + if((int) Math.floor(MathHelper.pointDistancePlane(xp, zp, x, z)) == (iradius - 1)) + mb.addComponent(new AnyComponent(new BlockPos(xp - x, 1, zp - z), block.getDefaultState())); } MultiblockRenderHandler.setMultiblock(mb.makeSet()); - MultiblockRenderHandler.anchor = new ChunkCoordinates(x, y, z); + MultiblockRenderHandler.anchor = new BlockPos(x, y, z); } @Override public void removeSextantMultiblock() { MultiblockSet set = MultiblockRenderHandler.currentMultiblock; if(set != null) { - Multiblock mb = set.getForIndex(0); + Multiblock mb = set.getForFacing(EnumFacing.SOUTH); if(mb instanceof MultiblockSextant) MultiblockRenderHandler.setMultiblock(null); } @@ -492,11 +432,11 @@ public class ClientProxy extends CommonProxy { } @Override - public void sparkleFX(World world, double x, double y, double z, float r, float g, float b, float size, int m, boolean fake) { - if(!doParticle(world) && !fake) + public void sparkleFX(double x, double y, double z, float r, float g, float b, float size, int m, boolean fake) { + if(!doParticle() && !fake) return; - FXSparkle sparkle = new FXSparkle(world, x, y, z, size, r, g, b, m); + FXSparkle sparkle = new FXSparkle(Minecraft.getMinecraft().theWorld, x, y, z, size, r, g, b, m); sparkle.fake = sparkle.noClip = fake; if(noclipEnabled) sparkle.noClip = true; @@ -519,20 +459,17 @@ public class ClientProxy extends CommonProxy { } @Override - public void wispFX(World world, double x, double y, double z, float r, float g, float b, float size, float motionx, float motiony, float motionz, float maxAgeMul) { - if(!doParticle(world)) + public void wispFX(double x, double y, double z, float r, float g, float b, float size, float motionx, float motiony, float motionz, float maxAgeMul) { + if(!doParticle()) return; - FXWisp wisp = new FXWisp(world, x, y, z, size, r, g, b, distanceLimit, depthTest, maxAgeMul); - wisp.motionX = motionx; - wisp.motionY = motiony; - wisp.motionZ = motionz; - + FXWisp wisp = new FXWisp(Minecraft.getMinecraft().theWorld, x, y, z, size, r, g, b, distanceLimit, depthTest, maxAgeMul); + wisp.setSpeed(motionx, motiony, motionz); Minecraft.getMinecraft().effectRenderer.addEffect(wisp); } - private boolean doParticle(World world) { - if(!world.isRemote) + private boolean doParticle() { + if(FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) return false; if(!ConfigHandler.useVanillaParticleLimiter) @@ -548,8 +485,28 @@ public class ClientProxy extends CommonProxy { } @Override - public void lightningFX(World world, Vector3 vectorStart, Vector3 vectorEnd, float ticksPerMeter, long seed, int colorOuter, int colorInner) { - LightningHandler.spawnLightningBolt(world, vectorStart, vectorEnd, ticksPerMeter, seed, colorOuter, colorInner); + public void lightningFX(Vector3 vectorStart, Vector3 vectorEnd, float ticksPerMeter, long seed, int colorOuter, int colorInner) { + Minecraft.getMinecraft().effectRenderer.addEffect(new FXLightning(Minecraft.getMinecraft().theWorld, vectorStart, vectorEnd, ticksPerMeter, seed, colorOuter, colorInner)); + } + + @Override + public void addBoss(IBotaniaBoss boss) { + BossBarHandler.bosses.add(boss); + } + + @Override + public void removeBoss(IBotaniaBoss boss) { + BossBarHandler.bosses.remove(boss); + } + + @Override + public int getClientRenderDistance() { + return Minecraft.getMinecraft().gameSettings.renderDistanceChunks; + } + + @Override + public ModelBiped getEmptyModelBiped() { + return EMPTY_MODEL; } } diff --git a/src/main/java/vazkii/botania/client/core/proxy/GuiFactory.java b/src/main/java/vazkii/botania/client/core/proxy/GuiFactory.java index 2a558708d..09ee76c03 100644 --- a/src/main/java/vazkii/botania/client/core/proxy/GuiFactory.java +++ b/src/main/java/vazkii/botania/client/core/proxy/GuiFactory.java @@ -10,19 +10,17 @@ */ package vazkii.botania.client.core.proxy; -import java.util.Set; - import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; +import net.minecraftforge.fml.client.IModGuiFactory; import vazkii.botania.client.gui.GuiBotaniaConfig; -import cpw.mods.fml.client.IModGuiFactory; + +import java.util.Set; public class GuiFactory implements IModGuiFactory { @Override - public void initialize(Minecraft minecraftInstance) { - // NO-OP - } + public void initialize(Minecraft minecraftInstance) {} @Override public Class mainConfigGuiClass() { diff --git a/src/main/java/vazkii/botania/client/fx/FXLightning.java b/src/main/java/vazkii/botania/client/fx/FXLightning.java new file mode 100644 index 000000000..c739d7633 --- /dev/null +++ b/src/main/java/vazkii/botania/client/fx/FXLightning.java @@ -0,0 +1,248 @@ +package vazkii.botania.client.fx; + +import gnu.trove.map.hash.TIntIntHashMap; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.particle.Particle; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.VertexBuffer; +import net.minecraft.entity.Entity; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.world.World; +import vazkii.botania.client.core.handler.LightningHandler; +import vazkii.botania.common.core.helper.Vector3; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +// Originally taken with permission from WRCBE - heavily modified +public class FXLightning extends Particle { + + private static final int fadetime = 20; + private final TIntIntHashMap splitParents = new TIntIntHashMap(); + private final double length; + private final Random rand; + private final int colorOuter; + private final int colorInner; + + private List segments = new ArrayList<>(); + private int segmentCount = 1; + private int splitCount; + private float speed = 1.5F; + + public FXLightning(World world, Vector3 sourcevec, Vector3 targetvec, float ticksPerMeter, long seed, int colorOuter, int colorInner) { + super(world, sourcevec.x, sourcevec.y, sourcevec.z); + this.rand = new Random(seed); + this.speed = ticksPerMeter; + this.colorOuter = colorOuter; + this.colorInner = colorInner; + this.length = targetvec.subtract(sourcevec).mag(); + this.particleMaxAge = fadetime + rand.nextInt(fadetime) - fadetime / 2; + this.particleAge = -(int) (length * speed); + + segments.add(new FXLightningSegment(sourcevec, targetvec)); + + fractal(2, length / 1.5, 0.7F, 0.7F, 45); + fractal(2, length / 4, 0.5F, 0.8F, 50); + fractal(2, length / 15, 0.5F, 0.9F, 55); + fractal(2, length / 30, 0.5F, 1.0F, 60); + fractal(2, length / 60, 0, 0, 0); + fractal(2, length / 100, 0, 0, 0); + fractal(2, length / 400, 0, 0, 0); + + calculateCollisionAndDiffs(); + + Collections.sort(segments, (o1, o2) -> Float.compare(o2.light, o1.light)); + } + + @Override + public void renderParticle(VertexBuffer wr, Entity entity, float partialTicks, float rotX, float rotZ, float rotYZ, float rotXY, float rotXZ) { + LightningHandler.queuedLightningBolts.offer(this); + } + + public void renderBolt(int pass, boolean inner) { + ParticleRenderDispatcher.lightningCount++; + VertexBuffer wr = Tessellator.getInstance().getBuffer(); + + float boltAge = particleAge < 0 ? 0 : (float) particleAge / (float) particleMaxAge; + float mainAlpha; + if(pass == 0) + mainAlpha = (1 - boltAge) * 0.4F; + else mainAlpha = 1 - boltAge * 0.5F; + + int expandTime = (int) (length * speed); + + int renderstart = (int) ((expandTime / 2 - particleMaxAge + particleAge) / (float) (expandTime / 2) * segmentCount); + int renderend = (int) ((particleAge + expandTime) / (float) expandTime * segmentCount); + + for(FXLightningSegment rendersegment : segments) { + if(rendersegment.segmentNo < renderstart || rendersegment.segmentNo > renderend) + continue; + + Vector3 playerVec = getRelativeViewVector(rendersegment.startPoint.point).multiply(-1); + + double width = 0.025F * (playerVec.mag() / 5 + 1) * (1 + rendersegment.light) * 0.5F; + + Vector3 diff1 = playerVec.crossProduct(rendersegment.prevDiff).normalize().multiply(width / rendersegment.sinPrev); + Vector3 diff2 = playerVec.crossProduct(rendersegment.nextDiff).normalize().multiply(width / rendersegment.sinNext); + + Vector3 startvec = rendersegment.startPoint.point; + Vector3 endvec = rendersegment.endPoint.point; + + int color = inner ? colorInner : colorOuter; + int r = (color & 0xFF0000) >> 16; + int g = (color & 0xFF00) >> 8; + int b = (color & 0xFF); + int a = (int) (mainAlpha * rendersegment.light * 0xFF); + + wr.pos(endvec.x - diff2.x, endvec.y - diff2.y, endvec.z - diff2.z).tex(0.5, 0).lightmap(0xF0, 0xF0).color(r, g, b, a).endVertex(); + wr.pos(startvec.x - diff1.x, startvec.y - diff1.y, startvec.z - diff1.z).tex(0.5, 0).lightmap(0xF0, 0xF0).color(r, g, b, a).endVertex(); + wr.pos(startvec.x + diff1.x, startvec.y + diff1.y, startvec.z + diff1.z).tex(0.5, 1).lightmap(0xF0, 0xF0).color(r, g, b, a).endVertex(); + wr.pos(endvec.x + diff2.x, endvec.y + diff2.y, endvec.z + diff2.z).tex(0.5, 1).lightmap(0xF0, 0xF0).color(r, g, b, a).endVertex(); + + if(rendersegment.next == null) { + Vector3 roundend = rendersegment.endPoint.point.add(rendersegment.diff.normalize().multiply(width)); + + wr.pos(roundend.x - diff2.x, roundend.y - diff2.y, roundend.z - diff2.z).tex(0, 0).lightmap(0xF0, 0xF0).color(r, g, b, a).endVertex(); + wr.pos(endvec.x - diff2.x, endvec.y - diff2.y, endvec.z - diff2.z).tex(0.5, 0).lightmap(0xF0, 0xF0).color(r, g, b, a).endVertex(); + wr.pos(endvec.x + diff2.x, endvec.y + diff2.y, endvec.z + diff2.z).tex(0.5, 1).lightmap(0xF0, 0xF0).color(r, g, b, a).endVertex(); + wr.pos(roundend.x + diff2.x, roundend.y + diff2.y, roundend.z + diff2.z).tex(0, 1).lightmap(0xF0, 0xF0).color(r, g, b, a).endVertex(); + } + + if(rendersegment.prev == null) { + Vector3 roundend = rendersegment.startPoint.point.subtract(rendersegment.diff.normalize().multiply(width)); + + wr.pos(startvec.x - diff1.x, startvec.y - diff1.y, startvec.z - diff1.z).tex(0.5, 0).lightmap(0xF0, 0xF0).color(r, g, b, a).endVertex(); + wr.pos(roundend.x - diff1.x, roundend.y - diff1.y, roundend.z - diff1.z).tex(0, 0).lightmap(0xF0, 0xF0).color(r, g, b, a).endVertex(); + wr.pos(roundend.x + diff1.x, roundend.y + diff1.y, roundend.z + diff1.z).tex(0, 1).lightmap(0xF0, 0xF0).color(r, g, b, a).endVertex(); + wr.pos(startvec.x + diff1.x, startvec.y + diff1.y, startvec.z + diff1.z).tex(0.5, 1).lightmap(0xF0, 0xF0).color(r, g, b, a).endVertex(); + } + } + } + + private void fractal(int splits, double amount, double splitChance, double splitLength, double splitAngle) { + List oldSegments = segments; + segments = new ArrayList<>(); + + FXLightningSegment prev; + + for(FXLightningSegment segment : oldSegments) { + prev = segment.prev; + + Vector3 subsegment = segment.diff.multiply(1F / splits); + + FXLightningBoltPoint[] newpoints = new FXLightningBoltPoint[splits + 1]; + + Vector3 startpoint = segment.startPoint.point; + newpoints[0] = segment.startPoint; + newpoints[splits] = segment.endPoint; + + for(int i = 1; i < splits; i++) { + Vector3 randoff = segment.diff.perpendicular().normalize().rotate(rand.nextFloat() * 360, segment.diff); + randoff = randoff.multiply((rand.nextFloat() - 0.5F) * amount * 2); + + Vector3 basepoint = startpoint.add(subsegment.multiply(i)); + + newpoints[i] = new FXLightningBoltPoint(basepoint, randoff); + } + + for(int i = 0; i < splits; i++) { + FXLightningSegment next = new FXLightningSegment(newpoints[i], newpoints[i + 1], segment.light, segment.segmentNo * splits + i, segment.splitNo); + next.prev = prev; + if (prev != null) + prev.next = next; + + if(i != 0 && rand.nextFloat() < splitChance) { + Vector3 splitrot = next.diff.xCrossProduct().rotate(rand.nextFloat() * 360, next.diff); + Vector3 diff = next.diff.rotate((rand.nextFloat() * 0.66F + 0.33F) * splitAngle, splitrot).multiply(splitLength); + + splitCount++; + splitParents.put(splitCount, next.splitNo); + + FXLightningSegment split = new FXLightningSegment(newpoints[i], new FXLightningBoltPoint(newpoints[i + 1].basepoint, newpoints[i + 1].offsetvec.add(diff)), segment.light / 2F, next.segmentNo, splitCount); + split.prev = prev; + + segments.add(split); + } + + prev = next; + segments.add(next); + } + + if(segment.next != null) + segment.next.prev = prev; + } + + segmentCount *= splits; + } + + private float rayTraceResistance(Vector3 start, Vector3 end, float prevresistance) { + RayTraceResult mop = worldObj.rayTraceBlocks(start.toVec3D(), end.toVec3D()); + + if(mop == null) + return prevresistance; + + if(mop.typeOfHit == RayTraceResult.Type.BLOCK) { + Block block = worldObj.getBlockState(mop.getBlockPos()).getBlock(); + + if(worldObj.isAirBlock(mop.getBlockPos())) + return prevresistance; + + return prevresistance + block.getExplosionResistance(null) + 0.3F; + } else return prevresistance; + } + + private void calculateCollisionAndDiffs() { + TIntIntHashMap lastactivesegment = new TIntIntHashMap(); + + Collections.sort(segments, (o1, o2) -> { + int comp = Integer.valueOf(o1.splitNo).compareTo(o2.splitNo); + if(comp == 0) + return Integer.valueOf(o1.segmentNo).compareTo(o2.segmentNo); + else return comp; + }); + + int lastSplitCalc = 0; + int lastActiveSegment = 0;// unterminated + float splitResistance = 0; + + for(FXLightningSegment segment : segments) { + if(segment.splitNo > lastSplitCalc) { + lastactivesegment.put(lastSplitCalc, lastActiveSegment); + lastSplitCalc = segment.splitNo; + lastActiveSegment = lastactivesegment.get(splitParents.get(segment.splitNo)); + splitResistance = lastActiveSegment < segment.segmentNo ? 50 : 0; + } + + if(splitResistance >= 40 * segment.light) + continue; + + splitResistance = rayTraceResistance(segment.startPoint.point, segment.endPoint.point, splitResistance); + lastActiveSegment = segment.segmentNo; + } + lastactivesegment.put(lastSplitCalc, lastActiveSegment); + + lastSplitCalc = 0; + lastActiveSegment = lastactivesegment.get(0); + for(Iterator iterator = segments.iterator(); iterator.hasNext();) { + FXLightningSegment segment = iterator.next(); + if(lastSplitCalc != segment.splitNo) { + lastSplitCalc = segment.splitNo; + lastActiveSegment = lastactivesegment.get(segment.splitNo); + } + + if(segment.segmentNo > lastActiveSegment) + iterator.remove(); + segment.calcEndDiffs(); + } + } + + private static Vector3 getRelativeViewVector(Vector3 pos) { + Entity renderEntity = Minecraft.getMinecraft().getRenderViewEntity(); + return new Vector3((float) renderEntity.posX - pos.x, (float) renderEntity.posY + renderEntity.getEyeHeight() - pos.y, (float) renderEntity.posZ - pos.z); + } + +} diff --git a/src/main/java/vazkii/botania/client/fx/FXLightningBoltPoint.java b/src/main/java/vazkii/botania/client/fx/FXLightningBoltPoint.java new file mode 100644 index 000000000..4c82eb3ab --- /dev/null +++ b/src/main/java/vazkii/botania/client/fx/FXLightningBoltPoint.java @@ -0,0 +1,17 @@ +package vazkii.botania.client.fx; + +import vazkii.botania.common.core.helper.Vector3; + +public class FXLightningBoltPoint { + + public final Vector3 point; + public final Vector3 basepoint; + public final Vector3 offsetvec; + + public FXLightningBoltPoint(Vector3 basepoint, Vector3 offsetvec) { + point = basepoint.add(offsetvec); + this.basepoint = basepoint; + this.offsetvec = offsetvec; + } + +} diff --git a/src/main/java/vazkii/botania/client/fx/FXLightningSegment.java b/src/main/java/vazkii/botania/client/fx/FXLightningSegment.java new file mode 100644 index 000000000..7f0e8750d --- /dev/null +++ b/src/main/java/vazkii/botania/client/fx/FXLightningSegment.java @@ -0,0 +1,71 @@ +package vazkii.botania.client.fx; + +import vazkii.botania.common.core.helper.Vector3; + +public class FXLightningSegment { + + public final FXLightningBoltPoint startPoint; + public final FXLightningBoltPoint endPoint; + + public Vector3 diff; + + public FXLightningSegment prev; + public FXLightningSegment next; + + public Vector3 nextDiff; + public Vector3 prevDiff; + + public float sinPrev; + public float sinNext; + public final float light; + + public final int segmentNo; + public final int splitNo; + + public FXLightningSegment(FXLightningBoltPoint start, FXLightningBoltPoint end, float light, int segmentnumber, int splitnumber) { + startPoint = start; + endPoint = end; + this.light = light; + segmentNo = segmentnumber; + splitNo = splitnumber; + + calcDiff(); + } + + public FXLightningSegment(Vector3 start, Vector3 end) { + this(new FXLightningBoltPoint(start, new Vector3(0, 0, 0)), new FXLightningBoltPoint(end, new Vector3(0, 0, 0)), 1, 0, 0); + } + + public void calcDiff() { + diff = endPoint.point.subtract(startPoint.point); + } + + public void calcEndDiffs() { + if(prev != null) { + Vector3 prevdiffnorm = prev.diff.normalize(); + Vector3 thisdiffnorm = diff.normalize(); + + prevDiff = thisdiffnorm.add(prevdiffnorm).normalize(); + sinPrev = (float) Math.sin(thisdiffnorm.angle(prevdiffnorm.multiply(-1)) / 2); + } else { + prevDiff = diff.normalize(); + sinPrev = 1; + } + + if(next != null) { + Vector3 nextdiffnorm = next.diff.normalize(); + Vector3 thisdiffnorm = diff.normalize(); + + nextDiff = thisdiffnorm.add(nextdiffnorm).normalize(); + sinNext = (float) Math.sin(thisdiffnorm.angle(nextdiffnorm.multiply(-1)) / 2); + } else { + nextDiff = diff.normalize(); + sinNext = 1; + } + } + + @Override + public String toString() { + return startPoint.point.toString() + " " + endPoint.point.toString(); + } +} diff --git a/src/main/java/vazkii/botania/client/fx/FXSparkle.java b/src/main/java/vazkii/botania/client/fx/FXSparkle.java index 61a563631..31e4b032a 100644 --- a/src/main/java/vazkii/botania/client/fx/FXSparkle.java +++ b/src/main/java/vazkii/botania/client/fx/FXSparkle.java @@ -10,37 +10,45 @@ */ package vazkii.botania.client.fx; -import java.util.ArrayDeque; -import java.util.Queue; - import net.minecraft.client.Minecraft; -import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.particle.ParticleManager; +import net.minecraft.client.particle.Particle; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.util.MathHelper; +import net.minecraft.client.renderer.VertexBuffer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.entity.Entity; +import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; - +import net.minecraftforge.fml.relauncher.ReflectionHelper; import org.lwjgl.opengl.GL11; - import vazkii.botania.client.core.helper.ShaderHelper; import vazkii.botania.client.lib.LibResources; import vazkii.botania.common.core.handler.ConfigHandler; -import vazkii.botania.common.core.helper.ObfuscationHelper; +import vazkii.botania.common.lib.LibObfuscation; -public class FXSparkle extends EntityFX { +import java.util.ArrayDeque; +import java.util.Queue; +public class FXSparkle extends Particle { + + private static final ResourceLocation vanillaParticles = new ResourceLocation("textures/particle/particles.png"); public static final ResourceLocation particles = new ResourceLocation(LibResources.MISC_PARTICLES); - public static Queue queuedRenders = new ArrayDeque(); - public static Queue queuedCorruptRenders = new ArrayDeque(); + private static final Queue queuedRenders = new ArrayDeque<>(); + private static final Queue queuedCorruptRenders = new ArrayDeque<>(); // Queue values - float f; - float f1; - float f2; - float f3; - float f4; - float f5; + private float f; + private float f1; + private float f2; + private float f3; + private float f4; + private float f5; + + public boolean noClip = false; public FXSparkle(World world, double x, double y, double z, float size, float red, float green, float blue, int m) { super(world, x, y, z, 0.0D, 0.0D, 0.0D); @@ -48,6 +56,7 @@ public class FXSparkle extends EntityFX { particleRed = red; particleGreen = green; particleBlue = blue; + particleAlpha = 0.5F; // So MC renders us on the alpha layer, value not actually used particleGravity = 0; motionX = motionY = motionZ = 0; particleScale *= size; @@ -64,16 +73,16 @@ public class FXSparkle extends EntityFX { ParticleRenderDispatcher.sparkleFxCount = 0; ParticleRenderDispatcher.fakeSparkleFxCount = 0; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F); - Minecraft.getMinecraft().renderEngine.bindTexture(ConfigHandler.matrixMode ? ObfuscationHelper.getParticleTexture() : particles); + GlStateManager.color(1.0F, 1.0F, 1.0F, 0.75F); + Minecraft.getMinecraft().renderEngine.bindTexture(ConfigHandler.matrixMode ? vanillaParticles : particles); - tessellator.startDrawingQuads(); + tessellator.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR); for(FXSparkle sparkle : queuedRenders) sparkle.renderQueued(tessellator); tessellator.draw(); ShaderHelper.useShader(ShaderHelper.filmGrain); - tessellator.startDrawingQuads(); + tessellator.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR); for(FXSparkle sparkle : queuedCorruptRenders) sparkle.renderQueued(tessellator); tessellator.draw(); @@ -101,18 +110,15 @@ public class FXSparkle extends EntityFX { float var15 = (float)(prevPosZ + (posZ - prevPosZ) * f - interpPosZ); float var16 = 1.0F; - tessellator.setBrightness(0x0000f0); - - tessellator.setColorRGBA_F(particleRed * var16, particleGreen * var16, particleBlue * var16, 1); - tessellator.addVertexWithUV(var13 - f1 * var12 - f4 * var12, var14 - f2 * var12, var15 - f3 * var12 - f5 * var12, var9, var11); - tessellator.addVertexWithUV(var13 - f1 * var12 + f4 * var12, var14 + f2 * var12, var15 - f3 * var12 + f5 * var12, var9, var10); - tessellator.addVertexWithUV(var13 + f1 * var12 + f4 * var12, var14 + f2 * var12, var15 + f3 * var12 + f5 * var12, var8, var10); - tessellator.addVertexWithUV(var13 + f1 * var12 - f4 * var12, var14 - f2 * var12, var15 + f3 * var12 - f5 * var12, var8, var11); + tessellator.getBuffer().pos(var13 - f1 * var12 - f4 * var12, var14 - f2 * var12, var15 - f3 * var12 - f5 * var12).tex(var9, var11).color(particleRed * var16, particleGreen * var16, particleBlue * var16, 1).endVertex(); + tessellator.getBuffer().pos(var13 - f1 * var12 + f4 * var12, var14 + f2 * var12, var15 - f3 * var12 + f5 * var12).tex(var9, var10).color(particleRed * var16, particleGreen * var16, particleBlue * var16, 1).endVertex(); + tessellator.getBuffer().pos(var13 + f1 * var12 + f4 * var12, var14 + f2 * var12, var15 + f3 * var12 + f5 * var12).tex(var8, var10).color(particleRed * var16, particleGreen * var16, particleBlue * var16, 1).endVertex(); + tessellator.getBuffer().pos(var13 + f1 * var12 - f4 * var12, var14 - f2 * var12, var15 + f3 * var12 - f5 * var12).tex(var8, var11).color(particleRed * var16, particleGreen * var16, particleBlue * var16, 1).endVertex(); } @Override - public void renderParticle(Tessellator tessellator, float f, float f1, float f2, float f3, float f4, float f5) { + public void renderParticle(VertexBuffer worldRendererIn, Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { this.f = f; this.f1 = f1; this.f2 = f2; @@ -132,12 +138,12 @@ public class FXSparkle extends EntityFX { prevPosZ = posZ; if (particleAge++ >= particleMaxAge) - setDead(); + setExpired(); motionY -= 0.04D * particleGravity; if (!noClip && !fake) - pushOutOfBlocks(posX, (boundingBox.minY + boundingBox.maxY) / 2.0D, posZ); + wiggleAround(posX, (getEntityBoundingBox().minY + getEntityBoundingBox().maxY) / 2.0D, posZ); posX += motionX; posY += motionY; @@ -148,111 +154,97 @@ public class FXSparkle extends EntityFX { motionY *= 0.908000001907348633D; motionZ *= 0.908000001907348633D; - if (onGround) { + if (isCollided) { motionX *= 0.69999998807907104D; motionZ *= 0.69999998807907104D; } } if(fake && particleAge > 1) - setDead(); + setExpired(); } public void setGravity(float value) { particleGravity = value; } - protected boolean pushOutOfBlocks(double par1, double par3, double par5) { - int var7 = MathHelper.floor_double(par1); - int var8 = MathHelper.floor_double(par3); - int var9 = MathHelper.floor_double(par5); - double var10 = par1 - var7; - double var12 = par3 - var8; - double var14 = par5 - var9; + // Copy of Entity.pushOutOfBlocks with several important changes + private boolean wiggleAround(double x, double y, double z) + { + BlockPos blockpos = new BlockPos(x, y, z); + double d0 = x - (double)blockpos.getX(); + double d1 = y - (double)blockpos.getY(); + double d2 = z - (double)blockpos.getZ(); - if (!worldObj.isAirBlock(var7, var8, var9)) { - boolean var16 = !worldObj.isBlockNormalCubeDefault(var7 - 1, var8, var9, false); - boolean var17 = !worldObj.isBlockNormalCubeDefault(var7 + 1, var8, var9, false); - boolean var18 = !worldObj.isBlockNormalCubeDefault(var7, var8 - 1, var9, false); - boolean var19 = !worldObj.isBlockNormalCubeDefault(var7, var8 + 1, var9, false); - boolean var20 = !worldObj.isBlockNormalCubeDefault(var7, var8, var9 - 1, false); - boolean var21 = !worldObj.isBlockNormalCubeDefault(var7, var8, var9 + 1, false); - byte var22 = -1; - double var23 = 9999.0D; + // Botania - change collision box list check to !airblock check + if (!worldObj.isAirBlock(blockpos)) + { + EnumFacing enumfacing = EnumFacing.UP; + double d3 = Double.MAX_VALUE; - if (var16 && var10 < var23) { - var23 = var10; - var22 = 0; + if (!this.worldObj.isBlockFullCube(blockpos.west()) && d0 < d3) + { + d3 = d0; + enumfacing = EnumFacing.WEST; } - if (var17 && 1.0D - var10 < var23) { - var23 = 1.0D - var10; - var22 = 1; + if (!this.worldObj.isBlockFullCube(blockpos.east()) && 1.0D - d0 < d3) + { + d3 = 1.0D - d0; + enumfacing = EnumFacing.EAST; } - if (var18 && var12 < var23) { - var23 = var12; - var22 = 2; + + if (!this.worldObj.isBlockFullCube(blockpos.north()) && d2 < d3) + { + d3 = d2; + enumfacing = EnumFacing.NORTH; } - if (var19 && 1.0D - var12 < var23) { - var23 = 1.0D - var12; - var22 = 3; + if (!this.worldObj.isBlockFullCube(blockpos.south()) && 1.0D - d2 < d3) + { + d3 = 1.0D - d2; + enumfacing = EnumFacing.SOUTH; } - if (var20 && var14 < var23) { - var23 = var14; - var22 = 4; + if (!this.worldObj.isBlockFullCube(blockpos.up()) && 1.0D - d1 < d3) + { + d3 = 1.0D - d1; + enumfacing = EnumFacing.UP; } - if (var21 && 1.0D - var14 < var23) { - var23 = 1.0D - var14; - var22 = 5; + float f = this.rand.nextFloat() * 0.05F + 0.01F; // Botania - made multiplier and add both smaller + float f1 = (float)enumfacing.getAxisDirection().getOffset(); + float secondary = (rand.nextFloat() - rand.nextFloat()) * 0.1F; // Botania - Make and use a secondary movement variable below + + if (enumfacing.getAxis() == EnumFacing.Axis.X) + { + this.motionX += (double)(f1 * f); + this.motionY = this.motionZ = secondary; } - - float var25 = rand.nextFloat() * 0.05F + 0.025F; - float var26 = (rand.nextFloat() - rand.nextFloat()) * 0.1F; - - if (var22 == 0) { - motionX = -var25; - motionY=motionZ=var26; + else if (enumfacing.getAxis() == EnumFacing.Axis.Y) + { + this.motionY += (double)(f1 * f); + this.motionX = this.motionZ = secondary; } - - if (var22 == 1) { - motionX = var25; - motionY=motionZ=var26; - } - - if (var22 == 2) { - motionY = -var25; - motionX=motionZ=var26; - } - - if (var22 == 3) { - motionY = var25; - motionX=motionZ=var26; - } - - if (var22 == 4) { - motionZ = -var25; - motionY=motionX=var26; - } - - if (var22 == 5) { - motionZ = var25; - motionY=motionX=var26; + else if (enumfacing.getAxis() == EnumFacing.Axis.Z) + { + this.motionZ += (double)(f1 * f); + this.motionX = this.motionY = secondary; } return true; - } else return false; + } + + return false; } public boolean corrupt = false; public boolean fake = false; - public int multiplier = 2; - public boolean shrink = true; - public int particle = 16; + private int multiplier = 2; + private final boolean shrink = true; + public final int particle = 16; public boolean tinkle = false; - public boolean slowdown = true; + public final boolean slowdown = true; public int currentColor = 0; } diff --git a/src/main/java/vazkii/botania/client/fx/FXWisp.java b/src/main/java/vazkii/botania/client/fx/FXWisp.java index 05ad91c98..1ca8d4faa 100644 --- a/src/main/java/vazkii/botania/client/fx/FXWisp.java +++ b/src/main/java/vazkii/botania/client/fx/FXWisp.java @@ -10,43 +10,48 @@ */ package vazkii.botania.client.fx; +import net.minecraft.client.Minecraft; +import net.minecraft.client.particle.ParticleManager; +import net.minecraft.client.particle.Particle; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.VertexBuffer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import net.minecraftforge.fml.client.FMLClientHandler; +import net.minecraftforge.fml.relauncher.ReflectionHelper; +import org.lwjgl.opengl.GL11; +import vazkii.botania.client.lib.LibResources; +import vazkii.botania.common.core.handler.ConfigHandler; +import vazkii.botania.common.lib.LibObfuscation; + import java.util.ArrayDeque; import java.util.Queue; -import net.minecraft.client.Minecraft; -import net.minecraft.client.particle.EntityFX; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.client.lib.LibResources; -import vazkii.botania.common.core.handler.ConfigHandler; -import vazkii.botania.common.core.helper.ObfuscationHelper; -import cpw.mods.fml.client.FMLClientHandler; - -public class FXWisp extends EntityFX { +public class FXWisp extends Particle { + private static final ResourceLocation vanillaParticles = new ResourceLocation("textures/particle/particles.png"); public static final ResourceLocation particles = new ResourceLocation(LibResources.MISC_WISP_LARGE); - public static Queue queuedRenders = new ArrayDeque(); - public static Queue queuedDepthIgnoringRenders = new ArrayDeque(); + private static final Queue queuedRenders = new ArrayDeque<>(); + private static final Queue queuedDepthIgnoringRenders = new ArrayDeque<>(); // Queue values - float f; - float f1; - float f2; - float f3; - float f4; - float f5; + private float f; + private float f1; + private float f2; + private float f3; + private float f4; + private float f5; public FXWisp(World world, double d, double d1, double d2, float size, float red, float green, float blue, boolean distanceLimit, boolean depthTest, float maxAgeMul) { super(world, d, d1, d2, 0.0D, 0.0D, 0.0D); particleRed = red; particleGreen = green; particleBlue = blue; + particleAlpha = 0.5F; // So MC renders us on the alpha layer, value not actually used particleGravity = 0; motionX = motionY = motionZ = 0; particleScale *= size; @@ -55,9 +60,8 @@ public class FXWisp extends EntityFX { this.depthTest = depthTest; moteHalfLife = particleMaxAge / 2; - noClip = true; setSize(0.01F, 0.01F); - EntityLivingBase renderentity = FMLClientHandler.instance().getClient().renderViewEntity; + Entity renderentity = FMLClientHandler.instance().getClient().getRenderViewEntity(); if(distanceLimit) { int visibleDistance = 50; @@ -77,23 +81,23 @@ public class FXWisp extends EntityFX { ParticleRenderDispatcher.wispFxCount = 0; ParticleRenderDispatcher.depthIgnoringWispFxCount = 0; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F); - Minecraft.getMinecraft().renderEngine.bindTexture(ConfigHandler.matrixMode ? ObfuscationHelper.getParticleTexture() : particles); + GlStateManager.color(1.0F, 1.0F, 1.0F, 0.75F); + Minecraft.getMinecraft().renderEngine.bindTexture(ConfigHandler.matrixMode ? vanillaParticles : particles); if(!queuedRenders.isEmpty()) { - tessellator.startDrawingQuads(); + tessellator.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_LMAP_COLOR); for(FXWisp wisp : queuedRenders) wisp.renderQueued(tessellator, true); tessellator.draw(); } if(!queuedDepthIgnoringRenders.isEmpty()) { - GL11.glDisable(GL11.GL_DEPTH_TEST); - tessellator.startDrawingQuads(); + GlStateManager.disableDepth(); + tessellator.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_LMAP_COLOR); for(FXWisp wisp : queuedDepthIgnoringRenders) wisp.renderQueued(tessellator, false); tessellator.draw(); - GL11.glEnable(GL11.GL_DEPTH_TEST); + GlStateManager.enableDepth(); } queuedRenders.clear(); @@ -105,8 +109,7 @@ public class FXWisp extends EntityFX { ParticleRenderDispatcher.wispFxCount++; else ParticleRenderDispatcher.depthIgnoringWispFxCount++; - float agescale = 0; - agescale = (float)particleAge / (float) moteHalfLife; + float agescale = (float)particleAge / (float) moteHalfLife; if (agescale > 1F) agescale = 2 - agescale; @@ -116,17 +119,17 @@ public class FXWisp extends EntityFX { float f11 = (float)(prevPosX + (posX - prevPosX) * f - interpPosX); float f12 = (float)(prevPosY + (posY - prevPosY) * f - interpPosY); float f13 = (float)(prevPosZ + (posZ - prevPosZ) * f - interpPosZ); - - tessellator.setBrightness(240); - tessellator.setColorRGBA_F(particleRed, particleGreen, particleBlue, 0.5F); - tessellator.addVertexWithUV(f11 - f1 * f10 - f4 * f10, f12 - f2 * f10, f13 - f3 * f10 - f5 * f10, 0, 1); - tessellator.addVertexWithUV(f11 - f1 * f10 + f4 * f10, f12 + f2 * f10, f13 - f3 * f10 + f5 * f10, 1, 1); - tessellator.addVertexWithUV(f11 + f1 * f10 + f4 * f10, f12 + f2 * f10, f13 + f3 * f10 + f5 * f10, 1, 0); - tessellator.addVertexWithUV(f11 + f1 * f10 - f4 * f10, f12 - f2 * f10, f13 + f3 * f10 - f5 * f10, 0, 0); + int combined = 15 << 20 | 15 << 4; + int k3 = combined >> 16 & 0xFFFF; + int l3 = combined & 0xFFFF; + tessellator.getBuffer().pos(f11 - f1 * f10 - f4 * f10, f12 - f2 * f10, f13 - f3 * f10 - f5 * f10).tex(0, 1).lightmap(k3, l3).color(particleRed, particleGreen, particleBlue, 0.5F).endVertex(); + tessellator.getBuffer().pos(f11 - f1 * f10 + f4 * f10, f12 + f2 * f10, f13 - f3 * f10 + f5 * f10).tex(1, 1).lightmap(k3, l3).color(particleRed, particleGreen, particleBlue, 0.5F).endVertex(); + tessellator.getBuffer().pos(f11 + f1 * f10 + f4 * f10, f12 + f2 * f10, f13 + f3 * f10 + f5 * f10).tex(1, 0).lightmap(k3, l3).color(particleRed, particleGreen, particleBlue, 0.5F).endVertex(); + tessellator.getBuffer().pos(f11 + f1 * f10 - f4 * f10, f12 - f2 * f10, f13 + f3 * f10 - f5 * f10).tex(0, 0).lightmap(k3, l3).color(particleRed, particleGreen, particleBlue, 0.5F).endVertex(); } @Override - public void renderParticle(Tessellator tessellator, float f, float f1, float f2, float f3, float f4, float f5) { + public void renderParticle(VertexBuffer wr, Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { this.f = f; this.f1 = f1; this.f2 = f2; @@ -146,7 +149,7 @@ public class FXWisp extends EntityFX { prevPosZ = posZ; if (particleAge++ >= particleMaxAge) - setDead(); + setExpired(); motionY -= 0.04D * particleGravity; posX += motionX; @@ -161,10 +164,16 @@ public class FXWisp extends EntityFX { particleGravity = value; } - boolean depthTest = true; + public void setSpeed(float mx, float my, float mz) { + motionX = mx; + motionY = my; + motionZ = mz; + } + + private boolean depthTest = true; public boolean distanceLimit = true; - float moteParticleScale; - int moteHalfLife; + private final float moteParticleScale; + private final int moteHalfLife; public boolean tinkle = false; public int blendmode = 1; } diff --git a/src/main/java/vazkii/botania/client/fx/ParticleRenderDispatcher.java b/src/main/java/vazkii/botania/client/fx/ParticleRenderDispatcher.java index 51915027f..39aa887c1 100644 --- a/src/main/java/vazkii/botania/client/fx/ParticleRenderDispatcher.java +++ b/src/main/java/vazkii/botania/client/fx/ParticleRenderDispatcher.java @@ -12,9 +12,9 @@ package vazkii.botania.client.fx; import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; import net.minecraft.profiler.Profiler; - import org.lwjgl.opengl.GL11; public final class ParticleRenderDispatcher { @@ -28,16 +28,16 @@ public final class ParticleRenderDispatcher { // Called from LightningHandler.onRenderWorldLast since that was // already registered. /shrug public static void dispatch() { - Tessellator tessellator = Tessellator.instance; + Tessellator tessellator = Tessellator.getInstance(); Profiler profiler = Minecraft.getMinecraft().mcProfiler; - GL11.glPushAttrib(GL11.GL_LIGHTING); - GL11.glDepthMask(false); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); - GL11.glAlphaFunc(GL11.GL_GREATER, 0.003921569F); - GL11.glDisable(GL11.GL_LIGHTING); + GL11.glPushAttrib(GL11.GL_LIGHTING_BIT); + GlStateManager.depthMask(false); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); + GlStateManager.alphaFunc(GL11.GL_GREATER, 0.003921569F); + GlStateManager.disableLighting(); profiler.startSection("sparkle"); FXSparkle.dispatchQueuedRenders(tessellator); @@ -45,9 +45,9 @@ public final class ParticleRenderDispatcher { FXWisp.dispatchQueuedRenders(tessellator); profiler.endSection(); - GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); - GL11.glDisable(GL11.GL_BLEND); - GL11.glDepthMask(true); + GlStateManager.alphaFunc(GL11.GL_GREATER, 0.1F); + GlStateManager.disableBlend(); + GlStateManager.depthMask(true); GL11.glPopAttrib(); } diff --git a/src/main/java/vazkii/botania/client/gui/GuiAchievementsHacky.java b/src/main/java/vazkii/botania/client/gui/GuiAchievementsHacky.java index 9891b66ed..cd719d940 100644 --- a/src/main/java/vazkii/botania/client/gui/GuiAchievementsHacky.java +++ b/src/main/java/vazkii/botania/client/gui/GuiAchievementsHacky.java @@ -10,24 +10,23 @@ */ package vazkii.botania.client.gui; -import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.achievement.GuiAchievements; -import net.minecraft.stats.StatFileWriter; +import net.minecraft.stats.StatisticsManager; +import net.minecraftforge.fml.relauncher.ReflectionHelper; import vazkii.botania.common.achievement.ModAchievements; -import cpw.mods.fml.relauncher.ReflectionHelper; public class GuiAchievementsHacky extends GuiAchievements { - public GuiAchievementsHacky(GuiScreen p_i45026_1_, StatFileWriter p_i45026_2_) { - super(p_i45026_1_, p_i45026_2_); + public GuiAchievementsHacky(GuiScreen screen, StatisticsManager stats) { + super(screen, stats); ReflectionHelper.setPrivateValue(GuiAchievements.class, this, ModAchievements.pageIndex, "currentPage"); } @Override public void initGui() { super.initGui(); - ((GuiButton) buttonList.get(1)).displayString = ModAchievements.botaniaPage.getName(); + buttonList.get(1).displayString = ModAchievements.botaniaPage.getName(); } } diff --git a/src/main/java/vazkii/botania/client/gui/GuiBotaniaConfig.java b/src/main/java/vazkii/botania/client/gui/GuiBotaniaConfig.java index 4f9d20e1b..38f88a519 100644 --- a/src/main/java/vazkii/botania/client/gui/GuiBotaniaConfig.java +++ b/src/main/java/vazkii/botania/client/gui/GuiBotaniaConfig.java @@ -13,9 +13,9 @@ package vazkii.botania.client.gui; import net.minecraft.client.gui.GuiScreen; import net.minecraftforge.common.config.ConfigElement; import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.fml.client.config.GuiConfig; import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.lib.LibMisc; -import cpw.mods.fml.client.config.GuiConfig; public class GuiBotaniaConfig extends GuiConfig { diff --git a/src/main/java/vazkii/botania/client/gui/SlotLocked.java b/src/main/java/vazkii/botania/client/gui/SlotLocked.java index 72b7ccadd..89d467435 100644 --- a/src/main/java/vazkii/botania/client/gui/SlotLocked.java +++ b/src/main/java/vazkii/botania/client/gui/SlotLocked.java @@ -17,17 +17,17 @@ import net.minecraft.item.ItemStack; public class SlotLocked extends Slot { - public SlotLocked(IInventory p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_) { - super(p_i1824_1_, p_i1824_2_, p_i1824_3_, p_i1824_4_); + public SlotLocked(IInventory inv, int index, int xPos, int yPos) { + super(inv, index, xPos, yPos); } @Override - public boolean canTakeStack(EntityPlayer p_82869_1_) { + public boolean canTakeStack(EntityPlayer player) { return false; } @Override - public boolean isItemValid(ItemStack p_75214_1_) { + public boolean isItemValid(ItemStack stack) { return false; } diff --git a/src/main/java/vazkii/botania/client/gui/bag/ContainerFlowerBag.java b/src/main/java/vazkii/botania/client/gui/bag/ContainerFlowerBag.java index 5160afa2a..d27c97212 100644 --- a/src/main/java/vazkii/botania/client/gui/bag/ContainerFlowerBag.java +++ b/src/main/java/vazkii/botania/client/gui/bag/ContainerFlowerBag.java @@ -11,28 +11,31 @@ package vazkii.botania.client.gui.bag; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ClickType; import net.minecraft.inventory.Container; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; +import net.minecraftforge.items.SlotItemHandler; import vazkii.botania.client.gui.SlotLocked; +import javax.annotation.Nonnull; + public class ContainerFlowerBag extends Container { - InventoryFlowerBag flowerBagInv; + private final InventoryFlowerBag flowerBagInv; - public ContainerFlowerBag(EntityPlayer player) { + public ContainerFlowerBag(InventoryPlayer playerInv, InventoryFlowerBag flowerBagInv) { int i; int j; - int slot = player.inventory.currentItem; - IInventory playerInv = player.inventory; - flowerBagInv = new InventoryFlowerBag(player, slot); + this.flowerBagInv = flowerBagInv; for(i = 0; i < 2; ++i) for(j = 0; j < 8; ++j) { int k = j + i * 8; - addSlotToContainer(new SlotFlower(flowerBagInv, k, 17 + j * 18, 26 + i * 18, k)); + addSlotToContainer(new SlotItemHandler(flowerBagInv, k, 17 + j * 18, 26 + i * 18)); } for(i = 0; i < 3; ++i) @@ -40,7 +43,7 @@ public class ContainerFlowerBag extends Container { addSlotToContainer(new Slot(playerInv, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); for(i = 0; i < 9; ++i) { - if(player.inventory.currentItem == i) + if(playerInv.getStackInSlot(i) == flowerBagInv.bag) addSlotToContainer(new SlotLocked(playerInv, i, 8 + i * 18, 142)); else addSlotToContainer(new Slot(playerInv, i, 8 + i * 18, 142)); } @@ -48,49 +51,40 @@ public class ContainerFlowerBag extends Container { } @Override - public boolean canInteractWith(EntityPlayer player) { - boolean can = flowerBagInv.isUseableByPlayer(player); - if(!can) - onContainerClosed(player); - - return can; + public boolean canInteractWith(@Nonnull EntityPlayer player) { + return player.getHeldItemMainhand() == flowerBagInv.bag + || player.getHeldItemOffhand() == flowerBagInv.bag; } @Override - public void onContainerClosed(EntityPlayer player) { - super.onContainerClosed(player); - flowerBagInv.pushInventory(); - } - - @Override - public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) { + public ItemStack transferStackInSlot(EntityPlayer player, int slotIndex) { ItemStack itemstack = null; - Slot slot = (Slot)inventorySlots.get(p_82846_2_); + Slot slot = inventorySlots.get(slotIndex); if(slot != null && slot.getHasStack()) { ItemStack itemstack1 = slot.getStack(); itemstack = itemstack1.copy(); - if(p_82846_2_ < 16) { + if(slotIndex < 16) { if(!mergeItemStack(itemstack1, 16, 52, true)) return null; } else { int i = itemstack.getItemDamage(); if(i < 16) { - Slot slot1 = (Slot)inventorySlots.get(i); + Slot slot1 = inventorySlots.get(i); if(slot1.isItemValid(itemstack) && !mergeItemStack(itemstack1, i, i + 1, true)) return null; } } if(itemstack1.stackSize == 0) - slot.putStack((ItemStack)null); + slot.putStack(null); else slot.onSlotChanged(); if(itemstack1.stackSize == itemstack.stackSize) return null; - slot.onPickupFromSlot(p_82846_1_, itemstack1); + slot.onPickupFromSlot(player, itemstack1); } return itemstack; diff --git a/src/main/java/vazkii/botania/client/gui/bag/GuiFlowerBag.java b/src/main/java/vazkii/botania/client/gui/bag/GuiFlowerBag.java index b3cee8997..fd172b4a2 100644 --- a/src/main/java/vazkii/botania/client/gui/bag/GuiFlowerBag.java +++ b/src/main/java/vazkii/botania/client/gui/bag/GuiFlowerBag.java @@ -10,41 +10,39 @@ */ package vazkii.botania.client.gui.bag; -import java.util.List; - import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; - -import org.lwjgl.opengl.GL11; - +import net.minecraftforge.items.SlotItemHandler; import vazkii.botania.client.lib.LibResources; import vazkii.botania.common.block.ModBlocks; +import java.util.List; + public class GuiFlowerBag extends GuiContainer { private static final ResourceLocation texture = new ResourceLocation(LibResources.GUI_FLOWER_BAG); - public GuiFlowerBag(EntityPlayer player) { - super(new ContainerFlowerBag(player)); + public GuiFlowerBag(InventoryPlayer playerInv, InventoryFlowerBag flowerBagInv) { + super(new ContainerFlowerBag(playerInv, flowerBagInv)); } @Override - protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { - String s = StatCollector.translateToLocal("item.botania:flowerBag.name"); + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { + String s = I18n.format("item.botania:flowerBag.name"); fontRendererObj.drawString(s, xSize / 2 - fontRendererObj.getStringWidth(s) / 2, 6, 4210752); - fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, ySize - 96 + 2, 4210752); + fontRendererObj.drawString(I18n.format("container.inventory"), 8, ySize - 96 + 2, 4210752); } @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); mc.getTextureManager().bindTexture(texture); int k = (width - xSize) / 2; int l = (height - ySize) / 2; @@ -52,23 +50,18 @@ public class GuiFlowerBag extends GuiContainer { List slotList = inventorySlots.inventorySlots; for(Slot slot : slotList) - if(slot instanceof SlotFlower) { - SlotFlower slotf = (SlotFlower) slot; + if(slot instanceof SlotItemHandler) { + SlotItemHandler slotf = (SlotItemHandler) slot; if(!slotf.getHasStack()) { - ItemStack stack = new ItemStack(ModBlocks.flower, 0, slotf.color); + ItemStack stack = new ItemStack(ModBlocks.flower, 0, slotf.getSlotIndex()); // index matches colors int x = guiLeft + slotf.xDisplayPosition; int y = guiTop + slotf.yDisplayPosition; RenderHelper.enableGUIStandardItemLighting(); - RenderItem.getInstance().renderItemIntoGUI(mc.fontRenderer, mc.renderEngine, stack, x, y); + mc.getRenderItem().renderItemIntoGUI(stack, x, y); RenderHelper.disableStandardItemLighting(); - mc.fontRenderer.drawStringWithShadow("0", x + 11, y + 9, 0xFF6666); + mc.fontRendererObj.drawStringWithShadow("0", x + 11, y + 9, 0xFF6666); } } } - @Override - protected boolean checkHotbarKeys(int p_146983_1_) { - return false; - } - } diff --git a/src/main/java/vazkii/botania/client/gui/bag/InventoryFlowerBag.java b/src/main/java/vazkii/botania/client/gui/bag/InventoryFlowerBag.java index 10fcb06f9..7451d27d0 100644 --- a/src/main/java/vazkii/botania/client/gui/bag/InventoryFlowerBag.java +++ b/src/main/java/vazkii/botania/client/gui/bag/InventoryFlowerBag.java @@ -10,151 +10,42 @@ */ package vazkii.botania.client.gui.bag; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; -import vazkii.botania.common.item.ItemFlowerBag; -import vazkii.botania.common.item.ModItems; -import vazkii.botania.common.lib.LibItemNames; +import net.minecraftforge.items.CapabilityItemHandler; +import net.minecraftforge.items.IItemHandlerModifiable; -public class InventoryFlowerBag implements IInventory { +public class InventoryFlowerBag implements IItemHandlerModifiable { - private static final ItemStack[] FALLBACK_INVENTORY = new ItemStack[16]; + private final IItemHandlerModifiable bagInv; + final ItemStack bag; - EntityPlayer player; - int slot; - ItemStack[] stacks = null; - - boolean invPushed = false; - ItemStack storedInv = null; - - public InventoryFlowerBag(EntityPlayer player, int slot) { - this.player = player; - this.slot = slot; - } - - public static boolean isFlowerBag(ItemStack stack) { - return stack != null && stack.getItem() == ModItems.flowerBag; - } - - ItemStack getStack() { - ItemStack stack = player.inventory.getStackInSlot(slot); - if(stack != null) - storedInv = stack; - return stack; - } - - ItemStack[] getInventory() { - if(stacks != null) - return stacks; - - ItemStack stack = getStack(); - if(isFlowerBag(getStack())) { - stacks = ItemFlowerBag.loadStacks(stack); - return stacks; - } - - return FALLBACK_INVENTORY; - } - - public void pushInventory() { - if(invPushed) - return; - - ItemStack stack = getStack(); - if(stack == null) - stack = storedInv; - - if(stack != null) { - ItemStack[] inv = getInventory(); - ItemFlowerBag.setStacks(stack, inv); - } - - invPushed = true; + public InventoryFlowerBag(ItemStack bag) { + this.bag = bag; + this.bagInv = (IItemHandlerModifiable) bag.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null); } @Override - public int getSizeInventory() { - return 16; + public void setStackInSlot(int slot, ItemStack stack) { + bagInv.setStackInSlot(slot, stack); } @Override - public ItemStack getStackInSlot(int i) { - return getInventory()[i]; + public int getSlots() { + return bagInv.getSlots(); } @Override - public ItemStack decrStackSize(int i, int j) { - ItemStack[] inventorySlots = getInventory(); - if (inventorySlots[i] != null) { - ItemStack stackAt; - - if (inventorySlots[i].stackSize <= j) { - stackAt = inventorySlots[i]; - inventorySlots[i] = null; - return stackAt; - } else { - stackAt = inventorySlots[i].splitStack(j); - - if (inventorySlots[i].stackSize == 0) - inventorySlots[i] = null; - - return stackAt; - } - } - - return null; + public ItemStack getStackInSlot(int slot) { + return bagInv.getStackInSlot(slot); } @Override - public ItemStack getStackInSlotOnClosing(int i) { - return getStackInSlot(i); + public ItemStack insertItem(int slot, ItemStack stack, boolean simulate) { + return bagInv.insertItem(slot, stack, simulate); } @Override - public void setInventorySlotContents(int i, ItemStack itemstack) { - ItemStack[] inventorySlots = getInventory(); - inventorySlots[i] = itemstack; + public ItemStack extractItem(int slot, int amount, boolean simulate) { + return bagInv.extractItem(slot, amount, simulate); } - - @Override - public int getInventoryStackLimit() { - return isFlowerBag(getStack()) ? 64 : 0; - } - - @Override - public boolean isUseableByPlayer(EntityPlayer entityplayer) { - return isFlowerBag(getStack()); - } - - @Override - public boolean isItemValidForSlot(int i, ItemStack itemstack) { - return isFlowerBag(getStack()); - } - - @Override - public boolean hasCustomInventoryName() { - return false; - } - - @Override - public void openInventory() { - // NO-OP - } - - @Override - public void closeInventory() { - // NO-OP - } - - @Override - public String getInventoryName() { - return LibItemNames.FLOWER_BAG; - } - - @Override - public void markDirty() { - // NO-OP - } - } diff --git a/src/main/java/vazkii/botania/client/gui/bag/SlotFlower.java b/src/main/java/vazkii/botania/client/gui/bag/SlotFlower.java deleted file mode 100644 index ba4c32378..000000000 --- a/src/main/java/vazkii/botania/client/gui/bag/SlotFlower.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Mar 16, 2015, 7:20:05 PM (GMT)] - */ -package vazkii.botania.client.gui.bag; - -import net.minecraft.inventory.Slot; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import vazkii.botania.common.block.ModBlocks; - -public class SlotFlower extends Slot { - - InventoryFlowerBag inv; - int color; - - public SlotFlower(InventoryFlowerBag p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_, int color) { - super(p_i1824_1_, p_i1824_2_, p_i1824_3_, p_i1824_4_); - this.color = color; - inv = p_i1824_1_; - } - - @Override - public void onSlotChange(ItemStack oldStack, ItemStack newStack) { - inv.setInventorySlotContents(color, newStack); - } - - @Override - public boolean isItemValid(ItemStack stack) { - return stack.getItem() == Item.getItemFromBlock(ModBlocks.flower) && stack.getItemDamage() == color; - } - -} diff --git a/src/main/java/vazkii/botania/client/gui/box/ContainerBaubleBox.java b/src/main/java/vazkii/botania/client/gui/box/ContainerBaubleBox.java index 24d54be75..d3d722be7 100644 --- a/src/main/java/vazkii/botania/client/gui/box/ContainerBaubleBox.java +++ b/src/main/java/vazkii/botania/client/gui/box/ContainerBaubleBox.java @@ -10,31 +10,33 @@ */ package vazkii.botania.client.gui.box; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import vazkii.botania.api.mana.IManaItem; -import vazkii.botania.client.gui.SlotLocked; import baubles.api.BaubleType; import baubles.api.IBauble; import baubles.common.container.InventoryBaubles; import baubles.common.container.SlotBauble; import baubles.common.lib.PlayerHandler; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraftforge.items.SlotItemHandler; +import vazkii.botania.api.mana.IManaItem; +import vazkii.botania.client.gui.SlotLocked; + +import javax.annotation.Nonnull; public class ContainerBaubleBox extends Container { - InventoryBaubleBox baubleBoxInv; - InventoryBaubles baubles; + private final InventoryBaubleBox baubleBoxInv; + private final InventoryBaubles baubles; - public ContainerBaubleBox(EntityPlayer player) { + public ContainerBaubleBox(EntityPlayer player, InventoryBaubleBox boxInv) { int i; int j; - int slot = player.inventory.currentItem; IInventory playerInv = player.inventory; - baubleBoxInv = new InventoryBaubleBox(player, slot); + baubleBoxInv = boxInv; baubles = new InventoryBaubles(player); baubles.setEventHandler(this); @@ -49,7 +51,7 @@ public class ContainerBaubleBox extends Container { for(i = 0; i < 4; ++i) for(j = 0; j < 6; ++j) { int k = j + i * 6; - addSlotToContainer(new SlotAnyBauble(baubleBoxInv, k, 62 + j * 18, 8 + i * 18)); + addSlotToContainer(new SlotItemHandler(baubleBoxInv, k, 62 + j * 18, 8 + i * 18)); } for(i = 0; i < 3; ++i) @@ -57,7 +59,7 @@ public class ContainerBaubleBox extends Container { addSlotToContainer(new Slot(playerInv, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); for(i = 0; i < 9; ++i) { - if(player.inventory.currentItem == i) + if(playerInv.getStackInSlot(i) == baubleBoxInv.box) addSlotToContainer(new SlotLocked(playerInv, i, 8 + i * 18, 142)); else addSlotToContainer(new Slot(playerInv, i, 8 + i * 18, 142)); } @@ -65,40 +67,35 @@ public class ContainerBaubleBox extends Container { } @Override - public boolean canInteractWith(EntityPlayer player) { - boolean can = baubleBoxInv.isUseableByPlayer(player); - if(!can) - onContainerClosed(player); - - return can; + public boolean canInteractWith(@Nonnull EntityPlayer player) { + return player.getHeldItemMainhand() == baubleBoxInv.box + || player.getHeldItemOffhand() == baubleBoxInv.box; } @Override public void onContainerClosed(EntityPlayer player) { super.onContainerClosed(player); - baubleBoxInv.pushInventory(); if(!player.worldObj.isRemote) PlayerHandler.setPlayerBaubles(player, baubles); } @Override - public void putStacksInSlots(ItemStack[] p_75131_1_) { + public void putStacksInSlots(ItemStack[] arr) { baubles.blockEvents = true; - super.putStacksInSlots(p_75131_1_); + super.putStacksInSlots(arr); } @Override - public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) { + public ItemStack transferStackInSlot(EntityPlayer player, int slotIndex) { ItemStack itemstack = null; - Slot slot = (Slot)inventorySlots.get(p_82846_2_); + Slot slot = inventorySlots.get(slotIndex); if(slot != null && slot.getHasStack()) { ItemStack itemstack1 = slot.getStack(); itemstack = itemstack1.copy(); - System.out.println(p_82846_2_ + " " + itemstack); - if(p_82846_2_ < 28) { + if(slotIndex < 28) { if(!mergeItemStack(itemstack1, 28, 64, true)) return null; } else { @@ -107,13 +104,13 @@ public class ContainerBaubleBox extends Container { } if(itemstack1.stackSize == 0) - slot.putStack((ItemStack)null); + slot.putStack(null); else slot.onSlotChanged(); if(itemstack1.stackSize == itemstack.stackSize) return null; - slot.onPickupFromSlot(p_82846_1_, itemstack1); + slot.onPickupFromSlot(player, itemstack1); } return itemstack; diff --git a/src/main/java/vazkii/botania/client/gui/box/GuiBaubleBox.java b/src/main/java/vazkii/botania/client/gui/box/GuiBaubleBox.java index 798a95373..de7e87501 100644 --- a/src/main/java/vazkii/botania/client/gui/box/GuiBaubleBox.java +++ b/src/main/java/vazkii/botania/client/gui/box/GuiBaubleBox.java @@ -11,43 +11,34 @@ package vazkii.botania.client.gui.box; import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.InventoryEffectRenderer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Slot; import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - import vazkii.botania.client.lib.LibResources; public class GuiBaubleBox extends InventoryEffectRenderer { private static final ResourceLocation texture = new ResourceLocation(LibResources.GUI_BAUBLE_BOX); - public GuiBaubleBox(EntityPlayer player) { - super(new ContainerBaubleBox(player)); + public GuiBaubleBox(EntityPlayer player, InventoryBaubleBox box) { + super(new ContainerBaubleBox(player, box)); } @Override - protected boolean checkHotbarKeys(int p_146983_1_) { - return false; - } - - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); mc.getTextureManager().bindTexture(texture); - int k = (width - xSize) / 2; - int l = (height - ySize) / 2; - drawTexturedModalRect(k, l, 0, 0, xSize, ySize); + drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); for(int i1 = 0; i1 < 4; ++i1) { - Slot slot = (Slot) inventorySlots.inventorySlots.get(i1); + Slot slot = inventorySlots.inventorySlots.get(i1); if(slot.getHasStack() && slot.getSlotStackLimit() == 1) - drawTexturedModalRect(k+slot.xDisplayPosition, l+slot.yDisplayPosition, 200, 0, 16, 16); + drawTexturedModalRect(guiLeft+slot.xDisplayPosition, guiTop+slot.yDisplayPosition, 200, 0, 16, 16); } - GuiInventory.func_147046_a(guiLeft + 43, guiTop + 61, 20, guiLeft + 43 - p_146976_2_, guiTop + 45 - 30 - p_146976_3_, mc.thePlayer); + GuiInventory.drawEntityOnScreen(guiLeft + 43, guiTop + 61, 20, guiLeft + 43 - mouseX, guiTop + 45 - 30 - mouseY, mc.thePlayer); } } diff --git a/src/main/java/vazkii/botania/client/gui/box/InventoryBaubleBox.java b/src/main/java/vazkii/botania/client/gui/box/InventoryBaubleBox.java index 415eee637..3d2cca86e 100644 --- a/src/main/java/vazkii/botania/client/gui/box/InventoryBaubleBox.java +++ b/src/main/java/vazkii/botania/client/gui/box/InventoryBaubleBox.java @@ -10,151 +10,43 @@ */ package vazkii.botania.client.gui.box; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; -import vazkii.botania.common.item.ItemBaubleBox; -import vazkii.botania.common.item.ModItems; -import vazkii.botania.common.lib.LibItemNames; +import net.minecraftforge.items.CapabilityItemHandler; +import net.minecraftforge.items.IItemHandlerModifiable; -public class InventoryBaubleBox implements IInventory { +public class InventoryBaubleBox implements IItemHandlerModifiable { - private static final ItemStack[] FALLBACK_INVENTORY = new ItemStack[16]; + private final IItemHandlerModifiable boxInv; + final ItemStack box; - EntityPlayer player; - int slot; - ItemStack[] stacks = null; - - boolean invPushed = false; - ItemStack storedInv = null; - - public InventoryBaubleBox(EntityPlayer player, int slot) { - this.player = player; - this.slot = slot; - } - - public static boolean isBaubleBox(ItemStack stack) { - return stack != null && stack.getItem() == ModItems.baubleBox; - } - - ItemStack getStack() { - ItemStack stack = player.inventory.getStackInSlot(slot); - if(stack != null) - storedInv = stack; - return stack; - } - - ItemStack[] getInventory() { - if(stacks != null) - return stacks; - - ItemStack stack = getStack(); - if(isBaubleBox(getStack())) { - stacks = ItemBaubleBox.loadStacks(stack); - return stacks; - } - - return FALLBACK_INVENTORY; - } - - public void pushInventory() { - if(invPushed) - return; - - ItemStack stack = getStack(); - if(stack == null) - stack = storedInv; - - if(stack != null) { - ItemStack[] inv = getInventory(); - ItemBaubleBox.setStacks(stack, inv); - } - - invPushed = true; + public InventoryBaubleBox(ItemStack box) { + this.box = box; + this.boxInv = (IItemHandlerModifiable) box.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null); } @Override - public int getSizeInventory() { - return 16; + public void setStackInSlot(int slot, ItemStack stack) { + boxInv.setStackInSlot(slot, stack); } @Override - public ItemStack getStackInSlot(int i) { - return getInventory()[i]; + public int getSlots() { + return boxInv.getSlots(); } @Override - public ItemStack decrStackSize(int i, int j) { - ItemStack[] inventorySlots = getInventory(); - if (inventorySlots[i] != null) { - ItemStack stackAt; - - if (inventorySlots[i].stackSize <= j) { - stackAt = inventorySlots[i]; - inventorySlots[i] = null; - return stackAt; - } else { - stackAt = inventorySlots[i].splitStack(j); - - if (inventorySlots[i].stackSize == 0) - inventorySlots[i] = null; - - return stackAt; - } - } - - return null; + public ItemStack getStackInSlot(int slot) { + return boxInv.getStackInSlot(slot); } @Override - public ItemStack getStackInSlotOnClosing(int i) { - return getStackInSlot(i); + public ItemStack insertItem(int slot, ItemStack stack, boolean simulate) { + return boxInv.insertItem(slot, stack, simulate); } @Override - public void setInventorySlotContents(int slot, ItemStack itemstack) { - ItemStack[] inventorySlots = getInventory(); - inventorySlots[slot] = itemstack; - } - - @Override - public int getInventoryStackLimit() { - return isBaubleBox(getStack()) ? 64 : 0; - } - - @Override - public boolean isUseableByPlayer(EntityPlayer entityplayer) { - return isBaubleBox(getStack()); - } - - @Override - public boolean isItemValidForSlot(int i, ItemStack itemstack) { - return isBaubleBox(getStack()); - } - - @Override - public boolean hasCustomInventoryName() { - return false; - } - - @Override - public void openInventory() { - // NO-OP - } - - @Override - public void closeInventory() { - // NO-OP - } - - @Override - public String getInventoryName() { - return LibItemNames.BAUBLE_BOX; - } - - @Override - public void markDirty() { - // NO-OP + public ItemStack extractItem(int slot, int amount, boolean simulate) { + return boxInv.extractItem(slot, amount, simulate); } } diff --git a/src/main/java/vazkii/botania/client/gui/box/SlotAnyBauble.java b/src/main/java/vazkii/botania/client/gui/box/SlotAnyBauble.java deleted file mode 100644 index e19453b9b..000000000 --- a/src/main/java/vazkii/botania/client/gui/box/SlotAnyBauble.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [25/11/2015, 19:59:22 (GMT)] - */ -package vazkii.botania.client.gui.box; - -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import vazkii.botania.api.mana.IManaItem; -import baubles.api.IBauble; - -public class SlotAnyBauble extends Slot { - - InventoryBaubleBox inv; - - public SlotAnyBauble(InventoryBaubleBox p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_) { - super(p_i1824_1_, p_i1824_2_, p_i1824_3_, p_i1824_4_); - inv = p_i1824_1_; - } - - @Override - public void onSlotChange(ItemStack oldStack, ItemStack newStack) { - inv.setInventorySlotContents(slotNumber, newStack); - } - - @Override - public boolean isItemValid(ItemStack stack) { - return stack.getItem() instanceof IBauble || stack.getItem() instanceof IManaItem; - } - -} diff --git a/src/main/java/vazkii/botania/client/gui/crafting/ContainerCraftingHalo.java b/src/main/java/vazkii/botania/client/gui/crafting/ContainerCraftingHalo.java index e335f5229..8d1dd16bd 100644 --- a/src/main/java/vazkii/botania/client/gui/crafting/ContainerCraftingHalo.java +++ b/src/main/java/vazkii/botania/client/gui/crafting/ContainerCraftingHalo.java @@ -15,12 +15,15 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.ContainerWorkbench; import net.minecraft.inventory.Slot; import net.minecraft.inventory.SlotCrafting; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import javax.annotation.Nonnull; + public class ContainerCraftingHalo extends ContainerWorkbench { - public ContainerCraftingHalo(InventoryPlayer p_i1808_1_, World p_i1808_2_) { - super(p_i1808_1_, p_i1808_2_, 0, 0, 0); + public ContainerCraftingHalo(InventoryPlayer playerInv, World world) { + super(playerInv, world, BlockPos.ORIGIN); craftMatrix = new InventoryCraftingHalo(this, 3, 3); @@ -28,7 +31,7 @@ public class ContainerCraftingHalo extends ContainerWorkbench { inventoryItemStacks.clear(); // Le copypasta - addSlotToContainer(new SlotCrafting(p_i1808_1_.player, craftMatrix, craftResult, 0, 124, 35)); + addSlotToContainer(new SlotCrafting(playerInv.player, craftMatrix, craftResult, 0, 124, 35)); int l; int i1; @@ -44,20 +47,20 @@ public class ContainerCraftingHalo extends ContainerWorkbench { { for (i1 = 0; i1 < 9; ++i1) { - addSlotToContainer(new Slot(p_i1808_1_, i1 + l * 9 + 9, 8 + i1 * 18, 84 + l * 18)); + addSlotToContainer(new Slot(playerInv, i1 + l * 9 + 9, 8 + i1 * 18, 84 + l * 18)); } } for (l = 0; l < 9; ++l) { - addSlotToContainer(new Slot(p_i1808_1_, l, 8 + l * 18, 142)); + addSlotToContainer(new Slot(playerInv, l, 8 + l * 18, 142)); } onCraftMatrixChanged(craftMatrix); } @Override - public boolean canInteractWith(EntityPlayer p_75145_1_) { + public boolean canInteractWith(@Nonnull EntityPlayer player) { return true; } } diff --git a/src/main/java/vazkii/botania/client/gui/crafting/GuiCraftingHalo.java b/src/main/java/vazkii/botania/client/gui/crafting/GuiCraftingHalo.java index fbc503ff6..fdc0401d8 100644 --- a/src/main/java/vazkii/botania/client/gui/crafting/GuiCraftingHalo.java +++ b/src/main/java/vazkii/botania/client/gui/crafting/GuiCraftingHalo.java @@ -11,31 +11,30 @@ package vazkii.botania.client.gui.crafting; import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; -import org.lwjgl.opengl.GL11; - // This is pretty much a copypasta of GuiCrafting >_> public class GuiCraftingHalo extends GuiContainer { private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation("textures/gui/container/crafting_table.png"); - public GuiCraftingHalo(InventoryPlayer p_i1084_1_, World p_i1084_2_) { - super(new ContainerCraftingHalo(p_i1084_1_, p_i1084_2_)); + public GuiCraftingHalo(InventoryPlayer playerInv, World world) { + super(new ContainerCraftingHalo(playerInv, world)); } @Override - protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { - fontRendererObj.drawString(I18n.format("container.crafting", new Object[0]), 28, 6, 4210752); - fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, ySize - 96 + 2, 4210752); + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { + fontRendererObj.drawString(I18n.format("container.crafting"), 28, 6, 4210752); + fontRendererObj.drawString(I18n.format("container.inventory"), 8, ySize - 96 + 2, 4210752); } @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); mc.getTextureManager().bindTexture(craftingTableGuiTextures); int k = (width - xSize) / 2; int l = (height - ySize) / 2; diff --git a/src/main/java/vazkii/botania/client/gui/crafting/InventoryCraftingHalo.java b/src/main/java/vazkii/botania/client/gui/crafting/InventoryCraftingHalo.java index 6089d6671..59e0eafd5 100644 --- a/src/main/java/vazkii/botania/client/gui/crafting/InventoryCraftingHalo.java +++ b/src/main/java/vazkii/botania/client/gui/crafting/InventoryCraftingHalo.java @@ -15,8 +15,8 @@ import net.minecraft.inventory.InventoryCrafting; public class InventoryCraftingHalo extends InventoryCrafting { - public InventoryCraftingHalo(Container p_i1807_1_, int p_i1807_2_, int p_i1807_3_) { - super(p_i1807_1_, p_i1807_2_, p_i1807_3_); + public InventoryCraftingHalo(Container container, int width, int height) { + super(container, width, height); } } diff --git a/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexicon.java b/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexicon.java index e329a7122..42649687f 100644 --- a/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexicon.java +++ b/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexicon.java @@ -10,37 +10,26 @@ */ package vazkii.botania.client.gui.lexicon; -import java.awt.Desktop; -import java.net.URI; -import java.util.ArrayDeque; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Calendar; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Queue; - import net.minecraft.client.Minecraft; import net.minecraft.client.audio.PositionedSoundRecord; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.resources.I18n; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ChatAllowedCharacters; -import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; +import net.minecraft.util.text.TextFormatting; import net.minecraftforge.common.MinecraftForge; - import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.GL11; - import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.lexicon.BotaniaTutorialStartEvent; import vazkii.botania.api.lexicon.LexiconCategory; import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.api.sound.BotaniaSoundEvents; import vazkii.botania.client.core.handler.ClientTickHandler; import vazkii.botania.client.core.handler.PersistentVariableHelper; import vazkii.botania.client.core.helper.RenderHelper; @@ -65,12 +54,26 @@ import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lexicon.page.PageText; import vazkii.botania.common.lib.LibMisc; +import java.awt.*; +import java.io.IOException; +import java.net.URI; +import java.time.LocalDateTime; +import java.time.Month; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Queue; + public class GuiLexicon extends GuiScreen { public static GuiLexicon currentOpenLexicon = new GuiLexicon(); public static ItemStack stackUsed; - public static HashMap notes = new HashMap(); + public static final Map notes = new HashMap<>(); private static final String TAG_TYPE = "type"; @@ -79,11 +82,11 @@ public class GuiLexicon extends GuiScreen { public static final int BOOKMARK_START = 1337; public static final int NOTES_BUTTON_ID = 1336; // random button tho public static final int MAX_BOOKMARK_COUNT = 8; - public static List bookmarks = new ArrayList(); - public static List bookmarkKeys = new ArrayList(); - boolean bookmarksNeedPopulation = false; + public static final List bookmarks = new ArrayList<>(); + public static final List bookmarkKeys = new ArrayList<>(); + private boolean bookmarksNeedPopulation = false; - public static Queue tutorial = new ArrayDeque(); + public static final Queue tutorial = new ArrayDeque<>(); public static final ResourceLocation texture = new ResourceLocation(LibResources.GUI_LEXICON); public static final ResourceLocation textureToff = new ResourceLocation(LibResources.GUI_TOFF); @@ -107,8 +110,8 @@ public class GuiLexicon extends GuiScreen { List allCategories; String title; - int guiWidth = 146; - int guiHeight = 180; + final int guiWidth = 146; + final int guiHeight = 180; int left, top; @Override @@ -130,7 +133,7 @@ public class GuiLexicon extends GuiScreen { } public void onInitGui() { - allCategories = new ArrayList(BotaniaAPI.getAllCategories()); + allCategories = new ArrayList<>(BotaniaAPI.getAllCategories()); Collections.sort(allCategories); lastTime = ClientTickHandler.ticksInGame; @@ -152,7 +155,7 @@ public class GuiLexicon extends GuiScreen { } else if(isCategoryIndex()) { int categories = allCategories.size(); for(int i = 0; i < categories + 1; i++) { - LexiconCategory category = null; + LexiconCategory category; category = i >= categories ? null : allCategories.get(i); int perline = 5; int x = i % perline; @@ -177,7 +180,9 @@ public class GuiLexicon extends GuiScreen { button.visible = false; } - if(Calendar.getInstance().get(Calendar.MONTH) == Calendar.NOVEMBER && Calendar.getInstance().get(Calendar.DATE) == 22) + LocalDateTime now = LocalDateTime.now(); + + if(now.getMonth() == Month.NOVEMBER && now.getDayOfMonth() == 22) buttonList.add(new GuiButtonDoot(-99, left + 100, top + 12)); } @@ -199,11 +204,11 @@ public class GuiLexicon extends GuiScreen { lastTime = time; partialTicks = par3; - GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.color(1F, 1F, 1F, 1F); mc.renderEngine.bindTexture(texture); drawNotes(par3); - GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.color(1F, 1F, 1F, 1F); mc.renderEngine.bindTexture(texture); drawTexturedModalRect(left, top, 0, 0, guiWidth, guiHeight); @@ -211,6 +216,7 @@ public class GuiLexicon extends GuiScreen { drawTexturedModalRect(left + 3, top + 1, 0, 212, 138, 6); String subtitle = getSubtitle(); + if(subtitle != null) drawBookmark(left + guiWidth / 2, top - getTitleHeight() + 10, subtitle, true, 191); drawBookmark(left + guiWidth / 2, top - getTitleHeight(), getTitle(), true); @@ -223,17 +229,17 @@ public class GuiLexicon extends GuiScreen { bookmarksNeedPopulation = false; } - if(mc.thePlayer.getCommandSenderName().equals("haighyorkie")) { - GL11.glColor4f(1F, 1F, 1F, 1F); + if(mc.thePlayer.getName().equals("haighyorkie")) { + GlStateManager.color(1F, 1F, 1F, 1F); mc.renderEngine.bindTexture(texture); drawTexturedModalRect(left - 19, top + 42, 67, 180, 19, 26); if(par1 >= left - 19 && par1 < left && par2 >= top + 62 && par2 < top + 88) { mc.renderEngine.bindTexture(textureToff); - GL11.glPushMatrix(); - GL11.glScalef(0.5F, 0.5F, 0.5F); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glTranslatef(0F, 0F, 2F); + GlStateManager.pushMatrix(); + GlStateManager.scale(0.5F, 0.5F, 0.5F); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.translate(0F, 0F, 2F); int w = 256; int h = 152; @@ -241,10 +247,10 @@ public class GuiLexicon extends GuiScreen { int y = (int) (top + guiHeight / 2 - h / 4 + Math.sin((ClientTickHandler.ticksInGame + par3) / 6.0) * 40); drawTexturedModalRect(x * 2, y * 2, 0, 0, w, h); - GL11.glDisable(GL11.GL_BLEND); - GL11.glPopMatrix(); + GlStateManager.disableBlend(); + GlStateManager.popMatrix(); - RenderHelper.renderTooltip(par1, par2, Arrays.asList(EnumChatFormatting.GOLD + "#goldfishchris", EnumChatFormatting.AQUA + "IT SAYS MANUAL")); + RenderHelper.renderTooltip(par1, par2, Arrays.asList(TextFormatting.GOLD + "#goldfishchris", TextFormatting.AQUA + "IT SAYS MANUAL")); } } @@ -252,11 +258,11 @@ public class GuiLexicon extends GuiScreen { if(hasTutorialArrow) { mc.renderEngine.bindTexture(texture); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1F, 1F, 1F, 0.7F + (float) (Math.sin((ClientTickHandler.ticksInGame + par3) * 0.3F) + 1) * 0.15F); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.color(1F, 1F, 1F, 0.7F + (float) (Math.sin((ClientTickHandler.ticksInGame + par3) * 0.3F) + 1) * 0.15F); drawTexturedModalRect(tutorialArrowX, tutorialArrowY, 20, 200, TUTORIAL_ARROW_WIDTH, TUTORIAL_ARROW_HEIGHT); - GL11.glDisable(GL11.GL_BLEND); + GlStateManager.disableBlend(); } } @@ -279,7 +285,7 @@ public class GuiLexicon extends GuiScreen { if(notesEnabled && ClientTickHandler.ticksInGame % 20 < 10) noteDisplay += "&r_"; - fontRendererObj.drawString(StatCollector.translateToLocal("botaniamisc.notes"), x + 5, y - 7, 0x666666); + fontRendererObj.drawString(I18n.format("botaniamisc.notes"), x + 5, y - 7, 0x666666); boolean unicode = fontRendererObj.getUnicodeFlag(); fontRendererObj.setUnicodeFlag(true); @@ -299,7 +305,7 @@ public class GuiLexicon extends GuiScreen { public void drawBookmark(int x, int y, String s, boolean drawLeft, int color, int v) { // This function is called from the buttons so I can't use fontRendererObj - FontRenderer font = Minecraft.getMinecraft().fontRenderer; + FontRenderer font = Minecraft.getMinecraft().fontRendererObj; boolean unicode = font.getUnicodeFlag(); font.setUnicodeFlag(true); int l = font.getStringWidth(s); @@ -312,8 +318,9 @@ public class GuiLexicon extends GuiScreen { Minecraft.getMinecraft().renderEngine.bindTexture(texture); - GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.color(1F, 1F, 1F, 1F); drawTexturedModalRect(x + l / 2 + 3, y - 1, 54, v, 6, 11); + if(drawLeft) drawTexturedModalRect(x - l / 2 - 9, y - 1, 61, v, 6, 11); for(int i = 0; i < l + 6; i++) @@ -324,8 +331,8 @@ public class GuiLexicon extends GuiScreen { } void drawHeader() { - GL11.glPushMatrix(); - GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.pushMatrix(); + GlStateManager.color(1F, 1F, 1F, 1F); Minecraft.getMinecraft().renderEngine.bindTexture(texture); drawTexturedModalRect(left - 8, top + 9, 0, 224, 140, 31); @@ -333,13 +340,13 @@ public class GuiLexicon extends GuiScreen { boolean unicode = fontRendererObj.getUnicodeFlag(); fontRendererObj.drawString(title, left + 18, top + 13, color); fontRendererObj.setUnicodeFlag(true); - fontRendererObj.drawString(String.format(StatCollector.translateToLocal("botaniamisc.edition"), ItemLexicon.getEdition()), left + 24, top + 22, color); + fontRendererObj.drawString(I18n.format("botaniamisc.edition", ItemLexicon.getEdition()), left + 24, top + 22, color); - String s = EnumChatFormatting.BOLD + categoryHighlight; + String s = TextFormatting.BOLD + categoryHighlight; fontRendererObj.drawString(s, left + guiWidth / 2 - fontRendererObj.getStringWidth(s) / 2, top + 36, 0); fontRendererObj.setUnicodeFlag(unicode); - GL11.glPopMatrix(); + GlStateManager.popMatrix(); categoryHighlight = ""; } @@ -433,7 +440,7 @@ public class GuiLexicon extends GuiScreen { public int bookmarkWidth(String b) { if(fontRendererObj == null) - fontRendererObj = Minecraft.getMinecraft().fontRenderer; + fontRendererObj = Minecraft.getMinecraft().fontRendererObj; boolean unicode = fontRendererObj.getUnicodeFlag(); fontRendererObj.setUnicodeFlag(true); @@ -474,16 +481,16 @@ public class GuiLexicon extends GuiScreen { GuiButtonInvisible button = (GuiButtonInvisible) buttonList.get(i); LexiconCategory category = i_ >= categoryList.size() ? null : categoryList.get(i_); if(category != null) - button.displayString = StatCollector.translateToLocal(category.getUnlocalizedName()); + button.displayString = I18n.format(category.getUnlocalizedName()); else { - button.displayString = StatCollector.translateToLocal("botaniamisc.lexiconIndex"); + button.displayString = I18n.format("botaniamisc.lexiconIndex"); break; } } } void populateBookmarks() { - List remove = new ArrayList(); + List remove = new ArrayList<>(); List buttons = buttonList; for(GuiButton button : buttons) if(button.id >= BOOKMARK_START) @@ -504,9 +511,9 @@ public class GuiLexicon extends GuiScreen { } if(isMainPage()) - buttonList.add(new GuiButtonHistory(BOOKMARK_START + MAX_BOOKMARK_COUNT, left + 138, top + guiHeight - 24, StatCollector.translateToLocal("botaniamisc.history"), this)); + buttonList.add(new GuiButtonHistory(BOOKMARK_START + MAX_BOOKMARK_COUNT, left + 138, top + guiHeight - 24, I18n.format("botaniamisc.history"), this)); else if(isChallenge()) - buttonList.add(new GuiButtonChallengeInfo(BOOKMARK_START + MAX_BOOKMARK_COUNT, left + 138, top + guiHeight - 24, StatCollector.translateToLocal("botaniamisc.info"), this)); + buttonList.add(new GuiButtonChallengeInfo(BOOKMARK_START + MAX_BOOKMARK_COUNT, left + 138, top + guiHeight - 24, I18n.format("botaniamisc.info"), this)); } public static void startTutorial() { @@ -520,10 +527,10 @@ public class GuiLexicon extends GuiScreen { tutorial.add(LexiconData.manaIntro); tutorial.add(LexiconData.pool); tutorial.add(LexiconData.spreader); - if(ConfigHandler.hardcorePassiveGeneration > 0) - tutorial.add(LexiconData.generatingIntro); - tutorial.add(LexiconData.passiveGen); - tutorial.add(LexiconData.daybloom); + tutorial.add(LexiconData.generatingIntro); + tutorial.add(LexiconData.endoflame); +// tutorial.add(LexiconData.passiveGen); +// tutorial.add(LexiconData.daybloom); tutorial.add(LexiconData.functionalIntro); tutorial.add(LexiconData.runicAltar); @@ -561,7 +568,7 @@ public class GuiLexicon extends GuiScreen { } @Override - protected void keyTyped(char par1, int par2) { + protected void keyTyped(char par1, int par2) throws IOException { handleNoteKey(par1, par2); if(!notesEnabled && closeScreenOnInvKey() && mc.gameSettings.keyBindInventory.getKeyCode() == par2) { @@ -572,7 +579,7 @@ public class GuiLexicon extends GuiScreen { if(par2 == KONAMI_CODE[konamiIndex]) { konamiIndex++; if(konamiIndex >= KONAMI_CODE.length) { - mc.getSoundHandler().playSound(PositionedSoundRecord.func_147673_a(new ResourceLocation("botania:way"))); + mc.getSoundHandler().playSound(PositionedSoundRecord.getMasterRecord(BotaniaSoundEvents.way, 1.0F)); konamiIndex = 0; } } else konamiIndex = 0; @@ -631,9 +638,7 @@ public class GuiLexicon extends GuiScreen { return "index"; } - public void load(NBTTagCompound cmp) { - // NO-OP - } + public void load(NBTTagCompound cmp) {} public GuiLexicon copy() { return new GuiLexicon(); diff --git a/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexiconChallenge.java b/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexiconChallenge.java index 5f852aedc..6cedd8e17 100644 --- a/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexiconChallenge.java +++ b/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexiconChallenge.java @@ -11,15 +11,11 @@ package vazkii.botania.client.gui.lexicon; import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.resources.I18n; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - +import net.minecraft.util.text.TextFormatting; import vazkii.botania.client.challenge.Challenge; import vazkii.botania.client.challenge.ModChallenges; import vazkii.botania.client.core.handler.ClientTickHandler; @@ -27,6 +23,8 @@ import vazkii.botania.client.core.handler.PersistentVariableHelper; import vazkii.botania.client.gui.lexicon.button.GuiButtonBack; import vazkii.botania.common.lexicon.page.PageText; +import java.io.IOException; + public class GuiLexiconChallenge extends GuiLexicon implements IParented { private static final String TAG_CHALLENGE = "challenge"; @@ -46,7 +44,7 @@ public class GuiLexiconChallenge extends GuiLexicon implements IParented { } public void setTitle() { - title = challenge == null ? "(null)" : StatCollector.translateToLocal(challenge.unlocalizedName); + title = challenge == null ? "(null)" : I18n.format(challenge.unlocalizedName); } @Override @@ -64,15 +62,15 @@ public class GuiLexiconChallenge extends GuiLexicon implements IParented { super.drawScreen(par1, par2, par3); RenderHelper.enableGUIStandardItemLighting(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - RenderItem.getInstance().renderItemIntoGUI(fontRendererObj, mc.renderEngine, challenge.icon, left + 18, top + 15); + GlStateManager.enableRescaleNormal(); + mc.getRenderItem().renderItemIntoGUI(challenge.icon, left + 18, top + 15); RenderHelper.disableStandardItemLighting(); - GL11.glEnable(GL11.GL_BLEND); + GlStateManager.enableBlend(); boolean unicode = fontRendererObj.getUnicodeFlag(); fontRendererObj.setUnicodeFlag(true); - fontRendererObj.drawString(EnumChatFormatting.BOLD + StatCollector.translateToLocal(challenge.unlocalizedName), left + 38, top + 13, 0); - fontRendererObj.drawString(StatCollector.translateToLocal(challenge.level.getName()) + " / " + (challenge.complete ? EnumChatFormatting.DARK_GREEN : EnumChatFormatting.DARK_RED) + StatCollector.translateToLocal(challenge.complete ? "botaniamisc.completed" : "botaniamisc.notCompleted"), left + 38, top + 23, 0); + fontRendererObj.drawString(TextFormatting.BOLD + I18n.format(challenge.unlocalizedName), left + 38, top + 13, 0); + fontRendererObj.drawString(I18n.format(challenge.level.getName()) + " / " + (challenge.complete ? TextFormatting.DARK_GREEN : TextFormatting.DARK_RED) + I18n.format(challenge.complete ? "botaniamisc.completed" : "botaniamisc.notCompleted"), left + 38, top + 23, 0); int width = guiWidth - 30; int x = left + 16; @@ -83,7 +81,7 @@ public class GuiLexiconChallenge extends GuiLexicon implements IParented { } @Override - protected void keyTyped(char par1, int par2) { + protected void keyTyped(char par1, int par2) throws IOException { if(par2 == 14 && !notesEnabled) // Backspace back(); else if(par2 == 199) { // Home @@ -95,7 +93,7 @@ public class GuiLexiconChallenge extends GuiLexicon implements IParented { } @Override - protected void mouseClicked(int par1, int par2, int par3) { + protected void mouseClicked(int par1, int par2, int par3) throws IOException { super.mouseClicked(par1, par2, par3); if(par3 == 1) @@ -118,13 +116,13 @@ public class GuiLexiconChallenge extends GuiLexicon implements IParented { } void setCompleteButtonTitle() { - completeButton.displayString = StatCollector.translateToLocal(challenge.complete ? "botaniamisc.markNotCompleted" : "botaniamisc.markCompleted"); + completeButton.displayString = I18n.format(challenge.complete ? "botaniamisc.markNotCompleted" : "botaniamisc.markCompleted"); } void back() { if(backButton.enabled) { actionPerformed(backButton); - backButton.func_146113_a(mc.getSoundHandler()); + backButton.playPressSound(mc.getSoundHandler()); } } diff --git a/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexiconChallengesList.java b/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexiconChallengesList.java index 66484f628..1f97ef595 100644 --- a/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexiconChallengesList.java +++ b/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexiconChallengesList.java @@ -10,11 +10,9 @@ */ package vazkii.botania.client.gui.lexicon; -import java.util.List; - import net.minecraft.client.gui.GuiButton; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.text.TextFormatting; import vazkii.botania.client.challenge.Challenge; import vazkii.botania.client.challenge.EnumChallengeLevel; import vazkii.botania.client.challenge.ModChallenges; @@ -22,6 +20,9 @@ import vazkii.botania.client.core.handler.ClientTickHandler; import vazkii.botania.client.gui.lexicon.button.GuiButtonBack; import vazkii.botania.client.gui.lexicon.button.GuiButtonChallengeIcon; +import java.io.IOException; +import java.util.List; + public class GuiLexiconChallengesList extends GuiLexicon implements IParented { GuiLexicon parent; @@ -29,13 +30,13 @@ public class GuiLexiconChallengesList extends GuiLexicon implements IParented { public GuiLexiconChallengesList() { parent = new GuiLexicon(); - title = StatCollector.translateToLocal("botaniamisc.challenges"); + title = I18n.format("botaniamisc.challenges"); } @Override public void onInitGui() { super.onInitGui(); - title = StatCollector.translateToLocal("botaniamisc.challenges"); + title = I18n.format("botaniamisc.challenges"); buttonList.add(backButton = new GuiButtonBack(12, left + guiWidth / 2 - 8, top + guiHeight + 2)); @@ -66,13 +67,13 @@ public class GuiLexiconChallengesList extends GuiLexicon implements IParented { if(c.complete) complete++; - fontRendererObj.drawString(EnumChatFormatting.BOLD + StatCollector.translateToLocal(level.getName()) + EnumChatFormatting.RESET + " (" + complete + "/" + list.size() + ")", left + 20, top + 11 + level.ordinal() * 44, 0); + fontRendererObj.drawString(TextFormatting.BOLD + I18n.format(level.getName()) + TextFormatting.RESET + " (" + complete + "/" + list.size() + ")", left + 20, top + 11 + level.ordinal() * 44, 0); } fontRendererObj.setUnicodeFlag(unicode); } @Override - protected void keyTyped(char par1, int par2) { + protected void keyTyped(char par1, int par2) throws IOException { if(par2 == 14 && !notesEnabled) // Backspace back(); else if(par2 == 199) { // Home @@ -84,7 +85,7 @@ public class GuiLexiconChallengesList extends GuiLexicon implements IParented { } @Override - protected void mouseClicked(int par1, int par2, int par3) { + protected void mouseClicked(int par1, int par2, int par3) throws IOException { super.mouseClicked(par1, par2, par3); if(par3 == 1) @@ -108,7 +109,7 @@ public class GuiLexiconChallengesList extends GuiLexicon implements IParented { void back() { if(backButton.enabled) { actionPerformed(backButton); - backButton.func_146113_a(mc.getSoundHandler()); + backButton.playPressSound(mc.getSoundHandler()); } } diff --git a/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexiconEntry.java b/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexiconEntry.java index 4aebd5db3..5a6591152 100644 --- a/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexiconEntry.java +++ b/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexiconEntry.java @@ -10,21 +10,15 @@ */ package vazkii.botania.client.gui.lexicon; -import java.awt.Desktop; -import java.net.URI; -import java.util.List; - import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.util.ChatStyle; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; - +import net.minecraft.util.text.Style; +import net.minecraft.util.text.TextComponentTranslation; +import net.minecraft.util.text.TextFormatting; import org.lwjgl.input.Mouse; - import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.internal.IGuiLexiconEntry; import vazkii.botania.api.lexicon.IAddonEntry; @@ -36,6 +30,11 @@ import vazkii.botania.client.gui.lexicon.button.GuiButtonPage; import vazkii.botania.client.gui.lexicon.button.GuiButtonShare; import vazkii.botania.client.gui.lexicon.button.GuiButtonViewOnline; +import java.awt.*; +import java.io.IOException; +import java.net.URI; +import java.util.List; + public class GuiLexiconEntry extends GuiLexicon implements IGuiLexiconEntry, IParented { private static final String TAG_ENTRY = "entry"; @@ -67,9 +66,9 @@ public class GuiLexiconEntry extends GuiLexicon implements IGuiLexiconEntry, IPa return; } - title = StatCollector.translateToLocal(entry.getUnlocalizedName()); + title = I18n.format(entry.getUnlocalizedName()); if(entry instanceof IAddonEntry) - subtitle = StatCollector.translateToLocal(((IAddonEntry) entry).getSubtitle()); + subtitle = I18n.format(((IAddonEntry) entry).getSubtitle()); else subtitle = null; } @@ -115,7 +114,7 @@ public class GuiLexiconEntry extends GuiLexicon implements IGuiLexiconEntry, IPa @Override String getTitle() { - return String.format("%s " + EnumChatFormatting.ITALIC + "(%s/%s)", title, page + 1, entry.pages.size()); + return String.format("%s " + TextFormatting.ITALIC + "(%s/%s)", title, page + 1, entry.pages.size()); } @Override @@ -213,7 +212,7 @@ public class GuiLexiconEntry extends GuiLexicon implements IGuiLexiconEntry, IPa tutorial.poll(); positionTutorialArrow(); if(tutorial.isEmpty()) { - mc.thePlayer.addChatMessage(new ChatComponentTranslation("botaniamisc.tutorialEnded").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED))); + mc.thePlayer.addChatMessage(new TextComponentTranslation("botaniamisc.tutorialEnded").setStyle(new Style().setColor(TextFormatting.RED))); hasTutorialArrow = false; } } @@ -280,7 +279,7 @@ public class GuiLexiconEntry extends GuiLexicon implements IGuiLexiconEntry, IPa } @Override - protected void mouseClicked(int par1, int par2, int par3) { + protected void mouseClicked(int par1, int par2, int par3) throws IOException { super.mouseClicked(par1, par2, par3); fx = par1; @@ -298,7 +297,7 @@ public class GuiLexiconEntry extends GuiLexicon implements IGuiLexiconEntry, IPa } @Override - public void handleMouseInput() { + public void handleMouseInput() throws IOException { super.handleMouseInput(); if(Mouse.getEventButton() == 0) @@ -319,7 +318,7 @@ public class GuiLexiconEntry extends GuiLexicon implements IGuiLexiconEntry, IPa page.onKeyPressed(par1, par2); if(par2 == 1) { - mc.displayGuiScreen((GuiScreen)null); + mc.displayGuiScreen(null); mc.setIngameFocus(); } else if(par2 == 203 || par2 == 200 || par2 == 201) // Left, Up, Page Up prevPage(); @@ -336,14 +335,14 @@ public class GuiLexiconEntry extends GuiLexicon implements IGuiLexiconEntry, IPa void back() { if(backButton.enabled) { actionPerformed(backButton); - backButton.func_146113_a(mc.getSoundHandler()); + backButton.playPressSound(mc.getSoundHandler()); } } void nextPage() { if(rightButton.enabled) { actionPerformed(rightButton); - rightButton.func_146113_a(mc.getSoundHandler()); + rightButton.playPressSound(mc.getSoundHandler()); updateNote(); } } @@ -351,7 +350,7 @@ public class GuiLexiconEntry extends GuiLexicon implements IGuiLexiconEntry, IPa void prevPage() { if(leftButton.enabled) { actionPerformed(leftButton); - leftButton.func_146113_a(mc.getSoundHandler()); + leftButton.playPressSound(mc.getSoundHandler()); updateNote(); } } @@ -408,7 +407,7 @@ public class GuiLexiconEntry extends GuiLexicon implements IGuiLexiconEntry, IPa @Override public GuiLexicon copy() { - GuiLexiconEntry gui = new GuiLexiconEntry(entry, new GuiScreen()); + GuiLexiconEntry gui = new GuiLexiconEntry(entry, this.parent); gui.page = page; gui.setTitle(); return gui; diff --git a/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexiconHistory.java b/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexiconHistory.java index 159d793a4..31e1e84e7 100644 --- a/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexiconHistory.java +++ b/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexiconHistory.java @@ -10,21 +10,21 @@ */ package vazkii.botania.client.gui.lexicon; -import java.util.ArrayList; -import java.util.List; - +import net.minecraft.client.resources.I18n; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.StatCollector; import vazkii.botania.api.lexicon.ILexicon; import vazkii.botania.api.lexicon.LexiconEntry; +import java.util.ArrayList; +import java.util.List; + public class GuiLexiconHistory extends GuiLexiconIndex { - public static List history = new ArrayList(); + public static final List history = new ArrayList<>(); public GuiLexiconHistory() { super(null); - title = StatCollector.translateToLocal("botaniamisc.historyLong"); + title = I18n.format("botaniamisc.historyLong"); } @Override @@ -33,7 +33,7 @@ public class GuiLexiconHistory extends GuiLexiconIndex { ILexicon lex = (ILexicon) stackUsed.getItem(); for(int i = history.size() - 1; i >= 0; i--) { LexiconEntry entry = history.get(i); - if(lex.isKnowledgeUnlocked(stackUsed, entry.getKnowledgeType()) && StatCollector.translateToLocal(entry.getUnlocalizedName()).toLowerCase().contains(searchField.getText().toLowerCase().trim())) + if(lex.isKnowledgeUnlocked(stackUsed, entry.getKnowledgeType()) && I18n.format(entry.getUnlocalizedName()).toLowerCase().contains(searchField.getText().toLowerCase().trim())) entriesToDisplay.add(entry); } } @@ -50,9 +50,7 @@ public class GuiLexiconHistory extends GuiLexiconIndex { } @Override - public void load(NBTTagCompound cmp) { - // NO-OP - } + public void load(NBTTagCompound cmp) {} @Override public String getNotesKey() { diff --git a/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexiconIndex.java b/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexiconIndex.java index 2f1d23054..433cd8c83 100644 --- a/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexiconIndex.java +++ b/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexiconIndex.java @@ -10,24 +10,16 @@ */ package vazkii.botania.client.gui.lexicon; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiTextField; -import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.resources.I18n; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; - +import net.minecraft.util.text.TextFormatting; import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.lexicon.ILexicon; import vazkii.botania.api.lexicon.LexiconCategory; @@ -36,7 +28,12 @@ import vazkii.botania.client.core.handler.ClientTickHandler; import vazkii.botania.client.gui.lexicon.button.GuiButtonBack; import vazkii.botania.client.gui.lexicon.button.GuiButtonInvisible; import vazkii.botania.client.gui.lexicon.button.GuiButtonPage; -import vazkii.botania.common.lexicon.DLexiconEntry; +import vazkii.botania.common.lexicon.DogLexiconEntry; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; public class GuiLexiconIndex extends GuiLexicon implements IParented { @@ -57,7 +54,7 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented { LexiconEntry currentEntry; float infoTime; - List entriesToDisplay = new ArrayList(); + final List entriesToDisplay = new ArrayList<>(); public GuiLexiconIndex() { parent = new GuiLexicon(); @@ -70,7 +67,7 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented { } public void setTitle() { - title = StatCollector.translateToLocal(category == null ? "botaniamisc.lexiconIndex" : category.getUnlocalizedName()); + title = I18n.format(category == null ? "botaniamisc.lexiconIndex" : category.getUnlocalizedName()); } @Override @@ -108,7 +105,7 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented { buttonList.add(leftButton = new GuiButtonPage(13, left, top + guiHeight - 10, false)); buttonList.add(rightButton = new GuiButtonPage(14, left + guiWidth - 18, top + guiHeight - 10, true)); - searchField = new GuiTextField(fontRendererObj, left + guiWidth / 2 + 28, top + guiHeight + 6, 200, 10); + searchField = new GuiTextField(15, fontRendererObj, left + guiWidth / 2 + 28, top + guiHeight + 6, 200, 10); searchField.setCanLoseFocus(false); searchField.setFocused(true); searchField.setEnableBackgroundDrawing(false); @@ -138,7 +135,7 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented { return true; search = search.toLowerCase(); - if(StatCollector.translateToLocal(e.getUnlocalizedName()).toLowerCase().contains(search)) + if(I18n.format(e.getUnlocalizedName()).toLowerCase().contains(search)) return true; for(ItemStack stack : e.getDisplayedRecipes()) { @@ -158,12 +155,12 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented { GuiButtonInvisible button = (GuiButtonInvisible) buttonList.get(i - page * 12); LexiconEntry entry = i >= entriesToDisplay.size() ? null : entriesToDisplay.get(i); if(entry != null) { - button.displayString = entry.getKnowledgeType().color + "" + (entry.isPriority() ? EnumChatFormatting.ITALIC : "") + StatCollector.translateToLocal(entry.getUnlocalizedName()); + button.displayString = entry.getKnowledgeType().color + "" + (entry.isPriority() ? TextFormatting.ITALIC : "") + I18n.format(entry.getUnlocalizedName()); button.displayStack = entry.getIcon(); if(entry == tutEntry) tutPage = page; - if(entry instanceof DLexiconEntry) + if(entry instanceof DogLexiconEntry) button.dog = true; } else button.displayString = ""; } @@ -183,22 +180,22 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented { if(!searchField.getText().isEmpty()) { drawBookmark(left + 138, top + guiHeight - 24, " " + searchField.getText(), false); mc.renderEngine.bindTexture(texture); - GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.color(1F, 1F, 1F, 1F); drawTexturedModalRect(left + 134, top + guiHeight - 26, 86, 180, 12, 12); if(entriesToDisplay.size() == 1) { - boolean unicode = mc.fontRenderer.getUnicodeFlag(); - mc.fontRenderer.setUnicodeFlag(true); - String s = StatCollector.translateToLocal("botaniamisc.enterToView"); - mc.fontRenderer.drawString(s, left + guiWidth / 2 - mc.fontRenderer.getStringWidth(s) / 2, top + 30, 0x666666); - mc.fontRenderer.setUnicodeFlag(unicode); + boolean unicode = mc.fontRendererObj.getUnicodeFlag(); + mc.fontRendererObj.setUnicodeFlag(true); + String s = I18n.format("botaniamisc.enterToView"); + mc.fontRendererObj.drawString(s, left + guiWidth / 2 - mc.fontRendererObj.getStringWidth(s) / 2, top + 30, 0x666666); + mc.fontRendererObj.setUnicodeFlag(unicode); } } else { - boolean unicode = mc.fontRenderer.getUnicodeFlag(); - mc.fontRenderer.setUnicodeFlag(true); - String s = StatCollector.translateToLocal("botaniamisc.typeToSearch"); - mc.fontRenderer.drawString(s, left + 120 - mc.fontRenderer.getStringWidth(s), top + guiHeight - 18, 0x666666); - mc.fontRenderer.setUnicodeFlag(unicode); + boolean unicode = mc.fontRendererObj.getUnicodeFlag(); + mc.fontRendererObj.setUnicodeFlag(true); + String s = I18n.format("botaniamisc.typeToSearch"); + mc.fontRendererObj.drawString(s, left + 120 - mc.fontRendererObj.getStringWidth(s), top + guiHeight - 18, 0x666666); + mc.fontRendererObj.setUnicodeFlag(unicode); } float animationTime = 4F; @@ -209,16 +206,16 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented { infoTime = Math.max(0, infoTime - timeDelta); if(currentButton != null && infoTime == 0) { - int x = par1 + 10; - int y = par2; + int x; + int y; x = currentButton.xPosition - 20; y = currentButton.yPosition; - mc.fontRenderer.drawStringWithShadow("?", x, y, 0xFFFFFF); - GL11.glScalef(0.5F, 0.5F, 1F); - mc.fontRenderer.drawStringWithShadow(EnumChatFormatting.BOLD + "Shift", x * 2 - 6, y * 2 + 20, 0xFFFFFF); - GL11.glScalef(2F, 2F, 1F); + mc.fontRendererObj.drawStringWithShadow("?", x, y, 0xFFFFFF); + GlStateManager.scale(0.5F, 0.5F, 1F); + mc.fontRendererObj.drawStringWithShadow(TextFormatting.BOLD + "Shift", x * 2 - 6, y * 2 + 20, 0xFFFFFF); + GlStateManager.scale(2F, 2F, 1F); } } @@ -227,38 +224,39 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented { int x = currentButton.xPosition; int y = currentButton.yPosition; - String s = StatCollector.translateToLocal(currentEntry.getTagline()); - boolean unicode = mc.fontRenderer.getUnicodeFlag(); - mc.fontRenderer.setUnicodeFlag(true); - int width = mc.fontRenderer.getStringWidth(s); + String s = I18n.format(currentEntry.getTagline()); + boolean unicode = mc.fontRendererObj.getUnicodeFlag(); + mc.fontRendererObj.setUnicodeFlag(true); + int width = mc.fontRendererObj.getStringWidth(s); - GL11.glPushMatrix(); - GL11.glTranslatef(x, y, 0); - GL11.glScalef(fract, 1F, 1F); + GlStateManager.pushMatrix(); + GlStateManager.translate(x, y, 0); + GlStateManager.scale(fract, 1F, 1F); Gui.drawRect(12, -30, width + 20, -2, 0x44000000); Gui.drawRect(10, -32, width + 22, -2, 0x44000000); + drawBookmark(width / 2 + 16, -8, s, true, 0xFFFFFF, 180); - mc.fontRenderer.setUnicodeFlag(unicode); + mc.fontRendererObj.setUnicodeFlag(unicode); net.minecraft.client.renderer.RenderHelper.enableGUIStandardItemLighting(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - ItemStack paper = new ItemStack(Items.paper, currentEntry.pages.size()); + GlStateManager.enableRescaleNormal(); + ItemStack paper = new ItemStack(Items.PAPER, currentEntry.pages.size()); - RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, paper, 14, -28); - RenderItem.getInstance().renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, paper, 14, -28); + mc.getRenderItem().renderItemAndEffectIntoGUI(paper, 14, -28); + mc.getRenderItem().renderItemOverlayIntoGUI(mc.fontRendererObj, paper, 14, -28, ""); List stacks = currentEntry.getDisplayedRecipes(); if(stacks.size() > 0) { int spaceForEach = Math.min(18, (width - 30) / stacks.size()); for(int i = 0; i < stacks.size(); i++) { ItemStack stack = stacks.get(i); - RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, stack, 38 + spaceForEach * i, -28); + mc.getRenderItem().renderItemAndEffectIntoGUI(stack, 38 + spaceForEach * i, -28); } } net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting(); - GL11.glPopMatrix(); + GlStateManager.popMatrix(); } setHoveredButton(null); @@ -364,7 +362,7 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented { } @Override - protected void mouseClicked(int par1, int par2, int par3) { + protected void mouseClicked(int par1, int par2, int par3) throws IOException { super.mouseClicked(par1, par2, par3); searchField.mouseClicked(par1, par2, par3); @@ -383,7 +381,7 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented { } @Override - public void handleMouseInput() { + public void handleMouseInput() throws IOException { super.handleMouseInput(); if(Mouse.getEventButton() == 0) @@ -402,7 +400,7 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented { } @Override - protected void keyTyped(char par1, int par2) { + protected void keyTyped(char par1, int par2) throws IOException { if(par2 == 203 || par2 == 200 || par2 == 201) // Left, Up, Page Up prevPage(); else if(par2 == 205 || par2 == 208 || par2 == 209) // Right, Down Page Down @@ -428,21 +426,21 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented { void back() { if(backButton.enabled) { actionPerformed(backButton); - backButton.func_146113_a(mc.getSoundHandler()); + backButton.playPressSound(mc.getSoundHandler()); } } void nextPage() { if(rightButton.enabled) { actionPerformed(rightButton); - rightButton.func_146113_a(mc.getSoundHandler()); + rightButton.playPressSound(mc.getSoundHandler()); } } void prevPage() { if(leftButton.enabled) { actionPerformed(leftButton); - leftButton.func_146113_a(mc.getSoundHandler()); + leftButton.playPressSound(mc.getSoundHandler()); } } diff --git a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonAchievement.java b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonAchievement.java index 822add343..5961c55d7 100644 --- a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonAchievement.java +++ b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonAchievement.java @@ -10,18 +10,17 @@ */ package vazkii.botania.client.gui.lexicon.button; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.client.Minecraft; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; - -import org.lwjgl.opengl.GL11; - +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.text.TextFormatting; import vazkii.botania.client.core.helper.RenderHelper; import vazkii.botania.client.gui.lexicon.GuiLexicon; +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.List; + public class GuiButtonAchievement extends GuiButtonLexicon { public GuiButtonAchievement(int id, int x, int y) { @@ -29,16 +28,16 @@ public class GuiButtonAchievement extends GuiButtonLexicon { } @Override - public void drawButton(Minecraft par1Minecraft, int par2, int par3) { - field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height; - int k = getHoverState(field_146123_n); + public void drawButton(@Nonnull Minecraft par1Minecraft, int par2, int par3) { + hovered = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height; + int k = getHoverState(hovered); par1Minecraft.renderEngine.bindTexture(GuiLexicon.texture); - GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.color(1F, 1F, 1F, 1F); drawTexturedModalRect(xPosition, yPosition, k == 2 ? 109 : 98, 191, 11, 11); - List tooltip = new ArrayList(); - tooltip.add(EnumChatFormatting.YELLOW + StatCollector.translateToLocal("botaniamisc.achievements")); + List tooltip = new ArrayList<>(); + tooltip.add(TextFormatting.YELLOW + I18n.format("botaniamisc.achievements")); int tooltipY = (tooltip.size() - 1) * 10; if(k == 2) diff --git a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonBack.java b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonBack.java index 75f3de627..0371c342e 100644 --- a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonBack.java +++ b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonBack.java @@ -10,17 +10,16 @@ */ package vazkii.botania.client.gui.lexicon.button; -import java.util.Arrays; -import java.util.List; - import net.minecraft.client.Minecraft; -import net.minecraft.util.StatCollector; - -import org.lwjgl.opengl.GL11; - +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.resources.I18n; import vazkii.botania.client.core.helper.RenderHelper; import vazkii.botania.client.gui.lexicon.GuiLexicon; +import javax.annotation.Nonnull; +import java.util.Collections; +import java.util.List; + public class GuiButtonBack extends GuiButtonLexicon { public GuiButtonBack(int par1, int par2, int par3) { @@ -28,13 +27,13 @@ public class GuiButtonBack extends GuiButtonLexicon { } @Override - public void drawButton(Minecraft par1Minecraft, int par2, int par3) { + public void drawButton(@Nonnull Minecraft par1Minecraft, int par2, int par3) { if(enabled) { - field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height; - int k = getHoverState(field_146123_n); + hovered = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height; + int k = getHoverState(hovered); par1Minecraft.renderEngine.bindTexture(GuiLexicon.texture); - GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.color(1F, 1F, 1F, 1F); drawTexturedModalRect(xPosition, yPosition, 36, k == 2 ? 180 : 189, 18, 9); List tooltip = getTooltip(); @@ -45,7 +44,7 @@ public class GuiButtonBack extends GuiButtonLexicon { } public List getTooltip() { - return Arrays.asList(StatCollector.translateToLocal("botaniamisc.back")); + return Collections.singletonList(I18n.format("botaniamisc.back")); } } diff --git a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonBackWithShift.java b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonBackWithShift.java index 329edad85..291914d20 100644 --- a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonBackWithShift.java +++ b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonBackWithShift.java @@ -10,12 +10,12 @@ */ package vazkii.botania.client.gui.lexicon.button; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.client.resources.I18n; + import java.util.Arrays; import java.util.List; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; - public class GuiButtonBackWithShift extends GuiButtonBack { public GuiButtonBackWithShift(int par1, int par2, int par3) { @@ -24,7 +24,7 @@ public class GuiButtonBackWithShift extends GuiButtonBack { @Override public List getTooltip() { - return Arrays.asList(StatCollector.translateToLocal("botaniamisc.back"), EnumChatFormatting.GRAY + StatCollector.translateToLocal("botaniamisc.clickToIndex")); + return Arrays.asList(I18n.format("botaniamisc.back"), TextFormatting.GRAY + I18n.format("botaniamisc.clickToIndex")); } } diff --git a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonBookmark.java b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonBookmark.java index 8f972bb1e..cd68ef3ee 100644 --- a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonBookmark.java +++ b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonBookmark.java @@ -1,17 +1,18 @@ package vazkii.botania.client.gui.lexicon.button; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.client.Minecraft; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.client.resources.I18n; import vazkii.botania.client.core.helper.RenderHelper; import vazkii.botania.client.gui.lexicon.GuiLexicon; +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.List; + public class GuiButtonBookmark extends GuiButtonLexicon { - GuiLexicon gui; + final GuiLexicon gui; public GuiButtonBookmark(int par1, int par2, int par3, GuiLexicon gui, String str) { super(par1, par2, par3, gui.bookmarkWidth(str) + 5, 11, str); @@ -19,18 +20,18 @@ public class GuiButtonBookmark extends GuiButtonLexicon { } @Override - public void drawButton(Minecraft mc, int par2, int par3) { + public void drawButton(@Nonnull Minecraft mc, int par2, int par3) { gui.drawBookmark(xPosition, yPosition, displayString, false); - field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height; - int k = getHoverState(field_146123_n); + hovered = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height; + int k = getHoverState(hovered); - List tooltip = new ArrayList(); + List tooltip = new ArrayList<>(); if(displayString.equals("+")) - tooltip.add(StatCollector.translateToLocal("botaniamisc.clickToAdd")); + tooltip.add(I18n.format("botaniamisc.clickToAdd")); else { - tooltip.add(String.format(StatCollector.translateToLocal("botaniamisc.bookmark"), id - GuiLexicon.BOOKMARK_START + 1)); - tooltip.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("botaniamisc.clickToSee")); - tooltip.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("botaniamisc.shiftToRemove")); + tooltip.add(I18n.format("botaniamisc.bookmark", id - GuiLexicon.BOOKMARK_START + 1)); + tooltip.add(TextFormatting.GRAY + I18n.format("botaniamisc.clickToSee")); + tooltip.add(TextFormatting.GRAY + I18n.format("botaniamisc.shiftToRemove")); } int tooltipY = (tooltip.size() + 1) * 5; diff --git a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonCategory.java b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonCategory.java index ca6b49d3c..2bbf672f0 100644 --- a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonCategory.java +++ b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonCategory.java @@ -11,15 +11,14 @@ package vazkii.botania.client.gui.lexicon.button; import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; - +import net.minecraft.client.resources.I18n; import org.lwjgl.opengl.ARBMultitexture; import org.lwjgl.opengl.ARBShaderObjects; import org.lwjgl.opengl.GL11; - import vazkii.botania.api.internal.ShaderCallback; import vazkii.botania.api.lexicon.LexiconCategory; import vazkii.botania.client.core.helper.RenderHelper; @@ -28,41 +27,43 @@ import vazkii.botania.client.gui.lexicon.GuiLexicon; import vazkii.botania.client.lib.LibResources; import vazkii.botania.common.core.handler.ConfigHandler; +import javax.annotation.Nonnull; + public class GuiButtonCategory extends GuiButtonLexicon { private static final ResourceLocation fallbackResource = new ResourceLocation(LibResources.CATEGORY_INDEX); private static final ResourceLocation stencilResource = new ResourceLocation(LibResources.GUI_STENCIL); - private ShaderCallback shaderCallback = new ShaderCallback() { + private static boolean boundStencil = false; - @Override - public void call(int shader) { - TextureManager r = Minecraft.getMinecraft().renderEngine; - int heightMatchUniform = ARBShaderObjects.glGetUniformLocationARB(shader, "heightMatch"); - int imageUniform = ARBShaderObjects.glGetUniformLocationARB(shader, "image"); - int maskUniform = ARBShaderObjects.glGetUniformLocationARB(shader, "mask"); + final GuiLexicon gui; + private final LexiconCategory category; + private ResourceLocation resource = null; + private float ticksHovered = 0F; + private final float time = 12F; - float heightMatch = ticksHovered / time; - OpenGlHelper.setActiveTexture(ARBMultitexture.GL_TEXTURE0_ARB); - GL11.glBindTexture(GL11.GL_TEXTURE_2D, r.getTexture(resource).getGlTextureId()); - ARBShaderObjects.glUniform1iARB(imageUniform, 0); + private final ShaderCallback shaderCallback = shader -> { + TextureManager r = Minecraft.getMinecraft().renderEngine; + int heightMatchUniform = ARBShaderObjects.glGetUniformLocationARB(shader, "heightMatch"); + int imageUniform = ARBShaderObjects.glGetUniformLocationARB(shader, "image"); + int maskUniform = ARBShaderObjects.glGetUniformLocationARB(shader, "mask"); - OpenGlHelper.setActiveTexture(ARBMultitexture.GL_TEXTURE0_ARB + ConfigHandler.glSecondaryTextureUnit); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glGetInteger(GL11.GL_TEXTURE_BINDING_2D); - GL11.glBindTexture(GL11.GL_TEXTURE_2D, r.getTexture(stencilResource).getGlTextureId()); - ARBShaderObjects.glUniform1iARB(maskUniform, ConfigHandler.glSecondaryTextureUnit); + float heightMatch = ticksHovered / time; + OpenGlHelper.setActiveTexture(ARBMultitexture.GL_TEXTURE0_ARB); + GL11.glBindTexture(GL11.GL_TEXTURE_2D, r.getTexture(resource).getGlTextureId()); + ARBShaderObjects.glUniform1iARB(imageUniform, 0); - ARBShaderObjects.glUniform1fARB(heightMatchUniform, heightMatch); - } + OpenGlHelper.setActiveTexture(ARBMultitexture.GL_TEXTURE0_ARB + ConfigHandler.glSecondaryTextureUnit); + + GlStateManager.enableTexture2D(); + GL11.glGetInteger(GL11.GL_TEXTURE_BINDING_2D); + + GL11.glBindTexture(GL11.GL_TEXTURE_2D, r.getTexture(stencilResource).getGlTextureId()); + ARBShaderObjects.glUniform1iARB(maskUniform, ConfigHandler.glSecondaryTextureUnit); + + ARBShaderObjects.glUniform1fARB(heightMatchUniform, heightMatch); }; - static boolean boundStencil = false; - GuiLexicon gui; - LexiconCategory category; - ResourceLocation resource = null; - float ticksHovered = 0F; - float time = 12F; int activeTex = 0; public GuiButtonCategory(int id, int x, int y, GuiLexicon gui, LexiconCategory category) { @@ -72,7 +73,7 @@ public class GuiButtonCategory extends GuiButtonLexicon { } @Override - public void drawButton(Minecraft mc, int mx, int my) { + public void drawButton(@Nonnull Minecraft mc, int mx, int my) { boolean inside = mx >= xPosition && my >= yPosition && mx < xPosition + width && my < yPosition + height; if(inside) ticksHovered = Math.min(time, ticksHovered + gui.timeDelta); @@ -87,11 +88,12 @@ public class GuiButtonCategory extends GuiButtonLexicon { } float s = 1F / 32F; - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glScalef(0.5F, 0.5F, 0.5F); - GL11.glColor4f(1F, 1F, 1F, 1F); + + GlStateManager.pushMatrix(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.scale(0.5F, 0.5F, 0.5F); + GlStateManager.color(1F, 1F, 1F, 1F); if(!boundStencil) { // Allow for the texture manager to take care of the ResourceLocation before we use it directly with gl mc.renderEngine.bindTexture(stencilResource); @@ -116,14 +118,14 @@ public class GuiButtonCategory extends GuiButtonLexicon { GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture); OpenGlHelper.setActiveTexture(ARBMultitexture.GL_TEXTURE0_ARB); } - - GL11.glPopMatrix(); + + GlStateManager.popMatrix(); if(inside) - gui.categoryHighlight = StatCollector.translateToLocal(getTooltipText()); + gui.categoryHighlight = I18n.format(getTooltipText()); } - String getTooltipText() { + private String getTooltipText() { if(category == null) return "botaniamisc.lexiconIndex"; return category.getUnlocalizedName(); diff --git a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonChallengeIcon.java b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonChallengeIcon.java index b75da43aa..ae2633e65 100644 --- a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonChallengeIcon.java +++ b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonChallengeIcon.java @@ -10,23 +10,20 @@ */ package vazkii.botania.client.gui.lexicon.button; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.client.resources.I18n; +import vazkii.botania.client.challenge.Challenge; + +import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.List; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - -import vazkii.botania.client.challenge.Challenge; - public class GuiButtonChallengeIcon extends GuiButtonLexicon { - public Challenge challenge; + public final Challenge challenge; public GuiButtonChallengeIcon(int id, int x, int y, Challenge challenge) { super(id, x, y, 16, 16, ""); @@ -34,26 +31,26 @@ public class GuiButtonChallengeIcon extends GuiButtonLexicon { } @Override - public void drawButton(Minecraft par1Minecraft, int par2, int par3) { - field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height; - int k = getHoverState(field_146123_n); + public void drawButton(@Nonnull Minecraft par1Minecraft, int par2, int par3) { + hovered = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height; + int k = getHoverState(hovered); RenderHelper.enableGUIStandardItemLighting(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - RenderItem.getInstance().renderItemIntoGUI(par1Minecraft.fontRenderer, par1Minecraft.renderEngine, challenge.icon, xPosition, yPosition); + GlStateManager.enableRescaleNormal(); + par1Minecraft.getRenderItem().renderItemIntoGUI(challenge.icon, xPosition, yPosition); RenderHelper.disableStandardItemLighting(); - GL11.glEnable(GL11.GL_BLEND); + GlStateManager.enableBlend(); if(challenge.complete) { - GL11.glDisable(GL11.GL_DEPTH_TEST); - par1Minecraft.fontRenderer.drawStringWithShadow("\u2714", xPosition + 10, yPosition + 9, 0x004C00); - par1Minecraft.fontRenderer.drawStringWithShadow("\u2714", xPosition + 10, yPosition + 8, 0x0BD20D); - GL11.glEnable(GL11.GL_DEPTH_TEST); + GlStateManager.disableDepth(); + par1Minecraft.fontRendererObj.drawStringWithShadow("\u2714", xPosition + 10, yPosition + 9, 0x004C00); + par1Minecraft.fontRendererObj.drawStringWithShadow("\u2714", xPosition + 10, yPosition + 8, 0x0BD20D); + GlStateManager.enableDepth(); } - List tooltip = new ArrayList(); - tooltip.add(EnumChatFormatting.AQUA + StatCollector.translateToLocal(challenge.unlocalizedName)); + List tooltip = new ArrayList<>(); + tooltip.add(TextFormatting.AQUA + I18n.format(challenge.unlocalizedName)); int tooltipY = (tooltip.size() - 1) * 10; if(k == 2) diff --git a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonChallengeInfo.java b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonChallengeInfo.java index 0dd4fe65a..ffbbc1176 100644 --- a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonChallengeInfo.java +++ b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonChallengeInfo.java @@ -10,17 +10,18 @@ */ package vazkii.botania.client.gui.lexicon.button; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.client.Minecraft; -import net.minecraft.util.StatCollector; +import net.minecraft.client.resources.I18n; import vazkii.botania.client.core.helper.RenderHelper; import vazkii.botania.client.gui.lexicon.GuiLexicon; +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.List; + public class GuiButtonChallengeInfo extends GuiButtonLexicon { - GuiLexicon gui; + final GuiLexicon gui; public GuiButtonChallengeInfo(int par1, int par2, int par3, String str, GuiLexicon gui) { super(par1, par2, par3, gui.bookmarkWidth(str) + 5, 11, str); @@ -28,13 +29,13 @@ public class GuiButtonChallengeInfo extends GuiButtonLexicon { } @Override - public void drawButton(Minecraft mc, int par2, int par3) { + public void drawButton(@Nonnull Minecraft mc, int par2, int par3) { gui.drawBookmark(xPosition, yPosition, displayString, false); - field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height; - int k = getHoverState(field_146123_n); + hovered = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height; + int k = getHoverState(hovered); - List tooltip = new ArrayList(); - tooltip.add(StatCollector.translateToLocal("botaniamisc.challengeInfo")); + List tooltip = new ArrayList<>(); + tooltip.add(I18n.format("botaniamisc.challengeInfo")); int tooltipY = (tooltip.size() + 1) * 5; if(k == 2) diff --git a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonChallenges.java b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonChallenges.java index 826dfa2c5..d3460f82f 100644 --- a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonChallenges.java +++ b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonChallenges.java @@ -10,18 +10,17 @@ */ package vazkii.botania.client.gui.lexicon.button; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.client.Minecraft; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; - -import org.lwjgl.opengl.GL11; - +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.client.resources.I18n; import vazkii.botania.client.core.helper.RenderHelper; import vazkii.botania.client.gui.lexicon.GuiLexicon; +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.List; + public class GuiButtonChallenges extends GuiButtonLexicon { public GuiButtonChallenges(int id, int x, int y) { @@ -29,16 +28,16 @@ public class GuiButtonChallenges extends GuiButtonLexicon { } @Override - public void drawButton(Minecraft par1Minecraft, int par2, int par3) { - field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height; - int k = getHoverState(field_146123_n); + public void drawButton(@Nonnull Minecraft par1Minecraft, int par2, int par3) { + hovered = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height; + int k = getHoverState(hovered); par1Minecraft.renderEngine.bindTexture(GuiLexicon.texture); - GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.color(1F, 1F, 1F, 1F); drawTexturedModalRect(xPosition, yPosition, k == 2 ? 131 : 120, 180, 11, 11); List tooltip = new ArrayList(); - tooltip.add(EnumChatFormatting.YELLOW + StatCollector.translateToLocal("botaniamisc.challenges")); + tooltip.add(TextFormatting.YELLOW + I18n.format("botaniamisc.challenges")); int tooltipY = (tooltip.size() - 1) * 10; if(k == 2) diff --git a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonDoot.java b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonDoot.java index 1b2646b9e..8880af260 100644 --- a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonDoot.java +++ b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonDoot.java @@ -10,21 +10,19 @@ */ package vazkii.botania.client.gui.lexicon.button; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; - -import org.lwjgl.opengl.GL11; - +import net.minecraft.util.text.TextFormatting; import vazkii.botania.client.core.helper.RenderHelper; import vazkii.botania.common.item.ModItems; +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.List; + // Ssssshhhhhhh // I should've done this last year public class GuiButtonDoot extends GuiButtonLexicon { @@ -34,25 +32,25 @@ public class GuiButtonDoot extends GuiButtonLexicon { } @Override - public void drawButton(Minecraft par1Minecraft, int par2, int par3) { - field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height; - int k = getHoverState(field_146123_n); + public void drawButton(@Nonnull Minecraft par1Minecraft, int par2, int par3) { + hovered = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height; + int k = getHoverState(hovered); - par1Minecraft.renderEngine.bindTexture(TextureMap.locationItemsTexture); - GL11.glColor4f(1F, 1F, 1F, 1F); - RenderItem.getInstance().renderItemIntoGUI(par1Minecraft.fontRenderer, par1Minecraft.renderEngine, new ItemStack(ModItems.cacophonium), xPosition, yPosition); - RenderItem.getInstance().renderItemIntoGUI(par1Minecraft.fontRenderer, par1Minecraft.renderEngine, new ItemStack(Items.fireworks), xPosition + 8, yPosition + 2); + par1Minecraft.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + GlStateManager.color(1F, 1F, 1F, 1F); + par1Minecraft.getRenderItem().renderItemIntoGUI(new ItemStack(ModItems.cacophonium), xPosition, yPosition); + par1Minecraft.getRenderItem().renderItemIntoGUI(new ItemStack(Items.FIREWORKS), xPosition + 8, yPosition + 2); - GL11.glDisable(GL11.GL_LIGHTING); + GlStateManager.disableLighting(); - List tooltip = new ArrayList(); - tooltip.add(EnumChatFormatting.LIGHT_PURPLE + "Happy Birthday Vazkii!"); - tooltip.add(EnumChatFormatting.GRAY + "doot doot"); + List tooltip = new ArrayList<>(); + tooltip.add(TextFormatting.LIGHT_PURPLE + "Happy Birthday Vazkii!"); + tooltip.add(TextFormatting.GRAY + "doot doot"); if(k == 2) RenderHelper.renderTooltip(xPosition - 100, yPosition + 36, tooltip); - GL11.glEnable(GL11.GL_ALPHA_TEST); + GlStateManager.enableAlpha(); } } diff --git a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonHistory.java b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonHistory.java index b5f1fd75e..ff9d0fb54 100644 --- a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonHistory.java +++ b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonHistory.java @@ -10,18 +10,19 @@ */ package vazkii.botania.client.gui.lexicon.button; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.client.Minecraft; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.client.resources.I18n; import vazkii.botania.client.core.helper.RenderHelper; import vazkii.botania.client.gui.lexicon.GuiLexicon; +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.List; + public class GuiButtonHistory extends GuiButtonLexicon { - GuiLexicon gui; + final GuiLexicon gui; public GuiButtonHistory(int par1, int par2, int par3, String str, GuiLexicon gui) { super(par1, par2, par3, gui.bookmarkWidth(str) + 5, 11, str); @@ -29,14 +30,14 @@ public class GuiButtonHistory extends GuiButtonLexicon { } @Override - public void drawButton(Minecraft mc, int par2, int par3) { + public void drawButton(@Nonnull Minecraft mc, int par2, int par3) { gui.drawBookmark(xPosition, yPosition, displayString, false); - field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height; - int k = getHoverState(field_146123_n); + hovered = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height; + int k = getHoverState(hovered); - List tooltip = new ArrayList(); - tooltip.add(StatCollector.translateToLocal("botaniamisc.historyLong")); - tooltip.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("botaniamisc.historyDesc")); + List tooltip = new ArrayList<>(); + tooltip.add(I18n.format("botaniamisc.historyLong")); + tooltip.add(TextFormatting.GRAY + I18n.format("botaniamisc.historyDesc")); int tooltipY = (tooltip.size() + 1) * 5; if(k == 2) diff --git a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonInvisible.java b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonInvisible.java index cbfb7d609..bff99eccf 100644 --- a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonInvisible.java +++ b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonInvisible.java @@ -11,15 +11,12 @@ package vazkii.botania.client.gui.lexicon.button; import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; - +import net.minecraft.util.text.TextFormatting; import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - import vazkii.botania.client.core.handler.ClientTickHandler; import vazkii.botania.client.core.handler.PersistentVariableHelper; import vazkii.botania.client.core.helper.FontHelper; @@ -27,11 +24,13 @@ import vazkii.botania.client.gui.lexicon.GuiLexiconIndex; import vazkii.botania.client.lib.LibResources; import vazkii.botania.common.lib.LibMisc; +import javax.annotation.Nonnull; + public class GuiButtonInvisible extends GuiButtonLexicon { private static final ResourceLocation dogResource = new ResourceLocation(LibResources.GUI_DOG); - GuiLexiconIndex gui; + final GuiLexiconIndex gui; public ItemStack displayStack = null; public boolean dog = false; float timeHover = 0; @@ -51,22 +50,22 @@ public class GuiButtonInvisible extends GuiButtonLexicon { } @Override - public void drawButton(Minecraft par1Minecraft, int par2, int par3) { + public void drawButton(@Nonnull Minecraft par1Minecraft, int par2, int par3) { if(enableDog) { dogPos += ClientTickHandler.delta * 10; par1Minecraft.renderEngine.bindTexture(dogResource); float f = 1F / 64F; - GL11.glTranslated(dogPos, 0, 0); - GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.translate(dogPos, 0, 0); + GlStateManager.color(1F, 1F, 1F, 1F); vazkii.botania.client.core.helper.RenderHelper.drawTexturedModalRect(0, yPosition, zLevel + 10, (dogPos % 100 < 50) ? 23 : 0, 0, 23, 19, f, f); xPosition = (int) Math.max(xPosition, dogPos + 10); - GL11.glTranslated(-dogPos, 0, 0); + GlStateManager.translate(-dogPos, 0, 0); } - field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height; - int k = getHoverState(field_146123_n); + hovered = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height; + int k = getHoverState(hovered); boolean showStack = displayStack != null && !displayString.isEmpty(); if(!displayString.isEmpty() && k == 2) { @@ -74,11 +73,11 @@ public class GuiButtonInvisible extends GuiButtonLexicon { gui.setHoveredButton(this); } else timeHover = Math.max(0, timeHover - gui.timeDelta); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.pushMatrix(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glDisable(GL11.GL_ALPHA_TEST); + GlStateManager.disableAlpha(); int color = 0; String format = FontHelper.getFormatFromString(displayString); if(format.length() > 1) { @@ -86,10 +85,10 @@ public class GuiButtonInvisible extends GuiButtonLexicon { if(key == 'o' && format.length() > 3) key = format.charAt(1); - for(EnumChatFormatting ecf : EnumChatFormatting.class.getEnumConstants()) - if(ecf.getFormattingCode() == key) { + for(TextFormatting ecf : TextFormatting.class.getEnumConstants()) + if(ecf.toString().indexOf(ecf.toString().length() - 1) == key) { if(ecf.ordinal() > 15) - ecf = EnumChatFormatting.BLACK; + ecf = TextFormatting.BLACK; color = LibMisc.CONTROL_CODE_COLORS[ecf.ordinal()]; break; } @@ -98,22 +97,22 @@ public class GuiButtonInvisible extends GuiButtonLexicon { int maxalpha = 0x22; int alpha = Math.min(maxalpha, (int) (timeHover / 4 * maxalpha)); drawRect(xPosition - 5, yPosition, (int) (xPosition - 5 + timeHover * 24), yPosition + height, alpha << 24 | color); - GL11.glEnable(GL11.GL_ALPHA_TEST); + GlStateManager.enableAlpha(); - boolean unicode = par1Minecraft.fontRenderer.getUnicodeFlag(); - par1Minecraft.fontRenderer.setUnicodeFlag(true); - par1Minecraft.fontRenderer.drawString(displayString, xPosition + (showStack ? 7 : 0), yPosition + (height - 8) / 2, 0); - par1Minecraft.fontRenderer.setUnicodeFlag(unicode); + boolean unicode = par1Minecraft.fontRendererObj.getUnicodeFlag(); + par1Minecraft.fontRendererObj.setUnicodeFlag(true); + par1Minecraft.fontRendererObj.drawString(displayString, xPosition + (showStack ? 7 : 0), yPosition + (height - 8) / 2, 0); + par1Minecraft.fontRendererObj.setUnicodeFlag(unicode); if(showStack) { - GL11.glScalef(0.5F, 0.5F, 0.5F); + GlStateManager.scale(0.5F, 0.5F, 0.5F); RenderHelper.enableGUIStandardItemLighting(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - RenderItem.getInstance().renderItemIntoGUI(par1Minecraft.fontRenderer, par1Minecraft.renderEngine, displayStack, xPosition * 2 - 6, yPosition * 2 + 4); + GlStateManager.enableRescaleNormal(); + par1Minecraft.getRenderItem().renderItemIntoGUI(displayStack, xPosition * 2 - 6, yPosition * 2 + 4); RenderHelper.disableStandardItemLighting(); - GL11.glEnable(GL11.GL_BLEND); + GlStateManager.enableBlend(); } - GL11.glPopMatrix(); + GlStateManager.popMatrix(); } } diff --git a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonLexicon.java b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonLexicon.java index b352679b9..47db510fb 100644 --- a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonLexicon.java +++ b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonLexicon.java @@ -13,17 +13,17 @@ package vazkii.botania.client.gui.lexicon.button; import net.minecraft.client.audio.PositionedSoundRecord; import net.minecraft.client.audio.SoundHandler; import net.minecraft.client.gui.GuiButton; -import net.minecraft.util.ResourceLocation; +import vazkii.botania.api.sound.BotaniaSoundEvents; public class GuiButtonLexicon extends GuiButton { - public GuiButtonLexicon(int p_i1021_1_, int p_i1021_2_, int p_i1021_3_, int p_i1021_4_, int p_i1021_5_, String p_i1021_6_) { - super(p_i1021_1_, p_i1021_2_, p_i1021_3_, p_i1021_4_, p_i1021_5_, p_i1021_6_); + public GuiButtonLexicon(int id, int x, int y, int width, int height, String text) { + super(id, x, y, width, height, text); } @Override - public void func_146113_a(SoundHandler p_146113_1_) { - p_146113_1_.playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("botania:lexiconPage"), 1.0F)); + public void playPressSound(SoundHandler handler) { + handler.playSound(PositionedSoundRecord.getMasterRecord(BotaniaSoundEvents.lexiconPage, 1.0F)); } } diff --git a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonNotes.java b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonNotes.java index 28729ab7d..f4ff7e83d 100644 --- a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonNotes.java +++ b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonNotes.java @@ -10,21 +10,20 @@ */ package vazkii.botania.client.gui.lexicon.button; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.client.Minecraft; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; - -import org.lwjgl.opengl.GL11; - +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.client.resources.I18n; import vazkii.botania.client.core.helper.RenderHelper; import vazkii.botania.client.gui.lexicon.GuiLexicon; +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.List; + public class GuiButtonNotes extends GuiButtonLexicon { - GuiLexicon parent; + final GuiLexicon parent; public GuiButtonNotes(GuiLexicon parent, int id, int x, int y) { super(id, x, y, 11, 11, ""); @@ -32,21 +31,21 @@ public class GuiButtonNotes extends GuiButtonLexicon { } @Override - public void drawButton(Minecraft par1Minecraft, int par2, int par3) { - field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height; - int k = getHoverState(field_146123_n); + public void drawButton(@Nonnull Minecraft par1Minecraft, int par2, int par3) { + hovered = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height; + int k = getHoverState(hovered); par1Minecraft.renderEngine.bindTexture(GuiLexicon.texture); - GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.color(1F, 1F, 1F, 1F); drawTexturedModalRect(xPosition, yPosition, k == 2 ? 130 : 120, 191, 10, 11); - List tooltip = new ArrayList(); + List tooltip = new ArrayList<>(); if(GuiLexicon.notesEnabled) - tooltip.add(EnumChatFormatting.GREEN + StatCollector.translateToLocal("botaniamisc.hideNotes")); + tooltip.add(TextFormatting.GREEN + I18n.format("botaniamisc.hideNotes")); else { - tooltip.add(EnumChatFormatting.GREEN + StatCollector.translateToLocal("botaniamisc.showNotes")); + tooltip.add(TextFormatting.GREEN + I18n.format("botaniamisc.showNotes")); if(parent.note != null && !parent.note.isEmpty()) - Minecraft.getMinecraft().fontRenderer.drawStringWithShadow("!", xPosition + 10, yPosition, 0xFF0000); + Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow("!", xPosition + 10, yPosition, 0xFF0000); } int tooltipY = (tooltip.size() - 1) * 10; diff --git a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonOptions.java b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonOptions.java index 013f9bceb..aa712a0fa 100644 --- a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonOptions.java +++ b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonOptions.java @@ -10,18 +10,17 @@ */ package vazkii.botania.client.gui.lexicon.button; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.client.Minecraft; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; - -import org.lwjgl.opengl.GL11; - +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.client.resources.I18n; import vazkii.botania.client.core.helper.RenderHelper; import vazkii.botania.client.gui.lexicon.GuiLexicon; +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.List; + public class GuiButtonOptions extends GuiButtonLexicon { public GuiButtonOptions(int id, int x, int y) { @@ -29,17 +28,17 @@ public class GuiButtonOptions extends GuiButtonLexicon { } @Override - public void drawButton(Minecraft par1Minecraft, int par2, int par3) { - field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height; - int k = getHoverState(field_146123_n); + public void drawButton(@Nonnull Minecraft par1Minecraft, int par2, int par3) { + hovered = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height; + int k = getHoverState(hovered); par1Minecraft.renderEngine.bindTexture(GuiLexicon.texture); - GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.color(1F, 1F, 1F, 1F); drawTexturedModalRect(xPosition, yPosition, k == 2 ? 109 : 98, 180, 11, 11); - List tooltip = new ArrayList(); + List tooltip = new ArrayList<>(); for(int i = 0; i < 3; i++) - tooltip.add((i == 0 ? EnumChatFormatting.RED : EnumChatFormatting.GRAY) + StatCollector.translateToLocal("botaniamisc.lexiconOptions" + i)); + tooltip.add((i == 0 ? TextFormatting.RED : TextFormatting.GRAY) + I18n.format("botaniamisc.lexiconOptions" + i)); int tooltipY = (tooltip.size() - 1) * 10; if(k == 2) diff --git a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonPage.java b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonPage.java index fdd0bc7e8..85b06bf25 100644 --- a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonPage.java +++ b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonPage.java @@ -10,19 +10,18 @@ */ package vazkii.botania.client.gui.lexicon.button; -import java.util.Arrays; - import net.minecraft.client.Minecraft; -import net.minecraft.util.StatCollector; - -import org.lwjgl.opengl.GL11; - +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.resources.I18n; import vazkii.botania.client.core.helper.RenderHelper; import vazkii.botania.client.gui.lexicon.GuiLexicon; +import javax.annotation.Nonnull; +import java.util.Collections; + public class GuiButtonPage extends GuiButtonLexicon { - boolean right; + final boolean right; public GuiButtonPage(int par1, int par2, int par3, boolean right) { super(par1, par2, par3, 18, 10, ""); @@ -30,17 +29,17 @@ public class GuiButtonPage extends GuiButtonLexicon { } @Override - public void drawButton(Minecraft par1Minecraft, int par2, int par3) { + public void drawButton(@Nonnull Minecraft par1Minecraft, int par2, int par3) { if(enabled) { - field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height; - int k = getHoverState(field_146123_n); + hovered = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height; + int k = getHoverState(hovered); par1Minecraft.renderEngine.bindTexture(GuiLexicon.texture); - GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.color(1F, 1F, 1F, 1F); drawTexturedModalRect(xPosition, yPosition, k == 2 ? 18 : 0, right ? 180 : 190, 18, 10); if(k == 2) - RenderHelper.renderTooltip(par2, par3, Arrays.asList(StatCollector.translateToLocal(right ? "botaniamisc.nextPage" : "botaniamisc.prevPage"))); + RenderHelper.renderTooltip(par2, par3, Collections.singletonList(I18n.format(right ? "botaniamisc.nextPage" : "botaniamisc.prevPage"))); } } diff --git a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonShare.java b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonShare.java index 339cc48dd..9f679d365 100644 --- a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonShare.java +++ b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonShare.java @@ -10,18 +10,17 @@ */ package vazkii.botania.client.gui.lexicon.button; -import java.util.Arrays; -import java.util.List; - import net.minecraft.client.Minecraft; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; - -import org.lwjgl.opengl.GL11; - +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.client.resources.I18n; import vazkii.botania.client.core.helper.RenderHelper; import vazkii.botania.client.gui.lexicon.GuiLexicon; +import javax.annotation.Nonnull; +import java.util.Collections; +import java.util.List; + public class GuiButtonShare extends GuiButtonLexicon { public GuiButtonShare(int par1, int par2, int par3) { @@ -29,12 +28,12 @@ public class GuiButtonShare extends GuiButtonLexicon { } @Override - public void drawButton(Minecraft par1Minecraft, int par2, int par3) { - field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height; - int k = getHoverState(field_146123_n); + public void drawButton(@Nonnull Minecraft par1Minecraft, int par2, int par3) { + hovered = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height; + int k = getHoverState(hovered); par1Minecraft.renderEngine.bindTexture(GuiLexicon.texture); - GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.color(1F, 1F, 1F, 1F); drawTexturedModalRect(xPosition, yPosition, k == 2 ? 10 : 0 , 200, 10, 12); List tooltip = getTooltip(); @@ -44,6 +43,6 @@ public class GuiButtonShare extends GuiButtonLexicon { } public List getTooltip() { - return Arrays.asList(EnumChatFormatting.AQUA + StatCollector.translateToLocal("botaniamisc.clickToShare")); + return Collections.singletonList(TextFormatting.AQUA + I18n.format("botaniamisc.clickToShare")); } } diff --git a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonUpdateWarning.java b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonUpdateWarning.java index 7f50bc672..48ee68a59 100644 --- a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonUpdateWarning.java +++ b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonUpdateWarning.java @@ -10,20 +10,19 @@ */ package vazkii.botania.client.gui.lexicon.button; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.client.Minecraft; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; - -import org.lwjgl.opengl.GL11; - +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.client.resources.I18n; import vazkii.botania.client.core.handler.ClientTickHandler; import vazkii.botania.client.core.handler.PersistentVariableHelper; import vazkii.botania.client.core.helper.RenderHelper; import vazkii.botania.client.gui.lexicon.GuiLexicon; +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.List; + public class GuiButtonUpdateWarning extends GuiButtonLexicon { public GuiButtonUpdateWarning(int id, int x, int y) { @@ -31,23 +30,23 @@ public class GuiButtonUpdateWarning extends GuiButtonLexicon { } @Override - public void drawButton(Minecraft par1Minecraft, int par2, int par3) { + public void drawButton(@Nonnull Minecraft par1Minecraft, int par2, int par3) { if(!visible || !enabled) return; - field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height; - int k = getHoverState(field_146123_n); + hovered = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height; + int k = getHoverState(hovered); boolean red = k == 2 || ClientTickHandler.ticksInGame % 10 < 5; par1Minecraft.renderEngine.bindTexture(GuiLexicon.texture); - GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.color(1F, 1F, 1F, 1F); drawTexturedModalRect(xPosition, yPosition, red ? 153 : 142, 180, 11, 11); - List tooltip = new ArrayList(); + List tooltip = new ArrayList<>(); String version = PersistentVariableHelper.lastBotaniaVersion; for(int i = 0; i < 6; i++) { - tooltip.add(EnumChatFormatting.GRAY + String.format(StatCollector.translateToLocal("botaniamisc.changes" + i), version).replaceAll("&", "\u00a7")); + tooltip.add(TextFormatting.GRAY + I18n.format("botaniamisc.changes" + i, version).replaceAll("&", "\u00a7")); if(i == 3) tooltip.add(""); } diff --git a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonViewOnline.java b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonViewOnline.java index 3cfb30b45..5cf07ae21 100644 --- a/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonViewOnline.java +++ b/src/main/java/vazkii/botania/client/gui/lexicon/button/GuiButtonViewOnline.java @@ -10,18 +10,17 @@ */ package vazkii.botania.client.gui.lexicon.button; -import java.util.Arrays; -import java.util.List; - import net.minecraft.client.Minecraft; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; - -import org.lwjgl.opengl.GL11; - +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.client.resources.I18n; import vazkii.botania.client.core.helper.RenderHelper; import vazkii.botania.client.gui.lexicon.GuiLexicon; +import javax.annotation.Nonnull; +import java.util.Collections; +import java.util.List; + public class GuiButtonViewOnline extends GuiButtonLexicon { public GuiButtonViewOnline(int id, int x, int y) { @@ -29,15 +28,15 @@ public class GuiButtonViewOnline extends GuiButtonLexicon { } @Override - public void drawButton(Minecraft par1Minecraft, int par2, int par3) { - field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height; - int k = getHoverState(field_146123_n); + public void drawButton(@Nonnull Minecraft par1Minecraft, int par2, int par3) { + hovered = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height; + int k = getHoverState(hovered); par1Minecraft.renderEngine.bindTexture(GuiLexicon.texture); - GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.color(1F, 1F, 1F, 1F); drawTexturedModalRect(xPosition, yPosition, k == 2 ? 41 : 30, 200, 11, 11); - List tooltip = Arrays.asList(EnumChatFormatting.AQUA + StatCollector.translateToLocal("botaniamisc.viewOnline")); + List tooltip = Collections.singletonList(TextFormatting.AQUA + I18n.format("botaniamisc.viewOnline")); int tooltipY = (tooltip.size() - 1) * 10; if(k == 2) RenderHelper.renderTooltip(par2, par3 + tooltipY, tooltip); diff --git a/src/main/java/vazkii/botania/client/integration/jei/JEIBotaniaPlugin.java b/src/main/java/vazkii/botania/client/integration/jei/JEIBotaniaPlugin.java new file mode 100644 index 000000000..662c0ff3f --- /dev/null +++ b/src/main/java/vazkii/botania/client/integration/jei/JEIBotaniaPlugin.java @@ -0,0 +1,102 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.client.integration.jei; + +import mezz.jei.api.IJeiHelpers; +import mezz.jei.api.IJeiRuntime; +import mezz.jei.api.IModPlugin; +import mezz.jei.api.IModRegistry; +import mezz.jei.api.JEIPlugin; +import mezz.jei.api.recipe.VanillaRecipeCategoryUid; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import vazkii.botania.api.BotaniaAPI; +import vazkii.botania.api.state.enums.AltarVariant; +import vazkii.botania.api.state.enums.PoolVariant; +import vazkii.botania.client.gui.crafting.ContainerCraftingHalo; +import vazkii.botania.client.integration.jei.brewery.BreweryRecipeCategory; +import vazkii.botania.client.integration.jei.brewery.BreweryRecipeHandler; +import vazkii.botania.client.integration.jei.elventrade.ElvenTradeRecipeCategory; +import vazkii.botania.client.integration.jei.elventrade.ElvenTradeRecipeHandler; +import vazkii.botania.client.integration.jei.manapool.ManaPoolRecipeCategory; +import vazkii.botania.client.integration.jei.manapool.ManaPoolRecipeHandler; +import vazkii.botania.client.integration.jei.petalapothecary.PetalApothecaryRecipeCategory; +import vazkii.botania.client.integration.jei.petalapothecary.PetalApothecaryRecipeHandler; +import vazkii.botania.client.integration.jei.puredaisy.PureDaisyRecipeCategory; +import vazkii.botania.client.integration.jei.puredaisy.PureDaisyRecipeHandler; +import vazkii.botania.client.integration.jei.runicaltar.RunicAltarRecipeCategory; +import vazkii.botania.client.integration.jei.runicaltar.RunicAltarRecipeHandler; +import vazkii.botania.common.block.ModBlocks; +import vazkii.botania.common.item.ModItems; +import vazkii.botania.common.item.block.ItemBlockSpecialFlower; + +import javax.annotation.Nonnull; + +@JEIPlugin +public class JEIBotaniaPlugin implements IModPlugin { + + @Override + public void register(@Nonnull IModRegistry registry) { + IJeiHelpers jeiHelpers = registry.getJeiHelpers(); + + jeiHelpers.getSubtypeRegistry().registerNbtInterpreter(Item.getItemFromBlock(ModBlocks.specialFlower), ItemBlockSpecialFlower::getType); + jeiHelpers.getSubtypeRegistry().registerNbtInterpreter(Item.getItemFromBlock(ModBlocks.floatingSpecialFlower), ItemBlockSpecialFlower::getType); + + registry.addRecipeCategories( + new BreweryRecipeCategory(jeiHelpers.getGuiHelper()), + new PureDaisyRecipeCategory(jeiHelpers.getGuiHelper()), + new RunicAltarRecipeCategory(jeiHelpers.getGuiHelper()), // Runic must come before petals. See williewillus/Botania#172 + new PetalApothecaryRecipeCategory(jeiHelpers.getGuiHelper()), + new ElvenTradeRecipeCategory(jeiHelpers.getGuiHelper()), + new ManaPoolRecipeCategory(jeiHelpers.getGuiHelper()) + ); + + registry.addRecipeHandlers( + new BreweryRecipeHandler(), + new PureDaisyRecipeHandler(), + new RunicAltarRecipeHandler(), // Runic must come before petals. See williewillus/Botania#172 + new PetalApothecaryRecipeHandler(), + new ElvenTradeRecipeHandler(), + new ManaPoolRecipeHandler() + ); + + registry.addRecipes(BotaniaAPI.brewRecipes); + registry.addRecipes(BotaniaAPI.pureDaisyRecipes); + registry.addRecipes(BotaniaAPI.petalRecipes); + registry.addRecipes(BotaniaAPI.elvenTradeRecipes); + registry.addRecipes(BotaniaAPI.runeAltarRecipes); + registry.addRecipes(BotaniaAPI.manaInfusionRecipes); + + registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.brewery), BreweryRecipeCategory.UID); + registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.alfPortal), ElvenTradeRecipeCategory.UID); + + for(PoolVariant v : PoolVariant.values()) { + registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.pool, 1, v.ordinal()), ManaPoolRecipeCategory.UID); + } + + for(AltarVariant v : AltarVariant.values()) { + if(v == AltarVariant.MOSSY) continue; + registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.altar, 1, v.ordinal()), PetalApothecaryRecipeCategory.UID); + } + + registry.addRecipeCategoryCraftingItem(ItemBlockSpecialFlower.ofType("puredaisy"), PureDaisyRecipeCategory.UID); + registry.addRecipeCategoryCraftingItem(ItemBlockSpecialFlower.ofType(new ItemStack(ModBlocks.floatingSpecialFlower), "puredaisy"), PureDaisyRecipeCategory.UID); + + + registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.runeAltar), RunicAltarRecipeCategory.UID); + registry.addRecipeCategoryCraftingItem(new ItemStack(ModItems.autocraftingHalo), VanillaRecipeCategoryUid.CRAFTING); + registry.addRecipeCategoryCraftingItem(new ItemStack(ModItems.craftingHalo), VanillaRecipeCategoryUid.CRAFTING); + + registry.getRecipeTransferRegistry().addRecipeTransferHandler(ContainerCraftingHalo.class, VanillaRecipeCategoryUid.CRAFTING, 1, 9, 10, 36); + } + + @Override + public void onRuntimeAvailable(@Nonnull IJeiRuntime jeiRuntime) {} + +} diff --git a/src/main/java/vazkii/botania/client/integration/jei/brewery/BreweryRecipeCategory.java b/src/main/java/vazkii/botania/client/integration/jei/brewery/BreweryRecipeCategory.java new file mode 100644 index 000000000..ec8828dbf --- /dev/null +++ b/src/main/java/vazkii/botania/client/integration/jei/brewery/BreweryRecipeCategory.java @@ -0,0 +1,97 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.client.integration.jei.brewery; + +import mezz.jei.api.IGuiHelper; +import mezz.jei.api.gui.IDrawable; +import mezz.jei.api.gui.IDrawableStatic; +import mezz.jei.api.gui.IRecipeLayout; +import mezz.jei.api.recipe.IRecipeCategory; +import mezz.jei.api.recipe.IRecipeWrapper; +import net.minecraft.client.Minecraft; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.client.resources.I18n; + +import javax.annotation.Nonnull; +import java.util.Collection; +import java.util.List; + +public class BreweryRecipeCategory implements IRecipeCategory { + + public static final String UID = "botania.brewery"; + private final IDrawableStatic background; + private final String localizedName; + + public BreweryRecipeCategory(IGuiHelper guiHelper) { + ResourceLocation location = new ResourceLocation("botania", "textures/gui/neiBrewery.png"); + background = guiHelper.createDrawable(location, 0, 0, 166, 65, 0, 0, 0, 0); + localizedName = I18n.format("botania.nei.brewery"); + } + + @Nonnull + @Override + public String getUid() { + return UID; + } + + @Nonnull + @Override + public String getTitle() { + return localizedName; + } + + @Nonnull + @Override + public IDrawable getBackground() { + return background; + } + + @Override + public void drawExtras(@Nonnull Minecraft minecraft) { + } + + @Override + public void drawAnimations(@Nonnull Minecraft minecraft) { + } + + @SuppressWarnings("unchecked") + @Override + public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { + if(!(recipeWrapper instanceof BreweryRecipeWrapper)) + return; + BreweryRecipeWrapper wrapper = ((BreweryRecipeWrapper) recipeWrapper); + + List inputs = wrapper.getInputs(); + + recipeLayout.getItemStacks().init(0, true, 39, 41); + if(inputs.get(0) instanceof ItemStack) { + recipeLayout.getItemStacks().set(0, ((ItemStack) inputs.get(0))); + } else { + recipeLayout.getItemStacks().set(0, ((Collection) inputs.get(0))); + } + + int index = 1, posX = 60; + for(int i = 1; i < wrapper.getInputs().size(); i++) { + Object o = wrapper.getInputs().get(i); + recipeLayout.getItemStacks().init(index, true, posX, 6); + if(o instanceof ItemStack) { + recipeLayout.getItemStacks().set(index, ((ItemStack) o)); + } else if(o instanceof Collection) { + recipeLayout.getItemStacks().set(index, ((Collection) o)); + } + index++; + posX += 18; + } + + recipeLayout.getItemStacks().init(7, false, 87, 41); + recipeLayout.getItemStacks().set(7, wrapper.getOutputs()); + } + +} diff --git a/src/main/java/vazkii/botania/client/integration/jei/brewery/BreweryRecipeHandler.java b/src/main/java/vazkii/botania/client/integration/jei/brewery/BreweryRecipeHandler.java new file mode 100644 index 000000000..e4ffe0bd4 --- /dev/null +++ b/src/main/java/vazkii/botania/client/integration/jei/brewery/BreweryRecipeHandler.java @@ -0,0 +1,48 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.client.integration.jei.brewery; + +import mezz.jei.api.recipe.IRecipeHandler; +import mezz.jei.api.recipe.IRecipeWrapper; +import vazkii.botania.api.recipe.RecipeBrew; + +import javax.annotation.Nonnull; + +public class BreweryRecipeHandler implements IRecipeHandler { + + @Nonnull + @Override + public Class getRecipeClass() { + return RecipeBrew.class; + } + + @Nonnull + @Override + public String getRecipeCategoryUid() { + return "botania.brewery"; + } + + @Nonnull + @Override + public String getRecipeCategoryUid(@Nonnull RecipeBrew recipe) { // o is erased type param + return getRecipeCategoryUid(); + } + + @Nonnull + @Override + public IRecipeWrapper getRecipeWrapper(@Nonnull RecipeBrew recipe) { + return new BreweryRecipeWrapper(recipe); + } + + @Override + public boolean isRecipeValid(@Nonnull RecipeBrew recipe) { + return recipe.getInputs().size() <= 6; + } + +} diff --git a/src/main/java/vazkii/botania/client/integration/jei/brewery/BreweryRecipeWrapper.java b/src/main/java/vazkii/botania/client/integration/jei/brewery/BreweryRecipeWrapper.java new file mode 100644 index 000000000..9604a1b5c --- /dev/null +++ b/src/main/java/vazkii/botania/client/integration/jei/brewery/BreweryRecipeWrapper.java @@ -0,0 +1,83 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.client.integration.jei.brewery; + +import com.google.common.collect.ImmutableList; +import mezz.jei.api.recipe.IRecipeWrapper; +import net.minecraft.client.Minecraft; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; +import vazkii.botania.api.recipe.RecipeBrew; +import vazkii.botania.common.item.ModItems; + +import javax.annotation.Nonnull; +import java.util.List; + +public class BreweryRecipeWrapper implements IRecipeWrapper { + + private final List input; + private final List output; + + @SuppressWarnings("unchecked") + public BreweryRecipeWrapper(RecipeBrew recipeBrew) { + ImmutableList.Builder builder = ImmutableList.builder(); + builder.add(ImmutableList.of(new ItemStack(ModItems.vial, 1, 0), new ItemStack(ModItems.vial, 1, 1))); + for(Object o : recipeBrew.getInputs()) { + if(o instanceof ItemStack) { + builder.add(o); + } + if(o instanceof String) { + builder.add(OreDictionary.getOres(((String) o))); + } + } + + input = builder.build(); + output = ImmutableList.of(recipeBrew.getOutput(new ItemStack(ModItems.vial)).copy(), recipeBrew.getOutput(new ItemStack(ModItems.vial, 1, 1)).copy()); + } + + @Override + public List getInputs() { + return input; + } + + @Override + public List getOutputs() { + return output; + } + + @Override + public List getFluidInputs() { + return ImmutableList.of(); + } + + @Override + public List getFluidOutputs() { + return ImmutableList.of(); + } + + @Override + public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) { + } + + @Override + public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) { + } + + @Override + public List getTooltipStrings(int mouseX, int mouseY) { + return ImmutableList.of(); + } + + @Override + public boolean handleClick(@Nonnull Minecraft minecraft, int mouseX, int mouseY, int mouseButton) { + return false; + } + +} diff --git a/src/main/java/vazkii/botania/client/integration/jei/elventrade/ElvenTradeRecipeCategory.java b/src/main/java/vazkii/botania/client/integration/jei/elventrade/ElvenTradeRecipeCategory.java new file mode 100644 index 000000000..c0c0570a3 --- /dev/null +++ b/src/main/java/vazkii/botania/client/integration/jei/elventrade/ElvenTradeRecipeCategory.java @@ -0,0 +1,116 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.client.integration.jei.elventrade; + +import mezz.jei.api.IGuiHelper; +import mezz.jei.api.gui.IDrawable; +import mezz.jei.api.gui.IRecipeLayout; +import mezz.jei.api.recipe.IRecipeCategory; +import mezz.jei.api.recipe.IRecipeWrapper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.VertexBuffer; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.client.resources.I18n; +import org.lwjgl.opengl.GL11; +import vazkii.botania.client.core.handler.MiscellaneousIcons; + +import javax.annotation.Nonnull; +import java.util.Collection; + +public class ElvenTradeRecipeCategory implements IRecipeCategory { + + public static final String UID = "botania.elvenTrade"; + private final String localizedName; + private final IDrawable background; + private final IDrawable overlay; + + public ElvenTradeRecipeCategory(IGuiHelper guiHelper) { + localizedName = I18n.format("botania.nei.elvenTrade"); + background = guiHelper.createBlankDrawable(145, 95); + overlay = guiHelper.createDrawable(new ResourceLocation("botania", "textures/gui/elvenTradeOverlay.png"), 0, 15, 140, 90); + } + + @Nonnull + @Override + public String getUid() { + return UID; + } + + @Nonnull + @Override + public String getTitle() { + return localizedName; + } + + @Nonnull + @Override + public IDrawable getBackground() { + return background; + } + + @Override + public void drawExtras(@Nonnull Minecraft minecraft) { + GlStateManager.enableAlpha(); + GlStateManager.enableBlend(); + overlay.draw(minecraft, 0, 4); + GlStateManager.disableBlend(); + GlStateManager.disableAlpha(); + } + + @Override + public void drawAnimations(@Nonnull Minecraft minecraft) { + minecraft.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + TextureAtlasSprite sprite = MiscellaneousIcons.INSTANCE.alfPortalTex; + Tessellator tess = Tessellator.getInstance(); + VertexBuffer wr = tess.getBuffer(); + wr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); + int startX = 22; + int startY = 25; + int stopX = 70; + int stopY = 73; + wr.pos(startX, startY, 0).tex(sprite.getMinU(), sprite.getMinV()).endVertex(); + wr.pos(startX, stopY, 0).tex(sprite.getMinU(), sprite.getMaxV()).endVertex(); + wr.pos(stopX, stopY, 0).tex(sprite.getMaxU(), sprite.getMaxV()).endVertex(); + wr.pos(stopX, startY, 0).tex(sprite.getMaxU(), sprite.getMinV()).endVertex(); + tess.draw(); + } + + @SuppressWarnings("unchecked") + @Override + public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { + if(!(recipeWrapper instanceof ElvenTradeRecipeWrapper)) + return; + ElvenTradeRecipeWrapper wrapper = ((ElvenTradeRecipeWrapper) recipeWrapper); + + int index = 0, posX = 42; + for(Object o : wrapper.getInputs()) { + recipeLayout.getItemStacks().init(index, true, posX, 0); + if(o instanceof Collection) { + recipeLayout.getItemStacks().set(index, ((Collection) o)); + } else { + recipeLayout.getItemStacks().set(index, ((ItemStack) o)); + } + index++; + posX += 18; + } + + for (int i = 0; i < wrapper.getOutputs().size(); i++) { + ItemStack stack = wrapper.getOutputs().get(i); + recipeLayout.getItemStacks().init(index + i, false, 93 + (i % 2 * 20), 41 + (i / 2 * 20)); + recipeLayout.getItemStacks().set(index + i, stack); + } + } + +} diff --git a/src/main/java/vazkii/botania/client/integration/jei/elventrade/ElvenTradeRecipeHandler.java b/src/main/java/vazkii/botania/client/integration/jei/elventrade/ElvenTradeRecipeHandler.java new file mode 100644 index 000000000..a791ad23a --- /dev/null +++ b/src/main/java/vazkii/botania/client/integration/jei/elventrade/ElvenTradeRecipeHandler.java @@ -0,0 +1,48 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.client.integration.jei.elventrade; + +import mezz.jei.api.recipe.IRecipeHandler; +import mezz.jei.api.recipe.IRecipeWrapper; +import vazkii.botania.api.recipe.RecipeElvenTrade; + +import javax.annotation.Nonnull; + +public class ElvenTradeRecipeHandler implements IRecipeHandler { + + @Nonnull + @Override + public Class getRecipeClass() { + return RecipeElvenTrade.class; + } + + @Nonnull + @Override + public String getRecipeCategoryUid() { + return "botania.elvenTrade"; + } + + @Nonnull + @Override + public String getRecipeCategoryUid(@Nonnull RecipeElvenTrade recipe) { // o is erased type param + return getRecipeCategoryUid(); + } + + @Nonnull + @Override + public IRecipeWrapper getRecipeWrapper(@Nonnull RecipeElvenTrade recipe) { + return new ElvenTradeRecipeWrapper(recipe); + } + + @Override + public boolean isRecipeValid(@Nonnull RecipeElvenTrade recipe) { + return true; + } + +} diff --git a/src/main/java/vazkii/botania/client/integration/jei/elventrade/ElvenTradeRecipeWrapper.java b/src/main/java/vazkii/botania/client/integration/jei/elventrade/ElvenTradeRecipeWrapper.java new file mode 100644 index 000000000..b76ac1c6f --- /dev/null +++ b/src/main/java/vazkii/botania/client/integration/jei/elventrade/ElvenTradeRecipeWrapper.java @@ -0,0 +1,80 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.client.integration.jei.elventrade; + +import com.google.common.collect.ImmutableList; +import mezz.jei.api.recipe.IRecipeWrapper; +import net.minecraft.client.Minecraft; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; +import vazkii.botania.api.recipe.RecipeElvenTrade; + +import javax.annotation.Nonnull; +import java.util.List; + +public class ElvenTradeRecipeWrapper implements IRecipeWrapper { + + private final List input; + private final List outputs; + + @SuppressWarnings("unchecked") + public ElvenTradeRecipeWrapper(RecipeElvenTrade recipe) { + ImmutableList.Builder builder = ImmutableList.builder(); + for(Object o : recipe.getInputs()) { + if(o instanceof ItemStack) { + builder.add(o); + } + if(o instanceof String) { + builder.add(OreDictionary.getOres(((String) o))); + } + } + input = builder.build(); + outputs = ImmutableList.copyOf(recipe.getOutputs()); + } + + @Override + public List getInputs() { + return input; + } + + @Override + public List getOutputs() { + return outputs; + } + + @Override + public List getFluidInputs() { + return ImmutableList.of(); + } + + @Override + public List getFluidOutputs() { + return ImmutableList.of(); + } + + @Override + public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) { + } + + @Override + public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) { + } + + @Override + public List getTooltipStrings(int mouseX, int mouseY) { + return ImmutableList.of(); + } + + @Override + public boolean handleClick(@Nonnull Minecraft minecraft, int mouseX, int mouseY, int mouseButton) { + return false; + } + +} diff --git a/src/main/java/vazkii/botania/client/integration/jei/manapool/ManaPoolRecipeCategory.java b/src/main/java/vazkii/botania/client/integration/jei/manapool/ManaPoolRecipeCategory.java new file mode 100644 index 000000000..eda67238b --- /dev/null +++ b/src/main/java/vazkii/botania/client/integration/jei/manapool/ManaPoolRecipeCategory.java @@ -0,0 +1,111 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.client.integration.jei.manapool; + +import mezz.jei.api.IGuiHelper; +import mezz.jei.api.gui.IDrawable; +import mezz.jei.api.gui.IRecipeLayout; +import mezz.jei.api.recipe.IRecipeCategory; +import mezz.jei.api.recipe.IRecipeWrapper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.client.resources.I18n; +import vazkii.botania.common.block.ModBlocks; +import vazkii.botania.common.core.helper.ItemNBTHelper; + +import javax.annotation.Nonnull; +import java.util.Collection; + +public class ManaPoolRecipeCategory implements IRecipeCategory { + + public static final String UID = "botania.manaPool"; + private final IDrawable background; + private final String localizedName; + private final IDrawable overlay; + private final ItemStack renderStack = new ItemStack(ModBlocks.pool); + + public ManaPoolRecipeCategory(IGuiHelper guiHelper) { + background = guiHelper.createBlankDrawable(168, 64); + localizedName = I18n.format("botania.nei.manaPool"); + overlay = guiHelper.createDrawable(new ResourceLocation("botania", "textures/gui/pureDaisyOverlay.png"), + 0, 0, 64, 46); + ItemNBTHelper.setBoolean(renderStack, "RenderFull", true); + } + + @Nonnull + @Override + public String getUid() { + return UID; + } + + @Nonnull + @Override + public String getTitle() { + return localizedName; + } + + @Nonnull + @Override + public IDrawable getBackground() { + return background; + } + + @Override + public void drawExtras(@Nonnull Minecraft minecraft) { + GlStateManager.enableAlpha(); + GlStateManager.enableBlend(); + overlay.draw(minecraft, 48, 0); + GlStateManager.disableBlend(); + GlStateManager.disableAlpha(); + } + + @Override + public void drawAnimations(@Nonnull Minecraft minecraft) { + } + + @SuppressWarnings("unchecked") + @Override + public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { + if(!(recipeWrapper instanceof ManaPoolRecipeWrapper)) + return; + + ManaPoolRecipeWrapper wrapper = ((ManaPoolRecipeWrapper) recipeWrapper); + int index = 0; + + recipeLayout.getItemStacks().init(index, true, 40, 12); + if(wrapper.getInputs().get(0) instanceof Collection) { + recipeLayout.getItemStacks().set(index, ((Collection) wrapper.getInputs().get(0))); + } else { + recipeLayout.getItemStacks().set(index, ((ItemStack) wrapper.getInputs().get(0))); + } + + index++; + + if(wrapper.getInputs().size() > 1) { + // Has catalyst + recipeLayout.getItemStacks().init(index, true, 20, 12); + recipeLayout.getItemStacks().set(index, ((ItemStack) wrapper.getInputs().get(1))); + index++; + } + + recipeLayout.getItemStacks().init(index, true, 70, 12); + recipeLayout.getItemStacks().set(index, renderStack); + index++; + + recipeLayout.getItemStacks().init(index, false, 99, 12); + if(wrapper.getOutputs().get(0) instanceof Collection) { + recipeLayout.getItemStacks().set(index, ((Collection) wrapper.getOutputs().get(0))); + } else { + recipeLayout.getItemStacks().set(index, ((ItemStack) wrapper.getOutputs().get(0))); + } + } + +} diff --git a/src/main/java/vazkii/botania/client/integration/jei/manapool/ManaPoolRecipeHandler.java b/src/main/java/vazkii/botania/client/integration/jei/manapool/ManaPoolRecipeHandler.java new file mode 100644 index 000000000..4096fea8b --- /dev/null +++ b/src/main/java/vazkii/botania/client/integration/jei/manapool/ManaPoolRecipeHandler.java @@ -0,0 +1,48 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.client.integration.jei.manapool; + +import mezz.jei.api.recipe.IRecipeHandler; +import mezz.jei.api.recipe.IRecipeWrapper; +import vazkii.botania.api.recipe.RecipeManaInfusion; + +import javax.annotation.Nonnull; + +public class ManaPoolRecipeHandler implements IRecipeHandler { + + @Nonnull + @Override + public Class getRecipeClass() { + return RecipeManaInfusion.class; + } + + @Nonnull + @Override + public String getRecipeCategoryUid() { + return "botania.manaPool"; + } + + @Nonnull + @Override + public String getRecipeCategoryUid(@Nonnull RecipeManaInfusion recipe) { // o is erased type param + return getRecipeCategoryUid(); + } + + @Nonnull + @Override + public IRecipeWrapper getRecipeWrapper(@Nonnull RecipeManaInfusion recipe) { + return new ManaPoolRecipeWrapper(recipe); + } + + @Override + public boolean isRecipeValid(@Nonnull RecipeManaInfusion recipe) { + return recipe.getManaToConsume() <= 100000; + } + +} diff --git a/src/main/java/vazkii/botania/client/integration/jei/manapool/ManaPoolRecipeWrapper.java b/src/main/java/vazkii/botania/client/integration/jei/manapool/ManaPoolRecipeWrapper.java new file mode 100644 index 000000000..4ffd3f699 --- /dev/null +++ b/src/main/java/vazkii/botania/client/integration/jei/manapool/ManaPoolRecipeWrapper.java @@ -0,0 +1,97 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.client.integration.jei.manapool; + +import com.google.common.collect.ImmutableList; +import mezz.jei.api.recipe.IRecipeWrapper; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; +import vazkii.botania.api.recipe.RecipeManaInfusion; +import vazkii.botania.client.core.handler.HUDHandler; +import vazkii.botania.common.block.tile.mana.TilePool; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.util.List; + +public class ManaPoolRecipeWrapper implements IRecipeWrapper { + + private final List input; + private final ItemStack output; + private final int mana; + + public ManaPoolRecipeWrapper(RecipeManaInfusion recipe) { + ImmutableList.Builder builder = ImmutableList.builder(); + + if(recipe.getInput() instanceof ItemStack) { + builder.add(recipe.getInput()); + } else if(recipe.getInput() instanceof String) { + builder.add(OreDictionary.getOres(((String) recipe.getInput()))); + } + + if(recipe.getCatalyst() != null) { + Block block = recipe.getCatalyst().getBlock(); + if (Item.getItemFromBlock(block) != null) { + builder.add(new ItemStack(block, 1, block.getMetaFromState(recipe.getCatalyst()))); + } + } + + input = builder.build(); + output = recipe.getOutput(); + mana = recipe.getManaToConsume(); + } + + @Override + public List getInputs() { + return input; + } + + @Override + public List getOutputs() { + return ImmutableList.of(output); + } + + @Override + public List getFluidInputs() { + return ImmutableList.of(); + } + + @Override + public List getFluidOutputs() { + return ImmutableList.of(); + } + + @Override + public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) { + GlStateManager.enableAlpha(); + HUDHandler.renderManaBar(28, 50, 0x0000FF, 0.75F, mana, TilePool.MAX_MANA / 10); + GlStateManager.disableAlpha(); + } + + @Override + public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) { + } + + @Nullable + @Override + public List getTooltipStrings(int mouseX, int mouseY) { + return ImmutableList.of(); + } + + @Override + public boolean handleClick(@Nonnull Minecraft minecraft, int mouseX, int mouseY, int mouseButton) { + return false; + } + +} diff --git a/src/main/java/vazkii/botania/client/integration/jei/petalapothecary/PetalApothecaryRecipeCategory.java b/src/main/java/vazkii/botania/client/integration/jei/petalapothecary/PetalApothecaryRecipeCategory.java new file mode 100644 index 000000000..198d3957f --- /dev/null +++ b/src/main/java/vazkii/botania/client/integration/jei/petalapothecary/PetalApothecaryRecipeCategory.java @@ -0,0 +1,110 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.client.integration.jei.petalapothecary; + +import mezz.jei.api.IGuiHelper; +import mezz.jei.api.gui.IDrawable; +import mezz.jei.api.gui.IDrawableStatic; +import mezz.jei.api.gui.IRecipeLayout; +import mezz.jei.api.recipe.IRecipeCategory; +import mezz.jei.api.recipe.IRecipeWrapper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.client.resources.I18n; +import vazkii.botania.common.block.ModBlocks; + +import javax.annotation.Nonnull; +import java.awt.*; +import java.util.Collection; + +public class PetalApothecaryRecipeCategory implements IRecipeCategory { + + public static final String UID = "botania.petals"; + private final IDrawableStatic background; + private final String localizedName; + private final IDrawableStatic overlay; + + public PetalApothecaryRecipeCategory(IGuiHelper guiHelper) { + background = guiHelper.createBlankDrawable(150, 110); + localizedName = I18n.format("botania.nei.petalApothecary"); + overlay = guiHelper.createDrawable(new ResourceLocation("botania", "textures/gui/petalOverlay.png"), + 0, 0, 150, 110); + } + + @Nonnull + @Override + public String getUid() { + return UID; + } + + @Nonnull + @Override + public String getTitle() { + return localizedName; + } + + @Nonnull + @Override + public IDrawable getBackground() { + return background; + } + + @Override + public void drawExtras(@Nonnull Minecraft minecraft) { + GlStateManager.enableAlpha(); + GlStateManager.enableBlend(); + overlay.draw(minecraft); + GlStateManager.disableBlend(); + GlStateManager.disableAlpha(); + } + + @Override + public void drawAnimations(@Nonnull Minecraft minecraft) { + } + + @SuppressWarnings("unchecked") + @Override + public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { + if(!(recipeWrapper instanceof PetalApothecaryRecipeWrapper)) + return; + PetalApothecaryRecipeWrapper wrapper = ((PetalApothecaryRecipeWrapper) recipeWrapper); + + recipeLayout.getItemStacks().init(0, true, 64, 52); + recipeLayout.getItemStacks().set(0, new ItemStack(ModBlocks.altar)); + + int index = 1; + double angleBetweenEach = 360.0 / wrapper.getInputs().size(); + Point point = new Point(64, 20), center = new Point(64, 52); + + for(Object o : wrapper.getInputs()) { + recipeLayout.getItemStacks().init(index, true, point.x, point.y); + if(o instanceof Collection) { + recipeLayout.getItemStacks().set(index, ((Collection) o)); + } + if(o instanceof ItemStack) { + recipeLayout.getItemStacks().set(index, ((ItemStack) o)); + } + index += 1; + point = rotatePointAbout(point, center, angleBetweenEach); + } + + recipeLayout.getItemStacks().init(index, false, 103, 17); + recipeLayout.getItemStacks().set(index, wrapper.getOutputs().get(0)); + } + + private Point rotatePointAbout(Point in, Point about, double degrees) { + double rad = degrees * Math.PI / 180.0; + double newX = Math.cos(rad) * (in.x - about.x) - Math.sin(rad) * (in.y - about.y) + about.x; + double newY = Math.sin(rad) * (in.x - about.x) + Math.cos(rad) * (in.y - about.y) + about.y; + return new Point(((int) newX), ((int) newY)); + } + +} diff --git a/src/main/java/vazkii/botania/client/integration/jei/petalapothecary/PetalApothecaryRecipeHandler.java b/src/main/java/vazkii/botania/client/integration/jei/petalapothecary/PetalApothecaryRecipeHandler.java new file mode 100644 index 000000000..fe4860533 --- /dev/null +++ b/src/main/java/vazkii/botania/client/integration/jei/petalapothecary/PetalApothecaryRecipeHandler.java @@ -0,0 +1,48 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.client.integration.jei.petalapothecary; + +import mezz.jei.api.recipe.IRecipeHandler; +import mezz.jei.api.recipe.IRecipeWrapper; +import vazkii.botania.api.recipe.RecipePetals; + +import javax.annotation.Nonnull; + +public class PetalApothecaryRecipeHandler implements IRecipeHandler { + + @Nonnull + @Override + public Class getRecipeClass() { + return RecipePetals.class; + } + + @Nonnull + @Override + public String getRecipeCategoryUid() { + return "botania.petals"; + } + + @Nonnull + @Override + public String getRecipeCategoryUid(@Nonnull RecipePetals recipe) { // o is erased type param + return getRecipeCategoryUid(); + } + + @Nonnull + @Override + public IRecipeWrapper getRecipeWrapper(@Nonnull RecipePetals recipe) { + return new PetalApothecaryRecipeWrapper(recipe); + } + + @Override + public boolean isRecipeValid(@Nonnull RecipePetals recipe) { + return recipe.getInputs().size() <= 16; + } + +} diff --git a/src/main/java/vazkii/botania/client/integration/jei/petalapothecary/PetalApothecaryRecipeWrapper.java b/src/main/java/vazkii/botania/client/integration/jei/petalapothecary/PetalApothecaryRecipeWrapper.java new file mode 100644 index 000000000..82a8925c1 --- /dev/null +++ b/src/main/java/vazkii/botania/client/integration/jei/petalapothecary/PetalApothecaryRecipeWrapper.java @@ -0,0 +1,79 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.client.integration.jei.petalapothecary; + +import com.google.common.collect.ImmutableList; +import mezz.jei.api.recipe.IRecipeWrapper; +import net.minecraft.client.Minecraft; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; +import vazkii.botania.api.recipe.RecipePetals; + +import javax.annotation.Nonnull; +import java.util.List; + +public class PetalApothecaryRecipeWrapper implements IRecipeWrapper { + + private final List input; + private final ItemStack output; + + public PetalApothecaryRecipeWrapper(RecipePetals recipe) { + ImmutableList.Builder builder = ImmutableList.builder(); + for(Object o : recipe.getInputs()) { + if(o instanceof ItemStack) { + builder.add(o); + } + if(o instanceof String) { + builder.add(OreDictionary.getOres(((String) o))); + } + } + input = builder.build(); + output = recipe.getOutput(); + } + + @Override + public List getInputs() { + return input; + } + + @Override + public List getOutputs() { + return ImmutableList.of(output); + } + + @Override + public List getFluidInputs() { + return ImmutableList.of(); + } + + @Override + public List getFluidOutputs() { + return ImmutableList.of(); + } + + @Override + public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) { + } + + @Override + public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) { + } + + @Override + public List getTooltipStrings(int mouseX, int mouseY) { + return ImmutableList.of(); + } + + @Override + public boolean handleClick(@Nonnull Minecraft minecraft, int mouseX, int mouseY, int mouseButton) { + return false; + } + +} diff --git a/src/main/java/vazkii/botania/client/integration/jei/puredaisy/PureDaisyRecipeCategory.java b/src/main/java/vazkii/botania/client/integration/jei/puredaisy/PureDaisyRecipeCategory.java new file mode 100644 index 000000000..1e567190e --- /dev/null +++ b/src/main/java/vazkii/botania/client/integration/jei/puredaisy/PureDaisyRecipeCategory.java @@ -0,0 +1,111 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.client.integration.jei.puredaisy; + +import mezz.jei.api.IGuiHelper; +import mezz.jei.api.gui.IDrawable; +import mezz.jei.api.gui.IRecipeLayout; +import mezz.jei.api.recipe.IRecipeCategory; +import mezz.jei.api.recipe.IRecipeWrapper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.client.resources.I18n; +import vazkii.botania.common.item.block.ItemBlockSpecialFlower; +import vazkii.botania.common.lib.LibBlockNames; + +import javax.annotation.Nonnull; +import java.util.Collection; + +public class PureDaisyRecipeCategory implements IRecipeCategory { + + public static final String UID = "botania.pureDaisy"; + private final IDrawable background; + private final String localizedName; + private final IDrawable overlay; + + public PureDaisyRecipeCategory(IGuiHelper guiHelper) { + background = guiHelper.createBlankDrawable(168, 64); + localizedName = I18n.format("botania.nei.pureDaisy"); + overlay = guiHelper.createDrawable(new ResourceLocation("botania", "textures/gui/pureDaisyOverlay.png"), + 0, 0, 64, 46); + } + + @Nonnull + @Override + public String getUid() { + return UID; + } + + @Nonnull + @Override + public String getTitle() { + return localizedName; + } + + @Nonnull + @Override + public IDrawable getBackground() { + return background; + } + + @Override + public void drawExtras(@Nonnull Minecraft minecraft) { + GlStateManager.enableAlpha(); + GlStateManager.enableBlend(); + overlay.draw(minecraft, 48, 0); + GlStateManager.disableBlend(); + GlStateManager.disableAlpha(); + } + + @Override + public void drawAnimations(@Nonnull Minecraft minecraft) { + } + + @SuppressWarnings("unchecked") + @Override + public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { + if(!(recipeWrapper instanceof PureDaisyRecipeWrapper)) + return; + + PureDaisyRecipeWrapper wrapper = ((PureDaisyRecipeWrapper) recipeWrapper); + boolean inputFluid = wrapper.getInputs().isEmpty(); + boolean outputFluid = wrapper.getOutputs().isEmpty(); + + + if(inputFluid) { + recipeLayout.getFluidStacks().init(0, true, 40, 12, 16, 16, 1000, false, null); + recipeLayout.getFluidStacks().set(0, wrapper.getFluidInputs().get(0)); + } else { + recipeLayout.getItemStacks().init(0, true, 40, 12); + if(wrapper.getInputs().get(0) instanceof Collection) { + recipeLayout.getItemStacks().set(0, ((Collection) wrapper.getInputs().get(0))); + } else { + recipeLayout.getItemStacks().set(0, ((ItemStack) wrapper.getInputs().get(0))); + } + } + + recipeLayout.getItemStacks().init(1, true, 70, 12); + recipeLayout.getItemStacks().set(1, ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_PUREDAISY)); + + if(outputFluid) { + recipeLayout.getFluidStacks().init(2, false, 99, 12, 16, 16, 1000, false, null); + recipeLayout.getFluidStacks().set(2, wrapper.getFluidOutputs().get(0)); + } else { + recipeLayout.getItemStacks().init(2, false, 99, 12); + if(wrapper.getOutputs().get(0) instanceof Collection) { + recipeLayout.getItemStacks().set(2, ((Collection) wrapper.getOutputs().get(0))); + } else { + recipeLayout.getItemStacks().set(2, ((ItemStack) wrapper.getOutputs().get(0))); + } + } + } + +} diff --git a/src/main/java/vazkii/botania/client/integration/jei/puredaisy/PureDaisyRecipeHandler.java b/src/main/java/vazkii/botania/client/integration/jei/puredaisy/PureDaisyRecipeHandler.java new file mode 100644 index 000000000..9dd786723 --- /dev/null +++ b/src/main/java/vazkii/botania/client/integration/jei/puredaisy/PureDaisyRecipeHandler.java @@ -0,0 +1,48 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.client.integration.jei.puredaisy; + +import mezz.jei.api.recipe.IRecipeHandler; +import mezz.jei.api.recipe.IRecipeWrapper; +import vazkii.botania.api.recipe.RecipePureDaisy; + +import javax.annotation.Nonnull; + +public class PureDaisyRecipeHandler implements IRecipeHandler { + + @Nonnull + @Override + public Class getRecipeClass() { + return RecipePureDaisy.class; + } + + @Nonnull + @Override + public String getRecipeCategoryUid() { + return "botania.pureDaisy"; + } + + @Nonnull + @Override + public String getRecipeCategoryUid(@Nonnull RecipePureDaisy recipe) { // o is erased type param + return getRecipeCategoryUid(); + } + + @Nonnull + @Override + public IRecipeWrapper getRecipeWrapper(@Nonnull RecipePureDaisy recipe) { + return new PureDaisyRecipeWrapper(recipe); + } + + @Override + public boolean isRecipeValid(@Nonnull RecipePureDaisy recipe) { + return true; + } + +} diff --git a/src/main/java/vazkii/botania/client/integration/jei/puredaisy/PureDaisyRecipeWrapper.java b/src/main/java/vazkii/botania/client/integration/jei/puredaisy/PureDaisyRecipeWrapper.java new file mode 100644 index 000000000..560245cb8 --- /dev/null +++ b/src/main/java/vazkii/botania/client/integration/jei/puredaisy/PureDaisyRecipeWrapper.java @@ -0,0 +1,89 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.client.integration.jei.puredaisy; + +import com.google.common.collect.ImmutableList; +import mezz.jei.api.recipe.IRecipeWrapper; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; +import vazkii.botania.api.recipe.RecipePureDaisy; + +import javax.annotation.Nonnull; +import java.util.List; + +public class PureDaisyRecipeWrapper implements IRecipeWrapper { + + private List inputs = ImmutableList.of(); + private List outputs = ImmutableList.of(); + private List fluidInputs = ImmutableList.of(); + private List fluidOutputs = ImmutableList.of(); + + public PureDaisyRecipeWrapper(RecipePureDaisy recipe) { + if(recipe.getInput() instanceof String) { + inputs = ImmutableList.of(OreDictionary.getOres(((String) recipe.getInput()))); + } else if(recipe.getInput() instanceof Block) { + Block b = ((Block) recipe.getInput()); + if(FluidRegistry.lookupFluidForBlock(b) != null) { + fluidInputs = ImmutableList.of(new FluidStack(FluidRegistry.lookupFluidForBlock(b), 1000)); + } else { + inputs = ImmutableList.of(new ItemStack(b, 1, b.getMetaFromState(b.getDefaultState()))); + } + } + + Block outBlock = recipe.getOutputState().getBlock(); + if(FluidRegistry.lookupFluidForBlock(outBlock) != null) { + fluidOutputs = ImmutableList.of(new FluidStack(FluidRegistry.lookupFluidForBlock(outBlock), 1000)); + } else { + outputs = ImmutableList.of(new ItemStack(outBlock, 1, outBlock.getMetaFromState(recipe.getOutputState()))); + } + } + + @Override + public List getInputs() { + return inputs; + } + + @Override + public List getOutputs() { + return outputs; + } + + @Override + public List getFluidInputs() { + return fluidInputs; + } + + @Override + public List getFluidOutputs() { + return fluidOutputs; + } + + @Override + public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) { + } + + @Override + public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) { + } + + @Override + public List getTooltipStrings(int mouseX, int mouseY) { + return ImmutableList.of(); + } + + @Override + public boolean handleClick(@Nonnull Minecraft minecraft, int mouseX, int mouseY, int mouseButton) { + return false; + } + +} diff --git a/src/main/java/vazkii/botania/client/integration/jei/runicaltar/RunicAltarRecipeCategory.java b/src/main/java/vazkii/botania/client/integration/jei/runicaltar/RunicAltarRecipeCategory.java new file mode 100644 index 000000000..0040afefc --- /dev/null +++ b/src/main/java/vazkii/botania/client/integration/jei/runicaltar/RunicAltarRecipeCategory.java @@ -0,0 +1,109 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.client.integration.jei.runicaltar; + +import mezz.jei.api.IGuiHelper; +import mezz.jei.api.gui.IDrawable; +import mezz.jei.api.gui.IRecipeLayout; +import mezz.jei.api.recipe.IRecipeCategory; +import mezz.jei.api.recipe.IRecipeWrapper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.resources.I18n; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import vazkii.botania.common.block.ModBlocks; + +import javax.annotation.Nonnull; +import java.awt.*; +import java.util.Collection; + +public class RunicAltarRecipeCategory implements IRecipeCategory { + + public static final String UID = "botania.runicAltar"; + private final IDrawable background; + private final String localizedName; + private final IDrawable overlay; + + public RunicAltarRecipeCategory(IGuiHelper guiHelper) { + background = guiHelper.createBlankDrawable(150, 110); + localizedName = I18n.format("botania.nei.runicAltar"); + overlay = guiHelper.createDrawable(new ResourceLocation("botania", "textures/gui/petalOverlay.png"), + 0, 0, 150, 110); + } + + @Nonnull + @Override + public String getUid() { + return UID; + } + + @Nonnull + @Override + public String getTitle() { + return localizedName; + } + + @Nonnull + @Override + public IDrawable getBackground() { + return background; + } + + @Override + public void drawExtras(@Nonnull Minecraft minecraft) { + GlStateManager.enableAlpha(); + GlStateManager.enableBlend(); + overlay.draw(minecraft); + GlStateManager.disableBlend(); + GlStateManager.disableAlpha(); + } + + @Override + public void drawAnimations(@Nonnull Minecraft minecraft) { + } + + @SuppressWarnings("unchecked") + @Override + public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { + if(!(recipeWrapper instanceof RunicAltarRecipeWrapper)) + return; + RunicAltarRecipeWrapper wrapper = ((RunicAltarRecipeWrapper) recipeWrapper); + + recipeLayout.getItemStacks().init(0, true, 64, 52); + recipeLayout.getItemStacks().set(0, new ItemStack(ModBlocks.runeAltar)); + + int index = 1; + double angleBetweenEach = 360.0 / wrapper.getInputs().size(); + Point point = new Point(64, 20), center = new Point(64, 52); + + for(Object o : wrapper.getInputs()) { + recipeLayout.getItemStacks().init(index, true, point.x, point.y); + if(o instanceof Collection) { + recipeLayout.getItemStacks().set(index, ((Collection) o)); + } + if(o instanceof ItemStack) { + recipeLayout.getItemStacks().set(index, ((ItemStack) o)); + } + index += 1; + point = rotatePointAbout(point, center, angleBetweenEach); + } + + recipeLayout.getItemStacks().init(index, false, 103, 17); + recipeLayout.getItemStacks().set(index, wrapper.getOutputs().get(0)); + } + + private Point rotatePointAbout(Point in, Point about, double degrees) { + double rad = degrees * Math.PI / 180.0; + double newX = Math.cos(rad) * (in.x - about.x) - Math.sin(rad) * (in.y - about.y) + about.x; + double newY = Math.sin(rad) * (in.x - about.x) + Math.cos(rad) * (in.y - about.y) + about.y; + return new Point(((int) newX), ((int) newY)); + } + +} diff --git a/src/main/java/vazkii/botania/client/integration/jei/runicaltar/RunicAltarRecipeHandler.java b/src/main/java/vazkii/botania/client/integration/jei/runicaltar/RunicAltarRecipeHandler.java new file mode 100644 index 000000000..2c4c17fb6 --- /dev/null +++ b/src/main/java/vazkii/botania/client/integration/jei/runicaltar/RunicAltarRecipeHandler.java @@ -0,0 +1,48 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.client.integration.jei.runicaltar; + +import mezz.jei.api.recipe.IRecipeHandler; +import mezz.jei.api.recipe.IRecipeWrapper; +import vazkii.botania.api.recipe.RecipeRuneAltar; + +import javax.annotation.Nonnull; + +public class RunicAltarRecipeHandler implements IRecipeHandler { + + @Nonnull + @Override + public Class getRecipeClass() { + return RecipeRuneAltar.class; + } + + @Nonnull + @Override + public String getRecipeCategoryUid() { + return "botania.runicAltar"; + } + + @Nonnull + @Override + public String getRecipeCategoryUid(@Nonnull RecipeRuneAltar recipe) { // o is erased type param + return getRecipeCategoryUid(); + } + + @Nonnull + @Override + public IRecipeWrapper getRecipeWrapper(@Nonnull RecipeRuneAltar recipe) { + return new RunicAltarRecipeWrapper(recipe); + } + + @Override + public boolean isRecipeValid(@Nonnull RecipeRuneAltar recipe) { + return recipe.getInputs().size() <= 16; + } + +} diff --git a/src/main/java/vazkii/botania/client/integration/jei/runicaltar/RunicAltarRecipeWrapper.java b/src/main/java/vazkii/botania/client/integration/jei/runicaltar/RunicAltarRecipeWrapper.java new file mode 100644 index 000000000..12deaf4e3 --- /dev/null +++ b/src/main/java/vazkii/botania/client/integration/jei/runicaltar/RunicAltarRecipeWrapper.java @@ -0,0 +1,88 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.client.integration.jei.runicaltar; + +import com.google.common.collect.ImmutableList; +import mezz.jei.api.recipe.IRecipeWrapper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; +import vazkii.botania.api.recipe.RecipeRuneAltar; +import vazkii.botania.client.core.handler.HUDHandler; +import vazkii.botania.common.block.tile.mana.TilePool; + +import javax.annotation.Nonnull; +import java.util.List; + +public class RunicAltarRecipeWrapper implements IRecipeWrapper { + + private final List input; + private final ItemStack output; + private final int manaUsage; + + @SuppressWarnings("unchecked") + public RunicAltarRecipeWrapper(RecipeRuneAltar recipe) { + ImmutableList.Builder builder = ImmutableList.builder(); + for(Object o : recipe.getInputs()) { + if(o instanceof ItemStack) { + builder.add(o); + } + if(o instanceof String) { + builder.add(OreDictionary.getOres(((String) o))); + } + } + input = builder.build(); + output = recipe.getOutput(); + manaUsage = recipe.getManaUsage(); + } + + @Override + public List getInputs() { + return input; + } + + @Override + public List getOutputs() { + return ImmutableList.of(output); + } + + @Override + public List getFluidInputs() { + return ImmutableList.of(); + } + + @Override + public List getFluidOutputs() { + return ImmutableList.of(); + } + + @Override + public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) { + GlStateManager.enableAlpha(); + HUDHandler.renderManaBar(28, 113, 0x0000FF, 0.75F, manaUsage, TilePool.MAX_MANA / 10); + GlStateManager.disableAlpha(); + } + + @Override + public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) { + } + + @Override + public List getTooltipStrings(int mouseX, int mouseY) { + return ImmutableList.of(); + } + + @Override + public boolean handleClick(@Nonnull Minecraft minecraft, int mouseX, int mouseY, int mouseButton) { + return false; + } + +} diff --git a/src/main/java/vazkii/botania/client/integration/nei/NEIBotaniaConfig.java b/src/main/java/vazkii/botania/client/integration/nei/NEIBotaniaConfig.java deleted file mode 100644 index 277bd5806..000000000 --- a/src/main/java/vazkii/botania/client/integration/nei/NEIBotaniaConfig.java +++ /dev/null @@ -1,62 +0,0 @@ -package vazkii.botania.client.integration.nei; - -import org.lwjgl.input.Keyboard; - -import vazkii.botania.client.integration.nei.recipe.RecipeHandlerBrewery; -import vazkii.botania.client.integration.nei.recipe.RecipeHandlerElvenTrade; -import vazkii.botania.client.integration.nei.recipe.RecipeHandlerFloatingFlowers; -import vazkii.botania.client.integration.nei.recipe.RecipeHandlerLexicaBotania; -import vazkii.botania.client.integration.nei.recipe.RecipeHandlerManaPool; -import vazkii.botania.client.integration.nei.recipe.RecipeHandlerPetalApothecary; -import vazkii.botania.client.integration.nei.recipe.RecipeHandlerPureDaisy; -import vazkii.botania.client.integration.nei.recipe.RecipeHandlerRunicAltar; -import vazkii.botania.common.lib.LibMisc; -import codechicken.nei.api.API; -import codechicken.nei.api.IConfigureNEI; -import codechicken.nei.guihook.GuiContainerManager; - -public class NEIBotaniaConfig implements IConfigureNEI { - - public static final String CORPOREA_KEY = "gui.botania_corporea_request"; - - @Override - public String getName() { - return LibMisc.MOD_NAME; - } - - @Override - public String getVersion() { - return LibMisc.VERSION; - } - - @Override - public void loadConfig() { - API.registerRecipeHandler(new RecipeHandlerFloatingFlowers()); - API.registerUsageHandler(new RecipeHandlerFloatingFlowers()); - - API.registerRecipeHandler(new RecipeHandlerPetalApothecary()); - API.registerUsageHandler(new RecipeHandlerPetalApothecary()); - - API.registerRecipeHandler(new RecipeHandlerRunicAltar()); - API.registerUsageHandler(new RecipeHandlerRunicAltar()); - - API.registerRecipeHandler(new RecipeHandlerManaPool()); - API.registerUsageHandler(new RecipeHandlerManaPool()); - - API.registerRecipeHandler(new RecipeHandlerElvenTrade()); - API.registerUsageHandler(new RecipeHandlerElvenTrade()); - - API.registerRecipeHandler(new RecipeHandlerBrewery()); - API.registerUsageHandler(new RecipeHandlerBrewery()); - - API.registerRecipeHandler(new RecipeHandlerPureDaisy()); - API.registerUsageHandler(new RecipeHandlerPureDaisy()); - - API.registerRecipeHandler(new RecipeHandlerLexicaBotania()); - API.registerUsageHandler(new RecipeHandlerLexicaBotania()); - - API.addKeyBind(CORPOREA_KEY, Keyboard.KEY_C); - GuiContainerManager.addInputHandler(new NEIInputHandler()); - } - -} diff --git a/src/main/java/vazkii/botania/client/integration/nei/NEIGuiHooks.java b/src/main/java/vazkii/botania/client/integration/nei/NEIGuiHooks.java deleted file mode 100644 index 37953eeaf..000000000 --- a/src/main/java/vazkii/botania/client/integration/nei/NEIGuiHooks.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Dec 15, 2014, 6:09:38 PM (GMT)] - */ -package vazkii.botania.client.integration.nei; - -import vazkii.botania.client.gui.crafting.GuiCraftingHalo; -import codechicken.nei.api.API; -import codechicken.nei.recipe.DefaultOverlayHandler; - -public class NEIGuiHooks { - - public static void init() { - API.registerGuiOverlay(GuiCraftingHalo.class, "crafting"); - API.registerGuiOverlayHandler(GuiCraftingHalo.class, new DefaultOverlayHandler(), "crafting"); - } - -} diff --git a/src/main/java/vazkii/botania/client/integration/nei/NEIInputHandler.java b/src/main/java/vazkii/botania/client/integration/nei/NEIInputHandler.java deleted file mode 100644 index e1ea06188..000000000 --- a/src/main/java/vazkii/botania/client/integration/nei/NEIInputHandler.java +++ /dev/null @@ -1,103 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [25/12/2015, 02:22:32 (GMT)] - */ -package vazkii.botania.client.integration.nei; - -import vazkii.botania.api.corporea.CorporeaHelper; -import vazkii.botania.common.block.tile.corporea.TileCorporeaIndex; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import codechicken.nei.LayoutManager; -import codechicken.nei.NEIClientConfig; -import codechicken.nei.guihook.GuiContainerManager; -import codechicken.nei.guihook.IContainerInputHandler; - -public class NEIInputHandler implements IContainerInputHandler { - - @Override - public boolean keyTyped(GuiContainer gui, char c, int i) { - Minecraft mc = Minecraft.getMinecraft(); - if(TileCorporeaIndex.InputHandler.getNearbyIndexes(mc.thePlayer).isEmpty()) - return false; - - int bind = NEIClientConfig.getKeyBinding(NEIBotaniaConfig.CORPOREA_KEY); - - if(i == bind) { - LayoutManager layoutManager = LayoutManager.instance(); - if(layoutManager != null && LayoutManager.itemPanel != null && !NEIClientConfig.isHidden()) { - ItemStack stack = GuiContainerManager.getStackMouseOver(gui); - if(stack != null && stack.getItem() != null) { - int count = 1; - int max = stack.getMaxStackSize(); - if(gui.isShiftKeyDown()) { - count = max; - if(gui.isCtrlKeyDown()) - count /= 4; - } else if(gui.isCtrlKeyDown()) - count = max / 2; - - if(count > 0) { - String name = CorporeaHelper.stripControlCodes(stack.getDisplayName()); - String full = count + " " + name; - - mc.ingameGUI.getChatGUI().addToSentMessages(full); - mc.thePlayer.sendChatMessage(full); - return true; - } - } - } - } - - return false; - } - - @Override - public boolean lastKeyTyped(GuiContainer arg0, char arg1, int arg2) { - return false; - } - - @Override - public boolean mouseClicked(GuiContainer arg0, int arg1, int arg2, int arg3) { - return false; - } - - @Override - public boolean mouseScrolled(GuiContainer arg0, int arg1, int arg2, int arg3) { - return false; - } - - @Override - public void onKeyTyped(GuiContainer arg0, char arg1, int arg2) { - // NO-OP - } - - @Override - public void onMouseClicked(GuiContainer arg0, int arg1, int arg2, int arg3) { - } - - @Override - public void onMouseDragged(GuiContainer arg0, int arg1, int arg2, int arg3, long arg4) { - // NO-OP - } - - @Override - public void onMouseScrolled(GuiContainer arg0, int arg1, int arg2, int arg3) { - // NO-OP - } - - @Override - public void onMouseUp(GuiContainer arg0, int arg1, int arg2, int arg3) { - // NO-OP - } - -} diff --git a/src/main/java/vazkii/botania/client/integration/nei/recipe/RecipeHandlerBrewery.java b/src/main/java/vazkii/botania/client/integration/nei/recipe/RecipeHandlerBrewery.java deleted file mode 100644 index 2a6e8659e..000000000 --- a/src/main/java/vazkii/botania/client/integration/nei/recipe/RecipeHandlerBrewery.java +++ /dev/null @@ -1,139 +0,0 @@ -package vazkii.botania.client.integration.nei.recipe; - -import java.awt.Rectangle; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; -import net.minecraftforge.oredict.OreDictionary; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.api.BotaniaAPI; -import vazkii.botania.api.brew.IBrewContainer; -import vazkii.botania.api.brew.IBrewItem; -import vazkii.botania.api.recipe.RecipeBrew; -import vazkii.botania.client.lib.LibResources; -import vazkii.botania.common.item.ModItems; -import codechicken.lib.gui.GuiDraw; -import codechicken.nei.PositionedStack; -import codechicken.nei.recipe.TemplateRecipeHandler; - -public class RecipeHandlerBrewery extends TemplateRecipeHandler { - - public class CachedBreweryRecipe extends CachedRecipe { - - public List inputs = new ArrayList(); - public PositionedStack output; - public int mana; - - public CachedBreweryRecipe(RecipeBrew recipe, ItemStack vial) { - if(recipe == null) - return; - - setIngredients(recipe.getInputs()); - ItemStack toVial; - if (vial == null) - toVial = new ItemStack(ModItems.vial); - else - toVial = vial.copy(); - toVial.stackSize = 1; - inputs.add(new PositionedStack(toVial, 39, 42)); - - output = new PositionedStack(recipe.getOutput(toVial), 87, 42); - } - - public CachedBreweryRecipe(RecipeBrew recipe) { - this(recipe, null); - } - - public void setIngredients(List inputs) { - int left = 96 - inputs.size() * 18 / 2; - - int i = 0; - for (Object o : inputs) { - if (o instanceof String) - this.inputs.add(new PositionedStack(OreDictionary.getOres((String) o), left + i * 18, 6)); - else - this.inputs.add(new PositionedStack(o, left + i * 18, 6)); - - i++; - } - } - - @Override - public List getIngredients() { - return getCycledIngredients(cycleticks / 20, inputs); - } - - @Override - public PositionedStack getResult() { - return output; - } - - } - - @Override - public String getRecipeName() { - return StatCollector.translateToLocal("botania.nei.brewery"); - } - - @Override - public String getGuiTexture() { - return LibResources.GUI_NEI_BREWERY; - } - - @Override - public void loadTransferRects() { - transferRects.add(new RecipeTransferRect(new Rectangle(87, 25, 15, 14), "botania.brewery")); - } - - @Override - public void drawBackground(int recipe) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GuiDraw.changeTexture(getGuiTexture()); - GuiDraw.drawTexturedModalRect(0, 0, 0, 0, 166, 65); - } - - @Override - public void loadCraftingRecipes(String outputId, Object... results) { - if(outputId.equals("botania.brewery")) - for(RecipeBrew recipe : BotaniaAPI.brewRecipes) - arecipes.add(new CachedBreweryRecipe(recipe)); - else super.loadCraftingRecipes(outputId, results); - } - - @Override - public void loadCraftingRecipes(ItemStack result) { - if(result.getItem() instanceof IBrewItem) - for(RecipeBrew recipe : BotaniaAPI.brewRecipes) { - if(recipe == null) - continue; - - if(((IBrewItem) result.getItem()).getBrew(result) == recipe.getBrew()) - arecipes.add(new CachedBreweryRecipe(recipe)); - } - } - - @Override - public void loadUsageRecipes(ItemStack ingredient) { - if(ingredient.getItem() instanceof IBrewContainer) { - for(RecipeBrew recipe : BotaniaAPI.brewRecipes) { - if(recipe == null) - continue; - - if(recipe.getOutput(ingredient) != null) - arecipes.add(new CachedBreweryRecipe(recipe, ingredient)); - } - } else for(RecipeBrew recipe : BotaniaAPI.brewRecipes) { - if(recipe == null) - continue; - - CachedBreweryRecipe crecipe = new CachedBreweryRecipe(recipe); - if(crecipe.contains(crecipe.inputs, ingredient)) - arecipes.add(crecipe); - } - } - -} diff --git a/src/main/java/vazkii/botania/client/integration/nei/recipe/RecipeHandlerElvenTrade.java b/src/main/java/vazkii/botania/client/integration/nei/recipe/RecipeHandlerElvenTrade.java deleted file mode 100644 index 02aaebef0..000000000 --- a/src/main/java/vazkii/botania/client/integration/nei/recipe/RecipeHandlerElvenTrade.java +++ /dev/null @@ -1,154 +0,0 @@ -package vazkii.botania.client.integration.nei.recipe; - -import java.awt.Rectangle; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; -import net.minecraftforge.oredict.OreDictionary; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.api.BotaniaAPI; -import vazkii.botania.api.lexicon.ILexicon; -import vazkii.botania.api.recipe.RecipeElvenTrade; -import vazkii.botania.client.lib.LibResources; -import vazkii.botania.common.block.BlockAlfPortal; -import codechicken.lib.gui.GuiDraw; -import codechicken.nei.NEIServerUtils; -import codechicken.nei.PositionedStack; -import codechicken.nei.recipe.TemplateRecipeHandler; - -public class RecipeHandlerElvenTrade extends TemplateRecipeHandler { - - public class CachedElvenTradeRecipe extends CachedRecipe { - - public List inputs = new ArrayList(); - public PositionedStack output; - - public CachedElvenTradeRecipe(RecipeElvenTrade recipe) { - if(recipe == null) - return; - - setIngredients(recipe.getInputs()); - output = new PositionedStack(recipe.getOutput(), 107, 46); - } - - public void setIngredients(List inputs) { - int i = 0; - for(Object o : inputs) { - if(o instanceof String) - this.inputs.add(new PositionedStack(OreDictionary.getOres((String) o), 60 + i * 18, 6)); - else this.inputs.add(new PositionedStack(o, 60 + i * 18, 6)); - - i++; - } - } - - @Override - public List getIngredients() { - return getCycledIngredients(cycleticks / 20, inputs); - } - - @Override - public PositionedStack getResult() { - return output; - } - - } - - @Override - public String getRecipeName() { - return StatCollector.translateToLocal("botania.nei.elvenTrade"); - } - - @Override - public String getGuiTexture() { - return LibResources.GUI_NEI_BLANK; - } - - @Override - public void loadTransferRects() { - transferRects.add(new RecipeTransferRect(new Rectangle(35, 30, 48, 48), "botania.elvenTrade")); - } - - @Override - public int recipiesPerPage() { - return 1; - } - - @Override - public void drawBackground(int recipe) { - super.drawBackground(recipe); - GL11.glEnable(GL11.GL_BLEND); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.7F); - GuiDraw.changeTexture(LibResources.GUI_ELVEN_TRADE_OVERLAY); - GuiDraw.drawTexturedModalRect(30, 10, 17, 17, 100, 80); - GL11.glDisable(GL11.GL_BLEND); - GuiDraw.changeTexture(TextureMap.locationBlocksTexture); - RenderItem.getInstance().renderIcon(35, 29, BlockAlfPortal.portalTex, 48, 48); - } - - private static boolean hasElvenKnowledge() { - /*EntityPlayer player = Minecraft.getMinecraft().thePlayer; - if (player != null) { - for (ItemStack stack : player.inventory.mainInventory) { - if (stack != null && stack.getItem() instanceof ILexicon) { - ILexicon lexicon = (ILexicon) stack.getItem(); - if (lexicon.isKnowledgeUnlocked(stack, BotaniaAPI.elvenKnowledge)) { - return true; - } - } - } - } - return false;*/ - return true; - } - - @Override - public void loadCraftingRecipes(String outputId, Object... results) { - if(outputId.equals("botania.elvenTrade") && hasElvenKnowledge()) { - if(hasElvenKnowledge()) { - for(RecipeElvenTrade recipe : BotaniaAPI.elvenTradeRecipes) { - if(recipe == null) - continue; - - arecipes.add(new CachedElvenTradeRecipe(recipe)); - } - } - } else super.loadCraftingRecipes(outputId, results); - } - - @Override - public void loadCraftingRecipes(ItemStack result) { - if(hasElvenKnowledge()) { - for(RecipeElvenTrade recipe : BotaniaAPI.elvenTradeRecipes) { - if(recipe == null) - continue; - - if(NEIServerUtils.areStacksSameTypeCrafting(recipe.getOutput(), result)) - arecipes.add(new CachedElvenTradeRecipe(recipe)); - } - } - } - - @Override - public void loadUsageRecipes(ItemStack ingredient) { - if(hasElvenKnowledge()) { - for(RecipeElvenTrade recipe : BotaniaAPI.elvenTradeRecipes) { - if(recipe == null) - continue; - - CachedElvenTradeRecipe crecipe = new CachedElvenTradeRecipe(recipe); - if(crecipe.contains(crecipe.inputs, ingredient)) - arecipes.add(crecipe); - } - } - } - -} diff --git a/src/main/java/vazkii/botania/client/integration/nei/recipe/RecipeHandlerFloatingFlowers.java b/src/main/java/vazkii/botania/client/integration/nei/recipe/RecipeHandlerFloatingFlowers.java deleted file mode 100644 index d1a1f397a..000000000 --- a/src/main/java/vazkii/botania/client/integration/nei/recipe/RecipeHandlerFloatingFlowers.java +++ /dev/null @@ -1,81 +0,0 @@ -package vazkii.botania.client.integration.nei.recipe; - -import java.awt.Rectangle; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.StatCollector; -import net.minecraftforge.oredict.OreDictionary; -import vazkii.botania.common.block.BlockFloatingSpecialFlower; -import vazkii.botania.common.block.BlockSpecialFlower; -import vazkii.botania.common.block.ModBlocks; -import codechicken.nei.PositionedStack; -import codechicken.nei.recipe.TemplateRecipeHandler; - -public class RecipeHandlerFloatingFlowers extends TemplateRecipeHandler { - - public class CachedFloatingFlowerRecipe extends CachedRecipe { - - public List inputs = new ArrayList(); - public PositionedStack output; - - public CachedFloatingFlowerRecipe(ItemStack floatingFlower, ItemStack specialFlower, ItemStack output) { - inputs.add(new PositionedStack(floatingFlower, 25, 6)); - inputs.add(new PositionedStack(specialFlower, 43, 6)); - this.output = new PositionedStack(output, 119, 24); - this.output.setMaxSize(1); - } - - @Override - public List getIngredients() { - return getCycledIngredients(cycleticks / 20, inputs); - } - - @Override - public PositionedStack getResult() { - return output; - } - - } - - @Override - public String getRecipeName() { - return StatCollector.translateToLocal("botania.nei.floatingFlowers"); - } - - @Override - public void loadTransferRects() { - transferRects.add(new RecipeTransferRect(new Rectangle(84, 23, 24, 18), "crafting")); - } - - @Override - public String getGuiTexture() { - return "textures/gui/container/crafting_table.png"; - } - - @Override - public void loadCraftingRecipes(ItemStack result) { - if(Block.getBlockFromItem(result.getItem()) instanceof BlockFloatingSpecialFlower) { - ItemStack floatingFlower = new ItemStack(ModBlocks.floatingFlower, 1, OreDictionary.WILDCARD_VALUE); - ItemStack specialFlower = new ItemStack(ModBlocks.specialFlower); - specialFlower.setTagCompound((NBTTagCompound) result.getTagCompound().copy()); - - arecipes.add(new CachedFloatingFlowerRecipe(floatingFlower, specialFlower, result.copy())); - } - } - - @Override - public void loadUsageRecipes(ItemStack ingredient) { - if(Block.getBlockFromItem(ingredient.getItem()) instanceof BlockSpecialFlower) { - ItemStack floatingFlower = new ItemStack(ModBlocks.floatingFlower, 1, OreDictionary.WILDCARD_VALUE); - ItemStack result = new ItemStack(ModBlocks.floatingSpecialFlower); - result.setTagCompound((NBTTagCompound) ingredient.getTagCompound().copy()); - - arecipes.add(new CachedFloatingFlowerRecipe(floatingFlower, ingredient.copy(), result)); - } - } - -} diff --git a/src/main/java/vazkii/botania/client/integration/nei/recipe/RecipeHandlerLexicaBotania.java b/src/main/java/vazkii/botania/client/integration/nei/recipe/RecipeHandlerLexicaBotania.java deleted file mode 100644 index ea1933074..000000000 --- a/src/main/java/vazkii/botania/client/integration/nei/recipe/RecipeHandlerLexicaBotania.java +++ /dev/null @@ -1,171 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [12/12/2015, 23:25:47 (GMT)] - */ -package vazkii.botania.client.integration.nei.recipe; - -import java.awt.Rectangle; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; -import net.minecraftforge.oredict.OreDictionary; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.api.BotaniaAPI; -import vazkii.botania.api.lexicon.KnowledgeType; -import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.api.lexicon.LexiconRecipeMappings; -import vazkii.botania.api.recipe.RecipeManaInfusion; -import vazkii.botania.client.core.handler.HUDHandler; -import vazkii.botania.client.integration.nei.recipe.RecipeHandlerManaPool.CachedManaPoolRecipe; -import vazkii.botania.client.lib.LibResources; -import vazkii.botania.client.render.tile.RenderTilePool; -import vazkii.botania.common.block.ModBlocks; -import vazkii.botania.common.block.tile.mana.TilePool; -import vazkii.botania.common.core.helper.InventoryHelper; -import vazkii.botania.common.item.ModItems; -import vazkii.botania.common.lexicon.LexiconData; -import vazkii.botania.common.lexicon.page.PageRecipe; -import vazkii.botania.common.lexicon.page.PageText; -import codechicken.lib.gui.GuiDraw; -import codechicken.nei.NEIServerUtils; -import codechicken.nei.PositionedStack; -import codechicken.nei.recipe.TemplateRecipeHandler; -import codechicken.nei.recipe.TemplateRecipeHandler.CachedRecipe; -import codechicken.nei.recipe.TemplateRecipeHandler.RecipeTransferRect; - -public class RecipeHandlerLexicaBotania extends TemplateRecipeHandler { - - public class CachedLexicaBotaniaRecipe extends CachedRecipe { - - public LexiconEntry entry; - public PositionedStack item; - public List otherStacks = new ArrayList(); - - public CachedLexicaBotaniaRecipe(ItemStack stack, LexiconEntry entry) { - otherStacks.add(new PositionedStack(new ItemStack(ModItems.lexicon), 51, 5)); - item = new PositionedStack(stack, 91, 5); - this.entry = entry; - } - - @Override - public List getIngredients() { - return otherStacks; - } - - @Override - public PositionedStack getResult() { - return item; - } - - @Override - public List getOtherStacks() { - return otherStacks; - } - - @Override - public boolean contains(Collection ingredients, ItemStack ingredient) { - return ingredient.getItem() == ModItems.lexicon; - } - - } - - @Override - public String getRecipeName() { - return StatCollector.translateToLocal("botania.nei.lexica"); - } - - @Override - public String getGuiTexture() { - return LibResources.GUI_NEI_BLANK; - } - - @Override - public int recipiesPerPage() { - return 1; - } - - @Override - public void loadTransferRects() { - transferRects.add(new RecipeTransferRect(new Rectangle(50, 4, 18, 18), "botania.lexica")); - } - - @Override - public void drawBackground(int recipe) { - super.drawBackground(recipe); - - FontRenderer font = Minecraft.getMinecraft().fontRenderer; - CachedLexicaBotaniaRecipe recipeObj = ((CachedLexicaBotaniaRecipe) arecipes.get(recipe)); - - String s = EnumChatFormatting.UNDERLINE + StatCollector.translateToLocal(recipeObj.entry.getUnlocalizedName()); - font.drawString(s, 82 - font.getStringWidth(s) / 2, 30, 4210752); - - KnowledgeType type = recipeObj.entry.getKnowledgeType(); - s = type.color + StatCollector.translateToLocal(type.getUnlocalizedName()).replaceAll("\\&.", ""); - font.drawString(s, 82 - font.getStringWidth(s) / 2, 42, 4210752); - - s = "\"" + StatCollector.translateToLocal(recipeObj.entry.getTagline()) + "\""; - PageText.renderText(5, 42, 160, 200, s); - - String key = LexiconRecipeMappings.stackToString(recipeObj.item.item); - String quickInfo = "botania.nei.quickInfo:" + key; - String quickInfoLocal = StatCollector.translateToLocal(quickInfo); - - if(GuiScreen.isShiftKeyDown() && GuiScreen.isCtrlKeyDown() && Minecraft.getMinecraft().gameSettings.advancedItemTooltips) - s = "name: " + key; - else if(quickInfo.equals(quickInfoLocal)) - s = StatCollector.translateToLocal("botania.nei.lexicaNoInfo"); - else { - s = StatCollector.translateToLocal("botania.nei.lexicaSeparator"); - font.drawString(s, 82 - font.getStringWidth(s) / 2, 80, 4210752); - s = quickInfoLocal; - } - - PageText.renderText(5, 80, 160, 200, s); - } - - @Override - public void loadCraftingRecipes(String outputId, Object... results) { - if(outputId.equals("botania.lexica")) { - for(LexiconEntry entry : BotaniaAPI.getAllEntries()) { - List stacks = entry.getDisplayedRecipes(); - for(ItemStack stack : stacks) - arecipes.add(new CachedLexicaBotaniaRecipe(stack, entry)); - } - } else super.loadCraftingRecipes(outputId, results); - } - - @Override - public void loadCraftingRecipes(ItemStack result) { - for(LexiconEntry entry : BotaniaAPI.getAllEntries()) { - List stacks = entry.getDisplayedRecipes(); - for(ItemStack stack : stacks) { - String key1 = LexiconRecipeMappings.stackToString(stack); - String key2 = LexiconRecipeMappings.stackToString(result); - if(key1.equals(key2)) - arecipes.add(new CachedLexicaBotaniaRecipe(stack, entry)); - } - } - } - - @Override - public void loadUsageRecipes(ItemStack ingredient) { - // NO-OP - } - -} diff --git a/src/main/java/vazkii/botania/client/integration/nei/recipe/RecipeHandlerManaPool.java b/src/main/java/vazkii/botania/client/integration/nei/recipe/RecipeHandlerManaPool.java deleted file mode 100644 index 8084b4d87..000000000 --- a/src/main/java/vazkii/botania/client/integration/nei/recipe/RecipeHandlerManaPool.java +++ /dev/null @@ -1,156 +0,0 @@ -package vazkii.botania.client.integration.nei.recipe; - -import java.awt.Rectangle; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; -import net.minecraftforge.oredict.OreDictionary; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.api.BotaniaAPI; -import vazkii.botania.api.recipe.RecipeManaInfusion; -import vazkii.botania.client.core.handler.HUDHandler; -import vazkii.botania.client.lib.LibResources; -import vazkii.botania.client.render.tile.RenderTilePool; -import vazkii.botania.common.block.ModBlocks; -import vazkii.botania.common.block.tile.mana.TilePool; -import codechicken.lib.gui.GuiDraw; -import codechicken.nei.NEIServerUtils; -import codechicken.nei.PositionedStack; -import codechicken.nei.recipe.TemplateRecipeHandler; - -public class RecipeHandlerManaPool extends TemplateRecipeHandler { - - public class CachedManaPoolRecipe extends CachedRecipe { - - public List inputs = new ArrayList(); - public PositionedStack output; - public List otherStacks = new ArrayList(); - public int mana; - - public CachedManaPoolRecipe(RecipeManaInfusion recipe) { - if(recipe == null) - return; - inputs.add(new PositionedStack(new ItemStack(ModBlocks.pool, 1, recipe.getOutput().getItem() == Item.getItemFromBlock(ModBlocks.pool) ? 2 : 0), 71, 37)); - - if(recipe.getInput() instanceof String) - inputs.add(new PositionedStack(OreDictionary.getOres((String) recipe.getInput()), 42, 37)); - else inputs.add(new PositionedStack(recipe.getInput(), 42, 37)); - - if(recipe.isAlchemy()) - otherStacks.add(new PositionedStack(new ItemStack(ModBlocks.alchemyCatalyst), 10, 37)); - else if (recipe.isConjuration()) - otherStacks.add(new PositionedStack(new ItemStack(ModBlocks.conjurationCatalyst), 10, 37)); - - output = new PositionedStack(recipe.getOutput(), 101, 37); - mana = recipe.getManaToConsume(); - } - - @Override - public List getIngredients() { - return getCycledIngredients(cycleticks / 20, inputs); - } - - @Override - public PositionedStack getResult() { - return output; - } - - @Override - public List getOtherStacks() { - return otherStacks; - } - - @Override - public boolean contains(Collection ingredients, ItemStack ingredient) { - if(ingredients == inputs) { - boolean skippedPool = false; - - for(PositionedStack stack : ingredients) { - if(!skippedPool) { - skippedPool = true; - continue; - } - - if(stack.contains(ingredient)) - return true; - } - } - - return super.contains(ingredients, ingredient); - } - - } - - @Override - public String getRecipeName() { - return StatCollector.translateToLocal("botania.nei.manaPool"); - } - - @Override - public String getGuiTexture() { - return LibResources.GUI_NEI_BLANK; - } - - @Override - public int recipiesPerPage() { - return 1; - } - - @Override - public void loadTransferRects() { - transferRects.add(new RecipeTransferRect(new Rectangle(70, 36, 18, 18), "botania.manaPool")); - } - - @Override - public void drawBackground(int recipe) { - super.drawBackground(recipe); - GL11.glEnable(GL11.GL_BLEND); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.5F); - GuiDraw.changeTexture(LibResources.GUI_MANA_INFUSION_OVERLAY); - GuiDraw.drawTexturedModalRect(45, 20, 38, 35, 92, 50); - HUDHandler.renderManaBar(32, 80, 0x0000FF, 0.75F, ((CachedManaPoolRecipe) arecipes.get(recipe)).mana, TilePool.MAX_MANA / 10); - RenderTilePool.forceMana = true; - } - - @Override - public void loadCraftingRecipes(String outputId, Object... results) { - if(outputId.equals("botania.manaPool")) { - for(RecipeManaInfusion recipe : BotaniaAPI.manaInfusionRecipes) { - if(recipe == null) - continue; - - arecipes.add(new CachedManaPoolRecipe(recipe)); - } - } else super.loadCraftingRecipes(outputId, results); - } - - @Override - public void loadCraftingRecipes(ItemStack result) { - for(RecipeManaInfusion recipe : BotaniaAPI.manaInfusionRecipes) { - if(recipe == null) - continue; - - if(NEIServerUtils.areStacksSameTypeCrafting(recipe.getOutput(), result)) - arecipes.add(new CachedManaPoolRecipe(recipe)); - } - } - - @Override - public void loadUsageRecipes(ItemStack ingredient) { - for(RecipeManaInfusion recipe : BotaniaAPI.manaInfusionRecipes) { - if(recipe == null) - continue; - - CachedManaPoolRecipe crecipe = new CachedManaPoolRecipe(recipe); - if(crecipe.contains(crecipe.getIngredients(), ingredient) || crecipe.contains(crecipe.getOtherStacks(), ingredient)) - arecipes.add(crecipe); - } - } - -} diff --git a/src/main/java/vazkii/botania/client/integration/nei/recipe/RecipeHandlerPetalApothecary.java b/src/main/java/vazkii/botania/client/integration/nei/recipe/RecipeHandlerPetalApothecary.java deleted file mode 100644 index d3d3fc96b..000000000 --- a/src/main/java/vazkii/botania/client/integration/nei/recipe/RecipeHandlerPetalApothecary.java +++ /dev/null @@ -1,142 +0,0 @@ -package vazkii.botania.client.integration.nei.recipe; - -import java.awt.Rectangle; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; -import net.minecraftforge.oredict.OreDictionary; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.api.BotaniaAPI; -import vazkii.botania.api.recipe.RecipePetals; -import vazkii.botania.client.lib.LibResources; -import vazkii.botania.common.block.ModBlocks; -import codechicken.lib.gui.GuiDraw; -import codechicken.nei.NEIServerUtils; -import codechicken.nei.PositionedStack; -import codechicken.nei.recipe.TemplateRecipeHandler; - -public class RecipeHandlerPetalApothecary extends TemplateRecipeHandler { - - public class CachedPetalApothecaryRecipe extends CachedRecipe { - - public List inputs = new ArrayList(); - public PositionedStack output; - - public CachedPetalApothecaryRecipe(RecipePetals recipe, boolean addCenterItem) { - setIngredients(recipe.getInputs()); - output = new PositionedStack(recipe.getOutput(), 111, 21); - if(addCenterItem) - inputs.add(new PositionedStack(new ItemStack(ModBlocks.altar), 73, 55)); - } - - public CachedPetalApothecaryRecipe(RecipePetals recipe) { - this(recipe, true); - } - - public void setIngredients(List inputs) { - float degreePerInput = 360F / inputs.size(); - float currentDegree = -90F; - - for(Object o : inputs) { - int posX = (int) Math.round(73 + Math.cos(currentDegree * Math.PI / 180D) * 32); - int posY = (int) Math.round(55 + Math.sin(currentDegree * Math.PI / 180D) * 32); - - if(o instanceof String) - this.inputs.add(new PositionedStack(OreDictionary.getOres((String) o), posX, posY)); - else this.inputs.add(new PositionedStack(o, posX, posY)); - currentDegree += degreePerInput; - } - } - - @Override - public List getIngredients() { - return getCycledIngredients(cycleticks / 20, inputs); - } - - @Override - public PositionedStack getResult() { - return output; - } - - } - - @Override - public String getRecipeName() { - return StatCollector.translateToLocal("botania.nei.petalApothecary"); - } - - public String getRecipeID() { - return "botania.petalApothecary"; - } - - @Override - public String getGuiTexture() { - return LibResources.GUI_NEI_BLANK; - } - - @Override - public void loadTransferRects() { - transferRects.add(new RecipeTransferRect(new Rectangle(72, 54, 18, 18), getRecipeID())); - } - - @Override - public int recipiesPerPage() { - return 1; - } - - @Override - public void drawBackground(int recipe) { - super.drawBackground(recipe); - GL11.glEnable(GL11.GL_BLEND); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.5F); - GuiDraw.changeTexture(LibResources.GUI_PETAL_OVERLAY); - GuiDraw.drawTexturedModalRect(45, 10, 38, 7, 92, 92); - } - - public List getRecipes() { - return BotaniaAPI.petalRecipes; - } - - public CachedPetalApothecaryRecipe getCachedRecipe(RecipePetals recipe) { - return new CachedPetalApothecaryRecipe(recipe); - } - - @Override - public void loadCraftingRecipes(String outputId, Object... results) { - if(outputId.equals(getRecipeID())) { - for(RecipePetals recipe : getRecipes()) - if(recipe.getOutput().getItem() != Items.skull) - arecipes.add(getCachedRecipe(recipe)); - } else super.loadCraftingRecipes(outputId, results); - } - - @Override - public void loadCraftingRecipes(ItemStack result) { - for(RecipePetals recipe : getRecipes()){ - if(recipe == null) - continue; - - if(recipe.getOutput().stackTagCompound != null && NEIServerUtils.areStacksSameType(recipe.getOutput(), result) || recipe.getOutput().stackTagCompound == null && NEIServerUtils.areStacksSameTypeCrafting(recipe.getOutput(), result) && recipe.getOutput().getItem() != Items.skull) - arecipes.add(getCachedRecipe(recipe)); - } - } - - @Override - public void loadUsageRecipes(ItemStack ingredient) { - for(RecipePetals recipe : getRecipes()) { - if(recipe == null) - continue; - - CachedPetalApothecaryRecipe crecipe = getCachedRecipe(recipe); - if(crecipe.contains(crecipe.inputs, ingredient) && recipe.getOutput().getItem() != Items.skull) - arecipes.add(crecipe); - } - } - - -} diff --git a/src/main/java/vazkii/botania/client/integration/nei/recipe/RecipeHandlerPureDaisy.java b/src/main/java/vazkii/botania/client/integration/nei/recipe/RecipeHandlerPureDaisy.java deleted file mode 100644 index 47cbedb63..000000000 --- a/src/main/java/vazkii/botania/client/integration/nei/recipe/RecipeHandlerPureDaisy.java +++ /dev/null @@ -1,137 +0,0 @@ -package vazkii.botania.client.integration.nei.recipe; - -import java.awt.Rectangle; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; -import net.minecraftforge.oredict.OreDictionary; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.api.BotaniaAPI; -import vazkii.botania.api.recipe.RecipePureDaisy; -import vazkii.botania.client.lib.LibResources; -import vazkii.botania.common.item.block.ItemBlockSpecialFlower; -import vazkii.botania.common.lib.LibBlockNames; -import codechicken.lib.gui.GuiDraw; -import codechicken.nei.NEIServerUtils; -import codechicken.nei.PositionedStack; -import codechicken.nei.recipe.TemplateRecipeHandler; - -public class RecipeHandlerPureDaisy extends TemplateRecipeHandler { - - public class CachedPureDaisyRecipe extends CachedRecipe { - - public List inputs = new ArrayList(); - public PositionedStack output; - public List otherStacks = new ArrayList(); - - public CachedPureDaisyRecipe(RecipePureDaisy recipe) { - if(recipe == null) - return; - inputs.add(new PositionedStack(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_PUREDAISY), 71, 23)); - - if(recipe.getInput() instanceof String) - inputs.add(new PositionedStack(OreDictionary.getOres((String) recipe.getInput()), 42, 23)); - else inputs.add(new PositionedStack(new ItemStack((Block) recipe.getInput()), 42, 23)); - - output = new PositionedStack(new ItemStack(recipe.getOutput()), 101, 23); - } - - @Override - public List getIngredients() { - return getCycledIngredients(cycleticks / 20, inputs); - } - - @Override - public PositionedStack getResult() { - return output; - } - - @Override - public List getOtherStacks() { - return otherStacks; - } - - @Override - public boolean contains(Collection ingredients, ItemStack ingredient) { - if(ingredients == inputs) { - for(PositionedStack stack : ingredients) - if(stack.contains(ingredient)) - return true; - } - - return super.contains(ingredients, ingredient); - } - - } - - @Override - public String getRecipeName() { - return StatCollector.translateToLocal("botania.nei.pureDaisy"); - } - - @Override - public String getGuiTexture() { - return LibResources.GUI_NEI_BLANK; - } - - @Override - public int recipiesPerPage() { - return 2; - } - - @Override - public void loadTransferRects() { - transferRects.add(new RecipeTransferRect(new Rectangle(70, 22, 18, 18), "botania.pureDaisy")); - } - - @Override - public void drawBackground(int recipe) { - super.drawBackground(recipe); - GL11.glEnable(GL11.GL_BLEND); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.5F); - GuiDraw.changeTexture(LibResources.GUI_PURE_DAISY_OVERLAY); - GuiDraw.drawTexturedModalRect(45, 10, 0, 0, 65, 44); - } - - @Override - public void loadCraftingRecipes(String outputId, Object... results) { - if(outputId.equals("botania.pureDaisy")) { - for(RecipePureDaisy recipe : BotaniaAPI.pureDaisyRecipes) { - if(recipe == null) - continue; - - arecipes.add(new CachedPureDaisyRecipe(recipe)); - } - } else super.loadCraftingRecipes(outputId, results); - } - - @Override - public void loadCraftingRecipes(ItemStack result) { - for(RecipePureDaisy recipe : BotaniaAPI.pureDaisyRecipes) { - if(recipe == null) - continue; - - if(NEIServerUtils.areStacksSameTypeCrafting(new ItemStack(recipe.getOutput()), result)) - arecipes.add(new CachedPureDaisyRecipe(recipe)); - } - } - - @Override - public void loadUsageRecipes(ItemStack ingredient) { - for(RecipePureDaisy recipe : BotaniaAPI.pureDaisyRecipes) { - if(recipe == null) - continue; - - CachedPureDaisyRecipe crecipe = new CachedPureDaisyRecipe(recipe); - if(crecipe.contains(crecipe.getIngredients(), ingredient) || crecipe.contains(crecipe.getOtherStacks(), ingredient)) - arecipes.add(crecipe); - } - } - -} diff --git a/src/main/java/vazkii/botania/client/integration/nei/recipe/RecipeHandlerRunicAltar.java b/src/main/java/vazkii/botania/client/integration/nei/recipe/RecipeHandlerRunicAltar.java deleted file mode 100644 index 506ad540d..000000000 --- a/src/main/java/vazkii/botania/client/integration/nei/recipe/RecipeHandlerRunicAltar.java +++ /dev/null @@ -1,57 +0,0 @@ -package vazkii.botania.client.integration.nei.recipe; - -import java.util.List; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; -import vazkii.botania.api.BotaniaAPI; -import vazkii.botania.api.recipe.RecipePetals; -import vazkii.botania.api.recipe.RecipeRuneAltar; -import vazkii.botania.client.core.handler.HUDHandler; -import vazkii.botania.common.block.ModBlocks; -import vazkii.botania.common.block.tile.mana.TilePool; -import codechicken.nei.PositionedStack; - -public class RecipeHandlerRunicAltar extends RecipeHandlerPetalApothecary { - - public class CachedRunicAltarRecipe extends CachedPetalApothecaryRecipe { - - public int manaUsage; - - public CachedRunicAltarRecipe(RecipeRuneAltar recipe) { - super(recipe, false); - if(recipe == null) - return; - manaUsage = recipe.getManaUsage(); - inputs.add(new PositionedStack(new ItemStack(ModBlocks.runeAltar), 73, 55)); - } - - } - - @Override - public String getRecipeName() { - return StatCollector.translateToLocal("botania.nei.runicAltar"); - } - - @Override - public String getRecipeID() { - return "botania.runicAltar"; - } - - @Override - public void drawBackground(int recipe) { - super.drawBackground(recipe); - HUDHandler.renderManaBar(32, 113, 0x0000FF, 0.75F, ((CachedRunicAltarRecipe) arecipes.get(recipe)).manaUsage, TilePool.MAX_MANA / 10); - } - - @Override - public List getRecipes() { - return BotaniaAPI.runeAltarRecipes; - } - - @Override - public CachedPetalApothecaryRecipe getCachedRecipe(RecipePetals recipe) { - return new CachedRunicAltarRecipe((RecipeRuneAltar) recipe); - } - -} diff --git a/src/main/java/vazkii/botania/client/lib/LibRenderIDs.java b/src/main/java/vazkii/botania/client/lib/LibRenderIDs.java deleted file mode 100644 index 75f424b70..000000000 --- a/src/main/java/vazkii/botania/client/lib/LibRenderIDs.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 21, 2014, 8:03:06 PM (GMT)] - */ -package vazkii.botania.client.lib; - -public final class LibRenderIDs { - - public static int idAltar = -1; - public static int idSpecialFlower = -1; - public static int idSpreader = -1; - public static int idPool = -1; - public static int idPylon = -1; - public static int idMiniIsland = -1; - public static int idTinyPotato = -1; - public static int idSpawnerClaw = -1; - public static int idBrewery = -1; - public static int idCorporeaIndex = -1; - public static int idPump = -1; - public static int idDoubleFlower = -1; - public static int idCorporeaCrystalCybe = -1; - public static int idIncensePlate = -1; - public static int idHourglass = -1; - public static int idCocoon = -1; - public static int idLightRelay = -1; - public static int idBellows = -1; - public static int idTeruTeruBozu = -1; - public static int idAvatar = -1; - -} diff --git a/src/main/java/vazkii/botania/client/lib/LibResources.java b/src/main/java/vazkii/botania/client/lib/LibResources.java index 584d12181..74d0d2e02 100644 --- a/src/main/java/vazkii/botania/client/lib/LibResources.java +++ b/src/main/java/vazkii/botania/client/lib/LibResources.java @@ -65,18 +65,12 @@ public final class LibResources { public static final String ENTRY_METAMORPHIC_STONES = PREFIX_ENTRIES + "metamorphicStones.png"; public static final String ENTRY_BANNERS = PREFIX_ENTRIES + "banners.png"; - public static final String MODEL_ALTAR = PREFIX_MODEL + "altar.png"; - public static final String MODEL_ALTAR_META = PREFIX_MODEL + "altarMeta%d.png"; - public static final String MODEL_ALTAR_MOSSY = PREFIX_MODEL + "altarMossy.png"; public static final String MODEL_SPREADER = PREFIX_MODEL + "spreader.png"; public static final String MODEL_SPREADER_REDSTONE = PREFIX_MODEL + "spreaderRedstone.png"; public static final String MODEL_SPREADER_DREAMWOOD = PREFIX_MODEL + "spreaderDreamwood.png"; public static final String MODEL_SPREADER_HALLOWEEN = PREFIX_MODEL + "spreader_halloween.png"; public static final String MODEL_SPREADER_REDSTONE_HALLOWEEN = PREFIX_MODEL + "spreaderRedstone_halloween.png"; public static final String MODEL_SPREADER_DREAMWOOD_HALLOWEEN = PREFIX_MODEL + "spreaderDreamwood_halloween.png"; - public static final String MODEL_POOL = PREFIX_MODEL + "pool.png"; - public static final String MODEL_INFINITE_POOL = PREFIX_MODEL + "infinitePool.png"; - public static final String MODEL_DILUTED_POOL = PREFIX_MODEL + "dilutedPool.png"; public static final String MODEL_PYLON_OLD = PREFIX_MODEL + "pylonOld.png"; public static final String MODEL_PYLON = PREFIX_MODEL + "pylon.png"; public static final String MODEL_PYLON_GREEN_OLD = PREFIX_MODEL + "pylonOld1.png"; @@ -104,7 +98,6 @@ public final class LibResources { public static final String MODEL_TINY_POTATO = PREFIX_MODEL + "tinyPotato.png"; public static final String MODEL_TINY_POTATO_GS = PREFIX_MODEL + "tinyPotatoGray.png"; public static final String MODEL_TINY_POTATO_HALLOWEEN = PREFIX_MODEL + "tinyPotato_halloween.png"; - public static final String MODEL_SPAWNER_CLAW = PREFIX_MODEL + "spawnerClaw.png"; public static final String MODEL_BREWERY = PREFIX_MODEL + "brewery.png"; public static final String MODEL_TRAVEL_BELT = PREFIX_MODEL + "travelBelt.png"; public static final String MODEL_SUPER_TRAVEL_BELT = PREFIX_MODEL + "superTravelBelt.png"; @@ -114,20 +107,8 @@ public final class LibResources { public static final String MODEL_UNHOLY_CLOAK = PREFIX_MODEL + "unholyCloak.png"; public static final String MODEL_CORPOREA_INDEX = PREFIX_MODEL + "corporeaIndex.png"; public static final String MODEL_INVISIBLE_ARMOR = PREFIX_MODEL + "invisibleArmor.png"; - public static final String MODEL_PUMP = PREFIX_MODEL + "pump.png"; - public static final String MODEL_MINI_ISLAND = PREFIX_MODEL + "miniIsland.png"; - public static final String MODEL_MINI_ISLAND_PODZOL = PREFIX_MODEL + "miniIslandPodzol.png"; - public static final String MODEL_MINI_ISLAND_MYCEL = PREFIX_MODEL + "miniIslandMycelium.png"; - public static final String MODEL_MINI_ISLAND_SNOW = PREFIX_MODEL + "miniIslandSnow.png"; - public static final String MODEL_MINI_ISLAND_DRY = PREFIX_MODEL + "miniIslandDry.png"; - public static final String MODEL_MINI_ISLAND_GOLDEN = PREFIX_MODEL + "miniIslandGolden.png"; - public static final String MODEL_MINI_ISLAND_VIVID = PREFIX_MODEL + "miniIslandVivid.png"; - public static final String MODEL_MINI_ISLAND_SCORCHED = PREFIX_MODEL + "miniIslandScorched.png"; - public static final String MODEL_MINI_ISLAND_INFUSED = PREFIX_MODEL + "miniIslandInfused.png"; - public static final String MODEL_MINI_ISLAND_MUTATED = PREFIX_MODEL + "miniIslandMutated.png"; public static final String MODEL_PINK_WITHER = PREFIX_MODEL + "pinkWither.png"; public static final String MODEL_CRYSTAL_CUBE = PREFIX_MODEL + "crystalCube.png"; - public static final String MODEL_INCENSE_PLATE = PREFIX_MODEL + "incensePlate.png"; public static final String MODEL_HOURGLASS = PREFIX_MODEL + "hourglass.png"; public static final String MODEL_COCOON = PREFIX_MODEL + "cocoon.png"; public static final String MODEL_BELLOWS = PREFIX_MODEL + "bellows.png"; @@ -151,8 +132,6 @@ public final class LibResources { public static final String MISC_RAINBOW = PREFIX_MISC + "rainbow.png"; public static final String MISC_PLANET = PREFIX_MISC + "planet"; - public static final String OBJ_MODEL_PYLON = PREFIX_OBJ_MODEL + "pylon.obj"; - public static final String CATEGORY_INDEX = PREFIX_CATEGORIES + "index.png"; public static final String SHADER_PYLON_GLOW_FRAG = PREFIX_SHADER + "pylon_glow.frag"; @@ -166,5 +145,7 @@ public final class LibResources { public static final String SHADER_FILM_GRAIN_FRAG = PREFIX_SHADER + "film_grain.frag"; public static final String SHADER_GOLD_FRAG = PREFIX_SHADER + "gold.frag"; public static final String SHADER_CATEGORY_BUTTON_FRAG = PREFIX_SHADER + "category_button.frag"; + public static final String SHADER_ALPHA_FRAG = PREFIX_SHADER + "alpha.frag"; + public static final String SHADER_ALPHA_VERT = PREFIX_SHADER + "alpha.vert"; } diff --git a/src/main/java/vazkii/botania/client/model/FloatingFlowerModel.java b/src/main/java/vazkii/botania/client/model/FloatingFlowerModel.java new file mode 100644 index 000000000..e16c57f3f --- /dev/null +++ b/src/main/java/vazkii/botania/client/model/FloatingFlowerModel.java @@ -0,0 +1,236 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.client.model; + +import com.google.common.collect.HashBasedTable; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Table; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.renderer.block.model.IBakedModel; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; +import net.minecraft.client.renderer.block.model.ItemOverrideList; +import net.minecraft.client.renderer.block.model.ModelManager; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.renderer.vertex.VertexFormatElement; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; +import net.minecraftforge.client.model.IPerspectiveAwareModel; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.client.model.ModelLoaderRegistry; +import net.minecraftforge.client.model.pipeline.IVertexConsumer; +import net.minecraftforge.client.model.pipeline.UnpackedBakedQuad; +import net.minecraftforge.client.model.pipeline.VertexTransformer; +import net.minecraftforge.common.model.TRSRTransformation; +import net.minecraftforge.common.property.IExtendedBlockState; +import org.apache.commons.lang3.tuple.Pair; +import vazkii.botania.api.BotaniaAPIClient; +import vazkii.botania.api.item.IFloatingFlower; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.common.Botania; +import vazkii.botania.common.block.ModBlocks; +import vazkii.botania.common.item.block.ItemBlockFloatingSpecialFlower; +import vazkii.botania.common.item.block.ItemBlockSpecialFlower; + +import javax.annotation.Nonnull; +import javax.vecmath.Matrix4f; +import javax.vecmath.Vector3f; +import javax.vecmath.Vector4f; +import java.util.ArrayList; +import java.util.EnumMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public class FloatingFlowerModel implements IBakedModel { + + private static final String MUNDANE_PREFIX = "botania:shimmeringFlower_"; + private final Table CACHE = HashBasedTable.create(); + + protected static BakedQuad transform(BakedQuad quad, final TRSRTransformation transform) { + UnpackedBakedQuad.Builder builder = new UnpackedBakedQuad.Builder(DefaultVertexFormats.ITEM); + final IVertexConsumer consumer = new VertexTransformer(builder) { + @Override + public void put(int element, float... data) { + VertexFormatElement formatElement = DefaultVertexFormats.ITEM.getElement(element); + switch(formatElement.getUsage()) { + case POSITION: { + float[] newData = new float[4]; + Vector4f vec = new Vector4f(data); + transform.getMatrix().transform(vec); + vec.get(newData); + parent.put(element, newData); + break; + } + default: { + parent.put(element, data); + break; + } + } + } + }; + quad.pipe(consumer); + return builder.build(); + } + + @Nonnull + @Override + public List getQuads(IBlockState state, EnumFacing face, long rand) { + if(state.getBlock() != ModBlocks.floatingSpecialFlower && state.getBlock() != ModBlocks.floatingFlower) + return Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel().getQuads(state, face, rand); + IExtendedBlockState realState = ((IExtendedBlockState) state); + IFloatingFlower.IslandType islandType = realState.getValue(BotaniaStateProps.ISLAND_TYPE); + String identifier; + + if(state.getBlock() == ModBlocks.floatingSpecialFlower) { + // Magic flower + identifier = realState.getValue(BotaniaStateProps.SUBTILE_ID); + } else { + // Mundane flower + identifier = MUNDANE_PREFIX + state.getValue(BotaniaStateProps.COLOR).getMetadata(); + } + + return getModel(islandType, identifier).getQuads(state, face, rand); + } + + // Get the model for this islandtype + flower type combination. If it's not cached already, generate it. + private CompositeBakedModel getModel(IFloatingFlower.IslandType islandType, String identifier) { + ModelManager modelManager = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getModelManager(); + + if(CACHE.contains(islandType, identifier)) { + return CACHE.get(islandType, identifier); + } else { + IBakedModel islandModel; + try { + islandModel = ModelLoaderRegistry.getModel(BotaniaAPIClient.getRegisteredIslandTypeModels().get(islandType)).bake(TRSRTransformation.identity(), DefaultVertexFormats.ITEM, ModelLoader.defaultTextureGetter()); + } catch (Exception e) { + islandModel = modelManager.getMissingModel(); + } + + IBakedModel flowerModel; + + if(identifier.startsWith(MUNDANE_PREFIX)) { + int meta = Integer.parseInt(identifier.substring(identifier.indexOf(MUNDANE_PREFIX) + MUNDANE_PREFIX.length())); + flowerModel = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getItemModel(new ItemStack(ModBlocks.shinyFlower, 1, meta)); + } else { + ItemStack stack = ItemBlockSpecialFlower.ofType(identifier); + IBakedModel specialFlowerModel = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getItemModel(stack); + flowerModel = specialFlowerModel.getOverrides().handleItemState(specialFlowerModel, stack, null, null); + } + + // Enhance! + CompositeBakedModel model = new CompositeBakedModel(flowerModel, islandModel); + Botania.LOGGER.debug("Cached floating flower model for islandtype %s and flowertype %s", islandType, identifier); + CACHE.put(islandType, identifier, model); + return model; + } + } + + @Nonnull + @Override + public ItemOverrideList getOverrides() { + return itemHandler; + } + + @Override public boolean isAmbientOcclusion() { return false; } + @Override public boolean isGui3d() { return true; } + @Override public boolean isBuiltInRenderer() { return false; } + @Nonnull @Override public TextureAtlasSprite getParticleTexture() { return Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite("minecraft:blocks/dirt"); } + @Nonnull @Override public ItemCameraTransforms getItemCameraTransforms() { return ItemCameraTransforms.DEFAULT; } + + private static class CompositeBakedModel implements IPerspectiveAwareModel { + + private final IBakedModel flower; + private final IBakedModel island; + private final List genQuads; + private final Map> faceQuads = new EnumMap<>(EnumFacing.class); + + public CompositeBakedModel(IBakedModel flower, IBakedModel island) { + this.flower = flower; + this.island = island; + + ImmutableList.Builder genBuilder = ImmutableList.builder(); + final TRSRTransformation transform = TRSRTransformation.blockCenterToCorner(new TRSRTransformation(new Vector3f(0F, 0.2F, 0F), null, new Vector3f(0.5F, 0.5F, 0.5F), null)); + + for(EnumFacing e : EnumFacing.VALUES) + faceQuads.put(e, new ArrayList<>()); + + // Add flower quads, scaled and translated + flower.getQuads(null, null, 0).stream().map(q -> transform(q, transform)).forEach(genBuilder::add); + for(EnumFacing e : EnumFacing.VALUES) { + List faceQ = faceQuads.get(e); + flower.getQuads(null, e, 0).stream().map(input -> transform(input, transform)).forEach(faceQ::add); + } + + // Add island quads + genBuilder.addAll(island.getQuads(null, null, 0)); + for(EnumFacing e : EnumFacing.VALUES) { + faceQuads.get(e).addAll(island.getQuads(null, e, 0)); + } + + genQuads = genBuilder.build(); + } + + // Forward all to flower model + @Nonnull @Override public List getQuads(IBlockState state, EnumFacing face, long rand) { + return face == null ? genQuads : faceQuads.get(face); + } + @Override public boolean isAmbientOcclusion() { + return flower.isAmbientOcclusion(); + } + @Override public boolean isGui3d() { + return flower.isGui3d(); + } + @Override public boolean isBuiltInRenderer() { + return flower.isBuiltInRenderer(); + } + @Nonnull @Override public TextureAtlasSprite getParticleTexture() { + return flower.getParticleTexture(); + } + @Nonnull @Override public ItemCameraTransforms getItemCameraTransforms() { + return flower.getItemCameraTransforms(); + } + @Nonnull @Override public ItemOverrideList getOverrides() { return ItemOverrideList.NONE; } + + @Override + public Pair handlePerspective(ItemCameraTransforms.TransformType cameraTransformType) { + if(island instanceof IPerspectiveAwareModel) { + Pair pair = ((IPerspectiveAwareModel) island).handlePerspective(cameraTransformType); + if(pair != null && pair.getRight() != null) + return Pair.of(this, pair.getRight()); + } + return Pair.of(this, TRSRTransformation.identity().getMatrix()); + } + } + + private final ItemOverrideList itemHandler = new ItemOverrideList(ImmutableList.of()) { + @Nonnull + @Override + public IBakedModel handleItemState(@Nonnull IBakedModel model, ItemStack stack, @Nonnull World world, @Nonnull EntityLivingBase entity) { + // Items always have GRASS island + IFloatingFlower.IslandType islandType = IFloatingFlower.IslandType.GRASS; + String identifier; + + if(Block.getBlockFromItem(stack.getItem()) == ModBlocks.floatingSpecialFlower) { + // Magic flower + identifier = ItemBlockFloatingSpecialFlower.getType(stack); + } else { + // Mundane flower + identifier = MUNDANE_PREFIX + stack.getItemDamage(); + } + + return FloatingFlowerModel.this.getModel(islandType, identifier); + } + }; +} diff --git a/src/main/java/vazkii/botania/client/model/GunModel.java b/src/main/java/vazkii/botania/client/model/GunModel.java new file mode 100644 index 000000000..0e0140c25 --- /dev/null +++ b/src/main/java/vazkii/botania/client/model/GunModel.java @@ -0,0 +1,171 @@ +package vazkii.botania.client.model; + +import com.google.common.base.Preconditions; +import com.google.common.cache.CacheBuilder; +import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; +import com.google.common.collect.ImmutableList; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.renderer.block.model.IBakedModel; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; +import net.minecraft.client.renderer.block.model.ItemOverrideList; +import net.minecraft.client.renderer.block.model.ModelManager; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.renderer.vertex.VertexFormatElement; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; +import net.minecraftforge.client.model.IPerspectiveAwareModel; +import net.minecraftforge.client.model.pipeline.IVertexConsumer; +import net.minecraftforge.client.model.pipeline.UnpackedBakedQuad; +import net.minecraftforge.client.model.pipeline.VertexTransformer; +import net.minecraftforge.common.model.TRSRTransformation; +import org.apache.commons.lang3.tuple.Pair; +import vazkii.botania.common.Botania; +import vazkii.botania.common.item.ItemManaGun; +import vazkii.botania.common.item.ModItems; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import javax.vecmath.Matrix4f; +import javax.vecmath.Vector3f; +import javax.vecmath.Vector4f; +import java.util.ArrayList; +import java.util.EnumMap; +import java.util.IdentityHashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public class GunModel implements IBakedModel { + + private final IBakedModel originalModel; + + public GunModel(IBakedModel originalModel) { + this.originalModel = Preconditions.checkNotNull(originalModel); + } + + private final ItemOverrideList itemHandler = new ItemOverrideList(ImmutableList.of()) { + @Nonnull + @Override + public IBakedModel handleItemState(@Nonnull IBakedModel model, ItemStack stack, @Nonnull World world, @Nonnull EntityLivingBase entity) { + ItemStack lens = ItemManaGun.getLens(stack); + if(lens != null) { + IBakedModel lensModel = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getItemModel(lens); + return GunModel.this.getModel(lensModel); + } + else return GunModel.this; + } + }; + + @Nonnull + @Override + public ItemOverrideList getOverrides() { + return itemHandler; + } + + @Nonnull @Override public List getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, long rand) { return originalModel.getQuads(state, side, rand); } + @Override public boolean isAmbientOcclusion() { return originalModel.isAmbientOcclusion(); } + @Override public boolean isGui3d() { return originalModel.isGui3d(); } + @Override public boolean isBuiltInRenderer() { return originalModel.isBuiltInRenderer(); } + @Nonnull @Override public TextureAtlasSprite getParticleTexture() { return originalModel.getParticleTexture(); } + @Nonnull @Override public ItemCameraTransforms getItemCameraTransforms() { return originalModel.getItemCameraTransforms(); } + + private final IdentityHashMap cache = new IdentityHashMap<>(); + + private CompositeBakedModel getModel(IBakedModel lens) { + CompositeBakedModel model = cache.get(lens); + if(model == null) { + model = new CompositeBakedModel(lens, originalModel); + cache.put(lens, model); + } + return model; + } + + protected static BakedQuad transform(BakedQuad quad, final TRSRTransformation transform) { + UnpackedBakedQuad.Builder builder = new UnpackedBakedQuad.Builder(DefaultVertexFormats.ITEM); + final IVertexConsumer consumer = new VertexTransformer(builder) { + @Override + public void put(int element, float... data) { + VertexFormatElement formatElement = DefaultVertexFormats.ITEM.getElement(element); + switch(formatElement.getUsage()) { + case POSITION: { + float[] newData = new float[4]; + Vector4f vec = new Vector4f(data); + transform.getMatrix().transform(vec); + vec.get(newData); + parent.put(element, newData); + break; + } + default: { + parent.put(element, data); + break; + } + } + } + }; + quad.pipe(consumer); + return builder.build(); + } + + private static class CompositeBakedModel implements IPerspectiveAwareModel { + + private final IBakedModel gun; + private final List genQuads; + private final Map> faceQuads = new EnumMap<>(EnumFacing.class); + + CompositeBakedModel(IBakedModel lens, IBakedModel gun) { + this.gun = gun; + + ImmutableList.Builder genBuilder = ImmutableList.builder(); + final TRSRTransformation transform = TRSRTransformation.blockCenterToCorner(new TRSRTransformation(new Vector3f(-0.4F, 0.25F, 0), null, new Vector3f(0.625F, 0.625F, 0.625F), TRSRTransformation.quatFromXYZ(0, (float) Math.PI / 2, 0))); + + for(EnumFacing e : EnumFacing.VALUES) + faceQuads.put(e, new ArrayList<>()); + + // Add lens quads, scaled and translated + for(BakedQuad quad : lens.getQuads(null, null, 0)) { + genBuilder.add(transform(quad, transform)); + } + + for(EnumFacing e : EnumFacing.VALUES) { + faceQuads.get(e).addAll(lens.getQuads(null, e, 0).stream().map(input -> transform(input, transform)).collect(Collectors.toList())); + } + + // Add gun quads + genBuilder.addAll(gun.getQuads(null, null, 0)); + for(EnumFacing e : EnumFacing.VALUES) { + faceQuads.get(e).addAll(gun.getQuads(null, e, 0)); + } + + genQuads = genBuilder.build(); + + } + + @Nonnull @Override public List getQuads(IBlockState state, EnumFacing face, long rand) { return face == null ? genQuads : faceQuads.get(face); } + + // Forward all to gun model + @Override public boolean isAmbientOcclusion() { return gun.isAmbientOcclusion(); } + @Override public boolean isGui3d() { return gun.isGui3d(); } + @Override public boolean isBuiltInRenderer() { return gun.isBuiltInRenderer(); } + @Nonnull @Override public TextureAtlasSprite getParticleTexture() { return gun.getParticleTexture();} + @Nonnull @Override public ItemCameraTransforms getItemCameraTransforms() { return gun.getItemCameraTransforms(); } + @Nonnull @Override public ItemOverrideList getOverrides() { return ItemOverrideList.NONE; } + + @Override + public Pair handlePerspective(ItemCameraTransforms.TransformType cameraTransformType) { + if(gun instanceof IPerspectiveAwareModel) { + Pair pair = ((IPerspectiveAwareModel) gun).handlePerspective(cameraTransformType); + if(pair != null && pair.getRight() != null) + return Pair.of(this, pair.getRight()); + } + return Pair.of(this, TRSRTransformation.identity().getMatrix()); + } + } + +} diff --git a/src/main/java/vazkii/botania/client/model/IPylonModel.java b/src/main/java/vazkii/botania/client/model/IPylonModel.java index c795092a5..1b0801004 100644 --- a/src/main/java/vazkii/botania/client/model/IPylonModel.java +++ b/src/main/java/vazkii/botania/client/model/IPylonModel.java @@ -10,10 +10,12 @@ */ package vazkii.botania.client.model; +import vazkii.botania.api.state.enums.PylonVariant; + public interface IPylonModel { - public void renderCrystal(); - public void renderRing(); - public void renderGems(); + public void renderCrystal(PylonVariant variant); + public void renderRing(PylonVariant variant); + public void renderGems(PylonVariant variant); } diff --git a/src/main/java/vazkii/botania/client/model/LexiconModel.java b/src/main/java/vazkii/botania/client/model/LexiconModel.java new file mode 100644 index 000000000..66489d7a3 --- /dev/null +++ b/src/main/java/vazkii/botania/client/model/LexiconModel.java @@ -0,0 +1,43 @@ +package vazkii.botania.client.model; + +import com.google.common.collect.ImmutableList; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.renderer.block.model.IBakedModel; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; +import net.minecraft.client.renderer.block.model.ItemOverrideList; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.util.EnumFacing; +import net.minecraftforge.client.model.IPerspectiveAwareModel; +import org.apache.commons.lang3.tuple.Pair; +import vazkii.botania.common.core.handler.ConfigHandler; + +import javax.annotation.Nonnull; +import javax.vecmath.Matrix4f; +import java.util.List; + +@SuppressWarnings("deprecation") +public class LexiconModel implements IPerspectiveAwareModel { + + private static final ModelResourceLocation path = new ModelResourceLocation("botania:lexicon_default", "inventory"); + + @Override + public Pair handlePerspective(ItemCameraTransforms.TransformType cameraTransformType) { + IBakedModel original = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getModel(path); + if((cameraTransformType == ItemCameraTransforms.TransformType.FIRST_PERSON_RIGHT_HAND + || cameraTransformType == ItemCameraTransforms.TransformType.FIRST_PERSON_LEFT_HAND) + && ConfigHandler.lexicon3dModel) + return Pair.of(this, null); + return ((IPerspectiveAwareModel) original).handlePerspective(cameraTransformType); + } + + @Nonnull @Override public List getQuads(IBlockState state, EnumFacing side, long rand) { return ImmutableList.of(); } + @Override public boolean isAmbientOcclusion() { return false; } + @Override public boolean isGui3d() { return false; } + @Override public boolean isBuiltInRenderer() { return false; } + @Nonnull @Override public TextureAtlasSprite getParticleTexture() { return Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite("botania:items/lexicon"); } + @Nonnull @Override public ItemCameraTransforms getItemCameraTransforms() { return ItemCameraTransforms.DEFAULT; } + @Nonnull @Override public ItemOverrideList getOverrides() { return ItemOverrideList.NONE; } +} diff --git a/src/main/java/vazkii/botania/client/model/ModelAltar.java b/src/main/java/vazkii/botania/client/model/ModelAltar.java deleted file mode 100644 index b8827a24d..000000000 --- a/src/main/java/vazkii/botania/client/model/ModelAltar.java +++ /dev/null @@ -1,88 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 21, 2014, 7:56:15 PM (GMT)] - */ -package vazkii.botania.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; - -public class ModelAltar extends ModelBase { - - ModelRenderer gobletBase; - ModelRenderer gobletBase2; - ModelRenderer gobletBase3; - ModelRenderer gobletStand; - ModelRenderer kelkBase; - ModelRenderer kelkBase2; - ModelRenderer kelkWall1; - ModelRenderer kelkWall2; - ModelRenderer kelkWall3; - ModelRenderer kelkWall4; - - public ModelAltar() { - textureWidth = 256; - textureHeight = 128; - - gobletBase = new ModelRenderer(this, 0, 0); - gobletBase.addBox(0F, 0F, 0F, 16, 2, 16); - gobletBase.setRotationPoint(-8F, 22F, -8F); - gobletBase.setTextureSize(256, 128); - gobletBase2 = new ModelRenderer(this, 0, 18); - gobletBase2.addBox(0F, 0F, 0F, 14, 1, 14); - gobletBase2.setRotationPoint(-7F, 21F, -7F); - gobletBase2.setTextureSize(256, 128); - gobletStand = new ModelRenderer(this, 68, 0); - gobletStand.addBox(0F, 0F, 0F, 6, 8, 6); - gobletStand.setRotationPoint(-3F, 12F, -3F); - gobletStand.setTextureSize(256, 128); - gobletBase3 = new ModelRenderer(this, 0, 33); - gobletBase3.addBox(0F, 0F, 0F, 12, 1, 12); - gobletBase3.setRotationPoint(-6F, 20F, -6F); - gobletBase3.setTextureSize(256, 128); - kelkBase = new ModelRenderer(this, 72, 45); - kelkBase.addBox(0F, 0F, 0F, 8, 1, 8); - kelkBase.setRotationPoint(-4F, 11F, -4F); - kelkBase.setTextureSize(256, 128); - kelkBase2 = new ModelRenderer(this, 72, 34); - kelkBase2.addBox(0F, 0F, 0F, 10, 1, 10); - kelkBase2.setRotationPoint(-5F, 10F, -5F); - kelkBase2.setTextureSize(256, 128); - kelkWall1 = new ModelRenderer(this, 72, 18); - kelkWall1.addBox(0F, 0F, 0F, 1, 6, 10); - kelkWall1.setRotationPoint(5F, 4F, -5F); - kelkWall1.setTextureSize(256, 128); - kelkWall2 = new ModelRenderer(this, 72, 18); - kelkWall2.addBox(0F, 0F, 0F, 1, 6, 10); - kelkWall2.setRotationPoint(-6F, 4F, -5F); - kelkWall2.setTextureSize(256, 128); - kelkWall3 = new ModelRenderer(this, 94, 18); - kelkWall3.addBox(0F, 0F, 0F, 10, 6, 1); - kelkWall3.setRotationPoint(-5F, 4F, 5F); - kelkWall3.setTextureSize(256, 128); - kelkWall4 = new ModelRenderer(this, 94, 18); - kelkWall4.addBox(0F, 0F, 0F, 10, 6, 1); - kelkWall4.setRotationPoint(-5F, 4F, -6F); - kelkWall4.setTextureSize(256, 128); - } - - public void render() { - float f = 1F / 16F; - gobletBase.render(f); - gobletBase2.render(f); - gobletBase3.render(f); - gobletStand.render(f); - kelkBase.render(f); - kelkBase2.render(f); - kelkWall1.render(f); - kelkWall2.render(f); - kelkWall3.render(f); - kelkWall4.render(f); - } -} diff --git a/src/main/java/vazkii/botania/client/model/ModelAvatar.java b/src/main/java/vazkii/botania/client/model/ModelAvatar.java index 934471b34..a3805d704 100644 --- a/src/main/java/vazkii/botania/client/model/ModelAvatar.java +++ b/src/main/java/vazkii/botania/client/model/ModelAvatar.java @@ -15,12 +15,12 @@ import net.minecraft.client.model.ModelRenderer; public class ModelAvatar extends ModelBase { - public ModelRenderer body; - public ModelRenderer rightarm; - public ModelRenderer leftarm; - public ModelRenderer rightleg; - public ModelRenderer leftleg; - public ModelRenderer head; + public final ModelRenderer body; + public final ModelRenderer rightarm; + public final ModelRenderer leftarm; + public final ModelRenderer rightleg; + public final ModelRenderer leftleg; + public final ModelRenderer head; public ModelAvatar() { textureWidth = 32; diff --git a/src/main/java/vazkii/botania/client/model/ModelBellows.java b/src/main/java/vazkii/botania/client/model/ModelBellows.java index f086f946e..528518b05 100644 --- a/src/main/java/vazkii/botania/client/model/ModelBellows.java +++ b/src/main/java/vazkii/botania/client/model/ModelBellows.java @@ -12,18 +12,17 @@ package vazkii.botania.client.model; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; - -import org.lwjgl.opengl.GL11; +import net.minecraft.client.renderer.GlStateManager; public class ModelBellows extends ModelBase { - ModelRenderer Base; - ModelRenderer Top; - ModelRenderer Funnel; - ModelRenderer Pipe; - ModelRenderer Handle1; - ModelRenderer Handle2; - ModelRenderer Handle3; + final ModelRenderer Base; + final ModelRenderer Top; + final ModelRenderer Funnel; + final ModelRenderer Pipe; + final ModelRenderer Handle1; + final ModelRenderer Handle2; + final ModelRenderer Handle3; public ModelBellows() { textureWidth = 64; @@ -74,18 +73,18 @@ public class ModelBellows extends ModelBase { //float fract = Math.max(0.1F, (float) (Math.sin(((double) ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks) * 0.2) + 1F) * 0.5F); float mov = (1F - fract) * 0.5F; - GL11.glTranslatef(0F, mov, 0F); + GlStateManager.translate(0F, mov, 0F); Top.render(f5); Handle1.render(f5); Handle2.render(f5); Handle3.render(f5); - GL11.glTranslatef(0F, -mov, 0F); + GlStateManager.translate(0F, -mov, 0F); - GL11.glRotatef(180F, 1F, 0F, 0F); - GL11.glTranslatef(-0.19F, -1.375F, -0.19F); - GL11.glScalef(1F, fract, 1F); + GlStateManager.rotate(180F, 1F, 0F, 0F); + GlStateManager.translate(-0.19F, -1.375F, -0.19F); + GlStateManager.scale(1F, fract, 1F); Funnel.render(f5); - GL11.glScalef(1F, 1F / fract, 1F); + GlStateManager.scale(1F, 1F / fract, 1F); } diff --git a/src/main/java/vazkii/botania/client/model/ModelBlackHoleCube.java b/src/main/java/vazkii/botania/client/model/ModelBlackHoleCube.java deleted file mode 100644 index 1c770b3b3..000000000 --- a/src/main/java/vazkii/botania/client/model/ModelBlackHoleCube.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [? (GMT)] - */ -package vazkii.botania.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelBlackHoleCube extends ModelBase { - public ModelRenderer shape1; - public ModelRenderer shape1_1; - public ModelRenderer shape1_2; - public ModelRenderer shape1_3; - public ModelRenderer shape1_4; - public ModelRenderer shape1_5; - public ModelRenderer shape1_6; - public ModelRenderer shape1_7; - public ModelRenderer shape1_8; - public ModelRenderer shape1_9; - public ModelRenderer shape1_10; - public ModelRenderer shape1_11; - - public ModelBlackHoleCube() { - textureWidth = 36; - textureHeight = 2; - shape1_3 = new ModelRenderer(this, 0, 0); - shape1_3.setRotationPoint(0.0F, 16.0F, 0.0F); - shape1_3.addBox(-7.0F, 7.0F, -8.0F, 14, 1, 1, 0.0F); - setRotateAngle(shape1_3, 0.0F, 1.5707963267948966F, 0.0F); - shape1_7 = new ModelRenderer(this, 0, 0); - shape1_7.setRotationPoint(0.0F, 16.0F, 0.0F); - shape1_7.addBox(-7.0F, -8.0F, -8.0F, 14, 1, 1, 0.0F); - setRotateAngle(shape1_7, 0.0F, 1.5707963267948966F, 0.0F); - shape1_9 = new ModelRenderer(this, 0, 0); - shape1_9.setRotationPoint(0.0F, 16.0F, 0.0F); - shape1_9.addBox(-7.0F, 7.0F, 7.0F, 14, 1, 1, 0.0F); - setRotateAngle(shape1_9, 0.0F, 3.141592653589793F, 1.5707963267948966F); - shape1_11 = new ModelRenderer(this, 0, 0); - shape1_11.setRotationPoint(0.0F, 16.0F, 0.0F); - shape1_11.addBox(-7.0F, 7.0F, -8.0F, 14, 1, 1, 0.0F); - setRotateAngle(shape1_11, 0.0F, 3.141592653589793F, 1.5707963267948966F); - shape1 = new ModelRenderer(this, 0, 0); - shape1.setRotationPoint(0.0F, 16.0F, 0.0F); - shape1.addBox(-8.0F, 7.0F, 7.0F, 16, 1, 1, 0.0F); - shape1_4 = new ModelRenderer(this, 0, 0); - shape1_4.setRotationPoint(0.0F, 16.0F, 0.0F); - shape1_4.addBox(-8.0F, 7.0F, -8.0F, 16, 1, 1, 0.0F); - shape1_8 = new ModelRenderer(this, 0, 0); - shape1_8.setRotationPoint(0.0F, 16.0F, 0.0F); - shape1_8.addBox(-7.0F, -8.0F, -8.0F, 14, 1, 1, 0.0F); - setRotateAngle(shape1_8, 0.0F, 3.141592653589793F, 1.5707963267948966F); - shape1_2 = new ModelRenderer(this, 0, 0); - shape1_2.setRotationPoint(0.0F, 16.0F, 0.0F); - shape1_2.addBox(-8.0F, -8.0F, -8.0F, 16, 1, 1, 0.0F); - shape1_1 = new ModelRenderer(this, 0, 0); - shape1_1.setRotationPoint(0.0F, 16.0F, 0.0F); - shape1_1.addBox(-8.0F, -8.0F, 7.0F, 16, 1, 1, 0.0F); - shape1_6 = new ModelRenderer(this, 0, 0); - shape1_6.setRotationPoint(0.0F, 16.0F, 0.0F); - shape1_6.addBox(-7.0F, -8.0F, -8.0F, 14, 1, 1, 0.0F); - setRotateAngle(shape1_6, 0.0F, -1.5707963267948966F, 0.0F); - shape1_10 = new ModelRenderer(this, 0, 0); - shape1_10.setRotationPoint(0.0F, 16.0F, 0.0F); - shape1_10.addBox(-7.0F, -8.0F, 7.0F, 14, 1, 1, 0.0F); - setRotateAngle(shape1_10, 0.0F, 3.141592653589793F, 1.5707963267948966F); - shape1_5 = new ModelRenderer(this, 0, 0); - shape1_5.setRotationPoint(0.0F, 16.0F, 0.0F); - shape1_5.addBox(-7.0F, 7.0F, -8.0F, 14, 1, 1, 0.0F); - setRotateAngle(shape1_5, 0.0F, -1.5707963267948966F, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - shape1_3.render(f5); - shape1_7.render(f5); - shape1_9.render(f5); - shape1_11.render(f5); - shape1.render(f5); - shape1_4.render(f5); - shape1_8.render(f5); - shape1_2.render(f5); - shape1_1.render(f5); - shape1_6.render(f5); - shape1_10.render(f5); - shape1_5.render(f5); - } - - - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/src/main/java/vazkii/botania/client/model/ModelBrewery.java b/src/main/java/vazkii/botania/client/model/ModelBrewery.java index aa24757c4..5dfd81659 100644 --- a/src/main/java/vazkii/botania/client/model/ModelBrewery.java +++ b/src/main/java/vazkii/botania/client/model/ModelBrewery.java @@ -12,17 +12,15 @@ package vazkii.botania.client.model; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; - -import org.lwjgl.opengl.GL11; - +import net.minecraft.client.renderer.GlStateManager; import vazkii.botania.client.render.tile.RenderTileBrewery; public class ModelBrewery extends ModelBase { - ModelRenderer Pole; - ModelRenderer Top; - ModelRenderer Bottom; - ModelRenderer Plate; + final ModelRenderer Pole; + final ModelRenderer Top; + final ModelRenderer Bottom; + final ModelRenderer Plate; public ModelBrewery() { textureWidth = 64; @@ -50,24 +48,27 @@ public class ModelBrewery extends ModelBase { float f = 1F / 16F; float offset = (float) Math.sin(time / 40) * 0.1F + 0.05F; - int plates = render.brewery.getSizeInventory() - 1; + boolean hasTile = render.brewery != null; + int plates = hasTile ? render.brewery.getSizeInventory() - 1 : 7; float deg = (float) time / 16F; float polerot = -deg * 25F; - GL11.glTranslatef(0F, offset, 0F); - GL11.glRotatef(polerot, 0F, 1F, 0F); - if(render.brewery.getStackInSlot(0) != null) { - GL11.glRotatef(180F, 1F, 0F, 0F); - GL11.glTranslatef(-1F / 8F, -0.5F, 1F / 128F); - render.renderItemStack(render.brewery.getStackInSlot(0)); - GL11.glTranslatef(1F / 8F, 0.5F, -1F / 128F); - GL11.glRotatef(-180F, 1F, 0F, 0F); + GlStateManager.translate(0F, offset, 0F); + GlStateManager.rotate(polerot, 0F, 1F, 0F); + if(hasTile && render.brewery.getItemHandler().getStackInSlot(0) != null) { + GlStateManager.rotate(180F, 1F, 0F, 0F); + GlStateManager.translate(0, -0.45, 0); + //GlStateManager.translate(-1F / 8F, -0.5F, 1F / 128F); + render.renderItemStack(render.brewery.getItemHandler().getStackInSlot(0)); + //GlStateManager.translate(1F / 8F, 0.5F, -1F / 128F); + GlStateManager.translate(0, 0.45, 0); + GlStateManager.rotate(-180F, 1F, 0F, 0F); } Pole.render(f); Top.render(f); Bottom.render(f); - GL11.glRotatef(-polerot, 0F, 1F, 0F); + GlStateManager.rotate(-polerot, 0F, 1F, 0F); float degper = (float) (2F * Math.PI) / plates; for(int i = 0; i < plates; i++) { @@ -76,27 +77,29 @@ public class ModelBrewery extends ModelBase { if(time == -1) offset1 = 0F; - GL11.glTranslatef(0F, offset1, 0F); - if(render.brewery.getStackInSlot(i + 1) != null) { + GlStateManager.translate(0F, offset1, 0F); + if(hasTile && render.brewery.getItemHandler().getStackInSlot(i + 1) != null) { float rot = Plate.rotateAngleY * 180F / (float) Math.PI; float transX = 0.3125F; float transY = 1.06F; float transZ = 0.1245F; - GL11.glRotatef(rot, 0F, 1F, 0F); - GL11.glTranslatef(transX, transY, transZ); - GL11.glRotatef(-90F, 1F, 0F, 0F); - render.renderItemStack(render.brewery.getStackInSlot(i + 1)); - GL11.glRotatef(90F, 1F, 0F, 0F); - GL11.glTranslatef(-transX, -transY, -transZ); - GL11.glRotatef(-rot, 0F, 1F, 0F); + GlStateManager.rotate(rot, 0F, 1F, 0F); + GlStateManager.translate(transX, transY, transZ); + GlStateManager.rotate(-90F, 1F, 0F, 0F); + GlStateManager.translate(0.125, 0.125, 0); + render.renderItemStack(render.brewery.getItemHandler().getStackInSlot(i + 1)); + GlStateManager.translate(-0.125, -0.125, 0); + GlStateManager.rotate(90F, 1F, 0F, 0F); + GlStateManager.translate(-transX, -transY, -transZ); + GlStateManager.rotate(-rot, 0F, 1F, 0F); } Plate.render(f); - GL11.glTranslatef(0F, -offset1, 0F); + GlStateManager.translate(0F, -offset1, 0F); deg += degper; } - GL11.glTranslatef(0F, -offset, 0F); + GlStateManager.translate(0F, -offset, 0F); } } diff --git a/src/main/java/vazkii/botania/client/model/ModelCocoon.java b/src/main/java/vazkii/botania/client/model/ModelCocoon.java deleted file mode 100644 index 2fbc79c1b..000000000 --- a/src/main/java/vazkii/botania/client/model/ModelCocoon.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [? (GMT)] - */ -package vazkii.botania.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; - -public class ModelCocoon extends ModelBase { - - public ModelRenderer shape; - - public ModelCocoon() { - textureWidth = 64; - textureHeight = 32; - shape = new ModelRenderer(this, 0, 0); - shape.setRotationPoint(0.0F, 22.0F, 0.0F); - shape.addBox(-5.0F, -8.0F, -7.0F, 10, 10, 14, 0.0F); - } - - public void render() { - shape.render(1F / 16F); - } - -} diff --git a/src/main/java/vazkii/botania/client/model/ModelCrystalCube.java b/src/main/java/vazkii/botania/client/model/ModelCrystalCube.java index 80addf965..d2d1c582e 100644 --- a/src/main/java/vazkii/botania/client/model/ModelCrystalCube.java +++ b/src/main/java/vazkii/botania/client/model/ModelCrystalCube.java @@ -14,9 +14,9 @@ import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; public class ModelCrystalCube extends ModelBase { - public ModelRenderer cube; - public ModelRenderer base1; - public ModelRenderer base2; + public final ModelRenderer cube; + public final ModelRenderer base1; + public final ModelRenderer base2; public ModelCrystalCube() { textureWidth = 48; diff --git a/src/main/java/vazkii/botania/client/model/ModelHourglass.java b/src/main/java/vazkii/botania/client/model/ModelHourglass.java index a1ca14ddc..fd71cce21 100644 --- a/src/main/java/vazkii/botania/client/model/ModelHourglass.java +++ b/src/main/java/vazkii/botania/client/model/ModelHourglass.java @@ -10,22 +10,22 @@ */ package vazkii.botania.client.model; -import java.awt.Color; - import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; - +import net.minecraft.client.renderer.GlStateManager; import org.lwjgl.opengl.GL11; +import java.awt.*; + public class ModelHourglass extends ModelBase { - public ModelRenderer ring; - public ModelRenderer base1; - public ModelRenderer base2; - public ModelRenderer glass1; - public ModelRenderer sand1; - public ModelRenderer glass2; - public ModelRenderer sand2; + public final ModelRenderer ring; + public final ModelRenderer base1; + public final ModelRenderer base2; + public final ModelRenderer glass1; + public final ModelRenderer sand1; + public final ModelRenderer glass2; + public final ModelRenderer sand2; public ModelHourglass() { textureWidth = 48; @@ -66,39 +66,39 @@ public class ModelHourglass extends ModelBase { base2.render(f); Color c = new Color(color); GL11.glColor3ub((byte) c.getRed(), (byte) c.getGreen(), (byte) c.getBlue()); - GL11.glPushAttrib(GL11.GL_NORMALIZE); - GL11.glEnable(GL11.GL_NORMALIZE); + GL11.glPushAttrib(GL11.GL_TRANSFORM_BIT); + GlStateManager.enableNormalize(); if(fract1 > 0) { - GL11.glPushMatrix(); + GlStateManager.pushMatrix(); if(flip) - GL11.glTranslatef(-2.5F * f, 1.0F * f, -2.5F * f); + GlStateManager.translate(-2.5F * f, 1.0F * f, -2.5F * f); else { - GL11.glRotatef(180F, 0F, 0F, 1F); - GL11.glTranslatef(-2.5F * f, -6.0F * f, -2.5F * f); + GlStateManager.rotate(180F, 0F, 0F, 1F); + GlStateManager.translate(-2.5F * f, -6.0F * f, -2.5F * f); } - GL11.glScalef(1F, fract1, 1F); + GlStateManager.scale(1F, fract1, 1F); sand1.render(f); - GL11.glPopMatrix(); + GlStateManager.popMatrix(); } if(fract2 > 0) { - GL11.glPushMatrix(); + GlStateManager.pushMatrix(); if(flip) - GL11.glTranslatef(-2.5F * f, -6.0F * f, -2.5F * f); + GlStateManager.translate(-2.5F * f, -6.0F * f, -2.5F * f); else { - GL11.glRotatef(180F, 0F, 0F, 1F); - GL11.glTranslatef(-2.5F * f, 1.0F * f, -2.5F * f); + GlStateManager.rotate(180F, 0F, 0F, 1F); + GlStateManager.translate(-2.5F * f, 1.0F * f, -2.5F * f); } - GL11.glScalef(1F, fract2, 1F); + GlStateManager.scale(1F, fract2, 1F); sand2.render(f); - GL11.glPopMatrix(); + GlStateManager.popMatrix(); } GL11.glPopAttrib(); - GL11.glColor3f(1F, 1F, 1F); + GL11.glColor3ub(((byte) 255), ((byte) 255), ((byte) 255)); glass1.render(f); glass2.render(f); } diff --git a/src/main/java/vazkii/botania/client/model/ModelIncensePlate.java b/src/main/java/vazkii/botania/client/model/ModelIncensePlate.java deleted file mode 100644 index d7fa2eadb..000000000 --- a/src/main/java/vazkii/botania/client/model/ModelIncensePlate.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [May 15, 2015, 4:17:37 PM (GMT)] - */ -package vazkii.botania.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; - -public class ModelIncensePlate extends ModelBase { - - ModelRenderer Plate; - ModelRenderer High; - - public ModelIncensePlate() { - textureWidth = 64; - textureHeight = 32; - - Plate = new ModelRenderer(this, 0, 0); - Plate.addBox(0F, 0F, 0F, 12, 1, 4); - Plate.setRotationPoint(-6F, 23F, -2F); - Plate.setTextureSize(64, 32); - Plate.mirror = true; - High = new ModelRenderer(this, 0, 6); - High.addBox(0F, 0F, 0F, 3, 1, 4); - High.setRotationPoint(-6F, 22F, -2F); - High.setTextureSize(64, 32); - High.mirror = true; - } - - public void render() { - float f5 = 1F / 16F; - Plate.render(f5); - High.render(f5); - } - -} diff --git a/src/main/java/vazkii/botania/client/model/ModelMiniIsland.java b/src/main/java/vazkii/botania/client/model/ModelMiniIsland.java deleted file mode 100644 index 4b9f2c19c..000000000 --- a/src/main/java/vazkii/botania/client/model/ModelMiniIsland.java +++ /dev/null @@ -1,84 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jul 8, 2014, 10:07:54 PM (GMT)] - */ -package vazkii.botania.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; - -public class ModelMiniIsland extends ModelBase { - - ModelRenderer island; - - public ModelMiniIsland() { - textureWidth = 64; - textureHeight = 32; - - setTextureOffset("island.Shape0", 0, 0); - setTextureOffset("island.Shape1-1", 8, 0); - setTextureOffset("island.Shape1-2", 16, 0); - setTextureOffset("island.Shape1-3", 24, 0); - setTextureOffset("island.Shape1-4", 32, 0); - setTextureOffset("island.Shape2-1", 8, 6); - setTextureOffset("island.Shape2-2", 16, 6); - setTextureOffset("island.Shape2-3", 24, 6); - setTextureOffset("island.Shape2-4", 32, 6); - setTextureOffset("island.Shape2-5", 8, 11); - setTextureOffset("island.Shape2-6", 16, 11); - setTextureOffset("island.Shape2-7", 24, 11); - setTextureOffset("island.Shape2-8", 32, 11); - setTextureOffset("island.Shape3-1", 8, 16); - setTextureOffset("island.Shape3-2", 16, 16); - setTextureOffset("island.Shape3-3", 24, 16); - setTextureOffset("island.Shape3-4", 32, 16); - setTextureOffset("island.Shape3-5", 8, 20); - setTextureOffset("island.Shape3-6", 16, 20); - setTextureOffset("island.Shape3-7", 24, 20); - setTextureOffset("island.Shape3-8", 32, 20); - setTextureOffset("island.Shape4-1", 8, 24); - setTextureOffset("island.Shape4-2", 16, 24); - setTextureOffset("island.Shape4-3", 24, 24); - setTextureOffset("island.Shape4-4", 32, 24); - - island = new ModelRenderer(this, "island"); - island.setRotationPoint(0F, 16F, 0F); - // island.mirror = true; - island.addBox("Shape0", -1F, 0F, -1F, 2, 5, 2); - island.addBox("Shape1-1", -1F, 0F, -3F, 2, 4, 2); - island.addBox("Shape1-2", 1F, 0F, -1F, 2, 4, 2); - island.addBox("Shape1-3", -1F, 0F, 1F, 2, 4, 2); - island.addBox("Shape1-4", -3F, 0F, -1F, 2, 4, 2); - island.addBox("Shape2-1", -1F, 0F, -5F, 2, 3, 2); - island.addBox("Shape2-2", 3F, 0F, -1F, 2, 3, 2); - island.addBox("Shape2-3", -1F, 0F, 3F, 2, 3, 2); - island.addBox("Shape2-4", -5F, 0F, -1F, 2, 3, 2); - island.addBox("Shape2-5", 1F, 0F, -3F, 2, 3, 2); - island.addBox("Shape2-6", 1F, 0F, 1F, 2, 3, 2); - island.addBox("Shape2-7", -3F, 0F, 1F, 2, 3, 2); - island.addBox("Shape2-8", -3F, 0F, -3F, 2, 3, 2); - island.addBox("Shape3-1", 1F, 0F, -5F, 2, 2, 2); - island.addBox("Shape3-2", 3F, 0F, 1F, 2, 2, 2); - island.addBox("Shape3-3", -3F, 0F, 3F, 2, 2, 2); - island.addBox("Shape3-4", -5F, 0F, -3F, 2, 2, 2); - island.addBox("Shape3-5", 3F, 0F, -3F, 2, 2, 2); - island.addBox("Shape3-6", 1F, 0F, 3F, 2, 2, 2); - island.addBox("Shape3-7", -5F, 0F, 1F, 2, 2, 2); - island.addBox("Shape3-8", -3F, 0F, -5F, 2, 2, 2); - island.addBox("Shape4-1", 3F, 0F, -5F, 2, 1, 2); - island.addBox("Shape4-2", 3F, 0F, 3F, 2, 1, 2); - island.addBox("Shape4-3", -5F, 0F, 3F, 2, 1, 2); - island.addBox("Shape4-4", -5F, 0F, -5F, 2, 1, 2); - } - - public void render() { - island.render(1F / 16F); - } - -} diff --git a/src/main/java/vazkii/botania/client/model/ModelPixie.java b/src/main/java/vazkii/botania/client/model/ModelPixie.java index 902ab687e..a4d2ddde4 100644 --- a/src/main/java/vazkii/botania/client/model/ModelPixie.java +++ b/src/main/java/vazkii/botania/client/model/ModelPixie.java @@ -13,13 +13,13 @@ package vazkii.botania.client.model; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; -import net.minecraft.util.MathHelper; +import net.minecraft.util.math.MathHelper; public class ModelPixie extends ModelBase { - ModelRenderer Body; - ModelRenderer LeftWing; - ModelRenderer RightWing; + final ModelRenderer Body; + final ModelRenderer LeftWing; + final ModelRenderer RightWing; public ModelPixie() { textureWidth = 64; diff --git a/src/main/java/vazkii/botania/client/model/ModelPool.java b/src/main/java/vazkii/botania/client/model/ModelPool.java deleted file mode 100644 index 1cc52537a..000000000 --- a/src/main/java/vazkii/botania/client/model/ModelPool.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 25, 2014, 1:53:32 PM (GMT)] - */ -package vazkii.botania.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; - -public class ModelPool extends ModelBase { - - ModelRenderer base; - ModelRenderer side1; - ModelRenderer side2; - ModelRenderer side3; - ModelRenderer side4; - - public ModelPool() { - textureWidth = 64; - textureHeight = 32; - - base = new ModelRenderer(this, 0, 0); - base.addBox(0F, 0F, 0F, 16, 1, 16); - base.setRotationPoint(-8F, 23F, -8F); - base.setTextureSize(64, 32); - side1 = new ModelRenderer(this, 0, 0); - side1.addBox(0F, 0F, 0F, 16, 7, 1); - side1.setRotationPoint(-8F, 16F, 7F); - side1.setTextureSize(64, 32); - side2 = new ModelRenderer(this, 0, 0); - side2.addBox(0F, 0F, 0F, 16, 7, 1); - side2.setRotationPoint(-8F, 16F, -8F); - side2.setTextureSize(64, 32); - side3 = new ModelRenderer(this, 0, 0); - side3.addBox(0F, 0F, 0F, 1, 7, 14); - side3.setRotationPoint(-8F, 16F, -7F); - side3.setTextureSize(64, 32); - side4 = new ModelRenderer(this, 0, 0); - side4.addBox(0F, 0F, 0F, 1, 7, 14); - side4.setRotationPoint(7F, 16F, -7F); - side4.setTextureSize(64, 32); - } - - public void render() { - float f = 1F / 16F; - base.render(f); - side1.render(f); - side2.render(f); - side3.render(f); - side4.render(f); - } -} \ No newline at end of file diff --git a/src/main/java/vazkii/botania/client/model/ModelPump.java b/src/main/java/vazkii/botania/client/model/ModelPump.java deleted file mode 100644 index e869a3d5e..000000000 --- a/src/main/java/vazkii/botania/client/model/ModelPump.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [? (GMT)] - */ -package vazkii.botania.client.model; - -import java.util.ArrayList; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; - -public class ModelPump extends ModelBase{ - - private ArrayList parts = new ArrayList(); - - private ArrayList innerRing = new ArrayList(); - private ArrayList outerRing = new ArrayList(); - - public ModelPump() { - textureWidth = 64; - textureHeight = 32; - - ModelRenderer main = new ModelRenderer(this, 0, 0); - main.addBox(-2.0F, -2.0F, -7.0F, 4, 4, 14); - main.setRotationPoint(0.0F, 4.0F, 0.0F); - - for(float r = 0; r <= Math.PI * 2; r += Math.PI) { - ModelRenderer side = new ModelRenderer(this, 22, 0); - - side.addBox(-4.0F, -4.0F, 7.0F, 8, 8, 1); - side.setRotationPoint(0.0F, 0.0F, 0.0F); - side.rotateAngleY = r; - main.addChild(side); - } - - for(float r = 0; r <= Math.PI * 2; r += Math.PI / 2) { - ModelRenderer innerPlate = new ModelRenderer(this, 0, 18); - ModelRenderer outerPlate = new ModelRenderer(this, 22, 18); - - innerPlate.addBox(-3.0F, -3.0F, -7.0F, 5, 1, 6); - innerPlate.setRotationPoint(0.0F, 4.0F, 0.0F); - innerPlate.rotateAngleZ = r; - innerRing.add(innerPlate); - parts.add(innerPlate); - - - outerPlate.addBox(-4.0F, -4.0F, 3.0F, 7, 1, 4); - outerPlate.setRotationPoint(0.0F, 4.0F, 0.0F); - outerPlate.rotateAngleZ = r; - outerRing.add(outerPlate); - parts.add(outerPlate); - } - - parts.add(main); - - } - - public void render(float ringPos) { - for(ModelRenderer iRing : innerRing) - iRing.rotationPointZ = ringPos; - - for(ModelRenderer part : parts) - part.render(1F / 16F); - } -} \ No newline at end of file diff --git a/src/main/java/vazkii/botania/client/model/ModelPylon.java b/src/main/java/vazkii/botania/client/model/ModelPylon.java index 3b90bf371..4b788d586 100644 --- a/src/main/java/vazkii/botania/client/model/ModelPylon.java +++ b/src/main/java/vazkii/botania/client/model/ModelPylon.java @@ -2,40 +2,164 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + *

    * Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php - * + *

    * File Created @ [Apr 1, 2014, 6:21:48 PM (GMT)] */ package vazkii.botania.client.model; +import com.google.common.base.Optional; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.VertexBuffer; +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.renderer.block.model.IBakedModel; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.renderer.vertex.VertexFormat; +import net.minecraft.crash.CrashReport; +import net.minecraft.util.ReportedException; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.model.AdvancedModelLoader; -import net.minecraftforge.client.model.IModelCustom; -import vazkii.botania.client.lib.LibResources; +import net.minecraftforge.client.model.Attributes; +import net.minecraftforge.client.model.IModel; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.client.model.obj.OBJLoader; +import net.minecraftforge.client.model.obj.OBJModel; +import net.minecraftforge.client.model.pipeline.LightUtil; +import net.minecraftforge.common.model.IModelPart; +import net.minecraftforge.common.model.IModelState; +import net.minecraftforge.common.model.Models; +import net.minecraftforge.common.model.TRSRTransformation; +import org.lwjgl.opengl.GL11; +import vazkii.botania.api.state.enums.PylonVariant; + +import java.util.ArrayList; +import java.util.List; +import java.util.function.Function; public class ModelPylon implements IPylonModel { - private IModelCustom model; + private IBakedModel manaCrystal; + private IBakedModel manaRingsAndPanes; + private IBakedModel manaGems; + private IBakedModel naturaCrystal; + private IBakedModel naturaRingsAndPanes; + private IBakedModel naturaGems; + private IBakedModel gaiaCrystal; + private IBakedModel gaiaRingsAndPanes; + private IBakedModel gaiaGems; public ModelPylon() { - model = AdvancedModelLoader.loadModel(new ResourceLocation(LibResources.OBJ_MODEL_PYLON)); + try { + // Load the OBJ + OBJModel model = ((OBJModel) OBJLoader.INSTANCE.loadModel(new ResourceLocation("botania:models/block/pylon.obj"))); + + // Apply the texture and flip the v's of the model + IModel manaModel = ((OBJModel) model.retexture(ImmutableMap.of("#pylon", "botania:model/pylon"))).process(ImmutableMap.of("flip-v", "true")); + IModel naturaModel = ((OBJModel) model.retexture(ImmutableMap.of("#pylon", "botania:model/pylon1"))).process(ImmutableMap.of("flip-v", "true")); + IModel gaiaModel = ((OBJModel) model.retexture(ImmutableMap.of("#pylon", "botania:model/pylon2"))).process(ImmutableMap.of("flip-v", "true")); + + // Hide necessary groups and bake + VertexFormat format = Attributes.DEFAULT_BAKED_FORMAT; + IModelState hideGroups = hideGroups(ImmutableList.of("Crystal_Ring", "Ring_Panel01", "Ring_Panel02", "Ring_Panel03", "Ring_Panel04", + "Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04")); + manaCrystal = manaModel.bake(hideGroups, format, ModelLoader.defaultTextureGetter()); + naturaCrystal = naturaModel.bake(hideGroups, format, ModelLoader.defaultTextureGetter()); + gaiaCrystal = gaiaModel.bake(hideGroups, format, ModelLoader.defaultTextureGetter()); + + hideGroups = hideGroups(ImmutableList.of("Crystal", "Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04")); + manaRingsAndPanes = manaModel.bake(hideGroups, format, ModelLoader.defaultTextureGetter()); + naturaRingsAndPanes = naturaModel.bake(hideGroups, format, ModelLoader.defaultTextureGetter()); + gaiaRingsAndPanes = gaiaModel.bake(hideGroups, format, ModelLoader.defaultTextureGetter()); + + hideGroups = hideGroups(ImmutableList.of("Crystal", "Crystal_Ring", "Ring_Panel01", "Ring_Panel02", "Ring_Panel03", "Ring_Panel04")); + manaGems = manaModel.bake(hideGroups, format, ModelLoader.defaultTextureGetter()); + naturaGems = naturaModel.bake(hideGroups, format, ModelLoader.defaultTextureGetter()); + gaiaGems = gaiaModel.bake(hideGroups, format, ModelLoader.defaultTextureGetter()); + } catch(Exception e) { + throw new ReportedException(new CrashReport("Error making pylon submodels for TESR!", e)); + } } @Override - public void renderCrystal() { - model.renderPart("Crystal"); + public void renderCrystal(PylonVariant variant) { + switch(variant) { + case MANA: + renderModel(manaCrystal); + break; + case NATURA: + renderModel(naturaCrystal); + break; + case GAIA: + renderModel(gaiaCrystal); + break; + } } @Override - public void renderRing() { - model.renderAllExcept("Crystal", "Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04"); + public void renderRing(PylonVariant variant) { + GlStateManager.disableLighting(); + switch(variant) { + case MANA: + renderModel(manaRingsAndPanes); + break; + case NATURA: + renderModel(naturaRingsAndPanes); + break; + case GAIA: + renderModel(gaiaRingsAndPanes); + break; + } + GlStateManager.enableLighting(); } @Override - public void renderGems() { - for(int i = 1; i < 5; i++) - model.renderPart("Ring_Gem0" + i); + public void renderGems(PylonVariant variant) { + GlStateManager.disableLighting(); + switch(variant) { + case MANA: + renderModel(manaGems); + break; + case NATURA: + renderModel(naturaGems); + break; + case GAIA: + renderModel(gaiaGems); + break; + } + GlStateManager.enableLighting(); } + + private void renderModel(IBakedModel model) { + Tessellator tessellator = Tessellator.getInstance(); + VertexBuffer worldrenderer = tessellator.getBuffer(); + worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.ITEM); + + for(BakedQuad bakedquad : model.getQuads(null, null, 0)) + LightUtil.renderQuadColor(worldrenderer, bakedquad, -1); + tessellator.draw(); + } + + private IModelState hideGroups(List groups) { + return part -> { + if (part.isPresent()) { + List parts = new ArrayList<>(); + Models.getParts(part.get()).forEachRemaining(parts::add); + for (String s : parts) { + if (groups.contains(s)) { + // Hide it + return Optional.of(TRSRTransformation.identity()); + } + } + } + + return Optional.absent(); + }; + } + } diff --git a/src/main/java/vazkii/botania/client/model/ModelPylonOld.java b/src/main/java/vazkii/botania/client/model/ModelPylonOld.java index c600dd261..ad615f98d 100644 --- a/src/main/java/vazkii/botania/client/model/ModelPylonOld.java +++ b/src/main/java/vazkii/botania/client/model/ModelPylonOld.java @@ -12,25 +12,26 @@ package vazkii.botania.client.model; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; +import vazkii.botania.api.state.enums.PylonVariant; public class ModelPylonOld extends ModelBase implements IPylonModel { - ModelRenderer crystal1; - ModelRenderer crystal2; - ModelRenderer crystal3; - ModelRenderer crystal4; - ModelRenderer crystal5; - ModelRenderer crystal6; - ModelRenderer crystal7; - ModelRenderer crystal8; - ModelRenderer outside1; - ModelRenderer outside2; - ModelRenderer outside3; - ModelRenderer outside4; - ModelRenderer outside5; - ModelRenderer outside6; - ModelRenderer outside7; - ModelRenderer outside8; + final ModelRenderer crystal1; + final ModelRenderer crystal2; + final ModelRenderer crystal3; + final ModelRenderer crystal4; + final ModelRenderer crystal5; + final ModelRenderer crystal6; + final ModelRenderer crystal7; + final ModelRenderer crystal8; + final ModelRenderer outside1; + final ModelRenderer outside2; + final ModelRenderer outside3; + final ModelRenderer outside4; + final ModelRenderer outside5; + final ModelRenderer outside6; + final ModelRenderer outside7; + final ModelRenderer outside8; public ModelPylonOld() { textureWidth = 64; @@ -119,7 +120,7 @@ public class ModelPylonOld extends ModelBase implements IPylonModel { } @Override - public void renderCrystal() { + public void renderCrystal(PylonVariant variant) { float f = 1F / 16F; crystal1.render(f); crystal2.render(f); @@ -132,7 +133,7 @@ public class ModelPylonOld extends ModelBase implements IPylonModel { } @Override - public void renderRing() { + public void renderRing(PylonVariant variant) { float f = 1F / 16F; outside1.render(f); outside2.render(f); @@ -151,8 +152,6 @@ public class ModelPylonOld extends ModelBase implements IPylonModel { } @Override - public void renderGems() { - // NO-OP - } + public void renderGems(PylonVariant variant) {} } \ No newline at end of file diff --git a/src/main/java/vazkii/botania/client/model/ModelSkullOverride.java b/src/main/java/vazkii/botania/client/model/ModelSkullOverride.java deleted file mode 100644 index 1ad6c4258..000000000 --- a/src/main/java/vazkii/botania/client/model/ModelSkullOverride.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [? (GMT)] - */ -package vazkii.botania.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelSkullOverride extends ModelBase { - - private final ModelRenderer bipedHead; - private final ModelRenderer bipedHeadwear; - - public ModelSkullOverride() { - textureWidth = 64; - textureHeight = 32; - bipedHead = new ModelRenderer(this, 0, 0); - bipedHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 0F); - bipedHead.setRotationPoint(0.0F, 0.0F, 0.0F); - bipedHeadwear = new ModelRenderer(this, 32, 0); - bipedHeadwear.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 0.5F); - bipedHeadwear.setRotationPoint(0.0F, 0.0F, 0.0F); - } - - public void renderWithoutRotation(float par1) { - bipedHead.render(par1); - bipedHeadwear.render(par1); - } - - @Override - public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { - setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); - bipedHead.render(par7); - bipedHeadwear.render(par7); - } - - @Override - public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { - bipedHead.rotateAngleY = bipedHeadwear.rotateAngleY = par4 / (180F / (float)Math.PI); - bipedHead.rotateAngleX = bipedHeadwear.rotateAngleX = par5 / (180F / (float)Math.PI); - } -} \ No newline at end of file diff --git a/src/main/java/vazkii/botania/client/model/ModelSpawnerClaw.java b/src/main/java/vazkii/botania/client/model/ModelSpawnerClaw.java deleted file mode 100644 index 4504ef8c6..000000000 --- a/src/main/java/vazkii/botania/client/model/ModelSpawnerClaw.java +++ /dev/null @@ -1,82 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jul 23, 2014, 5:46:38 PM (GMT)] - */ -package vazkii.botania.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; - -public class ModelSpawnerClaw extends ModelBase { - ModelRenderer Plate; - ModelRenderer Claw1; - ModelRenderer Claw2; - ModelRenderer Claw3; - ModelRenderer Claw4; - ModelRenderer Claw5; - ModelRenderer Claw6; - ModelRenderer Claw7; - ModelRenderer Claw8; - - public ModelSpawnerClaw() { - textureWidth = 64; - textureHeight = 32; - - Plate = new ModelRenderer(this, 0, 0); - Plate.addBox(0F, 0F, 0F, 12, 1, 12); - Plate.setRotationPoint(-6F, 23F, -6F); - Plate.setTextureSize(64, 32); - Claw1 = new ModelRenderer(this, 0, 14); - Claw1.addBox(0F, 0F, 0F, 2, 1, 3); - Claw1.setRotationPoint(-1F, 23F, 6F); - Claw1.setTextureSize(64, 32); - Claw2 = new ModelRenderer(this, 11, 14); - Claw2.addBox(0F, 0F, 0F, 2, 1, 3); - Claw2.setRotationPoint(-1F, 23F, -9F); - Claw2.setTextureSize(64, 32); - Claw3 = new ModelRenderer(this, 0, 19); - Claw3.addBox(0F, 0F, 0F, 3, 1, 2); - Claw3.setRotationPoint(-9F, 23F, -1F); - Claw3.setTextureSize(64, 32); - Claw4 = new ModelRenderer(this, 11, 19); - Claw4.addBox(0F, 0F, 0F, 3, 1, 2); - Claw4.setRotationPoint(6F, 23F, -1F); - Claw4.setTextureSize(64, 32); - Claw5 = new ModelRenderer(this, 23, 16); - Claw5.addBox(0F, 0F, 0F, 2, 5, 1); - Claw5.setRotationPoint(-1F, 24F, 8F); - Claw5.setTextureSize(64, 32); - Claw6 = new ModelRenderer(this, 30, 16); - Claw6.addBox(0F, 0F, 0F, 1, 5, 2); - Claw6.setRotationPoint(8F, 24F, -1F); - Claw6.setTextureSize(64, 32); - Claw7 = new ModelRenderer(this, 37, 16); - Claw7.addBox(0F, 0F, 0F, 2, 5, 1); - Claw7.setRotationPoint(-1F, 24F, -9F); - Claw7.setTextureSize(64, 32); - Claw8 = new ModelRenderer(this, 44, 16); - Claw8.addBox(0F, 0F, 0F, 1, 5, 2); - Claw8.setRotationPoint(-9F, 24F, -1F); - Claw8.setTextureSize(64, 32); - } - - public void render() { - float f5 = 1F / 16F; - Plate.render(f5); - Claw1.render(f5); - Claw2.render(f5); - Claw3.render(f5); - Claw4.render(f5); - Claw5.render(f5); - Claw6.render(f5); - Claw7.render(f5); - Claw8.render(f5); - } - -} diff --git a/src/main/java/vazkii/botania/client/model/ModelSpinningCubes.java b/src/main/java/vazkii/botania/client/model/ModelSpinningCubes.java index 2220b450c..0fa96db73 100644 --- a/src/main/java/vazkii/botania/client/model/ModelSpinningCubes.java +++ b/src/main/java/vazkii/botania/client/model/ModelSpinningCubes.java @@ -12,15 +12,14 @@ package vazkii.botania.client.model; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.OpenGlHelper; - import org.lwjgl.opengl.GL11; - import vazkii.botania.client.core.handler.ClientTickHandler; public class ModelSpinningCubes extends ModelBase { - ModelRenderer spinningCube; + final ModelRenderer spinningCube; public ModelSpinningCubes() { spinningCube = new ModelRenderer(this, 42, 0); @@ -30,7 +29,7 @@ public class ModelSpinningCubes extends ModelBase { } public void renderSpinningCubes(int cubes, int repeat, int origRepeat) { - GL11.glDisable(GL11.GL_TEXTURE_2D); + GlStateManager.disableTexture2D(); final float modifier = 6F; final float rotationModifier = 0.2F; @@ -40,8 +39,8 @@ public class ModelSpinningCubes extends ModelBase { double ticks = ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks - 1.3 * (origRepeat - repeat); float offsetPerCube = 360 / cubes; - GL11.glPushMatrix(); - GL11.glTranslatef(-0.025F, 0.85F, -0.025F); + GlStateManager.pushMatrix(); + GlStateManager.translate(-0.025F, 0.85F, -0.025F); for(int i = 0; i < cubes; i++) { float offset = offsetPerCube * i; float deg = (int) (ticks / rotationModifier % 360F + offset); @@ -52,19 +51,19 @@ public class ModelSpinningCubes extends ModelBase { float z = (float) (radiusZ * Math.sin(rad)); float y = (float) Math.cos((ticks + 50 * i) / 5F) / 10F; - GL11.glPushMatrix(); - GL11.glTranslatef(x, y, z); + GlStateManager.pushMatrix(); + GlStateManager.translate(x, y, z); float xRotate = (float) Math.sin(ticks * rotationModifier) / 2F; float yRotate = (float) Math.max(0.6F, Math.sin(ticks * 0.1F) / 2F + 0.5F); float zRotate = (float) Math.cos(ticks * rotationModifier) / 2F; - GL11.glRotatef(deg, xRotate, yRotate, zRotate); + GlStateManager.rotate(deg, xRotate, yRotate, zRotate); if(repeat < origRepeat) { - GL11.glColor4f(1F, 1F, 1F, (float) repeat / (float) origRepeat * 0.4F); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glDisable(GL11.GL_ALPHA_TEST); - } else GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.color(1F, 1F, 1F, (float) repeat / (float) origRepeat * 0.4F); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.disableAlpha(); + } else GlStateManager.color(1F, 1F, 1F, 1F); int light = 15728880; int lightmapX = light % 65536; @@ -74,14 +73,14 @@ public class ModelSpinningCubes extends ModelBase { spinningCube.render(1F / 16F); if(repeat < origRepeat) { - GL11.glDisable(GL11.GL_BLEND); - GL11.glEnable(GL11.GL_ALPHA_TEST); + GlStateManager.disableBlend(); + GlStateManager.enableAlpha(); } - GL11.glPopMatrix(); + GlStateManager.popMatrix(); } - GL11.glPopMatrix(); - GL11.glEnable(GL11.GL_TEXTURE_2D); + GlStateManager.popMatrix(); + GlStateManager.enableTexture2D(); if(repeat != 0) renderSpinningCubes(cubes, repeat - 1, origRepeat); diff --git a/src/main/java/vazkii/botania/client/model/ModelSpreader.java b/src/main/java/vazkii/botania/client/model/ModelSpreader.java index f0f2161db..dc52e7f91 100644 --- a/src/main/java/vazkii/botania/client/model/ModelSpreader.java +++ b/src/main/java/vazkii/botania/client/model/ModelSpreader.java @@ -15,16 +15,16 @@ import net.minecraft.client.model.ModelRenderer; public class ModelSpreader extends ModelBase { - ModelRenderer cubeSide1; - ModelRenderer cubeSide2; - ModelRenderer cubeSide3; - ModelRenderer cubeSide4; - ModelRenderer cubeSide5; - ModelRenderer cubeHole1; - ModelRenderer cubeHole2; - ModelRenderer cubeHole3; - ModelRenderer cubeHole4; - ModelRenderer cubeInside; + final ModelRenderer cubeSide1; + final ModelRenderer cubeSide2; + final ModelRenderer cubeSide3; + final ModelRenderer cubeSide4; + final ModelRenderer cubeSide5; + final ModelRenderer cubeHole1; + final ModelRenderer cubeHole2; + final ModelRenderer cubeHole3; + final ModelRenderer cubeHole4; + final ModelRenderer cubeInside; public ModelSpreader() { textureWidth = 64; diff --git a/src/main/java/vazkii/botania/client/model/ModelTeruTeruBozu.java b/src/main/java/vazkii/botania/client/model/ModelTeruTeruBozu.java index 06817df7c..374ef7bfe 100644 --- a/src/main/java/vazkii/botania/client/model/ModelTeruTeruBozu.java +++ b/src/main/java/vazkii/botania/client/model/ModelTeruTeruBozu.java @@ -16,10 +16,10 @@ import net.minecraft.client.model.ModelRenderer; public class ModelTeruTeruBozu extends ModelBase { - public ModelRenderer thread; - public ModelRenderer cloth; - public ModelRenderer happyFace; - public ModelRenderer sadFace; + public final ModelRenderer thread; + public final ModelRenderer cloth; + public final ModelRenderer happyFace; + public final ModelRenderer sadFace; public ModelTeruTeruBozu() { textureWidth = 64; diff --git a/src/main/java/vazkii/botania/client/model/ModelTinyPotato.java b/src/main/java/vazkii/botania/client/model/ModelTinyPotato.java index 5415f00d0..cfeba1f5a 100644 --- a/src/main/java/vazkii/botania/client/model/ModelTinyPotato.java +++ b/src/main/java/vazkii/botania/client/model/ModelTinyPotato.java @@ -15,7 +15,7 @@ import net.minecraft.client.model.ModelRenderer; public class ModelTinyPotato extends ModelBase { - ModelRenderer potato; + final ModelRenderer potato; public ModelTinyPotato() { textureWidth = 64; diff --git a/src/main/java/vazkii/botania/client/model/PlatformModel.java b/src/main/java/vazkii/botania/client/model/PlatformModel.java new file mode 100644 index 000000000..49764605b --- /dev/null +++ b/src/main/java/vazkii/botania/client/model/PlatformModel.java @@ -0,0 +1,170 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.client.model; + +import com.google.common.collect.ImmutableList; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.renderer.block.model.IBakedModel; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; +import net.minecraft.client.renderer.block.model.ItemOverrideList; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockRenderLayer; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.WorldType; +import net.minecraft.world.biome.Biome; +import net.minecraftforge.client.MinecraftForgeClient; +import net.minecraftforge.common.property.IExtendedBlockState; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.common.block.BlockCamo; +import vazkii.botania.common.block.ModBlocks; +import vazkii.botania.common.block.tile.TileCamo; + +import javax.annotation.Nonnull; +import java.util.List; + +public class PlatformModel implements IBakedModel { + + @Nonnull + @Override + public List getQuads(IBlockState state, EnumFacing side, long rand) { + if(state.getBlock() != ModBlocks.platform) + return Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel().getQuads(state, side, rand); + + BlockRenderLayer layer = MinecraftForgeClient.getRenderLayer(); + IBlockState heldState = ((IExtendedBlockState) state).getValue(BotaniaStateProps.HELD_STATE); + IBlockAccess heldWorld = ((IExtendedBlockState) state).getValue(BotaniaStateProps.HELD_WORLD); + BlockPos heldPos = ((IExtendedBlockState) state).getValue(BotaniaStateProps.HELD_POS); + + if (heldWorld == null || heldPos == null) { + return ImmutableList.of(); + } + + Minecraft mc = Minecraft.getMinecraft(); + if(heldState == null && layer == BlockRenderLayer.SOLID) { + // No camo + ModelResourceLocation path = new ModelResourceLocation("botania:platform", "variant=" + state.getValue(BotaniaStateProps.PLATFORM_VARIANT).getName()); + return mc.getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getModel(path).getQuads(state, side, rand); + } else if(heldState != null) { + + // Some people used this to get an invisible block in the past, accommodate that. + if(heldState.getBlock() == ModBlocks.manaGlass) + return ImmutableList.of(); + + if(heldState.getBlock().canRenderInLayer(heldState, layer)) { + IBlockState actual = heldState.getBlock().getActualState(heldState, new FakeBlockAccess(heldWorld), heldPos); + + // Steal camo's model + IBakedModel model = mc.getBlockRendererDispatcher().getBlockModelShapes().getModelForState(actual); + + // Their model can be smart too + IBlockState extended = heldState.getBlock().getExtendedState(actual, new FakeBlockAccess(heldWorld), heldPos); + return model.getQuads(extended, side, rand); + } + } + + return ImmutableList.of(); // Nothing renders + } + + @Override + public boolean isAmbientOcclusion() { + return true; + } + + @Override + public boolean isGui3d() { + return true; + } + + @Override + public boolean isBuiltInRenderer() { + return false; + } + + @Nonnull + @Override + public TextureAtlasSprite getParticleTexture() { + return Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite("botania:blocks/livingwood0"); + } + + @Nonnull + @Override + public ItemCameraTransforms getItemCameraTransforms() { + return ItemCameraTransforms.DEFAULT; + } + + @Nonnull + @Override + public ItemOverrideList getOverrides() { + return ItemOverrideList.NONE; + } + + private static class FakeBlockAccess implements IBlockAccess { + + private final IBlockAccess compose; + + private FakeBlockAccess(IBlockAccess compose) { + this.compose = compose; + } + + @Override + public TileEntity getTileEntity(@Nonnull BlockPos pos) { + return compose.getTileEntity(pos); + } + + @Override + public int getCombinedLight(@Nonnull BlockPos pos, int lightValue) { + return 15 << 20 | 15 << 4; + } + + @Nonnull + @Override + public IBlockState getBlockState(@Nonnull BlockPos pos) { + IBlockState state = compose.getBlockState(pos); + if(state.getBlock() instanceof BlockCamo) { + state = ((TileCamo) compose.getTileEntity(pos)).camoState; + } + return state == null ? Blocks.AIR.getDefaultState() : state; + } + + @Override + public boolean isAirBlock(@Nonnull BlockPos pos) { + return compose.isAirBlock(pos); + } + + @Nonnull + @Override + public Biome getBiomeGenForCoords(@Nonnull BlockPos pos) { + return compose.getBiomeGenForCoords(pos); + } + + @Override + public int getStrongPower(@Nonnull BlockPos pos, @Nonnull EnumFacing direction) { + return compose.getStrongPower(pos, direction); + } + + @Nonnull + @Override + public WorldType getWorldType() { + return compose.getWorldType(); + } + + @Override + public boolean isSideSolid(@Nonnull BlockPos pos, @Nonnull EnumFacing side, boolean _default) { + return compose.isSideSolid(pos, side, _default); + } + } + +} diff --git a/src/main/java/vazkii/botania/client/model/SpecialFlowerModel.java b/src/main/java/vazkii/botania/client/model/SpecialFlowerModel.java new file mode 100644 index 000000000..2387dbed1 --- /dev/null +++ b/src/main/java/vazkii/botania/client/model/SpecialFlowerModel.java @@ -0,0 +1,284 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

    + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.client.model; + +import com.google.common.base.Function; +import com.google.common.cache.CacheBuilder; +import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.gson.JsonElement; +import com.google.gson.JsonParser; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.renderer.block.model.IBakedModel; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; +import net.minecraft.client.renderer.block.model.ItemOverrideList; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.renderer.vertex.VertexFormat; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import net.minecraftforge.client.model.ICustomModelLoader; +import net.minecraftforge.client.model.IModel; +import net.minecraftforge.client.model.IModelCustomData; +import net.minecraftforge.client.model.IPerspectiveAwareModel; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.client.model.ModelLoaderRegistry; +import net.minecraftforge.client.model.SimpleModelState; +import net.minecraftforge.common.model.IModelState; +import net.minecraftforge.common.model.TRSRTransformation; +import net.minecraftforge.common.property.IExtendedBlockState; +import org.apache.commons.lang3.tuple.Pair; +import vazkii.botania.api.BotaniaAPIClient; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.common.Botania; +import vazkii.botania.common.block.ModBlocks; +import vazkii.botania.common.item.block.ItemBlockSpecialFlower; + +import javax.annotation.Nonnull; +import javax.vecmath.Matrix4f; +import java.io.IOException; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +public class SpecialFlowerModel implements IModelCustomData { + + // SpecialFlowerModel for when there are no blockModels registered for a subtile + public static final SpecialFlowerModel INSTANCE = new SpecialFlowerModel(ImmutableMap.of(), ImmutableMap.of()); + + private final ImmutableMap, ModelResourceLocation> blockModels; + private final ImmutableMap, ModelResourceLocation> itemModels; + + public SpecialFlowerModel(ImmutableMap, ModelResourceLocation> blockModels, + ImmutableMap, ModelResourceLocation> itemModels) { + this.blockModels = blockModels; + this.itemModels = itemModels; + } + + @Override + public Collection getDependencies() { + ImmutableSet.Builder builder = ImmutableSet.builder(); + builder.addAll(blockModels.values()); + builder.addAll(itemModels.values()); + + // Force island models to be loaded and baked. See FloatingFlowerModel. + builder.addAll(BotaniaAPIClient.getRegisteredIslandTypeModels().values()); + + return builder.build(); + } + + @Override + public Collection getTextures() { + return ImmutableList.of(); + } + + @Override + public IBakedModel bake(IModelState state, VertexFormat format, Function bakedTextureGetter) { + // "Bake" the SpecialFlowerModel (in reality, just create another wrapper for all the delegate blockModels) + return new SpecialFlowerBakedModel(blockModels, itemModels, IPerspectiveAwareModel.MapWrapper.getTransforms(state)); + } + + @Override + public IModelState getDefaultState() { + return TRSRTransformation.identity(); + } + + @Override + public IModel process(ImmutableMap customData) { + // Load the base variant from blockstate json, and also add all the model paths we received from external API + ImmutableMap.Builder, ModelResourceLocation> blockBuilder = ImmutableMap.builder(); + ImmutableMap.Builder, ModelResourceLocation> itemBuilder = ImmutableMap.builder(); + + for(String key : customData.keySet()) { + if("base".equals(key)) { + blockBuilder.put(Optional.empty(), getLocation(customData.get(key))); + } + } + + for(Map.Entry e : BotaniaAPIClient.getRegisteredSubtileBlockModels().entrySet()) { + blockBuilder.put(Optional.of(e.getKey()), e.getValue()); + } + for(Map.Entry e : BotaniaAPIClient.getRegisteredSubtileItemModels().entrySet()) { + itemBuilder.put(Optional.of(e.getKey()), e.getValue()); + } + + ImmutableMap, ModelResourceLocation> blockModels = blockBuilder.build(); + ImmutableMap, ModelResourceLocation> itemModels = itemBuilder.build(); + if(blockModels.isEmpty() && itemModels.isEmpty()) return INSTANCE; + return new SpecialFlowerModel(blockModels, itemModels); + } + + private ModelResourceLocation getLocation(String json) { + JsonElement e = new JsonParser().parse(json); + if(e.isJsonPrimitive() && e.getAsJsonPrimitive().isString()) { + return new ModelResourceLocation(e.getAsString()); + } + Botania.LOGGER.error("Expect ModelResourceLocation, got: ", json); + return new ModelResourceLocation("builtin/missing", "missing"); + } + + public enum Loader implements ICustomModelLoader { + INSTANCE { + @Override + public void onResourceManagerReload(@Nonnull IResourceManager resourceManager) { + } + + @Override + public boolean accepts(ResourceLocation modelLocation) { + return modelLocation.getResourceDomain().equals("botania_special") && ( + modelLocation.getResourcePath().equals("specialFlower") || + modelLocation.getResourcePath().equals("models/block/specialFlower") || + modelLocation.getResourcePath().equals("models/item/specialFlower")); + } + + @Override + public IModel loadModel(ResourceLocation modelLocation) throws IOException { + // Load a dummy model for now, all actual blockModels added in process(). + return SpecialFlowerModel.INSTANCE; + } + } + } + + private static class SpecialFlowerBakedModel implements IPerspectiveAwareModel { + + private final ImmutableMap transforms; + private final ImmutableMap, ModelResourceLocation> blockModels; + private final ImmutableMap, ModelResourceLocation> itemModels; + + private final IBakedModel baseModel; + private final LoadingCache> bakedBlockModels; + private final LoadingCache> bakedItemModels; + + SpecialFlowerBakedModel(ImmutableMap, ModelResourceLocation> blockModels, + ImmutableMap, ModelResourceLocation> itemModels, ImmutableMap cameraTransforms) { + this.blockModels = blockModels; + this.itemModels = itemModels; + this.transforms = cameraTransforms; + + ModelResourceLocation baseModelPath = blockModels.getOrDefault(Optional.empty(), + new ModelResourceLocation("builtin/missing", "missing")); + this.baseModel = ModelLoaderRegistry.getModelOrMissing(baseModelPath) + .bake(new SimpleModelState(transforms), DefaultVertexFormats.ITEM, ModelLoader.defaultTextureGetter()); + + this.bakedBlockModels = CacheBuilder.newBuilder().build(new Loader(true)); + this.bakedItemModels = CacheBuilder.newBuilder().build(new Loader(false)); + } + + private class Loader extends CacheLoader> { + + private final boolean loadBlocks; + + Loader(boolean blocks) { + this.loadBlocks = blocks; + } + + @Override + public Optional load(@Nonnull String key) { + Map, ModelResourceLocation> loadFrom = loadBlocks ? blockModels : itemModels; + + ModelResourceLocation loc = loadFrom.get(Optional.of(key)); + if(loc == null) + return Optional.empty(); + + IModel model = ModelLoaderRegistry.getModelOrMissing(loc); + if(model == ModelLoaderRegistry.getMissingModel()) + return Optional.empty(); + + return Optional.of(model.bake(new SimpleModelState(transforms), DefaultVertexFormats.ITEM, ModelLoader.defaultTextureGetter())); + } + } + + @Nonnull + @Override + public List getQuads(IBlockState state, EnumFacing face, long rand) { + if(state.getBlock() != ModBlocks.specialFlower) { + Botania.LOGGER.fatal("FOREIGN BLOCK: " + state); + return Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel().getQuads(state, face, rand); + } + + IExtendedBlockState extendedState = ((IExtendedBlockState) state); + String subtileId = extendedState.getValue(BotaniaStateProps.SUBTILE_ID); + + IBakedModel ret = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel(); + Optional specialModel = bakedBlockModels.getUnchecked(subtileId == null ? "" : subtileId); + if(specialModel.isPresent()) + ret = specialModel.get(); + + return ret.getQuads(state, face, rand); + } + + @Nonnull + @Override + public ItemOverrideList getOverrides() { + return itemHandler; + } + + private final ItemStack roseFallback = new ItemStack(Blocks.RED_FLOWER); + + private final ItemOverrideList itemHandler = new ItemOverrideList(ImmutableList.of()) { + @Nonnull + @Override + public IBakedModel handleItemState(@Nonnull IBakedModel original, ItemStack stack, @Nonnull World world, @Nonnull EntityLivingBase living) { + Optional item = bakedItemModels.getUnchecked(ItemBlockSpecialFlower.getType(stack)); + + if(!item.isPresent()) + item = bakedBlockModels.getUnchecked(ItemBlockSpecialFlower.getType(stack)); + + return item.isPresent() + ? item.get() + : Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getItemModel(roseFallback); + } + }; + + @Override + public boolean isAmbientOcclusion() { + return baseModel.isAmbientOcclusion(); + } + + @Override + public boolean isGui3d() { + return baseModel.isGui3d(); + } + + @Override + public boolean isBuiltInRenderer() { + return baseModel.isBuiltInRenderer(); + } + + @Nonnull + @Override + public TextureAtlasSprite getParticleTexture() { + return baseModel.getParticleTexture(); + } + + @Nonnull + @Override + public ItemCameraTransforms getItemCameraTransforms() { + return baseModel.getItemCameraTransforms(); + } + + @Override + public Pair handlePerspective(ItemCameraTransforms.TransformType cameraTransformType) { + return IPerspectiveAwareModel.MapWrapper.handlePerspective(this, transforms, cameraTransformType); + } + } + +} diff --git a/src/main/java/vazkii/botania/client/model/armor/ModelArmorElementium.java b/src/main/java/vazkii/botania/client/model/armor/ModelArmorElementium.java index 8720d8f1e..24245b427 100644 --- a/src/main/java/vazkii/botania/client/model/armor/ModelArmorElementium.java +++ b/src/main/java/vazkii/botania/client/model/armor/ModelArmorElementium.java @@ -14,46 +14,50 @@ import net.minecraft.client.model.ModelBiped; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.item.EntityArmorStand; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.EnumAction; -import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumHandSide; +import vazkii.botania.common.Botania; + +import javax.annotation.Nonnull; public class ModelArmorElementium extends ModelBiped { - public ModelRenderer helm; - public ModelRenderer body; - public ModelRenderer armR; - public ModelRenderer armL; - public ModelRenderer belt; - public ModelRenderer bootR; - public ModelRenderer bootL; - public ModelRenderer helm1; - public ModelRenderer helm2; - public ModelRenderer helm3; - public ModelRenderer fairy; - public ModelRenderer helmWing1; - public ModelRenderer helmWing2; - public ModelRenderer helmWing3; - public ModelRenderer helmWing4; - public ModelRenderer body2; - public ModelRenderer armRpauldron; - public ModelRenderer wing1; - public ModelRenderer wing2; - public ModelRenderer armLpauldron; - public ModelRenderer wing1_1; - public ModelRenderer wing2_1; - public ModelRenderer legR; - public ModelRenderer legL; - public ModelRenderer bootR1; - public ModelRenderer wing1_2; - public ModelRenderer wing2_2; - public ModelRenderer bootL1; - public ModelRenderer wing1_3; - public ModelRenderer wing2_3; + private final ModelRenderer helm; + public final ModelRenderer body; + private final ModelRenderer armR; + private final ModelRenderer armL; + public final ModelRenderer belt; + private final ModelRenderer bootR; + private final ModelRenderer bootL; + private final ModelRenderer helm1; + private final ModelRenderer helm2; + private final ModelRenderer helm3; + private final ModelRenderer fairy; + private final ModelRenderer helmWing1; + private final ModelRenderer helmWing2; + private final ModelRenderer helmWing3; + private final ModelRenderer helmWing4; + private final ModelRenderer body2; + private final ModelRenderer armRpauldron; + private final ModelRenderer wing1; + private final ModelRenderer wing2; + private final ModelRenderer armLpauldron; + private final ModelRenderer wing1_1; + private final ModelRenderer wing2_1; + private final ModelRenderer legR; + private final ModelRenderer legL; + private final ModelRenderer bootR1; + private final ModelRenderer wing1_2; + private final ModelRenderer wing2_2; + private final ModelRenderer bootL1; + private final ModelRenderer wing1_3; + private final ModelRenderer wing2_3; - int slot; + private final EntityEquipmentSlot slot; - public ModelArmorElementium(int slot) { + public ModelArmorElementium(EntityEquipmentSlot slot) { this.slot = slot; textureWidth = 64; @@ -210,22 +214,28 @@ public class ModelArmorElementium extends ModelBiped { } @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - helm.showModel = slot == 0; - body.showModel = slot == 1; - armR.showModel = slot == 1; - armL.showModel = slot == 1; - legR.showModel = slot == 2; - legL.showModel = slot == 2; - bootL.showModel = slot == 3; - bootR.showModel = slot == 3; + public void render(@Nonnull Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) { + + if(entity instanceof EntityArmorStand) { + // Hack so helmets look right on armor stand + netHeadYaw = 0; + } + + helm.showModel = slot == EntityEquipmentSlot.HEAD; + body.showModel = slot == EntityEquipmentSlot.CHEST; + armR.showModel = slot == EntityEquipmentSlot.CHEST; + armL.showModel = slot == EntityEquipmentSlot.CHEST; + legR.showModel = slot == EntityEquipmentSlot.LEGS; + legL.showModel = slot == EntityEquipmentSlot.LEGS; + bootL.showModel = slot == EntityEquipmentSlot.FEET; + bootR.showModel = slot == EntityEquipmentSlot.FEET; bipedHeadwear.showModel = false; bipedHead = helm; bipedBody = body; bipedRightArm = armR; bipedLeftArm = armL; - if(slot == 2) { + if(slot == EntityEquipmentSlot.LEGS) { bipedRightLeg = legR; bipedLeftLeg = legL; } else { @@ -233,32 +243,10 @@ public class ModelArmorElementium extends ModelBiped { bipedLeftLeg = bootL; } - prepareForRender(entity); - super.render(entity, f, f1, f2, f3, f4, f5); + super.render(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale); } - public void prepareForRender(Entity entity) { - EntityLivingBase living = (EntityLivingBase) entity; - isSneak = living != null ? living.isSneaking() : false; - if(living != null && living instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer) living; - - ItemStack itemstack = player.inventory.getCurrentItem(); - heldItemRight = itemstack != null ? 1 : 0; - - aimedBow = false; - if (itemstack != null && player.getItemInUseCount() > 0) { - EnumAction enumaction = itemstack.getItemUseAction(); - - if (enumaction == EnumAction.block) - heldItemRight = 3; - else if (enumaction == EnumAction.bow) - aimedBow = true; - } - } - } - - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { + private void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { modelRenderer.rotateAngleX = x; modelRenderer.rotateAngleY = y; modelRenderer.rotateAngleZ = z; diff --git a/src/main/java/vazkii/botania/client/model/armor/ModelArmorManasteel.java b/src/main/java/vazkii/botania/client/model/armor/ModelArmorManasteel.java index a2d163a95..32c623c7c 100644 --- a/src/main/java/vazkii/botania/client/model/armor/ModelArmorManasteel.java +++ b/src/main/java/vazkii/botania/client/model/armor/ModelArmorManasteel.java @@ -14,35 +14,39 @@ import net.minecraft.client.model.ModelBiped; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.item.EntityArmorStand; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.EnumAction; -import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumHandSide; + +import javax.annotation.Nonnull; public class ModelArmorManasteel extends ModelBiped { - public ModelRenderer helm; - public ModelRenderer body; - public ModelRenderer armR; - public ModelRenderer armL; - public ModelRenderer belt; - public ModelRenderer bootR; - public ModelRenderer bootL; - public ModelRenderer helm1; - public ModelRenderer helm2; - public ModelRenderer helm3; - public ModelRenderer helm4; - public ModelRenderer helm5; - public ModelRenderer helm6; - public ModelRenderer helm7; - public ModelRenderer body2; - public ModelRenderer armRpauldron; - public ModelRenderer armLpauldron; - public ModelRenderer legR; - public ModelRenderer legL; - int slot; + private final ModelRenderer helm; + public final ModelRenderer body; + private final ModelRenderer armR; + private final ModelRenderer armL; + public final ModelRenderer belt; + private final ModelRenderer bootR; + private final ModelRenderer bootL; + private final ModelRenderer helm1; + private final ModelRenderer helm2; + private final ModelRenderer helm3; + private final ModelRenderer helm4; + private final ModelRenderer helm5; + private final ModelRenderer helm6; + private final ModelRenderer helm7; + private final ModelRenderer body2; + private final ModelRenderer armRpauldron; + private final ModelRenderer armLpauldron; + private final ModelRenderer legR; + private final ModelRenderer legL; - public ModelArmorManasteel(int slot) { + private final EntityEquipmentSlot slot; + + public ModelArmorManasteel(EntityEquipmentSlot slot) { this.slot = slot; textureWidth = 64; @@ -139,22 +143,27 @@ public class ModelArmorManasteel extends ModelBiped { } @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - helm.showModel = slot == 0; - body.showModel = slot == 1; - armR.showModel = slot == 1; - armL.showModel = slot == 1; - legR.showModel = slot == 2; - legL.showModel = slot == 2; - bootL.showModel = slot == 3; - bootR.showModel = slot == 3; + public void render(@Nonnull Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) { + if(entity instanceof EntityArmorStand) { + // Hack so helmets look right on armor stand + netHeadYaw = 0; + } + + helm.showModel = slot == EntityEquipmentSlot.HEAD; + body.showModel = slot == EntityEquipmentSlot.CHEST; + armR.showModel = slot == EntityEquipmentSlot.CHEST; + armL.showModel = slot == EntityEquipmentSlot.CHEST; + legR.showModel = slot == EntityEquipmentSlot.LEGS; + legL.showModel = slot == EntityEquipmentSlot.LEGS; + bootL.showModel = slot == EntityEquipmentSlot.FEET; + bootR.showModel = slot == EntityEquipmentSlot.FEET; bipedHeadwear.showModel = false; bipedHead = helm; bipedBody = body; bipedRightArm = armR; bipedLeftArm = armL; - if(slot == 2) { + if(slot == EntityEquipmentSlot.LEGS) { bipedRightLeg = legR; bipedLeftLeg = legL; } else { @@ -162,32 +171,10 @@ public class ModelArmorManasteel extends ModelBiped { bipedLeftLeg = bootL; } - prepareForRender(entity); - super.render(entity, f, f1, f2, f3, f4, f5); + super.render(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale); } - public void prepareForRender(Entity entity) { - EntityLivingBase living = (EntityLivingBase) entity; - isSneak = living != null ? living.isSneaking() : false; - if(living != null && living instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer) living; - - ItemStack itemstack = player.inventory.getCurrentItem(); - heldItemRight = itemstack != null ? 1 : 0; - - aimedBow = false; - if (itemstack != null && player.getItemInUseCount() > 0) { - EnumAction enumaction = itemstack.getItemUseAction(); - - if (enumaction == EnumAction.block) - heldItemRight = 3; - else if(enumaction == EnumAction.bow) - aimedBow = true; - } - } - } - - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { + private void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { modelRenderer.rotateAngleX = x; modelRenderer.rotateAngleY = y; modelRenderer.rotateAngleZ = z; diff --git a/src/main/java/vazkii/botania/client/model/armor/ModelArmorManaweave.java b/src/main/java/vazkii/botania/client/model/armor/ModelArmorManaweave.java index ce2fd8c25..67abe34a0 100644 --- a/src/main/java/vazkii/botania/client/model/armor/ModelArmorManaweave.java +++ b/src/main/java/vazkii/botania/client/model/armor/ModelArmorManaweave.java @@ -14,36 +14,39 @@ import net.minecraft.client.model.ModelBiped; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.item.EntityArmorStand; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.EnumAction; -import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumHandSide; + +import javax.annotation.Nonnull; public class ModelArmorManaweave extends ModelBiped { - public ModelRenderer helm; - public ModelRenderer body; - public ModelRenderer armR; - public ModelRenderer armL; - public ModelRenderer legR; - public ModelRenderer legL; - public ModelRenderer bootR; - public ModelRenderer bootL; - public ModelRenderer helm2; - public ModelRenderer helm3; - public ModelRenderer helm4; - public ModelRenderer helmSeam1; - public ModelRenderer helmSeam2; - public ModelRenderer helmSeam3; - public ModelRenderer helmSeam4; - public ModelRenderer body2; - public ModelRenderer armRpauldron; - public ModelRenderer armLpauldron; - public ModelRenderer skirtR; - public ModelRenderer skirtL; + private final ModelRenderer helm; + public final ModelRenderer body; + private final ModelRenderer armR; + private final ModelRenderer armL; + private final ModelRenderer legR; + private final ModelRenderer legL; + private final ModelRenderer bootR; + private final ModelRenderer bootL; + private final ModelRenderer helm2; + private final ModelRenderer helm3; + private final ModelRenderer helm4; + private final ModelRenderer helmSeam1; + private final ModelRenderer helmSeam2; + private final ModelRenderer helmSeam3; + private final ModelRenderer helmSeam4; + private final ModelRenderer body2; + private final ModelRenderer armRpauldron; + private final ModelRenderer armLpauldron; + private final ModelRenderer skirtR; + private final ModelRenderer skirtL; - int slot; + private final EntityEquipmentSlot slot; - public ModelArmorManaweave(int slot) { + public ModelArmorManaweave(EntityEquipmentSlot slot) { this.slot = slot; textureWidth = 64; @@ -140,22 +143,27 @@ public class ModelArmorManaweave extends ModelBiped { } @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - helm.showModel = slot == 0; - body.showModel = slot == 1; - armR.showModel = slot == 1; - armL.showModel = slot == 1; - legR.showModel = slot == 2; - legL.showModel = slot == 2; - bootL.showModel = slot == 3; - bootR.showModel = slot == 3; + public void render(@Nonnull Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) { + if(entity instanceof EntityArmorStand) { + // Hack so helmets look right on armor stand + netHeadYaw = 0; + } + + helm.showModel = slot == EntityEquipmentSlot.HEAD; + body.showModel = slot == EntityEquipmentSlot.CHEST; + armR.showModel = slot == EntityEquipmentSlot.CHEST; + armL.showModel = slot == EntityEquipmentSlot.CHEST; + legR.showModel = slot == EntityEquipmentSlot.LEGS; + legL.showModel = slot == EntityEquipmentSlot.LEGS; + bootL.showModel = slot == EntityEquipmentSlot.FEET; + bootR.showModel = slot == EntityEquipmentSlot.FEET; bipedHeadwear.showModel = false; bipedHead = helm; bipedBody = body; bipedRightArm = armR; bipedLeftArm = armL; - if(slot == 2) { + if(slot == EntityEquipmentSlot.LEGS) { bipedRightLeg = legR; bipedLeftLeg = legL; } else { @@ -163,32 +171,10 @@ public class ModelArmorManaweave extends ModelBiped { bipedLeftLeg = bootL; } - prepareForRender(entity); - super.render(entity, f, f1, f2, f3, f4, f5); + super.render(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale); } - public void prepareForRender(Entity entity) { - EntityLivingBase living = (EntityLivingBase) entity; - isSneak = living != null ? living.isSneaking() : false; - if(living != null && living instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer) living; - - ItemStack itemstack = player.inventory.getCurrentItem(); - heldItemRight = itemstack != null ? 1 : 0; - - aimedBow = false; - if (itemstack != null && player.getItemInUseCount() > 0) { - EnumAction enumaction = itemstack.getItemUseAction(); - - if (enumaction == EnumAction.block) - heldItemRight = 3; - else if (enumaction == EnumAction.bow) - aimedBow = true; - } - } - } - - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { + private void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { modelRenderer.rotateAngleX = x; modelRenderer.rotateAngleY = y; modelRenderer.rotateAngleZ = z; diff --git a/src/main/java/vazkii/botania/client/model/armor/ModelArmorTerrasteel.java b/src/main/java/vazkii/botania/client/model/armor/ModelArmorTerrasteel.java index 91104c4ee..1fc135e38 100644 --- a/src/main/java/vazkii/botania/client/model/armor/ModelArmorTerrasteel.java +++ b/src/main/java/vazkii/botania/client/model/armor/ModelArmorTerrasteel.java @@ -14,49 +14,52 @@ import net.minecraft.client.model.ModelBiped; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.item.EntityArmorStand; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.EnumAction; -import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumHandSide; + +import javax.annotation.Nonnull; public class ModelArmorTerrasteel extends ModelBiped { - public ModelRenderer helm; - public ModelRenderer body; - public ModelRenderer armr; - public ModelRenderer armL; - public ModelRenderer belt; - public ModelRenderer bootR; - public ModelRenderer bootL; - public ModelRenderer helm2; - public ModelRenderer helm3; - public ModelRenderer helm4; - public ModelRenderer helmLeaf1; - public ModelRenderer helmLeaf2; - public ModelRenderer helmLeaf3; - public ModelRenderer helmLeaf4; - public ModelRenderer helmLeaf5; - public ModelRenderer helmLeaf6; - public ModelRenderer helmbranch1; - public ModelRenderer helmbranch2; - public ModelRenderer helmbranch3; - public ModelRenderer helmbranch4; - public ModelRenderer body2; - public ModelRenderer armRpauldron; - public ModelRenderer armRbranch1; - public ModelRenderer armRbranch2; - public ModelRenderer armLpauldron; - public ModelRenderer armLbranch1; - public ModelRenderer armLbranch2; - public ModelRenderer legR; - public ModelRenderer legL; - public ModelRenderer bootR1; - public ModelRenderer bootRbranch; - public ModelRenderer bootL2; - public ModelRenderer bootLbranch; + private final ModelRenderer helm; + public final ModelRenderer body; + private final ModelRenderer armr; + private final ModelRenderer armL; + public final ModelRenderer belt; + private final ModelRenderer bootR; + private final ModelRenderer bootL; + private final ModelRenderer helm2; + private final ModelRenderer helm3; + private final ModelRenderer helm4; + private final ModelRenderer helmLeaf1; + private final ModelRenderer helmLeaf2; + private final ModelRenderer helmLeaf3; + private final ModelRenderer helmLeaf4; + private final ModelRenderer helmLeaf5; + private final ModelRenderer helmLeaf6; + private final ModelRenderer helmbranch1; + private final ModelRenderer helmbranch2; + private final ModelRenderer helmbranch3; + private final ModelRenderer helmbranch4; + private final ModelRenderer body2; + private final ModelRenderer armRpauldron; + private final ModelRenderer armRbranch1; + private final ModelRenderer armRbranch2; + private final ModelRenderer armLpauldron; + private final ModelRenderer armLbranch1; + private final ModelRenderer armLbranch2; + private final ModelRenderer legR; + private final ModelRenderer legL; + private final ModelRenderer bootR1; + private final ModelRenderer bootRbranch; + private final ModelRenderer bootL2; + private final ModelRenderer bootLbranch; - int slot; + private final EntityEquipmentSlot slot; - public ModelArmorTerrasteel(int slot) { + public ModelArmorTerrasteel(EntityEquipmentSlot slot) { this.slot = slot; textureWidth = 64; @@ -231,22 +234,27 @@ public class ModelArmorTerrasteel extends ModelBiped { } @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - helm.showModel = slot == 0; - body.showModel = slot == 1; - armr.showModel = slot == 1; - armL.showModel = slot == 1; - legR.showModel = slot == 2; - legL.showModel = slot == 2; - bootL.showModel = slot == 3; - bootR.showModel = slot == 3; + public void render(@Nonnull Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) { + if(entity instanceof EntityArmorStand) { + // Hack so helmets look right on armor stand + netHeadYaw = 0; + } + + helm.showModel = slot == EntityEquipmentSlot.HEAD; + body.showModel = slot == EntityEquipmentSlot.CHEST; + armr.showModel = slot == EntityEquipmentSlot.CHEST; + armL.showModel = slot == EntityEquipmentSlot.CHEST; + legR.showModel = slot == EntityEquipmentSlot.LEGS; + legL.showModel = slot == EntityEquipmentSlot.LEGS; + bootL.showModel = slot == EntityEquipmentSlot.FEET; + bootR.showModel = slot == EntityEquipmentSlot.FEET; bipedHeadwear.showModel = false; bipedHead = helm; bipedBody = body; bipedRightArm = armr; bipedLeftArm = armL; - if(slot == 2) { + if(slot == EntityEquipmentSlot.LEGS) { bipedRightLeg = legR; bipedLeftLeg = legL; } else { @@ -254,32 +262,10 @@ public class ModelArmorTerrasteel extends ModelBiped { bipedLeftLeg = bootL; } - prepareForRender(entity); - super.render(entity, f, f1, f2, f3, f4, f5); + super.render(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale); } - public void prepareForRender(Entity entity) { - EntityLivingBase living = (EntityLivingBase) entity; - isSneak = living != null ? living.isSneaking() : false; - if(living != null && living instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer) living; - - ItemStack itemstack = player.inventory.getCurrentItem(); - heldItemRight = itemstack != null ? 1 : 0; - - aimedBow = false; - if (itemstack != null && player.getItemInUseCount() > 0) { - EnumAction enumaction = itemstack.getItemUseAction(); - - if (enumaction == EnumAction.block) - heldItemRight = 3; - else if (enumaction == EnumAction.bow) - aimedBow = true; - } - } - } - - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { + private void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { modelRenderer.rotateAngleX = x; modelRenderer.rotateAngleY = y; modelRenderer.rotateAngleZ = z; diff --git a/src/main/java/vazkii/botania/client/render/IModelRegister.java b/src/main/java/vazkii/botania/client/render/IModelRegister.java new file mode 100644 index 000000000..358074074 --- /dev/null +++ b/src/main/java/vazkii/botania/client/render/IModelRegister.java @@ -0,0 +1,14 @@ +package vazkii.botania.client.render; + +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +public interface IModelRegister { + /** + * Do whatever needs to be done to register models + * For Blocks, statemapper registration needs to be done BEFORE itemblock registration + * Exceptions to that rule are noted + */ + @SideOnly(Side.CLIENT) + void registerModels(); +} diff --git a/src/main/java/vazkii/botania/client/render/block/InterpolatedIcon.java b/src/main/java/vazkii/botania/client/render/block/InterpolatedIcon.java deleted file mode 100644 index dbe47f01b..000000000 --- a/src/main/java/vazkii/botania/client/render/block/InterpolatedIcon.java +++ /dev/null @@ -1,79 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Aug 15, 2015, 5:11:16 PM (GMT)] - */ -package vazkii.botania.client.render.block; - -import java.lang.reflect.Field; - -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.texture.TextureUtil; -import net.minecraft.client.resources.data.AnimationMetadataSection; -import vazkii.botania.common.lib.LibObfuscation; -import cpw.mods.fml.relauncher.ReflectionHelper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -// This is all vanilla code from 1.8, thanks to ganymedes01 porting it to 1.7 :D -@SideOnly(Side.CLIENT) -public class InterpolatedIcon extends TextureAtlasSprite { - - protected int[][] interpolatedFrameData; - private Field fanimationMetadata; - - public InterpolatedIcon(String name) { - super(name); - fanimationMetadata = ReflectionHelper.findField(TextureAtlasSprite.class, LibObfuscation.ANIMATION_METADATA); - fanimationMetadata.setAccessible(true); - } - - @Override - public void updateAnimation() { - super.updateAnimation(); - try { - updateAnimationInterpolated(); - } catch(Exception e) { - // NO-OP - } - } - - private void updateAnimationInterpolated() throws IllegalArgumentException, IllegalAccessException { - AnimationMetadataSection animationMetadata = (AnimationMetadataSection) fanimationMetadata.get(this); - - double d0 = 1.0D - tickCounter / (double) animationMetadata.getFrameTimeSingle(frameCounter); - int i = animationMetadata.getFrameIndex(frameCounter); - int j = animationMetadata.getFrameCount() == 0 ? framesTextureData.size() : animationMetadata.getFrameCount(); - int k = animationMetadata.getFrameIndex((frameCounter + 1) % j); - - if(i != k && k >= 0 && k < framesTextureData.size()) { - int[][] aint = (int[][]) framesTextureData.get(i); - int[][] aint1 = (int[][]) framesTextureData.get(k); - - if(interpolatedFrameData == null || interpolatedFrameData.length != aint.length) - interpolatedFrameData = new int[aint.length][]; - - for(int l = 0; l < aint.length; l++) { - if (interpolatedFrameData[l] == null) - interpolatedFrameData[l] = new int[aint[l].length]; - - if(l < aint1.length && aint1[l].length == aint[l].length) - for (int i1 = 0; i1 < aint[l].length; ++i1) { - int j1 = aint[l][i1]; - int k1 = aint1[l][i1]; - int l1 = (int) (((j1 & 16711680) >> 16) * d0 + ((k1 & 16711680) >> 16) * (1.0D - d0)); - int i2 = (int) (((j1 & 65280) >> 8) * d0 + ((k1 & 65280) >> 8) * (1.0D - d0)); - int j2 = (int) ((j1 & 255) * d0 + (k1 & 255) * (1.0D - d0)); - interpolatedFrameData[l][i1] = j1 & -16777216 | l1 << 16 | i2 << 8 | j2; - } - } - - TextureUtil.uploadTextureMipmap(interpolatedFrameData, width, height, originX, originY, false, false); - } - } -} \ No newline at end of file diff --git a/src/main/java/vazkii/botania/client/render/block/RenderAltar.java b/src/main/java/vazkii/botania/client/render/block/RenderAltar.java deleted file mode 100644 index 2d1e6384e..000000000 --- a/src/main/java/vazkii/botania/client/render/block/RenderAltar.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 21, 2014, 8:02:01 PM (GMT)] - */ -package vazkii.botania.client.render.block; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.world.IBlockAccess; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.client.render.tile.RenderTileAltar; -import vazkii.botania.common.block.tile.TileAltar; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderAltar implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - GL11.glPushMatrix(); - GL11.glTranslatef(-0.5F, -0.6F, -0.5F); - GL11.glScalef(0.9F, 0.9F, 0.9F); - RenderTileAltar.forceMeta = metadata; - TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileAltar(), 0.0D, 0.0D, 0.0D, 0.0F); - GL11.glPopMatrix(); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return false; - } - - @Override - public int getRenderId() { - return LibRenderIDs.idAltar; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } -} diff --git a/src/main/java/vazkii/botania/client/render/block/RenderAvatar.java b/src/main/java/vazkii/botania/client/render/block/RenderAvatar.java deleted file mode 100644 index f850e1237..000000000 --- a/src/main/java/vazkii/botania/client/render/block/RenderAvatar.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Oct 24, 2015, 11:06:11 PM (GMT)] - */ -package vazkii.botania.client.render.block; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.world.IBlockAccess; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.common.block.tile.TileAvatar; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderAvatar implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - GL11.glPushMatrix(); - GL11.glTranslatef(-0.5F, -0.6F, -0.5F); - TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileAvatar(), 0.0D, 0.0D, 0.0D, 0.0F); - GL11.glPopMatrix(); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return false; - } - - @Override - public int getRenderId() { - return LibRenderIDs.idAvatar; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } - -} diff --git a/src/main/java/vazkii/botania/client/render/block/RenderBellows.java b/src/main/java/vazkii/botania/client/render/block/RenderBellows.java deleted file mode 100644 index a1e287418..000000000 --- a/src/main/java/vazkii/botania/client/render/block/RenderBellows.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Aug 28, 2015, 7:13:45 PM (GMT)] - */ -package vazkii.botania.client.render.block; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.world.IBlockAccess; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.common.block.tile.mana.TileBellows; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderBellows implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { - GL11.glPushMatrix(); - GL11.glTranslatef(-0.5F, -0.3F, -0.5F); - GL11.glScalef(1.2F, 1.2F, 1.2F); - TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileBellows(), 0.0D, 0.0D, 0.0D, 0.0F); - GL11.glPopMatrix(); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return false; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } - - @Override - public int getRenderId() { - return LibRenderIDs.idBellows; - } - -} diff --git a/src/main/java/vazkii/botania/client/render/block/RenderBrewery.java b/src/main/java/vazkii/botania/client/render/block/RenderBrewery.java deleted file mode 100644 index aa2eefed3..000000000 --- a/src/main/java/vazkii/botania/client/render/block/RenderBrewery.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Oct 31, 2014, 5:00:12 PM (GMT)] - */ -package vazkii.botania.client.render.block; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.world.IBlockAccess; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.client.render.tile.RenderTileBrewery; -import vazkii.botania.common.block.tile.TileBrewery; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderBrewery implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { - GL11.glPushMatrix(); - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - GL11.glScalef(1.2F, 1.2F, 1.2F); - RenderTileBrewery.rotate = false; - TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileBrewery(), 0.0D, 0.0D, 0.0D, 0.0F); - RenderTileBrewery.rotate = true; - GL11.glPopMatrix(); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return false; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } - - @Override - public int getRenderId() { - return LibRenderIDs.idBrewery; - } - -} diff --git a/src/main/java/vazkii/botania/client/render/block/RenderCocoon.java b/src/main/java/vazkii/botania/client/render/block/RenderCocoon.java deleted file mode 100644 index d74f04d17..000000000 --- a/src/main/java/vazkii/botania/client/render/block/RenderCocoon.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jul 8, 2015, 5:57:29 PM (GMT)] - */ -package vazkii.botania.client.render.block; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.world.IBlockAccess; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.common.block.tile.TileCocoon; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderCocoon implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - GL11.glPushMatrix(); - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileCocoon(), 0.0D, 0.0D, 0.0D, 0.0F); - GL11.glPopMatrix(); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return false; - } - - @Override - public int getRenderId() { - return LibRenderIDs.idCocoon; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } - -} diff --git a/src/main/java/vazkii/botania/client/render/block/RenderCorporeaCrystalCube.java b/src/main/java/vazkii/botania/client/render/block/RenderCorporeaCrystalCube.java deleted file mode 100644 index 1225ae73d..000000000 --- a/src/main/java/vazkii/botania/client/render/block/RenderCorporeaCrystalCube.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Apr 30, 2015, 6:22:32 PM (GMT)] - */ -package vazkii.botania.client.render.block; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.world.IBlockAccess; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.common.block.tile.corporea.TileCorporeaCrystalCube; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderCorporeaCrystalCube implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { - GL11.glPushMatrix(); - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - GL11.glDisable(GL11.GL_ALPHA_TEST); - TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileCorporeaCrystalCube(), 0.0D, 0.0D, 0.0D, 0.0F); - GL11.glEnable(GL11.GL_ALPHA_TEST); - GL11.glPopMatrix(); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return false; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } - - @Override - public int getRenderId() { - return LibRenderIDs.idCorporeaCrystalCybe; - } - -} diff --git a/src/main/java/vazkii/botania/client/render/block/RenderCorporeaIndex.java b/src/main/java/vazkii/botania/client/render/block/RenderCorporeaIndex.java deleted file mode 100644 index 4eb43de55..000000000 --- a/src/main/java/vazkii/botania/client/render/block/RenderCorporeaIndex.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Feb 15, 2015, 1:57:50 AM (GMT)] - */ -package vazkii.botania.client.render.block; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.world.IBlockAccess; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.client.render.tile.RenderTileCorporeaIndex; -import vazkii.botania.common.block.tile.corporea.TileCorporeaIndex; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderCorporeaIndex implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { - GL11.glPushMatrix(); - GL11.glTranslatef(-0.5F, -0.3F, -0.5F); - GL11.glScalef(1.4F, 1.4F, 1.4F); - RenderTileCorporeaIndex.move = false; - TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileCorporeaIndex(), 0.0D, 0.0D, 0.0D, 0.0F); - RenderTileCorporeaIndex.move = true; - GL11.glPopMatrix(); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return false; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } - - @Override - public int getRenderId() { - return LibRenderIDs.idCorporeaIndex; - } - -} diff --git a/src/main/java/vazkii/botania/client/render/block/RenderDoubleFlower.java b/src/main/java/vazkii/botania/client/render/block/RenderDoubleFlower.java deleted file mode 100644 index d9a9ab80b..000000000 --- a/src/main/java/vazkii/botania/client/render/block/RenderDoubleFlower.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Mar 22, 2015, 9:00:06 PM (GMT)] - */ -package vazkii.botania.client.render.block; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockDoublePlant; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import vazkii.botania.client.lib.LibRenderIDs; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderDoubleFlower implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { - // NO-OP - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int p_147774_2_, int p_147774_3_, int p_147774_4_, Block block, int modelId, RenderBlocks renderer) { - BlockDoublePlant p_147774_1_ = (BlockDoublePlant) block; - Tessellator tessellator = Tessellator.instance; - tessellator.setBrightness(p_147774_1_.getMixedBrightnessForBlock(world, p_147774_2_, p_147774_3_, p_147774_4_)); - tessellator.setColorOpaque_F(1F, 1F, 1F); - long j1 = p_147774_2_ * 3129871 ^ p_147774_4_ * 116129781L; - j1 = j1 * j1 * 42317861L + j1 * 11L; - int i1 = world.getBlockMetadata(p_147774_2_, p_147774_3_, p_147774_4_); - boolean flag1 = BlockDoublePlant.func_149887_c(i1); - if (flag1) - { - if (world.getBlock(p_147774_2_, p_147774_3_ - 1, p_147774_4_) != p_147774_1_) - { - return false; - } - - BlockDoublePlant.func_149890_d(world.getBlockMetadata(p_147774_2_, p_147774_3_ - 1, p_147774_4_)); - } - else - { - BlockDoublePlant.func_149890_d(i1); - } - - // Only change here, to use xyz rather than side/meta - IIcon icon = renderer.getBlockIcon(block, world, p_147774_2_, p_147774_3_, p_147774_4_, 0); - RenderSpecialFlower.drawCrossedSquares(world, block, icon, p_147774_2_, p_147774_3_, p_147774_4_, p_147774_2_, p_147774_3_, p_147774_4_, 1F, renderer); - return true; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return false; - } - - @Override - public int getRenderId() { - return LibRenderIDs.idDoubleFlower; - } - -} diff --git a/src/main/java/vazkii/botania/client/render/block/RenderFloatingFlower.java b/src/main/java/vazkii/botania/client/render/block/RenderFloatingFlower.java deleted file mode 100644 index 4c569ce74..000000000 --- a/src/main/java/vazkii/botania/client/render/block/RenderFloatingFlower.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jul 8, 2014, 11:05:38 PM (GMT)] - */ -package vazkii.botania.client.render.block; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.world.IBlockAccess; -import vazkii.botania.client.lib.LibRenderIDs; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderFloatingFlower implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { - // NO-OP, see RenderFloatingFlowerItem under ./item. - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return false; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } - - @Override - public int getRenderId() { - return LibRenderIDs.idMiniIsland; - } - -} diff --git a/src/main/java/vazkii/botania/client/render/block/RenderHourglass.java b/src/main/java/vazkii/botania/client/render/block/RenderHourglass.java deleted file mode 100644 index 5bb3d923c..000000000 --- a/src/main/java/vazkii/botania/client/render/block/RenderHourglass.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [May 30, 2015, 3:17:41 PM (GMT)] - */ -package vazkii.botania.client.render.block; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.world.IBlockAccess; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.common.block.tile.TileHourglass; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderHourglass implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - GL11.glPushMatrix(); - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - GL11.glDisable(GL11.GL_ALPHA_TEST); - TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileHourglass(), 0.0D, 0.0D, 0.0D, 0.0F); - GL11.glEnable(GL11.GL_ALPHA_TEST); - GL11.glPopMatrix(); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return false; - } - - @Override - public int getRenderId() { - return LibRenderIDs.idHourglass; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } - -} diff --git a/src/main/java/vazkii/botania/client/render/block/RenderIncensePlate.java b/src/main/java/vazkii/botania/client/render/block/RenderIncensePlate.java deleted file mode 100644 index d487e4fa2..000000000 --- a/src/main/java/vazkii/botania/client/render/block/RenderIncensePlate.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [May 15, 2015, 5:59:56 PM (GMT)] - */ -package vazkii.botania.client.render.block; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.world.IBlockAccess; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.common.block.tile.TileIncensePlate; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderIncensePlate implements ISimpleBlockRenderingHandler{ - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - GL11.glPushMatrix(); - GL11.glTranslatef(-0.5F, -0.1F, -0.5F); - GL11.glScalef(1.4F, 1.4F, 1.4F); - TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileIncensePlate(), 0.0D, 0.0D, 0.0D, 0.0F); - GL11.glPopMatrix(); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return false; - } - - @Override - public int getRenderId() { - return LibRenderIDs.idIncensePlate; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } - -} diff --git a/src/main/java/vazkii/botania/client/render/block/RenderPool.java b/src/main/java/vazkii/botania/client/render/block/RenderPool.java deleted file mode 100644 index 29cc7cb51..000000000 --- a/src/main/java/vazkii/botania/client/render/block/RenderPool.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 26, 2014, 12:25:06 AM (GMT)] - */ -package vazkii.botania.client.render.block; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.world.IBlockAccess; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.client.render.tile.RenderTilePool; -import vazkii.botania.common.block.tile.mana.TilePool; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderPool implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - GL11.glPushMatrix(); - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - RenderTilePool.forceMeta = metadata; - RenderTilePool.forceMana = RenderTilePool.forceMana | metadata == 1; - TileEntityRendererDispatcher.instance.renderTileEntityAt(new TilePool(), 0.0D, 0.0D, 0.0D, 0.0F); - GL11.glPopMatrix(); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return false; - } - - @Override - public int getRenderId() { - return LibRenderIDs.idPool; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } - -} diff --git a/src/main/java/vazkii/botania/client/render/block/RenderPump.java b/src/main/java/vazkii/botania/client/render/block/RenderPump.java deleted file mode 100644 index cbf99719f..000000000 --- a/src/main/java/vazkii/botania/client/render/block/RenderPump.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Mar 18, 2015, 4:42:08 PM (GMT)] - */ -package vazkii.botania.client.render.block; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.world.IBlockAccess; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.common.block.tile.mana.TilePump; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderPump implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { - GL11.glPushMatrix(); - GL11.glTranslatef(-0.5F, -0.25F, -0.5F); - TileEntityRendererDispatcher.instance.renderTileEntityAt(new TilePump(), 0.0D, 0.0D, 0.0D, 0.0F); - GL11.glPopMatrix(); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return false; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } - - @Override - public int getRenderId() { - return LibRenderIDs.idPump; - } - -} diff --git a/src/main/java/vazkii/botania/client/render/block/RenderPylon.java b/src/main/java/vazkii/botania/client/render/block/RenderPylon.java deleted file mode 100644 index aad8cfd19..000000000 --- a/src/main/java/vazkii/botania/client/render/block/RenderPylon.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Feb 18, 2014, 10:20:06 PM (GMT)] - */ -package vazkii.botania.client.render.block; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.world.IBlockAccess; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.client.render.tile.RenderTilePylon; -import vazkii.botania.common.block.tile.TilePylon; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderPylon implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - GL11.glPushMatrix(); - GL11.glTranslatef(-0.5F, -0.7F, -0.5F); - RenderTilePylon.green = metadata == 1; - RenderTilePylon.pink = metadata == 2; - TileEntityRendererDispatcher.instance.renderTileEntityAt(new TilePylon(), 0.0D, 0.0D, 0.0D, 0.0F); - GL11.glPopMatrix(); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return false; - } - - @Override - public int getRenderId() { - return LibRenderIDs.idPylon; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } - -} diff --git a/src/main/java/vazkii/botania/client/render/block/RenderSpawnerClaw.java b/src/main/java/vazkii/botania/client/render/block/RenderSpawnerClaw.java deleted file mode 100644 index 6c1e45513..000000000 --- a/src/main/java/vazkii/botania/client/render/block/RenderSpawnerClaw.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jul 23, 2014, 6:23:54 PM (GMT)] - */ -package vazkii.botania.client.render.block; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.world.IBlockAccess; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.common.block.tile.TileSpawnerClaw; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderSpawnerClaw implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { - GL11.glPushMatrix(); - GL11.glTranslatef(-0.5F, 0F, -0.5F); - TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileSpawnerClaw(), 0.0D, 0.0D, 0.0D, 0.0F); - GL11.glPopMatrix(); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return false; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } - - @Override - public int getRenderId() { - return LibRenderIDs.idSpawnerClaw; - } - -} diff --git a/src/main/java/vazkii/botania/client/render/block/RenderSpecialFlower.java b/src/main/java/vazkii/botania/client/render/block/RenderSpecialFlower.java deleted file mode 100644 index 6de45bc66..000000000 --- a/src/main/java/vazkii/botania/client/render/block/RenderSpecialFlower.java +++ /dev/null @@ -1,135 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 25, 2014, 4:15:46 PM (GMT)] - */ -package vazkii.botania.client.render.block; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.EntityRenderer; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import vazkii.botania.api.lexicon.multiblock.IMultiblockRenderHook; -import vazkii.botania.api.lexicon.multiblock.Multiblock; -import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderSpecialFlower implements ISimpleBlockRenderingHandler, IMultiblockRenderHook { - - int id; - - public RenderSpecialFlower(int id) { - this.id = id; - } - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - // NO-OP - } - - @Override - public boolean renderWorldBlock(IBlockAccess blockAccess, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return renderCrossedSquares(blockAccess, block, x, y, z, renderer); - } - - // Copied from RenderBlocks - public static boolean renderCrossedSquares(IBlockAccess blockAccess, Block par1Block, int par2, int par3, int par4, RenderBlocks render) { - Tessellator tessellator = Tessellator.instance; - tessellator.setBrightness(par1Block.getMixedBrightnessForBlock(blockAccess, par2, par3, par4)); - float f = 1.0F; - int l = par1Block.colorMultiplier(blockAccess, par2, par3, par4); - float f1 = (l >> 16 & 255) / 255.0F; - float f2 = (l >> 8 & 255) / 255.0F; - float f3 = (l & 255) / 255.0F; - - if(EntityRenderer.anaglyphEnable) { - float f4 = (f1 * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F; - float f5 = (f1 * 30.0F + f2 * 70.0F) / 100.0F; - float f6 = (f1 * 30.0F + f3 * 70.0F) / 100.0F; - f1 = f4; - f2 = f5; - f3 = f6; - } - - tessellator.setColorOpaque_F(f * f1, f * f2, f * f3); - double d1 = par2; - double d2 = par3; - double d0 = par4; - long sh; - - sh = par2 * 3129871 ^ par4 * 116129781L ^ par3; - sh = sh * sh * 42317861L + sh * 11L; - d1 += ((sh >> 16 & 15L) / 15.0F - 0.5D) * 0.3D; - d2 += (sh >> 32 & 15L) / 15.0F * -0.15D; - d0 += ((sh >> 24 & 15L) / 15.0F - 0.5D) * 0.3D; - - - // Only change here, to use xyz rather than side/meta - IIcon icon = render.getBlockIcon(par1Block, blockAccess, par2, par3, par4, 0); - drawCrossedSquares(blockAccess, par1Block, icon, par2, par3, par4, d1, d2, d0, 1.0F, render); - - return true; - } - - // Copied from RenderBlocks - public static void drawCrossedSquares(IBlockAccess blockAccess, Block par1Block, IIcon icon, int x, int y, int z, double par3, double par5, double par7, float par9, RenderBlocks render) { - Tessellator tessellator = Tessellator.instance; - - double d3 = icon.getMinU(); - double d4 = icon.getMinV(); - double d5 = icon.getMaxU(); - double d6 = icon.getMaxV(); - double d7 = 0.45D * par9; - double d8 = par3 + 0.5D - d7; - double d9 = par3 + 0.5D + d7; - double d10 = par7 + 0.5D - d7; - double d11 = par7 + 0.5D + d7; - tessellator.addVertexWithUV(d8, par5 + par9, d10, d3, d4); - tessellator.addVertexWithUV(d8, par5 + 0.0D, d10, d3, d6); - tessellator.addVertexWithUV(d9, par5 + 0.0D, d11, d5, d6); - tessellator.addVertexWithUV(d9, par5 + par9, d11, d5, d4); - tessellator.addVertexWithUV(d9, par5 + par9, d11, d3, d4); - tessellator.addVertexWithUV(d9, par5 + 0.0D, d11, d3, d6); - tessellator.addVertexWithUV(d8, par5 + 0.0D, d10, d5, d6); - tessellator.addVertexWithUV(d8, par5 + par9, d10, d5, d4); - tessellator.addVertexWithUV(d8, par5 + par9, d11, d3, d4); - tessellator.addVertexWithUV(d8, par5 + 0.0D, d11, d3, d6); - tessellator.addVertexWithUV(d9, par5 + 0.0D, d10, d5, d6); - tessellator.addVertexWithUV(d9, par5 + par9, d10, d5, d4); - tessellator.addVertexWithUV(d9, par5 + par9, d10, d3, d4); - tessellator.addVertexWithUV(d9, par5 + 0.0D, d10, d3, d6); - tessellator.addVertexWithUV(d8, par5 + 0.0D, d11, d5, d6); - tessellator.addVertexWithUV(d8, par5 + par9, d11, d5, d4); - } - - @Override - public int getRenderId() { - return id; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return false; - } - - @Override - public void renderBlockForMultiblock(IBlockAccess world, Multiblock mb, Block block, int meta, RenderBlocks renderBlocks, MultiblockComponent comp, float alpha) { - Tessellator tess = Tessellator.instance; - tess.startDrawingQuads(); - drawCrossedSquares(world, block, block.getIcon(0, meta), 0, 0, 0, -0.5, -0.5, -0.5, 1F, renderBlocks); - tess.draw(); - } - - @Override - public boolean needsTranslate(Block block) { - return true; - } - -} diff --git a/src/main/java/vazkii/botania/client/render/block/RenderSpreader.java b/src/main/java/vazkii/botania/client/render/block/RenderSpreader.java deleted file mode 100644 index 946dfdb6c..000000000 --- a/src/main/java/vazkii/botania/client/render/block/RenderSpreader.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 25, 2014, 9:45:58 PM (GMT)] - */ -package vazkii.botania.client.render.block; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.world.IBlockAccess; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.common.block.tile.mana.TileSpreader; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderSpreader implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - GL11.glPushMatrix(); - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - TileSpreader.staticRedstone = metadata == 1; - TileSpreader.staticDreamwood = metadata == 2 || metadata == 3; - TileSpreader.staticUltra = metadata == 3; - - TileSpreader spreader = new TileSpreader(); - spreader.rotationX = -180F; - TileEntityRendererDispatcher.instance.renderTileEntityAt(spreader, 0.0D, 0.0D, 0.0D, 0.0F); - GL11.glPopMatrix(); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return false; - } - - @Override - public int getRenderId() { - return LibRenderIDs.idSpreader; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } - -} diff --git a/src/main/java/vazkii/botania/client/render/block/RenderTeruTeruBozu.java b/src/main/java/vazkii/botania/client/render/block/RenderTeruTeruBozu.java deleted file mode 100644 index d12f99eaa..000000000 --- a/src/main/java/vazkii/botania/client/render/block/RenderTeruTeruBozu.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Oct 1, 2015, 9:40:27 PM (GMT)] - */ -package vazkii.botania.client.render.block; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.world.IBlockAccess; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.common.block.tile.TileTeruTeruBozu; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderTeruTeruBozu implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - GL11.glPushMatrix(); - GL11.glTranslatef(-0.5F, -0.3F, -0.5F); - TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileTeruTeruBozu(), 0.0D, 0.0D, 0.0D, 0.0F); - GL11.glPopMatrix(); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return false; - } - - @Override - public int getRenderId() { - return LibRenderIDs.idTeruTeruBozu; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } - -} diff --git a/src/main/java/vazkii/botania/client/render/block/RenderTinyPotato.java b/src/main/java/vazkii/botania/client/render/block/RenderTinyPotato.java deleted file mode 100644 index 2ba503369..000000000 --- a/src/main/java/vazkii/botania/client/render/block/RenderTinyPotato.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jul 18, 2014, 11:43:37 PM (GMT)] - */ -package vazkii.botania.client.render.block; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.world.IBlockAccess; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.common.block.tile.TileTinyPotato; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderTinyPotato implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { - GL11.glPushMatrix(); - GL11.glTranslatef(-0.5F, 0F, -0.5F); - TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileTinyPotato(), 0.0D, 0.0D, 0.0D, 0.0F); - GL11.glPopMatrix(); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - return false; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } - - @Override - public int getRenderId() { - return LibRenderIDs.idTinyPotato; - } - -} diff --git a/src/main/java/vazkii/botania/client/render/entity/LayerGaiaHead.java b/src/main/java/vazkii/botania/client/render/entity/LayerGaiaHead.java new file mode 100644 index 000000000..8db3e0532 --- /dev/null +++ b/src/main/java/vazkii/botania/client/render/entity/LayerGaiaHead.java @@ -0,0 +1,102 @@ +package vazkii.botania.client.render.entity; + +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.entity.layers.LayerRenderer; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.EntityEquipmentSlot; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumFacing; +import vazkii.botania.client.core.helper.ShaderHelper; +import vazkii.botania.client.render.tile.RenderTileGaiaHead; +import vazkii.botania.common.block.tile.TileGaiaHead; +import vazkii.botania.common.item.ModItems; + +import javax.annotation.Nonnull; + +public class LayerGaiaHead implements LayerRenderer { + + private final ModelRenderer modelRenderer; + + public LayerGaiaHead(ModelRenderer modelRenderer) + { + this.modelRenderer = modelRenderer; + } + + // Copied from LayerCustomHead, edits noted + @Override + public void doRenderLayer(@Nonnull EntityPlayer player, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) { + ItemStack itemstack = player.getItemStackFromSlot(EntityEquipmentSlot.HEAD); + + if (itemstack != null && itemstack.getItem() == ModItems.gaiaHead) // Botania - check for head + { + GlStateManager.pushMatrix(); + + if (player.isSneaking()) + { + GlStateManager.translate(0.0F, 0.2F, 0.0F); + } + + /*boolean flag = player instanceof EntityVillager || player instanceof EntityZombie && ((EntityZombie)player).isVillager(); + + if (player.isChild() && !(player instanceof EntityVillager)) + { + float f = 2.0F; + float f1 = 1.4F; + GlStateManager.translate(0.0F, 0.5F * scale, 0.0F); + GlStateManager.scale(f1 / f, f1 / f, f1 / f); + GlStateManager.translate(0.0F, 16.0F * scale, 0.0F); + } Botania - N/A */ + + this.modelRenderer.postRender(0.0625F); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + + float f2 = 1.1875F; + GlStateManager.scale(f2, -f2, -f2); + + // Botania - remove if check for skull and else branch. Check done above. + + /*if (flag) + { + GlStateManager.translate(0.0F, 0.0625F, 0.0F); + } Botania - N/A */ + + /*GameProfile gameprofile = null; + + if (itemstack.hasTagCompound()) + { + NBTTagCompound nbttagcompound = itemstack.getTagCompound(); + + if (nbttagcompound.hasKey("SkullOwner", 10)) + { + gameprofile = NBTUtil.readGameProfileFromNBT(nbttagcompound.getCompoundTag("SkullOwner")); + } + else if (nbttagcompound.hasKey("SkullOwner", 8)) + { + String s = nbttagcompound.getString("SkullOwner"); + + if (!StringUtils.isNullOrEmpty(s)) + { + gameprofile = TileEntitySkull.updateGameprofile(new GameProfile((UUID)null, s)); + nbttagcompound.setTag("SkullOwner", NBTUtil.writeGameProfile(new NBTTagCompound(), gameprofile)); + } + } + } Botania - Don't do skin stuff */ + + // Botania - use gaia TESR + ShaderHelper.useShader(ShaderHelper.doppleganger, RenderDoppleganger.defaultCallback); + ((RenderTileGaiaHead) (TileEntitySpecialRenderer) TileEntityRendererDispatcher.instance.getSpecialRendererByClass(TileGaiaHead.class)) + .renderSkull(-0.5F, 0.0F, -0.5F, EnumFacing.UP, 180.0F, itemstack.getMetadata(), null, -1, limbSwing); + ShaderHelper.releaseShader(); + + GlStateManager.popMatrix(); + } + } + + @Override + public boolean shouldCombineTextures() { + return false; + } +} diff --git a/src/main/java/vazkii/botania/client/render/entity/RenderBabylonWeapon.java b/src/main/java/vazkii/botania/client/render/entity/RenderBabylonWeapon.java index 0fc4712ed..801d3e138 100644 --- a/src/main/java/vazkii/botania/client/render/entity/RenderBabylonWeapon.java +++ b/src/main/java/vazkii/botania/client/render/entity/RenderBabylonWeapon.java @@ -10,100 +10,105 @@ */ package vazkii.botania.client.render.entity; -import java.util.Random; - import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.entity.Entity; -import net.minecraft.util.IIcon; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.util.ResourceLocation; - import org.lwjgl.opengl.GL11; - +import vazkii.botania.client.core.handler.MiscellaneousIcons; +import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.client.core.helper.ShaderHelper; import vazkii.botania.client.lib.LibResources; import vazkii.botania.common.entity.EntityBabylonWeapon; -import vazkii.botania.common.item.relic.ItemKingKey; -public class RenderBabylonWeapon extends Render { +import javax.annotation.Nonnull; +import java.util.Random; + +public class RenderBabylonWeapon extends Render { private static final ResourceLocation babylon = new ResourceLocation(LibResources.MISC_BABYLON); + public RenderBabylonWeapon(RenderManager renderManager) { + super(renderManager); + } + @Override - public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) { - EntityBabylonWeapon weapon = (EntityBabylonWeapon) par1Entity; - GL11.glPushMatrix(); - GL11.glTranslatef((float)par2, (float)par4, (float)par6); - GL11.glRotatef(weapon.getRotation(), 0F, 1F, 0F); + public void doRender(@Nonnull EntityBabylonWeapon weapon, double par2, double par4, double par6, float par8, float par9) { + GlStateManager.pushMatrix(); + GlStateManager.translate((float)par2, (float)par4, (float)par6); + GlStateManager.rotate(weapon.getRotation(), 0F, 1F, 0F); int live = weapon.getLiveTicks(); int delay = weapon.getDelay(); float charge = Math.min(10F, Math.max(live, weapon.getChargeTicks()) + par9); float chargeMul = charge / 10F; - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); - GL11.glPushMatrix(); + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + GlStateManager.pushMatrix(); float s = 1.5F; - GL11.glScalef(s, s, s); - GL11.glRotatef(-90F, 0F, 1F, 0F); - GL11.glRotatef(45F, 0F, 0F, 1F); - IIcon icon = ItemKingKey.weaponIcons[weapon.getVariety()]; - GL11.glColor4f(1F, 1F, 1F, chargeMul); + GlStateManager.scale(s, s, s); + GlStateManager.rotate(-90F, 0F, 1F, 0F); + GlStateManager.rotate(45F, 0F, 0F, 1F); + TextureAtlasSprite icon = MiscellaneousIcons.INSTANCE.kingKeyWeaponIcons[weapon.getVariety()]; + GlStateManager.color(1F, 1F, 1F, chargeMul); float f = icon.getMinU(); float f1 = icon.getMaxU(); float f2 = icon.getMinV(); float f3 = icon.getMaxV(); OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240, 240); - GL11.glDisable(GL11.GL_LIGHTING); - ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F); - GL11.glPopMatrix(); + GlStateManager.disableLighting(); + IconHelper.renderIconIn3D(Tessellator.getInstance(), f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F); + GlStateManager.popMatrix(); - GL11.glDisable(GL11.GL_CULL_FACE); - GL11.glShadeModel(GL11.GL_SMOOTH); - GL11.glColor4f(1F, 1F, 1F, chargeMul); + GlStateManager.disableCull(); + GlStateManager.shadeModel(GL11.GL_SMOOTH); + GlStateManager.color(1F, 1F, 1F, chargeMul); Minecraft.getMinecraft().renderEngine.bindTexture(babylon); - Tessellator tes = Tessellator.instance; + Tessellator tes = Tessellator.getInstance(); ShaderHelper.useShader(ShaderHelper.halo); Random rand = new Random(weapon.getUniqueID().getMostSignificantBits()); - GL11.glRotatef(-90F, 1F, 0F, 0F); - GL11.glTranslatef(0F, -0.3F + rand.nextFloat() * 0.1F, 1F); + GlStateManager.rotate(-90F, 1F, 0F, 0F); + GlStateManager.translate(0F, -0.3F + rand.nextFloat() * 0.1F, 1F); s = chargeMul; if(live > delay) s -= Math.min(1F, (live - delay + par9) * 0.2F); s *= 2F; - GL11.glScalef(s, s, s); + GlStateManager.scale(s, s, s); - GL11.glRotatef(charge * 9F + (weapon.ticksExisted + par9) * 0.5F + rand.nextFloat() * 360F, 0F, 1F, 0F); + GlStateManager.rotate(charge * 9F + (weapon.ticksExisted + par9) * 0.5F + rand.nextFloat() * 360F, 0F, 1F, 0F); - tes.startDrawingQuads(); - tes.addVertexWithUV(-1, 0, -1, 0, 0); - tes.addVertexWithUV(-1, 0, 1, 0, 1); - tes.addVertexWithUV(1, 0, 1, 1, 1); - tes.addVertexWithUV(1, 0, -1, 1, 0); + tes.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); + tes.getBuffer().pos(-1, 0, -1).tex(0, 0).endVertex(); + tes.getBuffer().pos(-1, 0, 1).tex(0, 1).endVertex(); + tes.getBuffer().pos(1, 0, 1).tex(1, 1).endVertex(); + tes.getBuffer().pos(1, 0, -1).tex(1, 0).endVertex(); tes.draw(); ShaderHelper.releaseShader(); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glShadeModel(GL11.GL_FLAT); - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glPopMatrix(); + GlStateManager.enableLighting(); + GlStateManager.shadeModel(GL11.GL_FLAT); + GlStateManager.enableCull(); + GlStateManager.popMatrix(); } + @Nonnull @Override - protected ResourceLocation getEntityTexture(Entity p_110775_1_) { - return null; + protected ResourceLocation getEntityTexture(@Nonnull EntityBabylonWeapon entity) { + return TextureMap.LOCATION_BLOCKS_TEXTURE; } } diff --git a/src/main/java/vazkii/botania/client/render/entity/RenderCorporeaSpark.java b/src/main/java/vazkii/botania/client/render/entity/RenderCorporeaSpark.java index 5dc731a27..a307f797a 100644 --- a/src/main/java/vazkii/botania/client/render/entity/RenderCorporeaSpark.java +++ b/src/main/java/vazkii/botania/client/render/entity/RenderCorporeaSpark.java @@ -10,39 +10,47 @@ */ package vazkii.botania.client.render.entity; -import net.minecraft.block.Block; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.entity.passive.EntitySheep; import net.minecraft.item.Item; -import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraftforge.common.util.ForgeDirection; - +import net.minecraft.network.datasync.DataParameter; import org.lwjgl.opengl.GL11; - +import vazkii.botania.client.core.handler.MiscellaneousIcons; +import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.common.entity.EntityCorporeaSpark; -import vazkii.botania.common.item.ItemCorporeaSpark; public class RenderCorporeaSpark extends RenderSparkBase { + public RenderCorporeaSpark(RenderManager manager) { + super(manager); + } + + protected DataParameter getInvisibilityParam() { + return EntityCorporeaSpark.INVISIBILITY; + } + @Override - public IIcon getBaseIcon(EntityCorporeaSpark entity) { - return entity.isMaster() ? ItemCorporeaSpark.worldIconMaster : ItemCorporeaSpark.worldIcon; + public TextureAtlasSprite getBaseIcon(EntityCorporeaSpark entity) { + return entity.isMaster() ? MiscellaneousIcons.INSTANCE.corporeaWorldIconMaster : MiscellaneousIcons.INSTANCE.corporeaWorldIcon; } @Override public void colorSpinningIcon(EntityCorporeaSpark entity, float a) { - int network = Math.min(15, entity.getNetwork()); - GL11.glColor4f(EntitySheep.fleeceColorTable[network][0], EntitySheep.fleeceColorTable[network][1], EntitySheep.fleeceColorTable[network][2], a); + int hex = entity.getNetwork().getMapColor().colorValue; + int r = (hex & 0xFF0000) >> 16; + int g = (hex & 0xFF00) >> 8; + int b = (hex & 0xFF); + GlStateManager.color(r / 255F, g / 255F, b / 255F, a); } @Override - public IIcon getSpinningIcon(EntityCorporeaSpark entity) { - return ItemCorporeaSpark.iconColorStar; + public TextureAtlasSprite getSpinningIcon(EntityCorporeaSpark entity) { + return MiscellaneousIcons.INSTANCE.corporeaIconStar; } @Override @@ -53,23 +61,21 @@ public class RenderCorporeaSpark extends RenderSparkBase { float absTime = Math.abs(time) - pticks; - GL11.glPushMatrix(); - GL11.glRotated(90F, 1F, 0F, 0F); - float scalef = 1F / 6F; - GL11.glScalef(scalef, scalef, scalef); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1F, 1F, 1F, absTime / 10); - GL11.glTranslatef(0F, 0F, -2F + (time < 0 ? -absTime : absTime) / 6); - - ItemStack stack = entity.getDisplayedItem(); + ItemStack stack = entity.getDisplayedItem().orNull(); if(stack == null) return; - Item item = stack.getItem(); - boolean block = item instanceof ItemBlock; - Minecraft.getMinecraft().renderEngine.bindTexture(block ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture); - IIcon icon = block ? Block.getBlockFromItem(item).getBlockTextureFromSide(ForgeDirection.UP.ordinal()) : item.getIcon(stack, 0); + GlStateManager.pushMatrix(); + GlStateManager.rotate(90F, 1F, 0F, 0F); + float scalef = 1F / 6F; + GlStateManager.scale(scalef, scalef, scalef); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.color(1F, 1F, 1F, absTime / 10); + GlStateManager.translate(0F, 0F, -2F + (time < 0 ? -absTime : absTime) / 6); + + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + TextureAtlasSprite icon = Minecraft.getMinecraft().getRenderItem().getItemModelWithOverrides(stack, entity.worldObj, null).getParticleTexture(); if(icon != null) { float minU = icon.getMinU(); @@ -84,20 +90,20 @@ public class RenderCorporeaSpark extends RenderSparkBase { int shift = pieces / 2; float scale = 1F / pieces * 3F; - GL11.glScalef(scale, scale, 1F); + GlStateManager.scale(scale, scale, 1F); for(int i = -shift; i < shift; i++) { - GL11.glTranslated(gap * i, 0F, 0F); + GlStateManager.translate(gap * i, 0F, 0F); for(int j = -shift; j < shift; j++) { - GL11.glTranslated(0F, gap * j, 0F); - ItemRenderer.renderItemIn2D(Tessellator.instance, minU + stepU * (i + shift), minV + stepV * (j + shift + 1), minU + stepU * (i + shift + 1), minV + stepV * (j + shift), icon.getIconWidth() / pieces, icon.getIconHeight() / pieces, 1F / 8F); - GL11.glTranslated(0F, -gap * j, 0F); + GlStateManager.translate(0F, gap * j, 0F); + IconHelper.renderIconIn3D(Tessellator.getInstance(), minU + stepU * (i + shift), minV + stepV * (j + shift + 1), minU + stepU * (i + shift + 1), minV + stepV * (j + shift), icon.getIconWidth() / pieces, icon.getIconHeight() / pieces, 1F / 8F); + GlStateManager.translate(0F, -gap * j, 0F); } - GL11.glTranslated(-gap * i, 0F, 0F); + GlStateManager.translate(-gap * i, 0F, 0F); } } - GL11.glDisable(GL11.GL_BLEND); - GL11.glPopMatrix(); + GlStateManager.disableBlend(); + GlStateManager.popMatrix(); } } diff --git a/src/main/java/vazkii/botania/client/render/entity/RenderDoppleganger.java b/src/main/java/vazkii/botania/client/render/entity/RenderDoppleganger.java index 3b8c124ba..551c0a10e 100644 --- a/src/main/java/vazkii/botania/client/render/entity/RenderDoppleganger.java +++ b/src/main/java/vazkii/botania/client/render/entity/RenderDoppleganger.java @@ -10,64 +10,57 @@ */ package vazkii.botania.client.render.entity; +import com.mojang.authlib.minecraft.MinecraftProfileTexture; import net.minecraft.client.Minecraft; -import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.model.ModelPlayer; import net.minecraft.client.renderer.entity.RenderBiped; -import net.minecraft.entity.Entity; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.resources.DefaultPlayerSkin; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.ResourceLocation; - import org.lwjgl.opengl.ARBShaderObjects; - import vazkii.botania.api.internal.ShaderCallback; -import vazkii.botania.client.core.handler.BossBarHandler; import vazkii.botania.client.core.helper.ShaderHelper; import vazkii.botania.common.entity.EntityDoppleganger; -public class RenderDoppleganger extends RenderBiped { +import javax.annotation.Nonnull; +import java.util.Map; +import java.util.UUID; - public static float DEFAULT_GRAIN_INTENSITY = 0.05F; - public static float DEFAULT_DISFIGURATION = 0.025F; +public class RenderDoppleganger extends RenderBiped { + + public static final float DEFAULT_GRAIN_INTENSITY = 0.05F; + public static final float DEFAULT_DISFIGURATION = 0.025F; public static float grainIntensity = DEFAULT_GRAIN_INTENSITY; public static float disfiguration = DEFAULT_DISFIGURATION; - public static ShaderCallback callback = new ShaderCallback() { + public static final ShaderCallback callback = shader -> { + // Frag Uniforms + int disfigurationUniform = ARBShaderObjects.glGetUniformLocationARB(shader, "disfiguration"); + ARBShaderObjects.glUniform1fARB(disfigurationUniform, disfiguration); - @Override - public void call(int shader) { - // Frag Uniforms - int disfigurationUniform = ARBShaderObjects.glGetUniformLocationARB(shader, "disfiguration"); - ARBShaderObjects.glUniform1fARB(disfigurationUniform, disfiguration); + // Vert Uniforms + int grainIntensityUniform = ARBShaderObjects.glGetUniformLocationARB(shader, "grainIntensity"); + ARBShaderObjects.glUniform1fARB(grainIntensityUniform, grainIntensity); + }; - // Vert Uniforms - int grainIntensityUniform = ARBShaderObjects.glGetUniformLocationARB(shader, "grainIntensity"); - ARBShaderObjects.glUniform1fARB(grainIntensityUniform, grainIntensity); - } - }; + public static final ShaderCallback defaultCallback = shader -> { + // Frag Uniforms + int disfigurationUniform = ARBShaderObjects.glGetUniformLocationARB(shader, "disfiguration"); + ARBShaderObjects.glUniform1fARB(disfigurationUniform, DEFAULT_DISFIGURATION); - public static ShaderCallback defaultCallback = new ShaderCallback() { + // Vert Uniforms + int grainIntensityUniform = ARBShaderObjects.glGetUniformLocationARB(shader, "grainIntensity"); + ARBShaderObjects.glUniform1fARB(grainIntensityUniform, DEFAULT_GRAIN_INTENSITY); + }; - @Override - public void call(int shader) { - // Frag Uniforms - int disfigurationUniform = ARBShaderObjects.glGetUniformLocationARB(shader, "disfiguration"); - ARBShaderObjects.glUniform1fARB(disfigurationUniform, DEFAULT_DISFIGURATION); - - // Vert Uniforms - int grainIntensityUniform = ARBShaderObjects.glGetUniformLocationARB(shader, "grainIntensity"); - ARBShaderObjects.glUniform1fARB(grainIntensityUniform, DEFAULT_GRAIN_INTENSITY); - } - }; - - public RenderDoppleganger() { - super(new ModelBiped(0.5F), 0F); + public RenderDoppleganger(RenderManager renderManager) { + super(renderManager, new ModelPlayer(0.0F, false), 0F); } @Override - public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) { - EntityDoppleganger dopple = (EntityDoppleganger) par1Entity; - BossBarHandler.setCurrentBoss(dopple); - + public void doRender(@Nonnull EntityDoppleganger dopple, double par2, double par4, double par6, float par8, float par9) { int invulTime = dopple.getInvulTime(); if(invulTime > 0) { grainIntensity = invulTime > 20 ? 1F : invulTime * 0.05F; @@ -78,13 +71,32 @@ public class RenderDoppleganger extends RenderBiped { } ShaderHelper.useShader(ShaderHelper.doppleganger, callback); - super.doRender(par1Entity, par2, par4, par6, par8, par9); + super.doRender(dopple, par2, par4, par6, par8, par9); ShaderHelper.releaseShader(); } + @Nonnull @Override - protected ResourceLocation getEntityTexture(Entity par1Entity) { - return Minecraft.getMinecraft().thePlayer.getLocationSkin(); + protected ResourceLocation getEntityTexture(@Nonnull EntityDoppleganger par1Entity) { + Minecraft mc = Minecraft.getMinecraft(); + + if(!(mc.getRenderViewEntity() instanceof EntityPlayer)) + return DefaultPlayerSkin.getDefaultSkinLegacy(); + + EntityPlayer view = (EntityPlayer) mc.getRenderViewEntity(); + + // Adapated from TileEntitySkullRenderer.renderTileEntityAt + Map map = mc.getSkinManager().loadSkinFromCache(view.getGameProfile()); + + if (map.containsKey(MinecraftProfileTexture.Type.SKIN)) + { + return mc.getSkinManager().loadSkin(map.get(MinecraftProfileTexture.Type.SKIN), MinecraftProfileTexture.Type.SKIN); + } + else + { + UUID uuid = EntityPlayer.getUUID(view.getGameProfile()); + return DefaultPlayerSkin.getDefaultSkin(uuid); + } } } diff --git a/src/main/java/vazkii/botania/client/render/entity/RenderManaStorm.java b/src/main/java/vazkii/botania/client/render/entity/RenderManaStorm.java index f0f568af4..cfa912b81 100644 --- a/src/main/java/vazkii/botania/client/render/entity/RenderManaStorm.java +++ b/src/main/java/vazkii/botania/client/render/entity/RenderManaStorm.java @@ -10,34 +10,38 @@ */ package vazkii.botania.client.render.entity; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.entity.Render; -import net.minecraft.entity.Entity; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - import vazkii.botania.client.core.helper.RenderHelper; import vazkii.botania.common.entity.EntityManaStorm; -public class RenderManaStorm extends Render { +import javax.annotation.Nonnull; - @Override - public void doRender(Entity e, double x, double y, double z, float something, float pticks) { - GL11.glPushMatrix(); - GL11.glTranslated(x, y, z); - EntityManaStorm storm = (EntityManaStorm) e; - float maxScale = 1.95F; - float scale = 0.05F + ((float) storm.burstsFired / EntityManaStorm.TOTAL_BURSTS - (storm.deathTime == 0 ? 0 : storm.deathTime + pticks) / EntityManaStorm.DEATH_TIME) * maxScale; - RenderHelper.renderStar(0x00FF00, scale, scale, scale, e.getUniqueID().getMostSignificantBits()); - GL11.glDisable(GL11.GL_BLEND); - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - GL11.glPopMatrix(); +public class RenderManaStorm extends Render { + + public RenderManaStorm(RenderManager renderManager) { + super(renderManager); } @Override - protected ResourceLocation getEntityTexture(Entity p_110775_1_) { - return null; + public void doRender(@Nonnull EntityManaStorm storm, double x, double y, double z, float something, float pticks) { + GlStateManager.pushMatrix(); + GlStateManager.translate(x, y, z); + float maxScale = 1.95F; + float scale = 0.05F + ((float) storm.burstsFired / EntityManaStorm.TOTAL_BURSTS - (storm.deathTime == 0 ? 0 : storm.deathTime + pticks) / EntityManaStorm.DEATH_TIME) * maxScale; + RenderHelper.renderStar(0x00FF00, scale, scale, scale, storm.getUniqueID().getMostSignificantBits()); + GlStateManager.disableBlend(); + GlStateManager.disableRescaleNormal(); + GlStateManager.popMatrix(); + } + + @Nonnull + @Override + protected ResourceLocation getEntityTexture(@Nonnull EntityManaStorm entity) { + return TextureMap.LOCATION_BLOCKS_TEXTURE; } } diff --git a/src/main/java/vazkii/botania/client/render/entity/RenderPinkWither.java b/src/main/java/vazkii/botania/client/render/entity/RenderPinkWither.java index a6806ca39..b98cdf83e 100644 --- a/src/main/java/vazkii/botania/client/render/entity/RenderPinkWither.java +++ b/src/main/java/vazkii/botania/client/render/entity/RenderPinkWither.java @@ -10,29 +10,25 @@ */ package vazkii.botania.client.render.entity; +import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.RenderWither; -import net.minecraft.entity.boss.BossStatus; import net.minecraft.entity.boss.EntityWither; import net.minecraft.util.ResourceLocation; import vazkii.botania.client.lib.LibResources; +import javax.annotation.Nonnull; + public class RenderPinkWither extends RenderWither { private static final ResourceLocation resource = new ResourceLocation(LibResources.MODEL_PINK_WITHER); - int idk = -1; - - @Override - public void doRender(EntityWither p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) { - super.doRender(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); - if(BossStatus.bossName.equals(p_76986_1_.func_145748_c_().getFormattedText())) { - BossStatus.statusBarTime = -1; - BossStatus.hasColorModifier = false; - } + public RenderPinkWither(RenderManager manager) { + super(manager); } + @Nonnull @Override - protected ResourceLocation getEntityTexture(EntityWither p_110775_1_) { + protected ResourceLocation getEntityTexture(EntityWither entity) { return resource; } diff --git a/src/main/java/vazkii/botania/client/render/entity/RenderPixie.java b/src/main/java/vazkii/botania/client/render/entity/RenderPixie.java index 4ef275754..6e994257a 100644 --- a/src/main/java/vazkii/botania/client/render/entity/RenderPixie.java +++ b/src/main/java/vazkii/botania/client/render/entity/RenderPixie.java @@ -10,55 +10,50 @@ */ package vazkii.botania.client.render.entity; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.entity.RenderLiving; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; +import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.util.ResourceLocation; - import org.lwjgl.opengl.ARBShaderObjects; import org.lwjgl.opengl.GL11; - import vazkii.botania.api.internal.ShaderCallback; import vazkii.botania.client.core.helper.ShaderHelper; import vazkii.botania.client.lib.LibResources; import vazkii.botania.client.model.ModelPixie; import vazkii.botania.common.entity.EntityPixie; -public class RenderPixie extends RenderLiving { +import javax.annotation.Nonnull; - ShaderCallback callback = new ShaderCallback() { +public class RenderPixie extends RenderLiving { - @Override - public void call(int shader) { - // Frag Uniforms - int disfigurationUniform = ARBShaderObjects.glGetUniformLocationARB(shader, "disfiguration"); - ARBShaderObjects.glUniform1fARB(disfigurationUniform, 0.025F); + final ShaderCallback callback = shader -> { + // Frag Uniforms + int disfigurationUniform = ARBShaderObjects.glGetUniformLocationARB(shader, "disfiguration"); + ARBShaderObjects.glUniform1fARB(disfigurationUniform, 0.025F); - // Vert Uniforms - int grainIntensityUniform = ARBShaderObjects.glGetUniformLocationARB(shader, "grainIntensity"); - ARBShaderObjects.glUniform1fARB(grainIntensityUniform, 0.05F); - } - }; + // Vert Uniforms + int grainIntensityUniform = ARBShaderObjects.glGetUniformLocationARB(shader, "grainIntensity"); + ARBShaderObjects.glUniform1fARB(grainIntensityUniform, 0.05F); + }; - public RenderPixie() { - super(new ModelPixie(), 0.25F); - setRenderPassModel(new ModelPixie()); + public RenderPixie(RenderManager renderManager) { + super(renderManager, new ModelPixie(), 0.25F); + //setRenderPassModel(new ModelPixie()); shadowSize = 0.0F; } + @Nonnull @Override - protected ResourceLocation getEntityTexture(Entity entity) { + protected ResourceLocation getEntityTexture(@Nonnull EntityPixie entity) { return new ResourceLocation(LibResources.MODEL_PIXIE); } @Override - public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) { - EntityPixie pixie = (EntityPixie) par1Entity; - + public void doRender(@Nonnull EntityPixie pixie, double par2, double par4, double par6, float par8, float par9) { if(pixie.getType() == 1) ShaderHelper.useShader(ShaderHelper.doppleganger, callback); - super.doRender(par1Entity, par2, par4, par6, par8, par9); + super.doRender(pixie, par2, par4, par6, par8, par9); if(pixie.getType() == 1) ShaderHelper.releaseShader(); } @@ -69,27 +64,27 @@ public class RenderPixie extends RenderLiving { else { bindTexture(getEntityTexture(par1EntityPixie)); float f1 = 1.0F; - GL11.glEnable(GL11.GL_BLEND); - GL11.glDisable(GL11.GL_ALPHA_TEST); - GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); + GlStateManager.enableBlend(); + GlStateManager.disableAlpha(); + GlStateManager.blendFunc(GL11.GL_ONE, GL11.GL_ONE); if (par1EntityPixie.isInvisible()) - GL11.glDepthMask(false); + GlStateManager.depthMask(false); else - GL11.glDepthMask(true); + GlStateManager.depthMask(true); char c0 = 61680; int j = c0 % 65536; int k = c0 / 65536; OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, j / 1.0F, k / 1.0F); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glColor4f(1.0F, 1.0F, 1.0F, f1); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.color(1.0F, 1.0F, 1.0F, f1); return 1; } } - @Override + /*@Override protected int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) { return setPixieBrightness((EntityPixie)par1EntityLivingBase, par2, par3); - } + }*/ } \ No newline at end of file diff --git a/src/main/java/vazkii/botania/client/render/entity/RenderPoolMinecart.java b/src/main/java/vazkii/botania/client/render/entity/RenderPoolMinecart.java index b9a043881..230086138 100644 --- a/src/main/java/vazkii/botania/client/render/entity/RenderPoolMinecart.java +++ b/src/main/java/vazkii/botania/client/render/entity/RenderPoolMinecart.java @@ -10,19 +10,29 @@ */ package vazkii.botania.client.render.entity; -import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.RenderMinecart; -import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; +import vazkii.botania.api.state.enums.PoolVariant; +import vazkii.botania.client.core.handler.ClientTickHandler; import vazkii.botania.client.render.tile.RenderTilePool; +import vazkii.botania.common.block.tile.mana.TilePool; import vazkii.botania.common.entity.EntityPoolMinecart; -public class RenderPoolMinecart extends RenderMinecart { +import javax.annotation.Nonnull; + +public class RenderPoolMinecart extends RenderMinecart { + + public RenderPoolMinecart(RenderManager manager) { + super(manager); + } @Override - protected void func_147910_a(EntityMinecart p_147910_1_, float p_147910_2_, Block p_147910_3_, int p_147910_4_) { - EntityPoolMinecart poolCart = (EntityPoolMinecart) p_147910_1_; + protected void renderCartContents(EntityPoolMinecart poolCart, float partialTicks, @Nonnull IBlockState state) { + RenderTilePool.forceVariant = PoolVariant.DEFAULT; RenderTilePool.forceManaNumber = poolCart.getMana(); - super.func_147910_a(p_147910_1_, p_147910_2_, p_147910_3_, p_147910_4_); + TileEntityRendererDispatcher.instance.getSpecialRendererByClass(TilePool.class).renderTileEntityAt(null, poolCart.posX, poolCart.posY, poolCart.posZ, ClientTickHandler.partialTicks, -1); } diff --git a/src/main/java/vazkii/botania/client/render/entity/RenderSnowballStack.java b/src/main/java/vazkii/botania/client/render/entity/RenderSnowballStack.java new file mode 100644 index 000000000..6e9f1500e --- /dev/null +++ b/src/main/java/vazkii/botania/client/render/entity/RenderSnowballStack.java @@ -0,0 +1,37 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + * + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + */ +package vazkii.botania.client.render.entity; + +import net.minecraft.client.renderer.RenderItem; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RenderSnowball; +import net.minecraft.entity.Entity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +import javax.annotation.Nonnull; +import java.util.function.Function; + +// Same as RenderSnowball, but ItemStack sensitive +public class RenderSnowballStack extends RenderSnowball { + + private final Function stackGetter; + + public RenderSnowballStack(RenderManager renderManagerIn, Item item, RenderItem render, Function stackGetter) { + super(renderManagerIn, item, render); + this.stackGetter = stackGetter; + } + + @Nonnull + @Override + public ItemStack getStackToRender(T entity) { + return stackGetter.apply(entity); + } + +} diff --git a/src/main/java/vazkii/botania/client/render/entity/RenderSpark.java b/src/main/java/vazkii/botania/client/render/entity/RenderSpark.java index d28bcaca0..4adc42fc7 100644 --- a/src/main/java/vazkii/botania/client/render/entity/RenderSpark.java +++ b/src/main/java/vazkii/botania/client/render/entity/RenderSpark.java @@ -10,16 +10,26 @@ */ package vazkii.botania.client.render.entity; -import net.minecraft.util.IIcon; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.network.datasync.DataParameter; +import vazkii.botania.client.core.handler.MiscellaneousIcons; import vazkii.botania.common.entity.EntitySpark; -import vazkii.botania.common.item.ItemSparkUpgrade; public class RenderSpark extends RenderSparkBase { + public RenderSpark(RenderManager renderManager) { + super(renderManager); + } + + protected DataParameter getInvisibilityParam() { + return EntitySpark.INVISIBILITY; + } + @Override - public IIcon getSpinningIcon(EntitySpark entity) { - int upgrade = entity.getUpgrade() - 1; - return upgrade >= 0 && upgrade < ItemSparkUpgrade.worldIcons.length ? ItemSparkUpgrade.worldIcons[upgrade] : null; + public TextureAtlasSprite getSpinningIcon(EntitySpark entity) { + int upgrade = entity.getUpgrade().ordinal() - 1; + return upgrade >= 0 && upgrade < MiscellaneousIcons.INSTANCE.sparkUpgradeIcons.length ? MiscellaneousIcons.INSTANCE.sparkUpgradeIcons[upgrade] : null; } } diff --git a/src/main/java/vazkii/botania/client/render/entity/RenderSparkBase.java b/src/main/java/vazkii/botania/client/render/entity/RenderSparkBase.java index ff1109f83..78dd27620 100644 --- a/src/main/java/vazkii/botania/client/render/entity/RenderSparkBase.java +++ b/src/main/java/vazkii/botania/client/render/entity/RenderSparkBase.java @@ -10,91 +10,95 @@ */ package vazkii.botania.client.render.entity; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.entity.Entity; +import net.minecraft.network.datasync.DataParameter; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import vazkii.botania.client.core.handler.ClientTickHandler; +import vazkii.botania.client.core.handler.MiscellaneousIcons; + +import javax.annotation.Nonnull; import java.util.Random; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.RenderEntity; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.entity.Entity; -import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; +public abstract class RenderSparkBase extends Render { -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - -import vazkii.botania.client.core.handler.ClientTickHandler; -import vazkii.botania.common.entity.EntitySpark; -import vazkii.botania.common.item.ItemSpark; - -public class RenderSparkBase extends RenderEntity { + public RenderSparkBase(RenderManager manager) { + super(manager); + } @Override - public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) { - T tEntity = (T) par1Entity; - IIcon iicon = getBaseIcon(tEntity); + public void doRender(@Nonnull T tEntity, double par2, double par4, double par6, float par8, float par9) { + TextureAtlasSprite iicon = getBaseIcon(tEntity); - GL11.glPushMatrix(); - GL11.glTranslatef((float)par2, (float)par4, (float)par6); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glAlphaFunc(GL11.GL_GREATER, 0.05F); + GlStateManager.pushMatrix(); + GlStateManager.translate((float)par2, (float)par4, (float)par6); + GlStateManager.enableRescaleNormal(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.alphaFunc(GL11.GL_GREATER, 0.05F); double time = ClientTickHandler.ticksInGame + par9; - time += new Random(par1Entity.getEntityId()).nextInt(); - float a = 0.1F + (1 - par1Entity.getDataWatcher().getWatchableObjectInt(EntitySpark.INVISIBILITY_DATA_WATCHER_KEY)) * 0.8F; + time += new Random(tEntity.getEntityId()).nextInt(); - GL11.glColor4f(1F, 1F, 1F, (0.7F + 0.3F * (float) (Math.sin(time / 5.0) + 0.5) * 2) * a); + float a = 0.1F + (1 - tEntity.getDataManager().get(getInvisibilityParam())) * 0.8F; + + GlStateManager.color(1F, 1F, 1F, (0.7F + 0.3F * (float) (Math.sin(time / 5.0) + 0.5) * 2) * a); float scale = 0.75F + 0.1F * (float) Math.sin(time / 10); - GL11.glScalef(scale, scale, scale); - bindEntityTexture(par1Entity); - Tessellator tessellator = Tessellator.instance; + GlStateManager.scale(scale, scale, scale); + bindEntityTexture(tEntity); + Tessellator tessellator = Tessellator.getInstance(); - GL11.glPushMatrix(); + GlStateManager.pushMatrix(); float r = 180.0F - renderManager.playerViewY; - GL11.glRotatef(r, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-renderManager.playerViewX, 1F, 0F, 0F); + GlStateManager.rotate(r, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(-renderManager.playerViewX, 1F, 0F, 0F); func_77026_a(tessellator, iicon); - IIcon spinningIcon = getSpinningIcon(tEntity); + TextureAtlasSprite spinningIcon = getSpinningIcon(tEntity); if(spinningIcon != null) { - GL11.glTranslatef(-0.02F + (float) Math.sin(time / 20) * 0.2F, 0.24F + (float) Math.cos(time / 20) * 0.2F, 0.005F); - GL11.glScalef(0.2F, 0.2F, 0.2F); + GlStateManager.translate(-0.02F + (float) Math.sin(time / 20) * 0.2F, 0.24F + (float) Math.cos(time / 20) * 0.2F, 0.005F); + GlStateManager.scale(0.2F, 0.2F, 0.2F); colorSpinningIcon(tEntity, a); func_77026_a(tessellator, spinningIcon); } - GL11.glPopMatrix(); - GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.popMatrix(); + GlStateManager.color(1F, 1F, 1F, 1F); renderCallback(tEntity, par9); - GL11.glDisable(GL11.GL_BLEND); - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - GL11.glPopMatrix(); + GlStateManager.disableBlend(); + GlStateManager.disableRescaleNormal(); + GlStateManager.popMatrix(); } - public IIcon getBaseIcon(T entity) { - return ItemSpark.worldIcon; + protected abstract DataParameter getInvisibilityParam(); + + protected TextureAtlasSprite getBaseIcon(T entity) { + return MiscellaneousIcons.INSTANCE.sparkWorldIcon; } - public void colorSpinningIcon(T entity, float a) { - // NO-OP - } + protected void colorSpinningIcon(T entity, float a) {} - public IIcon getSpinningIcon(T entity) { + protected TextureAtlasSprite getSpinningIcon(T entity) { return null; } - public void renderCallback(T entity, float pticks) { - // NO-OP - } + protected void renderCallback(T entity, float pticks) {} + @Nonnull @Override - protected ResourceLocation getEntityTexture(Entity p_110775_1_) { - return TextureMap.locationItemsTexture; + protected ResourceLocation getEntityTexture(@Nonnull Entity entity) { + return TextureMap.LOCATION_BLOCKS_TEXTURE; } - private void func_77026_a(Tessellator p_77026_1_, IIcon p_77026_2_) { + private void func_77026_a(Tessellator p_77026_1_, TextureAtlasSprite p_77026_2_) { float f = p_77026_2_.getMinU(); float f1 = p_77026_2_.getMaxU(); float f2 = p_77026_2_.getMinV(); @@ -103,13 +107,12 @@ public class RenderSparkBase extends RenderEntity { float f5 = 0.5F; float f6 = 0.25F; - p_77026_1_.startDrawingQuads(); - p_77026_1_.setNormal(0.0F, 1.0F, 0.0F); - p_77026_1_.setBrightness(240); - p_77026_1_.addVertexWithUV(0.0F - f5, 0.0F - f6, 0.0D, f, f3); - p_77026_1_.addVertexWithUV(f4 - f5, 0.0F - f6, 0.0D, f1, f3); - p_77026_1_.addVertexWithUV(f4 - f5, f4 - f6, 0.0D, f1, f2); - p_77026_1_.addVertexWithUV(0.0F - f5, f4 - f6, 0.0D, f, f2); + p_77026_1_.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_NORMAL); + //p_77026_1_.getBuffer().setBrightness(240); + p_77026_1_.getBuffer().pos(0.0F - f5, 0.0F - f6, 0.0D).tex(f, f3).normal(0.0F, 1.0F, 0.0F).endVertex(); + p_77026_1_.getBuffer().pos(f4 - f5, 0.0F - f6, 0.0D).tex(f1, f3).normal(0.0F, 1.0F, 0.0F).endVertex(); + p_77026_1_.getBuffer().pos(f4 - f5, f4 - f6, 0.0D).tex(f1, f2).normal(0.0F, 1.0F, 0.0F).endVertex(); + p_77026_1_.getBuffer().pos(0.0F - f5, f4 - f6, 0.0D).tex(f, f2).normal(0.0F, 1.0F, 0.0F).endVertex(); p_77026_1_.draw(); } diff --git a/src/main/java/vazkii/botania/client/render/entity/RenderThornChakram.java b/src/main/java/vazkii/botania/client/render/entity/RenderThornChakram.java index e23e8a18a..8410a27fd 100644 --- a/src/main/java/vazkii/botania/client/render/entity/RenderThornChakram.java +++ b/src/main/java/vazkii/botania/client/render/entity/RenderThornChakram.java @@ -10,48 +10,52 @@ */ package vazkii.botania.client.render.entity; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.entity.Entity; -import net.minecraft.util.IIcon; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.util.ResourceLocation; - import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - import vazkii.botania.common.entity.EntityThornChakram; -import vazkii.botania.common.item.ModItems; + +import javax.annotation.Nonnull; // Basically a bit of an extension of RenderSnowball -public class RenderThornChakram extends Render { +public class RenderThornChakram extends Render { + + public RenderThornChakram(RenderManager renderManager) { + super(renderManager); + } @Override - public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) { - EntityThornChakram c = (EntityThornChakram) p_76986_1_; + public void doRender(@Nonnull EntityThornChakram c, double x, double y, double z, float entityYaw, float partialTicks) { boolean fire = c.isFire(); - IIcon iicon = ModItems.thornChakram.getIconFromDamage(fire ? 1 : 0); + TextureAtlasSprite iicon = null;//ModItems.thornChakram.getIconFromDamage(fire ? 1 : 0); if(iicon != null) { - GL11.glPushMatrix(); - GL11.glTranslatef((float)p_76986_2_, (float)p_76986_4_, (float)p_76986_6_); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glScalef(0.5F, 0.5F, 0.5F); - bindEntityTexture(p_76986_1_); - Tessellator tessellator = Tessellator.instance; + GlStateManager.pushMatrix(); + GlStateManager.translate((float)x, (float)y, (float)z); + GlStateManager.enableRescaleNormal(); + GlStateManager.scale(0.5F, 0.5F, 0.5F); + bindEntityTexture(c); + Tessellator tessellator = Tessellator.getInstance(); func_77026_a(tessellator, iicon, fire ? 240 : -1); - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - GL11.glPopMatrix(); + GlStateManager.disableRescaleNormal(); + GlStateManager.popMatrix(); } } + @Nonnull @Override - protected ResourceLocation getEntityTexture(Entity p_110775_1_) { - return TextureMap.locationItemsTexture; + protected ResourceLocation getEntityTexture(@Nonnull EntityThornChakram p_110775_1_) { + return TextureMap.LOCATION_BLOCKS_TEXTURE; } - private void func_77026_a(Tessellator p_77026_1_, IIcon p_77026_2_, int light) { + private void func_77026_a(Tessellator p_77026_1_, TextureAtlasSprite p_77026_2_, int light) { float f = p_77026_2_.getMinU(); float f1 = p_77026_2_.getMaxU(); float f2 = p_77026_2_.getMinV(); @@ -59,16 +63,15 @@ public class RenderThornChakram extends Render { float f4 = 1.0F; float f5 = 0.5F; float f6 = 0.25F; - GL11.glRotatef(180.0F - renderManager.playerViewY, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-renderManager.playerViewX, 1.0F, 0.0F, 0.0F); - p_77026_1_.startDrawingQuads(); - p_77026_1_.setNormal(0.0F, 1.0F, 0.0F); + GlStateManager.rotate(180.0F - renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(-renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + p_77026_1_.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_NORMAL); if(light != -1) - p_77026_1_.setBrightness(light); - p_77026_1_.addVertexWithUV(0.0F - f5, 0.0F - f6, 0.0D, f, f3); - p_77026_1_.addVertexWithUV(f4 - f5, 0.0F - f6, 0.0D, f1, f3); - p_77026_1_.addVertexWithUV(f4 - f5, f4 - f6, 0.0D, f1, f2); - p_77026_1_.addVertexWithUV(0.0F - f5, f4 - f6, 0.0D, f, f2); + //p_77026_1_.getBuffer().setBrightness(light); + p_77026_1_.getBuffer().pos(0.0F - f5, 0.0F - f6, 0.0D).tex(f, f3).normal(0.0F, 1.0F, 0.0F).endVertex(); + p_77026_1_.getBuffer().pos(f4 - f5, 0.0F - f6, 0.0D).tex(f1, f3).normal(0.0F, 1.0F, 0.0F).endVertex(); + p_77026_1_.getBuffer().pos(f4 - f5, f4 - f6, 0.0D).tex(f1, f2).normal(0.0F, 1.0F, 0.0F).endVertex(); + p_77026_1_.getBuffer().pos(0.0F - f5, f4 - f6, 0.0D).tex(f, f2).normal(0.0F, 1.0F, 0.0F).endVertex(); p_77026_1_.draw(); } diff --git a/src/main/java/vazkii/botania/client/render/item/RenderBow.java b/src/main/java/vazkii/botania/client/render/item/RenderBow.java deleted file mode 100644 index 8b22dc0da..000000000 --- a/src/main/java/vazkii/botania/client/render/item/RenderBow.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Feb 28, 2015, 3:43:09 PM (GMT)] - */ -package vazkii.botania.client.render.item; - -import net.minecraft.client.renderer.ItemRenderer; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraftforge.client.IItemRenderer; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.common.lib.LibObfuscation; -import cpw.mods.fml.relauncher.ReflectionHelper; - -public class RenderBow implements IItemRenderer { - - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) { - return type != ItemRenderType.INVENTORY; - } - - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { - return helper == ItemRendererHelper.ENTITY_ROTATION || helper == ItemRendererHelper.ENTITY_BOBBING; - } - - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) { - switch(type) { - case ENTITY : { - GL11.glPushMatrix(); - GL11.glTranslatef(-0.5F, 0F, 0F); - if(item.isOnItemFrame()) - GL11.glTranslatef(0F, -0.3F, 0.01F); - render(item, null, false); - GL11.glPopMatrix(); - break; - } - case EQUIPPED : { - render(item, data[1] instanceof EntityPlayer ? (EntityPlayer) data[1] : null, true); - break; - } - case EQUIPPED_FIRST_PERSON : { - render(item, data[1] instanceof EntityPlayer ? (EntityPlayer) data[1] : null, false); - break; - } - default : break; - } - } - - public void render(ItemStack item, EntityPlayer player, boolean transform) { - int dmg = item.getItemDamage(); - IIcon icon = item.getItem().getIconFromDamageForRenderPass(dmg, 0); - if(player != null) { - ItemStack using = ReflectionHelper.getPrivateValue(EntityPlayer.class, player, LibObfuscation.ITEM_IN_USE); - int time = ReflectionHelper.getPrivateValue(EntityPlayer.class, player, LibObfuscation.ITEM_IN_USE_COUNT); - icon = item.getItem().getIcon(item, 0, player, using, time); - if(transform) { - GL11.glTranslatef(0.2F, -0.3F, 0.1F); - //GL11.glRotatef(20.0F, 0.0F, 1.0F, 0.0F); - //GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); - } - } - - float f = icon.getMinU(); - float f1 = icon.getMaxU(); - float f2 = icon.getMinV(); - float f3 = icon.getMaxV(); - float scale = 1F / 16F; - - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1F, 1F, 1F, 1F); - ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), scale); - - GL11.glDisable(GL11.GL_BLEND); - GL11.glPopMatrix(); - - GL11.glColor4f(1F, 1F, 1F, 1F); - } - - -} diff --git a/src/main/java/vazkii/botania/client/render/item/RenderFloatingFlowerItem.java b/src/main/java/vazkii/botania/client/render/item/RenderFloatingFlowerItem.java deleted file mode 100644 index 3f66ca3cb..000000000 --- a/src/main/java/vazkii/botania/client/render/item/RenderFloatingFlowerItem.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Nov 17, 2014, 5:48:34 PM (GMT)] - */ -package vazkii.botania.client.render.item; - -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.client.IItemRenderer; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.common.block.ModBlocks; -import vazkii.botania.common.block.tile.TileFloatingFlower; -import vazkii.botania.common.item.block.ItemBlockFloatingSpecialFlower; -import vazkii.botania.common.item.block.ItemBlockSpecialFlower; - -public class RenderFloatingFlowerItem implements IItemRenderer { - - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) { - return true; - } - - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { - return true; - } - - @Override - public void renderItem(ItemRenderType type, ItemStack stack, Object... data) { - GL11.glPushMatrix(); - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - float s = 1.4F; - GL11.glScalef(s, s, s); - GL11.glRotatef(-5F, 1F, 0F, 0F); - Item item = stack.getItem(); - TileFloatingFlower.forcedStack = item instanceof ItemBlockFloatingSpecialFlower ? ItemBlockSpecialFlower.ofType(ItemBlockSpecialFlower.getType(stack)) : new ItemStack(ModBlocks.flower, 1, stack.getItemDamage()); - - TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileFloatingFlower(), 0.0D, 0.0D, 0.0D, 0.0F); - GL11.glDisable(GL11.GL_BLEND); - GL11.glPopMatrix(); - } - -} diff --git a/src/main/java/vazkii/botania/client/render/item/RenderLens.java b/src/main/java/vazkii/botania/client/render/item/RenderLens.java deleted file mode 100644 index a3b71c2f4..000000000 --- a/src/main/java/vazkii/botania/client/render/item/RenderLens.java +++ /dev/null @@ -1,123 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 31, 2014, 3:08:00 PM (GMT)] - */ -package vazkii.botania.client.render.item; - -import java.awt.Color; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.ItemRenderer; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraftforge.client.IItemRenderer; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.api.mana.ILens; -import vazkii.botania.common.item.lens.ItemLens; - -public class RenderLens implements IItemRenderer { - - static RenderItem render = new RenderItem(); - ItemRenderer renderer = new ItemRenderer(Minecraft.getMinecraft()); - - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) { - return type != ItemRenderType.INVENTORY; - } - - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { - return helper == ItemRendererHelper.ENTITY_ROTATION || helper == ItemRendererHelper.ENTITY_BOBBING; - } - - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) { - switch(type) { - case ENTITY : { - GL11.glPushMatrix(); - GL11.glTranslatef(-0.5F, 0F, 0F); - if(item.isOnItemFrame()) - GL11.glTranslatef(0F, -0.3F, 0.01F); - render(item); - GL11.glPopMatrix(); - break; - } - case EQUIPPED : { - render(item); - break; - } - case EQUIPPED_FIRST_PERSON : { - render(item); - break; - } - default : break; - } - } - - public static void render(ItemStack item) { - Color color = new Color(((ILens) item.getItem()).getLensColor(item)); - render(item, color.getRGB()); - } - - public static void render(ItemStack item, int color_) { - int dmg = item.getItemDamage(); - IIcon icon = item.getItem().getIconFromDamageForRenderPass(dmg, 1); - float f = icon.getMinU(); - float f1 = icon.getMaxU(); - float f2 = icon.getMinV(); - float f3 = icon.getMaxV(); - float scale = 1F / 16F; - - GL11.glColor4f(1F, 1F, 1F, 1F); - ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), scale); - - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - Color color = new Color(color_); - GL11.glColor4ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue(), (byte) 255); - - boolean shiny = ItemLens.getStoredColor(item) != -1; - icon = ItemLens.iconGlass; - GL11.glScalef(scale, scale, scale); - GL11.glTranslatef(0F, 0F, -0.5F); - renderShinyLensIcon(icon, shiny); - GL11.glRotatef(180F, 0F, 1F, 0F); - GL11.glTranslatef(-16F, 0F, 0F); - renderShinyLensIcon(icon, shiny); - GL11.glDisable(GL11.GL_CULL_FACE); - GL11.glDisable(GL11.GL_BLEND); - GL11.glPopMatrix(); - - GL11.glColor4f(1F, 1F, 1F, 1F); - } - - public static void renderShinyLensIcon(IIcon icon, boolean shiny) { - float par1 = 0; - float par2 = 0; - float par4 = 16; - float par5 = 16; - float zLevel = 0F; - Tessellator tessellator = Tessellator.instance; - tessellator.startDrawingQuads(); - if(shiny) - tessellator.setBrightness(240); - tessellator.addVertexWithUV(par1 + 0, par2 + par5, zLevel, icon.getMinU(), icon.getMaxV()); - tessellator.addVertexWithUV(par1 + par4, par2 + par5, zLevel, icon.getMaxU(), icon.getMaxV()); - tessellator.addVertexWithUV(par1 + par4, par2 + 0, zLevel, icon.getMaxU(), icon.getMinV()); - tessellator.addVertexWithUV(par1 + 0, par2 + 0, zLevel, icon.getMinU(), icon.getMinV()); - tessellator.draw(); - } - -} \ No newline at end of file diff --git a/src/main/java/vazkii/botania/client/render/item/RenderLexicon.java b/src/main/java/vazkii/botania/client/render/item/RenderLexicon.java deleted file mode 100644 index 694325ae3..000000000 --- a/src/main/java/vazkii/botania/client/render/item/RenderLexicon.java +++ /dev/null @@ -1,115 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Mar 25, 2014, 8:49:01 PM (GMT)] - */ -package vazkii.botania.client.render.item; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.model.ModelBook; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; -import net.minecraftforge.client.IItemRenderer; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.client.core.handler.ClientTickHandler; -import vazkii.botania.client.gui.lexicon.GuiLexicon; -import vazkii.botania.client.lib.LibResources; -import vazkii.botania.common.item.ItemLexicon; -import vazkii.botania.common.item.ModItems; - -public class RenderLexicon implements IItemRenderer { - - ModelBook model = new ModelBook(); - ResourceLocation texture = new ResourceLocation(LibResources.MODEL_LEXICA); - - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) { - return type == ItemRenderType.EQUIPPED_FIRST_PERSON; - } - - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { - return false; - } - - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) { - GL11.glPushMatrix(); - Minecraft mc = Minecraft.getMinecraft(); - mc.renderEngine.bindTexture(texture); - float opening = 0F; - float pageFlip = 0F; - - float ticks = ClientTickHandler.ticksWithLexicaOpen; - if(ticks > 0 && ticks < 10) { - if(mc.currentScreen instanceof GuiLexicon) - ticks += ClientTickHandler.partialTicks; - else ticks -= ClientTickHandler.partialTicks; - } - - GL11.glTranslatef(0.3F + 0.02F * ticks, 0.475F + 0.01F * ticks, -0.2F - 0.01F * ticks); - GL11.glRotatef(87.5F + ticks * 5, 0F, 1F, 0F); - GL11.glRotatef(ticks * 2.5F, 0F, 0F, 1F); - GL11.glScalef(0.9F, 0.9F, 0.9F); - opening = ticks / 12F; - - float pageFlipTicks = ClientTickHandler.pageFlipTicks; - if(pageFlipTicks > 0) - pageFlipTicks -= ClientTickHandler.partialTicks; - - pageFlip = pageFlipTicks / 5F; - - model.render(null, 0F, 0F, pageFlip, opening, 0F, 1F / 16F); - if(ticks < 3) { - FontRenderer font = Minecraft.getMinecraft().fontRenderer; - GL11.glRotatef(180F, 0F, 0F, 1F); - GL11.glTranslatef(-0.3F, -0.21F, -0.07F); - GL11.glScalef(0.0035F, 0.0035F, -0.0035F); - boolean bevo = Minecraft.getMinecraft().thePlayer.getCommandSenderName().equalsIgnoreCase("BevoLJ"); - boolean saice = Minecraft.getMinecraft().thePlayer.getCommandSenderName().equalsIgnoreCase("saice"); - - String title = ModItems.lexicon.getItemStackDisplayName(null); - String origTitle = title; - - if(Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem() != null) - title = Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem().getDisplayName(); - if(title.equals(origTitle) && bevo) - title = StatCollector.translateToLocal("item.botania:lexicon.bevo"); - if(title.equals(origTitle) && saice) - title = StatCollector.translateToLocal("item.botania:lexicon.saice"); - - font.drawString(font.trimStringToWidth(title, 80), 0, 0, 0xD69700); - GL11.glTranslatef(0F, 10F, 0F); - GL11.glScalef(0.6F, 0.6F, 0.6F); - font.drawString(EnumChatFormatting.ITALIC + "" + EnumChatFormatting.BOLD + String.format(StatCollector.translateToLocal("botaniamisc.edition"), ItemLexicon.getEdition()), 0, 0, 0xA07100); - - GL11.glTranslatef(0F, 15F, 0F); - font.drawString(StatCollector.translateToLocal("botaniamisc.lexiconcover0"), 0, 0, 0x79ff92); - - GL11.glTranslatef(0F, 10F, 0F); - font.drawString(StatCollector.translateToLocal("botaniamisc.lexiconcover1"), 0, 0, 0x79ff92); - - GL11.glTranslatef(0F, 50F, 0F); - font.drawString(StatCollector.translateToLocal("botaniamisc.lexiconcover2"), 0, 0, 0x79ff92); - GL11.glTranslatef(0F, 10F, 0F); - font.drawString(EnumChatFormatting.UNDERLINE + "" + EnumChatFormatting.ITALIC + StatCollector.translateToLocal("botaniamisc.lexiconcover3"), 0, 0, 0x79ff92); - if(bevo || saice) { - GL11.glTranslatef(0F, 10F, 0F); - font.drawString(StatCollector.translateToLocal("botaniamisc.lexiconcover" + (bevo ? 4 : 5)), 0, 0, 0x79ff92); - } - } - - GL11.glPopMatrix(); - } - -} diff --git a/src/main/java/vazkii/botania/client/render/item/RenderTransparentItem.java b/src/main/java/vazkii/botania/client/render/item/RenderTransparentItem.java deleted file mode 100644 index 72b6bc127..000000000 --- a/src/main/java/vazkii/botania/client/render/item/RenderTransparentItem.java +++ /dev/null @@ -1,79 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Aug 6, 2014, 10:04:57 PM (GMT)] - */ -package vazkii.botania.client.render.item; - -import net.minecraft.client.renderer.ItemRenderer; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraftforge.client.IItemRenderer; - -import org.lwjgl.opengl.GL11; - -public class RenderTransparentItem implements IItemRenderer { - - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) { - return type != ItemRenderType.INVENTORY; - } - - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { - return helper == ItemRendererHelper.ENTITY_ROTATION || helper == ItemRendererHelper.ENTITY_BOBBING; - } - - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) { - switch(type) { - case ENTITY : { - GL11.glPushMatrix(); - GL11.glTranslatef(-0.5F, 0F, 0F); - if(item.isOnItemFrame()) - GL11.glTranslatef(0F, -0.3F, 0.01F); - render(item); - GL11.glPopMatrix(); - break; - } - case EQUIPPED : { - render(item); - break; - } - case EQUIPPED_FIRST_PERSON : { - render(item); - break; - } - default : break; - } - } - - public void render(ItemStack item) { - int dmg = item.getItemDamage(); - IIcon icon = item.getItem().getIconFromDamageForRenderPass(dmg, 0); - float f = icon.getMinU(); - float f1 = icon.getMaxU(); - float f2 = icon.getMinV(); - float f3 = icon.getMaxV(); - float scale = 1F / 16F; - - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1F, 1F, 1F, 1F); - ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), scale); - - GL11.glDisable(GL11.GL_BLEND); - GL11.glPopMatrix(); - - GL11.glColor4f(1F, 1F, 1F, 1F); - } - - -} diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileAlfPortal.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileAlfPortal.java index 65b77c1e1..76ce37640 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileAlfPortal.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileAlfPortal.java @@ -11,70 +11,78 @@ package vazkii.botania.client.render.tile; import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; - +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import org.lwjgl.opengl.GL11; - +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.AlfPortalState; import vazkii.botania.client.core.handler.ClientTickHandler; -import vazkii.botania.common.block.BlockAlfPortal; +import vazkii.botania.client.core.handler.MiscellaneousIcons; +import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.tile.TileAlfPortal; -public class RenderTileAlfPortal extends TileEntitySpecialRenderer { +import javax.annotation.Nonnull; + +public class RenderTileAlfPortal extends TileEntitySpecialRenderer { @Override - public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) { - TileAlfPortal portal = (TileAlfPortal) tileentity; - int meta = portal.getBlockMetadata(); - if(meta == 0) + public void renderTileEntityAt(@Nonnull TileAlfPortal portal, double d0, double d1, double d2, float f, int digProgress) { + if (!portal.getWorld().isBlockLoaded(portal.getPos(), false) + || portal.getWorld().getBlockState(portal.getPos()).getBlock() != ModBlocks.alfPortal) return; - GL11.glPushMatrix(); - GL11.glTranslated(d0, d1, d2); - GL11.glTranslatef(-1F, 1F, 0.25F); + AlfPortalState state = portal.getWorld().getBlockState(portal.getPos()).getValue(BotaniaStateProps.ALFPORTAL_STATE); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1F, 1F, 1F, 1F); - GL11.glDisable(GL11.GL_ALPHA_TEST); - GL11.glEnable(GL11.GL_CULL_FACE); + if(state == AlfPortalState.OFF) + return; + + GlStateManager.pushMatrix(); + GlStateManager.translate(d0, d1, d2); + GlStateManager.translate(-1F, 1F, 0.25F); + + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.color(1F, 1F, 1F, 1F); + GlStateManager.disableAlpha(); + GlStateManager.enableCull(); float alpha = (float) Math.min(1F, (Math.sin((ClientTickHandler.ticksInGame + f) / 8D) + 1D) / 7D + 0.6D) * (Math.min(60, portal.ticksOpen) / 60F) * 0.5F; - GL11.glColor4f(1F, 1F, 1F, alpha); + GlStateManager.color(1F, 1F, 1F, alpha); - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); - if(meta == 2) { - GL11.glTranslatef(1.25F, 0F, 1.75F); - GL11.glRotatef(90F, 0F, 1F, 0F); + if(state == AlfPortalState.ON_X) { + GlStateManager.translate(1.25F, 0F, 1.75F); + GlStateManager.rotate(90F, 0F, 1F, 0F); } - GL11.glDisable(GL11.GL_CULL_FACE); - GL11.glDisable(GL11.GL_LIGHTING); - renderIcon(0, 0, BlockAlfPortal.portalTex, 3, 3, 240); + GlStateManager.disableCull(); + GlStateManager.disableLighting(); + renderIcon(0, 0, MiscellaneousIcons.INSTANCE.alfPortalTex, 3, 3, 240); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glTranslated(0F, 0F, 0.5F); - renderIcon(0, 0, BlockAlfPortal.portalTex, 3, 3, 240); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.translate(0F, 0F, 0.5F); + renderIcon(0, 0, MiscellaneousIcons.INSTANCE.alfPortalTex, 3, 3, 240); - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glEnable(GL11.GL_ALPHA_TEST); - GL11.glDisable(GL11.GL_BLEND); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glColor4f(1F, 1F, 1F, 1F); - GL11.glPopMatrix(); + GlStateManager.enableCull(); + GlStateManager.enableAlpha(); + GlStateManager.disableBlend(); + GlStateManager.enableLighting(); + GlStateManager.color(1F, 1F, 1F, 1F); + GlStateManager.popMatrix(); } - public void renderIcon(int par1, int par2, IIcon par3Icon, int par4, int par5, int brightness) { - Tessellator tessellator = Tessellator.instance; - tessellator.startDrawingQuads(); - tessellator.setBrightness(brightness); - tessellator.addVertexWithUV(par1 + 0, par2 + par5, 0, par3Icon.getMinU(), par3Icon.getMaxV()); - tessellator.addVertexWithUV(par1 + par4, par2 + par5, 0, par3Icon.getMaxU(), par3Icon.getMaxV()); - tessellator.addVertexWithUV(par1 + par4, par2 + 0, 0, par3Icon.getMaxU(), par3Icon.getMinV()); - tessellator.addVertexWithUV(par1 + 0, par2 + 0, 0, par3Icon.getMinU(), par3Icon.getMinV()); + public void renderIcon(int par1, int par2, TextureAtlasSprite par3Icon, int par4, int par5, int brightness) { + Tessellator tessellator = Tessellator.getInstance(); + tessellator.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); + //tessellator.getBuffer().setBrightness(brightness); + tessellator.getBuffer().pos(par1 + 0, par2 + par5, 0).tex(par3Icon.getMinU(), par3Icon.getMaxV()).endVertex(); + tessellator.getBuffer().pos(par1 + par4, par2 + par5, 0).tex(par3Icon.getMaxU(), par3Icon.getMaxV()).endVertex(); + tessellator.getBuffer().pos(par1 + par4, par2 + 0, 0).tex(par3Icon.getMaxU(), par3Icon.getMinV()).endVertex(); + tessellator.getBuffer().pos(par1 + 0, par2 + 0, 0).tex(par3Icon.getMinU(), par3Icon.getMinV()).endVertex(); tessellator.draw(); } diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileAltar.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileAltar.java index 24cca1942..8f384ceed 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileAltar.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileAltar.java @@ -10,68 +10,44 @@ */ package vazkii.botania.client.render.tile; -import java.awt.Color; - -import net.minecraft.block.Block; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.init.Blocks; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; - +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - import vazkii.botania.client.core.handler.ClientTickHandler; -import vazkii.botania.client.lib.LibResources; -import vazkii.botania.client.model.ModelAltar; +import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.tile.TileAltar; -public class RenderTileAltar extends TileEntitySpecialRenderer { +import javax.annotation.Nonnull; - private static final ResourceLocation[] textures = new ResourceLocation[] { - new ResourceLocation(LibResources.MODEL_ALTAR), - new ResourceLocation(String.format(LibResources.MODEL_ALTAR_META, 0)), - new ResourceLocation(String.format(LibResources.MODEL_ALTAR_META, 1)), - new ResourceLocation(String.format(LibResources.MODEL_ALTAR_META, 2)), - new ResourceLocation(String.format(LibResources.MODEL_ALTAR_META, 3)), - new ResourceLocation(String.format(LibResources.MODEL_ALTAR_META, 4)), - new ResourceLocation(String.format(LibResources.MODEL_ALTAR_META, 5)), - new ResourceLocation(String.format(LibResources.MODEL_ALTAR_META, 6)), - new ResourceLocation(String.format(LibResources.MODEL_ALTAR_META, 7)) - }; - - private static final ResourceLocation textureMossy = new ResourceLocation(LibResources.MODEL_ALTAR_MOSSY); - - ModelAltar model = new ModelAltar(); - RenderItem renderItem = new RenderItem(); - public static int forceMeta = -1; +public class RenderTileAltar extends TileEntitySpecialRenderer { @Override - public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float pticks) { - TileAltar altar = (TileAltar) tileentity; + public void renderTileEntityAt(@Nonnull TileAltar altar, double d0, double d1, double d2, float pticks, int digProgress) { + if(!altar.getWorld().isBlockLoaded(altar.getPos(), false) + || altar.getWorld().getBlockState(altar.getPos()).getBlock() != ModBlocks.altar) + return; - GL11.glPushMatrix(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glColor4f(1F, 1F, 1F, 1F); - Minecraft.getMinecraft().renderEngine.bindTexture(altar.isMossy ? textureMossy : textures[Math.min(textures.length - 1, forceMeta == -1 ? tileentity.getBlockMetadata() : forceMeta)]); + GlStateManager.pushMatrix(); + GlStateManager.enableRescaleNormal(); + GlStateManager.color(1F, 1F, 1F, 1F); - GL11.glTranslated(d0 + 0.5, d1 + 1.5, d2 + 0.5); - GL11.glScalef(1F, -1F, -1F); - model.render(); - GL11.glScalef(1F, -1F, -1F); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GlStateManager.translate(d0 + 0.5, d1 + 1.5, d2 + 0.5); + GlStateManager.enableRescaleNormal(); boolean water = altar.hasWater(); boolean lava = altar.hasLava(); if(water || lava) { - GL11.glPushMatrix(); + GlStateManager.pushMatrix(); float s = 1F / 256F * 10F; float v = 1F / 8F; float w = -v * 2.5F; @@ -79,7 +55,7 @@ public class RenderTileAltar extends TileEntitySpecialRenderer { if(water) { int petals = 0; for(int i = 0; i < altar.getSizeInventory(); i++) - if(altar.getStackInSlot(i) != null) + if(altar.getItemHandler().getStackInSlot(i) != null) petals++; else break; @@ -92,9 +68,9 @@ public class RenderTileAltar extends TileEntitySpecialRenderer { double ticks = (ClientTickHandler.ticksInGame + pticks) * 0.5; float offsetPerPetal = 360 / petals; - GL11.glPushMatrix(); - GL11.glTranslatef(-0.05F, -0.5F, 0F); - GL11.glScalef(v, v, v); + GlStateManager.pushMatrix(); + GlStateManager.translate(-0.05F, -0.5F, 0F); + GlStateManager.scale(v, v, v); for(int i = 0; i < petals; i++) { float offset = offsetPerPetal * i; float deg = (int) (ticks / rotationModifier % 360F + offset); @@ -105,77 +81,66 @@ public class RenderTileAltar extends TileEntitySpecialRenderer { float z = (float) (radiusZ * Math.sin(rad)); float y = (float) Math.cos((ticks + 50 * i) / 5F) / 10F; - GL11.glPushMatrix(); - GL11.glTranslatef(x, y, z); + GlStateManager.pushMatrix(); + GlStateManager.translate(x, y, z); float xRotate = (float) Math.sin(ticks * rotationModifier) / 2F; float yRotate = (float) Math.max(0.6F, Math.sin(ticks * 0.1F) / 2F + 0.5F); float zRotate = (float) Math.cos(ticks * rotationModifier) / 2F; v /= 2F; - GL11.glTranslatef(v, v, v); - GL11.glRotatef(deg, xRotate, yRotate, zRotate); - GL11.glTranslatef(-v, -v, -v); + GlStateManager.translate(v, v, v); + GlStateManager.rotate(deg, xRotate, yRotate, zRotate); + GlStateManager.translate(-v, -v, -v); v *= 2F; - GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.color(1F, 1F, 1F, 1F); - ItemStack stack = altar.getStackInSlot(i); - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); - IIcon icon = stack.getItem().getIcon(stack, 0); - if(icon != null) { - Color color = new Color(stack.getItem().getColorFromItemStack(stack, 0)); - GL11.glColor3ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue()); - float f = icon.getMinU(); - float f1 = icon.getMaxU(); - float f2 = icon.getMinV(); - float f3 = icon.getMaxV(); - ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F); - GL11.glColor3f(1F, 1F, 1F); - } - - GL11.glPopMatrix(); + ItemStack stack = altar.getItemHandler().getStackInSlot(i); + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + Minecraft.getMinecraft().getRenderItem().renderItem(stack, ItemCameraTransforms.TransformType.GROUND); + GlStateManager.popMatrix(); } - GL11.glPopMatrix(); + GlStateManager.popMatrix(); } } - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); - Block block = lava ? Blocks.lava : Blocks.water; + + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + Fluid fluid = lava ? FluidRegistry.LAVA : FluidRegistry.WATER; int brightness = lava ? 240 : -1; float alpha = lava ? 1F : 0.7F; - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glDisable(GL11.GL_ALPHA_TEST); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.disableAlpha(); if(lava) - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glColor4f(1F, 1F, 1F, alpha); - GL11.glTranslatef(w, -0.3F, w); - GL11.glRotatef(90F, 1F, 0F, 0F); - GL11.glScalef(s, s, s); + GlStateManager.disableLighting(); + GlStateManager.color(1F, 1F, 1F, alpha); + GlStateManager.translate(w, -0.3F, w); + GlStateManager.rotate(90F, 1F, 0F, 0F); + GlStateManager.scale(s, s, s); - renderIcon(0, 0, block.getIcon(0, 0), 16, 16, brightness); + renderIcon(0, 0, fluid.getStill(), 16, 16, brightness); if(lava) - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_ALPHA_TEST); - GL11.glDisable(GL11.GL_BLEND); - GL11.glPopMatrix(); + GlStateManager.enableLighting(); + GlStateManager.enableAlpha(); + GlStateManager.disableBlend(); + GlStateManager.popMatrix(); } - GL11.glPopMatrix(); - - forceMeta = -1; + GlStateManager.popMatrix(); } - public void renderIcon(int par1, int par2, IIcon par3Icon, int par4, int par5, int brightness) { - Tessellator tessellator = Tessellator.instance; - tessellator.startDrawingQuads(); - if(brightness != -1) - tessellator.setBrightness(brightness); - tessellator.addVertexWithUV(par1 + 0, par2 + par5, 0, par3Icon.getMinU(), par3Icon.getMaxV()); - tessellator.addVertexWithUV(par1 + par4, par2 + par5, 0, par3Icon.getMaxU(), par3Icon.getMaxV()); - tessellator.addVertexWithUV(par1 + par4, par2 + 0, 0, par3Icon.getMaxU(), par3Icon.getMinV()); - tessellator.addVertexWithUV(par1 + 0, par2 + 0, 0, par3Icon.getMinU(), par3Icon.getMinV()); + public void renderIcon(int par1, int par2, ResourceLocation loc, int par4, int par5, int brightness) { + TextureAtlasSprite par3Icon = Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(loc.toString()); + Tessellator tessellator = Tessellator.getInstance(); + tessellator.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); + //if(brightness != -1) + //tessellator.getBuffer().putBrightness4(brightness, brightness, brightness, brightness); + tessellator.getBuffer().pos(par1 + 0, par2 + par5, 0).tex(par3Icon.getMinU(), par3Icon.getMaxV()).endVertex(); + tessellator.getBuffer().pos(par1 + par4, par2 + par5, 0).tex(par3Icon.getMaxU(), par3Icon.getMaxV()).endVertex(); + tessellator.getBuffer().pos(par1 + par4, par2 + 0, 0).tex(par3Icon.getMaxU(), par3Icon.getMinV()).endVertex(); + tessellator.getBuffer().pos(par1 + 0, par2 + 0, 0).tex(par3Icon.getMinU(), par3Icon.getMinV()).endVertex(); tessellator.draw(); } diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileAvatar.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileAvatar.java index 03dd328c6..19577f4c3 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileAvatar.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileAvatar.java @@ -10,29 +10,27 @@ */ package vazkii.botania.client.render.tile; -import java.awt.Color; - import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.OpenGlHelper; -import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; - import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - import vazkii.botania.api.item.IAvatarWieldable; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.client.core.handler.ClientTickHandler; import vazkii.botania.client.lib.LibResources; import vazkii.botania.client.model.ModelAvatar; +import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.tile.TileAvatar; -public class RenderTileAvatar extends TileEntitySpecialRenderer { +import javax.annotation.Nonnull; + +public class RenderTileAvatar extends TileEntitySpecialRenderer { private static final float[] ROTATIONS = new float[] { 180F, 0F, 90F, 270F @@ -42,72 +40,68 @@ public class RenderTileAvatar extends TileEntitySpecialRenderer { private static final ModelAvatar model = new ModelAvatar(); @Override - public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float pticks) { - TileAvatar avatar = (TileAvatar) tileentity; + public void renderTileEntityAt(@Nonnull TileAvatar avatar, double d0, double d1, double d2, float pticks, int digProgress) { + if (avatar != null) + if (!avatar.getWorld().isBlockLoaded(avatar.getPos(), false) + || avatar.getWorld().getBlockState(avatar.getPos()).getBlock() != ModBlocks.avatar) + return; - GL11.glPushMatrix(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glColor4f(1F, 1F, 1F, 1F); - GL11.glTranslated(d0, d1, d2); + GlStateManager.pushMatrix(); + GlStateManager.enableRescaleNormal(); + GlStateManager.color(1F, 1F, 1F, 1F); + GlStateManager.translate(d0, d1, d2); Minecraft.getMinecraft().renderEngine.bindTexture(texture); - int meta = avatar.getWorldObj() != null ? avatar.getBlockMetadata() : 0; + EnumFacing facing = avatar != null && avatar.getWorld() != null + ? avatar.getWorld().getBlockState(avatar.getPos()).getValue(BotaniaStateProps.CARDINALS) + : EnumFacing.SOUTH; - GL11.glTranslatef(0.5F, 1.6F, 0.5F); - GL11.glScalef(1F, -1F, -1F); - GL11.glRotatef(ROTATIONS[Math.max(Math.min(ROTATIONS.length - 1, meta - 2), 0)], 0F, 1F, 0F); + GlStateManager.translate(0.5F, 1.6F, 0.5F); + GlStateManager.scale(1F, -1F, -1F); + GlStateManager.rotate(ROTATIONS[Math.max(Math.min(ROTATIONS.length - 1, facing.getIndex() - 2), 0)], 0F, 1F, 0F); model.render(); - ItemStack stack = avatar.getStackInSlot(0); - if(stack != null) { - GL11.glPushMatrix(); - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); - float s = 0.4F; - GL11.glScalef(s, s, s); - GL11.glRotatef(90F, 0F, 1F, 0F); - GL11.glRotatef(180F, 0F, 0F, 1F); - GL11.glTranslated(-1.2F, -3.5F, -0.65F); - GL11.glRotatef(20F, 0F, 0F, 1F); + if (avatar == null) { + GlStateManager.color(1F, 1F, 1F); + GlStateManager.scale(1F, -1F, -1F); + GlStateManager.enableRescaleNormal(); + GlStateManager.popMatrix(); + return; + } - int renderPass = 0; - do { - IIcon icon = stack.getItem().getIcon(stack, renderPass); - if(icon != null) { - Color color = new Color(stack.getItem().getColorFromItemStack(stack, renderPass)); - GL11.glColor3ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue()); - float f = icon.getMinU(); - float f1 = icon.getMaxU(); - float f2 = icon.getMinV(); - float f3 = icon.getMaxV(); - ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F); - GL11.glColor3f(1F, 1F, 1F); - } - renderPass++; - } while(renderPass < stack.getItem().getRenderPasses(stack.getItemDamage())); - GL11.glPopMatrix(); + ItemStack stack = avatar.getItemHandler().getStackInSlot(0); + if(stack != null) { + GlStateManager.pushMatrix(); + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + float s = 0.6F; + GlStateManager.scale(s, s, s); + GlStateManager.translate(-0.5F, 2F, -0.25F); + GlStateManager.rotate(-70, 1, 0, 0); + Minecraft.getMinecraft().getRenderItem().renderItem(stack, ItemCameraTransforms.TransformType.THIRD_PERSON_RIGHT_HAND); + GlStateManager.popMatrix(); IAvatarWieldable wieldable = (IAvatarWieldable) stack.getItem(); Minecraft.getMinecraft().renderEngine.bindTexture(wieldable.getOverlayResource(avatar, stack)); s = 1.01F; - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glScalef(s, s, s); - GL11.glTranslatef(0F, -0.01F, 0F); + GlStateManager.pushMatrix(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.scale(s, s, s); + GlStateManager.translate(0F, -0.01F, 0F); int light = 15728880; int lightmapX = light % 65536; int lightmapY = light / 65536; OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapX, lightmapY); float alpha = (float) Math.sin(ClientTickHandler.ticksInGame / 20D) / 2F + 0.5F; - GL11.glColor4f(1F, 1F, 1F, alpha + 0.183F); + GlStateManager.color(1F, 1F, 1F, alpha + 0.183F); model.render(); - GL11.glPopMatrix(); + GlStateManager.popMatrix(); } - GL11.glColor3f(1F, 1F, 1F); - GL11.glScalef(1F, -1F, -1F); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glPopMatrix(); + GlStateManager.color(1F, 1F, 1F); + GlStateManager.scale(1F, -1F, -1F); + GlStateManager.enableRescaleNormal(); + GlStateManager.popMatrix(); } } diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileBellows.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileBellows.java index 77cd86806..b1284eb67 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileBellows.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileBellows.java @@ -11,18 +11,17 @@ package vazkii.botania.client.render.tile; import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - import vazkii.botania.client.lib.LibResources; import vazkii.botania.client.model.ModelBellows; +import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.tile.mana.TileBellows; -public class RenderTileBellows extends TileEntitySpecialRenderer { +import javax.annotation.Nonnull; + +public class RenderTileBellows extends TileEntitySpecialRenderer { private static final float[] ROTATIONS = new float[] { 180F, 0F, 90F, 270F @@ -32,25 +31,28 @@ public class RenderTileBellows extends TileEntitySpecialRenderer { private static final ModelBellows model = new ModelBellows(); @Override - public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) { - TileBellows bellows = (TileBellows) tileentity; - - GL11.glPushMatrix(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glColor4f(1F, 1F, 1F, 1F); - GL11.glTranslated(d0, d1, d2); + public void renderTileEntityAt(@Nonnull TileBellows bellows, double d0, double d1, double d2, float f, int digProgress) { + if (bellows != null) + if (!bellows.getWorld().isBlockLoaded(bellows.getPos(), false) + || bellows.getWorld().getBlockState(bellows.getPos()).getBlock() != ModBlocks.bellows) + return; + + GlStateManager.pushMatrix(); + GlStateManager.enableRescaleNormal(); + GlStateManager.color(1F, 1F, 1F, 1F); + GlStateManager.translate(d0, d1, d2); Minecraft.getMinecraft().renderEngine.bindTexture(texture); - int meta = bellows.getWorldObj() != null ? bellows.getBlockMetadata() : 0; + int meta = bellows != null && bellows.getWorld() != null ? bellows.getBlockMetadata() : 0; - GL11.glTranslatef(0.5F, 1.5F, 0.5F); - GL11.glScalef(1F, -1F, -1F); - GL11.glRotatef(ROTATIONS[Math.max(Math.min(ROTATIONS.length, meta - 2), 0)], 0F, 1F, 0F); - model.render(Math.max(0.1F, 1F - (bellows.movePos + bellows.moving * f + 0.1F))); - GL11.glColor3f(1F, 1F, 1F); - GL11.glScalef(1F, -1F, -1F); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glPopMatrix(); + GlStateManager.translate(0.5F, 1.5F, 0.5F); + GlStateManager.scale(1F, -1F, -1F); + GlStateManager.rotate(ROTATIONS[Math.max(Math.min(ROTATIONS.length, meta - 2), 0)], 0F, 1F, 0F); + model.render(Math.max(0.1F, 1F - (bellows == null ? 0 : (bellows.movePos + bellows.moving * f + 0.1F)))); + GlStateManager.color(1F, 1F, 1F); + GlStateManager.scale(1F, -1F, -1F); + GlStateManager.enableRescaleNormal(); + GlStateManager.popMatrix(); } } diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileBrewery.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileBrewery.java index d649d0edc..dc918cd54 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileBrewery.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileBrewery.java @@ -10,98 +10,56 @@ */ package vazkii.botania.client.render.tile; -import java.awt.Color; - -import net.minecraft.block.Block; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.ItemRenderer; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.ForgeHooksClient; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - import vazkii.botania.client.core.handler.ClientTickHandler; import vazkii.botania.client.lib.LibResources; import vazkii.botania.client.model.ModelBrewery; import vazkii.botania.common.block.tile.TileBrewery; -public class RenderTileBrewery extends TileEntitySpecialRenderer { +import javax.annotation.Nonnull; + +public class RenderTileBrewery extends TileEntitySpecialRenderer { private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_BREWERY); - ModelBrewery model = new ModelBrewery(); + final ModelBrewery model = new ModelBrewery(); public TileBrewery brewery; - public static boolean rotate = true; @Override - public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) { - brewery = (TileBrewery) tileentity; - GL11.glPushMatrix(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glColor4f(1F, 1F, 1F, 1F); - GL11.glTranslated(d0, d1, d2); + public void renderTileEntityAt(@Nonnull TileBrewery brewery, double d0, double d1, double d2, float f, int digProgress) { + this.brewery = brewery; + GlStateManager.pushMatrix(); + GlStateManager.enableRescaleNormal(); + GlStateManager.color(1F, 1F, 1F, 1F); + GlStateManager.translate(d0, d1, d2); Minecraft.getMinecraft().renderEngine.bindTexture(texture); - GL11.glScalef(1F, -1F, -1F); - GL11.glTranslatef(0.5F, -1.5F, -0.5F); + GlStateManager.scale(1F, -1F, -1F); + GlStateManager.translate(0.5F, -1.5F, -0.5F); double time = ClientTickHandler.ticksInGame + f; - if(!rotate) - time = -1; model.render(this, time); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glPopMatrix(); + GlStateManager.enableRescaleNormal(); + GlStateManager.popMatrix(); } public void renderItemStack(ItemStack stack) { if(stack != null) { Minecraft mc = Minecraft.getMinecraft(); - mc.renderEngine.bindTexture(stack.getItem() instanceof ItemBlock ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture); + GlStateManager.pushMatrix(); + mc.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); float s = 0.25F; - GL11.glScalef(s, s, s); - GL11.glScalef(2F, 2F, 2F); - if(!ForgeHooksClient.renderEntityItem(new EntityItem(brewery.getWorldObj(), brewery.xCoord, brewery.yCoord, brewery.zCoord, stack), stack, 0F, 0F, brewery.getWorldObj().rand, mc.renderEngine, RenderBlocks.getInstance(), 1)) { - GL11.glScalef(0.5F, 0.5F, 0.5F); - if(stack.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(stack.getItem()).getRenderType())) { - GL11.glScalef(0.5F, 0.5F, 0.5F); - GL11.glTranslatef(1F, 1.1F, 0F); - GL11.glPushMatrix(); - RenderBlocks.getInstance().renderBlockAsItem(Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 1F); - GL11.glPopMatrix(); - GL11.glTranslatef(-1F, -1.1F, 0F); - GL11.glScalef(2F, 2F, 2F); - } else { - int renderPass = 0; - do { - IIcon icon = stack.getItem().getIcon(stack, renderPass); - if(icon != null) { - Color color = new Color(stack.getItem().getColorFromItemStack(stack, renderPass)); - GL11.glColor3ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue()); - float f = icon.getMinU(); - float f1 = icon.getMaxU(); - float f2 = icon.getMinV(); - float f3 = icon.getMaxV(); - - ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F); - GL11.glColor3f(1F, 1F, 1F); - } - renderPass++; - } while(renderPass < stack.getItem().getRenderPasses(stack.getItemDamage())); - } - } - GL11.glScalef(1F / s, 1F / s, 1F / s); - + GlStateManager.scale(s, s, s); + mc.getRenderItem().renderItem(stack, ItemCameraTransforms.TransformType.GROUND); + GlStateManager.scale(1F / s, 1F / s, 1F / s); + GlStateManager.popMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(texture); } } diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileCocoon.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileCocoon.java index ff7b4679b..51b884e39 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileCocoon.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileCocoon.java @@ -10,27 +10,21 @@ */ package vazkii.botania.client.render.tile; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.block.model.IBakedModel; +import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; - import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - -import vazkii.botania.client.lib.LibResources; -import vazkii.botania.client.model.ModelCocoon; import vazkii.botania.common.block.tile.TileCocoon; -public class RenderTileCocoon extends TileEntitySpecialRenderer { +import javax.annotation.Nonnull; - private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_COCOON); - ModelCocoon model = new ModelCocoon(); +public class RenderTileCocoon extends TileEntitySpecialRenderer { @Override - public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) { - TileCocoon cocoon = (TileCocoon) tileentity; - + public void renderTileEntityAt(@Nonnull TileCocoon cocoon, double d0, double d1, double d2, float f, int digProgress) { float rot = 0F; float modval = 60F - (float) cocoon.timePassed / (float) TileCocoon.TOTAL_TIME * 30F; if(cocoon.timePassed % modval < 10) { @@ -39,19 +33,21 @@ public class RenderTileCocoon extends TileEntitySpecialRenderer { rot = (float) Math.sin(v) * (float) Math.log(cocoon.timePassed + f); } - GL11.glPushMatrix(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1F, 1F, 1F, 1F); - GL11.glTranslated(d0, d1, d2); - Minecraft.getMinecraft().renderEngine.bindTexture(texture); - GL11.glRotatef(90F, 1F, 0F, 0F); - GL11.glTranslatef(0.5F, -0.5F - 3F / 16F, -0.5F + 1F / 16F); - GL11.glRotatef(rot, 0F, 1F, 0F); - model.render(); - GL11.glColor3f(1F, 1F, 1F); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glPopMatrix(); + GlStateManager.pushMatrix(); + GlStateManager.enableRescaleNormal(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.color(1F, 1F, 1F, 1F); + GlStateManager.translate(d0, d1, d2 + 1); + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + GlStateManager.translate(0.5F, 0, 0F); + GlStateManager.rotate(rot, 1F, 0F, 0F); + GlStateManager.translate(-0.5F, 0, 0F); + IBlockState state = cocoon.getWorld().getBlockState(cocoon.getPos()); + IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelForState(state); + Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelRenderer().renderModelBrightness(model, state, 1.0F, false); + GlStateManager.color(1F, 1F, 1F); + GlStateManager.enableRescaleNormal(); + GlStateManager.popMatrix(); } } diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileCorporeaCrystalCube.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileCorporeaCrystalCube.java index 71f7d6eef..a84aae581 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileCorporeaCrystalCube.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileCorporeaCrystalCube.java @@ -10,71 +10,91 @@ */ package vazkii.botania.client.render.tile; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.entity.Render; -import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.BlockRendererDispatcher; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.VertexBuffer; +import net.minecraft.client.renderer.block.model.IBakedModel; +import net.minecraft.client.renderer.entity.RenderEntityItem; +import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.entity.item.EntityItem; import net.minecraft.init.Blocks; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; - +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; +import net.minecraftforge.client.MinecraftForgeClient; +import net.minecraftforge.client.model.animation.Animation; +import net.minecraftforge.common.animation.Event; +import net.minecraftforge.common.model.IModelState; +import net.minecraftforge.common.model.animation.CapabilityAnimation; +import net.minecraftforge.common.property.IExtendedBlockState; +import net.minecraftforge.common.property.Properties; +import org.apache.commons.lang3.tuple.Pair; import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - import vazkii.botania.client.core.handler.ClientTickHandler; -import vazkii.botania.client.lib.LibResources; -import vazkii.botania.client.model.ModelCrystalCube; import vazkii.botania.common.block.tile.corporea.TileCorporeaCrystalCube; +import vazkii.botania.common.core.handler.MethodHandles; -public class RenderTileCorporeaCrystalCube extends TileEntitySpecialRenderer { +import javax.annotation.Nonnull; - private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_CRYSTAL_CUBE); - ModelCrystalCube model = new ModelCrystalCube(); - EntityItem entity = null; +public class RenderTileCorporeaCrystalCube extends TileEntitySpecialRenderer { + + private EntityItem entity = null; + private RenderEntityItem itemRenderer = null; @Override - public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) { - TileCorporeaCrystalCube cube = (TileCorporeaCrystalCube) tileentity; + public void renderTileEntityAt(@Nonnull TileCorporeaCrystalCube cube, double d0, double d1, double d2, float f, int digProgress) { + ItemStack stack = null; + if (cube != null) { + if(entity == null) + entity = new EntityItem(cube.getWorld(), cube.getPos().getX(), cube.getPos().getY(), cube.getPos().getZ(), new ItemStack(Blocks.STONE)); - if(entity == null) - entity = new EntityItem(cube.getWorldObj(), cube.xCoord, cube.yCoord, cube.zCoord, new ItemStack(Blocks.stone)); + if(itemRenderer == null) + itemRenderer = new RenderEntityItem(Minecraft.getMinecraft().getRenderManager(), Minecraft.getMinecraft().getRenderItem()) { + @Override + public boolean shouldBob() { + return false; + } + }; - entity.age = ClientTickHandler.ticksInGame; - ItemStack stack = cube.getRequestTarget(); - entity.setEntityItemStack(stack); + try { + MethodHandles.itemAge_setter.invokeExact(entity, ClientTickHandler.ticksInGame); + } catch (Throwable ignored) {} - double time = ClientTickHandler.ticksInGame + f; - double worldTicks = tileentity.getWorldObj() == null ? 0 : time; - - Minecraft mc = Minecraft.getMinecraft(); - GL11.glPushMatrix(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1F, 1F, 1F, 1F); - GL11.glTranslated(d0, d1, d2); - mc.renderEngine.bindTexture(texture); - GL11.glTranslatef(0.5F, 1.5F, 0.5F); - GL11.glScalef(1F, -1F, -1F); - model.renderBase(); - GL11.glTranslatef(0F, (float) Math.sin(worldTicks / 20.0) * 0.05F, 0F); - if(stack != null) { - GL11.glPushMatrix(); - float s = stack.getItem() instanceof ItemBlock ? 0.7F : 0.5F; - GL11.glTranslatef(0F, 0.8F, 0F); - GL11.glScalef(s, s, s); - GL11.glRotatef(180F, 0F, 0F, 1F); - ((Render) RenderManager.instance.entityRenderMap.get(EntityItem.class)).doRender(entity, 0, 0, 0, 1F, f); - GL11.glPopMatrix(); - mc.renderEngine.bindTexture(texture); + stack = cube.getRequestTarget(); + entity.setEntityItemStack(stack); } - GL11.glColor4f(1F, 1F, 1F, 0.4F); - model.renderCube(); - GL11.glColor3f(1F, 1F, 1F); + double time = ClientTickHandler.ticksInGame + f; + double worldTicks = cube == null || cube.getWorld() == null ? 0 : time; + + Minecraft mc = Minecraft.getMinecraft(); + GlStateManager.pushMatrix(); + GlStateManager.enableRescaleNormal(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.color(1F, 1F, 1F, 1F); + GlStateManager.translate(d0, d1, d2); + GlStateManager.translate(0.5F, 1.5F, 0.5F); + GlStateManager.scale(1F, -1F, -1F); + GlStateManager.translate(0F, (float) Math.sin(worldTicks / 20.0 * 1.55) * 0.025F, 0F); + if(stack != null) { + GlStateManager.pushMatrix(); + float s = stack.getItem() instanceof ItemBlock ? 0.7F : 0.5F; + GlStateManager.translate(0F, 0.8F, 0F); + GlStateManager.scale(s, s, s); + GlStateManager.rotate(180F, 0F, 0F, 1F); + itemRenderer.doRender(entity, 0, 0, 0, 1F, f); + GlStateManager.popMatrix(); + } + + GlStateManager.color(1F, 1F, 1F); if(stack != null) { int count = cube.getItemCount(); @@ -92,26 +112,91 @@ public class RenderTileCorporeaCrystalCube extends TileEntitySpecialRenderer { int colorShade = (color & 16579836) >> 2 | color & -16777216; float s = 1F / 64F; - GL11.glScalef(s, s, s); - GL11.glDisable(GL11.GL_LIGHTING); - int l = mc.fontRenderer.getStringWidth(countStr); + GlStateManager.scale(s, s, s); + GlStateManager.disableLighting(); + int l = mc.fontRendererObj.getStringWidth(countStr); - GL11.glTranslatef(0F, 55F, 0F); + GlStateManager.translate(0F, 55F, 0F); float tr = -16.5F; for(int i = 0; i < 4; i++) { - GL11.glRotatef(90F, 0F, 1F, 0F); - GL11.glTranslatef(0F, 0F, tr); - mc.fontRenderer.drawString(countStr, -l / 2, 0, color); - GL11.glTranslatef(0F, 0F, 0.1F); - mc.fontRenderer.drawString(countStr, -l / 2 + 1, 1, colorShade); - GL11.glTranslatef(0F, 0F, -tr - 0.1F); + GlStateManager.rotate(90F, 0F, 1F, 0F); + GlStateManager.translate(0F, 0F, tr); + mc.fontRendererObj.drawString(countStr, -l / 2, 0, color); + GlStateManager.translate(0F, 0F, 0.1F); + mc.fontRendererObj.drawString(countStr, -l / 2 + 1, 1, colorShade); + GlStateManager.translate(0F, 0F, -tr - 0.1F); } - GL11.glEnable(GL11.GL_LIGHTING); + GlStateManager.enableLighting(); } - GL11.glScalef(1F, -1F, -1F); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glPopMatrix(); + GlStateManager.scale(1F, -1F, -1F); + GlStateManager.enableRescaleNormal(); + GlStateManager.popMatrix(); + + renderAnimatedModel(cube, d0, d1, d2, f); + } + + // Copied from AnimationTESR + private static BlockRendererDispatcher blockRenderer; + + private void renderAnimatedModel(TileCorporeaCrystalCube te, double x, double y, double z, float partialTick) { + // From FastTESR.renderTileEntityAt + Tessellator tessellator = Tessellator.getInstance(); + VertexBuffer worldRenderer = tessellator.getBuffer(); + this.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + RenderHelper.disableStandardItemLighting(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.enableBlend(); + GlStateManager.disableCull(); + + if (Minecraft.isAmbientOcclusionEnabled()) + { + GlStateManager.shadeModel(GL11.GL_SMOOTH); + } + else + { + GlStateManager.shadeModel(GL11.GL_FLAT); + } + + worldRenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK); + + // Inlined AnimationTESR.renderTileEntityFast + if(!te.hasCapability(CapabilityAnimation.ANIMATION_CAPABILITY, null)) + { + return; + } + if(blockRenderer == null) blockRenderer = Minecraft.getMinecraft().getBlockRendererDispatcher(); + BlockPos pos = te.getPos(); + IBlockAccess world = MinecraftForgeClient.getRegionRenderCache(te.getWorld(), pos); + IBlockState state = world.getBlockState(pos); + if(state.getPropertyNames().contains(Properties.StaticProperty)) + { + state = state.withProperty(Properties.StaticProperty, false); + } + if(state instanceof IExtendedBlockState) + { + IExtendedBlockState exState = (IExtendedBlockState)state; + if(exState.getUnlistedNames().contains(Properties.AnimationProperty)) + { + float time = Animation.getWorldTime(getWorld(), partialTick); + Pair> pair = te.getCapability(CapabilityAnimation.ANIMATION_CAPABILITY, null).apply(time); + // handleEvents(te, time, pair.getRight()); + + IBakedModel model = blockRenderer.getBlockModelShapes().getModelForState(exState.getClean()); + exState = exState.withProperty(Properties.AnimationProperty, pair.getLeft()); + + worldRenderer.setTranslation(x - pos.getX(), y - pos.getY(), z - pos.getZ()); + + blockRenderer.getBlockModelRenderer().renderModel(world, model, exState, pos, worldRenderer, false); + } + } + // End inline AnimationTESR.renderTileEntityFast + + worldRenderer.setTranslation(0, 0, 0); + + tessellator.draw(); + + RenderHelper.enableStandardItemLighting(); } } diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileCorporeaIndex.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileCorporeaIndex.java index 3e66131aa..6efd32834 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileCorporeaIndex.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileCorporeaIndex.java @@ -12,62 +12,61 @@ package vazkii.botania.client.render.tile; import net.minecraft.client.Minecraft; import net.minecraft.client.model.ModelEnderCrystal; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - import vazkii.botania.client.core.helper.RenderHelper; import vazkii.botania.client.lib.LibResources; import vazkii.botania.common.block.tile.corporea.TileCorporeaIndex; -public class RenderTileCorporeaIndex extends TileEntitySpecialRenderer { +import javax.annotation.Nonnull; + +public class RenderTileCorporeaIndex extends TileEntitySpecialRenderer { private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_CORPOREA_INDEX); - ModelEnderCrystal crystal = new ModelEnderCrystal(0F, false); + final ModelEnderCrystal crystal = new ModelEnderCrystal(0F, false); public static boolean move = true; @Override - public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partticks) { - TileCorporeaIndex index = (TileCorporeaIndex) tile; + public void renderTileEntityAt(@Nonnull TileCorporeaIndex index, double x, double y, double z, float partticks, int digProgress) { + move = index != null; - GL11.glPushMatrix(); - GL11.glTranslated(x + 0.5, y, z + 0.5); + GlStateManager.pushMatrix(); + GlStateManager.translate(x + 0.5, y, z + 0.5); Minecraft.getMinecraft().renderEngine.bindTexture(texture); float translation = move ? (float) ((Math.cos((index.ticksWithCloseby + (index.hasCloseby ? partticks : 0)) / 10F) * 0.5 + 0.5) * 0.25) : 0F; float rotation = move ? index.ticks * 2 + partticks : 0F; float scale = 0.6F; - GL11.glScalef(scale, scale, scale); + GlStateManager.scale(scale, scale, scale); crystal.render(null, 0F, rotation, translation, 0F, 0F, 1F / 16F); - GL11.glScalef(1F / scale, 1F / scale, 1F / scale); + GlStateManager.scale(1F / scale, 1F / scale, 1F / scale); - if(index.closeby > 0F) { + if(index != null && index.closeby > 0F) { float starScale = 0.02F; float starRadius = (float) TileCorporeaIndex.RADIUS * index.closeby + (index.closeby == 1F ? 0F : index.hasCloseby ? partticks : -partticks) * 0.2F; double rads = (index.ticksWithCloseby + partticks) * 2 * Math.PI / 180; double starX = Math.cos(rads) * starRadius; double starZ = Math.sin(rads) * starRadius; int color = 0xFF00FF; - int seed = index.xCoord ^ index.yCoord ^ index.zCoord; + int seed = index.getPos().getX() ^ index.getPos().getY() ^ index.getPos().getZ(); - GL11.glTranslated(starX, 0.3, starZ); + GlStateManager.translate(starX, 0.3, starZ); RenderHelper.renderStar(color, starScale, starScale, starScale, seed); - GL11.glTranslated(-starX * 2, 0, -starZ * 2); + GlStateManager.translate(-starX * 2, 0, -starZ * 2); RenderHelper.renderStar(color, starScale, starScale, starScale, seed); - GL11.glTranslated(starX, 0, starZ); + GlStateManager.translate(starX, 0, starZ); rads = -rads; starX = Math.cos(rads) * starRadius; starZ = Math.sin(rads) * starRadius; - GL11.glTranslated(starX, 0, starZ); + GlStateManager.translate(starX, 0, starZ); RenderHelper.renderStar(color, starScale, starScale, starScale, seed); - GL11.glTranslated(-starX * 2, 0, -starZ * 2); + GlStateManager.translate(-starX * 2, 0, -starZ * 2); RenderHelper.renderStar(color, starScale, starScale, starScale, seed); - GL11.glTranslated(starX, 0, starZ); + GlStateManager.translate(starX, 0, starZ); } - GL11.glPopMatrix(); + GlStateManager.popMatrix(); } } diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileEnchanter.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileEnchanter.java index 6d9b654fa..351dde8b2 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileEnchanter.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileEnchanter.java @@ -11,110 +11,111 @@ package vazkii.botania.client.render.tile; import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.Render; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.entity.item.EntityItem; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; - import org.lwjgl.opengl.GL11; - import vazkii.botania.client.core.handler.ClientTickHandler; +import vazkii.botania.client.core.handler.MiscellaneousIcons; import vazkii.botania.client.core.helper.ShaderHelper; -import vazkii.botania.common.block.mana.BlockEnchanter; import vazkii.botania.common.block.tile.TileEnchanter; +import vazkii.botania.common.core.handler.MethodHandles; -public class RenderTileEnchanter extends TileEntitySpecialRenderer { +import javax.annotation.Nonnull; - RenderItem renderItem = new RenderItem(); - EntityItem item; +public class RenderTileEnchanter extends TileEntitySpecialRenderer { + + private EntityItem item; @Override - public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) { - TileEnchanter enchanter = (TileEnchanter) tileentity; + public void renderTileEntityAt(@Nonnull TileEnchanter enchanter, double d0, double d1, double d2, float f, int digProgress) { float alphaMod = 0F; - if(enchanter.stage == 2) + if(enchanter.stage == TileEnchanter.State.GATHER_MANA) alphaMod = Math.min(20, enchanter.stageTicks) / 20F; - else if(enchanter.stage == 4) + else if(enchanter.stage == TileEnchanter.State.RESET) alphaMod = (20 - enchanter.stageTicks) / 20F; - else if(enchanter.stage > 2) + else if(enchanter.stage == TileEnchanter.State.DO_ENCHANT) alphaMod = 1F; if(enchanter.itemToEnchant != null) { if(item == null) - item = new EntityItem(enchanter.getWorldObj(), enchanter.xCoord, enchanter.yCoord + 1, enchanter.zCoord, enchanter.itemToEnchant); + item = new EntityItem(enchanter.getWorld(), enchanter.getPos().getX(), enchanter.getPos().getY() + 1, enchanter.getPos().getZ(), enchanter.itemToEnchant); + + try { + MethodHandles.itemAge_setter.invokeExact(item, ClientTickHandler.ticksInGame); + } catch (Throwable ignored) {} - item.age = ClientTickHandler.ticksInGame; item.setEntityItemStack(enchanter.itemToEnchant); - GL11.glColor4f(1F, 1F, 1F, 1F); - GL11.glTranslatef(0.5F, 1.25F, 0.5F); - ((Render) RenderManager.instance.entityRenderMap.get(EntityItem.class)).doRender(item, d0, d1, d2, 1F, f); - GL11.glTranslatef(-0.5F, -1.25F, -0.5F); + GlStateManager.color(1F, 1F, 1F, 1F); + GlStateManager.translate(0.5F, 1.25F, 0.5F); + ((Render) Minecraft.getMinecraft().getRenderManager().entityRenderMap.get(EntityItem.class)).doRender(item, d0, d1, d2, 1F, f); + GlStateManager.translate(-0.5F, -1.25F, -0.5F); } - GL11.glPushMatrix(); - GL11.glTranslated(d0, d1, d2); + GlStateManager.pushMatrix(); + GlStateManager.translate(d0, d1, d2); - GL11.glRotated(90F, 1F, 0F, 0F); - GL11.glTranslatef(-2F, -2F, -0.001F); + GlStateManager.rotate(90F, 1F, 0F, 0F); + GlStateManager.translate(-2F, -2F, -0.001F); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1F, 1F, 1F, 1F); - GL11.glDisable(GL11.GL_ALPHA_TEST); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.color(1F, 1F, 1F, 1F); + GlStateManager.disableAlpha(); float alpha = (float) ((Math.sin((ClientTickHandler.ticksInGame + f) / 8D) + 1D) / 5D + 0.4D) * alphaMod; if(alpha > 0) { if(ShaderHelper.useShaders()) - GL11.glColor4f(1F, 1F, 1F, alpha); + GlStateManager.color(1F, 1F, 1F, alpha); else { int light = 15728880; int lightmapX = light % 65536; int lightmapY = light / 65536; OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapX, lightmapY); - GL11.glColor4f(0.6F + (float) ((Math.cos((ClientTickHandler.ticksInGame + f) / 6D) + 1D) / 5D), 0.1F, 0.9F, alpha); + GlStateManager.color(0.6F + (float) ((Math.cos((ClientTickHandler.ticksInGame + f) / 6D) + 1D) / 5D), 0.1F, 0.9F, alpha); } - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); - if(enchanter.stage == 3 || enchanter.stage == 4) { + if(enchanter.stage == TileEnchanter.State.DO_ENCHANT || enchanter.stage == TileEnchanter.State.RESET) { int ticks = enchanter.stageTicks + enchanter.stage3EndTicks; int angle = ticks * 2; float yTranslation = Math.min(20, ticks) / 20F * 1.15F; float scale = ticks < 10 ? 1F : 1F - Math.min(20, ticks - 10) / 20F * 0.75F; - GL11.glTranslatef(2.5F, 2.5F, -yTranslation); - GL11.glScalef(scale, scale, 1F); - GL11.glRotatef(angle, 0F, 0F, 1F); - GL11.glTranslatef(-2.5F, -2.5F, 0F); + GlStateManager.translate(2.5F, 2.5F, -yTranslation); + GlStateManager.scale(scale, scale, 1F); + GlStateManager.rotate(angle, 0F, 0F, 1F); + GlStateManager.translate(-2.5F, -2.5F, 0F); } ShaderHelper.useShader(ShaderHelper.enchanterRune); - renderIcon(0, 0, BlockEnchanter.overlay, 5, 5, 240); + renderIcon(0, 0, MiscellaneousIcons.INSTANCE.enchanterOverlay, 5, 5, 240); ShaderHelper.releaseShader(); } - GL11.glEnable(GL11.GL_ALPHA_TEST); - GL11.glDisable(GL11.GL_BLEND); - GL11.glColor4f(1F, 1F, 1F, 1F); - GL11.glPopMatrix(); + GlStateManager.enableAlpha(); + GlStateManager.disableBlend(); + GlStateManager.color(1F, 1F, 1F, 1F); + GlStateManager.popMatrix(); } - public void renderIcon(int par1, int par2, IIcon par3Icon, int par4, int par5, int brightness) { - Tessellator tessellator = Tessellator.instance; - tessellator.startDrawingQuads(); - tessellator.setBrightness(brightness); - tessellator.addVertexWithUV(par1 + 0, par2 + par5, 0, par3Icon.getMinU(), par3Icon.getMaxV()); - tessellator.addVertexWithUV(par1 + par4, par2 + par5, 0, par3Icon.getMaxU(), par3Icon.getMaxV()); - tessellator.addVertexWithUV(par1 + par4, par2 + 0, 0, par3Icon.getMaxU(), par3Icon.getMinV()); - tessellator.addVertexWithUV(par1 + 0, par2 + 0, 0, par3Icon.getMinU(), par3Icon.getMinV()); + private void renderIcon(int par1, int par2, TextureAtlasSprite par3Icon, int par4, int par5, int brightness) { + Tessellator tessellator = Tessellator.getInstance(); + tessellator.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); + //tessellator.getBuffer().setBrightness(brightness); + tessellator.getBuffer().pos(par1 + 0, par2 + par5, 0).tex(par3Icon.getMinU(), par3Icon.getMaxV()).endVertex(); + tessellator.getBuffer().pos(par1 + par4, par2 + par5, 0).tex(par3Icon.getMaxU(), par3Icon.getMaxV()).endVertex(); + tessellator.getBuffer().pos(par1 + par4, par2 + 0, 0).tex(par3Icon.getMaxU(), par3Icon.getMinV()).endVertex(); + tessellator.getBuffer().pos(par1 + 0, par2 + 0, 0).tex(par3Icon.getMinU(), par3Icon.getMinV()).endVertex(); tessellator.draw(); } diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileFloatingFlower.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileFloatingFlower.java index c688c2587..53b3132a3 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileFloatingFlower.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileFloatingFlower.java @@ -10,71 +10,57 @@ */ package vazkii.botania.client.render.tile; -import java.awt.*; -import java.util.Random; - +import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.ItemRenderer; -import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.BlockRendererDispatcher; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.block.model.IBakedModel; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; - -import org.lwjgl.opengl.GL11; - import vazkii.botania.client.core.handler.ClientTickHandler; -import vazkii.botania.client.model.ModelMiniIsland; -import vazkii.botania.common.block.decor.IFloatingFlower; +import vazkii.botania.common.core.handler.ConfigHandler; + +import javax.annotation.Nonnull; +import java.util.Random; public class RenderTileFloatingFlower extends TileEntitySpecialRenderer { - private static final ModelMiniIsland model = new ModelMiniIsland(); - @Override - public void renderTileEntityAt(TileEntity tile, double d0, double d1, double d2, float t) { - IFloatingFlower flower = (IFloatingFlower) tile; - GL11.glPushMatrix(); - GL11.glColor4f(1F, 1F, 1F, 1F); - GL11.glTranslated(d0, d1, d2); + public void renderTileEntityAt(@Nonnull TileEntity tile, double d0, double d1, double d2, float t, int digProgress) { + if(ConfigHandler.staticFloaters) + return; - double worldTime = tile.getWorldObj() == null ? 0 : (double) (ClientTickHandler.ticksInGame + t); - if(tile.getWorldObj() != null) - worldTime += new Random(tile.xCoord ^ tile.yCoord ^ tile.zCoord).nextInt(1000); + if (tile != null) + if (!tile.getWorld().isBlockLoaded(tile.getPos(), false)) + return; - GL11.glTranslatef(0.5F, 0F, 0.5F); - GL11.glRotatef(-((float) worldTime * 0.5F), 0F, 1F, 0F); - GL11.glTranslatef(-0.5F, 0F, -0.5F); - if(tile.getWorldObj() != null) { - GL11.glTranslatef(0F, (float) Math.sin(worldTime * 0.05F) * 0.1F, 0F); - GL11.glRotatef(4F * (float) Math.sin(worldTime * 0.04F), 1F, 0F, 0F); - } + BlockRendererDispatcher brd = Minecraft.getMinecraft().getBlockRendererDispatcher(); + GlStateManager.pushMatrix(); + GlStateManager.color(1F, 1F, 1F, 1F); + GlStateManager.translate(d0, d1, d2); - Minecraft.getMinecraft().renderEngine.bindTexture(flower.getIslandType().getResource()); - Color color = new Color(flower.getIslandType().getColor()); - GL11.glColor3f(color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f); - GL11.glPushMatrix(); - GL11.glTranslatef(0.5F, 1.4F, 0.5F); - GL11.glScalef(1F, -1F, -1F); - model.render(); - GL11.glPopMatrix(); - GL11.glColor3f(1f, 1f, 1f); + double worldTime = (double) (ClientTickHandler.ticksInGame + t); + if(tile.getWorld() != null) + worldTime += new Random(tile.getPos().hashCode()).nextInt(1000); - ItemStack stack = flower.getDisplayStack(); - IIcon icon = stack.getIconIndex(); + GlStateManager.translate(0.5F, 0, 0.5F); + GlStateManager.rotate(-((float) worldTime * 0.5F), 0F, 1F, 0F); + GlStateManager.translate(-0.5, (float) Math.sin(worldTime * 0.05F) * 0.1F, 0.5); + + GlStateManager.rotate(4F * (float) Math.sin(worldTime * 0.04F), 1F, 0F, 0F); + + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + + IBlockState state = tile.getWorld().getBlockState(tile.getPos()); + state = state.getBlock().getExtendedState(state, tile.getWorld(), tile.getPos()); + IBakedModel model = brd.getBlockModelShapes().getModelManager().getModel(new ModelResourceLocation("botania:floatingSpecialFlower", "inventory")); + brd.getBlockModelRenderer().renderModelBrightness(model, state, 1.0F, true); + + GlStateManager.popMatrix(); - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); - float f = icon.getMinU(); - float f1 = icon.getMaxU(); - float f2 = icon.getMinV(); - float f3 = icon.getMaxV(); - GL11.glTranslatef(0.25F, 0.4F, 0.5F); - GL11.glScalef(0.5F, 0.5F, 0.5F); - ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 32F); - GL11.glColor3f(1F, 1F, 1F); - GL11.glPopMatrix(); } } diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileGaiaHead.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileGaiaHead.java new file mode 100644 index 000000000..d5de22f41 --- /dev/null +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileGaiaHead.java @@ -0,0 +1,79 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + * + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + * + * File Created @ [? (GMT)] + */ +package vazkii.botania.client.render.tile; + +import com.mojang.authlib.GameProfile; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; +import net.minecraft.client.renderer.tileentity.TileEntitySkullRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.entity.boss.EntityDragon; +import net.minecraft.entity.boss.EntityWither; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntitySkeleton; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.monster.SkeletonType; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntitySkull; +import net.minecraft.util.EnumFacing; +import vazkii.botania.client.core.helper.ShaderHelper; +import vazkii.botania.client.render.entity.RenderDoppleganger; +import vazkii.botania.common.Botania; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +public class RenderTileGaiaHead extends TileEntitySkullRenderer { + @Override + public void renderTileEntityAt(TileEntitySkull skull, double x, double y, double z, float partialTicks, int digProgress) { + ShaderHelper.useShader(ShaderHelper.doppleganger, RenderDoppleganger.defaultCallback); + + // Null-safe copy of super + this.renderSkull((float)x, (float)y, (float)z, + skull == null ? EnumFacing.NORTH : EnumFacing.getFront(skull.getBlockMetadata() & 7), + skull == null ? 0 : skull.getSkullRotation() * 360 / 16.0F, + 3, null, digProgress, partialTicks); + + ShaderHelper.releaseShader(); + } + + @Override + public void setRendererDispatcher(@Nonnull TileEntityRendererDispatcher dispatcher) { + this.rendererDispatcher = dispatcher; + // Do not set `instance` to us, interferes with vanilla skulls + } + + @Override + public void renderSkull(float x, float y, float z, @Nonnull EnumFacing facing, float rotation, int skullType, @Nullable GameProfile profile, int destroyStage, float animateTicks) { + Minecraft mc = Minecraft.getMinecraft(); + Entity view = mc.getRenderViewEntity(); + + profile = null; + + if(view instanceof EntityPlayer) { + skullType = 3; + profile = ((EntityPlayer) mc.getRenderViewEntity()).getGameProfile(); + } else if (view instanceof EntitySkeleton) { + skullType = 0; + if (((EntitySkeleton) view).func_189771_df() == SkeletonType.WITHER) + skullType = 1; + } else if(view instanceof EntityWither) + skullType = 1; + else if(view instanceof EntityZombie) + skullType = 2; + else if(view instanceof EntityCreeper) + skullType = 4; + else if(view instanceof EntityDragon) + skullType = 5; + + super.renderSkull(x, y, z, facing, rotation, skullType, profile, destroyStage, animateTicks); + } +} \ No newline at end of file diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileHourglass.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileHourglass.java index c5bb50574..236fe9e33 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileHourglass.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileHourglass.java @@ -10,60 +10,57 @@ */ package vazkii.botania.client.render.tile; -import java.util.Random; - import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; - import org.lwjgl.opengl.GL11; - import vazkii.botania.client.core.handler.ClientTickHandler; import vazkii.botania.client.lib.LibResources; import vazkii.botania.client.model.ModelHourglass; import vazkii.botania.common.block.tile.TileHourglass; -public class RenderTileHourglass extends TileEntitySpecialRenderer { +import javax.annotation.Nonnull; +import java.util.Random; - ResourceLocation texture = new ResourceLocation(LibResources.MODEL_HOURGLASS); - ModelHourglass model = new ModelHourglass(); +public class RenderTileHourglass extends TileEntitySpecialRenderer { + + final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_HOURGLASS); + final ModelHourglass model = new ModelHourglass(); @Override - public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float ticks) { - TileHourglass hourglass = (TileHourglass) tileentity; - - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1F, 1F, 1F, 1F); - GL11.glTranslated(d0, d1, d2); + public void renderTileEntityAt(@Nonnull TileHourglass hourglass, double d0, double d1, double d2, float ticks, int digProgress) { + GlStateManager.pushMatrix(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.color(1F, 1F, 1F, 1F); + GlStateManager.translate(d0, d1, d2); Minecraft.getMinecraft().renderEngine.bindTexture(texture); - - int wtime = tileentity.getWorldObj() == null ? 0 : ClientTickHandler.ticksInGame; + boolean hasWorld = hourglass != null && hourglass.getWorld() != null; + int wtime = !hasWorld ? 0 : ClientTickHandler.ticksInGame; if(wtime != 0) - wtime += new Random(tileentity.xCoord ^ tileentity.yCoord ^ tileentity.zCoord).nextInt(360); + wtime += new Random(hourglass.getPos().hashCode()).nextInt(360); float time = wtime == 0 ? 0 : wtime + ticks; float x = 0.5F + (float) Math.cos(time * 0.05F) * 0.025F; float y = 0.55F + (float) (Math.sin(time * 0.04F) + 1F) * 0.05F; float z = 0.5F + (float) Math.sin(time * 0.05F) * 0.025F; - ItemStack stack = hourglass.getStackInSlot(0); + ItemStack stack = hasWorld ? hourglass.getItemHandler().getStackInSlot(0) : null; float fract1 = stack == null ? 0 : hourglass.timeFraction; float fract2 = stack == null ? 0 : 1F - hourglass.timeFraction; - GL11.glTranslatef(x, y, z); + GlStateManager.translate(x, y, z); - float rot = hourglass.flip ? 180F : 1F; - if(hourglass.flipTicks > 0) + float rot = hasWorld && hourglass.flip ? 180F : 1F; + if(hasWorld && hourglass.flipTicks > 0) rot += (hourglass.flipTicks - ticks) * (180F / 4F); - GL11.glRotatef(rot, 0F, 0F, 1F); + GlStateManager.rotate(rot, 0F, 0F, 1F); - GL11.glScalef(1F, -1F, -1F); - model.render(fract1, fract2, hourglass.flip, hourglass.getColor()); - GL11.glScalef(1F, -1F, -1F); - GL11.glPopMatrix(); + GlStateManager.scale(1F, -1F, -1F); + model.render(fract1, fract2, hasWorld && hourglass.flip, hasWorld ? hourglass.getColor() : 0); + GlStateManager.scale(1F, -1F, -1F); + GlStateManager.popMatrix(); } } diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileIncensePlate.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileIncensePlate.java index 3a786db70..1f16393e0 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileIncensePlate.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileIncensePlate.java @@ -10,82 +10,51 @@ */ package vazkii.botania.client.render.tile; -import java.awt.Color; - +import com.google.common.collect.ImmutableMap; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.ItemRenderer; -import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - -import vazkii.botania.client.lib.LibResources; -import vazkii.botania.client.model.ModelIncensePlate; +import net.minecraft.util.EnumFacing; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.tile.TileIncensePlate; -public class RenderTileIncensePlate extends TileEntitySpecialRenderer { +import javax.annotation.Nonnull; +import java.util.Map; - private static final float[] ROTATIONS = new float[] { - 180F, 0F, 90F, 270F - }; +public class RenderTileIncensePlate extends TileEntitySpecialRenderer { - ResourceLocation texture = new ResourceLocation(LibResources.MODEL_INCENSE_PLATE); - ModelIncensePlate model = new ModelIncensePlate(); + private static final Map ROTATIONS = ImmutableMap.of(EnumFacing.NORTH, 180, EnumFacing.SOUTH, 0, EnumFacing.WEST, 270, EnumFacing.EAST, 90); + @SuppressWarnings("deprecation") @Override - public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float ticks) { - TileIncensePlate plate = (TileIncensePlate) tileentity; + public void renderTileEntityAt(@Nonnull TileIncensePlate plate, double d0, double d1, double d2, float ticks, int digProgress) { + if(!plate.getWorld().isBlockLoaded(plate.getPos(), false) + || plate.getWorld().getBlockState(plate.getPos()).getBlock() != ModBlocks.incensePlate) + return; - int meta = plate.getWorldObj() != null ? plate.getBlockMetadata() : 0; + ItemStack stack = plate.getItemHandler().getStackInSlot(0); + if(stack == null) + return; - GL11.glPushMatrix(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1F, 1F, 1F, 1F); - GL11.glTranslated(d0, d1, d2); - Minecraft.getMinecraft().renderEngine.bindTexture(texture); - GL11.glTranslatef(0.5F, 1.5F, 0.5F); - GL11.glScalef(1F, -1F, -1F); - GL11.glRotatef(ROTATIONS[Math.max(Math.min(ROTATIONS.length, meta - 2), 0)], 0F, 1F, 0F); - model.render(); - GL11.glScalef(1F, -1F, -1F); + EnumFacing facing = plate.getWorld().getBlockState(plate.getPos()).getValue(BotaniaStateProps.CARDINALS); - ItemStack stack = plate.getStackInSlot(0); - if(stack != null) { - GL11.glPushMatrix(); - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); - float s = 0.4F; - GL11.glTranslatef(0.1F, -1.46F, 0F); - GL11.glScalef(s, s, s); - GL11.glRotatef(180F, 0F, 1F, 0F); - - int renderPass = 0; - do { - IIcon icon = stack.getItem().getIcon(stack, renderPass); - if(icon != null) { - Color color = new Color(stack.getItem().getColorFromItemStack(stack, renderPass)); - GL11.glColor3ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue()); - float f = icon.getMinU(); - float f1 = icon.getMaxU(); - float f2 = icon.getMinV(); - float f3 = icon.getMaxV(); - ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 32F); - GL11.glColor3f(1F, 1F, 1F); - } - renderPass++; - } while(renderPass < stack.getItem().getRenderPasses(stack.getItemDamage())); - GL11.glPopMatrix(); - } - GL11.glColor3f(1F, 1F, 1F); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glPopMatrix(); + GlStateManager.pushMatrix(); + GlStateManager.enableRescaleNormal(); + GlStateManager.translate(d0, d1, d2); + GlStateManager.translate(0.5F, 1.5F, 0.5F); + GlStateManager.rotate(ROTATIONS.get(facing), 0F, 1F, 0F); + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + float s = 0.6F; + GlStateManager.translate(-0.11F, -1.35F, 0F); + GlStateManager.scale(s, s, s); + Minecraft.getMinecraft().getRenderItem().renderItem(stack, ItemCameraTransforms.TransformType.GROUND); + GlStateManager.color(1F, 1F, 1F); + GlStateManager.enableRescaleNormal(); + GlStateManager.popMatrix(); } } diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileLightRelay.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileLightRelay.java index 5213ecda3..842cb6609 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileLightRelay.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileLightRelay.java @@ -11,64 +11,74 @@ package vazkii.botania.client.render.tile; import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; - +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.LuminizerVariant; import vazkii.botania.client.core.handler.ClientTickHandler; +import vazkii.botania.client.core.handler.MiscellaneousIcons; import vazkii.botania.client.core.helper.ShaderHelper; -import vazkii.botania.common.block.BlockLightRelay; +import vazkii.botania.common.block.ModBlocks; +import vazkii.botania.common.block.tile.TileLightRelay; -public class RenderTileLightRelay extends TileEntitySpecialRenderer { +import javax.annotation.Nonnull; + +public class RenderTileLightRelay extends TileEntitySpecialRenderer { @Override - public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float pticks) { + public void renderTileEntityAt(@Nonnull TileLightRelay tile, double x, double y, double z, float pticks, int digProgress) { + if(!tile.getWorld().isBlockLoaded(tile.getPos(), false) + || tile.getWorld().getBlockState(tile.getPos()).getBlock() != ModBlocks.lightRelay) + return; + Minecraft mc = Minecraft.getMinecraft(); - IIcon iicon = tile.getBlockMetadata() > 0 ? BlockLightRelay.worldIconRed : BlockLightRelay.worldIcon; + TextureAtlasSprite iicon = tile.getWorld().getBlockState(tile.getPos()) + .getValue(BotaniaStateProps.LUMINIZER_VARIANT) == LuminizerVariant.DEFAULT + ? MiscellaneousIcons.INSTANCE.lightRelayWorldIcon + : MiscellaneousIcons.INSTANCE.lightRelayWorldIconRed; - GL11.glPushMatrix(); - GL11.glTranslated(x + 0.5, y + 0.3, z + 0.5); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glAlphaFunc(GL11.GL_GREATER, 0.05F); + GlStateManager.pushMatrix(); + GlStateManager.translate(x + 0.5, y + 0.3, z + 0.5); + GlStateManager.enableRescaleNormal(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.alphaFunc(GL11.GL_GREATER, 0.05F); double time = ClientTickHandler.ticksInGame + pticks; - GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.color(1F, 1F, 1F, 1F); float scale = 0.75F; - GL11.glScalef(scale, scale, scale); - Tessellator tessellator = Tessellator.instance; + GlStateManager.scale(scale, scale, scale); + Tessellator tessellator = Tessellator.getInstance(); - GL11.glPushMatrix(); - float r = 180.0F - RenderManager.instance.playerViewY; - GL11.glRotatef(r, 0F, 1F, 0F); - GL11.glRotatef(-RenderManager.instance.playerViewX, 1F, 0F, 0F); + GlStateManager.pushMatrix(); + float r = 180.0F - mc.getRenderManager().playerViewY; + GlStateManager.rotate(r, 0F, 1F, 0F); + GlStateManager.rotate(-mc.getRenderManager().playerViewX, 1F, 0F, 0F); float off = 0.25F; - GL11.glTranslatef(0F, off, 0F); - GL11.glRotated(time, 0F, 0F, 1F); - GL11.glTranslatef(0F, -off, 0F); + GlStateManager.translate(0F, off, 0F); + GlStateManager.rotate(((float) time), 0F, 0F, 1F); + GlStateManager.translate(0F, -off, 0F); - mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture); + mc.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); ShaderHelper.useShader(ShaderHelper.halo); func_77026_a(tessellator, iicon); ShaderHelper.releaseShader(); - - GL11.glPopMatrix(); - GL11.glColor4f(1F, 1F, 1F, 1F); - GL11.glDisable(GL11.GL_BLEND); - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - GL11.glPopMatrix(); + + GlStateManager.popMatrix(); + GlStateManager.color(1F, 1F, 1F, 1F); + GlStateManager.disableBlend(); + GlStateManager.disableRescaleNormal(); + GlStateManager.popMatrix(); } - private void func_77026_a(Tessellator p_77026_1_, IIcon p_77026_2_) { + private void func_77026_a(Tessellator p_77026_1_, TextureAtlasSprite p_77026_2_) { float f = p_77026_2_.getMinU(); float f1 = p_77026_2_.getMaxU(); float f2 = p_77026_2_.getMinV(); @@ -84,13 +94,12 @@ public class RenderTileLightRelay extends TileEntitySpecialRenderer { float f5 = 0.5F; float f6 = 0.25F; - p_77026_1_.startDrawingQuads(); - p_77026_1_.setNormal(0.0F, 1.0F, 0.0F); - p_77026_1_.setBrightness(240); - p_77026_1_.addVertexWithUV(0.0F - f5, 0.0F - f6, 0.0D, f, f3); - p_77026_1_.addVertexWithUV(f4 - f5, 0.0F - f6, 0.0D, f1, f3); - p_77026_1_.addVertexWithUV(f4 - f5, f4 - f6, 0.0D, f1, f2); - p_77026_1_.addVertexWithUV(0.0F - f5, f4 - f6, 0.0D, f, f2); + p_77026_1_.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_NORMAL); + //p_77026_1_.getBuffer().setBrightness(240); + p_77026_1_.getBuffer().pos(0.0F - f5, 0.0F - f6, 0.0D).tex(f, f3).normal(0, 1, 0).endVertex(); + p_77026_1_.getBuffer().pos(f4 - f5, 0.0F - f6, 0.0D).tex(f1, f3).normal(0, 1, 0).endVertex(); + p_77026_1_.getBuffer().pos(f4 - f5, f4 - f6, 0.0D).tex(f1, f2).normal(0, 1, 0).endVertex(); + p_77026_1_.getBuffer().pos(0.0F - f5, f4 - f6, 0.0D).tex(f, f2).normal(0, 1, 0).endVertex(); p_77026_1_.draw(); } diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTilePool.java b/src/main/java/vazkii/botania/client/render/tile/RenderTilePool.java index d0395960b..707f8c8de 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTilePool.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTilePool.java @@ -10,156 +10,147 @@ */ package vazkii.botania.client.render.tile; -import java.awt.Color; -import java.util.Random; - import net.minecraft.block.Block; import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.block.model.IBakedModel; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.passive.EntitySheep; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; - +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.util.math.MathHelper; import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - import vazkii.botania.api.mana.IPoolOverlayProvider; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.PoolVariant; import vazkii.botania.client.core.handler.ClientTickHandler; +import vazkii.botania.client.core.handler.MiscellaneousIcons; import vazkii.botania.client.core.handler.MultiblockRenderHandler; import vazkii.botania.client.core.helper.ShaderHelper; -import vazkii.botania.client.lib.LibResources; -import vazkii.botania.client.model.ModelPool; -import vazkii.botania.common.block.mana.BlockPool; +import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.tile.mana.TilePool; -public class RenderTilePool extends TileEntitySpecialRenderer { +import javax.annotation.Nonnull; +import java.awt.*; +import java.util.Random; - private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_POOL); - private static final ResourceLocation textureInf = new ResourceLocation(LibResources.MODEL_INFINITE_POOL); - private static final ResourceLocation textureDil = new ResourceLocation(LibResources.MODEL_DILUTED_POOL); +public class RenderTilePool extends TileEntitySpecialRenderer { - private static final ModelPool model = new ModelPool(); - RenderItem renderItem = new RenderItem(); - - public static int forceMeta = 0; - public static boolean forceMana = false; + // Overrides for when we call this TESR without an actual pool + public static PoolVariant forceVariant = PoolVariant.DEFAULT; public static int forceManaNumber = -1; @Override - public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) { - TilePool pool = (TilePool) tileentity; + public void renderTileEntityAt(@Nonnull TilePool pool, double d0, double d1, double d2, float f, int digProgress) { + if(pool != null && (!pool.getWorld().isBlockLoaded(pool.getPos(), false) + || pool.getWorld().getBlockState(pool.getPos()).getBlock() != ModBlocks.pool)) + return; - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GlStateManager.pushMatrix(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.enableRescaleNormal(); float a = MultiblockRenderHandler.rendering ? 0.6F : 1F; - GL11.glColor4f(1F, 1F, 1F, a); - GL11.glTranslated(d0, d1, d2); - boolean inf = tileentity.getWorldObj() == null ? forceMeta == 1 : tileentity.getBlockMetadata() == 1; - boolean dil = tileentity.getWorldObj() == null ? forceMeta == 2 : tileentity.getBlockMetadata() == 2; - boolean fab = tileentity.getWorldObj() == null ? forceMeta == 3 : tileentity.getBlockMetadata() == 3; - Minecraft.getMinecraft().renderEngine.bindTexture(inf ? textureInf : dil ? textureDil : texture); - - GL11.glTranslatef(0.5F, 1.5F, 0.5F); - GL11.glScalef(1F, -1F, -1F); - if(fab) { - float time = ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks; - if(tileentity != null) - time += new Random(tileentity.xCoord ^ tileentity.yCoord ^ tileentity.zCoord).nextInt(100000); - - Color color = Color.getHSBColor(time * 0.005F, 0.6F, 1F); - GL11.glColor4ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue(), (byte) 255); + GlStateManager.color(1F, 1F, 1F, a); + if (pool == null) { // A null pool means we are calling the TESR without a pool (on a minecart). Adjust accordingly + GlStateManager.translate(0, 0, -1); } else { - int color = pool.color; - float[] acolor = EntitySheep.fleeceColorTable[color]; - GL11.glColor4f(acolor[0], acolor[1], acolor[2], a); + GlStateManager.translate(d0, d1, d2); } - model.render(); - GL11.glColor4f(1F, 1F, 1F, a); - GL11.glScalef(1F, -1F, -1F); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); + boolean fab = pool == null ? forceVariant == PoolVariant.FABULOUS : pool.getWorld().getBlockState(pool.getPos()).getValue(BotaniaStateProps.POOL_VARIANT) == PoolVariant.FABULOUS; - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + int color = 0xFFFFFF; - int mana = pool.getCurrentMana(); - if(forceManaNumber > -1) - mana = forceManaNumber; - int cap = pool.manaCap; + if (fab) { + float time = ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks; + if(pool != null) + time += new Random(pool.getPos().getX() ^ pool.getPos().getY() ^ pool.getPos().getZ()).nextInt(100000); + color = Color.HSBtoRGB(time * 0.005F, 0.6F, 1F); + } + + if (fab || forceManaNumber > -1) { + int red = (color & 0xFF0000) >> 16; + int green = (color & 0xFF00) >> 8; + int blue = (color & 0xFF); + IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelForState(pool == null ? ModBlocks.pool.getDefaultState().withProperty(BotaniaStateProps.POOL_VARIANT, forceVariant) : pool.getWorld().getBlockState(pool.getPos())); + Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelRenderer().renderModelBrightnessColor(model, 1.0F, red / 255F, green / 255F, blue / 255F); + } + + GlStateManager.translate(0.5F, 1.5F, 0.5F); + GlStateManager.color(1, 1, 1, a); + GlStateManager.enableRescaleNormal(); + + int mana = pool == null ? forceManaNumber : pool.getCurrentMana(); + int cap = pool == null ? -1 : pool.manaCap; if(cap == -1) cap = TilePool.MAX_MANA; float waterLevel = (float) mana / (float) cap * 0.4F; - if(forceMana) - waterLevel = 0.4F; float s = 1F / 16F; float v = 1F / 8F; float w = -v * 3.5F; - if(pool.getWorldObj() != null) { - Block below = pool.getWorldObj().getBlock(pool.xCoord, pool.yCoord - 1, pool.zCoord); + if(pool != null) { + Block below = pool.getWorld().getBlockState(pool.getPos().down()).getBlock(); if(below instanceof IPoolOverlayProvider) { - IIcon overlay = ((IPoolOverlayProvider) below).getIcon(pool.getWorldObj(), pool.xCoord, pool.yCoord - 1, pool.zCoord); + TextureAtlasSprite overlay = ((IPoolOverlayProvider) below).getIcon(pool.getWorld(), pool.getPos()); if(overlay != null) { - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glDisable(GL11.GL_ALPHA_TEST); - GL11.glColor4f(1F, 1F, 1F, a * (float) ((Math.sin((ClientTickHandler.ticksInGame + f) / 20.0) + 1) * 0.3 + 0.2)); - GL11.glTranslatef(-0.5F, -1F - 0.43F, -0.5F); - GL11.glRotatef(90F, 1F, 0F, 0F); - GL11.glScalef(s, s, s); + GlStateManager.pushMatrix(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.disableAlpha(); + GlStateManager.color(1F, 1F, 1F, a * (float) ((Math.sin((ClientTickHandler.ticksInGame + f) / 20.0) + 1) * 0.3 + 0.2)); + GlStateManager.translate(-0.5F, -1F - 0.43F, -0.5F); + GlStateManager.rotate(90F, 1F, 0F, 0F); + GlStateManager.scale(s, s, s); renderIcon(0, 0, overlay, 16, 16, 240); - GL11.glEnable(GL11.GL_ALPHA_TEST); - GL11.glDisable(GL11.GL_BLEND); - GL11.glPopMatrix(); + GlStateManager.enableAlpha(); + GlStateManager.disableBlend(); + GlStateManager.popMatrix(); } } } if(waterLevel > 0) { s = 1F / 256F * 14F; - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glDisable(GL11.GL_ALPHA_TEST); - GL11.glColor4f(1F, 1F, 1F, a); - GL11.glTranslatef(w, -1F - (0.43F - waterLevel), w); - GL11.glRotatef(90F, 1F, 0F, 0F); - GL11.glScalef(s, s, s); + GlStateManager.pushMatrix(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.disableAlpha(); + GlStateManager.color(1F, 1F, 1F, a); + GlStateManager.translate(w, -1F - (0.43F - waterLevel), w); + GlStateManager.rotate(90F, 1F, 0F, 0F); + GlStateManager.scale(s, s, s); ShaderHelper.useShader(ShaderHelper.manaPool); - renderIcon(0, 0, BlockPool.manaIcon, 16, 16, 240); + renderIcon(0, 0, MiscellaneousIcons.INSTANCE.manaWater, 16, 16, 240); ShaderHelper.releaseShader(); - GL11.glEnable(GL11.GL_ALPHA_TEST); - GL11.glDisable(GL11.GL_BLEND); - GL11.glPopMatrix(); + GlStateManager.enableAlpha(); + GlStateManager.disableBlend(); + GlStateManager.popMatrix(); } - GL11.glPopMatrix(); + GlStateManager.popMatrix(); - forceMeta = 0; - forceMana = false; + forceVariant = PoolVariant.DEFAULT; forceManaNumber = -1; } - public void renderIcon(int par1, int par2, IIcon par3Icon, int par4, int par5, int brightness) { - Tessellator tessellator = Tessellator.instance; - tessellator.startDrawingQuads(); - tessellator.setBrightness(brightness); - tessellator.addVertexWithUV(par1 + 0, par2 + par5, 0, par3Icon.getMinU(), par3Icon.getMaxV()); - tessellator.addVertexWithUV(par1 + par4, par2 + par5, 0, par3Icon.getMaxU(), par3Icon.getMaxV()); - tessellator.addVertexWithUV(par1 + par4, par2 + 0, 0, par3Icon.getMaxU(), par3Icon.getMinV()); - tessellator.addVertexWithUV(par1 + 0, par2 + 0, 0, par3Icon.getMinU(), par3Icon.getMinV()); + public void renderIcon(int par1, int par2, TextureAtlasSprite par3Icon, int par4, int par5, int brightness) { + Tessellator tessellator = Tessellator.getInstance(); + tessellator.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); + //tessellator.getBuffer().setBrightness(brightness); + tessellator.getBuffer().pos(par1 + 0, par2 + par5, 0).tex(par3Icon.getMinU(), par3Icon.getMaxV()).endVertex(); + tessellator.getBuffer().pos(par1 + par4, par2 + par5, 0).tex(par3Icon.getMaxU(), par3Icon.getMaxV()).endVertex(); + tessellator.getBuffer().pos(par1 + par4, par2 + 0, 0).tex(par3Icon.getMaxU(), par3Icon.getMinV()).endVertex(); + tessellator.getBuffer().pos(par1 + 0, par2 + 0, 0).tex(par3Icon.getMinU(), par3Icon.getMinV()).endVertex(); tessellator.draw(); } diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTilePrism.java b/src/main/java/vazkii/botania/client/render/tile/RenderTilePrism.java index e1c95c37c..a30fb6c32 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTilePrism.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTilePrism.java @@ -11,41 +11,40 @@ package vazkii.botania.client.render.tile; import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; - -import org.lwjgl.opengl.GL11; - import vazkii.botania.api.mana.ILens; import vazkii.botania.client.core.handler.ClientTickHandler; -import vazkii.botania.client.render.item.RenderLens; import vazkii.botania.common.block.tile.mana.TilePrism; -public class RenderTilePrism extends TileEntitySpecialRenderer { +import javax.annotation.Nonnull; + +//import vazkii.botania.client.render.item.RenderLens; + +public class RenderTilePrism extends TileEntitySpecialRenderer { @Override - public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partTicks) { - TilePrism prism = (TilePrism) tile; - GL11.glPushMatrix(); - GL11.glTranslated(x, y, z); + public void renderTileEntityAt(@Nonnull TilePrism prism, double x, double y, double z, float partTicks, int digProgress) { + GlStateManager.pushMatrix(); + GlStateManager.translate(x, y, z); float pos = (float) Math.sin((ClientTickHandler.ticksInGame + partTicks) * 0.05F) * 0.5F * (1F - 1F / 16F) - 0.5F; - ItemStack stack = prism.getStackInSlot(0); + ItemStack stack = prism.getItemHandler().getStackInSlot(0); if(stack != null) { - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); if(stack.getItem() instanceof ILens) { - ILens lens = (ILens) stack.getItem(); - GL11.glPushMatrix(); - GL11.glRotatef(90F, 1F, 0F, 0F); - GL11.glTranslatef(0F, 0F, pos); - RenderLens.render(stack, lens.getLensColor(stack)); - GL11.glPopMatrix(); + GlStateManager.pushMatrix(); + GlStateManager.rotate(90F, 1F, 0F, 0F); + GlStateManager.translate(0.5F, 0.5F, pos); + Minecraft.getMinecraft().getRenderItem().renderItem(stack, ItemCameraTransforms.TransformType.NONE); + GlStateManager.popMatrix(); } } - GL11.glPopMatrix(); + GlStateManager.popMatrix(); } } diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTilePump.java b/src/main/java/vazkii/botania/client/render/tile/RenderTilePump.java deleted file mode 100644 index 62e561177..000000000 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTilePump.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Mar 18, 2015, 3:15:38 PM (GMT)] - */ -package vazkii.botania.client.render.tile; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - -import vazkii.botania.client.lib.LibResources; -import vazkii.botania.client.model.ModelPump; -import vazkii.botania.common.block.tile.mana.TilePump; - -public class RenderTilePump extends TileEntitySpecialRenderer { - - private static final float[] ROTATIONS = new float[] { - 180F, 0F, 90F, 270F - }; - - private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_PUMP); - private static final ModelPump model = new ModelPump(); - - @Override - public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) { - TilePump pump = (TilePump) tileentity; - - GL11.glPushMatrix(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glColor4f(1F, 1F, 1F, 1F); - GL11.glTranslated(d0, d1, d2); - - Minecraft.getMinecraft().renderEngine.bindTexture(texture); - int meta = pump.getWorldObj() != null ? pump.getBlockMetadata() : 0; - - GL11.glTranslatef(0.5F, 0.5F, 0.5F); - GL11.glScalef(1F, -1F, -1F); - GL11.glRotatef(ROTATIONS[Math.max(Math.min(ROTATIONS.length - 1, meta - 2), 0)], 0F, 1F, 0F); - model.render(Math.max(0F, Math.min(8F, pump.innerRingPos + pump.moving * f))); - GL11.glColor3f(1F, 1F, 1F); - GL11.glScalef(1F, -1F, -1F); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glPopMatrix(); - } - -} diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTilePylon.java b/src/main/java/vazkii/botania/client/render/tile/RenderTilePylon.java index 209fe9596..be5f880cc 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTilePylon.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTilePylon.java @@ -10,17 +10,15 @@ */ package vazkii.botania.client.render.tile; -import java.util.Random; - import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; - import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.PylonVariant; import vazkii.botania.client.core.handler.ClientTickHandler; import vazkii.botania.client.core.handler.MultiblockRenderHandler; import vazkii.botania.client.core.helper.ShaderHelper; @@ -28,112 +26,118 @@ import vazkii.botania.client.lib.LibResources; import vazkii.botania.client.model.IPylonModel; import vazkii.botania.client.model.ModelPylon; import vazkii.botania.client.model.ModelPylonOld; +import vazkii.botania.common.block.ModBlocks; +import vazkii.botania.common.block.tile.TilePylon; import vazkii.botania.common.core.handler.ConfigHandler; -public class RenderTilePylon extends TileEntitySpecialRenderer { +import javax.annotation.Nonnull; +import java.util.Random; + +public class RenderTilePylon extends TileEntitySpecialRenderer { private static final ResourceLocation textureOld = new ResourceLocation(LibResources.MODEL_PYLON_OLD); - private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_PYLON); - private static final ResourceLocation textureGreenOld = new ResourceLocation(LibResources.MODEL_PYLON_GREEN_OLD); - private static final ResourceLocation textureGreen = new ResourceLocation(LibResources.MODEL_PYLON_GREEN); - private static final ResourceLocation texturePinkOld = new ResourceLocation(LibResources.MODEL_PYLON_PINK_OLD); - private static final ResourceLocation texturePink = new ResourceLocation(LibResources.MODEL_PYLON_PINK); IPylonModel model; public static boolean green = false; public static boolean pink = false; @Override - public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float pticks) { + public void renderTileEntityAt(@Nonnull TilePylon pylon, double d0, double d1, double d2, float pticks, int digProgress) { + if(!pylon.getWorld().isBlockLoaded(pylon.getPos(), false) + || pylon.getWorld().getBlockState(pylon.getPos()).getBlock() != ModBlocks.pylon) + return; + if(model == null) model = ConfigHandler.oldPylonModel ? new ModelPylonOld() : new ModelPylon(); - GL11.glPushMatrix(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.pushMatrix(); + GlStateManager.enableRescaleNormal(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); float a = MultiblockRenderHandler.rendering ? 0.6F : 1F; - GL11.glColor4f(1F, 1F, 1F, a); - if(tileentity.getWorldObj() != null) { - green = tileentity.getBlockMetadata() == 1; - pink = tileentity.getBlockMetadata() == 2; + GlStateManager.color(1F, 1F, 1F, a); + PylonVariant variant = null; + if(pylon.getWorld() != null && pylon.getWorld().getBlockState(pylon.getPos()).getBlock() == ModBlocks.pylon) { + variant = pylon.getWorld().getBlockState(pylon.getPos()).getValue(BotaniaStateProps.PYLON_VARIANT); + green = variant == PylonVariant.NATURA; + pink = variant == PylonVariant.GAIA; } if(ConfigHandler.oldPylonModel) Minecraft.getMinecraft().renderEngine.bindTexture(pink ? texturePinkOld : green ? textureGreenOld : textureOld); - else Minecraft.getMinecraft().renderEngine.bindTexture(pink ? texturePink : green ? textureGreen : texture); + else Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); - double worldTime = tileentity.getWorldObj() == null ? 0 : (double) (ClientTickHandler.ticksInGame + pticks); + double worldTime = pylon.getWorld() == null ? 0 : (double) (ClientTickHandler.ticksInGame + pticks); - if(tileentity != null) - worldTime += new Random(tileentity.xCoord ^ tileentity.yCoord ^ tileentity.zCoord).nextInt(360); + if(pylon != null) + worldTime += new Random(pylon.getPos().hashCode()).nextInt(360); if(ConfigHandler.oldPylonModel) { - GL11.glTranslated(d0 + 0.5, d1 + 2.2, d2 + 0.5); - GL11.glScalef(1F, -1.5F, -1F); + GlStateManager.translate(d0 + 0.5, d1 + 2.2, d2 + 0.5); + GlStateManager.scale(1F, -1.5F, -1F); } else { - GL11.glTranslated(d0 + 0.2 + (green ? -0.1 : 0), d1 + 0.05, d2 + 0.8 + (green ? 0.1 : 0)); + GlStateManager.translate(d0 + 0.2 + (green ? -0.1 : 0), d1 + 0.05, d2 + 0.8 + (green ? 0.1 : 0)); float scale = green ? 0.8F : 0.6F; - GL11.glScalef(scale, 0.6F, scale); + GlStateManager.scale(scale, 0.6F, scale); } if(!green) { - GL11.glPushMatrix(); + GlStateManager.pushMatrix(); if(!ConfigHandler.oldPylonModel) - GL11.glTranslatef(0.5F, 0F, -0.5F); - GL11.glRotatef((float) worldTime * 1.5F, 0F, 1F, 0F); + GlStateManager.translate(0.5F, 0F, -0.5F); + GlStateManager.rotate((float) worldTime * 1.5F, 0F, 1F, 0F); if(!ConfigHandler.oldPylonModel) - GL11.glTranslatef(-0.5F, 0F, 0.5F); + GlStateManager.translate(-0.5F, 0F, 0.5F); - model.renderRing(); - GL11.glTranslated(0D, Math.sin(worldTime / 20D) / 20 - 0.025, 0D); - model.renderGems(); - GL11.glPopMatrix(); + model.renderRing(variant); + GlStateManager.translate(0D, Math.sin(worldTime / 20D) / 20 - 0.025, 0D); + model.renderGems(variant); + GlStateManager.popMatrix(); } - GL11.glPushMatrix(); - GL11.glTranslated(0D, Math.sin(worldTime / 20D) / 17.5, 0D); + GlStateManager.pushMatrix(); + GlStateManager.translate(0D, Math.sin(worldTime / 20D) / 17.5, 0D); if(!ConfigHandler.oldPylonModel) - GL11.glTranslatef(0.5F, 0F, -0.5F); + GlStateManager.translate(0.5F, 0F, -0.5F); - GL11.glRotatef((float) -worldTime, 0F, 1F, 0F); + GlStateManager.rotate((float) -worldTime, 0F, 1F, 0F); if(!ConfigHandler.oldPylonModel) - GL11.glTranslatef(-0.5F, 0F, 0.5F); + GlStateManager.translate(-0.5F, 0F, 0.5F); - GL11.glDisable(GL11.GL_CULL_FACE); - model.renderCrystal(); + GlStateManager.disableCull(); + model.renderCrystal(variant); - GL11.glColor4f(1F, 1F, 1F, a); + GlStateManager.color(1F, 1F, 1F, a); if(!ShaderHelper.useShaders()) { int light = 15728880; int lightmapX = light % 65536; int lightmapY = light / 65536; OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapX, lightmapY); float alpha = (float) ((Math.sin(worldTime / 20D) / 2D + 0.5) / (ConfigHandler.oldPylonModel ? 1D : 2D)); - GL11.glColor4f(1F, 1F, 1F, a * (alpha + 0.183F)); + GlStateManager.color(1F, 1F, 1F, a * (alpha + 0.183F)); } - GL11.glDisable(GL11.GL_ALPHA_TEST); - GL11.glScalef(1.1F, 1.1F, 1.1F); + GlStateManager.disableAlpha(); + GlStateManager.scale(1.1F, 1.1F, 1.1F); if(!ConfigHandler.oldPylonModel) - GL11.glTranslatef(-0.05F, -0.1F, 0.05F); - else GL11.glTranslatef(0F, -0.09F, 0F); + GlStateManager.translate(-0.05F, -0.1F, 0.05F); + else GlStateManager.translate(0F, -0.09F, 0F); ShaderHelper.useShader(ShaderHelper.pylonGlow); - model.renderCrystal(); + model.renderCrystal(variant); ShaderHelper.releaseShader(); - GL11.glEnable(GL11.GL_ALPHA_TEST); - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glPopMatrix(); + GlStateManager.enableAlpha(); + GlStateManager.enableCull(); + GlStateManager.popMatrix(); - GL11.glDisable(GL11.GL_BLEND); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glPopMatrix(); + GlStateManager.disableBlend(); + GlStateManager.enableRescaleNormal(); + GlStateManager.popMatrix(); } diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileRedString.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileRedString.java index 24910351c..ea5edf03e 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileRedString.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileRedString.java @@ -10,17 +10,17 @@ */ package vazkii.botania.client.render.tile; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; +import net.minecraft.client.renderer.VertexBuffer; +import net.minecraftforge.client.model.animation.FastTESR; import vazkii.botania.client.core.handler.RedStringRenderer; import vazkii.botania.common.block.tile.string.TileRedString; -public class RenderTileRedString extends TileEntitySpecialRenderer { +public class RenderTileRedString extends FastTESR { @Override - public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float partticks) { - TileRedString trs = (TileRedString) tileentity; + public void renderTileEntityFast(TileRedString trs, double x, double y, double z, float partialTicks, int destroyStage, VertexBuffer worldRenderer) { RedStringRenderer.redStringTiles.add(trs); } + } diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileRuneAltar.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileRuneAltar.java index 245c62cd9..de0936cbd 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileRuneAltar.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileRuneAltar.java @@ -10,45 +10,32 @@ */ package vazkii.botania.client.render.tile; -import java.awt.Color; - -import net.minecraft.block.Block; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.ItemRenderer; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraftforge.client.ForgeHooksClient; - -import org.lwjgl.opengl.GL11; - import vazkii.botania.client.core.handler.ClientTickHandler; import vazkii.botania.client.core.helper.RenderHelper; import vazkii.botania.client.model.ModelSpinningCubes; import vazkii.botania.common.block.tile.TileRuneAltar; -public class RenderTileRuneAltar extends TileEntitySpecialRenderer { +import javax.annotation.Nonnull; - ModelSpinningCubes cubes = new ModelSpinningCubes(); - RenderBlocks renderBlocks = new RenderBlocks(); +public class RenderTileRuneAltar extends TileEntitySpecialRenderer { + + final ModelSpinningCubes cubes = new ModelSpinningCubes(); @Override - public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float partticks) { - TileRuneAltar altar = (TileRuneAltar) tileentity; - - GL11.glPushMatrix(); - GL11.glColor4f(1F, 1F, 1F, 1F); - GL11.glTranslated(x, y, z); + public void renderTileEntityAt(@Nonnull TileRuneAltar altar, double x, double y, double z, float partticks, int digProgress) { + GlStateManager.pushMatrix(); + GlStateManager.color(1F, 1F, 1F, 1F); + GlStateManager.translate(x, y, z); int items = 0; for(int i = 0; i < altar.getSizeInventory(); i++) - if(altar.getStackInSlot(i) == null) + if(altar.getItemHandler().getStackInSlot(i) == null) break; else items++; float[] angles = new float[altar.getSizeInventory()]; @@ -60,68 +47,40 @@ public class RenderTileRuneAltar extends TileEntitySpecialRenderer { double time = ClientTickHandler.ticksInGame + partticks; + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); for(int i = 0; i < altar.getSizeInventory(); i++) { - GL11.glPushMatrix(); - GL11.glScalef(0.5F, 0.5F, 0.5F); - GL11.glTranslatef(1F, 2.5F, 1F); - GL11.glRotatef(angles[i] + (float) time, 0F, 1F, 0F); - GL11.glTranslatef(2.25F, 0F, 0.5F); - GL11.glRotatef(90F, 0F, 1F, 0F); - GL11.glTranslated(0D, 0.15 * Math.sin((time + i * 10) / 5D), 0F); - ItemStack stack = altar.getStackInSlot(i); + GlStateManager.pushMatrix(); + GlStateManager.translate(0.5F, 1.25F, 0.5F); + GlStateManager.rotate(angles[i] + (float) time, 0F, 1F, 0F); + GlStateManager.translate(1.125F, 0F, 0.25F); + GlStateManager.rotate(90F, 0F, 1F, 0F); + GlStateManager.translate(0D, 0.075 * Math.sin((time + i * 10) / 5D), 0F); + ItemStack stack = altar.getItemHandler().getStackInSlot(i); Minecraft mc = Minecraft.getMinecraft(); if(stack != null) { - mc.renderEngine.bindTexture(stack.getItem() instanceof ItemBlock ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture); - - GL11.glScalef(2F, 2F, 2F); - if(!ForgeHooksClient.renderEntityItem(new EntityItem(altar.getWorldObj(), altar.xCoord, altar.yCoord, altar.zCoord, stack), stack, 0F, 0F, altar.getWorldObj().rand, mc.renderEngine, renderBlocks, 1)) { - GL11.glScalef(0.5F, 0.5F, 0.5F); - if(stack.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(stack.getItem()).getRenderType())) { - GL11.glScalef(0.5F, 0.5F, 0.5F); - GL11.glTranslatef(1F, 1.1F, 0F); - renderBlocks.renderBlockAsItem(Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 1F); - GL11.glTranslatef(-1F, -1.1F, 0F); - GL11.glScalef(2F, 2F, 2F); - } else { - int renderPass = 0; - do { - IIcon icon = stack.getItem().getIcon(stack, renderPass); - if(icon != null) { - Color color = new Color(stack.getItem().getColorFromItemStack(stack, renderPass)); - GL11.glColor3ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue()); - float f = icon.getMinU(); - float f1 = icon.getMaxU(); - float f2 = icon.getMinV(); - float f3 = icon.getMaxV(); - ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F); - GL11.glColor3f(1F, 1F, 1F); - } - renderPass++; - } while(renderPass < stack.getItem().getRenderPasses(stack.getItemDamage())); - } - } + mc.getRenderItem().renderItem(stack, ItemCameraTransforms.TransformType.GROUND); } - GL11.glPopMatrix(); + GlStateManager.popMatrix(); } - GL11.glDisable(GL11.GL_ALPHA_TEST); - GL11.glPushMatrix(); - GL11.glTranslatef(0.5F, 1.8F, 0.5F); - GL11.glRotatef(180F, 1F, 0F, 1F); + GlStateManager.disableAlpha(); + GlStateManager.pushMatrix(); + GlStateManager.translate(0.5F, 1.8F, 0.5F); + GlStateManager.rotate(180F, 1F, 0F, 1F); int repeat = 15; cubes.renderSpinningCubes(2, repeat, repeat); - GL11.glPopMatrix(); + GlStateManager.popMatrix(); - GL11.glTranslatef(0F, 0.2F, 0F); + GlStateManager.translate(0F, 0.2F, 0F); float scale = altar.getTargetMana() == 0 ? 0 : (float) altar.getCurrentMana() / (float) altar.getTargetMana() / 75F; if(scale != 0) { - int seed = altar.xCoord ^ altar.yCoord ^ altar.zCoord; - GL11.glTranslatef(0.5F, 0.7F, 0.5F); + int seed = altar.getPos().getX() ^ altar.getPos().getY() ^ altar.getPos().getZ(); + GlStateManager.translate(0.5F, 0.7F, 0.5F); RenderHelper.renderStar(0x00E4D7, scale, scale, scale, seed); } - GL11.glEnable(GL11.GL_ALPHA_TEST); + GlStateManager.enableAlpha(); - GL11.glPopMatrix(); + GlStateManager.popMatrix(); } } diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileSkullOverride.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileSkullOverride.java deleted file mode 100644 index 5d49f06fe..000000000 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileSkullOverride.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [? (GMT)] - */ -package vazkii.botania.client.render.tile; - -import java.util.Map; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.entity.AbstractClientPlayer; -import net.minecraft.client.renderer.tileentity.TileEntitySkullRenderer; -import net.minecraft.tileentity.TileEntitySkull; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - -import vazkii.botania.client.core.helper.ShaderHelper; -import vazkii.botania.client.model.ModelSkullOverride; -import vazkii.botania.client.render.entity.RenderDoppleganger; -import vazkii.botania.common.block.tile.TileGaiaHead; - -import com.mojang.authlib.GameProfile; -import com.mojang.authlib.minecraft.MinecraftProfileTexture; - -public class RenderTileSkullOverride extends TileEntitySkullRenderer { - - public static final ModelSkullOverride modelSkull = new ModelSkullOverride(); - - @Override - public void renderTileEntityAt(TileEntitySkull p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) { - render(p_147500_1_, (float) p_147500_2_, (float) p_147500_4_, (float) p_147500_6_, p_147500_1_.getBlockMetadata() & 7, p_147500_1_.func_145906_b() * 360 / 16.0F, p_147500_1_.func_145904_a(), p_147500_1_.func_152108_a()); - } - - public void render(TileEntitySkull skull, float par1, float par2, float par3, int par4, float par5, int par6, GameProfile gameProfile) { - boolean gaia = skull instanceof TileGaiaHead; - if(par6 == 3 || gaia) { - ResourceLocation resourcelocation = AbstractClientPlayer.locationStevePng; - Minecraft minecraft = Minecraft.getMinecraft(); - if(gaia) - resourcelocation = minecraft.thePlayer.getLocationSkin(); - else if(gameProfile != null) { - Map map = minecraft.func_152342_ad().func_152788_a(gameProfile); - - if (map.containsKey(MinecraftProfileTexture.Type.SKIN)) { - resourcelocation = minecraft.func_152342_ad().func_152792_a((MinecraftProfileTexture)map.get(MinecraftProfileTexture.Type.SKIN), MinecraftProfileTexture.Type.SKIN); - } - } - bindTexture(resourcelocation); - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_CULL_FACE); - if (par4 != 1) { - switch (par4) { - case 2: - GL11.glTranslatef(par1 + 0.5F, par2 + 0.25F, par3 + 0.74F); - break; - case 3: - GL11.glTranslatef(par1 + 0.5F, par2 + 0.25F, par3 + 0.26F); - par5 = 180.0F; - break; - case 4: - GL11.glTranslatef(par1 + 0.74F, par2 + 0.25F, par3 + 0.5F); - par5 = 270.0F; - break; - case 5: - default: - GL11.glTranslatef(par1 + 0.26F, par2 + 0.25F, par3 + 0.5F); - par5 = 90.0F; - } - } else GL11.glTranslatef(par1 + 0.5F, par2, par3 + 0.5F); - - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glScalef(-1.0F, -1.0F, 1.0F); - GL11.glEnable(GL11.GL_ALPHA_TEST); - if(gaia) - ShaderHelper.useShader(ShaderHelper.doppleganger, RenderDoppleganger.defaultCallback); - - modelSkull.render(null, 0F, 0F, 0F, par5, 0F, 0.0625F); - - if(gaia) - ShaderHelper.releaseShader(); - GL11.glPopMatrix(); - } else super.func_152674_a(par1, par2, par3, par4, par5, par6, gameProfile); - } -} \ No newline at end of file diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileSparkChanger.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileSparkChanger.java index 97188418e..dce4694cf 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileSparkChanger.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileSparkChanger.java @@ -10,57 +10,38 @@ */ package vazkii.botania.client.render.tile; -import java.awt.Color; - import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.ItemRenderer; -import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; - -import org.lwjgl.opengl.GL11; - import vazkii.botania.common.block.tile.TileSparkChanger; -public class RenderTileSparkChanger extends TileEntitySpecialRenderer { +import javax.annotation.Nonnull; + +public class RenderTileSparkChanger extends TileEntitySpecialRenderer { @Override - public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float pticks) { - GL11.glPushMatrix(); - GL11.glTranslated(d0, d1, d2); - GL11.glRotated(90F, 1F, 0F, 0F); - GL11.glTranslatef(0.8F, 0.2F, -0.22F); - GL11.glColor4f(1F, 1F, 1F, 1F); - ItemStack stack = ((TileSparkChanger) tileentity).getStackInSlot(0); + public void renderTileEntityAt(@Nonnull TileSparkChanger tileentity, double d0, double d1, double d2, float pticks, int digProgress) { + GlStateManager.pushMatrix(); + GlStateManager.translate(d0, d1, d2); + GlStateManager.rotate(90F, 1F, 0F, 0F); + GlStateManager.translate(0.8F, 0.2F, -0.22F); + GlStateManager.color(1F, 1F, 1F, 1F); + ItemStack stack = tileentity.getItemHandler().getStackInSlot(0); if(stack != null) { - GL11.glPushMatrix(); - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); + GlStateManager.pushMatrix(); + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); float s = 0.6F; - GL11.glScalef(s, s, s); - GL11.glRotatef(180F, 0F, 1F, 0F); - - int renderPass = 0; - do { - IIcon icon = stack.getItem().getIcon(stack, renderPass); - if(icon != null) { - Color color = new Color(stack.getItem().getColorFromItemStack(stack, renderPass)); - GL11.glColor3ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue()); - float f = icon.getMinU(); - float f1 = icon.getMaxU(); - float f2 = icon.getMinV(); - float f3 = icon.getMaxV(); - ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F); - GL11.glColor3f(1F, 1F, 1F); - } - renderPass++; - } while(renderPass < stack.getItem().getRenderPasses(stack.getItemDamage())); - GL11.glPopMatrix(); + GlStateManager.scale(s, s, s); + GlStateManager.rotate(180F, 0F, 1F, 0F); + GlStateManager.translate(0.5, 0.5, 0); + Minecraft.getMinecraft().getRenderItem().renderItem(stack, ItemCameraTransforms.TransformType.GROUND); + GlStateManager.popMatrix(); } - GL11.glColor4f(1F, 1F, 1F, 1F); - GL11.glPopMatrix(); + GlStateManager.color(1F, 1F, 1F, 1F); + GlStateManager.popMatrix(); } } diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileSpawnerClaw.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileSpawnerClaw.java deleted file mode 100644 index 92628dc63..000000000 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileSpawnerClaw.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jul 23, 2014, 5:46:10 PM (GMT)] - */ -package vazkii.botania.client.render.tile; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - -import vazkii.botania.client.lib.LibResources; -import vazkii.botania.client.model.ModelSpawnerClaw; - -public class RenderTileSpawnerClaw extends TileEntitySpecialRenderer { - - private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_SPAWNER_CLAW); - private static final ModelSpawnerClaw model = new ModelSpawnerClaw(); - - @Override - public void renderTileEntityAt(TileEntity var1, double d0, double d1, double d2, float var8) { - GL11.glPushMatrix(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glColor4f(1F, 1F, 1F, 1F); - GL11.glTranslated(d0, d1, d2); - - Minecraft.getMinecraft().renderEngine.bindTexture(texture); - - GL11.glTranslatef(0.5F, 1.5F, 0.5F); - GL11.glScalef(1F, -1F, -1F); - - model.render(); - GL11.glColor3f(1F, 1F, 1F); - GL11.glScalef(1F, -1F, -1F); - GL11.glPopMatrix(); - } - -} diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileSpreader.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileSpreader.java index e13a116c7..da7415e0f 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileSpreader.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileSpreader.java @@ -10,31 +10,30 @@ */ package vazkii.botania.client.render.tile; -import java.awt.Color; -import java.util.Random; - -import net.minecraft.block.Block; +import net.minecraft.block.BlockCarpet; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.init.Blocks; +import net.minecraft.item.EnumDyeColor; import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - import vazkii.botania.api.mana.ILens; import vazkii.botania.client.core.handler.ClientTickHandler; import vazkii.botania.client.core.proxy.ClientProxy; import vazkii.botania.client.lib.LibResources; import vazkii.botania.client.model.ModelSpreader; -import vazkii.botania.client.render.item.RenderLens; +import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.tile.mana.TileSpreader; -public class RenderTileSpreader extends TileEntitySpecialRenderer { +import javax.annotation.Nonnull; +import java.awt.*; +import java.util.Random; + +public class RenderTileSpreader extends TileEntitySpecialRenderer { private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_SPREADER); private static final ResourceLocation textureRs = new ResourceLocation(LibResources.MODEL_SPREADER_REDSTONE); @@ -47,83 +46,88 @@ public class RenderTileSpreader extends TileEntitySpecialRenderer { private static final ModelSpreader model = new ModelSpreader(); @Override - public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float ticks) { - TileSpreader spreader = (TileSpreader) tileentity; - GL11.glPushMatrix(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glColor4f(1F, 1F, 1F, 1F); - GL11.glTranslated(d0, d1, d2); + public void renderTileEntityAt(@Nonnull TileSpreader spreader, double d0, double d1, double d2, float ticks, int digProgress) { + if(!spreader.getWorld().isBlockLoaded(spreader.getPos(), false) + || spreader.getWorld().getBlockState(spreader.getPos()).getBlock() != ModBlocks.spreader) + return; + + GlStateManager.pushMatrix(); + GlStateManager.enableRescaleNormal(); + GlStateManager.color(1F, 1F, 1F, 1F); + GlStateManager.translate(d0, d1, d2); - GL11.glTranslatef(0.5F, 1.5F, 0.5F); - GL11.glRotatef(spreader.rotationX + 90F, 0F, 1F, 0F); - GL11.glTranslatef(0F, -1F, 0F); - GL11.glRotatef(spreader.rotationY, 1F, 0F, 0F); - GL11.glTranslatef(0F, 1F, 0F); + GlStateManager.translate(0.5F, 1.5F, 0.5F); + GlStateManager.rotate(spreader.rotationX + 90F, 0F, 1F, 0F); + GlStateManager.translate(0F, -1F, 0F); + GlStateManager.rotate(spreader.rotationY, 1F, 0F, 0F); + GlStateManager.translate(0F, 1F, 0F); ResourceLocation r = spreader.isRedstone() ? textureRs : spreader.isDreamwood() ? textureDw : texture; if(ClientProxy.dootDoot) r = spreader.isRedstone() ? textureRsHalloween : spreader.isDreamwood() ? textureDwHalloween : textureHalloween; Minecraft.getMinecraft().renderEngine.bindTexture(r); - GL11.glScalef(1F, -1F, -1F); + GlStateManager.scale(1F, -1F, -1F); double time = ClientTickHandler.ticksInGame + ticks; if(spreader.isULTRA_SPREADER()) { - Color color = Color.getHSBColor((float) ((time * 5 + new Random(spreader.xCoord ^ spreader.yCoord ^ spreader.zCoord).nextInt(10000)) % 360) / 360F, 0.4F, 0.9F); - GL11.glColor3f(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F); + Color color = Color.getHSBColor((float) ((time * 5 + new Random(spreader.getPos().hashCode()).nextInt(10000)) % 360) / 360F, 0.4F, 0.9F); + GlStateManager.color(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F); } model.render(); - GL11.glColor3f(1F, 1F, 1F); + GlStateManager.color(1F, 1F, 1F); - GL11.glPushMatrix(); - double worldTicks = tileentity.getWorldObj() == null ? 0 : time; - GL11.glRotatef((float) worldTicks % 360, 0F, 1F, 0F); - GL11.glTranslatef(0F, (float) Math.sin(worldTicks / 20.0) * 0.05F, 0F); + GlStateManager.pushMatrix(); + double worldTicks = spreader.getWorld() == null ? 0 : time; + GlStateManager.rotate((float) worldTicks % 360, 0F, 1F, 0F); + GlStateManager.translate(0F, (float) Math.sin(worldTicks / 20.0) * 0.05F, 0F); model.renderCube(); - GL11.glPopMatrix(); - GL11.glScalef(1F, -1F, -1F); - ItemStack stack = spreader.getStackInSlot(0); + GlStateManager.popMatrix(); + GlStateManager.scale(1F, -1F, -1F); + ItemStack stack = spreader.getItemHandler().getStackInSlot(0); if(stack != null) { - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); ILens lens = (ILens) stack.getItem(); - GL11.glPushMatrix(); - GL11.glTranslatef(-0.4F, -1.4F, -0.4375F); - GL11.glScalef(0.8F, 0.8F, 0.8F); - RenderLens.render(stack, lens.getLensColor(stack)); - GL11.glPopMatrix(); + GlStateManager.pushMatrix(); + GlStateManager.translate(-0.0F, -1F, -0.4375F); + GlStateManager.scale(0.8F, 0.8F, 0.8F); + Minecraft.getMinecraft().getRenderItem().renderItem(stack, ItemCameraTransforms.TransformType.NONE); + GlStateManager.popMatrix(); } if(spreader.paddingColor != -1) { - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); - Block block = Blocks.carpet; - int color = spreader.paddingColor; - RenderBlocks render = RenderBlocks.getInstance(); - float f = 1F / 16F; - GL11.glTranslatef(0F, -f, 0F); - render.renderBlockAsItem(block, color, 1F); - GL11.glTranslatef(0F, -f * 15, 0F); - render.renderBlockAsItem(block, color, 1F); - GL11.glRotatef(90F, 1F, 0F, 0F); - GL11.glRotatef(90F, 0F, 1F, 0F); + IBlockState carpet = Blocks.CARPET.getDefaultState().withProperty(BlockCarpet.COLOR, EnumDyeColor.byMetadata(spreader.paddingColor)); - GL11.glPushMatrix(); - GL11.glScalef(f * 14F, 1F, 1F); - render.renderBlockAsItem(block, color, 1F); - GL11.glPopMatrix(); + GlStateManager.translate(-0.5F, -0.5F, 0.5F); + float f = 1 / 16F; - GL11.glRotatef(90F, 1F, 0F, 0F); - GL11.glTranslatef(0F, 0F, -f / 2); - GL11.glScalef(f * 14F, 1F, f * 15F); - render.renderBlockAsItem(block, color, 1F); - GL11.glTranslatef(0F, f * 15F, 0F); - render.renderBlockAsItem(block, color, 1F); + Minecraft.getMinecraft().getBlockRendererDispatcher().renderBlockBrightness(carpet, 1.0F); + GlStateManager.rotate(-90, 0, 1, 0); + + GlStateManager.rotate(270, 0, 0, 1); + Minecraft.getMinecraft().getBlockRendererDispatcher().renderBlockBrightness(carpet, 1.0F); + GlStateManager.rotate(-90, 0, 1, 0); + + GlStateManager.translate(0, 15 * f, 0); + Minecraft.getMinecraft().getBlockRendererDispatcher().renderBlockBrightness(carpet, 1.0F); + GlStateManager.rotate(-90, 0, 1, 0); + + GlStateManager.translate(15 * f, f, 0); + GlStateManager.rotate(270, 0, 0, 1); + Minecraft.getMinecraft().getBlockRendererDispatcher().renderBlockBrightness(carpet, 1.0F); + GlStateManager.rotate(-90, 0, 1, 0); + + GlStateManager.translate(0, -1, 0); + GlStateManager.rotate(90, 1, 0, 0); + Minecraft.getMinecraft().getBlockRendererDispatcher().renderBlockBrightness(carpet, 1.0F); } - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glPopMatrix(); + GlStateManager.enableRescaleNormal(); + GlStateManager.popMatrix(); } } diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileStarfield.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileStarfield.java index b1991082a..c475a28c7 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileStarfield.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileStarfield.java @@ -10,122 +10,141 @@ */ package vazkii.botania.client.render.tile; -import java.awt.Color; -import java.nio.FloatBuffer; -import java.util.Random; - import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.ActiveRenderInfo; import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.VertexBuffer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.util.ResourceLocation; +import vazkii.botania.common.block.tile.TileStarfield; -import org.lwjgl.opengl.GL11; +import javax.annotation.Nonnull; +import java.awt.*; +import java.nio.FloatBuffer; +import java.util.Random; -// THIS CODE WAS STOLEN FROM THE END PORTAL -// OH GOD -// I HAVE NO IDEA WHAT I'M DOING -// SO MUCH STUFF I DON'T UNDERSTAND D: -// HELP -public class RenderTileStarfield extends TileEntitySpecialRenderer { +// This is copied from the vanilla end portal TESR, relevant edits are commented +public class RenderTileStarfield extends TileEntitySpecialRenderer { - private static final ResourceLocation field_147529_c = new ResourceLocation("textures/environment/end_sky.png"); - private static final ResourceLocation field_147526_d = new ResourceLocation("textures/entity/end_portal.png"); + private static final ResourceLocation END_SKY_TEXTURE = new ResourceLocation("textures/environment/end_sky.png"); + private static final ResourceLocation END_PORTAL_TEXTURE = new ResourceLocation("textures/entity/end_portal.png"); private static final Random field_147527_e = new Random(31100L); - FloatBuffer field_147528_b = GLAllocation.createDirectFloatBuffer(16); - @Override - public void renderTileEntityAt(TileEntity p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) { - float f1 = (float)field_147501_a.field_147560_j; - float f2 = (float)field_147501_a.field_147561_k; - float f3 = (float)field_147501_a.field_147558_l; - GL11.glDisable(GL11.GL_LIGHTING); + final FloatBuffer field_147528_b = GLAllocation.createDirectFloatBuffer(16); + + public void renderTileEntityAt(@Nonnull TileStarfield starfield, double x, double y, double z, float partialTicks, int destroyStage) + { + float f = (float)this.rendererDispatcher.entityX; + float f1 = (float)this.rendererDispatcher.entityY; + float f2 = (float)this.rendererDispatcher.entityZ; + GlStateManager.disableLighting(); field_147527_e.setSeed(31100L); - float f4 = 0.24F; + float f3 = 0.24F; // Botania: move to bottom of block space - for(int i = 0; i < 16; ++i) { - GL11.glPushMatrix(); - float f5 = 16 - i; - float f6 = 0.0625F; - float f7 = 1.0F / (f5 + 1.0F); + for (int i = 0; i < 16; ++i) + { + GlStateManager.pushMatrix(); + float f4 = (float)(16 - i); + float f5 = 0.0625F; + float f6 = 1.0F / (f4 + 1.0F); - if(i == 0) { - bindTexture(field_147529_c); - f7 = 0.1F; - f5 = 65.0F; - f6 = 0.125F; - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (i == 0) + { + this.bindTexture(END_SKY_TEXTURE); + f6 = 0.1F; + f4 = 65.0F; + f5 = 0.125F; + GlStateManager.enableBlend(); + GlStateManager.blendFunc(770, 771); } - if(i == 1) { - bindTexture(field_147526_d); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); - f6 = 0.5F; + if (i >= 1) + { + this.bindTexture(END_PORTAL_TEXTURE); } - float f8 = (float)-(p_147500_4_ + f4); - float f9 = f8 + ActiveRenderInfo.objectY; - float f10 = f8 + f5 + ActiveRenderInfo.objectY; - float f11 = f9 / f10; - f11 += (float)(p_147500_4_ + f4); - GL11.glTranslatef(f1, f11, f3); - GL11.glTexGeni(GL11.GL_S, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR); - GL11.glTexGeni(GL11.GL_T, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR); - GL11.glTexGeni(GL11.GL_R, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR); - GL11.glTexGeni(GL11.GL_Q, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_EYE_LINEAR); - GL11.glTexGen(GL11.GL_S, GL11.GL_OBJECT_PLANE, func_147525_a(1.0F, 0.0F, 0.0F, 0.0F)); - GL11.glTexGen(GL11.GL_T, GL11.GL_OBJECT_PLANE, func_147525_a(0.0F, 0.0F, 1.0F, 0.0F)); - GL11.glTexGen(GL11.GL_R, GL11.GL_OBJECT_PLANE, func_147525_a(0.0F, 0.0F, 0.0F, 1.0F)); - GL11.glTexGen(GL11.GL_Q, GL11.GL_EYE_PLANE, func_147525_a(0.0F, 1.0F, 0.0F, 0.0F)); - GL11.glEnable(GL11.GL_TEXTURE_GEN_S); - GL11.glEnable(GL11.GL_TEXTURE_GEN_T); - GL11.glEnable(GL11.GL_TEXTURE_GEN_R); - GL11.glEnable(GL11.GL_TEXTURE_GEN_Q); - GL11.glPopMatrix(); - GL11.glMatrixMode(GL11.GL_TEXTURE); - GL11.glPushMatrix(); - GL11.glLoadIdentity(); - GL11.glTranslatef(0.0F, Minecraft.getSystemTime() % 20000L / 20000.0F, 0.0F); - GL11.glScalef(f6, f6, f6); - GL11.glTranslatef(0.5F, 0.5F, 0.0F); - GL11.glRotatef((i * i * 4321 + i * 9) * 2.0F, 0.0F, 0.0F, 1.0F); - GL11.glTranslatef(-0.5F, -0.5F, 0.0F); - GL11.glTranslatef(-f1, -f3, -f2); - f9 = f8 + ActiveRenderInfo.objectY; - GL11.glTranslatef(ActiveRenderInfo.objectX * f5 / f9, ActiveRenderInfo.objectZ * f5 / f9, -f2); - Tessellator tessellator = Tessellator.instance; - tessellator.startDrawingQuads(); + if (i == 1) + { + GlStateManager.enableBlend(); + GlStateManager.blendFunc(1, 1); + f5 = 0.5F; + } + float f7 = (float)(-(y + (double)f3)); + float f8 = f7 + (float)ActiveRenderInfo.getPosition().yCoord; + float f9 = f7 + f4 + (float)ActiveRenderInfo.getPosition().yCoord; + float f10 = f8 / f9; + f10 = (float)(y + (double)f3) + f10; + GlStateManager.translate(f, f10, f2); + GlStateManager.texGen(GlStateManager.TexGen.S, 9217); + GlStateManager.texGen(GlStateManager.TexGen.T, 9217); + GlStateManager.texGen(GlStateManager.TexGen.R, 9217); + GlStateManager.texGen(GlStateManager.TexGen.Q, 9216); + GlStateManager.texGen(GlStateManager.TexGen.S, 9473, this.func_147525_a(1.0F, 0.0F, 0.0F, 0.0F)); + GlStateManager.texGen(GlStateManager.TexGen.T, 9473, this.func_147525_a(0.0F, 0.0F, 1.0F, 0.0F)); + GlStateManager.texGen(GlStateManager.TexGen.R, 9473, this.func_147525_a(0.0F, 0.0F, 0.0F, 1.0F)); + GlStateManager.texGen(GlStateManager.TexGen.Q, 9474, this.func_147525_a(0.0F, 1.0F, 0.0F, 0.0F)); + GlStateManager.enableTexGenCoord(GlStateManager.TexGen.S); + GlStateManager.enableTexGenCoord(GlStateManager.TexGen.T); + GlStateManager.enableTexGenCoord(GlStateManager.TexGen.R); + GlStateManager.enableTexGenCoord(GlStateManager.TexGen.Q); + GlStateManager.popMatrix(); + GlStateManager.matrixMode(5890); + GlStateManager.pushMatrix(); + GlStateManager.loadIdentity(); + GlStateManager.translate(0.0F, (float)(Minecraft.getSystemTime() % 20000) / 20000.0F, 0.0F); + GlStateManager.scale(f5, f5, f5); + GlStateManager.translate(0.5F, 0.5F, 0.0F); + GlStateManager.rotate((float)(i * i * 4321 + i * 9) * 2.0F, 0.0F, 0.0F, 1.0F); + GlStateManager.translate(-0.5F, -0.5F, 0.0F); + GlStateManager.translate(-f, -f2, -f1); + f8 = f7 + (float)ActiveRenderInfo.getPosition().yCoord; + GlStateManager.translate((float)ActiveRenderInfo.getPosition().xCoord * f4 / f8, (float)ActiveRenderInfo.getPosition().zCoord * f4 / f8, -f1); + Tessellator tessellator = Tessellator.getInstance(); + VertexBuffer worldrenderer = tessellator.getBuffer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR); + float f11 = (field_147527_e.nextFloat() * 0.5F + 0.1F) * f6; + float f12 = (field_147527_e.nextFloat() * 0.5F + 0.4F) * f6; + float f13 = (field_147527_e.nextFloat() * 0.5F + 0.5F) * f6; + + if (i == 0) + { + f11 = f12 = 1.0F * f6; + } + + // Botania: change color based on time Color color = Color.getHSBColor(Minecraft.getSystemTime() / 20F % 360 / 360F, 1F, 1F); f11 = color.getRed() / 255F; - float f12 = color.getGreen() / 255F; - float f13 = color.getBlue() / 255F; + f12 = color.getGreen() / 255F; + f13 = color.getBlue() / 255F; - tessellator.setColorRGBA_F(f11 * f7, f12 * f7, f13 * f7, 1.0F); - tessellator.addVertex(p_147500_2_, p_147500_4_ + f4, p_147500_6_); - tessellator.addVertex(p_147500_2_, p_147500_4_ + f4, p_147500_6_ + 1.0D); - tessellator.addVertex(p_147500_2_ + 1.0D, p_147500_4_ + f4, p_147500_6_ + 1.0D); - tessellator.addVertex(p_147500_2_ + 1.0D, p_147500_4_ + f4, p_147500_6_); + f11 *= f6; f12 *= f6; f13 *= f6; + + worldrenderer.pos(x, y + (double)f3, z).color(f11, f12, f13, 1.0F).endVertex(); + worldrenderer.pos(x, y + (double)f3, z + 1.0D).color(f11, f12, f13, 1.0F).endVertex(); + worldrenderer.pos(x + 1.0D, y + (double)f3, z + 1.0D).color(f11, f12, f13, 1.0F).endVertex(); + worldrenderer.pos(x + 1.0D, y + (double)f3, z).color(f11, f12, f13, 1.0F).endVertex(); tessellator.draw(); - GL11.glPopMatrix(); - GL11.glMatrixMode(GL11.GL_MODELVIEW); + GlStateManager.popMatrix(); + GlStateManager.matrixMode(5888); + this.bindTexture(END_SKY_TEXTURE); } - GL11.glDisable(GL11.GL_BLEND); - GL11.glDisable(GL11.GL_TEXTURE_GEN_S); - GL11.glDisable(GL11.GL_TEXTURE_GEN_T); - GL11.glDisable(GL11.GL_TEXTURE_GEN_R); - GL11.glDisable(GL11.GL_TEXTURE_GEN_Q); - GL11.glEnable(GL11.GL_LIGHTING); + GlStateManager.disableBlend(); + GlStateManager.disableTexGenCoord(GlStateManager.TexGen.S); + GlStateManager.disableTexGenCoord(GlStateManager.TexGen.T); + GlStateManager.disableTexGenCoord(GlStateManager.TexGen.R); + GlStateManager.disableTexGenCoord(GlStateManager.TexGen.Q); + GlStateManager.enableLighting(); } - private FloatBuffer func_147525_a(float p_147525_1_, float p_147525_2_, float p_147525_3_, float p_147525_4_) { - field_147528_b.clear(); - field_147528_b.put(p_147525_1_).put(p_147525_2_).put(p_147525_3_).put(p_147525_4_); - field_147528_b.flip(); - return field_147528_b; + private FloatBuffer func_147525_a(float p_147525_1_, float p_147525_2_, float p_147525_3_, float p_147525_4_) + { + this.field_147528_b.clear(); + this.field_147528_b.put(p_147525_1_).put(p_147525_2_).put(p_147525_3_).put(p_147525_4_); + this.field_147528_b.flip(); + return this.field_147528_b; } } diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileTerraPlate.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileTerraPlate.java index c87a336df..41ff6e3d1 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileTerraPlate.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileTerraPlate.java @@ -11,69 +11,68 @@ package vazkii.botania.client.render.tile; import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; - +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import org.lwjgl.opengl.GL11; - import vazkii.botania.client.core.handler.ClientTickHandler; +import vazkii.botania.client.core.handler.MiscellaneousIcons; import vazkii.botania.client.core.helper.ShaderHelper; -import vazkii.botania.common.block.mana.BlockTerraPlate; import vazkii.botania.common.block.tile.TileTerraPlate; -public class RenderTileTerraPlate extends TileEntitySpecialRenderer { +import javax.annotation.Nonnull; + +public class RenderTileTerraPlate extends TileEntitySpecialRenderer { @Override - public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) { - TileTerraPlate plate = (TileTerraPlate) tileentity; - + public void renderTileEntityAt(@Nonnull TileTerraPlate plate, double d0, double d1, double d2, float f, int digProgress) { float max = TileTerraPlate.MAX_MANA / 10F; float alphaMod = Math.min(max, plate.getCurrentMana()) / max; - GL11.glPushMatrix(); - GL11.glTranslated(d0, d1, d2); + GlStateManager.pushMatrix(); + GlStateManager.translate(d0, d1, d2); - GL11.glRotated(90F, 1F, 0F, 0F); - GL11.glTranslatef(0F, 0F, -3F / 16F - 0.001F); + GlStateManager.rotate(90F, 1F, 0F, 0F); + GlStateManager.translate(0F, 0F, -3F / 16F - 0.001F); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1F, 1F, 1F, 1F); - GL11.glDisable(GL11.GL_ALPHA_TEST); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.color(1F, 1F, 1F, 1F); + GlStateManager.disableAlpha(); float alpha = (float) ((Math.sin((ClientTickHandler.ticksInGame + f) / 8D) + 1D) / 5D + 0.6D) * alphaMod; if(ShaderHelper.useShaders()) - GL11.glColor4f(1F, 1F, 1F, alpha); + GlStateManager.color(1F, 1F, 1F, alpha); else { int light = 15728880; int lightmapX = light % 65536; int lightmapY = light / 65536; OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapX, lightmapY); - GL11.glColor4f(0.6F + (float) ((Math.cos((ClientTickHandler.ticksInGame + f) / 6D) + 1D) / 5D), 0.1F, 0.9F, alpha); + GlStateManager.color(0.6F + (float) ((Math.cos((ClientTickHandler.ticksInGame + f) / 6D) + 1D) / 5D), 0.1F, 0.9F, alpha); } - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); ShaderHelper.useShader(ShaderHelper.terraPlateRune); - renderIcon(0, 0, BlockTerraPlate.overlay, 1, 1, 240); + renderIcon(0, 0, MiscellaneousIcons.INSTANCE.terraPlateOverlay, 1, 1, 240); ShaderHelper.releaseShader(); - GL11.glEnable(GL11.GL_ALPHA_TEST); - GL11.glDisable(GL11.GL_BLEND); - GL11.glColor4f(1F, 1F, 1F, 1F); - GL11.glPopMatrix(); + GlStateManager.enableAlpha(); + GlStateManager.disableBlend(); + GlStateManager.color(1F, 1F, 1F, 1F); + GlStateManager.popMatrix(); } - public void renderIcon(int par1, int par2, IIcon par3Icon, int par4, int par5, int brightness) { - Tessellator tessellator = Tessellator.instance; - tessellator.startDrawingQuads(); - tessellator.setBrightness(brightness); - tessellator.addVertexWithUV(par1 + 0, par2 + par5, 0, par3Icon.getMinU(), par3Icon.getMaxV()); - tessellator.addVertexWithUV(par1 + par4, par2 + par5, 0, par3Icon.getMaxU(), par3Icon.getMaxV()); - tessellator.addVertexWithUV(par1 + par4, par2 + 0, 0, par3Icon.getMaxU(), par3Icon.getMinV()); - tessellator.addVertexWithUV(par1 + 0, par2 + 0, 0, par3Icon.getMinU(), par3Icon.getMinV()); + public void renderIcon(int par1, int par2, TextureAtlasSprite par3Icon, int par4, int par5, int brightness) { + Tessellator tessellator = Tessellator.getInstance(); + tessellator.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); + //tessellator.getBuffer().setBrightness(brightness); + tessellator.getBuffer().pos(par1 + 0, par2 + par5, 0).tex(par3Icon.getMinU(), par3Icon.getMaxV()).endVertex(); + tessellator.getBuffer().pos(par1 + par4, par2 + par5, 0).tex(par3Icon.getMaxU(), par3Icon.getMaxV()).endVertex(); + tessellator.getBuffer().pos(par1 + par4, par2 + 0, 0).tex(par3Icon.getMaxU(), par3Icon.getMinV()).endVertex(); + tessellator.getBuffer().pos(par1 + 0, par2 + 0, 0).tex(par3Icon.getMinU(), par3Icon.getMinV()).endVertex(); tessellator.draw(); } diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileTeruTeruBozu.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileTeruTeruBozu.java index adcb0cbc9..27e65e6d6 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileTeruTeruBozu.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileTeruTeruBozu.java @@ -10,56 +10,55 @@ */ package vazkii.botania.client.render.tile; -import java.util.Random; - import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; - import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - import vazkii.botania.client.core.proxy.ClientProxy; import vazkii.botania.client.lib.LibResources; import vazkii.botania.client.model.ModelTeruTeruBozu; import vazkii.botania.common.Botania; +import vazkii.botania.common.block.tile.TileTeruTeruBozu; -public class RenderTileTeruTeruBozu extends TileEntitySpecialRenderer { +import javax.annotation.Nonnull; +import java.util.Random; + +public class RenderTileTeruTeruBozu extends TileEntitySpecialRenderer { private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_TERU_TERU_BOZU); private static final ResourceLocation textureHalloween = new ResourceLocation(LibResources.MODEL_TERU_TERU_BOZU_HALLOWEEN); - ModelTeruTeruBozu model = new ModelTeruTeruBozu(); + final ModelTeruTeruBozu model = new ModelTeruTeruBozu(); @Override - public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) { - GL11.glPushMatrix(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glEnable(GL11.GL_BLEND); - GL11.glDisable(GL11.GL_CULL_FACE); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1F, 1F, 1F, 1F); - GL11.glTranslated(d0, d1, d2); + public void renderTileEntityAt(@Nonnull TileTeruTeruBozu tileentity, double d0, double d1, double d2, float f, int digProgress) { + GlStateManager.pushMatrix(); + GlStateManager.enableRescaleNormal(); + GlStateManager.enableBlend(); + GlStateManager.disableCull(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.color(1F, 1F, 1F, 1F); + GlStateManager.translate(d0, d1, d2); Minecraft.getMinecraft().renderEngine.bindTexture(ClientProxy.dootDoot ? textureHalloween : texture); - GL11.glRotatef(180F, 1F, 0F, 0F); + GlStateManager.rotate(180F, 1F, 0F, 0F); double time = Botania.proxy.getWorldElapsedTicks() + f; - boolean hasWorld = tileentity.getWorldObj() != null; + boolean hasWorld = tileentity != null && tileentity.getWorld() != null; if(hasWorld) - time += new Random(tileentity.xCoord ^ tileentity.yCoord ^ tileentity.zCoord).nextInt(1000); + time += new Random(tileentity.getPos().hashCode()).nextInt(1000); - GL11.glTranslatef(0.5F, -1.25F + (hasWorld ? (float) Math.sin(time * 0.01F) * 0.05F : 0F), -0.5F); + GlStateManager.translate(0.5F, -1.25F + (hasWorld ? (float) Math.sin(time * 0.01F) * 0.05F : 0F), -0.5F); if(hasWorld) { - GL11.glRotated(time * 0.3, 0F, 1F, 0F); - GL11.glRotatef(4F * (float) Math.sin(time * 0.05F), 0F, 0F, 1F); + GlStateManager.rotate(((float) (time * 0.3)), 0F, 1F, 0F); + GlStateManager.rotate(4F * (float) Math.sin(time * 0.05F), 0F, 0F, 1F); float s = 0.75F; - GL11.glScalef(s, s, s); + GlStateManager.scale(s, s, s); } model.render(); - GL11.glColor3f(1F, 1F, 1F); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glPopMatrix(); + GlStateManager.color(1F, 1F, 1F); + GlStateManager.enableRescaleNormal(); + GlStateManager.enableCull(); + GlStateManager.popMatrix(); } } diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileTinyPotato.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileTinyPotato.java index d8883a54a..a92d1d7f2 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileTinyPotato.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileTinyPotato.java @@ -10,391 +10,443 @@ */ package vazkii.botania.client.render.tile; +import net.minecraft.block.Block; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.OpenGlHelper; -import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.VertexBuffer; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.init.Blocks; import net.minecraft.init.Items; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.RayTraceResult; import net.minecraftforge.common.MinecraftForge; - import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - import vazkii.botania.api.item.TinyPotatoRenderEvent; import vazkii.botania.client.core.handler.ContributorFancinessHandler; +import vazkii.botania.client.core.handler.MiscellaneousIcons; +import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.client.core.helper.ShaderHelper; import vazkii.botania.client.core.proxy.ClientProxy; import vazkii.botania.client.lib.LibResources; import vazkii.botania.client.model.ModelTinyPotato; +import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.tile.TileTinyPotato; import vazkii.botania.common.item.ModItems; +import vazkii.botania.common.item.equipment.bauble.ItemBaubleCosmetic; import vazkii.botania.common.item.equipment.bauble.ItemFlightTiara; -import vazkii.botania.common.item.material.ItemManaResource; -import vazkii.botania.common.item.relic.ItemInfiniteFruit; -public class RenderTileTinyPotato extends TileEntitySpecialRenderer { +import javax.annotation.Nonnull; +import java.util.Arrays; +public class RenderTileTinyPotato extends TileEntitySpecialRenderer { private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_TINY_POTATO); private static final ResourceLocation textureGrayscale = new ResourceLocation(LibResources.MODEL_TINY_POTATO_GS); private static final ResourceLocation textureHalloween = new ResourceLocation(LibResources.MODEL_TINY_POTATO_HALLOWEEN); private static final ModelTinyPotato model = new ModelTinyPotato(); + private final ItemStack[] cosmetics = Arrays.stream(ItemBaubleCosmetic.Variants.values()).map(v -> new ItemStack(ModItems.cosmetic, 1, v.ordinal())).toArray(ItemStack[]::new); + + + private static boolean matches(String name, String match) { + return name.equals(match) || name.startsWith(match + " "); + } + + private static String removeFromFront(String name, String match) { + return name.substring(match.length()).trim(); + } @Override - public void renderTileEntityAt(TileEntity var1, double d0, double d1, double d2, float var8) { - TileTinyPotato potato = (TileTinyPotato) var1; - GL11.glPushMatrix(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glColor4f(1F, 1F, 1F, 1F); - GL11.glTranslated(d0, d1, d2); + public void renderTileEntityAt(@Nonnull TileTinyPotato potato, double x, double y, double z, float partialTicks, int destroyStage) { + if(!potato.getWorld().isBlockLoaded(potato.getPos(), false) + || potato.getWorld().getBlockState(potato.getPos()).getBlock() != ModBlocks.tinyPotato) + return; + + GlStateManager.pushMatrix(); + GlStateManager.enableRescaleNormal(); + GlStateManager.color(1F, 1F, 1F, 1F); + GlStateManager.translate(x, y, z); Minecraft mc = Minecraft.getMinecraft(); mc.renderEngine.bindTexture(ClientProxy.dootDoot ? textureHalloween : texture); - String name = potato.name.toLowerCase(); + String name = potato.name.toLowerCase().trim(); boolean usedShader = false; - if(name.startsWith("gaia ")) { + if (matches(name, "gaia")) { ShaderHelper.useShader(ShaderHelper.doppleganger); - name = name.substring(5); + name = removeFromFront(name, "gaia"); usedShader = true; - } else if(name.startsWith("hot ")) { + } else if (matches(name, "hot")) { ShaderHelper.useShader(ShaderHelper.halo); - name = name.substring(4); + name = removeFromFront(name, "hot"); usedShader = true; - } else if(name.startsWith("magic ")) { + } else if (matches(name, "magic")) { ShaderHelper.useShader(ShaderHelper.enchanterRune); - name = name.substring(6); + name = removeFromFront(name, "magic"); usedShader = true; - } else if(name.startsWith("gold ")) { + } else if (matches(name, "gold")) { ShaderHelper.useShader(ShaderHelper.gold); - name = name.substring(5); + name = removeFromFront(name, "gold"); usedShader = true; - } else if(name.startsWith("snoop ")) { + } else if (matches(name, "snoop")) { ShaderHelper.useShader(ShaderHelper.terraPlateRune); - name = name.substring(6); + name = removeFromFront(name, "snoop"); usedShader = true; } - GL11.glTranslatef(0.5F, 1.5F, 0.5F); - GL11.glScalef(1F, -1F, -1F); - int meta = potato.getWorldObj() == null ? 3 : potato.getBlockMetadata(); + GlStateManager.translate(0.5F, 1.5F, 0.5F); + GlStateManager.scale(1F, -1F, -1F); + int meta = potato.getWorld() == null ? 3 : potato.getBlockMetadata(); float rotY = meta * 90F - 180F; - GL11.glRotatef(rotY, 0F, 1F, 0F); + GlStateManager.rotate(rotY, 0F, 1F, 0F); float jump = potato.jumpTicks; - if(jump > 0) - jump -= var8; + if (jump > 0) + jump -= partialTicks; float up = (float) -Math.abs(Math.sin(jump / 10 * Math.PI)) * 0.2F; float rotZ = (float) Math.sin(jump / 10 * Math.PI) * 2; - GL11.glTranslatef(0F, up, 0F); - GL11.glRotatef(rotZ, 0F, 0F, 1F); + GlStateManager.translate(0F, up, 0F); + GlStateManager.rotate(rotZ, 0F, 0F, 1F); - GL11.glPushMatrix(); - if(name.equals("pahimar")) { - GL11.glScalef(1F, 0.3F, 1F); - GL11.glTranslatef(0F, 3.5F, 0F); - } else if(name.equals("kyle hyde")) - mc.renderEngine.bindTexture(textureGrayscale); - else if(name.equals("dinnerbone") || name.equals("grumm")) { - GL11.glRotatef(180F, 0F, 0F, 1F); - GL11.glTranslatef(0F, -2.625F, 0F); - } else if(name.equals("aureylian")) - GL11.glColor3f(1F, 0.5F, 1F); + GlStateManager.pushMatrix(); + switch (name) { + case "pahimar": + GlStateManager.scale(1F, 0.3F, 1F); + GlStateManager.translate(0F, 3.5F, 0F); + break; + case "kyle hyde": + mc.renderEngine.bindTexture(textureGrayscale); + break; + case "dinnerbone": + case "grumm": + GlStateManager.rotate(180F, 0F, 0F, 1F); + GlStateManager.translate(0F, -2.625F, 0F); + break; + case "aureylian": + GlStateManager.color(1F, 0.5F, 1F); + break; + } boolean render = !(name.equals("mami") || name.equals("soaryn") || name.equals("eloraam") && jump != 0); - if(render) + if (render) model.render(); - if(name.equals("kingdaddydmac")) { - GL11.glTranslated(0.5F, 0F, 0F); + if (name.equals("kingdaddydmac")) { + GlStateManager.translate(0.5F, 0F, 0F); model.render(); } - if(usedShader) + if (usedShader) ShaderHelper.releaseShader(); - GL11.glPopMatrix(); + GlStateManager.popMatrix(); - if(!name.isEmpty()) { - GL11.glPushMatrix(); - mc.renderEngine.bindTexture(TextureMap.locationItemsTexture); + if (!name.isEmpty()) { + GlStateManager.pushMatrix(); + mc.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); ContributorFancinessHandler.firstStart(); float scale = 1F / 4F; - GL11.glTranslatef(0F, 1F, 0F); - GL11.glScalef(scale, scale, scale); - if(name.equals("phi") || name.equals("vazkii")) { - GL11.glTranslatef(0.45F, 0F, 0.4F); - GL11.glRotatef(90F, 0F, 1F, 0F); - GL11.glRotatef(20F, 1F, 0F, 1F); - renderIcon(((ItemManaResource) ModItems.manaResource).phiFlowerIcon); + GlStateManager.translate(0F, 1F, 0F); + GlStateManager.scale(scale, scale, scale); + if (name.equals("phi") || name.equals("vazkii")) { + GlStateManager.translate(0.45F, 0F, 0.4F); + GlStateManager.rotate(90F, 0F, 1F, 0F); + GlStateManager.rotate(20F, 1F, 0F, 1F); + renderIcon(MiscellaneousIcons.INSTANCE.phiFlowerIcon); - if(name.equals("vazkii")) { - GL11.glRotatef(-20F, 1F, 0F, 1F); - GL11.glScalef(1.25F, 1.25F, 1.25F); - GL11.glRotatef(180F, 0F, 0F, 1F); - GL11.glTranslatef(-1.5F, -1.3F, -0.75F); - renderIcon(((ItemManaResource) ModItems.manaResource).nerfBatIcon); + if (name.equals("vazkii")) { + GlStateManager.rotate(-20F, 1F, 0F, 1F); + GlStateManager.scale(1.25F, 1.25F, 1.25F); + GlStateManager.rotate(180F, 0F, 0F, 1F); + GlStateManager.translate(-1.5F, -1.3F, -0.75F); + renderIcon(MiscellaneousIcons.INSTANCE.nerfBatIcon); } - } else if(name.equals("skull kid")) { - GL11.glScalef(1.25F, 1.25F, 1.25F); - GL11.glRotatef(180F, 0F, 0F, 1F); - GL11.glTranslatef(-0.5F, -1.2F, -0.4F); - renderIcon(ModItems.cosmetic.getIconFromDamage(23)); - } else if(name.equals("kamina")) { - GL11.glScalef(1.25F, 1.25F, 1.25F); - GL11.glRotatef(180F, 0F, 0F, 1F); - GL11.glTranslatef(-0.5F, -1.1F, -0.4F); - renderIcon(ModItems.cosmetic.getIconFromDamage(26)); - } else if(name.equals("haighyorkie")) { - GL11.glScalef(1.25F, 1.25F, 1.25F); - GL11.glRotatef(180F, 0F, 0F, 1F); - GL11.glRotatef(90F, 0F, 1F, 0F); - GL11.glTranslatef(-0.5F, -1.2F, -0.4F); - renderIcon(((ItemManaResource) ModItems.manaResource).goldfishIcon); - } else if(name.equals("chitoge")) { - GL11.glScalef(1.25F, 1.25F, 1.25F); - GL11.glRotatef(180F, 0F, 0F, 1F); - GL11.glTranslatef(-0.5F, -0.7F, 0.1F); - renderIcon(ModItems.cosmetic.getIconFromDamage(7)); - } else if(name.equals("direwolf20")) { - GL11.glRotatef(180F, 0F, 0F, 1F); - GL11.glTranslatef(-0.5F, -2.2F, -0.5F); - renderIcon(ModItems.cosmetic.getIconFromDamage(0)); - } else if(name.equals("doctor")) { - GL11.glScalef(1.25F, 1.25F, 1.25F); - GL11.glRotatef(180F, 0F, 0F, 1F); - GL11.glTranslatef(-0.5F, -1.15F, -0.4F); - renderIcon(ModItems.cosmetic.getIconFromDamage(25)); - } else if(name.equals("snoo")) { - GL11.glScalef(1.25F, 1.25F, 1.25F); - GL11.glRotatef(180F, 0F, 0F, 1F); - GL11.glTranslatef(-0.5F, -0.7F, 0.1F); - GL11.glRotatef(20F, 0F, 0F, 1F); - renderIcon(ModItems.cosmetic.getIconFromDamage(24)); - } else if(name.equals("charlotte")) { - GL11.glScalef(1.25F, 1.25F, 1.25F); - GL11.glRotatef(180F, 0F, 0F, 1F); - GL11.glTranslatef(-0.5F, -1.2F, -0.4F); - renderIcon(ModItems.cosmetic.getIconFromDamage(12)); - } else if(name.equals("greg") || name.equals("gregorioust")) { - GL11.glScalef(1.25F, 1.25F, 1.25F); - GL11.glRotatef(180F, 0F, 0F, 1F); - GL11.glRotatef(90F, 0F, 1F, 0F); - GL11.glTranslatef(-0.5F, -1.5F, -0.4F); - renderIcon(Items.book.getIconFromDamage(0)); + } else if (name.equals("skull kid")) { + GlStateManager.scale(1.25F, 1.25F, 1.25F); + GlStateManager.rotate(180F, 0F, 0F, 1F); + GlStateManager.rotate(180F, 0F, 1F, 0F); + GlStateManager.translate(0F, -1.6F, 0F); + renderItem(cosmetics[23]); + } else if (name.equals("kamina")) { + GlStateManager.scale(1.25F, 1.25F, 1.25F); + GlStateManager.rotate(180F, 0F, 0F, 1F); + GlStateManager.rotate(180F, 0F, 1F, 0F); + GlStateManager.translate(0F, -1.4F, 0F); + renderItem(cosmetics[26]); + } else if (name.equals("haighyorkie")) { + GlStateManager.scale(1.25F, 1.25F, 1.25F); + GlStateManager.rotate(180F, 0F, 0F, 1F); + GlStateManager.rotate(90F, 0F, 1F, 0F); + GlStateManager.translate(-0.5F, -1.2F, -0.4F); + renderIcon(MiscellaneousIcons.INSTANCE.goldfishIcon); + } else if (name.equals("chitoge")) { + GlStateManager.scale(1.25F, 1.25F, 1.25F); + GlStateManager.rotate(180F, 0F, 0F, 1F); + GlStateManager.translate(0F, -1F, -0.4F); + renderItem(cosmetics[7]); + } else if (name.equals("direwolf20")) { + GlStateManager.rotate(180F, 0F, 0F, 1F); + GlStateManager.rotate(180F, 0F, 1F, 0F); + GlStateManager.translate(0F, -2.5F, 0.125F); + renderItem(cosmetics[0]); + } else if (name.equals("doctor")) { + GlStateManager.scale(1.25F, 1.25F, 1.25F); + GlStateManager.rotate(180F, 0F, 0F, 1F); + GlStateManager.rotate(180F, 0F, 1F, 0F); + GlStateManager.translate(0F, -1.45F, 0F); + renderItem(cosmetics[25]); + } else if (name.equals("snoo")) { + GlStateManager.scale(1.25F, 1.25F, 1.25F); + GlStateManager.rotate(180F, 0F, 0F, 1F); + GlStateManager.translate(0F, -0.75F, -0.5F); + renderItem(cosmetics[24]); + } else if (name.equals("charlotte")) { + GlStateManager.scale(1.25F, 1.25F, 1.25F); + GlStateManager.rotate(180F, 0F, 0F, 1F); + GlStateManager.rotate(180F, 0F, 1F, 0F); + GlStateManager.translate(0F, -1.6F, 0F); + renderItem(cosmetics[12]); + } else if (name.equals("greg") || name.equals("gregorioust")) { + GlStateManager.scale(1.25F, 1.25F, 1.25F); + GlStateManager.rotate(180F, 1F, 0F, 0F); + GlStateManager.rotate(270F, 0F, 1F, 0F); + GlStateManager.translate(0F, -1.5F, -0.9F); + renderItem(new ItemStack(Items.BOOK)); - mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture); - GL11.glTranslatef(0.5F, 0.5F, 0F); - GL11.glScalef(0.3F, 0.3F, 0.3F); + mc.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + GlStateManager.scale(0.3F, 0.3F, 0.3F); + GlStateManager.translate(0F, 2.5F, 1.5F); + renderItem(new ItemStack(Blocks.IRON_ORE)); + } else if (name.equals("profmobius")) { + GlStateManager.scale(1.25F, 1.25F, 1.25F); + GlStateManager.rotate(180F, 1F, 0F, 0F); + GlStateManager.rotate(270F, 0F, 1F, 0F); + GlStateManager.translate(0F, -1.5F, -0.9F); + renderItem(new ItemStack(Items.BREAD)); + } else if (name.equals("martysgames") || name.equals("marty")) { + GlStateManager.scale(0.7F, 0.7F, 0.7F); + GlStateManager.rotate(180F, 0F, 0F, 1F); + GlStateManager.translate(-0.3F, -2.7F, -1.2F); + GlStateManager.rotate(15F, 0F, 0F, 1F); + renderItem(new ItemStack(ModItems.infiniteFruit, 1).setStackDisplayName("das boot")); + } else if (name.equals("tromped")) { + GlStateManager.scale(1.25F, 1.25F, 1.25F); + GlStateManager.rotate(180F, 1F, 0F, 0F); + GlStateManager.rotate(270F, 0F, 1F, 0F); + GlStateManager.translate(0F, -1.5F, -0.9F); + renderItem(new ItemStack(ModItems.cacophonium)); + } else if (name.equals("kain vinosec")) { + GlStateManager.scale(1.25F, 1.25F, 1.25F); + GlStateManager.rotate(180F, 1F, 0F, 0F); + GlStateManager.rotate(270F, 0F, 1F, 0F); + GlStateManager.translate(0.25F, -1.8F, -0.9F); + renderItem(new ItemStack(ModItems.recordGaia1)); + GlStateManager.translate(0F, 0F, 0.85F); + renderItem(new ItemStack(ModItems.recordGaia2)); + } else if (name.equals("mankrik")) { + GlStateManager.scale(1.25F, 1.25F, 1.25F); + GlStateManager.rotate(180F, 0F, 0F, 1F); + GlStateManager.rotate(180F, 0F, 1F, 0F); + GlStateManager.translate(0F, -0.5F, -0.5F); + renderItem(cosmetics[31]); + } else if (name.equals("kurumi")) { + GlStateManager.scale(0.4F, 0.4F, 0.4F); + GlStateManager.rotate(180F, 0F, 0F, 1F); + GlStateManager.translate(-0.45F, -2.85F, -1.75F); + renderItem(cosmetics[17]); + } else if (name.equals("ichun")) { + GlStateManager.scale(1.25F, 1.25F, 1.25F); + GlStateManager.rotate(180F, 0F, 0F, 1F); + GlStateManager.rotate(180F, 0F, 1F, 0F); + GlStateManager.translate(0F, -1.45F, 0F); + renderItem(cosmetics[15]); + } else if (name.equals("wiiv") || name.equals("dylan4ever") || name.equals("dylankaiser")) { + GlStateManager.scale(1.25F, 1.25F, 1.25F); + GlStateManager.rotate(180F, 1F, 0F, 0F); + GlStateManager.rotate(270F, 0F, 1F, 0F); + GlStateManager.translate(0F, -1.5F, -0.9F); + renderItem(new ItemStack(Items.PAINTING)); + } else if (name.equals("jibril")) { + GlStateManager.scale(1.5F, 1.5F, 1.5F); + GlStateManager.translate(0F, -0.8F, 0F); + GlStateManager.rotate(90F, 0F, 1F, 0F); + ItemFlightTiara.renderHalo(null, partialTicks); + GlStateManager.disableBlend(); + GlStateManager.disableLighting(); + } else if (name.equals("nebris")) { + GlStateManager.rotate(180F, 1F, 0F, 0F); + mc.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + renderItem(new ItemStack(Blocks.GLOWSTONE)); + } else if (name.equals("ible")) { + mc.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + GlStateManager.scale(1.2F, 1.2F, 1.2F); + GlStateManager.translate(-0.5F, 0F, -0.5F); + GlStateManager.rotate(180F, 1F, 1F, 0F); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + renderBlock(Blocks.PORTAL); + } else if (name.equals("razz") || name.equals("razzleberryfox")) { + GlStateManager.scale(1.25F, 1.25F, 1.25F); + GlStateManager.rotate(180F, 1F, 0F, 0F); + GlStateManager.rotate(270F, 0F, 1F, 0F); + GlStateManager.translate(0F, -1.5F, 0F); + renderItem(cosmetics[8]); + } else if (name.equals("etho") || name.equals("ethoslab")) { + GlStateManager.scale(1.25F, 1.25F, 1.25F); + GlStateManager.rotate(180F, 1F, 0F, 0F); + GlStateManager.rotate(270F, 0F, 1F, 0F); + GlStateManager.translate(0F, -1.5F, -0.9F); + renderItem(new ItemStack(Items.COOKIE)); + } else if (name.equals("sethbling")) { + GlStateManager.scale(1.2F, 1.2F, 1.2F); + GlStateManager.rotate(-90F, 0F, 1F, 0F); + GlStateManager.translate(-0.5F, 1.4F, -0.5F); + GlStateManager.rotate(180F, 1F, 0F, 0F); + mc.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + renderBlock(Blocks.COMMAND_BLOCK); + } else if (name.equals("bdoubleo100") || name.equals("bdoubleo")) { + GlStateManager.scale(1.25F, 1.25F, 1.25F); + GlStateManager.rotate(180F, 1F, 0F, 0F); + GlStateManager.rotate(180F, 0F, 1F, 0F); + GlStateManager.translate(-0.65F, -1.5F, -0.45F); + renderItem(new ItemStack(Items.STICK)); + } else if (name.equals("kingdaddydmac")) { + GlStateManager.scale(0.5F, 0.5F, 0.5F); + GlStateManager.rotate(180F, 0F, 0F, 1F); + GlStateManager.rotate(90F, 0F, 1F, 0F); + GlStateManager.translate(0F, -3F, 0.65F); + renderItem(new ItemStack(ModItems.manaRing, 1, 0)); + GlStateManager.translate(0F, 0F, -4F); + renderItem(new ItemStack(ModItems.manaRing, 1, 0)); - RenderBlocks.getInstance().renderBlockAsItem(Blocks.iron_ore, 0, 1F); - } else if(name.equals("profmobius")) { - GL11.glScalef(1.25F, 1.25F, 1.25F); - GL11.glRotatef(180F, 0F, 0F, 1F); - GL11.glRotatef(90F, 0F, 1F, 0F); - GL11.glTranslatef(-0.5F, -1.2F, -0.4F); - renderIcon(Items.bread.getIconFromDamage(0)); - } else if(name.equals("martysgames") || name.equals("marty")) { - GL11.glScalef(0.7F, 0.7F, 0.7F); - GL11.glRotatef(180F, 0F, 0F, 1F); - GL11.glTranslatef(-0.75F, -2.4F, -0.7F); - GL11.glRotatef(10F, 0F, 0F, 1F); - renderIcon(ItemInfiniteFruit.dasBootIcon); - } else if(name.equals("tromped")) { - GL11.glScalef(1.25F, 1.25F, 1.25F); - GL11.glRotatef(180F, 0F, 0F, 1F); - GL11.glRotatef(90F, 0F, 1F, 0F); - GL11.glTranslatef(-0.5F, -1.2F, -0.4F); - renderIcon(ModItems.cacophonium.getIconFromDamage(0)); - } else if(name.equals("kain vinosec")) { - GL11.glScalef(1.25F, 1.25F, 1.25F); - GL11.glRotatef(180F, 0F, 0F, 1F); - GL11.glRotatef(90F, 0F, 1F, 0F); - GL11.glTranslatef(-0.3F, -1.5F, -0.4F); - renderIcon(ModItems.recordGaia1.getIconFromDamage(0)); - GL11.glTranslatef(0F, 0F, 0.85F); - renderIcon(ModItems.recordGaia2.getIconFromDamage(0)); - } else if(name.equals("mankrik")) { - GL11.glScalef(1.25F, 1.25F, 1.25F); - GL11.glRotatef(180F, 0F, 0F, 1F); - GL11.glTranslatef(-0.5F, -0.2F, -0.1F); - renderIcon(ModItems.cosmetic.getIconFromDamage(31)); - } else if(name.equals("kurumi")) { - GL11.glScalef(0.4F, 0.4F, 0.4F); - GL11.glRotatef(180F, 0F, 0F, 1F); - GL11.glTranslatef(-0.9F, -2.5F, -1.3F); - renderIcon(ModItems.cosmetic.getIconFromDamage(17)); - } else if(name.equals("ichun")) { - GL11.glScalef(1.25F, 1.25F, 1.25F); - GL11.glRotatef(180F, 0F, 0F, 1F); - GL11.glTranslatef(-0.5F, -1.2F, -0.4F); - renderIcon(ModItems.cosmetic.getIconFromDamage(15)); - } else if(name.equals("wiiv") || name.equals("dylan4ever") || name.equals("dylankaiser")) { - GL11.glScalef(1.5F, 1.5F, 1.5F); - GL11.glRotatef(180F, 0F, 0F, 1F); - GL11.glRotatef(90F, 0F, 1F, 0F); - GL11.glTranslatef(-0.5F, -1.1F, -0.325F); - renderIcon(Items.painting.getIconFromDamage(0)); - } else if(name.equals("jibril")) { - GL11.glScalef(1.5F, 1.5F, 1.5F); - GL11.glTranslatef(0F, 0.7F, 0F); - GL11.glRotatef(90F, 0F, 1F, 0F); - ItemFlightTiara.renderHalo(null, var8); - } else if(name.equals("nebris")) { - mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture); - GL11.glRotatef(180F, 1F, 0F, 0F); - RenderBlocks.getInstance().renderBlockAsItem(Blocks.glowstone, 0, 1F); - } else if(name.equals("ible")) { - mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture); - GL11.glScalef(1.2F, 1.2F, 1.2F); - GL11.glTranslatef(0F, 0.7F, 0F); - GL11.glRotatef(180F, 1F, 0F, 0F); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - RenderBlocks.getInstance().renderBlockAsItem(Blocks.portal, 0, 1F); - } else if(name.equals("razz") || name.equals("razzleberryfox")) { - GL11.glScalef(1.25F, 1.25F, 1.25F); - GL11.glRotatef(180F, 0F, 0F, 1F); - GL11.glRotatef(90F, 0F, 1F, 0F); - GL11.glTranslatef(-0.5F, -1F, 0.45F); - renderIcon(ModItems.cosmetic.getIconFromDamage(8)); - } else if(name.equals("etho") || name.equals("ethoslab")) { - GL11.glScalef(1.25F, 1.25F, 1.25F); - GL11.glRotatef(180F, 0F, 0F, 1F); - GL11.glRotatef(90F, 0F, 1F, 0F); - GL11.glTranslatef(-0.5F, -1.2F, -0.4F); - renderIcon(Items.cookie.getIconFromDamage(0)); - } else if(name.equals("sethbling")) { - mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture); - GL11.glScalef(1.2F, 1.2F, 1.2F); - GL11.glTranslatef(0F, 0.9F, 0F); - GL11.glRotatef(180F, 1F, 0F, 0F); - RenderBlocks.getInstance().renderBlockAsItem(Blocks.command_block, 0, 1F); - } else if(name.equals("bdoubleo100") || name.equals("bdoubleo")) { - GL11.glScalef(1.25F, 1.25F, 1.25F); - GL11.glRotatef(180F, 0F, 0F, 1F); - GL11.glTranslatef(-1F, -1.1F, -0.1F); - renderIcon(Items.stick.getIconFromDamage(0)); - } else if(name.equals("kingdaddydmac")) { - GL11.glScalef(0.5F, 0.5F, 0.5F); - GL11.glRotatef(180F, 0F, 0F, 1F); - GL11.glRotatef(90F, 0F, 1F, 0F); - GL11.glTranslatef(-0.3F, -2.5F, 1.075F); - renderIcon(ModItems.manaRing.getIconFromDamage(0)); - GL11.glTranslatef(0F, 0F, -4F); - renderIcon(ModItems.manaRing.getIconFromDamage(0)); - - mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture); - GL11.glScalef(1.5F, 1.5F, 1.5F); - GL11.glTranslatef(1.5F, -0.5F, 0.7F); - RenderBlocks.getInstance().renderBlockAsItem(Blocks.cake, 0, 1F); - } else if(name.equals("sjin")) { - GL11.glScalef(1.25F, 1.25F, 1.25F); - GL11.glRotatef(180F, 0F, 0F, 1F); - GL11.glTranslatef(-0.5F, -1.27F, -0.4F); - renderIcon(ModItems.cosmetic.getIconFromDamage(27)); - } else if(name.equals("martyn") || name.equals("inthelittlewood")) { - GL11.glScalef(1.25F, 1.25F, 1.25F); - GL11.glRotatef(180F, 0F, 0F, 1F); - GL11.glTranslatef(-0.5F, -0.45F, -0.1F); - mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture); - renderIcon(Blocks.sapling.getIcon(0, 0)); - }else if(ContributorFancinessHandler.flowerMap != null && ContributorFancinessHandler.flowerMap.containsKey(name)) { - IIcon icon = ContributorFancinessHandler.flowerMap.get(name); - if(icon != null) { - mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture); - GL11.glRotatef(180F, 1F, 0F, 0F); - GL11.glTranslatef(-0.5F, -0.5F, 0F); + GlStateManager.scale(0.8F, 0.8F, 0.8F); + GlStateManager.translate(1.25F, -1.25F, 2.25F); + mc.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + renderBlock(Blocks.CAKE); + } else if (name.equals("sjin")) { + GlStateManager.scale(1.25F, 1.25F, 1.25F); + GlStateManager.rotate(180F, 0F, 0F, 1F); + GlStateManager.rotate(180F, 0F, 1F, 0F); + GlStateManager.translate(0F, -1.6F, 0F); + renderItem(cosmetics[27]); + } else if (name.equals("martyn") || name.equals("inthelittlewood")) { + GlStateManager.scale(1.25F, 1.25F, 1.25F); + GlStateManager.rotate(180F, 0F, 0F, 1F); + GlStateManager.rotate(180F, 0F, 1F, 0F); + GlStateManager.translate(0F, -0.8F, -0.2F); + mc.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + renderItem(new ItemStack(Blocks.SAPLING, 0, 0)); + } else if (name.equals("williewillus")) { + GlStateManager.rotate(180F, 1F, 0F, 0F); + mc.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + renderItem(new ItemStack(Blocks.field_189879_dh)); + GlStateManager.scale(0.75F, 0.75F, 0.75F); + GlStateManager.translate(-1.1F, -1.25F, 0F); + renderItem(new ItemStack(Blocks.CHORUS_FLOWER)); + GlStateManager.translate(2.2F, 0F, 0F); + renderItem(new ItemStack(Blocks.PRISMARINE)); + } else if (ContributorFancinessHandler.flowerMap != null && ContributorFancinessHandler.flowerMap.containsKey(name)) { + ItemStack icon = ContributorFancinessHandler.flowerMap.get(name); + if (icon != null) { + mc.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + GlStateManager.rotate(180F, 1F, 0F, 0F); + GlStateManager.rotate(180F, 0F, 1F, 0F); + GlStateManager.translate(0F, 0F, 0F); ShaderHelper.useShader(ShaderHelper.gold); - renderIcon(icon); + renderItem(icon); ShaderHelper.releaseShader(); } } - GL11.glPopMatrix(); + GlStateManager.popMatrix(); } - MinecraftForge.EVENT_BUS.post(new TinyPotatoRenderEvent(potato, potato.name, d0, d1, d2, var8)); + MinecraftForge.EVENT_BUS.post(new TinyPotatoRenderEvent(potato, potato.name, x, y, z, partialTicks, destroyStage)); - GL11.glRotatef(-rotZ, 0F, 0F, 1F); - GL11.glRotatef(-rotY, 0F, 1F, 0F); - GL11.glColor3f(1F, 1F, 1F); - GL11.glScalef(1F, -1F, -1F); + GlStateManager.rotate(-rotZ, 0F, 0F, 1F); + GlStateManager.rotate(-rotY, 0F, 1F, 0F); + GlStateManager.color(1F, 1F, 1F); + GlStateManager.scale(1F, -1F, -1F); - MovingObjectPosition pos = mc.objectMouseOver; - if(!name.isEmpty() && pos != null && pos.blockX == potato.xCoord && pos.blockY == potato.yCoord && pos.blockZ == potato.zCoord) { - GL11.glPushMatrix(); - GL11.glTranslatef(0F, -0.6F, 0F); - GL11.glRotatef(-RenderManager.instance.playerViewY, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(RenderManager.instance.playerViewX, 1.0F, 0.0F, 0.0F); + RayTraceResult pos = mc.objectMouseOver; + if (!name.isEmpty() && pos != null && pos.getBlockPos() != null && potato.getPos().equals(pos.getBlockPos())) { + GlStateManager.pushMatrix(); + GlStateManager.translate(0F, -0.6F, 0F); + GlStateManager.rotate(-mc.getRenderManager().playerViewY, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(mc.getRenderManager().playerViewX, 1.0F, 0.0F, 0.0F); float f = 1.6F; float f1 = 0.016666668F * f; - GL11.glScalef(-f1, -f1, f1); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glTranslatef(0.0F, 0F / f1, 0.0F); - GL11.glDepthMask(false); - GL11.glEnable(GL11.GL_BLEND); + GlStateManager.scale(-f1, -f1, f1); + GlStateManager.disableLighting(); + GlStateManager.translate(0.0F, 0F / f1, 0.0F); + GlStateManager.depthMask(false); + GlStateManager.enableBlend(); OpenGlHelper.glBlendFunc(770, 771, 1, 0); - Tessellator tessellator = Tessellator.instance; - GL11.glDisable(GL11.GL_TEXTURE_2D); - tessellator.startDrawingQuads(); - int i = mc.fontRenderer.getStringWidth(potato.name) / 2; - tessellator.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F); - tessellator.addVertex(-i - 1, -1.0D, 0.0D); - tessellator.addVertex(-i - 1, 8.0D, 0.0D); - tessellator.addVertex(i + 1, 8.0D, 0.0D); - tessellator.addVertex(i + 1, -1.0D, 0.0D); + Tessellator tessellator = Tessellator.getInstance(); + VertexBuffer worldrenderer = tessellator.getBuffer(); + GlStateManager.disableTexture2D(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR); + int i = mc.fontRendererObj.getStringWidth(potato.name) / 2; + worldrenderer.pos(-i - 1, -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + worldrenderer.pos(-i - 1, 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + worldrenderer.pos(i + 1, 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + worldrenderer.pos(i + 1, -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); tessellator.draw(); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glDepthMask(true); - mc.fontRenderer.drawString(potato.name, -mc.fontRenderer.getStringWidth(potato.name) / 2, 0, 0xFFFFFF); - if(name.equals("pahimar") || name.equals("soaryn")) { - GL11.glTranslatef(0F, 14F, 0F); + GlStateManager.enableTexture2D(); + GlStateManager.depthMask(true); + mc.fontRendererObj.drawString(potato.name, -mc.fontRendererObj.getStringWidth(potato.name) / 2, 0, 0xFFFFFF); + if (name.equals("pahimar") || name.equals("soaryn")) { + GlStateManager.translate(0F, 14F, 0F); String s = name.equals("pahimar") ? "[WIP]" : "(soon)"; - GL11.glDepthMask(false); - GL11.glEnable(GL11.GL_BLEND); + GlStateManager.depthMask(false); + GlStateManager.enableBlend(); OpenGlHelper.glBlendFunc(770, 771, 1, 0); - GL11.glDisable(GL11.GL_TEXTURE_2D); - tessellator.startDrawingQuads(); - i = mc.fontRenderer.getStringWidth(s) / 2; - tessellator.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F); - tessellator.addVertex(-i - 1, -1.0D, 0.0D); - tessellator.addVertex(-i - 1, 8.0D, 0.0D); - tessellator.addVertex(i + 1, 8.0D, 0.0D); - tessellator.addVertex(i + 1, -1.0D, 0.0D); + GlStateManager.disableTexture2D(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR); + i = mc.fontRendererObj.getStringWidth(s) / 2; + worldrenderer.pos(-i - 1, -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + worldrenderer.pos(-i - 1, 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + worldrenderer.pos(i + 1, 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + worldrenderer.pos(i + 1, -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); tessellator.draw(); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glDepthMask(true); - mc.fontRenderer.drawString(s, -mc.fontRenderer.getStringWidth(s) / 2, 0, 0xFFFFFF); + GlStateManager.enableTexture2D(); + GlStateManager.depthMask(true); + mc.fontRendererObj.drawString(s, -mc.fontRendererObj.getStringWidth(s) / 2, 0, 0xFFFFFF); } - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_BLEND); - GL11.glColor4f(1F, 1F, 1F, 1F); - GL11.glScalef(1F / -f1, 1F / -f1, 1F / f1); - GL11.glPopMatrix(); + GlStateManager.enableLighting(); + GlStateManager.disableBlend(); + GlStateManager.color(1F, 1F, 1F, 1F); + GlStateManager.scale(1F / -f1, 1F / -f1, 1F / f1); + GlStateManager.popMatrix(); } - GL11.glPopMatrix(); + GlStateManager.popMatrix(); } - public void renderIcon(IIcon icon) { + private void renderIcon(TextureAtlasSprite icon) { float f = icon.getMinU(); float f1 = icon.getMaxU(); float f2 = icon.getMinV(); float f3 = icon.getMaxV(); - ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F); + IconHelper.renderIconIn3D(Tessellator.getInstance(), f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F); } -} \ No newline at end of file + + private void renderItem(ItemStack stack) { + Minecraft.getMinecraft().getRenderItem().renderItem(stack, ItemCameraTransforms.TransformType.HEAD); + } + + private void renderBlock(Block block) { + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + Minecraft.getMinecraft().getBlockRendererDispatcher().renderBlockBrightness(block.getDefaultState(), 1.0F); + } +} diff --git a/src/main/java/vazkii/botania/client/render/world/SkyblockRenderEvents.java b/src/main/java/vazkii/botania/client/render/world/SkyblockRenderEvents.java index 007b637fb..983fe27cb 100644 --- a/src/main/java/vazkii/botania/client/render/world/SkyblockRenderEvents.java +++ b/src/main/java/vazkii/botania/client/render/world/SkyblockRenderEvents.java @@ -13,16 +13,16 @@ package vazkii.botania.client.render.world; import net.minecraft.client.Minecraft; import net.minecraft.world.World; import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.world.WorldTypeSkyblock; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; public final class SkyblockRenderEvents { @SubscribeEvent - public void onRender(RenderWorldLastEvent event) { + public static void onRender(RenderWorldLastEvent event) { World world = Minecraft.getMinecraft().theWorld; - if(ConfigHandler.enableFancySkybox && world.provider.dimensionId == 0 && (ConfigHandler.enableFancySkyboxInNormalWorlds || WorldTypeSkyblock.isWorldSkyblock(Minecraft.getMinecraft().theWorld))) { + if(ConfigHandler.enableFancySkybox && world.provider.getDimension() == 0 && (ConfigHandler.enableFancySkyboxInNormalWorlds || WorldTypeSkyblock.isWorldSkyblock(Minecraft.getMinecraft().theWorld))) { if(!(world.provider.getSkyRenderer() instanceof SkyblockSkyRenderer)) world.provider.setSkyRenderer(new SkyblockSkyRenderer()); } diff --git a/src/main/java/vazkii/botania/client/render/world/SkyblockSkyRenderer.java b/src/main/java/vazkii/botania/client/render/world/SkyblockSkyRenderer.java index 39cc7a216..d90e4fef8 100644 --- a/src/main/java/vazkii/botania/client/render/world/SkyblockSkyRenderer.java +++ b/src/main/java/vazkii/botania/client/render/world/SkyblockSkyRenderer.java @@ -10,32 +10,34 @@ */ package vazkii.botania.client.render.world; -import java.util.Random; - import net.minecraft.client.Minecraft; import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.RenderGlobal; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.util.MathHelper; +import net.minecraft.client.renderer.VertexBuffer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.Vec3; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.Vec3d; import net.minecraftforge.client.IRenderHandler; - +import net.minecraftforge.fml.relauncher.ReflectionHelper; import org.lwjgl.opengl.GL11; - +import vazkii.botania.client.core.handler.ClientMethodHandles; import vazkii.botania.client.core.handler.ClientTickHandler; import vazkii.botania.client.lib.LibResources; import vazkii.botania.common.lib.LibObfuscation; -import cpw.mods.fml.relauncher.ReflectionHelper; + +import java.util.Random; public class SkyblockSkyRenderer extends IRenderHandler { private static final ResourceLocation textureSkybox = new ResourceLocation(LibResources.MISC_SKYBOX); private static final ResourceLocation textureRainbow = new ResourceLocation(LibResources.MISC_RAINBOW); - private static final ResourceLocation textureMoonPhases = new ResourceLocation("textures/environment/moon_phases.png"); - private static final ResourceLocation textureSun = new ResourceLocation("textures/environment/sun.png"); + private static final ResourceLocation MOON_PHASES_TEXTURES = new ResourceLocation("textures/environment/moon_phases.png"); + private static final ResourceLocation SUN_TEXTURES = new ResourceLocation("textures/environment/sun.png"); private static final ResourceLocation[] planetTextures = new ResourceLocation[] { new ResourceLocation(LibResources.MISC_PLANET + "0.png"), new ResourceLocation(LibResources.MISC_PLANET + "1.png"), @@ -45,141 +47,179 @@ public class SkyblockSkyRenderer extends IRenderHandler { new ResourceLocation(LibResources.MISC_PLANET + "5.png") }; + // Copy of overworld section of RenderGlobal.renderSky(), heavily modified @Override public void render(float partialTicks, WorldClient world, Minecraft mc) { - boolean test = false; - if(test) - return; + // Environment setup + int glSkyList; + net.minecraft.client.renderer.vertex.VertexBuffer skyVBO; - int glSkyList = ReflectionHelper.getPrivateValue(RenderGlobal.class, mc.renderGlobal, LibObfuscation.GL_SKY_LIST); - int glSkyList2 = ReflectionHelper.getPrivateValue(RenderGlobal.class, mc.renderGlobal, LibObfuscation.GL_SKY_LIST2); // Horizon line. We don't have it here - int starGLCallList = ReflectionHelper.getPrivateValue(RenderGlobal.class, mc.renderGlobal, LibObfuscation.STAR_GL_CALL_LIST); - - GL11.glDisable(GL11.GL_TEXTURE_2D); - Vec3 vec3 = world.getSkyColor(mc.renderViewEntity, partialTicks); - float f1 = (float)vec3.xCoord; - float f2 = (float)vec3.yCoord; - float f3 = (float)vec3.zCoord; - float f6; + try { + glSkyList = (int) ClientMethodHandles.glSkyList_getter.invokeExact(mc.renderGlobal); + skyVBO = (net.minecraft.client.renderer.vertex.VertexBuffer) ClientMethodHandles.skyVBO_getter.invokeExact(mc.renderGlobal); + } catch (Throwable t) { return; } + // Begin + GlStateManager.disableTexture2D(); + Vec3d vec3d = world.getSkyColor(mc.getRenderViewEntity(), partialTicks); + float f = (float)vec3d.xCoord; + float f1 = (float)vec3d.yCoord; + float f2 = (float)vec3d.zCoord; + + // Botania - darken when in void float insideVoid = 0; if(mc.thePlayer.posY <= -2) insideVoid = (float) Math.min(1F, -(mc.thePlayer.posY + 2) / 30F); - + + f = Math.max(0F, f - insideVoid); f1 = Math.max(0F, f1 - insideVoid); f2 = Math.max(0F, f2 - insideVoid); - f3 = Math.max(0F, f3 - insideVoid); - Tessellator tessellator1 = Tessellator.instance; - GL11.glDepthMask(false); - GL11.glEnable(GL11.GL_FOG); - GL11.glColor3f(f1, f2, f3); - GL11.glCallList(glSkyList); - GL11.glDisable(GL11.GL_FOG); - GL11.glDisable(GL11.GL_ALPHA_TEST); - GL11.glEnable(GL11.GL_BLEND); - OpenGlHelper.glBlendFunc(770, 771, 1, 0); - RenderHelper.disableStandardItemLighting(); - float[] afloat = world.provider.calcSunriseSunsetColors(world.getCelestialAngle(partialTicks), partialTicks); - float f7; - float f8; - float f9; - float f10; + /*if (pass != 2) Botania - no anaglyph stuff + { + float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F; + float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F; + float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F; + f = f3; + f1 = f4; + f2 = f5; + }*/ - // === Sunset - if(afloat != null) { - GL11.glDisable(GL11.GL_TEXTURE_2D); - GL11.glShadeModel(GL11.GL_SMOOTH); - GL11.glPushMatrix(); - GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(MathHelper.sin(world.getCelestialAngleRadians(partialTicks)) < 0.0F ? 180.0F : 0.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F); - f6 = afloat[0]; - f7 = afloat[1]; - f8 = afloat[2]; - float f11; + GlStateManager.color(f, f1, f2); + Tessellator tessellator = Tessellator.getInstance(); + VertexBuffer vertexbuffer = tessellator.getBuffer(); + GlStateManager.depthMask(false); + GlStateManager.enableFog(); + GlStateManager.color(f, f1, f2); - tessellator1.startDrawing(6); - tessellator1.setColorRGBA_F(f6, f7, f8, afloat[3] * (1F - insideVoid)); - tessellator1.addVertex(0.0D, 100.0D, 0.0D); - byte b0 = 16; - tessellator1.setColorRGBA_F(afloat[0], afloat[1], afloat[2], 0.0F); - - for(int j = 0; j <= b0; ++j) { - f11 = (float)j * (float)Math.PI * 2.0F / (float)b0; - float f12 = MathHelper.sin(f11); - float f13 = MathHelper.cos(f11); - tessellator1.addVertex((double)(f12 * 120.0F), (double)(f13 * 120.0F), (double)(-f13 * 40.0F * afloat[3])); - } - - tessellator1.draw(); - GL11.glPopMatrix(); - GL11.glShadeModel(GL11.GL_FLAT); + if (OpenGlHelper.useVbo()) + { + skyVBO.bindBuffer(); + GlStateManager.glEnableClientState(32884); + GlStateManager.glVertexPointer(3, 5126, 12, 0); + skyVBO.drawArrays(7); + skyVBO.unbindBuffer(); + GlStateManager.glDisableClientState(32884); + } + else + { + GlStateManager.callList(glSkyList); } - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glPushMatrix(); - f6 = Math.max(0.2F, 1.0F - world.getRainStrength(partialTicks)) * (1F - insideVoid); - f7 = 0.0F; - f8 = 0.0F; - f9 = 0.0F; + GlStateManager.disableFog(); + GlStateManager.disableAlpha(); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); + RenderHelper.disableStandardItemLighting(); + float[] afloat = world.provider.calcSunriseSunsetColors(world.getCelestialAngle(partialTicks), partialTicks); - GL11.glTranslatef(f7, f8, f9); - GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); + if (afloat != null) + { + GlStateManager.disableTexture2D(); + GlStateManager.shadeModel(7425); + GlStateManager.pushMatrix(); + GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(MathHelper.sin(world.getCelestialAngleRadians(partialTicks)) < 0.0F ? 180.0F : 0.0F, 0.0F, 0.0F, 1.0F); + GlStateManager.rotate(90.0F, 0.0F, 0.0F, 1.0F); + float f6 = afloat[0]; + float f7 = afloat[1]; + float f8 = afloat[2]; + /*if (pass != 2) Botania - no anaglyph stuff + { + float f9 = (f6 * 30.0F + f7 * 59.0F + f8 * 11.0F) / 100.0F; + float f10 = (f6 * 30.0F + f7 * 70.0F) / 100.0F; + float f11 = (f6 * 30.0F + f8 * 70.0F) / 100.0F; + f6 = f9; + f7 = f10; + f8 = f11; + }*/ + + vertexbuffer.begin(6, DefaultVertexFormats.POSITION_COLOR); + vertexbuffer.pos(0.0D, 100.0D, 0.0D).color(f6, f7, f8, afloat[3] * (1F - insideVoid)).endVertex(); // Botania - darken in void + int j = 16; + + for (int l = 0; l <= 16; ++l) + { + float f21 = (float)l * ((float)Math.PI * 2F) / 16.0F; + float f12 = MathHelper.sin(f21); + float f13 = MathHelper.cos(f21); + vertexbuffer.pos((double)(f12 * 120.0F), (double)(f13 * 120.0F), (double)(-f13 * 40.0F * afloat[3])).color(afloat[0], afloat[1], afloat[2], 0.0F).endVertex(); + } + + tessellator.draw(); + GlStateManager.popMatrix(); + GlStateManager.shadeModel(7424); + } + + GlStateManager.enableTexture2D(); + GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); + GlStateManager.pushMatrix(); + float f16 = 1.0F - world.getRainStrength(partialTicks); + GlStateManager.color(1.0F, 1.0F, 1.0F, f16); + GlStateManager.rotate(-90.0F, 0.0F, 1.0F, 0.0F); + + float f17; // Botania - move declaration up from below "extra stuff" + + // Botania - Begin extra stuff float celAng = world.getCelestialAngle(partialTicks); float effCelAng = celAng; if(celAng > 0.5) effCelAng = 0.5F - (celAng - 0.5F); // === Planets - f10 = 20F; - float lowA = Math.max(0F, effCelAng - 0.3F) * f6; + f17 = 20F; + float lowA = Math.max(0F, effCelAng - 0.3F) * f16; float a = Math.max(0.1F, lowA); - OpenGlHelper.glBlendFunc(770, 771, 1, 0); - GL11.glPushMatrix(); - GL11.glColor4f(1F, 1F, 1F, (a * 4) * (1F - insideVoid)); - GL11.glRotatef(90F, 0.5F, 0.5F, 0.0F); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GlStateManager.pushMatrix(); + GlStateManager.color(1F, 1F, 1F, (a * 4) * (1F - insideVoid)); + GlStateManager.rotate(90F, 0.5F, 0.5F, 0.0F); for(int p = 0; p < planetTextures.length; p++) { mc.renderEngine.bindTexture(planetTextures[p]); - drawObject(tessellator1, f10); + tessellator.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); + tessellator.getBuffer().pos(-f17, 100.0D, -f17).tex(0.0D, 0.0D).endVertex(); + tessellator.getBuffer().pos(f17, 100.0D, -f17).tex(1.0D, 0.0D).endVertex(); + tessellator.getBuffer().pos(f17, 100.0D, f17).tex(1.0D, 1.0D).endVertex(); + tessellator.getBuffer().pos(-f17, 100.0D, f17).tex(0.0D, 1.0D).endVertex(); + tessellator.draw(); switch(p) { - case 0: - GL11.glRotatef(70F, 1F, 0F, 0F); - f10 = 12F; - break; - case 1: - GL11.glRotatef(120F, 0F, 0F, 1F); - f10 = 15F; - break; - case 2: - GL11.glRotatef(80F, 1F, 0F, 1F); - f10 = 25F; - break; - case 3: - GL11.glRotatef(100F, 0F, 0F, 1F); - f10 = 10F; - break; - case 4: - GL11.glRotatef(-60F, 1F, 0F, 0.5F); - f10 = 40F; + case 0: + GlStateManager.rotate(70F, 1F, 0F, 0F); + f17 = 12F; + break; + case 1: + GlStateManager.rotate(120F, 0F, 0F, 1F); + f17 = 15F; + break; + case 2: + GlStateManager.rotate(80F, 1F, 0F, 1F); + f17 = 25F; + break; + case 3: + GlStateManager.rotate(100F, 0F, 0F, 1F); + f17 = 10F; + break; + case 4: + GlStateManager.rotate(-60F, 1F, 0F, 0.5F); + f17 = 40F; } } - GL11.glColor4f(1F, 1F, 1F, 1F); - GL11.glPopMatrix(); + GlStateManager.color(1F, 1F, 1F, 1F); + GlStateManager.popMatrix(); // === Rays - mc.renderEngine.bindTexture(textureSkybox); + mc.renderEngine.bindTexture(textureSkybox); - f10 = 20F; + f17 = 20F; a = lowA; - GL11.glPushMatrix(); - OpenGlHelper.glBlendFunc(770, 1, 1, 0); - GL11.glTranslatef(0F, -1F, 0F); - GL11.glRotatef(220F, 1F, 0F, 0F); - GL11.glColor4f(1F, 1F, 1F, a); + GlStateManager.pushMatrix(); + GlStateManager.tryBlendFuncSeparate(770, 1, 1, 0); + GlStateManager.translate(0F, -1F, 0F); + GlStateManager.rotate(220F, 1F, 0F, 0F); + GlStateManager.color(1F, 1F, 1F, a); int angles = 90; float s = 3F; float m = 1F; @@ -193,53 +233,53 @@ public class SkyblockSkyRenderer extends IRenderHandler { for(int p = 0; p < 3; p++) { float baseAngle = rotSpeed * rotSpeedMod * (ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks); - GL11.glRotatef((ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks) * 0.25F * rotSpeed * rotSpeedMod, 0F, 1F, 0F); + GlStateManager.rotate((ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks) * 0.25F * rotSpeed * rotSpeedMod, 0F, 1F, 0F); - tessellator1.startDrawingQuads(); + tessellator.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); for(int i = 0; i < angles; i++) { int j = i; if(i % 2 == 0) j--; float ang = j * anglePer + baseAngle; - double xp = Math.cos(ang * Math.PI / 180F) * f10; - double zp = Math.sin(ang * Math.PI / 180F) * f10; + double xp = Math.cos(ang * Math.PI / 180F) * f17; + double zp = Math.sin(ang * Math.PI / 180F) * f17; double yo = Math.sin(fuzzPer * j) * 1; float ut = ang * uPer; if(i % 2 == 0) { - tessellator1.addVertexWithUV(xp, yo + y0 + y, zp, ut, 1F); - tessellator1.addVertexWithUV(xp, yo + y0, zp, ut, 0); + tessellator.getBuffer().pos(xp, yo + y0 + y, zp).tex(ut, 1F).endVertex(); + tessellator.getBuffer().pos(xp, yo + y0, zp).tex(ut, 0).endVertex(); } else { - tessellator1.addVertexWithUV(xp, yo + y0, zp, ut, 0); - tessellator1.addVertexWithUV(xp, yo + y0 + y, zp, ut, 1F); + tessellator.getBuffer().pos(xp, yo + y0, zp).tex(ut, 0).endVertex(); + tessellator.getBuffer().pos(xp, yo + y0 + y, zp).tex(ut, 1F).endVertex(); } } - tessellator1.draw(); + tessellator.draw(); switch(p) { - case 0: - GL11.glRotatef(20F, 1F, 0F, 0F); - GL11.glColor4f(1F, 0.4F, 0.4F, a); - fuzzPer = (Math.PI * 14) / angles; - rotSpeed = 0.2F; - break; - case 1: - GL11.glRotatef(50F, 1F, 0F, 0F); - GL11.glColor4f(0.4F, 1F, 0.7F, a); - fuzzPer = (Math.PI * 6) / angles; - rotSpeed = 2F; - break; + case 0: + GlStateManager.rotate(20F, 1F, 0F, 0F); + GlStateManager.color(1F, 0.4F, 0.4F, a); + fuzzPer = (Math.PI * 14) / angles; + rotSpeed = 0.2F; + break; + case 1: + GlStateManager.rotate(50F, 1F, 0F, 0F); + GlStateManager.color(0.4F, 1F, 0.7F, a); + fuzzPer = (Math.PI * 6) / angles; + rotSpeed = 2F; + break; } } - GL11.glPopMatrix(); + GlStateManager.popMatrix(); // === Rainbow - GL11.glPushMatrix(); - OpenGlHelper.glBlendFunc(770, 771, 1, 0); - mc.renderEngine.bindTexture(textureRainbow); - f10 = 10F; + GlStateManager.pushMatrix(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + mc.renderEngine.bindTexture(textureRainbow); + f17 = 10F; float effCelAng1 = celAng; if(effCelAng1 > 0.25F) effCelAng1 = 1F - effCelAng1; @@ -250,121 +290,229 @@ public class SkyblockSkyRenderer extends IRenderHandler { Random rand = new Random(day * 0xFF); float angle1 = rand.nextFloat() * 360F; float angle2 = rand.nextFloat() * 360F; - GL11.glColor4f(1F, 1F, 1F, effCelAng1 * (1F - insideVoid)); - GL11.glRotatef(angle1, 0F, 1F, 0F); - GL11.glRotatef(angle2, 0F, 0F, 1F); + GlStateManager.color(1F, 1F, 1F, effCelAng1 * (1F - insideVoid)); + GlStateManager.rotate(angle1, 0F, 1F, 0F); + GlStateManager.rotate(angle2, 0F, 0F, 1F); - tessellator1.startDrawingQuads(); + tessellator.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); for(int i = 0; i < angles; i++) { int j = i; if(i % 2 == 0) j--; float ang = j * anglePer; - double xp = Math.cos(ang * Math.PI / 180F) * f10; - double zp = Math.sin(ang * Math.PI / 180F) * f10; + double xp = Math.cos(ang * Math.PI / 180F) * f17; + double zp = Math.sin(ang * Math.PI / 180F) * f17; double yo = 0; float ut = ang * uPer; if(i % 2 == 0) { - tessellator1.addVertexWithUV(xp, yo + y0 + y, zp, ut, 1F); - tessellator1.addVertexWithUV(xp, yo + y0, zp, ut, 0); + tessellator.getBuffer().pos(xp, yo + y0 + y, zp).tex(ut, 1F).endVertex(); + tessellator.getBuffer().pos(xp, yo + y0, zp).tex(ut, 0).endVertex(); } else { - tessellator1.addVertexWithUV(xp, yo + y0, zp, ut, 0); - tessellator1.addVertexWithUV(xp, yo + y0 + y, zp, ut, 1F); + tessellator.getBuffer().pos(xp, yo + y0, zp).tex(ut, 0).endVertex(); + tessellator.getBuffer().pos(xp, yo + y0 + y, zp).tex(ut, 1F).endVertex(); } } - tessellator1.draw(); - GL11.glPopMatrix(); + tessellator.draw(); + GlStateManager.popMatrix(); + GlStateManager.color(1F, 1F, 1F, 1F - insideVoid); + GlStateManager.tryBlendFuncSeparate(770, 1, 1, 0); + // Botania - End extra stuff + + + GlStateManager.rotate(world.getCelestialAngle(partialTicks) * 360.0F, 1.0F, 0.0F, 0.0F); + /*float*/ f17 = 60.0F; // Botania - 30 -> 60 and move declaration above "extra stuff" + mc.renderEngine.bindTexture(SUN_TEXTURES); + vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX); + vertexbuffer.pos((double)(-f17), 100.0D, (double)(-f17)).tex(0.0D, 0.0D).endVertex(); + vertexbuffer.pos((double)f17, 100.0D, (double)(-f17)).tex(1.0D, 0.0D).endVertex(); + vertexbuffer.pos((double)f17, 100.0D, (double)f17).tex(1.0D, 1.0D).endVertex(); + vertexbuffer.pos((double)(-f17), 100.0D, (double)f17).tex(0.0D, 1.0D).endVertex(); + tessellator.draw(); + f17 = 60.0F; // Botania - 20 -> 60 + mc.renderEngine.bindTexture(MOON_PHASES_TEXTURES); + int i = world.getMoonPhase(); + int k = i % 4; + int i1 = i / 4 % 2; + float f22 = (float)(k + 0) / 4.0F; + float f23 = (float)(i1 + 0) / 2.0F; + float f24 = (float)(k + 1) / 4.0F; + float f14 = (float)(i1 + 1) / 2.0F; + vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX); + vertexbuffer.pos((double)(-f17), -100.0D, (double)f17).tex((double)f24, (double)f14).endVertex(); + vertexbuffer.pos((double)f17, -100.0D, (double)f17).tex((double)f22, (double)f14).endVertex(); + vertexbuffer.pos((double)f17, -100.0D, (double)(-f17)).tex((double)f22, (double)f23).endVertex(); + vertexbuffer.pos((double)(-f17), -100.0D, (double)(-f17)).tex((double)f24, (double)f23).endVertex(); + tessellator.draw(); + GlStateManager.disableTexture2D(); + // Botania - Custom star rendering + { + f16 *= Math.max(0.1F, effCelAng * 2); + renderStars(mc, f16, partialTicks); + } + /*float f15 = this.theWorld.getStarBrightness(partialTicks) * f16; - GL11.glColor4f(1F, 1F, 1F, 1F - insideVoid); + if (f15 > 0.0F) + { + GlStateManager.color(f15, f15, f15, f15); - OpenGlHelper.glBlendFunc(770, 1, 1, 0); + if (this.vboEnabled) + { + this.starVBO.bindBuffer(); + GlStateManager.glEnableClientState(32884); + GlStateManager.glVertexPointer(3, 5126, 12, 0); + this.starVBO.drawArrays(7); + this.starVBO.unbindBuffer(); + GlStateManager.glDisableClientState(32884); + } + else + { + GlStateManager.callList(this.starGLCallList); + } + }*/ + + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.disableBlend(); + GlStateManager.enableAlpha(); + GlStateManager.enableFog(); + GlStateManager.popMatrix(); + // Botania - no horizon rendering + /* GlStateManager.disableTexture2D(); + GlStateManager.color(0.0F, 0.0F, 0.0F); + double d0 = this.mc.thePlayer.getPositionEyes(partialTicks).yCoord - this.theWorld.getHorizon(); - // === Sun - GL11.glRotatef(world.getCelestialAngle(partialTicks) * 360.0F, 1.0F, 0.0F, 0.0F); - f10 = 60.0F; - mc.renderEngine.bindTexture(textureSun); - drawObject(tessellator1, f10); + if (d0 < 0.0D) + { + GlStateManager.pushMatrix(); + GlStateManager.translate(0.0F, 12.0F, 0.0F); - // === Moon - f10 = 60.0F; - mc.renderEngine.bindTexture(textureMoonPhases); - int k = world.getMoonPhase(); - int l = k % 4; - int i1 = k / 4 % 2; - float f14 = (float)(l + 0) / 4.0F; - float f15 = (float)(i1 + 0) / 2.0F; - float f16 = (float)(l + 1) / 4.0F; - float f17 = (float)(i1 + 1) / 2.0F; - tessellator1.startDrawingQuads(); - tessellator1.addVertexWithUV((double)(-f10), -100.0D, (double)f10, (double)f16, (double)f17); - tessellator1.addVertexWithUV((double)f10, -100.0D, (double)f10, (double)f14, (double)f17); - tessellator1.addVertexWithUV((double)f10, -100.0D, (double)(-f10), (double)f14, (double)f15); - tessellator1.addVertexWithUV((double)(-f10), -100.0D, (double)(-f10), (double)f16, (double)f15); - tessellator1.draw(); + if (this.vboEnabled) + { + this.sky2VBO.bindBuffer(); + GlStateManager.glEnableClientState(32884); + GlStateManager.glVertexPointer(3, 5126, 12, 0); + this.sky2VBO.drawArrays(7); + this.sky2VBO.unbindBuffer(); + GlStateManager.glDisableClientState(32884); + } + else + { + GlStateManager.callList(this.glSkyList2); + } - // === Stars - f6 *= Math.max(0.1F, effCelAng * 2); - float t = (ClientTickHandler.ticksInGame + partialTicks + 2000) * 0.005F; - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_TEXTURE_2D); + GlStateManager.popMatrix(); + float f18 = 1.0F; + float f19 = -((float)(d0 + 65.0D)); + float f20 = -1.0F; + vertexbuffer.begin(7, DefaultVertexFormats.POSITION_COLOR); + vertexbuffer.pos(-1.0D, (double)f19, 1.0D).color(0, 0, 0, 255).endVertex(); + vertexbuffer.pos(1.0D, (double)f19, 1.0D).color(0, 0, 0, 255).endVertex(); + vertexbuffer.pos(1.0D, -1.0D, 1.0D).color(0, 0, 0, 255).endVertex(); + vertexbuffer.pos(-1.0D, -1.0D, 1.0D).color(0, 0, 0, 255).endVertex(); + vertexbuffer.pos(-1.0D, -1.0D, -1.0D).color(0, 0, 0, 255).endVertex(); + vertexbuffer.pos(1.0D, -1.0D, -1.0D).color(0, 0, 0, 255).endVertex(); + vertexbuffer.pos(1.0D, (double)f19, -1.0D).color(0, 0, 0, 255).endVertex(); + vertexbuffer.pos(-1.0D, (double)f19, -1.0D).color(0, 0, 0, 255).endVertex(); + vertexbuffer.pos(1.0D, -1.0D, -1.0D).color(0, 0, 0, 255).endVertex(); + vertexbuffer.pos(1.0D, -1.0D, 1.0D).color(0, 0, 0, 255).endVertex(); + vertexbuffer.pos(1.0D, (double)f19, 1.0D).color(0, 0, 0, 255).endVertex(); + vertexbuffer.pos(1.0D, (double)f19, -1.0D).color(0, 0, 0, 255).endVertex(); + vertexbuffer.pos(-1.0D, (double)f19, -1.0D).color(0, 0, 0, 255).endVertex(); + vertexbuffer.pos(-1.0D, (double)f19, 1.0D).color(0, 0, 0, 255).endVertex(); + vertexbuffer.pos(-1.0D, -1.0D, 1.0D).color(0, 0, 0, 255).endVertex(); + vertexbuffer.pos(-1.0D, -1.0D, -1.0D).color(0, 0, 0, 255).endVertex(); + vertexbuffer.pos(-1.0D, -1.0D, -1.0D).color(0, 0, 0, 255).endVertex(); + vertexbuffer.pos(-1.0D, -1.0D, 1.0D).color(0, 0, 0, 255).endVertex(); + vertexbuffer.pos(1.0D, -1.0D, 1.0D).color(0, 0, 0, 255).endVertex(); + vertexbuffer.pos(1.0D, -1.0D, -1.0D).color(0, 0, 0, 255).endVertex(); + tessellator.draw(); + } - GL11.glPushMatrix(); - GL11.glRotatef(t * 3, 0F, 1F, 0F); - GL11.glColor4f(1F, 1F, 1F, f6); - GL11.glCallList(starGLCallList); - GL11.glPopMatrix(); + if (this.theWorld.provider.isSkyColored()) + { + GlStateManager.color(f * 0.2F + 0.04F, f1 * 0.2F + 0.04F, f2 * 0.6F + 0.1F); + } + else + { + GlStateManager.color(f, f1, f2); + } - GL11.glPushMatrix(); - GL11.glRotatef(t, 0F, 1F, 0F); - GL11.glColor4f(0.5F, 1F, 1F, f6); - GL11.glCallList(starGLCallList); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glRotatef(t * 2, 0F, 1F, 0F); - GL11.glColor4f(1F, 0.75F, 0.75F, f6); - GL11.glCallList(starGLCallList); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glRotatef(t * 3, 0F, 0F, 1F); - GL11.glColor4f(1F, 1F, 1F, 0.25F * f6); - GL11.glCallList(starGLCallList); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glRotatef(t, 0F, 0F, 1F); - GL11.glColor4f(0.5F, 1F, 1F, 0.25F * f6); - GL11.glCallList(starGLCallList); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glRotatef(t * 2, 0F, 0F, 1F); - GL11.glColor4f(1F, 0.75F, 0.75F, 0.25F * f6); - GL11.glCallList(starGLCallList); - GL11.glPopMatrix(); - - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glPopMatrix(); - - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_BLEND); - GL11.glEnable(GL11.GL_ALPHA_TEST); - GL11.glEnable(GL11.GL_FOG); - GL11.glPopMatrix(); - GL11.glDepthMask(true); + GlStateManager.pushMatrix(); + GlStateManager.translate(0.0F, -((float)(d0 - 16.0D)), 0.0F); + GlStateManager.callList(this.glSkyList2); + GlStateManager.popMatrix();*/ + GlStateManager.enableTexture2D(); + GlStateManager.depthMask(true); } + + private void renderStars(Minecraft mc, float alpha, float partialTicks) { + int starGLCallList; + net.minecraft.client.renderer.vertex.VertexBuffer starVBO; - private void drawObject(Tessellator tess, float f10) { - tess.startDrawingQuads(); - tess.addVertexWithUV((double)(-f10), 100.0D, (double)(-f10), 0.0D, 0.0D); - tess.addVertexWithUV((double)f10, 100.0D, (double)(-f10), 1.0D, 0.0D); - tess.addVertexWithUV((double)f10, 100.0D, (double)f10, 1.0D, 1.0D); - tess.addVertexWithUV((double)(-f10), 100.0D, (double)f10, 0.0D, 1.0D); - tess.draw(); + try { + starGLCallList = (int) ClientMethodHandles.starGLCallList_getter.invokeExact(mc.renderGlobal); + starVBO = (net.minecraft.client.renderer.vertex.VertexBuffer) ClientMethodHandles.starVBO_getter.invokeExact(mc.renderGlobal); + } catch (Throwable t) { return; } + + float t = (ClientTickHandler.ticksInGame + partialTicks + 2000) * 0.005F; + GlStateManager.pushMatrix(); + + GlStateManager.pushMatrix(); + GlStateManager.rotate(t * 3, 0F, 1F, 0F); + GlStateManager.color(1F, 1F, 1F, alpha); + drawVboOrList(starVBO, starGLCallList); + GlStateManager.popMatrix(); + + GlStateManager.pushMatrix(); + GlStateManager.rotate(t, 0F, 1F, 0F); + GlStateManager.color(0.5F, 1F, 1F, alpha); + drawVboOrList(starVBO, starGLCallList); + GlStateManager.popMatrix(); + + GlStateManager.pushMatrix(); + GlStateManager.rotate(t * 2, 0F, 1F, 0F); + GlStateManager.color(1F, 0.75F, 0.75F, alpha); + drawVboOrList(starVBO, starGLCallList); + GlStateManager.popMatrix(); + + GlStateManager.pushMatrix(); + GlStateManager.rotate(t * 3, 0F, 0F, 1F); + GlStateManager.color(1F, 1F, 1F, 0.25F * alpha); + drawVboOrList(starVBO, starGLCallList); + GlStateManager.popMatrix(); + + GlStateManager.pushMatrix(); + GlStateManager.rotate(t, 0F, 0F, 1F); + GlStateManager.color(0.5F, 1F, 1F, 0.25F * alpha); + drawVboOrList(starVBO, starGLCallList); + GlStateManager.popMatrix(); + + GlStateManager.pushMatrix(); + GlStateManager.rotate(t * 2, 0F, 0F, 1F); + GlStateManager.color(1F, 0.75F, 0.75F, 0.25F * alpha); + drawVboOrList(starVBO, starGLCallList); + GlStateManager.popMatrix(); + + GlStateManager.popMatrix(); + } + + // Excised from many occurences in RenderGlobal + private void drawVboOrList(net.minecraft.client.renderer.vertex.VertexBuffer vbo, int displayList) { + if (OpenGlHelper.useVbo()) + { + vbo.bindBuffer(); + GlStateManager.glEnableClientState(GL11.GL_VERTEX_ARRAY); + GlStateManager.glVertexPointer(3, GL11.GL_FLOAT, 12, 0); + vbo.drawArrays(GL11.GL_QUADS); + vbo.unbindBuffer(); + GlStateManager.glDisableClientState(GL11.GL_VERTEX_ARRAY); + } + else + { + GlStateManager.callList(displayList); + } } } diff --git a/src/main/java/vazkii/botania/common/Botania.java b/src/main/java/vazkii/botania/common/Botania.java index 8d43e9d71..f5051bca4 100644 --- a/src/main/java/vazkii/botania/common/Botania.java +++ b/src/main/java/vazkii/botania/common/Botania.java @@ -10,26 +10,87 @@ */ package vazkii.botania.common; +import net.minecraft.entity.Entity; +import net.minecraft.entity.boss.EntityDragon; +import net.minecraft.entity.boss.EntityDragonPart; +import net.minecraft.entity.boss.EntityWither; +import net.minecraft.entity.item.EntityEnderCrystal; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.entity.item.EntityPainting; +import net.minecraft.util.text.translation.I18n; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.common.FMLCommonHandler; +import net.minecraftforge.fml.common.Loader; +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.fml.common.Mod.EventHandler; +import net.minecraftforge.fml.common.Mod.Instance; +import net.minecraftforge.fml.common.ModAPIManager; +import net.minecraftforge.fml.common.SidedProxy; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLInterModComms; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; +import net.minecraftforge.fml.common.event.FMLServerAboutToStartEvent; +import net.minecraftforge.fml.common.event.FMLServerStartingEvent; +import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; +import net.minecraftforge.fml.common.network.NetworkRegistry; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import vazkii.botania.api.BotaniaAPI; +import vazkii.botania.api.lexicon.ITwoNamedPage; +import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.api.lexicon.LexiconPage; +import vazkii.botania.common.achievement.ModAchievements; +import vazkii.botania.common.block.ModBanners; +import vazkii.botania.common.block.ModBlocks; +import vazkii.botania.common.block.ModMultiblocks; +import vazkii.botania.common.block.subtile.generating.SubTileNarslimmus; +import vazkii.botania.common.block.tile.TileLightRelay; +import vazkii.botania.common.block.tile.corporea.TileCorporeaIndex; +import vazkii.botania.common.brew.ModBrews; +import vazkii.botania.common.brew.ModPotions; +import vazkii.botania.common.core.command.CommandOpen; +import vazkii.botania.common.core.command.CommandShare; +import vazkii.botania.common.core.command.CommandSkyblockSpread; +import vazkii.botania.common.core.handler.BiomeDecorationHandler; +import vazkii.botania.common.core.handler.CommonTickHandler; +import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.core.handler.IMCHandler; +import vazkii.botania.common.core.handler.InternalMethodHandler; import vazkii.botania.common.core.handler.ManaNetworkHandler; -import vazkii.botania.common.core.proxy.CommonProxy; -import vazkii.botania.common.integration.coloredlights.ILightHelper; -import vazkii.botania.common.integration.coloredlights.LightHelperColored; -import vazkii.botania.common.integration.coloredlights.LightHelperVanilla; +import vazkii.botania.common.core.handler.ModSounds; +import vazkii.botania.common.core.handler.PixieHandler; +import vazkii.botania.common.core.handler.SheddingHandler; +import vazkii.botania.common.core.loot.LootHandler; +import vazkii.botania.common.core.proxy.IProxy; +import vazkii.botania.common.crafting.ModBrewRecipes; +import vazkii.botania.common.crafting.ModCraftingRecipes; +import vazkii.botania.common.crafting.ModElvenTradeRecipes; +import vazkii.botania.common.crafting.ModManaAlchemyRecipes; +import vazkii.botania.common.crafting.ModManaConjurationRecipes; +import vazkii.botania.common.crafting.ModManaInfusionRecipes; +import vazkii.botania.common.crafting.ModMigrationRecipes; +import vazkii.botania.common.crafting.ModPetalRecipes; +import vazkii.botania.common.crafting.ModPureDaisyRecipes; +import vazkii.botania.common.crafting.ModRuneRecipes; +import vazkii.botania.common.entity.EntityCorporeaSpark; +import vazkii.botania.common.entity.EntityDoppleganger; +import vazkii.botania.common.entity.EntityFlameRing; +import vazkii.botania.common.entity.EntityMagicLandmine; +import vazkii.botania.common.entity.EntityMagicMissile; +import vazkii.botania.common.entity.EntityManaBurst; +import vazkii.botania.common.entity.EntityPinkWither; +import vazkii.botania.common.entity.EntitySignalFlare; +import vazkii.botania.common.entity.EntitySpark; +import vazkii.botania.common.entity.ModEntities; +import vazkii.botania.common.integration.buildcraft.StatementAPIPlugin; +import vazkii.botania.common.item.ModItems; +import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibMisc; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.Mod.Instance; -import cpw.mods.fml.common.ModAPIManager; -import cpw.mods.fml.common.SidedProxy; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLInterModComms; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerAboutToStartEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; -import cpw.mods.fml.common.event.FMLServerStoppingEvent; +import vazkii.botania.common.network.GuiHandler; +import vazkii.botania.common.network.PacketHandler; +import vazkii.botania.common.world.SkyblockWorldEvents; +import vazkii.botania.common.world.WorldTypeSkyblock; @Mod(modid = LibMisc.MOD_ID, name = LibMisc.MOD_NAME, version = LibMisc.VERSION, dependencies = LibMisc.DEPENDENCIES, guiFactory = LibMisc.GUI_FACTORY) public class Botania { @@ -41,15 +102,17 @@ public class Botania { public static boolean bloodMagicLoaded = false; public static boolean coloredLightsLoaded = false; public static boolean etFuturumLoaded = false; + public static boolean rfApiLoaded = false; public static boolean storageDrawersLoaded = false; - - public static ILightHelper lightHelper; + public static boolean quarkLoaded = false; @Instance(LibMisc.MOD_ID) public static Botania instance; - @SidedProxy(serverSide = LibMisc.PROXY_COMMON, clientSide = LibMisc.PROXY_CLIENT) - public static CommonProxy proxy; + @SidedProxy(serverSide = LibMisc.PROXY_SERVER, clientSide = LibMisc.PROXY_CLIENT) + public static IProxy proxy; + + public static final Logger LOGGER = LogManager.getLogger(LibMisc.MOD_ID); @EventHandler public void preInit(FMLPreInitializationEvent event) { @@ -57,33 +120,124 @@ public class Botania { thaumcraftLoaded = Loader.isModLoaded("Thaumcraft"); bcTriggersLoaded = ModAPIManager.INSTANCE.hasAPI("BuildCraftAPI|statements"); - bloodMagicLoaded = Loader.isModLoaded("AWWayofTime"); // Psh, noob + bloodMagicLoaded = Loader.isModLoaded("BloodMagic"); // Psh, noob coloredLightsLoaded = Loader.isModLoaded("easycoloredlights"); etFuturumLoaded = Loader.isModLoaded("etfuturum"); + rfApiLoaded = ModAPIManager.INSTANCE.hasAPI("CoFHAPI|energy"); + quarkLoaded = Loader.isModLoaded("Quark"); + storageDrawersLoaded = Loader.isModLoaded("StorageDrawers"); - - lightHelper = coloredLightsLoaded ? new LightHelperColored() : new LightHelperVanilla(); + + BotaniaAPI.internalHandler = new InternalMethodHandler(); + + ConfigHandler.loadConfig(event.getSuggestedConfigurationFile()); + + PacketHandler.init(); + ModSounds.init(); + ModBlocks.init(); + ModItems.init(); + ModEntities.init(); + ModPotions.init(); + ModBrews.init(); + + ModAchievements.init(); + ModMultiblocks.init(); + ModBanners.init(); + + if(Botania.gardenOfGlassLoaded) + new WorldTypeSkyblock(); proxy.preInit(event); } + @EventHandler public void init(FMLInitializationEvent event) { + ModCraftingRecipes.init(); + ModMigrationRecipes.init(); + ModPetalRecipes.init(); + ModPureDaisyRecipes.init(); + ModRuneRecipes.init(); + ModManaAlchemyRecipes.init(); + ModManaConjurationRecipes.init(); + ModManaInfusionRecipes.init(); + ModElvenTradeRecipes.init(); + ModBrewRecipes.init(); + LexiconData.init(); + + NetworkRegistry.INSTANCE.registerGuiHandler(Botania.instance, new GuiHandler()); + + MinecraftForge.TERRAIN_GEN_BUS.register(BiomeDecorationHandler.class); + MinecraftForge.EVENT_BUS.register(ManaNetworkHandler.instance); + MinecraftForge.EVENT_BUS.register(PixieHandler.class); + MinecraftForge.EVENT_BUS.register(SheddingHandler.class); + MinecraftForge.EVENT_BUS.register(SubTileNarslimmus.SpawnIntercepter.class); + MinecraftForge.EVENT_BUS.register(TileCorporeaIndex.getInputHandler()); + MinecraftForge.EVENT_BUS.register(new LootHandler()); + + if(Botania.gardenOfGlassLoaded) + MinecraftForge.EVENT_BUS.register(SkyblockWorldEvents.class); + + MinecraftForge.EVENT_BUS.register(CommonTickHandler.class); + + FMLInterModComms.sendMessage("ProjectE", "interdictionblacklist", EntityManaBurst.class.getCanonicalName()); + + if(Botania.bcTriggersLoaded) + new StatementAPIPlugin(); proxy.init(event); } @EventHandler public void postInit(FMLPostInitializationEvent event) { + if(Botania.thaumcraftLoaded) { + ModBrews.initTC(); + ModBrewRecipes.initTC(); + try { + @SuppressWarnings("unchecked") + Class clazz = (Class) Class.forName("thaumcraft.common.lib.aura.EntityAuraNode"); + BotaniaAPI.blacklistEntityFromGravityRod(clazz); + } catch (ClassNotFoundException ignored) {} + } + + ModBlocks.addDispenserBehaviours(); + ModBlocks.registerMultiparts(); + ConfigHandler.loadPostInit(); + LexiconData.postInit(); + + int words = 0; + for(LexiconEntry entry : BotaniaAPI.getAllEntries()) + for(LexiconPage page : entry.pages) { + words += countWords(page.getUnlocalizedName()); + if(page instanceof ITwoNamedPage) + words += countWords(((ITwoNamedPage) page).getSecondUnlocalizedName()); + } + Botania.LOGGER.info("The Lexica Botania has {} words.", words); + + registerDefaultEntityBlacklist(); proxy.postInit(event); } + // Overriding the internal method handler will break everything as it changes regularly. + // So just don't be a moron and don't override it. Thanks. @EventHandler public void serverStarting(FMLServerAboutToStartEvent event) { - proxy.serverAboutToStart(event); + String clname = BotaniaAPI.internalHandler.getClass().getName(); + String expect = "vazkii.botania.common.core.handler.InternalMethodHandler"; + if(!clname.equals(expect)) { + new IllegalAccessError("The Botania API internal method handler has been overriden. " + + "This will cause crashes and compatibility issues, and that's why it's marked as" + + " \"Do not Override\". Whoever had the brilliant idea of overriding it needs to go" + + " back to elementary school and learn to read. (Expected classname: " + expect + ", Actual classname: " + clname + ")").printStackTrace(); + FMLCommonHandler.instance().exitJava(1, true); + } } @EventHandler public void serverStarting(FMLServerStartingEvent event) { - proxy.serverStarting(event); + // todo 1.8 - we don't have a file server yet. event.registerServerCommand(new CommandDownloadLatest()); + event.registerServerCommand(new CommandShare()); + event.registerServerCommand(new CommandOpen()); + if(Botania.gardenOfGlassLoaded) + event.registerServerCommand(new CommandSkyblockSpread()); } @EventHandler @@ -96,8 +250,31 @@ public class Botania { IMCHandler.processMessages(event.getMessages()); } - /*@EventHandler - public void missingMappings(FMLMissingMappingsEvent event) { - AliasHandler.onMissingMappings(event); - }*/ + private int countWords(String s) { + String s1 = I18n.translateToLocal(s); + return s1.split("\\s+").length; + } + + private void registerDefaultEntityBlacklist() { + // Vanilla + BotaniaAPI.blacklistEntityFromGravityRod(EntityDragon.class); + BotaniaAPI.blacklistEntityFromGravityRod(EntityDragonPart.class); + BotaniaAPI.blacklistEntityFromGravityRod(EntityWither.class); + BotaniaAPI.blacklistEntityFromGravityRod(EntityItemFrame.class); + BotaniaAPI.blacklistEntityFromGravityRod(EntityEnderCrystal.class); + BotaniaAPI.blacklistEntityFromGravityRod(EntityPainting.class); + + // Botania + BotaniaAPI.blacklistEntityFromGravityRod(EntityCorporeaSpark.class); + BotaniaAPI.blacklistEntityFromGravityRod(EntityDoppleganger.class); + BotaniaAPI.blacklistEntityFromGravityRod(EntityFlameRing.class); + BotaniaAPI.blacklistEntityFromGravityRod(EntityMagicLandmine.class); + BotaniaAPI.blacklistEntityFromGravityRod(EntityMagicMissile.class); + BotaniaAPI.blacklistEntityFromGravityRod(EntityManaBurst.class); + BotaniaAPI.blacklistEntityFromGravityRod(EntityPinkWither.class); + BotaniaAPI.blacklistEntityFromGravityRod(EntitySignalFlare.class); + BotaniaAPI.blacklistEntityFromGravityRod(EntitySpark.class); + BotaniaAPI.blacklistEntityFromGravityRod(TileLightRelay.EntityPlayerMover.class); + } + } diff --git a/src/main/java/vazkii/botania/common/achievement/AchievementMod.java b/src/main/java/vazkii/botania/common/achievement/AchievementMod.java index 7da1fa5f2..22c740eec 100644 --- a/src/main/java/vazkii/botania/common/achievement/AchievementMod.java +++ b/src/main/java/vazkii/botania/common/achievement/AchievementMod.java @@ -10,18 +10,18 @@ */ package vazkii.botania.common.achievement; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.stats.Achievement; import vazkii.botania.api.item.IRelic; +import java.util.ArrayList; +import java.util.List; + public class AchievementMod extends Achievement { - public static List achievements = new ArrayList(); + public static final List achievements = new ArrayList<>(); public AchievementMod(String name, int x, int y, ItemStack icon, Achievement parent) { super("achievement.botania:" + name, "botania:" + name, x, y, icon, parent); diff --git a/src/main/java/vazkii/botania/common/achievement/AchievementTriggerer.java b/src/main/java/vazkii/botania/common/achievement/AchievementTriggerer.java index 0d67196f9..3605f7159 100644 --- a/src/main/java/vazkii/botania/common/achievement/AchievementTriggerer.java +++ b/src/main/java/vazkii/botania/common/achievement/AchievementTriggerer.java @@ -12,14 +12,16 @@ package vazkii.botania.common.achievement; import net.minecraft.item.ItemStack; import net.minecraft.stats.Achievement; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent.ItemPickupEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.PlayerEvent.ItemCraftedEvent; +import net.minecraftforge.fml.common.gameevent.PlayerEvent.ItemPickupEvent; public final class AchievementTriggerer { + private AchievementTriggerer() {} + @SubscribeEvent - public void onItemPickedUp(ItemPickupEvent event) { + public static void onItemPickedUp(ItemPickupEvent event) { ItemStack stack = event.pickedUp.getEntityItem(); if(stack != null && stack.getItem() instanceof IPickupAchievement) { Achievement achievement = ((IPickupAchievement) stack.getItem()).getAchievementOnPickup(stack, event.player, event.pickedUp); @@ -29,7 +31,7 @@ public final class AchievementTriggerer { } @SubscribeEvent - public void onItemCrafted(ItemCraftedEvent event) { + public static void onItemCrafted(ItemCraftedEvent event) { if(event.crafting != null && event.crafting.getItem() instanceof ICraftAchievement) { Achievement achievement = ((ICraftAchievement) event.crafting.getItem()).getAchievementOnCraft(event.crafting, event.player, event.craftMatrix); if(achievement != null) diff --git a/src/main/java/vazkii/botania/common/achievement/ModAchievements.java b/src/main/java/vazkii/botania/common/achievement/ModAchievements.java index 9db5d62dd..ff4a817a9 100644 --- a/src/main/java/vazkii/botania/common/achievement/ModAchievements.java +++ b/src/main/java/vazkii/botania/common/achievement/ModAchievements.java @@ -14,6 +14,7 @@ import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.stats.Achievement; import net.minecraftforge.common.AchievementPage; +import net.minecraftforge.common.MinecraftForge; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.item.ModItems; @@ -21,7 +22,6 @@ import vazkii.botania.common.item.block.ItemBlockSpecialFlower; import vazkii.botania.common.lib.LibAchievementNames; import vazkii.botania.common.lib.LibBlockNames; import vazkii.botania.common.lib.LibMisc; -import cpw.mods.fml.common.FMLCommonHandler; public final class ModAchievements { @@ -30,7 +30,7 @@ public final class ModAchievements { public static Achievement flowerPickup; public static Achievement lexiconUse; - public static Achievement daybloomPickup; + public static Achievement daybloomPickup; // TODO change this to something else public static Achievement cacophoniumCraft; public static Achievement manaPoolPickup; @@ -91,7 +91,7 @@ public final class ModAchievements { public static void init() { flowerPickup = new AchievementMod(LibAchievementNames.FLOWER_PICKUP, 0, 4, new ItemStack(ModBlocks.flower, 1, 6), null); lexiconUse = new AchievementMod(LibAchievementNames.LEXICON_USE, 1, 5, ModItems.lexicon, flowerPickup); - daybloomPickup = new AchievementMod(LibAchievementNames.DAYBLOOM_PICKUP, 3, 5, ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_DAYBLOOM), lexiconUse); + daybloomPickup = new AchievementMod(LibAchievementNames.DAYBLOOM_PICKUP, 3, 5, ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_HYDROANGEAS), lexiconUse); // TODO this too cacophoniumCraft = new AchievementMod(LibAchievementNames.CACOPHONIUM_CRAFT, -1, 2, ModItems.cacophonium, flowerPickup); manaPoolPickup = new AchievementMod(LibAchievementNames.MANA_POOL_PICKUP, 3, 2, ModBlocks.pool, daybloomPickup); @@ -132,7 +132,7 @@ public final class ModAchievements { signalFlareStun = new AchievementMod(LibAchievementNames.SIGNAL_FLARE_STUN, -3, 1, ModItems.signalFlare, null).setSpecial(); l20ShardUse = new AchievementMod(LibAchievementNames.L20_SHARD_USE, -5, 3, ModItems.laputaShard, null).setSpecial(); - gaiaGuardianNoArmor = new AchievementMod(LibAchievementNames.GAIA_GUARDIAN_NO_ARMOR, -5, 1, new ItemStack(Items.skull, 1, 3), null).setSpecial(); + gaiaGuardianNoArmor = new AchievementMod(LibAchievementNames.GAIA_GUARDIAN_NO_ARMOR, -5, 1, new ItemStack(Items.SKULL, 1, 3), null).setSpecial(); rankSSPick = new AchievementMod(LibAchievementNames.RANK_SS_PICK, -3, 3, ModItems.terraPick, null).setSpecial(); superCorporeaRequest = new AchievementMod(LibAchievementNames.SUPER_CORPOREA_REQUEST, -3, -1, ModBlocks.corporeaIndex, null).setSpecial(); pinkinator = new AchievementMod(LibAchievementNames.PINKINATOR, -5, -1, ModItems.pinkinator, null).setSpecial(); @@ -157,7 +157,7 @@ public final class ModAchievements { botaniaPage = new AchievementPage(LibMisc.MOD_NAME, AchievementMod.achievements.toArray(new Achievement[AchievementMod.achievements.size()])); AchievementPage.registerAchievementPage(botaniaPage); - FMLCommonHandler.instance().bus().register(new AchievementTriggerer()); + MinecraftForge.EVENT_BUS.register(AchievementTriggerer.class); } } diff --git a/src/main/java/vazkii/botania/common/block/BlockAlfPortal.java b/src/main/java/vazkii/botania/common/block/BlockAlfPortal.java index 2e8245885..32240b26a 100644 --- a/src/main/java/vazkii/botania/common/block/BlockAlfPortal.java +++ b/src/main/java/vazkii/botania/common/block/BlockAlfPortal.java @@ -10,68 +10,91 @@ */ package vazkii.botania.common.block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.AlfPortalState; import vazkii.botania.api.wand.IWandable; -import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.common.achievement.ModAchievements; import vazkii.botania.common.block.tile.TileAlfPortal; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -public class BlockAlfPortal extends BlockModContainer implements IWandable, ILexiconable { +import javax.annotation.Nonnull; - IIcon iconOff, iconOn; - public static IIcon portalTex; +public class BlockAlfPortal extends BlockMod implements IWandable, ILexiconable { public BlockAlfPortal() { - super(Material.wood); + super(Material.WOOD, LibBlockNames.ALF_PORTAL); setHardness(10F); - setStepSound(soundTypeWood); - setBlockName(LibBlockNames.ALF_PORTAL); + setSoundType(SoundType.WOOD); + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.ALFPORTAL_STATE); + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + if (meta > AlfPortalState.values().length) { + meta = 0; + } + return getDefaultState().withProperty(BotaniaStateProps.ALFPORTAL_STATE, AlfPortalState.values()[meta]); } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - iconOff = IconHelper.forBlock(par1IconRegister, this, 0); - iconOn = IconHelper.forBlock(par1IconRegister, this, 1); - portalTex = IconHelper.forBlock(par1IconRegister, this, "Inside"); + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.ALFPORTAL_STATE).ordinal(); } @Override - public IIcon getIcon(int side, int meta) { - return meta == 0 ? iconOff : iconOn; + public IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.ALFPORTAL_STATE, AlfPortalState.OFF); } @Override - public TileEntity createNewTileEntity(World world, int meta) { + public boolean hasTileEntity(IBlockState state) { + return true; + } + + @Nonnull + @Override + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileAlfPortal(); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.alfhomancyIntro; } @Override - public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int side) { - boolean did = ((TileAlfPortal) world.getTileEntity(x, y, z)).onWanded(); + public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, BlockPos pos, EnumFacing side) { + boolean did = ((TileAlfPortal) world.getTileEntity(pos)).onWanded(); if(did && player != null) player.addStat(ModAchievements.elfPortalOpen, 1); return did; } @Override - public int getLightValue(IBlockAccess world, int x, int y, int z) { - return world.getBlockMetadata(x, y, z) == 0 ? 0 : 15; + public int getLightValue(@Nonnull IBlockState state, IBlockAccess world, @Nonnull BlockPos pos) { + if(world.getBlockState(pos).getBlock() != this) + return world.getBlockState(pos).getLightValue(world, pos); + return state.getValue(BotaniaStateProps.ALFPORTAL_STATE) != AlfPortalState.OFF ? 15 : 0; } } diff --git a/src/main/java/vazkii/botania/common/block/BlockAltGrass.java b/src/main/java/vazkii/botania/common/block/BlockAltGrass.java index 1f7a5c3da..1a491ecef 100644 --- a/src/main/java/vazkii/botania/common/block/BlockAltGrass.java +++ b/src/main/java/vazkii/botania/common/block/BlockAltGrass.java @@ -10,143 +10,160 @@ */ package vazkii.botania.common.block; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; +import net.minecraft.block.BlockDirt; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.EnumPlantType; import net.minecraftforge.common.IPlantable; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.core.helper.IconHelper; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.AltGrassVariant; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.Botania; import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.registry.GameRegistry; + +import javax.annotation.Nonnull; +import java.util.List; +import java.util.Random; public class BlockAltGrass extends BlockMod implements ILexiconable { - private static final int SUBTYPES = 6; - IIcon[] icons; - public BlockAltGrass() { - super(Material.grass); + super(Material.GRASS, LibBlockNames.ALT_GRASS); setHardness(0.6F); - setStepSound(soundTypeGrass); - setBlockName(LibBlockNames.ALT_GRASS); + setSoundType(SoundType.PLANT); setTickRandomly(true); } + @Nonnull @Override - public boolean isToolEffective(String type, int metadata) { + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.ALTGRASS_VARIANT); + } + + @Override + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.ALTGRASS_VARIANT, AltGrassVariant.DRY); + } + + @Override + public boolean isToolEffective(String type, @Nonnull IBlockState state) { return type.equals("shovel"); } - + @Override - public Block setBlockName(String par1Str) { - GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, par1Str); - return super.setBlockName(par1Str); + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.ALTGRASS_VARIANT).ordinal(); + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + return getDefaultState().withProperty(BotaniaStateProps.ALTGRASS_VARIANT, AltGrassVariant.values()[meta]); } @Override - protected boolean shouldRegisterInNameSet() { - return false; + public void registerItemForm() { + GameRegistry.register(new ItemBlockWithMetadataAndName(this), getRegistryName()); } + @SideOnly(Side.CLIENT) @Override - public void getSubBlocks(Item item, CreativeTabs tab, List list) { + public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List list) { for(int i = 0; i < 6; i++) list.add(new ItemStack(item, 1, i)); } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - icons = new IIcon[SUBTYPES * 2]; - for(int i = 0; i < icons.length; i++) - icons[i] = IconHelper.forBlock(par1IconRegister, this, i); - } - - @Override - public IIcon getIcon(int side, int meta) { - return side == 0 || meta >= SUBTYPES ? Blocks.dirt.getIcon(side, meta) : side == 1 ? icons[meta * 2] : icons[meta * 2 + 1]; - } - - @Override - public void updateTick(World world, int x, int y, int z, Random rand) { - if(!world.isRemote && world.getBlockLightValue(x, y + 1, z) >= 9) { - int meta = world.getBlockMetadata(x, y, z); + public void updateTick(World world, BlockPos pos, IBlockState state, Random rand) { + if(!world.isRemote && state.getBlock() == this && world.getLight(pos.up()) >= 9) { + AltGrassVariant variant = state.getValue(BotaniaStateProps.ALTGRASS_VARIANT); for(int l = 0; l < 4; ++l) { - int i1 = x + rand.nextInt(3) - 1; - int j1 = y + rand.nextInt(5) - 3; - int k1 = z + rand.nextInt(3) - 1; + BlockPos pos1 = pos.add(rand.nextInt(3) - 1, rand.nextInt(5) - 3, rand.nextInt(3) - 1); + + world.getBlockState(pos1.up()).getBlock(); - world.getBlock(i1, j1 + 1, k1); - - if(world.getBlock(i1, j1, k1) == Blocks.dirt && world.getBlockMetadata(i1, j1, k1) == 0 && world.getBlockLightValue(i1, j1 + 1, k1) >= 4 && world.getBlockLightOpacity(i1, j1 + 1, k1) <= 2) - world.setBlock(i1, j1, k1, this, meta, 1 | 2); + if(world.getBlockState(pos1).getBlock() == Blocks.DIRT && world.getBlockState(pos1).getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.DIRT && world.getLight(pos1.up()) >= 4 && world.getBlockLightOpacity(pos1.up()) <= 2) + world.setBlockState(pos1, this.getDefaultState().withProperty(BotaniaStateProps.ALTGRASS_VARIANT, variant), 1 | 2); } } } @Override - public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { - return Blocks.dirt.getItemDropped(0, p_149650_2_, p_149650_3_); + public Item getItemDropped(IBlockState state, Random rand, int fortune) { + return Blocks.DIRT.getItemDropped(state, rand, fortune); + } + + @Nonnull + @Override + public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player) { + return new ItemStack(this, 1, getMetaFromState(world.getBlockState(pos))); } @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) { - return new ItemStack(this, 1, world.getBlockMetadata(x, y, z)); - } - - @Override - public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plantable) { - EnumPlantType type = plantable.getPlantType(world, x, y - 1, z); + public boolean canSustainPlant(@Nonnull IBlockState state, @Nonnull IBlockAccess world, BlockPos pos, @Nonnull EnumFacing direction, IPlantable plantable) { + EnumPlantType type = plantable.getPlantType(world, pos.down()); return type == EnumPlantType.Plains || type == EnumPlantType.Beach; } + @SideOnly(Side.CLIENT) @Override - public void randomDisplayTick(World world, int x, int y, int z, Random r) { - int meta = world.getBlockMetadata(x, y, z); - switch(meta) { - case 0: // Dry - break; - case 1: // Golden + public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random r) { + if (state.getBlock() != this) + return; + AltGrassVariant variant = state.getValue(BotaniaStateProps.ALTGRASS_VARIANT); + switch(variant) { + case DRY: break; - case 2: // Vivid + case GOLDEN: break; - case 3: // Scorched + case VIVID: + break; + case SCORCHED: if(r.nextInt(80) == 0) - world.spawnParticle("flame", x + r.nextFloat(), y + 1.1, z + r.nextFloat(), 0, 0, 0); + world.spawnParticle(EnumParticleTypes.FLAME, pos.getX() + r.nextFloat(), pos.getY() + 1.1, pos.getZ() + r.nextFloat(), 0, 0, 0); break; - case 4: // Infused + case INFUSED: if(r.nextInt(100) == 0) - Botania.proxy.sparkleFX(world, x + r.nextFloat(), y + 1.05, z + r.nextFloat(), 0F, 1F, 1F, r.nextFloat() * 0.2F + 1F, 5); - break; - case 5: // Mutated + Botania.proxy.sparkleFX(pos.getX() + r.nextFloat(), pos.getY() + 1.05, pos.getZ() + r.nextFloat(), 0F, 1F, 1F, r.nextFloat() * 0.2F + 1F, 5); + break; + case MUTATED: if(r.nextInt(100) == 0) { if(r.nextInt(100) > 25) - Botania.proxy.sparkleFX(world, x + r.nextFloat(), y + 1.05, z + r.nextFloat(), 1F, 0F, 1F, r.nextFloat() * 0.2F + 1F, 5); - else Botania.proxy.sparkleFX(world, x + r.nextFloat(), y + 1.05, z + r.nextFloat(), 1F, 1F, 0F, r.nextFloat() * 0.2F + 1F, 5); + Botania.proxy.sparkleFX(pos.getX() + r.nextFloat(), pos.getY() + 1.05, pos.getZ() + r.nextFloat(), 1F, 0F, 1F, r.nextFloat() * 0.2F + 1F, 5); + else Botania.proxy.sparkleFX(pos.getX() + r.nextFloat(), pos.getY() + 1.05, pos.getZ() + r.nextFloat(), 1F, 1F, 0F, r.nextFloat() * 0.2F + 1F, 5); } break; } } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.grassSeeds; } + + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerBlockToState(this, AltGrassVariant.values().length); + } } diff --git a/src/main/java/vazkii/botania/common/block/BlockAltar.java b/src/main/java/vazkii/botania/common/block/BlockAltar.java index 01abb60f4..1443a32de 100644 --- a/src/main/java/vazkii/botania/common/block/BlockAltar.java +++ b/src/main/java/vazkii/botania/common/block/BlockAltar.java @@ -10,152 +10,192 @@ */ package vazkii.botania.common.block; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; +import net.minecraft.util.BlockRenderLayer; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.IFluidContainerItem; +import net.minecraftforge.fluids.capability.CapabilityFluidHandler; +import net.minecraftforge.fluids.capability.IFluidHandler; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.internal.VanillaPacketDispatcher; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.mana.ManaItemHandler; -import vazkii.botania.client.lib.LibRenderIDs; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.AltarVariant; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.Botania; import vazkii.botania.common.block.tile.TileAltar; import vazkii.botania.common.block.tile.TileSimpleInventory; +import vazkii.botania.common.core.helper.InventoryHelper; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName; import vazkii.botania.common.item.rod.ItemWaterRod; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.registry.GameRegistry; -public class BlockAltar extends BlockModContainer implements ILexiconable { +import javax.annotation.Nonnull; +import java.util.List; - Random random; +public class BlockAltar extends BlockMod implements ILexiconable { + + private static final AxisAlignedBB AABB = new AxisAlignedBB(0.125, 0.125, 0.125, 0.875, 20.0/16, 0.875); protected BlockAltar() { - super(Material.rock); + super(Material.ROCK, LibBlockNames.ALTAR); setHardness(3.5F); - setStepSound(soundTypeStone); - setBlockName(LibBlockNames.ALTAR); + setSoundType(SoundType.STONE); + } - float f = 1F / 16F * 2F; - setBlockBounds(f, f, f, 1F - f, 1F / 16F * 20F, 1F - f); + @Nonnull + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { + return AABB; + } - random = new Random(); + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.ALTAR_VARIANT); } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - // NO-OP + protected IBlockState pickDefaultState() { + return blockState.getBaseState() + .withProperty(BotaniaStateProps.ALTAR_VARIANT, AltarVariant.DEFAULT); } @Override - protected boolean shouldRegisterInNameSet() { - return false; + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.ALTAR_VARIANT).ordinal(); + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + if (meta < 0 || meta >= AltarVariant.values().length ) { + meta = 0; + } + return getDefaultState().withProperty(BotaniaStateProps.ALTAR_VARIANT, AltarVariant.values()[meta]); + } + + @Nonnull + @Override + public IBlockState getActualState(@Nonnull IBlockState state, IBlockAccess worldIn, BlockPos pos) { + TileEntity te = worldIn.getTileEntity(pos); + if (te instanceof TileAltar) { + TileAltar altar = ((TileAltar) te); + + if (altar.isMossy) { + state = state.withProperty(BotaniaStateProps.ALTAR_VARIANT, AltarVariant.MOSSY); + } + } + return state; + } + + @SideOnly(Side.CLIENT) + @Nonnull + @Override + public BlockRenderLayer getBlockLayer() { + return BlockRenderLayer.CUTOUT; } @Override - public Block setBlockName(String par1Str) { - GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, par1Str); - return super.setBlockName(par1Str); + public void registerItemForm() { + GameRegistry.register(new ItemBlockWithMetadataAndName(this), getRegistryName()); } + @SideOnly(Side.CLIENT) @Override - public void getSubBlocks(Item item, CreativeTabs tab, List list) { + public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List list) { for(int i = 0; i < 9; i++) list.add(new ItemStack(item, 1, i)); } @Override - public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { + public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity par5Entity) { if(par5Entity instanceof EntityItem) { - TileAltar tile = (TileAltar) par1World.getTileEntity(par2, par3, par4); + TileAltar tile = (TileAltar) world.getTileEntity(pos); if(tile.collideEntityItem((EntityItem) par5Entity)) VanillaPacketDispatcher.dispatchTEToNearbyPlayers(tile); } } @Override - public int getLightValue(IBlockAccess world, int x, int y, int z) { - TileAltar tile = (TileAltar) world.getTileEntity(x, y, z); - return tile.hasLava ? 15 : 0; + public int getLightValue(@Nonnull IBlockState state, IBlockAccess world, @Nonnull BlockPos pos) { + if(world.getBlockState(pos).getBlock() != this) + return world.getBlockState(pos).getLightValue(world, pos); + TileAltar tile = (TileAltar) world.getTileEntity(pos); + return (tile != null && tile.hasLava) ? 15 : 0; } @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { - ItemStack stack = par5EntityPlayer.getCurrentEquippedItem(); - TileAltar tile = (TileAltar) par1World.getTileEntity(par2, par3, par4); - - if(par5EntityPlayer.isSneaking()) { - for(int i = tile.getSizeInventory() - 1; i >= 0; i--) { - ItemStack stackAt = tile.getStackInSlot(i); - if(stackAt != null) { - ItemStack copy = stackAt.copy(); - if(!par5EntityPlayer.inventory.addItemStackToInventory(copy)) - par5EntityPlayer.dropPlayerItemWithRandomChoice(copy, false); - tile.setInventorySlotContents(i, null); - par1World.func_147453_f(par2, par3, par4, this); - break; - } - } + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9) { + TileAltar tile = (TileAltar) world.getTileEntity(pos); + if(player.isSneaking()) { + InventoryHelper.withdrawFromInventory(tile, player); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(tile); } else if(tile.isEmpty() && tile.hasWater && stack == null) - tile.trySetLastRecipe(par5EntityPlayer); + tile.trySetLastRecipe(player); else { - if(stack != null && (isValidWaterContainer(stack) || stack.getItem() == ModItems.waterRod && ManaItemHandler.requestManaExact(stack, par5EntityPlayer, ItemWaterRod.COST, false))) { + if(stack != null && (isValidWaterContainer(stack) || stack.getItem() == ModItems.waterRod && ManaItemHandler.requestManaExact(stack, player, ItemWaterRod.COST, false))) { if(!tile.hasWater) { if(stack.getItem() == ModItems.waterRod) - ManaItemHandler.requestManaExact(stack, par5EntityPlayer, ItemWaterRod.COST, true); - else if(!par5EntityPlayer.capabilities.isCreativeMode) - par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, getContainer(stack)); + ManaItemHandler.requestManaExact(stack, player, ItemWaterRod.COST, true); + else if(!player.capabilities.isCreativeMode) + drain(FluidRegistry.WATER, stack); tile.setWater(true); - par1World.func_147453_f(par2, par3, par4, this); + world.updateComparatorOutputLevel(pos, this); + world.checkLight(pos); } return true; - } else if(stack != null && stack.getItem() == Items.lava_bucket) { - if(!par5EntityPlayer.capabilities.isCreativeMode) - par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, getContainer(stack)); + } else if(stack != null && stack.getItem() == Items.LAVA_BUCKET) { + if(!player.capabilities.isCreativeMode) + drain(FluidRegistry.LAVA, stack); tile.setLava(true); tile.setWater(false); - par1World.func_147453_f(par2, par3, par4, this); + world.updateComparatorOutputLevel(pos, this); + world.checkLight(pos); return true; - } else if(stack != null && stack.getItem() == Items.bucket && (tile.hasWater || tile.hasLava) && !Botania.gardenOfGlassLoaded) { - ItemStack bucket = tile.hasLava ? new ItemStack(Items.lava_bucket) : new ItemStack(Items.water_bucket); + } else if(stack != null && stack.getItem() == Items.BUCKET && (tile.hasWater || tile.hasLava) && !Botania.gardenOfGlassLoaded) { + ItemStack bucket = tile.hasLava ? new ItemStack(Items.LAVA_BUCKET) : new ItemStack(Items.WATER_BUCKET); if(stack.stackSize == 1) - par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, bucket); + player.setHeldItem(hand, bucket); else { - if(!par5EntityPlayer.inventory.addItemStackToInventory(bucket)) - par5EntityPlayer.dropPlayerItemWithRandomChoice(bucket, false); + if(!player.inventory.addItemStackToInventory(bucket)) + player.dropItem(bucket, false); stack.stackSize--; } if(tile.hasLava) tile.setLava(false); else tile.setWater(false); - par1World.func_147453_f(par2, par3, par4, this); + world.updateComparatorOutputLevel(pos, this); + world.checkLight(pos); return true; } @@ -165,127 +205,92 @@ public class BlockAltar extends BlockModContainer implements ILexiconable { } @Override - public void fillWithRain(World world, int x, int y, int z) { + public void fillWithRain(World world, BlockPos pos) { if(world.rand.nextInt(20) == 1) { - TileEntity tile = world.getTileEntity(x, y, z); + TileEntity tile = world.getTileEntity(pos); if(tile instanceof TileAltar) { TileAltar altar = (TileAltar) tile; if(!altar.hasLava && !altar.hasWater) altar.setWater(true); - world.func_147453_f(x, y, z, this); + world.updateComparatorOutputLevel(pos, this); } } } @Override - public int damageDropped(int meta) { - return meta; + public int damageDropped(IBlockState state) { + return getMetaFromState(state); } private boolean isValidWaterContainer(ItemStack stack) { if(stack == null || stack.stackSize != 1) return false; - if(stack.getItem() == ModItems.waterBowl) - return true; - if(stack.getItem() instanceof IFluidContainerItem) { - FluidStack fluidStack = ((IFluidContainerItem) stack.getItem()).getFluid(stack); - return fluidStack != null && fluidStack.getFluid() == FluidRegistry.WATER && fluidStack.amount >= FluidContainerRegistry.BUCKET_VOLUME; + if(stack.hasCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, null)) { + IFluidHandler handler = stack.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, null); + FluidStack simulate = handler.drain(new FluidStack(FluidRegistry.WATER, Fluid.BUCKET_VOLUME), false); + if(simulate != null && simulate.getFluid() == FluidRegistry.WATER && simulate.amount == Fluid.BUCKET_VOLUME) + return true; } - FluidStack fluidStack = FluidContainerRegistry.getFluidForFilledItem(stack); - return fluidStack != null && fluidStack.getFluid() == FluidRegistry.WATER && fluidStack.amount >= FluidContainerRegistry.BUCKET_VOLUME; + + return false; } - private ItemStack getContainer(ItemStack stack) { - if(stack.getItem() == ModItems.waterBowl) - return new ItemStack(Items.bowl); - - if (stack.getItem().hasContainerItem(stack)) - return stack.getItem().getContainerItem(stack); - else if (stack.getItem() instanceof IFluidContainerItem) { - ((IFluidContainerItem) stack.getItem()).drain(stack, FluidContainerRegistry.BUCKET_VOLUME, true); - return stack; - } - return FluidContainerRegistry.drainFluidContainer(stack); + private void drain(Fluid fluid, ItemStack stack) { + stack.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, null) + .drain(new FluidStack(fluid, Fluid.BUCKET_VOLUME), true); } @Override - public IIcon getIcon(int par1, int par2) { - return par2 == 0 ? Blocks.cobblestone.getIcon(par1, par2) : ModFluffBlocks.biomeStoneA.getIcon(par1, par2 + 7); - } - - @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public boolean renderAsNormalBlock() { + public boolean isFullCube(IBlockState state) { return false; } @Override - public int getRenderType() { - return LibRenderIDs.idAltar; + public boolean hasTileEntity(IBlockState state) { + return true; } + @Nonnull @Override - public TileEntity createNewTileEntity(World world, int meta) { + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileAltar(); } @Override - public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { - TileSimpleInventory inv = (TileSimpleInventory) par1World.getTileEntity(par2, par3, par4); + public void breakBlock(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state) { + TileSimpleInventory inv = (TileSimpleInventory) world.getTileEntity(pos); - if (inv != null) { - for (int j1 = 0; j1 < inv.getSizeInventory(); ++j1) { - ItemStack itemstack = inv.getStackInSlot(j1); + InventoryHelper.dropInventory(inv, world, state, pos); - if (itemstack != null) { - float f = random.nextFloat() * 0.8F + 0.1F; - float f1 = random.nextFloat() * 0.8F + 0.1F; - EntityItem entityitem; - - for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) { - int k1 = random.nextInt(21) + 10; - - if (k1 > itemstack.stackSize) - k1 = itemstack.stackSize; - - itemstack.stackSize -= k1; - entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage())); - float f3 = 0.05F; - entityitem.motionX = (float)random.nextGaussian() * f3; - entityitem.motionY = (float)random.nextGaussian() * f3 + 0.2F; - entityitem.motionZ = (float)random.nextGaussian() * f3; - - if (itemstack.hasTagCompound()) - entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy()); - } - } - } - - par1World.func_147453_f(par2, par3, par4, par5); - } - - super.breakBlock(par1World, par2, par3, par4, par5, par6); + super.breakBlock(world, pos, state); } @Override - public boolean hasComparatorInputOverride() { + public boolean hasComparatorInputOverride(IBlockState state) { return true; } @Override - public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) { - TileAltar altar = (TileAltar) par1World.getTileEntity(par2, par3, par4); + public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) { + TileAltar altar = (TileAltar) world.getTileEntity(pos); return altar.hasWater ? 15 : 0; } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.apothecary; } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerBlockToState(this, AltarVariant.values().length - 1); + } + } diff --git a/src/main/java/vazkii/botania/common/block/BlockAvatar.java b/src/main/java/vazkii/botania/common/block/BlockAvatar.java index f6eed4756..cb4ca3e8b 100644 --- a/src/main/java/vazkii/botania/common/block/BlockAvatar.java +++ b/src/main/java/vazkii/botania/common/block/BlockAvatar.java @@ -10,63 +10,100 @@ */ package vazkii.botania.common.block; -import java.util.Random; - -import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.block.statemap.StateMap; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; +import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.common.util.RotationHelper; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.item.IAvatarWieldable; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.lib.LibRenderIDs; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.block.tile.TileAvatar; import vazkii.botania.common.block.tile.TileSimpleInventory; +import vazkii.botania.common.core.helper.InventoryHelper; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -public class BlockAvatar extends BlockModContainer implements ILexiconable { +import javax.annotation.Nonnull; +import java.util.Random; - private static final int[] META_ROTATIONS = new int[] { 2, 5, 3, 4 }; +public class BlockAvatar extends BlockMod implements ILexiconable { - Random random; + private static final AxisAlignedBB X_AABB = new AxisAlignedBB(.3125, 0, .21875, 1-.3125, 17/16.0, 1-.21875); + private static final AxisAlignedBB Z_AABB = new AxisAlignedBB(.21875, 0, .3125, 1-.21875, 17/16.0, 1-.3125); protected BlockAvatar() { - super(Material.wood); + super(Material.WOOD, LibBlockNames.AVATAR); setHardness(2.0F); - setStepSound(soundTypeWood); - setBlockName(LibBlockNames.AVATAR); - setBlockBounds(true); + setSoundType(SoundType.WOOD); + } - random = new Random(); + @Nonnull + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { + if(state.getValue(BotaniaStateProps.CARDINALS).getAxis() == EnumFacing.Axis.X) + return X_AABB; + else return Z_AABB; + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.CARDINALS); } @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int s, float xs, float ys, float zs) { - TileAvatar avatar = (TileAvatar) world.getTileEntity(x, y, z); - ItemStack stackOnAvatar = avatar.getStackInSlot(0); - ItemStack stackOnPlayer = player.getCurrentEquippedItem(); + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.CARDINALS, EnumFacing.NORTH); + } + + @Override + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.CARDINALS).getIndex(); + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + if (meta < 2 || meta > 5) { + meta = 2; + } + return getDefaultState().withProperty(BotaniaStateProps.CARDINALS, EnumFacing.getFront(meta)); + } + + @Override + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stackOnPlayer, EnumFacing s, float xs, float ys, float zs) { + TileAvatar avatar = (TileAvatar) world.getTileEntity(pos); + ItemStack stackOnAvatar = avatar.getItemHandler().getStackInSlot(0); if(stackOnAvatar != null) { ItemStack copyStack = stackOnAvatar.copy(); - avatar.setInventorySlotContents(0, null); + avatar.getItemHandler().setStackInSlot(0, null); if(!player.inventory.addItemStackToInventory(copyStack)) - player.dropPlayerItemWithRandomChoice(copyStack, true); + player.dropItem(copyStack, true); return true; } else if(stackOnPlayer != null && stackOnPlayer.getItem() instanceof IAvatarWieldable) { ItemStack copyStack = stackOnPlayer.copy(); - avatar.setInventorySlotContents(0, copyStack); + avatar.getItemHandler().setStackInSlot(0, copyStack); stackOnPlayer.stackSize--; return true; } @@ -75,104 +112,57 @@ public class BlockAvatar extends BlockModContainer implements ILexiconable { } @Override - public void setBlockBoundsBasedOnState(IBlockAccess w, int x, int y, int z) { - setBlockBounds(w.getBlockMetadata(x, y, z) < 4); - } + public void breakBlock(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state) { + TileSimpleInventory inv = (TileSimpleInventory) world.getTileEntity(pos); - public void setBlockBounds(boolean horiz) { - float f = 1F / 16F; - float w = f * 9; - float l = f * 6; - float ws = (1F - w) / 2; - float ls = (1F - l) / 2; + InventoryHelper.dropInventory(inv, world, state, pos); - if(horiz) - setBlockBounds(ws, 0F, ls, 1F - ws, 1F + f, 1F - ls); - else setBlockBounds(ls, 0F, ws, 1F - ls, 1F + f, 1F - ws); + super.breakBlock(world, pos, state); } @Override - public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { - TileSimpleInventory inv = (TileSimpleInventory) par1World.getTileEntity(par2, par3, par4); - - if (inv != null) { - for (int j1 = 0; j1 < inv.getSizeInventory(); ++j1) { - ItemStack itemstack = inv.getStackInSlot(j1); - - if (itemstack != null) { - float f = random.nextFloat() * 0.8F + 0.1F; - float f1 = random.nextFloat() * 0.8F + 0.1F; - EntityItem entityitem; - - for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) { - int k1 = random.nextInt(21) + 10; - - if (k1 > itemstack.stackSize) - k1 = itemstack.stackSize; - - itemstack.stackSize -= k1; - entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage())); - float f3 = 0.05F; - entityitem.motionX = (float)random.nextGaussian() * f3; - entityitem.motionY = (float)random.nextGaussian() * f3 + 0.2F; - entityitem.motionZ = (float)random.nextGaussian() * f3; - - if (itemstack.hasTagCompound()) - entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy()); - } - } - } - - par1World.func_147453_f(par2, par3, par4, par5); - } - - super.breakBlock(par1World, par2, par3, par4, par5, par6); + public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { + world.setBlockState(pos, state.withProperty(BotaniaStateProps.CARDINALS, placer.getHorizontalFacing().getOpposite())); } @Override - public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) { - int l = MathHelper.floor_double(p_149689_5_.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; - p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, META_ROTATIONS[l], 2); - } - - @Override - public boolean rotateBlock(World worldObj, int x, int y, int z, ForgeDirection axis) { - return RotationHelper.rotateVanillaBlock(Blocks.furnace, worldObj, x, y, z, axis); - } - - @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - // NO-OP - } - - @Override - public IIcon getIcon(int side, int meta) { - return ModBlocks.livingwood.getIcon(0, 0); - } - - @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public boolean renderAsNormalBlock() { + public boolean isFullCube(IBlockState state) { return false; } + @Nonnull @Override - public int getRenderType() { - return LibRenderIDs.idAvatar; + public EnumBlockRenderType getRenderType(IBlockState state) { + return EnumBlockRenderType.ENTITYBLOCK_ANIMATED; } @Override - public TileEntity createNewTileEntity(World world, int meta) { + public boolean hasTileEntity(IBlockState state) { + return true; + } + + @Nonnull + @Override + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileAvatar(); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.avatar; } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelLoader.setCustomStateMapper(this, new StateMap.Builder().ignore(BotaniaStateProps.CARDINALS).build()); + ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(this), 0, TileAvatar.class); + ModelHandler.registerCustomItemblock(this, "avatar"); + } + } diff --git a/src/main/java/vazkii/botania/common/block/BlockBifrost.java b/src/main/java/vazkii/botania/common/block/BlockBifrost.java index 8f2736bd7..4838ec0b2 100644 --- a/src/main/java/vazkii/botania/common/block/BlockBifrost.java +++ b/src/main/java/vazkii/botania/common/block/BlockBifrost.java @@ -10,41 +10,40 @@ */ package vazkii.botania.common.block; -import java.util.Random; - import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.BlockRenderLayer; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import net.minecraftforge.client.event.TextureStitchEvent; import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.render.block.InterpolatedIcon; import vazkii.botania.common.block.tile.TileBifrost; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -public class BlockBifrost extends BlockModContainer implements ILexiconable { +import javax.annotation.Nonnull; +import java.util.Random; + +public class BlockBifrost extends BlockMod implements ILexiconable { public BlockBifrost() { - super(Material.glass); - setBlockName(LibBlockNames.BIFROST); + super(Material.GLASS, LibBlockNames.BIFROST); setLightOpacity(0); setLightLevel(1F); setBlockUnbreakable(); - setStepSound(soundTypeGlass); - MinecraftForge.EVENT_BUS.register(this); + setSoundType(SoundType.GLASS); } @Override @@ -53,59 +52,47 @@ public class BlockBifrost extends BlockModContainer implements ILexiconable { } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } + @Nonnull @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) { + public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player) { return new ItemStack(ModItems.rainbowRod); } - public boolean shouldSideBeRendered1(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) { - Block block = p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_); + @Override + public boolean shouldSideBeRendered(IBlockState state, @Nonnull IBlockAccess world, @Nonnull BlockPos pos, EnumFacing side) { + Block block = world.getBlockState(pos.offset(side)).getBlock(); + return block != this && super.shouldSideBeRendered(state, world, pos, side); + } - return block == this ? false : super.shouldSideBeRendered(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_); + @SideOnly(Side.CLIENT) + @Nonnull + @Override + public BlockRenderLayer getBlockLayer() { + return BlockRenderLayer.TRANSLUCENT; } @Override - public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) { - return shouldSideBeRendered1(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, 1 - p_149646_5_); - } - - @Override - public int getRenderBlockPass() { - return 1; - } - - @Override - public int quantityDropped(int meta, int fortune, Random random) { + public int quantityDropped(IBlockState state, int fortune, @Nonnull Random random) { return 0; } - @SubscribeEvent - @SideOnly(Side.CLIENT) - public void loadTextures(TextureStitchEvent.Pre event) { - if(event.map.getTextureType() == 0) { - TextureAtlasSprite icon = new InterpolatedIcon("botania:bifrost"); - if(event.map.setTextureEntry("botania:bifrost", icon)) - blockIcon = icon; - } + @Override + public boolean hasTileEntity(IBlockState state) { + return true; } + @Nonnull @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - // NO-OP - } - - @Override - public TileEntity createNewTileEntity(World world, int meta) { + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileBifrost(); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.rainbowRod; } diff --git a/src/main/java/vazkii/botania/common/block/BlockBifrostPerm.java b/src/main/java/vazkii/botania/common/block/BlockBifrostPerm.java index 49eb55010..a0871edc0 100644 --- a/src/main/java/vazkii/botania/common/block/BlockBifrostPerm.java +++ b/src/main/java/vazkii/botania/common/block/BlockBifrostPerm.java @@ -10,73 +10,66 @@ */ package vazkii.botania.common.block; -import java.util.Random; - -import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; +import net.minecraft.util.BlockRenderLayer; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.common.Botania; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; +import javax.annotation.Nonnull; +import java.util.Random; + public class BlockBifrostPerm extends BlockMod implements ILexiconable { public BlockBifrostPerm() { - super(Material.glass); - setBlockName(LibBlockNames.BIFROST_PERM); + super(Material.GLASS, LibBlockNames.BIFROST_PERM); setLightOpacity(0); setHardness(0.3F); setLightLevel(1F); - setStepSound(soundTypeGlass); + setSoundType(SoundType.GLASS); setTickRandomly(true); } @Override - public IIcon getIcon(int side, int meta) { - return ModBlocks.bifrost.getIcon(side, meta); - } - - @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - // NO-OP - } - - @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } - public boolean shouldSideBeRendered1(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) { - Block block = p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_); - - return block == this ? false : super.shouldSideBeRendered(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_); + @Override + public boolean shouldSideBeRendered(IBlockState state, @Nonnull IBlockAccess world, @Nonnull BlockPos pos, EnumFacing side) { + if (world.getBlockState(pos.offset(side)).getBlock() == this) { + return false; + } + return super.shouldSideBeRendered(state, world, pos, side); } @Override - public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) { - return shouldSideBeRendered1(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, 1 - p_149646_5_); - } - - @Override - public void randomDisplayTick(World world, int x, int y, int z, Random rand) { + public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) { if(rand.nextBoolean()) - Botania.proxy.sparkleFX(world, x + Math.random(), y + Math.random(), z + Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), 0.45F + 0.2F * (float) Math.random(), 6); + Botania.proxy.sparkleFX(pos.getX() + Math.random(), pos.getY() + Math.random(), pos.getZ() + Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), 0.45F + 0.2F * (float) Math.random(), 6); + } + + @SideOnly(Side.CLIENT) + @Nonnull + @Override + public BlockRenderLayer getBlockLayer() { + return BlockRenderLayer.TRANSLUCENT; } @Override - public int getRenderBlockPass() { - return 1; - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.rainbowRod; } diff --git a/src/main/java/vazkii/botania/common/block/BlockCacophonium.java b/src/main/java/vazkii/botania/common/block/BlockCacophonium.java index d0129c4fa..dcb1f43b4 100644 --- a/src/main/java/vazkii/botania/common/block/BlockCacophonium.java +++ b/src/main/java/vazkii/botania/common/block/BlockCacophonium.java @@ -10,44 +10,56 @@ */ package vazkii.botania.common.block; -import java.util.ArrayList; - import net.minecraft.block.Block; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import vazkii.botania.client.core.helper.IconHelper; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.common.block.tile.TileCacophonium; import vazkii.botania.common.lib.LibBlockNames; -public class BlockCacophonium extends BlockModContainer { +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.List; - IIcon top; +public class BlockCacophonium extends BlockMod { protected BlockCacophonium() { - super(Material.wood); - setBlockName(LibBlockNames.CACOPHONIUM); + super(Material.WOOD, LibBlockNames.CACOPHONIUM); setHardness(0.8F); } + @Nonnull @Override - public void registerBlockIcons(IIconRegister reg) { - blockIcon = IconHelper.forBlock(reg, this, 0); - top = IconHelper.forBlock(reg, this, 1); + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.POWERED); } @Override - public IIcon getIcon(int side, int meta) { - return side == 1 ? blockIcon : top; + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.POWERED, false); } @Override - protected boolean canSilkHarvest() { + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.POWERED) ? 8 : 0; + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + return getDefaultState().withProperty(BotaniaStateProps.POWERED, meta == 8); + } + + @Override + public boolean canSilkHarvest(World world, BlockPos pos, @Nonnull IBlockState state, EntityPlayer player) { return false; } @@ -57,33 +69,46 @@ public class BlockCacophonium extends BlockModContainer { } @Override - public void onNeighborBlockChange(World world, int x, int y, int z, Block block) { - boolean power = world.isBlockIndirectlyGettingPowered(x, y, z) || world.isBlockIndirectlyGettingPowered(x, y + 1, z); - int meta = world.getBlockMetadata(x, y, z); - boolean powered = (meta & 8) != 0; + public void neighborChanged(IBlockState state, World world, BlockPos pos, Block block) { + boolean power = world.isBlockIndirectlyGettingPowered(pos) > 0 || world.isBlockIndirectlyGettingPowered(pos.up()) > 0; + boolean powered = state.getValue(BotaniaStateProps.POWERED); if(power && !powered) { - TileEntity tile = world.getTileEntity(x, y, z); + TileEntity tile = world.getTileEntity(pos); if(tile != null && tile instanceof TileCacophonium) ((TileCacophonium) tile).annoyDirewolf(); - world.setBlockMetadataWithNotify(x, y, z, meta | 8, 4); + world.setBlockState(pos, state.withProperty(BotaniaStateProps.POWERED, true), 4); } else if(!power && powered) - world.setBlockMetadataWithNotify(x, y, z, meta & -9, 4); + world.setBlockState(pos, state.withProperty(BotaniaStateProps.POWERED, false), 4); } @Override - public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) { - if(!par6EntityPlayer.capabilities.isCreativeMode) - dropBlockAsItem(par1World, par2, par3, par4, par5, 0); + public boolean removedByPlayer(@Nonnull IBlockState state, World world, @Nonnull BlockPos pos, @Nonnull EntityPlayer player, boolean willHarvest) { + if (willHarvest) { + // Copy of super.removedByPlayer but don't set to air yet + // This is so getDrops below will have a TE to work with + onBlockHarvested(world, pos, state, player); + return true; + } else { + return super.removedByPlayer(state, world, pos, player, willHarvest); + } } @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList stacks = new ArrayList(); + public void harvestBlock(@Nonnull World world, EntityPlayer player, @Nonnull BlockPos pos, @Nonnull IBlockState state, TileEntity te, ItemStack stack) { + super.harvestBlock(world, player, pos, state, te, stack); + // Now delete the block and TE + world.setBlockToAir(pos); + } - TileEntity tile = world.getTileEntity(x, y, z); + @Nonnull + @Override + public List getDrops(IBlockAccess world, BlockPos pos, @Nonnull IBlockState state, int fortune) { + ArrayList stacks = new ArrayList<>(); + + TileEntity tile = world.getTileEntity(pos); if(tile != null && tile instanceof TileCacophonium) { - stacks.add(new ItemStack(Blocks.noteblock)); + stacks.add(new ItemStack(Blocks.NOTEBLOCK)); ItemStack thingy = ((TileCacophonium) tile).stack; if(thingy != null) stacks.add(thingy.copy()); @@ -93,7 +118,13 @@ public class BlockCacophonium extends BlockModContainer { } @Override - public TileEntity createNewTileEntity(World world, int meta) { + public boolean hasTileEntity(IBlockState state) { + return true; + } + + @Nonnull + @Override + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileCacophonium(); } diff --git a/src/main/java/vazkii/botania/common/block/BlockCamo.java b/src/main/java/vazkii/botania/common/block/BlockCamo.java index 968d83492..4a0e58452 100644 --- a/src/main/java/vazkii/botania/common/block/BlockCamo.java +++ b/src/main/java/vazkii/botania/common/block/BlockCamo.java @@ -10,104 +10,45 @@ */ package vazkii.botania.common.block; -import java.util.Arrays; -import java.util.List; - import net.minecraft.block.Block; -import net.minecraft.block.BlockDirectional; import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; +import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import vazkii.botania.common.block.tile.TileCamo; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -public abstract class BlockCamo extends BlockModContainer { +public abstract class BlockCamo extends BlockMod { - static List validRenderTypes = Arrays.asList(0, 31, 39); + protected BlockCamo(Material par2Material, String name) { + super(par2Material, name); + } - protected BlockCamo(Material par2Material) { - super(par2Material); + public static boolean isValidBlock(IBlockState state) { + return state.isOpaqueCube() || state.getRenderType() == EnumBlockRenderType.MODEL; } @Override - public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { - TileEntity tile = world.getTileEntity(x, y, z); - int meta = world.getBlockMetadata(x, y, z); + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack currentStack, EnumFacing side, float hitX, float hitY, float hitZ) { + TileEntity tile = world.getTileEntity(pos); - if(tile instanceof TileCamo) { + if(world.isRemote) + return true; + + if(currentStack != null + && Block.getBlockFromItem(currentStack.getItem()) != null + && tile instanceof TileCamo) { TileCamo camo = (TileCamo) tile; - Block block = camo.camo; - if(block != null && isValidBlock(block)) - return block.getIcon(side, camo.camoMeta); - } + IBlockState changeState = Block.getBlockFromItem(currentStack.getItem()).onBlockPlaced(world, pos, side, hitX, hitY, hitZ, currentStack.getItemDamage(), player); - return getIconFromSideAfterCheck(tile, meta, side); - } - - public static boolean isValidBlock(Block block) { - return block.isOpaqueCube() || isValidRenderType(block.getRenderType()); - } - - public static boolean isValidRenderType(int type) { - return validRenderTypes.contains(type); - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { - TileEntity tile = par1World.getTileEntity(par2, par3, par4); - - if(tile instanceof TileCamo) { - TileCamo camo = (TileCamo) tile; - ItemStack currentStack = par5EntityPlayer.getCurrentEquippedItem(); - - if(currentStack == null) - currentStack = new ItemStack(Block.getBlockFromName("air"), 1, 0); - - boolean doChange = true; - Block block = null; - checkChange : { - if(currentStack.getItem() != Item.getItemFromBlock(Block.getBlockFromName("air"))) { - if(Item.getIdFromItem(currentStack.getItem()) == 0) { - doChange = false; - break checkChange; - } - - block = Block.getBlockFromItem(currentStack.getItem()); - if(block == null || !isValidBlock(block) || block instanceof BlockCamo || block.getMaterial() == Material.air) - doChange = false; - } - } - - if(doChange && currentStack.getItem() != null) { - int metadata = currentStack.getItemDamage(); - if(block instanceof BlockDirectional) { - switch (par6) { - case 0: - case 1: - break; - case 2: - metadata = metadata & 12 | 2; - break; - case 3: - metadata = metadata & 12; - break; - case 4: - metadata = metadata & 12 | 1; - break; - case 5: - metadata = metadata & 12 | 3; - break; - } - } - camo.camo = Block.getBlockFromItem(currentStack.getItem()); - camo.camoMeta = metadata; - par1World.markBlockForUpdate(par2,par3,par4); + if(isValidBlock(changeState) && !(changeState.getBlock() instanceof BlockCamo) && changeState.getMaterial() != Material.AIR) { + camo.camoState = changeState; + world.notifyBlockUpdate(pos, state, state, 8); return true; } @@ -117,31 +58,18 @@ public abstract class BlockCamo extends BlockModContainer { } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public boolean renderAsNormalBlock() { + public boolean isFullCube(IBlockState state) { return false; } @Override - @SideOnly(Side.CLIENT) - public int colorMultiplier(IBlockAccess par1World, int par2, int par3, int par4) { - TileEntity tile = par1World.getTileEntity(par2, par3, par4); - if(tile instanceof TileCamo) { - TileCamo camo = (TileCamo) tile; - Block block = camo.camo; - if(block != null) - return block instanceof BlockCamo ? 0xFFFFFF : block.getRenderColor(camo.camoMeta); - - } - return 0xFFFFFF; - } - - public IIcon getIconFromSideAfterCheck(TileEntity tile, int meta, int side) { - return getIcon(side, meta); + public boolean hasTileEntity(IBlockState state) { + return true; } } \ No newline at end of file diff --git a/src/main/java/vazkii/botania/common/block/BlockCell.java b/src/main/java/vazkii/botania/common/block/BlockCell.java index b538b2372..85a105d1d 100644 --- a/src/main/java/vazkii/botania/common/block/BlockCell.java +++ b/src/main/java/vazkii/botania/common/block/BlockCell.java @@ -10,12 +10,14 @@ */ package vazkii.botania.common.block; -import java.util.ArrayList; - +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; @@ -23,26 +25,36 @@ import vazkii.botania.common.block.tile.TileCell; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -public class BlockCell extends BlockModContainer implements ILexiconable { +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.List; + +public class BlockCell extends BlockMod implements ILexiconable { public BlockCell() { - super(Material.gourd); - setBlockName(LibBlockNames.CELL_BLOCK); - setStepSound(soundTypeCloth); + super(Material.GOURD, LibBlockNames.CELL_BLOCK); + setSoundType(SoundType.CLOTH); + } + + @Nonnull + @Override + public List getDrops(IBlockAccess world, BlockPos pos, @Nonnull IBlockState state, int fortune) { + return new ArrayList<>(); } @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - return new ArrayList(); + public boolean hasTileEntity(IBlockState state) { + return true; } + @Nonnull @Override - public TileEntity createNewTileEntity(World world, int meta) { + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileCell(); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.dandelifeon; } diff --git a/src/main/java/vazkii/botania/common/block/BlockCocoon.java b/src/main/java/vazkii/botania/common/block/BlockCocoon.java index bcf82a503..99599bee6 100644 --- a/src/main/java/vazkii/botania/common/block/BlockCocoon.java +++ b/src/main/java/vazkii/botania/common/block/BlockCocoon.java @@ -10,92 +10,99 @@ */ package vazkii.botania.common.block; -import java.util.ArrayList; - +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.lib.LibRenderIDs; import vazkii.botania.common.block.tile.TileCocoon; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -public class BlockCocoon extends BlockModContainer implements ILexiconable { +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.List; + +public class BlockCocoon extends BlockMod implements ILexiconable { + + private static final AxisAlignedBB AABB = new AxisAlignedBB(3.0/16, 0, 3.0/16, 13.0/16, 0.875, 13.0/16);; protected BlockCocoon() { - super(Material.cloth); + super(Material.CLOTH, LibBlockNames.COCOON); setHardness(3.0F); setResistance(50.0F); - setStepSound(soundTypeCloth); - setBlockName(LibBlockNames.COCOON); - float f = 3F / 16F; - float f1 = 14F / 16F; - setBlockBounds(f, 0F, f, 1F - f, f1, 1F - f); + setSoundType(SoundType.CLOTH); + } + + @Nonnull + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { + return AABB; } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - // NO-OP - } - - @Override - public IIcon getIcon(int p_149691_1_, int p_149691_2_) { - return Blocks.web.getBlockTextureFromSide(0); - } - - @Override - public boolean renderAsNormalBlock() { + public boolean isFullCube(IBlockState state) { return false; } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } + @Nonnull @Override - public int getRenderType() { - return LibRenderIDs.idCocoon; + public EnumBlockRenderType getRenderType(IBlockState state) { + return EnumBlockRenderType.ENTITYBLOCK_ANIMATED; } @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int s, float xs, float ys, float zs) { - TileCocoon cocoon = (TileCocoon) world.getTileEntity(x, y, z); - ItemStack item = player.getCurrentEquippedItem(); - if(cocoon.emeraldsGiven < TileCocoon.MAX_EMERALDS && item != null && item.getItem() == Items.emerald) { + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack item, EnumFacing s, float xs, float ys, float zs) { + TileCocoon cocoon = (TileCocoon) world.getTileEntity(pos); + if(cocoon.emeraldsGiven < TileCocoon.MAX_EMERALDS && item != null && item.getItem() == Items.EMERALD) { if(!player.capabilities.isCreativeMode) item.stackSize--; cocoon.emeraldsGiven++; - world.playAuxSFX(2005, x, y, z, 6 + world.rand.nextInt(4)); + world.playEvent(2005, pos, 6 + world.rand.nextInt(4)); } return false; } + @Nonnull @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - return new ArrayList(); + public List getDrops(IBlockAccess world, BlockPos pos, @Nonnull IBlockState state, int fortune) { + return new ArrayList<>(); } @Override - protected boolean canSilkHarvest() { + public boolean canSilkHarvest(World world, BlockPos pos, @Nonnull IBlockState state, EntityPlayer player) { return false; } @Override - public TileEntity createNewTileEntity(World world, int meta) { + public boolean hasTileEntity(IBlockState state) { + return true; + } + + @Nonnull + @Override + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileCocoon(); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.cocoon; } diff --git a/src/main/java/vazkii/botania/common/block/BlockDreamwood.java b/src/main/java/vazkii/botania/common/block/BlockDreamwood.java index 5ed43a155..03e0cb7c1 100644 --- a/src/main/java/vazkii/botania/common/block/BlockDreamwood.java +++ b/src/main/java/vazkii/botania/common/block/BlockDreamwood.java @@ -2,12 +2,13 @@ package vazkii.botania.common.block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.fml.common.registry.GameRegistry; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.common.item.block.ItemBlockDreamwood; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.registry.GameRegistry; public class BlockDreamwood extends BlockLivingwood { @@ -16,12 +17,12 @@ public class BlockDreamwood extends BlockLivingwood { } @Override - void register(String name) { - GameRegistry.registerBlock(this, ItemBlockDreamwood.class, name); + public void registerItemForm() { + GameRegistry.register(new ItemBlockDreamwood(this), getRegistryName()); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.elvenResources; } } diff --git a/src/main/java/vazkii/botania/common/block/BlockEnchantedSoil.java b/src/main/java/vazkii/botania/common/block/BlockEnchantedSoil.java index 1c66aca3f..d45fd01b6 100644 --- a/src/main/java/vazkii/botania/common/block/BlockEnchantedSoil.java +++ b/src/main/java/vazkii/botania/common/block/BlockEnchantedSoil.java @@ -10,92 +10,57 @@ */ package vazkii.botania.common.block; -import java.util.Random; - +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import net.minecraftforge.client.event.TextureStitchEvent; import net.minecraftforge.common.EnumPlantType; import net.minecraftforge.common.IPlantable; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.util.ForgeDirection; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.render.block.InterpolatedIcon; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import javax.annotation.Nonnull; +import java.util.Random; public class BlockEnchantedSoil extends BlockMod implements ILexiconable { - IIcon iconSide; - public BlockEnchantedSoil() { - super(Material.grass); + super(Material.GRASS, LibBlockNames.ENCHANTED_SOIL); setHardness(0.6F); - setStepSound(soundTypeGrass); - setBlockName(LibBlockNames.ENCHANTED_SOIL); - MinecraftForge.EVENT_BUS.register(this); + setSoundType(SoundType.PLANT); } @Override - boolean registerInCreative() { + protected boolean registerInCreative() { return false; } @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - // NO-OP - } - - @SubscribeEvent - @SideOnly(Side.CLIENT) - public void loadTextures(TextureStitchEvent.Pre event) { - if(event.map.getTextureType() == 0) { - TextureAtlasSprite icon = new InterpolatedIcon("botania:enchantedSoil0"); - if(event.map.setTextureEntry("botania:enchantedSoil0", icon)) - blockIcon = icon; - - icon = new InterpolatedIcon("botania:enchantedSoil1"); - if(event.map.setTextureEntry("botania:enchantedSoil1", icon)) - iconSide = icon; - } + public Item getItemDropped(IBlockState state, Random rand, int fortune) { + return Blocks.DIRT.getItemDropped(state, rand, fortune); } @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int side, int meta) { - return side == 0 ? Blocks.dirt.getIcon(0, 0) : side == 1 ? blockIcon : iconSide; + public boolean canSustainPlant(@Nonnull IBlockState state, @Nonnull IBlockAccess world, BlockPos pos, @Nonnull EnumFacing direction, IPlantable plantable) { + return plantable.getPlantType(world, pos.down()) == EnumPlantType.Plains; } @Override - public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { - return Blocks.dirt.getItemDropped(0, p_149650_2_, p_149650_3_); - } - - @Override - public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plantable) { - return plantable.getPlantType(world, x, y - 1, z) == EnumPlantType.Plains; - } - - @Override - protected boolean canSilkHarvest() { + public boolean canSilkHarvest(World world, BlockPos pos, @Nonnull IBlockState state, EntityPlayer player) { return false; } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.overgrowthSeed; } diff --git a/src/main/java/vazkii/botania/common/block/BlockEnderEye.java b/src/main/java/vazkii/botania/common/block/BlockEnderEye.java index 5ea86885a..7edc3f342 100644 --- a/src/main/java/vazkii/botania/common/block/BlockEnderEye.java +++ b/src/main/java/vazkii/botania/common/block/BlockEnderEye.java @@ -10,61 +10,80 @@ */ package vazkii.botania.common.block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.core.helper.IconHelper; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.common.block.tile.TileEnderEye; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -public class BlockEnderEye extends BlockModContainer implements ILexiconable { +import javax.annotation.Nonnull; - IIcon iconOff, iconOn; +public class BlockEnderEye extends BlockMod implements ILexiconable { protected BlockEnderEye() { - super(Material.iron); + super(Material.IRON, LibBlockNames.ENDER_EYE_BLOCK); setHardness(3F); setResistance(10F); - setStepSound(soundTypeMetal); - setBlockName(LibBlockNames.ENDER_EYE_BLOCK); + setSoundType(SoundType.METAL); + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.POWERED); } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - iconOff = IconHelper.forBlock(par1IconRegister, this, 0); - iconOn = IconHelper.forBlock(par1IconRegister, this, 1); + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.POWERED, false); + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + return getDefaultState().withProperty(BotaniaStateProps.POWERED, meta == 15); } @Override - public IIcon getIcon(int side, int meta) { - return meta == 0 ? iconOff : iconOn; + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.POWERED) ? 15 : 0; } @Override - public boolean canProvidePower() { + public boolean canProvidePower(IBlockState state) { return true; } @Override - public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int side) { - return world.getBlockMetadata(x, y, z); + public int getWeakPower(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) { + return state.getValue(BotaniaStateProps.POWERED) ? 15 : 0; } @Override - public TileEntity createNewTileEntity(World world, int meta) { + public boolean hasTileEntity(IBlockState state) { + return true; + } + + @Nonnull + @Override + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileEnderEye(); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.enderEyeBlock; } diff --git a/src/main/java/vazkii/botania/common/block/BlockFakeAir.java b/src/main/java/vazkii/botania/common/block/BlockFakeAir.java index e55e11295..109256a9d 100644 --- a/src/main/java/vazkii/botania/common/block/BlockFakeAir.java +++ b/src/main/java/vazkii/botania/common/block/BlockFakeAir.java @@ -10,49 +10,69 @@ */ package vazkii.botania.common.block; -import java.util.ArrayList; -import java.util.Random; - +import com.google.common.collect.ImmutableList; import net.minecraft.block.Block; import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.Explosion; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import vazkii.botania.common.block.tile.TileFakeAir; import vazkii.botania.common.lib.LibBlockNames; -public class BlockFakeAir extends BlockModContainer { +import javax.annotation.Nonnull; +import java.util.List; +import java.util.Random; + +public class BlockFakeAir extends BlockMod { + + private static final AxisAlignedBB AABB = new AxisAlignedBB(0, 0, 0, 0, 0, 0); public BlockFakeAir() { - super(Material.air); - setBlockName(LibBlockNames.FAKE_AIR); - setBlockBounds(0, 0, 0, 0, 0, 0); + super(Material.field_189963_J, LibBlockNames.FAKE_AIR); setTickRandomly(true); } + @Nonnull @Override - public void onNeighborBlockChange(World world, int x, int y, int z, Block block) { - if(shouldRemove(world, x, y, z)) - world.scheduleBlockUpdate(x, y, z, this, tickRate(world)); + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { + return AABB; } - private boolean shouldRemove(World world, int x, int y, int z) { - return !world.isRemote && world.getTileEntity(x, y, z) == null || !(world.getTileEntity(x, y, z) instanceof TileFakeAir) || !((TileFakeAir) world.getTileEntity(x, y, z)).canStay(); + @Nonnull + @Override + public EnumBlockRenderType getRenderType(IBlockState state) { + return EnumBlockRenderType.INVISIBLE; } @Override - public void updateTick(World world, int x, int y, int z, Random rand) { - if(shouldRemove(world, x, y, z)) - world.setBlock(x, y, z, Blocks.water); + public void registerItemForm() {} + + @Override + public void neighborChanged(IBlockState state, World world, BlockPos pos, Block block) { + if(shouldRemove(world, pos)) + world.scheduleUpdate(pos, this, tickRate(world)); + } + + private boolean shouldRemove(World world, BlockPos pos) { + return !world.isRemote && world.getTileEntity(pos) == null || !(world.getTileEntity(pos) instanceof TileFakeAir) || !((TileFakeAir) world.getTileEntity(pos)).canStay(); } @Override - public int tickRate(World p_149738_1_) { + public void updateTick(World world, BlockPos pos, IBlockState state, Random rand) { + if(shouldRemove(world, pos)) + world.setBlockState(pos, rand.nextInt(10) == 0 ? Blocks.WATER.getDefaultState() : Blocks.AIR.getDefaultState()); + } + + @Override + public int tickRate(World world) { return 4; } @@ -62,27 +82,27 @@ public class BlockFakeAir extends BlockModContainer { } @Override - public boolean isBlockNormalCube() { + public boolean isBlockNormalCube(IBlockState state) { return false; } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public boolean canEntityDestroy(IBlockAccess world, int x, int y, int z, Entity e) { + public boolean canEntityDestroy(IBlockState state, IBlockAccess world, BlockPos pos, Entity e) { return false; } @Override - public boolean canCollideCheck(int par1, boolean par2) { + public boolean canCollideCheck(IBlockState state, boolean hitIfLiquid) { return false; } @Override - public boolean canBeReplacedByLeaves(IBlockAccess world, int x, int y, int z) { + public boolean canBeReplacedByLeaves(IBlockState state, IBlockAccess world, BlockPos pos) { return true; } @@ -91,23 +111,30 @@ public class BlockFakeAir extends BlockModContainer { return false; } + @Nonnull @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - return new ArrayList(); // Empty List + public List getDrops(IBlockAccess world, BlockPos pos, @Nonnull IBlockState state, int fortune) { + return ImmutableList.of(); } @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { + public AxisAlignedBB getCollisionBoundingBox(IBlockState state, @Nonnull World world, @Nonnull BlockPos pos) { return null; } @Override - public boolean isAir(IBlockAccess world, int x, int y, int z) { + public boolean isAir(IBlockState state, IBlockAccess world, BlockPos pos) { return true; } @Override - public TileEntity createNewTileEntity(World world, int meta) { + public boolean hasTileEntity(IBlockState state) { + return true; + } + + @Nonnull + @Override + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileFakeAir(); } diff --git a/src/main/java/vazkii/botania/common/block/BlockFelPumpkin.java b/src/main/java/vazkii/botania/common/block/BlockFelPumpkin.java index 9f439a05f..58c706509 100644 --- a/src/main/java/vazkii/botania/common/block/BlockFelPumpkin.java +++ b/src/main/java/vazkii/botania/common/block/BlockFelPumpkin.java @@ -10,8 +10,10 @@ */ package vazkii.botania.common.block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.monster.EntityBlaze; @@ -19,87 +21,100 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.living.LivingDropsEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.core.helper.IconHelper; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import javax.annotation.Nonnull; public class BlockFelPumpkin extends BlockMod implements ILexiconable { private static final String TAG_FEL_SPAWNED = "Botania-FelSpawned"; - IIcon top, face; - public BlockFelPumpkin() { - super(Material.gourd); - setBlockName(LibBlockNames.FEL_PUMPKIN); + super(Material.GOURD, LibBlockNames.FEL_PUMPKIN); setHardness(1F); - setStepSound(soundTypeWood); - MinecraftForge.EVENT_BUS.register(this); + setSoundType(SoundType.WOOD); + MinecraftForge.EVENT_BUS.register(BlockFelPumpkin.class); + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.CARDINALS); } @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int p_149691_1_, int p_149691_2_) { - return p_149691_1_ == 1 ? top : p_149691_1_ == 0 ? top : p_149691_2_ == 2 && p_149691_1_ == 2 ? face : p_149691_2_ == 3 && p_149691_1_ == 5 ? face : p_149691_2_ == 0 && p_149691_1_ == 3 ? face : p_149691_2_ == 1 && p_149691_1_ == 4 ? face : blockIcon; + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.CARDINALS, EnumFacing.SOUTH); } @Override - public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) { - super.onBlockAdded(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_); + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.CARDINALS).getHorizontalIndex(); + } - if(!p_149726_1_.isRemote && p_149726_1_.getBlock(p_149726_2_, p_149726_3_ - 1, p_149726_4_) == Blocks.iron_bars && p_149726_1_.getBlock(p_149726_2_, p_149726_3_ - 2, p_149726_4_) == Blocks.iron_bars) { - p_149726_1_.setBlock(p_149726_2_, p_149726_3_, p_149726_4_, getBlockById(0), 0, 2); - p_149726_1_.setBlock(p_149726_2_, p_149726_3_ - 1, p_149726_4_, getBlockById(0), 0, 2); - p_149726_1_.setBlock(p_149726_2_, p_149726_3_ - 2, p_149726_4_, getBlockById(0), 0, 2); - EntityBlaze blaze = new EntityBlaze(p_149726_1_); - blaze.setLocationAndAngles(p_149726_2_ + 0.5D, p_149726_3_ - 1.95D, p_149726_4_ + 0.5D, 0.0F, 0.0F); + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + return getDefaultState().withProperty(BotaniaStateProps.CARDINALS, EnumFacing.getHorizontal(meta)); + } + + @Override + public void onBlockAdded(World world, BlockPos pos, IBlockState state) { + super.onBlockAdded(world, pos, state); + + if(!world.isRemote && world.getBlockState(pos.down()).getBlock() == Blocks.IRON_BARS && world.getBlockState(pos.down(2)).getBlock() == Blocks.IRON_BARS) { + world.setBlockState(pos, Blocks.AIR.getDefaultState(), 2); + world.setBlockState(pos.down(), Blocks.AIR.getDefaultState(), 2); + world.setBlockState(pos.down(2), Blocks.AIR.getDefaultState(), 2); + EntityBlaze blaze = new EntityBlaze(world); + blaze.setLocationAndAngles(pos.getX() + 0.5D, pos.getY() - 1.95D, pos.getZ() + 0.5D, 0.0F, 0.0F); blaze.getEntityData().setBoolean(TAG_FEL_SPAWNED, true); - p_149726_1_.spawnEntityInWorld(blaze); - p_149726_1_.notifyBlockChange(p_149726_2_, p_149726_3_, p_149726_4_, getBlockById(0)); - p_149726_1_.notifyBlockChange(p_149726_2_, p_149726_3_ - 1, p_149726_4_, getBlockById(0)); - p_149726_1_.notifyBlockChange(p_149726_2_, p_149726_3_ - 2, p_149726_4_, getBlockById(0)); + world.spawnEntityInWorld(blaze); + world.notifyNeighborsOfStateChange(pos, Blocks.AIR); + world.notifyNeighborsOfStateChange(pos.down(), Blocks.AIR); + world.notifyNeighborsOfStateChange(pos.down(2), Blocks.AIR); } } @Override - public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) { - int l = MathHelper.floor_double(p_149689_5_.rotationYaw * 4.0F / 360.0F + 2.5D) & 3; - p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, l, 2); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister p_149651_1_) { - face = IconHelper.forBlock(p_149651_1_, this); - top = Blocks.pumpkin.getIcon(0, 0); - blockIcon = Blocks.pumpkin.getIcon(2, 0); + public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { + world.setBlockState(pos, state.withProperty(BotaniaStateProps.CARDINALS, placer.getHorizontalFacing().getOpposite())); } @SubscribeEvent - public void onDrops(LivingDropsEvent event) { - if(event.entity instanceof EntityBlaze && event.entity.getEntityData().getBoolean(TAG_FEL_SPAWNED)) - if(event.drops.isEmpty()) - event.drops.add(new EntityItem(event.entity.worldObj, event.entity.posX, event.entity.posY, event.entity.posZ, new ItemStack(Items.blaze_powder, 6))); - else for(EntityItem item : event.drops) { + public static void onDrops(LivingDropsEvent event) { + if(event.getEntityLiving() instanceof EntityBlaze && event.getEntityLiving().getEntityData().getBoolean(TAG_FEL_SPAWNED)) + if(event.getDrops().isEmpty()) + event.getDrops().add(new EntityItem(event.getEntityLiving().worldObj, event.getEntityLiving().posX, event.getEntityLiving().posY, event.getEntityLiving().posZ, new ItemStack(Items.BLAZE_POWDER, 6))); + else for(EntityItem item : event.getDrops()) { ItemStack stack = item.getEntityItem(); - if(stack.getItem() == Items.blaze_rod) - item.setEntityItemStack(new ItemStack(Items.blaze_powder, stack.stackSize * 10)); + if(stack.getItem() == Items.BLAZE_ROD) + item.setEntityItemStack(new ItemStack(Items.BLAZE_POWDER, stack.stackSize * 10)); } } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.gardenOfGlass; } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerBlockToState(this, 0, getDefaultState().withProperty(BotaniaStateProps.CARDINALS, EnumFacing.NORTH)); + } + } diff --git a/src/main/java/vazkii/botania/common/block/BlockFloatingSpecialFlower.java b/src/main/java/vazkii/botania/common/block/BlockFloatingSpecialFlower.java index c50430429..ab7655cb1 100644 --- a/src/main/java/vazkii/botania/common/block/BlockFloatingSpecialFlower.java +++ b/src/main/java/vazkii/botania/common/block/BlockFloatingSpecialFlower.java @@ -10,26 +10,37 @@ */ package vazkii.botania.common.block; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumDyeColor; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.common.property.ExtendedBlockState; +import net.minecraftforge.common.property.IExtendedBlockState; +import net.minecraftforge.common.property.IUnlistedProperty; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.oredict.RecipeSorter; import net.minecraftforge.oredict.RecipeSorter.Category; import vazkii.botania.api.BotaniaAPI; +import vazkii.botania.api.item.IFloatingFlower; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.api.subtile.ISpecialFlower; import vazkii.botania.api.wand.IWandHUD; import vazkii.botania.api.wand.IWandable; @@ -37,11 +48,14 @@ import vazkii.botania.common.block.decor.BlockFloatingFlower; import vazkii.botania.common.block.tile.TileFloatingSpecialFlower; import vazkii.botania.common.block.tile.TileSpecialFlower; import vazkii.botania.common.crafting.recipe.SpecialFloatingFlowerRecipe; -import vazkii.botania.common.integration.coloredlights.LightHelper; import vazkii.botania.common.item.block.ItemBlockFloatingSpecialFlower; import vazkii.botania.common.item.block.ItemBlockSpecialFlower; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.registry.GameRegistry; + +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements ISpecialFlower, IWandable, ILexiconable, IWandHUD { @@ -52,75 +66,111 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I RecipeSorter.register("botania:floatingSpecialFlower", SpecialFloatingFlowerRecipe.class, Category.SHAPELESS, ""); } + @Nonnull @Override - public int getLightValue(IBlockAccess world, int x, int y, int z) { - int currentLight = ((TileSpecialFlower) world.getTileEntity(x, y, z)).getLightValue(); - if(currentLight == -1) - currentLight = originalLight; - return LightHelper.getPackedColor(world.getBlockMetadata(x, y, z), currentLight); + public BlockStateContainer createBlockState() { + return new ExtendedBlockState(this, new IProperty[] { BotaniaStateProps.COLOR }, new IUnlistedProperty[] { BotaniaStateProps.SUBTILE_ID, BotaniaStateProps.ISLAND_TYPE }); + } + + @Nonnull + @Override + public IBlockState getExtendedState(@Nonnull IBlockState state, IBlockAccess world, BlockPos pos) { + state = super.getExtendedState(state, world, pos); + TileEntity te = world.getTileEntity(pos); + if (te instanceof TileFloatingSpecialFlower) { + state = ((IExtendedBlockState) state).withProperty(BotaniaStateProps.SUBTILE_ID, ((TileFloatingSpecialFlower) te).subTileName); + } + return state; } @Override - public boolean hasComparatorInputOverride() { + public int getLightValue(@Nonnull IBlockState state, IBlockAccess world, @Nonnull BlockPos pos) { + if(world.getBlockState(pos).getBlock() != this) + return world.getBlockState(pos).getLightValue(world, pos); + + TileEntity tile = world.getTileEntity(pos); + return tile instanceof TileSpecialFlower ? ((TileSpecialFlower) tile).getLightValue() : lightValue; + } + + @Override + public boolean hasComparatorInputOverride(IBlockState state) { return true; } @Override - public int getComparatorInputOverride(World world, int x, int y, int z, int side) { - return ((TileSpecialFlower) world.getTileEntity(x, y, z)).getComparatorInputOverride(side); + public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) { + return ((TileSpecialFlower) world.getTileEntity(pos)).getComparatorInputOverride(); } @Override - public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int side) { - return ((TileSpecialFlower) world.getTileEntity(x, y, z)).getPowerLevel(side); + public int getWeakPower(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) { + return ((TileSpecialFlower) world.getTileEntity(pos)).getPowerLevel(side); } @Override - public int isProvidingStrongPower(IBlockAccess world, int x, int y, int z, int side) { - return isProvidingWeakPower(world, x, y, z, side); + public int getStrongPower(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) { + return getWeakPower(state, world, pos, side); } @Override - public boolean canProvidePower() { + public boolean canProvidePower(IBlockState state) { return true; } + @SideOnly(Side.CLIENT) @Override - public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { - // NO-OP - } + public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {} + @SideOnly(Side.CLIENT) @Override - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { + public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List stacks) { for(String s : BotaniaAPI.subtilesForCreativeMenu) { - par3List.add(ItemBlockSpecialFlower.ofType(new ItemStack(par1), s)); + stacks.add(ItemBlockSpecialFlower.ofType(new ItemStack(item), s)); if(BotaniaAPI.miniFlowers.containsKey(s)) - par3List.add(ItemBlockSpecialFlower.ofType(new ItemStack(par1), BotaniaAPI.miniFlowers.get(s))); + stacks.add(ItemBlockSpecialFlower.ofType(new ItemStack(item), BotaniaAPI.miniFlowers.get(s))); + } + } + + @Nonnull + @Override + public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player) { + String name = ((TileSpecialFlower) world.getTileEntity(pos)).subTileName; + return ItemBlockSpecialFlower.ofType(new ItemStack(state.getBlock()), name); + } + + @Override + public void onBlockHarvested(World world, BlockPos pos, IBlockState state, EntityPlayer player) { + ((TileSpecialFlower) world.getTileEntity(pos)).onBlockHarvested(world, pos, state, player); + } + + @Override + public boolean removedByPlayer(@Nonnull IBlockState state, World world, @Nonnull BlockPos pos, @Nonnull EntityPlayer player, boolean willHarvest) { + if (willHarvest) { + // Copy of super.removedByPlayer but don't set to air yet + // This is so getDrops below will have a TE to work with + onBlockHarvested(world, pos, state, player); + return true; + } else { + return super.removedByPlayer(state, world, pos, player, willHarvest); } } @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) { - String name = ((TileSpecialFlower) world.getTileEntity(x, y, z)).subTileName; - return ItemBlockSpecialFlower.ofType(new ItemStack(world.getBlock(x, y, z)), name); + public void harvestBlock(@Nonnull World world, EntityPlayer player, @Nonnull BlockPos pos, @Nonnull IBlockState state, TileEntity te, ItemStack stack) { + super.harvestBlock(world, player, pos, state, te, stack); + // Now delete the block and TE + world.setBlockToAir(pos); } + @Nonnull @Override - public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) { - if(!par6EntityPlayer.capabilities.isCreativeMode) { - dropBlockAsItem(par1World, par2, par3, par4, par5, 0); - ((TileSpecialFlower) par1World.getTileEntity(par2, par3, par4)).onBlockHarvested(par1World, par2, par3, par4, par5, par6EntityPlayer); - } - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList list = new ArrayList(); - TileEntity tile = world.getTileEntity(x, y, z); + public List getDrops(IBlockAccess world, BlockPos pos, @Nonnull IBlockState state, int fortune) { + ArrayList list = new ArrayList<>(); + TileEntity tile = world.getTileEntity(pos); if(tile != null) { String name = ((TileSpecialFlower) tile).subTileName; - list.add(ItemBlockSpecialFlower.ofType(new ItemStack(world.getBlock(x, y, z)), name)); + list.add(ItemBlockSpecialFlower.ofType(new ItemStack(state.getBlock()), name)); ((TileSpecialFlower) tile).getDrops(list); } @@ -128,49 +178,51 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I } @Override - public boolean onBlockEventReceived(World par1World, int par2, int par3, int par4, int par5, int par6) { - super.onBlockEventReceived(par1World, par2, par3, par4, par5, par6); - TileEntity tileentity = par1World.getTileEntity(par2, par3, par4); - return tileentity != null ? tileentity.receiveClientEvent(par5, par6) : false; + public boolean eventReceived(IBlockState state, World world, BlockPos pos, int eventID, int value) { + super.eventReceived(state, world, pos, eventID, value); + TileEntity tileentity = world.getTileEntity(pos); + return tileentity != null ? tileentity.receiveClientEvent(eventID, value) : false; } @Override - public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int side) { - return ((TileSpecialFlower) world.getTileEntity(x, y, z)).onWanded(stack, player); + public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, BlockPos pos, EnumFacing side) { + return ((TileSpecialFlower) world.getTileEntity(pos)).onWanded(stack, player); } @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) { - ((TileSpecialFlower) world.getTileEntity(x, y, z)).onBlockPlacedBy(world, x, y, z, entity, stack); + public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase entity, ItemStack stack) { + ((TileSpecialFlower) world.getTileEntity(pos)).onBlockPlacedBy(world, pos, state, entity, stack); } @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - return ((TileSpecialFlower) world.getTileEntity(x, y, z)).onBlockActivated(world, x, y, z, player, side, hitX, hitY, hitZ) || super.onBlockActivated(world, x, y, z, player, side, hitX, hitY, hitZ); + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing side, float hitX, float hitY, float hitZ) { + return ((TileSpecialFlower) world.getTileEntity(pos)).onBlockActivated(world, pos, state, player, hand, stack, side, hitX, hitY, hitZ) || super.onBlockActivated(world, pos, state, player, hand, stack, side, hitX, hitY, hitZ); } @Override - public void onBlockAdded(World world, int x, int y, int z) { - ((TileSpecialFlower) world.getTileEntity(x, y, z)).onBlockAdded(world, x, y, z); + public void onBlockAdded(World world, BlockPos pos, IBlockState state) { + ((TileSpecialFlower) world.getTileEntity(pos)).onBlockAdded(world, pos, state); + } + + @SideOnly(Side.CLIENT) + @Override + public void renderHUD(Minecraft mc, ScaledResolution res, World world, BlockPos pos) { + ((TileSpecialFlower) world.getTileEntity(pos)).renderHUD(mc, res); } @Override - public void renderHUD(Minecraft mc, ScaledResolution res, World world, int x, int y, int z) { - ((TileSpecialFlower) world.getTileEntity(x, y, z)).renderHUD(mc, res); + public void registerItemForm() { + GameRegistry.register(new ItemBlockFloatingSpecialFlower(this), getRegistryName()); } + @Nonnull @Override - protected void register(String name) { - GameRegistry.registerBlock(this, ItemBlockFloatingSpecialFlower.class, name); - } - - @Override - public TileEntity createNewTileEntity(World world, int meta) { + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileFloatingSpecialFlower(); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { - return ((TileSpecialFlower) world.getTileEntity(x, y, z)).getEntry(); + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { + return ((TileSpecialFlower) world.getTileEntity(pos)).getEntry(); } } diff --git a/src/main/java/vazkii/botania/common/block/BlockForestEye.java b/src/main/java/vazkii/botania/common/block/BlockForestEye.java index aa03b96cc..cb72976e5 100644 --- a/src/main/java/vazkii/botania/common/block/BlockForestEye.java +++ b/src/main/java/vazkii/botania/common/block/BlockForestEye.java @@ -10,73 +10,75 @@ */ package vazkii.botania.common.block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.common.block.tile.TileForestEye; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -public class BlockForestEye extends BlockModContainer implements ILexiconable { +import javax.annotation.Nonnull; - IIcon[] icons; +public class BlockForestEye extends BlockMod implements ILexiconable { + + private static final AxisAlignedBB AABB = new AxisAlignedBB(0.25, 0.25, 0.25, 0.75, 0.75, 0.75); public BlockForestEye() { - super(Material.iron); + super(Material.IRON, LibBlockNames.FOREST_EYE); setHardness(5.0F); setResistance(10.0F); - setStepSound(soundTypeMetal); - setBlockBounds(0.25F, 0.25F, 0.25F, 0.75F, 0.75F, 0.75F); - setBlockName(LibBlockNames.FOREST_EYE); + setSoundType(SoundType.METAL); + } + + @Nonnull + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { + return AABB; } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - icons = new IIcon[6]; - for(int i = 0; i < icons.length; i++) - icons[i] = IconHelper.forBlock(par1IconRegister, this, i); - } - - @Override - public IIcon getIcon(int par1, int par2) { - return icons[Math.min(icons.length - 1, par1)]; - } - - @Override - public boolean renderAsNormalBlock() { + public boolean isFullCube(IBlockState state) { return false; } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public boolean hasComparatorInputOverride() { + public boolean hasComparatorInputOverride(IBlockState state) { return true; } @Override - public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) { - TileForestEye eye = (TileForestEye) par1World.getTileEntity(par2, par3, par4); - return Math.min(15, Math.max(0, eye.entities - 1)); + public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) { + TileForestEye eye = (TileForestEye) world.getTileEntity(pos); + return eye == null ? 0 : Math.min(15, Math.max(0, eye.entities - 1)); } @Override - public TileEntity createNewTileEntity(World world, int meta) { + public boolean hasTileEntity(IBlockState state) { + return true; + } + + @Nonnull + @Override + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileForestEye(); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.forestEye; } diff --git a/src/main/java/vazkii/botania/common/block/BlockGaiaHead.java b/src/main/java/vazkii/botania/common/block/BlockGaiaHead.java index 9b49819a9..dd484b7c6 100644 --- a/src/main/java/vazkii/botania/common/block/BlockGaiaHead.java +++ b/src/main/java/vazkii/botania/common/block/BlockGaiaHead.java @@ -10,91 +10,85 @@ */ package vazkii.botania.common.block; -import java.util.ArrayList; -import java.util.Random; - -import net.minecraft.block.Block; import net.minecraft.block.BlockSkull; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Blocks; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.block.statemap.StateMap; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntitySkull; -import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.client.render.IModelRegister; import vazkii.botania.common.block.tile.TileGaiaHead; import vazkii.botania.common.item.ModItems; -import vazkii.botania.common.item.block.ItemBlockMod; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import vazkii.botania.common.lib.LibMisc; -public class BlockGaiaHead extends BlockSkull { +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +public class BlockGaiaHead extends BlockSkull implements IModelRegister { public BlockGaiaHead() { - setBlockName(LibBlockNames.GAIA_HEAD); + setRegistryName(new ResourceLocation(LibMisc.MOD_ID, LibBlockNames.GAIA_HEAD)); + GameRegistry.register(this); + setUnlocalizedName(LibBlockNames.GAIA_HEAD); setHardness(1.0F); } + @Nonnull @Override - public Block setBlockName(String par1Str) { - GameRegistry.registerBlock(this, ItemBlockMod.class, par1Str); - return super.setBlockName(par1Str); + public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player) { + return new ItemStack(ModItems.gaiaHead); } + @Nonnull @Override - @SideOnly(Side.CLIENT) - public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { - return ModItems.gaiaHead; - } + public List getDrops(@Nonnull IBlockAccess world, @Nonnull BlockPos pos, IBlockState state, int fortune) { + ArrayList ret = new ArrayList<>(); + + if(!state.getValue(NODROP)) { + ItemStack itemstack = new ItemStack(ModItems.gaiaHead, 1); + TileEntitySkull tileentityskull = (TileEntitySkull)world.getTileEntity(pos); + + if(tileentityskull == null) + return ret; + + ret.add(itemstack); + } + return ret; + } + + @Override + public Item getItemDropped(IBlockState state, Random rand, int fortune) { + return ModItems.gaiaHead; + } @Override - public void registerBlockIcons(IIconRegister p_149651_1_) { - // NO-OP - } - - @Override - public ArrayList getDrops(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, int p_149749_6_, int fortune) { - ArrayList ret = new ArrayList(); - - if((p_149749_6_ & 8) == 0) { - ItemStack itemstack = new ItemStack(ModItems.gaiaHead, 1); - TileEntitySkull tileentityskull = (TileEntitySkull)p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_); - - if(tileentityskull == null) - return ret; - - ret.add(itemstack); - } - return ret; - } - - @Override - public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { - return ModItems.gaiaHead; - } - - @Override - public int getDamageValue(World p_149643_1_, int p_149643_2_, int p_149643_3_, int p_149643_4_) { + public int damageDropped(IBlockState state) { return 0; } + @Nonnull @Override - public int damageDropped(int p_149692_1_) { - return 0; - } - - @Override - public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + public TileEntity createNewTileEntity(World world, int meta) { return new TileGaiaHead(); } - @Override @SideOnly(Side.CLIENT) - public IIcon getIcon(int p_149691_1_, int p_149691_2_) { - return Blocks.coal_block.getBlockTextureFromSide(p_149691_1_); + @Override + public void registerModels() { + ModelLoader.setCustomStateMapper(this, new StateMap.Builder().ignore(FACING, NODROP).build()); } - } diff --git a/src/main/java/vazkii/botania/common/block/BlockGhostRail.java b/src/main/java/vazkii/botania/common/block/BlockGhostRail.java index 428ec97a5..7ff6cb92c 100644 --- a/src/main/java/vazkii/botania/common/block/BlockGhostRail.java +++ b/src/main/java/vazkii/botania/common/block/BlockGhostRail.java @@ -12,82 +12,111 @@ package vazkii.botania.common.block; import net.minecraft.block.Block; import net.minecraft.block.BlockRailBase; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.BlockRailPowered; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.minecart.MinecartUpdateEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.core.helper.IconHelper; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.client.core.handler.ModelHandler; +import vazkii.botania.client.render.IModelRegister; import vazkii.botania.common.core.BotaniaCreativeTab; import vazkii.botania.common.item.block.ItemBlockMod; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import vazkii.botania.common.lib.LibMisc; -public class BlockGhostRail extends BlockRailBase implements ILexiconable { +import javax.annotation.Nonnull; + +public class BlockGhostRail extends BlockRailBase implements ILexiconable, IModelRegister { private static final String TAG_FLOAT_TICKS = "Botania_FloatTicks"; public BlockGhostRail() { super(true); setCreativeTab(BotaniaCreativeTab.INSTANCE); - MinecraftForge.EVENT_BUS.register(this); - setBlockName(LibBlockNames.GHOST_RAIL); + setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.RAIL_DIRECTION, EnumRailDirection.NORTH_SOUTH)); + setRegistryName(new ResourceLocation(LibMisc.MOD_ID, LibBlockNames.GHOST_RAIL)); + GameRegistry.register(this); + GameRegistry.register(new ItemBlockMod(this), getRegistryName()); + setUnlocalizedName(LibBlockNames.GHOST_RAIL); + MinecraftForge.EVENT_BUS.register(BlockGhostRail.class); + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.RAIL_DIRECTION); } @Override - public Block setBlockName(String par1Str) { - GameRegistry.registerBlock(this, ItemBlockMod.class, par1Str); - return super.setBlockName(par1Str); + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.RAIL_DIRECTION).getMetadata(); } + @Nonnull @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - blockIcon = IconHelper.forBlock(par1IconRegister, this); + public IBlockState getStateFromMeta(int meta) { + return getDefaultState().withProperty(BotaniaStateProps.RAIL_DIRECTION, EnumRailDirection.byMetadata(meta)); } @SubscribeEvent - public void onMinecartUpdate(MinecartUpdateEvent event) { - int x = MathHelper.floor_double(event.entity.posX); - int y = MathHelper.floor_double(event.entity.posY); - int z = MathHelper.floor_double(event.entity.posZ); - Block block = event.entity.worldObj.getBlock(x, y, z); - boolean air = block.isAir(event.entity.worldObj, x, y, z); - int floatTicks = event.entity.getEntityData().getInteger(TAG_FLOAT_TICKS); + public static void onMinecartUpdate(MinecartUpdateEvent event) { + BlockPos entPos = new BlockPos(event.getEntity()); + IBlockState state = event.getEntity().worldObj.getBlockState(entPos); + Block block = state.getBlock(); + boolean air = block.isAir(state, event.getEntity().worldObj, entPos); + int floatTicks = event.getEntity().getEntityData().getInteger(TAG_FLOAT_TICKS); - if(block == this) - event.entity.getEntityData().setInteger(TAG_FLOAT_TICKS, 20); + if(block == ModBlocks.ghostRail) + event.getEntity().getEntityData().setInteger(TAG_FLOAT_TICKS, 20); else if(block instanceof BlockRailBase || block == ModBlocks.dreamwood) { - event.entity.getEntityData().setInteger(TAG_FLOAT_TICKS, 0); + event.getEntity().getEntityData().setInteger(TAG_FLOAT_TICKS, 0); if(floatTicks > 0) - event.entity.worldObj.playAuxSFX(2003, x, y, z, 0); + event.getEntity().worldObj.playEvent(2003, entPos, 0); } - floatTicks = event.entity.getEntityData().getInteger(TAG_FLOAT_TICKS); + floatTicks = event.getEntity().getEntityData().getInteger(TAG_FLOAT_TICKS); if(floatTicks > 0) { - Block blockBelow = event.entity.worldObj.getBlock(x, y - 1, z); - boolean airBelow = blockBelow.isAir(event.entity.worldObj, x, y - 1, z); + IBlockState stateBelow = event.getEntity().worldObj.getBlockState(entPos.down()); + Block blockBelow = stateBelow.getBlock(); + boolean airBelow = blockBelow.isAir(stateBelow, event.getEntity().worldObj, entPos.down()); if(air && airBelow || !air && !airBelow) - event.entity.noClip = true; - event.entity.motionY = 0.2; - event.entity.motionX *= 1.4; - event.entity.motionZ *= 1.4; - event.entity.getEntityData().setInteger(TAG_FLOAT_TICKS, floatTicks - 1); - event.entity.worldObj.playAuxSFX(2000, x, y, z, 0); - } else event.entity.noClip = false; + event.getEntity().noClip = true; + event.getEntity().motionY = 0.2; + event.getEntity().motionX *= 1.4; + event.getEntity().motionZ *= 1.4; + event.getEntity().getEntityData().setInteger(TAG_FLOAT_TICKS, floatTicks - 1); + event.getEntity().worldObj.playEvent(2000, entPos, 0); + } else event.getEntity().noClip = false; } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.ghostRail; } + @Nonnull + @Override + public IProperty getShapeProperty() { + return BlockRailPowered.SHAPE; + } + + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerCustomItemblock(this, "ghost_rail"); + } } diff --git a/src/main/java/vazkii/botania/common/block/BlockHourglass.java b/src/main/java/vazkii/botania/common/block/BlockHourglass.java index 99c51a1d5..54c0b2d32 100644 --- a/src/main/java/vazkii/botania/common/block/BlockHourglass.java +++ b/src/main/java/vazkii/botania/common/block/BlockHourglass.java @@ -10,78 +10,111 @@ */ package vazkii.botania.common.block; -import java.util.Random; - -import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.renderer.block.statemap.StateMap; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.TextComponentTranslation; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.internal.IManaBurst; import vazkii.botania.api.internal.VanillaPacketDispatcher; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.mana.IManaTrigger; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.api.wand.IWandHUD; import vazkii.botania.api.wand.IWandable; -import vazkii.botania.client.lib.LibRenderIDs; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.block.tile.TileHourglass; import vazkii.botania.common.block.tile.TileSimpleInventory; +import vazkii.botania.common.core.helper.InventoryHelper; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -public class BlockHourglass extends BlockModContainer implements IManaTrigger, IWandable, IWandHUD, ILexiconable { +import javax.annotation.Nonnull; +import java.util.Random; - Random random; +public class BlockHourglass extends BlockMod implements IManaTrigger, IWandable, IWandHUD, ILexiconable { + + private static final AxisAlignedBB AABB = new AxisAlignedBB(0.25, 0, 0.25, 0.75, 1.15, 0.75); protected BlockHourglass() { - super(Material.iron); - setBlockName(LibBlockNames.HOURGLASS); + super(Material.IRON, LibBlockNames.HOURGLASS); setHardness(2.0F); - setStepSound(soundTypeMetal); + setSoundType(SoundType.METAL); + } - float f = 1F / 16F; - float w = 8F * f; - float d = (1F - w) / 2; - setBlockBounds(d, 0F, d, 1F - d, 1.15F, 1F - d); + @Nonnull + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { + return AABB; + } - random = new Random(); + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.POWERED); } @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float xs, float ys, float zs) { - TileHourglass hourglass = (TileHourglass) world.getTileEntity(x, y, z); - ItemStack hgStack = hourglass.getStackInSlot(0); - ItemStack stack = player.getCurrentEquippedItem(); + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.POWERED, false); + } + + @Override + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.POWERED) ? 1 : 0; + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + return getDefaultState().withProperty(BotaniaStateProps.POWERED, meta == 1); + } + + @Override + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing side, float xs, float ys, float zs) { + TileHourglass hourglass = (TileHourglass) world.getTileEntity(pos); + ItemStack hgStack = hourglass.getItemHandler().getStackInSlot(0); if(stack != null && stack.getItem() == ModItems.twigWand) return false; if(hourglass.lock) { if(!player.worldObj.isRemote) - player.addChatMessage(new ChatComponentTranslation("botaniamisc.hourglassLock")); + player.addChatMessage(new TextComponentTranslation("botaniamisc.hourglassLock")); return true; } if(hgStack == null && TileHourglass.getStackItemTime(stack) > 0) { - hourglass.setInventorySlotContents(0, stack.copy()); + hourglass.getItemHandler().setStackInSlot(0, stack.copy()); hourglass.markDirty(); stack.stackSize = 0; return true; } else if(hgStack != null) { ItemStack copy = hgStack.copy(); if(!player.inventory.addItemStackToInventory(copy)) - player.dropPlayerItemWithRandomChoice(copy, false); - hourglass.setInventorySlotContents(0, null); + player.dropItem(copy, false); + hourglass.getItemHandler().setStackInSlot(0, null); hourglass.markDirty(); return true; } @@ -90,13 +123,13 @@ public class BlockHourglass extends BlockModContainer implements IManaTrigger, I } @Override - public boolean canProvidePower() { + public boolean canProvidePower(IBlockState state) { return true; } @Override - public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int side) { - return world.getBlockMetadata(x, y, z) == 0 ? 0 : 15; + public int getWeakPower(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) { + return state.getValue(BotaniaStateProps.POWERED) ? 15 : 0; } @Override @@ -105,103 +138,81 @@ public class BlockHourglass extends BlockModContainer implements IManaTrigger, I } @Override - public void updateTick(World world, int x, int y, int z, Random rand) { - world.setBlockMetadataWithNotify(x, y, z, 0, 1 | 2); + public void updateTick(World world, BlockPos pos, IBlockState state, Random rand) { + if(state.getValue(BotaniaStateProps.POWERED)) + world.setBlockState(pos, state.withProperty(BotaniaStateProps.POWERED, false), 1 | 2); } @Override - public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { - TileSimpleInventory inv = (TileSimpleInventory) par1World.getTileEntity(par2, par3, par4); + public void breakBlock(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state) { + TileSimpleInventory inv = (TileSimpleInventory) world.getTileEntity(pos); - if (inv != null) { - for (int j1 = 0; j1 < inv.getSizeInventory(); ++j1) { - ItemStack itemstack = inv.getStackInSlot(j1); + InventoryHelper.dropInventory(inv, world, state, pos); - if (itemstack != null) { - float f = random.nextFloat() * 0.8F + 0.1F; - float f1 = random.nextFloat() * 0.8F + 0.1F; - EntityItem entityitem; - - for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) { - int k1 = random.nextInt(21) + 10; - - if (k1 > itemstack.stackSize) - k1 = itemstack.stackSize; - - itemstack.stackSize -= k1; - entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage())); - float f3 = 0.05F; - entityitem.motionX = (float)random.nextGaussian() * f3; - entityitem.motionY = (float)random.nextGaussian() * f3 + 0.2F; - entityitem.motionZ = (float)random.nextGaussian() * f3; - - if (itemstack.hasTagCompound()) - entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy()); - } - } - } - - par1World.func_147453_f(par2, par3, par4, par5); - } - - super.breakBlock(par1World, par2, par3, par4, par5, par6); + super.breakBlock(world, pos, state); } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - // NO-OP - } - - @Override - public IIcon getIcon(int p_149691_1_, int p_149691_2_) { - return ModBlocks.manaGlass.getIcon(0, 0); - } - - @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public boolean renderAsNormalBlock() { + public boolean isFullCube(IBlockState state) { return false; } + @Nonnull @Override - public int getRenderType() { - return LibRenderIDs.idHourglass; + public EnumBlockRenderType getRenderType(IBlockState state) { + return EnumBlockRenderType.ENTITYBLOCK_ANIMATED; } @Override - public TileEntity createNewTileEntity(World world, int meta) { + public boolean hasTileEntity(IBlockState state) { + return true; + } + + @Nonnull + @Override + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileHourglass(); } @Override - public void onBurstCollision(IManaBurst burst, World world, int x, int y, int z) { + public void onBurstCollision(IManaBurst burst, World world, BlockPos pos) { if(!world.isRemote && !burst.isFake()) { - TileHourglass tile = (TileHourglass) world.getTileEntity(x, y, z); + TileHourglass tile = (TileHourglass) world.getTileEntity(pos); tile.move = !tile.move; VanillaPacketDispatcher.dispatchTEToNearbyPlayers(tile); } } @Override - public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int side) { - TileHourglass tile = (TileHourglass) world.getTileEntity(x, y, z); + public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, BlockPos pos, EnumFacing side) { + TileHourglass tile = (TileHourglass) world.getTileEntity(pos); tile.lock = !tile.lock; return false; } + @SideOnly(Side.CLIENT) @Override - public void renderHUD(Minecraft mc, ScaledResolution res, World world, int x, int y, int z) { - TileHourglass tile = (TileHourglass) world.getTileEntity(x, y, z); + public void renderHUD(Minecraft mc, ScaledResolution res, World world, BlockPos pos) { + TileHourglass tile = (TileHourglass) world.getTileEntity(pos); tile.renderHUD(res); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.hourglass; } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelLoader.setCustomStateMapper(this, new StateMap.Builder().ignore(BotaniaStateProps.POWERED).build()); + ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(this), 0, TileHourglass.class); + ModelHandler.registerCustomItemblock(this, "hovering_hourglass"); + } + } diff --git a/src/main/java/vazkii/botania/common/block/BlockIncensePlate.java b/src/main/java/vazkii/botania/common/block/BlockIncensePlate.java index 1a44465f0..9554ff0fe 100644 --- a/src/main/java/vazkii/botania/common/block/BlockIncensePlate.java +++ b/src/main/java/vazkii/botania/common/block/BlockIncensePlate.java @@ -10,64 +10,90 @@ */ package vazkii.botania.common.block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.common.util.RotationHelper; import vazkii.botania.api.internal.VanillaPacketDispatcher; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.lib.LibRenderIDs; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.common.block.tile.TileIncensePlate; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -public class BlockIncensePlate extends BlockModContainer implements ILexiconable { +import javax.annotation.Nonnull; - private static final int[] META_ROTATIONS = new int[] { 2, 5, 3, 4 }; +public class BlockIncensePlate extends BlockMod implements ILexiconable { + + private static final AxisAlignedBB X_AABB = new AxisAlignedBB(0.375, 0, 0.125, 0.625, 1/16.0, 0.875); + private static final AxisAlignedBB Z_AABB = new AxisAlignedBB(0.125, 0, 0.375, 0.875, 1/16.0, 0.625); protected BlockIncensePlate() { - super(Material.wood); - setBlockName(LibBlockNames.INCENSE_PLATE); + super(Material.WOOD, LibBlockNames.INCENSE_PLATE); setHardness(2.0F); - setStepSound(soundTypeWood); - setBlockBounds(true); + setSoundType(SoundType.WOOD); + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.CARDINALS); } @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int s, float xs, float ys, float zs) { - TileIncensePlate plate = (TileIncensePlate) world.getTileEntity(x, y, z); - ItemStack stack = player.getCurrentEquippedItem(); - ItemStack plateStack = plate.getStackInSlot(0); + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.CARDINALS, EnumFacing.SOUTH); + } + + @Override + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.CARDINALS).getIndex(); + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + if (meta < 2 || meta > 5) { + meta = 2; + } + return getDefaultState().withProperty(BotaniaStateProps.CARDINALS, EnumFacing.getFront(meta)); + } + + @Override + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing s, float xs, float ys, float zs) { + TileIncensePlate plate = (TileIncensePlate) world.getTileEntity(pos); + ItemStack plateStack = plate.getItemHandler().getStackInSlot(0); boolean did = false; if(world.isRemote) return true; - if(plateStack == null && plate.isItemValidForSlot(0, stack)) { - plate.setInventorySlotContents(0, stack.copy()); + if(plateStack == null && plate.acceptsItem(stack)) { + plate.getItemHandler().setStackInSlot(0, stack.copy()); stack.stackSize--; did = true; } else if(plateStack != null && !plate.burning) { - if(stack != null && stack.getItem() == Items.flint_and_steel) { + if(stack != null && stack.getItem() == Items.FLINT_AND_STEEL) { plate.ignite(); stack.damageItem(1, player); did = true; } else { ItemStack addStack = plateStack.copy(); if(!player.inventory.addItemStackToInventory(addStack)) - player.dropPlayerItemWithRandomChoice(addStack, false); - plate.setInventorySlotContents(0, null); + player.dropItem(addStack, false); + plate.getItemHandler().setStackInSlot(0, null); did = true; } @@ -80,74 +106,53 @@ public class BlockIncensePlate extends BlockModContainer implements ILexiconable } @Override - public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) { - int l = MathHelper.floor_double(p_149689_5_.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; - p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, META_ROTATIONS[l], 2); + public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { + world.setBlockState(pos, state.withProperty(BotaniaStateProps.CARDINALS, placer.getHorizontalFacing().getOpposite())); } @Override - public boolean hasComparatorInputOverride() { + public boolean hasComparatorInputOverride(IBlockState state) { return true; } @Override - public int getComparatorInputOverride(World world, int x, int y, int z, int side) { - return ((TileIncensePlate) world.getTileEntity(x, y, z)).comparatorOutput; + public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) { + return ((TileIncensePlate) world.getTileEntity(pos)).comparatorOutput; + } + + @Nonnull + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { + if(state.getValue(BotaniaStateProps.CARDINALS).getAxis() == EnumFacing.Axis.X) { + return X_AABB; + } else { + return Z_AABB; + } } @Override - public void setBlockBoundsBasedOnState(IBlockAccess w, int x, int y, int z) { - setBlockBounds(w.getBlockMetadata(x, y, z) < 4); - } - - public void setBlockBounds(boolean horiz) { - float f = 1F / 16F; - float w = 12 * f; - float l = 4 * f; - float xs = (1F - w) / 2; - float zs = (1F - l) / 2; - if(horiz) - setBlockBounds(xs, 0F, zs, 1F - xs, f, 1f - zs); - else setBlockBounds(zs, 0F, xs, 1F - zs, f, 1f - xs); - } - - @Override - public boolean rotateBlock(World worldObj, int x, int y, int z, ForgeDirection axis) { - return RotationHelper.rotateVanillaBlock(Blocks.furnace, worldObj, x, y, z, axis); - } - - @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - // NO-OP - } - - @Override - public IIcon getIcon(int p_149691_1_, int p_149691_2_) { - return ModBlocks.livingwood.getIcon(0, 0); - } - - @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public boolean renderAsNormalBlock() { + public boolean isFullCube(IBlockState state) { return false; } @Override - public int getRenderType() { - return LibRenderIDs.idIncensePlate; + public boolean hasTileEntity(IBlockState state) { + return true; } + @Nonnull @Override - public TileEntity createNewTileEntity(World world, int meta) { + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileIncensePlate(); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.incense; } diff --git a/src/main/java/vazkii/botania/common/block/BlockLightLauncher.java b/src/main/java/vazkii/botania/common/block/BlockLightLauncher.java index dc0d407fa..4496392fc 100644 --- a/src/main/java/vazkii/botania/common/block/BlockLightLauncher.java +++ b/src/main/java/vazkii/botania/common/block/BlockLightLauncher.java @@ -10,70 +10,102 @@ */ package vazkii.botania.common.block; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.common.block.tile.TileLightRelay; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -import vazkii.botania.common.lib.LibMisc; + +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.List; public class BlockLightLauncher extends BlockMod implements ILexiconable { + private static final AxisAlignedBB AABB = new AxisAlignedBB(0, 0, 0, 1, 0.25, 1); + public BlockLightLauncher() { - super(Material.wood); + super(Material.WOOD, LibBlockNames.LIGHT_LAUNCHER); setHardness(2.0F); - setStepSound(soundTypeWood); - setBlockName(LibBlockNames.LIGHT_LAUNCHER); - setBlockBounds(0F, 0F, 0F, 1F, 0.25F, 1F); + setSoundType(SoundType.WOOD); + } + + @Nonnull + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { + return AABB; + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.POWERED); } @Override - public boolean isOpaqueCube() { + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.POWERED, false); + } + + @Override + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.POWERED) ? 8 : 0; + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + return getDefaultState().withProperty(BotaniaStateProps.POWERED, meta == 8); + } + + @Override + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public boolean renderAsNormalBlock() { + public boolean isFullCube(IBlockState state) { return false; } @Override - public boolean getBlocksMovement(IBlockAccess p_149655_1_, int p_149655_2_, int p_149655_3_, int p_149655_4_) { + public boolean isPassable(IBlockAccess world, BlockPos pos) { return false; } @Override - public void onNeighborBlockChange(World world, int x, int y, int z, Block block) { - boolean power = world.isBlockIndirectlyGettingPowered(x, y, z) || world.isBlockIndirectlyGettingPowered(x, y + 1, z); - int meta = world.getBlockMetadata(x, y, z); - boolean powered = (meta & 8) != 0; + public void neighborChanged(IBlockState state, World world, BlockPos pos, Block block) { + boolean power = world.isBlockIndirectlyGettingPowered(pos) > 0|| world.isBlockIndirectlyGettingPowered(pos.up()) > 0; + boolean powered = state.getValue(BotaniaStateProps.POWERED); if(power && !powered) { - pickUpEntities(world, x, y, z); - world.setBlockMetadataWithNotify(x, y, z, meta | 8, 4); + pickUpEntities(world, pos); + world.setBlockState(pos, state.withProperty(BotaniaStateProps.POWERED, true), 4); } else if(!power && powered) - world.setBlockMetadataWithNotify(x, y, z, meta & -9, 4); + world.setBlockState(pos, state.withProperty(BotaniaStateProps.POWERED, false), 4); } - public void pickUpEntities(World world, int x, int y, int z) { - List relays = new ArrayList(); - for(ForgeDirection dir : LibMisc.CARDINAL_DIRECTIONS) { - TileEntity tile = world.getTileEntity(x + dir.offsetX, y, z + dir.offsetZ); + private void pickUpEntities(World world, BlockPos pos) { + List relays = new ArrayList<>(); + for(EnumFacing dir : EnumFacing.HORIZONTALS) { + TileEntity tile = world.getTileEntity(pos.offset(dir)); if(tile instanceof TileLightRelay) { TileLightRelay relay = (TileLightRelay) tile; if(relay.getBinding() != null) @@ -82,7 +114,7 @@ public class BlockLightLauncher extends BlockMod implements ILexiconable { } if(!relays.isEmpty()) { - AxisAlignedBB aabb = AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1); + AxisAlignedBB aabb = new AxisAlignedBB(pos, pos.add(1, 1, 1)); List entities = world.getEntitiesWithinAABB(EntityLivingBase.class, aabb); entities.addAll(world.getEntitiesWithinAABB(EntityItem.class, aabb)); @@ -96,7 +128,7 @@ public class BlockLightLauncher extends BlockMod implements ILexiconable { } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.luminizerTransport; } diff --git a/src/main/java/vazkii/botania/common/block/BlockLightRelay.java b/src/main/java/vazkii/botania/common/block/BlockLightRelay.java index 04e0d77c2..eb41acdb9 100644 --- a/src/main/java/vazkii/botania/common/block/BlockLightRelay.java +++ b/src/main/java/vazkii/botania/common/block/BlockLightRelay.java @@ -10,147 +10,180 @@ */ package vazkii.botania.common.block; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.LuminizerVariant; import vazkii.botania.api.wand.IWandable; -import vazkii.botania.client.core.helper.IconHelper; -import vazkii.botania.client.lib.LibRenderIDs; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.block.tile.TileLightRelay; import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.registry.GameRegistry; -public class BlockLightRelay extends BlockModContainer implements IWandable, ILexiconable { +import javax.annotation.Nonnull; +import java.util.List; +import java.util.Random; - public static IIcon invIcon, worldIcon, invIconRed, worldIconRed; +public class BlockLightRelay extends BlockMod implements IWandable, ILexiconable { + + private static final AxisAlignedBB AABB = new AxisAlignedBB(5.0/16, 5.0/16, 5.0/16, 11.0/16, 11.0/16, 11.0/16); protected BlockLightRelay() { - super(Material.glass); - float f = 5F / 16F; - setBlockBounds(f, f, f, 1F - f, 1F - f, 1F - f); - setBlockName(LibBlockNames.LIGHT_RELAY); + super(Material.GLASS, LibBlockNames.LIGHT_RELAY); + } + + @Nonnull + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { + return AABB; + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.LUMINIZER_VARIANT, BotaniaStateProps.POWERED); } @Override - public Block setBlockName(String par1Str) { - register(par1Str); - return super.setBlockName(par1Str); - } - - void register(String name) { - GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, name); + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.LUMINIZER_VARIANT, LuminizerVariant.DEFAULT).withProperty(BotaniaStateProps.POWERED, false); } @Override - public void getSubBlocks(Item item, CreativeTabs tab, List list) { + public int getMetaFromState(IBlockState state) { + int meta = state.getValue(BotaniaStateProps.LUMINIZER_VARIANT) == LuminizerVariant.DETECTOR ? 1 : 0; + if (state.getValue(BotaniaStateProps.POWERED)) { + meta |= 8; + } else { + meta &= -9; + } + return meta; + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + boolean powered = (meta & 8) != 0; + meta &= -9; + return getDefaultState().withProperty(BotaniaStateProps.POWERED, powered).withProperty(BotaniaStateProps.LUMINIZER_VARIANT, meta == 1 ? LuminizerVariant.DETECTOR : LuminizerVariant.DEFAULT); + } + + @Override + public void registerItemForm() { + GameRegistry.register(new ItemBlockWithMetadataAndName(this), getRegistryName()); + } + + @SideOnly(Side.CLIENT) + @Override + public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List list) { for(int i = 0; i < 2; i++) list.add(new ItemStack(item, 1, i)); } @Override - public int damageDropped(int meta) { - return meta == 0 ? 0 : 1; + public int damageDropped(IBlockState state) { + return state.getValue(BotaniaStateProps.LUMINIZER_VARIANT) == LuminizerVariant.DEFAULT ? 0 : 1; } @Override - protected boolean shouldRegisterInNameSet() { + public boolean isPassable(IBlockAccess world, BlockPos pos) { return false; } @Override - public boolean getBlocksMovement(IBlockAccess p_149655_1_, int p_149655_2_, int p_149655_3_, int p_149655_4_) { - return false; - } - - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int s, float xs, float ys, float zs) { - ((TileLightRelay) world.getTileEntity(x, y, z)).mountEntity(player); + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing s, float xs, float ys, float zs) { + ((TileLightRelay) world.getTileEntity(pos)).mountEntity(player); return true; } @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { + public AxisAlignedBB getCollisionBoundingBox(IBlockState state, @Nonnull World world, @Nonnull BlockPos pos) { return null; } @Override - public int tickRate(World p_149738_1_) { + public int tickRate(World world) { return 2; } @Override - public void updateTick(World world, int x, int y, int z, Random rand) { - world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z) & -9, 1 | 2); + public void updateTick(World world, BlockPos pos, IBlockState state, Random rand) { + world.setBlockState(pos, state.withProperty(BotaniaStateProps.POWERED, false), 1 | 2); } @Override - public boolean canProvidePower() { + public boolean canProvidePower(IBlockState state) { return true; } @Override - public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int s) { - int meta = world.getBlockMetadata(x, y, z); - return (meta & 8) != 0 ? 15 : 0; + public int getWeakPower(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing s) { + return state.getValue(BotaniaStateProps.LUMINIZER_VARIANT) == LuminizerVariant.DETECTOR + && state.getValue(BotaniaStateProps.POWERED) ? 15 : 0; } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - invIcon = IconHelper.forBlock(par1IconRegister, this, 0); - worldIcon = IconHelper.forBlock(par1IconRegister, this, 1); - invIconRed = IconHelper.forBlock(par1IconRegister, this, 2); - worldIconRed = IconHelper.forBlock(par1IconRegister, this, 3); - } - - @Override - public IIcon getIcon(int side, int meta) { - return meta > 0 ? invIconRed : invIcon; - } - - @Override - public boolean renderAsNormalBlock() { + public boolean isFullCube(IBlockState state) { return false; } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } + @Nonnull @Override - public int getRenderType() { - return LibRenderIDs.idLightRelay; + public EnumBlockRenderType getRenderType(IBlockState state) { + return EnumBlockRenderType.ENTITYBLOCK_ANIMATED; } @Override - public TileEntity createNewTileEntity(World world, int meta) { + public boolean hasTileEntity(IBlockState state) { + return true; + } + + @Nonnull + @Override + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileLightRelay(); } @Override - public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int side) { + public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, BlockPos pos, EnumFacing side) { return false; } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.luminizerTransport; } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + int i = 0; + for(LuminizerVariant v : LuminizerVariant.values()) + ModelHandler.registerBlockToState(this, i++, getDefaultState().withProperty(BotaniaStateProps.LUMINIZER_VARIANT, v)); + } + } diff --git a/src/main/java/vazkii/botania/common/block/BlockLivingrock.java b/src/main/java/vazkii/botania/common/block/BlockLivingrock.java index e0b6e8621..ba4efbef5 100644 --- a/src/main/java/vazkii/botania/common/block/BlockLivingrock.java +++ b/src/main/java/vazkii/botania/common/block/BlockLivingrock.java @@ -10,83 +10,99 @@ */ package vazkii.botania.common.block; -import java.util.List; - -import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.core.helper.IconHelper; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.LivingRockVariant; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.registry.GameRegistry; + +import javax.annotation.Nonnull; +import java.util.List; public class BlockLivingrock extends BlockMod implements ILexiconable { - private static final int TYPES = 5; - IIcon[] icons; - public BlockLivingrock() { - super(Material.rock); + super(Material.ROCK, LibBlockNames.LIVING_ROCK); setHardness(2.0F); setResistance(10.0F); - setStepSound(soundTypeStone); - setBlockName(LibBlockNames.LIVING_ROCK); + setSoundType(SoundType.STONE); + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.LIVINGROCK_VARIANT); } @Override - protected boolean shouldRegisterInNameSet() { - return false; + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.LIVINGROCK_VARIANT, LivingRockVariant.DEFAULT); } @Override - public int damageDropped(int par1) { - return par1; + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.LIVINGROCK_VARIANT).ordinal(); + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + if (meta >= LivingRockVariant.values().length) { + meta = 0; + } + return getDefaultState().withProperty(BotaniaStateProps.LIVINGROCK_VARIANT, LivingRockVariant.values()[meta]); } @Override - public Block setBlockName(String par1Str) { - GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, par1Str); - return super.setBlockName(par1Str); + public int damageDropped(IBlockState state) { + return getMetaFromState(state); } @Override - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for(int i = 0; i < TYPES; i++) - par3List.add(new ItemStack(par1, 1, i)); + public void registerItemForm() { + GameRegistry.register(new ItemBlockWithMetadataAndName(this), getRegistryName()); + } + + @SideOnly(Side.CLIENT) + @Override + public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List stacks) { + for(int i = 0; i < LivingRockVariant.values().length; i++) + stacks.add(new ItemStack(item, 1, i)); + } + + @Nonnull + @Override + public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player) { + return new ItemStack(this, 1, getMetaFromState(state)); } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - icons = new IIcon[TYPES]; - for(int i = 0; i < TYPES; i++) - icons[i] = IconHelper.forBlock(par1IconRegister, this, i); + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { + boolean isDefaultVariant = world.getBlockState(pos).getValue(BotaniaStateProps.LIVINGROCK_VARIANT) == LivingRockVariant.DEFAULT; + return isDefaultVariant ? LexiconData.pureDaisy : LexiconData.decorativeBlocks; } + @SideOnly(Side.CLIENT) @Override - public IIcon getIcon(int par1, int par2) { - return icons[Math.min(TYPES - 1, par2)]; - } - - @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) { - int meta = world.getBlockMetadata(x, y, z); - return new ItemStack(this, 1, meta); - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { - int meta = world.getBlockMetadata(x, y, z); - return meta == 0 ? LexiconData.pureDaisy : LexiconData.decorativeBlocks; + public void registerModels() { + ModelHandler.registerBlockToState(this, LivingRockVariant.values().length); } } diff --git a/src/main/java/vazkii/botania/common/block/BlockLivingwood.java b/src/main/java/vazkii/botania/common/block/BlockLivingwood.java index a9571b675..5177ca109 100644 --- a/src/main/java/vazkii/botania/common/block/BlockLivingwood.java +++ b/src/main/java/vazkii/botania/common/block/BlockLivingwood.java @@ -10,101 +10,115 @@ */ package vazkii.botania.common.block; -import java.util.List; - -import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.core.helper.IconHelper; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.LivingWoodVariant; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.registry.GameRegistry; + +import javax.annotation.Nonnull; +import java.util.List; public class BlockLivingwood extends BlockMod implements ILexiconable { - private static final int TYPES = 6; - IIcon[] icons; - public BlockLivingwood() { this(LibBlockNames.LIVING_WOOD); } public BlockLivingwood(String name) { - super(Material.wood); + super(Material.WOOD, name); setHardness(2.0F); - setStepSound(soundTypeWood); - setBlockName(name); + setSoundType(SoundType.WOOD); + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.LIVINGWOOD_VARIANT); } @Override - protected boolean shouldRegisterInNameSet() { - return false; + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.LIVINGWOOD_VARIANT, LivingWoodVariant.DEFAULT); } @Override - public int damageDropped(int par1) { - return par1; + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.LIVINGWOOD_VARIANT).ordinal(); + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + if (meta >= LivingWoodVariant.values().length) { + meta = 0; + } + return getDefaultState().withProperty(BotaniaStateProps.LIVINGWOOD_VARIANT, LivingWoodVariant.values()[meta]); } @Override - public Block setBlockName(String par1Str) { - register(par1Str); - return super.setBlockName(par1Str); - } - - void register(String name) { - GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, name); + public int damageDropped(IBlockState state) { + return getMetaFromState(state); } @Override - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for(int i = 0; i < TYPES; i++) - par3List.add(new ItemStack(par1, 1, i)); + public void registerItemForm() { + GameRegistry.register(new ItemBlockWithMetadataAndName(this), getRegistryName()); + } + + @SideOnly(Side.CLIENT) + @Override + public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List stacks) { + for(int i = 0; i < LivingWoodVariant.values().length; i++) + stacks.add(new ItemStack(item, 1, i)); + } + + @Nonnull + @Override + public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player) { + return new ItemStack(this, 1, getMetaFromState(state)); } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - icons = new IIcon[TYPES]; - for(int i = 0; i < TYPES; i++) - icons[i] = IconHelper.forBlock(par1IconRegister, this, i); + public int getLightValue(@Nonnull IBlockState state, IBlockAccess world, @Nonnull BlockPos pos) { + if(world.getBlockState(pos).getBlock() != this) + return world.getBlockState(pos).getLightValue(world, pos); + return state.getValue(BotaniaStateProps.LIVINGWOOD_VARIANT) == LivingWoodVariant.GLIMMERING ? 12 : 0; } @Override - public IIcon getIcon(int par1, int par2) { - return icons[Math.min(TYPES - 1, par2)]; + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { + boolean defaultVariant = world.getBlockState(pos).getValue(BotaniaStateProps.LIVINGWOOD_VARIANT) == LivingWoodVariant.DEFAULT; + return defaultVariant ? LexiconData.pureDaisy : LexiconData.decorativeBlocks; } @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) { - int meta = world.getBlockMetadata(x, y, z); - return new ItemStack(this, 1, meta); + public boolean canSustainLeaves(IBlockState state, IBlockAccess world, BlockPos pos) { + return state.getValue(BotaniaStateProps.LIVINGWOOD_VARIANT) == LivingWoodVariant.DEFAULT; } + @SideOnly(Side.CLIENT) @Override - public int getLightValue(IBlockAccess world, int x, int y, int z) { - return world.getBlockMetadata(x, y, z) == 5 ? 12 : 0; - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { - int meta = world.getBlockMetadata(x, y, z); - return meta == 0 ? LexiconData.pureDaisy : LexiconData.decorativeBlocks; - } - - @Override - public boolean canSustainLeaves(IBlockAccess world, int x, int y, int z) { - return world.getBlockMetadata(x, y, z) == 0; + public void registerModels() { + ModelHandler.registerBlockToState(this, LivingWoodVariant.values().length); } } diff --git a/src/main/java/vazkii/botania/common/block/BlockManaBomb.java b/src/main/java/vazkii/botania/common/block/BlockManaBomb.java index 5154cd727..d0e0bdebe 100644 --- a/src/main/java/vazkii/botania/common/block/BlockManaBomb.java +++ b/src/main/java/vazkii/botania/common/block/BlockManaBomb.java @@ -10,11 +10,14 @@ */ package vazkii.botania.common.block; +import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.stats.Achievement; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import vazkii.botania.api.internal.IManaBurst; import vazkii.botania.api.lexicon.ILexiconable; @@ -29,25 +32,24 @@ import vazkii.botania.common.lib.LibBlockNames; public class BlockManaBomb extends BlockMod implements IManaTrigger, ILexiconable, ICraftAchievement { public BlockManaBomb() { - super(Material.wood); + super(Material.WOOD, LibBlockNames.MANA_BOMB); setHardness(12.0F); - setStepSound(soundTypeWood); - setBlockName(LibBlockNames.MANA_BOMB); + setSoundType(SoundType.WOOD); } @Override - public void onBurstCollision(IManaBurst burst, World world, int x, int y, int z) { + public void onBurstCollision(IManaBurst burst, World world, BlockPos pos) { if(!burst.isFake() && !world.isRemote) { - world.playAuxSFX(2001, x, y, z, getIdFromBlock(this)); - world.setBlockToAir(x, y, z); + world.playEvent(2001, pos, Block.getStateId(this.getDefaultState())); + world.setBlockToAir(pos); EntityManaStorm storm = new EntityManaStorm(world); - storm.setPosition(x + 0.5, y + 0.5, z + 0.5); + storm.setPosition(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5); world.spawnEntityInWorld(storm); } } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.manaBomb; } diff --git a/src/main/java/vazkii/botania/common/block/BlockMod.java b/src/main/java/vazkii/botania/common/block/BlockMod.java index e797d0c8f..905800fa7 100644 --- a/src/main/java/vazkii/botania/common/block/BlockMod.java +++ b/src/main/java/vazkii/botania/common/block/BlockMod.java @@ -12,52 +12,49 @@ package vazkii.botania.common.block; import net.minecraft.block.Block; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.IBlockState; +import net.minecraft.item.Item; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.recipe.IElvenItem; -import vazkii.botania.client.core.helper.IconHelper; +import vazkii.botania.client.core.handler.ModelHandler; +import vazkii.botania.client.render.IModelRegister; import vazkii.botania.common.core.BotaniaCreativeTab; import vazkii.botania.common.item.block.ItemBlockElven; import vazkii.botania.common.item.block.ItemBlockMod; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import vazkii.botania.common.lib.LibMisc; -public class BlockMod extends Block { +public abstract class BlockMod extends Block implements IModelRegister { - public int originalLight; - - public BlockMod(Material par2Material) { + public BlockMod(Material par2Material, String name) { super(par2Material); + setUnlocalizedName(name); + setDefaultState(pickDefaultState()); // This MUST happen before registering the block + setRegistryName(new ResourceLocation(LibMisc.MOD_ID, name)); + GameRegistry.register(this); + registerItemForm(); if(registerInCreative()) setCreativeTab(BotaniaCreativeTab.INSTANCE); } - @Override - public Block setBlockName(String par1Str) { - if(shouldRegisterInNameSet()) - GameRegistry.registerBlock(this, this instanceof IElvenItem ? ItemBlockElven.class : ItemBlockMod.class, par1Str); - return super.setBlockName(par1Str); + protected IBlockState pickDefaultState() { + return blockState.getBaseState(); } - protected boolean shouldRegisterInNameSet() { + public void registerItemForm() { + GameRegistry.register(this instanceof IElvenItem ? new ItemBlockElven(this) : new ItemBlockMod(this), getRegistryName()); + } + + protected boolean registerInCreative() { return true; } - @Override - public Block setLightLevel(float p_149715_1_) { - originalLight = (int) (p_149715_1_ * 15); - return super.setLightLevel(p_149715_1_); - } - - @Override @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - blockIcon = IconHelper.forBlock(par1IconRegister, this); + @Override + public void registerModels() { + if(Item.getItemFromBlock(this) != null) + ModelHandler.registerBlockToState(this, 0, getDefaultState()); } - - boolean registerInCreative() { - return true; - } - - } diff --git a/src/main/java/vazkii/botania/common/block/BlockModContainer.java b/src/main/java/vazkii/botania/common/block/BlockModContainer.java deleted file mode 100644 index d1ff8357e..000000000 --- a/src/main/java/vazkii/botania/common/block/BlockModContainer.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 14, 2014, 5:32:55 PM (GMT)] - */ -package vazkii.botania.common.block; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import vazkii.botania.client.core.helper.IconHelper; -import vazkii.botania.common.core.BotaniaCreativeTab; -import vazkii.botania.common.item.block.ItemBlockMod; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public abstract class BlockModContainer extends BlockContainer { - - public int originalLight; - - protected BlockModContainer(Material par2Material) { - super(par2Material); - if(registerInCreative()) - setCreativeTab(BotaniaCreativeTab.INSTANCE); - } - - @Override - public Block setBlockName(String par1Str) { - if(shouldRegisterInNameSet()) - GameRegistry.registerBlock(this, ItemBlockMod.class, par1Str); - return super.setBlockName(par1Str); - } - - protected boolean shouldRegisterInNameSet() { - return true; - } - - @Override - public Block setLightLevel(float p_149715_1_) { - originalLight = (int) (p_149715_1_ * 15); - return super.setLightLevel(p_149715_1_); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - blockIcon = IconHelper.forBlock(par1IconRegister, this); - } - - public boolean registerInCreative() { - return true; - } - - @Override - public abstract T createNewTileEntity(World world, int meta); - -} \ No newline at end of file diff --git a/src/main/java/vazkii/botania/common/block/BlockModDoubleFlower.java b/src/main/java/vazkii/botania/common/block/BlockModDoubleFlower.java index bdbe1ae81..7338dd666 100644 --- a/src/main/java/vazkii/botania/common/block/BlockModDoubleFlower.java +++ b/src/main/java/vazkii/botania/common/block/BlockModDoubleFlower.java @@ -10,233 +10,225 @@ */ package vazkii.botania.common.block; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - +import com.google.common.collect.ImmutableList; import net.minecraft.block.Block; import net.minecraft.block.BlockDoublePlant; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.SoundType; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.block.statemap.StateMap; import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.enchantment.EnchantmentHelper; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.passive.EntitySheep; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; -import net.minecraft.init.Items; +import net.minecraft.item.EnumDyeColor; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.stats.StatList; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import net.minecraftforge.event.ForgeEventFactory; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.core.helper.IconHelper; -import vazkii.botania.client.lib.LibRenderIDs; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.client.render.IModelRegister; import vazkii.botania.common.Botania; import vazkii.botania.common.core.BotaniaCreativeTab; import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import vazkii.botania.common.lib.LibMisc; -public class BlockModDoubleFlower extends BlockDoublePlant implements ILexiconable { +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; +public abstract class BlockModDoubleFlower extends BlockDoublePlant implements ILexiconable, IModelRegister { private static final int COUNT = 8; - IIcon[] doublePlantTopIcons, doublePlantBottomIcons; - IIcon[] doublePlantTopIconsAlt, doublePlantBottomIconsAlt; - - final int offset; + private final boolean second; public BlockModDoubleFlower(boolean second) { - offset = second ? 8 : 0; - setBlockName(LibBlockNames.DOUBLE_FLOWER + (second ? 2 : 1)); + this.second = second; + this.setHardness(0.0F); + this.setSoundType(SoundType.PLANT); + String name = LibBlockNames.DOUBLE_FLOWER + (second ? 2 : 1); + setDefaultState(pickDefaultState()); + setRegistryName(new ResourceLocation(LibMisc.MOD_ID, name)); + GameRegistry.register(this); + GameRegistry.register(new ItemBlockWithMetadataAndName(this), getRegistryName()); + setUnlocalizedName(name); setHardness(0F); - setStepSound(soundTypeGrass); setTickRandomly(false); setCreativeTab(BotaniaCreativeTab.INSTANCE); } + @Nonnull @Override - public Block setBlockName(String par1Str) { - if(!par1Str.equals("doublePlant")) - GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, par1Str); - return super.setBlockName(par1Str); - } + public abstract BlockStateContainer createBlockState(); + + protected abstract IBlockState pickDefaultState(); @Override - public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + public abstract int getMetaFromState(IBlockState state); + + @Nonnull + @Override + public abstract IBlockState getStateFromMeta(int meta); + + @Override + public Item getItemDropped(IBlockState state, @Nonnull Random rand, int fortune) { return null; } @Override - public int damageDropped(int p_149692_1_) { - return p_149692_1_ & 7; + public int damageDropped(IBlockState state) { + return 0; } @Override - @SideOnly(Side.CLIENT) - public IIcon func_149888_a(boolean top, int index) { - return (ConfigHandler.altFlowerTextures ? top ? doublePlantTopIconsAlt : doublePlantBottomIconsAlt : top ? doublePlantTopIcons : doublePlantBottomIcons)[index & 7]; - } - - @Override - public void func_149889_c(World p_149889_1_, int p_149889_2_, int p_149889_3_, int p_149889_4_, int p_149889_5_, int p_149889_6_) { - p_149889_1_.setBlock(p_149889_2_, p_149889_3_, p_149889_4_, this, p_149889_5_, p_149889_6_); - p_149889_1_.setBlock(p_149889_2_, p_149889_3_ + 1, p_149889_4_, this, p_149889_5_ | 8, p_149889_6_); - } - - @Override - public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) { - p_149689_1_.setBlock(p_149689_2_, p_149689_3_ + 1, p_149689_4_, this, p_149689_6_.getItemDamage() | 8, 2); - } - - @Override - public boolean func_149851_a(World world, int x, int y, int z, boolean fuckifiknow) { + public boolean canGrow(@Nonnull World world, @Nonnull BlockPos pos, IBlockState state, boolean fuckifiknow) { return false; } @Override - public void harvestBlock(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_) { - if(p_149636_1_.isRemote || p_149636_2_.getCurrentEquippedItem() == null || p_149636_2_.getCurrentEquippedItem().getItem() != Items.shears || func_149887_c(p_149636_6_)) - harvestBlockCopy(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_); - } - - // This is how I get around encapsulation - public void harvestBlockCopy(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_) { - p_149636_2_.addStat(StatList.mineBlockStatArray[getIdFromBlock(this)], 1); - p_149636_2_.addExhaustion(0.025F); - - if(this.canSilkHarvest(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_) && EnchantmentHelper.getSilkTouchModifier(p_149636_2_)) { - ArrayList items = new ArrayList(); - ItemStack itemstack = createStackedBlock(p_149636_6_); - - if(itemstack != null) - items.add(itemstack); - - ForgeEventFactory.fireBlockHarvesting(items, p_149636_1_, this, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_, 0, 1.0f, true, p_149636_2_); - for(ItemStack is : items) - this.dropBlockAsItem(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, is); - } else { - harvesters.set(p_149636_2_); - int i1 = EnchantmentHelper.getFortuneModifier(p_149636_2_); - this.dropBlockAsItem(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_, i1); - harvesters.set(null); - } + public boolean canHarvestBlock(IBlockAccess world, @Nonnull BlockPos pos, @Nonnull EntityPlayer player) { + return false; } @Override - public void onBlockHarvested(World p_149681_1_, int p_149681_2_, int p_149681_3_, int p_149681_4_, int p_149681_5_, EntityPlayer p_149681_6_) { - if(func_149887_c(p_149681_5_)) { - if(p_149681_1_.getBlock(p_149681_2_, p_149681_3_ - 1, p_149681_4_) == this) { - if(!p_149681_6_.capabilities.isCreativeMode) { - int i1 = p_149681_1_.getBlockMetadata(p_149681_2_, p_149681_3_ - 1, p_149681_4_); - int j1 = func_149890_d(i1); - - if(j1 != 3 && j1 != 2); - //p_149681_1_.func_147480_a(p_149681_2_, p_149681_3_ - 1, p_149681_4_, true); - else { - /*if (!p_149681_1_.isRemote && p_149681_6_.getCurrentEquippedItem() != null && p_149681_6_.getCurrentEquippedItem().getItem() == Items.shears) - { - this.func_149886_b(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_, i1, p_149681_6_); - }*/ - - p_149681_1_.setBlockToAir(p_149681_2_, p_149681_3_ - 1, p_149681_4_); - } - } else p_149681_1_.setBlockToAir(p_149681_2_, p_149681_3_ - 1, p_149681_4_); - } - } else if(p_149681_6_.capabilities.isCreativeMode && p_149681_1_.getBlock(p_149681_2_, p_149681_3_ + 1, p_149681_4_) == this) - p_149681_1_.setBlock(p_149681_2_, p_149681_3_ + 1, p_149681_4_, Blocks.air, 0, 2); - - //super.onBlockHarvested(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, p_149681_6_); - } - - @Override - public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z) { + public boolean canUseBonemeal(World worldIn, Random rand, BlockPos pos, IBlockState state) { return true; } @Override - public ArrayList onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune) { - ArrayList ret = new ArrayList(); - ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z) & 7)); + public void onBlockHarvested(World world, BlockPos pos, IBlockState state, @Nonnull EntityPlayer player) { + if(state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER) { + if(world.getBlockState(pos.down()).getBlock() == this) { + if (!player.capabilities.isCreativeMode) { + // IBlockState iblockstate = worldIn.getBlockState(pos.down()); + // BlockDoublePlant.EnumPlantType blockdoubleplant$enumplanttype = (BlockDoublePlant.EnumPlantType) iblockstate.getValue(VARIANT); + + //if (blockdoubleplant$enumplanttype != BlockDoublePlant.EnumPlantType.FERN && blockdoubleplant$enumplanttype != BlockDoublePlant.EnumPlantType.GRASS) { + // worldIn.destroyBlock(pos.down(), true); + //} else if (!world.isRemote) { + // if (player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.SHEARS) { + // this.onHarvest(worldIn, pos, iblockstate, player); + // world.setBlockToAir(pos.down()); + // } else { + // world.destroyBlock(pos.down(), true); + // } + //} else { + world.setBlockToAir(pos.down()); + //} + } else { + world.setBlockToAir(pos.down()); + } + } + } else if(player.capabilities.isCreativeMode && world.getBlockState(pos.up()).getBlock() == this) + world.setBlockState(pos.up(), Blocks.AIR.getDefaultState(), 2); + player.addStat(StatList.getBlockStats(this)); + //super.onBlockHarvested(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, p_149681_6_); + } + + @Override + public boolean isShearable(ItemStack item, IBlockAccess world, @Nonnull BlockPos pos) { + return true; + } + + @Nonnull + @Override + public List onSheared(ItemStack item, IBlockAccess world, @Nonnull BlockPos pos, int fortune) { + ArrayList ret = new ArrayList<>(); + IBlockState state = world.getBlockState(pos); + IBlockState stateBelow = world.getBlockState(pos.down()); + + if (stateBelow.getBlock() == this && stateBelow.getValue(HALF) == EnumBlockHalf.LOWER && state.getValue(HALF) == EnumBlockHalf.UPPER) { + ret.add(new ItemStack(this, 1, getMetaFromState(world.getBlockState(pos.down())))); + } + + if (state.getValue(HALF) == EnumBlockHalf.LOWER) { + ret.add(new ItemStack(this, 1, getMetaFromState(state))); + } + return ret; } + @Nonnull @Override - public ArrayList getDrops(World world, int x, int y, int z, int meta, int fortune) { - return new ArrayList(); + public List getDrops(IBlockAccess world, BlockPos pos, @Nonnull IBlockState state, int fortune) { + return ImmutableList.of(); } @Override - public IIcon getIcon(int p_149691_1_, int p_149691_2_) { - boolean top = func_149887_c(p_149691_2_); - return (ConfigHandler.altFlowerTextures ? top ? doublePlantTopIconsAlt : doublePlantBottomIconsAlt : top ? doublePlantTopIcons : doublePlantBottomIcons)[p_149691_2_ & 7]; - } - - @Override - public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { - int meta = world.getBlockMetadata(x, y, z); - boolean top = func_149887_c(meta); - if(top) - meta = world.getBlockMetadata(x, y - 1, z); - - return (ConfigHandler.altFlowerTextures ? top ? doublePlantBottomIconsAlt : doublePlantTopIconsAlt : top ? doublePlantBottomIcons : doublePlantTopIcons)[meta & 7]; - } - - @Override - public void registerBlockIcons(IIconRegister register) { - doublePlantTopIcons = new IIcon[COUNT]; - doublePlantBottomIcons = new IIcon[COUNT]; - doublePlantTopIconsAlt = new IIcon[COUNT]; - doublePlantBottomIconsAlt = new IIcon[COUNT]; - for(int i = 0; i < COUNT; i++) { - int off = offset(i); - doublePlantTopIcons[i] = IconHelper.forName(register, "flower" + off + "Tall0"); - doublePlantBottomIcons[i] = IconHelper.forName(register, "flower" + off + "Tall1"); - doublePlantTopIconsAlt[i] = IconHelper.forName(register, "flower" + off + "Tall0", BlockModFlower.ALT_DIR); - doublePlantBottomIconsAlt[i] = IconHelper.forName(register, "flower" + off + "Tall1", BlockModFlower.ALT_DIR); - } - } - - @Override - public int colorMultiplier(IBlockAccess blockAccess, int x, int y, int z) { - return 16777215; - } - - @Override - public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) { + public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, @Nonnull List stacks) { for(int i = 0; i < COUNT; ++i) - p_149666_3_.add(new ItemStack(p_149666_1_, 1, i)); + stacks.add(new ItemStack(item, 1, i)); + } + + @Nonnull + @Override + @SideOnly(Side.CLIENT) + public Block.EnumOffsetType getOffsetType() + { + return Block.EnumOffsetType.NONE; } @Override - public int getRenderType() { - return LibRenderIDs.idDoubleFlower; + @SideOnly(Side.CLIENT) + public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) { + state = getActualState(state, world, pos); + int hex = state.getValue(second ? BotaniaStateProps.DOUBLEFLOWER_VARIANT_2 : BotaniaStateProps.DOUBLEFLOWER_VARIANT_1).getMapColor().colorValue; + int r = (hex & 0xFF0000) >> 16; + int g = (hex & 0xFF00) >> 8; + int b = (hex & 0xFF); + + if(rand.nextDouble() < ConfigHandler.flowerParticleFrequency) + Botania.proxy.sparkleFX(pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.5 + rand.nextFloat() * 0.5, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5); + } @Override - public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { - int meta = par1World.getBlockMetadata(par2, par3, par4); - float[] color = EntitySheep.fleeceColorTable[offset(meta & 7)]; - - if(par5Random.nextDouble() < ConfigHandler.flowerParticleFrequency) - Botania.proxy.sparkleFX(par1World, par2 + 0.3 + par5Random.nextFloat() * 0.5, par3 + 0.5 + par5Random.nextFloat() * 0.5, par4 + 0.3 + par5Random.nextFloat() * 0.5, color[0], color[1], color[2], par5Random.nextFloat(), 5); - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.flowers; } - int offset(int meta) { - return meta + offset; + @Nonnull + @Override + public IBlockState getActualState(IBlockState state, @Nonnull IBlockAccess worldIn, @Nonnull BlockPos pos) { + if (state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER) { + IBlockState iblockstate = worldIn.getBlockState(pos.down()); + + if (iblockstate.getBlock() == this) { + PropertyEnum prop = second ? BotaniaStateProps.DOUBLEFLOWER_VARIANT_2 : BotaniaStateProps.DOUBLEFLOWER_VARIANT_1; + state = state.withProperty(prop, iblockstate.getValue(prop)); + } + } + + return state.withProperty(VARIANT, EnumPlantType.SUNFLOWER).withProperty(FACING, EnumFacing.SOUTH); + } + + @Nonnull + @Override + public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player) { + state = state.getBlock().getActualState(state, world, pos); + PropertyEnum prop = second ? BotaniaStateProps.DOUBLEFLOWER_VARIANT_2 : BotaniaStateProps.DOUBLEFLOWER_VARIANT_1; + return new ItemStack(Item.getItemFromBlock(state.getBlock()), 1, state.getValue(prop).ordinal() - (second ? 8 : 0)); + } + + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelLoader.setCustomStateMapper(this, (new StateMap.Builder()).ignore(BlockDoublePlant.VARIANT, BlockDoublePlant.FACING).build()); } } diff --git a/src/main/java/vazkii/botania/common/block/BlockModDoubleFlower1.java b/src/main/java/vazkii/botania/common/block/BlockModDoubleFlower1.java new file mode 100644 index 000000000..f2f0f7c50 --- /dev/null +++ b/src/main/java/vazkii/botania/common/block/BlockModDoubleFlower1.java @@ -0,0 +1,59 @@ +package vazkii.botania.common.block; + +import net.minecraft.block.BlockDoublePlant; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.util.EnumFacing; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.client.core.handler.ModelHandler; + +import javax.annotation.Nonnull; + +// White to Gray +public class BlockModDoubleFlower1 extends BlockModDoubleFlower { + public BlockModDoubleFlower1() { + super(false); + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, FACING, VARIANT, HALF, BotaniaStateProps.DOUBLEFLOWER_VARIANT_1); + } + + @Override + protected IBlockState pickDefaultState() { + return blockState.getBaseState() + .withProperty(FACING, EnumFacing.SOUTH) + .withProperty(VARIANT, EnumPlantType.SUNFLOWER) + .withProperty(HALF, BlockDoublePlant.EnumBlockHalf.LOWER) + .withProperty(BotaniaStateProps.DOUBLEFLOWER_VARIANT_1, EnumDyeColor.WHITE); + } + + @Override + public int getMetaFromState(IBlockState state) { + int meta = state.getValue(BotaniaStateProps.DOUBLEFLOWER_VARIANT_1).getMetadata(); + if (state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER) { + meta |= 8; + } + return meta; + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + BlockDoublePlant.EnumBlockHalf half = (meta & 8) > 0 ? BlockDoublePlant.EnumBlockHalf.UPPER : BlockDoublePlant.EnumBlockHalf.LOWER; + meta &= -9; + return getDefaultState().withProperty(HALF, half).withProperty(BotaniaStateProps.DOUBLEFLOWER_VARIANT_1, EnumDyeColor.byMetadata(meta)); + } + + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + super.registerModels(); + ModelHandler.registerCustomItemblock(this, 8, i -> "double_flower_" + EnumDyeColor.byMetadata(i).getName()); + } +} diff --git a/src/main/java/vazkii/botania/common/block/BlockModDoubleFlower2.java b/src/main/java/vazkii/botania/common/block/BlockModDoubleFlower2.java new file mode 100644 index 000000000..25d866a4d --- /dev/null +++ b/src/main/java/vazkii/botania/common/block/BlockModDoubleFlower2.java @@ -0,0 +1,60 @@ +package vazkii.botania.common.block; + +import net.minecraft.block.BlockDoublePlant; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.util.EnumFacing; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.client.core.handler.ModelHandler; + +import javax.annotation.Nonnull; + +// Silver to black +public class BlockModDoubleFlower2 extends BlockModDoubleFlower { + + public BlockModDoubleFlower2() { + super(true); + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, FACING, VARIANT, HALF, BotaniaStateProps.DOUBLEFLOWER_VARIANT_2); + } + + @Override + protected IBlockState pickDefaultState() { + return blockState.getBaseState() + .withProperty(FACING, EnumFacing.SOUTH) + .withProperty(VARIANT, EnumPlantType.SUNFLOWER) + .withProperty(HALF, BlockDoublePlant.EnumBlockHalf.LOWER) + .withProperty(BotaniaStateProps.DOUBLEFLOWER_VARIANT_2, EnumDyeColor.SILVER); + } + + @Override + public int getMetaFromState(IBlockState state) { + int meta = state.getValue(BotaniaStateProps.DOUBLEFLOWER_VARIANT_2).getMetadata() - 8; + if (state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER) { + meta |= 8; + } + return meta; + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + BlockDoublePlant.EnumBlockHalf half = (meta & 8) > 0 ? BlockDoublePlant.EnumBlockHalf.UPPER : BlockDoublePlant.EnumBlockHalf.LOWER; + meta &= -9; + return getDefaultState().withProperty(HALF, half).withProperty(BotaniaStateProps.DOUBLEFLOWER_VARIANT_2, EnumDyeColor.byMetadata(meta + 8)); + } + + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + super.registerModels(); + ModelHandler.registerCustomItemblock(this, 8, i -> "double_flower_" + EnumDyeColor.byMetadata(i + 8).getName()); + } +} diff --git a/src/main/java/vazkii/botania/common/block/BlockModFlower.java b/src/main/java/vazkii/botania/common/block/BlockModFlower.java index 084e217c7..2188dd856 100644 --- a/src/main/java/vazkii/botania/common/block/BlockModFlower.java +++ b/src/main/java/vazkii/botania/common/block/BlockModFlower.java @@ -10,26 +10,35 @@ */ package vazkii.botania.common.block; -import java.util.List; -import java.util.Random; - import net.minecraft.block.Block; +import net.minecraft.block.BlockDoublePlant; import net.minecraft.block.BlockFlower; import net.minecraft.block.IGrowable; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.SoundType; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.block.statemap.StateMap; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.passive.EntitySheep; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumDyeColor; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.stats.Achievement; -import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.core.helper.IconHelper; -import vazkii.botania.client.lib.LibRenderIDs; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.client.core.handler.ModelHandler; +import vazkii.botania.client.render.IModelRegister; import vazkii.botania.common.Botania; import vazkii.botania.common.achievement.IPickupAchievement; import vazkii.botania.common.achievement.ModAchievements; @@ -38,93 +47,104 @@ import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import vazkii.botania.common.lib.LibMisc; -public class BlockModFlower extends BlockFlower implements ILexiconable, IPickupAchievement, IGrowable { +import javax.annotation.Nonnull; +import java.util.List; +import java.util.Random; - public static IIcon[] icons; - public static IIcon[] iconsAlt; +public class BlockModFlower extends BlockFlower implements ILexiconable, IPickupAchievement, IGrowable, IModelRegister { - public int originalLight; - - public static final String ALT_DIR = "alt"; + private static final AxisAlignedBB AABB = new AxisAlignedBB(0.3, 0, 0.3, 0.8, 1, 0.8); protected BlockModFlower() { this(LibBlockNames.FLOWER); } protected BlockModFlower(String name) { - super(0); - setBlockName(name); + setUnlocalizedName(name); + setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE).withProperty(type, EnumFlowerType.POPPY)); + setRegistryName(new ResourceLocation(LibMisc.MOD_ID, name)); + GameRegistry.register(this); + registerItemForm(); setHardness(0F); - setStepSound(soundTypeGrass); - setBlockBounds(0.3F, 0.0F, 0.3F, 0.8F, 1, 0.8F); + setSoundType(SoundType.PLANT); setTickRandomly(false); setCreativeTab(registerInCreative() ? BotaniaCreativeTab.INSTANCE : null); } + public void registerItemForm() { + GameRegistry.register(new ItemBlockWithMetadataAndName(this), getRegistryName()); + } + + @Nonnull + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { + return AABB; + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, getTypeProperty(), BotaniaStateProps.COLOR); + } + + @Override + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.COLOR).getMetadata(); + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + if (meta >= EnumDyeColor.values().length) { + meta = 0; + } + return getDefaultState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.byMetadata(meta)); + } + + @Nonnull + @Override + public IBlockState getActualState(@Nonnull IBlockState state, IBlockAccess world, BlockPos pos) { + return state.withProperty(type, EnumFlowerType.POPPY); + } + + @Nonnull + @Override + public EnumFlowerColor getBlockType() { + return EnumFlowerColor.RED; + } + public boolean registerInCreative() { return true; } - @Override - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for(int i = 0; i < 16; i++) - par3List.add(new ItemStack(par1, 1, i)); - } - - @Override - public Block setBlockName(String par1Str) { - GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, par1Str); - return super.setBlockName(par1Str); - } - - @Override @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - icons = new IIcon[17]; - iconsAlt = new IIcon[17]; - - for(int i = 0; i < icons.length; i++) { - icons[i] = IconHelper.forBlock(par1IconRegister, this, i); - iconsAlt[i] = IconHelper.forBlock(par1IconRegister, this, i, ALT_DIR); - } + @Override + public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, @Nonnull List stacks) { + for(int i = 0; i < 16; i++) + stacks.add(new ItemStack(item, 1, i)); } @Override - public Block setLightLevel(float p_149715_1_) { - originalLight = (int) (p_149715_1_ * 15); - return super.setLightLevel(p_149715_1_); + public int damageDropped(IBlockState state) { + return getMetaFromState(state); + } + + @SideOnly(Side.CLIENT) + @Override + public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) { + int hex = state.getValue(BotaniaStateProps.COLOR).getMapColor().colorValue; + int r = (hex & 0xFF0000) >> 16; + int g = (hex & 0xFF00) >> 8; + int b = (hex & 0xFF); + + if(rand.nextDouble() < ConfigHandler.flowerParticleFrequency) + Botania.proxy.sparkleFX(pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.5 + rand.nextFloat() * 0.5, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5); } @Override - public IIcon getIcon(int par1, int par2) { - return (ConfigHandler.altFlowerTextures ? iconsAlt : icons)[Math.min(icons.length - 1, par2)]; - } - - @Override - public int getRenderType() { - return LibRenderIDs.idSpecialFlower; - } - - @Override - public int damageDropped(int par1) { - return par1; - } - - @Override - public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { - int meta = par1World.getBlockMetadata(par2, par3, par4); - float[] color = EntitySheep.fleeceColorTable[meta]; - - if(par5Random.nextDouble() < ConfigHandler.flowerParticleFrequency) - Botania.proxy.sparkleFX(par1World, par2 + 0.3 + par5Random.nextFloat() * 0.5, par3 + 0.5 + par5Random.nextFloat() * 0.5, par4 + 0.3 + par5Random.nextFloat() * 0.5, color[0], color[1], color[2], par5Random.nextFloat(), 5); - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.flowers; } @@ -134,26 +154,30 @@ public class BlockModFlower extends BlockFlower implements ILexiconable, IPickup } @Override - public boolean func_149851_a(World world, int x, int y, int z, boolean fuckifiknow) { - return world.isAirBlock(x, y + 1, z); + public boolean canGrow(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state, boolean fuckifiknow) { + return world.isAirBlock(pos.up()); } @Override - public boolean func_149852_a(World world, Random rand, int x, int y, int z) { - return func_149851_a(world, x, y, z, false); + public boolean canUseBonemeal(@Nonnull World world, @Nonnull Random rand, @Nonnull BlockPos pos, @Nonnull IBlockState state) { + return canGrow(world, pos, state, false); } @Override - public void func_149853_b(World world, Random rand, int x, int y, int z) { - int meta = world.getBlockMetadata(x, y, z); - placeDoubleFlower(world, x, y, z, meta, 1 | 2); + public void grow(@Nonnull World world, @Nonnull Random rand, @Nonnull BlockPos pos, @Nonnull IBlockState state) { + placeDoubleFlower(world, pos, state.getValue(BotaniaStateProps.COLOR), 1 | 2); } - public static void placeDoubleFlower(World world, int x, int y, int z, int meta, int flags) { - Block flower = meta >= 8 ? ModBlocks.doubleFlower2 : ModBlocks.doubleFlower1; - int placeMeta = meta & 7; - world.setBlock(x, y, z, flower, placeMeta, flags); - world.setBlock(x, y + 1, z, flower, placeMeta | 8, flags); + public static void placeDoubleFlower(World world, BlockPos pos, EnumDyeColor color, int flags) { + Block flower = color.getMetadata() >= 8 ? ModBlocks.doubleFlower2 : ModBlocks.doubleFlower1; + world.setBlockState(pos, flower.getDefaultState().withProperty(color.getMetadata() >= 8 ? BotaniaStateProps.DOUBLEFLOWER_VARIANT_2 : BotaniaStateProps.DOUBLEFLOWER_VARIANT_1, color).withProperty(BlockDoublePlant.HALF, BlockDoublePlant.EnumBlockHalf.LOWER), flags); + world.setBlockState(pos.up(), flower.getDefaultState().withProperty(color.getMetadata() >= 8 ? BotaniaStateProps.DOUBLEFLOWER_VARIANT_2 : BotaniaStateProps.DOUBLEFLOWER_VARIANT_1, color).withProperty(BlockDoublePlant.HALF, BlockDoublePlant.EnumBlockHalf.UPPER), flags); } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelLoader.setCustomStateMapper(this, (new StateMap.Builder()).ignore(getTypeProperty()).build()); + ModelHandler.registerCustomItemblock(this, EnumDyeColor.values().length, i -> "flower_" + EnumDyeColor.byMetadata(i).getName()); + } } diff --git a/src/main/java/vazkii/botania/common/block/BlockOpenCrate.java b/src/main/java/vazkii/botania/common/block/BlockOpenCrate.java index be6647ce8..353d14612 100644 --- a/src/main/java/vazkii/botania/common/block/BlockOpenCrate.java +++ b/src/main/java/vazkii/botania/common/block/BlockOpenCrate.java @@ -10,16 +10,14 @@ */ package vazkii.botania.common.block; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; @@ -27,165 +25,146 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.CratePattern; +import vazkii.botania.api.state.enums.CrateVariant; import vazkii.botania.api.wand.IWandHUD; import vazkii.botania.api.wand.IWandable; -import vazkii.botania.client.core.helper.IconHelper; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.block.tile.TileCraftCrate; import vazkii.botania.common.block.tile.TileOpenCrate; import vazkii.botania.common.block.tile.TileSimpleInventory; +import vazkii.botania.common.core.helper.InventoryHelper; import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.registry.GameRegistry; -public class BlockOpenCrate extends BlockModContainer implements ILexiconable, IWandable, IWandHUD { +import javax.annotation.Nonnull; +import java.util.List; +import java.util.Random; - IIcon iconSide; - IIcon iconBottom; - IIcon iconSideCraft; - IIcon iconBottomCraft; - - IIcon[] sidePatternIcons; - - Random random; - - private static final int SUBTYPES = 2; +public class BlockOpenCrate extends BlockMod implements ILexiconable, IWandable, IWandHUD { public BlockOpenCrate() { - super(Material.wood); + super(Material.WOOD, LibBlockNames.OPEN_CRATE); setHardness(2.0F); - setStepSound(soundTypeWood); - setBlockName(LibBlockNames.OPEN_CRATE); + setSoundType(SoundType.WOOD); + } - random = new Random(); + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.CRATE_VARIANT, BotaniaStateProps.CRATE_PATTERN); } @Override - protected boolean shouldRegisterInNameSet() { - return false; + protected IBlockState pickDefaultState() { + return blockState.getBaseState() + .withProperty(BotaniaStateProps.CRATE_VARIANT, CrateVariant.OPEN) + .withProperty(BotaniaStateProps.CRATE_PATTERN, CratePattern.NONE); } @Override - public Block setBlockName(String par1Str) { - GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, par1Str); - return super.setBlockName(par1Str); + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.CRATE_VARIANT).ordinal(); + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + if (meta >= CrateVariant.values().length) { + meta = 0; + } + return getDefaultState().withProperty(BotaniaStateProps.CRATE_VARIANT, CrateVariant.values()[meta]); + } + + @Nonnull + @Override + public IBlockState getActualState(@Nonnull IBlockState state, IBlockAccess world, BlockPos pos) { + if (world.getTileEntity(pos) instanceof TileCraftCrate) { + TileCraftCrate tile = ((TileCraftCrate) world.getTileEntity(pos)); + state = state.withProperty(BotaniaStateProps.CRATE_PATTERN, CratePattern.values()[tile.pattern + 1]); + } else { + state = state.withProperty(BotaniaStateProps.CRATE_PATTERN, CratePattern.NONE); + } + + return state; } @Override - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for(int i = 0; i < SUBTYPES; i++) - par3List.add(new ItemStack(par1, 1, i)); + public void registerItemForm() { + GameRegistry.register(new ItemBlockWithMetadataAndName(this), getRegistryName()); + } + + @SideOnly(Side.CLIENT) + @Override + public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List stacks) { + for(int i = 0; i < CrateVariant.values().length; i++) + stacks.add(new ItemStack(item, 1, i)); } @Override - public int damageDropped(int meta) { - return meta; + public int damageDropped(IBlockState state) { + return getMetaFromState(state); } @Override - public boolean hasComparatorInputOverride() { + public boolean hasComparatorInputOverride(IBlockState state) { return true; } @Override - public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) { - TileOpenCrate crate = (TileOpenCrate) par1World.getTileEntity(par2, par3, par4); + public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) { + TileOpenCrate crate = (TileOpenCrate) world.getTileEntity(pos); return crate.getSignal(); } @Override - public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { - TileSimpleInventory inv = (TileSimpleInventory) par1World.getTileEntity(par2, par3, par4); - - if (inv != null) { - for (int j1 = 0; j1 < inv.getSizeInventory(); ++j1) { - ItemStack itemstack = inv.getStackInSlot(j1); - - if (itemstack != null) { - float f = random.nextFloat() * 0.8F + 0.1F; - float f1 = random.nextFloat() * 0.8F + 0.1F; - EntityItem entityitem; - - for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) { - int k1 = random.nextInt(21) + 10; - - if (k1 > itemstack.stackSize) - k1 = itemstack.stackSize; - - itemstack.stackSize -= k1; - entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage())); - float f3 = 0.05F; - entityitem.motionX = (float)random.nextGaussian() * f3; - entityitem.motionY = (float)random.nextGaussian() * f3 + 0.2F; - entityitem.motionZ = (float)random.nextGaussian() * f3; - - if (itemstack.hasTagCompound()) - entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy()); - } - } - } - - par1World.func_147453_f(par2, par3, par4, par5); + public void breakBlock(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state) { + if (!world.isRemote) { + TileSimpleInventory inv = (TileSimpleInventory) world.getTileEntity(pos); + InventoryHelper.dropInventory(inv, world, state, pos); } - super.breakBlock(par1World, par2, par3, par4, par5, par6); + super.breakBlock(world, pos, state); } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - iconSide = IconHelper.forBlock(par1IconRegister, this, 0); - iconBottom = IconHelper.forBlock(par1IconRegister, this, 1); - iconSideCraft = IconHelper.forBlock(par1IconRegister, this, 2); - iconBottomCraft = IconHelper.forBlock(par1IconRegister, this, 3); + public boolean hasTileEntity(IBlockState state) { + return true; + } - sidePatternIcons = new IIcon[TileCraftCrate.PATTERNS.length]; - for(int i = 0; i < sidePatternIcons.length; i++) - sidePatternIcons[i] = IconHelper.forName(par1IconRegister, "ocPattern" + i); + @Nonnull + @Override + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { + return state.getValue(BotaniaStateProps.CRATE_VARIANT) == CrateVariant.OPEN ? new TileOpenCrate() : new TileCraftCrate(); } @Override - public IIcon getIcon(int side, int meta) { - return meta == 0 ? side == 0 ? iconBottom : iconSide : side == 0 ? iconBottomCraft : iconSideCraft; + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { + return world.getBlockState(pos).getValue(BotaniaStateProps.CRATE_VARIANT) == CrateVariant.OPEN ? LexiconData.openCrate : LexiconData.craftCrate; } @Override - public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { - TileEntity tile = world.getTileEntity(x, y, z); - if(tile != null && tile instanceof TileCraftCrate && ((TileCraftCrate) tile).pattern != -1 && side != 0) - return sidePatternIcons[((TileCraftCrate) tile).pattern]; - - return super.getIcon(world, x, y, z, side); + public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, BlockPos pos, EnumFacing side) { + TileOpenCrate crate = (TileOpenCrate) world.getTileEntity(pos); + return crate.onWanded(world, player, stack); } + @SideOnly(Side.CLIENT) @Override - public TileEntity createNewTileEntity(World world, int meta) { - return meta == 0 ? new TileOpenCrate() : new TileCraftCrate(); - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { - return world.getBlockMetadata(x, y, z) == 0 ? LexiconData.openCrate : LexiconData.craftCrate; - } - - @Override - public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int side) { - TileOpenCrate crate = (TileOpenCrate) world.getTileEntity(x, y, z); - return crate.onWanded(player, stack); - } - - @Override - public void renderHUD(Minecraft mc, ScaledResolution res, World world, int x, int y, int z) { - TileEntity tile = world.getTileEntity(x, y, z); + public void renderHUD(Minecraft mc, ScaledResolution res, World world, BlockPos pos) { + TileEntity tile = world.getTileEntity(pos); if(tile instanceof TileCraftCrate) { TileCraftCrate craft = (TileCraftCrate) tile; @@ -209,13 +188,20 @@ public class BlockOpenCrate extends BlockModContainer implements ILexiconable, I Gui.drawRect(xp, yp, xp + 16, yp + 16, enabled ? 0x22FFFFFF : 0x22FF0000); - ItemStack item = craft.getStackInSlot(index); + ItemStack item = craft.getItemHandler().getStackInSlot(index); net.minecraft.client.renderer.RenderHelper.enableGUIStandardItemLighting(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, item, xp, yp); + GlStateManager.enableRescaleNormal(); + mc.getRenderItem().renderItemAndEffectIntoGUI(item, xp, yp); net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting(); } } } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerBlockToState(this, 0, getDefaultState()); + ModelHandler.registerBlockToState(this, 1, getDefaultState().withProperty(BotaniaStateProps.CRATE_VARIANT, CrateVariant.CRAFTY)); + } + } diff --git a/src/main/java/vazkii/botania/common/block/BlockPistonRelay.java b/src/main/java/vazkii/botania/common/block/BlockPistonRelay.java index 80dfcdfe4..8013548a4 100644 --- a/src/main/java/vazkii/botania/common/block/BlockPistonRelay.java +++ b/src/main/java/vazkii/botania/common/block/BlockPistonRelay.java @@ -10,15 +10,14 @@ */ package vazkii.botania.common.block; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Random; - +import gnu.trove.map.hash.TObjectIntHashMap; import net.minecraft.block.Block; +import net.minecraft.block.BlockPistonExtension; +import net.minecraft.block.BlockPistonMoving; +import net.minecraft.block.SoundType; +import net.minecraft.block.material.EnumPushReaction; import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -28,113 +27,110 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagString; import net.minecraft.server.MinecraftServer; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraft.world.WorldSavedData; import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.event.world.WorldEvent; +import net.minecraftforge.fml.common.FMLCommonHandler; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; +import net.minecraftforge.fml.common.gameevent.TickEvent.Type; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.api.sound.BotaniaSoundEvents; import vazkii.botania.api.wand.IWandable; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.TickEvent; -import cpw.mods.fml.common.gameevent.TickEvent.Phase; -import cpw.mods.fml.common.gameevent.TickEvent.Type; + +import javax.annotation.Nonnull; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Random; +import java.util.Set; +import java.util.UUID; public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconable { - public static Map playerPositions = new HashMap(); - public static Map mappedPositions = new HashMap(); + // Currently active binding attempts + public final Map playerPositions = new HashMap<>(); - static List removeThese = new ArrayList(); - static List checkedCoords = new ArrayList(); - static Map coordsToCheck = new HashMap(); + // Bindings + public final Map mappedPositions = new HashMap<>(); + + private final Set removeQueue = new HashSet<>(); + private final Set checkedCoords = new HashSet<>(); + private final TObjectIntHashMap coordsToCheck = new TObjectIntHashMap<>(10, 0.5F, -1); public BlockPistonRelay() { - super(Material.gourd); - setBlockName(LibBlockNames.PISTON_RELAY); + super(Material.GOURD, LibBlockNames.PISTON_RELAY); setHardness(2F); setResistance(10F); - setStepSound(soundTypeMetal); + setSoundType(SoundType.METAL); MinecraftForge.EVENT_BUS.register(this); - FMLCommonHandler.instance().bus().register(this); } @Override - public int quantityDropped(int meta, int fortune, Random random) { + public int quantityDropped(IBlockState state, int fortune, @Nonnull Random random) { return 0; } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { - mapCoords(par1World.provider.dimensionId, par2, par3, par4, 2); + public void breakBlock(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state) { + if(!world.isRemote) + mapCoords(world.provider.getDimension(), pos, 2); } - public static String getCoordsAsString(int world, int x, int y, int z) { - return world + ":" + x + ":" + y + ":" + z; + private void mapCoords(int world, BlockPos pos, int time) { + coordsToCheck.put(new DimWithPos(world, pos), time); } - static void mapCoords(int world, int x, int y, int z, int time) { - String coords = getCoordsAsString(world, x, y, z); - coordsToCheck.put(coords, time); - } - - static void decrCoords(String key) { + private void decrCoords(DimWithPos key) { int time = getTimeInCoords(key); if(time <= 0) - removeThese.add(key); - else coordsToCheck.put(key, time - 1); + removeQueue.add(key); + else coordsToCheck.adjustValue(key, -1); } - static int getTimeInCoords(String key) { + private int getTimeInCoords(DimWithPos key) { return coordsToCheck.get(key); } - static Block getBlockAt(String key) { - MinecraftServer server = MinecraftServer.getServer(); - if(server == null) - return Blocks.air; - - String[] tokens = key.split(":"); - int worldId = Integer.parseInt(tokens[0]), x = Integer.parseInt(tokens[1]), y = Integer.parseInt(tokens[2]), z = Integer.parseInt(tokens[3]); - World world = server.worldServerForDimension(worldId); - return world.getBlock(x, y, z); + private Block getBlockAt(DimWithPos key) { + return getStateAt(key).getBlock(); } - static int getBlockMetaAt(String key) { - MinecraftServer server = MinecraftServer.getServer(); + private IBlockState getStateAt(DimWithPos key) { + MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance(); if(server == null) - return 0; - - String[] tokens = key.split(":"); - int worldId = Integer.parseInt(tokens[0]), x = Integer.parseInt(tokens[1]), y = Integer.parseInt(tokens[2]), z = Integer.parseInt(tokens[3]); - World world = server.worldServerForDimension(worldId); - return world.getBlockMetadata(x, y, z); + return Blocks.AIR.getDefaultState(); + return server.worldServerForDimension(key.dim).getBlockState(key.blockPos); } @Override - public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int side) { - if(player == null) + public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, BlockPos pos, EnumFacing side) { + if(player == null || world.isRemote) return false; if(!player.isSneaking()) { - playerPositions.put(player.getCommandSenderName(), getCoordsAsString(world.provider.dimensionId, x, y, z)); - world.playSoundEffect(x, y, z, "botania:ding", 0.5F, 1F); + playerPositions.put(player.getUniqueID(), new DimWithPos(world.provider.getDimension(), pos)); + world.playSound(null, pos, BotaniaSoundEvents.ding, SoundCategory.BLOCKS, 0.5F, 1F); } else { - dropBlockAsItem(world, x, y, z, new ItemStack(this)); - world.setBlockToAir(x, y, z); - if(!world.isRemote) - world.playAuxSFX(2001, x, y , z, Block.getIdFromBlock(this)); + spawnAsEntity(world, pos, new ItemStack(this)); + world.setBlockToAir(pos); + world.playEvent(2001, pos, Block.getStateId(getDefaultState())); } return true; @@ -142,12 +138,14 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl @SubscribeEvent public void onWorldLoad(WorldEvent.Load event) { - WorldData.get(event.world); + if(!event.getWorld().isRemote) + WorldData.get(event.getWorld()); } @SubscribeEvent public void onWorldUnload(WorldEvent.Unload event) { - WorldData.get(event.world).markDirty(); + if(!event.getWorld().isRemote) + WorldData.get(event.getWorld()).markDirty(); } public static class WorldData extends WorldSavedData { @@ -159,36 +157,38 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl } @Override - public void readFromNBT(NBTTagCompound nbttagcompound) { - mappedPositions.clear(); + public void readFromNBT(@Nonnull NBTTagCompound nbttagcompound) { + ((BlockPistonRelay) (ModBlocks.pistonRelay)).mappedPositions.clear(); - Collection tags = nbttagcompound.func_150296_c(); + Collection tags = nbttagcompound.getKeySet(); for(String key : tags) { NBTBase tag = nbttagcompound.getTag(key); if(tag instanceof NBTTagString) { - String value = ((NBTTagString) tag).func_150285_a_(); + String value = ((NBTTagString) tag).getString(); - mappedPositions.put(key, value); + ((BlockPistonRelay) (ModBlocks.pistonRelay)).mappedPositions.put(DimWithPos.fromString(key), DimWithPos.fromString(value)); } } } + @Nonnull @Override - public void writeToNBT(NBTTagCompound nbttagcompound) { - for(String s : mappedPositions.keySet()) - nbttagcompound.setString(s, mappedPositions.get(s)); + public NBTTagCompound writeToNBT(@Nonnull NBTTagCompound nbttagcompound) { + for(DimWithPos s : ((BlockPistonRelay) (ModBlocks.pistonRelay)).mappedPositions.keySet()) + nbttagcompound.setString(s.toString(), ((BlockPistonRelay) (ModBlocks.pistonRelay)).mappedPositions.get(s).toString()); + return nbttagcompound; } public static WorldData get(World world) { - if(world.mapStorage == null) + if(world.getMapStorage() == null) return null; - WorldData data = (WorldData) world.mapStorage.loadData(WorldData.class, ID); + WorldData data = (WorldData) world.getMapStorage().getOrLoadData(WorldData.class, ID); if (data == null) { data = new WorldData(ID); data.markDirty(); - world.mapStorage.setData(ID, data); + world.getMapStorage().setData(ID, data); } return data; } @@ -197,54 +197,52 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl @SubscribeEvent public void tickEnd(TickEvent event) { if(event.type == Type.SERVER && event.phase == Phase.END) { - List coordsToCheckCopy = new ArrayList(coordsToCheck.keySet()); - for(String s : coordsToCheckCopy) { + for(DimWithPos s : coordsToCheck.keySet()) { decrCoords(s); if(checkedCoords.contains(s)) continue; Block block = getBlockAt(s); - if(block == Blocks.piston_extension) { - int meta = getBlockMetaAt(s); - boolean sticky = (meta & 8) == 8; - ForgeDirection dir = ForgeDirection.getOrientation(meta & ~8); + if(block == Blocks.PISTON_EXTENSION) { + IBlockState state = getStateAt(s); + boolean sticky = BlockPistonExtension.EnumPistonType.STICKY == state.getValue(BlockPistonMoving.TYPE); + EnumFacing dir = state.getValue(BlockPistonMoving.FACING); - MinecraftServer server = MinecraftServer.getServer(); + MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance(); if(server != null && getTimeInCoords(s) == 0) { - String newPos; + DimWithPos newPos; { - String[] tokens = s.split(":"); - int worldId = Integer.parseInt(tokens[0]), x = Integer.parseInt(tokens[1]), y = Integer.parseInt(tokens[2]), z = Integer.parseInt(tokens[3]); + int worldId = s.dim, x = s.blockPos.getX(), y = s.blockPos.getY(), z = s.blockPos.getZ(); + BlockPos pos = s.blockPos; World world = server.worldServerForDimension(worldId); - if(world.isAirBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ)) - world.setBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, ModBlocks.pistonRelay); + if(world.isAirBlock(pos.offset(dir))) + world.setBlockState(pos.offset(dir), ModBlocks.pistonRelay.getDefaultState()); else if(!world.isRemote) { ItemStack stack = new ItemStack(ModBlocks.pistonRelay); - world.spawnEntityInWorld(new EntityItem(world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, stack)); + world.spawnEntityInWorld(new EntityItem(world, x + dir.getFrontOffsetX(), y + dir.getFrontOffsetY(), z + dir.getFrontOffsetZ(), stack)); } checkedCoords.add(s); - newPos = getCoordsAsString(world.provider.dimensionId, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ); + newPos = new DimWithPos(world.provider.getDimension(), pos.offset(dir)); } if(mappedPositions.containsKey(s)) { - String pos = mappedPositions.get(s); - String[] tokens = pos.split(":"); - int worldId = Integer.parseInt(tokens[0]), x = Integer.parseInt(tokens[1]), y = Integer.parseInt(tokens[2]), z = Integer.parseInt(tokens[3]); + DimWithPos pos = mappedPositions.get(s); + int worldId = pos.dim; + BlockPos pos2 = pos.blockPos; World world = server.worldServerForDimension(worldId); - Block srcBlock = world.getBlock(x, y, z); - int srcMeta = world.getBlockMetadata(x, y, z); - TileEntity tile = world.getTileEntity(x, y, z); - Material mat = srcBlock.getMaterial(); + IBlockState srcState = world.getBlockState(pos2); + TileEntity tile = world.getTileEntity(pos2); + Material mat = srcState.getMaterial(); - if(!sticky && tile == null && mat.getMaterialMobility() == 0 && srcBlock.getBlockHardness(world, x, y, z) != -1 && !srcBlock.isAir(world, x, y, z)) { - Material destMat = world.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ).getMaterial(); - if(world.isAirBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ) || destMat.isReplaceable()) { - world.setBlock(x, y, z, Blocks.air); - world.setBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, srcBlock, srcMeta, 1 | 2); - mappedPositions.put(s, getCoordsAsString(world.provider.dimensionId, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ)); + if(!sticky && tile == null && mat.getMobilityFlag() == EnumPushReaction.NORMAL && srcState.getBlockHardness(world, pos2) != -1 && !srcState.getBlock().isAir(srcState, world, pos2)) { + Material destMat = world.getBlockState(pos2.offset(dir)).getMaterial(); + if(world.isAirBlock(pos2.offset(dir)) || destMat.isReplaceable()) { + world.setBlockState(pos2, Blocks.AIR.getDefaultState()); + world.setBlockState(pos2.offset(dir), srcState, 1 | 2); + mappedPositions.put(s, new DimWithPos(world.provider.getDimension(), pos2.offset(dir))); } } @@ -258,14 +256,11 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl } } - // ConcurrentModificationException failsafe - ArrayList remove = new ArrayList(removeThese); - for(String s : remove) { + for(DimWithPos s : removeQueue) { coordsToCheck.remove(s); - if(checkedCoords.contains(s)) - checkedCoords.remove(s); + checkedCoords.remove(s); } - removeThese.clear(); + removeQueue.clear(); } public void save(World world) { @@ -275,7 +270,41 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.pistonRelay; } + + public static class DimWithPos { + public final int dim; + public final BlockPos blockPos; + + public DimWithPos(int dim, BlockPos pos) { + this.dim = dim; + this.blockPos = pos; + } + + @Override + public int hashCode() { + return 31 * dim ^ blockPos.hashCode(); + } + + @Override + public boolean equals(Object o) { + return o instanceof DimWithPos + && dim == ((DimWithPos) o).dim + && blockPos.equals(((DimWithPos) o).blockPos); + } + + @Override + public String toString() { + return dim + ":" + blockPos.getX() + ":" + blockPos.getY() + ":" + blockPos.getZ(); + } + + public static DimWithPos fromString(String s) { + String[] split = s.split(":"); + return new DimWithPos(Integer.parseInt(split[0]), new BlockPos(Integer.parseInt(split[1]), Integer.parseInt(split[2]), Integer.parseInt(split[3]))); + } + + } + } diff --git a/src/main/java/vazkii/botania/common/block/BlockPlatform.java b/src/main/java/vazkii/botania/common/block/BlockPlatform.java index 75346747f..f5ed414a5 100644 --- a/src/main/java/vazkii/botania/common/block/BlockPlatform.java +++ b/src/main/java/vazkii/botania/common/block/BlockPlatform.java @@ -10,105 +10,161 @@ */ package vazkii.botania.common.block; -import java.util.List; - -import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.block.statemap.StateMap; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.IIcon; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockRenderLayer; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.common.property.ExtendedBlockState; +import net.minecraftforge.common.property.IExtendedBlockState; +import net.minecraftforge.common.property.IUnlistedProperty; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.api.mana.IManaCollisionGhost; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.PlatformVariant; import vazkii.botania.api.wand.IWandable; -import vazkii.botania.client.core.helper.IconHelper; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.block.tile.TileCamo; import vazkii.botania.common.block.tile.TilePlatform; import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.registry.GameRegistry; -public class BlockPlatform extends BlockCamo implements ILexiconable, IWandable { +import javax.annotation.Nonnull; +import java.util.List; - IIcon[] icons; - private static final int SUBTYPES = 3; +public class BlockPlatform extends BlockCamo implements ILexiconable, IWandable, IManaCollisionGhost { public BlockPlatform() { - super(Material.wood); + super(Material.WOOD, LibBlockNames.PLATFORM); setHardness(2.0F); setResistance(5.0F); - setStepSound(Block.soundTypeWood); - setBlockName(LibBlockNames.PLATFORM); + setSoundType(SoundType.WOOD); + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new ExtendedBlockState(this, new IProperty[] { BotaniaStateProps.PLATFORM_VARIANT, }, + new IUnlistedProperty[] { BotaniaStateProps.HELD_STATE, BotaniaStateProps.HELD_WORLD, BotaniaStateProps.HELD_POS }); } @Override - protected boolean shouldRegisterInNameSet() { - return false; + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.PLATFORM_VARIANT, PlatformVariant.ABSTRUSE); } @Override - public int damageDropped(int par1) { - return par1; + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.PLATFORM_VARIANT).ordinal(); + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + if (meta > PlatformVariant.values().length) { + meta = 0; + } + return getDefaultState().withProperty(BotaniaStateProps.PLATFORM_VARIANT, PlatformVariant.values()[meta]); + } + + @Nonnull + @Override + public IBlockState getExtendedState(@Nonnull IBlockState state, IBlockAccess world, BlockPos pos) { + state = ((IExtendedBlockState) state).withProperty(BotaniaStateProps.HELD_WORLD, world) + .withProperty(BotaniaStateProps.HELD_POS, pos); + + if (world.getTileEntity(pos) instanceof TileCamo) { + TileCamo tile = ((TileCamo) world.getTileEntity(pos)); + return ((IExtendedBlockState) state).withProperty(BotaniaStateProps.HELD_STATE, tile.camoState); + } else { + return state; + } } @Override - public Block setBlockName(String par1Str) { - GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, par1Str); - return super.setBlockName(par1Str); + public boolean canRenderInLayer(IBlockState state, @Nonnull BlockRenderLayer layer) { + return true; + } + + + @Override + public int damageDropped(IBlockState state) { + return getMetaFromState(state); } @Override - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for(int i = 0; i < SUBTYPES; i++) - par3List.add(new ItemStack(par1, 1, i)); + public void registerItemForm() { + GameRegistry.register(new ItemBlockWithMetadataAndName(this), getRegistryName()); + } + + @SideOnly(Side.CLIENT) + @Override + public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List stacks) { + for(int i = 0; i < PlatformVariant.values().length; i++) + stacks.add(new ItemStack(item, 1, i)); } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - icons = new IIcon[SUBTYPES]; - for(int i = 0; i < SUBTYPES; i++) - icons[i] = IconHelper.forBlock(par1IconRegister, this, i); + public void addCollisionBoxToList(IBlockState state, @Nonnull World world, @Nonnull BlockPos pos, @Nonnull AxisAlignedBB par5AxisAlignedBB, @Nonnull List stacks, Entity par7Entity) { + PlatformVariant variant = state.getValue(BotaniaStateProps.PLATFORM_VARIANT); + if(variant == PlatformVariant.INFRANGIBLE || variant == PlatformVariant.ABSTRUSE && par7Entity != null && par7Entity.posY > pos.getY() + 0.9 && (!(par7Entity instanceof EntityPlayer) || !par7Entity.isSneaking())) + super.addCollisionBoxToList(state, world, pos, par5AxisAlignedBB, stacks, par7Entity); } @Override - public IIcon getIcon(int par1, int par2) { - return icons[Math.min(SUBTYPES - 1, par2)]; + public float getBlockHardness(IBlockState state, World world, BlockPos pos) { + PlatformVariant variant = world.getBlockState(pos).getValue(BotaniaStateProps.PLATFORM_VARIANT); + return variant == PlatformVariant.INFRANGIBLE ? -1F : super.getBlockHardness(state, world, pos); } + @Nonnull @Override - public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { - int meta = par1World.getBlockMetadata(par2, par3, par4); - if(meta == 2 || meta == 0 && par7Entity != null && par7Entity.posY > par3 + (par7Entity instanceof EntityPlayer ? 2 : 0) && (!(par7Entity instanceof EntityPlayer) || !par7Entity.isSneaking())) - super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); - } - - @Override - public float getBlockHardness(World par1World, int par2, int par3, int par4) { - int meta = par1World.getBlockMetadata(par2, par3, par4); - return meta == 2 ? -1F : super.getBlockHardness(par1World, par2, par3, par4); - } - - @Override - public TileCamo createNewTileEntity(World world, int meta) { + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TilePlatform(); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { - int meta = world.getBlockMetadata(x, y, z); - return meta == 0 ? LexiconData.platform : meta == 2 ? null : LexiconData.spectralPlatform; + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { + PlatformVariant variant = world.getBlockState(pos).getValue(BotaniaStateProps.PLATFORM_VARIANT); + return variant == PlatformVariant.ABSTRUSE ? LexiconData.platform : variant == PlatformVariant.INFRANGIBLE ? null : LexiconData.spectralPlatform; } @Override - public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int side) { - TilePlatform tile = (TilePlatform) world.getTileEntity(x, y, z); + public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, BlockPos pos, EnumFacing side) { + TilePlatform tile = (TilePlatform) world.getTileEntity(pos); return tile.onWanded(player); } + @Override + public boolean isGhost(IBlockState state, World world, BlockPos pos) { + return true; + } + + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerBlockToState(this, 3); + // Statemapper after item registration, because the items should be registered to the actual variant names + ModelLoader.setCustomStateMapper(this, new StateMap.Builder().ignore(BotaniaStateProps.PLATFORM_VARIANT).build()); + + } } \ No newline at end of file diff --git a/src/main/java/vazkii/botania/common/block/BlockPylon.java b/src/main/java/vazkii/botania/common/block/BlockPylon.java index c6ed2b133..91445d0bc 100644 --- a/src/main/java/vazkii/botania/common/block/BlockPylon.java +++ b/src/main/java/vazkii/botania/common/block/BlockPylon.java @@ -10,108 +10,150 @@ */ package vazkii.botania.common.block; -import java.util.List; - -import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.fml.common.Optional; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import thaumcraft.api.crafting.IInfusionStabiliser; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.lib.LibRenderIDs; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.PylonVariant; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.block.tile.TilePylon; import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.Optional; -import cpw.mods.fml.common.registry.GameRegistry; + +import javax.annotation.Nonnull; +import java.util.List; @Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.crafting.IInfusionStabiliser", striprefs = true) -public class BlockPylon extends BlockModContainer implements ILexiconable, IInfusionStabiliser { +public class BlockPylon extends BlockMod implements ILexiconable, IInfusionStabiliser { + + private static final AxisAlignedBB AABB = new AxisAlignedBB(0.125, 0, 0.125, 0.875, 21.0/16, 0.875); public BlockPylon() { - super(Material.iron); + super(Material.IRON, LibBlockNames.PYLON); setHardness(5.5F); - setStepSound(soundTypeMetal); - setBlockName(LibBlockNames.PYLON); + setSoundType(SoundType.METAL); setLightLevel(0.5F); - - float f = 1F / 16F * 2F; - setBlockBounds(f, 0F, f, 1F - f, 1F / 16F * 21F, 1F - f); } + + @Nonnull @Override - protected boolean shouldRegisterInNameSet() { + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { + return AABB; + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.PYLON_VARIANT); + } + + @Override + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.PYLON_VARIANT, PylonVariant.MANA); + } + + @Override + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.PYLON_VARIANT).ordinal(); + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + if (meta > PylonVariant.values().length) { + meta = 0; + } + return getDefaultState().withProperty(BotaniaStateProps.PYLON_VARIANT, PylonVariant.values()[meta]); + } + + @Override + public void registerItemForm() { + GameRegistry.register(new ItemBlockWithMetadataAndName(this), getRegistryName()); + } + + @Override + public int damageDropped(IBlockState state) { + return getMetaFromState(state); + } + + @SideOnly(Side.CLIENT) + @Override + public void getSubBlocks(@Nonnull Item item, CreativeTabs par2, List par3) { + for(int i = 0; i < PylonVariant.values().length; i++) + par3.add(new ItemStack(item, 1, i)); + } + + @Override + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public Block setBlockName(String par1Str) { - GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, par1Str); - return super.setBlockName(par1Str); - } - - @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - // NO-OP - } - - @Override - public int damageDropped(int par1) { - return par1; - } - - @Override - public void getSubBlocks(Item par1, CreativeTabs par2, List par3) { - for(int i = 0; i < 3; i++) - par3.add(new ItemStack(par1, 1, i)); - } - - @Override - public IIcon getIcon(int par1, int par2) { - return par2 == 0 ? Blocks.diamond_block.getIcon(0, 0) : ModBlocks.storage.getIcon(0, par2); - } - - @Override - public boolean isOpaqueCube() { + public boolean isFullCube(IBlockState state) { return false; } + @Nonnull @Override - public boolean renderAsNormalBlock() { - return false; + public EnumBlockRenderType getRenderType(IBlockState state) { + return EnumBlockRenderType.ENTITYBLOCK_ANIMATED; } @Override - public int getRenderType() { - return LibRenderIDs.idPylon; + public float getEnchantPowerBonus(World world, BlockPos pos) { + IBlockState state = world.getBlockState(pos); + if (state.getBlock() != this || state.getValue(BotaniaStateProps.PYLON_VARIANT) == PylonVariant.MANA) { + return 8; + } else { + return 15; + } } @Override - public float getEnchantPowerBonus(World world, int x, int y, int z) { - return world.getBlockMetadata(x, y, z) == 0 ? 8 : 15; + public boolean hasTileEntity(IBlockState state) { + return true; } + @Nonnull @Override - public TileEntity createNewTileEntity(World world, int meta) { + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TilePylon(); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { - int meta = world.getBlockMetadata(x, y, z); - return meta == 0 ? LexiconData.pylon : meta == 1 ? LexiconData.alfhomancyIntro : LexiconData.gaiaRitual; + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { + PylonVariant variant = world.getBlockState(pos).getValue(BotaniaStateProps.PYLON_VARIANT); + return variant == PylonVariant.MANA ? LexiconData.pylon : variant == PylonVariant.NATURA ? LexiconData.alfhomancyIntro : LexiconData.gaiaRitual; } + @Override - public boolean canStabaliseInfusion(World world, int x, int y, int z) { + public boolean canStabaliseInfusion(World world, BlockPos pos) { return ConfigHandler.enableThaumcraftStablizers; } + + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerBlockToState(this, PylonVariant.values().length); + } } diff --git a/src/main/java/vazkii/botania/common/block/BlockRoot.java b/src/main/java/vazkii/botania/common/block/BlockRoot.java index 4a5810bfe..f825b95bb 100644 --- a/src/main/java/vazkii/botania/common/block/BlockRoot.java +++ b/src/main/java/vazkii/botania/common/block/BlockRoot.java @@ -10,12 +10,14 @@ */ package vazkii.botania.common.block; -import java.util.Random; - +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; @@ -23,23 +25,30 @@ import vazkii.botania.common.item.ModItems; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; +import javax.annotation.Nonnull; +import java.util.Random; + public class BlockRoot extends BlockMod implements ILexiconable { public BlockRoot() { - super(Material.plants); + super(Material.PLANTS, LibBlockNames.ROOT); setHardness(1.2F); - setStepSound(soundTypeWood); - setBlockName(LibBlockNames.ROOT); + setSoundType(SoundType.WOOD); } + @Nonnull + @Override + public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player) { + return new ItemStack(this); + } @Override - public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + public Item getItemDropped(IBlockState state, Random rand, int fortune) { return ModItems.manaResource; } @Override - public int damageDropped(int p_149692_1_) { + public int damageDropped(IBlockState state) { return 20; } @@ -49,7 +58,7 @@ public class BlockRoot extends BlockMod implements ILexiconable { } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.gardenOfGlass; } diff --git a/src/main/java/vazkii/botania/common/block/BlockSolidVines.java b/src/main/java/vazkii/botania/common/block/BlockSolidVines.java index f75af748e..0080e3acc 100644 --- a/src/main/java/vazkii/botania/common/block/BlockSolidVines.java +++ b/src/main/java/vazkii/botania/common/block/BlockSolidVines.java @@ -10,64 +10,60 @@ */ package vazkii.botania.common.block; -import java.util.Random; - -import net.minecraft.block.Block; import net.minecraft.block.BlockVine; +import net.minecraft.block.SoundType; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.fml.common.registry.GameRegistry; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.common.item.block.ItemBlockMod; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.registry.GameRegistry; +import vazkii.botania.common.lib.LibMisc; + +import javax.annotation.Nonnull; +import java.util.Random; public class BlockSolidVines extends BlockVine implements ILexiconable { public BlockSolidVines() { - setBlockName(LibBlockNames.SOLID_VINE); + setRegistryName(new ResourceLocation(LibMisc.MOD_ID, LibBlockNames.SOLID_VINE)); + GameRegistry.register(this); + setUnlocalizedName(LibBlockNames.SOLID_VINE); setHardness(0.5F); - setStepSound(soundTypeGrass); - setBlockTextureName("vine"); + setSoundType(SoundType.PLANT); setCreativeTab(null); } @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World w, int x, int y, int z) { - setBlockBoundsBasedOnState(w, x, y, z); - return AxisAlignedBB.getBoundingBox(x + minX, y + minY, z + minZ, x + maxX, y + maxY, z + maxZ); + public AxisAlignedBB getCollisionBoundingBox(IBlockState state, World world, BlockPos pos) { + return getBoundingBox(state, world, pos); } @Override - public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { - // NO-OP - } + public void updateTick(World world, @Nonnull BlockPos pos, @Nonnull IBlockState state, @Nonnull Random rand) {} @Override - public Block setBlockName(String par1Str) { - GameRegistry.registerBlock(this, ItemBlockMod.class, par1Str); - return super.setBlockName(par1Str); - } - - @Override - public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z) { + public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos) { return false; } + @Nonnull @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) { - return new ItemStack(Blocks.vine); + public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player) { + return new ItemStack(Blocks.VINE); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.vineBall; } - } diff --git a/src/main/java/vazkii/botania/common/block/BlockSparkChanger.java b/src/main/java/vazkii/botania/common/block/BlockSparkChanger.java index f8a69fe9f..f84460779 100644 --- a/src/main/java/vazkii/botania/common/block/BlockSparkChanger.java +++ b/src/main/java/vazkii/botania/common/block/BlockSparkChanger.java @@ -10,104 +10,120 @@ */ package vazkii.botania.common.block; -import java.util.Random; - import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.core.helper.IconHelper; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.common.block.tile.TileSimpleInventory; import vazkii.botania.common.block.tile.TileSparkChanger; +import vazkii.botania.common.core.helper.InventoryHelper; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -public class BlockSparkChanger extends BlockModContainer implements ILexiconable { +import javax.annotation.Nonnull; +import java.util.Random; - IIcon[] icons; - Random random; +public class BlockSparkChanger extends BlockMod implements ILexiconable { + + private static final AxisAlignedBB AABB = new AxisAlignedBB(0, 0, 0, 1, 3.0/16, 1); public BlockSparkChanger() { - super(Material.rock); - setBlockBounds(0F, 0F, 0F, 1F, 3F / 16F, 1F); + super(Material.ROCK, LibBlockNames.SPARK_CHANGER); setHardness(2.0F); setResistance(10.0F); - setStepSound(soundTypeStone); - setBlockName(LibBlockNames.SPARK_CHANGER); + setSoundType(SoundType.STONE); + } - random = new Random(); + @Nonnull + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { + return AABB; + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.POWERED); } @Override - public boolean renderAsNormalBlock() { + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.POWERED, true); + } + + @Override + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.POWERED) ? 8 : 0; + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + return getDefaultState().withProperty(BotaniaStateProps.POWERED, meta == 8); + } + + @Override + public boolean isFullCube(IBlockState state) { return false; } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public boolean getBlocksMovement(IBlockAccess p_149655_1_, int p_149655_2_, int p_149655_3_, int p_149655_4_) { + public boolean isPassable(IBlockAccess world, BlockPos pos) { return false; } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - icons = new IIcon[3]; - for(int i = 0; i < icons.length; i++) - icons[i] = IconHelper.forBlock(par1IconRegister, this, i); - } - - @Override - public IIcon getIcon(int par1, int par2) { - return icons[Math.min(2, par1)]; - } - - @Override - public void onNeighborBlockChange(World world, int x, int y, int z, Block block) { - boolean power = world.isBlockIndirectlyGettingPowered(x, y, z) || world.isBlockIndirectlyGettingPowered(x, y + 1, z); - int meta = world.getBlockMetadata(x, y, z); - boolean powered = (meta & 8) != 0; + public void neighborChanged(IBlockState state, World world, BlockPos pos, Block block) { + boolean power = world.isBlockIndirectlyGettingPowered(pos) > 0 || world.isBlockIndirectlyGettingPowered(pos.up()) > 0; + boolean powered = state.getValue(BotaniaStateProps.POWERED); if(power && !powered) { - ((TileSparkChanger) world.getTileEntity(x, y, z)).doSwap(); - world.setBlockMetadataWithNotify(x, y, z, meta | 8, 4); + ((TileSparkChanger) world.getTileEntity(pos)).doSwap(); + world.setBlockState(pos, state.withProperty(BotaniaStateProps.POWERED, true), 4); } else if(!power && powered) - world.setBlockMetadataWithNotify(x, y, z, meta & -9, 4); + world.setBlockState(pos, state.withProperty(BotaniaStateProps.POWERED, false), 4); } @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int s, float xs, float ys, float zs) { - TileSparkChanger changer = (TileSparkChanger) world.getTileEntity(x, y, z); - ItemStack cstack = changer.getStackInSlot(0); - ItemStack pstack = player.getCurrentEquippedItem(); + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack pstack, EnumFacing s, float xs, float ys, float zs) { + TileSparkChanger changer = (TileSparkChanger) world.getTileEntity(pos); + ItemStack cstack = changer.getItemHandler().getStackInSlot(0); if(cstack != null) { - changer.setInventorySlotContents(0, null); - world.func_147453_f(x, y, z, this); + changer.getItemHandler().setStackInSlot(0, null); + world.updateComparatorOutputLevel(pos, this); changer.markDirty(); if(!player.inventory.addItemStackToInventory(cstack)) - player.dropPlayerItemWithRandomChoice(cstack, false); + player.dropItem(cstack, false); return true; } else if(pstack != null && pstack.getItem() == ModItems.sparkUpgrade) { - changer.setInventorySlotContents(0, pstack.copy().splitStack(1)); - world.func_147453_f(x, y, z, this); + changer.getItemHandler().setStackInSlot(0, pstack.copy().splitStack(1)); + world.updateComparatorOutputLevel(pos, this); changer.markDirty(); pstack.stackSize--; if(pstack.stackSize == 0) - player.inventory.setInventorySlotContents(player.inventory.currentItem, null); + player.setHeldItem(hand, null); return true; } @@ -116,64 +132,41 @@ public class BlockSparkChanger extends BlockModContainer implements ILexiconable } @Override - public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { - TileSimpleInventory inv = (TileSimpleInventory) par1World.getTileEntity(par2, par3, par4); + public void breakBlock(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state) { + TileSimpleInventory inv = (TileSimpleInventory) world.getTileEntity(pos); - if (inv != null) { - for (int j1 = 0; j1 < inv.getSizeInventory(); ++j1) { - ItemStack itemstack = inv.getStackInSlot(j1); + InventoryHelper.dropInventory(inv, world, state, pos); - if (itemstack != null) { - float f = random.nextFloat() * 0.8F + 0.1F; - float f1 = random.nextFloat() * 0.8F + 0.1F; - EntityItem entityitem; - - for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) { - int k1 = random.nextInt(21) + 10; - - if (k1 > itemstack.stackSize) - k1 = itemstack.stackSize; - - itemstack.stackSize -= k1; - entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage())); - float f3 = 0.05F; - entityitem.motionX = (float)random.nextGaussian() * f3; - entityitem.motionY = (float)random.nextGaussian() * f3 + 0.2F; - entityitem.motionZ = (float)random.nextGaussian() * f3; - - if (itemstack.hasTagCompound()) - entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy()); - } - } - } - - par1World.func_147453_f(par2, par3, par4, par5); - } - - super.breakBlock(par1World, par2, par3, par4, par5, par6); + super.breakBlock(world, pos, state); } @Override - public boolean hasComparatorInputOverride() { + public boolean hasComparatorInputOverride(IBlockState state) { return true; } @Override - public int getComparatorInputOverride(World world, int x, int y, int z, int s) { - TileSparkChanger changer = (TileSparkChanger) world.getTileEntity(x, y, z); - ItemStack stack = changer.getStackInSlot(0); + public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) { + TileSparkChanger changer = (TileSparkChanger) world.getTileEntity(pos); + ItemStack stack = changer.getItemHandler().getStackInSlot(0); if(stack == null) return 0; return stack.getItemDamage() + 1; } @Override - public TileEntity createNewTileEntity(World world, int meta) { + public boolean hasTileEntity(IBlockState state) { + return true; + } + + @Nonnull + @Override + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileSparkChanger(); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.sparkChanger; } diff --git a/src/main/java/vazkii/botania/common/block/BlockSpecialFlower.java b/src/main/java/vazkii/botania/common/block/BlockSpecialFlower.java index e44ac4941..314a969fd 100644 --- a/src/main/java/vazkii/botania/common/block/BlockSpecialFlower.java +++ b/src/main/java/vazkii/botania/common/block/BlockSpecialFlower.java @@ -10,59 +10,70 @@ */ package vazkii.botania.common.block; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import net.minecraft.block.Block; import net.minecraft.block.BlockFlower; -import net.minecraft.block.ITileEntityProvider; +import net.minecraft.block.SoundType; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.renderer.block.statemap.StateMap; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.passive.EntitySheep; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; +import net.minecraft.item.EnumDyeColor; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.BlockRenderLayer; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.common.property.ExtendedBlockState; +import net.minecraftforge.common.property.IExtendedBlockState; +import net.minecraftforge.common.property.IUnlistedProperty; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.api.subtile.ISpecialFlower; +import vazkii.botania.api.subtile.SubTileEntity; import vazkii.botania.api.wand.IWandHUD; import vazkii.botania.api.wand.IWandable; -import vazkii.botania.client.lib.LibRenderIDs; +import vazkii.botania.client.core.handler.ModelHandler; +import vazkii.botania.client.render.IModelRegister; +import vazkii.botania.common.Botania; import vazkii.botania.common.block.tile.TileSpecialFlower; import vazkii.botania.common.core.BotaniaCreativeTab; -import vazkii.botania.common.integration.coloredlights.LightHelper; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.item.block.ItemBlockSpecialFlower; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.registry.GameRegistry; +import vazkii.botania.common.lib.LibMisc; -public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvider, ISpecialFlower, IWandable, ILexiconable, IWandHUD { +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; - public static Map icons = new HashMap(); - public static Map iconsAlt = new HashMap(); +public class BlockSpecialFlower extends BlockFlower implements ISpecialFlower, IWandable, ILexiconable, IWandHUD, IModelRegister { static { - BotaniaAPI.subtilesForCreativeMenu.addAll(Arrays.asList(new String[] { + BotaniaAPI.subtilesForCreativeMenu.addAll(Arrays.asList( // Misc LibBlockNames.SUBTILE_PUREDAISY, LibBlockNames.SUBTILE_MANASTAR, // Generating - LibBlockNames.SUBTILE_DAYBLOOM, - LibBlockNames.SUBTILE_NIGHTSHADE, LibBlockNames.SUBTILE_ENDOFLAME, LibBlockNames.SUBTILE_HYDROANGEAS, LibBlockNames.SUBTILE_THERMALILY, @@ -101,113 +112,169 @@ public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvid LibBlockNames.SUBTILE_VINCULOTUS, LibBlockNames.SUBTILE_SPECTRANTHEMUM, LibBlockNames.SUBTILE_BUBBELL, - LibBlockNames.SUBTILE_SOLEGNOLIA - })); + LibBlockNames.SUBTILE_SOLEGNOLIA, + LibBlockNames.SUBTILE_BERGAMUTE)); } + private static final AxisAlignedBB AABB = new AxisAlignedBB(0.3, 0, 0.3, 0.8, 1, 0.8); + protected BlockSpecialFlower() { - super(0); - setBlockName(LibBlockNames.SPECIAL_FLOWER); + setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE).withProperty(type, EnumFlowerType.POPPY)); + setRegistryName(new ResourceLocation(LibMisc.MOD_ID, LibBlockNames.SPECIAL_FLOWER)); + GameRegistry.register(this); + GameRegistry.register(new ItemBlockSpecialFlower(this), getRegistryName()); + setUnlocalizedName(LibBlockNames.SPECIAL_FLOWER); setHardness(0.1F); - setStepSound(soundTypeGrass); + setSoundType(SoundType.PLANT); setTickRandomly(false); setCreativeTab(BotaniaCreativeTab.INSTANCE); - setBlockBounds(0.3F, 0.0F, 0.3F, 0.8F, 1, 0.8F); } + @Nonnull @Override - public int getLightValue(IBlockAccess world, int x, int y, int z) { - int currentLight = ((TileSpecialFlower) world.getTileEntity(x, y, z)).getLightValue(); - if(currentLight == -1) - currentLight = 0; - return LightHelper.getPackedColor(world.getBlockMetadata(x, y, z), currentLight); + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { + return AABB; } + @Nonnull @Override - public boolean hasComparatorInputOverride() { - return true; + public BlockStateContainer createBlockState() { + return new ExtendedBlockState(this, new IProperty[] { getTypeProperty(), BotaniaStateProps.COLOR }, new IUnlistedProperty[] { BotaniaStateProps.SUBTILE_ID } ); } + @Nonnull @Override - public int getComparatorInputOverride(World world, int x, int y, int z, int side) { - return ((TileSpecialFlower) world.getTileEntity(x, y, z)).getComparatorInputOverride(side); - } - - @Override - public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int side) { - return ((TileSpecialFlower) world.getTileEntity(x, y, z)).getPowerLevel(side); - } - - @Override - public int isProvidingStrongPower(IBlockAccess world, int x, int y, int z, int side) { - return isProvidingWeakPower(world, x, y, z, side); - } - - @Override - public boolean canProvidePower() { - return true; - } - - @Override - public int getRenderType() { - return LibRenderIDs.idSpecialFlower; - } - - @Override - public Block setBlockName(String par1Str) { - GameRegistry.registerBlock(this, ItemBlockSpecialFlower.class, par1Str); - return super.setBlockName(par1Str); - } - - @Override - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for(String s : BotaniaAPI.subtilesForCreativeMenu) { - par3List.add(ItemBlockSpecialFlower.ofType(s)); - if(BotaniaAPI.miniFlowers.containsKey(s)) - par3List.add(ItemBlockSpecialFlower.ofType(BotaniaAPI.miniFlowers.get(s))); + public IExtendedBlockState getExtendedState(@Nonnull IBlockState state, IBlockAccess world, BlockPos pos) { + TileEntity te = world.getTileEntity(pos); + if (te instanceof TileSpecialFlower && ((TileSpecialFlower) te).getSubTile() != null) { + Class clazz = ((TileSpecialFlower) te).getSubTile().getClass(); + String id = BotaniaAPI.getSubTileStringMapping(clazz); + return ((IExtendedBlockState) state).withProperty(BotaniaStateProps.SUBTILE_ID, id); + } else { + return ((IExtendedBlockState) state); } } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - for(String s : BotaniaAPI.getAllSubTiles()) - if(!s.isEmpty()) - BotaniaAPI.getSignatureForName(s).registerIcons(par1IconRegister); + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.COLOR).getMetadata(); + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + if (meta > 15) { + meta = 0; + } + return getDefaultState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.byMetadata(meta)); } @Override - public IIcon getIcon(IBlockAccess par1iBlockAccess, int par2, int par3, int par4, int par5) { - return ((TileSpecialFlower) par1iBlockAccess.getTileEntity(par2, par3, par4)).getIcon(); + public int getLightValue(@Nonnull IBlockState state, IBlockAccess world, @Nonnull BlockPos pos) { + if(world.getBlockState(pos).getBlock() != this) + return world.getBlockState(pos).getLightValue(world, pos); + + return world.getTileEntity(pos) == null ? 0 : ((TileSpecialFlower) world.getTileEntity(pos)).getLightValue(); } @Override - public IIcon getIcon(int par1, int par2) { - return BlockModFlower.icons[16]; + public boolean hasComparatorInputOverride(IBlockState state) { + return true; } @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) { - String name = ((TileSpecialFlower) world.getTileEntity(x, y, z)).subTileName; + public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) { + return ((TileSpecialFlower) world.getTileEntity(pos)).getComparatorInputOverride(); + } + + @Override + public int getWeakPower(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) { + return ((TileSpecialFlower) world.getTileEntity(pos)).getPowerLevel(side); + } + + @Override + public int getStrongPower(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) { + return getWeakPower(state, world, pos, side); + } + + @Override + public boolean canProvidePower(IBlockState state) { + return true; + } + + @SideOnly(Side.CLIENT) + @Nonnull + @Override + public BlockRenderLayer getBlockLayer() { + return BlockRenderLayer.CUTOUT; + } + + @SideOnly(Side.CLIENT) + @Override + public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, @Nonnull List stacks) { + for(String s : BotaniaAPI.subtilesForCreativeMenu) { + stacks.add(ItemBlockSpecialFlower.ofType(s)); + if(BotaniaAPI.miniFlowers.containsKey(s)) + stacks.add(ItemBlockSpecialFlower.ofType(BotaniaAPI.miniFlowers.get(s))); + } + } + + @Nonnull + @Override + public EnumFlowerColor getBlockType() { + return EnumFlowerColor.RED; + } + + @Nonnull + @Override + public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player) { + String name = ((TileSpecialFlower) world.getTileEntity(pos)).subTileName; return ItemBlockSpecialFlower.ofType(name); } @Override - protected boolean canPlaceBlockOn(Block block) { - return super.canPlaceBlockOn(block) || block == ModBlocks.redStringRelay || block == Blocks.mycelium; + public boolean canPlaceBlockAt(World world, BlockPos pos) { + return world.getBlockState(pos.down()).getBlock() == ModBlocks.redStringRelay + || world.getBlockState(pos.down()).getBlock() == Blocks.MYCELIUM + || super.canPlaceBlockAt(world, pos); } @Override - public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) { - if(!par6EntityPlayer.capabilities.isCreativeMode) { - dropBlockAsItem(par1World, par2, par3, par4, par5, 0); - ((TileSpecialFlower) par1World.getTileEntity(par2, par3, par4)).onBlockHarvested(par1World, par2, par3, par4, par5, par6EntityPlayer); + protected boolean canSustainBush(IBlockState state) { + return state.getBlock() == ModBlocks.redStringRelay + || state.getBlock() == Blocks.MYCELIUM + || super.canSustainBush(state); + } + + @Override + public void onBlockHarvested(World world, BlockPos pos, IBlockState state, EntityPlayer player) { + ((TileSpecialFlower) world.getTileEntity(pos)).onBlockHarvested(world, pos, state, player); + } + + @Override + public boolean removedByPlayer(@Nonnull IBlockState state, World world, @Nonnull BlockPos pos, @Nonnull EntityPlayer player, boolean willHarvest) { + if (willHarvest) { + // Copy of super.removedByPlayer but don't set to air yet + // This is so getDrops below will have a TE to work with + onBlockHarvested(world, pos, state, player); + return true; + } else { + return super.removedByPlayer(state, world, pos, player, willHarvest); } } @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList list = new ArrayList(); - TileEntity tile = world.getTileEntity(x, y, z); + public void harvestBlock(@Nonnull World world, EntityPlayer player, @Nonnull BlockPos pos, @Nonnull IBlockState state, TileEntity te, ItemStack stack) { + super.harvestBlock(world, player, pos, state, te, stack); + // Now delete the block and TE + world.setBlockToAir(pos); + } + + @Nonnull + @Override + public List getDrops(IBlockAccess world, BlockPos pos, @Nonnull IBlockState state, int fortune) { + ArrayList list = new ArrayList<>(); + TileEntity tile = world.getTileEntity(pos); if(tile != null) { String name = ((TileSpecialFlower) tile).subTileName; @@ -219,59 +286,67 @@ public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvid } @Override - public boolean onBlockEventReceived(World par1World, int par2, int par3, int par4, int par5, int par6) { - super.onBlockEventReceived(par1World, par2, par3, par4, par5, par6); - TileEntity tileentity = par1World.getTileEntity(par2, par3, par4); + public boolean eventReceived(IBlockState state, World world, BlockPos pos, int par5, int par6) { + super.eventReceived(state, world, pos, par5, par6); + TileEntity tileentity = world.getTileEntity(pos); return tileentity != null ? tileentity.receiveClientEvent(par5, par6) : false; } @Override - public TileEntity createNewTileEntity(World world, int meta) { + public boolean hasTileEntity(IBlockState state) { + return true; + } + + @Nonnull + @Override + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileSpecialFlower(); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { - return ((TileSpecialFlower) world.getTileEntity(x, y, z)).getEntry(); + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { + return ((TileSpecialFlower) world.getTileEntity(pos)).getEntry(); } @Override - public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int side) { - return ((TileSpecialFlower) world.getTileEntity(x, y, z)).onWanded(stack, player); + public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, BlockPos pos, EnumFacing side) { + return ((TileSpecialFlower) world.getTileEntity(pos)).onWanded(stack, player); } @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) { - ((TileSpecialFlower) world.getTileEntity(x, y, z)).onBlockPlacedBy(world, x, y, z, entity, stack); + public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase entity, ItemStack stack) { + ((TileSpecialFlower) world.getTileEntity(pos)).onBlockPlacedBy(world, pos, state, entity, stack); } @Override - public void onBlockAdded(World world, int x, int y, int z) { - ((TileSpecialFlower) world.getTileEntity(x, y, z)).onBlockAdded(world, x, y, z); + public void onBlockAdded(World world, BlockPos pos, IBlockState state) { + ((TileSpecialFlower) world.getTileEntity(pos)).onBlockAdded(world, pos, state); } @Override - public int colorMultiplier(IBlockAccess world, int x, int y, int z) { - float[] rgb = EntitySheep.fleeceColorTable[world.getBlockMetadata(x, y, z)]; - return ((int) (rgb[0] * 255) << 16) + ((int) (rgb[1] * 255) << 8) + (int) (rgb[2] * 255); - } - - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - ItemStack stack = player.getCurrentEquippedItem(); + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing side, float hitX, float hitY, float hitZ) { if(stack != null && stack.getItem() == ModItems.dye) { - int newMeta = stack.getItemDamage(); - int oldMeta = world.getBlockMetadata(x, y, z); - if(newMeta != oldMeta) - world.setBlockMetadataWithNotify(x, y, z, newMeta, 1 | 2); + EnumDyeColor newColor = EnumDyeColor.byMetadata(stack.getItemDamage()); + EnumDyeColor oldColor = state.getValue(BotaniaStateProps.COLOR); + if(newColor != oldColor) + world.setBlockState(pos, state.withProperty(BotaniaStateProps.COLOR, newColor), 1 | 2); + return true; } - return ((TileSpecialFlower) world.getTileEntity(x, y, z)).onBlockActivated(world, x, y, z, player, side, hitX, hitY, hitZ); + return ((TileSpecialFlower) world.getTileEntity(pos)).onBlockActivated(world, pos, state, player, hand, stack, side, hitX, hitY, hitZ); } + @SideOnly(Side.CLIENT) @Override - public void renderHUD(Minecraft mc, ScaledResolution res, World world, int x, int y, int z) { - ((TileSpecialFlower) world.getTileEntity(x, y, z)).renderHUD(mc, res); + public void renderHUD(Minecraft mc, ScaledResolution res, World world, BlockPos pos) { + ((TileSpecialFlower) world.getTileEntity(pos)).renderHUD(mc, res); } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + // Let custom loader work + ModelLoader.setCustomStateMapper(this, new StateMap.Builder().ignore(BotaniaStateProps.COLOR).ignore(getTypeProperty()).build()); + ModelHandler.registerInventoryVariant(this); + } } diff --git a/src/main/java/vazkii/botania/common/block/BlockStorage.java b/src/main/java/vazkii/botania/common/block/BlockStorage.java index bf35e1173..bbffed6e0 100644 --- a/src/main/java/vazkii/botania/common/block/BlockStorage.java +++ b/src/main/java/vazkii/botania/common/block/BlockStorage.java @@ -10,86 +10,98 @@ */ package vazkii.botania.common.block; -import java.util.List; - -import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.core.helper.IconHelper; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.StorageVariant; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.item.block.ItemBlockStorage; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import javax.annotation.Nonnull; +import java.util.List; public class BlockStorage extends BlockMod implements ILexiconable { - private static final int SUBTYPES = 5; - - IIcon[] icons; - public BlockStorage() { - super(Material.iron); + super(Material.IRON, LibBlockNames.STORAGE); setHardness(3F); setResistance(10F); - setStepSound(soundTypeMetal); - setBlockName(LibBlockNames.STORAGE); + setSoundType(SoundType.METAL); + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.STORAGE_VARIANT); } @Override - public void getSubBlocks(Item par1, CreativeTabs par2, List par3) { - for(int i = 0; i < SUBTYPES; i++) - par3.add(new ItemStack(par1, 1, i)); + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.STORAGE_VARIANT, StorageVariant.MANASTEEL); } @Override - public Block setBlockName(String par1Str) { - GameRegistry.registerBlock(this, ItemBlockStorage.class, par1Str); - return super.setBlockName(par1Str); + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.STORAGE_VARIANT).ordinal(); } + @Nonnull @Override - public int damageDropped(int meta) { - return meta; + public IBlockState getStateFromMeta(int meta) { + if (meta >= StorageVariant.values().length) { + meta = 0; + } + return getDefaultState().withProperty(BotaniaStateProps.STORAGE_VARIANT, StorageVariant.values()[meta]); } - @Override - protected boolean shouldRegisterInNameSet() { - return false; - } - - @Override @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - icons = new IIcon[SUBTYPES]; - for(int i = 0; i < icons.length; i++) - icons[i] = IconHelper.forBlock(par1IconRegister, this, i); + @Override + public void getSubBlocks(@Nonnull Item item, CreativeTabs par2, List par3) { + for(int i = 0; i < StorageVariant.values().length; i++) + par3.add(new ItemStack(item, 1, i)); } @Override - public IIcon getIcon(int par1, int par2) { - return icons[Math.min(icons.length - 1, par2)]; + public void registerItemForm() { + GameRegistry.register(new ItemBlockStorage(this), getRegistryName()); } @Override - public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) { + public int damageDropped(IBlockState state) { + return getMetaFromState(state); + } + + @Override + public boolean isBeaconBase(IBlockAccess worldObj, BlockPos pos, BlockPos beaconPos) { return true; } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { - int meta = world.getBlockMetadata(x, y, z); - return meta == 0 ? LexiconData.pool : LexiconData.terrasteel; + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { + StorageVariant variant = world.getBlockState(pos).getValue(BotaniaStateProps.STORAGE_VARIANT); + return variant == StorageVariant.MANASTEEL ? LexiconData.pool : LexiconData.terrasteel; + } + + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerBlockToState(this, StorageVariant.values().length); } } diff --git a/src/main/java/vazkii/botania/common/block/BlockTeruTeruBozu.java b/src/main/java/vazkii/botania/common/block/BlockTeruTeruBozu.java index 30e15f717..91dd42569 100644 --- a/src/main/java/vazkii/botania/common/block/BlockTeruTeruBozu.java +++ b/src/main/java/vazkii/botania/common/block/BlockTeruTeruBozu.java @@ -11,7 +11,7 @@ package vazkii.botania.common.block; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; @@ -19,26 +19,41 @@ import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.lib.LibRenderIDs; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.block.tile.TileTeruTeruBozu; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -public class BlockTeruTeruBozu extends BlockModContainer implements ILexiconable { +import javax.annotation.Nonnull; + +public class BlockTeruTeruBozu extends BlockMod implements ILexiconable { + + private static final AxisAlignedBB AABB = new AxisAlignedBB(0.25, 0.01, 0.25, 0.75, 0.99, 0.75); public BlockTeruTeruBozu() { - super(Material.cloth); - setBlockName(LibBlockNames.TERU_TERU_BOZU); - float f = 0.25F; - setBlockBounds(f, 0.01F, f, 1F - f, 0.99F, 1F - f); + super(Material.CLOTH, LibBlockNames.TERU_TERU_BOZU); + } + + @Nonnull + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { + return AABB; } @Override - public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity e) { + public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity e) { if(!world.isRemote && e instanceof EntityItem) { EntityItem item = (EntityItem) e; ItemStack stack = item.getEntityItem(); @@ -51,8 +66,7 @@ public class BlockTeruTeruBozu extends BlockModContainer implements ILexiconable } @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int s, float xs, float ys, float zs) { - ItemStack stack = player.getCurrentEquippedItem(); + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing s, float xs, float ys, float zs) { if(stack != null && (isSunflower(stack) && removeRain(world) || isBlueOrchid(stack) && startRain(world))) { if(!player.capabilities.isCreativeMode) stack.stackSize--; @@ -61,15 +75,15 @@ public class BlockTeruTeruBozu extends BlockModContainer implements ILexiconable return false; } - public boolean isSunflower(ItemStack stack) { - return stack.getItem() == Item.getItemFromBlock(Blocks.double_plant) && stack.getItemDamage() == 0; + private boolean isSunflower(ItemStack stack) { + return stack.getItem() == Item.getItemFromBlock(Blocks.DOUBLE_PLANT) && stack.getItemDamage() == 0; } - public boolean isBlueOrchid(ItemStack stack) { - return stack.getItem() == Item.getItemFromBlock(Blocks.red_flower) && stack.getItemDamage() == 1; + private boolean isBlueOrchid(ItemStack stack) { + return stack.getItem() == Item.getItemFromBlock(Blocks.RED_FLOWER) && stack.getItemDamage() == 1; } - public boolean removeRain(World world) { + private boolean removeRain(World world) { if(world.isRaining()) { world.getWorldInfo().setRaining(false); return true; @@ -77,7 +91,7 @@ public class BlockTeruTeruBozu extends BlockModContainer implements ILexiconable return false; } - public boolean startRain(World world) { + private boolean startRain(World world) { if(!world.isRaining()) { if(world.rand.nextInt(10) == 0) world.getWorldInfo().setRaining(true); @@ -87,48 +101,52 @@ public class BlockTeruTeruBozu extends BlockModContainer implements ILexiconable } @Override - public boolean hasComparatorInputOverride() { + public boolean hasComparatorInputOverride(IBlockState state) { return true; } @Override - public int getComparatorInputOverride(World world, int x, int y, int z, int s) { + public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) { return world.isRaining() ? 15 : 0; } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - // NO-OP - } - - @Override - public IIcon getIcon(int side, int meta) { - return Blocks.wool.getIcon(0, 0); - } - - @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public boolean renderAsNormalBlock() { + public boolean isFullCube(IBlockState state) { return false; } + @Nonnull @Override - public int getRenderType() { - return LibRenderIDs.idTeruTeruBozu; + public EnumBlockRenderType getRenderType(IBlockState state) { + return EnumBlockRenderType.ENTITYBLOCK_ANIMATED; } @Override - public TileEntity createNewTileEntity(World world, int meta) { + public boolean hasTileEntity(IBlockState state) { + return true; + } + + @Nonnull + @Override + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileTeruTeruBozu(); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.teruTeruBozu; } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerCustomItemblock(this, "teru_teru_bozu"); + ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(this), 0, TileTeruTeruBozu.class); + } + } diff --git a/src/main/java/vazkii/botania/common/block/BlockTinyPlanet.java b/src/main/java/vazkii/botania/common/block/BlockTinyPlanet.java index 6720700cf..8decb0596 100644 --- a/src/main/java/vazkii/botania/common/block/BlockTinyPlanet.java +++ b/src/main/java/vazkii/botania/common/block/BlockTinyPlanet.java @@ -10,47 +10,70 @@ */ package vazkii.botania.common.block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.api.mana.IManaCollisionGhost; import vazkii.botania.common.block.tile.TileTinyPlanet; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -public class BlockTinyPlanet extends BlockModContainer implements ILexiconable { +import javax.annotation.Nonnull; + +public class BlockTinyPlanet extends BlockMod implements ILexiconable, IManaCollisionGhost { + + private static final AxisAlignedBB AABB = new AxisAlignedBB(3.0/16, 3.0/16, 3.0/16, 13.0/16, 13.0/16, 13.0/16); protected BlockTinyPlanet() { - super(Material.rock); + super(Material.ROCK, LibBlockNames.TINY_PLANET); setHardness(20F); setResistance(100F); - setStepSound(soundTypeStone); - float size = 3F / 16F; - setBlockBounds(size, size, size, 1F - size, 1F - size, 1F - size); - setBlockName(LibBlockNames.TINY_PLANET); + setSoundType(SoundType.STONE); + } + + @Nonnull + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { + return AABB; } @Override - public boolean renderAsNormalBlock() { + public boolean isFullCube(IBlockState state) { return false; } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public TileEntity createNewTileEntity(World world, int meta) { + public boolean hasTileEntity(IBlockState state) { + return true; + } + + @Nonnull + @Override + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileTinyPlanet(); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.tinyPlanet; } + @Override + public boolean isGhost(IBlockState state, World world, BlockPos pos) { + return true; + } } diff --git a/src/main/java/vazkii/botania/common/block/ModBanners.java b/src/main/java/vazkii/botania/common/block/ModBanners.java new file mode 100644 index 000000000..0e5a137c1 --- /dev/null +++ b/src/main/java/vazkii/botania/common/block/ModBanners.java @@ -0,0 +1,47 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + * + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + * + * File Created @ [Aug 25, 2015, 7:11:35 PM (GMT)] + */ +package vazkii.botania.common.block; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntityBanner; +import net.minecraftforge.common.util.EnumHelper; +import vazkii.botania.common.item.ModItems; + +public final class ModBanners { + + public static void init() { + Class> clazz = TileEntityBanner.EnumBannerPattern.class; + addPattern(clazz, "flower", "flr", new ItemStack(ModItems.manaResource, 1, 3)); + addPattern(clazz, "lexicon", "lex", new ItemStack(ModItems.lexicon)); + addPattern(clazz, "logo", "lgo", new ItemStack(ModItems.manaResource, 1, 4)); + addPattern(clazz, "sapling", "spl", new ItemStack(ModItems.manaResource, 1, 13)); + addPattern(clazz, "tiny_potato", "tpt", new ItemStack(ModBlocks.tinyPotato)); + + addPattern(clazz, "spark_dispersive", "sds", new ItemStack(ModItems.sparkUpgrade, 1, 0)); + addPattern(clazz, "spark_dominant", "sdm", new ItemStack(ModItems.sparkUpgrade, 1, 1)); + addPattern(clazz, "spark_recessive", "src", new ItemStack(ModItems.sparkUpgrade, 1, 2)); + addPattern(clazz, "spark_isolated", "sis", new ItemStack(ModItems.sparkUpgrade, 1, 3)); + + addPattern(clazz, "fish", "fis", new ItemStack(Items.FISH)); + addPattern(clazz, "axe", "axe", new ItemStack(Items.IRON_AXE)); + addPattern(clazz, "hoe", "hoe", new ItemStack(Items.IRON_HOE)); + addPattern(clazz, "pickaxe", "pik", new ItemStack(Items.IRON_PICKAXE)); + addPattern(clazz, "shovel", "shv", new ItemStack(Items.IRON_SHOVEL)); + addPattern(clazz, "sword", "srd", new ItemStack(Items.IRON_SWORD)); + } + + public static void addPattern(Class> clazz, String name, String id, ItemStack craftingItem) { + name = "botania_" + name; + id = "bt_" + id; + EnumHelper.addEnum(clazz, name.toUpperCase(), new Class[] { String.class, String.class, ItemStack.class }, name, id, craftingItem); + } +} diff --git a/src/main/java/vazkii/botania/common/block/ModBlocks.java b/src/main/java/vazkii/botania/common/block/ModBlocks.java index 075722c82..eac1fe811 100644 --- a/src/main/java/vazkii/botania/common/block/ModBlocks.java +++ b/src/main/java/vazkii/botania/common/block/ModBlocks.java @@ -16,8 +16,12 @@ import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.fml.common.Loader; +import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.oredict.OreDictionary; import vazkii.botania.api.BotaniaAPI; +import vazkii.botania.api.recipe.RecipeManaInfusion; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.api.subtile.SubTileEntity; import vazkii.botania.client.lib.LibResources; import vazkii.botania.common.block.corporea.BlockCorporeaCrystalCube; @@ -30,23 +34,19 @@ import vazkii.botania.common.block.decor.BlockBuriedPetals; import vazkii.botania.common.block.decor.BlockCustomBrick; import vazkii.botania.common.block.decor.BlockDirtPath; import vazkii.botania.common.block.decor.BlockElfGlass; -import vazkii.botania.common.block.decor.BlockEndStoneBrick; import vazkii.botania.common.block.decor.BlockFloatingFlower; import vazkii.botania.common.block.decor.BlockManaBeacon; import vazkii.botania.common.block.decor.BlockManaFlame; import vazkii.botania.common.block.decor.BlockManaGlass; import vazkii.botania.common.block.decor.BlockModMushroom; import vazkii.botania.common.block.decor.BlockPetalBlock; -import vazkii.botania.common.block.decor.BlockPrismarine; -import vazkii.botania.common.block.decor.BlockReeds; -import vazkii.botania.common.block.decor.BlockSeaLamp; import vazkii.botania.common.block.decor.BlockShimmerrock; import vazkii.botania.common.block.decor.BlockShimmerwoodPlanks; import vazkii.botania.common.block.decor.BlockShinyFlower; import vazkii.botania.common.block.decor.BlockStarfield; -import vazkii.botania.common.block.decor.BlockThatch; import vazkii.botania.common.block.decor.BlockTinyPotato; import vazkii.botania.common.block.decor.BlockUnstable; +import vazkii.botania.common.block.dispenser.BehaviourFelPumpkin; import vazkii.botania.common.block.dispenser.BehaviourPoolMinecart; import vazkii.botania.common.block.dispenser.BehaviourSeeds; import vazkii.botania.common.block.dispenser.BehaviourWand; @@ -74,11 +74,11 @@ import vazkii.botania.common.block.string.BlockRedStringDispenser; import vazkii.botania.common.block.string.BlockRedStringFertilizer; import vazkii.botania.common.block.string.BlockRedStringInterceptor; import vazkii.botania.common.block.string.BlockRedStringRelay; -import vazkii.botania.common.block.subtile.SubTileDecor; import vazkii.botania.common.block.subtile.SubTileManastar; import vazkii.botania.common.block.subtile.SubTilePureDaisy; import vazkii.botania.common.block.subtile.functional.SubTileAgricarnation; import vazkii.botania.common.block.subtile.functional.SubTileBellethorn; +import vazkii.botania.common.block.subtile.functional.SubTileBergamute; import vazkii.botania.common.block.subtile.functional.SubTileBubbell; import vazkii.botania.common.block.subtile.functional.SubTileClayconia; import vazkii.botania.common.block.subtile.functional.SubTileDaffomill; @@ -104,7 +104,6 @@ import vazkii.botania.common.block.subtile.functional.SubTileTigerseye; import vazkii.botania.common.block.subtile.functional.SubTileVinculotus; import vazkii.botania.common.block.subtile.generating.SubTileArcaneRose; import vazkii.botania.common.block.subtile.generating.SubTileDandelifeon; -import vazkii.botania.common.block.subtile.generating.SubTileDaybloom; import vazkii.botania.common.block.subtile.generating.SubTileEndoflame; import vazkii.botania.common.block.subtile.generating.SubTileEntropinnyum; import vazkii.botania.common.block.subtile.generating.SubTileGourmaryllis; @@ -112,7 +111,6 @@ import vazkii.botania.common.block.subtile.generating.SubTileHydroangeas; import vazkii.botania.common.block.subtile.generating.SubTileKekimurus; import vazkii.botania.common.block.subtile.generating.SubTileMunchdew; import vazkii.botania.common.block.subtile.generating.SubTileNarslimmus; -import vazkii.botania.common.block.subtile.generating.SubTileNightshade; import vazkii.botania.common.block.subtile.generating.SubTileRafflowsia; import vazkii.botania.common.block.subtile.generating.SubTileSpectrolus; import vazkii.botania.common.block.subtile.generating.SubTileThermalily; @@ -173,8 +171,6 @@ import vazkii.botania.common.block.tile.string.TileRedStringRelay; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.lib.LibBlockNames; import vazkii.botania.common.lib.LibOreDict; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.registry.GameRegistry; public final class ModBlocks { @@ -209,13 +205,9 @@ public final class ModBlocks { public static Block bifrost; public static Block solidVines; public static Block buriedPetals; - public static Block prismarine; - public static Block seaLamp; public static Block floatingFlower; public static Block tinyPotato; public static Block spawnerClaw; - public static Block reedBlock; - public static Block thatch; public static Block customBrick; public static Block enderEye; public static Block starfield; @@ -237,7 +229,6 @@ public final class ModBlocks { public static Block petalBlock; public static Block corporeaIndex; public static Block corporeaFunnel; - public static Block endStoneBrick; public static Block mushroom; public static Block pump; public static Block doubleFlower1; @@ -301,13 +292,9 @@ public final class ModBlocks { bifrost = new BlockBifrost(); solidVines = new BlockSolidVines(); buriedPetals = new BlockBuriedPetals(); - prismarine = new BlockPrismarine(); - seaLamp = new BlockSeaLamp(); floatingFlower = new BlockFloatingFlower(); tinyPotato = new BlockTinyPotato(); spawnerClaw = new BlockSpawnerClaw(); - reedBlock = new BlockReeds(); - thatch = new BlockThatch(); customBrick = new BlockCustomBrick(); enderEye = new BlockEnderEye(); starfield = new BlockStarfield(); @@ -329,11 +316,10 @@ public final class ModBlocks { petalBlock = new BlockPetalBlock(); corporeaIndex = new BlockCorporeaIndex(); corporeaFunnel = new BlockCorporeaFunnel(); - endStoneBrick = new BlockEndStoneBrick(); mushroom = new BlockModMushroom(); pump = new BlockPump(); - doubleFlower1 = new BlockModDoubleFlower(false); - doubleFlower2 = new BlockModDoubleFlower(true); + doubleFlower1 = new BlockModDoubleFlower1(); + doubleFlower2 = new BlockModDoubleFlower2(); fakeAir = new BlockFakeAir(); blazeBlock = new BlockBlaze(); corporeaInterceptor = new BlockCorporeaInterceptor(); @@ -375,39 +361,32 @@ public final class ModBlocks { OreDictionary.registerOre(LibOreDict.DOUBLE_FLOWER[i + 8], new ItemStack(doubleFlower2, 1, i)); } - OreDictionary.registerOre(LibOreDict.PRISMARINE_BLOCK, new ItemStack(prismarine, 1, OreDictionary.WILDCARD_VALUE)); OreDictionary.registerOre(LibOreDict.BLAZE_BLOCK, blazeBlock); - for(int i = 0; i < 16; i++) - OreDictionary.registerOre(LibOreDict.STONE_18_VARIANTS[i], new ItemStack(ModFluffBlocks.stone, 1, i)); - // Vanilla OreDict entries - OreDictionary.registerOre("dirt", Blocks.dirt); - OreDictionary.registerOre("grass", Blocks.grass); - OreDictionary.registerOre("sand", Block.getBlockFromName("sand")); - OreDictionary.registerOre("gravel", Block.getBlockFromName("gravel")); - OreDictionary.registerOre("hardenedClay", new ItemStack(Blocks.hardened_clay, 1, OreDictionary.WILDCARD_VALUE)); - OreDictionary.registerOre("snowLayer", Blocks.snow_layer); - OreDictionary.registerOre("mycelium", Blocks.mycelium); - OreDictionary.registerOre("podzol", new ItemStack(Blocks.dirt, 1, 2)); - OreDictionary.registerOre("netherrack", Blocks.netherrack); - OreDictionary.registerOre("soulSand", Blocks.soul_sand); - OreDictionary.registerOre("ice", Blocks.ice); - OreDictionary.registerOre("slabCobblestone", new ItemStack(Blocks.stone_slab, 1, 3)); - OreDictionary.registerOre("chestWood", Blocks.chest); - OreDictionary.registerOre("craftingTableWood", Blocks.crafting_table); + OreDictionary.registerOre("hardenedClay", new ItemStack(Blocks.HARDENED_CLAY, 1, OreDictionary.WILDCARD_VALUE)); + OreDictionary.registerOre("snowLayer", Blocks.SNOW_LAYER); + OreDictionary.registerOre("mycelium", Blocks.MYCELIUM); + OreDictionary.registerOre("podzol", new ItemStack(Blocks.DIRT, 1, 2)); + OreDictionary.registerOre("soulSand", Blocks.SOUL_SAND); + OreDictionary.registerOre("ice", Blocks.ICE); + OreDictionary.registerOre("slabCobblestone", new ItemStack(Blocks.STONE_SLAB, 1, 3)); - BotaniaAPI.registerPaintableBlock(unstableBlock); - BotaniaAPI.registerPaintableBlock(manaBeacon); + BotaniaAPI.registerPaintableBlock(unstableBlock, BotaniaStateProps.COLOR); + BotaniaAPI.registerPaintableBlock(manaBeacon, BotaniaStateProps.COLOR); + + RecipeManaInfusion.alchemyState = alchemyCatalyst.getDefaultState(); + RecipeManaInfusion.conjurationState = conjurationCatalyst.getDefaultState(); initTileEntities(); } public static void addDispenserBehaviours() { for(Item seed : BotaniaAPI.seeds.keySet()) - BlockDispenser.dispenseBehaviorRegistry.putObject(seed, new BehaviourSeeds(BotaniaAPI.seeds.get(seed))); - BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.twigWand, new BehaviourWand()); - BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.poolMinecart, new BehaviourPoolMinecart()); + BlockDispenser.DISPENSE_BEHAVIOR_REGISTRY.putObject(seed, new BehaviourSeeds(BotaniaAPI.seeds.get(seed))); + BlockDispenser.DISPENSE_BEHAVIOR_REGISTRY.putObject(ModItems.twigWand, new BehaviourWand()); + BlockDispenser.DISPENSE_BEHAVIOR_REGISTRY.putObject(ModItems.poolMinecart, new BehaviourPoolMinecart()); + BlockDispenser.DISPENSE_BEHAVIOR_REGISTRY.putObject(Item.getItemFromBlock(ModBlocks.felPumpkin), new BehaviourFelPumpkin()); } private static void initTileEntities() { @@ -469,13 +448,9 @@ public final class ModBlocks { BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_PUREDAISY, SubTilePureDaisy.class); BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_MANASTAR, SubTileManastar.class); - registerSubTileWithDecor(LibBlockNames.SUBTILE_DAYBLOOM, SubTileDaybloom.class, SubTileDecor.Daybloom.class); - BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_DAYBLOOM_PRIME, SubTileDaybloom.Prime.class); + BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_HYDROANGEAS, SubTileHydroangeas.class); BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_ENDOFLAME, SubTileEndoflame.class); - registerSubTileWithDecor(LibBlockNames.SUBTILE_HYDROANGEAS, SubTileHydroangeas.class, SubTileDecor.Hydroangeas.class); BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_THERMALILY, SubTileThermalily.class); - registerSubTileWithDecor(LibBlockNames.SUBTILE_NIGHTSHADE, SubTileNightshade.class, SubTileDecor.Nightshade.class); - BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_NIGHTSHADE_PRIME, SubTileNightshade.Prime.class); BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_ARCANE_ROSE, SubTileArcaneRose.class); BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_MUNCHDEW, SubTileMunchdew.class); BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_ENTROPINNYUM, SubTileEntropinnyum.class); @@ -511,6 +486,7 @@ public final class ModBlocks { registerSubTileWithMini(LibBlockNames.SUBTILE_MARIMORPHOSIS, SubTileMarimorphosis.class); registerSubTileWithMini(LibBlockNames.SUBTILE_BUBBELL, SubTileBubbell.class); registerSubTileWithMini(LibBlockNames.SUBTILE_SOLEGNOLIA, SubTileSolegnolia.class); + BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_BERGAMUTE, SubTileBergamute.class); } public static void registerMultiparts() { @@ -530,11 +506,6 @@ public final class ModBlocks { BotaniaAPI.registerMiniSubTile(key + "Chibi", innerClazz, key); } - private static void registerSubTileWithDecor(String key, Class clazz, Class decor) { - BotaniaAPI.registerSubTile(key, clazz); - BotaniaAPI.registerMiniSubTile(key + "Decor", decor, key); - } - private static void registerTile(Class clazz, String key) { GameRegistry.registerTileEntity(clazz, LibResources.PREFIX_MOD + key); } diff --git a/src/main/java/vazkii/botania/common/block/ModFluffBlocks.java b/src/main/java/vazkii/botania/common/block/ModFluffBlocks.java index 3c2ea950d..01143a6f3 100644 --- a/src/main/java/vazkii/botania/common/block/ModFluffBlocks.java +++ b/src/main/java/vazkii/botania/common/block/ModFluffBlocks.java @@ -10,8 +10,12 @@ */ package vazkii.botania.common.block; +import com.google.common.collect.ImmutableList; import net.minecraft.block.Block; -import vazkii.botania.common.block.decor.Block18Stone; +import net.minecraft.item.EnumDyeColor; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.BiomeBrickVariant; +import vazkii.botania.api.state.enums.BiomeStoneVariant; import vazkii.botania.common.block.decor.BlockPavement; import vazkii.botania.common.block.decor.biomestone.BlockBiomeStoneA; import vazkii.botania.common.block.decor.biomestone.BlockBiomeStoneB; @@ -21,15 +25,10 @@ import vazkii.botania.common.block.decor.panes.BlockManaglassPane; import vazkii.botania.common.block.decor.quartz.BlockSpecialQuartz; import vazkii.botania.common.block.decor.quartz.BlockSpecialQuartzSlab; import vazkii.botania.common.block.decor.quartz.BlockSpecialQuartzStairs; -import vazkii.botania.common.block.decor.slabs.Block18StoneSlab; import vazkii.botania.common.block.decor.slabs.BlockBiomeStoneSlab; import vazkii.botania.common.block.decor.slabs.BlockDirtPathSlab; -import vazkii.botania.common.block.decor.slabs.BlockEndStoneSlab; -import vazkii.botania.common.block.decor.slabs.BlockEnderBrickSlab; import vazkii.botania.common.block.decor.slabs.BlockModSlab; import vazkii.botania.common.block.decor.slabs.BlockPavementSlab; -import vazkii.botania.common.block.decor.slabs.BlockReedSlab; -import vazkii.botania.common.block.decor.slabs.BlockThatchSlab; import vazkii.botania.common.block.decor.slabs.bricks.BlockCustomBrickSlab; import vazkii.botania.common.block.decor.slabs.bricks.BlockSnowBrickSlab; import vazkii.botania.common.block.decor.slabs.bricks.BlockSoulBrickSlab; @@ -42,16 +41,8 @@ import vazkii.botania.common.block.decor.slabs.living.BlockLivingwoodPlankSlab; import vazkii.botania.common.block.decor.slabs.living.BlockLivingwoodSlab; import vazkii.botania.common.block.decor.slabs.living.BlockShimmerrockSlab; import vazkii.botania.common.block.decor.slabs.living.BlockShimmerwoodPlankSlab; -import vazkii.botania.common.block.decor.slabs.prismarine.BlockDarkPrismarineSlab; -import vazkii.botania.common.block.decor.slabs.prismarine.BlockPrismarineBrickSlab; -import vazkii.botania.common.block.decor.slabs.prismarine.BlockPrismarineSlab; -import vazkii.botania.common.block.decor.stairs.Block18StoneStairs; import vazkii.botania.common.block.decor.stairs.BlockBiomeStoneStairs; -import vazkii.botania.common.block.decor.stairs.BlockEndStoneStairs; -import vazkii.botania.common.block.decor.stairs.BlockEnderBrickStairs; import vazkii.botania.common.block.decor.stairs.BlockPavementStairs; -import vazkii.botania.common.block.decor.stairs.BlockReedStairs; -import vazkii.botania.common.block.decor.stairs.BlockThatchStairs; import vazkii.botania.common.block.decor.stairs.bricks.BlockCustomBrickStairs; import vazkii.botania.common.block.decor.stairs.bricks.BlockSnowBrickStairs; import vazkii.botania.common.block.decor.stairs.bricks.BlockSoulBrickStairs; @@ -64,19 +55,15 @@ import vazkii.botania.common.block.decor.stairs.living.BlockLivingwoodPlankStair import vazkii.botania.common.block.decor.stairs.living.BlockLivingwoodStairs; import vazkii.botania.common.block.decor.stairs.living.BlockShimmerrockStairs; import vazkii.botania.common.block.decor.stairs.living.BlockShimmerwoodPlankStairs; -import vazkii.botania.common.block.decor.stairs.prismarine.BlockDarkPrismarineStairs; -import vazkii.botania.common.block.decor.stairs.prismarine.BlockPrismarineBrickStairs; -import vazkii.botania.common.block.decor.stairs.prismarine.BlockPrismarineStairs; -import vazkii.botania.common.block.decor.walls.Block18StoneWall; import vazkii.botania.common.block.decor.walls.BlockBiomeStoneWall; -import vazkii.botania.common.block.decor.walls.BlockPrismarineWall; -import vazkii.botania.common.block.decor.walls.BlockReedWall; import vazkii.botania.common.block.decor.walls.living.BlockDreamwoodWall; import vazkii.botania.common.block.decor.walls.living.BlockLivingrockWall; import vazkii.botania.common.block.decor.walls.living.BlockLivingwoodWall; import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.lib.LibBlockNames; +import java.util.Locale; + public final class ModFluffBlocks { public static Block livingwoodStairs; @@ -101,25 +88,6 @@ public final class ModFluffBlocks { public static Block dreamwoodPlankSlab; public static Block dreamwoodPlankSlabFull; - public static Block prismarineStairs; - public static Block prismarineSlab; - public static Block prismarineSlabFull; - public static Block prismarineWall; - public static Block prismarineBrickStairs; - public static Block prismarineBrickSlab; - public static Block prismarineBrickSlabFull; - public static Block darkPrismarineStairs; - public static Block darkPrismarineSlab; - public static Block darkPrismarineSlabFull; - - public static Block reedStairs; - public static Block reedSlab; - public static Block reedSlabFull; - public static Block reedWall; - public static Block thatchStairs; - public static Block thatchSlab; - public static Block thatchSlabFull; - public static Block netherBrickStairs; public static Block netherBrickSlab; public static Block netherBrickSlabFull; @@ -167,29 +135,16 @@ public final class ModFluffBlocks { public static Block biomeStoneA; public static Block biomeStoneB; - public static Block stone; public static Block pavement; - public static Block[] biomeStoneStairs = new Block[24]; - public static Block[] biomeStoneSlabs = new Block[24]; - public static Block[] biomeStoneFullSlabs = new Block[24]; + public static final Block[] biomeStoneStairs = new Block[24]; + public static final Block[] biomeStoneSlabs = new Block[24]; + public static final Block[] biomeStoneFullSlabs = new Block[24]; public static Block biomeStoneWall; - public static Block[] stoneStairs = new Block[8]; - public static Block[] stoneSlabs = new Block[8]; - public static Block[] stoneFullSlabs = new Block[8]; - public static Block stoneWall; - - public static Block[] pavementStairs = new Block[BlockPavement.TYPES]; - public static Block[] pavementSlabs = new Block[BlockPavement.TYPES]; - public static Block[] pavementFullSlabs = new Block[BlockPavement.TYPES]; - - public static Block endStoneSlab; - public static Block endStoneSlabFull; - public static Block endStoneStairs; - public static Block enderBrickSlab; - public static Block enderBrickSlabFull; - public static Block enderBrickStairs; + public static final Block[] pavementStairs = new Block[BlockPavement.TYPES]; + public static final Block[] pavementSlabs = new Block[BlockPavement.TYPES]; + public static final Block[] pavementFullSlabs = new Block[BlockPavement.TYPES]; public static Block shimmerrockSlab; public static Block shimmerrockSlabFull; @@ -225,25 +180,6 @@ public final class ModFluffBlocks { dreamwoodPlankSlab = new BlockDreamwoodPlankSlab(false); dreamwoodPlankSlabFull = new BlockDreamwoodPlankSlab(true); - prismarineStairs = new BlockPrismarineStairs(); - prismarineSlab = new BlockPrismarineSlab(false); - prismarineSlabFull = new BlockPrismarineSlab(true); - prismarineWall = new BlockPrismarineWall(); - prismarineBrickStairs = new BlockPrismarineBrickStairs(); - prismarineBrickSlab = new BlockPrismarineBrickSlab(false); - prismarineBrickSlabFull = new BlockPrismarineBrickSlab(true); - darkPrismarineStairs = new BlockDarkPrismarineStairs(); - darkPrismarineSlab = new BlockDarkPrismarineSlab(false); - darkPrismarineSlabFull = new BlockDarkPrismarineSlab(true); - - reedStairs = new BlockReedStairs(); - reedSlab = new BlockReedSlab(false); - reedSlabFull = new BlockReedSlab(true); - reedWall = new BlockReedWall(); - thatchStairs = new BlockThatchStairs(); - thatchSlab = new BlockThatchSlab(false); - thatchSlabFull = new BlockThatchSlab(true); - netherBrickStairs = new BlockCustomBrickStairs(); netherBrickSlab = new BlockCustomBrickSlab(false); netherBrickSlabFull = new BlockCustomBrickSlab(true); @@ -259,7 +195,6 @@ public final class ModFluffBlocks { biomeStoneA = new BlockBiomeStoneA(); biomeStoneB = new BlockBiomeStoneB(); - stone = new Block18Stone(); pavement = new BlockPavement(); if(ConfigHandler.darkQuartzEnabled) { @@ -297,35 +232,34 @@ public final class ModFluffBlocks { dirtPathSlab = new BlockDirtPathSlab(false); dirtPathSlabFull = new BlockDirtPathSlab(true); - for(int i = 0; i < 24; i++) { - int meta = i % 16; - Block block = i < 16 ? biomeStoneA : biomeStoneB; - biomeStoneStairs[i] = new BlockBiomeStoneStairs(block, meta); - biomeStoneSlabs[i] = new BlockBiomeStoneSlab(false, block, meta, i); - biomeStoneFullSlabs[i] = new BlockBiomeStoneSlab(true, block, meta, i); + int count = 0; + for (BiomeStoneVariant variant : BiomeStoneVariant.values()) { + biomeStoneStairs[count] = new BlockBiomeStoneStairs(biomeStoneA.getDefaultState().withProperty(BotaniaStateProps.BIOMESTONE_VARIANT, variant)); + biomeStoneSlabs[count] = new BlockBiomeStoneSlab(false, biomeStoneA.getDefaultState().withProperty(BotaniaStateProps.BIOMESTONE_VARIANT, variant), count); + biomeStoneFullSlabs[count] = new BlockBiomeStoneSlab(true, biomeStoneA.getDefaultState().withProperty(BotaniaStateProps.BIOMESTONE_VARIANT, variant), count); + count++; + } + + for (BiomeBrickVariant variant : BiomeBrickVariant.values()) { + if (variant.getName().toLowerCase(Locale.ROOT).contains("chiseled")) { + // No chiseled stairs/slabs + continue; + } + biomeStoneStairs[count] = new BlockBiomeStoneStairs(biomeStoneB.getDefaultState().withProperty(BotaniaStateProps.BIOMEBRICK_VARIANT, variant)); + biomeStoneSlabs[count] = new BlockBiomeStoneSlab(false, biomeStoneB.getDefaultState().withProperty(BotaniaStateProps.BIOMEBRICK_VARIANT, variant), count); + biomeStoneFullSlabs[count] = new BlockBiomeStoneSlab(true, biomeStoneB.getDefaultState().withProperty(BotaniaStateProps.BIOMEBRICK_VARIANT, variant), count); + count++; } biomeStoneWall = new BlockBiomeStoneWall(); - for(int i = 0; i < 8; i++) { - int meta = i > 3 ? i + 4 : i; - stoneStairs[i] = new Block18StoneStairs(meta); - stoneSlabs[i] = new Block18StoneSlab(false, meta, i); - stoneFullSlabs[i] = new Block18StoneSlab(true, meta, i); + count = 0; + for (EnumDyeColor color : ImmutableList.of(EnumDyeColor.WHITE, EnumDyeColor.BLACK, EnumDyeColor.BLUE, + EnumDyeColor.RED, EnumDyeColor.YELLOW, EnumDyeColor.GREEN)) { + pavementStairs[count] = new BlockPavementStairs(color); + pavementSlabs[count] = new BlockPavementSlab(false, color, count); + pavementFullSlabs[count] = new BlockPavementSlab(true, color, count); + count++; } - stoneWall = new Block18StoneWall(); - - for(int i = 0; i < pavementStairs.length; i++) { - pavementStairs[i] = new BlockPavementStairs(i); - pavementSlabs[i] = new BlockPavementSlab(false, i, i); - pavementFullSlabs[i] = new BlockPavementSlab(true, i, i); - } - - endStoneSlab = new BlockEndStoneSlab(false); - endStoneSlabFull = new BlockEndStoneSlab(true); - endStoneStairs = new BlockEndStoneStairs(); - enderBrickSlab = new BlockEnderBrickSlab(false); - enderBrickSlabFull = new BlockEnderBrickSlab(true); - enderBrickStairs = new BlockEnderBrickStairs(); shimmerrockSlab = new BlockShimmerrockSlab(false); shimmerrockSlabFull = new BlockShimmerrockSlab(true); @@ -337,85 +271,6 @@ public final class ModFluffBlocks { managlassPane = new BlockManaglassPane(); alfglassPane = new BlockAlfglassPane(); bifrostPane = new BlockBifrostPane(); - - if(ConfigHandler.darkQuartzEnabled) { - ((BlockModSlab) darkQuartzSlab).register(); - ((BlockModSlab) darkQuartzSlabFull).register(); - } - ((BlockModSlab) manaQuartzSlab).register(); - ((BlockModSlab) manaQuartzSlabFull).register(); - ((BlockModSlab) blazeQuartzSlab).register(); - ((BlockModSlab) blazeQuartzSlabFull).register(); - ((BlockModSlab) lavenderQuartzSlab).register(); - ((BlockModSlab) lavenderQuartzSlabFull).register(); - ((BlockModSlab) redQuartzSlab).register(); - ((BlockModSlab) redQuartzSlabFull).register(); - ((BlockModSlab) elfQuartzSlab).register(); - ((BlockModSlab) elfQuartzSlabFull).register(); - ((BlockModSlab) sunnyQuartzSlab).register(); - ((BlockModSlab) sunnyQuartzSlabFull).register(); - - ((BlockModSlab) livingwoodSlab).register(); - ((BlockModSlab) livingwoodSlabFull).register(); - ((BlockModSlab) livingwoodPlankSlab).register(); - ((BlockModSlab) livingwoodPlankSlabFull).register(); - ((BlockModSlab) livingrockSlab).register(); - ((BlockModSlab) livingrockSlabFull).register(); - ((BlockModSlab) livingrockBrickSlab).register(); - ((BlockModSlab) livingrockBrickSlabFull).register(); - ((BlockModSlab) dreamwoodSlab).register(); - ((BlockModSlab) dreamwoodSlabFull).register(); - ((BlockModSlab) dreamwoodPlankSlab).register(); - ((BlockModSlab) dreamwoodPlankSlabFull).register(); - - ((BlockModSlab) reedSlab).register(); - ((BlockModSlab) reedSlabFull).register(); - ((BlockModSlab) thatchSlab).register(); - ((BlockModSlab) thatchSlabFull).register(); - - ((BlockModSlab) prismarineSlab).register(); - ((BlockModSlab) prismarineSlabFull).register(); - ((BlockModSlab) prismarineBrickSlab).register(); - ((BlockModSlab) prismarineBrickSlabFull).register(); - ((BlockModSlab) darkPrismarineSlab).register(); - ((BlockModSlab) darkPrismarineSlabFull).register(); - - ((BlockModSlab) netherBrickSlab).register(); - ((BlockModSlab) netherBrickSlabFull).register(); - ((BlockModSlab) soulBrickSlab).register(); - ((BlockModSlab) soulBrickSlabFull).register(); - ((BlockModSlab) snowBrickSlab).register(); - ((BlockModSlab) snowBrickSlabFull).register(); - ((BlockModSlab) tileSlab).register(); - ((BlockModSlab) tileSlabFull).register(); - - ((BlockModSlab) dirtPathSlab).register(); - ((BlockModSlab) dirtPathSlabFull).register(); - - ((BlockModSlab) endStoneSlab).register(); - ((BlockModSlab) endStoneSlabFull).register(); - ((BlockModSlab) enderBrickSlab).register(); - ((BlockModSlab) enderBrickSlabFull).register(); - - ((BlockModSlab) shimmerrockSlab).register(); - ((BlockModSlab) shimmerrockSlabFull).register(); - ((BlockModSlab) shimmerwoodPlankSlab).register(); - ((BlockModSlab) shimmerwoodPlankSlabFull).register(); - - for(int i = 0; i < 24; i++) { - ((BlockModSlab) biomeStoneSlabs[i]).register(); - ((BlockModSlab) biomeStoneFullSlabs[i]).register(); - } - - for(int i = 0; i < 8; i++) { - ((BlockModSlab) stoneSlabs[i]).register(); - ((BlockModSlab) stoneFullSlabs[i]).register(); - } - - for(int i = 0; i < pavementSlabs.length; i++) { - ((BlockModSlab) pavementSlabs[i]).register(); - ((BlockModSlab) pavementFullSlabs[i]).register(); - } } } diff --git a/src/main/java/vazkii/botania/common/block/corporea/BlockCorporeaBase.java b/src/main/java/vazkii/botania/common/block/corporea/BlockCorporeaBase.java index 4be814d28..d67e812d6 100644 --- a/src/main/java/vazkii/botania/common/block/corporea/BlockCorporeaBase.java +++ b/src/main/java/vazkii/botania/common/block/corporea/BlockCorporeaBase.java @@ -10,70 +10,38 @@ */ package vazkii.botania.common.block.corporea; -import java.util.Random; - -import net.minecraft.block.Block; import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.stats.Achievement; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import vazkii.botania.common.achievement.ICraftAchievement; import vazkii.botania.common.achievement.ModAchievements; -import vazkii.botania.common.block.BlockModContainer; +import vazkii.botania.common.block.BlockMod; import vazkii.botania.common.block.tile.TileSimpleInventory; -import vazkii.botania.common.block.tile.corporea.TileCorporeaBase; +import vazkii.botania.common.core.helper.InventoryHelper; -public abstract class BlockCorporeaBase extends BlockModContainer implements ICraftAchievement { +import javax.annotation.Nonnull; +import java.util.Random; - Random random; +public abstract class BlockCorporeaBase extends BlockMod implements ICraftAchievement { public BlockCorporeaBase(Material material, String name) { - super(material); - setBlockName(name); - - random = new Random(); + super(material, name); } @Override - public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { - TileSimpleInventory inv = (TileSimpleInventory) par1World.getTileEntity(par2, par3, par4); + public void breakBlock(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state) { + TileSimpleInventory inv = (TileSimpleInventory) world.getTileEntity(pos); - if (inv != null) { - for (int j1 = 0; j1 < inv.getSizeInventory(); ++j1) { - ItemStack itemstack = inv.getStackInSlot(j1); + InventoryHelper.dropInventory(inv, world, state, pos); - if (itemstack != null) { - float f = random.nextFloat() * 0.8F + 0.1F; - float f1 = random.nextFloat() * 0.8F + 0.1F; - EntityItem entityitem; - - for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) { - int k1 = random.nextInt(21) + 10; - - if (k1 > itemstack.stackSize) - k1 = itemstack.stackSize; - - itemstack.stackSize -= k1; - entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage())); - float f3 = 0.05F; - entityitem.motionX = (float)random.nextGaussian() * f3; - entityitem.motionY = (float)random.nextGaussian() * f3 + 0.2F; - entityitem.motionZ = (float)random.nextGaussian() * f3; - - if (itemstack.hasTagCompound()) - entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy()); - } - } - } - - par1World.func_147453_f(par2, par3, par4, par5); - } - - super.breakBlock(par1World, par2, par3, par4, par5, par6); + super.breakBlock(world, pos, state); } @Override @@ -81,4 +49,9 @@ public abstract class BlockCorporeaBase extends BlockModContainer 0 || world.isBlockIndirectlyGettingPowered(pos.up()) > 0; + boolean powered = state.getValue(BotaniaStateProps.POWERED); if(power && !powered) { - ((TileCorporeaFunnel) world.getTileEntity(x, y, z)).doRequest(); - world.setBlockMetadataWithNotify(x, y, z, meta | 8, 4); + ((TileCorporeaFunnel) world.getTileEntity(pos)).doRequest(); + world.setBlockState(pos, state.withProperty(BotaniaStateProps.POWERED, true), 4); } else if(!power && powered) - world.setBlockMetadataWithNotify(x, y, z, meta & -9, 4); + world.setBlockState(pos, state.withProperty(BotaniaStateProps.POWERED, false), 4); } + @Nonnull @Override - public IIcon getIcon(int par1, int par2) { - return icons[par1 > 1 ? 1 : 0]; - } - - @Override - public TileCorporeaBase createNewTileEntity(World world, int meta) { + public TileCorporeaBase createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileCorporeaFunnel(); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.corporeaFunnel; } } diff --git a/src/main/java/vazkii/botania/common/block/corporea/BlockCorporeaIndex.java b/src/main/java/vazkii/botania/common/block/corporea/BlockCorporeaIndex.java index f2f604cc5..1b19b8d79 100644 --- a/src/main/java/vazkii/botania/common/block/corporea/BlockCorporeaIndex.java +++ b/src/main/java/vazkii/botania/common/block/corporea/BlockCorporeaIndex.java @@ -10,62 +10,112 @@ */ package vazkii.botania.common.block.corporea; +import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.particle.ParticleDigging; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.lib.LibRenderIDs; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.StorageVariant; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.tile.corporea.TileCorporeaBase; import vazkii.botania.common.block.tile.corporea.TileCorporeaIndex; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; +import javax.annotation.Nonnull; + public class BlockCorporeaIndex extends BlockCorporeaBase implements ILexiconable { public BlockCorporeaIndex() { - super(Material.iron, LibBlockNames.CORPOREA_INDEX); + super(Material.IRON, LibBlockNames.CORPOREA_INDEX); setHardness(5.5F); - setStepSound(soundTypeMetal); + setSoundType(SoundType.METAL); } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public boolean renderAsNormalBlock() { + public boolean isFullCube(IBlockState state) { return false; } + @Nonnull @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - // NO-OP + public EnumBlockRenderType getRenderType(IBlockState state) { + return EnumBlockRenderType.ENTITYBLOCK_ANIMATED; } + @Nonnull @Override - public IIcon getIcon(int side, int meta) { - return ModBlocks.storage.getIcon(0, 2); - } - - @Override - public int getRenderType() { - return LibRenderIDs.idCorporeaIndex; - } - - @Override - public TileCorporeaBase createNewTileEntity(World world, int meta) { + public TileCorporeaBase createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileCorporeaIndex(); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.corporeaIndex; } + @Override + public boolean addLandingEffects(IBlockState state, net.minecraft.world.WorldServer worldObj, BlockPos blockPosition, IBlockState iblockstate, EntityLivingBase entity, int numberOfParticles ) + { + float f = (float) MathHelper.ceiling_float_int(entity.fallDistance - 3.0F); + double d0 = (double)Math.min(0.2F + f / 15.0F, 10.0F); + if (d0 > 2.5D) { + d0 = 2.5D; + } + int i = (int)(150.0D * d0); + worldObj.spawnParticle(EnumParticleTypes.BLOCK_DUST, entity.posX, entity.posY, entity.posZ, i, 0.0D, 0.0D, 0.0D, 0.15000000596046448D, Block.getStateId(ModBlocks.storage.getDefaultState().withProperty(BotaniaStateProps.STORAGE_VARIANT, StorageVariant.ELEMENTIUM))); + return true; + } + + @Override + @SideOnly(Side.CLIENT) + public boolean addDestroyEffects(World world, BlockPos pos, net.minecraft.client.particle.ParticleManager effectRenderer) + { + if (world.getBlockState(pos).getBlock() == this) { + int i = 4; + ParticleDigging.Factory factory = new ParticleDigging.Factory(); + for (int j = 0; j < i; ++j) { + for (int k = 0; k < i; ++k) { + for (int l = 0; l < i; ++l) { + double d0 = (double)pos.getX() + ((double)j + 0.5D) / (double)i; + double d1 = (double)pos.getY() + ((double)k + 0.5D) / (double)i; + double d2 = (double)pos.getZ() + ((double)l + 0.5D) / (double)i; + effectRenderer.addEffect(factory.getEntityFX(-1, world, d0, d1, d2, d0 - (double)pos.getX() - 0.5D, d1 - (double)pos.getY() - 0.5D, d2 - (double)pos.getZ() - 0.5D, Block.getStateId(ModBlocks.storage.getDefaultState().withProperty(BotaniaStateProps.STORAGE_VARIANT, StorageVariant.ELEMENTIUM)))); + } + } + } + return true; + } else { + return false; + } + } + + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerCustomItemblock(this, "corporea_index"); + ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(this), 0, TileCorporeaIndex.class); + } + } diff --git a/src/main/java/vazkii/botania/common/block/corporea/BlockCorporeaInterceptor.java b/src/main/java/vazkii/botania/common/block/corporea/BlockCorporeaInterceptor.java index b8c18f027..af72aefbe 100644 --- a/src/main/java/vazkii/botania/common/block/corporea/BlockCorporeaInterceptor.java +++ b/src/main/java/vazkii/botania/common/block/corporea/BlockCorporeaInterceptor.java @@ -10,72 +10,85 @@ */ package vazkii.botania.common.block.corporea; -import java.util.Random; - +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.core.helper.IconHelper; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.common.block.tile.corporea.TileCorporeaBase; import vazkii.botania.common.block.tile.corporea.TileCorporeaInterceptor; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; +import javax.annotation.Nonnull; +import java.util.Random; + public class BlockCorporeaInterceptor extends BlockCorporeaBase implements ILexiconable { - IIcon[] icons; - public BlockCorporeaInterceptor() { - super(Material.iron, LibBlockNames.CORPOREA_INTERCEPTOR); + super(Material.IRON, LibBlockNames.CORPOREA_INTERCEPTOR); setHardness(5.5F); - setStepSound(soundTypeMetal); + setSoundType(SoundType.METAL); + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.POWERED); } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - icons = new IIcon[2]; - for(int i = 0; i < icons.length; i++) - icons[i] = IconHelper.forBlock(par1IconRegister, this, i); + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.POWERED, false); } @Override - public IIcon getIcon(int par1, int par2) { - return icons[par1 > 1 ? 1 : 0]; + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.POWERED) ? 1 : 0; + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + return getDefaultState().withProperty(BotaniaStateProps.POWERED, meta == 1); } @Override - public void updateTick(World world, int x, int y, int z, Random rand) { - world.setBlockMetadataWithNotify(x, y, z, 0, 1 | 2); + public void updateTick(World world, BlockPos pos, IBlockState state, Random rand) { + world.setBlockState(pos, state.withProperty(BotaniaStateProps.POWERED, false), 1 | 2); } @Override - public boolean canProvidePower() { + public boolean canProvidePower(IBlockState state) { return true; } @Override - public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int side) { - return world.getBlockMetadata(x, y, z) != 0 ? 15 : 0; + public int getWeakPower(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) { + return state.getValue(BotaniaStateProps.POWERED) ? 15 : 0; } @Override - public int tickRate(World p_149738_1_) { + public int tickRate(World world) { return 2; } + @Nonnull @Override - public TileCorporeaBase createNewTileEntity(World world, int meta) { + public TileCorporeaBase createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileCorporeaInterceptor(); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.corporeaInterceptor; } diff --git a/src/main/java/vazkii/botania/common/block/corporea/BlockCorporeaRetainer.java b/src/main/java/vazkii/botania/common/block/corporea/BlockCorporeaRetainer.java index 2d804b714..dcae55067 100644 --- a/src/main/java/vazkii/botania/common/block/corporea/BlockCorporeaRetainer.java +++ b/src/main/java/vazkii/botania/common/block/corporea/BlockCorporeaRetainer.java @@ -11,56 +11,89 @@ package vazkii.botania.common.block.corporea; import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.stats.Achievement; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.common.achievement.ICraftAchievement; import vazkii.botania.common.achievement.ModAchievements; -import vazkii.botania.common.block.BlockModContainer; +import vazkii.botania.common.block.BlockMod; import vazkii.botania.common.block.tile.corporea.TileCorporeaRetainer; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -public class BlockCorporeaRetainer extends BlockModContainer implements ILexiconable, ICraftAchievement { +import javax.annotation.Nonnull; + +public class BlockCorporeaRetainer extends BlockMod implements ILexiconable, ICraftAchievement { public BlockCorporeaRetainer() { - super(Material.iron); + super(Material.IRON, LibBlockNames.CORPOREA_RETAINER); setHardness(5.5F); - setStepSound(soundTypeMetal); - setBlockName(LibBlockNames.CORPOREA_RETAINER); + setSoundType(SoundType.METAL); + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.POWERED); } @Override - public void onNeighborBlockChange(World world, int x, int y, int z, Block block) { - boolean power = world.isBlockIndirectlyGettingPowered(x, y, z) || world.isBlockIndirectlyGettingPowered(x, y + 1, z); - int meta = world.getBlockMetadata(x, y, z); - boolean powered = (meta & 8) != 0; + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.POWERED, false); + } + + @Override + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.POWERED) ? 8 : 0; + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + return getDefaultState().withProperty(BotaniaStateProps.POWERED, meta == 8); + } + + @Override + public void neighborChanged(IBlockState state, World world, BlockPos pos, Block block) { + boolean power = world.isBlockIndirectlyGettingPowered(pos) > 0 || world.isBlockIndirectlyGettingPowered(pos.up()) > 0; + boolean powered = state.getValue(BotaniaStateProps.POWERED); if(power && !powered) { - ((TileCorporeaRetainer) world.getTileEntity(x, y, z)).fulfilRequest(); - world.setBlockMetadataWithNotify(x, y, z, meta | 8, 4); + ((TileCorporeaRetainer) world.getTileEntity(pos)).fulfilRequest(); + world.setBlockState(pos, state.withProperty(BotaniaStateProps.POWERED, true), 4); } else if(!power && powered) - world.setBlockMetadataWithNotify(x, y, z, meta & -9, 4); + world.setBlockState(pos, state.withProperty(BotaniaStateProps.POWERED, false), 4); } @Override - public boolean hasComparatorInputOverride() { + public boolean hasComparatorInputOverride(IBlockState state) { return true; } @Override - public int getComparatorInputOverride(World world, int x, int y, int z, int s) { - return ((TileCorporeaRetainer) world.getTileEntity(x, y, z)).hasPendingRequest() ? 15 : 0; + public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) { + return ((TileCorporeaRetainer) world.getTileEntity(pos)).hasPendingRequest() ? 15 : 0; } @Override - public TileEntity createNewTileEntity(World world, int meta) { + public boolean hasTileEntity(IBlockState state) { + return true; + } + + @Nonnull + @Override + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileCorporeaRetainer(); } @@ -70,7 +103,7 @@ public class BlockCorporeaRetainer extends BlockModContainer implements ILexicon } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.corporeaRetainer; } diff --git a/src/main/java/vazkii/botania/common/block/decor/Block18Stone.java b/src/main/java/vazkii/botania/common/block/decor/Block18Stone.java deleted file mode 100644 index 6614a15d1..000000000 --- a/src/main/java/vazkii/botania/common/block/decor/Block18Stone.java +++ /dev/null @@ -1,90 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Apr 10, 2015, 7:34:31 PM (GMT)] - */ -package vazkii.botania.common.block.decor; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; -import vazkii.botania.api.lexicon.ILexiconable; -import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.core.helper.IconHelper; -import vazkii.botania.common.block.BlockMod; -import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName; -import vazkii.botania.common.lexicon.LexiconData; -import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.registry.GameRegistry; - -public class Block18Stone extends BlockMod implements ILexiconable { - - private static IIcon[] icons = new IIcon[16]; - - public Block18Stone() { - super(Material.rock); - setHardness(1.5F); - setResistance(10F); - setStepSound(soundTypeStone); - setBlockName(LibBlockNames.STONE); - } - - @Override - public void registerBlockIcons(IIconRegister register) { - for(int i = 0; i < 16; i++) - icons[i] = IconHelper.forBlock(register, this, i); - } - - @Override - public void getSubBlocks(Item item, CreativeTabs tab, List list) { - for(int i = 0; i < 16; i++) - list.add(new ItemStack(item, 1, i)); - } - - @Override - public IIcon getIcon(int side, int meta) { - return icons[meta]; - } - - @Override - protected boolean shouldRegisterInNameSet() { - return false; - } - - @Override - public int damageDropped(int par1) { - return par1; - } - - @Override - public Block setBlockName(String par1Str) { - GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, par1Str); - return super.setBlockName(par1Str); - } - - @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) { - int meta = world.getBlockMetadata(x, y, z); - return new ItemStack(this, 1, meta); - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { - return LexiconData.stoneAlchemy; - } - -} diff --git a/src/main/java/vazkii/botania/common/block/decor/BlockBlaze.java b/src/main/java/vazkii/botania/common/block/decor/BlockBlaze.java index a627d1cde..ec455d41e 100644 --- a/src/main/java/vazkii/botania/common/block/decor/BlockBlaze.java +++ b/src/main/java/vazkii/botania/common/block/decor/BlockBlaze.java @@ -10,42 +10,43 @@ */ package vazkii.botania.common.block.decor; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.fml.common.IFuelHandler; +import net.minecraftforge.fml.common.registry.GameRegistry; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.common.Botania; import vazkii.botania.common.block.BlockMod; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.IFuelHandler; -import cpw.mods.fml.common.registry.GameRegistry; public class BlockBlaze extends BlockMod implements ILexiconable, IFuelHandler { public BlockBlaze() { - super(Material.iron); + super(Material.IRON, LibBlockNames.BLAZE_BLOCK); setHardness(3F); setResistance(10F); - setStepSound(soundTypeMetal); + setSoundType(SoundType.METAL); setLightLevel(1F); - setBlockName(LibBlockNames.BLAZE_BLOCK); GameRegistry.registerFuelHandler(this); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.blazeBlock; } @Override public int getBurnTime(ItemStack fuel) { - return fuel.getItem() == Item.getItemFromBlock(this) ? TileEntityFurnace.getItemBurnTime(new ItemStack(Items.blaze_rod)) * (Botania.gardenOfGlassLoaded ? 5 : 10) : 0; + return fuel.getItem() == Item.getItemFromBlock(this) ? TileEntityFurnace.getItemBurnTime(new ItemStack(Items.BLAZE_ROD)) * (Botania.gardenOfGlassLoaded ? 5 : 10) : 0; } } diff --git a/src/main/java/vazkii/botania/common/block/decor/BlockBuriedPetals.java b/src/main/java/vazkii/botania/common/block/decor/BlockBuriedPetals.java index 147a5905d..e8950b55f 100644 --- a/src/main/java/vazkii/botania/common/block/decor/BlockBuriedPetals.java +++ b/src/main/java/vazkii/botania/common/block/decor/BlockBuriedPetals.java @@ -10,43 +10,54 @@ */ package vazkii.botania.common.block.decor; -import java.util.Random; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.passive.EntitySheep; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.block.statemap.StateMap; +import net.minecraft.item.EnumDyeColor; import net.minecraft.item.Item; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import vazkii.botania.client.core.helper.IconHelper; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.common.Botania; import vazkii.botania.common.block.BlockModFlower; -import vazkii.botania.common.integration.coloredlights.ColoredLightHelper; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.Optional; + +import javax.annotation.Nonnull; +import java.util.Random; public class BlockBuriedPetals extends BlockModFlower { + private static final AxisAlignedBB AABB = new AxisAlignedBB(0, 0, 0, 1, 0.1, 1); + public BlockBuriedPetals() { super(LibBlockNames.BURIED_PETALS); - setBlockBounds(0F, 0F, 0F, 1F, 0.1F, 1F); setLightLevel(0.25F); } + @Nonnull @Override - @Optional.Method(modid = "easycoloredlights") - public int getLightValue(IBlockAccess world, int x, int y, int z) { - return ColoredLightHelper.getPackedColor(world.getBlockMetadata(x, y, z), originalLight); + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { + return AABB; } + @SideOnly(Side.CLIENT) @Override - public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { - int meta = par1World.getBlockMetadata(par2, par3, par4); - float[] color = EntitySheep.fleeceColorTable[meta]; + public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) { + EnumDyeColor color = state.getValue(BotaniaStateProps.COLOR); + int hex = color.getMapColor().colorValue; + int r = (hex & 0xFF0000) >> 16; + int g = (hex & 0xFF00) >> 8; + int b = (hex & 0xFF); Botania.proxy.setSparkleFXNoClip(true); - Botania.proxy.sparkleFX(par1World, par2 + 0.3 + par5Random.nextFloat() * 0.5, par3 + 0.1 + par5Random.nextFloat() * 0.1, par4 + 0.3 + par5Random.nextFloat() * 0.5, color[0], color[1], color[2], par5Random.nextFloat(), 5); + Botania.proxy.sparkleFX(pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.1 + rand.nextFloat() * 0.1, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5); + Botania.proxy.setSparkleFXNoClip(false); } @@ -56,22 +67,23 @@ public class BlockBuriedPetals extends BlockModFlower { } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - blockIcon = IconHelper.forBlock(par1IconRegister, this); - } - - @Override - public IIcon getIcon(int par1, int par2) { - return blockIcon; - } - - @Override - public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + public Item getItemDropped(IBlockState state, Random rand, int fortune) { return ModItems.petal; } @Override - public int getRenderType() { - return 0; + public void registerItemForm() {} + + @Nonnull + @Override + public EnumBlockRenderType getRenderType(IBlockState state) { + return EnumBlockRenderType.INVISIBLE; } + + @SideOnly(Side.CLIENT) + @Override + public final void registerModels() { + ModelLoader.setCustomStateMapper(this, (new StateMap.Builder()).ignore(getTypeProperty()).build()); + } + } diff --git a/src/main/java/vazkii/botania/common/block/decor/BlockCustomBrick.java b/src/main/java/vazkii/botania/common/block/decor/BlockCustomBrick.java index 063738508..e9e91b48b 100644 --- a/src/main/java/vazkii/botania/common/block/decor/BlockCustomBrick.java +++ b/src/main/java/vazkii/botania/common/block/decor/BlockCustomBrick.java @@ -10,84 +10,100 @@ */ package vazkii.botania.common.block.decor; -import java.util.List; - -import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.core.helper.IconHelper; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.CustomBrickVariant; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.block.BlockMod; import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.registry.GameRegistry; + +import javax.annotation.Nonnull; +import java.util.List; public class BlockCustomBrick extends BlockMod implements ILexiconable { - private static final int TYPES = 16; - IIcon[] icons; - public BlockCustomBrick() { - super(Material.rock); + super(Material.ROCK, LibBlockNames.CUSTOM_BRICK); setHardness(2.0F); setResistance(5.0F); - setStepSound(soundTypeStone); - setBlockName(LibBlockNames.CUSTOM_BRICK); + setSoundType(SoundType.STONE); + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.CUSTOMBRICK_VARIANT); } @Override - protected boolean shouldRegisterInNameSet() { - return false; + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.CUSTOMBRICK_VARIANT, CustomBrickVariant.HELLISH_BRICK); } @Override - public int damageDropped(int par1) { - return par1; + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.CUSTOMBRICK_VARIANT).ordinal(); + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + if (meta >= CustomBrickVariant.values().length) { + meta = 0; + } + return getDefaultState().withProperty(BotaniaStateProps.CUSTOMBRICK_VARIANT, CustomBrickVariant.values()[meta]); } @Override - public Block setBlockName(String par1Str) { - GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, par1Str); - return super.setBlockName(par1Str); + public int damageDropped(IBlockState state) { + return getMetaFromState(state); } @Override - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for(int i = 0; i < TYPES; i++) - par3List.add(new ItemStack(par1, 1, i)); + public void registerItemForm() { + GameRegistry.register(new ItemBlockWithMetadataAndName(this), getRegistryName()); + } + + @SideOnly(Side.CLIENT) + @Override + public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List stacks) { + for(int i = 0; i < CustomBrickVariant.values().length; i++) + stacks.add(new ItemStack(item, 1, i)); + } + + @Nonnull + @Override + public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player) { + return new ItemStack(this, 1, getMetaFromState(world.getBlockState(pos))); } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - icons = new IIcon[TYPES]; - for(int i = 0; i < TYPES; i++) - icons[i] = IconHelper.forBlock(par1IconRegister, this, i); + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { + CustomBrickVariant variant = world.getBlockState(pos).getValue(BotaniaStateProps.CUSTOMBRICK_VARIANT); + return variant.getName().contains("azulejo") ? LexiconData.azulejo : LexiconData.decorativeBlocks; } + @SideOnly(Side.CLIENT) @Override - public IIcon getIcon(int par1, int par2) { - return icons[Math.min(TYPES - 1, par2)]; - } - - @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) { - int meta = world.getBlockMetadata(x, y, z); - return new ItemStack(this, 1, meta); - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { - int meta = world.getBlockMetadata(x, y, z); - return meta >= 4 ? LexiconData.azulejo : LexiconData.decorativeBlocks; + public void registerModels() { + ModelHandler.registerBlockToState(this, CustomBrickVariant.values().length); } } diff --git a/src/main/java/vazkii/botania/common/block/decor/BlockDirtPath.java b/src/main/java/vazkii/botania/common/block/decor/BlockDirtPath.java index 500bd4e47..0a9d79e2c 100644 --- a/src/main/java/vazkii/botania/common/block/decor/BlockDirtPath.java +++ b/src/main/java/vazkii/botania/common/block/decor/BlockDirtPath.java @@ -11,93 +11,117 @@ package vazkii.botania.common.block.decor; import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.IAttributeInstance; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.EnumPlantType; import net.minecraftforge.common.IPlantable; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.common.block.BlockMod; +import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; +import javax.annotation.Nonnull; +import java.util.UUID; + public class BlockDirtPath extends BlockMod implements ILexiconable { + private static final UUID speedBoostUuid = UUID.fromString("c5f17cca-c89f-4f12-81da-8f04b1f27679"); + private static final AttributeModifier speedBoost = new AttributeModifier(speedBoostUuid, "Trodden dirt speed boost", 0.55, 2).setSaved(false); + private static final AxisAlignedBB AABB = new AxisAlignedBB(0, 0, 0, 1, 15F/16F, 1); + public BlockDirtPath() { - super(Material.ground); - setBlockBounds(0F, 0F, 0F, 1F, 15F / 16F, 1F); + super(Material.GROUND, LibBlockNames.DIRT_PATH); setLightOpacity(255); setHardness(0.6F); - setStepSound(soundTypeGravel); - setBlockName(LibBlockNames.DIRT_PATH); + setSoundType(SoundType.GROUND); useNeighborBrightness = true; + MinecraftForge.EVENT_BUS.register(BlockDirtPath.class); } @Override - public boolean isToolEffective(String type, int metadata) { + public boolean isToolEffective(String type, @Nonnull IBlockState state) { return type.equals("shovel"); } @Override - public void onEntityWalking(World world, int x, int y, int z, Entity entity) { - float speed = 2F; - float max = 0.4F; + public void onEntityWalk(World world, BlockPos pos, Entity entity) { + if(!world.isRemote && entity instanceof EntityPlayerMP) { + EntityLivingBase living = ((EntityLivingBase) entity); + IAttributeInstance attr = living.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED); + if(!attr.hasModifier(speedBoost)) { + attr.applyModifier(speedBoost); + } + } + } - double motionX = Math.abs(entity.motionX); - double motionZ = Math.abs(entity.motionZ); - if(motionX < max) - entity.motionX *= speed; - if(motionZ < max) - entity.motionZ *= speed; + @Nonnull + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { + IBlockState stateAbove = world.getBlockState(pos.up()); + Block blockAbove = stateAbove.getBlock(); + if(!blockAbove.isAir(stateAbove, world, pos.up())) + return FULL_BLOCK_AABB; + else return AABB; } @Override - public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) { - Block blockAbove = world.getBlock(x, y + 1, z); - if(!blockAbove.isAir(world, x, y + 1, z)) - setBlockBounds(0F, 0F, 0F, 1F, 1, 1F); - else setBlockBounds(0F, 0F, 0F, 1F, 15F / 16F, 1F); + public boolean isSideSolid(IBlockState state, @Nonnull IBlockAccess world, @Nonnull BlockPos pos, EnumFacing side) { + return side == EnumFacing.DOWN; } @Override - public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side) { - return side == ForgeDirection.DOWN; + public AxisAlignedBB getCollisionBoundingBox(IBlockState state, @Nonnull World world, @Nonnull BlockPos pos) { + return FULL_BLOCK_AABB; } @Override - public void onNeighborBlockChange(World world, int x, int y, int z, Block block) { - setBlockBoundsBasedOnState(world, x, y, z); - } - - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) { - return AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1); - } - - @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public boolean renderAsNormalBlock() { + public boolean isFullCube(IBlockState state) { return false; } @Override - public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plantable) { - return plantable.getPlantType(world, x, y - 1, z) == EnumPlantType.Plains; + public boolean canSustainPlant(@Nonnull IBlockState state, @Nonnull IBlockAccess world, BlockPos pos, @Nonnull EnumFacing direction, IPlantable plantable) { + return plantable.getPlantType(world, pos.down()) == EnumPlantType.Plains; } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.dirtPath; } + @SubscribeEvent + public static void onTickEnd(TickEvent.WorldTickEvent event) { + if(event.world.isRemote || event.phase != TickEvent.Phase.END) + return; + for(EntityPlayerMP player : event.world.getPlayers(EntityPlayerMP.class, p -> p.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).hasModifier(speedBoost))) { + if (event.world.getBlockState(new BlockPos(player).down()).getBlock() != ModBlocks.dirtPath) { + player.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).removeModifier(speedBoost); + } + } // todo 1.8 there's probably a better way to do this. + } + } diff --git a/src/main/java/vazkii/botania/common/block/decor/BlockElfGlass.java b/src/main/java/vazkii/botania/common/block/decor/BlockElfGlass.java index f4597f2b9..c835bd735 100644 --- a/src/main/java/vazkii/botania/common/block/decor/BlockElfGlass.java +++ b/src/main/java/vazkii/botania/common/block/decor/BlockElfGlass.java @@ -10,51 +10,29 @@ */ package vazkii.botania.common.block.decor; -import java.util.Random; - -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.recipe.IElvenItem; -import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; public class BlockElfGlass extends BlockManaGlass implements IElvenItem, ILexiconable { - private static final int ICON_COUNT = 4; - IIcon[] icons; - public BlockElfGlass() { super(LibBlockNames.ELF_GLASS); } - @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - icons = new IIcon[ICON_COUNT]; - for(int i = 0; i < ICON_COUNT; i++) - icons[i] = IconHelper.forBlock(par1IconRegister, this, i); - blockIcon = IconHelper.forBlock(par1IconRegister, this); - } - - @Override - public IIcon getIcon(IBlockAccess world, int x, int y, int z, int s) { - int v = (int) Math.floor(new Random(x * 10 ^ y * 20 ^ z * 30).nextInt(ICON_COUNT * 100) / 100.0); - return icons[v]; - } - @Override public boolean isElvenItem(ItemStack stack) { return true; } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.elvenResources; } diff --git a/src/main/java/vazkii/botania/common/block/decor/BlockEndStoneBrick.java b/src/main/java/vazkii/botania/common/block/decor/BlockEndStoneBrick.java deleted file mode 100644 index 22b476c67..000000000 --- a/src/main/java/vazkii/botania/common/block/decor/BlockEndStoneBrick.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Feb 16, 2015, 8:17:12 PM (GMT)] - */ -package vazkii.botania.common.block.decor; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; -import vazkii.botania.api.lexicon.ILexiconable; -import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.core.helper.IconHelper; -import vazkii.botania.common.block.BlockMod; -import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName; -import vazkii.botania.common.lexicon.LexiconData; -import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.registry.GameRegistry; - -public class BlockEndStoneBrick extends BlockMod implements ILexiconable { - - private static IIcon[] icons = new IIcon[5]; - - public BlockEndStoneBrick() { - super(Material.rock); - setHardness(1.5F); - setResistance(10F); - setStepSound(soundTypeStone); - setBlockName(LibBlockNames.END_STONE_BRICK); - } - - @Override - public void registerBlockIcons(IIconRegister register) { - for(int i = 0; i < icons.length; i++) { - icons[i] = IconHelper.forBlock(register, this, i); - } - } - - @Override - public void getSubBlocks(Item item, CreativeTabs tab, List list) { - for(int i = 0; i < 4; i++) - list.add(new ItemStack(item, 1, i)); - } - - @Override - public IIcon getIcon(int side, int meta) { - return meta == 3 ? icons[side == 0 || side == 1 ? 4 : 3] : icons[Math.min(icons.length - 1, meta)]; - } - - @Override - protected boolean shouldRegisterInNameSet() { - return false; - } - - @Override - public int damageDropped(int par1) { - return par1; - } - - @Override - public Block setBlockName(String par1Str) { - GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, par1Str); - return super.setBlockName(par1Str); - } - - @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) { - int meta = world.getBlockMetadata(x, y, z); - return new ItemStack(this, 1, meta); - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { - return LexiconData.endStoneDecor; - } - -} diff --git a/src/main/java/vazkii/botania/common/block/decor/BlockFloatingFlower.java b/src/main/java/vazkii/botania/common/block/decor/BlockFloatingFlower.java index 0d69eae4e..df2e7aa0f 100644 --- a/src/main/java/vazkii/botania/common/block/decor/BlockFloatingFlower.java +++ b/src/main/java/vazkii/botania/common/block/decor/BlockFloatingFlower.java @@ -10,127 +10,174 @@ */ package vazkii.botania.common.block.decor; -import cpw.mods.fml.common.Optional; -import cpw.mods.fml.common.registry.GameRegistry; -import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.block.statemap.StateMap; import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.passive.EntitySheep; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; import net.minecraft.init.Items; +import net.minecraft.item.EnumDyeColor; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; +import net.minecraft.util.BlockRenderLayer; +import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.common.property.ExtendedBlockState; +import net.minecraftforge.common.property.IExtendedBlockState; +import net.minecraftforge.common.property.IUnlistedProperty; +import net.minecraftforge.fml.common.Optional; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import thaumcraft.api.crafting.IInfusionStabiliser; import vazkii.botania.api.internal.VanillaPacketDispatcher; +import vazkii.botania.api.item.IFloatingFlower; +import vazkii.botania.api.item.IFloatingFlower.IslandType; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.lib.LibRenderIDs; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.Botania; -import vazkii.botania.common.block.BlockModContainer; -import vazkii.botania.common.block.decor.IFloatingFlower.IslandType; +import vazkii.botania.common.block.BlockMod; import vazkii.botania.common.block.tile.TileFloatingFlower; +import vazkii.botania.common.block.tile.TileFloatingSpecialFlower; import vazkii.botania.common.core.handler.ConfigHandler; -import vazkii.botania.common.integration.coloredlights.ColoredLightHelper; import vazkii.botania.common.item.IFloatingFlowerVariant; import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; +import javax.annotation.Nonnull; import java.util.List; import java.util.Random; @Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.crafting.IInfusionStabiliser", striprefs = true) -public class BlockFloatingFlower extends BlockModContainer implements ILexiconable, IInfusionStabiliser { +public class BlockFloatingFlower extends BlockMod implements ILexiconable, IInfusionStabiliser { + + private static final AxisAlignedBB AABB = new AxisAlignedBB(0.1, 0.1, 0.1, 0.9, 0.9, 0.9); public BlockFloatingFlower() { this(LibBlockNames.MINI_ISLAND); } public BlockFloatingFlower(String name) { - super(Material.ground); - setBlockName(name); + super(Material.GROUND, name); setHardness(0.5F); - setStepSound(soundTypeGravel); + setSoundType(SoundType.GROUND); setLightLevel(1F); + } - float f = 0.1F; - setBlockBounds(f, f, f, 1F - f, 1F - f, 1F - f); + @Nonnull + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { + return AABB; + } + + @Nonnull + @Override + public EnumBlockRenderType getRenderType(IBlockState state) { + return ConfigHandler.staticFloaters ? EnumBlockRenderType.MODEL : EnumBlockRenderType.ENTITYBLOCK_ANIMATED; + } + + @Nonnull + @Override + public BlockRenderLayer getBlockLayer() { + return BlockRenderLayer.CUTOUT; + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new ExtendedBlockState(this, new IProperty[] { BotaniaStateProps.COLOR }, new IUnlistedProperty[] { BotaniaStateProps.ISLAND_TYPE }); } @Override - @Optional.Method(modid = "easycoloredlights") - public int getLightValue(IBlockAccess world, int x, int y, int z) { - return ColoredLightHelper.getPackedColor(world.getBlockMetadata(x, y, z), originalLight); + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE); } @Override - protected boolean shouldRegisterInNameSet() { - return false; + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.COLOR).getMetadata(); + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + if (meta >= EnumDyeColor.values().length) { + meta = 0; + } + return getDefaultState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.byMetadata(meta)); + } + + @Nonnull + @Override + public IBlockState getExtendedState(@Nonnull IBlockState state, IBlockAccess world, BlockPos pos) { + state = getActualState(state, world, pos); + TileEntity te = world.getTileEntity(pos); + if (te instanceof TileFloatingFlower) { + state = ((IExtendedBlockState) state).withProperty(BotaniaStateProps.ISLAND_TYPE, ((TileFloatingFlower) te).getIslandType()); + } else if (te instanceof TileFloatingSpecialFlower) { + state = ((IExtendedBlockState) state).withProperty(BotaniaStateProps.ISLAND_TYPE, ((TileFloatingSpecialFlower) te).getIslandType()); + } + return state; } @Override - public Block setBlockName(String par1Str) { - register(par1Str); - return super.setBlockName(par1Str); - } - - protected void register(String name) { - GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, name); + public void registerItemForm() { + GameRegistry.register(new ItemBlockWithMetadataAndName(this), getRegistryName()); } + @SideOnly(Side.CLIENT) @Override - public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { - int meta = par1World.getBlockMetadata(par2, par3, par4); - float[] color = EntitySheep.fleeceColorTable[meta]; + public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) { + int hex = state.getValue(BotaniaStateProps.COLOR).getMapColor().colorValue; + int r = (hex & 0xFF0000) >> 16; + int g = (hex & 0xFF00) >> 8; + int b = (hex & 0xFF); - if(par5Random.nextDouble() < ConfigHandler.flowerParticleFrequency) - Botania.proxy.sparkleFX(par1World, par2 + 0.3 + par5Random.nextFloat() * 0.5, par3 + 0.5 + par5Random.nextFloat() * 0.5, par4 + 0.3 + par5Random.nextFloat() * 0.5, color[0], color[1], color[2], par5Random.nextFloat(), 5); + if(rand.nextDouble() < ConfigHandler.flowerParticleFrequency) + Botania.proxy.sparkleFX(pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.5 + rand.nextFloat() * 0.5, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5); } + @SideOnly(Side.CLIENT) @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - // NO-OP - } - - @Override - public void getSubBlocks(Item par1, CreativeTabs par2, List par3) { + public void getSubBlocks(@Nonnull Item item, CreativeTabs par2, List par3) { for(int i = 0; i < 16; i++) - par3.add(new ItemStack(par1, 1, i)); + par3.add(new ItemStack(item, 1, i)); } @Override - public int damageDropped(int par1) { - return par1; + public int damageDropped(IBlockState state) { + return getMetaFromState(state); } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public boolean renderAsNormalBlock() { + public boolean isFullCube(IBlockState state) { return false; } @Override - public IIcon getIcon(int par1, int par2) { - return Blocks.dirt.getIcon(par1, par2); - } - - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - ItemStack stack = player.getCurrentEquippedItem(); + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing side, float hitX, float hitY, float hitZ) { if(stack != null) { - IFloatingFlower flower = (IFloatingFlower) world.getTileEntity(x, y, z); + IFloatingFlower flower = (IFloatingFlower) world.getTileEntity(pos); IslandType type = null; - if(stack.getItem() == Items.snowball) + if(stack.getItem() == Items.SNOWBALL) type = IslandType.SNOW; else if(stack.getItem() instanceof IFloatingFlowerVariant) { IslandType newType = ((IFloatingFlowerVariant) stack.getItem()).getIslandType(stack); @@ -141,7 +188,7 @@ public class BlockFloatingFlower extends BlockModContainer implements ILexiconab if(type != null && type != flower.getIslandType()) { if(!world.isRemote) { flower.setIslandType(type); - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, x, y, z); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos); } if(!player.capabilities.isCreativeMode) @@ -153,22 +200,31 @@ public class BlockFloatingFlower extends BlockModContainer implements ILexiconab } @Override - public int getRenderType() { - return LibRenderIDs.idMiniIsland; + public boolean hasTileEntity(IBlockState state) { + return true; } + @Nonnull @Override - public TileEntity createNewTileEntity(World world, int meta) { + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileFloatingFlower(); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.shinyFlowers; } @Override - public boolean canStabaliseInfusion(World world, int x, int y, int z) { + public boolean canStabaliseInfusion(World world, BlockPos pos) { return ConfigHandler.enableThaumcraftStablizers; } + + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelLoader.setCustomStateMapper(this, new StateMap.Builder().ignore(BotaniaStateProps.COLOR).build()); + // All to variant inventory so smartmodel can work + ModelHandler.registerItemAllMeta(Item.getItemFromBlock(this), EnumDyeColor.values().length); + } } diff --git a/src/main/java/vazkii/botania/common/block/decor/BlockManaBeacon.java b/src/main/java/vazkii/botania/common/block/decor/BlockManaBeacon.java index 90d3d7a11..9091ea44c 100644 --- a/src/main/java/vazkii/botania/common/block/decor/BlockManaBeacon.java +++ b/src/main/java/vazkii/botania/common/block/decor/BlockManaBeacon.java @@ -10,107 +10,127 @@ */ package vazkii.botania.common.block.decor; -import java.awt.Color; -import java.util.List; - -import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.block.statemap.StateMap; import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.passive.EntitySheep; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumDyeColor; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.core.helper.IconHelper; -import vazkii.botania.common.block.BlockModContainer; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.client.core.handler.ModelHandler; +import vazkii.botania.common.block.BlockMod; import vazkii.botania.common.block.tile.TileManaBeacon; import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.registry.GameRegistry; -public class BlockManaBeacon extends BlockModContainer implements ILexiconable { +import javax.annotation.Nonnull; +import java.util.List; - IIcon[] icons; +public class BlockManaBeacon extends BlockMod implements ILexiconable { + + private static final AxisAlignedBB AABB = new AxisAlignedBB(3.0/16, 3.0/16, 3.0/16, 13.0/16, 13.0/16, 13.0/16); public BlockManaBeacon() { - super(Material.iron); + super(Material.IRON, LibBlockNames.MANA_BEACON); setHardness(5.0F); setResistance(10.0F); - setStepSound(soundTypeMetal); - float size = 3F / 16F; - setBlockBounds(size, size, size, 1F - size, 1F - size, 1F - size); - setBlockName(LibBlockNames.MANA_BEACON); + setSoundType(SoundType.METAL); + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.COLOR); } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - icons = new IIcon[2]; - for(int i = 0; i < 2; i++) - icons[i] = IconHelper.forBlock(par1IconRegister, this, i); + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE); } @Override - public IIcon getIcon(int par1, int par2) { - return icons[par1 == 1 ? 1 : 0]; + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.COLOR).getMetadata(); } + @Nonnull @Override - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { + public IBlockState getStateFromMeta(int meta) { + if (meta >= EnumDyeColor.values().length) { + meta = 0; + } + return getDefaultState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.byMetadata(meta)); + } + + @Nonnull + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { + return AABB; + } + + @SideOnly(Side.CLIENT) + @Override + public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List stacks) { for(int i = 0; i < 16; i++) - par3List.add(new ItemStack(par1, 1, i)); + stacks.add(new ItemStack(item, 1, i)); } @Override - public Block setBlockName(String par1Str) { - GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, par1Str); - return super.setBlockName(par1Str); + public void registerItemForm() { + GameRegistry.register(new ItemBlockWithMetadataAndName(this), getRegistryName()); } @Override - protected boolean shouldRegisterInNameSet() { + public boolean isFullCube(IBlockState state) { return false; } @Override - public boolean renderAsNormalBlock() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public boolean isOpaqueCube() { - return false; + public int damageDropped(IBlockState state) { + return getMetaFromState(state); } @Override - public int damageDropped(int par1) { - return par1; - } - - @Override - public int getRenderColor(int par1) { - float[] color = EntitySheep.fleeceColorTable[par1]; - return new Color(color[0], color[1], color[2]).getRGB(); - } - - @Override - public int colorMultiplier(IBlockAccess par1iBlockAccess, int par2, int par3, int par4) { - return getRenderColor(par1iBlockAccess.getBlockMetadata(par2, par3, par4)); - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.unstableBlocks; } @Override - public TileEntity createNewTileEntity(World world, int meta) { + public boolean hasTileEntity(IBlockState state) { + return true; + } + + @Nonnull + @Override + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileManaBeacon(); } + + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelLoader.setCustomStateMapper(this, (new StateMap.Builder()).ignore(BotaniaStateProps.COLOR).build()); + ModelHandler.registerBlockToState(this, EnumDyeColor.values().length); + } } diff --git a/src/main/java/vazkii/botania/common/block/decor/BlockManaFlame.java b/src/main/java/vazkii/botania/common/block/decor/BlockManaFlame.java index fdf5c95b6..feb059682 100644 --- a/src/main/java/vazkii/botania/common/block/decor/BlockManaFlame.java +++ b/src/main/java/vazkii/botania/common/block/decor/BlockManaFlame.java @@ -10,40 +10,51 @@ */ package vazkii.botania.common.block.decor; -import java.util.ArrayList; - +import com.google.common.collect.ImmutableList; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.fml.common.Optional; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.common.block.BlockModContainer; +import vazkii.botania.common.block.BlockMod; import vazkii.botania.common.block.tile.TileManaFlame; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; import vazkii.botania.common.world.WorldTypeSkyblock; -import cpw.mods.fml.common.Optional; -public class BlockManaFlame extends BlockModContainer implements ILexiconable { +import javax.annotation.Nonnull; +import java.util.List; + +public class BlockManaFlame extends BlockMod implements ILexiconable { + + private static final AxisAlignedBB AABB = new AxisAlignedBB(0.25, 0.25, 0.25, 0.75, 0.75, 0.75); public BlockManaFlame() { - super(Material.cloth); - setBlockName(LibBlockNames.MANA_FLAME); - float f = 0.25F; - setStepSound(soundTypeCloth); - setBlockBounds(f, f, f, 1F - f, 1F - f, 1F - f); + super(Material.CLOTH, LibBlockNames.MANA_FLAME); + setSoundType(SoundType.CLOTH); setLightLevel(1F); } + @Nonnull + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { + return AABB; + } + @Override public boolean registerInCreative() { return false; @@ -51,49 +62,46 @@ public class BlockManaFlame extends BlockModContainer implements ILexiconable { @Override @Optional.Method(modid = "easycoloredlights") - public int getLightValue(IBlockAccess world, int x, int y, int z) { - return ((TileManaFlame) world.getTileEntity(x, y, z)).getLightColor(); + public int getLightValue(@Nonnull IBlockState state, IBlockAccess world, @Nonnull BlockPos pos) { + if(world.getBlockState(pos).getBlock() != this) + return world.getBlockState(pos).getLightValue(world, pos); + return ((TileManaFlame) world.getTileEntity(pos)).getLightColor(); + } + + @Nonnull + @Override + public EnumBlockRenderType getRenderType(IBlockState state) { + return EnumBlockRenderType.INVISIBLE; } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - // NO-OP - } - - @Override - public int getRenderType() { - return -1; - } - - @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public boolean renderAsNormalBlock() { + public boolean isFullCube(IBlockState state) { return false; } @Override - public boolean getBlocksMovement(IBlockAccess p_149655_1_, int p_149655_2_, int p_149655_3_, int p_149655_4_) { + public boolean isPassable(IBlockAccess world, BlockPos pos) { return true; } @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { - return null; + public AxisAlignedBB getCollisionBoundingBox(IBlockState state, @Nonnull World world, @Nonnull BlockPos pos) { + return NULL_AABB; } @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int s, float xs, float ys, float zs) { + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing s, float xs, float ys, float zs) { if(WorldTypeSkyblock.isWorldSkyblock(world)) { - ItemStack stack = player.getCurrentEquippedItem(); - if(stack != null && stack.getItem() == Item.getItemFromBlock(Blocks.sapling) && !player.inventory.hasItem(ModItems.lexicon)) { + if(stack != null && stack.getItem() == Item.getItemFromBlock(Blocks.SAPLING) && !player.inventory.hasItemStack(new ItemStack(ModItems.lexicon))) { if(!world.isRemote) stack.stackSize--; if(!player.inventory.addItemStackToInventory(new ItemStack(ModItems.lexicon))) - player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.lexicon), false); + player.dropItem(new ItemStack(ModItems.lexicon), false); return true; } @@ -101,24 +109,29 @@ public class BlockManaFlame extends BlockModContainer implements ILexiconable { return false; } + @Nonnull @Override - public IIcon getIcon(int side, int meta) { - return Blocks.fire.getIcon(side, meta); + public List getDrops(IBlockAccess world, BlockPos pos, @Nonnull IBlockState state, int fortune) { + return ImmutableList.of(); } @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - return new ArrayList(); + public boolean hasTileEntity(IBlockState state) { + return true; } + @Nonnull @Override - public TileEntity createNewTileEntity(World world, int meta) { + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileManaFlame(); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.lenses; } + @Override + public void registerItemForm() {} + } diff --git a/src/main/java/vazkii/botania/common/block/decor/BlockManaGlass.java b/src/main/java/vazkii/botania/common/block/decor/BlockManaGlass.java index b38cc8e33..2d89cdab2 100644 --- a/src/main/java/vazkii/botania/common/block/decor/BlockManaGlass.java +++ b/src/main/java/vazkii/botania/common/block/decor/BlockManaGlass.java @@ -11,17 +11,26 @@ package vazkii.botania.common.block.decor; import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockRenderLayer; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.common.block.BlockMod; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; +import javax.annotation.Nonnull; + public class BlockManaGlass extends BlockMod implements ILexiconable { public BlockManaGlass() { @@ -29,36 +38,33 @@ public class BlockManaGlass extends BlockMod implements ILexiconable { } public BlockManaGlass(String name) { - super(Material.glass); + super(Material.GLASS, name); setHardness(0.3F); - setStepSound(soundTypeGlass); + setSoundType(SoundType.GLASS); setLightLevel(1.0F); - setBlockName(name); } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } - public boolean shouldSideBeRendered1(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) { - Block block = p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_); + @SideOnly(Side.CLIENT) + @Override + public boolean shouldSideBeRendered(IBlockState state, @Nonnull IBlockAccess world, @Nonnull BlockPos pos, EnumFacing side) { + Block block = world.getBlockState(pos.offset(side)).getBlock(); + return block == this ? false : super.shouldSideBeRendered(state, world, pos, side); + } - return block == this ? false : super.shouldSideBeRendered(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_); + @SideOnly(Side.CLIENT) + @Nonnull + @Override + public BlockRenderLayer getBlockLayer() { + return BlockRenderLayer.TRANSLUCENT; } @Override - public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) { - return shouldSideBeRendered1(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, 1 - p_149646_5_); - } - - @Override - public int getRenderBlockPass() { - return 1; - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.pool; } diff --git a/src/main/java/vazkii/botania/common/block/decor/BlockModMushroom.java b/src/main/java/vazkii/botania/common/block/decor/BlockModMushroom.java index e66816ebc..ec614ba82 100644 --- a/src/main/java/vazkii/botania/common/block/decor/BlockModMushroom.java +++ b/src/main/java/vazkii/botania/common/block/decor/BlockModMushroom.java @@ -13,142 +13,153 @@ package vazkii.botania.common.block.decor; import java.util.List; import java.util.Random; +import javax.annotation.Nonnull; + import net.minecraft.block.Block; +import net.minecraft.block.BlockDirt; import net.minecraft.block.BlockMushroom; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.SoundType; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.passive.EntitySheep; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; +import net.minecraft.item.EnumDyeColor; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fml.common.Optional; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import thaumcraft.api.crafting.IInfusionStabiliser; import vazkii.botania.api.item.IHornHarvestable; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.core.helper.IconHelper; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.client.core.handler.ModelHandler; +import vazkii.botania.client.render.IModelRegister; import vazkii.botania.common.Botania; import vazkii.botania.common.core.BotaniaCreativeTab; import vazkii.botania.common.core.handler.ConfigHandler; -import vazkii.botania.common.integration.coloredlights.ColoredLightHelper; import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.Optional; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import vazkii.botania.common.lib.LibMisc; @Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.crafting.IInfusionStabiliser", striprefs = true) -public class BlockModMushroom extends BlockMushroom implements IInfusionStabiliser, IHornHarvestable, ILexiconable { +public class BlockModMushroom extends BlockMushroom implements IInfusionStabiliser, IHornHarvestable, ILexiconable, IModelRegister { - public static IIcon[] icons; - public int originalLight; + private static final AxisAlignedBB AABB = new AxisAlignedBB(0.3, 0, 0.3, 0.8, 1, 0.8); public BlockModMushroom() { - setBlockName(LibBlockNames.MUSHROOM); + setRegistryName(new ResourceLocation(LibMisc.MOD_ID, LibBlockNames.MUSHROOM)); + setUnlocalizedName(LibBlockNames.MUSHROOM); setLightLevel(0.2F); setHardness(0F); - setStepSound(soundTypeGrass); - setBlockBounds(0.3F, 0.0F, 0.3F, 0.8F, 1, 0.8F); + setSoundType(SoundType.PLANT); setTickRandomly(false); setCreativeTab(BotaniaCreativeTab.INSTANCE); + setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE)); + GameRegistry.register(this); + GameRegistry.register(new ItemBlockWithMetadataAndName(this), getRegistryName()); + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.COLOR); } @Override - public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { - // NO-OP, to prevent spreading + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.COLOR).getMetadata(); + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + if (meta >= EnumDyeColor.values().length) { + meta = 0; + } + return getDefaultState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.byMetadata(meta)); + } + + @Nonnull + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { + return AABB; } @Override - public boolean canBlockStay(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_) { - if(p_149718_3_ >= 0 && p_149718_3_ < 256) { - Block block = p_149718_1_.getBlock(p_149718_2_, p_149718_3_ - 1, p_149718_4_); - return block == Blocks.mycelium || block == Blocks.dirt && p_149718_1_.getBlockMetadata(p_149718_2_, p_149718_3_ - 1, p_149718_4_) == 2 || block.canSustainPlant(p_149718_1_, p_149718_2_, p_149718_3_ - 1, p_149718_4_, ForgeDirection.UP, this); + public void updateTick(@Nonnull World world, @Nonnull BlockPos pos, IBlockState state, Random rand) {} // Prevent spreading + + @Override + public boolean canPlaceBlockAt(World world, BlockPos pos) { + if(pos.getY() >= 0 && pos.getY() < 256) { + IBlockState state = world.getBlockState(pos.down()); + Block block = state.getBlock(); + return block == Blocks.MYCELIUM || block == Blocks.DIRT && state.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.PODZOL || block.canSustainPlant(state, world, pos.down(), EnumFacing.UP, this); } return false; } - @Override - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for(int i = 0; i < 16; i++) - par3List.add(new ItemStack(par1, 1, i)); - } - - @Override - public Block setBlockName(String par1Str) { - GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, par1Str); - return super.setBlockName(par1Str); - } - - @Override @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - icons = new IIcon[16]; - - for(int i = 0; i < icons.length; i++) - icons[i] = IconHelper.forBlock(par1IconRegister, this, i); + @Override + public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List stacks) { + for(int i = 0; i < 16; i++) + stacks.add(new ItemStack(item, 1, i)); } @Override - public Block setLightLevel(float p_149715_1_) { - originalLight = (int) (p_149715_1_ * 15); - return super.setLightLevel(p_149715_1_); + public int damageDropped(IBlockState state) { + return getMetaFromState(state); + } + + @SideOnly(Side.CLIENT) + @Override + public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) { + int hex = state.getValue(BotaniaStateProps.COLOR).getMapColor().colorValue; + int r = (hex & 0xFF0000) >> 16; + int g = (hex & 0xFF00) >> 8; + int b = (hex & 0xFF); + + if(rand.nextDouble() < ConfigHandler.flowerParticleFrequency * 0.25F) + Botania.proxy.sparkleFX(pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.5 + rand.nextFloat() * 0.5, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5); } @Override - @Optional.Method(modid = "easycoloredlights") - public int getLightValue(IBlockAccess world, int x, int y, int z) { - return ColoredLightHelper.getPackedColor(world.getBlockMetadata(x, y, z), originalLight); - } - - @Override - public IIcon getIcon(int par1, int par2) { - return icons[par2]; - } - - @Override - public int damageDropped(int par1) { - return par1; - } - - @Override - public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { - int meta = par1World.getBlockMetadata(par2, par3, par4); - float[] color = EntitySheep.fleeceColorTable[meta]; - - if(par5Random.nextDouble() < ConfigHandler.flowerParticleFrequency * 0.25F) - Botania.proxy.sparkleFX(par1World, par2 + 0.3 + par5Random.nextFloat() * 0.5, par3 + 0.5 + par5Random.nextFloat() * 0.5, par4 + 0.3 + par5Random.nextFloat() * 0.5, color[0], color[1], color[2], par5Random.nextFloat(), 5); - } - - @Override - public boolean canStabaliseInfusion(World world, int x, int y, int z) { + public boolean canStabaliseInfusion(World world, BlockPos pos) { return ConfigHandler.enableThaumcraftStablizers; } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.mushrooms; } @Override - public boolean canHornHarvest(World world, int x, int y, int z, ItemStack stack, EnumHornType hornType) { + public boolean canHornHarvest(World world, BlockPos pos, ItemStack stack, EnumHornType hornType) { return false; } @Override - public boolean hasSpecialHornHarvest(World world, int x, int y, int z, ItemStack stack, EnumHornType hornType) { + public boolean hasSpecialHornHarvest(World world, BlockPos pos, ItemStack stack, EnumHornType hornType) { return false; } @Override - public void harvestByHorn(World world, int x, int y, int z, ItemStack stack, EnumHornType hornType) { - // NO-OP - } + public void harvestByHorn(World world, BlockPos pos, ItemStack stack, EnumHornType hornType) {} + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerCustomItemblock(this, EnumDyeColor.values().length, i -> "mushroom_" + EnumDyeColor.byMetadata(i).getName()); + } } diff --git a/src/main/java/vazkii/botania/common/block/decor/BlockPavement.java b/src/main/java/vazkii/botania/common/block/decor/BlockPavement.java index d13de732d..49768b283 100644 --- a/src/main/java/vazkii/botania/common/block/decor/BlockPavement.java +++ b/src/main/java/vazkii/botania/common/block/decor/BlockPavement.java @@ -10,77 +10,112 @@ */ package vazkii.botania.common.block.decor; -import java.util.List; - -import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumDyeColor; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; -import vazkii.botania.client.core.helper.IconHelper; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.block.BlockMod; import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import javax.annotation.Nonnull; +import java.util.List; public class BlockPavement extends BlockMod { public static final int TYPES = 6; - IIcon[] icons; public BlockPavement() { - super(Material.rock); + super(Material.ROCK, LibBlockNames.PAVEMENT); setHardness(2.0F); setResistance(10.0F); - setStepSound(soundTypeStone); - setBlockName(LibBlockNames.PAVEMENT); + setSoundType(SoundType.STONE); + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.PAVEMENT_COLOR); } @Override - protected boolean shouldRegisterInNameSet() { - return false; + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.PAVEMENT_COLOR, EnumDyeColor.WHITE); } @Override - public int damageDropped(int par1) { - return par1; + public int getMetaFromState(IBlockState state) { + switch (state.getValue(BotaniaStateProps.PAVEMENT_COLOR)) { + case GREEN: return 5; + case YELLOW: return 4; + case RED: return 3; + case BLUE: return 2; + case BLACK: return 1; + case WHITE: + default: return 0; + } + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + if (meta >= TYPES) { + meta = 0; + } + + EnumDyeColor color; + switch (meta) { + case 5: color = EnumDyeColor.GREEN; break; + case 4: color = EnumDyeColor.YELLOW; break; + case 3: color = EnumDyeColor.RED; break; + case 2: color = EnumDyeColor.BLUE; break; + case 1: color = EnumDyeColor.BLACK; break; + case 0: + default: color = EnumDyeColor.WHITE; break; + } + return getDefaultState().withProperty(BotaniaStateProps.PAVEMENT_COLOR, color); } @Override - public Block setBlockName(String par1Str) { - GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, par1Str); - return super.setBlockName(par1Str); + public int damageDropped(IBlockState state) { + return getMetaFromState(state); } @Override - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for(int i = 0; i < TYPES; i++) - par3List.add(new ItemStack(par1, 1, i)); + public void registerItemForm() { + GameRegistry.register(new ItemBlockWithMetadataAndName(this), getRegistryName()); } - @Override @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - icons = new IIcon[TYPES]; + @Override + public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List stacks) { for(int i = 0; i < TYPES; i++) - icons[i] = IconHelper.forBlock(par1IconRegister, this, i); + stacks.add(new ItemStack(item, 1, i)); } + @Nonnull @Override - public IIcon getIcon(int par1, int par2) { - return icons[Math.min(TYPES - 1, par2)]; + public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player) { + return new ItemStack(this, 1, getMetaFromState(world.getBlockState(pos))); } + @SideOnly(Side.CLIENT) @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) { - int meta = world.getBlockMetadata(x, y, z); - return new ItemStack(this, 1, meta); + public void registerModels() { + ModelHandler.registerBlockToState(this, BotaniaStateProps.PAVEMENT_COLOR.getAllowedValues().size()); } } diff --git a/src/main/java/vazkii/botania/common/block/decor/BlockPetalBlock.java b/src/main/java/vazkii/botania/common/block/decor/BlockPetalBlock.java index 1ee7e2982..1721e9c59 100644 --- a/src/main/java/vazkii/botania/common/block/decor/BlockPetalBlock.java +++ b/src/main/java/vazkii/botania/common/block/decor/BlockPetalBlock.java @@ -10,70 +10,94 @@ */ package vazkii.botania.common.block.decor; -import java.awt.Color; -import java.util.List; - -import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.block.statemap.StateMap; import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.passive.EntitySheep; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumDyeColor; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.world.IBlockAccess; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.block.BlockMod; import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.registry.GameRegistry; + +import javax.annotation.Nonnull; +import java.util.List; public class BlockPetalBlock extends BlockMod implements ILexiconable { public BlockPetalBlock() { - super(Material.plants); + super(Material.PLANTS, LibBlockNames.PETAL_BLOCK); setHardness(0.4F); - setStepSound(soundTypeGrass); - setBlockName(LibBlockNames.PETAL_BLOCK); + setSoundType(SoundType.PLANT); + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.COLOR); } @Override - public void getSubBlocks(Item item, CreativeTabs tab, List list) { + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE); + } + + @Override + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.COLOR).getMetadata(); + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + if (meta >= EnumDyeColor.values().length) { + meta = 0; + } + return getDefaultState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.byMetadata(meta)); + } + + @SideOnly(Side.CLIENT) + @Override + public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List list) { for(int i = 0; i < 16; i++) list.add(new ItemStack(item, 1, i)); } @Override - protected boolean shouldRegisterInNameSet() { - return false; + public void registerItemForm() { + GameRegistry.register(new ItemBlockWithMetadataAndName(this), getRegistryName()); } @Override - public Block setBlockName(String par1Str) { - GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, par1Str); - return super.setBlockName(par1Str); + public int damageDropped(IBlockState state) { + return getMetaFromState(state); } @Override - public int getRenderColor(int meta) { - return new Color(EntitySheep.fleeceColorTable[meta][0], EntitySheep.fleeceColorTable[meta][1], EntitySheep.fleeceColorTable[meta][2]).getRGB(); - } - - @Override - public int colorMultiplier(IBlockAccess world, int x, int y, int z) { - return getRenderColor(world.getBlockMetadata(x, y, z)); - } - - @Override - public int damageDropped(int meta) { - return meta; - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.flowers; } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelLoader.setCustomStateMapper(this, (new StateMap.Builder()).ignore(BotaniaStateProps.COLOR).build()); + ModelHandler.registerBlockToState(this, EnumDyeColor.values().length); + } + } diff --git a/src/main/java/vazkii/botania/common/block/decor/BlockPrismarine.java b/src/main/java/vazkii/botania/common/block/decor/BlockPrismarine.java deleted file mode 100644 index 870ac12e3..000000000 --- a/src/main/java/vazkii/botania/common/block/decor/BlockPrismarine.java +++ /dev/null @@ -1,110 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jun 28, 2014, 8:25:39 PM (GMT)] - */ -package vazkii.botania.common.block.decor; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; -import net.minecraftforge.client.event.TextureStitchEvent; -import net.minecraftforge.common.MinecraftForge; -import vazkii.botania.api.lexicon.ILexiconable; -import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.core.helper.IconHelper; -import vazkii.botania.client.render.block.InterpolatedIcon; -import vazkii.botania.common.block.BlockMod; -import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName; -import vazkii.botania.common.lexicon.LexiconData; -import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockPrismarine extends BlockMod implements ILexiconable { - - private static final int TYPES = 3; - IIcon[] icons; - - public BlockPrismarine() { - super(Material.rock); - setHardness(2.0F); - setResistance(10.0F); - setStepSound(soundTypeStone); - setBlockName(LibBlockNames.PRISMARINE); - MinecraftForge.EVENT_BUS.register(this); - } - - @Override - protected boolean shouldRegisterInNameSet() { - return false; - } - - @Override - public int damageDropped(int par1) { - return par1; - } - - @Override - public Block setBlockName(String par1Str) { - GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, par1Str); - return super.setBlockName(par1Str); - } - - @Override - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for(int i = 0; i < TYPES; i++) - par3List.add(new ItemStack(par1, 1, i)); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - icons = new IIcon[TYPES]; - for(int i = 1; i < TYPES; i++) - icons[i] = IconHelper.forBlock(par1IconRegister, this, i); - } - - @SubscribeEvent - @SideOnly(Side.CLIENT) - public void loadTextures(TextureStitchEvent.Pre event) { - if(event.map.getTextureType() == 0) { - TextureAtlasSprite icon = new InterpolatedIcon("botania:prismarine0"); - if(event.map.setTextureEntry("botania:prismarine0", icon)) - icons[0] = icon; - } - } - - @Override - public IIcon getIcon(int par1, int par2) { - return icons[Math.min(TYPES - 1, par2)]; - } - - @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) { - int meta = world.getBlockMetadata(x, y, z); - return new ItemStack(this, 1, meta); - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { - return LexiconData.prismarine; - } -} \ No newline at end of file diff --git a/src/main/java/vazkii/botania/common/block/decor/BlockReeds.java b/src/main/java/vazkii/botania/common/block/decor/BlockReeds.java deleted file mode 100644 index 0cfdf2cae..000000000 --- a/src/main/java/vazkii/botania/common/block/decor/BlockReeds.java +++ /dev/null @@ -1,73 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jul 28, 2014, 8:02:49 PM (GMT)] - */ -package vazkii.botania.common.block.decor; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockRotatedPillar; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; -import vazkii.botania.api.lexicon.ILexiconable; -import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.core.helper.IconHelper; -import vazkii.botania.common.core.BotaniaCreativeTab; -import vazkii.botania.common.item.block.ItemBlockMod; -import vazkii.botania.common.lexicon.LexiconData; -import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockReeds extends BlockRotatedPillar implements ILexiconable { - - IIcon topIcon; - - public BlockReeds() { - super(Material.wood); - setHardness(1.0F); - setStepSound(soundTypeWood); - setBlockName(LibBlockNames.REED_BLOCK); - setCreativeTab(BotaniaCreativeTab.INSTANCE); - } - - - @Override - public Block setBlockName(String par1Str) { - GameRegistry.registerBlock(this, ItemBlockMod.class, par1Str); - return super.setBlockName(par1Str); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - blockIcon = IconHelper.forBlock(par1IconRegister, this, 0); - topIcon = IconHelper.forBlock(par1IconRegister, this, 1); - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { - return LexiconData.decorativeBlocks; - } - - @Override - protected IIcon getSideIcon(int p_150163_1_) { - return blockIcon; - } - - @Override - protected IIcon getTopIcon(int p_150161_1_) { - return topIcon; - } - -} diff --git a/src/main/java/vazkii/botania/common/block/decor/BlockSeaLamp.java b/src/main/java/vazkii/botania/common/block/decor/BlockSeaLamp.java deleted file mode 100644 index 381135096..000000000 --- a/src/main/java/vazkii/botania/common/block/decor/BlockSeaLamp.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jun 28, 2014, 9:24:43 PM (GMT)] - */ -package vazkii.botania.common.block.decor; - -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import vazkii.botania.api.lexicon.ILexiconable; -import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.common.block.BlockMod; -import vazkii.botania.common.integration.coloredlights.ColoredLightHelper; -import vazkii.botania.common.lexicon.LexiconData; -import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.Optional; - -public class BlockSeaLamp extends BlockMod implements ILexiconable { - - public BlockSeaLamp() { - super(Material.glass); - setHardness(0.3F); - setStepSound(soundTypeGlass); - setLightLevel(1.0F); - setBlockName(LibBlockNames.SEA_LAMP); - } - - int coloredLight = -1; - - @Override - @Optional.Method(modid = "easycoloredlights") - public int getLightValue(IBlockAccess world, int x, int y, int z) { - return coloredLight == -1 ? (coloredLight = ColoredLightHelper.makeRGBLightValue(85, 136, 125, originalLight)) : coloredLight; - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { - return LexiconData.prismarine; - } - -} diff --git a/src/main/java/vazkii/botania/common/block/decor/BlockShimmerrock.java b/src/main/java/vazkii/botania/common/block/decor/BlockShimmerrock.java index c99f9c53e..04b990213 100644 --- a/src/main/java/vazkii/botania/common/block/decor/BlockShimmerrock.java +++ b/src/main/java/vazkii/botania/common/block/decor/BlockShimmerrock.java @@ -10,53 +10,29 @@ */ package vazkii.botania.common.block.decor; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import net.minecraftforge.client.event.TextureStitchEvent; -import net.minecraftforge.common.MinecraftForge; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.render.block.InterpolatedIcon; import vazkii.botania.common.block.BlockMod; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; public class BlockShimmerrock extends BlockMod implements ILexiconable { public BlockShimmerrock() { - super(Material.rock); + super(Material.ROCK, LibBlockNames.SHIMMERROCK); setHardness(2.0F); setResistance(10.0F); - setStepSound(soundTypeStone); - setBlockName(LibBlockNames.SHIMMERROCK); - MinecraftForge.EVENT_BUS.register(this); - } - - @SubscribeEvent - @SideOnly(Side.CLIENT) - public void loadTextures(TextureStitchEvent.Pre event) { - if(event.map.getTextureType() == 0) { - TextureAtlasSprite icon = new InterpolatedIcon("botania:shimmerrock"); - if(event.map.setTextureEntry("botania:shimmerrock", icon)) - blockIcon = icon; - } + setSoundType(SoundType.STONE); } @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - // NO-OP - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.rainbowRod; } diff --git a/src/main/java/vazkii/botania/common/block/decor/BlockShimmerwoodPlanks.java b/src/main/java/vazkii/botania/common/block/decor/BlockShimmerwoodPlanks.java index 3a45c951d..3d6372d7a 100644 --- a/src/main/java/vazkii/botania/common/block/decor/BlockShimmerwoodPlanks.java +++ b/src/main/java/vazkii/botania/common/block/decor/BlockShimmerwoodPlanks.java @@ -10,52 +10,28 @@ */ package vazkii.botania.common.block.decor; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import net.minecraftforge.client.event.TextureStitchEvent; -import net.minecraftforge.common.MinecraftForge; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.render.block.InterpolatedIcon; import vazkii.botania.common.block.BlockMod; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; public class BlockShimmerwoodPlanks extends BlockMod implements ILexiconable { public BlockShimmerwoodPlanks() { - super(Material.wood); + super(Material.WOOD, LibBlockNames.SHIMMERWOOD_PLANKS); setHardness(2.0F); - setStepSound(soundTypeWood); - setBlockName(LibBlockNames.SHIMMERWOOD_PLANKS); - MinecraftForge.EVENT_BUS.register(this); - } - - @SubscribeEvent - @SideOnly(Side.CLIENT) - public void loadTextures(TextureStitchEvent.Pre event) { - if(event.map.getTextureType() == 0) { - TextureAtlasSprite icon = new InterpolatedIcon("botania:shimmerwoodPlanks"); - if(event.map.setTextureEntry("botania:shimmerwoodPlanks", icon)) - blockIcon = icon; - } + setSoundType(SoundType.WOOD); } @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - // NO-OP - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.rainbowRod; } diff --git a/src/main/java/vazkii/botania/common/block/decor/BlockShinyFlower.java b/src/main/java/vazkii/botania/common/block/decor/BlockShinyFlower.java index 7ec379792..4fc9d2a21 100644 --- a/src/main/java/vazkii/botania/common/block/decor/BlockShinyFlower.java +++ b/src/main/java/vazkii/botania/common/block/decor/BlockShinyFlower.java @@ -10,83 +10,70 @@ */ package vazkii.botania.common.block.decor; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.block.statemap.StateMap; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumDyeColor; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.fml.common.Optional; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import thaumcraft.api.crafting.IInfusionStabiliser; import vazkii.botania.api.item.IHornHarvestable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.core.helper.IconHelper; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.block.BlockModFlower; import vazkii.botania.common.core.handler.ConfigHandler; -import vazkii.botania.common.integration.coloredlights.ColoredLightHelper; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.Optional; + +import javax.annotation.Nonnull; @Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.crafting.IInfusionStabiliser", striprefs = true) public class BlockShinyFlower extends BlockModFlower implements IInfusionStabiliser, IHornHarvestable { - private static IIcon[] icons; - private static IIcon[] iconsAlt; - public BlockShinyFlower() { super(LibBlockNames.SHINY_FLOWER); setLightLevel(1F); } @Override - @Optional.Method(modid = "easycoloredlights") - public int getLightValue(IBlockAccess world, int x, int y, int z) { - return ColoredLightHelper.getPackedColor(world.getBlockMetadata(x, y, z), originalLight); - } - - @Override - public void registerBlockIcons(IIconRegister register) { - icons = new IIcon[16]; - iconsAlt = new IIcon[16]; - for(int i = 0; i < 16; i++) { - icons[i] = IconHelper.forName(register, "flowerGlimmering" + i); - iconsAlt[i] = IconHelper.forName(register, "flowerGlimmering" + i, BlockModFlower.ALT_DIR); - } - } - - @Override - public IIcon getIcon(int par1, int par2) { - return (ConfigHandler.altFlowerTextures ? iconsAlt : icons)[Math.min(icons.length - 1, par2)]; - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.shinyFlowers; } @Override - public boolean func_149851_a(World world, int x, int y, int z, boolean fuckifiknow) { + public boolean canGrow(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state, boolean fuckifiknow) { return false; } @Override - public boolean canStabaliseInfusion(World world, int x, int y, int z) { + public boolean canStabaliseInfusion(World world, BlockPos pos) { return ConfigHandler.enableThaumcraftStablizers; } @Override - public boolean canHornHarvest(World world, int x, int y, int z, ItemStack stack, EnumHornType hornType) { + public boolean canHornHarvest(World world, BlockPos pos, ItemStack stack, EnumHornType hornType) { return false; } @Override - public boolean hasSpecialHornHarvest(World world, int x, int y, int z, ItemStack stack, EnumHornType hornType) { + public boolean hasSpecialHornHarvest(World world, BlockPos pos, ItemStack stack, EnumHornType hornType) { return false; } @Override - public void harvestByHorn(World world, int x, int y, int z, ItemStack stack, EnumHornType hornType) { - // NO-OP + public void harvestByHorn(World world, BlockPos pos, ItemStack stack, EnumHornType hornType) {} + + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelLoader.setCustomStateMapper(this, (new StateMap.Builder()).ignore(getTypeProperty()).build()); + ModelHandler.registerCustomItemblock(this, EnumDyeColor.values().length, i -> "glimmering_flower_" + EnumDyeColor.byMetadata(i).getName()); } } diff --git a/src/main/java/vazkii/botania/common/block/decor/BlockStarfield.java b/src/main/java/vazkii/botania/common/block/decor/BlockStarfield.java index bbde621f0..f2ae2f945 100644 --- a/src/main/java/vazkii/botania/common/block/decor/BlockStarfield.java +++ b/src/main/java/vazkii/botania/common/block/decor/BlockStarfield.java @@ -10,64 +10,99 @@ */ package vazkii.botania.common.block.decor; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; +import net.minecraft.util.BlockRenderLayer; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.core.helper.IconHelper; -import vazkii.botania.common.block.BlockModContainer; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.common.block.BlockMod; import vazkii.botania.common.block.tile.TileStarfield; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -public class BlockStarfield extends BlockModContainer implements ILexiconable { +import javax.annotation.Nonnull; - IIcon[] icons; +public class BlockStarfield extends BlockMod implements ILexiconable { + + private static final AxisAlignedBB AABB = new AxisAlignedBB(0, 0, 0, 1, 0.25, 1); public BlockStarfield() { - super(Material.iron); + super(Material.IRON, LibBlockNames.STARFIELD); setHardness(5F); setResistance(2000F); - setStepSound(soundTypeMetal); - setBlockName(LibBlockNames.STARFIELD); + setSoundType(SoundType.METAL); + } - setBlockBounds(0F, 0F, 0F, 1F, 0.25F, 1F); + @Nonnull + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { + return AABB; + } + + @SideOnly(Side.CLIENT) + @Nonnull + @Override + public BlockRenderLayer getBlockLayer() { + return BlockRenderLayer.CUTOUT_MIPPED; + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.POWERED); } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - icons = new IIcon[3]; - for(int i = 0; i < icons.length; i++) - icons[i] = IconHelper.forBlock(par1IconRegister, this, i); + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.POWERED, false); } @Override - public IIcon getIcon(int par1, int par2) { - return icons[Math.min(2, par1)]; + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.POWERED) ? 1 : 0; + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + return getDefaultState().withProperty(BotaniaStateProps.POWERED, meta == 1); } @Override - public boolean renderAsNormalBlock() { + public boolean isFullCube(IBlockState state) { return false; } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public TileEntity createNewTileEntity(World world, int meta) { + public boolean hasTileEntity(IBlockState state) { + return true; + } + + @Nonnull + @Override + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileStarfield(); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.starfield; } diff --git a/src/main/java/vazkii/botania/common/block/decor/BlockThatch.java b/src/main/java/vazkii/botania/common/block/decor/BlockThatch.java deleted file mode 100644 index 2efb25986..000000000 --- a/src/main/java/vazkii/botania/common/block/decor/BlockThatch.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jul 28, 2014, 9:07:00 PM (GMT)] - */ -package vazkii.botania.common.block.decor; - -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import vazkii.botania.api.lexicon.ILexiconable; -import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.common.block.BlockMod; -import vazkii.botania.common.lexicon.LexiconData; -import vazkii.botania.common.lib.LibBlockNames; - -public class BlockThatch extends BlockMod implements ILexiconable { - - public BlockThatch() { - super(Material.grass); - setHardness(1.0F); - setStepSound(soundTypeGrass); - setBlockName(LibBlockNames.THATCH); - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { - return LexiconData.decorativeBlocks; - } - -} diff --git a/src/main/java/vazkii/botania/common/block/decor/BlockTinyPotato.java b/src/main/java/vazkii/botania/common/block/decor/BlockTinyPotato.java index 6c3a99b0f..c8e7daf33 100644 --- a/src/main/java/vazkii/botania/common/block/decor/BlockTinyPotato.java +++ b/src/main/java/vazkii/botania/common/block/decor/BlockTinyPotato.java @@ -10,91 +10,137 @@ */ package vazkii.botania.common.block.decor; -import java.util.ArrayList; - -import net.minecraft.block.Block; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; +import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.fml.common.registry.GameRegistry; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.lib.LibRenderIDs; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.common.achievement.ModAchievements; -import vazkii.botania.common.block.BlockModContainer; +import vazkii.botania.common.block.BlockMod; import vazkii.botania.common.block.tile.TileTinyPotato; import vazkii.botania.common.item.block.ItemBlockTinyPotato; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.registry.GameRegistry; -public class BlockTinyPotato extends BlockModContainer implements ILexiconable { +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.List; + +public class BlockTinyPotato extends BlockMod implements ILexiconable { + + private static final AxisAlignedBB AABB = new AxisAlignedBB(0.375, 0, 0.375, 0.625, 0.375, 0.625); public BlockTinyPotato() { - super(Material.cloth); + super(Material.CLOTH, LibBlockNames.TINY_POTATO); setHardness(0.25F); - setBlockName(LibBlockNames.TINY_POTATO); - float f = 1F / 16F * 6F; - setBlockBounds(f, 0, f, 1F - f, f, 1F - f); + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.CARDINALS); } @Override - public Block setBlockName(String par1Str) { - GameRegistry.registerBlock(this, ItemBlockTinyPotato.class, par1Str); - return super.setBlockName(par1Str); + protected IBlockState pickDefaultState() { + return blockState.getBaseState() + .withProperty(BotaniaStateProps.CARDINALS, EnumFacing.SOUTH); } @Override - protected boolean shouldRegisterInNameSet() { - return false; + public int getMetaFromState(IBlockState state) { + switch (state.getValue(BotaniaStateProps.CARDINALS)) { + case NORTH: return 0; + case WEST: return 3; + case EAST: return 1; + case SOUTH: + default: + return 2; // wai vazkii senpai + } + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + EnumFacing side; + switch (meta) { + case 3: side = EnumFacing.WEST; break; + case 0: side = EnumFacing.NORTH; break; + case 1: side = EnumFacing.EAST; break; + case 2: + default: + side = EnumFacing.SOUTH; break; + } + return getDefaultState().withProperty(BotaniaStateProps.CARDINALS, side); + } + + @Nonnull + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { + return AABB; } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - // NO-OP + public void registerItemForm() { + GameRegistry.register(new ItemBlockTinyPotato(this), getRegistryName()); } @Override - public IIcon getIcon(int side, int meta) { - return Blocks.hardened_clay.getIcon(0, 0); - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { - TileEntity tile = par1World.getTileEntity(par2, par3, par4); + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9) { + TileEntity tile = world.getTileEntity(pos); if(tile instanceof TileTinyPotato) { ((TileTinyPotato) tile).interact(); - par5EntityPlayer.addStat(ModAchievements.tinyPotatoPet, 1); - par1World.spawnParticle("heart", par2 + minX + Math.random() * (maxX - minX), par3 + maxY, par4 + minZ + Math.random() * (maxZ - minZ), 0, 0 ,0); + player.addStat(ModAchievements.tinyPotatoPet, 1); + world.spawnParticle(EnumParticleTypes.HEART, pos.getX() + AABB.minX + Math.random() * (AABB.maxX - AABB.minX), pos.getY() + AABB.maxY, pos.getZ() + AABB.minZ + Math.random() * (AABB.maxZ - AABB.minZ), 0, 0 ,0); } return true; } @Override - public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLiving, ItemStack par6ItemStack) { - int l1 = MathHelper.floor_double(par5EntityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; - - par1World.setBlockMetadataWithNotify(par2, par3, par4, l1, 2); + public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase par5EntityLiving, ItemStack par6ItemStack) { + world.setBlockState(pos, state.withProperty(BotaniaStateProps.CARDINALS, par5EntityLiving.getHorizontalFacing().getOpposite())); if (par6ItemStack.hasDisplayName()) - ((TileTinyPotato) par1World.getTileEntity(par2, par3, par4)).name = par6ItemStack.getDisplayName(); + ((TileTinyPotato) world.getTileEntity(pos)).name = par6ItemStack.getDisplayName(); } @Override - public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) { - if(!par6EntityPlayer.capabilities.isCreativeMode) - dropBlockAsItem(par1World, par2, par3, par4, par5, 0); + public boolean removedByPlayer(@Nonnull IBlockState state, World world, @Nonnull BlockPos pos, @Nonnull EntityPlayer player, boolean willHarvest) { + if (willHarvest) { + // Copy of super.removedByPlayer but don't set to air yet + // This is so getDrops below will have a TE to work with + onBlockHarvested(world, pos, state, player); + return true; + } else { + return super.removedByPlayer(state, world, pos, player, willHarvest); + } } @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList list = new ArrayList(); - TileEntity tile = world.getTileEntity(x, y, z); + public void harvestBlock(@Nonnull World world, EntityPlayer player, @Nonnull BlockPos pos, @Nonnull IBlockState state, TileEntity te, ItemStack stack) { + super.harvestBlock(world, player, pos, state, te, stack); + // Now delete the block and TE + world.setBlockToAir(pos); + } + + @Nonnull + @Override + public List getDrops(IBlockAccess world, BlockPos pos, @Nonnull IBlockState state, int fortune) { + ArrayList list = new ArrayList<>(); + TileEntity tile = world.getTileEntity(pos); if(tile != null) { ItemStack stack = new ItemStack(this); @@ -108,27 +154,34 @@ public class BlockTinyPotato extends BlockModContainer implements ILexiconable { } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public boolean renderAsNormalBlock() { + public boolean isFullCube(IBlockState state) { return false; } + @Nonnull @Override - public int getRenderType() { - return LibRenderIDs.idTinyPotato; + public EnumBlockRenderType getRenderType(IBlockState state) { + return EnumBlockRenderType.ENTITYBLOCK_ANIMATED; } @Override - public TileEntity createNewTileEntity(World world, int meta) { + public boolean hasTileEntity(IBlockState state) { + return true; + } + + @Nonnull + @Override + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileTinyPotato(); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.tinyPotato; } } diff --git a/src/main/java/vazkii/botania/common/block/decor/BlockUnstable.java b/src/main/java/vazkii/botania/common/block/decor/BlockUnstable.java index 32bc04b1e..f2b1fc068 100644 --- a/src/main/java/vazkii/botania/common/block/decor/BlockUnstable.java +++ b/src/main/java/vazkii/botania/common/block/decor/BlockUnstable.java @@ -10,97 +10,132 @@ */ package vazkii.botania.common.block.decor; -import java.awt.Color; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.block.statemap.StateMap; import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.passive.EntitySheep; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumDyeColor; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.Botania; import vazkii.botania.common.block.BlockMod; import vazkii.botania.common.core.helper.Vector3; import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.registry.GameRegistry; + +import javax.annotation.Nonnull; +import java.awt.*; +import java.util.List; +import java.util.Random; public class BlockUnstable extends BlockMod implements ILexiconable { + private static final AxisAlignedBB AABB = new AxisAlignedBB(0.25, 0.25, 0.25, 0.75, 0.75, 0.75); + public BlockUnstable() { - super(Material.iron); + super(Material.IRON, LibBlockNames.UNSTABLE_BLOCK); setHardness(5.0F); setResistance(10.0F); - setStepSound(soundTypeMetal); - setBlockBounds(0.25F, 0.25F, 0.25F, 0.75F, 0.75F, 0.75F); - setBlockName(LibBlockNames.UNSTABLE_BLOCK); + setSoundType(SoundType.METAL); + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.COLOR); } @Override - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE); + } + + @Override + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.COLOR).getMetadata(); + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + if (meta >= EnumDyeColor.values().length) { + meta = 0; + } + return getDefaultState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.byMetadata(meta)); + } + + @Nonnull + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { + return AABB; + } + + @SideOnly(Side.CLIENT) + @Override + public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List stacks) { for(int i = 0; i < 16; i++) - par3List.add(new ItemStack(par1, 1, i)); + stacks.add(new ItemStack(item, 1, i)); } @Override - public Block setBlockName(String par1Str) { - GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, par1Str); - return super.setBlockName(par1Str); + public void registerItemForm() { + GameRegistry.register(new ItemBlockWithMetadataAndName(this), getRegistryName()); } @Override - protected boolean shouldRegisterInNameSet() { + public boolean isFullCube(IBlockState state) { return false; } @Override - public boolean renderAsNormalBlock() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { - int color = getRenderColor(par1World.getBlockMetadata(par2, par3, par4)); + @SideOnly(Side.CLIENT) + public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) { + int color = Minecraft.getMinecraft().getBlockColors().colorMultiplier(state, world, pos, 0); int colorBright = new Color(color).brighter().getRGB(); int colorDark = new Color(color).darker().getRGB(); - Vector3 origVector = new Vector3(par2 + 0.5, par3 + 0.5, par4 + 0.5); - Vector3 endVector = origVector.copy().add(par1World.rand.nextDouble() * 2 - 1, par1World.rand.nextDouble() * 2 - 1, par1World.rand.nextDouble() * 2 - 1); - Botania.proxy.lightningFX(par1World, origVector, endVector, 5F, colorDark, colorBright); + Vector3 origVector = new Vector3(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5); + Vector3 endVector = origVector.add(world.rand.nextDouble() * 2 - 1, world.rand.nextDouble() * 2 - 1, world.rand.nextDouble() * 2 - 1); + Botania.proxy.lightningFX(origVector, endVector, 5F, colorDark, colorBright); } @Override - public int damageDropped(int par1) { - return par1; + public int damageDropped(IBlockState state) { + return getMetaFromState(state); } @Override - public int getRenderColor(int par1) { - float[] color = EntitySheep.fleeceColorTable[par1]; - return new Color(color[0], color[1], color[2]).getRGB(); - } - - @Override - public int colorMultiplier(IBlockAccess par1iBlockAccess, int par2, int par3, int par4) { - return getRenderColor(par1iBlockAccess.getBlockMetadata(par2, par3, par4)); - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.unstableBlocks; } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelLoader.setCustomStateMapper(this, (new StateMap.Builder()).ignore(BotaniaStateProps.COLOR).build()); + ModelHandler.registerBlockToState(this, EnumDyeColor.values().length); + } + } diff --git a/src/main/java/vazkii/botania/common/block/decor/IFloatingFlower.java b/src/main/java/vazkii/botania/common/block/decor/IFloatingFlower.java deleted file mode 100644 index 1240b9eae..000000000 --- a/src/main/java/vazkii/botania/common/block/decor/IFloatingFlower.java +++ /dev/null @@ -1,74 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Nov 17, 2014, 6:05:18 PM (GMT)] - */ -package vazkii.botania.common.block.decor; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import vazkii.botania.client.lib.LibResources; - -import java.util.HashMap; - -public interface IFloatingFlower { - - public ItemStack getDisplayStack(); - - public IslandType getIslandType(); - - public void setIslandType(IslandType type); - - public class IslandType { - private static HashMap registry = new HashMap(); - - public static final IslandType GRASS = new IslandType("GRASS", LibResources.MODEL_MINI_ISLAND); - public static final IslandType PODZOL = new IslandType("PODZOL", LibResources.MODEL_MINI_ISLAND_PODZOL); - public static final IslandType MYCEL = new IslandType("MYCEL", LibResources.MODEL_MINI_ISLAND_MYCEL); - public static final IslandType SNOW = new IslandType("SNOW", LibResources.MODEL_MINI_ISLAND_SNOW); - public static final IslandType DRY = new IslandType("DRY", LibResources.MODEL_MINI_ISLAND_DRY); - public static final IslandType GOLDEN = new IslandType("GOLDEN", LibResources.MODEL_MINI_ISLAND_GOLDEN); - public static final IslandType VIVID = new IslandType("VIVID", LibResources.MODEL_MINI_ISLAND_VIVID); - public static final IslandType SCORCHED = new IslandType("SCORCHED", LibResources.MODEL_MINI_ISLAND_SCORCHED); - public static final IslandType INFUSED = new IslandType("INFUSED", LibResources.MODEL_MINI_ISLAND_INFUSED); - public static final IslandType MUTATED = new IslandType("MUTATED", LibResources.MODEL_MINI_ISLAND_MUTATED); - - public IslandType(String name, String s) { - this(name, new ResourceLocation(s)); - } - - public IslandType(String name, ResourceLocation s) { - if (registry.containsKey(name)) throw new IllegalArgumentException(name+" already registered!"); - this.typeName = name; - res = s; - registry.put(name, this); - } - - private final ResourceLocation res; - public final String typeName; - - public static IslandType ofType(String typeStr) { - IslandType type = registry.get(typeStr); - return type == null ? GRASS : type; - } - - public ResourceLocation getResource() { - return res; - } - - public int getColor() { - return 0xFFFFFF; - } - - public String toString() { - return this.typeName; - } - - } - -} diff --git a/src/main/java/vazkii/botania/common/block/decor/biomestone/BlockBiomeStone.java b/src/main/java/vazkii/botania/common/block/decor/biomestone/BlockBiomeStone.java index bec935526..8be058bce 100644 --- a/src/main/java/vazkii/botania/common/block/decor/biomestone/BlockBiomeStone.java +++ b/src/main/java/vazkii/botania/common/block/decor/biomestone/BlockBiomeStone.java @@ -10,83 +10,62 @@ */ package vazkii.botania.common.block.decor.biomestone; -import java.util.List; - -import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.common.block.BlockMod; import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName; import vazkii.botania.common.lexicon.LexiconData; -import cpw.mods.fml.common.registry.GameRegistry; + +import javax.annotation.Nonnull; +import java.util.List; public class BlockBiomeStone extends BlockMod implements ILexiconable { - private static IIcon[] icons = new IIcon[32]; - int iconOffset; - - public BlockBiomeStone(int iconOffset, String name) { - super(Material.rock); + public BlockBiomeStone(String name) { + super(Material.ROCK, name); setHardness(1.5F); setResistance(10F); - setStepSound(soundTypeStone); - setBlockName(name); - this.iconOffset = iconOffset; + setSoundType(SoundType.STONE); } + @SideOnly(Side.CLIENT) @Override - public void registerBlockIcons(IIconRegister register) { - for(int i = 0; i < 16; i++) { - int index = i + iconOffset; - icons[index] = IconHelper.forName(register, "biomeStone" + index); - } - } - - @Override - public void getSubBlocks(Item item, CreativeTabs tab, List list) { + public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List list) { for(int i = 0; i < 16; i++) list.add(new ItemStack(item, 1, i)); } @Override - public IIcon getIcon(int side, int meta) { - return icons[meta + iconOffset]; + public int damageDropped(IBlockState state) { + return getMetaFromState(state); } @Override - protected boolean shouldRegisterInNameSet() { - return false; + public void registerItemForm() { + GameRegistry.register(new ItemBlockWithMetadataAndName(this), getRegistryName()); + } + + @Nonnull + @Override + public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player) { + return new ItemStack(this, 1, getMetaFromState(world.getBlockState(pos))); } @Override - public int damageDropped(int par1) { - return par1; - } - - @Override - public Block setBlockName(String par1Str) { - GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, par1Str); - return super.setBlockName(par1Str); - } - - @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) { - int meta = world.getBlockMetadata(x, y, z); - return new ItemStack(this, 1, meta); - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.marimorphosis; } } diff --git a/src/main/java/vazkii/botania/common/block/decor/biomestone/BlockBiomeStoneA.java b/src/main/java/vazkii/botania/common/block/decor/biomestone/BlockBiomeStoneA.java index 2a9928204..179d975ab 100644 --- a/src/main/java/vazkii/botania/common/block/decor/biomestone/BlockBiomeStoneA.java +++ b/src/main/java/vazkii/botania/common/block/decor/biomestone/BlockBiomeStoneA.java @@ -10,17 +10,61 @@ */ package vazkii.botania.common.block.decor.biomestone; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.BiomeStoneVariant; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.lib.LibBlockNames; +import javax.annotation.Nonnull; + public class BlockBiomeStoneA extends BlockBiomeStone { public BlockBiomeStoneA() { - super(0, LibBlockNames.BIOME_STONE_A); + super(LibBlockNames.BIOME_STONE_A); + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.BIOMESTONE_VARIANT); } @Override - public int damageDropped(int par1) { - return par1 % 8 + 8; + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.BIOMESTONE_VARIANT, BiomeStoneVariant.FOREST); + } + + @Override + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.BIOMESTONE_VARIANT).ordinal(); + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + if (meta >= BiomeStoneVariant.values().length) { + meta = 0; + } + return getDefaultState().withProperty(BotaniaStateProps.BIOMESTONE_VARIANT, BiomeStoneVariant.values()[meta]); + } + + @Override + public int damageDropped(IBlockState state) { + int meta = getMetaFromState(state); + if (meta < 8) { + meta += 8; // Drop cobblestone variant + } + return meta; + } + + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerBlockToState(this, BiomeStoneVariant.values().length); } } diff --git a/src/main/java/vazkii/botania/common/block/decor/biomestone/BlockBiomeStoneB.java b/src/main/java/vazkii/botania/common/block/decor/biomestone/BlockBiomeStoneB.java index 405432fc5..4a814dd72 100644 --- a/src/main/java/vazkii/botania/common/block/decor/biomestone/BlockBiomeStoneB.java +++ b/src/main/java/vazkii/botania/common/block/decor/biomestone/BlockBiomeStoneB.java @@ -10,12 +10,51 @@ */ package vazkii.botania.common.block.decor.biomestone; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.BiomeBrickVariant; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.lib.LibBlockNames; +import javax.annotation.Nonnull; + public class BlockBiomeStoneB extends BlockBiomeStone { public BlockBiomeStoneB() { - super(16, LibBlockNames.BIOME_STONE_B); + super(LibBlockNames.BIOME_STONE_B); } + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.BIOMEBRICK_VARIANT); + } + + @Override + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.BIOMEBRICK_VARIANT, BiomeBrickVariant.FOREST); + } + + @Override + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.BIOMEBRICK_VARIANT).ordinal(); + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + if (meta >= BiomeBrickVariant.values().length) { + meta = 0; + } + return getDefaultState().withProperty(BotaniaStateProps.BIOMEBRICK_VARIANT, BiomeBrickVariant.values()[meta]); + } + + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerBlockToState(this, BiomeBrickVariant.values().length); + } } diff --git a/src/main/java/vazkii/botania/common/block/decor/panes/BlockAlfglassPane.java b/src/main/java/vazkii/botania/common/block/decor/panes/BlockAlfglassPane.java index 081d8e7da..c5286035d 100644 --- a/src/main/java/vazkii/botania/common/block/decor/panes/BlockAlfglassPane.java +++ b/src/main/java/vazkii/botania/common/block/decor/panes/BlockAlfglassPane.java @@ -10,12 +10,31 @@ */ package vazkii.botania.common.block.decor.panes; +import net.minecraft.util.BlockRenderLayer; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.block.ModBlocks; +import javax.annotation.Nonnull; + public class BlockAlfglassPane extends BlockModPane { public BlockAlfglassPane() { super(ModBlocks.elfGlass); } + @SideOnly(Side.CLIENT) + @Nonnull + @Override + public BlockRenderLayer getBlockLayer() { + return BlockRenderLayer.TRANSLUCENT; + } + + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerCustomItemblock(this, "alfglass_pane"); + } + } diff --git a/src/main/java/vazkii/botania/common/block/decor/panes/BlockBifrostPane.java b/src/main/java/vazkii/botania/common/block/decor/panes/BlockBifrostPane.java index 495e39016..d5d42dd65 100644 --- a/src/main/java/vazkii/botania/common/block/decor/panes/BlockBifrostPane.java +++ b/src/main/java/vazkii/botania/common/block/decor/panes/BlockBifrostPane.java @@ -10,37 +10,31 @@ */ package vazkii.botania.common.block.decor.panes; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraftforge.client.event.TextureStitchEvent; -import net.minecraftforge.common.MinecraftForge; -import vazkii.botania.client.render.block.InterpolatedIcon; +import net.minecraft.util.BlockRenderLayer; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.block.ModBlocks; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import javax.annotation.Nonnull; public class BlockBifrostPane extends BlockModPane { public BlockBifrostPane() { super(ModBlocks.bifrostPerm); - MinecraftForge.EVENT_BUS.register(this); } - @SubscribeEvent @SideOnly(Side.CLIENT) - public void loadTextures(TextureStitchEvent.Pre event) { - if(event.map.getTextureType() == 0) { - TextureAtlasSprite icon = new InterpolatedIcon("botania:bifrostPermPane"); - if(event.map.setTextureEntry("botania:bifrostPermPane", icon)) - iconTop = icon; - } - } - + @Nonnull @Override + public BlockRenderLayer getBlockLayer() { + return BlockRenderLayer.TRANSLUCENT; + } + @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister reg) { - // NO-OP + @Override + public void registerModels() { + ModelHandler.registerCustomItemblock(this, "bifrost_pane"); } } diff --git a/src/main/java/vazkii/botania/common/block/decor/panes/BlockManaglassPane.java b/src/main/java/vazkii/botania/common/block/decor/panes/BlockManaglassPane.java index d509b38b9..09e2d4a16 100644 --- a/src/main/java/vazkii/botania/common/block/decor/panes/BlockManaglassPane.java +++ b/src/main/java/vazkii/botania/common/block/decor/panes/BlockManaglassPane.java @@ -10,12 +10,32 @@ */ package vazkii.botania.common.block.decor.panes; +import net.minecraft.util.BlockRenderLayer; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.block.ModBlocks; +import javax.annotation.Nonnull; + public class BlockManaglassPane extends BlockModPane { public BlockManaglassPane() { super(ModBlocks.manaGlass); } + @SideOnly(Side.CLIENT) + @Nonnull + @Override + public BlockRenderLayer getBlockLayer() { + return BlockRenderLayer.TRANSLUCENT; + } + + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerCustomItemblock(this, "managlass_pane"); + } + + } diff --git a/src/main/java/vazkii/botania/common/block/decor/panes/BlockModPane.java b/src/main/java/vazkii/botania/common/block/decor/panes/BlockModPane.java index 206ba158d..a77c0cead 100644 --- a/src/main/java/vazkii/botania/common/block/decor/panes/BlockModPane.java +++ b/src/main/java/vazkii/botania/common/block/decor/panes/BlockModPane.java @@ -10,80 +10,51 @@ */ package vazkii.botania.common.block.decor.panes; +import javax.annotation.Nonnull; + import net.minecraft.block.Block; import net.minecraft.block.BlockPane; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; -import net.minecraftforge.common.util.ForgeDirection; -import vazkii.botania.client.core.helper.IconHelper; +import net.minecraftforge.fml.common.registry.GameRegistry; +import vazkii.botania.client.render.IModelRegister; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.core.BotaniaCreativeTab; import vazkii.botania.common.item.block.ItemBlockMod; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import vazkii.botania.common.lib.LibMisc; -public class BlockModPane extends BlockPane { - - Block source; - public IIcon iconTop; +public class BlockModPane extends BlockPane implements IModelRegister { public BlockModPane(Block source) { - super("", "", Material.glass, false); - this.source = source; - setBlockName(source.getUnlocalizedName().replaceAll("tile.", "") + "Pane"); + super(Material.GLASS, false); + // Backward compat don't kill me + String name = source.getUnlocalizedName().replaceAll("tile.", "") + "Pane"; + setRegistryName(new ResourceLocation(LibMisc.MOD_ID, name)); + GameRegistry.register(this); + GameRegistry.register(new ItemBlockMod(this), getRegistryName()); + setUnlocalizedName(name); setCreativeTab(BotaniaCreativeTab.INSTANCE); setHardness(0.3F); - setStepSound(soundTypeGlass); + setSoundType(SoundType.GLASS); setLightLevel(1.0F); useNeighborBrightness = true; } - @Override - public Block setBlockName(String par1Str) { - GameRegistry.registerBlock(this, ItemBlockMod.class, par1Str); - return super.setBlockName(par1Str); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister reg) { - iconTop = IconHelper.forBlock(reg, this); - } - - @Override - public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) { + /*@Override + public boolean shouldSideBeRendered(IBlockState state, IBlockAccess iblockaccess, BlockPos pos, EnumFacing side) { return false; + }*/ + + @Override + public boolean canPaneConnectTo(IBlockAccess world, BlockPos pos, @Nonnull EnumFacing dir) { + Block block = world.getBlockState(pos).getBlock(); + return block == ModBlocks.elfGlass || block == ModBlocks.manaGlass || block == ModBlocks.bifrostPerm || super.canPaneConnectTo(world, pos, dir); } @Override - public int getRenderType() { - return 18; - } - - @Override - public int getRenderBlockPass() { - return 1; - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon func_150097_e() { - return source.getIcon(0, 0); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int side, int meta) { - return side >= 2 ? iconTop : source.getIcon(side, meta); - } - - @Override - public boolean canPaneConnectTo(IBlockAccess world, int x, int y, int z, ForgeDirection dir) { - Block block = world.getBlock(x, y, z); - return block == ModBlocks.elfGlass || block == ModBlocks.manaGlass || block == ModBlocks.bifrostPerm || super.canPaneConnectTo(world, x, y, z, dir); - } - + public void registerModels() {} } diff --git a/src/main/java/vazkii/botania/common/block/decor/quartz/BlockSpecialQuartz.java b/src/main/java/vazkii/botania/common/block/decor/quartz/BlockSpecialQuartz.java index 7773404ad..9bff35bb7 100644 --- a/src/main/java/vazkii/botania/common/block/decor/quartz/BlockSpecialQuartz.java +++ b/src/main/java/vazkii/botania/common/block/decor/quartz/BlockSpecialQuartz.java @@ -10,55 +10,72 @@ */ package vazkii.botania.common.block.decor.quartz; -import java.util.List; - -import net.minecraft.block.Block; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.core.helper.IconHelper; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.QuartzVariant; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.block.BlockMod; import vazkii.botania.common.block.ModFluffBlocks; import vazkii.botania.common.item.block.ItemBlockSpecialQuartz; import vazkii.botania.common.lexicon.LexiconData; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import javax.annotation.Nonnull; +import java.util.List; public class BlockSpecialQuartz extends BlockMod implements ILexiconable { - private final String[] iconNames; public final String type; - private IIcon[] specialQuartzIcons; - private IIcon chiseledSpecialQuartzIcon; - private IIcon pillarSpecialQuartzIcon; - private IIcon specialQuartzTopIcon; public BlockSpecialQuartz(String type) { - super(Material.rock); + super(Material.ROCK, "quartzType" + type); this.type = type; - iconNames = new String[]{ "block" + type + "Quartz0", "chiseled" + type + "Quartz0", "pillar" + type + "Quartz0", null, null }; setHardness(0.8F); setResistance(10F); - setBlockName("quartzType" + type); + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.QUARTZ_VARIANT); } @Override - public Block setBlockName(String par1Str) { - GameRegistry.registerBlock(this, ItemBlockSpecialQuartz.class, par1Str); - return super.setBlockName(par1Str); + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.QUARTZ_VARIANT, QuartzVariant.NORMAL); } @Override - protected boolean shouldRegisterInNameSet() { - return false; + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.QUARTZ_VARIANT).ordinal(); + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + if (meta >= QuartzVariant.values().length) { + meta = 0; + } + return getDefaultState().withProperty(BotaniaStateProps.QUARTZ_VARIANT, QuartzVariant.values()[meta]); + } + + @Override + public void registerItemForm() { + GameRegistry.register(new ItemBlockSpecialQuartz(this), getRegistryName()); } public String[] getNames() { @@ -69,86 +86,56 @@ public class BlockSpecialQuartz extends BlockMod implements ILexiconable { }; } + @Nonnull @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - if (par2 != 2 && par2 != 3 && par2 != 4) { - if (par1 != 1 && (par1 != 0 || par2 != 1)) { - if (par1 == 0) - return specialQuartzTopIcon; - else { - if (par2 < 0 || par2 >= specialQuartzIcons.length) - par2 = 0; - - return specialQuartzIcons[par2]; - } - } else return par2 == 1 ? chiseledSpecialQuartzIcon : specialQuartzTopIcon; - } else - return par2 == 2 && (par1 == 1 || par1 == 0) ? pillarSpecialQuartzIcon : par2 == 3 && (par1 == 5 || par1 == 4) ? pillarSpecialQuartzIcon : par2 == 4 && (par1 == 2 || par1 == 3) ? pillarSpecialQuartzIcon : specialQuartzIcons[par2]; - } - - @Override - public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) { - if (par9 == 2) { - switch (par5) { - case 0: - case 1: - par9 = 2; - break; - case 2: - case 3: - par9 = 4; - break; - case 4: - case 5: - par9 = 3; + public IBlockState onBlockPlaced(World world, BlockPos pos, EnumFacing side, float par6, float par7, float par8, int meta, EntityLivingBase placer) { + if (meta == 2) { // Pillar quartz variant + switch (side.getAxis()) { + case Y: + return getDefaultState().withProperty(BotaniaStateProps.QUARTZ_VARIANT, QuartzVariant.PILLAR_Y); + case Z: + return getDefaultState().withProperty(BotaniaStateProps.QUARTZ_VARIANT, QuartzVariant.PILLAR_Z); + case X: + return getDefaultState().withProperty(BotaniaStateProps.QUARTZ_VARIANT, QuartzVariant.PILLAR_X); } } - return par9; + return getStateFromMeta(meta); } @Override - public int damageDropped(int par1) { - return par1 != 3 && par1 != 4 ? par1 : 2; - } - - @Override - public ItemStack createStackedBlock(int par1) { - return par1 != 3 && par1 != 4 ? super.createStackedBlock(par1) : new ItemStack(this, 1, 2); - } - - @Override - public int getRenderType() { - return 39; - } - - @Override - @SideOnly(Side.CLIENT) - public void getSubBlocks(Item item, CreativeTabs tab, List par3List) { - par3List.add(new ItemStack(this, 1, 0)); - par3List.add(new ItemStack(this, 1, 1)); - par3List.add(new ItemStack(this, 1, 2)); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - specialQuartzIcons = new IIcon[iconNames.length]; - - for (int i = 0; i < specialQuartzIcons.length; ++i) { - if (iconNames[i] == null) - specialQuartzIcons[i] = specialQuartzIcons[i - 1]; - else specialQuartzIcons[i] = IconHelper.forName(par1IconRegister, iconNames[i]); + public int damageDropped(IBlockState state) { + QuartzVariant variant = state.getValue(BotaniaStateProps.QUARTZ_VARIANT); + if (variant == QuartzVariant.PILLAR_X || variant == QuartzVariant.PILLAR_Z) { + state = state.withProperty(BotaniaStateProps.QUARTZ_VARIANT, QuartzVariant.PILLAR_Y); } - - specialQuartzTopIcon = IconHelper.forName(par1IconRegister, "block" + type + "Quartz1"); - chiseledSpecialQuartzIcon = IconHelper.forName(par1IconRegister, "chiseled" + type + "Quartz1"); - pillarSpecialQuartzIcon = IconHelper.forName(par1IconRegister, "pillar" + type + "Quartz1"); + return getMetaFromState(state); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public ItemStack createStackedBlock(@Nonnull IBlockState state) { + return new ItemStack(this, 1, damageDropped(state)); + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List stacks) { + stacks.add(new ItemStack(this, 1, 0)); + stacks.add(new ItemStack(this, 1, 1)); + stacks.add(new ItemStack(this, 1, 2)); + } + + @Override + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return this == ModFluffBlocks.elfQuartz ? LexiconData.elvenResources : LexiconData.decorativeBlocks; } + + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerBlockToState(this, 0, getDefaultState()); + ModelHandler.registerBlockToState(this, 1, getDefaultState().withProperty(BotaniaStateProps.QUARTZ_VARIANT, QuartzVariant.CHISELED)); + ModelHandler.registerBlockToState(this, 2, getDefaultState().withProperty(BotaniaStateProps.QUARTZ_VARIANT, QuartzVariant.PILLAR_Y)); + } + } diff --git a/src/main/java/vazkii/botania/common/block/decor/quartz/BlockSpecialQuartzSlab.java b/src/main/java/vazkii/botania/common/block/decor/quartz/BlockSpecialQuartzSlab.java index c26bbc8c1..1b2db8806 100644 --- a/src/main/java/vazkii/botania/common/block/decor/quartz/BlockSpecialQuartzSlab.java +++ b/src/main/java/vazkii/botania/common/block/decor/quartz/BlockSpecialQuartzSlab.java @@ -10,31 +10,30 @@ */ package vazkii.botania.common.block.decor.quartz; -import java.util.Random; - import net.minecraft.block.Block; import net.minecraft.block.BlockSlab; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.common.block.ModFluffBlocks; import vazkii.botania.common.block.decor.slabs.BlockModSlab; import vazkii.botania.common.lexicon.LexiconData; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import javax.annotation.Nonnull; +import java.util.Random; public class BlockSpecialQuartzSlab extends BlockModSlab { - Block source; + final Block source; public BlockSpecialQuartzSlab(Block source, boolean par2) { - super(par2, Material.rock, "quartzSlab" + ((BlockSpecialQuartz) source).type + (par2 ? "Full" : "Half")); + super(par2, Material.ROCK, "quartzSlab" + ((BlockSpecialQuartz) source).type + (par2 ? "Full" : "Half")); setHardness(0.8F); setResistance(10F); this.source = source; @@ -80,35 +79,24 @@ public class BlockSpecialQuartzSlab extends BlockModSlab { return this; } + @Nonnull @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) { + public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player) { return new ItemStack(getSingleBlock()); } @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return source.getBlockTextureFromSide(par1); - } - - @Override - public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + public Item getItemDropped(IBlockState state, Random rand, int fortune) { return Item.getItemFromBlock(getSingleBlock()); } @Override - public ItemStack createStackedBlock(int par1) { + public ItemStack createStackedBlock(@Nonnull IBlockState par1) { return new ItemStack(getSingleBlock()); } @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - // NO-OP - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return this == ModFluffBlocks.elfQuartzSlab ? LexiconData.elvenResources : LexiconData.decorativeBlocks; } diff --git a/src/main/java/vazkii/botania/common/block/decor/quartz/BlockSpecialQuartzStairs.java b/src/main/java/vazkii/botania/common/block/decor/quartz/BlockSpecialQuartzStairs.java index b2494da45..5e7db0c1c 100644 --- a/src/main/java/vazkii/botania/common/block/decor/quartz/BlockSpecialQuartzStairs.java +++ b/src/main/java/vazkii/botania/common/block/decor/quartz/BlockSpecialQuartzStairs.java @@ -13,6 +13,7 @@ package vazkii.botania.common.block.decor.quartz; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.common.block.ModFluffBlocks; @@ -22,12 +23,12 @@ import vazkii.botania.common.lexicon.LexiconData; public class BlockSpecialQuartzStairs extends BlockModStairs { public BlockSpecialQuartzStairs(Block source) { - super(source, 0, "quartzStairs" + ((BlockSpecialQuartz) source).type); + super(source.getDefaultState(), "quartzStairs" + ((BlockSpecialQuartz) source).type); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { - return this == ModFluffBlocks.elfQuartzStairs ? LexiconData.elvenResources : super.getEntry(world, x, y, z, player, lexicon); + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { + return this == ModFluffBlocks.elfQuartzStairs ? LexiconData.elvenResources : super.getEntry(world, pos, player, lexicon); } } \ No newline at end of file diff --git a/src/main/java/vazkii/botania/common/block/decor/slabs/Block18StoneSlab.java b/src/main/java/vazkii/botania/common/block/decor/slabs/Block18StoneSlab.java deleted file mode 100644 index b5ff215d6..000000000 --- a/src/main/java/vazkii/botania/common/block/decor/slabs/Block18StoneSlab.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Apr 10, 2015, 7:52:06 PM (GMT)] - */ -package vazkii.botania.common.block.decor.slabs; - -import net.minecraft.block.BlockSlab; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.common.block.ModFluffBlocks; -import vazkii.botania.common.lexicon.LexiconData; - -public class Block18StoneSlab extends BlockLivingSlab { - - int index; - - public Block18StoneSlab(boolean full, int meta, int index) { - super(full, ModFluffBlocks.stone, meta); - this.index = index; - setHardness(1.5F); - setResistance(10F); - } - - @Override - public BlockSlab getFullBlock() { - return (BlockSlab) ModFluffBlocks.stoneFullSlabs[index]; - } - - @Override - public BlockSlab getSingleBlock() { - return (BlockSlab) ModFluffBlocks.stoneSlabs[index]; - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { - return LexiconData.stoneAlchemy; - } - -} diff --git a/src/main/java/vazkii/botania/common/block/decor/slabs/BlockBiomeStoneSlab.java b/src/main/java/vazkii/botania/common/block/decor/slabs/BlockBiomeStoneSlab.java index aa20c9def..5045d53c2 100644 --- a/src/main/java/vazkii/botania/common/block/decor/slabs/BlockBiomeStoneSlab.java +++ b/src/main/java/vazkii/botania/common/block/decor/slabs/BlockBiomeStoneSlab.java @@ -10,10 +10,11 @@ */ package vazkii.botania.common.block.decor.slabs; -import net.minecraft.block.Block; import net.minecraft.block.BlockSlab; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.common.block.ModFluffBlocks; @@ -21,10 +22,10 @@ import vazkii.botania.common.lexicon.LexiconData; public class BlockBiomeStoneSlab extends BlockLivingSlab { - int index; + final int index; - public BlockBiomeStoneSlab(boolean full, Block source, int meta, int index) { - super(full, source, meta); + public BlockBiomeStoneSlab(boolean full, IBlockState state, int index) { + super(full, state); this.index = index; setHardness(1.5F); setResistance(10F); @@ -41,7 +42,7 @@ public class BlockBiomeStoneSlab extends BlockLivingSlab { } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.marimorphosis; } diff --git a/src/main/java/vazkii/botania/common/block/decor/slabs/BlockDirtPathSlab.java b/src/main/java/vazkii/botania/common/block/decor/slabs/BlockDirtPathSlab.java index a91b5bbab..f22f0bd5c 100644 --- a/src/main/java/vazkii/botania/common/block/decor/slabs/BlockDirtPathSlab.java +++ b/src/main/java/vazkii/botania/common/block/decor/slabs/BlockDirtPathSlab.java @@ -13,6 +13,7 @@ package vazkii.botania.common.block.decor.slabs; import net.minecraft.block.BlockSlab; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.common.block.ModBlocks; @@ -22,7 +23,7 @@ import vazkii.botania.common.lexicon.LexiconData; public class BlockDirtPathSlab extends BlockLivingSlab { public BlockDirtPathSlab(boolean full) { - super(full, ModBlocks.dirtPath, 0); + super(full, ModBlocks.dirtPath.getDefaultState()); setHardness(0.6F); } @@ -37,7 +38,7 @@ public class BlockDirtPathSlab extends BlockLivingSlab { } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.dirtPath; } diff --git a/src/main/java/vazkii/botania/common/block/decor/slabs/BlockEndStoneSlab.java b/src/main/java/vazkii/botania/common/block/decor/slabs/BlockEndStoneSlab.java deleted file mode 100644 index 4a2a65d9f..000000000 --- a/src/main/java/vazkii/botania/common/block/decor/slabs/BlockEndStoneSlab.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Feb 16, 2015, 8:45:00 PM (GMT)] - */ -package vazkii.botania.common.block.decor.slabs; - -import net.minecraft.block.BlockSlab; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.common.block.ModBlocks; -import vazkii.botania.common.block.ModFluffBlocks; -import vazkii.botania.common.lexicon.LexiconData; - -public class BlockEndStoneSlab extends BlockLivingSlab { - - public BlockEndStoneSlab(boolean full) { - super(full, ModBlocks.endStoneBrick, 0); - setHardness(1.5F); - setResistance(10F); - setStepSound(soundTypeStone); - } - - @Override - public BlockSlab getFullBlock() { - return (BlockSlab) ModFluffBlocks.endStoneSlabFull; - } - - @Override - public BlockSlab getSingleBlock() { - return (BlockSlab) ModFluffBlocks.endStoneSlab; - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { - return LexiconData.endStoneDecor; - } - -} diff --git a/src/main/java/vazkii/botania/common/block/decor/slabs/BlockEnderBrickSlab.java b/src/main/java/vazkii/botania/common/block/decor/slabs/BlockEnderBrickSlab.java deleted file mode 100644 index ce28c608b..000000000 --- a/src/main/java/vazkii/botania/common/block/decor/slabs/BlockEnderBrickSlab.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jul 7, 2015, 10:37:15 PM (GMT)] - */ -package vazkii.botania.common.block.decor.slabs; - -import net.minecraft.block.BlockSlab; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.common.block.ModBlocks; -import vazkii.botania.common.block.ModFluffBlocks; -import vazkii.botania.common.lexicon.LexiconData; - -public class BlockEnderBrickSlab extends BlockLivingSlab { - - public BlockEnderBrickSlab(boolean full) { - super(full, ModBlocks.endStoneBrick, 2); - setHardness(1.5F); - setResistance(10F); - setStepSound(soundTypeStone); - } - - @Override - public BlockSlab getFullBlock() { - return (BlockSlab) ModFluffBlocks.enderBrickSlabFull; - } - - @Override - public BlockSlab getSingleBlock() { - return (BlockSlab) ModFluffBlocks.enderBrickSlab; - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { - return LexiconData.endStoneDecor; - } - -} diff --git a/src/main/java/vazkii/botania/common/block/decor/slabs/BlockLivingSlab.java b/src/main/java/vazkii/botania/common/block/decor/slabs/BlockLivingSlab.java index 573774843..5d8878350 100644 --- a/src/main/java/vazkii/botania/common/block/decor/slabs/BlockLivingSlab.java +++ b/src/main/java/vazkii/botania/common/block/decor/slabs/BlockLivingSlab.java @@ -1,26 +1,15 @@ package vazkii.botania.common.block.decor.slabs; -import net.minecraft.block.Block; -import net.minecraft.util.IIcon; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.state.IBlockState; public abstract class BlockLivingSlab extends BlockModSlab { - Block source; - int meta; + final IBlockState sourceState; - public BlockLivingSlab(boolean full, Block source, int meta) { - super(full, source.getMaterial(), source.getUnlocalizedName().replaceAll("tile.", "") + meta + "Slab" + (full ? "Full" : "")); - setStepSound(source.stepSound); - this.source = source; - this.meta = meta; - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return source.getIcon(par1, meta); + public BlockLivingSlab(boolean full, IBlockState state) { + super(full, state.getMaterial(), state.getBlock().getUnlocalizedName().replaceAll("tile.", "") + state.getBlock().getMetaFromState(state) + "Slab" + (full ? "Full" : "")); + setSoundType(state.getBlock().getSoundType()); + this.sourceState = state; } } diff --git a/src/main/java/vazkii/botania/common/block/decor/slabs/BlockModSlab.java b/src/main/java/vazkii/botania/common/block/decor/slabs/BlockModSlab.java index d6f502f61..2de7fef87 100644 --- a/src/main/java/vazkii/botania/common/block/decor/slabs/BlockModSlab.java +++ b/src/main/java/vazkii/botania/common/block/decor/slabs/BlockModSlab.java @@ -1,80 +1,152 @@ package vazkii.botania.common.block.decor.slabs; +import java.util.Locale; import java.util.Random; +import javax.annotation.Nonnull; + import net.minecraft.block.BlockSlab; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.block.statemap.StateMap; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.IStringSerializable; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.client.core.handler.ModelHandler; +import vazkii.botania.client.render.IModelRegister; import vazkii.botania.common.core.BotaniaCreativeTab; import vazkii.botania.common.item.block.ItemBlockModSlab; import vazkii.botania.common.lexicon.LexiconData; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import vazkii.botania.common.lib.LibMisc; -public abstract class BlockModSlab extends BlockSlab implements ILexiconable { +public abstract class BlockModSlab extends BlockSlab implements ILexiconable, IModelRegister { - String name; + private final String name; + private final boolean doubleSlab; + private static final PropertyEnum DUMMY = PropertyEnum.create("dummy", DummyEnum.class); public BlockModSlab(boolean full, Material mat, String name) { - super(full, mat); + super(mat); this.name = name; - setBlockName(name); + setUnlocalizedName(name); + setRegistryName(new ResourceLocation(LibMisc.MOD_ID, name)); + doubleSlab = full; if(!full) { setCreativeTab(BotaniaCreativeTab.INSTANCE); useNeighborBrightness = true; } + setDefaultState(blockState.getBaseState().withProperty(HALF, EnumBlockHalf.BOTTOM).withProperty(DUMMY, DummyEnum.SINGLETON)); + GameRegistry.register(this); + if (!isDouble()) + GameRegistry.register(new ItemBlockModSlab(this), getRegistryName()); + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, HALF, getVariantProperty()); + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + if (doubleSlab) { + return getDefaultState(); + } else { + return getDefaultState().withProperty(HALF, meta == 8 ? EnumBlockHalf.TOP : EnumBlockHalf.BOTTOM); + } + } + + @Override + public int getMetaFromState(IBlockState state) { + if (doubleSlab) { + return 0; + } else { + return state.getValue(HALF) == EnumBlockHalf.TOP ? 8 : 0; + } } public abstract BlockSlab getFullBlock(); public abstract BlockSlab getSingleBlock(); + @Nonnull @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) { + public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player) { return new ItemStack(getSingleBlock()); } @Override - public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + public Item getItemDropped(IBlockState state, Random rand, int fortune) { return Item.getItemFromBlock(getSingleBlock()); } @Override - public int quantityDropped(int meta, int fortune, Random random) { - return super.quantityDropped(meta, fortune, random); - } - - @Override - public ItemStack createStackedBlock(int par1) { + public ItemStack createStackedBlock(@Nonnull IBlockState par1) { return new ItemStack(getSingleBlock()); } + @Nonnull @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - // NO-OP - } - - public void register() { - GameRegistry.registerBlock(this, ItemBlockModSlab.class, name); - } - - @Override - public String func_150002_b(int i) { + public String getUnlocalizedName(int i) { return name; } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public final boolean isDouble() { + return doubleSlab; + } + + @Nonnull + @Override + public final IProperty getVariantProperty() { + return DUMMY; // Vanilla expects us to store different kinds of slabs into one block ID. Except we don't. We need this dummy property and dummy value to satisfy it. + } + + @Nonnull + @Override + public final Comparable getTypeForItem(@Nonnull ItemStack stack) { + return DummyEnum.SINGLETON; + } + + @Override + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.decorativeBlocks; } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + if(!doubleSlab) { + ModelLoader.setCustomStateMapper(this, (new StateMap.Builder()).ignore(BlockModSlab.DUMMY).build()); + ModelHandler.registerBlockToState(this, 0, getDefaultState()); + } else { + ModelLoader.setCustomStateMapper(this, (new StateMap.Builder()).ignore(BlockModSlab.DUMMY, BlockSlab.HALF).build()); + } + } + + private enum DummyEnum implements IStringSerializable { + SINGLETON { + @Nonnull + @Override + public String getName() { + return name().toLowerCase(Locale.ROOT); + } + } + } + } diff --git a/src/main/java/vazkii/botania/common/block/decor/slabs/BlockPavementSlab.java b/src/main/java/vazkii/botania/common/block/decor/slabs/BlockPavementSlab.java index 9e071232f..43eaefc78 100644 --- a/src/main/java/vazkii/botania/common/block/decor/slabs/BlockPavementSlab.java +++ b/src/main/java/vazkii/botania/common/block/decor/slabs/BlockPavementSlab.java @@ -12,18 +12,21 @@ package vazkii.botania.common.block.decor.slabs; import net.minecraft.block.BlockSlab; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumDyeColor; import net.minecraft.item.ItemStack; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.common.block.ModFluffBlocks; import vazkii.botania.common.lexicon.LexiconData; public class BlockPavementSlab extends BlockLivingSlab { - int index; + final int index; - public BlockPavementSlab(boolean full, int meta, int index) { - super(full, ModFluffBlocks.pavement, meta); + public BlockPavementSlab(boolean full, EnumDyeColor color, int index) { + super(full, ModFluffBlocks.pavement.getDefaultState().withProperty(BotaniaStateProps.PAVEMENT_COLOR, color)); this.index = index; setHardness(2F); setResistance(10F); @@ -40,7 +43,7 @@ public class BlockPavementSlab extends BlockLivingSlab { } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.pavement; } diff --git a/src/main/java/vazkii/botania/common/block/decor/slabs/BlockReedSlab.java b/src/main/java/vazkii/botania/common/block/decor/slabs/BlockReedSlab.java deleted file mode 100644 index 23c955d44..000000000 --- a/src/main/java/vazkii/botania/common/block/decor/slabs/BlockReedSlab.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jul 28, 2014, 8:49:59 PM (GMT)] - */ -package vazkii.botania.common.block.decor.slabs; - -import net.minecraft.block.BlockSlab; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.common.block.ModBlocks; -import vazkii.botania.common.block.ModFluffBlocks; -import vazkii.botania.common.lexicon.LexiconData; - -public class BlockReedSlab extends BlockLivingSlab { - - public BlockReedSlab(boolean full) { - super(full, ModBlocks.reedBlock, 0); - setHardness(1.0F); - setStepSound(soundTypeWood); - } - - @Override - public BlockSlab getFullBlock() { - return (BlockSlab) ModFluffBlocks.reedSlabFull; - } - - @Override - public BlockSlab getSingleBlock() { - return (BlockSlab) ModFluffBlocks.reedSlab; - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { - return LexiconData.decorativeBlocks; - } - - -} diff --git a/src/main/java/vazkii/botania/common/block/decor/slabs/BlockThatchSlab.java b/src/main/java/vazkii/botania/common/block/decor/slabs/BlockThatchSlab.java deleted file mode 100644 index 228ec633a..000000000 --- a/src/main/java/vazkii/botania/common/block/decor/slabs/BlockThatchSlab.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jul 28, 2014, 8:49:59 PM (GMT)] - */ -package vazkii.botania.common.block.decor.slabs; - -import net.minecraft.block.BlockSlab; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.common.block.ModBlocks; -import vazkii.botania.common.block.ModFluffBlocks; -import vazkii.botania.common.lexicon.LexiconData; - -public class BlockThatchSlab extends BlockLivingSlab { - - public BlockThatchSlab(boolean full) { - super(full, ModBlocks.thatch, 0); - setHardness(1.0F); - setStepSound(soundTypeGrass); - } - - @Override - public BlockSlab getFullBlock() { - return (BlockSlab) ModFluffBlocks.thatchSlabFull; - } - - @Override - public BlockSlab getSingleBlock() { - return (BlockSlab) ModFluffBlocks.thatchSlab; - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { - return LexiconData.decorativeBlocks; - } - - -} diff --git a/src/main/java/vazkii/botania/common/block/decor/slabs/bricks/BlockCustomBrickSlab.java b/src/main/java/vazkii/botania/common/block/decor/slabs/bricks/BlockCustomBrickSlab.java index 7c6cde0e1..ae85fbdb3 100644 --- a/src/main/java/vazkii/botania/common/block/decor/slabs/bricks/BlockCustomBrickSlab.java +++ b/src/main/java/vazkii/botania/common/block/decor/slabs/bricks/BlockCustomBrickSlab.java @@ -11,10 +11,14 @@ package vazkii.botania.common.block.decor.slabs.bricks; import net.minecraft.block.BlockSlab; +import net.minecraft.block.SoundType; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.CustomBrickVariant; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.ModFluffBlocks; import vazkii.botania.common.block.decor.slabs.BlockLivingSlab; @@ -23,14 +27,14 @@ import vazkii.botania.common.lexicon.LexiconData; public class BlockCustomBrickSlab extends BlockLivingSlab { public BlockCustomBrickSlab(boolean full) { - this(full, 0); + this(full, CustomBrickVariant.HELLISH_BRICK); } - public BlockCustomBrickSlab(boolean full, int meta) { - super(full, ModBlocks.customBrick, meta); + public BlockCustomBrickSlab(boolean full, CustomBrickVariant variant) { + super(full, ModBlocks.customBrick.getDefaultState().withProperty(BotaniaStateProps.CUSTOMBRICK_VARIANT, variant)); setHardness(2.0F); setResistance(5.0F); - setStepSound(soundTypeStone); + setSoundType(SoundType.STONE); } @Override @@ -44,7 +48,7 @@ public class BlockCustomBrickSlab extends BlockLivingSlab { } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.decorativeBlocks; } diff --git a/src/main/java/vazkii/botania/common/block/decor/slabs/bricks/BlockSnowBrickSlab.java b/src/main/java/vazkii/botania/common/block/decor/slabs/bricks/BlockSnowBrickSlab.java index f827d8207..e30f16395 100644 --- a/src/main/java/vazkii/botania/common/block/decor/slabs/bricks/BlockSnowBrickSlab.java +++ b/src/main/java/vazkii/botania/common/block/decor/slabs/bricks/BlockSnowBrickSlab.java @@ -11,12 +11,13 @@ package vazkii.botania.common.block.decor.slabs.bricks; import net.minecraft.block.BlockSlab; +import vazkii.botania.api.state.enums.CustomBrickVariant; import vazkii.botania.common.block.ModFluffBlocks; public class BlockSnowBrickSlab extends BlockCustomBrickSlab { public BlockSnowBrickSlab(boolean full) { - super(full, 2); + super(full, CustomBrickVariant.FROSTY_BRICK); } @Override diff --git a/src/main/java/vazkii/botania/common/block/decor/slabs/bricks/BlockSoulBrickSlab.java b/src/main/java/vazkii/botania/common/block/decor/slabs/bricks/BlockSoulBrickSlab.java index d3afdf03e..f67a5599c 100644 --- a/src/main/java/vazkii/botania/common/block/decor/slabs/bricks/BlockSoulBrickSlab.java +++ b/src/main/java/vazkii/botania/common/block/decor/slabs/bricks/BlockSoulBrickSlab.java @@ -11,12 +11,13 @@ package vazkii.botania.common.block.decor.slabs.bricks; import net.minecraft.block.BlockSlab; +import vazkii.botania.api.state.enums.CustomBrickVariant; import vazkii.botania.common.block.ModFluffBlocks; public class BlockSoulBrickSlab extends BlockCustomBrickSlab { public BlockSoulBrickSlab(boolean full) { - super(full, 1); + super(full, CustomBrickVariant.SOUL_BRICK); } @Override diff --git a/src/main/java/vazkii/botania/common/block/decor/slabs/bricks/BlockTileSlab.java b/src/main/java/vazkii/botania/common/block/decor/slabs/bricks/BlockTileSlab.java index 41ac1e919..52819c430 100644 --- a/src/main/java/vazkii/botania/common/block/decor/slabs/bricks/BlockTileSlab.java +++ b/src/main/java/vazkii/botania/common/block/decor/slabs/bricks/BlockTileSlab.java @@ -11,12 +11,13 @@ package vazkii.botania.common.block.decor.slabs.bricks; import net.minecraft.block.BlockSlab; +import vazkii.botania.api.state.enums.CustomBrickVariant; import vazkii.botania.common.block.ModFluffBlocks; public class BlockTileSlab extends BlockCustomBrickSlab { public BlockTileSlab(boolean full) { - super(full, 3); + super(full, CustomBrickVariant.ROOF_TILE); } @Override diff --git a/src/main/java/vazkii/botania/common/block/decor/slabs/living/BlockDreamwoodPlankSlab.java b/src/main/java/vazkii/botania/common/block/decor/slabs/living/BlockDreamwoodPlankSlab.java index 3474f89ed..13f337a65 100644 --- a/src/main/java/vazkii/botania/common/block/decor/slabs/living/BlockDreamwoodPlankSlab.java +++ b/src/main/java/vazkii/botania/common/block/decor/slabs/living/BlockDreamwoodPlankSlab.java @@ -1,6 +1,8 @@ package vazkii.botania.common.block.decor.slabs.living; import net.minecraft.block.BlockSlab; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.LivingWoodVariant; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.ModFluffBlocks; import vazkii.botania.common.block.decor.slabs.BlockLivingSlab; @@ -8,7 +10,7 @@ import vazkii.botania.common.block.decor.slabs.BlockLivingSlab; public class BlockDreamwoodPlankSlab extends BlockLivingSlab { public BlockDreamwoodPlankSlab(boolean full) { - super(full, ModBlocks.dreamwood, 1); + super(full, ModBlocks.dreamwood.getDefaultState().withProperty(BotaniaStateProps.LIVINGWOOD_VARIANT, LivingWoodVariant.PLANKS)); setHardness(2.0F); } diff --git a/src/main/java/vazkii/botania/common/block/decor/slabs/living/BlockDreamwoodSlab.java b/src/main/java/vazkii/botania/common/block/decor/slabs/living/BlockDreamwoodSlab.java index 9531c1eb9..f797778c2 100644 --- a/src/main/java/vazkii/botania/common/block/decor/slabs/living/BlockDreamwoodSlab.java +++ b/src/main/java/vazkii/botania/common/block/decor/slabs/living/BlockDreamwoodSlab.java @@ -8,7 +8,7 @@ import vazkii.botania.common.block.decor.slabs.BlockLivingSlab; public class BlockDreamwoodSlab extends BlockLivingSlab { public BlockDreamwoodSlab(boolean full) { - super(full, ModBlocks.dreamwood, 0); + super(full, ModBlocks.dreamwood.getDefaultState()); setHardness(2.0F); } diff --git a/src/main/java/vazkii/botania/common/block/decor/slabs/living/BlockLivingrockBrickSlab.java b/src/main/java/vazkii/botania/common/block/decor/slabs/living/BlockLivingrockBrickSlab.java index f4cc7b46b..0799f944a 100644 --- a/src/main/java/vazkii/botania/common/block/decor/slabs/living/BlockLivingrockBrickSlab.java +++ b/src/main/java/vazkii/botania/common/block/decor/slabs/living/BlockLivingrockBrickSlab.java @@ -1,6 +1,9 @@ package vazkii.botania.common.block.decor.slabs.living; import net.minecraft.block.BlockSlab; +import net.minecraft.block.SoundType; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.LivingRockVariant; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.ModFluffBlocks; import vazkii.botania.common.block.decor.slabs.BlockLivingSlab; @@ -8,10 +11,10 @@ import vazkii.botania.common.block.decor.slabs.BlockLivingSlab; public class BlockLivingrockBrickSlab extends BlockLivingSlab { public BlockLivingrockBrickSlab(boolean full) { - super(full, ModBlocks.livingrock, 1); + super(full, ModBlocks.livingrock.getDefaultState().withProperty(BotaniaStateProps.LIVINGROCK_VARIANT, LivingRockVariant.BRICK)); setHardness(2.0F); setResistance(10.0F); - setStepSound(soundTypeStone); + setSoundType(SoundType.STONE); } @Override diff --git a/src/main/java/vazkii/botania/common/block/decor/slabs/living/BlockLivingrockSlab.java b/src/main/java/vazkii/botania/common/block/decor/slabs/living/BlockLivingrockSlab.java index 4866a6712..d51909370 100644 --- a/src/main/java/vazkii/botania/common/block/decor/slabs/living/BlockLivingrockSlab.java +++ b/src/main/java/vazkii/botania/common/block/decor/slabs/living/BlockLivingrockSlab.java @@ -1,6 +1,7 @@ package vazkii.botania.common.block.decor.slabs.living; import net.minecraft.block.BlockSlab; +import net.minecraft.block.SoundType; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.ModFluffBlocks; import vazkii.botania.common.block.decor.slabs.BlockLivingSlab; @@ -8,10 +9,10 @@ import vazkii.botania.common.block.decor.slabs.BlockLivingSlab; public class BlockLivingrockSlab extends BlockLivingSlab { public BlockLivingrockSlab(boolean full) { - super(full, ModBlocks.livingrock, 0); + super(full, ModBlocks.livingrock.getDefaultState()); setHardness(2.0F); setResistance(10.0F); - setStepSound(soundTypeStone); + setSoundType(SoundType.STONE); } @Override diff --git a/src/main/java/vazkii/botania/common/block/decor/slabs/living/BlockLivingwoodPlankSlab.java b/src/main/java/vazkii/botania/common/block/decor/slabs/living/BlockLivingwoodPlankSlab.java index 4ecc38374..1d1756033 100644 --- a/src/main/java/vazkii/botania/common/block/decor/slabs/living/BlockLivingwoodPlankSlab.java +++ b/src/main/java/vazkii/botania/common/block/decor/slabs/living/BlockLivingwoodPlankSlab.java @@ -1,6 +1,8 @@ package vazkii.botania.common.block.decor.slabs.living; import net.minecraft.block.BlockSlab; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.LivingWoodVariant; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.ModFluffBlocks; import vazkii.botania.common.block.decor.slabs.BlockLivingSlab; @@ -8,7 +10,7 @@ import vazkii.botania.common.block.decor.slabs.BlockLivingSlab; public class BlockLivingwoodPlankSlab extends BlockLivingSlab { public BlockLivingwoodPlankSlab(boolean full) { - super(full, ModBlocks.livingwood, 1); + super(full, ModBlocks.livingwood.getDefaultState().withProperty(BotaniaStateProps.LIVINGWOOD_VARIANT, LivingWoodVariant.PLANKS)); setHardness(2.0F); } diff --git a/src/main/java/vazkii/botania/common/block/decor/slabs/living/BlockLivingwoodSlab.java b/src/main/java/vazkii/botania/common/block/decor/slabs/living/BlockLivingwoodSlab.java index 53ea9e745..abd4a2046 100644 --- a/src/main/java/vazkii/botania/common/block/decor/slabs/living/BlockLivingwoodSlab.java +++ b/src/main/java/vazkii/botania/common/block/decor/slabs/living/BlockLivingwoodSlab.java @@ -8,7 +8,7 @@ import vazkii.botania.common.block.decor.slabs.BlockLivingSlab; public class BlockLivingwoodSlab extends BlockLivingSlab { public BlockLivingwoodSlab(boolean full) { - super(full, ModBlocks.livingwood, 0); + super(full, ModBlocks.livingwood.getDefaultState()); setHardness(2.0F); } diff --git a/src/main/java/vazkii/botania/common/block/decor/slabs/living/BlockShimmerrockSlab.java b/src/main/java/vazkii/botania/common/block/decor/slabs/living/BlockShimmerrockSlab.java index 8302a1647..c78dc76dc 100644 --- a/src/main/java/vazkii/botania/common/block/decor/slabs/living/BlockShimmerrockSlab.java +++ b/src/main/java/vazkii/botania/common/block/decor/slabs/living/BlockShimmerrockSlab.java @@ -11,6 +11,7 @@ package vazkii.botania.common.block.decor.slabs.living; import net.minecraft.block.BlockSlab; +import net.minecraft.block.SoundType; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.ModFluffBlocks; import vazkii.botania.common.block.decor.slabs.BlockLivingSlab; @@ -18,10 +19,10 @@ import vazkii.botania.common.block.decor.slabs.BlockLivingSlab; public class BlockShimmerrockSlab extends BlockLivingSlab { public BlockShimmerrockSlab(boolean full) { - super(full, ModBlocks.shimmerrock, 0); + super(full, ModBlocks.shimmerrock.getDefaultState()); setHardness(2.0F); setResistance(10.0F); - setStepSound(soundTypeStone); + setSoundType(SoundType.STONE); } @Override diff --git a/src/main/java/vazkii/botania/common/block/decor/slabs/living/BlockShimmerwoodPlankSlab.java b/src/main/java/vazkii/botania/common/block/decor/slabs/living/BlockShimmerwoodPlankSlab.java index 1f4b2fb09..1b1816f24 100644 --- a/src/main/java/vazkii/botania/common/block/decor/slabs/living/BlockShimmerwoodPlankSlab.java +++ b/src/main/java/vazkii/botania/common/block/decor/slabs/living/BlockShimmerwoodPlankSlab.java @@ -11,6 +11,7 @@ package vazkii.botania.common.block.decor.slabs.living; import net.minecraft.block.BlockSlab; +import net.minecraft.block.SoundType; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.ModFluffBlocks; import vazkii.botania.common.block.decor.slabs.BlockLivingSlab; @@ -18,10 +19,10 @@ import vazkii.botania.common.block.decor.slabs.BlockLivingSlab; public class BlockShimmerwoodPlankSlab extends BlockLivingSlab { public BlockShimmerwoodPlankSlab(boolean full) { - super(full, ModBlocks.shimmerwoodPlanks, 0); + super(full, ModBlocks.shimmerwoodPlanks.getDefaultState()); setHardness(2.0F); setResistance(10.0F); - setStepSound(soundTypeWood); + setSoundType(SoundType.WOOD); } @Override diff --git a/src/main/java/vazkii/botania/common/block/decor/slabs/prismarine/BlockDarkPrismarineSlab.java b/src/main/java/vazkii/botania/common/block/decor/slabs/prismarine/BlockDarkPrismarineSlab.java deleted file mode 100644 index 4d11d827e..000000000 --- a/src/main/java/vazkii/botania/common/block/decor/slabs/prismarine/BlockDarkPrismarineSlab.java +++ /dev/null @@ -1,22 +0,0 @@ -package vazkii.botania.common.block.decor.slabs.prismarine; - -import net.minecraft.block.BlockSlab; -import vazkii.botania.common.block.ModFluffBlocks; - -public class BlockDarkPrismarineSlab extends BlockPrismarineSlab { - - public BlockDarkPrismarineSlab(boolean full) { - super(full, 2); - } - - @Override - public BlockSlab getFullBlock() { - return (BlockSlab) ModFluffBlocks.darkPrismarineSlabFull; - } - - @Override - public BlockSlab getSingleBlock() { - return (BlockSlab) ModFluffBlocks.darkPrismarineSlab; - } - -} diff --git a/src/main/java/vazkii/botania/common/block/decor/slabs/prismarine/BlockPrismarineBrickSlab.java b/src/main/java/vazkii/botania/common/block/decor/slabs/prismarine/BlockPrismarineBrickSlab.java deleted file mode 100644 index 9b7f5fa7a..000000000 --- a/src/main/java/vazkii/botania/common/block/decor/slabs/prismarine/BlockPrismarineBrickSlab.java +++ /dev/null @@ -1,22 +0,0 @@ -package vazkii.botania.common.block.decor.slabs.prismarine; - -import net.minecraft.block.BlockSlab; -import vazkii.botania.common.block.ModFluffBlocks; - -public class BlockPrismarineBrickSlab extends BlockPrismarineSlab { - - public BlockPrismarineBrickSlab(boolean full) { - super(full, 1); - } - - @Override - public BlockSlab getFullBlock() { - return (BlockSlab) ModFluffBlocks.prismarineBrickSlabFull; - } - - @Override - public BlockSlab getSingleBlock() { - return (BlockSlab) ModFluffBlocks.prismarineBrickSlab; - } - -} diff --git a/src/main/java/vazkii/botania/common/block/decor/slabs/prismarine/BlockPrismarineSlab.java b/src/main/java/vazkii/botania/common/block/decor/slabs/prismarine/BlockPrismarineSlab.java deleted file mode 100644 index b9e385f03..000000000 --- a/src/main/java/vazkii/botania/common/block/decor/slabs/prismarine/BlockPrismarineSlab.java +++ /dev/null @@ -1,41 +0,0 @@ -package vazkii.botania.common.block.decor.slabs.prismarine; - -import net.minecraft.block.BlockSlab; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.common.block.ModBlocks; -import vazkii.botania.common.block.ModFluffBlocks; -import vazkii.botania.common.block.decor.slabs.BlockLivingSlab; -import vazkii.botania.common.lexicon.LexiconData; - -public class BlockPrismarineSlab extends BlockLivingSlab { - - public BlockPrismarineSlab(boolean full) { - this(full, 0); - } - - public BlockPrismarineSlab(boolean full, int meta) { - super(full, ModBlocks.prismarine, meta); - setHardness(2.0F); - setResistance(10.0F); - setStepSound(soundTypeStone); - } - - @Override - public BlockSlab getFullBlock() { - return (BlockSlab) ModFluffBlocks.prismarineSlabFull; - } - - @Override - public BlockSlab getSingleBlock() { - return (BlockSlab) ModFluffBlocks.prismarineSlab; - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { - return LexiconData.prismarine; - } - -} diff --git a/src/main/java/vazkii/botania/common/block/decor/stairs/Block18StoneStairs.java b/src/main/java/vazkii/botania/common/block/decor/stairs/Block18StoneStairs.java deleted file mode 100644 index 3873be4c1..000000000 --- a/src/main/java/vazkii/botania/common/block/decor/stairs/Block18StoneStairs.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Apr 10, 2015, 7:51:29 PM (GMT)] - */ -package vazkii.botania.common.block.decor.stairs; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.common.block.ModFluffBlocks; -import vazkii.botania.common.lexicon.LexiconData; - -public class Block18StoneStairs extends BlockLivingStairs { - - public Block18StoneStairs(int meta) { - super(ModFluffBlocks.stone, meta); - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { - return LexiconData.stoneAlchemy; - } - -} diff --git a/src/main/java/vazkii/botania/common/block/decor/stairs/BlockBiomeStoneStairs.java b/src/main/java/vazkii/botania/common/block/decor/stairs/BlockBiomeStoneStairs.java index 20ff8e624..8fbdc7f63 100644 --- a/src/main/java/vazkii/botania/common/block/decor/stairs/BlockBiomeStoneStairs.java +++ b/src/main/java/vazkii/botania/common/block/decor/stairs/BlockBiomeStoneStairs.java @@ -10,21 +10,22 @@ */ package vazkii.botania.common.block.decor.stairs; -import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.common.lexicon.LexiconData; public class BlockBiomeStoneStairs extends BlockLivingStairs { - public BlockBiomeStoneStairs(Block source, int meta) { - super(source, meta); + public BlockBiomeStoneStairs(IBlockState state) { + super(state); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.marimorphosis; } diff --git a/src/main/java/vazkii/botania/common/block/decor/stairs/BlockEndStoneStairs.java b/src/main/java/vazkii/botania/common/block/decor/stairs/BlockEndStoneStairs.java deleted file mode 100644 index a2da6e37b..000000000 --- a/src/main/java/vazkii/botania/common/block/decor/stairs/BlockEndStoneStairs.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Feb 16, 2015, 8:44:03 PM (GMT)] - */ -package vazkii.botania.common.block.decor.stairs; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.common.block.ModBlocks; -import vazkii.botania.common.lexicon.LexiconData; - -public class BlockEndStoneStairs extends BlockLivingStairs { - - public BlockEndStoneStairs() { - super(ModBlocks.endStoneBrick, 0); - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { - return LexiconData.endStoneDecor; - } - -} diff --git a/src/main/java/vazkii/botania/common/block/decor/stairs/BlockEnderBrickStairs.java b/src/main/java/vazkii/botania/common/block/decor/stairs/BlockEnderBrickStairs.java deleted file mode 100644 index fdd23147c..000000000 --- a/src/main/java/vazkii/botania/common/block/decor/stairs/BlockEnderBrickStairs.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jul 7, 2015, 10:38:15 PM (GMT)] - */ -package vazkii.botania.common.block.decor.stairs; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.common.block.ModBlocks; -import vazkii.botania.common.lexicon.LexiconData; - -public class BlockEnderBrickStairs extends BlockLivingStairs { - - public BlockEnderBrickStairs() { - super(ModBlocks.endStoneBrick, 2); - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { - return LexiconData.endStoneDecor; - } - -} diff --git a/src/main/java/vazkii/botania/common/block/decor/stairs/BlockLivingStairs.java b/src/main/java/vazkii/botania/common/block/decor/stairs/BlockLivingStairs.java index 2dba633b5..5850709e2 100644 --- a/src/main/java/vazkii/botania/common/block/decor/stairs/BlockLivingStairs.java +++ b/src/main/java/vazkii/botania/common/block/decor/stairs/BlockLivingStairs.java @@ -1,11 +1,11 @@ package vazkii.botania.common.block.decor.stairs; -import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; public class BlockLivingStairs extends BlockModStairs { - public BlockLivingStairs(Block source, int meta) { - super(source, meta, source.getUnlocalizedName().replaceAll("tile.", "") + meta + "Stairs"); + public BlockLivingStairs(IBlockState state) { + super(state, state.getBlock().getUnlocalizedName().replaceAll("tile.", "") + state.getBlock().getMetaFromState(state) + "Stairs"); } } diff --git a/src/main/java/vazkii/botania/common/block/decor/stairs/BlockModStairs.java b/src/main/java/vazkii/botania/common/block/decor/stairs/BlockModStairs.java index 82ad317d5..cb702eecc 100644 --- a/src/main/java/vazkii/botania/common/block/decor/stairs/BlockModStairs.java +++ b/src/main/java/vazkii/botania/common/block/decor/stairs/BlockModStairs.java @@ -1,35 +1,46 @@ package vazkii.botania.common.block.decor.stairs; -import net.minecraft.block.Block; import net.minecraft.block.BlockStairs; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.client.render.IModelRegister; import vazkii.botania.common.core.BotaniaCreativeTab; import vazkii.botania.common.item.block.ItemBlockMod; import vazkii.botania.common.lexicon.LexiconData; -import cpw.mods.fml.common.registry.GameRegistry; +import vazkii.botania.common.lib.LibMisc; -public class BlockModStairs extends BlockStairs implements ILexiconable { +public class BlockModStairs extends BlockStairs implements ILexiconable, IModelRegister { - public BlockModStairs(Block source, int meta, String name) { - super(source, meta); - setBlockName(name); + public BlockModStairs(IBlockState state, String name) { + super(state); + setRegistryName(new ResourceLocation(LibMisc.MOD_ID, name)); + GameRegistry.register(this); + GameRegistry.register(new ItemBlockMod(this), getRegistryName()); + setUnlocalizedName(name); setCreativeTab(BotaniaCreativeTab.INSTANCE); useNeighborBrightness = true; } @Override - public Block setBlockName(String par1Str) { - GameRegistry.registerBlock(this, ItemBlockMod.class, par1Str); - return super.setBlockName(par1Str); - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.decorativeBlocks; } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), 0, new ModelResourceLocation(getRegistryName(), "inventory")); + } } diff --git a/src/main/java/vazkii/botania/common/block/decor/stairs/BlockPavementStairs.java b/src/main/java/vazkii/botania/common/block/decor/stairs/BlockPavementStairs.java index fd9624717..0294eddda 100644 --- a/src/main/java/vazkii/botania/common/block/decor/stairs/BlockPavementStairs.java +++ b/src/main/java/vazkii/botania/common/block/decor/stairs/BlockPavementStairs.java @@ -11,20 +11,23 @@ package vazkii.botania.common.block.decor.stairs; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumDyeColor; import net.minecraft.item.ItemStack; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.common.block.ModFluffBlocks; import vazkii.botania.common.lexicon.LexiconData; public class BlockPavementStairs extends BlockLivingStairs { - public BlockPavementStairs(int meta) { - super(ModFluffBlocks.pavement, meta); + public BlockPavementStairs(EnumDyeColor color) { + super(ModFluffBlocks.pavement.getDefaultState().withProperty(BotaniaStateProps.PAVEMENT_COLOR, color)); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.pavement; } diff --git a/src/main/java/vazkii/botania/common/block/decor/stairs/BlockReedStairs.java b/src/main/java/vazkii/botania/common/block/decor/stairs/BlockReedStairs.java deleted file mode 100644 index c2c045307..000000000 --- a/src/main/java/vazkii/botania/common/block/decor/stairs/BlockReedStairs.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jul 28, 2014, 8:47:52 PM (GMT)] - */ -package vazkii.botania.common.block.decor.stairs; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.common.block.ModBlocks; -import vazkii.botania.common.lexicon.LexiconData; - -public class BlockReedStairs extends BlockLivingStairs { - - public BlockReedStairs() { - super(ModBlocks.reedBlock, 0); - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { - return LexiconData.decorativeBlocks; - } - - -} diff --git a/src/main/java/vazkii/botania/common/block/decor/stairs/BlockThatchStairs.java b/src/main/java/vazkii/botania/common/block/decor/stairs/BlockThatchStairs.java deleted file mode 100644 index d55162c51..000000000 --- a/src/main/java/vazkii/botania/common/block/decor/stairs/BlockThatchStairs.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jul 28, 2014, 8:47:52 PM (GMT)] - */ -package vazkii.botania.common.block.decor.stairs; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.common.block.ModBlocks; -import vazkii.botania.common.lexicon.LexiconData; - -public class BlockThatchStairs extends BlockLivingStairs { - - public BlockThatchStairs() { - super(ModBlocks.thatch, 0); - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { - return LexiconData.decorativeBlocks; - } - - -} diff --git a/src/main/java/vazkii/botania/common/block/decor/stairs/bricks/BlockCustomBrickStairs.java b/src/main/java/vazkii/botania/common/block/decor/stairs/bricks/BlockCustomBrickStairs.java index e49976d2a..62792a7bb 100644 --- a/src/main/java/vazkii/botania/common/block/decor/stairs/bricks/BlockCustomBrickStairs.java +++ b/src/main/java/vazkii/botania/common/block/decor/stairs/bricks/BlockCustomBrickStairs.java @@ -2,8 +2,11 @@ package vazkii.botania.common.block.decor.stairs.bricks; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.CustomBrickVariant; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.decor.stairs.BlockLivingStairs; import vazkii.botania.common.lexicon.LexiconData; @@ -11,15 +14,15 @@ import vazkii.botania.common.lexicon.LexiconData; public class BlockCustomBrickStairs extends BlockLivingStairs { public BlockCustomBrickStairs() { - this(0); + this(CustomBrickVariant.HELLISH_BRICK); } - public BlockCustomBrickStairs(int meta) { - super(ModBlocks.customBrick, meta); + public BlockCustomBrickStairs(CustomBrickVariant variant) { + super(ModBlocks.customBrick.getDefaultState().withProperty(BotaniaStateProps.CUSTOMBRICK_VARIANT, variant)); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.decorativeBlocks; } diff --git a/src/main/java/vazkii/botania/common/block/decor/stairs/bricks/BlockSnowBrickStairs.java b/src/main/java/vazkii/botania/common/block/decor/stairs/bricks/BlockSnowBrickStairs.java index de545e4c7..da529cbcd 100644 --- a/src/main/java/vazkii/botania/common/block/decor/stairs/bricks/BlockSnowBrickStairs.java +++ b/src/main/java/vazkii/botania/common/block/decor/stairs/bricks/BlockSnowBrickStairs.java @@ -10,10 +10,12 @@ */ package vazkii.botania.common.block.decor.stairs.bricks; +import vazkii.botania.api.state.enums.CustomBrickVariant; + public class BlockSnowBrickStairs extends BlockCustomBrickStairs { public BlockSnowBrickStairs() { - super(2); + super(CustomBrickVariant.FROSTY_BRICK); } } diff --git a/src/main/java/vazkii/botania/common/block/decor/stairs/bricks/BlockSoulBrickStairs.java b/src/main/java/vazkii/botania/common/block/decor/stairs/bricks/BlockSoulBrickStairs.java index 7d031030b..27b8cb4cf 100644 --- a/src/main/java/vazkii/botania/common/block/decor/stairs/bricks/BlockSoulBrickStairs.java +++ b/src/main/java/vazkii/botania/common/block/decor/stairs/bricks/BlockSoulBrickStairs.java @@ -10,10 +10,12 @@ */ package vazkii.botania.common.block.decor.stairs.bricks; +import vazkii.botania.api.state.enums.CustomBrickVariant; + public class BlockSoulBrickStairs extends BlockCustomBrickStairs { public BlockSoulBrickStairs() { - super(1); + super(CustomBrickVariant.SOUL_BRICK); } } diff --git a/src/main/java/vazkii/botania/common/block/decor/stairs/bricks/BlockTileStairs.java b/src/main/java/vazkii/botania/common/block/decor/stairs/bricks/BlockTileStairs.java index 943fe3b39..d8c011596 100644 --- a/src/main/java/vazkii/botania/common/block/decor/stairs/bricks/BlockTileStairs.java +++ b/src/main/java/vazkii/botania/common/block/decor/stairs/bricks/BlockTileStairs.java @@ -10,10 +10,12 @@ */ package vazkii.botania.common.block.decor.stairs.bricks; +import vazkii.botania.api.state.enums.CustomBrickVariant; + public class BlockTileStairs extends BlockCustomBrickStairs { public BlockTileStairs() { - super(3); + super(CustomBrickVariant.ROOF_TILE); } } diff --git a/src/main/java/vazkii/botania/common/block/decor/stairs/living/BlockDreamwoodPlankStairs.java b/src/main/java/vazkii/botania/common/block/decor/stairs/living/BlockDreamwoodPlankStairs.java index bba59293c..3b54c82ee 100644 --- a/src/main/java/vazkii/botania/common/block/decor/stairs/living/BlockDreamwoodPlankStairs.java +++ b/src/main/java/vazkii/botania/common/block/decor/stairs/living/BlockDreamwoodPlankStairs.java @@ -1,12 +1,14 @@ package vazkii.botania.common.block.decor.stairs.living; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.LivingWoodVariant; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.decor.stairs.BlockLivingStairs; public class BlockDreamwoodPlankStairs extends BlockLivingStairs { public BlockDreamwoodPlankStairs() { - super(ModBlocks.dreamwood, 1); + super(ModBlocks.dreamwood.getDefaultState().withProperty(BotaniaStateProps.LIVINGWOOD_VARIANT, LivingWoodVariant.PLANKS)); } } diff --git a/src/main/java/vazkii/botania/common/block/decor/stairs/living/BlockDreamwoodStairs.java b/src/main/java/vazkii/botania/common/block/decor/stairs/living/BlockDreamwoodStairs.java index 7d87c4a0a..a2b688747 100644 --- a/src/main/java/vazkii/botania/common/block/decor/stairs/living/BlockDreamwoodStairs.java +++ b/src/main/java/vazkii/botania/common/block/decor/stairs/living/BlockDreamwoodStairs.java @@ -6,7 +6,7 @@ import vazkii.botania.common.block.decor.stairs.BlockLivingStairs; public class BlockDreamwoodStairs extends BlockLivingStairs { public BlockDreamwoodStairs() { - super(ModBlocks.dreamwood, 0); + super(ModBlocks.dreamwood.getDefaultState()); } } diff --git a/src/main/java/vazkii/botania/common/block/decor/stairs/living/BlockLivingrockBrickStairs.java b/src/main/java/vazkii/botania/common/block/decor/stairs/living/BlockLivingrockBrickStairs.java index 08618fc79..8b85347f6 100644 --- a/src/main/java/vazkii/botania/common/block/decor/stairs/living/BlockLivingrockBrickStairs.java +++ b/src/main/java/vazkii/botania/common/block/decor/stairs/living/BlockLivingrockBrickStairs.java @@ -1,12 +1,14 @@ package vazkii.botania.common.block.decor.stairs.living; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.LivingRockVariant; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.decor.stairs.BlockLivingStairs; public class BlockLivingrockBrickStairs extends BlockLivingStairs { public BlockLivingrockBrickStairs() { - super(ModBlocks.livingrock, 1); + super(ModBlocks.livingrock.getDefaultState().withProperty(BotaniaStateProps.LIVINGROCK_VARIANT, LivingRockVariant.BRICK)); } } diff --git a/src/main/java/vazkii/botania/common/block/decor/stairs/living/BlockLivingrockStairs.java b/src/main/java/vazkii/botania/common/block/decor/stairs/living/BlockLivingrockStairs.java index a974af4e8..16d494738 100644 --- a/src/main/java/vazkii/botania/common/block/decor/stairs/living/BlockLivingrockStairs.java +++ b/src/main/java/vazkii/botania/common/block/decor/stairs/living/BlockLivingrockStairs.java @@ -6,7 +6,7 @@ import vazkii.botania.common.block.decor.stairs.BlockLivingStairs; public class BlockLivingrockStairs extends BlockLivingStairs { public BlockLivingrockStairs() { - super(ModBlocks.livingrock, 0); + super(ModBlocks.livingrock.getDefaultState()); } } diff --git a/src/main/java/vazkii/botania/common/block/decor/stairs/living/BlockLivingwoodPlankStairs.java b/src/main/java/vazkii/botania/common/block/decor/stairs/living/BlockLivingwoodPlankStairs.java index 9ffc1a315..e15e00a99 100644 --- a/src/main/java/vazkii/botania/common/block/decor/stairs/living/BlockLivingwoodPlankStairs.java +++ b/src/main/java/vazkii/botania/common/block/decor/stairs/living/BlockLivingwoodPlankStairs.java @@ -1,12 +1,14 @@ package vazkii.botania.common.block.decor.stairs.living; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.LivingWoodVariant; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.decor.stairs.BlockLivingStairs; public class BlockLivingwoodPlankStairs extends BlockLivingStairs { public BlockLivingwoodPlankStairs() { - super(ModBlocks.livingwood, 1); + super(ModBlocks.livingwood.getDefaultState().withProperty(BotaniaStateProps.LIVINGWOOD_VARIANT, LivingWoodVariant.PLANKS)); } } diff --git a/src/main/java/vazkii/botania/common/block/decor/stairs/living/BlockLivingwoodStairs.java b/src/main/java/vazkii/botania/common/block/decor/stairs/living/BlockLivingwoodStairs.java index d1dec721f..40622fdf1 100644 --- a/src/main/java/vazkii/botania/common/block/decor/stairs/living/BlockLivingwoodStairs.java +++ b/src/main/java/vazkii/botania/common/block/decor/stairs/living/BlockLivingwoodStairs.java @@ -6,7 +6,7 @@ import vazkii.botania.common.block.decor.stairs.BlockLivingStairs; public class BlockLivingwoodStairs extends BlockLivingStairs { public BlockLivingwoodStairs() { - super(ModBlocks.livingwood, 0); + super(ModBlocks.livingwood.getDefaultState()); } } diff --git a/src/main/java/vazkii/botania/common/block/decor/stairs/living/BlockShimmerrockStairs.java b/src/main/java/vazkii/botania/common/block/decor/stairs/living/BlockShimmerrockStairs.java index 34e6cfe2a..fbc9b1c4a 100644 --- a/src/main/java/vazkii/botania/common/block/decor/stairs/living/BlockShimmerrockStairs.java +++ b/src/main/java/vazkii/botania/common/block/decor/stairs/living/BlockShimmerrockStairs.java @@ -16,7 +16,7 @@ import vazkii.botania.common.block.decor.stairs.BlockLivingStairs; public class BlockShimmerrockStairs extends BlockLivingStairs { public BlockShimmerrockStairs() { - super(ModBlocks.shimmerrock, 0); + super(ModBlocks.shimmerrock.getDefaultState()); } } diff --git a/src/main/java/vazkii/botania/common/block/decor/stairs/living/BlockShimmerwoodPlankStairs.java b/src/main/java/vazkii/botania/common/block/decor/stairs/living/BlockShimmerwoodPlankStairs.java index 5714756e1..25c221d9f 100644 --- a/src/main/java/vazkii/botania/common/block/decor/stairs/living/BlockShimmerwoodPlankStairs.java +++ b/src/main/java/vazkii/botania/common/block/decor/stairs/living/BlockShimmerwoodPlankStairs.java @@ -16,7 +16,7 @@ import vazkii.botania.common.block.decor.stairs.BlockLivingStairs; public class BlockShimmerwoodPlankStairs extends BlockLivingStairs { public BlockShimmerwoodPlankStairs() { - super(ModBlocks.shimmerwoodPlanks, 0); + super(ModBlocks.shimmerwoodPlanks.getDefaultState()); } } diff --git a/src/main/java/vazkii/botania/common/block/decor/stairs/prismarine/BlockDarkPrismarineStairs.java b/src/main/java/vazkii/botania/common/block/decor/stairs/prismarine/BlockDarkPrismarineStairs.java deleted file mode 100644 index 2d3c99963..000000000 --- a/src/main/java/vazkii/botania/common/block/decor/stairs/prismarine/BlockDarkPrismarineStairs.java +++ /dev/null @@ -1,10 +0,0 @@ -package vazkii.botania.common.block.decor.stairs.prismarine; - - -public class BlockDarkPrismarineStairs extends BlockPrismarineStairs { - - public BlockDarkPrismarineStairs() { - super(2); - } - -} diff --git a/src/main/java/vazkii/botania/common/block/decor/stairs/prismarine/BlockPrismarineBrickStairs.java b/src/main/java/vazkii/botania/common/block/decor/stairs/prismarine/BlockPrismarineBrickStairs.java deleted file mode 100644 index f3d015e46..000000000 --- a/src/main/java/vazkii/botania/common/block/decor/stairs/prismarine/BlockPrismarineBrickStairs.java +++ /dev/null @@ -1,10 +0,0 @@ -package vazkii.botania.common.block.decor.stairs.prismarine; - - -public class BlockPrismarineBrickStairs extends BlockPrismarineStairs { - - public BlockPrismarineBrickStairs() { - super(1); - } - -} diff --git a/src/main/java/vazkii/botania/common/block/decor/stairs/prismarine/BlockPrismarineStairs.java b/src/main/java/vazkii/botania/common/block/decor/stairs/prismarine/BlockPrismarineStairs.java deleted file mode 100644 index 3a823ffd3..000000000 --- a/src/main/java/vazkii/botania/common/block/decor/stairs/prismarine/BlockPrismarineStairs.java +++ /dev/null @@ -1,26 +0,0 @@ -package vazkii.botania.common.block.decor.stairs.prismarine; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.common.block.ModBlocks; -import vazkii.botania.common.block.decor.stairs.BlockLivingStairs; -import vazkii.botania.common.lexicon.LexiconData; - -public class BlockPrismarineStairs extends BlockLivingStairs { - - public BlockPrismarineStairs() { - this(0); - } - - public BlockPrismarineStairs(int meta) { - super(ModBlocks.prismarine, meta); - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { - return LexiconData.prismarine; - } - -} diff --git a/src/main/java/vazkii/botania/common/block/decor/walls/Block18StoneWall.java b/src/main/java/vazkii/botania/common/block/decor/walls/Block18StoneWall.java deleted file mode 100644 index 64b30f695..000000000 --- a/src/main/java/vazkii/botania/common/block/decor/walls/Block18StoneWall.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jul 18, 2015, 8:41:10 PM (GMT)] - */ -package vazkii.botania.common.block.decor.walls; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.common.block.ModFluffBlocks; -import vazkii.botania.common.lexicon.LexiconData; - -public class Block18StoneWall extends BlockVariantWall { - - public Block18StoneWall() { - super(ModFluffBlocks.stone, 4); - setHardness(1.5F); - setResistance(10F); - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { - return LexiconData.stoneAlchemy; - } - -} diff --git a/src/main/java/vazkii/botania/common/block/decor/walls/BlockBiomeStoneWall.java b/src/main/java/vazkii/botania/common/block/decor/walls/BlockBiomeStoneWall.java index 3f8a3e037..7aa85b348 100644 --- a/src/main/java/vazkii/botania/common/block/decor/walls/BlockBiomeStoneWall.java +++ b/src/main/java/vazkii/botania/common/block/decor/walls/BlockBiomeStoneWall.java @@ -10,24 +10,91 @@ */ package vazkii.botania.common.block.decor.walls; +import net.minecraft.block.BlockWall; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.block.statemap.StateMap; +import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.BiomeStoneVariant; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.block.ModFluffBlocks; +import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName; import vazkii.botania.common.lexicon.LexiconData; +import vazkii.botania.common.lib.LibMisc; -public class BlockBiomeStoneWall extends BlockVariantWall { +import javax.annotation.Nonnull; +import java.util.List; + +public class BlockBiomeStoneWall extends BlockModWall { public BlockBiomeStoneWall() { - super(ModFluffBlocks.biomeStoneA, 8, 8); + super(ModFluffBlocks.biomeStoneA, 0); setHardness(1.5F); setResistance(10F); } + @Nonnull @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, VARIANT, UP, NORTH, SOUTH, WEST, EAST, BotaniaStateProps.BIOMESTONEWALL_VARIANT); + } + + @Override + protected IBlockState pickDefaultState() { + return super.pickDefaultState().withProperty(BotaniaStateProps.BIOMESTONEWALL_VARIANT, BiomeStoneVariant.FOREST_COBBLE); + } + + @Override + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.BIOMESTONEWALL_VARIANT).ordinal() - 8; + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + if (meta < 0 || meta >= BotaniaStateProps.BIOMESTONEWALL_VARIANT.getAllowedValues().size()) { + meta = 0; + } + return getDefaultState().withProperty(BotaniaStateProps.BIOMESTONEWALL_VARIANT, BiomeStoneVariant.values()[meta + 8]); + } + + @Override + public void register() { + GameRegistry.register(this); + GameRegistry.register(new ItemBlockWithMetadataAndName(this), getRegistryName()); + } + + @SideOnly(Side.CLIENT) + @Override + public void getSubBlocks(@Nonnull Item item, CreativeTabs tabs, @Nonnull List list) { + for(int i = 0; i < 8; i++) + list.add(new ItemStack(item, 1, i)); + } + + @Override + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.marimorphosis; } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelLoader.setCustomStateMapper(this, + (new StateMap.Builder()).withName(BotaniaStateProps.BIOMESTONEWALL_VARIANT) + .ignore(BlockWall.VARIANT).withSuffix("_wall").build()); + ModelHandler.registerCustomItemblock(this, 8, i -> BiomeStoneVariant.values()[i + 8].getName() + "_wall"); + } + } diff --git a/src/main/java/vazkii/botania/common/block/decor/walls/BlockModWall.java b/src/main/java/vazkii/botania/common/block/decor/walls/BlockModWall.java index b0a3863b7..a72c7da83 100644 --- a/src/main/java/vazkii/botania/common/block/decor/walls/BlockModWall.java +++ b/src/main/java/vazkii/botania/common/block/decor/walls/BlockModWall.java @@ -12,66 +12,107 @@ package vazkii.botania.common.block.decor.walls; import java.util.List; +import javax.annotation.Nonnull; + import net.minecraft.block.Block; import net.minecraft.block.BlockWall; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.block.statemap.StateMap; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.client.render.IModelRegister; +import vazkii.botania.common.core.BotaniaCreativeTab; import vazkii.botania.common.item.block.ItemBlockMod; import vazkii.botania.common.lexicon.LexiconData; -import cpw.mods.fml.common.registry.GameRegistry; -public class BlockModWall extends BlockWall implements ILexiconable { - - Block block; - int meta; +public abstract class BlockModWall extends BlockWall implements ILexiconable, IModelRegister { public BlockModWall(Block block, int meta) { super(block); - this.block = block; - this.meta = meta; - setBlockName(block.getUnlocalizedName().replaceAll("tile.", "") + meta + "Wall"); + // For backward compat don't kill me + String name = block.getUnlocalizedName().replaceAll("tile.", "") + meta + "Wall"; + setRegistryName(name); + setUnlocalizedName(name); + setDefaultState(pickDefaultState()); + register(); + setCreativeTab(BotaniaCreativeTab.INSTANCE); + } + + @Nonnull + @Override + public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) { + return super.getActualState(state, world, pos).withProperty(VARIANT, EnumType.NORMAL); } @Override - public boolean canPlaceTorchOnTop(World world, int x, int y, int z) { + public int damageDropped(IBlockState state) { + return getMetaFromState(state); + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, VARIANT, UP, NORTH, SOUTH, WEST, EAST); + } + + protected IBlockState pickDefaultState() { + return blockState.getBaseState() + .withProperty(UP, false) + .withProperty(NORTH, false) + .withProperty(SOUTH, false) + .withProperty(WEST, false) + .withProperty(EAST, false) + .withProperty(VARIANT, EnumType.NORMAL); + } + + @Override + public int getMetaFromState(IBlockState state) { + return 0; + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + return getDefaultState(); + } + + @Override + public boolean canPlaceTorchOnTop(IBlockState state, @Nonnull IBlockAccess world, @Nonnull BlockPos pos) { return true; } - @Override - public Block setBlockName(String par1Str) { - register(par1Str); - return super.setBlockName(par1Str); - } - - public void register(String name) { - GameRegistry.registerBlock(this, ItemBlockMod.class, name); + public void register() { + GameRegistry.register(this); + GameRegistry.register(new ItemBlockMod(this), getRegistryName()); } + @SideOnly(Side.CLIENT) @Override - public void getSubBlocks(Item item, CreativeTabs tabs, List list) { + public void getSubBlocks(@Nonnull Item item, CreativeTabs tabs, @Nonnull List list) { list.add(new ItemStack(item)); } @Override - public IIcon getIcon(int side, int meta) { - return block.getIcon(side, this.meta); - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.decorativeBlocks; } + @SideOnly(Side.CLIENT) @Override - public void registerBlockIcons(IIconRegister p_149651_1_) { - // NO-OP + public void registerModels() { + ModelLoader.setCustomStateMapper(this, (new StateMap.Builder()).ignore(BlockWall.VARIANT).build()); } } diff --git a/src/main/java/vazkii/botania/common/block/decor/walls/BlockPrismarineWall.java b/src/main/java/vazkii/botania/common/block/decor/walls/BlockPrismarineWall.java deleted file mode 100644 index 0c0029950..000000000 --- a/src/main/java/vazkii/botania/common/block/decor/walls/BlockPrismarineWall.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jul 18, 2015, 8:30:00 PM (GMT)] - */ -package vazkii.botania.common.block.decor.walls; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.common.block.ModBlocks; -import vazkii.botania.common.lexicon.LexiconData; - -public class BlockPrismarineWall extends BlockModWall { - - public BlockPrismarineWall() { - super(ModBlocks.prismarine, 0); - setHardness(2.0F); - setResistance(10.0F); - setStepSound(soundTypeStone); - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { - return LexiconData.prismarine; - } - -} diff --git a/src/main/java/vazkii/botania/common/block/decor/walls/BlockReedWall.java b/src/main/java/vazkii/botania/common/block/decor/walls/BlockReedWall.java deleted file mode 100644 index 508389fd8..000000000 --- a/src/main/java/vazkii/botania/common/block/decor/walls/BlockReedWall.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jul 18, 2015, 8:31:04 PM (GMT)] - */ -package vazkii.botania.common.block.decor.walls; - -import vazkii.botania.common.block.ModBlocks; - -public class BlockReedWall extends BlockModWall { - - public BlockReedWall() { - super(ModBlocks.reedBlock, 0); - setHardness(1.0F); - setStepSound(soundTypeWood); - } - -} diff --git a/src/main/java/vazkii/botania/common/block/decor/walls/BlockVariantWall.java b/src/main/java/vazkii/botania/common/block/decor/walls/BlockVariantWall.java deleted file mode 100644 index 4c457bb44..000000000 --- a/src/main/java/vazkii/botania/common/block/decor/walls/BlockVariantWall.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jul 18, 2015, 8:42:16 PM (GMT)] - */ -package vazkii.botania.common.block.decor.walls; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName; -import cpw.mods.fml.common.registry.GameRegistry; - -public class BlockVariantWall extends BlockModWall { - - int metaStates; - int metaShift; - - public BlockVariantWall(Block block, int metaStates, int metaShift) { - super(block, 0); - this.metaStates = metaStates; - this.metaShift = metaShift; - } - - public BlockVariantWall(Block block, int metaStates) { - this(block, metaStates, 0); - } - - @Override - public void register(String name) { - GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, name); - } - - @Override - public void getSubBlocks(Item item, CreativeTabs tabs, List list) { - for(int i = 0; i < metaStates; i++) - list.add(new ItemStack(item, 1, i)); - } - - @Override - public IIcon getIcon(int side, int meta) { - return block.getIcon(side, meta + metaShift); - } - - -} diff --git a/src/main/java/vazkii/botania/common/block/decor/walls/living/BlockDreamwoodWall.java b/src/main/java/vazkii/botania/common/block/decor/walls/living/BlockDreamwoodWall.java index 6006e41a3..638ff1ee2 100644 --- a/src/main/java/vazkii/botania/common/block/decor/walls/living/BlockDreamwoodWall.java +++ b/src/main/java/vazkii/botania/common/block/decor/walls/living/BlockDreamwoodWall.java @@ -10,6 +10,10 @@ */ package vazkii.botania.common.block.decor.walls.living; +import net.minecraft.block.SoundType; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.decor.walls.BlockModWall; @@ -18,7 +22,13 @@ public class BlockDreamwoodWall extends BlockModWall { public BlockDreamwoodWall() { super(ModBlocks.dreamwood, 0); setHardness(2.0F); - setStepSound(soundTypeWood); + setSoundType(SoundType.WOOD); + } + + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerCustomItemblock(this, "dreamwood_wall"); } } diff --git a/src/main/java/vazkii/botania/common/block/decor/walls/living/BlockLivingrockWall.java b/src/main/java/vazkii/botania/common/block/decor/walls/living/BlockLivingrockWall.java index 603eebc83..9445b0d15 100644 --- a/src/main/java/vazkii/botania/common/block/decor/walls/living/BlockLivingrockWall.java +++ b/src/main/java/vazkii/botania/common/block/decor/walls/living/BlockLivingrockWall.java @@ -10,6 +10,10 @@ */ package vazkii.botania.common.block.decor.walls.living; +import net.minecraft.block.SoundType; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.decor.walls.BlockModWall; @@ -19,7 +23,13 @@ public class BlockLivingrockWall extends BlockModWall { super(ModBlocks.livingrock, 0); setHardness(2.0F); setResistance(10.0F); - setStepSound(soundTypeStone); + setSoundType(SoundType.STONE); + } + + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerCustomItemblock(this, "livingrock_wall"); } } diff --git a/src/main/java/vazkii/botania/common/block/decor/walls/living/BlockLivingwoodWall.java b/src/main/java/vazkii/botania/common/block/decor/walls/living/BlockLivingwoodWall.java index b958d4ff7..57e96e141 100644 --- a/src/main/java/vazkii/botania/common/block/decor/walls/living/BlockLivingwoodWall.java +++ b/src/main/java/vazkii/botania/common/block/decor/walls/living/BlockLivingwoodWall.java @@ -10,6 +10,10 @@ */ package vazkii.botania.common.block.decor.walls.living; +import net.minecraft.block.SoundType; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.decor.walls.BlockModWall; @@ -18,7 +22,13 @@ public class BlockLivingwoodWall extends BlockModWall { public BlockLivingwoodWall() { super(ModBlocks.livingwood, 0); setHardness(2.0F); - setStepSound(soundTypeWood); + setSoundType(SoundType.WOOD); + } + + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerCustomItemblock(this, "livingwood_wall"); } } diff --git a/src/main/java/vazkii/botania/common/block/dispenser/BehaviourFelPumpkin.java b/src/main/java/vazkii/botania/common/block/dispenser/BehaviourFelPumpkin.java new file mode 100644 index 000000000..52b1f3381 --- /dev/null +++ b/src/main/java/vazkii/botania/common/block/dispenser/BehaviourFelPumpkin.java @@ -0,0 +1,59 @@ +package vazkii.botania.common.block.dispenser; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockDispenser; +import net.minecraft.dispenser.BehaviorDefaultDispenseItem; +import net.minecraft.dispenser.IBlockSource; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import vazkii.botania.common.block.ModBlocks; + +import javax.annotation.Nonnull; + +// Taken from vanilla pumpkin dispense behaviour +public class BehaviourFelPumpkin extends BehaviorDefaultDispenseItem { + private boolean field_179241_b = true; + + @Nonnull + @Override + protected ItemStack dispenseStack(IBlockSource source, ItemStack stack) + { + World world = source.getWorld(); + EnumFacing facing = world.getBlockState(source.getBlockPos()).getValue(BlockDispenser.FACING); + BlockPos blockpos = source.getBlockPos().offset(facing); + Block blockpumpkin = ModBlocks.felPumpkin; + + if (world.isAirBlock(blockpos) && world.getBlockState(blockpos.down()).getBlock() == Blocks.IRON_BARS + && world.getBlockState(blockpos.down(2)).getBlock() == Blocks.IRON_BARS) // Botania - Check for iron bars + { + if (!world.isRemote) + { + world.setBlockState(blockpos, blockpumpkin.getDefaultState(), 3); + } + + --stack.stackSize; + } + else + { + this.field_179241_b = false; + } + + return stack; + } + + @Override + protected void playDispenseSound(IBlockSource source) + { + if (this.field_179241_b) + { + source.getWorld().playEvent(1000, source.getBlockPos(), 0); + } + else + { + source.getWorld().playEvent(1001, source.getBlockPos(), 0); + } + } +} diff --git a/src/main/java/vazkii/botania/common/block/dispenser/BehaviourPoolMinecart.java b/src/main/java/vazkii/botania/common/block/dispenser/BehaviourPoolMinecart.java index 5639c9386..62f67508b 100644 --- a/src/main/java/vazkii/botania/common/block/dispenser/BehaviourPoolMinecart.java +++ b/src/main/java/vazkii/botania/common/block/dispenser/BehaviourPoolMinecart.java @@ -10,55 +10,57 @@ */ package vazkii.botania.common.block.dispenser; -import net.minecraft.block.Block; import net.minecraft.block.BlockDispenser; import net.minecraft.block.BlockRailBase; import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; import net.minecraft.dispenser.BehaviorDefaultDispenseItem; import net.minecraft.dispenser.IBlockSource; import net.minecraft.entity.item.EntityMinecart; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import vazkii.botania.common.entity.EntityPoolMinecart; +import javax.annotation.Nonnull; + public class BehaviourPoolMinecart extends BehaviorDefaultDispenseItem { + @Nonnull @Override - public ItemStack dispenseStack(IBlockSource p_82487_1_, ItemStack p_82487_2_) { - EnumFacing enumfacing = BlockDispenser.func_149937_b(p_82487_1_.getBlockMetadata()); - World world = p_82487_1_.getWorld(); - double d0 = p_82487_1_.getX() + enumfacing.getFrontOffsetX() * 1.125F; - double d1 = p_82487_1_.getY() + enumfacing.getFrontOffsetY() * 1.125F; - double d2 = p_82487_1_.getZ() + enumfacing.getFrontOffsetZ() * 1.125F; - int i = p_82487_1_.getXInt() + enumfacing.getFrontOffsetX(); - int j = p_82487_1_.getYInt() + enumfacing.getFrontOffsetY(); - int k = p_82487_1_.getZInt() + enumfacing.getFrontOffsetZ(); - Block block = world.getBlock(i, j, k); + public ItemStack dispenseStack(IBlockSource source, ItemStack stack) { + World world = source.getWorld(); + EnumFacing enumfacing = world.getBlockState(source.getBlockPos()).getValue(BlockDispenser.FACING); + double d0 = source.getX() + enumfacing.getFrontOffsetX() * 1.125F; + double d1 = source.getY() + enumfacing.getFrontOffsetY() * 1.125F; + double d2 = source.getZ() + enumfacing.getFrontOffsetZ() * 1.125F; + BlockPos pos = source.getBlockPos().offset(enumfacing); + IBlockState state = world.getBlockState(pos); double d3; - if(BlockRailBase.func_150051_a(block)) + if(BlockRailBase.isRailBlock(state)) d3 = 0.0D; else { - if(block.getMaterial() != Material.air || !BlockRailBase.func_150051_a(world.getBlock(i, j - 1, k))) - return super.dispenseStack(p_82487_1_, p_82487_2_); + if(state.getMaterial() != Material.AIR || !BlockRailBase.isRailBlock(world.getBlockState(pos.down()))) + return super.dispenseStack(source, stack); d3 = -1.0D; } EntityMinecart entityminecart = new EntityPoolMinecart(world, d0, d1 + d3, d2); - if(p_82487_2_.hasDisplayName()) - entityminecart.setMinecartName(p_82487_2_.getDisplayName()); + if(stack.hasDisplayName()) + entityminecart.setCustomNameTag(stack.getDisplayName()); world.spawnEntityInWorld(entityminecart); - p_82487_2_.splitStack(1); - return p_82487_2_; + stack.splitStack(1); + return stack; } @Override - protected void playDispenseSound(IBlockSource p_82485_1_) { - p_82485_1_.getWorld().playAuxSFX(1000, p_82485_1_.getXInt(), p_82485_1_.getYInt(), p_82485_1_.getZInt(), 0); + protected void playDispenseSound(IBlockSource source) { + source.getWorld().playEvent(1000, source.getBlockPos(), 0); } } diff --git a/src/main/java/vazkii/botania/common/block/dispenser/BehaviourSeeds.java b/src/main/java/vazkii/botania/common/block/dispenser/BehaviourSeeds.java index bd679c72b..23c700885 100644 --- a/src/main/java/vazkii/botania/common/block/dispenser/BehaviourSeeds.java +++ b/src/main/java/vazkii/botania/common/block/dispenser/BehaviourSeeds.java @@ -16,31 +16,33 @@ import net.minecraft.dispenser.BehaviorDefaultDispenseItem; import net.minecraft.dispenser.IBlockSource; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import javax.annotation.Nonnull; + public class BehaviourSeeds extends BehaviorDefaultDispenseItem { - Block block; + private final Block block; public BehaviourSeeds(Block block) { this.block = block; } + @Nonnull @Override - public ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) { - EnumFacing facing = BlockDispenser.func_149937_b(par1IBlockSource.getBlockMetadata()); - int x = par1IBlockSource.getXInt() + facing.getFrontOffsetX(); - int y = par1IBlockSource.getYInt() + facing.getFrontOffsetY(); - int z = par1IBlockSource.getZInt() + facing.getFrontOffsetZ(); - World world = par1IBlockSource.getWorld(); + public ItemStack dispenseStack(IBlockSource source, ItemStack par2ItemStack) { + World world = source.getWorld(); + EnumFacing facing = world.getBlockState(source.getBlockPos()).getValue(BlockDispenser.FACING); + BlockPos pos = source.getBlockPos().offset(facing); - if(world.getBlock(x, y, z).isAir(world, x, y, z) && block.canBlockStay(world, x, y, z)) { - world.setBlock(x, y, z, block); + if(world.getBlockState(pos).getBlock().isAir(world.getBlockState(pos), world, pos) && block.canPlaceBlockAt(world, pos)) { + world.setBlockState(pos, block.getDefaultState()); par2ItemStack.stackSize--; return par2ItemStack; } - return super.dispenseStack(par1IBlockSource, par2ItemStack); + return super.dispenseStack(source, par2ItemStack); } } diff --git a/src/main/java/vazkii/botania/common/block/dispenser/BehaviourWand.java b/src/main/java/vazkii/botania/common/block/dispenser/BehaviourWand.java index b50b971f7..506849d73 100644 --- a/src/main/java/vazkii/botania/common/block/dispenser/BehaviourWand.java +++ b/src/main/java/vazkii/botania/common/block/dispenser/BehaviourWand.java @@ -15,26 +15,28 @@ import net.minecraft.block.BlockDispenser; import net.minecraft.dispenser.BehaviorDefaultDispenseItem; import net.minecraft.dispenser.IBlockSource; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; import vazkii.botania.api.wand.IWandable; +import javax.annotation.Nonnull; + public class BehaviourWand extends BehaviorDefaultDispenseItem { + @Nonnull @Override - protected ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) { - ForgeDirection facing = ForgeDirection.getOrientation(BlockDispenser.func_149937_b(par1IBlockSource.getBlockMetadata()).ordinal()); - int x = par1IBlockSource.getXInt() + facing.offsetX; - int y = par1IBlockSource.getYInt() + facing.offsetY; - int z = par1IBlockSource.getZInt() + facing.offsetZ; - World world = par1IBlockSource.getWorld(); - Block block = world.getBlock(x, y, z); + protected ItemStack dispenseStack(IBlockSource source, ItemStack par2ItemStack) { + World world = source.getWorld(); + EnumFacing facing = world.getBlockState(source.getBlockPos()).getValue(BlockDispenser.FACING); + BlockPos pos = source.getBlockPos().offset(facing); + Block block = world.getBlockState(pos).getBlock(); if(block instanceof IWandable) { - ((IWandable) block).onUsedByWand(null, par2ItemStack, world, x, y, z, facing.getOpposite().ordinal()); + ((IWandable) block).onUsedByWand(null, par2ItemStack, world, pos, facing.getOpposite()); return par2ItemStack; } - return super.dispenseStack(par1IBlockSource, par2ItemStack); + return super.dispenseStack(source, par2ItemStack); } } diff --git a/src/main/java/vazkii/botania/common/block/mana/BlockAlchemyCatalyst.java b/src/main/java/vazkii/botania/common/block/mana/BlockAlchemyCatalyst.java index 0c60b1635..a23d16a86 100644 --- a/src/main/java/vazkii/botania/common/block/mana/BlockAlchemyCatalyst.java +++ b/src/main/java/vazkii/botania/common/block/mana/BlockAlchemyCatalyst.java @@ -10,57 +10,45 @@ */ package vazkii.botania.common.block.mana; -import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.mana.IPoolOverlayProvider; -import vazkii.botania.client.core.helper.IconHelper; +import vazkii.botania.client.core.handler.MiscellaneousIcons; import vazkii.botania.common.block.BlockMod; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; public class BlockAlchemyCatalyst extends BlockMod implements ILexiconable, IPoolOverlayProvider { - IIcon[] icons; - public BlockAlchemyCatalyst() { this(LibBlockNames.ALCHEMY_CATALYST); } public BlockAlchemyCatalyst(String name) { - super(Material.rock); + super(Material.ROCK, name); setHardness(2.0F); setResistance(10.0F); - setStepSound(Block.soundTypeStone); - setBlockName(name); + setSoundType(SoundType.STONE); } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - icons = new IIcon[4]; - for(int i = 0; i < icons.length; i++) - icons[i] = IconHelper.forBlock(par1IconRegister, this, i); - } - - @Override - public IIcon getIcon(int par1, int par2) { - return icons[Math.min(2, par1)]; - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.alchemy; } @Override - public IIcon getIcon(World world, int x, int y, int z) { - return icons[3]; + @SideOnly(Side.CLIENT) + public TextureAtlasSprite getIcon(World world, BlockPos pos) { + return MiscellaneousIcons.INSTANCE.alchemyCatalystOverlay; } } diff --git a/src/main/java/vazkii/botania/common/block/mana/BlockBellows.java b/src/main/java/vazkii/botania/common/block/mana/BlockBellows.java index 341061899..555924322 100644 --- a/src/main/java/vazkii/botania/common/block/mana/BlockBellows.java +++ b/src/main/java/vazkii/botania/common/block/mana/BlockBellows.java @@ -10,85 +10,130 @@ */ package vazkii.botania.common.block.mana; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.block.statemap.StateMap; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; +import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.common.block.BlockModContainer; -import vazkii.botania.common.block.ModBlocks; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.client.core.handler.ModelHandler; +import vazkii.botania.common.block.BlockMod; import vazkii.botania.common.block.tile.mana.TileBellows; import vazkii.botania.common.entity.EntityDoppleganger; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -public class BlockBellows extends BlockModContainer implements ILexiconable { +import javax.annotation.Nonnull; - private static final int[] META_ROTATIONS = new int[] { 3, 4, 2, 5 }; +public class BlockBellows extends BlockMod implements ILexiconable { + + private static final AxisAlignedBB AABB = new AxisAlignedBB(0.1875, 0, 0.1875, 1-0.1875, 10.0 / 16, 1-0.1875); public BlockBellows() { - super(Material.wood); + super(Material.WOOD, LibBlockNames.BELLOWS); setHardness(2.0F); - setStepSound(soundTypeWood); - setBlockName(LibBlockNames.BELLOWS); + setSoundType(SoundType.WOOD); + } - float f = (1F - 10 / 16F) / 2F; - setBlockBounds(f, 0F, f, 1F - f, 10F / 16F, 1F - f); + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.CARDINALS); } @Override - public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) { - int l = MathHelper.floor_double(p_149689_5_.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; - p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, META_ROTATIONS[l], 2); + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.CARDINALS, EnumFacing.SOUTH); } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - // NO-OP + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.CARDINALS).getIndex(); + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + if (meta < 2 || meta > 5) { + meta = 2; + } + return getDefaultState().withProperty(BotaniaStateProps.CARDINALS, EnumFacing.getFront(meta)); + } + + @Nonnull + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { + return AABB; } @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int s, float xs, float ys, float zs) { + public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { + world.setBlockState(pos, state.withProperty(BotaniaStateProps.CARDINALS, placer.getHorizontalFacing()), 2); + } + + @Override + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing s, float xs, float ys, float zs) { if(EntityDoppleganger.isTruePlayer(player)) - ((TileBellows) world.getTileEntity(x, y, z)).interact(); + ((TileBellows) world.getTileEntity(pos)).interact(); return true; } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public boolean renderAsNormalBlock() { + public boolean isFullCube(IBlockState state) { return false; } + @Nonnull @Override - public IIcon getIcon(int par1, int par2) { - return ModBlocks.livingwood.getIcon(par1, 0); + public EnumBlockRenderType getRenderType(IBlockState state) { + return EnumBlockRenderType.ENTITYBLOCK_ANIMATED; } @Override - public int getRenderType() { - return LibRenderIDs.idBellows; + public boolean hasTileEntity(IBlockState state) { + return true; } + @Nonnull @Override - public TileEntity createNewTileEntity(World world, int meta) { + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileBellows(); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.bellows; } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelLoader.setCustomStateMapper(this, new StateMap.Builder().ignore(BotaniaStateProps.CARDINALS).build()); + ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(this), 0, TileBellows.class); + ModelHandler.registerCustomItemblock(this, "bellows"); + } + } diff --git a/src/main/java/vazkii/botania/common/block/mana/BlockBrewery.java b/src/main/java/vazkii/botania/common/block/mana/BlockBrewery.java index 1c83b153c..85f71d81d 100644 --- a/src/main/java/vazkii/botania/common/block/mana/BlockBrewery.java +++ b/src/main/java/vazkii/botania/common/block/mana/BlockBrewery.java @@ -10,159 +10,162 @@ */ package vazkii.botania.common.block.mana; -import java.util.Random; - -import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.renderer.block.statemap.StateMap; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.api.wand.IWandHUD; -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.common.block.BlockModContainer; +import vazkii.botania.client.core.handler.ModelHandler; +import vazkii.botania.common.block.BlockMod; import vazkii.botania.common.block.tile.TileBrewery; import vazkii.botania.common.block.tile.TileSimpleInventory; +import vazkii.botania.common.core.helper.InventoryHelper; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -public class BlockBrewery extends BlockModContainer implements ILexiconable, IWandHUD { +import javax.annotation.Nonnull; +import java.util.Random; - Random random; +public class BlockBrewery extends BlockMod implements ILexiconable, IWandHUD { + + private static final AxisAlignedBB AABB = new AxisAlignedBB(0.375, 0.05, 0.375, 0.625, 0.95, 0.625); public BlockBrewery() { - super(Material.rock); - float f = 6F / 16F; - setBlockBounds(f, 0.05F, f, 1F - f, 0.95F, 1F - f); - setBlockName(LibBlockNames.BREWERY); + super(Material.ROCK, LibBlockNames.BREWERY); setHardness(2.0F); setResistance(10.0F); - setStepSound(soundTypeStone); + setSoundType(SoundType.STONE); + } - random = new Random(); + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.POWERED); } @Override - public IIcon getIcon(int side, int meta) { - return Blocks.cobblestone.getIcon(side, meta); + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.POWERED, false); } @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { - TileBrewery brew = (TileBrewery) par1World.getTileEntity(par2, par3, par4); + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.POWERED) ? 1 : 0; + } - if(par5EntityPlayer.isSneaking()) { - if(brew.recipe == null && par1World.getBlockMetadata(par2, par3, par4) == 0) - for(int i = brew.getSizeInventory() - 1; i >= 0; i--) { - ItemStack stackAt = brew.getStackInSlot(i); - if(stackAt != null) { - ItemStack copy = stackAt.copy(); - if(!par5EntityPlayer.inventory.addItemStackToInventory(copy)) - par5EntityPlayer.dropPlayerItemWithRandomChoice(copy, false); - brew.setInventorySlotContents(i, null); - par1World.func_147453_f(par2, par3, par4, this); - break; - } - } + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + return getDefaultState().withProperty(BotaniaStateProps.POWERED, meta == 1); + } + + @Nonnull + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { + return AABB; + } + + @Override + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing side, float par7, float par8, float par9) { + TileBrewery brew = (TileBrewery) world.getTileEntity(pos); + + if(player.isSneaking()) { + if(brew.recipe == null && !state.getValue(BotaniaStateProps.POWERED)) + InventoryHelper.withdrawFromInventory(brew, player); } else { - ItemStack stack = par5EntityPlayer.getCurrentEquippedItem(); if(stack != null) - return brew.addItem(par5EntityPlayer, stack); + return brew.addItem(player, stack, hand); } return false; } @Override - public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { - TileSimpleInventory inv = (TileSimpleInventory) par1World.getTileEntity(par2, par3, par4); + public void breakBlock(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state) { + TileSimpleInventory inv = (TileSimpleInventory) world.getTileEntity(pos); - if (inv != null) { - for (int j1 = 0; j1 < inv.getSizeInventory(); ++j1) { - ItemStack itemstack = inv.getStackInSlot(j1); + InventoryHelper.dropInventory(inv, world, state, pos); - if (itemstack != null) { - float f = random.nextFloat() * 0.8F + 0.1F; - float f1 = random.nextFloat() * 0.8F + 0.1F; - EntityItem entityitem; - - for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) { - int k1 = random.nextInt(21) + 10; - - if (k1 > itemstack.stackSize) - k1 = itemstack.stackSize; - - itemstack.stackSize -= k1; - entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage())); - float f3 = 0.05F; - entityitem.motionX = (float)random.nextGaussian() * f3; - entityitem.motionY = (float)random.nextGaussian() * f3 + 0.2F; - entityitem.motionZ = (float)random.nextGaussian() * f3; - - if (itemstack.hasTagCompound()) - entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy()); - } - } - } - - par1World.func_147453_f(par2, par3, par4, par5); - } - - super.breakBlock(par1World, par2, par3, par4, par5, par6); + super.breakBlock(world, pos, state); } @Override - public boolean hasComparatorInputOverride() { + public boolean hasComparatorInputOverride(IBlockState state) { return true; } @Override - public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) { - TileBrewery brew = (TileBrewery) par1World.getTileEntity(par2, par3, par4); + public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) { + TileBrewery brew = (TileBrewery) world.getTileEntity(pos); return brew.signal; } + @Nonnull @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - // NO-OP + public EnumBlockRenderType getRenderType(IBlockState state) { + return EnumBlockRenderType.ENTITYBLOCK_ANIMATED; } @Override - public int getRenderType() { - return LibRenderIDs.idBrewery; - } - - @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public boolean renderAsNormalBlock() { + public boolean isFullCube(IBlockState state) { return false; } @Override - public TileEntity createNewTileEntity(World world, int meta) { + public boolean hasTileEntity(IBlockState state) { + return true; + } + + @Nonnull + @Override + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileBrewery(); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.brewery; } + @SideOnly(Side.CLIENT) @Override - public void renderHUD(Minecraft mc, ScaledResolution res, World world, int x, int y, int z) { - ((TileBrewery) world.getTileEntity(x, y, z)).renderHUD(mc, res); + public void renderHUD(Minecraft mc, ScaledResolution res, World world, BlockPos pos) { + ((TileBrewery) world.getTileEntity(pos)).renderHUD(mc, res); + } + + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelLoader.setCustomStateMapper(this, new StateMap.Builder().ignore(BotaniaStateProps.POWERED).build()); + ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(this), 0, TileBrewery.class); + ModelHandler.registerCustomItemblock(this, "brewery"); } } diff --git a/src/main/java/vazkii/botania/common/block/mana/BlockConjurationCatalyst.java b/src/main/java/vazkii/botania/common/block/mana/BlockConjurationCatalyst.java index 818223a53..d5f030960 100644 --- a/src/main/java/vazkii/botania/common/block/mana/BlockConjurationCatalyst.java +++ b/src/main/java/vazkii/botania/common/block/mana/BlockConjurationCatalyst.java @@ -10,10 +10,15 @@ */ package vazkii.botania.common.block.mana; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.client.core.handler.MiscellaneousIcons; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; @@ -24,7 +29,13 @@ public class BlockConjurationCatalyst extends BlockAlchemyCatalyst { } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.conjurationCatalyst; } + + @Override + @SideOnly(Side.CLIENT) + public TextureAtlasSprite getIcon(World world, BlockPos pos) { + return MiscellaneousIcons.INSTANCE.conjurationCatalystOverlay; + } } diff --git a/src/main/java/vazkii/botania/common/block/mana/BlockDistributor.java b/src/main/java/vazkii/botania/common/block/mana/BlockDistributor.java index f5b8aba15..ac0bc76c6 100644 --- a/src/main/java/vazkii/botania/common/block/mana/BlockDistributor.java +++ b/src/main/java/vazkii/botania/common/block/mana/BlockDistributor.java @@ -10,52 +10,45 @@ */ package vazkii.botania.common.block.mana; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.core.helper.IconHelper; -import vazkii.botania.common.block.BlockModContainer; -import vazkii.botania.common.block.ModBlocks; +import vazkii.botania.common.block.BlockMod; import vazkii.botania.common.block.tile.mana.TileDistributor; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -public class BlockDistributor extends BlockModContainer implements ILexiconable { +import javax.annotation.Nonnull; - IIcon iconSide, iconTop; +public class BlockDistributor extends BlockMod implements ILexiconable { public BlockDistributor() { - super(Material.rock); + super(Material.ROCK, LibBlockNames.DISTRIBUTOR); setHardness(2.0F); setResistance(10.0F); - setStepSound(soundTypeStone); - setBlockName(LibBlockNames.DISTRIBUTOR); + setSoundType(SoundType.STONE); } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - iconTop = IconHelper.forBlock(par1IconRegister, this, 0); - iconSide = IconHelper.forBlock(par1IconRegister, this, 1); + public boolean hasTileEntity(IBlockState state) { + return true; } + @Nonnull @Override - public IIcon getIcon(int par1, int par2) { - return par1 == 0 ? ModBlocks.livingrock.getIcon(0, 0) : par1 == 1 ? iconTop : iconSide; - } - - @Override - public TileEntity createNewTileEntity(World world, int meta) { + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileDistributor(); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.distributor; } diff --git a/src/main/java/vazkii/botania/common/block/mana/BlockEnchanter.java b/src/main/java/vazkii/botania/common/block/mana/BlockEnchanter.java index 2318fc4cb..29bbf50bc 100644 --- a/src/main/java/vazkii/botania/common/block/mana/BlockEnchanter.java +++ b/src/main/java/vazkii/botania/common/block/mana/BlockEnchanter.java @@ -10,13 +10,12 @@ */ package vazkii.botania.common.block.mana; -import java.util.Random; - -import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -25,34 +24,66 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.TextComponentTranslation; import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import net.minecraftforge.items.ItemHandlerHelper; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.api.wand.IWandHUD; import vazkii.botania.api.wand.IWandable; -import vazkii.botania.client.core.helper.IconHelper; -import vazkii.botania.common.block.BlockModContainer; +import vazkii.botania.client.core.handler.ModelHandler; +import vazkii.botania.common.Botania; +import vazkii.botania.common.block.BlockMod; import vazkii.botania.common.block.tile.TileEnchanter; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -public class BlockEnchanter extends BlockModContainer implements IWandable, ILexiconable, IWandHUD { +import javax.annotation.Nonnull; +import java.util.Random; - Random random; - public static IIcon overlay; +public class BlockEnchanter extends BlockMod implements IWandable, ILexiconable, IWandHUD { + + private final Random random = new Random(); public BlockEnchanter() { - super(Material.rock); + super(Material.ROCK, LibBlockNames.ENCHANTER); setHardness(3.0F); setResistance(5.0F); setLightLevel(1.0F); - setStepSound(soundTypeStone); - setBlockName(LibBlockNames.ENCHANTER); + setSoundType(SoundType.STONE); + } - random = new Random(); + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.ENCHANTER_DIRECTION); + } + + @Override + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.ENCHANTER_DIRECTION, EnumFacing.Axis.X); + } + + @Override + public int getMetaFromState(IBlockState state) { + switch (state.getValue(BotaniaStateProps.ENCHANTER_DIRECTION)) { + case Z: return 1; + case X: + default: return 0; + } + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + return getDefaultState().withProperty(BotaniaStateProps.ENCHANTER_DIRECTION, meta == 1 ? EnumFacing.Axis.Z : EnumFacing.Axis.X); } @Override @@ -61,54 +92,55 @@ public class BlockEnchanter extends BlockModContainer implements IWandable, ILex } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - super.registerBlockIcons(par1IconRegister); - overlay = IconHelper.forBlock(par1IconRegister, this, "Overlay"); + public boolean hasTileEntity(IBlockState state) { + return true; } + @Nonnull @Override - public TileEntity createNewTileEntity(World world, int meta) { + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileEnchanter(); } @Override - public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { - return Item.getItemFromBlock(Blocks.lapis_block); + public Item getItemDropped(IBlockState state, Random rand, int fortune) { + return Item.getItemFromBlock(Blocks.LAPIS_BLOCK); } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { - TileEnchanter enchanter = (TileEnchanter) par1World.getTileEntity(par2, par3, par4); - ItemStack stack = par5EntityPlayer.getCurrentEquippedItem(); + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing side, float par7, float par8, float par9) { + TileEnchanter enchanter = (TileEnchanter) world.getTileEntity(pos); if(stack != null && stack.getItem() == ModItems.twigWand) return false; - boolean stackEnchantable = stack != null && stack.getItem() != Items.book && stack.isItemEnchantable() && stack.stackSize == 1 && stack.getItem().getItemEnchantability(stack) > 0; + boolean stackEnchantable = stack != null + && stack.getItem() != Items.BOOK + && stack.isItemEnchantable() + && stack.stackSize == 1; if(enchanter.itemToEnchant == null) { if(stackEnchantable) { enchanter.itemToEnchant = stack.copy(); - par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, null); + player.setHeldItem(hand, null); enchanter.sync(); } - } else if(enchanter.stage == 0) { - if(par5EntityPlayer.inventory.addItemStackToInventory(enchanter.itemToEnchant.copy())) { - enchanter.itemToEnchant = null; - enchanter.sync(); - } else par5EntityPlayer.addChatMessage(new ChatComponentTranslation("botaniamisc.invFull")); + } else if(enchanter.stage == TileEnchanter.State.IDLE) { + ItemHandlerHelper.giveItemToPlayer(player, enchanter.itemToEnchant.copy()); + enchanter.itemToEnchant = null; + enchanter.sync(); } return true; } @Override - public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { - TileEnchanter enchanter = (TileEnchanter) par1World.getTileEntity(par2, par3, par4); + public void breakBlock(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state) { + TileEnchanter enchanter = (TileEnchanter) world.getTileEntity(pos); ItemStack itemstack = enchanter.itemToEnchant; @@ -117,14 +149,14 @@ public class BlockEnchanter extends BlockModContainer implements IWandable, ILex float f1 = random.nextFloat() * 0.8F + 0.1F; EntityItem entityitem; - for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) { + for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; world.spawnEntityInWorld(entityitem)) { int k1 = random.nextInt(21) + 10; if (k1 > itemstack.stackSize) k1 = itemstack.stackSize; itemstack.stackSize -= k1; - entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage())); + entityitem = new EntityItem(world, pos.getX() + f, pos.getY() + f1, pos.getZ() + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage())); float f3 = 0.05F; entityitem.motionX = (float)random.nextGaussian() * f3 * 0.5; entityitem.motionY = (float)random.nextGaussian() * f3 + 0.2F; @@ -135,25 +167,32 @@ public class BlockEnchanter extends BlockModContainer implements IWandable, ILex } } - par1World.func_147453_f(par2, par3, par4, par5); + world.updateComparatorOutputLevel(pos, state.getBlock()); - super.breakBlock(par1World, par2, par3, par4, par5, par6); + super.breakBlock(world, pos, state); } @Override - public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int side) { - ((TileEnchanter) world.getTileEntity(x, y, z)).onWanded(player, stack); + public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, BlockPos pos, EnumFacing side) { + ((TileEnchanter) world.getTileEntity(pos)).onWanded(player, stack); return true; } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.manaEnchanting; } + @SideOnly(Side.CLIENT) @Override - public void renderHUD(Minecraft mc, ScaledResolution res, World world, int x, int y, int z) { - ((TileEnchanter) world.getTileEntity(x, y, z)).renderHUD(mc, res); + public void renderHUD(Minecraft mc, ScaledResolution res, World world, BlockPos pos) { + ((TileEnchanter) world.getTileEntity(pos)).renderHUD(res); + } + + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerBlockToState(this, 0, getDefaultState().withProperty(BotaniaStateProps.ENCHANTER_DIRECTION, EnumFacing.Axis.X)); } } diff --git a/src/main/java/vazkii/botania/common/block/mana/BlockForestDrum.java b/src/main/java/vazkii/botania/common/block/mana/BlockForestDrum.java index 3893d556c..5a2baf649 100644 --- a/src/main/java/vazkii/botania/common/block/mana/BlockForestDrum.java +++ b/src/main/java/vazkii/botania/common/block/mana/BlockForestDrum.java @@ -10,127 +10,144 @@ */ package vazkii.botania.common.block.mana; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.passive.EntityCow; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; +import net.minecraft.init.SoundEvents; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.IShearable; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.internal.IManaBurst; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.mana.IManaTrigger; -import vazkii.botania.client.core.helper.IconHelper; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.DrumVariant; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.block.BlockMod; import vazkii.botania.common.item.ItemGrassHorn; import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.registry.GameRegistry; + +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; public class BlockForestDrum extends BlockMod implements IManaTrigger, ILexiconable { - IIcon iconBases, iconFaces; - IIcon iconBasesA, iconFacesA; - IIcon iconBasesB, iconFacesB; + private static final AxisAlignedBB AABB = new AxisAlignedBB(3/16.0, 0, 3/16.0, 13/16.0, 14/16.0, 13/16.0); public BlockForestDrum() { - super(Material.wood); - float f = 1F / 16F; - setBlockBounds(f * 3, 0F, f * 3, 1F - f * 3, 1F - f * 2, 1F - f * 3); - + super(Material.WOOD, LibBlockNames.FOREST_DRUM); setHardness(2.0F); - setStepSound(soundTypeWood); - setBlockName(LibBlockNames.FOREST_DRUM); + setSoundType(SoundType.WOOD); + } + + @Nonnull + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { + return AABB; + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.DRUM_VARIANT); } @Override - protected boolean shouldRegisterInNameSet() { + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.DRUM_VARIANT, DrumVariant.WILD); + } + + @Override + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.DRUM_VARIANT).ordinal(); + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + if (meta >= DrumVariant.values().length) { + meta = 0; + } + return getDefaultState().withProperty(BotaniaStateProps.DRUM_VARIANT, DrumVariant.values()[meta]); + } + + @Override + public void registerItemForm() { + GameRegistry.register(new ItemBlockWithMetadataAndName(this), getRegistryName()); + } + + @Override + public boolean isFullCube(IBlockState state) { return false; } @Override - public Block setBlockName(String par1Str) { - GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, par1Str); - return super.setBlockName(par1Str); - } - - @Override - public boolean renderAsNormalBlock() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public boolean isOpaqueCube() { - return false; + public int damageDropped(IBlockState state) { + return state.getBlock().getMetaFromState(state); } + @SideOnly(Side.CLIENT) @Override - public int damageDropped(int meta) { - return meta; - } - - @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - iconBases = IconHelper.forBlock(par1IconRegister, this, 0); - iconFaces = IconHelper.forBlock(par1IconRegister, this, 1); - iconBasesA = IconHelper.forBlock(par1IconRegister, this, 2); - iconFacesA = IconHelper.forBlock(par1IconRegister, this, 3); - iconBasesB = IconHelper.forBlock(par1IconRegister, this, 4); - iconFacesB = IconHelper.forBlock(par1IconRegister, this, 5); - } - - @Override - public void getSubBlocks(Item item, CreativeTabs tab, List list) { + public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List list) { for(int i = 0; i < 3; i++) list.add(new ItemStack(item, 1, i)); } @Override - public IIcon getIcon(int side, int meta) { - boolean animal = meta == 1; - boolean tree = meta == 2; - return side < 2 ? animal ? iconBasesA : tree ? iconBasesB : iconBases : animal ? iconFacesA : tree ? iconFacesB : iconFaces; - } - - @Override - public void onBurstCollision(IManaBurst burst, World world, int x, int y, int z) { + public void onBurstCollision(IManaBurst burst, World world, BlockPos pos) { if(burst.isFake()) return; - - if(world.getBlockMetadata(x, y, z) == 0) - ItemGrassHorn.breakGrass(world, null, 0, x, y, z); - else if(world.getBlockMetadata(x, y, z) == 2) - ItemGrassHorn.breakGrass(world, null, 1, x, y, z); - else if(!world.isRemote) { + if(world.isRemote) { + world.spawnParticle(EnumParticleTypes.NOTE, pos.getX() + 0.5, pos.getY() + 1.2, pos.getZ() + 0.5D, 1.0 / 24.0, 0, 0); + return; + } + DrumVariant variant = world.getBlockState(pos).getValue(BotaniaStateProps.DRUM_VARIANT); + if(variant == DrumVariant.WILD) + ItemGrassHorn.breakGrass(world, null, 0, pos); + else if(variant == DrumVariant.CANOPY) + ItemGrassHorn.breakGrass(world, null, 1, pos); + else { int range = 10; - List entities = world.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getBoundingBox(x - range, y - range, z - range, x + range + 1, y + range + 1, z + range + 1)); - List shearables = new ArrayList(); + List entities = world.getEntitiesWithinAABB(EntityLiving.class, new AxisAlignedBB(pos.add(-range, -range, -range), pos.add(range + 1, range + 1, range + 1))); + List shearables = new ArrayList<>(); ItemStack stack = new ItemStack(this, 1, 1); for(EntityLiving entity : entities) { - if(entity instanceof IShearable && ((IShearable) entity).isShearable(stack, world, (int) entity.posX, (int) entity.posY, (int) entity.posZ)) { + if(entity instanceof IShearable && ((IShearable) entity).isShearable(stack, world, new BlockPos(entity))) { shearables.add(entity); } else if(entity instanceof EntityCow) { - List items = world.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(entity.posX, entity.posY, entity.posZ, entity.posX + entity.width, entity.posY + entity.height, entity.posZ + entity.width)); + List items = world.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(entity.posX, entity.posY, entity.posZ, entity.posX + entity.width, entity.posY + entity.height, entity.posZ + entity.width)); for(EntityItem item : items) { ItemStack itemstack = item.getEntityItem(); - if(itemstack != null && itemstack.getItem() == Items.bucket && !world.isRemote) { + if(itemstack != null && itemstack.getItem() == Items.BUCKET && !world.isRemote) { while(itemstack.stackSize > 0) { - EntityItem ent = entity.entityDropItem(new ItemStack(Items.milk_bucket), 1.0F); + EntityItem ent = entity.entityDropItem(new ItemStack(Items.MILK_BUCKET), 1.0F); ent.motionY += world.rand.nextFloat() * 0.05F; ent.motionX += (world.rand.nextFloat() - world.rand.nextFloat()) * 0.1F; ent.motionZ += (world.rand.nextFloat() - world.rand.nextFloat()) * 0.1F; @@ -149,7 +166,7 @@ public class BlockForestDrum extends BlockMod implements IManaTrigger, ILexicona if(sheared > 4) break; - List stacks = ((IShearable) entity).onSheared(stack, world, (int) entity.posX, (int) entity.posY, (int) entity.posZ, 0); + List stacks = ((IShearable) entity).onSheared(stack, world, new BlockPos(entity), 0); if(stacks != null) for(ItemStack wool : stacks) { EntityItem ent = entity.entityDropItem(wool, 1.0F); @@ -161,25 +178,29 @@ public class BlockForestDrum extends BlockMod implements IManaTrigger, ILexicona } } - if(!world.isRemote) - for(int i = 0; i < 10; i++) - world.playSoundEffect(x, y, z, "note.bd", 1F, 1F); - else world.spawnParticle("note", x + 0.5, y + 1.2, z + 0.5D, 1.0 / 24.0, 0, 0); - + for(int i = 0; i < 10; i++) + world.playSound(null, pos, SoundEvents.BLOCK_NOTE_BASEDRUM, SoundCategory.BLOCKS, 1F, 1F); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { - int meta = world.getBlockMetadata(x, y, z); + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { + DrumVariant variant = world.getBlockState(pos).getValue(BotaniaStateProps.DRUM_VARIANT); - switch(meta) { - case 1: + switch(variant) { + case GATHERING: return LexiconData.gatherDrum; - case 2: + case CANOPY: return LexiconData.canopyDrum; + case WILD: default: return LexiconData.forestDrum; } } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerBlockToState(this, DrumVariant.values().length); + } + } diff --git a/src/main/java/vazkii/botania/common/block/mana/BlockManaDetector.java b/src/main/java/vazkii/botania/common/block/mana/BlockManaDetector.java index 2487ce7b4..23696983e 100644 --- a/src/main/java/vazkii/botania/common/block/mana/BlockManaDetector.java +++ b/src/main/java/vazkii/botania/common/block/mana/BlockManaDetector.java @@ -10,76 +10,97 @@ */ package vazkii.botania.common.block.mana; -import java.util.List; - -import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import vazkii.botania.api.internal.IManaBurst; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.core.helper.IconHelper; -import vazkii.botania.common.block.BlockModContainer; +import vazkii.botania.api.mana.IManaCollisionGhost; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.common.block.BlockMod; import vazkii.botania.common.block.tile.mana.TileManaDetector; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -public class BlockManaDetector extends BlockModContainer implements ILexiconable { +import javax.annotation.Nonnull; +import java.util.List; - IIcon[] icons; +public class BlockManaDetector extends BlockMod implements ILexiconable, IManaCollisionGhost { public BlockManaDetector() { - super(Material.rock); + super(Material.ROCK, LibBlockNames.MANA_DETECTOR); setHardness(2.0F); setResistance(10.0F); - setStepSound(Block.soundTypeStone); - setBlockName(LibBlockNames.MANA_DETECTOR); + setSoundType(SoundType.STONE); + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.POWERED); } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - icons = new IIcon[2]; - for(int i = 0; i < icons.length; i++) - icons[i] = IconHelper.forBlock(par1IconRegister, this, i); + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.POWERED, false); } @Override - public IIcon getIcon(int par1, int par2) { - return icons[Math.min(icons.length - 1, par2)]; + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.POWERED) ? 1 : 0; + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + return getDefaultState().withProperty(BotaniaStateProps.POWERED, meta == 1); } @Override - public boolean canProvidePower() { + public boolean canProvidePower(IBlockState state) { return true; } @Override - public int isProvidingWeakPower(IBlockAccess par1iBlockAccess, int par2, int par3, int par4, int par5) { - return par1iBlockAccess.getBlockMetadata(par2, par3, par4) != 0 ? 15 : 0; + public int getWeakPower(IBlockState state, IBlockAccess par1iBlockAccess, BlockPos pos, EnumFacing side) { + return state.getValue(BotaniaStateProps.POWERED) ? 15 : 0; } @Override - public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { + public void addCollisionBoxToList(IBlockState state, @Nonnull World world, @Nonnull BlockPos pos, @Nonnull AxisAlignedBB par5AxisAlignedBB, @Nonnull List stacks, Entity par7Entity) { if(par7Entity != null && !(par7Entity instanceof IManaBurst)) - super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); + super.addCollisionBoxToList(state, world, pos, par5AxisAlignedBB, stacks, par7Entity); } @Override - public TileEntity createNewTileEntity(World world, int meta) { + public boolean hasTileEntity(IBlockState state) { + return true; + } + + @Nonnull + @Override + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileManaDetector(); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.manaDetector; } + @Override + public boolean isGhost(IBlockState state, World world, BlockPos pos) { + return true; + } } diff --git a/src/main/java/vazkii/botania/common/block/mana/BlockManaVoid.java b/src/main/java/vazkii/botania/common/block/mana/BlockManaVoid.java index 622375863..034b3a04a 100644 --- a/src/main/java/vazkii/botania/common/block/mana/BlockManaVoid.java +++ b/src/main/java/vazkii/botania/common/block/mana/BlockManaVoid.java @@ -10,54 +10,57 @@ */ package vazkii.botania.common.block.mana; -import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.mana.IPoolOverlayProvider; -import vazkii.botania.client.core.helper.IconHelper; -import vazkii.botania.common.block.BlockModContainer; +import vazkii.botania.client.core.handler.MiscellaneousIcons; +import vazkii.botania.common.block.BlockMod; import vazkii.botania.common.block.tile.mana.TileManaVoid; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -public class BlockManaVoid extends BlockModContainer implements ILexiconable, IPoolOverlayProvider { +import javax.annotation.Nonnull; - IIcon overlay; +public class BlockManaVoid extends BlockMod implements ILexiconable, IPoolOverlayProvider { public BlockManaVoid() { - super(Material.rock); + super(Material.ROCK, LibBlockNames.MANA_VOID); setHardness(2.0F); setResistance(2000F); - setStepSound(Block.soundTypeStone); - setBlockName(LibBlockNames.MANA_VOID); + setSoundType(SoundType.STONE); } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - blockIcon = IconHelper.forBlock(par1IconRegister, this, 0); - overlay = IconHelper.forBlock(par1IconRegister, this, 1); + public boolean hasTileEntity(IBlockState state) { + return true; } + @Nonnull @Override - public TileEntity createNewTileEntity(World world, int id) { + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileManaVoid(); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.manaVoid; } @Override - public IIcon getIcon(World world, int x, int y, int z) { - return overlay; + @SideOnly(Side.CLIENT) + public TextureAtlasSprite getIcon(World world, BlockPos pos) { + return MiscellaneousIcons.INSTANCE.manaVoidOverlay; } } diff --git a/src/main/java/vazkii/botania/common/block/mana/BlockPool.java b/src/main/java/vazkii/botania/common/block/mana/BlockPool.java index ec1075a37..7dc4ed154 100644 --- a/src/main/java/vazkii/botania/common/block/mana/BlockPool.java +++ b/src/main/java/vazkii/botania/common/block/mana/BlockPool.java @@ -10,173 +10,216 @@ */ package vazkii.botania.common.block.mana; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.renderer.block.statemap.StateMap; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; +import net.minecraft.item.EnumDyeColor; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.stats.Achievement; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.internal.VanillaPacketDispatcher; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.PoolVariant; import vazkii.botania.api.wand.IWandHUD; import vazkii.botania.api.wand.IWandable; -import vazkii.botania.client.core.helper.IconHelper; -import vazkii.botania.client.lib.LibRenderIDs; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.achievement.ICraftAchievement; -import vazkii.botania.common.achievement.IPickupAchievement; import vazkii.botania.common.achievement.ModAchievements; -import vazkii.botania.common.block.BlockModContainer; -import vazkii.botania.common.block.ModBlocks; +import vazkii.botania.common.block.BlockMod; import vazkii.botania.common.block.tile.mana.TilePool; import vazkii.botania.common.item.block.ItemBlockPool; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.registry.GameRegistry; -public class BlockPool extends BlockModContainer implements IWandHUD, IWandable, ILexiconable, ICraftAchievement { +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.List; - boolean lastFragile = false; +public class BlockPool extends BlockMod implements IWandHUD, IWandable, ILexiconable, ICraftAchievement { - public static IIcon manaIcon; + private static final AxisAlignedBB AABB = new AxisAlignedBB(0, 0, 0, 1, 0.5, 1); + + private boolean lastFragile = false; public BlockPool() { - super(Material.rock); + super(Material.ROCK, LibBlockNames.POOL); setHardness(2.0F); setResistance(10.0F); - setStepSound(soundTypeStone); - setBlockName(LibBlockNames.POOL); - setBlockBounds(0F, 0F, 0F, 1F, 0.5F, 1F); - + setSoundType(SoundType.STONE); BotaniaAPI.blacklistBlockFromMagnet(this, Short.MAX_VALUE); } + @Nonnull @Override - protected boolean shouldRegisterInNameSet() { - return false; + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.POOL_VARIANT, BotaniaStateProps.COLOR); } @Override - public Block setBlockName(String par1Str) { - GameRegistry.registerBlock(this, ItemBlockPool.class, par1Str); - return super.setBlockName(par1Str); + protected IBlockState pickDefaultState() { + return blockState.getBaseState() + .withProperty(BotaniaStateProps.POOL_VARIANT, PoolVariant.DEFAULT) + .withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE); } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - manaIcon = IconHelper.forName(par1IconRegister, "manaWater"); + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.POOL_VARIANT).ordinal(); + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + if (meta > PoolVariant.values().length) { + meta = 0; + } + return getDefaultState().withProperty(BotaniaStateProps.POOL_VARIANT, PoolVariant.values()[meta]); + } + + @Nonnull + @Override + public IBlockState getActualState(@Nonnull IBlockState state, IBlockAccess world, BlockPos pos) { + TileEntity te = world.getTileEntity(pos); + if (te instanceof TilePool) { + return state.withProperty(BotaniaStateProps.COLOR, ((TilePool) te).color); + } else { + return state.withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE); + } + } + + @Nonnull + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { + return AABB; } @Override - public int damageDropped(int meta) { - return meta; + public void registerItemForm() { + GameRegistry.register(new ItemBlockPool(this), getRegistryName()); } @Override - public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { - TilePool pool = (TilePool) par1World.getTileEntity(par2, par3, par4); + public int damageDropped(IBlockState state) { + return state.getBlock().getMetaFromState(state); + } + + @Override + public void breakBlock(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state) { + TilePool pool = (TilePool) world.getTileEntity(pos); lastFragile = pool.fragile; - super.breakBlock(par1World, par2, par3, par4, par5, par6); + super.breakBlock(world, pos, state); } + @Nonnull @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList drops = new ArrayList(); + public List getDrops(IBlockAccess world, BlockPos pos, @Nonnull IBlockState state, int fortune) { + ArrayList drops = new ArrayList<>(); if(!lastFragile) - drops.add(new ItemStack(this, 1, metadata)); + drops.add(new ItemStack(this, 1, state.getBlock().getMetaFromState(state))); return drops; } + @SideOnly(Side.CLIENT) @Override - public void getSubBlocks(Item par1, CreativeTabs par2, List par3) { - par3.add(new ItemStack(par1, 1, 0)); - par3.add(new ItemStack(par1, 1, 2)); - par3.add(new ItemStack(par1, 1, 3)); - par3.add(new ItemStack(par1, 1, 1)); + public void getSubBlocks(@Nonnull Item item, CreativeTabs par2, List par3) { + par3.add(new ItemStack(item, 1, 0)); + par3.add(new ItemStack(item, 1, 2)); + par3.add(new ItemStack(item, 1, 3)); + par3.add(new ItemStack(item, 1, 1)); } @Override - public TileEntity createNewTileEntity(World world, int meta) { + public boolean hasTileEntity(IBlockState state) { + return true; + } + + @Nonnull + @Override + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TilePool(); } @Override - public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { + public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity par5Entity) { if(par5Entity instanceof EntityItem) { - TilePool tile = (TilePool) par1World.getTileEntity(par2, par3, par4); + TilePool tile = (TilePool) world.getTileEntity(pos); if(tile.collideEntityItem((EntityItem) par5Entity)) - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(par1World, par2, par3, par4); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos); } } + private static final AxisAlignedBB BOTTOM_AABB = new AxisAlignedBB(0, 0, 0, 1, 1/16.0, 1); + private static final AxisAlignedBB NORTH_AABB = new AxisAlignedBB(0, 0, 15/16.0, 1, 0.5, 1); + private static final AxisAlignedBB SOUTH_AABB = new AxisAlignedBB(0, 0, 0, 1, 0.5, 1/16.0); + private static final AxisAlignedBB WEST_AABB = new AxisAlignedBB(0, 0, 0, 1/16.0, 0.5, 1); + private static final AxisAlignedBB EAST_AABB = new AxisAlignedBB(15/16.0, 0, 0, 1, 0.5, 1); + + @Override - public void addCollisionBoxesToList(World p_149743_1_, int p_149743_2_, int p_149743_3_, int p_149743_4_, AxisAlignedBB p_149743_5_, List p_149743_6_, Entity p_149743_7_) { - float f = 1F / 16F; - setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, f, 1.0F); - super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); - setBlockBounds(0.0F, 0.0F, 0.0F, f, 0.5F, 1.0F); - super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); - setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, f); - super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); - setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); - super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); - setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 0.5F, 1.0F); - super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); - setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); + public void addCollisionBoxToList(IBlockState state, @Nonnull World world, @Nonnull BlockPos pos, @Nonnull AxisAlignedBB entityBox, @Nonnull List boxes, Entity entity) { + addCollisionBoxToList(pos, entityBox, boxes, BOTTOM_AABB); + addCollisionBoxToList(pos, entityBox, boxes, NORTH_AABB); + addCollisionBoxToList(pos, entityBox, boxes, SOUTH_AABB); + addCollisionBoxToList(pos, entityBox, boxes, WEST_AABB); + addCollisionBoxToList(pos, entityBox, boxes, EAST_AABB); } @Override - public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side) { - return side == ForgeDirection.DOWN; + public boolean isSideSolid(IBlockState state, @Nonnull IBlockAccess world, @Nonnull BlockPos pos, EnumFacing side) { + return side == EnumFacing.DOWN; } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public boolean renderAsNormalBlock() { + public boolean isFullCube(IBlockState state) { return false; } + @Nonnull @Override - public IIcon getIcon(int par1, int par2) { - return ModBlocks.livingrock.getIcon(par1, 0); + public EnumBlockRenderType getRenderType(IBlockState state) { + if (state.getValue(BotaniaStateProps.POOL_VARIANT) == PoolVariant.FABULOUS) + return EnumBlockRenderType.ENTITYBLOCK_ANIMATED; + else return EnumBlockRenderType.MODEL; } @Override - public int getRenderType() { - return LibRenderIDs.idPool; - } - - @Override - public boolean hasComparatorInputOverride() { + public boolean hasComparatorInputOverride(IBlockState state) { return true; } @Override - public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) { - TilePool pool = (TilePool) par1World.getTileEntity(par2, par3, par4); + public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) { + TilePool pool = (TilePool) world.getTileEntity(pos); int val = (int) ((double) pool.getCurrentMana() / (double) pool.manaCap * 15.0); if(pool.getCurrentMana() > 0) val = Math.max(val, 1); @@ -185,23 +228,30 @@ public class BlockPool extends BlockModContainer implements IWandHUD, IWandable, } @Override - public void renderHUD(Minecraft mc, ScaledResolution res, World world, int x, int y, int z) { - ((TilePool) world.getTileEntity(x, y, z)).renderHUD(mc, res); + public void renderHUD(Minecraft mc, ScaledResolution res, World world, BlockPos pos) { + ((TilePool) world.getTileEntity(pos)).renderHUD(mc, res); } @Override - public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int side) { - ((TilePool) world.getTileEntity(x, y, z)).onWanded(player, stack); + public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, BlockPos pos, EnumFacing side) { + ((TilePool) world.getTileEntity(pos)).onWanded(player, stack); return true; } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { - return world.getBlockMetadata(x, y, z) == 3 ? LexiconData.rainbowRod : LexiconData.pool; + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { + return world.getBlockState(pos).getValue(BotaniaStateProps.POOL_VARIANT) == PoolVariant.FABULOUS ? LexiconData.rainbowRod : LexiconData.pool; } @Override public Achievement getAchievementOnCraft(ItemStack stack, EntityPlayer player, IInventory matrix) { return ModAchievements.manaPoolPickup; } + + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelLoader.setCustomStateMapper(this, (new StateMap.Builder()).ignore(BotaniaStateProps.COLOR).build()); + ModelHandler.registerBlockToState(this, PoolVariant.values().length); + } } diff --git a/src/main/java/vazkii/botania/common/block/mana/BlockPrism.java b/src/main/java/vazkii/botania/common/block/mana/BlockPrism.java index 0748d9321..a5b179e92 100644 --- a/src/main/java/vazkii/botania/common/block/mana/BlockPrism.java +++ b/src/main/java/vazkii/botania/common/block/mana/BlockPrism.java @@ -10,182 +10,185 @@ */ package vazkii.botania.common.block.mana; -import java.util.Random; - import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.IIcon; +import net.minecraft.util.BlockRenderLayer; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.internal.IManaBurst; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.mana.ILens; +import vazkii.botania.api.mana.IManaCollisionGhost; import vazkii.botania.api.mana.IManaTrigger; -import vazkii.botania.client.core.helper.IconHelper; -import vazkii.botania.common.block.BlockModContainer; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.common.block.BlockMod; import vazkii.botania.common.block.tile.TileSimpleInventory; import vazkii.botania.common.block.tile.mana.TilePrism; +import vazkii.botania.common.core.helper.InventoryHelper; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -public class BlockPrism extends BlockModContainer implements IManaTrigger, ILexiconable { +import javax.annotation.Nonnull; +import java.util.Random; - Random random; - IIcon[] icons; +public class BlockPrism extends BlockMod implements IManaTrigger, ILexiconable, IManaCollisionGhost { + + private static final AxisAlignedBB AABB = new AxisAlignedBB(0.25, 0, 0.25, 0.75, 1, 0.75); + + private final Random random = new Random(); public BlockPrism() { - super(Material.glass); + super(Material.GLASS, LibBlockNames.PRISM); setHardness(0.3F); - setStepSound(soundTypeGlass); + setSoundType(SoundType.GLASS); setLightLevel(1.0F); - setBlockName(LibBlockNames.PRISM); - float f = 0.25F; - setBlockBounds(f, 0F, f, 1F - f, 1F, 1F - f); + } - random = new Random(); + @Nonnull + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { + return AABB; + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.POWERED, BotaniaStateProps.HAS_LENS); } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - icons = new IIcon[2]; - for(int i = 0; i < icons.length; i++) - icons[i] = IconHelper.forBlock(par1IconRegister, this, i); + protected IBlockState pickDefaultState() { + return blockState.getBaseState() + .withProperty(BotaniaStateProps.POWERED, false) + .withProperty(BotaniaStateProps.HAS_LENS, false); } @Override - public IIcon getIcon(int side, int meta) { - return side > 1 ? icons[1] : icons[0]; + public int getMetaFromState(IBlockState state) { + return (state.getValue(BotaniaStateProps.POWERED) ? 8 : 0) + + (state.getValue(BotaniaStateProps.HAS_LENS) ? 1 : 0); + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + return getDefaultState().withProperty(BotaniaStateProps.POWERED, (meta & 8) > 0) + .withProperty(BotaniaStateProps.HAS_LENS, (meta & 1) > 0); + } + + @Nonnull + @Override + @SideOnly(Side.CLIENT) + public BlockRenderLayer getBlockLayer() { + return BlockRenderLayer.TRANSLUCENT; } @Override - public int getRenderBlockPass() { - return 1; + public AxisAlignedBB getCollisionBoundingBox(IBlockState state, @Nonnull World world, @Nonnull BlockPos pos) { + return NULL_AABB; } @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { - return null; - } - - @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public boolean renderAsNormalBlock() { + public boolean isFullCube(IBlockState state) { return false; } @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { - TileEntity tile = par1World.getTileEntity(par2, par3, par4); + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float par7, float par8, float par9) { + TileEntity tile = world.getTileEntity(pos); if(!(tile instanceof TilePrism)) return false; TilePrism prism = (TilePrism) tile; - ItemStack lens = prism.getStackInSlot(0); - ItemStack heldItem = par5EntityPlayer.getCurrentEquippedItem(); + ItemStack lens = prism.getItemHandler().getStackInSlot(0); boolean isHeldItemLens = heldItem != null && heldItem.getItem() instanceof ILens; - int meta = par1World.getBlockMetadata(par2, par3, par4); if(lens == null && isHeldItemLens) { - if(!par5EntityPlayer.capabilities.isCreativeMode) - par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, null); + if(!player.capabilities.isCreativeMode) + player.setHeldItem(hand, null); - prism.setInventorySlotContents(0, heldItem.copy()); + prism.getItemHandler().setStackInSlot(0, heldItem.copy()); prism.markDirty(); - par1World.setBlockMetadataWithNotify(par2, par3, par4, meta | 1, 1 | 2); + world.setBlockState(pos, state.withProperty(BotaniaStateProps.HAS_LENS, true), 1 | 2); } else if(lens != null) { ItemStack add = lens.copy(); - if(!par5EntityPlayer.inventory.addItemStackToInventory(add)) - par5EntityPlayer.dropPlayerItemWithRandomChoice(add, false); - prism.setInventorySlotContents(0, null); + if(!player.inventory.addItemStackToInventory(add)) + player.dropItem(add, false); + prism.getItemHandler().setStackInSlot(0, null); prism.markDirty(); - par1World.setBlockMetadataWithNotify(par2, par3, par4, meta & 14, 1 | 2); + world.setBlockState(pos, state.withProperty(BotaniaStateProps.HAS_LENS, false), 1 | 2); } return true; } @Override - public void onNeighborBlockChange(World world, int x, int y, int z, Block block) { - boolean power = world.isBlockIndirectlyGettingPowered(x, y, z) || world.isBlockIndirectlyGettingPowered(x, y + 1, z); - int meta = world.getBlockMetadata(x, y, z); - boolean powered = (meta & 8) != 0; + public void neighborChanged(IBlockState state, World world, BlockPos pos, Block block) { + boolean power = world.isBlockIndirectlyGettingPowered(pos) > 0 || world.isBlockIndirectlyGettingPowered(pos.up()) > 0; + boolean powered = state.getValue(BotaniaStateProps.POWERED); if(!world.isRemote) { if(power && !powered) - world.setBlockMetadataWithNotify(x, y, z, meta | 8, 1 | 2); + world.setBlockState(pos, state.withProperty(BotaniaStateProps.POWERED, true), 1 | 2); else if(!power && powered) - world.setBlockMetadataWithNotify(x, y, z, meta & -9, 1 | 2); + world.setBlockState(pos, state.withProperty(BotaniaStateProps.POWERED, false), 1 | 2); } } @Override - public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { - TileEntity tile = par1World.getTileEntity(par2, par3, par4); - if(!(tile instanceof TileSimpleInventory)) - return; + public void breakBlock(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state) { + TileSimpleInventory inv = (TileSimpleInventory) world.getTileEntity(pos); - TileSimpleInventory inv = (TileSimpleInventory) tile; + InventoryHelper.dropInventory(inv, world, state, pos); - if (inv != null) { - for (int j1 = 0; j1 < inv.getSizeInventory(); ++j1) { - ItemStack itemstack = inv.getStackInSlot(j1); - - if (itemstack != null) { - float f = random.nextFloat() * 0.8F + 0.1F; - float f1 = random.nextFloat() * 0.8F + 0.1F; - EntityItem entityitem; - - for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) { - int k1 = random.nextInt(21) + 10; - - if (k1 > itemstack.stackSize) - k1 = itemstack.stackSize; - - itemstack.stackSize -= k1; - entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage())); - float f3 = 0.05F; - entityitem.motionX = (float)random.nextGaussian() * f3; - entityitem.motionY = (float)random.nextGaussian() * f3 + 0.2F; - entityitem.motionZ = (float)random.nextGaussian() * f3; - - if (itemstack.hasTagCompound()) - entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy()); - } - } - } - - par1World.func_147453_f(par2, par3, par4, par5); - } - - super.breakBlock(par1World, par2, par3, par4, par5, par6); + super.breakBlock(world, pos, state); } @Override - public TileEntity createNewTileEntity(World world, int meta) { + public boolean hasTileEntity(IBlockState state) { + return true; + } + + @Nonnull + @Override + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TilePrism(); } @Override - public void onBurstCollision(IManaBurst burst, World world, int x, int y, int z) { - TileEntity tile = world.getTileEntity(x, y, z); + public void onBurstCollision(IManaBurst burst, World world, BlockPos pos) { + TileEntity tile = world.getTileEntity(pos); if(tile != null && tile instanceof TilePrism) ((TilePrism) tile).onBurstCollision(burst); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.prism; } + @Override + public boolean isGhost(IBlockState state, World world, BlockPos pos) { + return true; + } } diff --git a/src/main/java/vazkii/botania/common/block/mana/BlockPump.java b/src/main/java/vazkii/botania/common/block/mana/BlockPump.java index aa4a4c6e6..b7c991353 100644 --- a/src/main/java/vazkii/botania/common/block/mana/BlockPump.java +++ b/src/main/java/vazkii/botania/common/block/mana/BlockPump.java @@ -10,105 +10,134 @@ */ package vazkii.botania.common.block.mana; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.common.util.RotationHelper; +import net.minecraftforge.common.property.ExtendedBlockState; +import net.minecraftforge.common.property.IUnlistedProperty; +import net.minecraftforge.common.property.Properties; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.common.block.BlockModContainer; -import vazkii.botania.common.block.ModBlocks; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.client.core.handler.ModelHandler; +import vazkii.botania.common.block.BlockMod; import vazkii.botania.common.block.tile.mana.TilePump; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -public class BlockPump extends BlockModContainer implements ILexiconable { +import javax.annotation.Nonnull; - private static final int[] META_ROTATIONS = new int[] { 2, 5, 3, 4 }; +public class BlockPump extends BlockMod implements ILexiconable { + + private static final AxisAlignedBB X_AABB = new AxisAlignedBB(0, 0, 0.25, 1, 0.5, 0.75); + private static final AxisAlignedBB Z_AABB = new AxisAlignedBB(0.25, 0, 0, 0.75, 0.5, 1); public BlockPump() { - super(Material.rock); + super(Material.ROCK, LibBlockNames.PUMP); setHardness(2.0F); setResistance(10.0F); - setStepSound(soundTypeStone); - setBlockName(LibBlockNames.PUMP); - setBlockBounds(true); + setSoundType(SoundType.STONE); + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new ExtendedBlockState(this, new IProperty[] { BotaniaStateProps.CARDINALS, Properties.StaticProperty }, new IUnlistedProperty[] { Properties.AnimationProperty }); } @Override - public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) { - int l = MathHelper.floor_double(p_149689_5_.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; - p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, META_ROTATIONS[l], 2); + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(Properties.StaticProperty, true).withProperty(BotaniaStateProps.CARDINALS, EnumFacing.SOUTH); } @Override - public void setBlockBoundsBasedOnState(IBlockAccess w, int x, int y, int z) { - setBlockBounds(w.getBlockMetadata(x, y, z) < 4); + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.CARDINALS).getIndex(); } - public void setBlockBounds(boolean horiz) { - if(horiz) - setBlockBounds(0.25F, 0F, 0F, 0.75F, 0.5F, 1F); - else setBlockBounds(0F, 0F, 0.25F, 1F, 0.5F, 0.75F); + @Nonnull + @Override + public IBlockState getActualState(@Nonnull IBlockState state, IBlockAccess world, BlockPos pos) { + return state.withProperty(Properties.StaticProperty, true); + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + if (meta < 2 || meta > 5) { + meta = 2; + } + return getDefaultState().withProperty(BotaniaStateProps.CARDINALS, EnumFacing.getFront(meta)); } @Override - public boolean rotateBlock(World worldObj, int x, int y, int z, ForgeDirection axis) { - return RotationHelper.rotateVanillaBlock(Blocks.furnace, worldObj, x, y, z, axis); + public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { + world.setBlockState(pos, state.withProperty(BotaniaStateProps.CARDINALS, placer.getHorizontalFacing().getOpposite()), 2); + } + + @Nonnull + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { + if(state.getValue(BotaniaStateProps.CARDINALS).getAxis() == EnumFacing.Axis.X) { + return X_AABB; + } else { + return Z_AABB; + } } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - // NO-OP - } - - @Override - public IIcon getIcon(int par1, int par2) { - return ModBlocks.livingrock.getIcon(0, 0); - } - - @Override - public int getRenderType() { - return LibRenderIDs.idPump; - } - - @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public boolean renderAsNormalBlock() { + public boolean isFullCube(IBlockState state) { return false; } @Override - public boolean hasComparatorInputOverride() { + public boolean hasComparatorInputOverride(IBlockState state) { return true; } @Override - public int getComparatorInputOverride(World world, int x, int y, int z, int side) { - return ((TilePump) world.getTileEntity(x, y, z)).comparator; + public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) { + return ((TilePump) world.getTileEntity(pos)).comparator; } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.poolCart; } + @Override - public TileEntity createNewTileEntity(World world, int meta) { + public boolean hasTileEntity(IBlockState state) { + return true; + } + + @Nonnull + @Override + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TilePump(); } + + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerInventoryVariant(this); + } } diff --git a/src/main/java/vazkii/botania/common/block/mana/BlockRFGenerator.java b/src/main/java/vazkii/botania/common/block/mana/BlockRFGenerator.java index 79e7e35db..1231ccf6f 100644 --- a/src/main/java/vazkii/botania/common/block/mana/BlockRFGenerator.java +++ b/src/main/java/vazkii/botania/common/block/mana/BlockRFGenerator.java @@ -10,45 +10,55 @@ */ package vazkii.botania.common.block.mana; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.fml.common.Optional; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.common.block.BlockModContainer; +import vazkii.botania.common.block.BlockMod; import vazkii.botania.common.block.tile.mana.TileRFGenerator; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.Optional; -public class BlockRFGenerator extends BlockModContainer implements ILexiconable { +import javax.annotation.Nonnull; + +public class BlockRFGenerator extends BlockMod implements ILexiconable { public BlockRFGenerator() { - super(Material.rock); + super(Material.ROCK, LibBlockNames.RF_GENERATOR); setHardness(2.0F); setResistance(10.0F); - setStepSound(soundTypeStone); - setBlockName(LibBlockNames.RF_GENERATOR); + setSoundType(SoundType.STONE); } @Override @Optional.Method(modid = "CoFHAPI|energy") - public void onNeighborChange(IBlockAccess world, int x, int y, int z, int tileX, int tileY, int tileZ) { - TileEntity tile = world.getTileEntity(x, y, z); + public void onNeighborChange(IBlockAccess world, BlockPos pos, BlockPos tilePos) { + TileEntity tile = world.getTileEntity(pos); if(tile != null && tile instanceof TileRFGenerator) - ((TileRFGenerator) tile).onNeighborTileChange(tileX, tileY, tileZ); + ((TileRFGenerator) tile).onNeighborTileChange(tilePos); } @Override - public TileEntity createNewTileEntity(World world, int meta) { + public boolean hasTileEntity(IBlockState state) { + return true; + } + + @Nonnull + @Override + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileRFGenerator(); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.rfGenerator; } diff --git a/src/main/java/vazkii/botania/common/block/mana/BlockRuneAltar.java b/src/main/java/vazkii/botania/common/block/mana/BlockRuneAltar.java index 23ef4ef8e..246a0a43a 100644 --- a/src/main/java/vazkii/botania/common/block/mana/BlockRuneAltar.java +++ b/src/main/java/vazkii/botania/common/block/mana/BlockRuneAltar.java @@ -10,156 +10,126 @@ */ package vazkii.botania.common.block.mana; -import java.util.Random; - -import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import vazkii.botania.api.BotaniaAPI; +import vazkii.botania.api.internal.VanillaPacketDispatcher; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.wand.IWandable; -import vazkii.botania.client.core.helper.IconHelper; -import vazkii.botania.common.block.BlockModContainer; +import vazkii.botania.common.block.BlockMod; import vazkii.botania.common.block.tile.TileRuneAltar; import vazkii.botania.common.block.tile.TileSimpleInventory; +import vazkii.botania.common.core.helper.InventoryHelper; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -public class BlockRuneAltar extends BlockModContainer implements IWandable, ILexiconable { +import javax.annotation.Nonnull; +import java.util.Random; - Random random; - IIcon[] icons; +public class BlockRuneAltar extends BlockMod implements IWandable, ILexiconable { + + private static final AxisAlignedBB AABB = new AxisAlignedBB(0, 0, 0, 1, 0.75, 1); public BlockRuneAltar() { - super(Material.rock); - setBlockBounds(0F, 0F, 0F, 1F, 0.75F, 1F); + super(Material.ROCK, LibBlockNames.RUNE_ALTAR); setHardness(2.0F); setResistance(10.0F); - setStepSound(soundTypeStone); - setBlockName(LibBlockNames.RUNE_ALTAR); - + setSoundType(SoundType.STONE); BotaniaAPI.blacklistBlockFromMagnet(this, Short.MAX_VALUE); + } - random = new Random(); + @Nonnull + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { + return AABB; } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public boolean renderAsNormalBlock() { + public boolean isFullCube(IBlockState state) { return false; } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - icons = new IIcon[3]; - for(int i = 0; i < icons.length; i++) - icons[i] = IconHelper.forBlock(par1IconRegister, this, i); - } + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing side, float par7, float par8, float par9) { + if(world.isRemote) + return true; - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { - TileRuneAltar altar = (TileRuneAltar) par1World.getTileEntity(par2, par3, par4); - ItemStack stack = par5EntityPlayer.getCurrentEquippedItem(); + TileRuneAltar altar = (TileRuneAltar) world.getTileEntity(pos); - if(par5EntityPlayer.isSneaking()) { - if(altar.manaToGet == 0) - for(int i = altar.getSizeInventory() - 1; i >= 0; i--) { - ItemStack stackAt = altar.getStackInSlot(i); - if(stackAt != null) { - ItemStack copy = stackAt.copy(); - if(!par5EntityPlayer.inventory.addItemStackToInventory(copy)) - par5EntityPlayer.dropPlayerItemWithRandomChoice(copy, false); - altar.setInventorySlotContents(i, null); - par1World.func_147453_f(par2, par3, par4, this); - break; - } - } - } else if(altar.isEmpty() && stack == null) - altar.trySetLastRecipe(par5EntityPlayer); - else if(stack != null) - return altar.addItem(par5EntityPlayer, stack); - return false; - } - - @Override - public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { - TileSimpleInventory inv = (TileSimpleInventory) par1World.getTileEntity(par2, par3, par4); - - if (inv != null) { - for (int j1 = 0; j1 < inv.getSizeInventory(); ++j1) { - ItemStack itemstack = inv.getStackInSlot(j1); - - if (itemstack != null) { - float f = random.nextFloat() * 0.8F + 0.1F; - float f1 = random.nextFloat() * 0.8F + 0.1F; - EntityItem entityitem; - - for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) { - int k1 = random.nextInt(21) + 10; - - if (k1 > itemstack.stackSize) - k1 = itemstack.stackSize; - - itemstack.stackSize -= k1; - entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage())); - float f3 = 0.05F; - entityitem.motionX = (float)random.nextGaussian() * f3; - entityitem.motionY = (float)random.nextGaussian() * f3 + 0.2F; - entityitem.motionZ = (float)random.nextGaussian() * f3; - - if (itemstack.hasTagCompound()) - entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy()); - } - } + if(player.isSneaking()) { + if(altar.manaToGet == 0) { + InventoryHelper.withdrawFromInventory(altar, player); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(altar); } - - par1World.func_147453_f(par2, par3, par4, par5); + } else if(altar.isEmpty() && stack == null) { + altar.trySetLastRecipe(player); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(altar); + } else if(stack != null) { + boolean result = altar.addItem(player, stack, hand); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(altar); + return result; } - super.breakBlock(par1World, par2, par3, par4, par5, par6); + return false; } @Override - public IIcon getIcon(int par1, int par2) { - return icons[Math.min(2, par1)]; + public void breakBlock(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state) { + TileSimpleInventory inv = (TileSimpleInventory) world.getTileEntity(pos); + + InventoryHelper.dropInventory(inv, world, state, pos); + + super.breakBlock(world, pos, state); } @Override - public TileEntity createNewTileEntity(World world, int meta) { + public boolean hasTileEntity(IBlockState state) { + return true; + } + + @Nonnull + @Override + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileRuneAltar(); } @Override - public boolean hasComparatorInputOverride() { + public boolean hasComparatorInputOverride(IBlockState state) { return true; } @Override - public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) { - TileRuneAltar altar = (TileRuneAltar) par1World.getTileEntity(par2, par3, par4); + public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) { + TileRuneAltar altar = (TileRuneAltar) world.getTileEntity(pos); return altar.signal; } @Override - public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int side) { - ((TileRuneAltar) world.getTileEntity(x, y, z)).onWanded(player, stack); + public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, BlockPos pos, EnumFacing side) { + ((TileRuneAltar) world.getTileEntity(pos)).onWanded(player, stack); return true; } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.runicAltar; } diff --git a/src/main/java/vazkii/botania/common/block/mana/BlockSpawnerClaw.java b/src/main/java/vazkii/botania/common/block/mana/BlockSpawnerClaw.java index c21a20fb5..02b3a1286 100644 --- a/src/main/java/vazkii/botania/common/block/mana/BlockSpawnerClaw.java +++ b/src/main/java/vazkii/botania/common/block/mana/BlockSpawnerClaw.java @@ -10,70 +10,72 @@ */ package vazkii.botania.common.block.mana; -import java.util.List; - import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.common.block.BlockModContainer; +import vazkii.botania.common.block.BlockMod; import vazkii.botania.common.block.tile.TileSpawnerClaw; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -public class BlockSpawnerClaw extends BlockModContainer implements ILexiconable { +import javax.annotation.Nonnull; +import java.util.List; + +public class BlockSpawnerClaw extends BlockMod implements ILexiconable { + + private static final AxisAlignedBB AABB = new AxisAlignedBB(0.125, 0, 0.125, 0.875, 1/16.0, 0.875); public BlockSpawnerClaw() { - super(Material.iron); + super(Material.IRON, LibBlockNames.SPAWNER_CLAW); setHardness(3.0F); - setBlockName(LibBlockNames.SPAWNER_CLAW); + } - float f = 1F / 8F; - float f1 = 1F / 16F; - setBlockBounds(f, 0F, f, 1F - f, f1, 1F - f); + @Nonnull + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { + return AABB; } @Override - public void getSubBlocks(Item item, CreativeTabs tab, List list) { + public void getSubBlocks(@Nonnull Item item, CreativeTabs tab, List list) { list.add(new ItemStack(item)); - list.add(new ItemStack(Blocks.mob_spawner)); + list.add(new ItemStack(Blocks.MOB_SPAWNER)); } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - //NO-OP - } - - @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public boolean renderAsNormalBlock() { + public boolean isFullCube(IBlockState state) { return false; } @Override - public int getRenderType() { - return LibRenderIDs.idSpawnerClaw; + public boolean hasTileEntity(IBlockState state) { + return true; } + @Nonnull @Override - public TileEntity createNewTileEntity(World world, int meta) { + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileSpawnerClaw(); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.spawnerClaw; } diff --git a/src/main/java/vazkii/botania/common/block/mana/BlockSpreader.java b/src/main/java/vazkii/botania/common/block/mana/BlockSpreader.java index 8227d736f..92f43e538 100644 --- a/src/main/java/vazkii/botania/common/block/mana/BlockSpreader.java +++ b/src/main/java/vazkii/botania/common/block/mana/BlockSpreader.java @@ -10,98 +10,114 @@ */ package vazkii.botania.common.block.mana; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; import net.minecraft.block.BlockPistonBase; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.mana.ILens; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.SpreaderVariant; import vazkii.botania.api.wand.IWandHUD; import vazkii.botania.api.wand.IWandable; import vazkii.botania.api.wand.IWireframeAABBProvider; -import vazkii.botania.client.lib.LibRenderIDs; -import vazkii.botania.common.block.BlockModContainer; -import vazkii.botania.common.block.ModBlocks; +import vazkii.botania.client.core.handler.ModelHandler; +import vazkii.botania.common.block.BlockMod; import vazkii.botania.common.block.tile.mana.TileSpreader; +import vazkii.botania.common.core.helper.InventoryHelper; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.registry.GameRegistry; -public class BlockSpreader extends BlockModContainer implements IWandable, IWandHUD, ILexiconable, IWireframeAABBProvider { +import javax.annotation.Nonnull; +import java.util.List; - Random random; +public class BlockSpreader extends BlockMod implements IWandable, IWandHUD, ILexiconable, IWireframeAABBProvider { public BlockSpreader() { - super(Material.wood); + super(Material.WOOD, LibBlockNames.SPREADER); setHardness(2.0F); - setStepSound(soundTypeWood); - setBlockName(LibBlockNames.SPREADER); + setSoundType(SoundType.WOOD); + } - random = new Random(); + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.SPREADER_VARIANT); } @Override - protected boolean shouldRegisterInNameSet() { - return false; + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.SPREADER_VARIANT, SpreaderVariant.MANA); } @Override - public Block setBlockName(String par1Str) { - GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, par1Str); - return super.setBlockName(par1Str); + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.SPREADER_VARIANT).ordinal(); + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + if (meta > SpreaderVariant.values().length) { + meta = 0; + } + return getDefaultState().withProperty(BotaniaStateProps.SPREADER_VARIANT, SpreaderVariant.values()[meta]); } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - // NO-OP + public void registerItemForm() { + GameRegistry.register(new ItemBlockWithMetadataAndName(this), getRegistryName()); } + @SideOnly(Side.CLIENT) @Override - public void getSubBlocks(Item par1, CreativeTabs par2, List par3) { + public void getSubBlocks(@Nonnull Item item, CreativeTabs par2, List par3) { for(int i = 0; i < 4; i++) - par3.add(new ItemStack(par1, 1, i)); + par3.add(new ItemStack(item, 1, i)); } @Override - public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { - int orientation = BlockPistonBase.determineOrientation(par1World, par2, par3, par4, par5EntityLivingBase); - TileSpreader spreader = (TileSpreader) par1World.getTileEntity(par2, par3, par4); - par1World.setBlockMetadataWithNotify(par2, par3, par4, par6ItemStack.getItemDamage(), 1 | 2); + public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { + EnumFacing orientation = BlockPistonBase.getFacingFromEntity(pos, par5EntityLivingBase); + TileSpreader spreader = (TileSpreader) world.getTileEntity(pos); + world.setBlockState(pos, getStateFromMeta(par6ItemStack.getItemDamage()), 1 | 2); switch(orientation) { - case 0: + case DOWN: spreader.rotationY = -90F; break; - case 1: + case UP: spreader.rotationY = 90F; break; - case 2: + case NORTH: spreader.rotationX = 270F; break; - case 3: + case SOUTH: spreader.rotationX = 90F; break; - case 4: + case WEST: break; default: spreader.rotationX = 180F; @@ -110,57 +126,52 @@ public class BlockSpreader extends BlockModContainer implements IWandable, IWand } @Override - public int damageDropped(int par1) { - return par1; + public int damageDropped(IBlockState par1) { + return getMetaFromState(par1); } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public boolean renderAsNormalBlock() { + public boolean isFullCube(IBlockState state) { return false; } + @Nonnull @Override - public IIcon getIcon(int par1, int par2) { - return par2 >= 2 ? ModBlocks.dreamwood.getIcon(par1, 0) : ModBlocks.livingwood.getIcon(par1, 0); + public EnumBlockRenderType getRenderType(IBlockState state) { + return EnumBlockRenderType.ENTITYBLOCK_ANIMATED; } @Override - public int getRenderType() { - return LibRenderIDs.idSpreader; - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { - TileEntity tile = par1World.getTileEntity(par2, par3, par4); + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing par6, float par7, float par8, float par9) { + TileEntity tile = world.getTileEntity(pos); if(!(tile instanceof TileSpreader)) return false; TileSpreader spreader = (TileSpreader) tile; - ItemStack lens = spreader.getStackInSlot(0); - ItemStack heldItem = par5EntityPlayer.getCurrentEquippedItem(); + ItemStack lens = spreader.getItemHandler().getStackInSlot(0); boolean isHeldItemLens = heldItem != null && heldItem.getItem() instanceof ILens; - boolean wool = heldItem != null && heldItem.getItem() == Item.getItemFromBlock(Blocks.wool); + boolean wool = heldItem != null && heldItem.getItem() == Item.getItemFromBlock(Blocks.WOOL); if(heldItem != null) if(heldItem.getItem() == ModItems.twigWand) return false; if(lens == null && isHeldItemLens) { - if (!par5EntityPlayer.capabilities.isCreativeMode) - par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, null); + if (!player.capabilities.isCreativeMode) + player.setHeldItem(hand, null); - spreader.setInventorySlotContents(0, heldItem.copy()); + spreader.getItemHandler().setStackInSlot(0, heldItem.copy()); spreader.markDirty(); } else if(lens != null && !wool) { ItemStack add = lens.copy(); - if(!par5EntityPlayer.inventory.addItemStackToInventory(add)) - par5EntityPlayer.dropPlayerItemWithRandomChoice(add, false); - spreader.setInventorySlotContents(0, null); + if(!player.inventory.addItemStackToInventory(add)) + player.dropItem(add, false); + spreader.getItemHandler().setStackInSlot(0, null); spreader.markDirty(); } @@ -168,11 +179,11 @@ public class BlockSpreader extends BlockModContainer implements IWandable, IWand spreader.paddingColor = heldItem.getItemDamage(); heldItem.stackSize--; if(heldItem.stackSize == 0) - par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, null); + player.setHeldItem(hand, null); } else if(heldItem == null && spreader.paddingColor != -1 && lens == null) { - ItemStack pad = new ItemStack(Blocks.wool, 1, spreader.paddingColor); - if(!par5EntityPlayer.inventory.addItemStackToInventory(pad)) - par5EntityPlayer.dropPlayerItemWithRandomChoice(pad, false); + ItemStack pad = new ItemStack(Blocks.WOOL, 1, spreader.paddingColor); + if(!player.inventory.addItemStackToInventory(pad)) + player.dropItem(pad, false); spreader.paddingColor = -1; spreader.markDirty(); } @@ -181,73 +192,59 @@ public class BlockSpreader extends BlockModContainer implements IWandable, IWand } @Override - public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { - TileEntity tile = par1World.getTileEntity(par2, par3, par4); + public void breakBlock(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state) { + TileEntity tile = world.getTileEntity(pos); if(!(tile instanceof TileSpreader)) return; TileSpreader inv = (TileSpreader) tile; - if (inv != null) { - for (int j1 = 0; j1 < inv.getSizeInventory() + 1; ++j1) { - ItemStack itemstack = j1 >= inv.getSizeInventory() ? inv.paddingColor == -1 ? null : new ItemStack(Blocks.wool, 1, inv.paddingColor) : inv.getStackInSlot(j1); - - if(itemstack != null) { - float f = random.nextFloat() * 0.8F + 0.1F; - float f1 = random.nextFloat() * 0.8F + 0.1F; - EntityItem entityitem; - - for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) { - int k1 = random.nextInt(21) + 10; - - if (k1 > itemstack.stackSize) - k1 = itemstack.stackSize; - - itemstack.stackSize -= k1; - entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage())); - float f3 = 0.05F; - entityitem.motionX = (float)random.nextGaussian() * f3; - entityitem.motionY = (float)random.nextGaussian() * f3 + 0.2F; - entityitem.motionZ = (float)random.nextGaussian() * f3; - - if (itemstack.hasTagCompound()) - entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy()); - } - } - } - - par1World.func_147453_f(par2, par3, par4, par5); + if(inv.paddingColor != -1) { + net.minecraft.inventory.InventoryHelper.spawnItemStack(world, pos.getX(), pos.getY(), pos.getZ(), new ItemStack(Blocks.WOOL, 1, inv.paddingColor)); } - super.breakBlock(par1World, par2, par3, par4, par5, par6); + InventoryHelper.dropInventory(inv, world, state, pos); + + super.breakBlock(world, pos, state); } @Override - public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int side) { - ((TileSpreader) world.getTileEntity(x, y, z)).onWanded(player, stack); + public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, BlockPos pos, EnumFacing side) { + ((TileSpreader) world.getTileEntity(pos)).onWanded(player, stack); return true; } @Override - public TileEntity createNewTileEntity(World world, int meta) { + public boolean hasTileEntity(IBlockState state) { + return true; + } + + @Nonnull + @Override + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileSpreader(); } @Override - public void renderHUD(Minecraft mc, ScaledResolution res, World world, int x, int y, int z) { - ((TileSpreader) world.getTileEntity(x, y, z)).renderHUD(mc, res); + public void renderHUD(Minecraft mc, ScaledResolution res, World world, BlockPos pos) { + ((TileSpreader) world.getTileEntity(pos)).renderHUD(mc, res); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { - int meta = world.getBlockMetadata(x, y, z); - return meta == 0 ? LexiconData.spreader : meta == 1 ? LexiconData.redstoneSpreader : LexiconData.dreamwoodSpreader; + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { + SpreaderVariant variant = world.getBlockState(pos).getValue(BotaniaStateProps.SPREADER_VARIANT); + return variant == SpreaderVariant.MANA ? LexiconData.spreader : variant == SpreaderVariant.REDSTONE ? LexiconData.redstoneSpreader : LexiconData.dreamwoodSpreader; } @Override - public AxisAlignedBB getWireframeAABB(World world, int x, int y, int z) { - float f = 1F / 16F; - return AxisAlignedBB.getBoundingBox(x + f, y + f, z + f, x + 1 - f, y + 1 - f, z + 1 - f); + public AxisAlignedBB getWireframeAABB(World world, BlockPos pos) { + return FULL_BLOCK_AABB.offset(pos).contract(1.0/16.0); + } + + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerBlockToState(this, SpreaderVariant.values().length); } } diff --git a/src/main/java/vazkii/botania/common/block/mana/BlockTerraPlate.java b/src/main/java/vazkii/botania/common/block/mana/BlockTerraPlate.java index c5579a682..d78dbe3e4 100644 --- a/src/main/java/vazkii/botania/common/block/mana/BlockTerraPlate.java +++ b/src/main/java/vazkii/botania/common/block/mana/BlockTerraPlate.java @@ -10,55 +10,61 @@ */ package vazkii.botania.common.block.mana; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.core.helper.IconHelper; -import vazkii.botania.common.block.BlockModContainer; +import vazkii.botania.common.block.BlockMod; import vazkii.botania.common.block.tile.TileTerraPlate; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -public class BlockTerraPlate extends BlockModContainer implements ILexiconable { +import javax.annotation.Nonnull; - public static IIcon overlay; - IIcon[] icons; +public class BlockTerraPlate extends BlockMod implements ILexiconable { + + private static final AxisAlignedBB AABB = new AxisAlignedBB(0, 0, 0, 1, 3.0/16, 1); public BlockTerraPlate() { - super(Material.iron); - setBlockBounds(0F, 0F, 0F, 1F, 3F / 16F, 1F); + super(Material.IRON, LibBlockNames.TERRA_PLATE); setHardness(3F); setResistance(10F); - setStepSound(soundTypeMetal); - setBlockName(LibBlockNames.TERRA_PLATE); - + setSoundType(SoundType.METAL); BotaniaAPI.blacklistBlockFromMagnet(this, Short.MAX_VALUE); } + @Nonnull @Override - public boolean onBlockActivated(World worldObj, int x, int y, int z, EntityPlayer player, int s, float xs, float ys, float zs) { - ItemStack stack = player.getCurrentEquippedItem(); + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { + return AABB; + } + + @Override + public boolean onBlockActivated(World worldObj, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing s, float xs, float ys, float zs) { if(stack != null && stack.getItem() == ModItems.manaResource && stack.getItemDamage() < 3) { if(player == null || !player.capabilities.isCreativeMode) { stack.stackSize--; if(stack.stackSize == 0 && player != null) - player.inventory.setInventorySlotContents(player.inventory.currentItem, null); + player.setHeldItem(hand, null); } ItemStack target = stack.copy(); target.stackSize = 1; - EntityItem item = new EntityItem(worldObj, x + 0.5, y + 0.5, z + 0.5, target); - item.delayBeforeCanPickup = 40; + EntityItem item = new EntityItem(worldObj, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, target); + item.setPickupDelay(40); item.motionX = item.motionY = item.motionZ = 0; if(!worldObj.isRemote) worldObj.spawnEntityInWorld(item); @@ -70,51 +76,44 @@ public class BlockTerraPlate extends BlockModContainer implements ILexiconable { } @Override - public boolean renderAsNormalBlock() { + public boolean isFullCube(IBlockState state) { return false; } @Override - public boolean isOpaqueCube() { + public boolean isOpaqueCube(IBlockState state) { return false; } @Override - public boolean getBlocksMovement(IBlockAccess p_149655_1_, int p_149655_2_, int p_149655_3_, int p_149655_4_) { + public boolean isPassable(IBlockAccess world, BlockPos pos) { return false; } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - icons = new IIcon[3]; - for(int i = 0; i < icons.length; i++) - icons[i] = IconHelper.forBlock(par1IconRegister, this, i); - overlay = IconHelper.forBlock(par1IconRegister, this, "Overlay"); + public boolean hasTileEntity(IBlockState state) { + return true; } + @Nonnull @Override - public IIcon getIcon(int par1, int par2) { - return icons[Math.min(2, par1)]; - } - - @Override - public TileEntity createNewTileEntity(World world, int meta) { + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileTerraPlate(); } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.terrasteel; } @Override - public boolean hasComparatorInputOverride() { + public boolean hasComparatorInputOverride(IBlockState state) { return true; } @Override - public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) { - TileTerraPlate plate = (TileTerraPlate) par1World.getTileEntity(par2, par3, par4); + public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) { + TileTerraPlate plate = (TileTerraPlate) world.getTileEntity(pos); int val = (int) ((double) plate.getCurrentMana() / (double) TileTerraPlate.MAX_MANA * 15.0); if(plate.getCurrentMana() > 0) val = Math.max(val, 1); diff --git a/src/main/java/vazkii/botania/common/block/mana/BlockTurntable.java b/src/main/java/vazkii/botania/common/block/mana/BlockTurntable.java index ea88ef91c..b7f42b3c0 100644 --- a/src/main/java/vazkii/botania/common/block/mana/BlockTurntable.java +++ b/src/main/java/vazkii/botania/common/block/mana/BlockTurntable.java @@ -10,66 +10,63 @@ */ package vazkii.botania.common.block.mana; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.wand.IWandHUD; import vazkii.botania.api.wand.IWandable; -import vazkii.botania.client.core.helper.IconHelper; -import vazkii.botania.common.block.BlockModContainer; +import vazkii.botania.common.block.BlockMod; import vazkii.botania.common.block.tile.mana.TileTurntable; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibBlockNames; -public class BlockTurntable extends BlockModContainer implements IWandable, IWandHUD, ILexiconable { +import javax.annotation.Nonnull; - IIcon[] icons; +public class BlockTurntable extends BlockMod implements IWandable, IWandHUD, ILexiconable { public BlockTurntable() { - super(Material.wood); + super(Material.WOOD, LibBlockNames.TURNTABLE); setHardness(2.0F); - setStepSound(soundTypeWood); - setBlockName(LibBlockNames.TURNTABLE); + setSoundType(SoundType.WOOD); } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - icons = new IIcon[2]; - for(int i = 0; i < icons.length; i++) - icons[i] = IconHelper.forBlock(par1IconRegister, this, i); + public boolean hasTileEntity(IBlockState state) { + return true; } + @Nonnull @Override - public IIcon getIcon(int par1, int par2) { - return par1 == 1 ? icons[0] : icons[1]; - } - - @Override - public TileEntity createNewTileEntity(World world, int meta) { + public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileTurntable(); } + @SideOnly(Side.CLIENT) @Override - public void renderHUD(Minecraft mc, ScaledResolution res, World world, int x, int y, int z) { - ((TileTurntable) world.getTileEntity(x, y, z)).renderHUD(mc, res); + public void renderHUD(Minecraft mc, ScaledResolution res, World world, BlockPos pos) { + ((TileTurntable) world.getTileEntity(pos)).renderHUD(mc, res); } @Override - public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int side) { - ((TileTurntable) world.getTileEntity(x, y, z)).onWanded(player, stack); + public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, BlockPos pos, EnumFacing side) { + ((TileTurntable) world.getTileEntity(pos)).onWanded(player, stack); return true; } @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.turntable; } diff --git a/src/main/java/vazkii/botania/common/block/string/BlockRedString.java b/src/main/java/vazkii/botania/common/block/string/BlockRedString.java index d87199730..353babb9b 100644 --- a/src/main/java/vazkii/botania/common/block/string/BlockRedString.java +++ b/src/main/java/vazkii/botania/common/block/string/BlockRedString.java @@ -11,69 +11,73 @@ package vazkii.botania.common.block.string; import net.minecraft.block.BlockPistonBase; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.common.util.RotationHelper; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.client.core.helper.IconHelper; -import vazkii.botania.common.block.BlockModContainer; -import vazkii.botania.common.block.tile.string.TileRedString; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.client.core.handler.ModelHandler; +import vazkii.botania.common.block.BlockMod; import vazkii.botania.common.lexicon.LexiconData; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -public abstract class BlockRedString extends BlockModContainer implements ILexiconable { +import javax.annotation.Nonnull; - IIcon senderIcon; - IIcon sideIcon; +public abstract class BlockRedString extends BlockMod implements ILexiconable { public BlockRedString(String name) { - super(Material.rock); + super(Material.ROCK, name); setHardness(2.0F); setResistance(10.0F); - setStepSound(soundTypeStone); - setBlockName(name); + setSoundType(SoundType.STONE); + } + + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.FACING); } @Override - public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { - int orientation = BlockPistonBase.determineOrientation(par1World, par2, par3, par4, par5EntityLivingBase); - par1World.setBlockMetadataWithNotify(par2, par3, par4, orientation, 1 | 2); + public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { + EnumFacing orientation = BlockPistonBase.getFacingFromEntity(pos, par5EntityLivingBase); + world.setBlockState(pos, state.withProperty(BotaniaStateProps.FACING, orientation), 1 | 2); } @Override - public boolean rotateBlock(World worldObj, int x, int y, int z, ForgeDirection axis) { - return RotationHelper.rotateVanillaBlock(Blocks.piston, worldObj, x, y, z, axis); + public int getMetaFromState(IBlockState state) { + return state.getValue(BotaniaStateProps.FACING).getIndex(); + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + return getDefaultState().withProperty(BotaniaStateProps.FACING, EnumFacing.getFront(meta)); } @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - senderIcon = IconHelper.forName(par1IconRegister, "redStringSender"); - sideIcon = registerSideIcon(par1IconRegister); - } - - @SideOnly(Side.CLIENT) - public IIcon registerSideIcon(IIconRegister register) { - return IconHelper.forBlock(register, this); + public boolean hasTileEntity(IBlockState state) { + return true; } @Override - public IIcon getIcon(int side, int meta) { - return side == meta ? senderIcon : sideIcon; - } - - @Override - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) { + public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) { return LexiconData.redString; } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerBlockToState(this, 0, getDefaultState().withProperty(BotaniaStateProps.FACING, EnumFacing.NORTH)); + } + } diff --git a/src/main/java/vazkii/botania/common/block/string/BlockRedStringComparator.java b/src/main/java/vazkii/botania/common/block/string/BlockRedStringComparator.java index 02db2de05..bef2d8406 100644 --- a/src/main/java/vazkii/botania/common/block/string/BlockRedStringComparator.java +++ b/src/main/java/vazkii/botania/common/block/string/BlockRedStringComparator.java @@ -10,11 +10,17 @@ */ package vazkii.botania.common.block.string; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.common.block.tile.string.TileRedString; import vazkii.botania.common.block.tile.string.TileRedStringComparator; import vazkii.botania.common.lib.LibBlockNames; +import javax.annotation.Nonnull; + public class BlockRedStringComparator extends BlockRedString { public BlockRedStringComparator() { @@ -22,17 +28,23 @@ public class BlockRedStringComparator extends BlockRedString { } @Override - public boolean hasComparatorInputOverride() { + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.FACING, EnumFacing.DOWN); + } + + @Override + public boolean hasComparatorInputOverride(IBlockState state) { return true; } @Override - public int getComparatorInputOverride(World world, int x, int y, int z, int side) { - return ((TileRedStringComparator) world.getTileEntity(x, y, z)).getComparatorValue(); + public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) { + return ((TileRedStringComparator) world.getTileEntity(pos)).getComparatorValue(); } + @Nonnull @Override - public TileRedString createNewTileEntity(World world, int meta) { + public TileRedString createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileRedStringComparator(); } diff --git a/src/main/java/vazkii/botania/common/block/string/BlockRedStringContainer.java b/src/main/java/vazkii/botania/common/block/string/BlockRedStringContainer.java index 3fc3f6cd0..2aa4b362a 100644 --- a/src/main/java/vazkii/botania/common/block/string/BlockRedStringContainer.java +++ b/src/main/java/vazkii/botania/common/block/string/BlockRedStringContainer.java @@ -10,11 +10,16 @@ */ package vazkii.botania.common.block.string; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.EnumFacing; import net.minecraft.world.World; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.common.block.tile.string.TileRedString; import vazkii.botania.common.block.tile.string.TileRedStringContainer; import vazkii.botania.common.lib.LibBlockNames; +import javax.annotation.Nonnull; + public class BlockRedStringContainer extends BlockRedString { public BlockRedStringContainer() { @@ -22,7 +27,13 @@ public class BlockRedStringContainer extends BlockRedString { } @Override - public TileRedString createNewTileEntity(World world, int meta) { + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.FACING, EnumFacing.DOWN); + } + + @Nonnull + @Override + public TileRedString createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileRedStringContainer(); } diff --git a/src/main/java/vazkii/botania/common/block/string/BlockRedStringDispenser.java b/src/main/java/vazkii/botania/common/block/string/BlockRedStringDispenser.java index 9ef22db23..2ff8578f6 100644 --- a/src/main/java/vazkii/botania/common/block/string/BlockRedStringDispenser.java +++ b/src/main/java/vazkii/botania/common/block/string/BlockRedStringDispenser.java @@ -11,33 +11,82 @@ package vazkii.botania.common.block.string; import net.minecraft.block.Block; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.block.statemap.StateMap; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.common.block.tile.string.TileRedString; import vazkii.botania.common.block.tile.string.TileRedStringDispenser; import vazkii.botania.common.lib.LibBlockNames; +import javax.annotation.Nonnull; + public class BlockRedStringDispenser extends BlockRedString { public BlockRedStringDispenser() { super(LibBlockNames.RED_STRING_DISPENSER); } + @Nonnull @Override - public void onNeighborBlockChange(World world, int x, int y, int z, Block block) { - boolean power = world.isBlockIndirectlyGettingPowered(x, y, z) || world.isBlockIndirectlyGettingPowered(x, y + 1, z); - int meta = world.getBlockMetadata(x, y, z); - boolean powered = (meta & 8) != 0; - - if(power && !powered) { - ((TileRedStringDispenser) world.getTileEntity(x, y, z)).tickDispenser(); - world.setBlockMetadataWithNotify(x, y, z, meta | 8, 4); - } else if(!power && powered) - world.setBlockMetadataWithNotify(x, y, z, meta & -9, 4); + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.FACING, BotaniaStateProps.POWERED); } @Override - public TileRedString createNewTileEntity(World world, int meta) { + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.FACING, EnumFacing.DOWN).withProperty(BotaniaStateProps.POWERED, false); + } + + @Override + public int getMetaFromState(IBlockState state) { + int meta = state.getValue(BotaniaStateProps.FACING).getIndex(); + if (state.getValue(BotaniaStateProps.POWERED)) { + meta |= 8; + } else { + meta &= -9; + } + return meta; + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + boolean powered = (meta & 8) != 0; + meta &= -9; + EnumFacing facing = EnumFacing.getFront(meta); + return getDefaultState().withProperty(BotaniaStateProps.FACING, facing).withProperty(BotaniaStateProps.POWERED, powered); + } + + @Override + public void neighborChanged(IBlockState state, World world, BlockPos pos, Block block) { + boolean power = world.isBlockIndirectlyGettingPowered(pos) > 0 || world.isBlockIndirectlyGettingPowered(pos.up()) > 0; + boolean powered = state.getValue(BotaniaStateProps.POWERED); + + if(power && !powered) { + ((TileRedStringDispenser) world.getTileEntity(pos)).tickDispenser(); + world.setBlockState(pos, state.withProperty(BotaniaStateProps.POWERED, true), 4); + } else if(!power && powered) + world.setBlockState(pos, state.withProperty(BotaniaStateProps.POWERED, false), 4); + } + + @Nonnull + @Override + public TileRedString createTileEntity(@Nonnull World world, @Nonnull IBlockState meta) { return new TileRedStringDispenser(); } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelLoader.setCustomStateMapper(this, new StateMap.Builder().ignore(BotaniaStateProps.POWERED).build()); + super.registerModels(); + } + } diff --git a/src/main/java/vazkii/botania/common/block/string/BlockRedStringFertilizer.java b/src/main/java/vazkii/botania/common/block/string/BlockRedStringFertilizer.java index 2483d69e0..da5bfa762 100644 --- a/src/main/java/vazkii/botania/common/block/string/BlockRedStringFertilizer.java +++ b/src/main/java/vazkii/botania/common/block/string/BlockRedStringFertilizer.java @@ -10,14 +10,19 @@ */ package vazkii.botania.common.block.string; -import java.util.Random; - import net.minecraft.block.IGrowable; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.common.block.tile.string.TileRedString; import vazkii.botania.common.block.tile.string.TileRedStringFertilizer; import vazkii.botania.common.lib.LibBlockNames; +import javax.annotation.Nonnull; +import java.util.Random; + public class BlockRedStringFertilizer extends BlockRedString implements IGrowable { public BlockRedStringFertilizer() { @@ -25,23 +30,28 @@ public class BlockRedStringFertilizer extends BlockRedString implements IGrowabl } @Override - public boolean func_149851_a(World world, int x, int y, int z, boolean something) { - return ((TileRedStringFertilizer) world.getTileEntity(x, y, z)).func_149851_a(world, something); + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.FACING, EnumFacing.DOWN); } @Override - public boolean func_149852_a(World world, Random rand, int x, int y, int z) { - return ((TileRedStringFertilizer) world.getTileEntity(x, y, z)).func_149852_a(world, rand); + public boolean canGrow(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state, boolean isClient) { + return ((TileRedStringFertilizer) world.getTileEntity(pos)).canGrow(world, isClient); } @Override - public void func_149853_b(World world, Random rand, int x, int y, int z) { - ((TileRedStringFertilizer) world.getTileEntity(x, y, z)).func_149853_b(world, rand); + public boolean canUseBonemeal(@Nonnull World world, @Nonnull Random rand, @Nonnull BlockPos pos, @Nonnull IBlockState state) { + return ((TileRedStringFertilizer) world.getTileEntity(pos)).canUseBonemeal(world, rand); } @Override - public TileRedString createNewTileEntity(World world, int meta) { + public void grow(@Nonnull World world, @Nonnull Random rand, @Nonnull BlockPos pos, @Nonnull IBlockState state) { + ((TileRedStringFertilizer) world.getTileEntity(pos)).grow(world, rand); + } + + @Nonnull + @Override + public TileRedString createTileEntity(@Nonnull World world, @Nonnull IBlockState meta) { return new TileRedStringFertilizer(); } - } diff --git a/src/main/java/vazkii/botania/common/block/string/BlockRedStringInterceptor.java b/src/main/java/vazkii/botania/common/block/string/BlockRedStringInterceptor.java index 6512281e1..ee8fd3bd3 100644 --- a/src/main/java/vazkii/botania/common/block/string/BlockRedStringInterceptor.java +++ b/src/main/java/vazkii/botania/common/block/string/BlockRedStringInterceptor.java @@ -10,54 +10,101 @@ */ package vazkii.botania.common.block.string; -import java.util.Random; - +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.block.statemap.StateMap; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.client.model.ModelLoader; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.PlayerInteractEvent; -import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.common.block.tile.string.TileRedString; import vazkii.botania.common.block.tile.string.TileRedStringInterceptor; import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +import javax.annotation.Nonnull; +import java.util.Random; public class BlockRedStringInterceptor extends BlockRedString { public BlockRedStringInterceptor() { super(LibBlockNames.RED_STRING_INTERCEPTOR); - MinecraftForge.EVENT_BUS.register(this); + MinecraftForge.EVENT_BUS.register(BlockRedStringInterceptor.class); } - @SubscribeEvent - public void onInteract(PlayerInteractEvent event) { - if(event.action == Action.RIGHT_CLICK_BLOCK) - TileRedStringInterceptor.onInteract(event.entityPlayer, event.world, event.x, event.y, event.z); + @Nonnull + @Override + public BlockStateContainer createBlockState() { + return new BlockStateContainer(this, BotaniaStateProps.FACING, BotaniaStateProps.POWERED); } @Override - public boolean canProvidePower() { + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.FACING, EnumFacing.DOWN).withProperty(BotaniaStateProps.POWERED, false); + } + + @Override + public int getMetaFromState(IBlockState state) { + int meta = state.getValue(BotaniaStateProps.FACING).getIndex(); + if (state.getValue(BotaniaStateProps.POWERED)) { + meta |= 8; + } else { + meta &= -9; + } + return meta; + } + + @Nonnull + @Override + public IBlockState getStateFromMeta(int meta) { + boolean powered = (meta & 8) != 0; + meta &= -9; + EnumFacing facing = EnumFacing.getFront(meta); + return getDefaultState().withProperty(BotaniaStateProps.FACING, facing).withProperty(BotaniaStateProps.POWERED, powered); + } + + @SubscribeEvent + public static void onInteract(PlayerInteractEvent.RightClickBlock event) { + TileRedStringInterceptor.onInteract(event.getEntityPlayer(), event.getWorld(), event.getPos(), event.getHand()); + } + + @Override + public boolean canProvidePower(IBlockState state) { return true; } @Override - public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int side) { - return (world.getBlockMetadata(x, y, z) & 8) == 0 ? 0 : 15; + public int getWeakPower(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) { + return state.getValue(BotaniaStateProps.POWERED) ? 15 : 0; } @Override - public void updateTick(World world, int x, int y, int z, Random update) { - world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z) & -9, 1 | 2); + public void updateTick(World world, BlockPos pos, IBlockState state, Random update) { + world.setBlockState(pos, state.withProperty(BotaniaStateProps.POWERED, false), 1 | 2); } @Override - public int tickRate(World p_149738_1_) { + public int tickRate(World world) { return 2; } + @Nonnull @Override - public TileRedString createNewTileEntity(World world, int meta) { + public TileRedString createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileRedStringInterceptor(); } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelLoader.setCustomStateMapper(this, new StateMap.Builder().ignore(BotaniaStateProps.POWERED).build()); + super.registerModels(); + } + } diff --git a/src/main/java/vazkii/botania/common/block/string/BlockRedStringRelay.java b/src/main/java/vazkii/botania/common/block/string/BlockRedStringRelay.java index 0a291ff0e..973d60ef5 100644 --- a/src/main/java/vazkii/botania/common/block/string/BlockRedStringRelay.java +++ b/src/main/java/vazkii/botania/common/block/string/BlockRedStringRelay.java @@ -10,11 +10,16 @@ */ package vazkii.botania.common.block.string; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.EnumFacing; import net.minecraft.world.World; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.common.block.tile.string.TileRedString; import vazkii.botania.common.block.tile.string.TileRedStringRelay; import vazkii.botania.common.lib.LibBlockNames; +import javax.annotation.Nonnull; + public class BlockRedStringRelay extends BlockRedString { public BlockRedStringRelay() { @@ -22,7 +27,13 @@ public class BlockRedStringRelay extends BlockRedString { } @Override - public TileRedString createNewTileEntity(World world, int meta) { + protected IBlockState pickDefaultState() { + return blockState.getBaseState().withProperty(BotaniaStateProps.FACING, EnumFacing.DOWN); + } + + @Nonnull + @Override + public TileRedString createTileEntity(@Nonnull World world, @Nonnull IBlockState state) { return new TileRedStringRelay(); } diff --git a/src/main/java/vazkii/botania/common/block/subtile/SubTileDecor.java b/src/main/java/vazkii/botania/common/block/subtile/SubTileDecor.java deleted file mode 100644 index 4eb580e27..000000000 --- a/src/main/java/vazkii/botania/common/block/subtile/SubTileDecor.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Sep 28, 2015, 10:17:01 PM (GMT)] - */ -package vazkii.botania.common.block.subtile; - -import vazkii.botania.api.subtile.SubTileEntity; - -public class SubTileDecor extends SubTileEntity { - - @Override - public boolean canUpdate() { - return false; - } - - public static class Daybloom extends SubTileDecor { } - public static class Nightshade extends SubTileDecor { } - public static class Hydroangeas extends SubTileDecor { } - -} diff --git a/src/main/java/vazkii/botania/common/block/subtile/SubTileManastar.java b/src/main/java/vazkii/botania/common/block/subtile/SubTileManastar.java index 4c5c45c19..d7919afea 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/SubTileManastar.java +++ b/src/main/java/vazkii/botania/common/block/subtile/SubTileManastar.java @@ -11,13 +11,12 @@ package vazkii.botania.common.block.subtile; import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.util.EnumFacing; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.mana.IManaPool; import vazkii.botania.api.subtile.SubTileEntity; import vazkii.botania.common.Botania; import vazkii.botania.common.lexicon.LexiconData; -import vazkii.botania.common.lib.LibMisc; public class SubTileManastar extends SubTileEntity { @@ -28,15 +27,15 @@ public class SubTileManastar extends SubTileEntity { super.onUpdate(); int mana = 0; - for(ForgeDirection dir : LibMisc.CARDINAL_DIRECTIONS) { - TileEntity tile = supertile.getWorldObj().getTileEntity(supertile.xCoord + dir.offsetX, supertile.yCoord, supertile.zCoord + dir.offsetZ); + for(EnumFacing dir : EnumFacing.HORIZONTALS) { + TileEntity tile = supertile.getWorld().getTileEntity(supertile.getPos().offset(dir)); if(tile instanceof IManaPool) mana += ((IManaPool) tile).getCurrentMana(); } if(manaLastTick != -1 && mana != manaLastTick && Math.random() > 0.6) { boolean more = mana > manaLastTick; - Botania.proxy.wispFX(supertile.getWorldObj(), supertile.xCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.yCoord + 0.75 + Math.random() * 0.2 - 0.1, supertile.zCoord + 0.5, more ? 0.05F : 1F, 0.05F, more ? 1F : 0.05F, (float) Math.random() / 7, (float) -Math.random() / 50); + Botania.proxy.wispFX(supertile.getPos().getX() + 0.55 + Math.random() * 0.2 - 0.1, supertile.getPos().getY() + 0.75 + Math.random() * 0.2 - 0.1, supertile.getPos().getZ() + 0.5, more ? 0.05F : 1F, 0.05F, more ? 1F : 0.05F, (float) Math.random() / 7, (float) -Math.random() / 50); } if(ticksExisted % 60 == 0) diff --git a/src/main/java/vazkii/botania/common/block/subtile/SubTilePureDaisy.java b/src/main/java/vazkii/botania/common/block/subtile/SubTilePureDaisy.java index 0f2b780e3..5b961ac54 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/SubTilePureDaisy.java +++ b/src/main/java/vazkii/botania/common/block/subtile/SubTilePureDaisy.java @@ -11,8 +11,9 @@ package vazkii.botania.common.block.subtile; import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.lexicon.LexiconEntry; @@ -28,22 +29,19 @@ public class SubTilePureDaisy extends SubTileEntity { private static final String TAG_POSITION = "position"; private static final String TAG_TICKS_REMAINING = "ticksRemaining"; - private static final int TOTAL_TIME = 1200; - private static final int TIME_PER = TOTAL_TIME / 8; - - private static final int[][] POSITIONS = new int[][] { - { -1, 0, -1 }, - { -1, 0, 0 }, - { -1, 0, 1 }, - { 0, 0, 1 }, - { 1, 0, 1 }, - { 1, 0, 0 }, - { 1, 0, -1 }, - { 0, 0, -1 }, + private static final BlockPos[] POSITIONS = { + new BlockPos(-1, 0, -1 ), + new BlockPos(-1, 0, 0 ), + new BlockPos(-1, 0, 1 ), + new BlockPos(0, 0, 1 ), + new BlockPos(1, 0, 1 ), + new BlockPos(1, 0, 0 ), + new BlockPos(1, 0, -1 ), + new BlockPos(0, 0, -1 ), }; int positionAt = 0; - int[] ticksRemaining = new int[] { TIME_PER, TIME_PER, TIME_PER, TIME_PER, TIME_PER, TIME_PER, TIME_PER, TIME_PER }; + final int[] ticksRemaining = { -1, -1, -1, -1, -1, -1, -1, -1}; @Override public void onUpdate() { @@ -53,54 +51,55 @@ public class SubTilePureDaisy extends SubTileEntity { if(positionAt == POSITIONS.length) positionAt = 0; - int[] acoords = POSITIONS[positionAt]; - ChunkCoordinates coords = new ChunkCoordinates(supertile.xCoord + acoords[0], supertile.yCoord + acoords[1], supertile.zCoord + acoords[2]); - World world = supertile.getWorldObj(); - if(!world.isAirBlock(coords.posX, coords.posY, coords.posZ)) { - Block block = world.getBlock(coords.posX, coords.posY, coords.posZ); - int meta = world.getBlockMetadata(coords.posX, coords.posY, coords.posZ); + BlockPos acoords = POSITIONS[positionAt]; + BlockPos coords = supertile.getPos().add(acoords); + World world = supertile.getWorld(); + if(!world.isAirBlock(coords)) { + IBlockState state = world.getBlockState(coords); RecipePureDaisy recipe = null; for(RecipePureDaisy recipe_ : BotaniaAPI.pureDaisyRecipes) - if(recipe_.matches(world, coords.posX, coords.posY, coords.posZ, this, block, meta)) { + if(recipe_.matches(world, coords, this, state)) { recipe = recipe_; break; } if(recipe != null) { - ticksRemaining[positionAt] = ticksRemaining[positionAt] - 1; + if (ticksRemaining[positionAt] == -1) + ticksRemaining[positionAt] = recipe.getTime(); + ticksRemaining[positionAt]--; - Botania.proxy.sparkleFX(supertile.getWorldObj(), coords.posX + Math.random(), coords.posY + Math.random(), coords.posZ + Math.random(), 1F, 1F, 1F, (float) Math.random(), 5); + Botania.proxy.sparkleFX(coords.getX() + Math.random(), coords.getY() + Math.random(), coords.getZ() + Math.random(), 1F, 1F, 1F, (float) Math.random(), 5); if(ticksRemaining[positionAt] <= 0) { - ticksRemaining[positionAt] = TIME_PER; + ticksRemaining[positionAt] = -1; - if(recipe.set(world,coords.posX, coords.posY, coords.posZ, this)) { + if(recipe.set(world,coords, this)) { for(int i = 0; i < 25; i++) { - double x = coords.posX + Math.random(); - double y = coords.posY + Math.random() + 0.5; - double z = coords.posZ + Math.random(); + double x = coords.getX() + Math.random(); + double y = coords.getY() + Math.random() + 0.5; + double z = coords.getZ() + Math.random(); - Botania.proxy.wispFX(supertile.getWorldObj(), x, y, z, 1F, 1F, 1F, (float) Math.random() / 2F); + Botania.proxy.wispFX(x, y, z, 1F, 1F, 1F, (float) Math.random() / 2F); } if(ConfigHandler.blockBreakParticles) - supertile.getWorldObj().playAuxSFX(2001, coords.posX, coords.posY, coords.posZ, Block.getIdFromBlock(recipe.getOutput()) + (recipe.getOutputMeta() << 12)); + supertile.getWorld().playEvent(2001, coords, Block.getStateId(recipe.getOutputState())); } } - } else ticksRemaining[positionAt] = TIME_PER; + } else ticksRemaining[positionAt] = -1; } } @Override public RadiusDescriptor getRadius() { - return new RadiusDescriptor.Square(toChunkCoordinates(), 1); + return new RadiusDescriptor.Square(toBlockPos(), 1); } @Override public void readFromPacketNBT(NBTTagCompound cmp) { positionAt = cmp.getInteger(TAG_POSITION); - if(supertile.getWorldObj() != null && !supertile.getWorldObj().isRemote) + if(supertile.getWorld() != null && !supertile.getWorld().isRemote) for(int i = 0; i < ticksRemaining.length; i++) ticksRemaining[i] = cmp.getInteger(TAG_TICKS_REMAINING + i); } diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/BergamuteEventHandler.java b/src/main/java/vazkii/botania/common/block/subtile/functional/BergamuteEventHandler.java new file mode 100644 index 000000000..ebcad5145 --- /dev/null +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/BergamuteEventHandler.java @@ -0,0 +1,105 @@ +package vazkii.botania.common.block.subtile.functional; + +import net.minecraft.client.audio.ISound; +import net.minecraft.client.audio.ITickableSound; +import net.minecraft.client.audio.MovingSound; +import net.minecraft.client.audio.Sound; +import net.minecraft.client.audio.SoundEventAccessor; +import net.minecraft.client.audio.SoundHandler; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.SoundCategory; +import net.minecraftforge.client.event.sound.PlaySoundEvent; +import net.minecraftforge.fml.common.eventhandler.EventPriority; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.api.BotaniaAPI; +import vazkii.botania.common.block.tile.mana.TilePool; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.awt.Color; +import java.util.Random; + +@SideOnly(Side.CLIENT) +public class BergamuteEventHandler { + + private BergamuteEventHandler() {} + + private static final Random RAND = new Random(); + private static final float MULTIPLIER = 0.15F; + + @SubscribeEvent(priority = EventPriority.LOWEST) + public static void onSoundEvent(PlaySoundEvent evt) { + ISound sound = evt.getResultSound(); + + if (sound != null && shouldSilence(sound)) { + if(sound instanceof ITickableSound) { + evt.setResultSound(new WrappedTickableSound((ITickableSound) sound, MULTIPLIER)); + } else { + SubTileBergamute berg = SubTileBergamute.getBergamuteNearby(sound.getXPosF(), sound.getYPosF(), sound.getZPosF()); + + if (berg != null) { + evt.setResultSound(new WrappedSound(sound, MULTIPLIER)); + + if (RAND.nextBoolean()) { + Color color = TilePool.PARTICLE_COLOR; + BotaniaAPI.internalHandler.sparkleFX(berg.getWorld(), berg.getPos().getX() + 0.3 + Math.random() * 0.5, berg.getPos().getY() + 0.5 + Math.random() * 0.5, berg.getPos().getZ() + 0.3 + Math.random() * 0.5, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random(), 5); + } + } + } + } + } + + private static boolean shouldSilence(ISound sound) { + return sound.getCategory() != SoundCategory.VOICE + && sound.getCategory() != SoundCategory.MUSIC + && sound.getClass().getName().startsWith("net.minecraft.client.audio"); + } + + @SideOnly(Side.CLIENT) + private static class WrappedSound implements ISound { + + private final ISound compose; + private final float volMult; + private final boolean recheck; + + private WrappedSound(ISound toWrap, float volMult) { + this.compose = toWrap; + this.volMult = volMult; + this.recheck = toWrap instanceof MovingSound; + } + + @Override + public float getVolume() { + float mult = recheck && SubTileBergamute.getBergamuteNearby(getXPosF(), getYPosF(), getZPosF()) == null ? 1F : volMult; + return compose.getVolume() * mult; + } + + @Nonnull @Override public ResourceLocation getSoundLocation() { return compose.getSoundLocation(); } + @Nullable @Override public SoundEventAccessor createAccessor(@Nonnull SoundHandler handler) { return compose.createAccessor(handler); } + @Nonnull @Override public Sound getSound() { return compose.getSound(); } + @Nonnull @Override public SoundCategory getCategory() { return compose.getCategory(); } + @Override public boolean canRepeat() { return compose.canRepeat(); } + @Override public int getRepeatDelay() { return compose.getRepeatDelay(); } + @Override public float getPitch() { return compose.getPitch(); } + @Override public float getXPosF() { return compose.getXPosF(); } + @Override public float getYPosF() { return compose.getYPosF(); } + @Override public float getZPosF() { return compose.getZPosF(); } + @Nonnull @Override public AttenuationType getAttenuationType() { return compose.getAttenuationType(); } + } + + @SideOnly(Side.CLIENT) + private static class WrappedTickableSound extends WrappedSound implements ITickableSound { + + private final ITickableSound compose; + + private WrappedTickableSound(ITickableSound toWrap, float volMult) { + super(toWrap, volMult); + this.compose = toWrap; + } + + @Override public boolean isDonePlaying() { return compose.isDonePlaying(); } + @Override public void update() { compose.update(); } + } +} diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileAgricarnation.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileAgricarnation.java index e6392a57e..bb6b8acc8 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileAgricarnation.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileAgricarnation.java @@ -16,8 +16,12 @@ import net.minecraft.block.BlockCrops; import net.minecraft.block.BlockSapling; import net.minecraft.block.IGrowable; import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.BlockPos; import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.api.sound.BotaniaSoundEvents; import vazkii.botania.api.subtile.RadiusDescriptor; import vazkii.botania.api.subtile.SubTileFunctional; import vazkii.botania.common.core.handler.ConfigHandler; @@ -32,24 +36,30 @@ public class SubTileAgricarnation extends SubTileFunctional { public void onUpdate() { super.onUpdate(); + if(supertile.getWorld().isRemote) + return; + + if(ticksExisted % 200 == 0) + sync(); + if(ticksExisted % 6 == 0 && redstoneSignal == 0) { int range = getRange(); - int x = supertile.xCoord + supertile.getWorldObj().rand.nextInt(range * 2 + 1) - range; - int z = supertile.zCoord + supertile.getWorldObj().rand.nextInt(range * 2 + 1) - range; + int x = supertile.getPos().getX() + supertile.getWorld().rand.nextInt(range * 2 + 1) - range; + int z = supertile.getPos().getZ() + supertile.getWorld().rand.nextInt(range * 2 + 1) - range; for(int i = 4; i > -2; i--) { - int y = supertile.yCoord + i; - - if(supertile.getWorldObj().isAirBlock(x, y, z)) + int y = supertile.getPos().getY() + i; + BlockPos pos = new BlockPos(x, y, z); + if(supertile.getWorld().isAirBlock(pos)) continue; - if(isPlant(x, y, z) && mana > 5) { - Block block = supertile.getWorldObj().getBlock(x, y, z); + if(isPlant(pos) && mana > 5) { + Block block = supertile.getWorld().getBlockState(pos).getBlock(); mana -= 5; - supertile.getWorldObj().scheduleBlockUpdate(x, y, z, block, 1); + supertile.getWorld().scheduleUpdate(pos, block, 1); if(ConfigHandler.blockBreakParticles) - supertile.getWorldObj().playAuxSFX(2005, x, y, z, 6 + supertile.getWorldObj().rand.nextInt(4)); - supertile.getWorldObj().playSoundEffect(x, y, z, "botania:agricarnation", 0.01F, 0.5F + (float) Math.random() * 0.5F); + supertile.getWorld().playEvent(2005, pos, 6 + supertile.getWorld().rand.nextInt(4)); + supertile.getWorld().playSound(null, x, y, z, BotaniaSoundEvents.agricarnation, SoundCategory.BLOCKS, 0.01F, 0.5F + (float) Math.random() * 0.5F); break; } @@ -62,13 +72,14 @@ public class SubTileAgricarnation extends SubTileFunctional { return true; } - boolean isPlant(int x, int y, int z) { - Block block = supertile.getWorldObj().getBlock(x, y, z); - if(block == Blocks.grass || block == Blocks.leaves || block == Blocks.leaves2 || block instanceof BlockBush && !(block instanceof BlockCrops) && !(block instanceof BlockSapling)) + private boolean isPlant(BlockPos pos) { + IBlockState state = supertile.getWorld().getBlockState(pos); + Block block = state.getBlock(); + if(block == Blocks.GRASS || block == Blocks.LEAVES || block == Blocks.LEAVES2 || block instanceof BlockBush && !(block instanceof BlockCrops) && !(block instanceof BlockSapling)) return false; - Material mat = block.getMaterial(); - return mat != null && (mat == Material.plants || mat == Material.cactus || mat == Material.grass || mat == Material.leaves || mat == Material.gourd) && block instanceof IGrowable && ((IGrowable) block).func_149851_a(supertile.getWorldObj(), x, y, z, supertile.getWorldObj().isRemote); + Material mat = state.getMaterial(); + return mat != null && (mat == Material.PLANTS || mat == Material.CACTUS || mat == Material.GRASS || mat == Material.LEAVES || mat == Material.GOURD) && block instanceof IGrowable && ((IGrowable) block).canGrow(supertile.getWorld(), pos, supertile.getWorld().getBlockState(pos), supertile.getWorld().isRemote); } @Override @@ -87,7 +98,7 @@ public class SubTileAgricarnation extends SubTileFunctional { @Override public RadiusDescriptor getRadius() { - return new RadiusDescriptor.Square(toChunkCoordinates(), getRange()); + return new RadiusDescriptor.Square(toBlockPos(), getRange()); } @Override diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileBellethorn.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileBellethorn.java index 52604a8d6..13dedb072 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileBellethorn.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileBellethorn.java @@ -10,20 +10,20 @@ */ package vazkii.botania.common.block.subtile.functional; -import java.util.List; - -import net.minecraft.command.IEntitySelector; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.monster.EntityWitch; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.DamageSource; +import net.minecraft.util.math.AxisAlignedBB; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.subtile.RadiusDescriptor; import vazkii.botania.api.subtile.SubTileFunctional; import vazkii.botania.common.lexicon.LexiconData; +import java.util.List; +import java.util.function.Predicate; + public class SubTileBellethorn extends SubTileFunctional { public static final int RANGE = 6; @@ -43,20 +43,19 @@ public class SubTileBellethorn extends SubTileFunctional { public void onUpdate() { super.onUpdate(); - if(redstoneSignal > 0) + if(supertile.getWorld().isRemote || redstoneSignal > 0) return; + if(ticksExisted % 200 == 0) + sync(); + final int manaToUse = getManaCost(); if(ticksExisted % 5 == 0) { int range = getRange(); - List entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord, supertile.zCoord - range, supertile.xCoord + range + 1, supertile.yCoord + 1, supertile.zCoord + range + 1)); - IEntitySelector selector = getSelector(); + List entities = supertile.getWorld().getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(supertile.getPos().add(-range, -range, -range), supertile.getPos().add(range + 1, range + 1, range + 1)), getSelector()::test); for(EntityLivingBase entity : entities) { - if(!selector.isEntityApplicable(entity)) - continue; - if(entity.hurtTime == 0 && mana >= manaToUse) { int dmg = 4; if(entity instanceof EntityWitch) @@ -83,20 +82,13 @@ public class SubTileBellethorn extends SubTileFunctional { return RANGE; } - public IEntitySelector getSelector() { - return new IEntitySelector() { - - @Override - public boolean isEntityApplicable(Entity entity) { - return !(entity instanceof EntityPlayer); - } - - }; + public Predicate getSelector() { + return entity -> !(entity instanceof EntityPlayer); } @Override public RadiusDescriptor getRadius() { - return new RadiusDescriptor.Square(toChunkCoordinates(), getRange()); + return new RadiusDescriptor.Square(toBlockPos(), getRange()); } @Override diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileBergamute.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileBergamute.java new file mode 100644 index 000000000..69b374ad7 --- /dev/null +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileBergamute.java @@ -0,0 +1,61 @@ +package vazkii.botania.common.block.subtile.functional; + +import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.api.subtile.RadiusDescriptor; +import vazkii.botania.api.subtile.SubTileFunctional; +import vazkii.botania.common.lexicon.LexiconData; + +import java.util.Collections; +import java.util.Set; +import java.util.WeakHashMap; + +public class SubTileBergamute extends SubTileFunctional { + private static final int RANGE = 4; + private static final Set existingFlowers = Collections.newSetFromMap(new WeakHashMap<>()); + + @Override + public void onUpdate() { + super.onUpdate(); + + if (supertile.getWorld().isRemote) { + if(!existingFlowers.contains(this)) { + existingFlowers.add(this); + } + } + } + + // todo seems expensive when we have lots of sounds cache maybe? + protected static SubTileBergamute getBergamuteNearby(float x, float y, float z) { + return existingFlowers.stream() + .filter(f -> f.redstoneSignal == 0) + .filter(f -> f.supertile.getWorld().getTileEntity(f.supertile.getPos()) == f.supertile) + .filter(f -> f.supertile.getDistanceSq(x, y, z) <= RANGE * RANGE) + .findAny().orElse(null); + } + + @Override + public boolean acceptsRedstone() { + return true; + } + + @Override + public int getMaxMana() { + return 1; + } + + @Override + public int getColor() { + return 0xF46C6C; + } + + @Override + public RadiusDescriptor getRadius() { + return new RadiusDescriptor.Circle(toBlockPos(), RANGE); + } + + @Override + public LexiconEntry getEntry() { + return LexiconData.bergamute; + } + +} diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileBubbell.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileBubbell.java index 10c62757c..4447776d2 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileBubbell.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileBubbell.java @@ -10,10 +10,11 @@ */ package vazkii.botania.common.block.subtile.functional; -import net.minecraft.block.Block; import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.subtile.ISubTileContainer; @@ -37,28 +38,33 @@ public class SubTileBubbell extends SubTileFunctional { public void onUpdate() { super.onUpdate(); + if(supertile.getWorld().isRemote) + return; + + if(ticksExisted % 200 == 0) + sync(); + if(mana > COST_PER_TICK) { mana -= COST_PER_TICK; if(ticksExisted % 10 == 0 && range < getRange()) range++; - for(int i = -range; i < range + 1; i++) - for(int j = -range; j < range + 1; j++) - for(int k = -range; k < range + 1; k++) - if(MathHelper.pointDistanceSpace(i, j, k, 0, 0, 0) < range) { - Block block = supertile.getWorldObj().getBlock(supertile.xCoord + i, supertile.yCoord + j, supertile.zCoord + k); - if(block.getMaterial() == Material.water) { - supertile.getWorldObj().setBlock(supertile.xCoord + i, supertile.yCoord + j, supertile.zCoord + k, ModBlocks.fakeAir, 0, 2); - TileFakeAir air = (TileFakeAir) supertile.getWorldObj().getTileEntity(supertile.xCoord + i, supertile.yCoord + j, supertile.zCoord + k); - air.setFlower(supertile); - } - } + for(BlockPos pos : BlockPos.getAllInBoxMutable(getPos().add(-range, -range, -range), getPos().add(range, range, range))) { + if(getPos().distanceSq(pos) < range * range) { + IBlockState state = supertile.getWorld().getBlockState(pos); + if(state.getMaterial() == Material.WATER) { + supertile.getWorld().setBlockState(pos, ModBlocks.fakeAir.getDefaultState(), 2); + TileFakeAir air = (TileFakeAir) supertile.getWorld().getTileEntity(pos); + air.setFlower(supertile); + } + } + } } } - public static boolean isValidBubbell(World world, int x, int y, int z) { - TileEntity tile = world.getTileEntity(x, y, z); + public static boolean isValidBubbell(World world, BlockPos pos) { + TileEntity tile = world.getTileEntity(pos); if(tile != null && tile instanceof ISubTileContainer) { ISubTileContainer container = (ISubTileContainer) tile; if(container.getSubTile() != null && container.getSubTile() instanceof SubTileBubbell) { @@ -98,7 +104,7 @@ public class SubTileBubbell extends SubTileFunctional { @Override public RadiusDescriptor getRadius() { - return new RadiusDescriptor.Circle(toChunkCoordinates(), range); + return new RadiusDescriptor.Circle(toBlockPos(), range); } @Override diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileClayconia.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileClayconia.java index 11e645f5b..8d77a9568 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileClayconia.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileClayconia.java @@ -10,20 +10,21 @@ */ package vazkii.botania.common.block.subtile.functional; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.block.Block; import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.math.BlockPos; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.subtile.RadiusDescriptor; import vazkii.botania.api.subtile.SubTileFunctional; import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.lexicon.LexiconData; +import java.util.ArrayList; +import java.util.List; + public class SubTileClayconia extends SubTileFunctional { private static final int COST = 80; @@ -37,23 +38,23 @@ public class SubTileClayconia extends SubTileFunctional { public void onUpdate() { super.onUpdate(); - if(!supertile.getWorldObj().isRemote && ticksExisted % 5 == 0) { + if(!supertile.getWorld().isRemote && ticksExisted % 5 == 0) { if(mana >= COST) { - ChunkCoordinates coords = getCoordsToPut(); + BlockPos coords = getCoordsToPut(); if(coords != null) { - supertile.getWorldObj().setBlockToAir(coords.posX, coords.posY, coords.posZ); + supertile.getWorld().setBlockToAir(coords); if(ConfigHandler.blockBreakParticles) - supertile.getWorldObj().playAuxSFX(2001, coords.posX, coords.posY, coords.posZ, Block.getIdFromBlock(Block.getBlockFromName("sand"))); - EntityItem item = new EntityItem(supertile.getWorldObj(), coords.posX + 0.5, coords.posY + 0.5, coords.posZ + 0.5, new ItemStack(Items.clay_ball)); - supertile.getWorldObj().spawnEntityInWorld(item); + supertile.getWorld().playEvent(2001, coords, Block.getStateId(Blocks.SAND.getDefaultState())); + EntityItem item = new EntityItem(supertile.getWorld(), coords.getX() + 0.5, coords.getY() + 0.5, coords.getZ() + 0.5, new ItemStack(Items.CLAY_BALL)); + supertile.getWorld().spawnEntityInWorld(item); mana -= COST; } } } } - public ChunkCoordinates getCoordsToPut() { - List possibleCoords = new ArrayList(); + public BlockPos getCoordsToPut() { + List possibleCoords = new ArrayList<>(); int range = getRange(); int rangeY = getRangeY(); @@ -61,22 +62,20 @@ public class SubTileClayconia extends SubTileFunctional { for(int i = -range; i < range + 1; i++) for(int j = -rangeY; j < rangeY + 1; j++) for(int k = -range; k < range + 1; k++) { - int x = supertile.xCoord + i; - int y = supertile.yCoord + j; - int z = supertile.zCoord + k; - Block block = supertile.getWorldObj().getBlock(x, y, z); - if(block == Block.getBlockFromName("sand")) - possibleCoords.add(new ChunkCoordinates(x, y, z)); + BlockPos pos = supertile.getPos().add(i, j, k); + Block block = supertile.getWorld().getBlockState(pos).getBlock(); + if(block == Blocks.SAND) + possibleCoords.add(pos); } if(possibleCoords.isEmpty()) return null; - return possibleCoords.get(supertile.getWorldObj().rand.nextInt(possibleCoords.size())); + return possibleCoords.get(supertile.getWorld().rand.nextInt(possibleCoords.size())); } @Override public RadiusDescriptor getRadius() { - return new RadiusDescriptor.Square(toChunkCoordinates(), getRange()); + return new RadiusDescriptor.Square(toBlockPos(), getRange()); } public int getRange() { diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileDaffomill.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileDaffomill.java index a4fd3f0b3..b4a942189 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileDaffomill.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileDaffomill.java @@ -10,35 +10,35 @@ */ package vazkii.botania.common.block.subtile.functional; -import java.util.List; - import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.AxisAlignedBB; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.subtile.RadiusDescriptor; import vazkii.botania.api.subtile.SubTileFunctional; import vazkii.botania.common.Botania; +import vazkii.botania.common.core.handler.MethodHandles; import vazkii.botania.common.lexicon.LexiconData; +import java.util.List; + public class SubTileDaffomill extends SubTileFunctional { private static final String TAG_ORIENTATION = "orientation"; private static final String TAG_WIND_TICKS = "windTicks"; - int windTicks = 0; - int orientation = 0; + private int windTicks = 0; + private EnumFacing orientation = EnumFacing.NORTH; @Override public void onUpdate() { super.onUpdate(); - ForgeDirection dir = ForgeDirection.getOrientation(orientation + 2); - if(supertile.getWorldObj().rand.nextInt(4) == 0) - Botania.proxy.wispFX(supertile.getWorldObj(), supertile.xCoord + Math.random(), supertile.yCoord + Math.random(), supertile.zCoord + Math.random(), 0.05F, 0.05F, 0.05F, 0.25F + (float) Math.random() * 0.15F, dir.offsetX * 0.1F, dir.offsetY * 0.1F, dir.offsetZ * 0.1F); + if(supertile.getWorld().rand.nextInt(4) == 0) + Botania.proxy.wispFX(supertile.getPos().getX() + Math.random(), supertile.getPos().getY() + Math.random(), supertile.getPos().getZ() + Math.random(), 0.05F, 0.05F, 0.05F, 0.25F + (float) Math.random() * 0.15F, orientation.getFrontOffsetX() * 0.1F, orientation.getFrontOffsetY() * 0.1F, orientation.getFrontOffsetZ() * 0.1F); if(windTicks == 0 && mana > 0) { windTicks = 20; @@ -49,41 +49,49 @@ public class SubTileDaffomill extends SubTileFunctional { AxisAlignedBB axis = aabbForOrientation(); if(axis != null) { - List items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, axis); + List items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, axis); int slowdown = getSlowdownFactor(); - for(EntityItem item : items) - if(!item.isDead && item.age >= slowdown) { - item.motionX += dir.offsetX * 0.05; - item.motionY += dir.offsetY * 0.05; - item.motionZ += dir.offsetZ * 0.05; + for(EntityItem item : items) { + int age; + try { + age = (int) MethodHandles.itemAge_getter.invokeExact(item); + } catch (Throwable t) { + continue; } + + if(!item.isDead && age >= slowdown) { + item.motionX += orientation.getFrontOffsetX() * 0.05; + item.motionY += orientation.getFrontOffsetY() * 0.05; + item.motionZ += orientation.getFrontOffsetZ() * 0.05; + } + } } windTicks--; } } - AxisAlignedBB aabbForOrientation() { - int x = supertile.xCoord; - int y = supertile.yCoord; - int z = supertile.zCoord; + private AxisAlignedBB aabbForOrientation() { + int x = supertile.getPos().getX(); + int y = supertile.getPos().getY(); + int z = supertile.getPos().getZ(); int w = 2; int h = 3; int l = 16; AxisAlignedBB axis = null; switch(orientation) { - case 0 : - axis = AxisAlignedBB.getBoundingBox(x - w, y - h, z - l, x + w + 1, y + h, z); + case NORTH : + axis = new AxisAlignedBB(x - w, y - h, z - l, x + w + 1, y + h, z); break; - case 1 : - axis = AxisAlignedBB.getBoundingBox(x - w, y - h, z + 1, x + w + 1, y + h, z + l + 1); + case SOUTH : + axis = new AxisAlignedBB(x - w, y - h, z + 1, x + w + 1, y + h, z + l + 1); break; - case 2 : - axis = AxisAlignedBB.getBoundingBox(x - l, y - h, z - w, x, y + h, z + w + 1); + case WEST : + axis = new AxisAlignedBB(x - l, y - h, z - w, x, y + h, z + w + 1); break; - case 3 : - axis = AxisAlignedBB.getBoundingBox(x + 1, y - h, z - w, x + l + 1, y + h, z + w + 1); + case EAST : + axis = new AxisAlignedBB(x + 1, y - h, z - w, x + l + 1, y + h, z + w + 1); } return axis; } @@ -100,7 +108,7 @@ public class SubTileDaffomill extends SubTileFunctional { if(player.isSneaking()) { if(!player.worldObj.isRemote) { - orientation = orientation == 3 ? 0 : orientation + 1; + orientation = orientation.rotateY(); sync(); } @@ -111,8 +119,8 @@ public class SubTileDaffomill extends SubTileFunctional { @Override public RadiusDescriptor getRadius() { AxisAlignedBB aabb = aabbForOrientation(); - aabb.minY = supertile.yCoord; - return new RadiusDescriptor.Rectangle(toChunkCoordinates(), aabb); + aabb = new AxisAlignedBB(aabb.minX, supertile.getPos().getY(), aabb.minZ, aabb.maxX, aabb.maxY, aabb.maxZ); + return new RadiusDescriptor.Rectangle(toBlockPos(), aabb); } @Override @@ -134,7 +142,7 @@ public class SubTileDaffomill extends SubTileFunctional { public void writeToPacketNBT(NBTTagCompound cmp) { super.writeToPacketNBT(cmp); - cmp.setInteger(TAG_ORIENTATION, orientation); + cmp.setInteger(TAG_ORIENTATION, orientation.getIndex() - 2); // retain compat with 1.7 saves cmp.setInteger(TAG_WIND_TICKS, windTicks); } @@ -142,7 +150,7 @@ public class SubTileDaffomill extends SubTileFunctional { public void readFromPacketNBT(NBTTagCompound cmp) { super.readFromPacketNBT(cmp); - orientation = cmp.getInteger(TAG_ORIENTATION); + orientation = EnumFacing.getFront(cmp.getInteger(TAG_ORIENTATION) + 2); // retain compat with 1.7 saves windTicks = cmp.getInteger(TAG_WIND_TICKS); } diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileDreadthorn.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileDreadthorn.java index 332389f7b..36583a36e 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileDreadthorn.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileDreadthorn.java @@ -10,12 +10,13 @@ */ package vazkii.botania.common.block.subtile.functional; -import net.minecraft.command.IEntitySelector; import net.minecraft.entity.Entity; import net.minecraft.entity.passive.EntityAnimal; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.common.lexicon.LexiconData; +import java.util.function.Predicate; + public class SubTileDreadthorn extends SubTileBellethorn { @Override @@ -24,15 +25,8 @@ public class SubTileDreadthorn extends SubTileBellethorn { } @Override - public IEntitySelector getSelector() { - return new IEntitySelector() { - - @Override - public boolean isEntityApplicable(Entity var1) { - return var1 instanceof EntityAnimal && ((EntityAnimal) var1).getGrowingAge() == 0; - } - - }; + public Predicate getSelector() { + return var1 -> var1 instanceof EntityAnimal && ((EntityAnimal) var1).getGrowingAge() == 0; } @Override diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileExoflame.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileExoflame.java index 4684517eb..f2cd743c9 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileExoflame.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileExoflame.java @@ -17,6 +17,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraft.util.math.BlockPos; import vazkii.botania.api.item.IExoflameHeatable; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.subtile.RadiusDescriptor; @@ -27,61 +28,56 @@ public class SubTileExoflame extends SubTileFunctional { private static final int RANGE = 5; private static final int RANGE_Y = 2; + private static final int COST = 300; @Override public void onUpdate() { super.onUpdate(); + if(supertile.getWorld().isRemote) + return; + boolean did = false; - int cost = 300; - fireFurnaces : { - for(int i = -RANGE; i < RANGE + 1; i++) - for(int j = -RANGE_Y; j < RANGE_Y + 1; j++) - for(int k = -RANGE; k < RANGE + 1; k++) { - int x = supertile.xCoord + i; - int y = supertile.yCoord + j; - int z = supertile.zCoord + k; - - TileEntity tile = supertile.getWorldObj().getTileEntity(x, y, z); - Block block = supertile.getWorldObj().getBlock(x, y, z); - if(tile != null) { - if(tile instanceof TileEntityFurnace && (block == Blocks.furnace || block == Blocks.lit_furnace)) { - TileEntityFurnace furnace = (TileEntityFurnace) tile; - boolean canSmelt = canFurnaceSmelt(furnace); - if(canSmelt && mana > 2) { - if(furnace.furnaceBurnTime < 2) { - if(furnace.furnaceBurnTime == 0) - BlockFurnace.updateFurnaceBlockState(true, supertile.getWorldObj(), x, y, z); - furnace.furnaceBurnTime = 200; - mana = Math.max(0, mana - cost); - } - if(ticksExisted % 2 == 0) - furnace.furnaceCookTime = Math.min(199, furnace.furnaceCookTime + 1); - - did = true; - - if(mana <= 0) - break fireFurnaces; - } - } else if(tile instanceof IExoflameHeatable) { - IExoflameHeatable heatable = (IExoflameHeatable) tile; - - if(heatable.canSmelt() && mana > 2) { - if(heatable.getBurnTime() == 0) { - heatable.boostBurnTime(); - mana = Math.max(0, mana - cost); - } - - if(ticksExisted % 2 == 0) - heatable.boostCookTime(); - - if(mana <= 0) - break fireFurnaces; - } - } + for(BlockPos pos : BlockPos.getAllInBox(getPos().add(-RANGE, -RANGE_Y, -RANGE), getPos().add(RANGE, RANGE_Y, RANGE))) { + TileEntity tile = supertile.getWorld().getTileEntity(pos); + Block block = supertile.getWorld().getBlockState(pos).getBlock(); + if(tile != null) { + if(tile instanceof TileEntityFurnace && (block == Blocks.FURNACE || block == Blocks.LIT_FURNACE)) { + TileEntityFurnace furnace = (TileEntityFurnace) tile; + boolean canSmelt = canFurnaceSmelt(furnace); + if(canSmelt && mana > 2) { + if(furnace.getField(0) < 2) { // Field 0 -> Burn time + if(furnace.getField(0) == 0) + BlockFurnace.setState(true, supertile.getWorld(), pos); + furnace.setField(0, 200); + mana = Math.max(0, mana - COST); } + if(ticksExisted % 2 == 0) + furnace.setField(2, Math.min(199, furnace.getField(2) + 1)); // Field 2 -> cook time + + did = true; + + if(mana <= 0) + break; } + } else if(tile instanceof IExoflameHeatable) { + IExoflameHeatable heatable = (IExoflameHeatable) tile; + + if(heatable.canSmelt() && mana > 2) { + if(heatable.getBurnTime() == 0) { + heatable.boostBurnTime(); + mana = Math.max(0, mana - COST); + } + + if(ticksExisted % 2 == 0) + heatable.boostCookTime(); + + if(mana <= 0) + break; + } + } + } } if(did) @@ -92,7 +88,7 @@ public class SubTileExoflame extends SubTileFunctional { if(furnace.getStackInSlot(0) == null) return false; else { - ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(furnace.getStackInSlot(0)); + ItemStack itemstack = FurnaceRecipes.instance().getSmeltingResult(furnace.getStackInSlot(0)); if(itemstack == null) return false; @@ -110,7 +106,7 @@ public class SubTileExoflame extends SubTileFunctional { @Override public RadiusDescriptor getRadius() { - return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE); + return new RadiusDescriptor.Square(toBlockPos(), RANGE); } @Override diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileFallenKanade.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileFallenKanade.java index 45f94df80..9d60f87ab 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileFallenKanade.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileFallenKanade.java @@ -10,41 +10,44 @@ */ package vazkii.botania.common.block.subtile.functional; -import java.util.List; - import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.potion.Potion; +import net.minecraft.init.MobEffects; import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.math.AxisAlignedBB; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.subtile.RadiusDescriptor; import vazkii.botania.api.subtile.SubTileFunctional; import vazkii.botania.common.lexicon.LexiconData; +import java.util.List; + public class SubTileFallenKanade extends SubTileFunctional { private static final int RANGE = 2; + private static final int COST = 120; @Override public void onUpdate() { super.onUpdate(); - final int cost = 120; - - if(!supertile.getWorldObj().isRemote && supertile.getWorldObj().provider.dimensionId != 1) { - List players = supertile.getWorldObj().getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1)); + if(!supertile.getWorld().isRemote && supertile.getWorld().provider.getDimension() != 1) { + boolean did = false; + List players = supertile.getWorld().getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1))); for(EntityPlayer player : players) { - if(player.getActivePotionEffect(Potion.regeneration) == null && mana >= cost ) { - player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 60, 2)); - mana -= cost; + if(player.getActivePotionEffect(MobEffects.REGENERATION) == null && mana >= COST) { + player.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 60, 2, true, true)); + mana -= COST; + did = true; } } + if(did) + sync(); } } @Override public RadiusDescriptor getRadius() { - return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE); + return new RadiusDescriptor.Square(toBlockPos(), RANGE); } @Override diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileHeiseiDream.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileHeiseiDream.java index 0c66e7fdc..d3ccd248d 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileHeiseiDream.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileHeiseiDream.java @@ -10,22 +10,24 @@ */ package vazkii.botania.common.block.subtile.functional; -import java.util.ArrayList; -import java.util.List; - +import com.google.common.base.Predicates; +import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIAttackMelee; import net.minecraft.entity.ai.EntityAINearestAttackableTarget; import net.minecraft.entity.ai.EntityAITasks.EntityAITaskEntry; import net.minecraft.entity.monster.IMob; -import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraftforge.fml.relauncher.ReflectionHelper; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.subtile.RadiusDescriptor; import vazkii.botania.api.subtile.SubTileFunctional; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibObfuscation; -import cpw.mods.fml.relauncher.ReflectionHelper; + +import java.util.ArrayList; +import java.util.List; public class SubTileHeiseiDream extends SubTileFunctional { @@ -35,9 +37,14 @@ public class SubTileHeiseiDream extends SubTileFunctional { public void onUpdate() { super.onUpdate(); + if(supertile.getWorld().isRemote) + return; + final int cost = 100; - List mobs = supertile.getWorldObj().getEntitiesWithinAABB(IMob.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1)); + @SuppressWarnings("unchecked") + List mobs = (List) (List) supertile.getWorld().getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1)), Predicates.instanceOf(IMob.class)); + if(mobs.size() > 1 && mana >= cost) for(IMob mob : mobs) { if(mob instanceof EntityLiving) { @@ -61,15 +68,14 @@ public class SubTileHeiseiDream extends SubTileFunctional { while(newTarget == entity); if(newTarget instanceof EntityLiving) { - List entries = new ArrayList(entity.tasks.taskEntries); - entries.addAll(new ArrayList(entity.targetTasks.taskEntries)); + List entries = new ArrayList<>(entity.tasks.taskEntries); + entries.addAll(new ArrayList<>(entity.targetTasks.taskEntries)); for(EntityAITaskEntry entry : entries) if(entry.action instanceof EntityAINearestAttackableTarget) { messWithGetTargetAI((EntityAINearestAttackableTarget) entry.action, (EntityLiving) newTarget); did = true; - } else if(entry.action instanceof EntityAIAttackOnCollide) { - messWithAttackOnCollideAI((EntityAIAttackOnCollide) entry.action); + } else if(entry.action instanceof EntityAIAttackMelee) { did = true; } @@ -82,17 +88,13 @@ public class SubTileHeiseiDream extends SubTileFunctional { } private static void messWithGetTargetAI(EntityAINearestAttackableTarget aiEntry, EntityLivingBase target) { - ReflectionHelper.setPrivateValue(EntityAINearestAttackableTarget.class, aiEntry, IMob.class, LibObfuscation.TARGET_CLASS); - ReflectionHelper.setPrivateValue(EntityAINearestAttackableTarget.class, aiEntry, target, LibObfuscation.TARGET_ENTITY); - } - - private static void messWithAttackOnCollideAI(EntityAIAttackOnCollide aiEntry) { - ReflectionHelper.setPrivateValue(EntityAIAttackOnCollide.class, aiEntry, IMob.class, LibObfuscation.CLASS_TARGET); + ReflectionHelper.setPrivateValue(EntityAINearestAttackableTarget.class, aiEntry, Entity.class, LibObfuscation.TARGET_CLASS); + ReflectionHelper.setPrivateValue(EntityAINearestAttackableTarget.class, aiEntry, Predicates.equalTo(target), LibObfuscation.TARGET_ENTITY_SELECTOR); // todo 1.8 will this leak `target`? } @Override public RadiusDescriptor getRadius() { - return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE); + return new RadiusDescriptor.Square(toBlockPos(), RANGE); } @Override diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileHopperhock.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileHopperhock.java index 84aea3c2c..c267a428e 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileHopperhock.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileHopperhock.java @@ -10,37 +10,37 @@ */ package vazkii.botania.common.block.subtile.functional; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Set; -import java.util.WeakHashMap; - import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.resources.I18n; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItemFrame; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.StatCollector; -import net.minecraftforge.common.util.ForgeDirection; - +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import net.minecraftforge.items.IItemHandler; +import net.minecraftforge.items.ItemHandlerHelper; import org.lwjgl.opengl.GL11; - -import scala.reflect.internal.util.WeakHashSet; +import vazkii.botania.api.corporea.InvWithLocation; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.mana.IManaItem; import vazkii.botania.api.subtile.RadiusDescriptor; import vazkii.botania.api.subtile.SubTileFunctional; +import vazkii.botania.common.core.handler.MethodHandles; import vazkii.botania.common.core.helper.InventoryHelper; import vazkii.botania.common.lexicon.LexiconData; -import vazkii.botania.common.lib.LibMisc; + +import java.util.ArrayList; +import java.util.List; public class SubTileHopperhock extends SubTileFunctional { @@ -51,48 +51,51 @@ public class SubTileHopperhock extends SubTileFunctional { private static final int RANGE_MANA_MINI = 2; private static final int RANGE_MINI = 1; - private static Set particled = Collections.newSetFromMap(new WeakHashMap()); - - int filterType = 0; + private int filterType = 0; @Override public void onUpdate() { super.onUpdate(); - if(redstoneSignal > 0) + if(supertile.getWorld().isRemote || redstoneSignal > 0) return; boolean pulledAny = false; int range = getRange(); - int x = supertile.xCoord; - int y = supertile.yCoord; - int z = supertile.zCoord; + BlockPos pos = supertile.getPos(); - List items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x - range, y - range, z - range, x + range + 1, y + range + 1, z + range + 1)); + List items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos.add(-range, -range, -range), pos.add(range + 1, range + 1, range + 1))); int slowdown = getSlowdownFactor(); for(EntityItem item : items) { - if(item.age < (60 + slowdown) || item.age >= 105 && item.age < 110 || item.isDead) + int age; + try { + age = (int) MethodHandles.itemAge_getter.invokeExact(item); + } catch (Throwable t) { + continue; + } + + if(age < (60 + slowdown) || age >= 105 && age < 110 || item.isDead) continue; ItemStack stack = item.getEntityItem(); - - IInventory invToPutItemIn = null; - ForgeDirection sideToPutItemIn = ForgeDirection.UNKNOWN; + IItemHandler invToPutItemIn = null; + EnumFacing sideToPutItemIn = null; boolean priorityInv = false; int amountToPutIn = 0; - for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { - int x_ = x + dir.offsetX; - int y_ = y + dir.offsetY; - int z_ = z + dir.offsetZ; + for(EnumFacing dir : EnumFacing.VALUES) { + BlockPos pos_ = pos.offset(dir); - IInventory inv = InventoryHelper.getInventory(supertile.getWorldObj(), x_, y_, z_); + InvWithLocation inv = InventoryHelper.getInventoryWithLocation(supertile.getWorld(), pos_, dir); if(inv != null) { - List filter = getFilterForInventory(inv, x_, y_, z_, true); + List filter = getFilterForInventory(pos_, true); boolean canAccept = canAcceptItem(stack, filter, filterType); - int availablePut = supertile.getWorldObj().isRemote ? 1 : InventoryHelper.testInventoryInsertion(inv, stack, dir); + + ItemStack simulate = ItemHandlerHelper.insertItem(inv.handler, stack.copy(), true); + int availablePut = stack.stackSize - (simulate == null ? 0 : simulate.stackSize); + canAccept &= availablePut > 0; if(canAccept) { @@ -102,9 +105,8 @@ public class SubTileHopperhock extends SubTileFunctional { if(priorityInv && !priority) break setInv; - invToPutItemIn = inv; + invToPutItemIn = inv.handler; priorityInv = priority; - sideToPutItemIn = dir.getOpposite(); amountToPutIn = availablePut; } } @@ -112,20 +114,12 @@ public class SubTileHopperhock extends SubTileFunctional { } if(invToPutItemIn != null && !item.isDead) { - boolean remote = supertile.getWorldObj().isRemote; - if(remote) { - if(!particled.contains(item)) { - SubTileSpectranthemum.spawnExplosionParticles(item, 3); - particled.add(item); - } - } else { - InventoryHelper.insertItemIntoInventory(invToPutItemIn, stack.splitStack(amountToPutIn), sideToPutItemIn, -1); - item.setEntityItemStack(stack); // Just in case someone subclasses EntityItem and changes something important. - invToPutItemIn.markDirty(); - if(item.getEntityItem().stackSize == 0) - item.setDead(); - pulledAny = true; - } + SubTileSpectranthemum.spawnExplosionParticles(item, 3); + ItemHandlerHelper.insertItem(invToPutItemIn, stack.splitStack(amountToPutIn), false); + item.setEntityItemStack(stack); // Just in case someone subclasses EntityItem and changes something important. + if(item.getEntityItem().stackSize == 0) + item.setDead(); + pulledAny = true; } } @@ -169,31 +163,26 @@ public class SubTileHopperhock extends SubTileFunctional { } } - public List getFilterForInventory(IInventory inv, int x, int y, int z, boolean recursiveForDoubleChests) { - List filter = new ArrayList(); + public List getFilterForInventory(BlockPos pos, boolean recursiveForDoubleChests) { + List filter = new ArrayList<>(); if(recursiveForDoubleChests) { - TileEntity tileEntity = supertile.getWorldObj().getTileEntity(x, y, z); - Block chest = supertile.getWorldObj().getBlock(x, y, z); + TileEntity tileEntity = supertile.getWorld().getTileEntity(pos); + Block chest = supertile.getWorld().getBlockState(pos).getBlock(); if(tileEntity instanceof TileEntityChest) - for(ForgeDirection dir : LibMisc.CARDINAL_DIRECTIONS) - if(supertile.getWorldObj().getBlock(x + dir.offsetX, y, z + dir.offsetZ) == chest) { - filter.addAll(getFilterForInventory((IInventory) supertile.getWorldObj().getTileEntity(x + dir.offsetX, y, z + dir.offsetZ), x + dir.offsetX, y, z + dir.offsetZ, false)); + for(EnumFacing dir : EnumFacing.HORIZONTALS) + if(supertile.getWorld().getBlockState(pos.offset(dir)).getBlock() == chest) { + filter.addAll(getFilterForInventory(pos.offset(dir), false)); break; } } - final int[] orientationToDir = new int[] { - 3, 4, 2, 5 - }; - - for(ForgeDirection dir : LibMisc.CARDINAL_DIRECTIONS) { - AxisAlignedBB aabb = AxisAlignedBB.getBoundingBox(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, x + dir.offsetX + 1, y + dir.offsetY + 1, z + dir.offsetZ + 1); - List frames = supertile.getWorldObj().getEntitiesWithinAABB(EntityItemFrame.class, aabb); + for(EnumFacing dir : EnumFacing.HORIZONTALS) { + AxisAlignedBB aabb = new AxisAlignedBB(pos.offset(dir), pos.offset(dir).add(1, 1, 1)); + List frames = supertile.getWorld().getEntitiesWithinAABB(EntityItemFrame.class, aabb); for(EntityItemFrame frame : frames) { - int orientation = frame.hangingDirection; - if(orientationToDir[orientation] == dir.ordinal()) + if(frame.facingDirection == dir) filter.add(frame.getDisplayedItem()); } } @@ -222,7 +211,7 @@ public class SubTileHopperhock extends SubTileFunctional { @Override public RadiusDescriptor getRadius() { - return new RadiusDescriptor.Square(toChunkCoordinates(), getRange()); + return new RadiusDescriptor.Square(toBlockPos(), getRange()); } public int getRange() { @@ -243,19 +232,20 @@ public class SubTileHopperhock extends SubTileFunctional { filterType = cmp.getInteger(TAG_FILTER_TYPE); } + @SideOnly(Side.CLIENT) @Override public void renderHUD(Minecraft mc, ScaledResolution res) { super.renderHUD(mc, res); int color = getColor(); - String filter = StatCollector.translateToLocal("botaniamisc.filter" + filterType); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - int x = res.getScaledWidth() / 2 - mc.fontRenderer.getStringWidth(filter) / 2; + String filter = I18n.format("botaniamisc.filter" + filterType); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + int x = res.getScaledWidth() / 2 - mc.fontRendererObj.getStringWidth(filter) / 2; int y = res.getScaledHeight() / 2 + 30; - mc.fontRenderer.drawStringWithShadow(filter, x, y, color); - GL11.glDisable(GL11.GL_BLEND); + mc.fontRendererObj.drawStringWithShadow(filter, x, y, color); + GlStateManager.disableBlend(); } @Override diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileHyacidus.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileHyacidus.java index c658d1d6a..85801c327 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileHyacidus.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileHyacidus.java @@ -10,19 +10,19 @@ */ package vazkii.botania.common.block.subtile.functional; -import java.util.List; - import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EnumCreatureAttribute; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.potion.Potion; +import net.minecraft.init.MobEffects; import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.math.AxisAlignedBB; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.subtile.RadiusDescriptor; import vazkii.botania.api.subtile.SubTileFunctional; import vazkii.botania.common.lexicon.LexiconData; +import java.util.List; + public class SubTileHyacidus extends SubTileFunctional { private static final int RANGE = 6; @@ -31,15 +31,15 @@ public class SubTileHyacidus extends SubTileFunctional { public void onUpdate() { super.onUpdate(); - if(redstoneSignal > 0) + if(supertile.getWorld().isRemote || redstoneSignal > 0) return; final int cost = 20; - List entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1)); + List entities = supertile.getWorld().getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1))); for(EntityLivingBase entity : entities) { - if(!(entity instanceof EntityPlayer) && entity.getActivePotionEffect(Potion.poison) == null && mana >= cost && !entity.worldObj.isRemote && entity.getCreatureAttribute() != EnumCreatureAttribute.UNDEAD) { - entity.addPotionEffect(new PotionEffect(Potion.poison.id, 60, 0)); + if(!(entity instanceof EntityPlayer) && entity.getActivePotionEffect(MobEffects.POISON) == null && mana >= cost && !entity.worldObj.isRemote && entity.getCreatureAttribute() != EnumCreatureAttribute.UNDEAD) { + entity.addPotionEffect(new PotionEffect(MobEffects.POISON, 60, 0)); mana -= cost; } } @@ -62,7 +62,7 @@ public class SubTileHyacidus extends SubTileFunctional { @Override public RadiusDescriptor getRadius() { - return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE); + return new RadiusDescriptor.Square(toBlockPos(), RANGE); } @Override diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileJadedAmaranthus.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileJadedAmaranthus.java index 8501cd179..71fab2cba 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileJadedAmaranthus.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileJadedAmaranthus.java @@ -12,7 +12,11 @@ package vazkii.botania.common.block.subtile.functional; import net.minecraft.block.Block; import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.util.math.BlockPos; import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.api.subtile.RadiusDescriptor; import vazkii.botania.api.subtile.SubTileFunctional; import vazkii.botania.common.block.ModBlocks; @@ -22,37 +26,41 @@ import vazkii.botania.common.lexicon.LexiconData; public class SubTileJadedAmaranthus extends SubTileFunctional { private static final int COST = 100; - int RANGE = 4; + final int RANGE = 4; @Override public void onUpdate() { super.onUpdate(); - if(redstoneSignal > 0) + if(supertile.getWorld().isRemote || redstoneSignal > 0) return; - if(mana >= COST && !supertile.getWorldObj().isRemote && ticksExisted % 30 == 0) { - int x = supertile.xCoord - RANGE + supertile.getWorldObj().rand.nextInt(RANGE * 2 + 1); - int y = supertile.yCoord + RANGE; - int z = supertile.zCoord - RANGE + supertile.getWorldObj().rand.nextInt(RANGE * 2 + 1); + if(ticksExisted % 30 == 0 && mana >= COST) { + BlockPos pos = new BlockPos( + supertile.getPos().getX() - RANGE + supertile.getWorld().rand.nextInt(RANGE * 2 + 1), + supertile.getPos().getY() + RANGE, + supertile.getPos().getZ() - RANGE + supertile.getWorld().rand.nextInt(RANGE * 2 + 1) + ); + + BlockPos up = pos.up(); for(int i = 0; i < RANGE * 2; i++) { - Block blockAbove = supertile.getWorldObj().getBlock(x, y + 1, z); - if((supertile.getWorldObj().isAirBlock(x, y + 1, z) || blockAbove.isReplaceable(supertile.getWorldObj(), x, y + 1, z)) && blockAbove.getMaterial() != Material.water && ModBlocks.flower.canPlaceBlockAt(supertile.getWorldObj(), x, y + 1, z)) { - int color = supertile.getWorldObj().rand.nextInt(16); - if(ModBlocks.flower.canBlockStay(supertile.getWorldObj(), x, y + 1, z)) { - if(ConfigHandler.blockBreakParticles) - supertile.getWorldObj().playAuxSFX(2001, x, y + 1, z, Block.getIdFromBlock(ModBlocks.flower) + (color << 12)); - supertile.getWorldObj().setBlock(x, y + 1, z, ModBlocks.flower, color, 1 | 2); - } - + IBlockState stateAbove = supertile.getWorld().getBlockState(up); + Block blockAbove = stateAbove.getBlock(); + if((supertile.getWorld().isAirBlock(up) || blockAbove.isReplaceable(supertile.getWorld(), up)) && stateAbove.getMaterial() != Material.WATER && ModBlocks.flower.canPlaceBlockAt(supertile.getWorld(), up)) { + EnumDyeColor color = EnumDyeColor.byMetadata(supertile.getWorld().rand.nextInt(16)); + IBlockState state = ModBlocks.flower.getDefaultState().withProperty(BotaniaStateProps.COLOR, color); + if(ConfigHandler.blockBreakParticles) + supertile.getWorld().playEvent(2001, up, Block.getStateId(state)); + supertile.getWorld().setBlockState(up, state, 1 | 2); mana -= COST; sync(); break; } - y--; + up = pos; + pos = pos.down(); } } } @@ -69,7 +77,7 @@ public class SubTileJadedAmaranthus extends SubTileFunctional { @Override public RadiusDescriptor getRadius() { - return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE); + return new RadiusDescriptor.Square(toBlockPos(), RANGE); } @Override diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileLoonuim.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileLoonuim.java index ce14cfaed..8b289be3f 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileLoonuim.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileLoonuim.java @@ -10,41 +10,50 @@ */ package vazkii.botania.common.block.subtile.functional; -import java.util.Random; - import net.minecraft.entity.item.EntityItem; import net.minecraft.item.ItemStack; -import net.minecraftforge.common.ChestGenHooks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.WorldServer; +import net.minecraft.world.storage.loot.LootContext; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.subtile.RadiusDescriptor; import vazkii.botania.api.subtile.SubTileFunctional; import vazkii.botania.common.lexicon.LexiconData; +import java.util.List; +import java.util.Random; + public class SubTileLoonuim extends SubTileFunctional { private static final int COST = 35000; private static final int RANGE = 3; + private static final String TAG_LOOT_TABLE = "lootTable"; + + private ResourceLocation lootTable = new ResourceLocation("minecraft", "chests/simple_dungeon"); @Override public void onUpdate() { super.onUpdate(); - if(redstoneSignal == 0 && ticksExisted % 200 == 0 && mana >= COST) { - Random rand = supertile.getWorldObj().rand; + if(!supertile.getWorld().isRemote && redstoneSignal == 0 && ticksExisted % 200 == 0 && mana >= COST) { + Random rand = supertile.getWorld().rand; ItemStack stack; do { - stack = ChestGenHooks.getOneItem(ChestGenHooks.DUNGEON_CHEST, rand); + List stacks = supertile.getWorld().getLootTableManager().getLootTableFromLocation(lootTable).generateLootForPools(rand, new LootContext.Builder(((WorldServer) supertile.getWorld())).build()); + if (stacks.isEmpty()) + return; + else stack = stacks.get(0); } while(stack == null || BotaniaAPI.looniumBlacklist.contains(stack.getItem())); int bound = RANGE * 2 + 1; - EntityItem entity = new EntityItem(supertile.getWorldObj(), supertile.xCoord - RANGE + rand.nextInt(bound) , supertile.yCoord + 1, supertile.zCoord - RANGE + rand.nextInt(bound), stack); + EntityItem entity = new EntityItem(supertile.getWorld(), supertile.getPos().getX() - RANGE + rand.nextInt(bound) , supertile.getPos().getY() + 1, supertile.getPos().getZ() - RANGE + rand.nextInt(bound), stack); entity.motionX = 0; entity.motionY = 0; entity.motionZ = 0; - if(!supertile.getWorldObj().isRemote) - supertile.getWorldObj().spawnEntityInWorld(entity); + supertile.getWorld().spawnEntityInWorld(entity); mana -= COST; sync(); @@ -73,7 +82,20 @@ public class SubTileLoonuim extends SubTileFunctional { @Override public RadiusDescriptor getRadius() { - return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE); + return new RadiusDescriptor.Square(toBlockPos(), RANGE); + } + + @Override + public void readFromPacketNBT(NBTTagCompound cmp) { + super.readFromPacketNBT(cmp); + if (cmp.hasKey(TAG_LOOT_TABLE)) + lootTable = new ResourceLocation(cmp.getString(TAG_LOOT_TABLE)); + } + + @Override + public void writeToPacketNBT(NBTTagCompound cmp) { + super.writeToPacketNBT(cmp); + cmp.setString(TAG_LOOT_TABLE, lootTable.toString()); } } diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileMarimorphosis.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileMarimorphosis.java index fb2d58a89..9fbde0921 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileMarimorphosis.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileMarimorphosis.java @@ -10,14 +10,13 @@ */ package vazkii.botania.common.block.subtile.functional; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - +import gnu.trove.list.array.TIntArrayList; import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.block.state.pattern.BlockStateMatcher; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.math.BlockPos; import net.minecraftforge.common.BiomeDictionary; import net.minecraftforge.common.BiomeDictionary.Type; import vazkii.botania.api.lexicon.LexiconEntry; @@ -27,6 +26,10 @@ import vazkii.botania.common.block.ModFluffBlocks; import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.lexicon.LexiconData; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + public class SubTileMarimorphosis extends SubTileFunctional { private static final int COST = 12; @@ -50,19 +53,19 @@ public class SubTileMarimorphosis extends SubTileFunctional { @Override public void onUpdate() { super.onUpdate(); - if(redstoneSignal > 0) + if(supertile.getWorld().isRemote && redstoneSignal > 0) return; - if(!supertile.getWorldObj().isRemote && mana >= COST && ticksExisted % 2 == 0) { - ChunkCoordinates coords = getCoordsToPut(); + if(mana >= COST && ticksExisted % 2 == 0) { + BlockPos coords = getCoordsToPut(); if(coords != null) { ItemStack stack = getStoneToPut(coords); if(stack != null) { Block block = Block.getBlockFromItem(stack.getItem()); int meta = stack.getItemDamage(); - supertile.getWorldObj().setBlock(coords.posX, coords.posY, coords.posZ, block, meta, 1 | 2); + supertile.getWorld().setBlockState(coords, block.getStateFromMeta(meta), 1 | 2); if(ConfigHandler.blockBreakParticles) - supertile.getWorldObj().playAuxSFX(2001, coords.posX, coords.posY, coords.posZ, Block.getIdFromBlock(block) + (meta << 12)); + supertile.getWorld().playEvent(2001, coords, Block.getIdFromBlock(block) + (meta << 12)); mana -= COST; sync(); @@ -71,10 +74,10 @@ public class SubTileMarimorphosis extends SubTileFunctional { } } - public ItemStack getStoneToPut(ChunkCoordinates coords) { - List types = Arrays.asList(BiomeDictionary.getTypesForBiome(supertile.getWorldObj().getBiomeGenForCoords(coords.posX, coords.posZ))); + public ItemStack getStoneToPut(BlockPos coords) { + List types = Arrays.asList(BiomeDictionary.getTypesForBiome(supertile.getWorld().getBiomeGenForCoords(coords))); - List values = new ArrayList(); + TIntArrayList values = new TIntArrayList(); for(int i = 0; i < 8; i++) { int times = 1; if(types.contains(TYPES[i])) @@ -84,34 +87,29 @@ public class SubTileMarimorphosis extends SubTileFunctional { values.add(i); } - return new ItemStack(ModFluffBlocks.biomeStoneA, 1, values.get(supertile.getWorldObj().rand.nextInt(values.size()))); + return new ItemStack(ModFluffBlocks.biomeStoneA, 1, values.get(supertile.getWorld().rand.nextInt(values.size()))); } - public ChunkCoordinates getCoordsToPut() { - List possibleCoords = new ArrayList(); + private BlockPos getCoordsToPut() { + List possibleCoords = new ArrayList<>(); int range = getRange(); int rangeY = getRangeY(); - for(int i = -range; i < range + 1; i++) - for(int j = -rangeY; j < rangeY; j++) - for(int k = -range; k < range + 1; k++) { - int x = supertile.xCoord + i; - int y = supertile.yCoord + j; - int z = supertile.zCoord + k; - Block block = supertile.getWorldObj().getBlock(x, y, z); - if(block != null && block.isReplaceableOreGen(supertile.getWorldObj(), x, y, z, Blocks.stone)) - possibleCoords.add(new ChunkCoordinates(x, y, z)); - } + for(BlockPos pos : BlockPos.getAllInBox(getPos().add(-range, -rangeY, -range), getPos().add(range, rangeY, range))) { + IBlockState state = supertile.getWorld().getBlockState(pos); + if(state.getBlock().isReplaceableOreGen(state, supertile.getWorld(), pos, BlockStateMatcher.forBlock(Blocks.STONE))) + possibleCoords.add(pos); + } if(possibleCoords.isEmpty()) return null; - return possibleCoords.get(supertile.getWorldObj().rand.nextInt(possibleCoords.size())); + return possibleCoords.get(supertile.getWorld().rand.nextInt(possibleCoords.size())); } @Override public RadiusDescriptor getRadius() { - return new RadiusDescriptor.Square(toChunkCoordinates(), getRange()); + return new RadiusDescriptor.Square(toBlockPos(), getRange()); } public int getRange() { diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileMedumone.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileMedumone.java index ec614af02..876e64ffb 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileMedumone.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileMedumone.java @@ -10,18 +10,18 @@ */ package vazkii.botania.common.block.subtile.functional; -import java.util.List; - import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.potion.Potion; +import net.minecraft.init.MobEffects; import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.math.AxisAlignedBB; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.subtile.RadiusDescriptor; import vazkii.botania.api.subtile.SubTileFunctional; import vazkii.botania.common.lexicon.LexiconData; +import java.util.List; + public class SubTileMedumone extends SubTileFunctional { private static final int RANGE = 6; @@ -30,12 +30,12 @@ public class SubTileMedumone extends SubTileFunctional { public void onUpdate() { super.onUpdate(); - if(mana > 0) { - List entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + 1, supertile.zCoord + RANGE + 1)); + if(!supertile.getWorld().isRemote && mana > 0) { + List entities = supertile.getWorld().getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1))); for(EntityLivingBase entity : entities) if(!(entity instanceof EntityPlayer)) { - entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 2, 100)); + entity.addPotionEffect(new PotionEffect(MobEffects.SLOWNESS, 2, 100)); mana--; if(mana == 0) return; @@ -50,7 +50,7 @@ public class SubTileMedumone extends SubTileFunctional { @Override public RadiusDescriptor getRadius() { - return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE); + return new RadiusDescriptor.Square(toBlockPos(), RANGE); } @Override diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileOrechid.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileOrechid.java index 8a027957b..322519a6f 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileOrechid.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileOrechid.java @@ -10,26 +10,29 @@ */ package vazkii.botania.common.block.subtile.functional; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Map; - import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.block.state.pattern.BlockStateMatcher; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.SoundCategory; import net.minecraft.util.WeightedRandom; +import net.minecraft.util.math.BlockPos; import net.minecraftforge.oredict.OreDictionary; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.api.sound.BotaniaSoundEvents; import vazkii.botania.api.subtile.RadiusDescriptor; import vazkii.botania.api.subtile.SubTileFunctional; import vazkii.botania.common.Botania; import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.lexicon.LexiconData; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + public class SubTileOrechid extends SubTileFunctional { private static final int COST = 17500; @@ -43,21 +46,21 @@ public class SubTileOrechid extends SubTileFunctional { public void onUpdate() { super.onUpdate(); - if(redstoneSignal > 0 || !canOperate()) + if(supertile.getWorld().isRemote || redstoneSignal > 0 || !canOperate()) return; int cost = getCost(); - if(!supertile.getWorldObj().isRemote && mana >= cost && ticksExisted % getDelay() == 0) { - ChunkCoordinates coords = getCoordsToPut(); + if(mana >= cost && ticksExisted % getDelay() == 0) { + BlockPos coords = getCoordsToPut(); if(coords != null) { ItemStack stack = getOreToPut(); - if(stack != null) { + if(stack != null && stack.getItem() != null) { Block block = Block.getBlockFromItem(stack.getItem()); int meta = stack.getItemDamage(); - supertile.getWorldObj().setBlock(coords.posX, coords.posY, coords.posZ, block, meta, 1 | 2); + supertile.getWorld().setBlockState(coords, block.getStateFromMeta(meta), 1 | 2); if(ConfigHandler.blockBreakParticles) - supertile.getWorldObj().playAuxSFX(2001, coords.posX, coords.posY, coords.posZ, Block.getIdFromBlock(block) + (meta << 12)); - supertile.getWorldObj().playSoundEffect(supertile.xCoord, supertile.yCoord, supertile.zCoord, "botania:orechid", 2F, 1F); + supertile.getWorld().playEvent(2001, coords, Block.getIdFromBlock(block) + (meta << 12)); + supertile.getWorld().playSound(null, supertile.getPos(), BotaniaSoundEvents.orechid, SoundCategory.BLOCKS, 2F, 1F); mana -= cost; sync(); @@ -67,12 +70,12 @@ public class SubTileOrechid extends SubTileFunctional { } public ItemStack getOreToPut() { - Collection values = new ArrayList(); + List values = new ArrayList<>(); Map map = getOreMap(); for(String s : map.keySet()) values.add(new StringRandomItem(map.get(s), s)); - String ore = ((StringRandomItem) WeightedRandom.getRandomItem(supertile.getWorldObj().rand, values)).s; + String ore = ((StringRandomItem) WeightedRandom.getRandomItem(supertile.getWorld().rand, values)).s; List ores = OreDictionary.getOres(ore); @@ -96,24 +99,19 @@ public class SubTileOrechid extends SubTileFunctional { return getOreToPut(); } - public ChunkCoordinates getCoordsToPut() { - List possibleCoords = new ArrayList(); + private BlockPos getCoordsToPut() { + List possibleCoords = new ArrayList<>(); Block source = getSourceBlock(); - for(int i = -RANGE; i < RANGE + 1; i++) - for(int j = -RANGE_Y; j < RANGE_Y; j++) - for(int k = -RANGE; k < RANGE + 1; k++) { - int x = supertile.xCoord + i; - int y = supertile.yCoord + j; - int z = supertile.zCoord + k; - Block block = supertile.getWorldObj().getBlock(x, y, z); - if(block != null && block.isReplaceableOreGen(supertile.getWorldObj(), x, y, z, source)) - possibleCoords.add(new ChunkCoordinates(x, y, z)); - } + for(BlockPos pos : BlockPos.getAllInBox(getPos().add(-RANGE, -RANGE_Y, -RANGE), getPos().add(RANGE, RANGE_Y, RANGE))) { + IBlockState state = supertile.getWorld().getBlockState(pos); + if(state.getBlock().isReplaceableOreGen(state, supertile.getWorld(), pos, BlockStateMatcher.forBlock(source))) + possibleCoords.add(pos); + } if(possibleCoords.isEmpty()) return null; - return possibleCoords.get(supertile.getWorldObj().rand.nextInt(possibleCoords.size())); + return possibleCoords.get(supertile.getWorld().rand.nextInt(possibleCoords.size())); } public boolean canOperate() { @@ -125,7 +123,7 @@ public class SubTileOrechid extends SubTileFunctional { } public Block getSourceBlock() { - return Blocks.stone; + return Blocks.STONE; } public int getCost() { @@ -138,7 +136,7 @@ public class SubTileOrechid extends SubTileFunctional { @Override public RadiusDescriptor getRadius() { - return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE); + return new RadiusDescriptor.Square(toBlockPos(), RANGE); } @Override @@ -163,7 +161,7 @@ public class SubTileOrechid extends SubTileFunctional { private static class StringRandomItem extends WeightedRandom.Item { - public String s; + public final String s; public StringRandomItem(int par1, String s) { super(par1); diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileOrechidIgnem.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileOrechidIgnem.java index 0b6a21f0e..018e4f5f0 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileOrechidIgnem.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileOrechidIgnem.java @@ -10,21 +10,21 @@ */ package vazkii.botania.common.block.subtile.functional; -import java.util.Map; - import net.minecraft.block.Block; import net.minecraft.init.Blocks; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.common.lexicon.LexiconData; +import java.util.Map; + public class SubTileOrechidIgnem extends SubTileOrechid { private static final int COST = 20000; @Override public boolean canOperate() { - return supertile.getWorldObj().provider.isHellWorld; + return supertile.getWorld().provider.doesWaterVaporize(); } @Override @@ -34,7 +34,7 @@ public class SubTileOrechidIgnem extends SubTileOrechid { @Override public Block getSourceBlock() { - return Blocks.netherrack; + return Blocks.NETHERRACK; } @Override diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTilePollidisiac.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTilePollidisiac.java index 485c81318..49d189e0f 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTilePollidisiac.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTilePollidisiac.java @@ -10,18 +10,19 @@ */ package vazkii.botania.common.block.subtile.functional; -import java.util.List; - import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.passive.EntityAnimal; import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraftforge.fml.relauncher.ReflectionHelper; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.subtile.RadiusDescriptor; import vazkii.botania.api.subtile.SubTileFunctional; +import vazkii.botania.common.core.handler.MethodHandles; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibObfuscation; -import cpw.mods.fml.relauncher.ReflectionHelper; + +import java.util.List; public class SubTilePollidisiac extends SubTileFunctional { @@ -31,21 +32,27 @@ public class SubTilePollidisiac extends SubTileFunctional { public void onUpdate() { super.onUpdate(); - if(!supertile.getWorldObj().isRemote) { + if(!supertile.getWorld().isRemote) { int manaCost = 12; - List items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord, supertile.zCoord - RANGE, supertile.xCoord + 1 + RANGE, supertile.yCoord + 1, supertile.zCoord + 1 +RANGE)); - List animals = supertile.getWorldObj().getEntitiesWithinAABB(EntityAnimal.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord, supertile.zCoord - RANGE, supertile.xCoord + 1 +RANGE, supertile.yCoord + 1, supertile.zCoord + 1 +RANGE)); + List items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1))); + List animals = supertile.getWorld().getEntitiesWithinAABB(EntityAnimal.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1))); int slowdown = getSlowdownFactor(); - + for(EntityAnimal animal : animals) { if(mana < manaCost) break; - int love = ReflectionHelper.getPrivateValue(EntityAnimal.class, animal, LibObfuscation.IN_LOVE); - if(animal.getGrowingAge() == 0 && love <= 0) { + if(animal.getGrowingAge() == 0 && !animal.isInLove()) { for(EntityItem item : items) { - if(item.age < (60 + slowdown) || item.isDead) + int age; + try { + age = (int) MethodHandles.itemAge_getter.invokeExact(item); + } catch (Throwable t) { + continue; + } + + if(age < (60 + slowdown) || item.isDead) continue; ItemStack stack = item.getEntityItem(); @@ -57,8 +64,7 @@ public class SubTilePollidisiac extends SubTileFunctional { mana -= manaCost; ReflectionHelper.setPrivateValue(EntityAnimal.class, animal, 1200, LibObfuscation.IN_LOVE); - animal.setTarget(null); - supertile.getWorldObj().setEntityState(animal, (byte)18); + supertile.getWorld().setEntityState(animal, (byte)18); } } } @@ -68,7 +74,7 @@ public class SubTilePollidisiac extends SubTileFunctional { @Override public RadiusDescriptor getRadius() { - return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE); + return new RadiusDescriptor.Square(toBlockPos(), RANGE); } @Override diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileRannuncarpus.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileRannuncarpus.java index f890fd778..4e8220288 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileRannuncarpus.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileRannuncarpus.java @@ -10,40 +10,41 @@ */ package vazkii.botania.common.block.subtile.functional; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.entity.item.EntityItem; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemBlockSpecial; import net.minecraft.item.ItemRedstone; -import net.minecraft.item.ItemReed; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; - +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraftforge.fml.relauncher.ReflectionHelper; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import org.lwjgl.opengl.GL11; - +import vazkii.botania.api.item.IFloatingFlower; import vazkii.botania.api.item.IFlowerPlaceable; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.subtile.ISubTileContainer; import vazkii.botania.api.subtile.RadiusDescriptor; import vazkii.botania.api.subtile.SubTileEntity; import vazkii.botania.api.subtile.SubTileFunctional; -import vazkii.botania.common.block.decor.IFloatingFlower; import vazkii.botania.common.core.handler.ConfigHandler; +import vazkii.botania.common.core.handler.MethodHandles; import vazkii.botania.common.item.block.ItemBlockSpecialFlower; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibObfuscation; -import cpw.mods.fml.relauncher.ReflectionHelper; + +import java.util.ArrayList; +import java.util.List; public class SubTileRannuncarpus extends SubTileFunctional { @@ -61,85 +62,86 @@ public class SubTileRannuncarpus extends SubTileFunctional { public void onUpdate() { super.onUpdate(); - if(redstoneSignal > 0) + if(supertile.getWorld().isRemote || redstoneSignal > 0) return; if(ticksExisted % 10 == 0) { - BlockData filter = getUnderlyingBlock(); + IBlockState filter = getUnderlyingBlock(); boolean scanned = false; - List validPositions = new ArrayList(); + List validPositions = new ArrayList<>(); int rangePlace = getRange(); int rangePlaceY = getRangeY(); - int x = supertile.xCoord; - int y = supertile.yCoord; - int z = supertile.zCoord; - - List items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x - RANGE, y - RANGE_Y, z - RANGE, x + RANGE + 1, y + RANGE_Y, z + RANGE + 1)); + BlockPos pos = supertile.getPos(); + + List items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE_Y, -RANGE), supertile.getPos().add(RANGE + 1, RANGE_Y + 1, RANGE + 1))); int slowdown = getSlowdownFactor(); for(EntityItem item : items) { - if(item.age < (60 + slowdown) || item.isDead) + int age; + try { + age = (int) MethodHandles.itemAge_getter.invokeExact(item); + } catch (Throwable t) { + continue; + } + + if(age < (60 + slowdown) || item.isDead) continue; ItemStack stack = item.getEntityItem(); Item stackItem = stack.getItem(); - if(stackItem instanceof ItemBlock || stackItem instanceof ItemReed || stackItem instanceof ItemRedstone || stackItem instanceof IFlowerPlaceable) { + if(stackItem instanceof ItemBlock || stackItem instanceof ItemBlockSpecial || stackItem instanceof ItemRedstone || stackItem instanceof IFlowerPlaceable) { if(!scanned) { - for(int i = -rangePlace; i < rangePlace + 1; i++) - for(int j = -rangePlaceY; j < rangePlaceY + 1; j++) - for(int l = -rangePlace; l < rangePlace + 1; l++) { - int xp = x + i; - int yp = y + j; - int zp = z + l; - Block blockAbove = supertile.getWorldObj().getBlock(xp, yp + 1, zp); - - if(filter.equals(supertile.getWorldObj(), xp, yp, zp) && (blockAbove.isAir(supertile.getWorldObj(), xp, yp + 1, zp) || blockAbove.isReplaceable(supertile.getWorldObj(), xp, yp + 1, zp))) - validPositions.add(new ChunkCoordinates(xp, yp + 1, zp)); - } + for(BlockPos pos_ : BlockPos.getAllInBox(pos.add(-rangePlace, -rangePlaceY, -rangePlace), pos.add(rangePlace, rangePlaceY, rangePlace))) { + IBlockState stateAbove = supertile.getWorld().getBlockState(pos_.up()); + Block blockAbove = stateAbove.getBlock(); + BlockPos up = pos_.up(); + if(filter == supertile.getWorld().getBlockState(pos_) + && (blockAbove.isAir(stateAbove, supertile.getWorld(), up) + || blockAbove.isReplaceable(supertile.getWorld(), up))) + validPositions.add(up); + } scanned = true; } - if(!validPositions.isEmpty() && !supertile.getWorldObj().isRemote) { - ChunkCoordinates coords = validPositions.get(supertile.getWorldObj().rand.nextInt(validPositions.size())); + if(!validPositions.isEmpty()) { + BlockPos coords = validPositions.get(supertile.getWorld().rand.nextInt(validPositions.size())); - Block blockToPlace = null; + IBlockState stateToPlace = null; if(stackItem instanceof IFlowerPlaceable) - blockToPlace = ((IFlowerPlaceable) stackItem).getBlockToPlaceByFlower(stack, this, coords.posX, coords.posY, coords.posZ); + stateToPlace = ((IFlowerPlaceable) stackItem).getBlockToPlaceByFlower(stack, this, coords); if(stackItem instanceof ItemBlock) - blockToPlace = ((ItemBlock) stackItem).field_150939_a; - else if(stackItem instanceof ItemReed) - blockToPlace = ReflectionHelper.getPrivateValue(ItemReed.class, (ItemReed) stackItem, LibObfuscation.REED_ITEM); + stateToPlace = ((ItemBlock) stackItem).block.getStateFromMeta(stackItem.getMetadata(stack.getItemDamage())); + else if(stackItem instanceof ItemBlockSpecial) + stateToPlace = ((Block) ReflectionHelper.getPrivateValue(ItemBlockSpecial.class, (ItemBlockSpecial) stackItem, LibObfuscation.REED_ITEM)).getDefaultState(); else if(stackItem instanceof ItemRedstone) - blockToPlace = Blocks.redstone_wire; + stateToPlace = Blocks.REDSTONE_WIRE.getDefaultState(); - if(blockToPlace != null) { - if(blockToPlace.canPlaceBlockAt(supertile.getWorldObj(), coords.posX, coords.posY, coords.posZ)) { - supertile.getWorldObj().setBlock(coords.posX, coords.posY, coords.posZ, blockToPlace, stack.getItemDamage(), 1 | 2); + if(stateToPlace != null) { + if(stateToPlace.getBlock().canPlaceBlockAt(supertile.getWorld(), coords)) { + supertile.getWorld().setBlockState(coords, stateToPlace, 1 | 2); if(ConfigHandler.blockBreakParticles) - supertile.getWorldObj().playAuxSFX(2001, coords.posX, coords.posY, coords.posZ, Block.getIdFromBlock(blockToPlace) + (stack.getItemDamage() << 12)); + supertile.getWorld().playEvent(2001, coords, Block.getStateId(stateToPlace)); validPositions.remove(coords); - TileEntity tile = supertile.getWorldObj().getTileEntity(coords.posX, coords.posY, coords.posZ); + TileEntity tile = supertile.getWorld().getTileEntity(coords); if(tile != null && tile instanceof ISubTileContainer) { ISubTileContainer container = (ISubTileContainer) tile; String subtileName = ItemBlockSpecialFlower.getType(stack); container.setSubTile(subtileName); SubTileEntity subtile = container.getSubTile(); - subtile.onBlockPlacedBy(supertile.getWorldObj(), coords.posX, coords.posY, coords.posZ, null, stack); + subtile.onBlockPlacedBy(supertile.getWorld(), coords, supertile.getWorld().getBlockState(coords), null, stack); } if(stackItem instanceof IFlowerPlaceable) - ((IFlowerPlaceable) stackItem).onBlockPlacedByFlower(stack, this, coords.posX, coords.posY, coords.posZ); + ((IFlowerPlaceable) stackItem).onBlockPlacedByFlower(stack, this, coords); - if(!supertile.getWorldObj().isRemote) { - stack.stackSize--; - if(stack.stackSize == 0) - item.setDead(); - } + stack.stackSize--; + if(stack.stackSize <= 0) + item.setDead(); if(mana > 1) mana--; @@ -152,8 +154,8 @@ public class SubTileRannuncarpus extends SubTileFunctional { } } - public BlockData getUnderlyingBlock() { - return new BlockData(supertile.getWorldObj(), supertile.xCoord, supertile.yCoord - (supertile instanceof IFloatingFlower ? 1 : 2), supertile.zCoord); + public IBlockState getUnderlyingBlock() { + return supertile.getWorld().getBlockState(supertile.getPos().down(supertile instanceof IFloatingFlower ? 1 : 2)); } @Override @@ -161,35 +163,36 @@ public class SubTileRannuncarpus extends SubTileFunctional { return true; } + @SideOnly(Side.CLIENT) @Override public void renderHUD(Minecraft mc, ScaledResolution res) { super.renderHUD(mc, res); - BlockData filter = getUnderlyingBlock(); - ItemStack recieverStack = new ItemStack(Item.getItemFromBlock(filter.block), 1, filter.meta); + IBlockState filter = getUnderlyingBlock(); + ItemStack recieverStack = new ItemStack(Item.getItemFromBlock(filter.getBlock()), 1, filter.getBlock().getMetaFromState(filter)); int color = getColor(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - if(recieverStack != null && recieverStack.getItem() != null) { + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if(recieverStack.getItem() != null) { String stackName = recieverStack.getDisplayName(); - int width = 16 + mc.fontRenderer.getStringWidth(stackName) / 2; + int width = 16 + mc.fontRendererObj.getStringWidth(stackName) / 2; int x = res.getScaledWidth() / 2 - width; int y = res.getScaledHeight() / 2 + 30; - mc.fontRenderer.drawStringWithShadow(stackName, x + 20, y + 5, color); + mc.fontRendererObj.drawStringWithShadow(stackName, x + 20, y + 5, color); RenderHelper.enableGUIStandardItemLighting(); - RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, recieverStack, x, y); + mc.getRenderItem().renderItemAndEffectIntoGUI(recieverStack, x, y); RenderHelper.disableStandardItemLighting(); } - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_BLEND); + GlStateManager.disableLighting(); + GlStateManager.disableBlend(); } @Override public RadiusDescriptor getRadius() { - return new RadiusDescriptor.Square(toChunkCoordinates(), getRange()); + return new RadiusDescriptor.Square(toBlockPos(), getRange()); } public int getRange() { @@ -220,24 +223,4 @@ public class SubTileRannuncarpus extends SubTileFunctional { @Override public int getRangeY() { return RANGE_PLACE_Y_MINI; } } - static class BlockData { - - Block block; - int meta; - - public BlockData(World world, int x, int y, int z) { - block = world.getBlock(x, y, z); - meta = world.getBlockMetadata(x, y, z); - } - - public boolean equals(BlockData data) { - return block == data.block && meta == data.meta; - } - - public boolean equals(World world, int x, int y, int z) { - return equals(new BlockData(world, x, y, z)); - } - - } - } diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileSolegnolia.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileSolegnolia.java index 9ad426e52..232d0b234 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileSolegnolia.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileSolegnolia.java @@ -10,24 +10,23 @@ */ package vazkii.botania.common.block.subtile.functional; -import java.util.Collections; -import java.util.Set; -import java.util.WeakHashMap; - +import com.google.common.collect.MapMaker; import net.minecraft.entity.Entity; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.subtile.RadiusDescriptor; import vazkii.botania.api.subtile.SubTileFunctional; -import vazkii.botania.common.core.helper.MathHelper; import vazkii.botania.common.lexicon.LexiconData; +import java.util.Collections; +import java.util.Set; +import java.util.WeakHashMap; + public class SubTileSolegnolia extends SubTileFunctional { private static final double RANGE = 5; private static final double RANGE_MINI = 1; - public static Set existingFlowers = Collections.newSetFromMap(new WeakHashMap()); - private static boolean registered = false; + private static final Set existingFlowers = Collections.newSetFromMap(new MapMaker().concurrencyLevel(2).weakKeys().makeMap()); @Override public void onUpdate() { @@ -35,8 +34,6 @@ public class SubTileSolegnolia extends SubTileFunctional { if(!existingFlowers.contains(this)) { existingFlowers.add(this); - if(!registered) - registered = true; } } @@ -46,16 +43,12 @@ public class SubTileSolegnolia extends SubTileFunctional { } public static boolean hasSolegnoliaAround(Entity e) { - for(SubTileSolegnolia flower : existingFlowers) { - if(flower.redstoneSignal > 0 || flower.supertile.getWorldObj() != e.worldObj || flower.supertile.getWorldObj().getTileEntity(flower.supertile.xCoord, flower.supertile.yCoord, flower.supertile.zCoord) != flower.supertile) - continue; - - double range = flower.getRange(); - if(MathHelper.pointDistanceSpace(e.posX, e.posY, e.posZ, flower.supertile.xCoord + 0.5, flower.supertile.yCoord + 0.5, flower.supertile.zCoord + 0.5) <= range) - return true; - } - - return false; + return existingFlowers.stream() + .filter(f -> f.redstoneSignal == 0) + .filter(f -> f.supertile.getWorld() == e.worldObj) + .filter(f -> f.supertile.getWorld().getTileEntity(f.supertile.getPos()) == f.supertile) + .filter(f -> f.supertile.getDistanceSq(e.posX, e.posY, e.posZ) <= f.getRange() * f.getRange()) + .findAny().isPresent(); } @Override @@ -74,7 +67,7 @@ public class SubTileSolegnolia extends SubTileFunctional { @Override public RadiusDescriptor getRadius() { - return new RadiusDescriptor.Circle(toChunkCoordinates(), getRange()); + return new RadiusDescriptor.Circle(toBlockPos(), getRange()); } @Override diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileSpectranthemum.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileSpectranthemum.java index d89696490..70a14decd 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileSpectranthemum.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileSpectranthemum.java @@ -10,24 +10,28 @@ */ package vazkii.botania.common.block.subtile.functional; -import java.util.List; - import net.minecraft.client.Minecraft; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.mana.IManaItem; import vazkii.botania.api.subtile.RadiusDescriptor; import vazkii.botania.api.subtile.SubTileFunctional; +import vazkii.botania.common.core.handler.MethodHandles; import vazkii.botania.common.core.helper.MathHelper; import vazkii.botania.common.lexicon.LexiconData; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import vazkii.botania.common.network.PacketBotaniaEffect; +import vazkii.botania.common.network.PacketHandler; + +import java.util.List; public class SubTileSpectranthemum extends SubTileFunctional { @@ -41,23 +45,29 @@ public class SubTileSpectranthemum extends SubTileFunctional { private static final String TAG_TELEPORTED = "Botania_TPd"; - int bindX, bindY = -1, bindZ; + private BlockPos bindPos = new BlockPos(0, -1, 0); @Override public void onUpdate() { super.onUpdate(); - if(redstoneSignal == 0 && supertile.getWorldObj().blockExists(bindX, bindY, bindZ)) { - int x = supertile.xCoord; - int y = supertile.yCoord; - int z = supertile.zCoord; + if(!supertile.getWorld().isRemote && redstoneSignal == 0 && supertile.getWorld().isBlockLoaded(bindPos)) { + BlockPos pos = supertile.getPos(); boolean did = false; - List items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x - RANGE, y - RANGE, z - RANGE, x + RANGE + 1, y + RANGE, z + RANGE + 1)); + + List items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos.add(-RANGE, -RANGE, -RANGE), pos.add(RANGE + 1, RANGE + 1, RANGE + 1))); int slowdown = getSlowdownFactor(); for(EntityItem item : items) { - if(item.age < (60 + slowdown) || item.isDead || item.getEntityData().getBoolean(TAG_TELEPORTED)) + int age; + try { + age = (int) MethodHandles.itemAge_getter.invokeExact(item); + } catch (Throwable t) { + continue; + } + + if(age < (60 + slowdown) || item.isDead || item.getEntityData().getBoolean(TAG_TELEPORTED)) continue; ItemStack stack = item.getEntityItem(); @@ -69,14 +79,12 @@ public class SubTileSpectranthemum extends SubTileFunctional { int cost = stack.stackSize * COST; if(mana >= cost) { spawnExplosionParticles(item, 10); - item.setPosition(bindX + 0.5, bindY + 1.5, bindZ + 0.5); + item.setPosition(bindPos.getX() + 0.5, bindPos.getY() + 1.5, bindPos.getZ() + 0.5); item.getEntityData().setBoolean(TAG_TELEPORTED, true); item.motionX = item.motionY = item.motionZ = 0; spawnExplosionParticles(item, 10); - if(!supertile.getWorldObj().isRemote) { - mana -= cost; - did = true; - } + mana -= cost; + did = true; } } } @@ -86,36 +94,32 @@ public class SubTileSpectranthemum extends SubTileFunctional { } } - public static void spawnExplosionParticles(EntityItem item, int p) { - for(int i = 0; i < p; i++) { - double m = 0.01; - double d0 = item.worldObj.rand.nextGaussian() * m; - double d1 = item.worldObj.rand.nextGaussian() * m; - double d2 = item.worldObj.rand.nextGaussian() * m; - double d3 = 10.0D; - item.worldObj.spawnParticle("explode", item.posX + item.worldObj.rand.nextFloat() * item.width * 2.0F - item.width - d0 * d3, item.posY + item.worldObj.rand.nextFloat() * item.height - d1 * d3, item.posZ + item.worldObj.rand.nextFloat() * item.width * 2.0F - item.width - d2 * d3, d0, d1, d2); - } + static void spawnExplosionParticles(EntityItem item, int p) { + PacketHandler.sendToNearby(item.worldObj, new BlockPos(item), + new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.ITEM_SMOKE, item.posX, item.posY, item.posZ, item.getEntityId(), p)); } @Override public RadiusDescriptor getRadius() { - return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE); + return new RadiusDescriptor.Square(toBlockPos(), RANGE); } @Override public void writeToPacketNBT(NBTTagCompound cmp) { super.writeToPacketNBT(cmp); - cmp.setInteger(TAG_BIND_X, bindX); - cmp.setInteger(TAG_BIND_Y, bindY); - cmp.setInteger(TAG_BIND_Z, bindZ); + cmp.setInteger(TAG_BIND_X, bindPos.getX()); + cmp.setInteger(TAG_BIND_Y, bindPos.getY()); + cmp.setInteger(TAG_BIND_Z, bindPos.getZ()); } @Override public void readFromPacketNBT(NBTTagCompound cmp) { super.readFromPacketNBT(cmp); - bindX = cmp.getInteger(TAG_BIND_X); - bindY = cmp.getInteger(TAG_BIND_Y); - bindZ = cmp.getInteger(TAG_BIND_Z); + bindPos = new BlockPos( + cmp.getInteger(TAG_BIND_X), + cmp.getInteger(TAG_BIND_Y), + cmp.getInteger(TAG_BIND_Z) + ); } @Override @@ -134,13 +138,11 @@ public class SubTileSpectranthemum extends SubTileFunctional { } @Override - public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { - boolean bound = super.bindTo(player, wand, x, y, z, side); + public boolean bindTo(EntityPlayer player, ItemStack wand, BlockPos pos, EnumFacing side) { + boolean bound = super.bindTo(player, wand, pos, side); - if(!bound && (x != bindX || y != bindY || z != bindZ) && MathHelper.pointDistanceSpace(x, y, z, supertile.xCoord, supertile.yCoord, supertile.zCoord) <= BIND_RANGE && (x != supertile.xCoord || y != supertile.yCoord || z != supertile.zCoord)) { - bindX = x; - bindY = y; - bindZ = z; + if(!bound && !pos.equals(bindPos) && pos.distanceSq(supertile.getPos()) <= BIND_RANGE * BIND_RANGE && !(pos.equals(supertile.getPos()))) { + bindPos = pos; sync(); return true; @@ -151,8 +153,8 @@ public class SubTileSpectranthemum extends SubTileFunctional { @Override @SideOnly(Side.CLIENT) - public ChunkCoordinates getBinding() { - return Minecraft.getMinecraft().thePlayer.isSneaking() && bindY != -1 ? new ChunkCoordinates(bindX, bindY, bindZ) : super.getBinding(); + public BlockPos getBinding() { + return Minecraft.getMinecraft().thePlayer.isSneaking() && bindPos.getY() != -1 ? bindPos : super.getBinding(); } @Override diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileTangleberrie.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileTangleberrie.java index 7959ee403..bc19f9532 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileTangleberrie.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileTangleberrie.java @@ -10,12 +10,9 @@ */ package vazkii.botania.common.block.subtile.functional; -import java.util.List; - import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.boss.IBossDisplayData; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.math.AxisAlignedBB; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.subtile.RadiusDescriptor; import vazkii.botania.api.subtile.SubTileFunctional; @@ -24,6 +21,8 @@ import vazkii.botania.common.core.helper.MathHelper; import vazkii.botania.common.core.helper.Vector3; import vazkii.botania.common.lexicon.LexiconData; +import java.util.List; + public class SubTileTangleberrie extends SubTileFunctional { @Override @@ -31,18 +30,18 @@ public class SubTileTangleberrie extends SubTileFunctional { super.onUpdate(); if(mana > 0) { - double x1 = supertile.xCoord + 0.5; - double y1 = supertile.yCoord + 0.5; - double z1 = supertile.zCoord + 0.5; + double x1 = supertile.getPos().getX() + 0.5; + double y1 = supertile.getPos().getY() + 0.5; + double z1 = supertile.getPos().getZ() + 0.5; double maxDist = getMaxDistance(); double range = getRange(); - AxisAlignedBB boundingBox = AxisAlignedBB.getBoundingBox(x1 - range, y1 - range, z1 - range, x1 + range + 1, y1 + range + 1, z1 + range + 1); - List entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLivingBase.class, boundingBox); + AxisAlignedBB boundingBox = new AxisAlignedBB(x1 - range, y1 - range, z1 - range, x1 + range + 1, y1 + range + 1, z1 + range + 1); + List entities = supertile.getWorld().getEntitiesWithinAABB(EntityLivingBase.class, boundingBox); for(EntityLivingBase entity : entities) { - if(entity instanceof EntityPlayer || entity instanceof IBossDisplayData) + if(entity instanceof EntityPlayer || !entity.isNonBoss()) continue; double x2 = entity.posX; @@ -53,8 +52,8 @@ public class SubTileTangleberrie extends SubTileFunctional { if(distance > maxDist && distance < range) { MathHelper.setEntityMotionFromVector(entity, new Vector3(x1, y1, z1), getMotionVelocity()); - if(supertile.getWorldObj().rand.nextInt(3) == 0) - Botania.proxy.sparkleFX(supertile.getWorldObj(), x2 + Math.random() * entity.width, y2 + Math.random() * entity.height, z2 + Math.random() * entity.width, 0.5F, 0.5F, 0.5F, 1F, 3); + if(supertile.getWorld().rand.nextInt(3) == 0) + Botania.proxy.sparkleFX(x2 + Math.random() * entity.width, y2 + Math.random() * entity.height, z2 + Math.random() * entity.width, 0.5F, 0.5F, 0.5F, 1F, 3); } } @@ -79,7 +78,7 @@ public class SubTileTangleberrie extends SubTileFunctional { @Override public RadiusDescriptor getRadius() { - return new RadiusDescriptor.Circle(toChunkCoordinates(), getRange()); + return new RadiusDescriptor.Circle(toBlockPos(), getRange()); } @Override diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileTigerseye.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileTigerseye.java index 07b01ed5f..03ae75762 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileTigerseye.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileTigerseye.java @@ -10,9 +10,6 @@ */ package vazkii.botania.common.block.subtile.functional; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.entity.EntityLiving; import net.minecraft.entity.ai.EntityAIAvoidEntity; import net.minecraft.entity.ai.EntityAINearestAttackableTarget; @@ -21,13 +18,16 @@ import net.minecraft.entity.item.EntityEnderCrystal; import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.passive.EntityOcelot; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraftforge.fml.relauncher.ReflectionHelper; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.subtile.RadiusDescriptor; import vazkii.botania.api.subtile.SubTileFunctional; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lib.LibObfuscation; -import cpw.mods.fml.relauncher.ReflectionHelper; + +import java.util.ArrayList; +import java.util.List; public class SubTileTigerseye extends SubTileFunctional { @@ -37,15 +37,19 @@ public class SubTileTigerseye extends SubTileFunctional { @Override public void onUpdate() { super.onUpdate(); + + if(supertile.getWorld().isRemote) + return; + final int cost = 70; boolean shouldAfffect = mana >= cost; - List entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord - RANGE_Y, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE_Y + 1, supertile.zCoord + RANGE + 1)); + List entities = supertile.getWorld().getEntitiesWithinAABB(EntityLiving.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE_Y, -RANGE), supertile.getPos().add(RANGE + 1, RANGE_Y + 1, RANGE + 1))); for(EntityLiving entity : entities) { - List entries = new ArrayList(entity.tasks.taskEntries); - entries.addAll(new ArrayList(entity.targetTasks.taskEntries)); + List entries = new ArrayList<>(entity.tasks.taskEntries); + entries.addAll(entity.targetTasks.taskEntries); boolean avoidsOcelots = false; if(shouldAfffect) @@ -85,7 +89,7 @@ public class SubTileTigerseye extends SubTileFunctional { @Override public RadiusDescriptor getRadius() { - return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE); + return new RadiusDescriptor.Square(toBlockPos(), RANGE); } @Override diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileVinculotus.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileVinculotus.java index 74110d252..a622e8b96 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileVinculotus.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileVinculotus.java @@ -10,25 +10,25 @@ */ package vazkii.botania.common.block.subtile.functional; +import net.minecraft.entity.monster.EntityEnderman; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.living.EnderTeleportEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.api.subtile.RadiusDescriptor; +import vazkii.botania.api.subtile.SubTileFunctional; +import vazkii.botania.common.core.helper.MathHelper; +import vazkii.botania.common.lexicon.LexiconData; + import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Set; import java.util.WeakHashMap; -import net.minecraft.entity.monster.EntityEnderman; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.living.EnderTeleportEvent; -import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.api.subtile.RadiusDescriptor; -import vazkii.botania.api.subtile.SubTileFunctional; -import vazkii.botania.common.core.helper.MathHelper; -import vazkii.botania.common.lexicon.LexiconData; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - public class SubTileVinculotus extends SubTileFunctional { - public static Set existingFlowers = Collections.newSetFromMap(new WeakHashMap()); + public static final Set existingFlowers = Collections.newSetFromMap(new WeakHashMap<>()); private static boolean registered = false; private static final int RANGE = 64; @@ -36,10 +36,10 @@ public class SubTileVinculotus extends SubTileFunctional { public void onUpdate() { super.onUpdate(); - if(!existingFlowers.contains(this)) { + if(!supertile.getWorld().isRemote && !existingFlowers.contains(this)) { existingFlowers.add(this); if(!registered) { - MinecraftForge.EVENT_BUS.register(new EndermanIntercepter()); + MinecraftForge.EVENT_BUS.register(EndermanIntercepter.class); registered = true; } } @@ -47,7 +47,7 @@ public class SubTileVinculotus extends SubTileFunctional { @Override public RadiusDescriptor getRadius() { - return new RadiusDescriptor.Circle(toChunkCoordinates(), RANGE); + return new RadiusDescriptor.Circle(toBlockPos(), RANGE); } @Override @@ -73,36 +73,33 @@ public class SubTileVinculotus extends SubTileFunctional { public static class EndermanIntercepter { @SubscribeEvent - public void onEndermanTeleport(EnderTeleportEvent event) { - if(event.entity.worldObj.isRemote) - return; - + public static void onEndermanTeleport(EnderTeleportEvent event) { int cost = 50; - if(event.entity instanceof EntityEnderman) { - List possibleFlowers = new ArrayList(); + if(event.getEntityLiving() instanceof EntityEnderman) { + List possibleFlowers = new ArrayList<>(); for(SubTileVinculotus flower : existingFlowers) { - if(flower.redstoneSignal > 0 || flower.mana <= cost || flower.supertile.getWorldObj() != event.entity.worldObj || flower.supertile.getWorldObj().getTileEntity(flower.supertile.xCoord, flower.supertile.yCoord, flower.supertile.zCoord) != flower.supertile) + if(flower.redstoneSignal > 0 || flower.mana <= cost || flower.supertile.getWorld() != event.getEntityLiving().worldObj || flower.supertile.getWorld().getTileEntity(flower.supertile.getPos()) != flower.supertile) continue; - double x = flower.supertile.xCoord + 0.5; - double y = flower.supertile.yCoord + 1.5; - double z = flower.supertile.zCoord + 0.5; + double x = flower.supertile.getPos().getX() + 0.5; + double y = flower.supertile.getPos().getY() + 1.5; + double z = flower.supertile.getPos().getZ() + 0.5; - if(MathHelper.pointDistanceSpace(x, y, z, event.targetX, event.targetY, event.targetZ) < RANGE) + if(MathHelper.pointDistanceSpace(x, y, z, event.getTargetX(), event.getTargetY(), event.getTargetZ()) < RANGE) possibleFlowers.add(flower); } if(!possibleFlowers.isEmpty()) { - SubTileVinculotus flower = possibleFlowers.get(event.entity.worldObj.rand.nextInt(possibleFlowers.size())); + SubTileVinculotus flower = possibleFlowers.get(event.getEntityLiving().worldObj.rand.nextInt(possibleFlowers.size())); - double x = flower.supertile.xCoord + 0.5; - double y = flower.supertile.yCoord + 1.5; - double z = flower.supertile.zCoord + 0.5; + double x = flower.supertile.getPos().getX() + 0.5; + double y = flower.supertile.getPos().getY() + 1.5; + double z = flower.supertile.getPos().getZ() + 0.5; - event.targetX = x + Math.random() * 3 - 1; - event.targetY = y; - event.targetZ = z + Math.random() * 3 - 1; + event.setTargetX(x + Math.random() * 3 - 1); + event.setTargetY(y); + event.setTargetZ(z + Math.random() * 3 - 1); flower.mana -= cost; flower.sync(); } diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileArcaneRose.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileArcaneRose.java index 08b5701c2..cbb8a88c0 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileArcaneRose.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileArcaneRose.java @@ -10,16 +10,16 @@ */ package vazkii.botania.common.block.subtile.generating; -import java.util.List; - import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.math.AxisAlignedBB; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.subtile.RadiusDescriptor; import vazkii.botania.api.subtile.SubTileGenerating; import vazkii.botania.common.core.helper.ExperienceHelper; import vazkii.botania.common.lexicon.LexiconData; +import java.util.List; + public class SubTileArcaneRose extends SubTileGenerating { private static final int RANGE = 1; @@ -31,7 +31,7 @@ public class SubTileArcaneRose extends SubTileGenerating { if(mana >= getMaxMana()) return; - List players = supertile.getWorldObj().getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + 1, supertile.zCoord + RANGE + 1)); + List players = supertile.getWorld().getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1))); for(EntityPlayer player : players) if(ExperienceHelper.getPlayerXP(player) >= 1 && player.onGround) { ExperienceHelper.drainPlayerXP(player, 1); @@ -42,7 +42,7 @@ public class SubTileArcaneRose extends SubTileGenerating { @Override public RadiusDescriptor getRadius() { - return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE); + return new RadiusDescriptor.Square(toBlockPos(), RANGE); } @Override diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileDandelifeon.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileDandelifeon.java index a6adf90b3..99764bb30 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileDandelifeon.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileDandelifeon.java @@ -10,11 +10,10 @@ */ package vazkii.botania.common.block.subtile.generating; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.subtile.RadiusDescriptor; @@ -23,6 +22,9 @@ import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.tile.TileCell; import vazkii.botania.common.lexicon.LexiconData; +import java.util.ArrayList; +import java.util.List; + public class SubTileDandelifeon extends SubTileGenerating { private static final int RANGE = 12; @@ -45,13 +47,13 @@ public class SubTileDandelifeon extends SubTileGenerating { public void onUpdate() { super.onUpdate(); - if(!supertile.getWorldObj().isRemote && redstoneSignal > 0 && ticksExisted % SPEED == 0) + if(!supertile.getWorld().isRemote && redstoneSignal > 0 && ticksExisted % SPEED == 0) runSimulation(); } void runSimulation() { int[][] table = getCellTable(); - List changes = new ArrayList(); + List changes = new ArrayList<>(); new ArrayList(); boolean wipe = false; @@ -85,20 +87,17 @@ public class SubTileDandelifeon extends SubTileGenerating { } } - int x = supertile.xCoord; - int y = supertile.yCoord; - int z = supertile.zCoord; + BlockPos pos = supertile.getPos(); for(int[] change : changes) { - int px = x - RANGE + change[0]; - int pz = z - RANGE + change[1]; + BlockPos pos_ = pos.add(-RANGE + change[0], 0, -RANGE + change[1]); int val = change[2]; if(val != -2 && wipe) val = -1; int old = change[3]; - setBlockForGeneration(px, y, pz, val, old); + setBlockForGeneration(pos_, val, old); } } @@ -106,22 +105,19 @@ public class SubTileDandelifeon extends SubTileGenerating { int diam = RANGE * 2 + 1; int[][] table = new int[diam][diam]; - int x = supertile.xCoord; - int y = supertile.yCoord; - int z = supertile.zCoord; + BlockPos pos = supertile.getPos(); for(int i = 0; i < diam; i++) for(int j = 0; j < diam; j++) { - int px = x - RANGE + i; - int pz = z - RANGE + j; - table[i][j] = getCellGeneration(px, y, pz); + BlockPos pos_ = pos.add(-RANGE + i, 0, -RANGE + j); + table[i][j] = getCellGeneration(pos_); } return table; } - int getCellGeneration(int x, int y, int z) { - TileEntity tile = supertile.getWorldObj().getTileEntity(x, y, z); + int getCellGeneration(BlockPos pos) { + TileEntity tile = supertile.getWorld().getTileEntity(pos); if(tile instanceof TileCell) return ((TileCell) tile).isSameFlower(supertile) ? ((TileCell) tile).getGeneration() : 0; @@ -162,21 +158,22 @@ public class SubTileDandelifeon extends SubTileGenerating { return x < 0 || z < 0 || x >= table.length || z >= table[0].length; } - void setBlockForGeneration(int x, int y, int z, int gen, int prevGen) { - World world = supertile.getWorldObj(); - Block blockAt = world.getBlock(x, y, z); - TileEntity tile = world.getTileEntity(x, y, z); + void setBlockForGeneration(BlockPos pos, int gen, int prevGen) { + World world = supertile.getWorld(); + IBlockState stateAt = world.getBlockState(pos); + Block blockAt = stateAt.getBlock(); + TileEntity tile = world.getTileEntity(pos); if(gen == -2) { int val = prevGen * MANA_PER_GEN; mana = Math.min(getMaxMana(), mana + val); //world.setBlockToAir(x, y, z); } else if(blockAt == ModBlocks.cellBlock) { if(gen < 0 || gen > MAX_GENERATIONS) - world.setBlockToAir(x, y, z); + world.setBlockToAir(pos); else ((TileCell) tile).setGeneration(supertile, gen); - } else if(gen >= 0 && blockAt.isAir(supertile.getWorldObj(), x, y, z)) { - world.setBlock(x, y, z, ModBlocks.cellBlock); - tile = world.getTileEntity(x, y, z); + } else if(gen >= 0 && blockAt.isAir(stateAt, supertile.getWorld(), pos)) { + world.setBlockState(pos, ModBlocks.cellBlock.getDefaultState()); + tile = world.getTileEntity(pos); ((TileCell) tile).setGeneration(supertile, gen); } } @@ -188,7 +185,7 @@ public class SubTileDandelifeon extends SubTileGenerating { @Override public RadiusDescriptor getRadius() { - return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE); + return new RadiusDescriptor.Square(toBlockPos(), RANGE); } @Override diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileDaybloom.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileDaybloom.java deleted file mode 100644 index aa9723c09..000000000 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileDaybloom.java +++ /dev/null @@ -1,129 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 25, 2014, 3:09:35 PM (GMT)] - */ -package vazkii.botania.common.block.subtile.generating; - -import java.util.ArrayList; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.api.subtile.signature.PassiveFlower; -import vazkii.botania.common.lexicon.LexiconData; - -@PassiveFlower -public class SubTileDaybloom extends SubTilePassiveGenerating { - - private static final String TAG_PRIME_POSITION_X = "primePositionX"; - private static final String TAG_PRIME_POSITION_Y = "primePositionY"; - private static final String TAG_PRIME_POSITION_Z = "primePositionZ"; - private static final String TAG_SAVED_POSITION = "savedPosition"; - - int primePositionX, primePositionY, primePositionZ; - boolean savedPosition; - - @Override - public int getColor() { - return 0xFFFF00; - } - - @Override - public void onUpdate() { - super.onUpdate(); - - if(isPrime() && (!savedPosition || primePositionX != supertile.xCoord || primePositionY != supertile.yCoord || primePositionZ != supertile.zCoord)) - supertile.getWorldObj().setBlockToAir(supertile.xCoord, supertile.yCoord, supertile.zCoord); - } - - public void setPrimusPosition() { - primePositionX = supertile.xCoord; - primePositionY = supertile.yCoord; - primePositionZ = supertile.zCoord; - - savedPosition = true; - } - - @Override - public ArrayList getDrops(ArrayList list) { - if(isPrime()) - list.clear(); - - return super.getDrops(list); - } - - @Override - public boolean canGeneratePassively() { - boolean rain = supertile.getWorldObj().getWorldChunkManager().getBiomeGenAt(supertile.xCoord, supertile.zCoord).getIntRainfall() > 0 && (supertile.getWorldObj().isRaining() || supertile.getWorldObj().isThundering()); - return supertile.getWorldObj().isDaytime() && !rain && supertile.getWorldObj().canBlockSeeTheSky(supertile.xCoord, supertile.yCoord + 1, supertile.zCoord); - } - - @Override - public int getDelayBetweenPassiveGeneration() { - return isPrime() ? 10 : 12; - } - - @Override - public void writeToPacketNBT(NBTTagCompound cmp) { - super.writeToPacketNBT(cmp); - - if(isPrime()) { - cmp.setInteger(TAG_PRIME_POSITION_X, primePositionX); - cmp.setInteger(TAG_PRIME_POSITION_Y, primePositionY); - cmp.setInteger(TAG_PRIME_POSITION_Z, primePositionZ); - cmp.setBoolean(TAG_SAVED_POSITION, savedPosition); - } - } - - @Override - public void readFromPacketNBT(NBTTagCompound cmp) { - super.readFromPacketNBT(cmp); - - if(isPrime()) { - primePositionX = cmp.getInteger(TAG_PRIME_POSITION_X); - primePositionY = cmp.getInteger(TAG_PRIME_POSITION_Y); - primePositionZ = cmp.getInteger(TAG_PRIME_POSITION_Z); - savedPosition = cmp.getBoolean(TAG_SAVED_POSITION); - } - } - - @Override - public boolean shouldSyncPassiveGeneration() { - return true; - } - - @Override - public boolean isPassiveFlower() { - return !isPrime(); - } - - @Override - public LexiconEntry getEntry() { - return LexiconData.daybloom; - } - - public boolean isPrime() { - return false; - } - - public static class Prime extends SubTileDaybloom { - - @Override - public boolean isPrime() { - return true; - } - - @Override - public LexiconEntry getEntry() { - return LexiconData.primusLoci; - } - - } - -} diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileEndoflame.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileEndoflame.java index 9210b93e6..13254e612 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileEndoflame.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileEndoflame.java @@ -10,21 +10,24 @@ */ package vazkii.botania.common.block.subtile.generating; -import java.util.List; - import net.minecraft.entity.item.EntityItem; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntityFurnace; -import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.AxisAlignedBB; import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.api.sound.BotaniaSoundEvents; import vazkii.botania.api.subtile.RadiusDescriptor; import vazkii.botania.api.subtile.SubTileGenerating; -import vazkii.botania.common.Botania; import vazkii.botania.common.block.ModBlocks; +import vazkii.botania.common.core.handler.MethodHandles; import vazkii.botania.common.lexicon.LexiconData; +import java.util.List; + public class SubTileEndoflame extends SubTileGenerating { private static final String TAG_BURN_TIME = "burnTime"; @@ -43,10 +46,17 @@ public class SubTileEndoflame extends SubTileGenerating { boolean didSomething = false; int slowdown = getSlowdownFactor(); - - List items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1)); + + List items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1))); for(EntityItem item : items) { - if(item.age >= (59 + slowdown) && !item.isDead) { + int age; + try { + age = (int) MethodHandles.itemAge_getter.invokeExact(item); + } catch (Throwable t) { + continue; + } + + if(age >= (59 + slowdown) && !item.isDead) { ItemStack stack = item.getEntityItem(); if(stack.getItem().hasContainerItem(stack)) continue; @@ -55,17 +65,17 @@ public class SubTileEndoflame extends SubTileGenerating { if(burnTime > 0 && stack.stackSize > 0) { this.burnTime = Math.min(FUEL_CAP, burnTime) / 2; - if(!supertile.getWorldObj().isRemote) { + if(!supertile.getWorld().isRemote) { stack.stackSize--; - supertile.getWorldObj().playSoundEffect(supertile.xCoord, supertile.yCoord, supertile.zCoord, "botania:endoflame", 0.2F, 1F); + supertile.getWorld().playSound(null, supertile.getPos(), BotaniaSoundEvents.endoflame, SoundCategory.BLOCKS, 0.2F, 1F); if(stack.stackSize == 0) item.setDead(); didSomething = true; } else { - item.worldObj.spawnParticle("largesmoke", item.posX, item.posY + 0.1, item.posZ, 0.0D, 0.0D, 0.0D); - item.worldObj.spawnParticle("flame", item.posX, item.posY, item.posZ, 0.0D, 0.0D, 0.0D); + item.worldObj.spawnParticle(EnumParticleTypes.SMOKE_LARGE, item.posX, item.posY + 0.1, item.posZ, 0.0D, 0.0D, 0.0D); + item.worldObj.spawnParticle(EnumParticleTypes.FLAME, item.posX, item.posY, item.posZ, 0.0D, 0.0D, 0.0D); } @@ -78,8 +88,8 @@ public class SubTileEndoflame extends SubTileGenerating { sync(); } } else { - if(supertile.getWorldObj().rand.nextInt(10) == 0) - supertile.getWorldObj().spawnParticle("flame", supertile.xCoord + 0.4 + Math.random() * 0.2, supertile.yCoord + 0.65, supertile.zCoord + 0.4 + Math.random() * 0.2, 0.0D, 0.0D, 0.0D); + if(supertile.getWorld().rand.nextInt(10) == 0) + supertile.getWorld().spawnParticle(EnumParticleTypes.FLAME, supertile.getPos().getX() + 0.4 + Math.random() * 0.2, supertile.getPos().getY() + 0.65, supertile.getPos().getZ() + 0.4 + Math.random() * 0.2, 0.0D, 0.0D, 0.0D); burnTime--; } @@ -103,7 +113,7 @@ public class SubTileEndoflame extends SubTileGenerating { @Override public RadiusDescriptor getRadius() { - return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE); + return new RadiusDescriptor.Square(toBlockPos(), RANGE); } @Override diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileEntropinnyum.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileEntropinnyum.java index 37e81be64..58bcaf92d 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileEntropinnyum.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileEntropinnyum.java @@ -10,16 +10,20 @@ */ package vazkii.botania.common.block.subtile.generating; -import java.util.List; - import net.minecraft.entity.item.EntityTNTPrimed; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MathHelper; +import net.minecraft.init.SoundEvents; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.subtile.RadiusDescriptor; import vazkii.botania.api.subtile.SubTileGenerating; import vazkii.botania.common.Botania; import vazkii.botania.common.lexicon.LexiconData; +import vazkii.botania.common.network.PacketBotaniaEffect; +import vazkii.botania.common.network.PacketHandler; + +import java.util.List; public class SubTileEntropinnyum extends SubTileGenerating { @@ -29,22 +33,16 @@ public class SubTileEntropinnyum extends SubTileGenerating { public void onUpdate() { super.onUpdate(); - if(mana == 0) { - List tnts = supertile.getWorldObj().getEntitiesWithinAABB(EntityTNTPrimed.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1)); + if(!supertile.getWorld().isRemote && mana == 0) { + List tnts = supertile.getWorld().getEntitiesWithinAABB(EntityTNTPrimed.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1))); for(EntityTNTPrimed tnt : tnts) { - if(tnt.fuse == 1 && !tnt.isDead && !supertile.getWorldObj().getBlock(MathHelper.floor_double(tnt.posX), MathHelper.floor_double(tnt.posY), MathHelper.floor_double(tnt.posZ)).getMaterial().isLiquid()) { - if(!supertile.getWorldObj().isRemote) { - tnt.setDead(); - mana += getMaxMana(); - supertile.getWorldObj().playSoundEffect(tnt.posX, tnt.posY, tnt.posZ, "random.explode", 0.2F, (1F + (supertile.getWorldObj().rand.nextFloat() - supertile.getWorldObj().rand.nextFloat()) * 0.2F) * 0.7F); - sync(); - } + if(tnt.getFuse() == 1 && !tnt.isDead && !supertile.getWorld().getBlockState(new BlockPos(tnt)).getMaterial().isLiquid()) { + tnt.playSound(SoundEvents.ENTITY_GENERIC_EXPLODE, 0.2F, (1F + (supertile.getWorld().rand.nextFloat() - supertile.getWorld().rand.nextFloat()) * 0.2F) * 0.7F); + tnt.setDead(); + mana += getMaxMana(); + sync(); - for(int i = 0; i < 50; i++) - Botania.proxy.sparkleFX(tnt.worldObj, tnt.posX + Math.random() * 4 - 2, tnt.posY + Math.random() * 4 - 2, tnt.posZ + Math.random() * 4 - 2, 1F, (float) Math.random() * 0.25F, (float) Math.random() * 0.25F, (float) (Math.random() * 0.65F + 1.25F), 12); - - supertile.getWorldObj().spawnParticle("hugeexplosion", tnt.posX, tnt.posY, tnt.posZ, 1D, 0D, 0D); - return; + PacketHandler.sendToNearby(supertile.getWorld(), supertile.getPos(), new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.ENTROPINNYUM, tnt.posX, tnt.posY, tnt.posZ)); } } } @@ -62,8 +60,8 @@ public class SubTileEntropinnyum extends SubTileGenerating { @Override public RadiusDescriptor getRadius() { - return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE); - }; + return new RadiusDescriptor.Square(toBlockPos(), RANGE); + } @Override public LexiconEntry getEntry() { diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileGourmaryllis.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileGourmaryllis.java index 5109539e7..2f9287b1d 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileGourmaryllis.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileGourmaryllis.java @@ -10,19 +10,23 @@ */ package vazkii.botania.common.block.subtile.generating; -import java.util.List; - import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.SoundEvents; import net.minecraft.item.Item; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.world.WorldServer; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.subtile.RadiusDescriptor; import vazkii.botania.api.subtile.SubTileGenerating; +import vazkii.botania.common.core.handler.MethodHandles; import vazkii.botania.common.lexicon.LexiconData; +import java.util.List; + public class SubTileGourmaryllis extends SubTileGenerating { private static final String TAG_COOLDOWN = "cooldown"; @@ -35,41 +39,42 @@ public class SubTileGourmaryllis extends SubTileGenerating { public void onUpdate() { super.onUpdate(); - if(cooldown > 0) + if (supertile.getWorld().isRemote) + return; + + if(cooldown > -1) cooldown--; - if(cooldown == 0 && !supertile.getWorldObj().isRemote) { + if(cooldown == 0) { mana = Math.min(getMaxMana(), mana + storedMana); storedMana = 0; sync(); } int slowdown = getSlowdownFactor(); - - boolean remote = supertile.getWorldObj().isRemote; - List items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1)); + + List items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1))); + for(EntityItem item : items) { ItemStack stack = item.getEntityItem(); - if(stack != null && stack.getItem() instanceof ItemFood && !item.isDead && item.age >= slowdown) { - if(cooldown == 0) { - if(!remote) { - int val = ((ItemFood) stack.getItem()).func_150905_g(stack); - storedMana = val * val * 64; - cooldown = val * 10; - supertile.getWorldObj().playSoundEffect(supertile.xCoord, supertile.yCoord, supertile.zCoord, "random.eat", 0.2F, 0.5F + (float) Math.random() * 0.5F); - sync(); - } else - for(int i = 0; i < 10; i++) { - float m = 0.2F; - float mx = (float) (Math.random() - 0.5) * m; - float my = (float) (Math.random() - 0.5) * m; - float mz = (float) (Math.random() - 0.5) * m; - supertile.getWorldObj().spawnParticle("iconcrack_" + Item.getIdFromItem(stack.getItem()), item.posX, item.posY, item.posZ, mx, my, mz); - } - + + int age; + try { + age = (int) MethodHandles.itemAge_getter.invokeExact(item); + } catch (Throwable t) { + continue; + } + + if(stack != null && stack.getItem() instanceof ItemFood && !item.isDead && age >= slowdown) { + if(cooldown <= 0) { + int val = ((ItemFood) stack.getItem()).getHealAmount(stack); + storedMana = val * val * 64; + cooldown = val * 10; + item.playSound(SoundEvents.ENTITY_GENERIC_EAT, 0.2F, 0.5F + (float) Math.random() * 0.5F); + sync(); + ((WorldServer) supertile.getWorld()).spawnParticle(EnumParticleTypes.ITEM_CRACK, false, item.posX, item.posY, item.posZ, 20, 0.1D, 0.1D, 0.1D, 0.05D, Item.getIdFromItem(stack.getItem()), stack.getItemDamage()); } - if(!remote) - item.setDead(); + item.setDead(); } } } @@ -89,7 +94,7 @@ public class SubTileGourmaryllis extends SubTileGenerating { @Override public RadiusDescriptor getRadius() { - return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE); + return new RadiusDescriptor.Square(toBlockPos(), RANGE); } @Override diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileHydroangeas.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileHydroangeas.java index 7bb064c87..d5dacc9b4 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileHydroangeas.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileHydroangeas.java @@ -15,27 +15,32 @@ import java.util.Collections; import java.util.List; import net.minecraft.block.Block; +import net.minecraft.block.BlockLiquid; import net.minecraft.block.material.Material; +import net.minecraft.block.properties.PropertyInteger; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.SoundEvents; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.BlockFluidBase; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.subtile.RadiusDescriptor; -import vazkii.botania.api.subtile.signature.PassiveFlower; +import vazkii.botania.api.subtile.SubTileGenerating; import vazkii.botania.common.Botania; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.lexicon.LexiconData; -import vazkii.botania.common.lib.LibMisc; -@PassiveFlower -public class SubTileHydroangeas extends SubTilePassiveGenerating { +public class SubTileHydroangeas extends SubTileGenerating { private static final String TAG_BURN_TIME = "burnTime"; private static final String TAG_COOLDOWN = "cooldown"; - private static final int[][] OFFSETS = { { 0, 1 }, { 0, -1 }, { 1, 0 }, { -1, 0 }, { -1, 1 }, { -1, -1 }, { 1, 1 }, { 1, -1 } }; + private static final BlockPos[] OFFSETS = { new BlockPos(0, 0, 1), new BlockPos(0, 0, -1), new BlockPos(1, 0, 0), new BlockPos(-1, 0, 0), new BlockPos(-1, 0, 1), new BlockPos(-1, 0, -1), new BlockPos(1, 0, 1), new BlockPos(1, 0, -1) }; int burnTime, cooldown; @@ -46,32 +51,31 @@ public class SubTileHydroangeas extends SubTilePassiveGenerating { if(cooldown > 0) { cooldown--; for(int i = 0; i < 3; i++) - Botania.proxy.wispFX(supertile.getWorldObj(), supertile.xCoord + 0.5 + Math.random() * 0.2 - 0.1, supertile.yCoord + 0.5 + Math.random() * 0.2 - 0.1, supertile.zCoord + 0.5 + Math.random() * 0.2 - 0.1, 0.1F, 0.1F, 0.1F, (float) Math.random() / 6, (float) -Math.random() / 30); + Botania.proxy.wispFX(supertile.getPos().getX() + 0.5 + Math.random() * 0.2 - 0.1, supertile.getPos().getY() + 0.5 + Math.random() * 0.2 - 0.1, supertile.getPos().getZ() + 0.5 + Math.random() * 0.2 - 0.1, 0.1F, 0.1F, 0.1F, (float) Math.random() / 6, (float) -Math.random() / 30); + return; } if(burnTime == 0) { - if(mana < getMaxMana() && !supertile.getWorldObj().isRemote) { - List offsets = Arrays.asList(OFFSETS); + if(mana < getMaxMana() && !supertile.getWorld().isRemote) { + List offsets = Arrays.asList(OFFSETS); Collections.shuffle(offsets); - for(int[] offsetArray : offsets) { - int[] positions = { - supertile.xCoord + offsetArray[0], - supertile.zCoord + offsetArray[1] - }; + for(BlockPos offset : offsets) { + BlockPos pos = supertile.getPos().add(offset); Material search = getMaterialToSearchFor(); - if(supertile.getWorldObj().getBlock(positions[0], supertile.yCoord, positions[1]).getMaterial() == search && (getBlockToSearchBelow() == null || supertile.getWorldObj().getBlock(positions[0], supertile.yCoord - 1, positions[1]) == getBlockToSearchBelow()) && supertile.getWorldObj().getBlockMetadata(positions[0], supertile.yCoord, positions[1]) == 0) { - if(search != Material.water) - supertile.getWorldObj().setBlockToAir(positions[0], supertile.yCoord, positions[1]); + PropertyInteger prop = supertile.getWorld().getBlockState(pos).getBlock() instanceof BlockLiquid ? BlockLiquid.LEVEL : supertile.getWorld().getBlockState(pos).getBlock() instanceof BlockFluidBase ? BlockFluidBase.LEVEL : null; + if(supertile.getWorld().getBlockState(pos).getMaterial() == search && (getBlockToSearchBelow() == null || supertile.getWorld().getBlockState(pos.down()).getBlock() == getBlockToSearchBelow()) && (prop == null || supertile.getWorld().getBlockState(pos).getValue(prop) == 0)) { + if(search != Material.WATER) + supertile.getWorld().setBlockToAir(pos); else { int waterAround = 0; - for(ForgeDirection dir : LibMisc.CARDINAL_DIRECTIONS) - if(supertile.getWorldObj().getBlock(positions[0] + dir.offsetX, supertile.yCoord, positions[1] + dir.offsetZ).getMaterial() == search) + for(EnumFacing dir : EnumFacing.HORIZONTALS) + if(supertile.getWorld().getBlockState(pos.offset(dir)).getMaterial() == search) waterAround++; if(waterAround < 2) - supertile.getWorldObj().setBlockToAir(positions[0], supertile.yCoord, positions[1]); + supertile.getWorld().setBlockToAir(pos); } if(cooldown == 0) @@ -85,7 +89,7 @@ public class SubTileHydroangeas extends SubTilePassiveGenerating { } } } else { - if(supertile.getWorldObj().rand.nextInt(8) == 0) + if(supertile.getWorld().rand.nextInt(8) == 0) doBurnParticles(); burnTime--; if(burnTime == 0) { @@ -96,11 +100,11 @@ public class SubTileHydroangeas extends SubTilePassiveGenerating { } public void doBurnParticles() { - Botania.proxy.wispFX(supertile.getWorldObj(), supertile.xCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.yCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.zCoord + 0.5, 0.05F, 0.05F, 0.7F, (float) Math.random() / 6, (float) -Math.random() / 60); + Botania.proxy.wispFX(supertile.getPos().getX() + 0.55 + Math.random() * 0.2 - 0.1, supertile.getPos().getY() + 0.55 + Math.random() * 0.2 - 0.1, supertile.getPos().getZ() + 0.5, 0.05F, 0.05F, 0.7F, (float) Math.random() / 6, (float) -Math.random() / 60); } public Material getMaterialToSearchFor() { - return Material.water; + return Material.WATER; } public Block getBlockToSearchBelow() { @@ -108,7 +112,7 @@ public class SubTileHydroangeas extends SubTilePassiveGenerating { } public void playSound() { - supertile.getWorldObj().playSoundEffect(supertile.xCoord, supertile.yCoord, supertile.zCoord, "random.drink", 0.01F, 0.5F + (float) Math.random() * 0.5F); + supertile.getWorld().playSound(null, supertile.getPos(), SoundEvents.ENTITY_GENERIC_DRINK, SoundCategory.BLOCKS, 0.01F, 0.5F + (float) Math.random() * 0.5F); } public int getBurnTime() { @@ -117,7 +121,7 @@ public class SubTileHydroangeas extends SubTilePassiveGenerating { @Override public RadiusDescriptor getRadius() { - return new RadiusDescriptor.Square(toChunkCoordinates(), 1); + return new RadiusDescriptor.Square(toBlockPos(), 1); } @Override @@ -163,8 +167,8 @@ public class SubTileHydroangeas extends SubTilePassiveGenerating { } @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) { - super.onBlockPlacedBy(world, x, y, z, entity, stack); + public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase entity, ItemStack stack) { + super.onBlockPlacedBy(world, pos, state, entity, stack); cooldown = ItemNBTHelper.getInt(stack, TAG_COOLDOWN, 0); } @@ -175,8 +179,8 @@ public class SubTileHydroangeas extends SubTilePassiveGenerating { @Override public int getDelayBetweenPassiveGeneration() { - boolean rain = supertile.getWorldObj().getWorldChunkManager().getBiomeGenAt(supertile.xCoord, supertile.zCoord).getIntRainfall() > 0 && (supertile.getWorldObj().isRaining() || supertile.getWorldObj().isThundering()); - return rain ? 1 : 2; + boolean rain = supertile.getWorld().getBiomeGenForCoords(supertile.getPos()).getRainfall() > 0 && (supertile.getWorld().isRaining() || supertile.getWorld().isThundering()); + return rain ? 2 : 3; } public int getCooldown() { diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileKekimurus.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileKekimurus.java index cbb2a15e1..c0e8014a1 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileKekimurus.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileKekimurus.java @@ -12,6 +12,10 @@ package vazkii.botania.common.block.subtile.generating; import net.minecraft.block.Block; import net.minecraft.block.BlockCake; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.SoundEvents; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.BlockPos; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.subtile.RadiusDescriptor; import vazkii.botania.api.subtile.SubTileGenerating; @@ -25,24 +29,26 @@ public class SubTileKekimurus extends SubTileGenerating { public void onUpdate() { super.onUpdate(); + if (supertile.getWorld().isRemote) + return; + int mana = 1800; - if(getMaxMana() - this.mana >= mana && !supertile.getWorldObj().isRemote && ticksExisted % 80 == 0) { + if(getMaxMana() - this.mana >= mana && !supertile.getWorld().isRemote && ticksExisted % 80 == 0) { for(int i = 0; i < RANGE * 2 + 1; i++) for(int j = 0; j < RANGE * 2 + 1; j++) for(int k = 0; k < RANGE * 2 + 1; k++) { - int x = supertile.xCoord + i - RANGE; - int y = supertile.yCoord + j - RANGE; - int z = supertile.zCoord + k - RANGE; - Block block = supertile.getWorldObj().getBlock(x, y, z); + BlockPos pos = supertile.getPos().add(i - RANGE, j - RANGE, k - RANGE); + IBlockState state = supertile.getWorld().getBlockState(pos); + Block block = state.getBlock(); if(block instanceof BlockCake) { - int meta = supertile.getWorldObj().getBlockMetadata(x, y, z) + 1; - if(meta == 6) - supertile.getWorldObj().setBlockToAir(x, y, z); - else supertile.getWorldObj().setBlockMetadataWithNotify(x, y, z, meta, 1 | 2); + int nextSlicesEaten = state.getValue(BlockCake.BITES) + 1; + if(nextSlicesEaten > 6) + supertile.getWorld().setBlockToAir(pos); + else supertile.getWorld().setBlockState(pos, state.withProperty(BlockCake.BITES, nextSlicesEaten), 1 | 2); - supertile.getWorldObj().playAuxSFX(2001, x, y, z, Block.getIdFromBlock(block) + (meta << 12)); - supertile.getWorldObj().playSoundEffect(supertile.xCoord, supertile.yCoord, supertile.zCoord, "random.eat", 1F, 0.5F + (float) Math.random() * 0.5F); + supertile.getWorld().playEvent(2001, pos, Block.getStateId(state)); + supertile.getWorld().playSound(null, supertile.getPos(), SoundEvents.ENTITY_GENERIC_EAT, SoundCategory.BLOCKS, 1F, 0.5F + (float) Math.random() * 0.5F); this.mana += mana; sync(); return; @@ -53,7 +59,7 @@ public class SubTileKekimurus extends SubTileGenerating { @Override public RadiusDescriptor getRadius() { - return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE); + return new RadiusDescriptor.Square(toBlockPos(), RANGE); } @Override diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileMunchdew.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileMunchdew.java index 0b7a66f58..312ae7522 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileMunchdew.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileMunchdew.java @@ -10,18 +10,15 @@ */ package vazkii.botania.common.block.subtile.generating; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - import net.minecraft.block.Block; import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.subtile.RadiusDescriptor; import vazkii.botania.api.subtile.SubTileGenerating; @@ -29,6 +26,10 @@ import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.lexicon.LexiconData; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + public class SubTileMunchdew extends SubTileGenerating { private static final String TAG_COOLDOWN = "cooldown"; @@ -53,44 +54,37 @@ public class SubTileMunchdew extends SubTileGenerating { int manaPerLeaf = 160; eatLeaves : { - if(getMaxMana() - mana >= manaPerLeaf && !supertile.getWorldObj().isRemote && ticksExisted % 4 == 0) { - List coords = new ArrayList(); - int x = supertile.xCoord; - int y = supertile.yCoord; - int z = supertile.zCoord; + if(getMaxMana() - mana >= manaPerLeaf && !supertile.getWorld().isRemote && ticksExisted % 4 == 0) { + List coords = new ArrayList<>(); + BlockPos pos = supertile.getPos(); - for(int i = -RANGE; i < RANGE + 1; i++) - for(int j = 0; j < RANGE_Y; j++) - for(int k = -RANGE; k < RANGE + 1; k++) { - int xp = x + i; - int yp = y + j; - int zp = z + k; - Block block = supertile.getWorldObj().getBlock(xp, yp, zp); - if(block.getMaterial() == Material.leaves) { - boolean exposed = false; - for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) - if(supertile.getWorldObj().getBlock(xp + dir.offsetX, yp + dir.offsetY, zp + dir.offsetZ).isAir(supertile.getWorldObj(), xp + dir.offsetX, yp + dir.offsetY, zp + dir.offsetZ)) { - exposed = true; - break; - } - - if(exposed) - coords.add(new ChunkCoordinates(xp, yp, zp)); + for(BlockPos pos_ : BlockPos.getAllInBox(pos.add(-RANGE, -RANGE_Y, -RANGE), pos.add(RANGE, RANGE_Y, RANGE))) { + if(supertile.getWorld().getBlockState(pos_).getMaterial() == Material.LEAVES) { + boolean exposed = false; + for(EnumFacing dir : EnumFacing.VALUES) { + IBlockState offState = supertile.getWorld().getBlockState(pos_.offset(dir)); + if(offState.getBlock().isAir(offState, supertile.getWorld(), pos_.offset(dir))) { + exposed = true; + break; } } + if(exposed) + coords.add(pos_); + } + } + if(coords.isEmpty()) break eatLeaves; Collections.shuffle(coords); - ChunkCoordinates breakCoords = coords.get(0); - Block block = supertile.getWorldObj().getBlock(breakCoords.posX, breakCoords.posY, breakCoords.posZ); - int meta = supertile.getWorldObj().getBlockMetadata(breakCoords.posX, breakCoords.posY, breakCoords.posZ); - supertile.getWorldObj().setBlockToAir(breakCoords.posX, breakCoords.posY, breakCoords.posZ); + BlockPos breakCoords = coords.get(0); + IBlockState state = supertile.getWorld().getBlockState(breakCoords); + supertile.getWorld().setBlockToAir(breakCoords); ticksWithoutEating = 0; ateOnce = true; if(ConfigHandler.blockBreakParticles) - supertile.getWorldObj().playAuxSFX(2001, breakCoords.posX, breakCoords.posY, breakCoords.posZ, Block.getIdFromBlock(block) + (meta << 12)); + supertile.getWorld().playEvent(2001, breakCoords, Block.getStateId(state)); mana += manaPerLeaf; } } @@ -104,7 +98,7 @@ public class SubTileMunchdew extends SubTileGenerating { @Override public RadiusDescriptor getRadius() { - return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE); + return new RadiusDescriptor.Square(toBlockPos(), RANGE); } @Override @@ -124,16 +118,16 @@ public class SubTileMunchdew extends SubTileGenerating { } @Override - public ArrayList getDrops(ArrayList list) { - ArrayList drops = super.getDrops(list); + public List getDrops(List list) { + List drops = super.getDrops(list); if(cooldown > 0) ItemNBTHelper.setInt(drops.get(0), TAG_COOLDOWN, cooldown); return drops; } @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) { - super.onBlockPlacedBy(world, x, y, z, entity, stack); + public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase entity, ItemStack stack) { + super.onBlockPlacedBy(world, pos, state, entity, stack); cooldown = ItemNBTHelper.getInt(stack, TAG_COOLDOWN, 0); } diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileNarslimmus.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileNarslimmus.java index 875fbb094..b7d4f18d7 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileNarslimmus.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileNarslimmus.java @@ -10,20 +10,23 @@ */ package vazkii.botania.common.block.subtile.generating; -import java.util.List; - import net.minecraft.entity.monster.EntitySlime; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MathHelper; +import net.minecraft.init.SoundEvents; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; import net.minecraftforge.event.entity.living.LivingSpawnEvent; +import net.minecraftforge.fml.common.eventhandler.Event.Result; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.subtile.RadiusDescriptor; import vazkii.botania.api.subtile.SubTileGenerating; import vazkii.botania.common.lexicon.LexiconData; -import cpw.mods.fml.common.eventhandler.Event.Result; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +import java.util.List; public class SubTileNarslimmus extends SubTileGenerating { @@ -36,7 +39,7 @@ public class SubTileNarslimmus extends SubTileGenerating { super.onUpdate(); if(ticksExisted % 5 == 0) { - List slimes = supertile.getWorldObj().getEntitiesWithinAABB(EntitySlime.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE, supertile.zCoord + RANGE + 1)); + List slimes = supertile.getWorld().getEntitiesWithinAABB(EntitySlime.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1))); for(EntitySlime slime : slimes) { if(slime.getEntityData().getBoolean(TAG_WORLD_SPAWNED) && !slime.isDead) { int size = slime.getSlimeSize(); @@ -44,7 +47,7 @@ public class SubTileNarslimmus extends SubTileGenerating { int mana = 820 * mul; if(!slime.worldObj.isRemote) { slime.setDead(); - slime.worldObj.playSoundAtEntity(slime, "mob.slime." + (size > 1 ? "big" : "small"), 1F, 0.02F); + slime.playSound(size > 1 ? SoundEvents.ENTITY_SLIME_SQUISH : SoundEvents.ENTITY_SMALL_SLIME_SQUISH, 1, 0.02F); this.mana = Math.min(getMaxMana(), this.mana + mana); sync(); } @@ -55,7 +58,7 @@ public class SubTileNarslimmus extends SubTileGenerating { float f2 = MathHelper.sin(f) * size * 0.5F * f1; float f3 = MathHelper.cos(f) * size * 0.5F * f1; float f4 = slime.worldObj.rand.nextFloat() * size * 0.5F * f1; - slime.worldObj.spawnParticle("slime", slime.posX + f2, slime.boundingBox.minY + f4, slime.posZ + f3, 0.0D, 0.0D, 0.0D); + slime.worldObj.spawnParticle(EnumParticleTypes.SLIME, slime.posX + f2, slime.getEntityBoundingBox().minY + f4, slime.posZ + f3, 0.0D, 0.0D, 0.0D); } break; } @@ -65,7 +68,7 @@ public class SubTileNarslimmus extends SubTileGenerating { @Override public RadiusDescriptor getRadius() { - return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE); + return new RadiusDescriptor.Square(toBlockPos(), RANGE); } @Override @@ -86,13 +89,13 @@ public class SubTileNarslimmus extends SubTileGenerating { public static class SpawnIntercepter { @SubscribeEvent - public void onSpawn(LivingSpawnEvent.CheckSpawn event) { - if(event.entityLiving instanceof EntitySlime && event.getResult() != Result.DENY && isSlimeChunk(event.entityLiving.worldObj, MathHelper.floor_double(event.x), MathHelper.floor_double(event.z))) - event.entityLiving.getEntityData().setBoolean(TAG_WORLD_SPAWNED, true); + public static void onSpawn(LivingSpawnEvent.CheckSpawn event) { + if(event.getEntityLiving() instanceof EntitySlime && event.getResult() != Result.DENY && isSlimeChunk(event.getEntityLiving().worldObj, MathHelper.floor_double(event.getX()), MathHelper.floor_double(event.getZ()))) + event.getEntityLiving().getEntityData().setBoolean(TAG_WORLD_SPAWNED, true); } public static boolean isSlimeChunk(World world, int x, int z) { - Chunk chunk = world.getChunkFromBlockCoords(x, z); + Chunk chunk = world.getChunkFromBlockCoords(new BlockPos(x, 0, z)); return chunk.getRandomWithSeed(987234911L).nextInt(10) == 0; } diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileNightshade.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileNightshade.java deleted file mode 100644 index 4ad851412..000000000 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileNightshade.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Mar 16, 2014, 11:15:42 PM (GMT)] - */ -package vazkii.botania.common.block.subtile.generating; - -import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.api.subtile.signature.PassiveFlower; -import vazkii.botania.common.lexicon.LexiconData; - -@PassiveFlower -public class SubTileNightshade extends SubTileDaybloom { - - @Override - public int getDelayBetweenPassiveGeneration() { - return super.getDelayBetweenPassiveGeneration(); - } - - @Override - public boolean canGeneratePassively() { - return !super.canGeneratePassively() && !supertile.getWorldObj().isDaytime(); - } - - @Override - public int getColor() { - return 0x3D2A90; - } - - @Override - public LexiconEntry getEntry() { - return LexiconData.nightshade; - } - - public static class Prime extends SubTileNightshade { - - @Override - public boolean isPrime() { - return true; - } - - @Override - public LexiconEntry getEntry() { - return LexiconData.primusLoci; - } - - } - -} diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTilePassiveGenerating.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTilePassiveGenerating.java deleted file mode 100644 index be4092079..000000000 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTilePassiveGenerating.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Mar 16, 2015, 6:03:16 PM (GMT)] - */ -package vazkii.botania.common.block.subtile.generating; - -import vazkii.botania.api.subtile.SubTileGenerating; - -public class SubTilePassiveGenerating extends SubTileGenerating { - - @Override - public boolean isPassiveFlower() { - return true; - } - -} diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileRafflowsia.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileRafflowsia.java index 07a42d947..5fdcee10e 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileRafflowsia.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileRafflowsia.java @@ -10,13 +10,13 @@ */ package vazkii.botania.common.block.subtile.generating; -import java.util.List; - import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.subtile.ISubTileContainer; @@ -26,6 +26,8 @@ import vazkii.botania.api.subtile.SubTileGenerating; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.lexicon.LexiconData; +import java.util.List; + public class SubTileRafflowsia extends SubTileGenerating { private static final String TAG_LAST_FLOWER = "lastFlower"; @@ -42,20 +44,18 @@ public class SubTileRafflowsia extends SubTileGenerating { int mana = 2100; - if(getMaxMana() - this.mana >= mana && !supertile.getWorldObj().isRemote && ticksExisted % 40 == 0) { + if(getMaxMana() - this.mana >= mana && !supertile.getWorld().isRemote && ticksExisted % 40 == 0) { for(int i = 0; i < RANGE * 2 + 1; i++) for(int j = 0; j < RANGE * 2 + 1; j++) for(int k = 0; k < RANGE * 2 + 1; k++) { - int x = supertile.xCoord + i - RANGE; - int y = supertile.yCoord + j - RANGE; - int z = supertile.zCoord + k - RANGE; - Block block = supertile.getWorldObj().getBlock(x, y, z); - TileEntity tile = supertile.getWorldObj().getTileEntity(x, y, z); + BlockPos pos = supertile.getPos().add(i - RANGE, j - RANGE, k - RANGE); + Block block = supertile.getWorld().getBlockState(pos).getBlock(); + TileEntity tile = supertile.getWorld().getTileEntity(pos); if(tile instanceof ISubTileContainer) { SubTileEntity stile = ((ISubTileContainer) tile).getSubTile(); String name = stile.getUnlocalizedName(); - if(stile instanceof SubTileGenerating && ((SubTileGenerating) stile).isPassiveFlower()) { + if(stile instanceof SubTileGenerating) { boolean last = name.equals(lastFlower); if(last) lastFlowerTimes++; @@ -66,10 +66,10 @@ public class SubTileRafflowsia extends SubTileGenerating { float mod = 1F / lastFlowerTimes; - int meta = supertile.getWorldObj().getBlockMetadata(x, y, z) + 1; - supertile.getWorldObj().setBlockToAir(x, y, z); + IBlockState state = supertile.getWorld().getBlockState(pos); + supertile.getWorld().setBlockToAir(pos); - supertile.getWorldObj().playAuxSFX(2001, x, y, z, Block.getIdFromBlock(block) + (meta << 12)); + supertile.getWorld().playEvent(2001, pos, Block.getStateId(state)); this.mana += mana * mod; sync(); return; @@ -105,8 +105,8 @@ public class SubTileRafflowsia extends SubTileGenerating { } @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) { - super.onBlockPlacedBy(world, x, y, z, entity, stack); + public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase entity, ItemStack stack) { + super.onBlockPlacedBy(world, pos, state, entity, stack); lastFlower = ItemNBTHelper.getString(stack, TAG_LAST_FLOWER, ""); lastFlowerTimes = ItemNBTHelper.getInt(stack, TAG_LAST_FLOWER_TIMES, 0); @@ -114,7 +114,7 @@ public class SubTileRafflowsia extends SubTileGenerating { @Override public RadiusDescriptor getRadius() { - return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE); + return new RadiusDescriptor.Square(toBlockPos(), RANGE); } @Override diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileSpectrolus.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileSpectrolus.java index 1bfeb03ed..f9b55b9bd 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileSpectrolus.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileSpectrolus.java @@ -10,27 +10,29 @@ */ package vazkii.botania.common.block.subtile.generating; -import java.awt.Color; -import java.util.List; - import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.entity.item.EntityItem; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; - +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import org.lwjgl.opengl.GL11; - import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.subtile.RadiusDescriptor; import vazkii.botania.api.subtile.SubTileGenerating; +import vazkii.botania.common.core.handler.MethodHandles; import vazkii.botania.common.lexicon.LexiconData; +import java.awt.*; +import java.util.List; + public class SubTileSpectrolus extends SubTileGenerating { private static final String TAG_NEXT_COLOR = "nextColor"; @@ -43,14 +45,23 @@ public class SubTileSpectrolus extends SubTileGenerating { public void onUpdate() { super.onUpdate(); - boolean remote = supertile.getWorldObj().isRemote; - Item wool = Item.getItemFromBlock(Blocks.wool); - List items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1)); + boolean remote = supertile.getWorld().isRemote; + Item wool = Item.getItemFromBlock(Blocks.WOOL); + + List items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1))); int slowdown = getSlowdownFactor(); - + for(EntityItem item : items) { ItemStack stack = item.getEntityItem(); - if(stack != null && stack.getItem() == wool && !item.isDead && item.age >= slowdown) { + + int age; + try { + age = (int) MethodHandles.itemAge_getter.invokeExact(item); + } catch (Throwable t) { + continue; + } + + if(stack != null && stack.getItem() == wool && !item.isDead && age >= slowdown) { int meta = stack.getItemDamage(); if(meta == nextColor) { if(!remote) { @@ -64,7 +75,7 @@ public class SubTileSpectrolus extends SubTileGenerating { float mx = (float) (Math.random() - 0.5) * m; float my = (float) (Math.random() - 0.5) * m; float mz = (float) (Math.random() - 0.5) * m; - supertile.getWorldObj().spawnParticle("blockcrack_" + Item.getIdFromItem(stack.getItem()) + "_" + meta, item.posX, item.posY, item.posZ, mx, my, mz); + supertile.getWorld().spawnParticle(EnumParticleTypes.ITEM_CRACK, item.posX, item.posY, item.posZ, mx, my, mz, Item.getIdFromItem(stack.getItem()), stack.getItemDamage()); } } @@ -76,7 +87,7 @@ public class SubTileSpectrolus extends SubTileGenerating { @Override public RadiusDescriptor getRadius() { - return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE); + return new RadiusDescriptor.Square(toBlockPos(), RANGE); } @Override @@ -94,29 +105,30 @@ public class SubTileSpectrolus extends SubTileGenerating { return LexiconData.spectrolus; } + @SideOnly(Side.CLIENT) @Override public void renderHUD(Minecraft mc, ScaledResolution res) { super.renderHUD(mc, res); - ItemStack stack = new ItemStack(Blocks.wool, 1, nextColor); + ItemStack stack = new ItemStack(Blocks.WOOL, 1, nextColor); int color = getColor(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); if(stack != null && stack.getItem() != null) { String stackName = stack.getDisplayName(); - int width = 16 + mc.fontRenderer.getStringWidth(stackName) / 2; + int width = 16 + mc.fontRendererObj.getStringWidth(stackName) / 2; int x = res.getScaledWidth() / 2 - width; int y = res.getScaledHeight() / 2 + 30; - mc.fontRenderer.drawStringWithShadow(stackName, x + 20, y + 5, color); + mc.fontRendererObj.drawStringWithShadow(stackName, x + 20, y + 5, color); RenderHelper.enableGUIStandardItemLighting(); - RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, stack, x, y); + mc.getRenderItem().renderItemAndEffectIntoGUI(stack, x, y); RenderHelper.disableStandardItemLighting(); } - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_BLEND); + GlStateManager.disableLighting(); + GlStateManager.disableBlend(); } @Override diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileThermalily.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileThermalily.java index 13e0fb1c8..becef208f 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileThermalily.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileThermalily.java @@ -11,7 +11,9 @@ package vazkii.botania.common.block.subtile.generating; import net.minecraft.block.material.Material; +import net.minecraft.util.SoundCategory; import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.api.sound.BotaniaSoundEvents; import vazkii.botania.common.Botania; import vazkii.botania.common.lexicon.LexiconData; @@ -29,22 +31,17 @@ public class SubTileThermalily extends SubTileHydroangeas { @Override public void doBurnParticles() { - Botania.proxy.wispFX(supertile.getWorldObj(), supertile.xCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.yCoord + 0.9 + Math.random() * 0.2 - 0.1, supertile.zCoord + 0.5, 0.7F, 0.05F, 0.05F, (float) Math.random() / 6, (float) -Math.random() / 60); - } - - @Override - public boolean isPassiveFlower() { - return false; + Botania.proxy.wispFX(supertile.getPos().getX() + 0.55 + Math.random() * 0.2 - 0.1, supertile.getPos().getY() + 0.9 + Math.random() * 0.2 - 0.1, supertile.getPos().getZ() + 0.5, 0.7F, 0.05F, 0.05F, (float) Math.random() / 6, (float) -Math.random() / 60); } @Override public Material getMaterialToSearchFor() { - return Material.lava; + return Material.LAVA; } @Override public void playSound() { - supertile.getWorldObj().playSoundEffect(supertile.xCoord, supertile.yCoord, supertile.zCoord, "botania:thermalily", 0.2F, 1F); + supertile.getWorld().playSound(null, supertile.getPos(), BotaniaSoundEvents.thermalily, SoundCategory.BLOCKS, 0.2F, 1F); } @Override diff --git a/src/main/java/vazkii/botania/common/block/tile/TileAlfPortal.java b/src/main/java/vazkii/botania/common/block/tile/TileAlfPortal.java index d3d475ee7..a6bb79285 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileAlfPortal.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileAlfPortal.java @@ -10,24 +10,28 @@ */ package vazkii.botania.common.block.tile; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.item.EntityItem; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraftforge.common.MinecraftForge; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.lexicon.ILexicon; import vazkii.botania.api.lexicon.multiblock.Multiblock; import vazkii.botania.api.lexicon.multiblock.MultiblockSet; +import vazkii.botania.api.lexicon.multiblock.component.StateInsensitiveComponent; import vazkii.botania.api.recipe.ElvenPortalUpdateEvent; import vazkii.botania.api.recipe.IElvenItem; import vazkii.botania.api.recipe.RecipeElvenTrade; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.AlfPortalState; +import vazkii.botania.api.state.enums.LivingWoodVariant; +import vazkii.botania.api.state.enums.PylonVariant; import vazkii.botania.common.Botania; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.tile.mana.TilePool; @@ -35,28 +39,35 @@ import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.item.ItemLexicon; import vazkii.botania.common.lexicon.LexiconData; -import com.google.common.base.Function; +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.List; +import java.util.function.Function; public class TileAlfPortal extends TileMod { - private static final int[][] LIVINGWOOD_POSITIONS = { - { -1, 0, 0}, { 1, 0, 0}, { -2, 1, 0}, { 2, 1, 0}, { -2, 3, 0}, { 2, 3, 0}, { -1, 4, 0}, { 1, 4, 0} + private static final BlockPos[] LIVINGWOOD_POSITIONS = { + new BlockPos(-1, 0, 0), new BlockPos(1, 0, 0), new BlockPos(-2, 1, 0), + new BlockPos(2, 1, 0), new BlockPos(-2, 3, 0), new BlockPos(2, 3, 0), + new BlockPos(-1, 4, 0), new BlockPos(1, 4, 0) }; - private static final int[][] GLIMMERING_LIVINGWOOD_POSITIONS = { - { -2, 2, 0 }, { 2, 2, 0 }, { 0, 4, 0 } + private static final BlockPos[] GLIMMERING_LIVINGWOOD_POSITIONS = { + new BlockPos(-2, 2, 0), new BlockPos(2, 2, 0), new BlockPos(0, 4, 0) }; - private static final int[][] PYLON_POSITIONS = { - { -3, 1, 3 }, { 3, 1, 3 } + private static final BlockPos[] PYLON_POSITIONS = { + new BlockPos(-3, 1, 3), new BlockPos(3, 1, 3) }; - private static final int[][] POOL_POSITIONS = { - { -3, 0, 3 }, { 3, 0, 3 } + private static final BlockPos[] POOL_POSITIONS = { + new BlockPos(-3, 0, 3), new BlockPos(3, 0, 3) }; - private static final int[][] AIR_POSITIONS = { - { -1, 1, 0 }, { 0, 1, 0 }, { 1, 1, 0 }, { -1, 2, 0 }, { 0, 2, 0 }, { 1, 2, 0 }, { -1, 3, 0 }, { 0, 3, 0 }, { 1, 3, 0 } + private static final BlockPos[] AIR_POSITIONS = { + new BlockPos(-1, 1, 0), new BlockPos(0, 1, 0), new BlockPos(1, 1, 0), + new BlockPos(-1, 2, 0), new BlockPos(0, 2, 0), new BlockPos(1, 2, 0), + new BlockPos(-1, 3, 0), new BlockPos(0, 3, 0), new BlockPos(1, 3, 0) }; private static final String TAG_TICKS_OPEN = "ticksOpen"; @@ -65,60 +76,46 @@ public class TileAlfPortal extends TileMod { private static final String TAG_STACK = "portalStack"; private static final String TAG_PORTAL_FLAG = "_elvenPortal"; - List stacksIn = new ArrayList(); + private final List stacksIn = new ArrayList<>(); public int ticksOpen = 0; - int ticksSinceLastItem = 0; + private int ticksSinceLastItem = 0; private boolean closeNow = false; private boolean hasUnloadedParts = false; - private static final Function CONVERTER_X_Z = new Function() { - @Override - public int[] apply(int[] input) { - return new int[] { input[2], input[1], input[0] }; - } - }; + private static final Function CONVERTER_X_Z = input -> new BlockPos(input.getZ(), input.getY(), input.getX()); - private static final Function CONVERTER_X_Z_FP = new Function() { - @Override - public double[] apply(double[] input) { - return new double[] { input[2], input[1], input[0] }; - } - }; + private static final Function CONVERTER_X_Z_FP = input -> new double[] { input[2], input[1], input[0] }; - private static final Function CONVERTER_Z_SWAP = new Function() { - @Override - public int[] apply(int[] input) { - return new int[] { input[0], input[1], -input[2] }; - } - }; + private static final Function CONVERTER_Z_SWAP = input -> new BlockPos(input.getX(), input.getY(), -input.getZ()); public static MultiblockSet makeMultiblockSet() { Multiblock mb = new Multiblock(); - for(int[] l : LIVINGWOOD_POSITIONS) - mb.addComponent(l[0], l[1] + 1, l[2], ModBlocks.livingwood, 0); - for(int[] g : GLIMMERING_LIVINGWOOD_POSITIONS) - mb.addComponent(g[0], g[1] + 1, g[2], ModBlocks.livingwood, 5); - for(int[] p : PYLON_POSITIONS) - mb.addComponent(-p[0], p[1] + 1, -p[2], ModBlocks.pylon, 1); - for(int[] p : POOL_POSITIONS) - mb.addComponent(-p[0], p[1] + 1, -p[2], ModBlocks.pool, 0); + for(BlockPos l : LIVINGWOOD_POSITIONS) + mb.addComponent(l.up(), ModBlocks.livingwood.getDefaultState()); + for(BlockPos g : GLIMMERING_LIVINGWOOD_POSITIONS) + mb.addComponent(g.up(), ModBlocks.livingwood.getDefaultState().withProperty(BotaniaStateProps.LIVINGWOOD_VARIANT, LivingWoodVariant.GLIMMERING)); + for(BlockPos p : PYLON_POSITIONS) + mb.addComponent(new BlockPos(-p.getX(), p.getY() + 1, -p.getZ()), ModBlocks.pylon.getDefaultState().withProperty(BotaniaStateProps.PYLON_VARIANT, PylonVariant.NATURA)); + for(BlockPos p : POOL_POSITIONS) + mb.addComponent(new StateInsensitiveComponent(new BlockPos(-p.getX(), p.getY() + 1, -p.getZ()), ModBlocks.pool)); - mb.addComponent(0, 1, 0, ModBlocks.alfPortal, 0); - mb.setRenderOffset(0, -1, 0); + mb.addComponent(new BlockPos(0, 1, 0), ModBlocks.alfPortal.getDefaultState()); + mb.setRenderOffset(new BlockPos(0, -1, 0)); return mb.makeSet(); } @Override - public void updateEntity() { - int meta = getBlockMetadata(); - if(meta == 0) { + public void update() { + IBlockState iBlockState = worldObj.getBlockState(getPos()); + if(iBlockState.getValue(BotaniaStateProps.ALFPORTAL_STATE) == AlfPortalState.OFF) { ticksOpen = 0; return; } - int newMeta = getValidMetadata(); + AlfPortalState state = iBlockState.getValue(BotaniaStateProps.ALFPORTAL_STATE); + AlfPortalState newState = getValidState(); if(!hasUnloadedParts) { ticksOpen++; @@ -131,7 +128,7 @@ public class TileAlfPortal extends TileMod { if(ticksOpen > 60) { ticksSinceLastItem++; if(ConfigHandler.elfPortalParticlesEnabled) - blockParticle(meta); + blockParticle(state); List items = worldObj.getEntitiesWithinAABB(EntityItem.class, aabb); if(!worldObj.isRemote) @@ -140,7 +137,7 @@ public class TileAlfPortal extends TileMod { continue; ItemStack stack = item.getEntityItem(); - if(stack != null && (!(stack.getItem() instanceof IElvenItem) || !((IElvenItem) stack.getItem()).isElvenItem(stack)) && !item.getEntityData().hasKey(TAG_PORTAL_FLAG)) { + if((!(stack.getItem() instanceof IElvenItem) || !((IElvenItem) stack.getItem()).isElvenItem(stack)) && !item.getEntityData().hasKey(TAG_PORTAL_FLAG)) { item.setDead(); addItem(stack); ticksSinceLastItem = 0; @@ -155,38 +152,38 @@ public class TileAlfPortal extends TileMod { } else closeNow = false; if(closeNow) { - worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 0, 1 | 2); + worldObj.setBlockState(getPos(), ModBlocks.alfPortal.getDefaultState(), 1 | 2); for(int i = 0; i < 36; i++) - blockParticle(meta); + blockParticle(state); closeNow = false; - } else if(newMeta != meta) { - if(newMeta == 0) + } else if(newState != state) { + if(newState == AlfPortalState.OFF) for(int i = 0; i < 36; i++) - blockParticle(meta); - worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, newMeta, 1 | 2); + blockParticle(state); + worldObj.setBlockState(getPos(), worldObj.getBlockState(getPos()).withProperty(BotaniaStateProps.ALFPORTAL_STATE, newState), 1 | 2); } hasUnloadedParts = false; } - private void blockParticle(int meta) { + private void blockParticle(AlfPortalState state) { int i = worldObj.rand.nextInt(AIR_POSITIONS.length); double[] pos = new double[] { - AIR_POSITIONS[i][0] + 0.5F, AIR_POSITIONS[i][1] + 0.5F, AIR_POSITIONS[i][2] + 0.5F + AIR_POSITIONS[i].getX() + 0.5F, AIR_POSITIONS[i].getY() + 0.5F, AIR_POSITIONS[i].getZ() + 0.5F }; - if(meta == 2) + if(state == AlfPortalState.ON_X) pos = CONVERTER_X_Z_FP.apply(pos); float motionMul = 0.2F; - Botania.proxy.wispFX(getWorldObj(), xCoord + pos[0], yCoord + pos[1], zCoord + pos[2], (float) (Math.random() * 0.25F), (float) (Math.random() * 0.5F + 0.5F), (float) (Math.random() * 0.25F), (float) (Math.random() * 0.15F + 0.1F), (float) (Math.random() - 0.5F) * motionMul, (float) (Math.random() - 0.5F) * motionMul, (float) (Math.random() - 0.5F) * motionMul); + Botania.proxy.wispFX(getPos().getX() + pos[0], getPos().getY() + pos[1], getPos().getZ() + pos[2], (float) (Math.random() * 0.25F), (float) (Math.random() * 0.5F + 0.5F), (float) (Math.random() * 0.25F), (float) (Math.random() * 0.15F + 0.1F), (float) (Math.random() - 0.5F) * motionMul, (float) (Math.random() - 0.5F) * motionMul, (float) (Math.random() - 0.5F) * motionMul); } public boolean onWanded() { - int meta = getBlockMetadata(); - if(meta == 0) { - int newMeta = getValidMetadata(); - if(newMeta != 0) { - worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, newMeta, 1 | 2); + AlfPortalState state = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.ALFPORTAL_STATE); + if(state == AlfPortalState.OFF) { + AlfPortalState newState = getValidState(); + if(newState != AlfPortalState.OFF) { + worldObj.setBlockState(getPos(), worldObj.getBlockState(getPos()).withProperty(BotaniaStateProps.ALFPORTAL_STATE, newState), 1 | 2); return true; } } @@ -194,22 +191,22 @@ public class TileAlfPortal extends TileMod { return false; } - AxisAlignedBB getPortalAABB() { - AxisAlignedBB aabb = AxisAlignedBB.getBoundingBox(xCoord - 1, yCoord + 1, zCoord, xCoord + 2, yCoord + 4, zCoord + 1); - if(getBlockMetadata() == 2) - aabb = AxisAlignedBB.getBoundingBox(xCoord, yCoord + 1, zCoord - 1, xCoord + 1, yCoord + 4, zCoord + 2); + private AxisAlignedBB getPortalAABB() { + AxisAlignedBB aabb = new AxisAlignedBB(pos.add(-1, 1, 0), pos.add(2, 4, 1)); + if(worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.ALFPORTAL_STATE) == AlfPortalState.ON_X) + aabb = new AxisAlignedBB(pos.add(0, 1, -1), pos.add(1, 4, 2)); return aabb; } - void addItem(ItemStack stack) { + private void addItem(ItemStack stack) { int size = stack.stackSize; stack.stackSize = 1; for(int i = 0; i < size; i++) stacksIn.add(stack.copy()); } - void resolveRecipes() { + private void resolveRecipes() { int i = 0; for(ItemStack stack : stacksIn) { if(stack != null && stack.getItem() instanceof ILexicon) { @@ -225,22 +222,24 @@ public class TileAlfPortal extends TileMod { for(RecipeElvenTrade recipe : BotaniaAPI.elvenTradeRecipes) { if(recipe.matches(stacksIn, false)) { recipe.matches(stacksIn, true); - spawnItem(recipe.getOutput().copy()); + for(ItemStack output : recipe.getOutputs()) + spawnItem(output.copy()); break; } } } - void spawnItem(ItemStack stack) { - EntityItem item = new EntityItem(worldObj, xCoord + 0.5, yCoord + 1.5, zCoord + 0.5, stack); + private void spawnItem(ItemStack stack) { + EntityItem item = new EntityItem(worldObj, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, stack); item.getEntityData().setBoolean(TAG_PORTAL_FLAG, true); worldObj.spawnEntityInWorld(item); ticksSinceLastItem = 0; } + @Nonnull @Override - public void writeToNBT(NBTTagCompound cmp) { - super.writeToNBT(cmp); + public NBTTagCompound writeToNBT(NBTTagCompound cmp) { + NBTTagCompound ret = super.writeToNBT(cmp); cmp.setInteger(TAG_STACK_COUNT, stacksIn.size()); int i = 0; @@ -250,6 +249,8 @@ public class TileAlfPortal extends TileMod { cmp.setTag(TAG_STACK + i, stackcmp); i++; } + + return ret; } @Override @@ -266,68 +267,68 @@ public class TileAlfPortal extends TileMod { } @Override - public void writeCustomNBT(NBTTagCompound cmp) { + public void writePacketNBT(NBTTagCompound cmp) { cmp.setInteger(TAG_TICKS_OPEN, ticksOpen); cmp.setInteger(TAG_TICKS_SINCE_LAST_ITEM, ticksSinceLastItem); } @Override - public void readCustomNBT(NBTTagCompound cmp) { + public void readPacketNBT(NBTTagCompound cmp) { ticksOpen = cmp.getInteger(TAG_TICKS_OPEN); ticksSinceLastItem = cmp.getInteger(TAG_TICKS_SINCE_LAST_ITEM); } - private int getValidMetadata() { + private AlfPortalState getValidState() { if(checkConverter(null)) - return 1; + return AlfPortalState.ON_Z; if(checkConverter(CONVERTER_X_Z)) - return 2; + return AlfPortalState.ON_X; - return 0; + return AlfPortalState.OFF; } - private boolean checkConverter(Function baseConverter) { + private boolean checkConverter(Function baseConverter) { return checkMultipleConverters(baseConverter) || checkMultipleConverters(CONVERTER_Z_SWAP, baseConverter); } - private boolean checkMultipleConverters(Function... converters) { - if(!check2DArray(AIR_POSITIONS, Blocks.air, -1, converters)) + @SafeVarargs + private final boolean checkMultipleConverters(Function... converters) { + if(!check2DArray(AIR_POSITIONS, Blocks.AIR.getDefaultState(), true, converters)) return false; - if(!check2DArray(LIVINGWOOD_POSITIONS, ModBlocks.livingwood, 0, converters)) + if(!check2DArray(LIVINGWOOD_POSITIONS, ModBlocks.livingwood.getDefaultState().withProperty(BotaniaStateProps.LIVINGWOOD_VARIANT, LivingWoodVariant.DEFAULT), false, converters)) return false; - if(!check2DArray(GLIMMERING_LIVINGWOOD_POSITIONS, ModBlocks.livingwood, 5, converters)) + if(!check2DArray(GLIMMERING_LIVINGWOOD_POSITIONS, ModBlocks.livingwood.getDefaultState().withProperty(BotaniaStateProps.LIVINGWOOD_VARIANT, LivingWoodVariant.GLIMMERING), false, converters)) return false; - if(!check2DArray(PYLON_POSITIONS, ModBlocks.pylon, 1, converters)) + if(!check2DArray(PYLON_POSITIONS, ModBlocks.pylon.getDefaultState().withProperty(BotaniaStateProps.PYLON_VARIANT, PylonVariant.NATURA), false, converters)) return false; - if(!check2DArray(POOL_POSITIONS, ModBlocks.pool, -1, converters)) + if(!check2DArray(POOL_POSITIONS, ModBlocks.pool.getDefaultState(), true, converters)) return false; lightPylons(converters); return true; } - private void lightPylons(Function... converters) { + @SafeVarargs + private final void lightPylons(Function... converters) { if(ticksOpen < 50) return; int cost = ticksOpen == 50 ? 75000 : 2; - for(int[] pos : PYLON_POSITIONS) { - for(Function f : converters) + for(BlockPos pos : PYLON_POSITIONS) { + for(Function f : converters) if(f != null) pos = f.apply(pos); - TileEntity tile = worldObj.getTileEntity(xCoord + pos[0], yCoord + pos[1], zCoord + pos[2]); + TileEntity tile = worldObj.getTileEntity(getPos().add(pos)); if(tile instanceof TilePylon) { TilePylon pylon = (TilePylon) tile; pylon.activated = true; - pylon.centerX = xCoord; - pylon.centerY = yCoord; - pylon.centerZ = zCoord; + pylon.centerPos = getPos(); } - tile = worldObj.getTileEntity(xCoord + pos[0], yCoord + pos[1] - 1, zCoord + pos[2]); + tile = worldObj.getTileEntity(getPos().add(pos).down()); if(tile instanceof TilePool) { TilePool pool = (TilePool) tile; if(pool.getCurrentMana() < cost) @@ -338,40 +339,38 @@ public class TileAlfPortal extends TileMod { } } - private boolean check2DArray(int[][] positions, Block block, int meta, Function... converters) { - for(int[] pos : positions) { - for(Function f : converters) + @SafeVarargs + private final boolean check2DArray(BlockPos[] positions, IBlockState state, boolean onlyCheckBlock, Function... converters) { + for(BlockPos pos : positions) { + for(Function f : converters) if(f != null) pos = f.apply(pos); - if(!checkPosition(pos, block, meta)) + if(!checkPosition(pos, state, onlyCheckBlock)) return false; } return true; } - private boolean checkPosition(int[] pos, Block block, int meta) { - int x = xCoord + pos[0]; - int y = yCoord + pos[1]; - int z = zCoord + pos[2]; - if(!worldObj.blockExists(x, y, z)) { + private boolean checkPosition(BlockPos pos, IBlockState state, boolean onlyCheckBlock) { + BlockPos pos_ = getPos().add(pos); + if(!worldObj.isBlockLoaded(pos_)) { hasUnloadedParts = true; return true; // Don't fuck everything up if there's a chunk unload } - Block blockat = worldObj.getBlock(x, y, z); - if(block == Blocks.air ? blockat.isAir(worldObj, x, y, z) : blockat == block) { - if(meta == -1) - return true; + IBlockState stateat = worldObj.getBlockState(pos_); + Block blockat = stateat.getBlock(); - int metaat = worldObj.getBlockMetadata(x, y, z); - return meta == metaat; + if(state.getBlock() == Blocks.AIR ? blockat.isAir(stateat, worldObj, pos_) : blockat == state.getBlock()) { + return onlyCheckBlock || stateat == state; } return false; } + @Nonnull @Override public AxisAlignedBB getRenderBoundingBox() { return INFINITE_EXTENT_AABB; diff --git a/src/main/java/vazkii/botania/common/block/tile/TileAltar.java b/src/main/java/vazkii/botania/common/block/tile/TileAltar.java index d6e58645c..46f06a7a1 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileAltar.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileAltar.java @@ -10,40 +10,48 @@ */ package vazkii.botania.common.block.tile; -import java.awt.Color; -import java.util.ArrayList; -import java.util.List; -import java.util.regex.Pattern; - import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.resources.I18n; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.init.Items; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.ISidedInventory; +import net.minecraft.init.SoundEvents; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.StatCollector; - -import org.lwjgl.opengl.GL11; - +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.capability.CapabilityFluidHandler; +import net.minecraftforge.fluids.capability.IFluidHandler; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import net.minecraftforge.items.IItemHandlerModifiable; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.internal.VanillaPacketDispatcher; import vazkii.botania.api.item.IPetalApothecary; import vazkii.botania.api.recipe.IFlowerComponent; import vazkii.botania.api.recipe.RecipePetals; +import vazkii.botania.api.sound.BotaniaSoundEvents; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.AltarVariant; import vazkii.botania.client.core.handler.HUDHandler; import vazkii.botania.client.core.helper.RenderHelper; import vazkii.botania.common.Botania; -import vazkii.botania.common.lib.LibBlockNames; -public class TileAltar extends TileSimpleInventory implements ISidedInventory, IPetalApothecary { +import java.awt.*; +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Pattern; + +public class TileAltar extends TileSimpleInventory implements IPetalApothecary { private static final Pattern SEED_PATTERN = Pattern.compile("(?:(?:(?:[A-Z-_.:]|^)seed)|(?:(?:[a-z-_.:]|^)Seed))(?:[sA-Z-_.:]|$)"); @@ -64,27 +72,45 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory, I if(stack == null || item.isDead) return false; - if(!isMossy && getBlockMetadata() == 0) { - if(stack.getItem() == Item.getItemFromBlock(Blocks.vine) && !worldObj.isRemote) { + if(!isMossy && worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.ALTAR_VARIANT) == AltarVariant.DEFAULT) { + if(stack.getItem() == Item.getItemFromBlock(Blocks.VINE)) { isMossy = true; - worldObj.func_147453_f(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord)); - stack.stackSize--; - if(stack.stackSize == 0) - item.setDead(); - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, xCoord, yCoord, zCoord); + if (worldObj.isRemote) { + worldObj.markBlockRangeForRenderUpdate(getPos(), getPos()); + } else { + worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock()); + stack.stackSize--; + if(stack.stackSize == 0) + item.setDead(); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos); + } + + return true; } } - if(!hasWater() && !hasLava()) { - if(stack.getItem() == Items.water_bucket && !worldObj.isRemote) { - setWater(true); - worldObj.func_147453_f(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord)); - stack.func_150996_a(Items.bucket); // Set item - } else if(stack.getItem() == Items.lava_bucket && !worldObj.isRemote) { - setLava(true); - worldObj.func_147453_f(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord)); - stack.func_150996_a(Items.bucket); // Set item - } else return false; + if(!hasWater() && !hasLava() && !worldObj.isRemote) { + + if(stack.hasCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, null)) { + IFluidHandler fluidHandler = stack.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, null); + + FluidStack drainWater = fluidHandler.drain(new FluidStack(FluidRegistry.WATER, Fluid.BUCKET_VOLUME), false); + FluidStack drainLava = fluidHandler.drain(new FluidStack(FluidRegistry.LAVA, Fluid.BUCKET_VOLUME), false); + + if(drainWater != null && drainWater.getFluid() == FluidRegistry.WATER && drainWater.amount == Fluid.BUCKET_VOLUME) { + setWater(true); + worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock()); + fluidHandler.drain(new FluidStack(FluidRegistry.WATER, Fluid.BUCKET_VOLUME), true); + return true; + } else if(drainLava != null && drainLava.getFluid() == FluidRegistry.LAVA && drainLava.amount == Fluid.BUCKET_VOLUME) { + setLava(true); + worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock()); + fluidHandler.drain(new FluidStack(FluidRegistry.LAVA, Fluid.BUCKET_VOLUME), true); + return true; + } + } + + return false; } if(hasLava()) { @@ -95,7 +121,7 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory, I boolean didChange = false; if(stack.getItem() instanceof IFlowerComponent && ((IFlowerComponent) stack.getItem()).canFit(stack, this)) { - if(getStackInSlot(getSizeInventory() - 1) != null) + if(itemHandler.getStackInSlot(getSizeInventory() - 1) != null) return false; if(!worldObj.isRemote) { @@ -104,34 +130,34 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory, I item.setDead(); for(int i = 0; i < getSizeInventory(); i++) - if(getStackInSlot(i) == null) { + if(itemHandler.getStackInSlot(i) == null) { ItemStack stackToPut = stack.copy(); stackToPut.stackSize = 1; - setInventorySlotContents(i, stackToPut); + itemHandler.setStackInSlot(i, stackToPut); didChange = true; - worldObj.playSoundAtEntity(item, "game.neutral.swim.splash", 0.1F, 1F); + worldObj.playSound(null, pos, SoundEvents.ENTITY_GENERIC_SPLASH, SoundCategory.BLOCKS, 0.1F, 10F); break; } } } else if(stack.getItem() != null && SEED_PATTERN.matcher(stack.getItem().getUnlocalizedName(stack)).find()) { for(RecipePetals recipe : BotaniaAPI.petalRecipes) { - if(recipe.matches(this)) { + if(recipe.matches(itemHandler)) { saveLastRecipe(); if(!worldObj.isRemote) { for(int i = 0; i < getSizeInventory(); i++) - setInventorySlotContents(i, null); + itemHandler.setStackInSlot(i, null); stack.stackSize--; if(stack.stackSize == 0) item.setDead(); ItemStack output = recipe.getOutput().copy(); - EntityItem outputItem = new EntityItem(worldObj, xCoord + 0.5, yCoord + 1.5, zCoord + 0.5, output); + EntityItem outputItem = new EntityItem(worldObj, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, output); worldObj.spawnEntityInWorld(outputItem); setWater(false); - worldObj.func_147453_f(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord)); + worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock()); } craftingFanciness(); @@ -146,9 +172,9 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory, I } public void saveLastRecipe() { - lastRecipe = new ArrayList(); + lastRecipe = new ArrayList<>(); for(int i = 0; i < getSizeInventory(); i++) { - ItemStack stack = getStackInSlot(i); + ItemStack stack = itemHandler.getStackInSlot(i); if(stack == null) break; lastRecipe.add(stack.copy()); @@ -157,12 +183,12 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory, I } public void trySetLastRecipe(EntityPlayer player) { - tryToSetLastRecipe(player, this, lastRecipe); + tryToSetLastRecipe(player, itemHandler, lastRecipe); if(!isEmpty()) - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, xCoord, yCoord, zCoord); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos); } - public static void tryToSetLastRecipe(EntityPlayer player, IInventory inv, List lastRecipe) { + public static void tryToSetLastRecipe(EntityPlayer player, IItemHandlerModifiable inv, List lastRecipe) { if(lastRecipe == null || lastRecipe.isEmpty() || player.worldObj.isRemote) return; @@ -181,7 +207,7 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory, I ItemStack stackToPut = pstack.copy(); stackToPut.stackSize = 1; - inv.setInventorySlotContents(index, stackToPut); + inv.setStackInSlot(index, stackToPut); didAny = true; index++; break; @@ -191,7 +217,7 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory, I if(didAny) { if(inv instanceof TileAltar) - player.worldObj.playSoundAtEntity(player, "game.neutral.swim.splash", 0.1F, 1F); + player.worldObj.playSound(null, ((TileAltar) inv).getPos(), SoundEvents.ENTITY_GENERIC_SPLASH, SoundCategory.BLOCKS, 0.1F, 10F); if(player instanceof EntityPlayerMP) { EntityPlayerMP mp = (EntityPlayerMP) player; mp.inventoryContainer.detectAndSendChanges(); @@ -199,38 +225,37 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory, I } } - public void craftingFanciness() { - worldObj.playSoundEffect(xCoord, yCoord, zCoord, "botania:altarCraft", 1F, 1F); + private void craftingFanciness() { + worldObj.playSound(null, pos, BotaniaSoundEvents.altarCraft, SoundCategory.BLOCKS, 1F, 1F); for(int i = 0; i < 25; i++) { float red = (float) Math.random(); float green = (float) Math.random(); float blue = (float) Math.random(); - Botania.proxy.sparkleFX(worldObj, xCoord + 0.5 + Math.random() * 0.4 - 0.2, yCoord + 1, zCoord + 0.5 + Math.random() * 0.4 - 0.2, red, green, blue, (float) Math.random(), 10); + Botania.proxy.sparkleFX(pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, red, green, blue, (float) Math.random(), 10); } } public boolean isEmpty() { for(int i = 0; i < getSizeInventory(); i++) - if(getStackInSlot(i) != null) + if(itemHandler.getStackInSlot(i) != null) return false; return true; } @Override - public void updateEntity() { - List items = worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord + 1D / 16D * 20D, zCoord, xCoord + 1, yCoord + 1D / 16D * 21D, zCoord + 1)); + public void update() { + List items = worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos.add(0, 1D / 16D * 20D, 0), pos.add(1, 1D / 16D * 32D, 1))); boolean didChange = false; - for(EntityItem item : items) didChange = collideEntityItem(item) || didChange; if(didChange) - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, xCoord, yCoord, zCoord); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos); for(int i = 0; i < getSizeInventory(); i++) { - ItemStack stackAt = getStackInSlot(i); + ItemStack stackAt = itemHandler.getStackInSlot(i); if(stackAt == null) break; @@ -240,16 +265,16 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory, I float green = color.getGreen() / 255F; float blue = color.getBlue() / 255F; if(Math.random() >= 0.75F) - worldObj.playSoundEffect(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, "game.neutral.swim.splash", 0.1F, 10F); - Botania.proxy.sparkleFX(worldObj, xCoord + 0.5 + Math.random() * 0.4 - 0.2, yCoord + 1, zCoord + 0.5 + Math.random() * 0.4 - 0.2, red, green, blue, (float) Math.random(), 10); + worldObj.playSound(null, pos, SoundEvents.ENTITY_GENERIC_SPLASH, SoundCategory.BLOCKS, 0.1F, 10F); + Botania.proxy.sparkleFX(pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, red, green, blue, (float) Math.random(), 10); } } if(hasLava()) { isMossy = false; - worldObj.spawnParticle("smoke", xCoord + 0.5 + Math.random() * 0.4 - 0.2, yCoord + 1, zCoord + 0.5 + Math.random() * 0.4 - 0.2, 0, 0.05, 0); + worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, 0, 0.05, 0); if(Math.random() > 0.9) - worldObj.spawnParticle("lava", xCoord + 0.5 + Math.random() * 0.4 - 0.2, yCoord + 1, zCoord + 0.5 + Math.random() * 0.4 - 0.2, 0, 0.01, 0); + worldObj.spawnParticle(EnumParticleTypes.LAVA, pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, 0, 0.01, 0); } if(recipeKeepTicks > 0) @@ -258,8 +283,8 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory, I } @Override - public void writeCustomNBT(NBTTagCompound cmp) { - super.writeCustomNBT(cmp); + public void writePacketNBT(NBTTagCompound cmp) { + super.writePacketNBT(cmp); cmp.setBoolean(TAG_HAS_WATER, hasWater()); cmp.setBoolean(TAG_HAS_LAVA, hasLava()); @@ -267,58 +292,38 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory, I } @Override - public void readCustomNBT(NBTTagCompound cmp) { - super.readCustomNBT(cmp); + public void readPacketNBT(NBTTagCompound cmp) { + super.readPacketNBT(cmp); hasWater = cmp.getBoolean(TAG_HAS_WATER); hasLava = cmp.getBoolean(TAG_HAS_LAVA); isMossy = cmp.getBoolean(TAG_IS_MOSSY); } - @Override - public String getInventoryName() { - return LibBlockNames.ALTAR; - } - @Override public int getSizeInventory() { return 16; } @Override - public int getInventoryStackLimit() { - return 1; - } - - @Override - public boolean isItemValidForSlot(int i, ItemStack itemstack) { - return false; - } - - @Override - public int[] getAccessibleSlotsFromSide(int var1) { - return new int[0]; - } - - @Override - public boolean canInsertItem(int i, ItemStack itemstack, int j) { - return false; - } - - @Override - public boolean canExtractItem(int i, ItemStack itemstack, int j) { - return false; + protected SimpleItemStackHandler createItemHandler() { + return new SimpleItemStackHandler(this, false) { + @Override + protected int getStackLimit(int slot, ItemStack stack) { + return 1; + } + }; } @Override public void setWater(boolean water) { hasWater = water; - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, xCoord, yCoord, zCoord); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos); } public void setLava(boolean lava) { hasLava = lava; - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, xCoord, yCoord, zCoord); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos); } @Override @@ -330,6 +335,7 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory, I return hasLava; } + @SideOnly(Side.CLIENT) public void renderHUD(Minecraft mc, ScaledResolution res) { int xc = res.getScaledWidth() / 2; int yc = res.getScaledHeight() / 2; @@ -338,7 +344,7 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory, I int radius = 24; int amt = 0; for(int i = 0; i < getSizeInventory(); i++) { - if(getStackInSlot(i) == null) + if(itemHandler.getStackInSlot(i) == null) break; amt++; } @@ -347,36 +353,36 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory, I float anglePer = 360F / amt; for(RecipePetals recipe : BotaniaAPI.petalRecipes) - if(recipe.matches(this)) { - GL11.glColor4f(1F, 1F, 1F, 1F); + if(recipe.matches(itemHandler)) { + GlStateManager.color(1F, 1F, 1F, 1F); mc.renderEngine.bindTexture(HUDHandler.manaBar); RenderHelper.drawTexturedModalRect(xc + radius + 9, yc - 8, 0, 0, 8, 22, 15); ItemStack stack = recipe.getOutput(); net.minecraft.client.renderer.RenderHelper.enableGUIStandardItemLighting(); - RenderItem.getInstance().renderItemIntoGUI(mc.fontRenderer, mc.renderEngine, stack, xc + radius + 32, yc - 8); - RenderItem.getInstance().renderItemIntoGUI(mc.fontRenderer, mc.renderEngine, new ItemStack(Items.wheat_seeds), xc + radius + 16, yc + 6); + mc.getRenderItem().renderItemIntoGUI(stack, xc + radius + 32, yc - 8); + mc.getRenderItem().renderItemIntoGUI(new ItemStack(Items.WHEAT_SEEDS), xc + radius + 16, yc + 6); net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting(); - mc.fontRenderer.drawStringWithShadow("+", xc + radius + 14, yc + 10, 0xFFFFFF); + mc.fontRendererObj.drawStringWithShadow("+", xc + radius + 14, yc + 10, 0xFFFFFF); } net.minecraft.client.renderer.RenderHelper.enableGUIStandardItemLighting(); for(int i = 0; i < amt; i++) { double xPos = xc + Math.cos(angle * Math.PI / 180D) * radius - 8; double yPos = yc + Math.sin(angle * Math.PI / 180D) * radius - 8; - GL11.glTranslated(xPos, yPos, 0); - RenderItem.getInstance().renderItemIntoGUI(mc.fontRenderer, mc.renderEngine, getStackInSlot(i), 0, 0); - GL11.glTranslated(-xPos, -yPos, 0); + GlStateManager.translate(xPos, yPos, 0); + mc.getRenderItem().renderItemIntoGUI(itemHandler.getStackInSlot(i), 0, 0); + GlStateManager.translate(-xPos, -yPos, 0); angle += anglePer; } net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting(); } else if(recipeKeepTicks > 0 && hasWater) { - String s = StatCollector.translateToLocal("botaniamisc.altarRefill0"); - mc.fontRenderer.drawStringWithShadow(s, xc - mc.fontRenderer.getStringWidth(s) / 2, yc + 10, 0xFFFFFF); - s = StatCollector.translateToLocal("botaniamisc.altarRefill1"); - mc.fontRenderer.drawStringWithShadow(s, xc - mc.fontRenderer.getStringWidth(s) / 2, yc + 20, 0xFFFFFF); + String s = I18n.format("botaniamisc.altarRefill0"); + mc.fontRendererObj.drawStringWithShadow(s, xc - mc.fontRendererObj.getStringWidth(s) / 2, yc + 10, 0xFFFFFF); + s = I18n.format("botaniamisc.altarRefill1"); + mc.fontRendererObj.drawStringWithShadow(s, xc - mc.fontRendererObj.getStringWidth(s) / 2, yc + 20, 0xFFFFFF); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileAvatar.java b/src/main/java/vazkii/botania/common/block/tile/TileAvatar.java index 1e0e62b28..a7afccf04 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileAvatar.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileAvatar.java @@ -10,15 +10,14 @@ */ package vazkii.botania.common.block.tile; -import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.util.EnumFacing; +import net.minecraftforge.items.IItemHandler; import vazkii.botania.api.item.IAvatarTile; import vazkii.botania.api.item.IAvatarWieldable; -import vazkii.botania.common.lib.LibBlockNames; -public class TileAvatar extends TileSimpleInventory implements IAvatarTile, ISidedInventory { +public class TileAvatar extends TileSimpleInventory implements IAvatarTile { private static final int MAX_MANA = 6400; @@ -31,19 +30,17 @@ public class TileAvatar extends TileSimpleInventory implements IAvatarTile, ISid int mana; @Override - public void updateEntity() { - super.updateEntity(); - + public void update() { enabled = true; - for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { - int redstoneSide = worldObj.getIndirectPowerLevelTo(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir.ordinal()); + for(EnumFacing dir : EnumFacing.VALUES) { + int redstoneSide = worldObj.getRedstonePower(pos.offset(dir), dir); if(redstoneSide > 0) { enabled = false; break; } } - ItemStack stack = getStackInSlot(0); + ItemStack stack = itemHandler.getStackInSlot(0); if(stack != null && stack.getItem() instanceof IAvatarWieldable) { IAvatarWieldable wieldable = (IAvatarWieldable) stack.getItem(); wieldable.onAvatarUpdate(this, stack); @@ -54,16 +51,16 @@ public class TileAvatar extends TileSimpleInventory implements IAvatarTile, ISid } @Override - public void writeCustomNBT(NBTTagCompound par1nbtTagCompound) { - super.writeCustomNBT(par1nbtTagCompound); + public void writePacketNBT(NBTTagCompound par1nbtTagCompound) { + super.writePacketNBT(par1nbtTagCompound); par1nbtTagCompound.setBoolean(TAG_ENABLED, enabled); par1nbtTagCompound.setInteger(TAG_TICKS_ELAPSED, ticksElapsed); par1nbtTagCompound.setInteger(TAG_MANA, mana); } @Override - public void readCustomNBT(NBTTagCompound par1nbtTagCompound) { - super.readCustomNBT(par1nbtTagCompound); + public void readPacketNBT(NBTTagCompound par1nbtTagCompound) { + super.readPacketNBT(par1nbtTagCompound); enabled = par1nbtTagCompound.getBoolean(TAG_ENABLED); ticksElapsed = par1nbtTagCompound.getInteger(TAG_TICKS_ELAPSED); mana = par1nbtTagCompound.getInteger(TAG_MANA); @@ -75,33 +72,13 @@ public class TileAvatar extends TileSimpleInventory implements IAvatarTile, ISid } @Override - public int getInventoryStackLimit() { - return 1; - } - - @Override - public boolean isItemValidForSlot(int i, ItemStack itemstack) { - return itemstack != null && itemstack.getItem() instanceof IAvatarTile; - } - - @Override - public int[] getAccessibleSlotsFromSide(int p_94128_1_) { - return new int[0]; - } - - @Override - public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_) { - return false; - } - - @Override - public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) { - return false; - } - - @Override - public String getInventoryName() { - return LibBlockNames.AVATAR; + protected SimpleItemStackHandler createItemHandler() { + return new SimpleItemStackHandler(this, false) { + @Override + protected int getStackLimit(int slot, ItemStack stack) { + return 1; + } + }; } @Override @@ -116,7 +93,7 @@ public class TileAvatar extends TileSimpleInventory implements IAvatarTile, ISid @Override public boolean canRecieveManaFromBursts() { - return getStackInSlot(0) != null; + return itemHandler.getStackInSlot(0) != null; } @Override @@ -124,6 +101,11 @@ public class TileAvatar extends TileSimpleInventory implements IAvatarTile, ISid return mana; } + @Override + public IItemHandler getInventory() { + return getItemHandler(); + } + @Override public int getElapsedFunctionalTicks() { return ticksElapsed; diff --git a/src/main/java/vazkii/botania/common/block/tile/TileBifrost.java b/src/main/java/vazkii/botania/common/block/tile/TileBifrost.java index acefc2ffd..d15d53aef 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileBifrost.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileBifrost.java @@ -13,6 +13,8 @@ package vazkii.botania.common.block.tile; import net.minecraft.nbt.NBTTagCompound; import vazkii.botania.common.Botania; +import javax.annotation.Nonnull; + public class TileBifrost extends TileMod { private static final String TAG_TICKS = "ticks"; @@ -20,19 +22,21 @@ public class TileBifrost extends TileMod { public int ticks = 0; @Override - public void updateEntity() { + public void update() { if(!worldObj.isRemote) { if(ticks <= 0) { - worldObj.setBlockToAir(xCoord, yCoord, zCoord); + worldObj.setBlockToAir(pos); } else ticks--; } else if(Math.random() < 0.1) - Botania.proxy.sparkleFX(worldObj, xCoord + Math.random(), yCoord + Math.random(), zCoord + Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), 0.45F + 0.2F * (float) Math.random(), 6); + Botania.proxy.sparkleFX(pos.getX() + Math.random(), pos.getY() + Math.random(), pos.getZ() + Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), 0.45F + 0.2F * (float) Math.random(), 6); } + @Nonnull @Override - public void writeToNBT(NBTTagCompound par1nbtTagCompound) { - super.writeToNBT(par1nbtTagCompound); - par1nbtTagCompound.setInteger(TAG_TICKS, ticks); + public NBTTagCompound writeToNBT(NBTTagCompound par1nbtTagCompound) { + NBTTagCompound ret = super.writeToNBT(par1nbtTagCompound); + ret.setInteger(TAG_TICKS, ticks); + return ret; } @Override diff --git a/src/main/java/vazkii/botania/common/block/tile/TileBrewery.java b/src/main/java/vazkii/botania/common/block/tile/TileBrewery.java index 2a4961a9c..e2c0950b0 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileBrewery.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileBrewery.java @@ -10,29 +10,34 @@ */ package vazkii.botania.common.block.tile; -import java.awt.Color; -import java.util.List; - import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.EnumHand; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.AxisAlignedBB; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.brew.IBrewContainer; import vazkii.botania.api.brew.IBrewItem; import vazkii.botania.api.internal.VanillaPacketDispatcher; import vazkii.botania.api.mana.IManaReceiver; import vazkii.botania.api.recipe.RecipeBrew; +import vazkii.botania.api.sound.BotaniaSoundEvents; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.client.core.helper.RenderHelper; import vazkii.botania.common.Botania; -import vazkii.botania.common.lib.LibBlockNames; +import vazkii.botania.common.block.ModBlocks; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.awt.*; +import java.util.List; // This is mostly copypasta from TileRuneAltar -public class TileBrewery extends TileSimpleInventory implements ISidedInventory, IManaReceiver { +public class TileBrewery extends TileSimpleInventory implements IManaReceiver { private static final String TAG_MANA = "mana"; @@ -41,34 +46,34 @@ public class TileBrewery extends TileSimpleInventory implements ISidedInventory, int manaLastTick = 0; public int signal = 0; - public boolean addItem(EntityPlayer player, ItemStack stack) { - if(recipe != null || stack == null || stack.getItem() instanceof IBrewItem && ((IBrewItem) stack.getItem()).getBrew(stack) != null && ((IBrewItem) stack.getItem()).getBrew(stack) != BotaniaAPI.fallbackBrew || getStackInSlot(0) == null != stack.getItem() instanceof IBrewContainer) + public boolean addItem(@Nullable EntityPlayer player, ItemStack stack, @Nullable EnumHand hand) { + if(recipe != null || stack == null || stack.getItem() instanceof IBrewItem && ((IBrewItem) stack.getItem()).getBrew(stack) != null && ((IBrewItem) stack.getItem()).getBrew(stack) != BotaniaAPI.fallbackBrew || itemHandler.getStackInSlot(0) == null != stack.getItem() instanceof IBrewContainer) return false; boolean did = false; for(int i = 0; i < getSizeInventory(); i++) - if(getStackInSlot(i) == null) { + if(itemHandler.getStackInSlot(i) == null) { did = true; ItemStack stackToAdd = stack.copy(); stackToAdd.stackSize = 1; - setInventorySlotContents(i, stackToAdd); + itemHandler.setStackInSlot(i, stackToAdd); if(player == null || !player.capabilities.isCreativeMode) { stack.stackSize--; if(stack.stackSize == 0 && player != null) - player.inventory.setInventorySlotContents(player.inventory.currentItem, null); + player.setHeldItem(hand, null); } break; } if(did) { - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, xCoord, yCoord, zCoord); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos); for(RecipeBrew recipe : BotaniaAPI.brewRecipes) - if(recipe.matches(this) && recipe.getOutput(getStackInSlot(0)) != null) { + if(recipe.matches(itemHandler) && recipe.getOutput(itemHandler.getStackInSlot(0)) != null) { this.recipe = recipe; - worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 1, 1 | 2); + worldObj.setBlockState(pos, ModBlocks.brewery.getDefaultState().withProperty(BotaniaStateProps.POWERED, true), 1 | 2); } } @@ -76,14 +81,12 @@ public class TileBrewery extends TileSimpleInventory implements ISidedInventory, } @Override - public void updateEntity() { - super.updateEntity(); - + public void update() { if(mana > 0 && recipe == null) { for(RecipeBrew recipe : BotaniaAPI.brewRecipes) - if(recipe.matches(this)) { + if(recipe.matches(itemHandler)) { this.recipe = recipe; - worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 1, 1 | 2); + worldObj.setBlockState(pos, ModBlocks.brewery.getDefaultState().withProperty(BotaniaStateProps.POWERED, true), 1 | 2); } if(recipe == null) @@ -94,31 +97,31 @@ public class TileBrewery extends TileSimpleInventory implements ISidedInventory, recieveMana(0); if(!worldObj.isRemote && recipe == null) { - List items = worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1)); + List items = worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos.getX(), pos.getY(), pos.getZ(), pos.getX() + 1, pos.getY() + 1, pos.getZ() + 1)); for(EntityItem item : items) if(!item.isDead && item.getEntityItem() != null) { ItemStack stack = item.getEntityItem(); - if(addItem(null, stack) && stack.stackSize == 0) + if(addItem(null, stack, null) && stack.stackSize == 0) item.setDead(); } } if(recipe != null) { - if(!recipe.matches(this)) { + if(!recipe.matches(itemHandler)) { recipe = null; - worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 0, 1 | 2); + worldObj.setBlockState(pos, ModBlocks.brewery.getDefaultState(), 1 | 2); } if(recipe != null) { if(mana != manaLastTick) { - Color color = new Color(recipe.getBrew().getColor(getStackInSlot(0))); + Color color = new Color(recipe.getBrew().getColor(itemHandler.getStackInSlot(0))); float r = color.getRed() / 255F; float g = color.getGreen() / 255F; float b = color.getBlue() / 255F; for(int i = 0; i < 5; i++) { - Botania.proxy.wispFX(worldObj, xCoord + 0.7 - Math.random() * 0.4, yCoord + 0.9 - Math.random() * 0.2, zCoord + 0.7 - Math.random() * 0.4, r, g, b, 0.1F + (float) Math.random() * 0.05F, 0.03F - (float) Math.random() * 0.06F, 0.03F + (float) Math.random() * 0.015F, 0.03F - (float) Math.random() * 0.06F); + Botania.proxy.wispFX(pos.getX() + 0.7 - Math.random() * 0.4, pos.getY() + 0.9 - Math.random() * 0.2, pos.getZ() + 0.7 - Math.random() * 0.4, r, g, b, 0.1F + (float) Math.random() * 0.05F, 0.03F - (float) Math.random() * 0.06F, 0.03F + (float) Math.random() * 0.015F, 0.03F - (float) Math.random() * 0.06F); for(int j = 0; j < 2; j++) - Botania.proxy.wispFX(worldObj, xCoord + 0.7 - Math.random() * 0.4, yCoord + 0.9 - Math.random() * 0.2, zCoord + 0.7 - Math.random() * 0.4, 0.2F, 0.2F, 0.2F, 0.1F + (float) Math.random() * 0.2F, 0.03F - (float) Math.random() * 0.06F, 0.03F + (float) Math.random() * 0.015F, 0.03F - (float) Math.random() * 0.06F); + Botania.proxy.wispFX(pos.getX() + 0.7 - Math.random() * 0.4, pos.getY() + 0.9 - Math.random() * 0.2, pos.getZ() + 0.7 - Math.random() * 0.4, 0.2F, 0.2F, 0.2F, 0.1F + (float) Math.random() * 0.2F, 0.03F - (float) Math.random() * 0.06F, 0.03F + (float) Math.random() * 0.015F, 0.03F - (float) Math.random() * 0.06F); } } @@ -126,13 +129,13 @@ public class TileBrewery extends TileSimpleInventory implements ISidedInventory, int mana = getManaCost(); recieveMana(-mana); if(!worldObj.isRemote) { - ItemStack output = recipe.getOutput(getStackInSlot(0)); - EntityItem outputItem = new EntityItem(worldObj, xCoord + 0.5, yCoord + 1.5, zCoord + 0.5, output); + ItemStack output = recipe.getOutput(itemHandler.getStackInSlot(0)); + EntityItem outputItem = new EntityItem(worldObj, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, output); worldObj.spawnEntityInWorld(outputItem); } for(int i = 0; i < getSizeInventory(); i++) - setInventorySlotContents(i, null); + itemHandler.setStackInSlot(i, null); craftingFanciness(); } @@ -145,14 +148,14 @@ public class TileBrewery extends TileSimpleInventory implements ISidedInventory, if(newSignal != signal) { signal = newSignal; - worldObj.func_147453_f(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord)); + worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock()); } manaLastTick = mana; } public int getManaCost() { - ItemStack stack = getStackInSlot(0); + ItemStack stack = itemHandler.getStackInSlot(0); if(recipe == null || stack == null || !(stack.getItem() instanceof IBrewContainer)) return 0; IBrewContainer container = (IBrewContainer) stack.getItem(); @@ -160,28 +163,28 @@ public class TileBrewery extends TileSimpleInventory implements ISidedInventory, } public void craftingFanciness() { - worldObj.playSoundEffect(xCoord, yCoord, zCoord, "botania:potionCreate", 1F, 1.5F + (float) Math.random() * 0.25F); + worldObj.playSound(null, pos, BotaniaSoundEvents.potionCreate, SoundCategory.BLOCKS, 1F, 1.5F + (float) Math.random() * 0.25F); for(int i = 0; i < 25; i++) { - Color color = new Color(recipe.getBrew().getColor(getStackInSlot(0))); + Color color = new Color(recipe.getBrew().getColor(itemHandler.getStackInSlot(0))); float r = color.getRed() / 255F; float g = color.getGreen() / 255F; float b = color.getBlue() / 255F; - Botania.proxy.sparkleFX(worldObj, xCoord + 0.5 + Math.random() * 0.4 - 0.2, yCoord + 1, zCoord + 0.5 + Math.random() * 0.4 - 0.2, r, g, b, (float) Math.random() * 2F + 0.5F, 10); + Botania.proxy.sparkleFX(pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, r, g, b, (float) Math.random() * 2F + 0.5F, 10); for(int j = 0; j < 2; j++) - Botania.proxy.wispFX(worldObj, xCoord + 0.7 - Math.random() * 0.4, yCoord + 0.9 - Math.random() * 0.2, zCoord + 0.7 - Math.random() * 0.4, 0.2F, 0.2F, 0.2F, 0.1F + (float) Math.random() * 0.2F, 0.05F - (float) Math.random() * 0.1F, 0.05F + (float) Math.random() * 0.03F, 0.05F - (float) Math.random() * 0.1F); + Botania.proxy.wispFX(pos.getX() + 0.7 - Math.random() * 0.4, pos.getY() + 0.9 - Math.random() * 0.2, pos.getZ() + 0.7 - Math.random() * 0.4, 0.2F, 0.2F, 0.2F, 0.1F + (float) Math.random() * 0.2F, 0.05F - (float) Math.random() * 0.1F, 0.05F + (float) Math.random() * 0.03F, 0.05F - (float) Math.random() * 0.1F); } } @Override - public void writeCustomNBT(NBTTagCompound par1nbtTagCompound) { - super.writeCustomNBT(par1nbtTagCompound); + public void writePacketNBT(NBTTagCompound par1nbtTagCompound) { + super.writePacketNBT(par1nbtTagCompound); par1nbtTagCompound.setInteger(TAG_MANA, mana); } @Override - public void readCustomNBT(NBTTagCompound par1nbtTagCompound) { - super.readCustomNBT(par1nbtTagCompound); + public void readPacketNBT(NBTTagCompound par1nbtTagCompound) { + super.readPacketNBT(par1nbtTagCompound); mana = par1nbtTagCompound.getInteger(TAG_MANA); } @@ -191,39 +194,20 @@ public class TileBrewery extends TileSimpleInventory implements ISidedInventory, return 7; } + @Nonnull @Override public AxisAlignedBB getRenderBoundingBox() { return INFINITE_EXTENT_AABB; } @Override - public String getInventoryName() { - return LibBlockNames.RUNE_ALTAR; - } - - @Override - public int getInventoryStackLimit() { - return 1; - } - - @Override - public int[] getAccessibleSlotsFromSide(int var1) { - int accessibleSlot = -1; - for(int i = 0; i < getSizeInventory(); i++) - if(getStackInSlot(i) != null) - accessibleSlot = i; - - return accessibleSlot == -1 ? new int[0] : new int[] { accessibleSlot }; - } - - @Override - public boolean canInsertItem(int i, ItemStack itemstack, int j) { - return true; - } - - @Override - public boolean canExtractItem(int i, ItemStack itemstack, int j) { - return mana == 0; + protected SimpleItemStackHandler createItemHandler() { + return new SimpleItemStackHandler(this, false) { + @Override + protected int getStackLimit(int slot, ItemStack stack) { + return 1; + } + }; } @Override @@ -255,7 +239,7 @@ public class TileBrewery extends TileSimpleInventory implements ISidedInventory, if(recipe == null) return; - RenderHelper.renderProgressPie(x, y, (float) mana / (float) manaToGet, recipe.getOutput(getStackInSlot(0))); + RenderHelper.renderProgressPie(x, y, (float) mana / (float) manaToGet, recipe.getOutput(itemHandler.getStackInSlot(0))); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileCacophonium.java b/src/main/java/vazkii/botania/common/block/tile/TileCacophonium.java index a1dc474eb..4e8259c3e 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileCacophonium.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileCacophonium.java @@ -12,6 +12,7 @@ package vazkii.botania.common.block.tile; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.SoundCategory; import vazkii.botania.common.item.ItemCacophonium; public class TileCacophonium extends TileMod { @@ -21,12 +22,12 @@ public class TileCacophonium extends TileMod { public ItemStack stack; public void annoyDirewolf() { - ItemCacophonium.playSound(worldObj, stack, xCoord, yCoord, zCoord, 1F); + ItemCacophonium.playSound(worldObj, stack, pos.getX(), pos.getY(), pos.getZ(), SoundCategory.BLOCKS, 1F); } @Override - public void writeCustomNBT(NBTTagCompound cmp) { - super.writeCustomNBT(cmp); + public void writePacketNBT(NBTTagCompound cmp) { + super.writePacketNBT(cmp); NBTTagCompound cmp1 = new NBTTagCompound(); if(stack != null) @@ -35,8 +36,8 @@ public class TileCacophonium extends TileMod { } @Override - public void readCustomNBT(NBTTagCompound cmp) { - super.readCustomNBT(cmp); + public void readPacketNBT(NBTTagCompound cmp) { + super.readPacketNBT(cmp); NBTTagCompound cmp1 = cmp.getCompoundTag(TAG_STACK); stack = ItemStack.loadItemStackFromNBT(cmp1); diff --git a/src/main/java/vazkii/botania/common/block/tile/TileCamo.java b/src/main/java/vazkii/botania/common/block/tile/TileCamo.java index e96e0e375..7ccdfeb93 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileCamo.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileCamo.java @@ -12,40 +12,37 @@ package vazkii.botania.common.block.tile; import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.NetworkManager; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.network.play.server.SPacketUpdateTileEntity; public class TileCamo extends TileMod { private static final String TAG_CAMO = "camo"; private static final String TAG_CAMO_META = "camoMeta"; - public Block camo; - public int camoMeta; + public IBlockState camoState; @Override - public boolean canUpdate() { - return false; - } - - @Override - public void writeCustomNBT(NBTTagCompound cmp) { - if(camo != null) { - cmp.setString(TAG_CAMO, Block.blockRegistry.getNameForObject(camo)); - cmp.setInteger(TAG_CAMO_META, camoMeta); + public void writePacketNBT(NBTTagCompound cmp) { + if(camoState != null) { + cmp.setString(TAG_CAMO, Block.REGISTRY.getNameForObject(camoState.getBlock()).toString()); + cmp.setInteger(TAG_CAMO_META, camoState.getBlock().getMetaFromState(camoState)); } } @Override - public void readCustomNBT(NBTTagCompound cmp) { - camo = Block.getBlockFromName(cmp.getString(TAG_CAMO)); - camoMeta = cmp.getInteger(TAG_CAMO_META); + public void readPacketNBT(NBTTagCompound cmp) { + Block b = Block.getBlockFromName(cmp.getString(TAG_CAMO)); + if (b != null) { + camoState = b.getStateFromMeta(cmp.getInteger(TAG_CAMO_META)); + } } @Override - public void onDataPacket(NetworkManager manager, S35PacketUpdateTileEntity packet) { + public void onDataPacket(NetworkManager manager, SPacketUpdateTileEntity packet) { super.onDataPacket(manager, packet); - worldObj.markBlockRangeForRenderUpdate(xCoord,yCoord,zCoord,xCoord,yCoord,zCoord); + worldObj.markBlockRangeForRenderUpdate(pos, pos); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileCell.java b/src/main/java/vazkii/botania/common/block/tile/TileCell.java index ed5f73441..97d4b9c1e 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileCell.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileCell.java @@ -12,7 +12,7 @@ package vazkii.botania.common.block.tile; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.math.BlockPos; public class TileCell extends TileMod { @@ -27,34 +27,25 @@ public class TileCell extends TileMod { private int generation; private boolean ticked; - private ChunkCoordinates flowerCoords = new ChunkCoordinates(); - private ChunkCoordinates validCoords = new ChunkCoordinates(); - - @Override - public boolean canUpdate() { - return false; - } + private BlockPos flowerCoords = new BlockPos(0, -1, 0); + private BlockPos validCoords = new BlockPos(0, -1, 0); public void setGeneration(TileEntity flower, int gen) { generation = gen; if(!ticked) { - flowerCoords.posX = flower.xCoord; - flowerCoords.posY = flower.yCoord; - flowerCoords.posZ = flower.zCoord; - validCoords.posX = xCoord; - validCoords.posY = yCoord; - validCoords.posZ = zCoord; + flowerCoords = flower.getPos(); + validCoords = this.getPos(); ticked = true; } else if(!matchCoords(validCoords, this) || !matchCoords(flowerCoords, flower)) - worldObj.setBlockToAir(xCoord, yCoord, zCoord); + worldObj.setBlockToAir(pos); } public boolean isSameFlower(TileEntity flower) { return matchCoords(validCoords, this) && matchCoords(flowerCoords, flower); } - - private boolean matchCoords(ChunkCoordinates coords, TileEntity tile) { - return coords.posX == tile.xCoord && coords.posY == tile.yCoord && coords.posZ == tile.zCoord; + + private boolean matchCoords(BlockPos coords, TileEntity tile) { + return coords.equals(tile.getPos()); } public int getGeneration() { @@ -62,30 +53,34 @@ public class TileCell extends TileMod { } @Override - public void writeCustomNBT(NBTTagCompound cmp) { + public void writePacketNBT(NBTTagCompound cmp) { cmp.setInteger(TAG_GENERATION, generation); cmp.setBoolean(TAG_TICKED, ticked); if(ticked) { - cmp.setInteger(TAG_FLOWER_X, flowerCoords.posX); - cmp.setInteger(TAG_FLOWER_Y, flowerCoords.posY); - cmp.setInteger(TAG_FLOWER_Z, flowerCoords.posZ); - cmp.setInteger(TAG_VALID_X, validCoords.posX); - cmp.setInteger(TAG_VALID_Y, validCoords.posY); - cmp.setInteger(TAG_VALID_Z, validCoords.posZ); + cmp.setInteger(TAG_FLOWER_X, flowerCoords.getX()); + cmp.setInteger(TAG_FLOWER_Y, flowerCoords.getY()); + cmp.setInteger(TAG_FLOWER_Z, flowerCoords.getZ()); + cmp.setInteger(TAG_VALID_X, validCoords.getX()); + cmp.setInteger(TAG_VALID_Y, validCoords.getY()); + cmp.setInteger(TAG_VALID_Z, validCoords.getZ()); } } @Override - public void readCustomNBT(NBTTagCompound cmp) { + public void readPacketNBT(NBTTagCompound cmp) { generation = cmp.getInteger(TAG_GENERATION); ticked = cmp.getBoolean(TAG_TICKED); if(ticked) { - flowerCoords.posX = cmp.getInteger(TAG_FLOWER_X); - flowerCoords.posY = cmp.getInteger(TAG_FLOWER_Y); - flowerCoords.posZ = cmp.getInteger(TAG_FLOWER_Z); - validCoords.posX = cmp.getInteger(TAG_VALID_X); - validCoords.posY = cmp.getInteger(TAG_VALID_Y); - validCoords.posZ = cmp.getInteger(TAG_VALID_Z); + flowerCoords = new BlockPos( + cmp.getInteger(TAG_FLOWER_X), + cmp.getInteger(TAG_FLOWER_Y), + cmp.getInteger(TAG_FLOWER_Z) + ); + validCoords = new BlockPos( + cmp.getInteger(TAG_VALID_X), + cmp.getInteger(TAG_VALID_Y), + cmp.getInteger(TAG_VALID_Z) + ); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileCocoon.java b/src/main/java/vazkii/botania/common/block/tile/TileCocoon.java index 1dd09aed9..831045fca 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileCocoon.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileCocoon.java @@ -18,11 +18,12 @@ import net.minecraft.entity.passive.EntityHorse; import net.minecraft.entity.passive.EntityMooshroom; import net.minecraft.entity.passive.EntityOcelot; import net.minecraft.entity.passive.EntityPig; +import net.minecraft.entity.passive.EntityRabbit; import net.minecraft.entity.passive.EntitySheep; import net.minecraft.entity.passive.EntityVillager; import net.minecraft.entity.passive.EntityWolf; import net.minecraft.nbt.NBTTagCompound; -import cpw.mods.fml.common.registry.VillagerRegistry; +import net.minecraftforge.fml.common.registry.VillagerRegistry; public class TileCocoon extends TileMod { @@ -36,16 +37,16 @@ public class TileCocoon extends TileMod { public int emeraldsGiven; @Override - public void updateEntity() { + public void update() { timePassed++; if(timePassed >= TOTAL_TIME) hatch(); } - public void hatch() { + private void hatch() { if(!worldObj.isRemote) { - worldObj.playAuxSFX(2001, xCoord, yCoord, zCoord, Block.getIdFromBlock(getBlockType())); - worldObj.setBlockToAir(xCoord, yCoord, zCoord); + worldObj.playEvent(2001, pos, Block.getStateId(getBlockType().getStateFromMeta(getBlockMetadata()))); + worldObj.setBlockToAir(pos); EntityAgeable entity = null; @@ -53,7 +54,7 @@ public class TileCocoon extends TileMod { if(Math.random() < villagerChance) { EntityVillager villager = new EntityVillager(worldObj); - VillagerRegistry.applyRandomTrade(villager, worldObj.rand); + VillagerRegistry.setRandomProfession(villager, worldObj.rand); entity = villager; } else { float specialChance = 0.05F; @@ -71,7 +72,7 @@ public class TileCocoon extends TileMod { break; } } else { - int entityType = worldObj.rand.nextInt(4); + int entityType = worldObj.rand.nextInt(5); switch(entityType) { case 0: entity = new EntitySheep(worldObj); @@ -87,12 +88,15 @@ public class TileCocoon extends TileMod { case 3: entity = new EntityChicken(worldObj); break; + case 4: + entity = new EntityRabbit(worldObj); + break; } } } if(entity != null) { - entity.setPosition(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5); + entity.setPosition(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5); entity.setGrowingAge(-24000); worldObj.spawnEntityInWorld(entity); entity.spawnExplosionParticle(); @@ -101,13 +105,13 @@ public class TileCocoon extends TileMod { } @Override - public void writeCustomNBT(NBTTagCompound cmp) { + public void writePacketNBT(NBTTagCompound cmp) { cmp.setInteger(TAG_TIME_PASSED, timePassed); cmp.setInteger(TAG_EMERALDS_GIVEN, emeraldsGiven); } @Override - public void readCustomNBT(NBTTagCompound cmp) { + public void readPacketNBT(NBTTagCompound cmp) { timePassed = cmp.getInteger(TAG_TIME_PASSED); emeraldsGiven = cmp.getInteger(TAG_EMERALDS_GIVEN); } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileCraftCrate.java b/src/main/java/vazkii/botania/common/block/tile/TileCraftCrate.java index 49def343f..7008c600b 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileCraftCrate.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileCraftCrate.java @@ -10,8 +10,6 @@ */ package vazkii.botania.common.block.tile; -import java.util.List; - import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.InventoryCrafting; @@ -20,10 +18,14 @@ import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.NetworkManager; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.network.play.server.SPacketUpdateTileEntity; +import net.minecraft.world.World; import vazkii.botania.api.internal.VanillaPacketDispatcher; import vazkii.botania.common.item.ModItems; +import javax.annotation.Nonnull; +import java.util.List; + public class TileCraftCrate extends TileOpenCrate { public static final boolean[][] PATTERNS = new boolean[][] { @@ -69,7 +71,7 @@ public class TileCraftCrate extends TileOpenCrate { private static final String TAG_PATTERN = "pattern"; public int pattern = -1; - int signal = 0; + private int signal = 0; @Override public int getSizeInventory() { @@ -77,13 +79,20 @@ public class TileCraftCrate extends TileOpenCrate { } @Override - public int getInventoryStackLimit() { - return 1; - } + protected SimpleItemStackHandler createItemHandler() { + return new SimpleItemStackHandler(this, true) { + @Override + protected int getStackLimit(int slot, ItemStack stack) { + return 1; + } - @Override - public boolean isItemValidForSlot(int i, ItemStack itemstack) { - return i != 9 && !isLocked(i); + @Override + public ItemStack insertItem(int slot, ItemStack stack, boolean simulate) { + if(slot != 9 && !isLocked(slot)) + return super.insertItem(slot, stack, simulate); + else return stack; + } + }; } public boolean isLocked(int slot) { @@ -91,33 +100,36 @@ public class TileCraftCrate extends TileOpenCrate { } @Override - public void updateEntity() { - if(!worldObj.isRemote && (craft(true) && canEject() || isFull())) + public void update() { + if (worldObj.isRemote) + return; + + if(craft(true) && canEject() || isFull()) ejectAll(); int newSignal = 0; for(; newSignal < 9; newSignal++) // dis for loop be derpy - if(!isLocked(newSignal) && getStackInSlot(newSignal) == null) + if(!isLocked(newSignal) && itemHandler.getStackInSlot(newSignal) == null) break; if(newSignal != signal) { signal = newSignal; - worldObj.func_147453_f(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord)); + worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock()); } } - boolean craft(boolean fullCheck) { + private boolean craft(boolean fullCheck) { if(fullCheck && !isFull()) return false; InventoryCrafting craft = new InventoryCrafting(new Container() { @Override - public boolean canInteractWith(EntityPlayer p_75145_1_) { + public boolean canInteractWith(@Nonnull EntityPlayer player) { return false; } }, 3, 3); for(int i = 0; i < 9; i++) { - ItemStack stack = getStackInSlot(i); + ItemStack stack = itemHandler.getStackInSlot(i); if(stack == null || isLocked(i) || stack.getItem() == ModItems.manaResource && stack.getItemDamage() == 11) continue; @@ -128,15 +140,15 @@ public class TileCraftCrate extends TileOpenCrate { List recipes = CraftingManager.getInstance().getRecipeList(); for(IRecipe recipe : recipes) if(recipe.matches(craft, worldObj)) { - setInventorySlotContents(9, recipe.getCraftingResult(craft)); + itemHandler.setStackInSlot(9, recipe.getCraftingResult(craft)); for(int i = 0; i < 9; i++) { - ItemStack stack = getStackInSlot(i); + ItemStack stack = itemHandler.getStackInSlot(i); if(stack == null) continue; ItemStack container = stack.getItem().getContainerItem(stack); - setInventorySlotContents(i, container); + itemHandler.setStackInSlot(i, container); } return true; } @@ -146,38 +158,40 @@ public class TileCraftCrate extends TileOpenCrate { boolean isFull() { for(int i = 0; i < 9; i++) - if(!isLocked(i) && getStackInSlot(i) == null) + if(!isLocked(i) && itemHandler.getStackInSlot(i) == null) return false; return true; } - void ejectAll() { + private void ejectAll() { for(int i = 0; i < getSizeInventory(); ++i) { - ItemStack stack = getStackInSlot(i); + ItemStack stack = itemHandler.getStackInSlot(i); if(stack != null) eject(stack, false); - setInventorySlotContents(i, null); - markDirty(); + itemHandler.setStackInSlot(i, null); } + markDirty(); } @Override - public void writeCustomNBT(NBTTagCompound par1nbtTagCompound) { - super.writeCustomNBT(par1nbtTagCompound); + public void writePacketNBT(NBTTagCompound par1nbtTagCompound) { + super.writePacketNBT(par1nbtTagCompound); par1nbtTagCompound.setInteger(TAG_PATTERN, pattern); } @Override - public void readCustomNBT(NBTTagCompound par1nbtTagCompound) { - super.readCustomNBT(par1nbtTagCompound); + public void readPacketNBT(NBTTagCompound par1nbtTagCompound) { + super.readPacketNBT(par1nbtTagCompound); pattern = par1nbtTagCompound.getInteger(TAG_PATTERN); } @Override - public boolean onWanded(EntityPlayer player, ItemStack stack) { - craft(false); - ejectAll(); + public boolean onWanded(World world, EntityPlayer player, ItemStack stack) { + if(!world.isRemote) { + craft(false); + ejectAll(); + } return true; } @@ -193,11 +207,11 @@ public class TileCraftCrate extends TileOpenCrate { } @Override - public void onDataPacket(NetworkManager manager, S35PacketUpdateTileEntity packet) { + public void onDataPacket(NetworkManager manager, SPacketUpdateTileEntity packet) { int lastPattern = pattern; super.onDataPacket(manager, packet); if(pattern != lastPattern) - worldObj.markBlockRangeForRenderUpdate(xCoord,yCoord,zCoord,xCoord,yCoord,zCoord); + worldObj.markBlockRangeForRenderUpdate(pos, pos); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileEnchanter.java b/src/main/java/vazkii/botania/common/block/tile/TileEnchanter.java index e615e2267..75f9351c2 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileEnchanter.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileEnchanter.java @@ -2,20 +2,21 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + * * Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php - * + * * File Created @ [Mar 15, 2014, 4:57:52 PM (GMT)] */ package vazkii.botania.common.block.tile; -import java.util.ArrayList; -import java.util.List; - +import com.google.common.base.Predicates; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentData; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; @@ -26,8 +27,10 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.internal.VanillaPacketDispatcher; @@ -38,9 +41,21 @@ import vazkii.botania.api.mana.IManaPool; import vazkii.botania.api.mana.spark.ISparkAttachable; import vazkii.botania.api.mana.spark.ISparkEntity; import vazkii.botania.api.mana.spark.SparkHelper; +import vazkii.botania.api.sound.BotaniaSoundEvents; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.client.core.helper.RenderHelper; import vazkii.botania.common.Botania; import vazkii.botania.common.block.ModBlocks; +import vazkii.botania.common.network.PacketBotaniaEffect; +import vazkii.botania.common.network.PacketHandler; + +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.EnumMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; public class TileEnchanter extends TileMod implements ISparkAttachable { @@ -52,68 +67,70 @@ public class TileEnchanter extends TileMod implements ISparkAttachable { private static final String TAG_ITEM = "item"; private static final String TAG_ENCHANTS = "enchantsToApply"; - public int stage = 0; + public State stage = State.IDLE; public int stageTicks = 0; public int stage3EndTicks = 0; - int manaRequired = -1; - int mana = 0; + private int manaRequired = -1; + private int mana = 0; public ItemStack itemToEnchant = null; - List enchants = new ArrayList(); + private final List enchants = new ArrayList<>(); - private static final int[][] OBSIDIAN_LOCATIONS = new int[][] { - { 0, -1, 0 }, - { 0, -1, 1 }, { 0, -1, -1 }, { 1, -1, 0 }, { -1, -1, 0 }, - { 0, -1, 2 }, { -1, -1, 2 }, { 1, -1, 2 }, - { 0, -1, -2 }, { -1, -1, -2 }, { 1, -1, -2 }, - { 2, -1, 0 }, { 2, -1, 1 }, { 2, -1, -1 }, - { -2, -1, 0 }, { -2, -1, 1 }, { -2, -1, -1 } + private static final BlockPos[] OBSIDIAN_LOCATIONS = { + new BlockPos(0, -1, 0), + new BlockPos(0, -1, 1), new BlockPos(0, -1, -1), new BlockPos(1, -1, 0), new BlockPos(-1, -1, 0), + new BlockPos(0, -1, 2), new BlockPos(-1, -1, 2), new BlockPos(1, -1, 2), + new BlockPos(0, -1, -2), new BlockPos(-1, -1, -2), new BlockPos(1, -1, -2), + new BlockPos(2, -1, 0), new BlockPos(2, -1, 1), new BlockPos(2, -1, -1 ), + new BlockPos(-2, -1, 0), new BlockPos(-2, -1, 1), new BlockPos(-2, -1, -1) }; - private static final int[][][] PYLON_LOCATIONS = new int[][][] { - { { -5, 1, 0 }, { 5, 1, 0 }, { -4, 1, 3 }, { 4, 1, 3 }, { -4, 1, -3 }, { 4, 1, -3 } }, - { { 0, 1, -5 }, { 0, 1, 5 }, { 3, 1, -4 }, { 3, 1, 4 }, { -3, 1, -4 }, { -3, 1, 4 } } - }; + private static final Map PYLON_LOCATIONS = new EnumMap<>(EnumFacing.Axis.class); - private static final int[][] FLOWER_LOCATIONS = new int[][] { - { -1, 0, -1 }, { 1, 0, -1 }, { -1, 0, 1 }, { 1, 0, 1 } + static { + PYLON_LOCATIONS.put(EnumFacing.Axis.X, new BlockPos[] { new BlockPos(-5, 1, 0), new BlockPos(5, 1, 0), new BlockPos(-4, 1, 3), new BlockPos(4, 1, 3), new BlockPos(-4, 1, -3 ), new BlockPos(4, 1, -3) }); + PYLON_LOCATIONS.put(EnumFacing.Axis.Z, new BlockPos[] { new BlockPos(0, 1, -5), new BlockPos(0, 1, 5), new BlockPos(3, 1, -4), new BlockPos(3, 1, 4), new BlockPos(-3, 1, -4 ), new BlockPos(-3, 1, 4) }); + } + + private static final BlockPos[] FLOWER_LOCATIONS = { + new BlockPos(-1, 0, -1), new BlockPos(1, 0, -1), new BlockPos(-1, 0, 1), new BlockPos(1, 0, 1) }; public static MultiblockSet makeMultiblockSet() { Multiblock mb = new Multiblock(); - for(int[] o : OBSIDIAN_LOCATIONS) - mb.addComponent(o[0], o[1] + 1, o[2], Blocks.obsidian, 0); - for(int[] p : PYLON_LOCATIONS[0]) { - mb.addComponent(p[0], p[1] + 1, p[2], ModBlocks.pylon, 0); - mb.addComponent(new FlowerComponent(new ChunkCoordinates(p[0], p[1], p[2]), ModBlocks.flower)); + for(BlockPos o : OBSIDIAN_LOCATIONS) + mb.addComponent(o.up(), Blocks.OBSIDIAN.getDefaultState()); + for(BlockPos p : PYLON_LOCATIONS.get(EnumFacing.Axis.X)) { + mb.addComponent(p.up(), ModBlocks.pylon.getDefaultState()); + mb.addComponent(new FlowerComponent(p, ModBlocks.flower)); } - for(int[] f : FLOWER_LOCATIONS) - mb.addComponent(new FlowerComponent(new ChunkCoordinates(f[0], f[1] + 1, f[2]), ModBlocks.flower)); + for(BlockPos f : FLOWER_LOCATIONS) + mb.addComponent(new FlowerComponent(f.up(), ModBlocks.flower)); - mb.addComponent(0, 1, 0, Blocks.lapis_block, 0); + mb.addComponent(BlockPos.ORIGIN.up(), Blocks.LAPIS_BLOCK.getDefaultState()); return mb.makeSet(); } public void onWanded(EntityPlayer player, ItemStack wand) { - if(stage != 0 || itemToEnchant == null || !itemToEnchant.isItemEnchantable()) + if(stage != State.IDLE || itemToEnchant == null || !itemToEnchant.isItemEnchantable()) return; - List items = worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(xCoord - 2, yCoord, zCoord - 2, xCoord + 3, yCoord + 1, zCoord + 3)); + List items = worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos.getX() - 2, pos.getY(), pos.getZ() - 2, pos.getX() + 3, pos.getY() + 1, pos.getZ() + 3)); int count = items.size(); if(count > 0 && !worldObj.isRemote) { for(EntityItem entity : items) { ItemStack item = entity.getEntityItem(); - if(item.getItem() == Items.enchanted_book) { - NBTTagList enchants = Items.enchanted_book.func_92110_g(item); + if(item.getItem() == Items.ENCHANTED_BOOK) { + NBTTagList enchants = Items.ENCHANTED_BOOK.getEnchantments(item); if(enchants != null && enchants.tagCount() > 0) { NBTTagCompound enchant = enchants.getCompoundTagAt(0); short id = enchant.getShort("id"); - if(isEnchantmentValid(id)) { + if(isEnchantmentValid(Enchantment.getEnchantmentByID(id))) { advanceStage(); return; } @@ -124,151 +141,155 @@ public class TileEnchanter extends TileMod implements ISparkAttachable { } @Override - public void updateEntity() { - if(getBlockMetadata() < PYLON_LOCATIONS.length) - for(int[] pylon : PYLON_LOCATIONS[getBlockMetadata()]) { - TileEntity tile = worldObj.getTileEntity(xCoord + pylon[0], yCoord + pylon[1], zCoord + pylon[2]); - if(tile != null && tile instanceof TilePylon) - ((TilePylon) tile).activated = false; - } + public void update() { + IBlockState state = worldObj.getBlockState(getPos()); + EnumFacing.Axis axis = state.getValue(BotaniaStateProps.ENCHANTER_DIRECTION); - if(!canEnchanterExist(worldObj, xCoord, yCoord, zCoord, getBlockMetadata())) { + for(BlockPos pylon : PYLON_LOCATIONS.get(axis)) { + TileEntity tile = worldObj.getTileEntity(pos.add(pylon)); + if(tile != null && tile instanceof TilePylon) { + ((TilePylon) tile).activated = stage == State.GATHER_MANA; + if(stage == State.GATHER_MANA) + ((TilePylon) tile).centerPos = pos; + } + } - worldObj.setBlock(xCoord, yCoord, zCoord, Blocks.lapis_block, 0, 1 | 2); - for(int i = 0; i < 50; i++) { - float red = (float) Math.random(); - float green = (float) Math.random(); - float blue = (float) Math.random(); - Botania.proxy.wispFX(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, red, green, blue, (float) Math.random() * 0.15F + 0.15F, (float) (Math.random() - 0.5F) * 0.25F, (float) (Math.random() - 0.5F) * 0.25F, (float) (Math.random() - 0.5F) * 0.25F); - } - worldObj.playSoundEffect(xCoord, yCoord, zCoord, "botania:enchanterBlock", 0.5F, 10F); + if(stage != State.IDLE) + stageTicks++; + + if(worldObj.isRemote) + return; + + if(!canEnchanterExist(worldObj, pos, axis)) { + worldObj.setBlockState(pos, Blocks.LAPIS_BLOCK.getDefaultState(), 1 | 2); + PacketHandler.sendToNearby(worldObj, pos, new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.ENCHANTER_DESTROY, + pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5)); + worldObj.playSound(null, pos, BotaniaSoundEvents.enchanterFade, SoundCategory.BLOCKS, 0.5F, 10F); } switch(stage) { - case 1 : { // Get books - if(stageTicks % 20 == 0) { - List items = worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(xCoord - 2, yCoord, zCoord - 2, xCoord + 3, yCoord + 1, zCoord + 3)); - int count = items.size(); - boolean addedEnch = false; + case GATHER_ENCHANTS : { // Get books + if(stageTicks % 20 == 0) { + List items = worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos.getX() - 2, pos.getY(), pos.getZ() - 2, pos.getX() + 3, pos.getY() + 1, pos.getZ() + 3)); + int count = items.size(); + boolean addedEnch = false; - if(count > 0 && !worldObj.isRemote) { - for(EntityItem entity : items) { - ItemStack item = entity.getEntityItem(); - if(item.getItem() == Items.enchanted_book) { - NBTTagList enchants = Items.enchanted_book.func_92110_g(item); - if(enchants != null && enchants.tagCount() > 0) { - NBTTagCompound enchant = enchants.getCompoundTagAt(0); - short enchantId = enchant.getShort("id"); - short enchantLvl = enchant.getShort("lvl"); - if(!hasEnchantAlready(enchantId) && isEnchantmentValid(enchantId)) { - this.enchants.add(new EnchantmentData(enchantId, enchantLvl)); - worldObj.playSoundEffect(xCoord, yCoord, zCoord, "botania:ding", 1F, 1F); - addedEnch = true; - break; - } - } - } - } - } + if(count > 0 && !worldObj.isRemote) { + for(EntityItem entity : items) { + ItemStack item = entity.getEntityItem(); + if(item.getItem() == Items.ENCHANTED_BOOK) { + NBTTagList enchants = Items.ENCHANTED_BOOK.getEnchantments(item); + if(enchants != null && enchants.tagCount() > 0) { + NBTTagCompound enchant = enchants.getCompoundTagAt(0); + short enchantId = enchant.getShort("id"); + short enchantLvl = enchant.getShort("lvl"); + Enchantment ench = Enchantment.getEnchantmentByID(enchantId); + if(!hasEnchantAlready(ench) && isEnchantmentValid(ench)) { + this.enchants.add(new EnchantmentData(ench, enchantLvl)); + worldObj.playSound(null, pos, BotaniaSoundEvents.ding, SoundCategory.BLOCKS, 1F, 1F); + addedEnch = true; + break; + } + } + } + } + } - if(!addedEnch) { - if(enchants.isEmpty()) - stage = 0; - else advanceStage(); - } + if(!addedEnch) { + if(enchants.isEmpty()) + stage = State.IDLE; + else advanceStage(); + } + } + break; + } + case GATHER_MANA : { // Get Mana + if(manaRequired == -1) { + manaRequired = 0; + for(EnchantmentData data : enchants) { + manaRequired += (int) + (5000F * ((15 - Math.min(15, data.enchantmentobj.getRarity().getWeight())) + * 1.05F) + * ((3F + data.enchantmentLevel * data.enchantmentLevel) * 0.25F) + * (0.9F + enchants.size() * 0.05F) + * (data.enchantmentobj.isTreasureEnchantment() ? 1.25F : 1F)); + } + } else if(mana >= manaRequired) { + manaRequired = 0; + for(BlockPos pylon : PYLON_LOCATIONS.get(axis)) + ((TilePylon) worldObj.getTileEntity(pos.add(pylon))).activated = false; + + advanceStage(); + } else { + ISparkEntity spark = getAttachedSpark(); + if(spark != null) { + List sparkEntities = SparkHelper.getSparksAround(worldObj, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5); + for(ISparkEntity otherSpark : sparkEntities) { + if(spark == otherSpark) + continue; + + if(otherSpark.getAttachedTile() != null && otherSpark.getAttachedTile() instanceof IManaPool) + otherSpark.registerTransfer(spark); + } + } + if(stageTicks % 5 == 0) + sync(); + } + + break; + } + case DO_ENCHANT : { // Enchant + if(stageTicks >= 100) { + for(EnchantmentData data : enchants) + if(EnchantmentHelper.getEnchantmentLevel(data.enchantmentobj, itemToEnchant) == 0) + itemToEnchant.addEnchantment(data.enchantmentobj, data.enchantmentLevel); + + enchants.clear(); + manaRequired = -1; + mana = 0; + + craftingFanciness(); + advanceStage(); + } + break; + } + case RESET: { // Reset + if(stageTicks >= 20) + advanceStage(); + + break; } - break; } - case 2 : { // Get Mana - for(int[] pylon : PYLON_LOCATIONS[getBlockMetadata()]) { - TilePylon pylonTile = (TilePylon) worldObj.getTileEntity(xCoord + pylon[0], yCoord + pylon[1], zCoord + pylon[2]); - if(pylonTile != null) { - pylonTile.activated = true; - pylonTile.centerX = xCoord; - pylonTile.centerY = yCoord; - pylonTile.centerZ = zCoord; - } - } - - if(manaRequired == -1) { - manaRequired = 0; - for(EnchantmentData data : enchants) { - Enchantment ench = Enchantment.enchantmentsList[data.enchant]; - manaRequired += (int) (5000F * ((15 - Math.min(15, ench.getWeight())) * 1.05F) * ((3F + data.level * data.level) * 0.25F) * (0.9F + enchants.size() * 0.05F)); - } - } else if(mana >= manaRequired) { - manaRequired = 0; - for(int[] pylon : PYLON_LOCATIONS[getBlockMetadata()]) - ((TilePylon) worldObj.getTileEntity(xCoord + pylon[0], yCoord + pylon[1], zCoord + pylon[2])).activated = false; - - advanceStage(); - } else { - ISparkEntity spark = getAttachedSpark(); - if(spark != null) { - List sparkEntities = SparkHelper.getSparksAround(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5); - for(ISparkEntity otherSpark : sparkEntities) { - if(spark == otherSpark) - continue; - - if(otherSpark.getAttachedTile() != null && otherSpark.getAttachedTile() instanceof IManaPool) - otherSpark.registerTransfer(spark); - } - } - } - - break; - } - case 3 : { // Enchant - if(stageTicks >= 100) { - for(EnchantmentData data : enchants) - if(EnchantmentHelper.getEnchantmentLevel(data.enchant, itemToEnchant) == 0) - itemToEnchant.addEnchantment(Enchantment.enchantmentsList[data.enchant], data.level); - - enchants.clear(); - manaRequired = -1; - mana = 0; - - craftingFanciness(); - advanceStage(); - } - break; - } - case 4 : { // Reset - if(stageTicks >= 20) - advanceStage(); - - break; - } - } - - if(stage != 0) - stageTicks++; } - public void advanceStage() { - stage++; - - if(stage == 4) - stage3EndTicks = stageTicks; - else if(stage == 5) { - stage = 0; - stage3EndTicks = 0; + private void advanceStage() { + switch(stage) { + case IDLE: stage = State.GATHER_ENCHANTS; break; + case GATHER_ENCHANTS: stage = State.GATHER_MANA; break; + case GATHER_MANA: stage = State.DO_ENCHANT; break; + case DO_ENCHANT: { + stage = State.RESET; + stage3EndTicks = stageTicks; + break; + } + case RESET: { + stage = State.IDLE; + stage3EndTicks = 0; + break; + } } stageTicks = 0; sync(); } - public void craftingFanciness() { - worldObj.playSoundEffect(xCoord, yCoord, zCoord, "botania:enchanterEnchant", 1F, 1F); - for(int i = 0; i < 25; i++) { - float red = (float) Math.random(); - float green = (float) Math.random(); - float blue = (float) Math.random(); - Botania.proxy.sparkleFX(worldObj, xCoord + 0.5 + Math.random() * 0.4 - 0.2, yCoord + 1, zCoord + 0.5 + Math.random() * 0.4 - 0.2, red, green, blue, (float) Math.random(), 10); - } + private void craftingFanciness() { + worldObj.playSound(null, pos, BotaniaSoundEvents.enchanterEnchant, SoundCategory.BLOCKS, 1F, 1F); + PacketHandler.sendToNearby(worldObj, pos, + new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.ENCHANTER_CRAFT, pos.getX() + 0.5, pos.getY() + 1, pos.getZ() + 0.5)); } + @Nonnull @Override public AxisAlignedBB getRenderBoundingBox() { return INFINITE_EXTENT_AABB; @@ -295,14 +316,14 @@ public class TileEnchanter extends TileMod implements ISparkAttachable { } public void sync() { - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, xCoord, yCoord, zCoord); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos); } @Override - public void writeCustomNBT(NBTTagCompound cmp) { + public void writePacketNBT(NBTTagCompound cmp) { cmp.setInteger(TAG_MANA, mana); cmp.setInteger(TAG_MANA_REQUIRED, manaRequired); - cmp.setInteger(TAG_STAGE, stage); + cmp.setInteger(TAG_STAGE, stage.ordinal()); cmp.setInteger(TAG_STAGE_TICKS, stageTicks); cmp.setInteger(TAG_STAGE_3_END_TICKS, stage3EndTicks); @@ -311,17 +332,17 @@ public class TileEnchanter extends TileMod implements ISparkAttachable { itemToEnchant.writeToNBT(itemCmp); cmp.setTag(TAG_ITEM, itemCmp); - String enchStr = ""; - for(EnchantmentData data : enchants) - enchStr = enchStr + data.enchant + ":" + data.level + ","; - cmp.setString(TAG_ENCHANTS, enchStr.isEmpty() ? enchStr : enchStr.substring(0, enchStr.length() - 1)); + String enchStr = enchants.stream() + .map(e -> Enchantment.REGISTRY.getNameForObject(e.enchantmentobj) + "=" + e.enchantmentLevel) + .collect(Collectors.joining(",")); + cmp.setString(TAG_ENCHANTS, enchStr); } @Override - public void readCustomNBT(NBTTagCompound cmp) { + public void readPacketNBT(NBTTagCompound cmp) { mana = cmp.getInteger(TAG_MANA); manaRequired = cmp.getInteger(TAG_MANA_REQUIRED); - stage = cmp.getInteger(TAG_STAGE); + stage = State.values()[cmp.getInteger(TAG_STAGE)]; stageTicks = cmp.getInteger(TAG_STAGE_TICKS); stage3EndTicks = cmp.getInteger(TAG_STAGE_3_END_TICKS); @@ -333,29 +354,28 @@ public class TileEnchanter extends TileMod implements ISparkAttachable { if(!enchStr.isEmpty()) { String[] enchTokens = enchStr.split(","); for(String token : enchTokens) { - String[] entryTokens = token.split(":"); - int id = Integer.parseInt(entryTokens[0]); + String[] entryTokens = token.split("="); + Enchantment ench = Enchantment.getEnchantmentByLocation(entryTokens[0]); int lvl = Integer.parseInt(entryTokens[1]); - enchants.add(new EnchantmentData(id, lvl)); + enchants.add(new EnchantmentData(ench, lvl)); } } } - private boolean hasEnchantAlready(int enchant) { + private boolean hasEnchantAlready(Enchantment enchant) { for(EnchantmentData data : enchants) - if(data.enchant == enchant) + if(data.enchantmentobj == enchant) return true; return false; } - public boolean isEnchantmentValid(short id) { - Enchantment ench = Enchantment.enchantmentsList[id]; - if(!ench.canApply(itemToEnchant) || !ench.type.canEnchantItem(itemToEnchant.getItem())) + private boolean isEnchantmentValid(Enchantment ench) { + if(!ench.canApply(itemToEnchant)) return false; for(EnchantmentData data : enchants) { - Enchantment otherEnch = Enchantment.enchantmentsList[data.enchant]; + Enchantment otherEnch = data.enchantmentobj; if(!otherEnch.canApplyTogether(ench) || !ench.canApplyTogether(otherEnch)) return false; } @@ -363,17 +383,17 @@ public class TileEnchanter extends TileMod implements ISparkAttachable { return true; } - public static boolean canEnchanterExist(World world, int x, int y, int z, int meta) { - for(int[] obsidian : OBSIDIAN_LOCATIONS) - if(world.getBlock(obsidian[0] + x, obsidian[1] + y, obsidian[2] + z) != Blocks.obsidian) + public static boolean canEnchanterExist(World world, BlockPos pos, EnumFacing.Axis axis) { + for(BlockPos obsidian : OBSIDIAN_LOCATIONS) + if(world.getBlockState(pos.add(obsidian)).getBlock() != Blocks.OBSIDIAN) return false; - for(int[] pylon : PYLON_LOCATIONS[meta]) - if(world.getBlock(pylon[0] + x, pylon[1] + y, pylon[2] + z) != ModBlocks.pylon || !BotaniaAPI.internalHandler.isBotaniaFlower(world, pylon[0] + x, pylon[1] + y - 1, pylon[2] + z)) + for(BlockPos pylon : PYLON_LOCATIONS.get(axis)) + if(world.getBlockState(pos.add(pylon)).getBlock() != ModBlocks.pylon || !BotaniaAPI.internalHandler.isBotaniaFlower(world, pos.add(pylon).down())) return false; - for(int[] flower : FLOWER_LOCATIONS) - if(!BotaniaAPI.internalHandler.isBotaniaFlower(world, flower[0] + x, flower[1] + y, flower[2] + z)) + for(BlockPos flower : FLOWER_LOCATIONS) + if(!BotaniaAPI.internalHandler.isBotaniaFlower(world, pos.add(flower))) return false; return true; @@ -385,15 +405,13 @@ public class TileEnchanter extends TileMod implements ISparkAttachable { } @Override - public void attachSpark(ISparkEntity entity) { - // NO-OP - } + public void attachSpark(ISparkEntity entity) {} @Override public ISparkEntity getAttachedSpark() { - List sparks = worldObj.getEntitiesWithinAABB(ISparkEntity.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord + 1, zCoord, xCoord + 1, yCoord + 2, zCoord + 1)); + List sparks = worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(pos.getX(), pos.getY() + 1, pos.getZ(), pos.getX() + 1, pos.getY() + 2, pos.getZ() + 1), Predicates.instanceOf(ISparkEntity.class)); if(sparks.size() == 1) { - Entity e = (Entity) sparks.get(0); + Entity e = sparks.get(0); return (ISparkEntity) e; } @@ -402,7 +420,7 @@ public class TileEnchanter extends TileMod implements ISparkAttachable { @Override public boolean areIncomingTranfersDone() { - return stage == 3; + return stage == State.DO_ENCHANT; } @Override @@ -410,7 +428,7 @@ public class TileEnchanter extends TileMod implements ISparkAttachable { return Math.max(0, manaRequired - getCurrentMana()); } - public void renderHUD(Minecraft mc, ScaledResolution res) { + public void renderHUD(ScaledResolution res) { if(manaRequired > 0 && itemToEnchant != null) { int x = res.getScaledWidth() / 2 + 20; int y = res.getScaledHeight() / 2 - 8; @@ -419,14 +437,12 @@ public class TileEnchanter extends TileMod implements ISparkAttachable { } } - private static class EnchantmentData { - - public int enchant, level; - - public EnchantmentData(int enchant, int level) { - this.enchant = enchant; - this.level = level; - } + public enum State { + IDLE, + GATHER_ENCHANTS, + GATHER_MANA, + DO_ENCHANT, + RESET } } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileEnderEye.java b/src/main/java/vazkii/botania/common/block/tile/TileEnderEye.java index 99be1db8b..fbc3c557c 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileEnderEye.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileEnderEye.java @@ -10,47 +10,53 @@ */ package vazkii.botania.common.block.tile; -import java.util.List; - import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.world.WorldServer; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.common.item.equipment.tool.ToolCommons; +import java.util.List; + public class TileEnderEye extends TileMod { @Override - public void updateEntity() { - int meta = getBlockMetadata(); + public void update() { + if (worldObj.isRemote) + return; + + boolean wasLooking = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED); int range = 80; - List players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(xCoord - range, yCoord - range, zCoord - range, xCoord + range, yCoord + range, zCoord + range)); + List players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(pos.add(-range, -range, -range), pos.add(range, range, range))); boolean looking = false; for(EntityPlayer player : players) { - ItemStack helm = player.getCurrentArmor(3); - if(helm != null && helm.getItem() == Item.getItemFromBlock(Blocks.pumpkin)) + ItemStack helm = player.getItemStackFromSlot(EntityEquipmentSlot.HEAD); + if(helm != null && helm.getItem() == Item.getItemFromBlock(Blocks.PUMPKIN)) continue; - MovingObjectPosition pos = ToolCommons.raytraceFromEntity(worldObj, player, true, 64); - if(pos != null && pos.blockX == xCoord && pos.blockY == yCoord && pos.blockZ == zCoord) { + RayTraceResult pos = ToolCommons.raytraceFromEntity(worldObj, player, true, 64); + if(pos != null && pos.getBlockPos() != null && pos.getBlockPos().equals(getPos())) { looking = true; break; } } - int newMeta = looking ? 15 : 0; - if(newMeta != meta && !worldObj.isRemote) - worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, newMeta, 1 | 2); + if(looking != wasLooking && !worldObj.isRemote) + worldObj.setBlockState(getPos(), worldObj.getBlockState(getPos()).withProperty(BotaniaStateProps.POWERED, looking), 1 | 2); if(looking) { - double x = xCoord - 0.1 + Math.random() * 1.2; - double y = yCoord - 0.1 + Math.random() * 1.2; - double z = zCoord - 0.1 + Math.random() * 1.2; - - worldObj.spawnParticle("reddust", x, y, z, 1, 0, 0); + double x = getPos().getX() - 0.1 + Math.random() * 1.2; + double y = getPos().getY() - 0.1 + Math.random() * 1.2; + double z = getPos().getZ() - 0.1 + Math.random() * 1.2; + + ((WorldServer) worldObj).spawnParticle(EnumParticleTypes.REDSTONE, false, x, y, z, 0, 1.0D, 0.0D, 0.0D, 1.0D); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileFakeAir.java b/src/main/java/vazkii/botania/common/block/tile/TileFakeAir.java index cc82c9619..25700314b 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileFakeAir.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileFakeAir.java @@ -12,45 +12,45 @@ package vazkii.botania.common.block.tile; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.BlockPos; import vazkii.botania.common.block.subtile.functional.SubTileBubbell; +import javax.annotation.Nonnull; + public class TileFakeAir extends TileMod { private static final String TAG_FLOWER_X = "flowerX"; private static final String TAG_FLOWER_Y = "flowerY"; private static final String TAG_FLOWER_Z = "flowerZ"; - int flowerX, flowerY, flowerZ; - - @Override - public boolean canUpdate() { - return false; - } + private BlockPos flowerPos = BlockPos.ORIGIN; public void setFlower(TileEntity tile) { - flowerX = tile.xCoord; - flowerY = tile.yCoord; - flowerZ = tile.zCoord; + flowerPos = tile.getPos(); } public boolean canStay() { - return SubTileBubbell.isValidBubbell(worldObj, flowerX, flowerY, flowerZ); + return SubTileBubbell.isValidBubbell(worldObj, flowerPos); } + @Nonnull @Override - public void writeToNBT(NBTTagCompound par1nbtTagCompound) { - super.writeToNBT(par1nbtTagCompound); - par1nbtTagCompound.setInteger(TAG_FLOWER_X, flowerX); - par1nbtTagCompound.setInteger(TAG_FLOWER_Y, flowerY); - par1nbtTagCompound.setInteger(TAG_FLOWER_Z, flowerZ); + public NBTTagCompound writeToNBT(NBTTagCompound par1nbtTagCompound) { + NBTTagCompound ret = super.writeToNBT(par1nbtTagCompound); + ret.setInteger(TAG_FLOWER_X, flowerPos.getX()); + ret.setInteger(TAG_FLOWER_Y, flowerPos.getY()); + ret.setInteger(TAG_FLOWER_Z, flowerPos.getZ()); + return ret; } @Override public void readFromNBT(NBTTagCompound par1nbtTagCompound) { super.readFromNBT(par1nbtTagCompound); - flowerX = par1nbtTagCompound.getInteger(TAG_FLOWER_X); - flowerY = par1nbtTagCompound.getInteger(TAG_FLOWER_Y); - flowerZ = par1nbtTagCompound.getInteger(TAG_FLOWER_Z); + flowerPos = new BlockPos( + par1nbtTagCompound.getInteger(TAG_FLOWER_X), + par1nbtTagCompound.getInteger(TAG_FLOWER_Y), + par1nbtTagCompound.getInteger(TAG_FLOWER_Z) + ); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileFloatingFlower.java b/src/main/java/vazkii/botania/common/block/tile/TileFloatingFlower.java index 03f4c4b69..fa8aa6382 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileFloatingFlower.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileFloatingFlower.java @@ -10,10 +10,12 @@ */ package vazkii.botania.common.block.tile; +import net.minecraft.item.EnumDyeColor; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import vazkii.botania.api.item.IFloatingFlower; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.common.block.ModBlocks; -import vazkii.botania.common.block.decor.IFloatingFlower; public class TileFloatingFlower extends TileMod implements IFloatingFlower { @@ -28,13 +30,9 @@ public class TileFloatingFlower extends TileMod implements IFloatingFlower { forcedStack = null; return retStack; } - - return new ItemStack(ModBlocks.shinyFlower, 1, getBlockMetadata()); - } - - @Override - public boolean canUpdate() { - return false; + EnumDyeColor color = worldObj.getBlockState(getPos()).getBlock() != ModBlocks.floatingFlower ? EnumDyeColor.WHITE + : worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.COLOR); + return new ItemStack(ModBlocks.shinyFlower, 1, color.getMetadata()); } @Override @@ -48,12 +46,12 @@ public class TileFloatingFlower extends TileMod implements IFloatingFlower { } @Override - public void writeCustomNBT(NBTTagCompound cmp) { + public void writePacketNBT(NBTTagCompound cmp) { cmp.setString(TAG_ISLAND_TYPE, type.toString()); } @Override - public void readCustomNBT(NBTTagCompound cmp) { + public void readPacketNBT(NBTTagCompound cmp) { type = IslandType.ofType(cmp.getString(TAG_ISLAND_TYPE)); } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileFloatingSpecialFlower.java b/src/main/java/vazkii/botania/common/block/tile/TileFloatingSpecialFlower.java index 9e6fce168..b8cb635bf 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileFloatingSpecialFlower.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileFloatingSpecialFlower.java @@ -12,7 +12,7 @@ package vazkii.botania.common.block.tile; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import vazkii.botania.common.block.decor.IFloatingFlower; +import vazkii.botania.api.item.IFloatingFlower; import vazkii.botania.common.item.block.ItemBlockSpecialFlower; public class TileFloatingSpecialFlower extends TileSpecialFlower implements IFloatingFlower { @@ -41,14 +41,14 @@ public class TileFloatingSpecialFlower extends TileSpecialFlower implements IFlo } @Override - public void writeCustomNBT(NBTTagCompound cmp) { - super.writeCustomNBT(cmp); + public void writePacketNBT(NBTTagCompound cmp) { + super.writePacketNBT(cmp); cmp.setString(TAG_ISLAND_TYPE, type.toString()); } @Override - public void readCustomNBT(NBTTagCompound cmp) { - super.readCustomNBT(cmp); + public void readPacketNBT(NBTTagCompound cmp) { + super.readPacketNBT(cmp); type = IslandType.ofType(cmp.getString(TAG_ISLAND_TYPE)); } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileForestEye.java b/src/main/java/vazkii/botania/common/block/tile/TileForestEye.java index 9f0e63c8f..2927a6179 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileForestEye.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileForestEye.java @@ -11,19 +11,21 @@ package vazkii.botania.common.block.tile; import net.minecraft.entity.passive.EntityAnimal; -import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.math.AxisAlignedBB; public class TileForestEye extends TileMod { public int entities = 0; @Override - public void updateEntity() { + public void update() { + if (worldObj.isRemote) + return; int range = 6; - int entityCount = worldObj.getEntitiesWithinAABB(EntityAnimal.class, AxisAlignedBB.getBoundingBox(xCoord - range, yCoord - range, zCoord - range, xCoord + range + 1, yCoord + range + 1, zCoord + range + 1)).size(); + int entityCount = worldObj.getEntitiesWithinAABB(EntityAnimal.class, new AxisAlignedBB(pos.add(-range, -range, -range), pos.add(range + 1, range + 1, range + 1))).size(); if(entityCount != entities) { entities = entityCount; - worldObj.func_147453_f(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord)); + worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock()); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileGaiaHead.java b/src/main/java/vazkii/botania/common/block/tile/TileGaiaHead.java index 6d705d90a..3759f8574 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileGaiaHead.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileGaiaHead.java @@ -13,5 +13,7 @@ package vazkii.botania.common.block.tile; import net.minecraft.tileentity.TileEntitySkull; public class TileGaiaHead extends TileEntitySkull { - + public TileGaiaHead() { + setType(3); + } } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileHourglass.java b/src/main/java/vazkii/botania/common/block/tile/TileHourglass.java index f18207621..092716fc9 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileHourglass.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileHourglass.java @@ -12,20 +12,18 @@ package vazkii.botania.common.block.tile; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.resources.I18n; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.StatCollector; import net.minecraft.util.StringUtils; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.internal.VanillaPacketDispatcher; -import vazkii.botania.common.lib.LibBlockNames; +import vazkii.botania.api.state.BotaniaStateProps; public class TileHourglass extends TileSimpleInventory { @@ -36,7 +34,7 @@ public class TileHourglass extends TileSimpleInventory { private static final String TAG_LOCK = "lock"; private static final String TAG_MOVE = "move"; - int time = 0; + private int time = 0; public float timeFraction = 0F; public boolean flip = false; public int flipTicks = 0; @@ -44,9 +42,7 @@ public class TileHourglass extends TileSimpleInventory { public boolean move = true; @Override - public void updateEntity() { - super.updateEntity(); - + public void update() { int totalTime = getTotalTime(); if(totalTime > 0) { if(move) @@ -55,8 +51,11 @@ public class TileHourglass extends TileSimpleInventory { time = 0; flip = !flip; flipTicks = 4; - worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 1, 1 | 2); - worldObj.scheduleBlockUpdate(xCoord, yCoord, zCoord, getBlockType(), getBlockType().tickRate(worldObj)); + if (!worldObj.isRemote) { + worldObj.setBlockState(getPos(), worldObj.getBlockState(getPos()).withProperty(BotaniaStateProps.POWERED, true), 1 | 2); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(this); + worldObj.scheduleUpdate(pos, getBlockType(), getBlockType().tickRate(worldObj)); + } } timeFraction = (float) time / (float) totalTime; } else { @@ -69,7 +68,7 @@ public class TileHourglass extends TileSimpleInventory { } public int getTotalTime() { - ItemStack stack = getStackInSlot(0); + ItemStack stack = itemHandler.getStackInSlot(0); if(stack == null) return 0; @@ -79,35 +78,39 @@ public class TileHourglass extends TileSimpleInventory { public static int getStackItemTime(ItemStack stack) { if(stack == null) return 0; - if(stack.getItem() == Item.getItemFromBlock(Blocks.sand)) + if(stack.getItem() == Item.getItemFromBlock(Blocks.SAND)) return stack.getItemDamage() == 1 ? 200 : 20; - if(stack.getItem() == Item.getItemFromBlock(Blocks.soul_sand)) + if(stack.getItem() == Item.getItemFromBlock(Blocks.SOUL_SAND)) return 1200; return 0; } public int getColor() { - ItemStack stack = getStackInSlot(0); + ItemStack stack = itemHandler.getStackInSlot(0); if(stack == null) return 0; - if(stack.getItem() == Item.getItemFromBlock(Blocks.sand)) + if(stack.getItem() == Item.getItemFromBlock(Blocks.SAND)) return stack.getItemDamage() == 1 ? 0xE95800 : 0xFFEC49; - if(stack.getItem() == Item.getItemFromBlock(Blocks.soul_sand)) + if(stack.getItem() == Item.getItemFromBlock(Blocks.SOUL_SAND)) return 0x5A412f; return 0; } @Override - public boolean isItemValidForSlot(int i, ItemStack itemstack) { - if(itemstack == null) - return false; - Item item = itemstack.getItem(); - return item == Item.getItemFromBlock(Blocks.sand) || item == Item.getItemFromBlock(Blocks.soul_sand); + protected SimpleItemStackHandler createItemHandler() { + return new SimpleItemStackHandler(this, true) { + @Override + public ItemStack insertItem(int slot, ItemStack stack, boolean simulate) { + if(stack != null && (stack.getItem() == Item.getItemFromBlock(Blocks.SAND) || stack.getItem() == Item.getItemFromBlock(Blocks.SOUL_SAND))) + return super.insertItem(slot, stack, simulate); + else return stack; + } + }; } @Override - public void writeCustomNBT(NBTTagCompound par1nbtTagCompound) { - super.writeCustomNBT(par1nbtTagCompound); + public void writePacketNBT(NBTTagCompound par1nbtTagCompound) { + super.writePacketNBT(par1nbtTagCompound); par1nbtTagCompound.setInteger(TAG_TIME, time); par1nbtTagCompound.setFloat(TAG_TIME_FRACTION, timeFraction); par1nbtTagCompound.setBoolean(TAG_FLIP, flip); @@ -117,8 +120,8 @@ public class TileHourglass extends TileSimpleInventory { } @Override - public void readCustomNBT(NBTTagCompound par1nbtTagCompound) { - super.readCustomNBT(par1nbtTagCompound); + public void readPacketNBT(NBTTagCompound par1nbtTagCompound) { + super.readPacketNBT(par1nbtTagCompound); time = par1nbtTagCompound.getInteger(TAG_TIME); timeFraction = par1nbtTagCompound.getFloat(TAG_TIME_FRACTION); flip = par1nbtTagCompound.getBoolean(TAG_FLIP); @@ -140,23 +143,24 @@ public class TileHourglass extends TileSimpleInventory { VanillaPacketDispatcher.dispatchTEToNearbyPlayers(this); } + @SideOnly(Side.CLIENT) public void renderHUD(ScaledResolution res) { Minecraft mc = Minecraft.getMinecraft(); int x = res.getScaledWidth() / 2 + 10; int y = res.getScaledHeight() / 2 - 10; - ItemStack stack = getStackInSlot(0); + ItemStack stack = itemHandler.getStackInSlot(0); if(stack != null) { RenderHelper.enableGUIStandardItemLighting(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - RenderItem.getInstance().renderItemIntoGUI(mc.fontRenderer, mc.renderEngine, stack, x, y); - RenderItem.getInstance().renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, stack, x, y); - GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GlStateManager.enableRescaleNormal(); + mc.getRenderItem().renderItemIntoGUI(stack, x, y); + mc.getRenderItem().renderItemOverlayIntoGUI(mc.fontRendererObj, stack, x, y, ""); + GlStateManager.disableRescaleNormal(); RenderHelper.disableStandardItemLighting(); int time = getTotalTime(); String timeStr = StringUtils.ticksToElapsedTime(time); - mc.fontRenderer.drawStringWithShadow(timeStr, x + 20, y, getColor()); + mc.fontRendererObj.drawStringWithShadow(timeStr, x + 20, y, getColor()); String status = ""; if(lock) @@ -164,14 +168,9 @@ public class TileHourglass extends TileSimpleInventory { if(!move) status = status.isEmpty() ? "stopped" : "lockedStopped"; if(!status.isEmpty()) - mc.fontRenderer.drawStringWithShadow(StatCollector.translateToLocal("botaniamisc." + status), x + 20, y + 12, getColor()); + mc.fontRendererObj.drawStringWithShadow(I18n.format("botaniamisc." + status), x + 20, y + 12, getColor()); } } - @Override - public String getInventoryName() { - return LibBlockNames.HOURGLASS; - } - } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileIncensePlate.java b/src/main/java/vazkii/botania/common/block/tile/TileIncensePlate.java index 133ad72ad..ad849febf 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileIncensePlate.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileIncensePlate.java @@ -10,25 +10,25 @@ */ package vazkii.botania.common.block.tile; -import java.awt.Color; -import java.util.List; - import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.ISidedInventory; +import net.minecraft.init.MobEffects; +import net.minecraft.init.SoundEvents; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.AxisAlignedBB; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.brew.Brew; import vazkii.botania.api.internal.VanillaPacketDispatcher; import vazkii.botania.common.Botania; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.item.brew.ItemIncenseStick; -import vazkii.botania.common.lib.LibBlockNames; -public class TileIncensePlate extends TileSimpleInventory implements ISidedInventory { +import java.awt.*; +import java.util.List; + +public class TileIncensePlate extends TileSimpleInventory { private static final String TAG_TIME_LEFT = "timeLeft"; private static final String TAG_BURNING = "burning"; @@ -40,39 +40,39 @@ public class TileIncensePlate extends TileSimpleInventory implements ISidedInven public int comparatorOutput = 0; @Override - public void updateEntity() { - ItemStack stack = getStackInSlot(0); + public void update() { + ItemStack stack = itemHandler.getStackInSlot(0); if(stack != null && burning) { Brew brew = ((ItemIncenseStick) ModItems.incenseStick).getBrew(stack); PotionEffect effect = brew.getPotionEffects(stack).get(0); if(timeLeft > 0) { timeLeft--; if(!worldObj.isRemote) { - List players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(xCoord + 0.5 - RANGE, yCoord + 0.5 - RANGE, zCoord + 0.5 - RANGE, xCoord + 0.5 + RANGE, yCoord + 0.5 + RANGE, zCoord + 0.5 + RANGE)); + List players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(pos.getX() + 0.5 - RANGE, pos.getY() + 0.5 - RANGE, pos.getZ() + 0.5 - RANGE, pos.getX() + 0.5 + RANGE, pos.getY() + 0.5 + RANGE, pos.getZ() + 0.5 + RANGE)); for(EntityPlayer player : players) { - PotionEffect currentEffect = player.getActivePotionEffect(Potion.potionTypes[effect.getPotionID()]); - boolean nightVision = effect.getPotionID() == Potion.nightVision.id; + PotionEffect currentEffect = player.getActivePotionEffect(effect.getPotion()); + boolean nightVision = effect.getPotion() == MobEffects.NIGHT_VISION; if(currentEffect == null || currentEffect.getDuration() < (nightVision ? 205 : 3)) { - PotionEffect applyEffect = new PotionEffect(effect.getPotionID(), nightVision ? 285 : 80, effect.getAmplifier(), true); + PotionEffect applyEffect = new PotionEffect(effect.getPotion(), nightVision ? 285 : 80, effect.getAmplifier(), true, true); player.addPotionEffect(applyEffect); } } if(worldObj.rand.nextInt(20) == 0) - worldObj.playSoundEffect(xCoord + 0.5, yCoord + 0.1, zCoord + 0.5, "fire.fire", 0.1F, 1F); + worldObj.playSound(null, pos, SoundEvents.BLOCK_FIRE_AMBIENT, SoundCategory.BLOCKS, 0.1F, 1); } else { - double x = xCoord + 0.5; - double y = yCoord + 0.5; - double z = zCoord + 0.5; + double x = pos.getX() + 0.5; + double y = pos.getY() + 0.5; + double z = pos.getZ() + 0.5; Color color = new Color(brew.getColor(stack)); float r = color.getRed() / 255F; float g = color.getGreen() / 255F; float b = color.getBlue() / 255F; - Botania.proxy.wispFX(worldObj, x - (Math.random() - 0.5) * 0.2, y - (Math.random() - 0.5) * 0.2, z - (Math.random() - 0.5) * 0.2, r, g, b, 0.05F + (float) Math.random() * 0.02F, 0.005F - (float) Math.random() * 0.01F, 0.01F + (float) Math.random() * 0.005F, 0.005F - (float) Math.random() * 0.01F); - Botania.proxy.wispFX(worldObj, x - (Math.random() - 0.5) * 0.2, y - (Math.random() - 0.5) * 0.2, z - (Math.random() - 0.5) * 0.2, 0.2F, 0.2F, 0.2F, 0.05F + (float) Math.random() * 0.02F, 0.005F - (float) Math.random() * 0.01F, 0.01F + (float) Math.random() * 0.001F, 0.005F - (float) Math.random() * 0.01F); + Botania.proxy.wispFX(x - (Math.random() - 0.5) * 0.2, y - (Math.random() - 0.5) * 0.2, z - (Math.random() - 0.5) * 0.2, r, g, b, 0.05F + (float) Math.random() * 0.02F, 0.005F - (float) Math.random() * 0.01F, 0.01F + (float) Math.random() * 0.005F, 0.005F - (float) Math.random() * 0.01F); + Botania.proxy.wispFX(x - (Math.random() - 0.5) * 0.2, y - (Math.random() - 0.5) * 0.2, z - (Math.random() - 0.5) * 0.2, 0.2F, 0.2F, 0.2F, 0.05F + (float) Math.random() * 0.02F, 0.005F - (float) Math.random() * 0.01F, 0.01F + (float) Math.random() * 0.001F, 0.005F - (float) Math.random() * 0.01F); } } else { - setInventorySlotContents(0, null); + itemHandler.setStackInSlot(0, null); burning = false; VanillaPacketDispatcher.dispatchTEToNearbyPlayers(this); } @@ -85,12 +85,12 @@ public class TileIncensePlate extends TileSimpleInventory implements ISidedInven newComparator = 2; if(comparatorOutput != newComparator) { comparatorOutput = newComparator; - worldObj.func_147453_f(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord)); + worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock()); } } public void ignite() { - ItemStack stack = getStackInSlot(0); + ItemStack stack = itemHandler.getStackInSlot(0); if(stack == null || burning) return; @@ -105,42 +105,38 @@ public class TileIncensePlate extends TileSimpleInventory implements ISidedInven } @Override - public String getInventoryName() { - return LibBlockNames.INCENSE_PLATE; - } - - @Override - public void writeCustomNBT(NBTTagCompound par1nbtTagCompound) { - super.writeCustomNBT(par1nbtTagCompound); + public void writePacketNBT(NBTTagCompound par1nbtTagCompound) { + super.writePacketNBT(par1nbtTagCompound); par1nbtTagCompound.setInteger(TAG_TIME_LEFT, timeLeft); par1nbtTagCompound.setBoolean(TAG_BURNING, burning); } @Override - public void readCustomNBT(NBTTagCompound par1nbtTagCompound) { - super.readCustomNBT(par1nbtTagCompound); + public void readPacketNBT(NBTTagCompound par1nbtTagCompound) { + super.readPacketNBT(par1nbtTagCompound); timeLeft = par1nbtTagCompound.getInteger(TAG_TIME_LEFT); burning = par1nbtTagCompound.getBoolean(TAG_BURNING); } - @Override - public boolean isItemValidForSlot(int i, ItemStack itemstack) { - return itemstack != null && itemstack.getItem() == ModItems.incenseStick && ((ItemIncenseStick) ModItems.incenseStick).getBrew(itemstack) != BotaniaAPI.fallbackBrew; + public boolean acceptsItem(ItemStack stack) { + return stack != null && stack.getItem() == ModItems.incenseStick && ((ItemIncenseStick) ModItems.incenseStick).getBrew(stack) != BotaniaAPI.fallbackBrew; } @Override - public int[] getAccessibleSlotsFromSide(int side) { - return new int[] { 0 }; - } + protected SimpleItemStackHandler createItemHandler() { + return new SimpleItemStackHandler(this, true) { + @Override + public ItemStack insertItem(int slot, ItemStack stack, boolean simulate) { + if(acceptsItem(stack)) + return super.insertItem(slot, stack, simulate); + else return stack; + } - @Override - public boolean canInsertItem(int slot, ItemStack stack, int side) { - return isItemValidForSlot(slot, stack); - } - - @Override - public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) { - return false; + @Override + public ItemStack extractItem(int slot, int amount, boolean simulate) { + return null; + } + }; } @Override diff --git a/src/main/java/vazkii/botania/common/block/tile/TileLightRelay.java b/src/main/java/vazkii/botania/common/block/tile/TileLightRelay.java index 063526503..a3425ae56 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileLightRelay.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileLightRelay.java @@ -10,10 +10,6 @@ */ package vazkii.botania.common.block.tile; -import java.awt.Color; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityEnderPearl; @@ -21,18 +17,29 @@ import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.datasync.DataParameter; +import net.minecraft.network.datasync.DataSerializers; +import net.minecraft.network.datasync.EntityDataManager; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import vazkii.botania.api.sound.BotaniaSoundEvents; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.LuminizerVariant; import vazkii.botania.api.wand.IWandBindable; import vazkii.botania.common.Botania; import vazkii.botania.common.achievement.ModAchievements; import vazkii.botania.common.block.ModBlocks; -import vazkii.botania.common.core.helper.MathHelper; import vazkii.botania.common.core.helper.Vector3; +import javax.annotation.Nonnull; +import java.awt.*; +import java.util.ArrayList; +import java.util.List; + public class TileLightRelay extends TileMod implements IWandBindable { private static final int MAX_DIST = 20; @@ -41,72 +48,78 @@ public class TileLightRelay extends TileMod implements IWandBindable { private static final String TAG_BIND_Y = "bindY"; private static final String TAG_BIND_Z = "bindZ"; - int bindX, bindY = -1, bindZ; + BlockPos bindPos = new BlockPos(0, -1, 0); int ticksElapsed = 0; public void mountEntity(Entity e) { - if(e.ridingEntity != null || worldObj.isRemote || bindY == -1 || !isValidBinding()) + if(e.isRiding() || worldObj.isRemote || bindPos.getY() == -1 || !isValidBinding()) return; - EntityPlayerMover mover = new EntityPlayerMover(worldObj, xCoord, yCoord, zCoord, bindX, bindY, bindZ); + EntityPlayerMover mover = new EntityPlayerMover(worldObj, pos, bindPos); worldObj.spawnEntityInWorld(mover); - e.mountEntity(mover); + e.startRiding(mover); if(!(e instanceof EntityItem)) { - worldObj.playSoundAtEntity(mover, "botania:lightRelay", 0.2F, (float) Math.random() * 0.3F + 0.7F); + mover.playSound(BotaniaSoundEvents.lightRelay, 0.2F, (float) Math.random() * 0.3F + 0.7F); if(e instanceof EntityPlayer) ((EntityPlayer) e).addStat(ModAchievements.luminizerRide, 1); } } @Override - public void updateEntity() { + public void update() { ticksElapsed++; - if(bindY > -1 && isValidBinding()) { - Vector3 vec = getMovementVector(); + if(bindPos.getY() > -1 && isValidBinding()) { + if(worldObj.isRemote) { + Vector3 vec = getMovementVector(); - double dist = 0.1; - int size = (int) (vec.mag() / dist); - int count = 10; - int start = ticksElapsed % size; + double dist = 0.1; + int size = (int) (vec.mag() / dist); + int count = 10; + int start = ticksElapsed % size; - Vector3 vecMag = vec.copy().normalize().multiply(dist); - Vector3 vecTip = vecMag.copy().multiply(start).add(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5); + Vector3 vecMag = vec.normalize().multiply(dist); + Vector3 vecTip = vecMag.multiply(start).add(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5); - double radPer = Math.PI / 16.0; - float mul = 0.5F; - float mulPer = 0.4F; - float maxMul = 2; - for(int i = start; i < start + count; i++) { - mul = Math.min(maxMul, mul + mulPer); - double rad = radPer * (i + ticksElapsed * 0.4); - Vector3 vecRot = vecMag.copy().crossProduct(Vector3.one).multiply(mul).rotate(rad, vecMag).add(vecTip); - Botania.proxy.wispFX(worldObj, vecRot.x, vecRot.y, vecRot.z, 0.4F, 0.4F, 1F, 0.1F, (float) -vecMag.x, (float) -vecMag.y, (float) -vecMag.z, 1F); - vecTip.add(vecMag); - } + double radPer = Math.PI / 16.0; + float mul = 0.5F; + float mulPer = 0.4F; + float maxMul = 2; + for(int i = start; i < start + count; i++) { + mul = Math.min(maxMul, mul + mulPer); + double rad = radPer * (i + ticksElapsed * 0.4); + Vector3 vecRot = vecMag.crossProduct(Vector3.ONE).multiply(mul).rotate(rad, vecMag).add(vecTip); + Botania.proxy.wispFX(vecRot.x, vecRot.y, vecRot.z, 0.4F, 0.4F, 1F, 0.1F, (float) -vecMag.x, (float) -vecMag.y, (float) -vecMag.z, 1F); + vecTip = vecTip.add(vecMag); + } + } else { + BlockPos endpoint = getEndpoint(); - ChunkCoordinates endpoint = getEndpoint(); - if(endpoint != null && !worldObj.isRemote) { - float range = 0.5F; - List enderPearls = worldObj.getEntitiesWithinAABB(EntityEnderPearl.class, AxisAlignedBB.getBoundingBox(xCoord - range, yCoord - range, zCoord - range, xCoord + 1 + range, yCoord + 1 + range, zCoord + 1 + range)); - for(EntityEnderPearl pearl : enderPearls) { - pearl.posX = endpoint.posX + pearl.posX - xCoord; - pearl.posY = endpoint.posY + pearl.posY - yCoord; - pearl.posZ = endpoint.posZ + pearl.posZ - zCoord; + if(endpoint != null) { + AxisAlignedBB aabb = ModBlocks.lightRelay.getBoundingBox(worldObj.getBlockState(pos), worldObj, pos).offset(pos); + float range = 0.5F; + List enderPearls = worldObj.getEntitiesWithinAABB(EntityEnderPearl.class, aabb.expandXyz(range)); + for(EntityEnderPearl pearl : enderPearls) { + pearl.setPositionAndUpdate( + endpoint.getX() + pearl.posX - pos.getX(), + endpoint.getY() + pearl.posY - pos.getY(), + endpoint.getZ() + pearl.posZ - pos.getZ() + ); + } } } } } - public boolean isValidBinding() { - Block block = worldObj.getBlock(bindX, bindY, bindZ); + private boolean isValidBinding() { + Block block = worldObj.getBlockState(bindPos).getBlock(); return block == ModBlocks.lightRelay; } - - public ChunkCoordinates getEndpoint() { - List pointsPassed = new ArrayList(); + + private BlockPos getEndpoint() { + List pointsPassed = new ArrayList<>(); TileLightRelay relay = this; - ChunkCoordinates lastCoords = null; + BlockPos lastCoords = null; // Doing while(true) gives an unreachable code error boolean run = true; @@ -114,12 +127,12 @@ public class TileLightRelay extends TileMod implements IWandBindable { if(pointsPassed.contains(relay)) return null; // Circular path pointsPassed.add(relay); - - ChunkCoordinates coords = relay.getBinding(); + + BlockPos coords = relay.getBinding(); if(coords == null) return lastCoords; - - TileEntity tile = worldObj.getTileEntity(coords.posX, coords.posY, coords.posZ); + + TileEntity tile = worldObj.getTileEntity(coords); if(tile != null && tile instanceof TileLightRelay) relay = (TileLightRelay) tile; else return lastCoords; @@ -131,42 +144,42 @@ public class TileLightRelay extends TileMod implements IWandBindable { } public Vector3 getMovementVector() { - return new Vector3(bindX - xCoord, bindY - yCoord, bindZ - zCoord); + return new Vector3(bindPos.getX() - pos.getX(), bindPos.getY() - pos.getY(), bindPos.getZ() - pos.getZ()); } @Override - public ChunkCoordinates getBinding() { - return bindY == -1 ? null : new ChunkCoordinates(bindX, bindY, bindZ); + public BlockPos getBinding() { + return bindPos.getY() == -1 ? null : bindPos; } @Override - public boolean canSelect(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { + public boolean canSelect(EntityPlayer player, ItemStack wand, BlockPos pos, EnumFacing side) { return true; } @Override - public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { - if(player.worldObj.getBlock(x, y, z) != ModBlocks.lightRelay || MathHelper.pointDistanceSpace(x, y, z, xCoord, yCoord, zCoord) > MAX_DIST) + public boolean bindTo(EntityPlayer player, ItemStack wand, BlockPos pos, EnumFacing side) { + if(player.worldObj.getBlockState(pos).getBlock() != ModBlocks.lightRelay || pos.distanceSq(getPos()) > MAX_DIST * MAX_DIST) return false; - bindX = x; - bindY = y; - bindZ = z; + bindPos = pos; return true; } @Override - public void readCustomNBT(NBTTagCompound cmp) { - bindX = cmp.getInteger(TAG_BIND_X); - bindY = cmp.getInteger(TAG_BIND_Y); - bindZ = cmp.getInteger(TAG_BIND_Z); + public void readPacketNBT(NBTTagCompound cmp) { + bindPos = new BlockPos( + cmp.getInteger(TAG_BIND_X), + cmp.getInteger(TAG_BIND_Y), + cmp.getInteger(TAG_BIND_Z) + ); } @Override - public void writeCustomNBT(NBTTagCompound cmp) { - cmp.setInteger(TAG_BIND_X, bindX); - cmp.setInteger(TAG_BIND_Y, bindY); - cmp.setInteger(TAG_BIND_Z, bindZ); + public void writePacketNBT(NBTTagCompound cmp) { + cmp.setInteger(TAG_BIND_X, bindPos.getX()); + cmp.setInteger(TAG_BIND_Y, bindPos.getY()); + cmp.setInteger(TAG_BIND_Z, bindPos.getZ()); } public static class EntityPlayerMover extends Entity { @@ -174,63 +187,54 @@ public class TileLightRelay extends TileMod implements IWandBindable { private static final String TAG_EXIT_X = "exitX"; private static final String TAG_EXIT_Y = "exitY"; private static final String TAG_EXIT_Z = "exitZ"; + private static final DataParameter EXIT_POS = EntityDataManager.createKey(EntityPlayerMover.class, DataSerializers.BLOCK_POS); + public EntityPlayerMover(World world) { super(world); } - public EntityPlayerMover(World world, int x, int y, int z, int exitX, int exitY, int exitZ) { + public EntityPlayerMover(World world, BlockPos pos, BlockPos exitPos) { this(world); - setPosition(x + 0.5, y + 0.5, z + 0.5); - setExit(exitX, exitY, exitZ); + setPosition(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5); + setExit(exitPos); } @Override protected void entityInit() { setSize(0F, 0F); noClip = true; - - dataWatcher.addObject(20, 0); - dataWatcher.addObject(21, 0); - dataWatcher.addObject(22, 0); - dataWatcher.setObjectWatched(20); - dataWatcher.setObjectWatched(21); - dataWatcher.setObjectWatched(22); + dataManager.register(EXIT_POS, BlockPos.ORIGIN); } @Override public void onUpdate() { super.onUpdate(); - if(riddenByEntity == null && !worldObj.isRemote) { + if(getPassengers().isEmpty() && !worldObj.isRemote) { setDead(); return; } - boolean isItem = riddenByEntity instanceof EntityItem; + boolean isItem = getRidingEntity() instanceof EntityItem; if(!isItem && ticksExisted % 30 == 0) - worldObj.playSoundAtEntity(this, "botania:lightRelay", 0.05F, (float) Math.random() * 0.3F + 0.7F); + playSound(BotaniaSoundEvents.lightRelay, 0.05F, (float) Math.random() * 0.3F + 0.7F); - int exitX = getExitX(); - int exitY = getExitY(); - int exitZ = getExitZ(); + BlockPos pos = new BlockPos(this); + BlockPos exitPos = getExitPos(); - int x = net.minecraft.util.MathHelper.floor_double(posX); - int y = net.minecraft.util.MathHelper.floor_double(posY); - int z = net.minecraft.util.MathHelper.floor_double(posZ); - if(x == exitX && y == exitY && z == exitZ) { - TileEntity tile = worldObj.getTileEntity(x, y, z); + if(pos.equals(exitPos)) { + TileEntity tile = worldObj.getTileEntity(pos); if(tile != null && tile instanceof TileLightRelay) { - int meta = worldObj.getBlockMetadata(x, y, z); - if(meta > 0) { - worldObj.setBlockMetadataWithNotify(x, y, z, meta | 8, 1 | 2); - worldObj.scheduleBlockUpdate(x, y, z, tile.getBlockType(), tile.getBlockType().tickRate(worldObj)); + if(worldObj.getBlockState(pos).getValue(BotaniaStateProps.LUMINIZER_VARIANT) == LuminizerVariant.DETECTOR) { + worldObj.setBlockState(pos, worldObj.getBlockState(pos).withProperty(BotaniaStateProps.POWERED, true), 1 | 2); + worldObj.scheduleUpdate(pos, tile.getBlockType(), tile.getBlockType().tickRate(worldObj)); } TileLightRelay relay = (TileLightRelay) tile; - ChunkCoordinates bind = relay.getBinding(); + BlockPos bind = relay.getBinding(); if(bind != null && relay.isValidBinding()) { - setExit(bind.posX, bind.posY, bind.posZ); + setExit(bind); return; } } @@ -239,7 +243,7 @@ public class TileLightRelay extends TileMod implements IWandBindable { setDead(); } else { Vector3 thisVec = Vector3.fromEntity(this); - Vector3 motVec = thisVec.negate().add(exitX + 0.5, exitY + 0.5, exitZ + 0.5).normalize().multiply(0.5); + Vector3 motVec = thisVec.negate().add(exitPos.getX() + 0.5, exitPos.getY() + 0.5, exitPos.getZ() + 0.5).normalize().multiply(0.5); Color color; @@ -251,7 +255,7 @@ public class TileLightRelay extends TileMod implements IWandBindable { double sin = Math.sin(rad); double s = 0.4; - Botania.proxy.sparkleFX(worldObj, posX + cos * s, posY - 0.5, posZ + sin * s, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, 1.2F, 10); + Botania.proxy.sparkleFX(posX + cos * s, posY - 0.5, posZ + sin * s, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, 1.2F, 10); } posX += motVec.x; @@ -266,38 +270,29 @@ public class TileLightRelay extends TileMod implements IWandBindable { } @Override - public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) { + public boolean attackEntityFrom(@Nonnull DamageSource source, float damage) { return false; } @Override - protected void readEntityFromNBT(NBTTagCompound cmp) { - setExit(cmp.getInteger(TAG_EXIT_X), cmp.getInteger(TAG_EXIT_Y), cmp.getInteger(TAG_EXIT_Z)); + protected void readEntityFromNBT(@Nonnull NBTTagCompound cmp) { + setExit(new BlockPos(cmp.getInteger(TAG_EXIT_X), cmp.getInteger(TAG_EXIT_Y), cmp.getInteger(TAG_EXIT_Z))); } @Override - protected void writeEntityToNBT(NBTTagCompound cmp) { - cmp.setInteger(TAG_EXIT_X, getExitX()); - cmp.setInteger(TAG_EXIT_Y, getExitY()); - cmp.setInteger(TAG_EXIT_Z, getExitZ()); + protected void writeEntityToNBT(@Nonnull NBTTagCompound cmp) { + BlockPos exit = getExitPos(); + cmp.setInteger(TAG_EXIT_X, exit.getX()); + cmp.setInteger(TAG_EXIT_Y, exit.getY()); + cmp.setInteger(TAG_EXIT_Z, exit.getZ()); } - public int getExitX() { - return dataWatcher.getWatchableObjectInt(20); + public BlockPos getExitPos() { + return dataManager.get(EXIT_POS); } - public int getExitY() { - return dataWatcher.getWatchableObjectInt(21); - } - - public int getExitZ() { - return dataWatcher.getWatchableObjectInt(22); - } - - public void setExit(int x, int y, int z) { - dataWatcher.updateObject(20, x); - dataWatcher.updateObject(21, y); - dataWatcher.updateObject(22, z); + public void setExit(BlockPos pos) { + dataManager.set(EXIT_POS, pos); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileManaBeacon.java b/src/main/java/vazkii/botania/common/block/tile/TileManaBeacon.java index d4d0936d8..1bf725ad3 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileManaBeacon.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileManaBeacon.java @@ -10,29 +10,32 @@ */ package vazkii.botania.common.block.tile; -import net.minecraft.entity.passive.EntitySheep; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.util.EnumFacing; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.common.Botania; public class TileManaBeacon extends TileMod { @Override - public void updateEntity() { + public void update() { boolean redstone = false; - for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { - int redstoneSide = worldObj.getIndirectPowerLevelTo(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir.ordinal()); + for(EnumFacing dir : EnumFacing.VALUES) { + int redstoneSide = worldObj.getRedstonePower(pos.offset(dir), dir); if(redstoneSide > 0) redstone = true; } if(!redstone) { - float[] color = EntitySheep.fleeceColorTable[worldObj.getBlockMetadata(xCoord, yCoord, zCoord)]; + int hex = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.COLOR).getMapColor().colorValue; + int r = (hex & 0xFF0000) >> 16; + int g = (hex & 0xFF00) >> 8; + int b = (hex & 0xFF); Botania.proxy.setWispFXDistanceLimit(false); - Botania.proxy.wispFX(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, color[0], color[1], color[2], (float) Math.random() * 5 + 1F, (float) (Math.random() - 0.5F), 10F * (float) Math.sqrt(256F / (256F - yCoord)), (float) (Math.random() - 0.5F)); + Botania.proxy.wispFX(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, r / 255F, g / 255F, b / 255F, (float) Math.random() * 5 + 1F, (float) (Math.random() - 0.5F), 10F * (float) Math.sqrt(256F / (256F - pos.getY())), (float) (Math.random() - 0.5F)); for(int i = 0; i < 2; i++) - Botania.proxy.wispFX(worldObj, xCoord + 0.5, 256, zCoord + 0.5, color[0], color[1], color[2], (float) Math.random() * 15 + 8F, (float) (Math.random() - 0.5F) * 8F, 0F, (float) (Math.random() - 0.5F) * 8F); + Botania.proxy.wispFX(pos.getX() + 0.5, Math.min(256, pos.getY() + Botania.proxy.getClientRenderDistance() * 16), pos.getZ() + 0.5, r / 255F, g / 255F, b / 255F, (float) Math.random() * 15 + 8F, (float) (Math.random() - 0.5F) * 8F, 0F, (float) (Math.random() - 0.5F) * 8F); Botania.proxy.setWispFXDistanceLimit(true); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileManaFlame.java b/src/main/java/vazkii/botania/common/block/tile/TileManaFlame.java index a1815d3ba..dc64dbac6 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileManaFlame.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileManaFlame.java @@ -12,15 +12,13 @@ package vazkii.botania.common.block.tile; import net.minecraft.nbt.NBTTagCompound; import vazkii.botania.common.Botania; -import vazkii.botania.common.integration.coloredlights.ColoredLightHelper; public class TileManaFlame extends TileMod { private static final String TAG_COLOR = "color"; - int color = 0x20FF20; - - int lightColor = -1; + private int color = 0x20FF20; + private int lightColor = -1; public void setColor(int color) { this.color = color; @@ -31,47 +29,52 @@ public class TileManaFlame extends TileMod { } @Override - public void updateEntity() { + public void update() { float c = 0.3F; - if(Math.random() < c) { + if(worldObj.isRemote && Math.random() < c) { float v = 0.1F; - float r = (float) (color >> 16 & 0xFF) / 0xFF + (float) (Math.random() - 0.5) * v; - float g = (float) (color >> 8 & 0xFF) / 0xFF + (float) (Math.random() - 0.5) * v; - float b = (float) (color & 0xFF) / 0xFF + (float) (Math.random() - 0.5) * v; + float r = (float) (color >> 16 & 0xFF) / 0xFF; + float g = (float) (color >> 8 & 0xFF) / 0xFF; + float b = (float) (color & 0xFF) / 0xFF; + + double luminance = 0.2126 * r + 0.7152 * g + 0.0722 * b; // Standard relative luminance calculation + + if (luminance < v) { + r += (float) Math.random() * 0.125F; + g += (float) Math.random() * 0.125F; + b += (float) Math.random() * 0.125F; + } float w = 0.15F; float h = 0.05F; - double x = xCoord + 0.5 + (Math.random() - 0.5) * w; - double y = yCoord + 0.25 + (Math.random() - 0.5) * h; - double z = zCoord + 0.5 + (Math.random() - 0.5) * w; + double x = pos.getX() + 0.5 + (Math.random() - 0.5) * w; + double y = pos.getY() + 0.25 + (Math.random() - 0.5) * h; + double z = pos.getZ() + 0.5 + (Math.random() - 0.5) * w; float s = 0.2F + (float) Math.random() * 0.1F; float m = 0.03F + (float) Math.random() * 0.015F; - Botania.proxy.wispFX(worldObj, x, y, z, r, g, b, s, -m); + Botania.proxy.wispFX(x, y, z, r, g, b, s, -m); } } public int getLightColor() { if(lightColor == -1) { - float r = (float) (color >> 16 & 0xFF) / 0xFF; - float g = (float) (color >> 8 & 0xFF) / 0xFF; - float b = (float) (color & 0xFF) / 0xFF; - lightColor = ColoredLightHelper.makeRGBLightValue(r, g, b, 1F); + lightColor = 0xFFFFFF; } return lightColor; } @Override - public void writeCustomNBT(NBTTagCompound cmp) { + public void writePacketNBT(NBTTagCompound cmp) { cmp.setInteger(TAG_COLOR, color); } @Override - public void readCustomNBT(NBTTagCompound cmp) { + public void readPacketNBT(NBTTagCompound cmp) { color = cmp.getInteger(TAG_COLOR); } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileMod.java b/src/main/java/vazkii/botania/common/block/tile/TileMod.java index b1deaf483..14952b522 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileMod.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileMod.java @@ -10,47 +10,62 @@ */ package vazkii.botania.common.block.tile; +import net.minecraft.block.state.IBlockState; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.network.play.server.SPacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ITickable; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; -public class TileMod extends TileEntity { +import javax.annotation.Nonnull; + +public class TileMod extends TileEntity implements ITickable { @Override - public void writeToNBT(NBTTagCompound par1nbtTagCompound) { - super.writeToNBT(par1nbtTagCompound); + public boolean shouldRefresh(World world, BlockPos pos, @Nonnull IBlockState oldState, @Nonnull IBlockState newState) { + return oldState.getBlock() != newState.getBlock(); + } - writeCustomNBT(par1nbtTagCompound); + @Nonnull + @Override + public NBTTagCompound writeToNBT(NBTTagCompound par1nbtTagCompound) { + NBTTagCompound ret = super.writeToNBT(par1nbtTagCompound); + writePacketNBT(ret); + return ret; + } + + @Nonnull + @Override + public final NBTTagCompound getUpdateTag() { + return writeToNBT(new NBTTagCompound()); } @Override public void readFromNBT(NBTTagCompound par1nbtTagCompound) { super.readFromNBT(par1nbtTagCompound); - - readCustomNBT(par1nbtTagCompound); + readPacketNBT(par1nbtTagCompound); } - public void writeCustomNBT(NBTTagCompound cmp) { - // NO-OP - } + public void writePacketNBT(NBTTagCompound cmp) {} - public void readCustomNBT(NBTTagCompound cmp) { - // NO-OP + public void readPacketNBT(NBTTagCompound cmp) {} + + @Override + public final SPacketUpdateTileEntity getUpdatePacket() { + NBTTagCompound tag = new NBTTagCompound(); + writePacketNBT(tag); + return new SPacketUpdateTileEntity(pos, -999, tag); } @Override - public Packet getDescriptionPacket() { - NBTTagCompound nbttagcompound = new NBTTagCompound(); - writeCustomNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, -999, nbttagcompound); - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) { + public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) { super.onDataPacket(net, packet); - readCustomNBT(packet.func_148857_g()); + readPacketNBT(packet.getNbtCompound()); } + @Override + public void update() {} + } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileOpenCrate.java b/src/main/java/vazkii/botania/common/block/tile/TileOpenCrate.java index 33f12dc65..5d788a80a 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileOpenCrate.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileOpenCrate.java @@ -11,29 +11,43 @@ package vazkii.botania.common.block.tile; import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; -import vazkii.botania.common.lib.LibBlockNames; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.common.block.ModBlocks; +import vazkii.botania.common.core.handler.MethodHandles; + +import javax.annotation.Nonnull; public class TileOpenCrate extends TileSimpleInventory { @Override - public int getSizeInventory() { - return 1; - } + public boolean shouldRefresh(World world, BlockPos pos, @Nonnull IBlockState oldState, @Nonnull IBlockState newState) { + if(oldState.getBlock() != newState.getBlock()) + return true; + if(oldState.getBlock() != ModBlocks.openCrate || newState.getBlock() != ModBlocks.openCrate) + return true; + return oldState.getValue(BotaniaStateProps.CRATE_VARIANT) != newState.getValue(BotaniaStateProps.CRATE_VARIANT); + } + + @Override + public int getSizeInventory() { + return 1; + } @Override - public String getInventoryName() { - return LibBlockNames.OPEN_CRATE; - } + public void update() { + if (worldObj.isRemote) + return; - @Override - public void updateEntity() { boolean redstone = false; - for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { - int redstoneSide = worldObj.getIndirectPowerLevelTo(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir.ordinal()); + for(EnumFacing dir : EnumFacing.VALUES) { + int redstoneSide = worldObj.getRedstonePower(pos.offset(dir), dir); if(redstoneSide > 0) { redstone = true; break; @@ -41,32 +55,36 @@ public class TileOpenCrate extends TileSimpleInventory { } if(canEject()) { - ItemStack stack = getStackInSlot(0); + ItemStack stack = itemHandler.getStackInSlot(0); if(stack != null) eject(stack, redstone); } } public boolean canEject() { - Block blockBelow = worldObj.getBlock(xCoord, yCoord - 1, zCoord); - return blockBelow.isAir(worldObj, xCoord, yCoord - 1, zCoord) || blockBelow.getCollisionBoundingBoxFromPool(worldObj, xCoord, yCoord - 1, zCoord) == null; + IBlockState stateBelow = worldObj.getBlockState(pos.down()); + Block blockBelow = stateBelow.getBlock(); + return blockBelow.isAir(stateBelow, worldObj, pos.down()) || stateBelow.getCollisionBoundingBox(worldObj, pos.down()) == null; } public void eject(ItemStack stack, boolean redstone) { - EntityItem item = new EntityItem(worldObj, xCoord + 0.5, yCoord - 0.5, zCoord + 0.5, stack); + EntityItem item = new EntityItem(worldObj, pos.getX() + 0.5, pos.getY() - 0.5, pos.getZ() + 0.5, stack); item.motionX = 0; item.motionY = 0; item.motionZ = 0; - if(redstone) - item.age = -200; + if(redstone) { + try { + MethodHandles.itemAge_setter.invokeExact(item, -200); + } catch (Throwable ignored) {} + } - setInventorySlotContents(0, null); - if(!worldObj.isRemote) - worldObj.spawnEntityInWorld(item); + + itemHandler.setStackInSlot(0, null); + worldObj.spawnEntityInWorld(item); } - public boolean onWanded(EntityPlayer player, ItemStack stack) { + public boolean onWanded(World world, EntityPlayer player, ItemStack stack) { return false; } diff --git a/src/main/java/vazkii/botania/common/block/tile/TilePlatform.java b/src/main/java/vazkii/botania/common/block/tile/TilePlatform.java index 416ca3eb2..3c4f81190 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TilePlatform.java +++ b/src/main/java/vazkii/botania/common/block/tile/TilePlatform.java @@ -12,19 +12,14 @@ package vazkii.botania.common.block.tile; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; -import vazkii.botania.api.mana.IManaCollisionGhost; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; -public class TilePlatform extends TileCamo implements IManaCollisionGhost { - - @Override - public boolean isGhost() { - return true; - } +public class TilePlatform extends TileCamo { public boolean onWanded(EntityPlayer player) { if(player != null) { - if(camo == null || player.isSneaking()) + if(camoState == null || player.isSneaking()) swapSelfAndPass(this, true); else swapSurroudings(this, false); return true; @@ -39,23 +34,20 @@ public class TilePlatform extends TileCamo implements IManaCollisionGhost { } void swapSurroudings(TilePlatform tile, boolean empty) { - for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { - int x = tile.xCoord + dir.offsetX; - int y = tile.yCoord + dir.offsetY; - int z = tile.zCoord + dir.offsetZ; - TileEntity tileAt = worldObj.getTileEntity(x, y, z); + for(EnumFacing dir : EnumFacing.VALUES) { + BlockPos pos = tile.getPos().offset(dir); + TileEntity tileAt = worldObj.getTileEntity(pos); if(tileAt != null && tileAt instanceof TilePlatform) { TilePlatform platform = (TilePlatform) tileAt; - if(empty ? platform.camo != null : platform.camo == null) + if(empty ? platform.camoState != null : platform.camoState == null) swapSelfAndPass(platform, empty); } } } void swap(TilePlatform tile, boolean empty) { - tile.camo = empty ? null : camo; - tile.camoMeta = empty ? 0 : camoMeta; - worldObj.markBlockForUpdate(tile.xCoord, tile.yCoord, tile.zCoord); + tile.camoState = empty ? null : camoState; + worldObj.notifyBlockUpdate(tile.getPos(), worldObj.getBlockState(tile.getPos()), worldObj.getBlockState(tile.getPos()), 8); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/TilePylon.java b/src/main/java/vazkii/botania/common/block/tile/TilePylon.java index a3b89b029..bb87e017c 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TilePylon.java +++ b/src/main/java/vazkii/botania/common/block/tile/TilePylon.java @@ -10,80 +10,93 @@ */ package vazkii.botania.common.block.tile; -import java.util.Random; - import net.minecraft.block.Block; -import net.minecraft.entity.passive.EntitySheep; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ITickable; +import net.minecraft.util.math.BlockPos; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.AlfPortalState; +import vazkii.botania.api.state.enums.PylonVariant; import vazkii.botania.common.Botania; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.core.helper.Vector3; -public class TilePylon extends TileEntity { +import java.util.Random; + +public class TilePylon extends TileEntity implements ITickable { boolean activated = false; - int centerX, centerY, centerZ; + BlockPos centerPos; int ticks = 0; - - @Override - public void updateEntity() { + public void update() { ++ticks; - int meta = getBlockMetadata(); + + if (worldObj.getBlockState(getPos()).getBlock() != ModBlocks.pylon) + return; + + PylonVariant variant = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.PYLON_VARIANT); if(activated && worldObj.isRemote) { - if(worldObj.getBlock(centerX, centerY, centerZ) != getBlockForMeta() || meta != 0 && worldObj.getBlockMetadata(centerX, centerY, centerZ) == 0) { + if(worldObj.getBlockState(centerPos).getBlock() != getBlockForMeta() || variant != PylonVariant.MANA && portalOff()) { activated = false; return; } - Vector3 centerBlock = new Vector3(centerX + 0.5, centerY + 0.75 + (Math.random() - 0.5 * 0.25), centerZ + 0.5); + Vector3 centerBlock = new Vector3(centerPos.getX() + 0.5, centerPos.getY() + 0.75 + (Math.random() - 0.5 * 0.25), centerPos.getZ() + 0.5); - if(meta == 1) { + if(variant == PylonVariant.NATURA) { if(ConfigHandler.elfPortalParticlesEnabled) { double worldTime = ticks; - worldTime += new Random(xCoord ^ yCoord ^ zCoord).nextInt(1000); + worldTime += new Random(pos.hashCode()).nextInt(1000); worldTime /= 5; float r = 0.75F + (float) Math.random() * 0.05F; - double x = xCoord + 0.5 + Math.cos(worldTime) * r; - double z = zCoord + 0.5 + Math.sin(worldTime) * r; + double x = pos.getX() + 0.5 + Math.cos(worldTime) * r; + double z = pos.getZ() + 0.5 + Math.sin(worldTime) * r; - Vector3 ourCoords = new Vector3(x, yCoord + 0.25, z); - centerBlock.sub(new Vector3(0, 0.5, 0)); - Vector3 movementVector = centerBlock.sub(ourCoords).normalize().multiply(0.2); + Vector3 ourCoords = new Vector3(x, pos.getY() + 0.25, z); + centerBlock = centerBlock.subtract(new Vector3(0, 0.5, 0)); + Vector3 movementVector = centerBlock.subtract(ourCoords).normalize().multiply(0.2); - Botania.proxy.wispFX(worldObj, x, yCoord + 0.25, z, (float) Math.random() * 0.25F, 0.75F + (float) Math.random() * 0.25F, (float) Math.random() * 0.25F, 0.25F + (float) Math.random() * 0.1F, -0.075F - (float) Math.random() * 0.015F); + Botania.proxy.wispFX(x, pos.getY() + 0.25, z, (float) Math.random() * 0.25F, 0.75F + (float) Math.random() * 0.25F, (float) Math.random() * 0.25F, 0.25F + (float) Math.random() * 0.1F, -0.075F - (float) Math.random() * 0.015F); if(worldObj.rand.nextInt(3) == 0) - Botania.proxy.wispFX(worldObj, x, yCoord + 0.25, z, (float) Math.random() * 0.25F, 0.75F + (float) Math.random() * 0.25F, (float) Math.random() * 0.25F, 0.25F + (float) Math.random() * 0.1F, (float) movementVector.x, (float) movementVector.y, (float) movementVector.z); + Botania.proxy.wispFX(x, pos.getY() + 0.25, z, (float) Math.random() * 0.25F, 0.75F + (float) Math.random() * 0.25F, (float) Math.random() * 0.25F, 0.25F + (float) Math.random() * 0.1F, (float) movementVector.x, (float) movementVector.y, (float) movementVector.z); } } else { Vector3 ourCoords = Vector3.fromTileEntityCenter(this).add(0, 1 + (Math.random() - 0.5 * 0.25), 0); - Vector3 movementVector = centerBlock.sub(ourCoords).normalize().multiply(0.2); + Vector3 movementVector = centerBlock.subtract(ourCoords).normalize().multiply(0.2); - Block block = worldObj.getBlock(xCoord, yCoord - 1, zCoord); + Block block = worldObj.getBlockState(pos.down()).getBlock(); if(block == ModBlocks.flower || block == ModBlocks.shinyFlower) { - int fmeta = worldObj.getBlockMetadata(xCoord, yCoord - 1, zCoord); - float[] color = EntitySheep.fleeceColorTable[fmeta]; + int hex = worldObj.getBlockState(pos.down()).getValue(BotaniaStateProps.COLOR).getMapColor().colorValue; + int r = (hex & 0xFF0000) >> 16; + int g = (hex & 0xFF00) >> 8; + int b = (hex & 0xFF); if(worldObj.rand.nextInt(4) == 0) - Botania.proxy.sparkleFX(worldObj, centerBlock.x + (Math.random() - 0.5) * 0.5, centerBlock.y, centerBlock.z + (Math.random() - 0.5) * 0.5, color[0], color[1], color[2], (float) Math.random(), 8); + Botania.proxy.sparkleFX(centerBlock.x + (Math.random() - 0.5) * 0.5, centerBlock.y, centerBlock.z + (Math.random() - 0.5) * 0.5, r / 255F, g / 255F, b / 255F, (float) Math.random(), 8); - Botania.proxy.wispFX(worldObj, xCoord + 0.5 + (Math.random() - 0.5) * 0.25, yCoord - 0.5, zCoord + 0.5 + (Math.random() - 0.5) * 0.25, color[0], color[1], color[2], (float) Math.random() / 3F, -0.04F); - Botania.proxy.wispFX(worldObj, xCoord + 0.5 + (Math.random() - 0.5) * 0.125, yCoord + 1.5, zCoord + 0.5 + (Math.random() - 0.5) * 0.125, color[0], color[1], color[2], (float) Math.random() / 5F, -0.001F); - Botania.proxy.wispFX(worldObj, xCoord + 0.5 + (Math.random() - 0.5) * 0.25, yCoord + 1.5, zCoord + 0.5 + (Math.random() - 0.5) * 0.25, color[0], color[1], color[2], (float) Math.random() / 8F, (float) movementVector.x, (float) movementVector.y, (float) movementVector.z); + Botania.proxy.wispFX(pos.getX() + 0.5 + (Math.random() - 0.5) * 0.25, pos.getY() - 0.5, pos.getZ() + 0.5 + (Math.random() - 0.5) * 0.25, r / 255F, g / 255F, b / 255F, (float) Math.random() / 3F, -0.04F); + Botania.proxy.wispFX(pos.getX() + 0.5 + (Math.random() - 0.5) * 0.125, pos.getY() + 1.5, pos.getZ() + 0.5 + (Math.random() - 0.5) * 0.125, r / 255F, g / 255F, b / 255F, (float) Math.random() / 5F, -0.001F); + Botania.proxy.wispFX(pos.getX() + 0.5 + (Math.random() - 0.5) * 0.25, pos.getY() + 1.5, pos.getZ() + 0.5 + (Math.random() - 0.5) * 0.25, r / 255F, g / 255F, b / 255F, (float) Math.random() / 8F, (float) movementVector.x, (float) movementVector.y, (float) movementVector.z); } } } if(worldObj.rand.nextBoolean() && worldObj.isRemote) - Botania.proxy.sparkleFX(worldObj, xCoord + Math.random(), yCoord + Math.random() * 1.5, zCoord + Math.random(), meta == 2 ? 1F : 0.5F, meta == 1 ? 1F : 0.5F, meta == 1 ? 0.5F : 1F, (float) Math.random(), 2); + Botania.proxy.sparkleFX(pos.getX() + Math.random(), pos.getY() + Math.random() * 1.5, pos.getZ() + Math.random(), variant == PylonVariant.GAIA ? 1F : 0.5F, variant == PylonVariant.NATURA ? 1F : 0.5F, variant == PylonVariant.NATURA ? 0.5F : 1F, (float) Math.random(), 2); } private Block getBlockForMeta() { - return getBlockMetadata() == 0 ? ModBlocks.enchanter : ModBlocks.alfPortal; + return worldObj.getBlockState(pos).getValue(BotaniaStateProps.PYLON_VARIANT) == PylonVariant.MANA ? ModBlocks.enchanter : ModBlocks.alfPortal; + } + + private boolean portalOff() { + return worldObj.getBlockState(centerPos).getBlock() != ModBlocks.alfPortal + || worldObj.getBlockState(centerPos).getValue(BotaniaStateProps.ALFPORTAL_STATE) == AlfPortalState.OFF; } } \ No newline at end of file diff --git a/src/main/java/vazkii/botania/common/block/tile/TileRuneAltar.java b/src/main/java/vazkii/botania/common/block/tile/TileRuneAltar.java index 0ac4be2be..27d27fc2a 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileRuneAltar.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileRuneAltar.java @@ -10,37 +10,37 @@ */ package vazkii.botania.common.block.tile; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.resources.I18n; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.StatCollector; - +import net.minecraft.util.EnumHand; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.AxisAlignedBB; import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.internal.VanillaPacketDispatcher; import vazkii.botania.api.mana.IManaReceiver; import vazkii.botania.api.recipe.RecipeRuneAltar; +import vazkii.botania.api.sound.BotaniaSoundEvents; import vazkii.botania.client.core.handler.HUDHandler; import vazkii.botania.client.core.helper.RenderHelper; import vazkii.botania.common.Botania; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.core.helper.Vector3; import vazkii.botania.common.item.ModItems; -import vazkii.botania.common.lib.LibBlockNames; -public class TileRuneAltar extends TileSimpleInventory implements ISidedInventory, IManaReceiver { +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.util.ArrayList; +import java.util.List; + +public class TileRuneAltar extends TileSimpleInventory implements IManaReceiver { private static final String TAG_MANA = "mana"; private static final String TAG_MANA_TO_GET = "manaToGet"; @@ -55,7 +55,7 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor List lastRecipe = null; int recipeKeepTicks = 0; - public boolean addItem(EntityPlayer player, ItemStack stack) { + public boolean addItem(@Nullable EntityPlayer player, ItemStack stack, @Nullable EnumHand hand) { if(cooldown > 0 || stack.getItem() == ModItems.twigWand || stack.getItem() == ModItems.lexicon) return false; @@ -63,11 +63,11 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor if(player == null || !player.capabilities.isCreativeMode) { stack.stackSize--; if(stack.stackSize == 0 && player != null) - player.inventory.setInventorySlotContents(player.inventory.currentItem, null); + player.setHeldItem(hand, null); } - EntityItem item = new EntityItem(worldObj, xCoord + 0.5, yCoord + 1, zCoord + 0.5, new ItemStack(ModBlocks.livingrock)); - item.delayBeforeCanPickup = 40; + EntityItem item = new EntityItem(worldObj, getPos().getX() + 0.5, getPos().getY() + 1, getPos().getZ() + 0.5, new ItemStack(ModBlocks.livingrock)); + item.setPickupDelay(40); item.motionX = item.motionY = item.motionZ = 0; if(!worldObj.isRemote) worldObj.spawnEntityInWorld(item); @@ -81,11 +81,11 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor boolean did = false; for(int i = 0; i < getSizeInventory(); i++) - if(getStackInSlot(i) == null) { + if(itemHandler.getStackInSlot(i) == null) { did = true; ItemStack stackToAdd = stack.copy(); stackToAdd.stackSize = 1; - setInventorySlotContents(i, stackToAdd); + itemHandler.setStackInSlot(i, stackToAdd); if(player == null || !player.capabilities.isCreativeMode) { stack.stackSize--; @@ -97,24 +97,23 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor } if(did) - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, xCoord, yCoord, zCoord); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos); return true; } @Override - public void updateEntity() { - super.updateEntity(); + public void update() { // Update every tick. recieveMana(0); if(!worldObj.isRemote && manaToGet == 0) { - List items = worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1)); + List items = worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos, pos.add(1, 1, 1))); for(EntityItem item : items) if(!item.isDead && item.getEntityItem() != null && item.getEntityItem().getItem() != Item.getItemFromBlock(ModBlocks.livingrock)) { ItemStack stack = item.getEntityItem(); - if(addItem(null, stack) && stack.stackSize == 0) + if(addItem(null, stack, null) && stack.stackSize == 0) item.setDead(); } } @@ -123,14 +122,14 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor if(worldObj.isRemote && manaToGet > 0 && mana >= manaToGet) { if(worldObj.rand.nextInt(20) == 0) { Vector3 vec = Vector3.fromTileEntityCenter(this); - Vector3 endVec = vec.copy().add(0, 2.5, 0); - Botania.proxy.lightningFX(worldObj, vec, endVec, 2F, 0x00948B, 0x00E4D7); + Vector3 endVec = vec.add(0, 2.5, 0); + Botania.proxy.lightningFX(vec, endVec, 2F, 0x00948B, 0x00E4D7); } } if(cooldown > 0) { cooldown--; - Botania.proxy.wispFX(getWorldObj(), xCoord + Math.random(), yCoord + 0.8, zCoord + Math.random(), 0.2F, 0.2F, 0.2F, 0.2F, -0.025F); + Botania.proxy.wispFX(pos.getX() + Math.random(), pos.getY() + 0.8, pos.getZ() + Math.random(), 0.2F, 0.2F, 0.2F, 0.2F, -0.025F); } int newSignal = 0; @@ -142,7 +141,7 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor if(newSignal != signal) { signal = newSignal; - worldObj.func_147453_f(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord)); + worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock()); } if(recipeKeepTicks > 0) @@ -160,7 +159,7 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor this.manaToGet = currentRecipe.getManaUsage(); else { for(RecipeRuneAltar recipe : BotaniaAPI.runeAltarRecipes) - if(recipe.matches(this)) { + if(recipe.matches(itemHandler)) { this.manaToGet = recipe.getManaUsage(); break getMana; } @@ -169,15 +168,15 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor } if(manaToGet != this.manaToGet) { - worldObj.playSoundEffect(xCoord, yCoord, zCoord, "botania:runeAltarStart", 1F, 1F); - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, xCoord, yCoord, zCoord); + worldObj.playSound(null, pos, BotaniaSoundEvents.runeAltarStart, SoundCategory.BLOCKS, 1, 1); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos); } } public void saveLastRecipe() { - lastRecipe = new ArrayList(); + lastRecipe = new ArrayList<>(); for(int i = 0; i < getSizeInventory(); i++) { - ItemStack stack = getStackInSlot(i); + ItemStack stack = itemHandler.getStackInSlot(i); if(stack == null) break; lastRecipe.add(stack.copy()); @@ -186,14 +185,14 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor } public void trySetLastRecipe(EntityPlayer player) { - TileAltar.tryToSetLastRecipe(player, this, lastRecipe); + TileAltar.tryToSetLastRecipe(player, itemHandler, lastRecipe); if(!isEmpty()) - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, xCoord, yCoord, zCoord); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos); } public boolean hasValidRecipe() { for(RecipeRuneAltar recipe : BotaniaAPI.runeAltarRecipes) - if(recipe.matches(this)) + if(recipe.matches(itemHandler)) return true; return false; @@ -205,14 +204,14 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor if(currentRecipe != null) recipe = currentRecipe; else for(RecipeRuneAltar recipe_ : BotaniaAPI.runeAltarRecipes) { - if(recipe_.matches(this)) { + if(recipe_.matches(itemHandler)) { recipe = recipe_; break; } } if(manaToGet > 0 && mana >= manaToGet) { - List items = worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1)); + List items = worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos, pos.add(1, 1, 1))); EntityItem livingrock = null; for(EntityItem item : items) if(!item.isDead && item.getEntityItem() != null && item.getEntityItem().getItem() == Item.getItemFromBlock(ModBlocks.livingrock)) { @@ -225,7 +224,7 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor recieveMana(-mana); if(!worldObj.isRemote) { ItemStack output = recipe.getOutput().copy(); - EntityItem outputItem = new EntityItem(worldObj, xCoord + 0.5, yCoord + 1.5, zCoord + 0.5, output); + EntityItem outputItem = new EntityItem(worldObj, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, output); worldObj.spawnEntityInWorld(outputItem); currentRecipe = null; cooldown = 60; @@ -234,14 +233,14 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor saveLastRecipe(); if(!worldObj.isRemote) { for(int i = 0; i < getSizeInventory(); i++) { - ItemStack stack = getStackInSlot(i); + ItemStack stack = itemHandler.getStackInSlot(i); if(stack != null) { if(stack.getItem() == ModItems.rune && (player == null || !player.capabilities.isCreativeMode)) { - EntityItem outputItem = new EntityItem(worldObj, xCoord + 0.5, yCoord + 1.5, zCoord + 0.5, stack.copy()); + EntityItem outputItem = new EntityItem(worldObj, getPos().getX() + 0.5, getPos().getY() + 1.5, getPos().getZ() + 0.5, stack.copy()); worldObj.spawnEntityInWorld(outputItem); } - setInventorySlotContents(i, null); + itemHandler.setStackInSlot(i, null); } } @@ -257,34 +256,34 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor } public void craftingFanciness() { - worldObj.playSoundEffect(xCoord, yCoord, zCoord, "botania:runeAltarCraft", 1F, 1F); + worldObj.playSound(null, pos, BotaniaSoundEvents.runeAltarCraft, SoundCategory.BLOCKS, 1, 1); for(int i = 0; i < 25; i++) { float red = (float) Math.random(); float green = (float) Math.random(); float blue = (float) Math.random(); - Botania.proxy.sparkleFX(worldObj, xCoord + 0.5 + Math.random() * 0.4 - 0.2, yCoord + 1, zCoord + 0.5 + Math.random() * 0.4 - 0.2, red, green, blue, (float) Math.random(), 10); + Botania.proxy.sparkleFX(pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, red, green, blue, (float) Math.random(), 10); } } public boolean isEmpty() { for(int i = 0; i < getSizeInventory(); i++) - if(getStackInSlot(i) != null) + if(itemHandler.getStackInSlot(i) != null) return false; return true; } @Override - public void writeCustomNBT(NBTTagCompound par1nbtTagCompound) { - super.writeCustomNBT(par1nbtTagCompound); + public void writePacketNBT(NBTTagCompound par1nbtTagCompound) { + super.writePacketNBT(par1nbtTagCompound); par1nbtTagCompound.setInteger(TAG_MANA, mana); par1nbtTagCompound.setInteger(TAG_MANA_TO_GET, manaToGet); } @Override - public void readCustomNBT(NBTTagCompound par1nbtTagCompound) { - super.readCustomNBT(par1nbtTagCompound); + public void readPacketNBT(NBTTagCompound par1nbtTagCompound) { + super.readPacketNBT(par1nbtTagCompound); mana = par1nbtTagCompound.getInteger(TAG_MANA); manaToGet = par1nbtTagCompound.getInteger(TAG_MANA_TO_GET); @@ -295,39 +294,20 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor return 16; } + @Nonnull @Override public AxisAlignedBB getRenderBoundingBox() { return INFINITE_EXTENT_AABB; } @Override - public String getInventoryName() { - return LibBlockNames.RUNE_ALTAR; - } - - @Override - public int getInventoryStackLimit() { - return 1; - } - - @Override - public int[] getAccessibleSlotsFromSide(int var1) { - int accessibleSlot = -1; - for(int i = 0; i < getSizeInventory(); i++) - if(getStackInSlot(i) != null) - accessibleSlot = i; - - return accessibleSlot == -1 ? new int[0] : new int[] { accessibleSlot }; - } - - @Override - public boolean canInsertItem(int i, ItemStack itemstack, int j) { - return true; - } - - @Override - public boolean canExtractItem(int i, ItemStack itemstack, int j) { - return mana == 0; + protected SimpleItemStackHandler createItemHandler() { + return new SimpleItemStackHandler(this, false) { + @Override + protected int getStackLimit(int slot, ItemStack stack) { + return 1; + } + }; } @Override @@ -358,7 +338,7 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor int radius = 24; int amt = 0; for(int i = 0; i < getSizeInventory(); i++) { - if(getStackInSlot(i) == null) + if(itemHandler.getStackInSlot(i) == null) break; amt++; } @@ -366,49 +346,49 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor if(amt > 0) { float anglePer = 360F / amt; for(RecipeRuneAltar recipe : BotaniaAPI.runeAltarRecipes) - if(recipe.matches(this)) { - GL11.glEnable(GL11.GL_BLEND); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if(recipe.matches(itemHandler)) { + GlStateManager.enableBlend(); + GlStateManager.enableRescaleNormal(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); recipe.getOutput(); float progress = (float) mana / (float) manaToGet; mc.renderEngine.bindTexture(HUDHandler.manaBar); - GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.color(1F, 1F, 1F, 1F); RenderHelper.drawTexturedModalRect(xc + radius + 9, yc - 8, 0, progress == 1F ? 0 : 22, 8, 22, 15); net.minecraft.client.renderer.RenderHelper.enableGUIStandardItemLighting(); if(progress == 1F) { - RenderItem.getInstance().renderItemIntoGUI(mc.fontRenderer, mc.renderEngine, new ItemStack(ModBlocks.livingrock), xc + radius + 16, yc + 8); - GL11.glTranslatef(0F, 0F, 100F); - RenderItem.getInstance().renderItemIntoGUI(mc.fontRenderer, mc.renderEngine, new ItemStack(ModItems.twigWand), xc + radius + 24, yc + 8); - GL11.glTranslatef(0F, 0F, -100F); + mc.getRenderItem().renderItemIntoGUI(new ItemStack(ModBlocks.livingrock), xc + radius + 16, yc + 8); + GlStateManager.translate(0F, 0F, 100F); + mc.getRenderItem().renderItemIntoGUI(new ItemStack(ModItems.twigWand), xc + radius + 24, yc + 8); + GlStateManager.translate(0F, 0F, -100F); } RenderHelper.renderProgressPie(xc + radius + 32, yc - 8, progress, recipe.getOutput()); net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting(); if(progress == 1F) - mc.fontRenderer.drawStringWithShadow("+", xc + radius + 14, yc + 12, 0xFFFFFF); + mc.fontRendererObj.drawStringWithShadow("+", xc + radius + 14, yc + 12, 0xFFFFFF); } net.minecraft.client.renderer.RenderHelper.enableGUIStandardItemLighting(); for(int i = 0; i < amt; i++) { double xPos = xc + Math.cos(angle * Math.PI / 180D) * radius - 8; double yPos = yc + Math.sin(angle * Math.PI / 180D) * radius - 8; - GL11.glTranslated(xPos, yPos, 0); - RenderItem.getInstance().renderItemIntoGUI(mc.fontRenderer, mc.renderEngine, getStackInSlot(i), 0, 0); - GL11.glTranslated(-xPos, -yPos, 0); + GlStateManager.translate(xPos, yPos, 0); + mc.getRenderItem().renderItemIntoGUI(itemHandler.getStackInSlot(i), 0, 0); + GlStateManager.translate(-xPos, -yPos, 0); angle += anglePer; } net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting(); } else if(recipeKeepTicks > 0) { - String s = StatCollector.translateToLocal("botaniamisc.altarRefill0"); - mc.fontRenderer.drawStringWithShadow(s, xc - mc.fontRenderer.getStringWidth(s) / 2, yc + 10, 0xFFFFFF); - s = StatCollector.translateToLocal("botaniamisc.altarRefill1"); - mc.fontRenderer.drawStringWithShadow(s, xc - mc.fontRenderer.getStringWidth(s) / 2, yc + 20, 0xFFFFFF); + String s = I18n.format("botaniamisc.altarRefill0"); + mc.fontRendererObj.drawStringWithShadow(s, xc - mc.fontRendererObj.getStringWidth(s) / 2, yc + 10, 0xFFFFFF); + s = I18n.format("botaniamisc.altarRefill1"); + mc.fontRendererObj.drawStringWithShadow(s, xc - mc.fontRendererObj.getStringWidth(s) / 2, yc + 20, 0xFFFFFF); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileSimpleInventory.java b/src/main/java/vazkii/botania/common/block/tile/TileSimpleInventory.java index 15a9f4144..715ad134d 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileSimpleInventory.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileSimpleInventory.java @@ -10,106 +10,84 @@ */ package vazkii.botania.common.block.tile; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.EnumFacing; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.items.CapabilityItemHandler; +import net.minecraftforge.items.IItemHandlerModifiable; +import net.minecraftforge.items.ItemStackHandler; -public abstract class TileSimpleInventory extends TileMod implements IInventory { +import javax.annotation.Nonnull; - ItemStack[] inventorySlots = new ItemStack[getSizeInventory()]; +public abstract class TileSimpleInventory extends TileMod { + + protected SimpleItemStackHandler itemHandler = createItemHandler(); @Override - public void readCustomNBT(NBTTagCompound par1NBTTagCompound) { - NBTTagList var2 = par1NBTTagCompound.getTagList("Items", 10); - inventorySlots = new ItemStack[getSizeInventory()]; - for (int var3 = 0; var3 < var2.tagCount(); ++var3) { - NBTTagCompound var4 = var2.getCompoundTagAt(var3); - byte var5 = var4.getByte("Slot"); - if (var5 >= 0 && var5 < inventorySlots.length) - inventorySlots[var5] = ItemStack.loadItemStackFromNBT(var4); - } + public void readPacketNBT(NBTTagCompound par1NBTTagCompound) { + itemHandler = createItemHandler(); + itemHandler.deserializeNBT(par1NBTTagCompound); } @Override - public void writeCustomNBT(NBTTagCompound par1NBTTagCompound) { - NBTTagList var2 = new NBTTagList(); - for (int var3 = 0; var3 < inventorySlots.length; ++var3) { - if (inventorySlots[var3] != null) { - NBTTagCompound var4 = new NBTTagCompound(); - var4.setByte("Slot", (byte)var3); - inventorySlots[var3].writeToNBT(var4); - var2.appendTag(var4); - } - } - par1NBTTagCompound.setTag("Items", var2); + public void writePacketNBT(NBTTagCompound par1NBTTagCompound) { + par1NBTTagCompound.merge(itemHandler.serializeNBT()); + } + + public abstract int getSizeInventory(); + + protected SimpleItemStackHandler createItemHandler() { + return new SimpleItemStackHandler(this, true); + } + + public IItemHandlerModifiable getItemHandler() { + return itemHandler; } @Override - public ItemStack getStackInSlot(int i) { - return inventorySlots[i]; + public boolean hasCapability(@Nonnull Capability cap, @Nonnull EnumFacing side) { + return cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY || super.hasCapability(cap, side); } + @Nonnull @Override - public ItemStack decrStackSize(int i, int j) { - if (inventorySlots[i] != null) { - ItemStack stackAt; + public T getCapability(@Nonnull Capability cap, @Nonnull EnumFacing side) { + if(cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) + return CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.cast(itemHandler); + return super.getCapability(cap, side); + } - if (inventorySlots[i].stackSize <= j) { - stackAt = inventorySlots[i]; - inventorySlots[i] = null; - return stackAt; - } else { - stackAt = inventorySlots[i].splitStack(j); + /* Extension of ItemStackHandler that uses our own slot array, allows for control of writing, + allows control over stack limits, and allows for itemstack-slot validation */ + protected static class SimpleItemStackHandler extends ItemStackHandler { - if (inventorySlots[i].stackSize == 0) - inventorySlots[i] = null; + private final boolean allowWrite; + private final TileSimpleInventory tile; - return stackAt; - } + public SimpleItemStackHandler(TileSimpleInventory inv, boolean allowWrite) { + super(inv.getSizeInventory()); + this.allowWrite = allowWrite; + this.tile = inv; } - return null; - } + @Override + public ItemStack insertItem(int slot, ItemStack stack, boolean simulate) { + if(allowWrite) { + return super.insertItem(slot, stack, simulate); + } else return stack; + } - @Override - public ItemStack getStackInSlotOnClosing(int i) { - return getStackInSlot(i); - } + @Override + public ItemStack extractItem(int slot, int amount, boolean simulate) { + if(allowWrite) { + return super.extractItem(slot, amount, simulate); + } else return null; + } - @Override - public void setInventorySlotContents(int i, ItemStack itemstack) { - inventorySlots[i] = itemstack; - } - - @Override - public int getInventoryStackLimit() { - return 64; - } - - @Override - public boolean isUseableByPlayer(EntityPlayer entityplayer) { - return worldObj.getTileEntity(xCoord, yCoord, zCoord) != this ? false : entityplayer.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <= 64; - } - - @Override - public boolean isItemValidForSlot(int i, ItemStack itemstack) { - return true; - } - - @Override - public boolean hasCustomInventoryName() { - return false; - } - - @Override - public void openInventory() { - // NO-OP - } - - @Override - public void closeInventory() { - // NO-OP + @Override + public void onContentsChanged(int slot) { + tile.markDirty(); + } } } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileSparkChanger.java b/src/main/java/vazkii/botania/common/block/tile/TileSparkChanger.java index 8b37e9c67..8f5954c67 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileSparkChanger.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileSparkChanger.java @@ -10,19 +10,18 @@ */ package vazkii.botania.common.block.tile; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.util.EnumFacing; import vazkii.botania.api.internal.VanillaPacketDispatcher; import vazkii.botania.api.mana.spark.ISparkAttachable; import vazkii.botania.api.mana.spark.ISparkEntity; +import vazkii.botania.api.mana.spark.SparkUpgradeType; import vazkii.botania.common.item.ModItems; -import vazkii.botania.common.lib.LibBlockNames; -import vazkii.botania.common.lib.LibMisc; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; public class TileSparkChanger extends TileSimpleInventory { @@ -30,16 +29,16 @@ public class TileSparkChanger extends TileSimpleInventory { if(worldObj.isRemote) return; - ItemStack changeStack = getStackInSlot(0); - List attachables = new ArrayList(); - for(ForgeDirection dir : LibMisc.CARDINAL_DIRECTIONS) { - TileEntity tile = worldObj.getTileEntity(xCoord + dir.offsetX, yCoord, zCoord + dir.offsetZ); + ItemStack changeStack = itemHandler.getStackInSlot(0); + List attachables = new ArrayList<>(); + for(EnumFacing dir : EnumFacing.HORIZONTALS) { + TileEntity tile = worldObj.getTileEntity(pos.offset(dir)); if(tile != null && tile instanceof ISparkAttachable) { ISparkAttachable attach = (ISparkAttachable) tile; ISparkEntity spark = attach.getAttachedSpark(); if(spark != null) { - int upg = spark.getUpgrade(); - int newUpg = changeStack == null ? 0 : changeStack.getItemDamage() + 1; + SparkUpgradeType upg = spark.getUpgrade(); + SparkUpgradeType newUpg = changeStack == null ? SparkUpgradeType.NONE : SparkUpgradeType.values()[changeStack.getItemDamage() + 1]; if(upg != newUpg) attachables.add(attach); } @@ -49,15 +48,15 @@ public class TileSparkChanger extends TileSimpleInventory { if(attachables.size() > 0) { ISparkAttachable attach = attachables.get(worldObj.rand.nextInt(attachables.size())); ISparkEntity spark = attach.getAttachedSpark(); - int upg = spark.getUpgrade(); - ItemStack sparkStack = upg == 0 ? null : new ItemStack(ModItems.sparkUpgrade, 1, upg - 1); - int newUpg = changeStack == null ? 0 : changeStack.getItemDamage() + 1; + SparkUpgradeType upg = spark.getUpgrade(); + ItemStack sparkStack = upg == SparkUpgradeType.NONE ? null : new ItemStack(ModItems.sparkUpgrade, 1, upg.ordinal() - 1); + SparkUpgradeType newUpg = changeStack == null ? SparkUpgradeType.NONE : SparkUpgradeType.values()[changeStack.getItemDamage() + 1]; spark.setUpgrade(newUpg); Collection transfers = spark.getTransfers(); if(transfers != null) transfers.clear(); - setInventorySlotContents(0, sparkStack); - worldObj.func_147453_f(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord)); + itemHandler.setStackInSlot(0, sparkStack); + worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock()); markDirty(); } } @@ -68,13 +67,20 @@ public class TileSparkChanger extends TileSimpleInventory { } @Override - public boolean isItemValidForSlot(int i, ItemStack itemstack) { - return itemstack != null && itemstack.getItem() == ModItems.sparkUpgrade; - } + protected SimpleItemStackHandler createItemHandler() { + return new SimpleItemStackHandler(this, true) { + @Override + protected int getStackLimit(int slot, ItemStack stack) { + return 1; + } - @Override - public int getInventoryStackLimit() { - return 1; + @Override + public ItemStack insertItem(int slot, ItemStack stack, boolean simulate) { + if(stack != null && stack.getItem() == ModItems.sparkUpgrade) + return super.insertItem(slot, stack, simulate); + else return stack; + } + }; } @Override @@ -83,9 +89,4 @@ public class TileSparkChanger extends TileSimpleInventory { VanillaPacketDispatcher.dispatchTEToNearbyPlayers(this); } - @Override - public String getInventoryName() { - return LibBlockNames.SPARK_CHANGER; - } - } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileSpawnerClaw.java b/src/main/java/vazkii/botania/common/block/tile/TileSpawnerClaw.java index 81e97bb4e..f30d31e19 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileSpawnerClaw.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileSpawnerClaw.java @@ -2,29 +2,32 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + * * Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php - * + * * File Created @ [Jul 23, 2014, 5:32:11 PM (GMT)] */ package vazkii.botania.common.block.tile; -import java.util.List; - import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; import net.minecraft.entity.EntityLiving; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.MobSpawnerBaseLogic; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityMobSpawner; -import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.WeightedRandom; +import net.minecraft.util.WeightedSpawnerEntity; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.chunk.storage.AnvilChunkLoader; import vazkii.botania.api.mana.IManaReceiver; import vazkii.botania.common.Botania; -import vazkii.botania.common.lib.LibObfuscation; -import cpw.mods.fml.relauncher.ReflectionHelper; +import vazkii.botania.common.core.handler.MethodHandles; + +import java.util.List; public class TileSpawnerClaw extends TileMod implements IManaReceiver { @@ -33,101 +36,131 @@ public class TileSpawnerClaw extends TileMod implements IManaReceiver { int mana = 0; @Override - public void updateEntity() { - TileEntity tileBelow = worldObj.getTileEntity(xCoord, yCoord - 1, zCoord); + public void update() { + TileEntity tileBelow = worldObj.getTileEntity(pos.down()); if(mana >= 5 && tileBelow instanceof TileEntityMobSpawner) { TileEntityMobSpawner spawner = (TileEntityMobSpawner) tileBelow; - MobSpawnerBaseLogic logic = spawner.func_145881_a(); + MobSpawnerBaseLogic logic = spawner.getSpawnerBaseLogic(); - if(!logic.isActivated()) { - if(!worldObj.isRemote) - mana -= 6; + try { + // Directly drawn from MobSpawnerBaseLogic, with inverted isActivated check and mana consumption + if(!((boolean) MethodHandles.isActivated.invokeExact(logic))) { + if(!worldObj.isRemote) + mana -= 6; - if(logic.getSpawnerWorld().isRemote) { - if(logic.spawnDelay > 0) - --logic.spawnDelay; + if(logic.getSpawnerWorld().isRemote) { + int delay = ((int) MethodHandles.spawnDelay_getter.invokeExact(logic)); + if(delay > 0) + MethodHandles.spawnDelay_setter.invokeExact(logic, delay - 1); - if(Math.random() > 0.5) - Botania.proxy.wispFX(worldObj, xCoord + 0.3 + Math.random() * 0.5, yCoord - 0.3 + Math.random() * 0.25, zCoord + Math.random(), 0.6F - (float) Math.random() * 0.3F, 0.1F, 0.6F - (float) Math.random() * 0.3F, (float) Math.random() / 3F, -0.025F - 0.005F * (float) Math.random(), 2F); + if(Math.random() > 0.5) + Botania.proxy.wispFX(getPos().getX() + 0.3 + Math.random() * 0.5, getPos().getY() - 0.3 + Math.random() * 0.25, getPos().getZ() + Math.random(), 0.6F - (float) Math.random() * 0.3F, 0.1F, 0.6F - (float) Math.random() * 0.3F, (float) Math.random() / 3F, -0.025F - 0.005F * (float) Math.random(), 2F); - logic.field_98284_d = logic.field_98287_c; - logic.field_98287_c = (logic.field_98287_c + 1000.0F / (logic.spawnDelay + 200.0F)) % 360.0D; - } else if(logic.spawnDelay == -1) - resetTimer(logic); + MethodHandles.prevMobRotation_setter.invokeExact(logic, logic.getMobRotation()); + MethodHandles.mobRotation_setter.invokeExact(logic, (logic.getMobRotation() + 1000.0F / (((int) MethodHandles.spawnDelay_getter.invokeExact(logic)) + 200.0F)) % 360.0D); + } else { + if(((int) MethodHandles.spawnDelay_getter.invokeExact(logic)) == -1) + resetTimer(logic); + int delay = ((int) MethodHandles.spawnDelay_getter.invokeExact(logic)); + if(delay > 0) { + MethodHandles.spawnDelay_setter.invokeExact(logic, delay - 1); + return; + } - if(logic.spawnDelay > 0) { - --logic.spawnDelay; - return; - } + if(logic.getSpawnerWorld().isRemote) + return; - boolean flag = false; + boolean flag = false; - int spawnCount = ReflectionHelper.getPrivateValue(MobSpawnerBaseLogic.class, logic, LibObfuscation.SPAWN_COUNT); - int spawnRange = ReflectionHelper.getPrivateValue(MobSpawnerBaseLogic.class, logic, LibObfuscation.SPAWN_RANGE); - int maxNearbyEntities = ReflectionHelper.getPrivateValue(MobSpawnerBaseLogic.class, logic, LibObfuscation.MAX_NEARBY_ENTITIES); + int spawnCount = ((int) MethodHandles.spawnCount_getter.invokeExact(logic)); + int spawnRange = ((int) MethodHandles.spawnRange_getter.invokeExact(logic)); + int maxNearbyEntities = ((int) MethodHandles.maxNearbyEntities_getter.invokeExact(logic)); + WeightedSpawnerEntity randomEntity = ((WeightedSpawnerEntity) MethodHandles.randomEntity_getter.invokeExact(logic)); - for(int i = 0; i < spawnCount; ++i) { - Entity entity = EntityList.createEntityByName(logic.getEntityNameToSpawn(), logic.getSpawnerWorld()); + BlockPos blockpos = logic.getSpawnerPosition(); + for(int i = 0; i < spawnCount; ++i) { + NBTTagCompound nbttagcompound = randomEntity.getNbt(); + NBTTagList nbttaglist = nbttagcompound.getTagList("Pos", 6); + World world = logic.getSpawnerWorld(); + int j = nbttaglist.tagCount(); + double d0 = j >= 1 ? nbttaglist.getDoubleAt(0) : (double)blockpos.getX() + (world.rand.nextDouble() - world.rand.nextDouble()) * (double)spawnRange + 0.5D; + double d1 = j >= 2 ? nbttaglist.getDoubleAt(1) : (double)(blockpos.getY() + world.rand.nextInt(3) - 1); + double d2 = j >= 3 ? nbttaglist.getDoubleAt(2) : (double)blockpos.getZ() + (world.rand.nextDouble() - world.rand.nextDouble()) * (double)spawnRange + 0.5D; + Entity entity = AnvilChunkLoader.readWorldEntityPos(nbttagcompound, world, d0, d1, d2, false); - if (entity == null) - return; + if (entity == null) + { + return; + } - int j = logic.getSpawnerWorld().getEntitiesWithinAABB(entity.getClass(), AxisAlignedBB.getBoundingBox(logic.getSpawnerX(), logic.getSpawnerY(), logic.getSpawnerZ(), logic.getSpawnerX() + 1, logic.getSpawnerY() + 1, logic.getSpawnerZ() + 1).expand(spawnRange * 2, 4.0D, spawnRange * 2)).size(); + int k = world.getEntitiesWithinAABB(entity.getClass(), (new AxisAlignedBB((double)blockpos.getX(), (double)blockpos.getY(), (double)blockpos.getZ(), (double)(blockpos.getX() + 1), (double)(blockpos.getY() + 1), (double)(blockpos.getZ() + 1))).expandXyz((double)spawnRange)).size(); - if (j >= maxNearbyEntities) { - resetTimer(logic); - return; + if (k >= maxNearbyEntities) + { + this.resetTimer(logic); + return; + } + + EntityLiving entityliving = entity instanceof EntityLiving ? (EntityLiving)entity : null; + entity.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, world.rand.nextFloat() * 360.0F, 0.0F); + + if (entityliving == null || entityliving.getCanSpawnHere()) + { + if (randomEntity.getNbt().getSize() == 1 && randomEntity.getNbt().hasKey("id", 8) && entity instanceof EntityLiving) + { + ((EntityLiving)entity).onInitialSpawn(world.getDifficultyForLocation(new BlockPos(entity)), null); + } + + AnvilChunkLoader.spawnEntity(entity, world); + world.playEvent(2004, blockpos, 0); + + if (entityliving != null) + { + entityliving.spawnExplosionParticle(); + } + + flag = true; + } + } + + if (flag) + resetTimer(logic); } - double d2 = logic.getSpawnerX() + (logic.getSpawnerWorld().rand.nextDouble() - logic.getSpawnerWorld().rand.nextDouble()) * spawnRange; - double d3 = logic.getSpawnerY() + logic.getSpawnerWorld().rand.nextInt(3) - 1; - double d4 = logic.getSpawnerZ() + (logic.getSpawnerWorld().rand.nextDouble() - logic.getSpawnerWorld().rand.nextDouble()) * spawnRange; - EntityLiving entityliving = entity instanceof EntityLiving ? (EntityLiving)entity : null; - entity.setLocationAndAngles(d2, d3, d4, logic.getSpawnerWorld().rand.nextFloat() * 360.0F, 0.0F); - if(entityliving == null || entityliving.getCanSpawnHere()) { - if(!worldObj.isRemote) - logic.func_98265_a(entity); - logic.getSpawnerWorld().playAuxSFX(2004, logic.getSpawnerX(), logic.getSpawnerY(), logic.getSpawnerZ(), 0); - - if (entityliving != null) - entityliving.spawnExplosionParticle(); - - flag = true; - } - } - - if (flag) - resetTimer(logic); + } + } catch (Throwable t) { + t.printStackTrace(); } } } - private void resetTimer(MobSpawnerBaseLogic logic) { - int maxSpawnDelay = ReflectionHelper.getPrivateValue(MobSpawnerBaseLogic.class, logic, LibObfuscation.MAX_SPAWN_DELAY); - int minSpawnDelay = ReflectionHelper.getPrivateValue(MobSpawnerBaseLogic.class, logic, LibObfuscation.MIN_SPAWN_DELAY); - List potentialEntitySpawns = ReflectionHelper.getPrivateValue(MobSpawnerBaseLogic.class, logic, LibObfuscation.POTENTIAL_ENTITY_SPAWNS); + // Direct copy of MobSpawnerBaseLogic.resetTimer() + private void resetTimer(MobSpawnerBaseLogic logic) throws Throwable { + int maxSpawnDelay = ((int) MethodHandles.maxSpawnDelay_getter.invokeExact(logic)); + int minSpawnDelay = ((int) MethodHandles.minSpawnDelay_getter.invokeExact(logic)); + List potentialEntitySpawns = ((List) MethodHandles.potentialSpawns_getter.invokeExact(logic)); if(maxSpawnDelay <= minSpawnDelay) - logic.spawnDelay = minSpawnDelay; + MethodHandles.spawnDelay_setter.invokeExact(logic, minSpawnDelay); else { int i = maxSpawnDelay - minSpawnDelay; - logic.spawnDelay = minSpawnDelay + logic.getSpawnerWorld().rand.nextInt(i); + MethodHandles.spawnDelay_setter.invokeExact(logic, minSpawnDelay + logic.getSpawnerWorld().rand.nextInt(i)); } if(potentialEntitySpawns != null && potentialEntitySpawns.size() > 0) - logic.setRandomEntity((MobSpawnerBaseLogic.WeightedRandomMinecart)WeightedRandom.getRandomItem(logic.getSpawnerWorld().rand, potentialEntitySpawns)); + logic.setNextSpawnData((WeightedSpawnerEntity)WeightedRandom.getRandomItem(logic.getSpawnerWorld().rand, potentialEntitySpawns)); - logic.func_98267_a(1); + logic.broadcastEvent(1); } @Override - public void writeCustomNBT(NBTTagCompound cmp) { + public void writePacketNBT(NBTTagCompound cmp) { cmp.setInteger(TAG_MANA, mana); } @Override - public void readCustomNBT(NBTTagCompound cmp) { + public void readPacketNBT(NBTTagCompound cmp) { mana = cmp.getInteger(TAG_MANA); } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileSpecialFlower.java b/src/main/java/vazkii/botania/common/block/tile/TileSpecialFlower.java index 34dbfb26f..893b8aba7 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileSpecialFlower.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileSpecialFlower.java @@ -10,9 +10,9 @@ */ package vazkii.botania.common.block.tile; -import java.util.ArrayList; - import net.minecraft.block.Block; +import net.minecraft.block.BlockDirt; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.entity.EntityLivingBase; @@ -21,9 +21,12 @@ import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.subtile.ISubTileSlowableContainer; @@ -32,13 +35,15 @@ import vazkii.botania.api.wand.IWandBindable; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.tile.string.TileRedStringRelay; +import java.util.List; + public class TileSpecialFlower extends TileMod implements IWandBindable, ISubTileSlowableContainer { private static final String TAG_SUBTILE_NAME = "subTileName"; private static final String TAG_SUBTILE_CMP = "subTileCmp"; public String subTileName = ""; - SubTileEntity subTile; + private SubTileEntity subTile; @Override public SubTileEntity getSubTile() { @@ -69,22 +74,16 @@ public class TileSpecialFlower extends TileMod implements IWandBindable, ISubTil } @Override - public void updateEntity() { + public void update() { if(subTile != null) { - TileEntity tileBelow = worldObj.getTileEntity(xCoord, yCoord - 1, zCoord); + TileEntity tileBelow = worldObj.getTileEntity(pos.down()); if(tileBelow instanceof TileRedStringRelay) { - ChunkCoordinates coords = ((TileRedStringRelay) tileBelow).getBinding(); + BlockPos coords = ((TileRedStringRelay) tileBelow).getBinding(); if(coords != null) { - int currX = xCoord; - int currY = yCoord; - int currZ = zCoord; - xCoord = coords.posX; - yCoord = coords.posY; - zCoord = coords.posZ; + BlockPos currPos = pos; + setPos(coords); subTile.onUpdate(); - xCoord = currX; - yCoord = currY; - zCoord = currZ; + setPos(currPos); return; } @@ -105,17 +104,12 @@ public class TileSpecialFlower extends TileMod implements IWandBindable, ISubTil } public boolean isOnSpecialSoil() { - return worldObj.getBlock(xCoord, yCoord - 1, zCoord) == ModBlocks.enchantedSoil; + return worldObj.getBlockState(pos.down()).getBlock() == ModBlocks.enchantedSoil; } @Override - public boolean canUpdate() { - return subTile == null || subTile.canUpdate(); - } - - @Override - public void writeCustomNBT(NBTTagCompound cmp) { - super.writeCustomNBT(cmp); + public void writePacketNBT(NBTTagCompound cmp) { + super.writePacketNBT(cmp); cmp.setString(TAG_SUBTILE_NAME, subTileName); NBTTagCompound subCmp = new NBTTagCompound(); @@ -126,8 +120,8 @@ public class TileSpecialFlower extends TileMod implements IWandBindable, ISubTil } @Override - public void readCustomNBT(NBTTagCompound cmp) { - super.readCustomNBT(cmp); + public void readPacketNBT(NBTTagCompound cmp) { + super.readPacketNBT(cmp); subTileName = cmp.getString(TAG_SUBTILE_NAME); NBTTagCompound subCmp = cmp.getCompoundTag(TAG_SUBTILE_CMP); @@ -139,10 +133,6 @@ public class TileSpecialFlower extends TileMod implements IWandBindable, ISubTil subTile.readFromPacketNBTInternal(subCmp); } - public IIcon getIcon() { - return subTile == null ? Blocks.red_flower.getIcon(0, 0) : subTile.getIcon(); - } - public LexiconEntry getEntry() { return subTile == null ? null : subTile.getEntry(); } @@ -151,71 +141,72 @@ public class TileSpecialFlower extends TileMod implements IWandBindable, ISubTil return subTile == null ? false : subTile.onWanded(player, wand); } - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) { + public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase entity, ItemStack stack) { if (subTile != null) - subTile.onBlockPlacedBy(world, x, y, z, entity, stack); + subTile.onBlockPlacedBy(world, pos, state, entity, stack); } - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - return subTile == null ? false : subTile.onBlockActivated(world, x, y, z, player, side, hitX, hitY, hitZ); + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing side, float hitX, float hitY, float hitZ) { + return subTile == null ? false : subTile.onBlockActivated(world, pos, state, player, hand, stack, side, hitX, hitY, hitZ); } - public void onBlockAdded(World world, int x, int y, int z) { + public void onBlockAdded(World world, BlockPos pos, IBlockState state) { if (subTile != null) - subTile.onBlockAdded(world, x, y, z); + subTile.onBlockAdded(world, pos, state); } - public void onBlockHarvested(World world, int x, int y, int z, int side, EntityPlayer player) { + public void onBlockHarvested(World world, BlockPos pos, IBlockState state, EntityPlayer player) { if (subTile != null) - subTile.onBlockHarvested(world, x, y, z, side, player); + subTile.onBlockHarvested(world, pos, state, player); } - public ArrayList getDrops(ArrayList list) { + public List getDrops(List list) { if (subTile != null) subTile.getDrops(list); return list; } + @SideOnly(Side.CLIENT) public void renderHUD(Minecraft mc, ScaledResolution res) { if(subTile != null) subTile.renderHUD(mc, res); } @Override - public ChunkCoordinates getBinding() { + public BlockPos getBinding() { if(subTile == null) return null; return subTile.getBinding(); } @Override - public boolean canSelect(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { + public boolean canSelect(EntityPlayer player, ItemStack wand, BlockPos pos, EnumFacing side) { if(subTile == null) return false; - return subTile.canSelect(player, wand, x, y, z, side); + return subTile.canSelect(player, wand, pos, side); } @Override - public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { + public boolean bindTo(EntityPlayer player, ItemStack wand, BlockPos pos, EnumFacing side) { if(subTile == null) return false; - return subTile.bindTo(player, wand, x, y, z, side); + return subTile.bindTo(player, wand, pos, side); } public int getLightValue() { if(subTile == null) - return -1; + return 0; return subTile.getLightValue(); } - public int getComparatorInputOverride(int side) { + public int getComparatorInputOverride() { if(subTile == null) return 0; - return subTile.getComparatorInputOverride(side); + return subTile.getComparatorInputOverride(); } - public int getPowerLevel(int side) { + public int getPowerLevel(EnumFacing side) { if(subTile == null) return 0; return subTile.getPowerLevel(side); @@ -223,13 +214,13 @@ public class TileSpecialFlower extends TileMod implements IWandBindable, ISubTil @Override public int getSlowdownFactor() { - Block below = worldObj.getBlock(xCoord, yCoord - 1, zCoord); - if(below == Blocks.mycelium) + Block below = worldObj.getBlockState(getPos().down()).getBlock(); + if(below == Blocks.MYCELIUM) return SLOWDOWN_FACTOR_MYCEL; - if(below == Blocks.dirt) { - int meta = worldObj.getBlockMetadata(xCoord, yCoord - 1, zCoord); - if(meta == 2) + if(below == Blocks.DIRT) { + BlockDirt.DirtType type = worldObj.getBlockState(getPos().down()).getValue(BlockDirt.VARIANT); + if(type == BlockDirt.DirtType.PODZOL) return SLOWDOWN_FACTOR_PODZOL; } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileSpiritShrine.java b/src/main/java/vazkii/botania/common/block/tile/TileSpiritShrine.java index 1925fad26..6ea40d788 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileSpiritShrine.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileSpiritShrine.java @@ -17,7 +17,7 @@ public class TileSpiritShrine extends TileMod { int ticks; @Override - public void updateEntity() { + public void update() { if(worldObj.isRemote) { if(ticks >= 40) { float[][] colors = new float[][] { @@ -43,14 +43,14 @@ public class TileSpiritShrine extends TileMod { double g = Math.sin(wticks * Math.PI / 180 * 0.55); for(int i = 0; i < totalSpiritCount; i++) { - double x = xCoord + Math.sin(wticks * Math.PI / 180) * r + 0.5; - double y = yCoord + (ticks > existTicks ? 40 - (double) (ticks - existTicks) : Math.min(80 + 40 * i, ticks) - 40 * (i + 1)) * 0.1; - double z = zCoord + Math.cos(wticks * Math.PI / 180) * r + 0.5; + double x = pos.getX() + Math.sin(wticks * Math.PI / 180) * r + 0.5; + double y = pos.getY() + (ticks > existTicks ? 40 - (double) (ticks - existTicks) : Math.min(80 + 40 * i, ticks) - 40 * (i + 1)) * 0.1; + double z = pos.getZ() + Math.cos(wticks * Math.PI / 180) * r + 0.5; wticks += tickIncrement; float[] colorsfx = colors[i >= colors.length ? 0 : i]; - Botania.proxy.wispFX(worldObj, x, y, z, colorsfx[0], colorsfx[1], colorsfx[2], 0.85F, (float)g * 0.05F, 0.25F); - Botania.proxy.wispFX(worldObj, x, y, z, colorsfx[0], colorsfx[1], colorsfx[2], (float) Math.random() * 0.1F + 0.1F, (float) (Math.random() - 0.5) * 0.05F, (float) (Math.random() - 0.5) * 0.05F, (float) (Math.random() - 0.5) * 0.05F, 0.9F); + Botania.proxy.wispFX(x, y, z, colorsfx[0], colorsfx[1], colorsfx[2], 0.85F, (float)g * 0.05F, 0.25F); + Botania.proxy.wispFX(x, y, z, colorsfx[0], colorsfx[1], colorsfx[2], (float) Math.random() * 0.1F + 0.1F, (float) (Math.random() - 0.5) * 0.05F, (float) (Math.random() - 0.5) * 0.05F, (float) (Math.random() - 0.5) * 0.05F, 0.9F); } } } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileStarfield.java b/src/main/java/vazkii/botania/common/block/tile/TileStarfield.java index 06eeaa350..188ac2965 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileStarfield.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileStarfield.java @@ -10,28 +10,29 @@ */ package vazkii.botania.common.block.tile; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.common.Botania; public class TileStarfield extends TileMod { @Override - public void updateEntity() { - int meta = getBlockMetadata(); + public void update() { + boolean state = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED); if(!worldObj.isRemote) { - int newMeta = worldObj.isDaytime() ? 0 : 1; - if(newMeta != meta) { - worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, newMeta, 1 | 2); - meta = newMeta; + boolean newState = !worldObj.isDaytime(); + if(newState != state) { + worldObj.setBlockState(getPos(), worldObj.getBlockState(getPos()).withProperty(BotaniaStateProps.POWERED, newState), 1 | 2); + state = newState; } } - if(meta == 1) { + if(state) { double radius = 512; int iter = 2; for(int i = 0; i < iter; i++) { - double x = xCoord + 0.5 + (Math.random() - 0.5) * radius; - double y = yCoord + 256; - double z = zCoord + 0.5 + (Math.random() - 0.5) * radius; + double x = pos.getX() + 0.5 + (Math.random() - 0.5) * radius; + double y = Math.min(256, pos.getY() + Botania.proxy.getClientRenderDistance() * 16); + double z = pos.getZ() + 0.5 + (Math.random() - 0.5) * radius; float w = 0.6F; float c = 1F - w; @@ -43,7 +44,7 @@ public class TileStarfield extends TileMod { float s = 20F + (float) Math.random() * 20F; int m = 50; - Botania.proxy.sparkleFX(worldObj, x, y, z, r, g, b, s, m); + Botania.proxy.sparkleFX(x, y, z, r, g, b, s, m); } } } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileTerraPlate.java b/src/main/java/vazkii/botania/common/block/tile/TileTerraPlate.java index f59d61d6d..3c1fa96a3 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileTerraPlate.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileTerraPlate.java @@ -10,15 +10,16 @@ */ package vazkii.botania.common.block.tile; -import java.util.List; - +import com.google.common.base.Predicates; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import vazkii.botania.api.internal.VanillaPacketDispatcher; import vazkii.botania.api.lexicon.multiblock.Multiblock; import vazkii.botania.api.lexicon.multiblock.MultiblockSet; @@ -26,20 +27,27 @@ import vazkii.botania.api.mana.IManaPool; import vazkii.botania.api.mana.spark.ISparkAttachable; import vazkii.botania.api.mana.spark.ISparkEntity; import vazkii.botania.api.mana.spark.SparkHelper; +import vazkii.botania.api.sound.BotaniaSoundEvents; import vazkii.botania.common.Botania; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.tile.mana.TilePool; import vazkii.botania.common.item.ModItems; +import java.util.List; + public class TileTerraPlate extends TileMod implements ISparkAttachable { public static final int MAX_MANA = TilePool.MAX_MANA / 2; - private static final int[][] LAPIS_BLOCKS = { - { 1, 0, }, { -1, 0 }, { 0, 1 }, { 0, -1 } + + private static final BlockPos[] LAPIS_BLOCKS = { + new BlockPos(1, 0, 0), new BlockPos(-1, 0, 0), + new BlockPos(0, 0, 1), new BlockPos(0, 0, -1) }; - private static final int[][] LIVINGROCK_BLOCKS = { - { 0, 0 }, { 1, 1 }, { 1, -1 }, { -1, 1 }, { -1, -1 } + private static final BlockPos[] LIVINGROCK_BLOCKS = { + new BlockPos(0, 0, 0), new BlockPos(1, 0, 1), + new BlockPos(1, 0, -1), new BlockPos(-1, 0, 1), + new BlockPos(-1, 0, -1) }; private static final String TAG_MANA = "mana"; @@ -49,19 +57,19 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable { public static MultiblockSet makeMultiblockSet() { Multiblock mb = new Multiblock(); - for(int[] l : LAPIS_BLOCKS) - mb.addComponent(l[0], 0, l[1], Blocks.lapis_block, 0); - for(int[] l : LIVINGROCK_BLOCKS) - mb.addComponent(l[0], 0, l[1], ModBlocks.livingrock, 0); + for(BlockPos relativePos : LAPIS_BLOCKS) + mb.addComponent(relativePos, Blocks.LAPIS_BLOCK.getDefaultState()); + for(BlockPos relativePos : LIVINGROCK_BLOCKS) + mb.addComponent(relativePos, ModBlocks.livingrock.getDefaultState()); - mb.addComponent(0, 1, 0, ModBlocks.terraPlate, 0); - mb.setRenderOffset(0, 1, 0); + mb.addComponent(new BlockPos(0, 1, 0), ModBlocks.terraPlate.getDefaultState()); + mb.setRenderOffset(new BlockPos(0, 1, 0)); return mb.makeSet(); } @Override - public void updateEntity() { + public void update() { boolean removeMana = true; if(hasValidPlatform()) { @@ -70,7 +78,7 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable { removeMana = false; ISparkEntity spark = getAttachedSpark(); if(spark != null) { - List sparkEntities = SparkHelper.getSparksAround(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5); + List sparkEntities = SparkHelper.getSparksAround(worldObj, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5); for(ISparkEntity otherSpark : sparkEntities) { if(spark == otherSpark) continue; @@ -88,10 +96,10 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable { if(otherItem != item) otherItem.setDead(); else item.setEntityItemStack(new ItemStack(ModItems.manaResource, 1, 4)); - item.worldObj.playSoundAtEntity(item, "botania:terrasteelCraft", 1F, 1F); + worldObj.playSound(null, item.posX, item.posY, item.posZ, BotaniaSoundEvents.terrasteelCraft, SoundCategory.BLOCKS, 1, 1); mana = 0; - worldObj.func_147453_f(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord)); - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, xCoord, yCoord, zCoord); + worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock()); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos); } } } @@ -114,26 +122,26 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable { double g = Math.sin(wticks * Math.PI / 180 * 0.55); for(int i = 0; i < totalSpiritCount; i++) { - double x = xCoord + Math.sin(wticks * Math.PI / 180) * r + 0.5; - double y = yCoord + 0.25 + Math.abs(r) * 0.7; - double z = zCoord + Math.cos(wticks * Math.PI / 180) * r + 0.5; + double x = pos.getX() + Math.sin(wticks * Math.PI / 180) * r + 0.5; + double y = pos.getY() + 0.25 + Math.abs(r) * 0.7; + double z = pos.getZ() + Math.cos(wticks * Math.PI / 180) * r + 0.5; wticks += tickIncrement; float[] colorsfx = new float[] { 0F, (float) ticks / (float) 100, 1F - (float) ticks / (float) 100 }; - Botania.proxy.wispFX(worldObj, x, y, z, colorsfx[0], colorsfx[1], colorsfx[2], 0.85F, (float)g * 0.05F, 0.25F); - Botania.proxy.wispFX(worldObj, x, y, z, colorsfx[0], colorsfx[1], colorsfx[2], (float) Math.random() * 0.1F + 0.1F, (float) (Math.random() - 0.5) * 0.05F, (float) (Math.random() - 0.5) * 0.05F, (float) (Math.random() - 0.5) * 0.05F, 0.9F); + Botania.proxy.wispFX(x, y, z, colorsfx[0], colorsfx[1], colorsfx[2], 0.85F, (float)g * 0.05F, 0.25F); + Botania.proxy.wispFX(x, y, z, colorsfx[0], colorsfx[1], colorsfx[2], (float) Math.random() * 0.1F + 0.1F, (float) (Math.random() - 0.5) * 0.05F, (float) (Math.random() - 0.5) * 0.05F, (float) (Math.random() - 0.5) * 0.05F, 0.9F); if(ticks == 100) for(int j = 0; j < 15; j++) - Botania.proxy.wispFX(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, colorsfx[0], colorsfx[1], colorsfx[2], (float) Math.random() * 0.15F + 0.15F, (float) (Math.random() - 0.5F) * 0.125F, (float) (Math.random() - 0.5F) * 0.125F, (float) (Math.random() - 0.5F) * 0.125F); + Botania.proxy.wispFX(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, colorsfx[0], colorsfx[1], colorsfx[2], (float) Math.random() * 0.15F + 0.15F, (float) (Math.random() - 0.5F) * 0.125F, (float) (Math.random() - 0.5F) * 0.125F, (float) (Math.random() - 0.5F) * 0.125F); } } } List getItems() { - return worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1)); + return worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos, pos.add(1, 1, 1))); } boolean areItemsValid(List items) { @@ -162,13 +170,12 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable { } boolean hasValidPlatform() { - return checkAll(LAPIS_BLOCKS, Blocks.lapis_block) && checkAll(LIVINGROCK_BLOCKS, ModBlocks.livingrock); + return checkAll(LAPIS_BLOCKS, Blocks.LAPIS_BLOCK) && checkAll(LIVINGROCK_BLOCKS, ModBlocks.livingrock); } - boolean checkAll(int[][] positions, Block block) { - for (int[] position : positions) { - int[] positions_ = position; - if(!checkPlatform(positions_[0], positions_[1], block)) + boolean checkAll(BlockPos[] relPositions, Block block) { + for (BlockPos position : relPositions) { + if(!checkPlatform(position.getX(), position.getZ(), block)) return false; } @@ -176,16 +183,16 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable { } boolean checkPlatform(int xOff, int zOff, Block block) { - return worldObj.getBlock(xCoord + xOff, yCoord - 1, zOff + zCoord) == block; + return worldObj.getBlockState(pos.add(xOff, -1, zOff)).getBlock() == block; } @Override - public void writeCustomNBT(NBTTagCompound cmp) { + public void writePacketNBT(NBTTagCompound cmp) { cmp.setInteger(TAG_MANA, mana); } @Override - public void readCustomNBT(NBTTagCompound cmp) { + public void readPacketNBT(NBTTagCompound cmp) { mana = cmp.getInteger(TAG_MANA); } @@ -202,7 +209,7 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable { @Override public void recieveMana(int mana) { this.mana = Math.max(0, Math.min(MAX_MANA, this.mana + mana)); - worldObj.func_147453_f(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord)); + worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock()); } @Override @@ -216,15 +223,13 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable { } @Override - public void attachSpark(ISparkEntity entity) { - // NO-OP - } + public void attachSpark(ISparkEntity entity) {} @Override public ISparkEntity getAttachedSpark() { - List sparks = worldObj.getEntitiesWithinAABB(ISparkEntity.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord + 1, zCoord, xCoord + 1, yCoord + 2, zCoord + 1)); + List sparks = worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(pos.up(), pos.up().add(1, 1, 1)), Predicates.instanceOf(ISparkEntity.class)); if(sparks.size() == 1) { - Entity e = (Entity) sparks.get(0); + Entity e = sparks.get(0); return (ISparkEntity) e; } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileTeruTeruBozu.java b/src/main/java/vazkii/botania/common/block/tile/TileTeruTeruBozu.java index 21e8fd2d0..a0414cd4a 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileTeruTeruBozu.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileTeruTeruBozu.java @@ -15,13 +15,16 @@ public class TileTeruTeruBozu extends TileMod { public boolean wasRaining = false; @Override - public void updateEntity() { + public void update() { + if (worldObj.isRemote) + return; + boolean isRaining = worldObj.isRaining(); if(isRaining && worldObj.rand.nextInt(9600) == 0) worldObj.getWorldInfo().setRaining(false); if(wasRaining != isRaining) - worldObj.func_147453_f(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord)); + worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock()); wasRaining = isRaining; } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileTinyPlanet.java b/src/main/java/vazkii/botania/common/block/tile/TileTinyPlanet.java index c7c14bc8b..b034e32fa 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileTinyPlanet.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileTinyPlanet.java @@ -10,19 +10,13 @@ */ package vazkii.botania.common.block.tile; -import vazkii.botania.api.mana.IManaCollisionGhost; import vazkii.botania.common.item.equipment.bauble.ItemTinyPlanet; -public class TileTinyPlanet extends TileMod implements IManaCollisionGhost { +public class TileTinyPlanet extends TileMod { @Override - public void updateEntity() { - ItemTinyPlanet.applyEffect(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5); - } - - @Override - public boolean isGhost() { - return true; + public void update() { + ItemTinyPlanet.applyEffect(worldObj, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileTinyPotato.java b/src/main/java/vazkii/botania/common/block/tile/TileTinyPotato.java index bc3f60e32..456f71f2c 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileTinyPotato.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileTinyPotato.java @@ -11,6 +11,8 @@ package vazkii.botania.common.block.tile; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.SoundCategory; +import vazkii.botania.api.sound.BotaniaSoundEvents; public class TileTinyPotato extends TileMod { @@ -23,9 +25,9 @@ public class TileTinyPotato extends TileMod { public void interact() { jump(); - if(name.equalsIgnoreCase("shia labeouf") && !worldObj.isRemote && nextDoIt == 0) { + if(name.toLowerCase().trim().endsWith("shia labeouf") && !worldObj.isRemote && nextDoIt == 0) { nextDoIt = 40; - worldObj.playSoundEffect(xCoord, yCoord, zCoord, "botania:doit", 1F, 1F); + worldObj.playSound(null, pos, BotaniaSoundEvents.doit, SoundCategory.BLOCKS, 1F, 1F); } } @@ -35,7 +37,7 @@ public class TileTinyPotato extends TileMod { } @Override - public void updateEntity() { + public void update() { if(worldObj.rand.nextInt(100) == 0) jump(); @@ -46,12 +48,12 @@ public class TileTinyPotato extends TileMod { } @Override - public void writeCustomNBT(NBTTagCompound cmp) { + public void writePacketNBT(NBTTagCompound cmp) { cmp.setString(TAG_NAME, name); } @Override - public void readCustomNBT(NBTTagCompound cmp) { + public void readPacketNBT(NBTTagCompound cmp) { name = cmp.getString(TAG_NAME); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaBase.java b/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaBase.java index d3af0ac8e..3a3d175ea 100644 --- a/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaBase.java +++ b/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaBase.java @@ -17,7 +17,7 @@ import vazkii.botania.common.block.tile.TileSimpleInventory; public abstract class TileCorporeaBase extends TileSimpleInventory { public ICorporeaSpark getSpark() { - return CorporeaHelper.getSparkForBlock(worldObj, xCoord, yCoord, zCoord); + return CorporeaHelper.getSparkForBlock(worldObj, getPos()); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaCrystalCube.java b/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaCrystalCube.java index 0c8b71c2e..715ebb432 100644 --- a/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaCrystalCube.java +++ b/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaCrystalCube.java @@ -10,16 +10,25 @@ */ package vazkii.botania.common.block.tile.corporea; -import java.util.List; - +import com.google.common.collect.ImmutableMap; import net.minecraft.entity.item.EntityItem; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.model.ModelLoaderRegistry; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.model.animation.CapabilityAnimation; +import net.minecraftforge.common.model.animation.IAnimationStateMachine; +import net.minecraftforge.fml.common.FMLCommonHandler; +import net.minecraftforge.fml.relauncher.Side; import vazkii.botania.api.corporea.CorporeaHelper; import vazkii.botania.api.corporea.ICorporeaRequestor; import vazkii.botania.api.corporea.ICorporeaSpark; import vazkii.botania.api.internal.VanillaPacketDispatcher; -import vazkii.botania.common.lib.LibBlockNames; + +import javax.annotation.Nonnull; +import java.util.List; public class TileCorporeaCrystalCube extends TileCorporeaBase implements ICorporeaRequestor { @@ -33,8 +42,18 @@ public class TileCorporeaCrystalCube extends TileCorporeaBase implements ICorpor int ticks = 0; public int compValue = 0; + private final IAnimationStateMachine asm; + + public TileCorporeaCrystalCube() { + if (FMLCommonHandler.instance().getSide() == Side.CLIENT) { + asm = ModelLoaderRegistry.loadASM(new ResourceLocation("botania", "asms/block/crystalcube_cube.json"), ImmutableMap.of()); + } else { + asm = null; + } + } + @Override - public void updateEntity() { + public void update() { ++ticks; if(ticks % 20 == 0) updateCount(); @@ -92,12 +111,12 @@ public class TileCorporeaCrystalCube extends TileCorporeaBase implements ICorpor private void onUpdateCount() { compValue = getComparatorValue(); - worldObj.func_147453_f(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord)); + worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock()); } @Override - public void writeCustomNBT(NBTTagCompound par1nbtTagCompound) { - super.writeCustomNBT(par1nbtTagCompound); + public void writePacketNBT(NBTTagCompound par1nbtTagCompound) { + super.writePacketNBT(par1nbtTagCompound); NBTTagCompound cmp = new NBTTagCompound(); if(requestTarget != null) requestTarget.writeToNBT(cmp); @@ -106,8 +125,8 @@ public class TileCorporeaCrystalCube extends TileCorporeaBase implements ICorpor } @Override - public void readCustomNBT(NBTTagCompound par1nbtTagCompound) { - super.readCustomNBT(par1nbtTagCompound); + public void readPacketNBT(NBTTagCompound par1nbtTagCompound) { + super.readPacketNBT(par1nbtTagCompound); NBTTagCompound cmp = par1nbtTagCompound.getCompoundTag(TAG_REQUEST_TARGET); requestTarget = ItemStack.loadItemStackFromNBT(cmp); itemCount = par1nbtTagCompound.getInteger(TAG_ITEM_COUNT); @@ -125,13 +144,8 @@ public class TileCorporeaCrystalCube extends TileCorporeaBase implements ICorpor } @Override - public boolean isItemValidForSlot(int i, ItemStack itemstack) { - return false; - } - - @Override - public String getInventoryName() { - return LibBlockNames.CORPOREA_CRYSTAL_CUBE; + protected SimpleItemStackHandler createItemHandler() { + return new SimpleItemStackHandler(this, false); } @Override @@ -144,7 +158,7 @@ public class TileCorporeaCrystalCube extends TileCorporeaBase implements ICorpor boolean did = false; for(ItemStack reqStack : stacks) if(requestTarget != null) { - EntityItem item = new EntityItem(worldObj, xCoord + 0.5, yCoord + 1.5, zCoord + 0.5, reqStack); + EntityItem item = new EntityItem(worldObj, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, reqStack); worldObj.spawnEntityInWorld(item); itemCount -= reqStack.stackSize; did = true; @@ -156,4 +170,17 @@ public class TileCorporeaCrystalCube extends TileCorporeaBase implements ICorpor } } + @Override + public boolean hasCapability(@Nonnull Capability cap, @Nonnull EnumFacing side) { + return cap == CapabilityAnimation.ANIMATION_CAPABILITY || super.hasCapability(cap, side); + } + + @Nonnull + @Override + public T getCapability(@Nonnull Capability cap, @Nonnull EnumFacing side) { + if(cap == CapabilityAnimation.ANIMATION_CAPABILITY) { + return CapabilityAnimation.ANIMATION_CAPABILITY.cast(asm); + } else return super.getCapability(cap, side); + } + } diff --git a/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaFunnel.java b/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaFunnel.java index 569251738..84a9226ad 100644 --- a/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaFunnel.java +++ b/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaFunnel.java @@ -10,21 +10,21 @@ */ package vazkii.botania.common.block.tile.corporea; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItemFrame; -import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraftforge.items.IItemHandler; +import net.minecraftforge.items.ItemHandlerHelper; import vazkii.botania.api.corporea.CorporeaHelper; import vazkii.botania.api.corporea.ICorporeaRequestor; import vazkii.botania.api.corporea.ICorporeaSpark; import vazkii.botania.common.core.helper.InventoryHelper; -import vazkii.botania.common.lib.LibBlockNames; -import vazkii.botania.common.lib.LibMisc; + +import java.util.ArrayList; +import java.util.List; public class TileCorporeaFunnel extends TileCorporeaBase implements ICorporeaRequestor { @@ -42,20 +42,17 @@ public class TileCorporeaFunnel extends TileCorporeaBase implements ICorporeaReq } public List getFilter() { - List filter = new ArrayList(); + List filter = new ArrayList<>(); - final int[] orientationToDir = new int[] { - 3, 4, 2, 5 - }; final int[] rotationToStackSize = new int[] { - 1, 16, 32, 64 + 1, 2, 4, 8, 16, 32, 48, 64 }; - for(ForgeDirection dir : LibMisc.CARDINAL_DIRECTIONS) { - List frames = worldObj.getEntitiesWithinAABB(EntityItemFrame.class, AxisAlignedBB.getBoundingBox(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, xCoord + dir.offsetX + 1, yCoord + dir.offsetY + 1, zCoord + dir.offsetZ + 1)); + for(EnumFacing dir : EnumFacing.HORIZONTALS) { + List frames = worldObj.getEntitiesWithinAABB(EntityItemFrame.class, new AxisAlignedBB(pos.offset(dir), pos.offset(dir).add(1, 1, 1))); for(EntityItemFrame frame : frames) { - int orientation = frame.hangingDirection; - if(orientationToDir[orientation] == dir.ordinal()) { + EnumFacing orientation = frame.facingDirection; + if(orientation == dir) { ItemStack stack = frame.getDisplayedItem(); if(stack != null) { ItemStack copy = stack.copy(); @@ -69,19 +66,14 @@ public class TileCorporeaFunnel extends TileCorporeaBase implements ICorporeaReq return filter; } - @Override - public boolean isItemValidForSlot(int i, ItemStack itemstack) { - return false; - } - @Override public int getSizeInventory() { return 1; } @Override - public String getInventoryName() { - return LibBlockNames.CORPOREA_FUNNEL; + protected SimpleItemStackHandler createItemHandler() { + return new SimpleItemStackHandler(this, false); } @Override @@ -89,21 +81,36 @@ public class TileCorporeaFunnel extends TileCorporeaBase implements ICorporeaReq if(!(request instanceof ItemStack)) return; - IInventory inv = InventoryHelper.getInventory(worldObj, xCoord, yCoord - 1, zCoord); - if(inv == null || inv instanceof TileCorporeaFunnel) - inv = InventoryHelper.getInventory(worldObj, xCoord, yCoord - 2, zCoord); + IItemHandler inv = getInv(); List stacks = CorporeaHelper.requestItem(request, count, spark, true, true); spark.onItemsRequested(stacks); - for(ItemStack reqStack : stacks) - if(request != null) { - if(inv != null && !(inv instanceof TileCorporeaFunnel) && reqStack.stackSize == InventoryHelper.testInventoryInsertion(inv, reqStack, ForgeDirection.UP)) - InventoryHelper.insertItemIntoInventory(inv, reqStack); - else { - EntityItem item = new EntityItem(worldObj, xCoord + 0.5, yCoord + 1.5, zCoord + 0.5, reqStack); - worldObj.spawnEntityInWorld(item); - } + for(ItemStack reqStack : stacks) { + if(inv != null && ItemHandlerHelper.insertItemStacked(inv, reqStack, true) == null) + ItemHandlerHelper.insertItemStacked(inv, reqStack, false); + else { + EntityItem item = new EntityItem(worldObj, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, reqStack); + worldObj.spawnEntityInWorld(item); } + } + } + + private IItemHandler getInv() { + TileEntity te = worldObj.getTileEntity(pos.down()); + IItemHandler ret = InventoryHelper.getInventory(worldObj, pos.down(), EnumFacing.UP); + if(ret == null) + ret = InventoryHelper.getInventory(worldObj, pos.down(), null); + if(ret != null && !(te instanceof TileCorporeaFunnel)) + return ret; + + te = worldObj.getTileEntity(pos.down(2)); + ret = InventoryHelper.getInventory(worldObj, pos.down(2), EnumFacing.UP); + if(ret == null) + ret = InventoryHelper.getInventory(worldObj, pos.down(2), null); + if(ret != null && !(te instanceof TileCorporeaFunnel)) + return ret; + + return null; } } diff --git a/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaIndex.java b/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaIndex.java index 11875e1f0..c2c5dc628 100644 --- a/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaIndex.java +++ b/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaIndex.java @@ -10,6 +10,27 @@ */ package vazkii.botania.common.block.tile.corporea; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.text.Style; +import net.minecraft.util.text.TextComponentTranslation; +import net.minecraft.util.text.TextFormatting; +import net.minecraftforge.event.ServerChatEvent; +import net.minecraftforge.fml.common.eventhandler.EventPriority; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import org.apache.commons.lang3.text.WordUtils; +import vazkii.botania.api.corporea.CorporeaHelper; +import vazkii.botania.api.corporea.ICorporeaAutoCompleteController; +import vazkii.botania.api.corporea.ICorporeaRequestor; +import vazkii.botania.api.corporea.ICorporeaSpark; +import vazkii.botania.common.achievement.ModAchievements; +import vazkii.botania.common.core.helper.MathHelper; + import java.util.ArrayList; import java.util.Collections; import java.util.LinkedHashMap; @@ -20,38 +41,14 @@ import java.util.WeakHashMap; import java.util.regex.Matcher; import java.util.regex.Pattern; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.util.ChatStyle; -import net.minecraft.util.EnumChatFormatting; -import net.minecraftforge.event.ServerChatEvent; - -import org.apache.commons.lang3.text.WordUtils; - -import vazkii.botania.api.corporea.CorporeaHelper; -import vazkii.botania.api.corporea.ICorporeaAutoCompleteController; -import vazkii.botania.api.corporea.ICorporeaRequestor; -import vazkii.botania.api.corporea.ICorporeaSpark; -import vazkii.botania.common.achievement.ModAchievements; -import vazkii.botania.common.core.helper.MathHelper; -import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.eventhandler.EventPriority; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - public class TileCorporeaIndex extends TileCorporeaBase implements ICorporeaRequestor { public static final double RADIUS = 2.5; private static InputHandler input; - public static final Set indexes = Collections.newSetFromMap(new WeakHashMap()); + public static final Set indexes = Collections.newSetFromMap(new WeakHashMap<>()); - private static final Map patterns = new LinkedHashMap(); + private static final Map patterns = new LinkedHashMap<>(); /** * (name) = Item name, or "this" for the name of the item in your hand @@ -151,14 +148,12 @@ public class TileCorporeaIndex extends TileCorporeaBase implements ICorporeaRequ public boolean hasCloseby; @Override - public void updateEntity() { - super.updateEntity(); + public void update() { + double x = pos.getX() + 0.5; + double y = pos.getY() + 0.5; + double z = pos.getZ() + 0.5; - double x = xCoord + 0.5; - double y = yCoord + 0.5; - double z = zCoord + 0.5; - - List players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(x - RADIUS, y - RADIUS, z - RADIUS, x + RADIUS, y + RADIUS, z + RADIUS)); + List players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(x - RADIUS, y - RADIUS, z - RADIUS, x + RADIUS, y + RADIUS, z + RADIUS)); hasCloseby = false; for(EntityPlayer player : players) if(isInRangeOfIndex(player, this)) { @@ -196,11 +191,6 @@ public class TileCorporeaIndex extends TileCorporeaBase implements ICorporeaRequ return 0; } - @Override - public String getInventoryName() { - return LibBlockNames.CORPOREA_INDEX; - } - @Override public void doCorporeaRequest(Object request, int count, ICorporeaSpark spark) { if(!(request instanceof String)) @@ -210,13 +200,13 @@ public class TileCorporeaIndex extends TileCorporeaBase implements ICorporeaRequ spark.onItemsRequested(stacks); for(ItemStack stack : stacks) if(stack != null) { - EntityItem item = new EntityItem(worldObj, xCoord + 0.5, yCoord + 1.5, zCoord + 0.5, stack); + EntityItem item = new EntityItem(worldObj, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, stack); worldObj.spawnEntityInWorld(item); } } public static boolean isInRangeOfIndex(EntityPlayer player, TileCorporeaIndex index) { - return player.worldObj.provider.dimensionId == index.worldObj.provider.dimensionId && MathHelper.pointDistancePlane(index.xCoord + 0.5, index.zCoord + 0.5, player.posX, player.posZ) < RADIUS && Math.abs(index.yCoord + 0.5 - player.posY + (player.worldObj.isRemote ? 0 : 1.6)) < 5; + return player.worldObj.provider.getDimension() == index.worldObj.provider.getDimension() && MathHelper.pointDistancePlane(index.getPos().getX() + 0.5, index.getPos().getZ() + 0.5, player.posX, player.posZ) < RADIUS && Math.abs(index.getPos().getY() + 0.5 - player.posY + (player.worldObj.isRemote ? 0 : 1.6)) < 5; } public static void addPattern(String pattern, IRegexStacker stacker) { @@ -246,9 +236,9 @@ public class TileCorporeaIndex extends TileCorporeaBase implements ICorporeaRequ @SubscribeEvent(priority = EventPriority.HIGHEST) public void onChatMessage(ServerChatEvent event) { - List nearbyIndexes = getNearbyIndexes(event.player); + List nearbyIndexes = getNearbyIndexes(event.getPlayer()); if(!nearbyIndexes.isEmpty()) { - String msg = event.message.toLowerCase().trim(); + String msg = event.getMessage().toLowerCase().trim(); for(TileCorporeaIndex index : nearbyIndexes) { if(index.worldObj.isRemote) continue; @@ -268,16 +258,16 @@ public class TileCorporeaIndex extends TileCorporeaBase implements ICorporeaRequ } if(name.equals("this")) { - ItemStack stack = event.player.getCurrentEquippedItem(); + ItemStack stack = event.getPlayer().getHeldItemMainhand(); if(stack != null) name = stack.getDisplayName().toLowerCase().trim(); } index.doCorporeaRequest(name, count, spark); - event.player.addChatMessage(new ChatComponentTranslation("botaniamisc.requestMsg", count, WordUtils.capitalizeFully(name), CorporeaHelper.lastRequestMatches, CorporeaHelper.lastRequestExtractions).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.LIGHT_PURPLE))); + event.getPlayer().addChatMessage(new TextComponentTranslation("botaniamisc.requestMsg", count, WordUtils.capitalizeFully(name), CorporeaHelper.lastRequestMatches, CorporeaHelper.lastRequestExtractions).setStyle(new Style().setColor(TextFormatting.LIGHT_PURPLE))); if(CorporeaHelper.lastRequestExtractions >= 50000) - event.player.addStat(ModAchievements.superCorporeaRequest, 1); + event.getPlayer().addStat(ModAchievements.superCorporeaRequest, 1); } } @@ -286,7 +276,7 @@ public class TileCorporeaIndex extends TileCorporeaBase implements ICorporeaRequ } public static List getNearbyIndexes(EntityPlayer player) { - List indexList = new ArrayList(); + List indexList = new ArrayList<>(); for(TileCorporeaIndex index : indexes) if(isInRangeOfIndex(player, index) && index.worldObj.isRemote == player.worldObj.isRemote) indexList.add(index); diff --git a/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaInterceptor.java b/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaInterceptor.java index bfc5734c9..743826e9b 100644 --- a/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaInterceptor.java +++ b/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaInterceptor.java @@ -10,26 +10,25 @@ */ package vazkii.botania.common.block.tile.corporea; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.entity.item.EntityItemFrame; -import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.AxisAlignedBB; import vazkii.botania.api.corporea.CorporeaHelper; import vazkii.botania.api.corporea.ICorporeaInterceptor; import vazkii.botania.api.corporea.ICorporeaSpark; -import vazkii.botania.common.lib.LibBlockNames; -import vazkii.botania.common.lib.LibMisc; +import vazkii.botania.api.corporea.InvWithLocation; +import vazkii.botania.api.state.BotaniaStateProps; + +import java.util.ArrayList; +import java.util.List; public class TileCorporeaInterceptor extends TileCorporeaBase implements ICorporeaInterceptor { @Override - public boolean isItemValidForSlot(int i, ItemStack itemstack) { - return false; + protected SimpleItemStackHandler createItemHandler() { + return new SimpleItemStackHandler(this, false); } @Override @@ -38,17 +37,10 @@ public class TileCorporeaInterceptor extends TileCorporeaBase implements ICorpor } @Override - public String getInventoryName() { - return LibBlockNames.CORPOREA_INTERCEPTOR; - } + public void interceptRequest(Object request, int count, ICorporeaSpark spark, ICorporeaSpark source, List stacks, List inventories, boolean doit) {} @Override - public void interceptRequest(Object request, int count, ICorporeaSpark spark, ICorporeaSpark source, List stacks, List inventories, boolean doit) { - // NO-OP - } - - @Override - public void interceptRequestLast(Object request, int count, ICorporeaSpark spark, ICorporeaSpark source, List stacks, List inventories, boolean doit) { + public void interceptRequestLast(Object request, int count, ICorporeaSpark spark, ICorporeaSpark source, List stacks, List inventories, boolean doit) { List filter = getFilter(); for(ItemStack stack : filter) if(requestMatches(request, stack)) { @@ -56,15 +48,15 @@ public class TileCorporeaInterceptor extends TileCorporeaBase implements ICorpor for(ItemStack stack_ : stacks) missing -= stack_.stackSize; - if(missing > 0 && getBlockMetadata() == 0) { - worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 1, 1 | 2); - worldObj.scheduleBlockUpdate(xCoord, yCoord, zCoord, getBlockType(), 2); + if(missing > 0 && !worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED)) { + worldObj.setBlockState(getPos(), worldObj.getBlockState(getPos()).withProperty(BotaniaStateProps.POWERED, true), 1 | 2); + worldObj.scheduleUpdate(getPos(), getBlockType(), 2); - TileEntity requestor = (TileEntity) source.getInventory(); - for(ForgeDirection dir : LibMisc.CARDINAL_DIRECTIONS) { - TileEntity tile = worldObj.getTileEntity(xCoord + dir.offsetX, yCoord, zCoord + dir.offsetZ); + TileEntity requestor = source.getSparkInventory().world.getTileEntity(source.getSparkInventory().pos); + for(EnumFacing dir : EnumFacing.HORIZONTALS) { + TileEntity tile = worldObj.getTileEntity(pos.offset(dir)); if(tile != null && tile instanceof TileCorporeaRetainer) - ((TileCorporeaRetainer) tile).setPendingRequest(requestor.xCoord, requestor.yCoord, requestor.zCoord, request, count); + ((TileCorporeaRetainer) tile).setPendingRequest(requestor.getPos(), request, count); } return; @@ -87,17 +79,13 @@ public class TileCorporeaInterceptor extends TileCorporeaBase implements ICorpor } public List getFilter() { - List filter = new ArrayList(); + List filter = new ArrayList<>(); - final int[] orientationToDir = new int[] { - 3, 4, 2, 5 - }; - - for(ForgeDirection dir : LibMisc.CARDINAL_DIRECTIONS) { - List frames = worldObj.getEntitiesWithinAABB(EntityItemFrame.class, AxisAlignedBB.getBoundingBox(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, xCoord + dir.offsetX + 1, yCoord + dir.offsetY + 1, zCoord + dir.offsetZ + 1)); + for(EnumFacing dir : EnumFacing.HORIZONTALS) { + List frames = worldObj.getEntitiesWithinAABB(EntityItemFrame.class, new AxisAlignedBB(pos.offset(dir), pos.offset(dir).add(1, 1, 1))); for(EntityItemFrame frame : frames) { - int orientation = frame.hangingDirection; - if(orientationToDir[orientation] == dir.ordinal()) + EnumFacing orientation = frame.facingDirection; + if(orientation == dir) filter.add(frame.getDisplayedItem()); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaRetainer.java b/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaRetainer.java index 841981fad..22013761e 100644 --- a/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaRetainer.java +++ b/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaRetainer.java @@ -10,12 +10,13 @@ */ package vazkii.botania.common.block.tile.corporea; -import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.math.BlockPos; import vazkii.botania.api.corporea.CorporeaHelper; import vazkii.botania.api.corporea.ICorporeaRequestor; import vazkii.botania.api.corporea.ICorporeaSpark; +import vazkii.botania.api.corporea.InvWithLocation; import vazkii.botania.common.block.tile.TileMod; public class TileCorporeaRetainer extends TileMod { @@ -34,21 +35,19 @@ public class TileCorporeaRetainer extends TileMod { private static final int REQUEST_STRING = 2; boolean pendingRequest = false; - int requestX, requestY, requestZ; + BlockPos requestPos = BlockPos.ORIGIN; Object request; int requestCount; - public void setPendingRequest(int x, int y, int z, Object request, int requestCount) { + public void setPendingRequest(BlockPos pos, Object request, int requestCount) { if(pendingRequest) return; - requestX = x; - requestY = y; - requestZ = z; + requestPos = pos; this.request = request; this.requestCount = requestCount; pendingRequest = true; - worldObj.func_147453_f(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord)); + worldObj.updateComparatorOutputLevel(getPos(), worldObj.getBlockState(getPos()).getBlock()); } public boolean hasPendingRequest() { @@ -59,26 +58,26 @@ public class TileCorporeaRetainer extends TileMod { if(!hasPendingRequest()) return; - ICorporeaSpark spark = CorporeaHelper.getSparkForBlock(worldObj, requestX, requestY, requestZ); + ICorporeaSpark spark = CorporeaHelper.getSparkForBlock(worldObj, requestPos); if(spark != null) { - IInventory inv = spark.getInventory(); - if(inv != null && inv instanceof ICorporeaRequestor) { - ICorporeaRequestor requestor = (ICorporeaRequestor) inv; + InvWithLocation inv = spark.getSparkInventory(); + if(inv != null && inv.world.getTileEntity(inv.pos) instanceof ICorporeaRequestor) { + ICorporeaRequestor requestor = (ICorporeaRequestor) inv.world.getTileEntity(inv.pos); requestor.doCorporeaRequest(request, requestCount, spark); pendingRequest = false; - worldObj.func_147453_f(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord)); + worldObj.updateComparatorOutputLevel(getPos(), worldObj.getBlockState(getPos()).getBlock()); } } } @Override - public void writeCustomNBT(NBTTagCompound cmp) { - super.writeCustomNBT(cmp); + public void writePacketNBT(NBTTagCompound cmp) { + super.writePacketNBT(cmp); cmp.setBoolean(TAG_PENDING_REQUEST, pendingRequest); - cmp.setInteger(TAG_REQUEST_X, requestX); - cmp.setInteger(TAG_REQUEST_Y, requestY); - cmp.setInteger(TAG_REQUEST_Z, requestZ); + cmp.setInteger(TAG_REQUEST_X, requestPos.getX()); + cmp.setInteger(TAG_REQUEST_Y, requestPos.getY()); + cmp.setInteger(TAG_REQUEST_Z, requestPos.getZ()); int reqType = REQUEST_NULL; if(request != null) @@ -100,13 +99,14 @@ public class TileCorporeaRetainer extends TileMod { } @Override - public void readCustomNBT(NBTTagCompound cmp) { - super.readCustomNBT(cmp); + public void readPacketNBT(NBTTagCompound cmp) { + super.readPacketNBT(cmp); pendingRequest = cmp.getBoolean(TAG_PENDING_REQUEST); - requestX = cmp.getInteger(TAG_REQUEST_X); - requestY = cmp.getInteger(TAG_REQUEST_Y); - requestZ = cmp.getInteger(TAG_REQUEST_Z); + int x = cmp.getInteger(TAG_REQUEST_X); + int y = cmp.getInteger(TAG_REQUEST_Y); + int z = cmp.getInteger(TAG_REQUEST_Z); + requestPos = new BlockPos(x, y, z); int reqType = cmp.getInteger(TAG_REQUEST_TYPE); switch (reqType) { diff --git a/src/main/java/vazkii/botania/common/block/tile/mana/TileBellows.java b/src/main/java/vazkii/botania/common/block/tile/mana/TileBellows.java index 11dfaa35f..1b2658fc8 100644 --- a/src/main/java/vazkii/botania/common/block/tile/mana/TileBellows.java +++ b/src/main/java/vazkii/botania/common/block/tile/mana/TileBellows.java @@ -10,12 +10,17 @@ */ package vazkii.botania.common.block.tile.mana; +import net.minecraft.block.BlockFurnace; import net.minecraft.init.Blocks; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityFurnace; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.SoundCategory; import vazkii.botania.api.internal.VanillaPacketDispatcher; +import vazkii.botania.api.sound.BotaniaSoundEvents; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.common.block.subtile.functional.SubTileExoflame; import vazkii.botania.common.block.tile.TileMod; @@ -33,7 +38,7 @@ public class TileBellows extends TileMod { } @Override - public void updateEntity() { + public void update() { boolean disable = true; TileEntity tile = getLinkedTile(); if(!active && tile instanceof TilePool) { @@ -53,39 +58,41 @@ public class TileBellows extends TileMod { if(movePos < max && active && moving >= 0F) { if(moving == 0F) - worldObj.playSoundEffect(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, "botania:bellows", 0.1F, 3F); + worldObj.playSound(null, pos, BotaniaSoundEvents.bellows, SoundCategory.BLOCKS, 0.1F, 3F); if(tile instanceof TileEntityFurnace) { TileEntityFurnace furnace = (TileEntityFurnace) tile; if(SubTileExoflame.canFurnaceSmelt(furnace)) { - furnace.furnaceCookTime = Math.min(199, furnace.furnaceCookTime + 20); - furnace.furnaceBurnTime = Math.max(0, furnace.furnaceBurnTime - 10); + furnace.setField(2, Math.min(199, furnace.getField(2) + 20)); // cookTime + furnace.setField(0, Math.max(0, furnace.getField(0) - 10)); // burnTime } - if(furnace.getBlockType() == Blocks.lit_furnace) { + if(furnace.hasWorldObj() && furnace.getBlockType() == Blocks.LIT_FURNACE) { // Copypasta from BlockFurnace - int x = furnace.xCoord; - int y = furnace.yCoord; - int z = furnace.zCoord; - int l = worldObj.getBlockMetadata(x, y, z); - float f = x + 0.5F; - float f1 = y + 0.0F + worldObj.rand.nextFloat() * 6.0F / 16.0F; - float f2 = z + 0.5F; - float f3 = 0.52F; - float f4 = worldObj.rand.nextFloat() * 0.6F - 0.3F; + EnumFacing enumfacing = worldObj.getBlockState(furnace.getPos()).getValue(BlockFurnace.FACING); + double d0 = (double)pos.getX() + 0.5D; + double d1 = (double)pos.getY() + worldObj.rand.nextDouble() * 6.0D / 16.0D; + double d2 = (double)pos.getZ() + 0.5D; + double d3 = 0.52D; + double d4 = worldObj.rand.nextDouble() * 0.6D - 0.3D; - if(l == 4) { - worldObj.spawnParticle("smoke", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D); - worldObj.spawnParticle("flame", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D); - } else if(l == 5) { - worldObj.spawnParticle("smoke", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D); - worldObj.spawnParticle("flame", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D); - } else if(l == 2) { - worldObj.spawnParticle("smoke", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D); - worldObj.spawnParticle("flame", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D); - } else if(l == 3) { - worldObj.spawnParticle("smoke", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D); - worldObj.spawnParticle("flame", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D); + switch (enumfacing) + { + case WEST: + worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 - d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D); + worldObj.spawnParticle(EnumParticleTypes.FLAME, d0 - d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D); + break; + case EAST: + worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D); + worldObj.spawnParticle(EnumParticleTypes.FLAME, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D); + break; + case NORTH: + worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 - d3, 0.0D, 0.0D, 0.0D); + worldObj.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 - d3, 0.0D, 0.0D, 0.0D); + break; + case SOUTH: + worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 + d3, 0.0D, 0.0D, 0.0D); + worldObj.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 + d3, 0.0D, 0.0D, 0.0D); } } } @@ -107,22 +114,20 @@ public class TileBellows extends TileMod { } } - super.updateEntity(); } public TileEntity getLinkedTile() { - int meta = getBlockMetadata(); - ForgeDirection dir = ForgeDirection.getOrientation(meta); - return worldObj.getTileEntity(xCoord + dir.offsetX, yCoord, zCoord + dir.offsetZ); + EnumFacing side = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.CARDINALS); + return worldObj.getTileEntity(getPos().offset(side)); } @Override - public void writeCustomNBT(NBTTagCompound cmp) { + public void writePacketNBT(NBTTagCompound cmp) { cmp.setBoolean(TAG_ACTIVE, active); } @Override - public void readCustomNBT(NBTTagCompound cmp) { + public void readPacketNBT(NBTTagCompound cmp) { active = cmp.getBoolean(TAG_ACTIVE); } @@ -131,7 +136,7 @@ public class TileBellows extends TileMod { boolean diff = this.active != active; this.active = active; if(diff) - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, xCoord, yCoord, zCoord); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/mana/TileDistributor.java b/src/main/java/vazkii/botania/common/block/tile/mana/TileDistributor.java index e0aa3d60f..ae11b8d8b 100644 --- a/src/main/java/vazkii/botania/common/block/tile/mana/TileDistributor.java +++ b/src/main/java/vazkii/botania/common/block/tile/mana/TileDistributor.java @@ -10,27 +10,28 @@ */ package vazkii.botania.common.block.tile.mana; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.util.EnumFacing; import vazkii.botania.api.internal.VanillaPacketDispatcher; import vazkii.botania.api.mana.IManaPool; import vazkii.botania.api.mana.IManaReceiver; import vazkii.botania.common.block.tile.TileMod; -import vazkii.botania.common.lib.LibMisc; + +import java.util.ArrayList; +import java.util.List; public class TileDistributor extends TileMod implements IManaReceiver { - List validPools = new ArrayList(); + final List validPools = new ArrayList<>(); @Override - public void updateEntity() { + public void update() { + if (worldObj.isRemote) + return; validPools.clear(); - for(ForgeDirection dir : LibMisc.CARDINAL_DIRECTIONS) { - TileEntity tileAt = worldObj.getTileEntity(xCoord + dir.offsetX, yCoord, zCoord + dir.offsetZ); - if(tileAt != null && tileAt instanceof IManaPool) { + for(EnumFacing dir : EnumFacing.HORIZONTALS) { + TileEntity tileAt = worldObj.getTileEntity(pos.offset(dir)); + if(tileAt != null && tileAt instanceof IManaPool && !tileAt.isInvalid()) { IManaReceiver receiver = (IManaReceiver) tileAt; if(!receiver.isFull()) validPools.add(receiver); @@ -56,7 +57,7 @@ public class TileDistributor extends TileMod implements IManaReceiver { for(IManaReceiver pool : validPools) { pool.recieveMana(manaForEach); TileEntity tile = (TileEntity) pool; - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, tile.xCoord, tile.yCoord, tile.zCoord); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, tile.getPos()); } } } diff --git a/src/main/java/vazkii/botania/common/block/tile/mana/TileManaDetector.java b/src/main/java/vazkii/botania/common/block/tile/mana/TileManaDetector.java index 90bd75db1..b9184d21c 100644 --- a/src/main/java/vazkii/botania/common/block/tile/mana/TileManaDetector.java +++ b/src/main/java/vazkii/botania/common/block/tile/mana/TileManaDetector.java @@ -10,31 +10,26 @@ */ package vazkii.botania.common.block.tile.mana; -import net.minecraft.util.AxisAlignedBB; +import com.google.common.base.Predicates; +import net.minecraft.entity.Entity; +import net.minecraft.util.math.AxisAlignedBB; import vazkii.botania.api.internal.IManaBurst; -import vazkii.botania.api.mana.IManaCollisionGhost; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.common.Botania; import vazkii.botania.common.block.tile.TileMod; -public class TileManaDetector extends TileMod implements IManaCollisionGhost { +public class TileManaDetector extends TileMod { @Override - public void updateEntity() { - if(!worldObj.isRemote) { - int meta = getBlockMetadata(); - int expectedMeta = worldObj.getEntitiesWithinAABB(IManaBurst.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1)).size() != 0 ? 1 : 0; - if(meta != expectedMeta) - worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, expectedMeta, 1 | 2); + public void update() { + boolean state = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED); + boolean expectedState = worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(pos, pos.add(1, 1, 1)), Predicates.instanceOf(IManaBurst.class)).size() != 0; + if(state != expectedState && !worldObj.isRemote) + worldObj.setBlockState(getPos(), worldObj.getBlockState(getPos()).withProperty(BotaniaStateProps.POWERED, expectedState), 1 | 2); - if(expectedMeta == 1) - for(int i = 0; i < 4; i++) - Botania.proxy.sparkleFX(getWorldObj(), xCoord + Math.random(), yCoord + Math.random(), zCoord + Math.random(), 1F, 0.2F, 0.2F, 0.7F + 0.5F * (float) Math.random(), 5); - } - } - - @Override - public boolean isGhost() { - return true; + if(expectedState) + for(int i = 0; i < 4; i++) + Botania.proxy.sparkleFX(pos.getX() + Math.random(), pos.getY() + Math.random(), pos.getZ() + Math.random(), 1F, 0.2F, 0.2F, 0.7F + 0.5F * (float) Math.random(), 5); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/mana/TileManaVoid.java b/src/main/java/vazkii/botania/common/block/tile/mana/TileManaVoid.java index d4b240ed0..e739294d3 100644 --- a/src/main/java/vazkii/botania/common/block/tile/mana/TileManaVoid.java +++ b/src/main/java/vazkii/botania/common/block/tile/mana/TileManaVoid.java @@ -16,11 +16,6 @@ import vazkii.botania.common.block.tile.TileMod; public class TileManaVoid extends TileMod implements IClientManaHandler { - @Override - public boolean canUpdate() { - return false; - } - @Override public int getCurrentMana() { return 0; @@ -35,7 +30,7 @@ public class TileManaVoid extends TileMod implements IClientManaHandler { public void recieveMana(int mana) { if(mana > 0) for(int i = 0; i < 10; i++) - Botania.proxy.sparkleFX(getWorldObj(), xCoord + Math.random(), yCoord + Math.random(), zCoord + Math.random(), 0.2F, 0.2F, 0.2F, 0.7F + 0.5F * (float) Math.random(), 5); + Botania.proxy.sparkleFX(pos.getX() + Math.random(), pos.getY() + Math.random(), pos.getZ() + Math.random(), 0.2F, 0.2F, 0.2F, 0.7F + 0.5F * (float) Math.random(), 5); } @Override diff --git a/src/main/java/vazkii/botania/common/block/tile/mana/TilePool.java b/src/main/java/vazkii/botania/common/block/tile/mana/TilePool.java index f6252385b..845cb6a15 100644 --- a/src/main/java/vazkii/botania/common/block/tile/mana/TilePool.java +++ b/src/main/java/vazkii/botania/common/block/tile/mana/TilePool.java @@ -10,30 +10,32 @@ */ package vazkii.botania.common.block.tile.mana; -import java.awt.Color; -import java.util.List; - +import com.google.common.base.Predicates; import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.resources.I18n; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.EnumDyeColor; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.network.play.server.SPacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.StatCollector; -import net.minecraftforge.common.util.ForgeDirection; - +import net.minecraft.util.EnumFacing; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import org.lwjgl.opengl.GL11; - import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.internal.VanillaPacketDispatcher; -import vazkii.botania.api.item.IDyablePool; import vazkii.botania.api.item.IManaDissolvable; import vazkii.botania.api.mana.IKeyLocked; import vazkii.botania.api.mana.IManaItem; @@ -43,8 +45,10 @@ import vazkii.botania.api.mana.ManaNetworkEvent; import vazkii.botania.api.mana.spark.ISparkAttachable; import vazkii.botania.api.mana.spark.ISparkEntity; import vazkii.botania.api.recipe.RecipeManaInfusion; +import vazkii.botania.api.sound.BotaniaSoundEvents; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.PoolVariant; import vazkii.botania.client.core.handler.HUDHandler; -import vazkii.botania.client.core.handler.LightningHandler; import vazkii.botania.client.core.helper.RenderHelper; import vazkii.botania.client.lib.LibResources; import vazkii.botania.common.Botania; @@ -52,13 +56,20 @@ import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.tile.TileMod; import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.core.handler.ManaNetworkHandler; -import vazkii.botania.common.core.helper.Vector3; +import vazkii.botania.common.core.handler.MethodHandles; import vazkii.botania.common.item.ItemManaTablet; import vazkii.botania.common.item.ModItems; -import vazkii.botania.common.lib.LibMisc; +import vazkii.botania.common.network.PacketBotaniaEffect; +import vazkii.botania.common.network.PacketHandler; -public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLocked, ISparkAttachable, IThrottledPacket { +import javax.annotation.Nonnull; +import java.awt.*; +import java.util.ArrayList; +import java.util.List; +public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAttachable, IThrottledPacket { + + public static final Color PARTICLE_COLOR = new Color(0x00C6FF); public static final int MAX_MANA = 1000000; public static final int MAX_MANA_DILLUTED = 10000; @@ -73,39 +84,45 @@ public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLoc private static final String TAG_INPUT_KEY = "inputKey"; private static final String TAG_OUTPUT_KEY = "outputKey"; - boolean outputting = false; - public boolean alchemy = false; - public boolean conjuration = false; - boolean catalystsRegistered = false; + private boolean outputting = false; - public int color = 0; + public EnumDyeColor color = EnumDyeColor.WHITE; int mana; - int knownMana = -1; + private int knownMana = -1; public int manaCap = -1; - int soundTicks = 0; - boolean canAccept = true; - boolean canSpare = true; + private int soundTicks = 0; + private boolean canAccept = true; + private boolean canSpare = true; public boolean fragile = false; - public boolean isDoingTransfer = false; - public int ticksDoingTransfer = 0; + boolean isDoingTransfer = false; + int ticksDoingTransfer = 0; - String inputKey = ""; - String outputKey = ""; + private String inputKey = ""; + private final String outputKey = ""; - int ticks = 0; - boolean sendPacket = false; + private int ticks = 0; + private boolean sendPacket = false; + + @Override + public boolean shouldRefresh(World world, BlockPos pos, @Nonnull IBlockState oldState, @Nonnull IBlockState newState) { + if(oldState.getBlock() != newState.getBlock()) + return true; + if(oldState.getBlock() != ModBlocks.pool || newState.getBlock() != ModBlocks.pool) + return true; + return oldState.getValue(BotaniaStateProps.POOL_VARIANT) != newState.getValue(BotaniaStateProps.POOL_VARIANT); + } @Override public boolean isFull() { - Block blockBelow = worldObj.getBlock(xCoord, yCoord - 1, zCoord); + Block blockBelow = worldObj.getBlockState(pos.down()).getBlock(); return blockBelow != ModBlocks.manaVoid && getCurrentMana() >= manaCap; } @Override public void recieveMana(int mana) { this.mana = Math.max(0, Math.min(getCurrentMana() + mana, manaCap)); - worldObj.func_147453_f(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord)); + worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock()); markDispatchable(); } @@ -121,14 +138,30 @@ public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLoc invalidate(); } + public static RecipeManaInfusion getMatchingRecipe(@Nonnull ItemStack stack, @Nonnull IBlockState state) { + List matchingNonCatRecipes = new ArrayList<>(); + List matchingCatRecipes = new ArrayList<>(); + + for (RecipeManaInfusion recipe : BotaniaAPI.manaInfusionRecipes) { + if (recipe.matches(stack)) { + if(recipe.getCatalyst() == null) + matchingNonCatRecipes.add(recipe); + else if (recipe.getCatalyst() == state) + matchingCatRecipes.add(recipe); + } + } + + // Recipes with matching catalyst take priority above recipes with no catalyst specified + return !matchingCatRecipes.isEmpty() ? matchingCatRecipes.get(0) : + !matchingNonCatRecipes.isEmpty() ? matchingNonCatRecipes.get(0) : + null; + } + public boolean collideEntityItem(EntityItem item) { - if(item.isDead) + if(worldObj.isRemote || item.isDead) return false; - boolean didChange = false; ItemStack stack = item.getEntityItem(); - if(stack == null) - return false; if(stack.getItem() instanceof IManaDissolvable) { ((IManaDissolvable) stack.getItem()).onDissolveTick(this, stack, item); @@ -136,69 +169,70 @@ public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLoc item.setDead(); } - if(item.age > 100 && item.age < 130 || !catalystsRegistered) + int age; + try { + age = ((int) MethodHandles.itemAge_getter.invokeExact(item)); + } catch (Throwable throwable) { return false; } + + if(age > 100 && age < 130) return false; - for(RecipeManaInfusion recipe : BotaniaAPI.manaInfusionRecipes) { - if(recipe.matches(stack) && (!recipe.isAlchemy() || alchemy) && (!recipe.isConjuration() || conjuration)) { - int mana = recipe.getManaToConsume(); - if(getCurrentMana() >= mana) { - recieveMana(-mana); + RecipeManaInfusion recipe = getMatchingRecipe(stack, worldObj.getBlockState(pos.down())); - if(!worldObj.isRemote) { - stack.stackSize--; - if(stack.stackSize == 0) - item.setDead(); + if(recipe != null) { + int mana = recipe.getManaToConsume(); + if(getCurrentMana() >= mana) { + recieveMana(-mana); - ItemStack output = recipe.getOutput().copy(); - EntityItem outputItem = new EntityItem(worldObj, xCoord + 0.5, yCoord + 1.5, zCoord + 0.5, output); - outputItem.age = 105; - worldObj.spawnEntityInWorld(outputItem); - } + stack.stackSize--; + if(stack.stackSize == 0) + item.setDead(); - craftingFanciness(); - didChange = true; - } + ItemStack output = recipe.getOutput().copy(); + EntityItem outputItem = new EntityItem(worldObj, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, output); + try { + MethodHandles.itemAge_setter.invokeExact(outputItem, 105); + } catch (Throwable ignored) {} + worldObj.spawnEntityInWorld(outputItem); - break; + craftingFanciness(); + return true; } } - return didChange; + return false; } - public void craftingFanciness() { + private void craftingFanciness() { if(soundTicks == 0) { - worldObj.playSoundEffect(xCoord, yCoord, zCoord, "botania:manaPoolCraft", 0.4F, 4F); + worldObj.playSound(null, pos, BotaniaSoundEvents.manaPoolCraft, SoundCategory.BLOCKS, 0.4F, 4F); soundTicks = 6; } - for(int i = 0; i < 25; i++) { - float red = (float) Math.random(); - float green = (float) Math.random(); - float blue = (float) Math.random(); - Botania.proxy.sparkleFX(worldObj, xCoord + 0.5 + Math.random() * 0.4 - 0.2, yCoord + 1, zCoord + 0.5 + Math.random() * 0.4 - 0.2, red, green, blue, (float) Math.random(), 10); - } + PacketHandler.sendToNearby(worldObj, getPos(), + new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.POOL_CRAFT, pos.getX(), pos.getY(), pos.getZ())); } @Override - public void updateEntity() { - boolean wasDoingTransfer = isDoingTransfer; - isDoingTransfer = false; + public void update() { if(manaCap == -1) - manaCap = getBlockMetadata() == 2 ? MAX_MANA_DILLUTED : MAX_MANA; + manaCap = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POOL_VARIANT) == PoolVariant.DILUTED ? MAX_MANA_DILLUTED : MAX_MANA; if(!ManaNetworkHandler.instance.isPoolIn(this) && !isInvalid()) ManaNetworkEvent.addPool(this); - if(soundTicks > 0) - soundTicks--; - if(worldObj.isRemote) { double particleChance = 1F - (double) getCurrentMana() / (double) manaCap * 0.1; - Color color = new Color(0x00C6FF); if(Math.random() > particleChance) - Botania.proxy.wispFX(worldObj, xCoord + 0.3 + Math.random() * 0.5, yCoord + 0.6 + Math.random() * 0.25, zCoord + Math.random(), color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random() / 3F, (float) -Math.random() / 25F, 2F); + Botania.proxy.wispFX(pos.getX() + 0.3 + Math.random() * 0.5, pos.getY() + 0.6 + Math.random() * 0.25, pos.getZ() + Math.random(), PARTICLE_COLOR.getRed() / 255F, PARTICLE_COLOR.getGreen() / 255F, PARTICLE_COLOR.getBlue() / 255F, (float) Math.random() / 3F, (float) -Math.random() / 25F, 2F); + return; + } + + boolean wasDoingTransfer = isDoingTransfer; + isDoingTransfer = false; + + if(soundTicks > 0) { + soundTicks--; } if(sendPacket && ticks % 10 == 0) { @@ -206,11 +240,7 @@ public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLoc sendPacket = false; } - alchemy = worldObj.getBlock(xCoord, yCoord - 1, zCoord) == ModBlocks.alchemyCatalyst; - conjuration = worldObj.getBlock(xCoord, yCoord - 1, zCoord) == ModBlocks.conjurationCatalyst; - catalystsRegistered = true; - - List items = worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1)); + List items = worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos, pos.add(1, 1, 1))); for(EntityItem item : items) { if(item.isDead) continue; @@ -223,8 +253,8 @@ public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLoc int bellowCount = 0; if(outputting) - for(ForgeDirection dir : LibMisc.CARDINAL_DIRECTIONS) { - TileEntity tile = worldObj.getTileEntity(xCoord + dir.offsetX, yCoord, zCoord + dir.offsetZ); + for(EnumFacing dir : EnumFacing.HORIZONTALS) { + TileEntity tile = worldObj.getTileEntity(pos.offset(dir)); if(tile != null && tile instanceof TileBellows && ((TileBellows) tile).getLinkedTile() == this) bellowCount++; } @@ -236,8 +266,7 @@ public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLoc didSomething = true; int manaVal = Math.min(transfRate, Math.min(getCurrentMana(), mana.getMaxMana(stack) - mana.getMana(stack))); - if(!worldObj.isRemote) - mana.addMana(stack, manaVal); + mana.addMana(stack, manaVal); recieveMana(-manaVal); } } else { @@ -246,17 +275,15 @@ public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLoc didSomething = true; int manaVal = Math.min(transfRate, Math.min(manaCap - getCurrentMana(), mana.getMana(stack))); - if(!worldObj.isRemote) - mana.addMana(stack, -manaVal); + mana.addMana(stack, -manaVal); recieveMana(manaVal); } } if(didSomething) { - if(worldObj.isRemote && ConfigHandler.chargingAnimationEnabled && worldObj.rand.nextInt(20) == 0) { - Vector3 itemVec = Vector3.fromTileEntity(this).add(0.5, 0.5 + Math.random() * 0.3, 0.5); - Vector3 tileVec = Vector3.fromTileEntity(this).add(0.2 + Math.random() * 0.6, 0, 0.2 + Math.random() * 0.6); - LightningHandler.spawnLightningBolt(worldObj, outputting ? tileVec : itemVec, outputting ? itemVec : tileVec, 80, worldObj.rand.nextLong(), 0x4400799c, 0x4400C6FF); + if(ConfigHandler.chargingAnimationEnabled && worldObj.rand.nextInt(20) == 0) { + PacketHandler.sendToNearby(worldObj, getPos(), + new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.POOL_CHARGE, getPos().getX(), getPos().getY(), getPos().getZ(), outputting ? 1 : 0)); } isDoingTransfer = outputting; } @@ -276,10 +303,10 @@ public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLoc } @Override - public void writeCustomNBT(NBTTagCompound cmp) { + public void writePacketNBT(NBTTagCompound cmp) { cmp.setInteger(TAG_MANA, mana); cmp.setBoolean(TAG_OUTPUTTING, outputting); - cmp.setInteger(TAG_COLOR, color); + cmp.setInteger(TAG_COLOR, color.getMetadata()); cmp.setInteger(TAG_MANA_CAP, manaCap); cmp.setBoolean(TAG_CAN_ACCEPT, canAccept); @@ -291,10 +318,10 @@ public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLoc } @Override - public void readCustomNBT(NBTTagCompound cmp) { + public void readPacketNBT(NBTTagCompound cmp) { mana = cmp.getInteger(TAG_MANA); outputting = cmp.getBoolean(TAG_OUTPUTTING); - color = cmp.getInteger(TAG_COLOR); + color = EnumDyeColor.byMetadata(cmp.getInteger(TAG_COLOR)); if(cmp.hasKey(TAG_MANA_CAP)) manaCap = cmp.getInteger(TAG_MANA_CAP); @@ -319,23 +346,24 @@ public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLoc if(player.isSneaking()) { outputting = !outputting; - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, xCoord, yCoord, zCoord); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos); } if(!worldObj.isRemote) { NBTTagCompound nbttagcompound = new NBTTagCompound(); - writeCustomNBT(nbttagcompound); + writePacketNBT(nbttagcompound); nbttagcompound.setInteger(TAG_KNOWN_MANA, getCurrentMana()); if(player instanceof EntityPlayerMP) - ((EntityPlayerMP) player).playerNetServerHandler.sendPacket(new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, -999, nbttagcompound)); + ((EntityPlayerMP) player).connection.sendPacket(new SPacketUpdateTileEntity(pos, -999, nbttagcompound)); } - worldObj.playSoundAtEntity(player, "botania:ding", 0.11F, 1F); + worldObj.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.ding, SoundCategory.PLAYERS, 0.11F, 1F); } + @SideOnly(Side.CLIENT) public void renderHUD(Minecraft mc, ScaledResolution res) { - ItemStack pool = new ItemStack(ModBlocks.pool, 1, getBlockMetadata()); - String name = StatCollector.translateToLocal(pool.getUnlocalizedName().replaceAll("tile.", "tile." + LibResources.PREFIX_MOD) + ".name"); + ItemStack pool = new ItemStack(ModBlocks.pool, 1, worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POOL_VARIANT).ordinal()); + String name = I18n.format(pool.getUnlocalizedName().replaceAll("tile.", "tile." + LibResources.PREFIX_MOD) + ".name"); int color = 0x4444FF; HUDHandler.drawSimpleManaHUD(color, knownMana, manaCap, name, res); @@ -345,23 +373,23 @@ public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLoc int u = outputting ? 22 : 0; int v = 38; - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); mc.renderEngine.bindTexture(HUDHandler.manaBar); RenderHelper.drawTexturedModalRect(x, y, 0, u, v, 22, 15); - GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.color(1F, 1F, 1F, 1F); ItemStack tablet = new ItemStack(ModItems.manaTablet); ItemManaTablet.setStackCreative(tablet); net.minecraft.client.renderer.RenderHelper.enableGUIStandardItemLighting(); - RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, tablet, x - 20, y); - RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, pool, x + 26, y); + mc.getRenderItem().renderItemAndEffectIntoGUI(tablet, x - 20, y); + mc.getRenderItem().renderItemAndEffectIntoGUI(pool, x + 26, y); net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting(); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_BLEND); + GlStateManager.disableLighting(); + GlStateManager.disableBlend(); } @Override @@ -376,7 +404,7 @@ public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLoc @Override public int getCurrentMana() { - return worldObj != null && getBlockMetadata() == 1 ? MAX_MANA : mana; + return worldObj != null && worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POOL_VARIANT) == PoolVariant.CREATIVE ? MAX_MANA : mana; } @Override @@ -395,13 +423,11 @@ public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLoc } @Override - public void attachSpark(ISparkEntity entity) { - // NO-OP - } + public void attachSpark(ISparkEntity entity) {} @Override public ISparkEntity getAttachedSpark() { - List sparks = worldObj.getEntitiesWithinAABB(ISparkEntity.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord + 1, zCoord, xCoord + 1, yCoord + 2, zCoord + 1)); + List sparks = worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(pos.up(), pos.up().add(1, 1, 1)), Predicates.instanceOf(ISparkEntity.class)); if(sparks.size() == 1) { Entity e = (Entity) sparks.get(0); return (ISparkEntity) e; @@ -421,13 +447,14 @@ public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLoc } @Override - public int getColor() { + public EnumDyeColor getColor() { return color; } @Override - public void setColor(int color) { + public void setColor(EnumDyeColor color) { this.color = color; + worldObj.notifyBlockUpdate(pos, worldObj.getBlockState(pos), worldObj.getBlockState(pos), 0b1011); } @Override diff --git a/src/main/java/vazkii/botania/common/block/tile/mana/TilePrism.java b/src/main/java/vazkii/botania/common/block/tile/mana/TilePrism.java index 974315976..f8b790512 100644 --- a/src/main/java/vazkii/botania/common/block/tile/mana/TilePrism.java +++ b/src/main/java/vazkii/botania/common/block/tile/mana/TilePrism.java @@ -11,21 +11,20 @@ package vazkii.botania.common.block.tile.mana; import net.minecraft.entity.Entity; -import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import vazkii.botania.api.internal.IManaBurst; +import vazkii.botania.api.internal.VanillaPacketDispatcher; import vazkii.botania.api.mana.BurstProperties; import vazkii.botania.api.mana.ILens; -import vazkii.botania.api.mana.IManaCollisionGhost; import vazkii.botania.api.mana.ITinyPlanetExcempt; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.common.block.tile.TileSimpleInventory; -import vazkii.botania.common.lib.LibBlockNames; -public class TilePrism extends TileSimpleInventory implements IManaCollisionGhost, ISidedInventory { +public class TilePrism extends TileSimpleInventory { public void onBurstCollision(IManaBurst burst) { - ItemStack lens = getStackInSlot(0); - boolean active = (getBlockMetadata() & 8) == 0; + ItemStack lens = itemHandler.getStackInSlot(0); + boolean active = !worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED); boolean valid = lens != null && lens.getItem() instanceof ILens && (!(lens.getItem() instanceof ITinyPlanetExcempt) || ((ITinyPlanetExcempt) lens.getItem()).shouldPull(lens)); if(active) { @@ -49,34 +48,27 @@ public class TilePrism extends TileSimpleInventory implements IManaCollisionGhos } } - @Override - public boolean isGhost() { - return true; - } - @Override public int getSizeInventory() { return 1; } @Override - public String getInventoryName() { - return LibBlockNames.PRISM; + protected SimpleItemStackHandler createItemHandler() { + return new SimpleItemStackHandler(this, true) { + @Override + public ItemStack insertItem(int slot, ItemStack stack, boolean simulate) { + if(stack != null && stack.getItem() instanceof ILens) + return super.insertItem(slot, stack, simulate); + else return stack; + } + }; } @Override - public int[] getAccessibleSlotsFromSide(int p_94128_1_) { - return new int[] { 0 }; - } - - @Override - public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_) { - return p_102007_2_.getItem() instanceof ILens; - } - - @Override - public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) { - return true; + public void markDirty() { + super.markDirty(); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(this); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/mana/TilePump.java b/src/main/java/vazkii/botania/common/block/tile/mana/TilePump.java index e5adc8b70..57ffa9bb3 100644 --- a/src/main/java/vazkii/botania/common/block/tile/mana/TilePump.java +++ b/src/main/java/vazkii/botania/common/block/tile/mana/TilePump.java @@ -10,11 +10,23 @@ */ package vazkii.botania.common.block.tile.mana; +import com.google.common.collect.ImmutableMap; import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.model.ModelLoaderRegistry; +import net.minecraftforge.common.animation.TimeValues; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.model.animation.CapabilityAnimation; +import net.minecraftforge.common.model.animation.IAnimationStateMachine; +import net.minecraftforge.fml.common.FMLCommonHandler; +import net.minecraftforge.fml.relauncher.Side; import vazkii.botania.api.internal.VanillaPacketDispatcher; import vazkii.botania.common.block.tile.TileMod; +import javax.annotation.Nonnull; + public class TilePump extends TileMod { private static final String TAG_ACTIVE = "active"; @@ -27,13 +39,40 @@ public class TilePump extends TileMod { public int comparator; public boolean hasRedstone = false; - int lastComparator = 0; + private int lastComparator = 0; + + private final TimeValues.VariableValue move; + private final IAnimationStateMachine asm; + + public TilePump() { + if (FMLCommonHandler.instance().getSide() == Side.CLIENT) { + move = new TimeValues.VariableValue(0); + asm = ModelLoaderRegistry.loadASM(new ResourceLocation("botania", "asms/block/pump.json"), ImmutableMap.of("move", move)); + } else { + move = null; + asm = null; + } + } @Override - public void updateEntity() { + public boolean hasCapability(@Nonnull Capability cap, @Nonnull EnumFacing side) { + return cap == CapabilityAnimation.ANIMATION_CAPABILITY || super.hasCapability(cap, side); + } + + @Nonnull + @Override + public T getCapability(@Nonnull Capability cap, @Nonnull EnumFacing side) { + if (cap == CapabilityAnimation.ANIMATION_CAPABILITY) { + return CapabilityAnimation.ANIMATION_CAPABILITY.cast(asm); + } + return super.getCapability(cap, side); + } + + @Override + public void update() { hasRedstone = false; - for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { - int redstoneSide = worldObj.getIndirectPowerLevelTo(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir.ordinal()); + for(EnumFacing dir : EnumFacing.VALUES) { + int redstoneSide = worldObj.getRedstonePower(pos.offset(dir), dir); if(redstoneSide > 0) { hasRedstone = true; break; @@ -52,7 +91,7 @@ public class TilePump extends TileMod { innerRingPos = Math.min(max, innerRingPos); moving = 0F; for(int x = 0; x < 2; x++) - worldObj.spawnParticle("explode", xCoord + Math.random(), yCoord + Math.random(), zCoord + Math.random(), 0, 0, 0); + worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_NORMAL, getPos().getX() + Math.random(), getPos().getY() + Math.random(), getPos().getZ() + Math.random(), 0, 0, 0); } } else if(innerRingPos > min) { innerRingPos -= incr * 2; @@ -63,6 +102,9 @@ public class TilePump extends TileMod { } } + if(worldObj.isRemote) + move.setValue(innerRingPos / 8 * 0.5F); // rescale to 0 - 0.5 for json animation + if(!hasCartOnTop) comparator = 0; if(!hasCart && active) @@ -74,20 +116,22 @@ public class TilePump extends TileMod { hasCartOnTop = false; if(comparator != lastComparator) - worldObj.func_147453_f(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord)); + worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock()); lastComparator = comparator; - - super.updateEntity(); } @Override - public void writeCustomNBT(NBTTagCompound cmp) { + public void writePacketNBT(NBTTagCompound cmp) { cmp.setBoolean(TAG_ACTIVE, active); } @Override - public void readCustomNBT(NBTTagCompound cmp) { + public void readPacketNBT(NBTTagCompound cmp) { + boolean prevActive = active; active = cmp.getBoolean(TAG_ACTIVE); + if(worldObj != null && worldObj.isRemote) + if(prevActive != active) + asm.transition(active ? "moving" : "default"); } public void setActive(boolean active) { @@ -95,8 +139,7 @@ public class TilePump extends TileMod { boolean diff = this.active != active; this.active = active; if(diff) - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, xCoord, yCoord, zCoord); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos); } } - } diff --git a/src/main/java/vazkii/botania/common/block/tile/mana/TileRFGenerator.java b/src/main/java/vazkii/botania/common/block/tile/mana/TileRFGenerator.java index 59e76677f..18ef60515 100644 --- a/src/main/java/vazkii/botania/common/block/tile/mana/TileRFGenerator.java +++ b/src/main/java/vazkii/botania/common/block/tile/mana/TileRFGenerator.java @@ -10,14 +10,19 @@ */ package vazkii.botania.common.block.tile.mana; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; -import vazkii.botania.api.mana.IManaReceiver; -import vazkii.botania.common.block.tile.TileMod; import cofh.api.energy.IEnergyConnection; import cofh.api.energy.IEnergyReceiver; -import cpw.mods.fml.common.Optional; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraftforge.fml.common.Optional; +import vazkii.botania.api.mana.IManaReceiver; +import vazkii.botania.common.Botania; +import vazkii.botania.common.block.tile.TileMod; + +import java.util.EnumMap; +import java.util.Map; @Optional.Interface(iface = "cofh.api.energy.IEnergyConnection", modid = "CoFHAPI|energy") public class TileRFGenerator extends TileMod implements IManaReceiver, IEnergyConnection { @@ -26,11 +31,10 @@ public class TileRFGenerator extends TileMod implements IManaReceiver, IEnergyCo private static final int MAX_MANA = 1280 * CONVERSION_RATE; private static final String TAG_MANA = "mana"; - int mana = 0; // Thanks to skyboy for help with this cuz I'm a noob with RF - private IEnergyReceiver[] receiverCache; + private final EnumMap receiverCache = new EnumMap<>(EnumFacing.class); private boolean deadCache; @Override @@ -38,14 +42,11 @@ public class TileRFGenerator extends TileMod implements IManaReceiver, IEnergyCo public void validate() { super.validate(); deadCache = true; - receiverCache = null; } @Override - @Optional.Method(modid = "CoFHAPI|energy") - public void updateEntity() { - super.updateEntity(); - if(!worldObj.isRemote) { + public void update() { + if(!worldObj.isRemote && Botania.rfApiLoaded) { if(deadCache) reCache(); @@ -56,20 +57,17 @@ public class TileRFGenerator extends TileMod implements IManaReceiver, IEnergyCo } @Optional.Method(modid = "CoFHAPI|energy") - protected final int transmitEnergy(int energy) { - if(receiverCache != null) - for(int i = receiverCache.length; i-- > 0;) { - IEnergyReceiver tile = receiverCache[i]; - if(tile == null) - continue; + private final int transmitEnergy(int energy) { + for(Map.Entry e : receiverCache.entrySet()) { + IEnergyReceiver tile = e.getValue(); + if (tile == null) + continue; - ForgeDirection from = ForgeDirection.VALID_DIRECTIONS[i]; - if(tile.receiveEnergy(from, energy, true) > 0) - energy -= tile.receiveEnergy(from, energy, false); + energy -= tile.receiveEnergy(e.getKey().getOpposite(), energy, false); - if(energy <= 0) - return 0; - } + if (energy <= 0) + return 0; + } return energy; } @@ -77,39 +75,28 @@ public class TileRFGenerator extends TileMod implements IManaReceiver, IEnergyCo @Optional.Method(modid = "CoFHAPI|energy") private void reCache() { if(deadCache) { - for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) - onNeighborTileChange(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ); + for(EnumFacing dir : EnumFacing.VALUES) + onNeighborTileChange(pos.offset(dir)); deadCache = false; } } @Optional.Method(modid = "CoFHAPI|energy") - public void onNeighborTileChange(int x, int y, int z) { - TileEntity tile = worldObj.getTileEntity(x, y, z); + public void onNeighborTileChange(BlockPos pos) { + TileEntity tile = worldObj.getTileEntity(pos); - if(x < xCoord) - addCache(tile, 5); - else if(x > xCoord) - addCache(tile, 4); - else if(z < zCoord) - addCache(tile, 3); - else if(z > zCoord) - addCache(tile, 2); - else if(y < yCoord) - addCache(tile, 1); - else if(y > yCoord) - addCache(tile, 0); + BlockPos q = getPos(); + EnumFacing side = EnumFacing.getFacingFromVector(pos.getX() - q.getX(), pos.getY() - q.getY(), pos.getZ() - q.getZ()); + + addCache(tile, side); } @Optional.Method(modid = "CoFHAPI|energy") - private void addCache(TileEntity tile, int side) { - if(receiverCache != null) - receiverCache[side] = null; + private void addCache(TileEntity tile, EnumFacing side) { + receiverCache.remove(side); - if(tile instanceof IEnergyReceiver && ((IEnergyReceiver)tile).canConnectEnergy(ForgeDirection.VALID_DIRECTIONS[side])) { - if(receiverCache == null) - receiverCache = new IEnergyReceiver[6]; - receiverCache[side] = (IEnergyReceiver)tile; + if(tile instanceof IEnergyReceiver) { + receiverCache.put(side, (IEnergyReceiver)tile); } } @@ -134,17 +121,17 @@ public class TileRFGenerator extends TileMod implements IManaReceiver, IEnergyCo } @Override - public void writeCustomNBT(NBTTagCompound cmp) { + public void writePacketNBT(NBTTagCompound cmp) { cmp.setInteger(TAG_MANA, mana); } @Override - public void readCustomNBT(NBTTagCompound cmp) { + public void readPacketNBT(NBTTagCompound cmp) { mana = cmp.getInteger(TAG_MANA); } @Override - public boolean canConnectEnergy(ForgeDirection from) { + public boolean canConnectEnergy(EnumFacing from) { return true; } diff --git a/src/main/java/vazkii/botania/common/block/tile/mana/TileSpreader.java b/src/main/java/vazkii/botania/common/block/tile/mana/TileSpreader.java index dff35de37..2e0fbd19a 100644 --- a/src/main/java/vazkii/botania/common/block/tile/mana/TileSpreader.java +++ b/src/main/java/vazkii/botania/common/block/tile/mana/TileSpreader.java @@ -10,34 +10,36 @@ */ package vazkii.botania.common.block.tile.mana; -import java.util.List; -import java.util.UUID; - +import com.google.common.base.Predicates; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.resources.I18n; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.network.play.server.SPacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.StatCollector; -import net.minecraft.util.Vec3; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ITickable; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; - +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import org.lwjgl.opengl.GL11; - import vazkii.botania.api.internal.IManaBurst; import vazkii.botania.api.internal.VanillaPacketDispatcher; import vazkii.botania.api.mana.BurstProperties; +import vazkii.botania.api.mana.IDirectioned; import vazkii.botania.api.mana.IKeyLocked; import vazkii.botania.api.mana.ILens; import vazkii.botania.api.mana.ILensControl; @@ -46,9 +48,11 @@ import vazkii.botania.api.mana.IManaCollector; import vazkii.botania.api.mana.IManaPool; import vazkii.botania.api.mana.IManaReceiver; import vazkii.botania.api.mana.IManaSpreader; -import vazkii.botania.api.mana.IRedirectable; import vazkii.botania.api.mana.IThrottledPacket; import vazkii.botania.api.mana.ManaNetworkEvent; +import vazkii.botania.api.sound.BotaniaSoundEvents; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.SpreaderVariant; import vazkii.botania.api.wand.IWandBindable; import vazkii.botania.client.core.handler.HUDHandler; import vazkii.botania.client.lib.LibResources; @@ -59,9 +63,12 @@ import vazkii.botania.common.core.handler.ManaNetworkHandler; import vazkii.botania.common.core.helper.Vector3; import vazkii.botania.common.entity.EntityManaBurst; import vazkii.botania.common.entity.EntityManaBurst.PositionProperties; -import vazkii.botania.common.lib.LibBlockNames; -public class TileSpreader extends TileSimpleInventory implements IManaCollector, IWandBindable, IKeyLocked, IThrottledPacket, IManaSpreader, IRedirectable { +import javax.annotation.Nonnull; +import java.util.List; +import java.util.UUID; + +public class TileSpreader extends TileSimpleInventory implements IManaCollector, IWandBindable, IKeyLocked, IThrottledPacket, IManaSpreader, IDirectioned, ITickable { private static final int MAX_MANA = 1000; private static final int ULTRA_MAX_MANA = 6400; @@ -109,13 +116,13 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, float mmForcedVelocityMultiplier = 1F; String inputKey = ""; - String outputKey = ""; + final String outputKey = ""; // End Map Maker Tags - public static boolean staticRedstone = false; - public static boolean staticDreamwood = false; - public static boolean staticUltra = false; + public static final boolean staticRedstone = false; + public static final boolean staticDreamwood = false; + public static final boolean staticUltra = false; UUID identity; @@ -143,6 +150,15 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, List lastTentativeBurst; boolean invalidTentativeBurst = false; + @Override + public boolean shouldRefresh(World world, BlockPos pos, @Nonnull IBlockState oldState, @Nonnull IBlockState newState) { + if(oldState.getBlock() != newState.getBlock()) + return true; + if(oldState.getBlock() != ModBlocks.spreader || newState.getBlock() != ModBlocks.spreader) + return true; + return oldState.getValue(BotaniaStateProps.SPREADER_VARIANT) != newState.getValue(BotaniaStateProps.SPREADER_VARIANT); + } + @Override public boolean isFull() { return mana >= getMaxMana(); @@ -166,19 +182,18 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, } @Override - public void updateEntity() { + public void update() { boolean inNetwork = ManaNetworkHandler.instance.isCollectorIn(this); boolean wasInNetwork = inNetwork; if(!inNetwork && !isInvalid()) { ManaNetworkEvent.addCollector(this); - inNetwork = true; } boolean redstone = false; - for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { - TileEntity tileAt = worldObj.getTileEntity(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ); - if(tileAt instanceof IManaPool) { + for(EnumFacing dir : EnumFacing.VALUES) { + TileEntity tileAt = worldObj.getTileEntity(pos.offset(dir)); + if(worldObj.isBlockLoaded(pos.offset(dir), false) && tileAt instanceof IManaPool) { IManaPool pool = (IManaPool) tileAt; if(wasInNetwork && (pool != receiver || isRedstone())) { if(pool instanceof IKeyLocked && !((IKeyLocked) pool).getOutputKey().equals(getInputKey())) @@ -194,7 +209,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, } } - int redstoneSide = worldObj.getIndirectPowerLevelTo(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir.ordinal()); + int redstoneSide = worldObj.getRedstonePower(pos.offset(dir), dir); if(redstoneSide > 0) redstone = true; } @@ -207,12 +222,12 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, double x = lastPingbackX; double y = lastPingbackY; double z = lastPingbackZ; - AxisAlignedBB aabb = AxisAlignedBB.getBoundingBox(x, y, z, x, y, z).expand(PINGBACK_EXPIRED_SEARCH_DISTANCE, PINGBACK_EXPIRED_SEARCH_DISTANCE, PINGBACK_EXPIRED_SEARCH_DISTANCE); - List bursts = worldObj.getEntitiesWithinAABB(IManaBurst.class, aabb); + AxisAlignedBB aabb = new AxisAlignedBB(x, y, z, x, y, z).expand(PINGBACK_EXPIRED_SEARCH_DISTANCE, PINGBACK_EXPIRED_SEARCH_DISTANCE, PINGBACK_EXPIRED_SEARCH_DISTANCE); + List bursts = worldObj.getEntitiesWithinAABB(Entity.class, aabb, Predicates.instanceOf(IManaBurst.class)); IManaBurst found = null; UUID identity = getIdentifier(); - for(IManaBurst burst : bursts) - if(burst != null && identity.equals(burst.getShooterUIID())) { + for(IManaBurst burst : ((List) bursts)) + if(burst != null && identity.equals(burst.getShooterUUID())) { found = burst; break; } @@ -231,7 +246,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, if(shouldShoot && receiver != null && receiver instanceof IKeyLocked) shouldShoot = ((IKeyLocked) receiver).getInputKey().equals(getOutputKey()); - ItemStack lens = getStackInSlot(0); + ItemStack lens = itemHandler.getStackInSlot(0); ILensControl control = getLensController(lens); if(control != null) { if(isredstone) { @@ -247,7 +262,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, if(receiverLastTick != receiver && !worldObj.isRemote) { requestsClientUpdate = true; - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, xCoord, yCoord, zCoord); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos); } redstoneLastTick = redstone; @@ -255,8 +270,8 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, } @Override - public void writeCustomNBT(NBTTagCompound cmp) { - super.writeCustomNBT(cmp); + public void writePacketNBT(NBTTagCompound cmp) { + super.writePacketNBT(cmp); UUID identity = getIdentifier(); cmp.setBoolean(TAG_HAS_IDENTITY, true); @@ -278,9 +293,9 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, cmp.setString(TAG_INPUT_KEY, inputKey); cmp.setString(TAG_OUTPUT_KEY, outputKey); - cmp.setInteger(TAG_FORCE_CLIENT_BINDING_X, receiver == null ? 0 : ((TileEntity) receiver).xCoord); - cmp.setInteger(TAG_FORCE_CLIENT_BINDING_Y, receiver == null ? -1 : ((TileEntity) receiver).yCoord); - cmp.setInteger(TAG_FORCE_CLIENT_BINDING_Z, receiver == null ? 0 : ((TileEntity) receiver).zCoord); + cmp.setInteger(TAG_FORCE_CLIENT_BINDING_X, receiver == null ? 0 : ((TileEntity) receiver).getPos().getX()); + cmp.setInteger(TAG_FORCE_CLIENT_BINDING_Y, receiver == null ? -1 : ((TileEntity) receiver).getPos().getY()); + cmp.setInteger(TAG_FORCE_CLIENT_BINDING_Z, receiver == null ? 0 : ((TileEntity) receiver).getPos().getZ()); cmp.setBoolean(TAG_MAPMAKER_OVERRIDE, mapmakerOverride); cmp.setInteger(TAG_FORCED_COLOR, mmForcedColor); @@ -294,15 +309,15 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, } @Override - public void readCustomNBT(NBTTagCompound cmp) { - super.readCustomNBT(cmp); + public void readPacketNBT(NBTTagCompound cmp) { + super.readPacketNBT(cmp); if(cmp.getBoolean(TAG_HAS_IDENTITY)) { long most = cmp.getLong(TAG_UUID_MOST); long least = cmp.getLong(TAG_UUID_LEAST); UUID identity = getIdentifierUnsafe(); if(identity == null || most != identity.getMostSignificantBits() || least != identity.getLeastSignificantBits()) - identity = new UUID(most, least); + this.identity = new UUID(most, least); } else getIdentifier(); mana = cmp.getInteger(TAG_MANA); @@ -340,7 +355,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, int y = cmp.getInteger(TAG_FORCE_CLIENT_BINDING_Y); int z = cmp.getInteger(TAG_FORCE_CLIENT_BINDING_Z); if(y != -1) { - TileEntity tile = worldObj.getTileEntity(x, y, z); + TileEntity tile = worldObj.getTileEntity(new BlockPos(x, y, z)); if(tile instanceof IManaReceiver) receiver = (IManaReceiver) tile; else receiver = null; @@ -368,20 +383,20 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, if(!player.isSneaking()) { if(!worldObj.isRemote) { NBTTagCompound nbttagcompound = new NBTTagCompound(); - writeCustomNBT(nbttagcompound); + writePacketNBT(nbttagcompound); nbttagcompound.setInteger(TAG_KNOWN_MANA, mana); if(player instanceof EntityPlayerMP) - ((EntityPlayerMP) player).playerNetServerHandler.sendPacket(new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, -999, nbttagcompound)); + ((EntityPlayerMP) player).connection.sendPacket(new SPacketUpdateTileEntity(pos, -999, nbttagcompound)); } - worldObj.playSoundAtEntity(player, "botania:ding", 0.1F, 1F); + worldObj.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.ding, SoundCategory.PLAYERS, 0.1F, 1); } else { - MovingObjectPosition pos = raytraceFromEntity(worldObj, player, true, 5); + RayTraceResult pos = raytraceFromEntity(worldObj, player, true, 5); if(pos != null && pos.hitVec != null && !worldObj.isRemote) { - double x = pos.hitVec.xCoord - xCoord - 0.5; - double y = pos.hitVec.yCoord - yCoord - 0.5; - double z = pos.hitVec.zCoord - zCoord - 0.5; + double x = pos.hitVec.xCoord - getPos().getX() - 0.5; + double y = pos.hitVec.yCoord - getPos().getY() - 0.5; + double z = pos.hitVec.zCoord - getPos().getZ() - 0.5; - if(pos.sideHit != 0 && pos.sideHit != 1) { + if(pos.sideHit != EnumFacing.DOWN && pos.sideHit != EnumFacing.UP) { Vector3 clickVector = new Vector3(x, 0, z); Vector3 relative = new Vector3(-0.5, 0, 0); double angle = Math.acos(clickVector.dotProduct(relative) / (relative.mag() * clickVector.mag())) * 180D / Math.PI; @@ -396,7 +411,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, checkForReceiver(); requestsClientUpdate = true; - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, xCoord, yCoord, zCoord); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, getPos()); } } } @@ -428,7 +443,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, worldObj.spawnEntityInWorld(burst); burst.ping(); if(!ConfigHandler.silentSpreaders) - worldObj.playSoundEffect(xCoord, yCoord, zCoord, "botania:spreaderFire", 0.05F * (paddingColor != -1 ? 0.2F : 1F), 0.7F + 0.3F * (float) Math.random()); + worldObj.playSound(null, pos, BotaniaSoundEvents.spreaderFire, SoundCategory.BLOCKS, 0.05F * (paddingColor != -1 ? 0.2F : 1F), 0.7F + 0.3F * (float) Math.random()); } } } @@ -436,19 +451,23 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, } public boolean isRedstone() { - return worldObj == null ? staticRedstone : getBlockMetadata() == 1; + updateContainingBlockInfo(); + return worldObj == null ? staticRedstone : getBlockMetadata() == SpreaderVariant.REDSTONE.ordinal(); } public boolean isDreamwood() { - return worldObj == null ? staticDreamwood : getBlockMetadata() == 2 || getBlockMetadata() == 3; + updateContainingBlockInfo(); + int variant = getBlockMetadata(); + return worldObj == null ? staticDreamwood : variant == SpreaderVariant.ELVEN.ordinal() || variant == SpreaderVariant.GAIA.ordinal(); } public boolean isULTRA_SPREADER() { - return worldObj == null ? staticUltra : getBlockMetadata() == 3; + updateContainingBlockInfo(); + return worldObj == null ? staticUltra : getBlockMetadata() == SpreaderVariant.GAIA.ordinal(); } public void checkForReceiver() { - ItemStack stack = getStackInSlot(0); + ItemStack stack = itemHandler.getStackInSlot(0); ILensControl control = getLensController(stack); if(control != null && !control.allowBurstShooting(stack, this, false)) return; @@ -457,7 +476,10 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, fakeBurst.setScanBeam(); TileEntity receiver = fakeBurst.getCollidedTile(true); - if(receiver != null && receiver instanceof IManaReceiver) + if(receiver != null + && receiver instanceof IManaReceiver + && receiver.hasWorldObj() + && receiver.getWorld().isBlockLoaded(receiver.getPos(), !receiver.getWorld().isRemote)) this.receiver = (IManaReceiver) receiver; else this.receiver = null; lastTentativeBurst = fakeBurst.propsList; @@ -476,7 +498,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, float gravity = 0F; BurstProperties props = new BurstProperties(maxMana, ticksBeforeManaLoss, manaLossPerTick, gravity, motionModifier, color); - ItemStack lens = getStackInSlot(0); + ItemStack lens = itemHandler.getStackInSlot(0); if(lens != null && lens.getItem() instanceof ILensEffect) ((ILensEffect) lens.getItem()).apply(lens, props); @@ -515,7 +537,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, return null; } - public static MovingObjectPosition raytraceFromEntity(World world, Entity player, boolean par3, double range) { + public static RayTraceResult raytraceFromEntity(World world, Entity player, boolean par3, double range) { float f = 1.0F; float f1 = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * f; float f2 = player.prevRotationYaw + (player.rotationYaw - player.prevRotationYaw) * f; @@ -524,7 +546,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, if (!world.isRemote && player instanceof EntityPlayer) d1 += 1.62D; double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * f; - Vec3 vec3 = Vec3.createVectorHelper(d0, d1, d2); + Vec3d vec3 = new Vec3d(d0, d1, d2); float f3 = MathHelper.cos(-f2 * 0.017453292F - (float) Math.PI); float f4 = MathHelper.sin(-f2 * 0.017453292F - (float) Math.PI); float f5 = -MathHelper.cos(-f1 * 0.017453292F); @@ -533,55 +555,56 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, float f8 = f3 * f5; double d3 = range; if (player instanceof EntityPlayerMP) - d3 = ((EntityPlayerMP) player).theItemInWorldManager.getBlockReachDistance(); - Vec3 vec31 = vec3.addVector(f7 * d3, f6 * d3, f8 * d3); - return world.func_147447_a(vec3, vec31, par3, !par3, par3); + d3 = ((EntityPlayerMP) player).interactionManager.getBlockReachDistance(); + Vec3d vec31 = vec3.addVector(f7 * d3, f6 * d3, f8 * d3); + return world.rayTraceBlocks(vec3, vec31, par3, !par3, par3); } + @SideOnly(Side.CLIENT) public void renderHUD(Minecraft mc, ScaledResolution res) { - String name = StatCollector.translateToLocal(new ItemStack(ModBlocks.spreader, 1, getBlockMetadata()).getUnlocalizedName().replaceAll("tile.", "tile." + LibResources.PREFIX_MOD) + ".name"); + String name = I18n.format(new ItemStack(ModBlocks.spreader, 1, worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.SPREADER_VARIANT).ordinal()).getUnlocalizedName().replaceAll("tile.", "tile." + LibResources.PREFIX_MOD) + ".name"); int color = isRedstone() ? 0xFF0000 : isDreamwood() ? 0xFF00AE : 0x00FF00; HUDHandler.drawSimpleManaHUD(color, knownMana, getMaxMana(), name, res); - ItemStack lens = getStackInSlot(0); + ItemStack lens = itemHandler.getStackInSlot(0); if(lens != null) { - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); String lensName = lens.getDisplayName(); - int width = 16 + mc.fontRenderer.getStringWidth(lensName) / 2; + int width = 16 + mc.fontRendererObj.getStringWidth(lensName) / 2; int x = res.getScaledWidth() / 2 - width; int y = res.getScaledHeight() / 2 + 50; - mc.fontRenderer.drawStringWithShadow(lensName, x + 20, y + 5, color); + mc.fontRendererObj.drawStringWithShadow(lensName, x + 20, y + 5, color); RenderHelper.enableGUIStandardItemLighting(); - RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, lens, x, y); + mc.getRenderItem().renderItemAndEffectIntoGUI(lens, x, y); RenderHelper.disableStandardItemLighting(); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_BLEND); + GlStateManager.disableLighting(); + GlStateManager.disableBlend(); } if(receiver != null) { TileEntity receiverTile = (TileEntity) receiver; - ItemStack recieverStack = new ItemStack(worldObj.getBlock(receiverTile.xCoord, receiverTile.yCoord, receiverTile.zCoord), 1, receiverTile.getBlockMetadata()); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + ItemStack recieverStack = new ItemStack(worldObj.getBlockState(receiverTile.getPos()).getBlock(), 1, receiverTile.getBlockMetadata()); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); if(recieverStack != null && recieverStack.getItem() != null) { String stackName = recieverStack.getDisplayName(); - int width = 16 + mc.fontRenderer.getStringWidth(stackName) / 2; + int width = 16 + mc.fontRendererObj.getStringWidth(stackName) / 2; int x = res.getScaledWidth() / 2 - width; int y = res.getScaledHeight() / 2 + 30; - mc.fontRenderer.drawStringWithShadow(stackName, x + 20, y + 5, color); + mc.fontRendererObj.drawStringWithShadow(stackName, x + 20, y + 5, color); RenderHelper.enableGUIStandardItemLighting(); - RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, recieverStack, x, y); + mc.getRenderItem().renderItemAndEffectIntoGUI(recieverStack, x, y); RenderHelper.disableStandardItemLighting(); } - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_BLEND); + GlStateManager.disableLighting(); + GlStateManager.disableBlend(); } - GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.color(1F, 1F, 1F, 1F); } @Override @@ -603,33 +626,35 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, } @Override - public String getInventoryName() { - return LibBlockNames.SPREADER; - } + protected SimpleItemStackHandler createItemHandler() { + return new SimpleItemStackHandler(this, true) { + @Override + protected int getStackLimit(int slot, ItemStack stack) { + return 1; + } - @Override - public int getInventoryStackLimit() { - return 1; - } - - @Override - public boolean isItemValidForSlot(int i, ItemStack itemstack) { - return itemstack.getItem() instanceof ILens; + @Override + public ItemStack insertItem(int slot, ItemStack stack, boolean simulate) { + if(stack != null && stack.getItem() instanceof ILens) + return super.insertItem(slot, stack, simulate); + else return stack; + } + }; } @Override public void markDirty() { checkForReceiver(); - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, xCoord, yCoord, zCoord); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos); } @Override - public ChunkCoordinates getBinding() { + public BlockPos getBinding() { if(receiver == null) return null; TileEntity tile = (TileEntity) receiver; - return new ChunkCoordinates(tile.xCoord, tile.yCoord, tile.zCoord); + return tile.getPos(); } @Override @@ -648,23 +673,24 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, } @Override - public boolean canSelect(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { + public boolean canSelect(EntityPlayer player, ItemStack wand, BlockPos pos, EnumFacing side) { return true; } @Override - public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { + public boolean bindTo(EntityPlayer player, ItemStack wand, BlockPos pos, EnumFacing side) { Vector3 thisVec = Vector3.fromTileEntityCenter(this); - Vector3 blockVec = new Vector3(x + 0.5, y + 0.5, z + 0.5); + Vector3 blockVec = new Vector3(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5); - AxisAlignedBB axis = player.worldObj.getBlock(x, y, z).getCollisionBoundingBoxFromPool(player.worldObj, x, y, z); - if(axis == null) - axis = AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1); + AxisAlignedBB axis = player.worldObj.getBlockState(pos).getCollisionBoundingBox(player.worldObj, pos); + if(axis != null) + axis = axis.offset(pos); + else axis = new AxisAlignedBB(pos, pos.add(1, 1, 1)); if(!blockVec.isInside(axis)) blockVec = new Vector3(axis.minX + (axis.maxX - axis.minX) / 2, axis.minY + (axis.maxY - axis.minY) / 2, axis.minZ + (axis.maxZ - axis.minZ) / 2); - Vector3 diffVec = blockVec.copy().sub(thisVec); + Vector3 diffVec = blockVec.subtract(thisVec); Vector3 diffVec2D = new Vector3(diffVec.x, diffVec.z, 0); Vector3 rotVec = new Vector3(0, 1, 0); double angle = rotVec.angle(diffVec2D) / Math.PI * 180.0; @@ -685,9 +711,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, } @Override - public void markDispatchable() { - // NO-OP - } + public void markDispatchable() {} @Override public float getRotationX() { @@ -758,7 +782,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, return identity; } - public UUID getIdentifierUnsafe() { + private UUID getIdentifierUnsafe() { return identity; } diff --git a/src/main/java/vazkii/botania/common/block/tile/mana/TileTurntable.java b/src/main/java/vazkii/botania/common/block/tile/mana/TileTurntable.java index 23a0b1426..3634200a3 100644 --- a/src/main/java/vazkii/botania/common/block/tile/mana/TileTurntable.java +++ b/src/main/java/vazkii/botania/common/block/tile/mana/TileTurntable.java @@ -12,15 +12,14 @@ package vazkii.botania.common.block.tile.mana; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumChatFormatting; -import net.minecraftforge.common.util.ForgeDirection; - +import net.minecraft.util.EnumFacing; +import net.minecraft.util.text.TextFormatting; import org.lwjgl.opengl.GL11; - import vazkii.botania.api.internal.VanillaPacketDispatcher; import vazkii.botania.common.block.tile.TileMod; @@ -33,35 +32,36 @@ public class TileTurntable extends TileMod { boolean backwards = false; @Override - public void updateEntity() { + public void update() { boolean redstone = false; - for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { - int redstoneSide = worldObj.getIndirectPowerLevelTo(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir.ordinal()); + for(EnumFacing dir : EnumFacing.VALUES) { + int redstoneSide = worldObj.getRedstonePower(pos.offset(dir), dir); if(redstoneSide > 0) redstone = true; } if(!redstone) { - TileEntity tile = worldObj.getTileEntity(xCoord, yCoord + 1, zCoord); + TileEntity tile = worldObj.getTileEntity(pos.up()); if(tile instanceof TileSpreader) { TileSpreader spreader = (TileSpreader) tile; spreader.rotationX += speed * (backwards ? -1 : 1); if(spreader.rotationX >= 360F) spreader.rotationX -= 360F; - spreader.checkForReceiver(); + if(!worldObj.isRemote) + spreader.checkForReceiver(); } } } @Override - public void writeCustomNBT(NBTTagCompound cmp) { + public void writePacketNBT(NBTTagCompound cmp) { cmp.setInteger(TAG_SPEED, speed); cmp.setBoolean(TAG_BACKWARDS, backwards); } @Override - public void readCustomNBT(NBTTagCompound cmp) { + public void readPacketNBT(NBTTagCompound cmp) { speed = cmp.getInteger(TAG_SPEED); backwards = cmp.getBoolean(TAG_BACKWARDS); } @@ -73,23 +73,23 @@ public class TileTurntable extends TileMod { if(player.isSneaking()) backwards = !backwards; else speed = speed == 6 ? 1 : speed + 1; - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, xCoord, yCoord, zCoord); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos); } public void renderHUD(Minecraft mc, ScaledResolution res) { int color = 0xAA006600; char motion = backwards ? '<' : '>'; - String speed = EnumChatFormatting.BOLD + ""; + String speed = TextFormatting.BOLD + ""; for(int i = 0; i < this.speed; i++) speed = speed + motion; - int x = res.getScaledWidth() / 2 - mc.fontRenderer.getStringWidth(speed) / 2; + int x = res.getScaledWidth() / 2 - mc.fontRendererObj.getStringWidth(speed) / 2; int y = res.getScaledHeight() / 2 - 15; - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - mc.fontRenderer.drawStringWithShadow(speed, x, y, color); - GL11.glDisable(GL11.GL_BLEND); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + mc.fontRendererObj.drawStringWithShadow(speed, x, y, color); + GlStateManager.disableBlend(); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/string/TileRedString.java b/src/main/java/vazkii/botania/common/block/tile/string/TileRedString.java index 2d386a6e1..7b3f869ce 100644 --- a/src/main/java/vazkii/botania/common/block/tile/string/TileRedString.java +++ b/src/main/java/vazkii/botania/common/block/tile/string/TileRedString.java @@ -11,43 +11,43 @@ package vazkii.botania.common.block.tile.string; import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChunkCoordinates; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.api.wand.ITileBound; import vazkii.botania.common.block.tile.TileMod; +import javax.annotation.Nonnull; + public abstract class TileRedString extends TileMod implements ITileBound { - private ChunkCoordinates binding; + private BlockPos binding; @Override - public void updateEntity() { - ForgeDirection dir = getOrientation(); - int x = xCoord; - int y = yCoord; - int z = zCoord; + public void update() { + EnumFacing dir = getOrientation(); + BlockPos pos_ = getPos(); int range = getRange(); - ChunkCoordinates currBinding = getBinding(); + BlockPos currBinding = getBinding(); setBinding(null); for(int i = 0; i < range; i++) { - x += dir.offsetX; - y += dir.offsetY; - z += dir.offsetZ; - if(worldObj.isAirBlock(x, y, z)) + pos_ = pos_.offset(dir); + if(worldObj.isAirBlock(pos_)) continue; - TileEntity tile = worldObj.getTileEntity(x, y, z); + TileEntity tile = worldObj.getTileEntity(pos_); if(tile instanceof TileRedString) continue; - if(acceptBlock(x, y, z)) { - setBinding(new ChunkCoordinates(x, y, z)); - if(currBinding == null || currBinding.posX != x || currBinding.posY != y || currBinding.posZ != z) - onBound(x, y, z); + if(acceptBlock(pos_)) { + setBinding(pos_); + if(currBinding == null || !currBinding.equals(pos_)) + onBound(pos_); break; } } @@ -57,38 +57,46 @@ public abstract class TileRedString extends TileMod implements ITileBound { return 8; } - public abstract boolean acceptBlock(int x, int y, int z); + public abstract boolean acceptBlock(BlockPos pos); - public void onBound(int x, int y, int z) { - // NO-OP - } + public void onBound(BlockPos pos) {} + @Nonnull @Override public AxisAlignedBB getRenderBoundingBox() { return INFINITE_EXTENT_AABB; } @Override - public ChunkCoordinates getBinding() { + public BlockPos getBinding() { return binding; } - public void setBinding(ChunkCoordinates binding) { + public void setBinding(BlockPos binding) { this.binding = binding; } - public ForgeDirection getOrientation() { - return ForgeDirection.getOrientation(getBlockMetadata()); + public EnumFacing getOrientation() { + return worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.FACING); } public TileEntity getTileAtBinding() { - ChunkCoordinates binding = getBinding(); - return binding == null ? null : worldObj.getTileEntity(binding.posX, binding.posY, binding.posZ); + BlockPos binding = getBinding(); + return binding == null ? null : worldObj.getTileEntity(binding); + } + + public IBlockState getStateAtBinding() { + BlockPos binding = getBinding(); + return binding == null ? Blocks.AIR.getDefaultState() : worldObj.getBlockState(binding); } public Block getBlockAtBinding() { - ChunkCoordinates binding = getBinding(); - return binding == null ? Blocks.air : worldObj.getBlock(binding.posX, binding.posY, binding.posZ); + return getStateAtBinding().getBlock(); + } + + @Override + public boolean hasFastRenderer() { + return true; } } diff --git a/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringComparator.java b/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringComparator.java index ca519437e..cb606bd48 100644 --- a/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringComparator.java +++ b/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringComparator.java @@ -10,30 +10,27 @@ */ package vazkii.botania.common.block.tile.string; -import net.minecraft.block.Block; -import net.minecraft.util.ChunkCoordinates; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; public class TileRedStringComparator extends TileRedString { - int comparatorValue = 0; + private int comparatorValue = 0; @Override - public void updateEntity() { - super.updateEntity(); - - ChunkCoordinates binding = getBinding(); - ForgeDirection dir = getOrientation(); - Block block = getBlockAtBinding(); + public void update() { + super.update(); + BlockPos binding = getBinding(); + IBlockState state = getStateAtBinding(); int origVal = comparatorValue; - if(block.hasComparatorInputOverride()) { - int val = block.getComparatorInputOverride(worldObj, binding.posX, binding.posY, binding.posZ, dir.getOpposite().ordinal()); - comparatorValue = val; + if(state.hasComparatorInputOverride()) { + comparatorValue = state.getComparatorInputOverride(worldObj, binding); } else comparatorValue = 0; if(origVal != comparatorValue) - worldObj.func_147453_f(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord)); + worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock()); } public int getComparatorValue() { @@ -41,9 +38,8 @@ public class TileRedStringComparator extends TileRedString { } @Override - public boolean acceptBlock(int x, int y, int z) { - Block block = worldObj.getBlock(x, y, z); - return block.hasComparatorInputOverride(); + public boolean acceptBlock(BlockPos pos) { + return worldObj.getBlockState(pos).hasComparatorInputOverride(); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringContainer.java b/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringContainer.java index 6759394fb..eca80dc41 100644 --- a/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringContainer.java +++ b/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringContainer.java @@ -10,126 +10,42 @@ */ package vazkii.botania.common.block.tile.string; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import vazkii.botania.common.core.helper.InventoryHelper; -import vazkii.botania.common.lib.LibBlockNames; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.items.CapabilityItemHandler; -public class TileRedStringContainer extends TileRedString implements ISidedInventory { +import javax.annotation.Nonnull; +import java.util.Arrays; + +public class TileRedStringContainer extends TileRedString { @Override - public boolean acceptBlock(int x, int y, int z) { - TileEntity tile = worldObj.getTileEntity(x, y, z); - if(tile != null && tile instanceof IInventory) { - IInventory inv = (IInventory) tile; - if(inv instanceof ISidedInventory) { - ISidedInventory sidedInv = (ISidedInventory) inv; - for(int i = 0; i < 6; i++) - if(sidedInv.getAccessibleSlotsFromSide(i).length != 0) - return true; - return false; - } - + public boolean acceptBlock(BlockPos pos) { + TileEntity tile = worldObj.getTileEntity(pos); + return tile != null + && Arrays.stream(EnumFacing.VALUES) + .anyMatch(e -> tile.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, e)); + } + + @Override + public boolean hasCapability(@Nonnull Capability cap, @Nonnull EnumFacing side) { + if(cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY + && getTileAtBinding() != null + && getTileAtBinding().hasCapability(cap, side)) return true; - } - - return false; + return super.hasCapability(cap, side); } + @Nonnull @Override - public int getSizeInventory() { - IInventory inv = getInventory(); - return inv != null ? inv.getSizeInventory() : 0; - } - - @Override - public ItemStack getStackInSlot(int slot) { - IInventory inv = getInventory(); - return inv != null ? inv.getStackInSlot(slot) : null; - } - - @Override - public ItemStack decrStackSize(int slot, int count) { - IInventory inv = getInventory(); - return inv != null ? inv.decrStackSize(slot, count) : null; - } - - @Override - public ItemStack getStackInSlotOnClosing(int slot) { - IInventory inv = getInventory(); - return inv != null ? inv.getStackInSlotOnClosing(slot) : null; - } - - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - IInventory inv = getInventory(); - if(inv != null) - inv.setInventorySlotContents(slot, stack); - } - - @Override - public String getInventoryName() { - IInventory inv = getInventory(); - return inv != null ? inv.getInventoryName() : LibBlockNames.RED_STRING_CONTAINER; - } - - @Override - public boolean hasCustomInventoryName() { - IInventory inv = getInventory(); - return inv != null ? inv.hasCustomInventoryName() : false; - } - - @Override - public int getInventoryStackLimit() { - IInventory inv = getInventory(); - return inv != null ? inv.getInventoryStackLimit() : 0; - } - - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - IInventory inv = getInventory(); - return inv != null ? inv.isUseableByPlayer(player) : false; - } - - @Override - public void openInventory() { - IInventory inv = getInventory(); - if(inv != null) - inv.openInventory(); - } - - @Override - public void closeInventory() { - IInventory inv = getInventory(); - if(inv != null) - inv.closeInventory(); - } - - @Override - public boolean isItemValidForSlot(int slot, ItemStack stack) { - IInventory inv = getInventory(); - return inv != null ? inv.isItemValidForSlot(slot, stack) : false; - } - - @Override - public int[] getAccessibleSlotsFromSide(int side) { - IInventory inv = getInventory(); - return inv instanceof ISidedInventory ? ((ISidedInventory) inv).getAccessibleSlotsFromSide(side) : inv instanceof IInventory ? InventoryHelper.buildSlotsForLinearInventory(inv) : new int[0]; - } - - @Override - public boolean canInsertItem(int slot, ItemStack stack, int side) { - IInventory inv = getInventory(); - return inv instanceof ISidedInventory ? ((ISidedInventory) inv).canInsertItem(slot, stack, side) : true; - } - - @Override - public boolean canExtractItem(int slot, ItemStack stack, int side) { - IInventory inv = getInventory(); - return inv instanceof ISidedInventory ? ((ISidedInventory) inv).canExtractItem(slot, stack, side) : true; + public T getCapability(@Nonnull Capability cap, @Nonnull EnumFacing side) { + if(cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY + && getTileAtBinding() != null + && getTileAtBinding().hasCapability(cap, side)) + return getTileAtBinding().getCapability(cap, side); + return super.getCapability(cap, side); } @Override @@ -140,12 +56,4 @@ public class TileRedStringContainer extends TileRedString implements ISidedInven tile.markDirty(); } - IInventory getInventory() { - TileEntity tile = getTileAtBinding(); - if(tile == null || !(tile instanceof IInventory)) - return null; - - return InventoryHelper.getInventory((IInventory) tile); - } - } diff --git a/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringDispenser.java b/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringDispenser.java index 6d1b5875d..609579ef3 100644 --- a/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringDispenser.java +++ b/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringDispenser.java @@ -12,22 +12,22 @@ package vazkii.botania.common.block.tile.string; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityDispenser; -import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.math.BlockPos; public class TileRedStringDispenser extends TileRedStringContainer { @Override - public boolean acceptBlock(int x, int y, int z) { - TileEntity tile = worldObj.getTileEntity(x, y, z); + public boolean acceptBlock(BlockPos pos) { + TileEntity tile = worldObj.getTileEntity(pos); return tile != null && tile instanceof TileEntityDispenser; } public void tickDispenser() { - ChunkCoordinates bind = getBinding(); + BlockPos bind = getBinding(); if(bind != null) { - TileEntity tile = worldObj.getTileEntity(bind.posX, bind.posY, bind.posZ); + TileEntity tile = worldObj.getTileEntity(bind); if(tile instanceof TileEntityDispenser) - worldObj.scheduleBlockUpdate(bind.posX, bind.posY, bind.posZ, tile.getBlockType(), tile.getBlockType().tickRate(worldObj)); + worldObj.scheduleUpdate(bind, tile.getBlockType(), tile.getBlockType().tickRate(worldObj)); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringFertilizer.java b/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringFertilizer.java index 463a37805..c030fe615 100644 --- a/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringFertilizer.java +++ b/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringFertilizer.java @@ -10,38 +10,38 @@ */ package vazkii.botania.common.block.tile.string; -import java.util.Random; - import net.minecraft.block.Block; import net.minecraft.block.IGrowable; -import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import java.util.Random; + public class TileRedStringFertilizer extends TileRedString { - public boolean func_149851_a(World p_149851_1_, boolean p_149851_5_) { - ChunkCoordinates binding = getBinding(); + public boolean canGrow(World world, boolean isClient) { + BlockPos binding = getBinding(); Block block = getBlockAtBinding(); - return block instanceof IGrowable ? ((IGrowable) block).func_149851_a(p_149851_1_, binding.posX, binding.posY, binding.posZ, p_149851_5_) : false; + return block instanceof IGrowable ? ((IGrowable) block).canGrow(world, binding, world.getBlockState(binding), isClient) : false; } - public boolean func_149852_a(World p_149852_1_, Random p_149852_2_) { - ChunkCoordinates binding = getBinding(); + public boolean canUseBonemeal(World world, Random rand) { + BlockPos binding = getBinding(); Block block = getBlockAtBinding(); - return block instanceof IGrowable ? ((IGrowable) block).func_149852_a(p_149852_1_, p_149852_2_, binding.posX, binding.posY, binding.posZ) : false; + return block instanceof IGrowable ? ((IGrowable) block).canUseBonemeal(world, rand, binding, world.getBlockState(binding)) : false; } - public void func_149853_b(World p_149853_1_, Random p_149853_2_) { - ChunkCoordinates binding = getBinding(); + public void grow(World world, Random rand) { + BlockPos binding = getBinding(); Block block = getBlockAtBinding(); if(block instanceof IGrowable) - ((IGrowable) block).func_149853_b(p_149853_1_, p_149853_2_, binding.posX, binding.posY, binding.posZ); + ((IGrowable) block).grow(world, rand, binding, world.getBlockState(binding)); } @Override - public boolean acceptBlock(int x, int y, int z) { - return worldObj.getBlock(x, y, z) instanceof IGrowable; + public boolean acceptBlock(BlockPos pos) { + return worldObj.getBlockState(pos).getBlock() instanceof IGrowable; } } diff --git a/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringInterceptor.java b/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringInterceptor.java index 39d0c375b..b8dd24d5f 100644 --- a/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringInterceptor.java +++ b/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringInterceptor.java @@ -10,58 +10,60 @@ */ package vazkii.botania.common.block.tile.string; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.ChunkCoordinates; +import net.minecraft.init.SoundEvents; +import net.minecraft.util.EnumHand; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import vazkii.botania.api.state.BotaniaStateProps; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; public class TileRedStringInterceptor extends TileRedString { - public static List interceptors = new ArrayList(); + private static final Set interceptors = new HashSet<>(); @Override - public void updateEntity() { - super.updateEntity(); - - if(!interceptors.contains(this)) + public void update() { + super.update(); + if(!worldObj.isRemote) interceptors.add(this); } @Override - public boolean acceptBlock(int x, int y, int z) { - return worldObj.getTileEntity(x, y, z) != null; + public boolean acceptBlock(BlockPos pos) { + return worldObj.getTileEntity(pos) != null; } - public boolean removeFromList() { - return !tileEntityInvalid && worldObj.getTileEntity(xCoord, yCoord, zCoord) == this; + private boolean saneState() { + return !isInvalid() && worldObj.getTileEntity(pos) == this; } - public static void onInteract(EntityPlayer player, World world, int x, int y, int z) { - List remove = new ArrayList(); + public static void onInteract(EntityPlayer player, World world, BlockPos pos, EnumHand hand) { + if(world.isRemote) + return; + + List remove = new ArrayList<>(); boolean did = false; - // CMEs are amazing - List interceptorsCopy = new ArrayList(interceptors); - - for(TileRedStringInterceptor inter : interceptorsCopy) { - if(!inter.removeFromList()) { + + for(TileRedStringInterceptor inter : interceptors) { + if(!inter.saneState()) { remove.add(inter); continue; } if(inter.worldObj == world) { - ChunkCoordinates coords = inter.getBinding(); - if(coords != null && coords.posX == x && coords.posY == y && coords.posZ == z) { - if(!world.isRemote) { - Block block = inter.getBlockType(); - int meta = inter.getBlockMetadata(); - world.setBlockMetadataWithNotify(inter.xCoord, inter.yCoord, inter.zCoord, meta | 8, 1 | 2); - world.scheduleBlockUpdate(inter.xCoord, inter.yCoord, inter.zCoord, block, block.tickRate(world)); - } - + BlockPos coords = inter.getBinding(); + if(coords != null && coords.equals(pos)) { + Block block = inter.getBlockType(); + world.setBlockState(inter.getPos(), world.getBlockState(inter.getPos()).withProperty(BotaniaStateProps.POWERED, true), 1 | 2); + world.scheduleUpdate(inter.getPos(), block, block.tickRate(world)); did = true; } } @@ -69,9 +71,8 @@ public class TileRedStringInterceptor extends TileRedString { interceptors.removeAll(remove); if(did) { - if(world.isRemote) - player.swingItem(); - else world.playSoundEffect(x + 0.5, y + 0.5, z + 0.5, "random.click", 0.3F, 0.6F); + player.swingArm(hand); + world.playSound(null, pos, SoundEvents.BLOCK_DISPENSER_DISPENSE, SoundCategory.BLOCKS, 0.3F, 0.6F); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringRelay.java b/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringRelay.java index 825deabf7..253ffea0b 100644 --- a/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringRelay.java +++ b/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringRelay.java @@ -15,17 +15,18 @@ import net.minecraft.block.BlockDoublePlant; import net.minecraft.block.BlockFlower; import net.minecraft.block.BlockMushroom; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.BlockPos; import vazkii.botania.api.subtile.ISubTileContainer; public class TileRedStringRelay extends TileRedString { @Override - public boolean acceptBlock(int x, int y, int z) { - if(x == xCoord && y == yCoord + 1 && z == zCoord) + public boolean acceptBlock(BlockPos pos) { + if(pos.equals(getPos().up())) return false; - Block block = worldObj.getBlock(x, y, z); - TileEntity tile = worldObj.getTileEntity(x, y, z); + Block block = worldObj.getBlockState(pos).getBlock(); + TileEntity tile = worldObj.getTileEntity(pos); return (block instanceof BlockFlower || block instanceof BlockMushroom || block instanceof BlockDoublePlant) && (tile == null || !(tile instanceof ISubTileContainer)); } diff --git a/src/main/java/vazkii/botania/common/brew/BrewMod.java b/src/main/java/vazkii/botania/common/brew/BrewMod.java index 765c957c1..07770128f 100644 --- a/src/main/java/vazkii/botania/common/brew/BrewMod.java +++ b/src/main/java/vazkii/botania/common/brew/BrewMod.java @@ -11,9 +11,12 @@ package vazkii.botania.common.brew; import net.minecraft.potion.PotionEffect; +import net.minecraft.potion.PotionUtils; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.brew.Brew; +import java.util.Arrays; + public class BrewMod extends Brew { public BrewMod(String key, int color, int cost, PotionEffect... effects) { @@ -21,6 +24,10 @@ public class BrewMod extends Brew { BotaniaAPI.registerBrew(this); } + public BrewMod(String key, int cost, PotionEffect... effects) { + this(key, PotionUtils.getPotionColorFromEffectList(Arrays.asList(effects)), cost, effects); + } + @Override public String getUnlocalizedName() { return "botania.brew." + super.getUnlocalizedName(); diff --git a/src/main/java/vazkii/botania/common/brew/BrewModPotion.java b/src/main/java/vazkii/botania/common/brew/BrewModPotion.java deleted file mode 100644 index 3ec9f03bf..000000000 --- a/src/main/java/vazkii/botania/common/brew/BrewModPotion.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Nov 2, 2014, 10:37:12 PM (GMT)] - */ -package vazkii.botania.common.brew; - -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; - -public class BrewModPotion extends BrewMod { - - public BrewModPotion(String key, int cost, PotionEffect... effects) { - super(key, Potion.potionTypes[effects[0].getPotionID()].getLiquidColor(), cost, effects); - } - -} diff --git a/src/main/java/vazkii/botania/common/brew/ModBrews.java b/src/main/java/vazkii/botania/common/brew/ModBrews.java index b30edbfc6..e9eb90564 100644 --- a/src/main/java/vazkii/botania/common/brew/ModBrews.java +++ b/src/main/java/vazkii/botania/common/brew/ModBrews.java @@ -10,8 +10,10 @@ */ package vazkii.botania.common.brew; +import net.minecraft.init.MobEffects; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; +import net.minecraft.util.ResourceLocation; import vazkii.botania.api.brew.Brew; import vazkii.botania.common.lib.LibBrewNames; @@ -42,38 +44,34 @@ public class ModBrews { public static Brew warpWard; public static void init() { - speed = new BrewMod(LibBrewNames.SPEED, 0x59B7FF, 4000, new PotionEffect(Potion.moveSpeed.id, 1800, 1)); - strength = new BrewMod(LibBrewNames.STRENGTH, 0xEE3F3F, 4000, new PotionEffect(Potion.damageBoost.id, 1800, 1)); - haste = new BrewMod(LibBrewNames.HASTE, 0xF4A432, 4000, new PotionEffect(Potion.digSpeed.id, 1800, 1)); - healing = new BrewMod(LibBrewNames.HEALING, 0xFF5ECC, 6000, new PotionEffect(Potion.heal.id, 1, 1)); - jumpBoost = new BrewMod(LibBrewNames.JUMP_BOOST, 0x32F46D, 4000, new PotionEffect(Potion.jump.id, 1800, 1)); - regen = new BrewMod(LibBrewNames.REGEN, 0xFD6488, 7000, new PotionEffect(Potion.regeneration.id, 500, 1)); - regenWeak = new BrewMod(LibBrewNames.REGEN_WEAK, 0xFD6488, 9000, new PotionEffect(Potion.regeneration.id, 2400, 0)); - resistance = new BrewMod(LibBrewNames.RESISTANCE, 0xB44E17, 4000, new PotionEffect(Potion.resistance.id, 1800, 1)); - fireResistance = new BrewMod(LibBrewNames.FIRE_RESISTANCE, 0xF86900, 4000, new PotionEffect(Potion.fireResistance.id, 9600, 0)); - waterBreathing = new BrewMod(LibBrewNames.WATER_BREATHING, 0x84A7CF, 4000, new PotionEffect(Potion.waterBreathing.id, 9600, 0)); - invisibility = new BrewMod(LibBrewNames.INVISIBILITY, 0xAEAEAE, 8000, new PotionEffect(Potion.invisibility.id, 9600, 0)); - nightVision = new BrewMod(LibBrewNames.NIGHT_VISION, 0x7C4BEB, 4000, new PotionEffect(Potion.nightVision.id, 9600, 0)); - absorption = new BrewMod(LibBrewNames.ABSORPTION, 0xF2EB23, 7000, new PotionEffect(Potion.field_76444_x.id, 1800, 3)).setNotBloodPendantInfusable().setNotIncenseInfusable(); + speed = new BrewMod(LibBrewNames.SPEED, 0x59B7FF, 4000, new PotionEffect(MobEffects.SPEED, 1800, 1)); + strength = new BrewMod(LibBrewNames.STRENGTH, 0xEE3F3F, 4000, new PotionEffect(MobEffects.STRENGTH, 1800, 1)); + haste = new BrewMod(LibBrewNames.HASTE, 0xF4A432, 4000, new PotionEffect(MobEffects.HASTE, 1800, 1)); + healing = new BrewMod(LibBrewNames.HEALING, 0xFF5ECC, 6000, new PotionEffect(MobEffects.INSTANT_HEALTH, 1, 1)); + jumpBoost = new BrewMod(LibBrewNames.JUMP_BOOST, 0x32F46D, 4000, new PotionEffect(MobEffects.JUMP_BOOST, 1800, 1)); + regen = new BrewMod(LibBrewNames.REGEN, 0xFD6488, 7000, new PotionEffect(MobEffects.REGENERATION, 500, 1)); + regenWeak = new BrewMod(LibBrewNames.REGEN_WEAK, 0xFD6488, 9000, new PotionEffect(MobEffects.REGENERATION, 2400, 0)); + resistance = new BrewMod(LibBrewNames.RESISTANCE, 0xB44E17, 4000, new PotionEffect(MobEffects.RESISTANCE, 1800, 1)); + fireResistance = new BrewMod(LibBrewNames.FIRE_RESISTANCE, 0xF86900, 4000, new PotionEffect(MobEffects.FIRE_RESISTANCE, 9600, 0)); + waterBreathing = new BrewMod(LibBrewNames.WATER_BREATHING, 0x84A7CF, 4000, new PotionEffect(MobEffects.WATER_BREATHING, 9600, 0)); + invisibility = new BrewMod(LibBrewNames.INVISIBILITY, 0xAEAEAE, 8000, new PotionEffect(MobEffects.INVISIBILITY, 9600, 0)); + nightVision = new BrewMod(LibBrewNames.NIGHT_VISION, 0x7C4BEB, 4000, new PotionEffect(MobEffects.NIGHT_VISION, 9600, 0)); + absorption = new BrewMod(LibBrewNames.ABSORPTION, 0xF2EB23, 7000, new PotionEffect(MobEffects.ABSORPTION, 1800, 3)).setNotBloodPendantInfusable().setNotIncenseInfusable(); - overload = new BrewMod(LibBrewNames.OVERLOAD, 0x232323, 12000, new PotionEffect(Potion.damageBoost.id, 1800, 3), new PotionEffect(Potion.moveSpeed.id, 1800, 2), new PotionEffect(Potion.weakness.id, 3600, 2), new PotionEffect(Potion.hunger.id, 200, 2)); - soulCross = new BrewModPotion(LibBrewNames.SOUL_CROSS, 10000, new PotionEffect(ModPotions.soulCross.id, 1800, 0)); - featherfeet = new BrewModPotion(LibBrewNames.FEATHER_FEET, 7000, new PotionEffect(ModPotions.featherfeet.id, 1800, 0)); - emptiness = new BrewModPotion(LibBrewNames.EMPTINESS, 30000, new PotionEffect(ModPotions.emptiness.id, 7200, 0)); - bloodthirst = new BrewModPotion(LibBrewNames.BLOODTHIRST, 20000, new PotionEffect(ModPotions.bloodthrst.id, 7200, 0)); - allure = new BrewModPotion(LibBrewNames.ALLURE, 2000, new PotionEffect(ModPotions.allure.id, 4800, 0)); - clear = new BrewModPotion(LibBrewNames.CLEAR, 4000, new PotionEffect(ModPotions.clear.id, 0, 0)); + overload = new BrewMod(LibBrewNames.OVERLOAD, 0x232323, 12000, new PotionEffect(MobEffects.STRENGTH, 1800, 3), new PotionEffect(MobEffects.SPEED, 1800, 2), new PotionEffect(MobEffects.WEAKNESS, 3600, 2), new PotionEffect(MobEffects.HUNGER, 200, 2)); + soulCross = new BrewMod(LibBrewNames.SOUL_CROSS, 10000, new PotionEffect(ModPotions.soulCross, 1800, 0)); + featherfeet = new BrewMod(LibBrewNames.FEATHER_FEET, 7000, new PotionEffect(ModPotions.featherfeet, 1800, 0)); + emptiness = new BrewMod(LibBrewNames.EMPTINESS, 30000, new PotionEffect(ModPotions.emptiness, 7200, 0)); + bloodthirst = new BrewMod(LibBrewNames.BLOODTHIRST, 20000, new PotionEffect(ModPotions.bloodthrst, 7200, 0)); + allure = new BrewMod(LibBrewNames.ALLURE, 2000, new PotionEffect(ModPotions.allure, 4800, 0)); + clear = new BrewMod(LibBrewNames.CLEAR, 4000, new PotionEffect(ModPotions.clear, 0, 0)); } public static void initTC() { - Potion warpWardPotion = null; - for(Potion potion : Potion.potionTypes) - if(potion != null && potion.getName().equals("potion.warpward")) { - warpWardPotion = potion; - break; - } + Potion warpWardPotion = Potion.REGISTRY.getObject(new ResourceLocation("minecraft:warp_ward")); + // thaumcraft 5 is registering its potions under the Minecraft namespace if(warpWardPotion != null) - warpWard = new BrewMod(LibBrewNames.WARP_WARD, 0xFBBDFF, 25000, new PotionEffect(warpWardPotion.id, 12000, 0)).setNotBloodPendantInfusable(); + warpWard = new BrewMod(LibBrewNames.WARP_WARD, 0xFBBDFF, 25000, new PotionEffect(warpWardPotion, 12000, 0)).setNotBloodPendantInfusable(); } } diff --git a/src/main/java/vazkii/botania/common/brew/ModPotions.java b/src/main/java/vazkii/botania/common/brew/ModPotions.java index f6cbffe31..ae0e1e013 100644 --- a/src/main/java/vazkii/botania/common/brew/ModPotions.java +++ b/src/main/java/vazkii/botania/common/brew/ModPotions.java @@ -10,9 +10,6 @@ */ package vazkii.botania.common.brew; -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; - import net.minecraft.potion.Potion; import vazkii.botania.common.brew.potion.PotionAllure; import vazkii.botania.common.brew.potion.PotionBloodthirst; @@ -31,9 +28,6 @@ public class ModPotions { public static Potion clear; public static void init() { - if(Potion.potionTypes.length < 256) - extendPotionArray(); - soulCross = new PotionSoulCross(); featherfeet = new PotionFeatherfeet(); emptiness = new PotionEmptiness(); @@ -42,27 +36,4 @@ public class ModPotions { clear = new PotionClear(); } - private static void extendPotionArray() { - Potion[] potionTypes = null; - - for (Field f : Potion.class.getDeclaredFields()) { - f.setAccessible(true); - try { - if (f.getName().equals("potionTypes") || f.getName().equals("field_76425_a")) { - Field modfield = Field.class.getDeclaredField("modifiers"); - modfield.setAccessible(true); - modfield.setInt(f, f.getModifiers() & ~Modifier.FINAL); - - potionTypes = (Potion[])f.get(null); - final Potion[] newPotionTypes = new Potion[256]; - System.arraycopy(potionTypes, 0, newPotionTypes, 0, potionTypes.length); - f.set(null, newPotionTypes); - } - } catch (Exception e) { - System.err.println("Severe error, please report this to the mod author:"); - System.err.println(e); - } - } - } - } diff --git a/src/main/java/vazkii/botania/common/brew/potion/PotionAllure.java b/src/main/java/vazkii/botania/common/brew/potion/PotionAllure.java index 4f856911e..0a055ddd5 100644 --- a/src/main/java/vazkii/botania/common/brew/potion/PotionAllure.java +++ b/src/main/java/vazkii/botania/common/brew/potion/PotionAllure.java @@ -15,22 +15,27 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityFishHook; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import vazkii.botania.common.core.handler.ConfigHandler; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import vazkii.botania.common.lib.LibPotionNames; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +import javax.annotation.Nonnull; public class PotionAllure extends PotionMod { public PotionAllure() { - super(ConfigHandler.potionIDAllure, LibPotionNames.ALLURE, false, 0x0034E4, 5); - MinecraftForge.EVENT_BUS.register(this); + super(LibPotionNames.ALLURE, false, 0x0034E4, 5); + setBeneficial(); } - @SubscribeEvent - public void onEntityUpdate(LivingUpdateEvent event) { - EntityLivingBase e = event.entityLiving; - if(e instanceof EntityPlayer && hasEffect(e)) { - EntityFishHook hook = ((EntityPlayer) e).fishEntity; + @Override + public boolean isReady(int duration, int amplifier) { + return true; + } + + @Override + public void performEffect(@Nonnull EntityLivingBase living, int amplified) { + if(living instanceof EntityPlayer) { + EntityFishHook hook = ((EntityPlayer) living).fishEntity; if(hook != null) hook.onUpdate(); } diff --git a/src/main/java/vazkii/botania/common/brew/potion/PotionBloodthirst.java b/src/main/java/vazkii/botania/common/brew/potion/PotionBloodthirst.java index 44eadad2b..0be6a938b 100644 --- a/src/main/java/vazkii/botania/common/brew/potion/PotionBloodthirst.java +++ b/src/main/java/vazkii/botania/common/brew/potion/PotionBloodthirst.java @@ -10,37 +10,36 @@ */ package vazkii.botania.common.brew.potion; -import java.util.List; - import net.minecraft.entity.monster.IMob; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.math.AxisAlignedBB; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.living.LivingSpawnEvent; +import net.minecraftforge.fml.common.eventhandler.Event.Result; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import vazkii.botania.common.brew.ModPotions; -import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.lib.LibPotionNames; -import cpw.mods.fml.common.eventhandler.Event.Result; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class PotionBloodthirst extends PotionMod { private static final int RANGE = 64; public PotionBloodthirst() { - super(ConfigHandler.potionIDBloodthirst, LibPotionNames.BLOODTHIRST, false, 0xC30000, 3); + super(LibPotionNames.BLOODTHIRST, false, 0xC30000, 3); MinecraftForge.EVENT_BUS.register(this); + setBeneficial(); } @SubscribeEvent public void onSpawn(LivingSpawnEvent.CheckSpawn event) { - if(event.getResult() != Result.ALLOW && event.entityLiving instanceof IMob) { - List players = event.world.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(event.x - RANGE, event.y - RANGE, event.z - RANGE, event.x + RANGE, event.y + RANGE, event.z + RANGE)); - for(EntityPlayer player : players) - if(hasEffect(player) && !hasEffect(player, ModPotions.emptiness)) { + if(event.getResult() != Result.ALLOW && event.getEntityLiving() instanceof IMob) { + AxisAlignedBB aabb = new AxisAlignedBB(event.getX() - RANGE, event.getY() - RANGE, event.getZ() - RANGE, event.getX() + RANGE, event.getY() + RANGE, event.getZ() + RANGE); + for(EntityPlayer player : event.getWorld().playerEntities) { + if(hasEffect(player) && !hasEffect(player, ModPotions.emptiness) && player.getEntityBoundingBox().intersectsWith(aabb)) { event.setResult(Result.ALLOW); return; } + } } } diff --git a/src/main/java/vazkii/botania/common/brew/potion/PotionClear.java b/src/main/java/vazkii/botania/common/brew/potion/PotionClear.java index 26e76aa3f..219cf3496 100644 --- a/src/main/java/vazkii/botania/common/brew/potion/PotionClear.java +++ b/src/main/java/vazkii/botania/common/brew/potion/PotionClear.java @@ -10,16 +10,18 @@ */ package vazkii.botania.common.brew.potion; +import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; -import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.lib.LibPotionNames; +import javax.annotation.Nonnull; + public class PotionClear extends PotionMod { public PotionClear() { - super(ConfigHandler.potionIDClear, LibPotionNames.CLEAR, false, 0xFFFFFF, 0); + super(LibPotionNames.CLEAR, false, 0xFFFFFF, 0); } @Override @@ -28,8 +30,8 @@ public class PotionClear extends PotionMod { } @Override - public void affectEntity(EntityLivingBase e, EntityLivingBase e1, int t, double d) { - e1.curePotionEffects(new ItemStack(Items.milk_bucket)); + public void affectEntity(Entity e, Entity e1, @Nonnull EntityLivingBase e2, int t, double d) { + e2.curePotionEffects(new ItemStack(Items.MILK_BUCKET)); } } diff --git a/src/main/java/vazkii/botania/common/brew/potion/PotionEmptiness.java b/src/main/java/vazkii/botania/common/brew/potion/PotionEmptiness.java index 6d2b77ea0..5c781c845 100644 --- a/src/main/java/vazkii/botania/common/brew/potion/PotionEmptiness.java +++ b/src/main/java/vazkii/botania/common/brew/potion/PotionEmptiness.java @@ -10,36 +10,35 @@ */ package vazkii.botania.common.brew.potion; -import java.util.List; - import net.minecraft.entity.monster.IMob; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.math.AxisAlignedBB; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.living.LivingSpawnEvent; -import vazkii.botania.common.core.handler.ConfigHandler; +import net.minecraftforge.fml.common.eventhandler.Event.Result; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import vazkii.botania.common.lib.LibPotionNames; -import cpw.mods.fml.common.eventhandler.Event.Result; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class PotionEmptiness extends PotionMod { private static final int RANGE = 128; public PotionEmptiness() { - super(ConfigHandler.potionIDEmptiness, LibPotionNames.EMPTINESS, false, 0xFACFFF, 2); + super(LibPotionNames.EMPTINESS, false, 0xFACFFF, 2); MinecraftForge.EVENT_BUS.register(this); + setBeneficial(); } @SubscribeEvent public void onSpawn(LivingSpawnEvent.CheckSpawn event) { - if(event.getResult() != Result.ALLOW && event.entityLiving instanceof IMob) { - List players = event.world.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(event.x - RANGE, event.y - RANGE, event.z - RANGE, event.x + RANGE, event.y + RANGE, event.z + RANGE)); - for(EntityPlayer player : players) - if(hasEffect(player)) { + if(event.getResult() != Result.ALLOW && event.getEntityLiving() instanceof IMob) { + AxisAlignedBB aabb = new AxisAlignedBB(event.getX() - RANGE, event.getY() - RANGE, event.getZ() - RANGE, event.getX() + RANGE, event.getY() + RANGE, event.getZ() + RANGE); + for(EntityPlayer player : event.getWorld().playerEntities) { + if(hasEffect(player) && player.getEntityBoundingBox().intersectsWith(aabb)) { event.setResult(Result.DENY); return; } + } } } diff --git a/src/main/java/vazkii/botania/common/brew/potion/PotionFeatherfeet.java b/src/main/java/vazkii/botania/common/brew/potion/PotionFeatherfeet.java index 0a3fff124..28ca98c01 100644 --- a/src/main/java/vazkii/botania/common/brew/potion/PotionFeatherfeet.java +++ b/src/main/java/vazkii/botania/common/brew/potion/PotionFeatherfeet.java @@ -13,22 +13,26 @@ package vazkii.botania.common.brew.potion; import net.minecraft.entity.EntityLivingBase; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import vazkii.botania.common.core.handler.ConfigHandler; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import vazkii.botania.common.lib.LibPotionNames; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +import javax.annotation.Nonnull; public class PotionFeatherfeet extends PotionMod { public PotionFeatherfeet() { - super(ConfigHandler.potionIDFeatherfeet, LibPotionNames.FEATHER_FEET, false, 0x26ADFF, 1); - MinecraftForge.EVENT_BUS.register(this); + super(LibPotionNames.FEATHER_FEET, false, 0x26ADFF, 1); + setBeneficial(); } - @SubscribeEvent - public void onEntityUpdate(LivingUpdateEvent event) { - EntityLivingBase e = event.entityLiving; - if(hasEffect(e)) - e.fallDistance = 2.5F; + @Override + public boolean isReady(int duration, int amplifier) { + return true; + } + + @Override + public void performEffect(@Nonnull EntityLivingBase living, int amplified) { + living.fallDistance = 2.5F; } } diff --git a/src/main/java/vazkii/botania/common/brew/potion/PotionMod.java b/src/main/java/vazkii/botania/common/brew/potion/PotionMod.java index 1cf8dcfe2..0eef0873e 100644 --- a/src/main/java/vazkii/botania/common/brew/potion/PotionMod.java +++ b/src/main/java/vazkii/botania/common/brew/potion/PotionMod.java @@ -11,29 +11,30 @@ package vazkii.botania.common.brew.potion; import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.VertexBuffer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.entity.EntityLivingBase; import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.client.lib.LibResources; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import vazkii.botania.common.lib.LibMisc; public class PotionMod extends Potion { private static final ResourceLocation resource = new ResourceLocation(LibResources.GUI_POTIONS); + private final int iconIndex; - public PotionMod(int id, String name, boolean badEffect, int color, int iconIndex) { - super(id, badEffect, color); + public PotionMod(String name, boolean badEffect, int color, int iconIndex) { + super(badEffect, color); + GameRegistry.register(this, new ResourceLocation(LibMisc.MOD_ID, name)); setPotionName("botania.potion." + name); - setIconIndex(iconIndex % 8, iconIndex / 8); - } - - @Override - @SideOnly(Side.CLIENT) - public int getStatusIconIndex() { - Minecraft.getMinecraft().renderEngine.bindTexture(resource); - - return super.getStatusIconIndex(); + this.iconIndex = iconIndex; } public boolean hasEffect(EntityLivingBase entity) { @@ -44,4 +45,35 @@ public class PotionMod extends Potion { return entity.getActivePotionEffect(potion) != null; } + @Override + @SideOnly(Side.CLIENT) + public void renderInventoryEffect(int x, int y, PotionEffect effect, Minecraft mc) { + render(x + 6, y + 7, 1); + } + + @Override + @SideOnly(Side.CLIENT) + public void renderHUDEffect(int x, int y, PotionEffect effect, Minecraft mc, float alpha) { + render(x + 3, y + 3, alpha); + } + + @SideOnly(Side.CLIENT) + private void render(int x, int y, float alpha) { + Minecraft.getMinecraft().renderEngine.bindTexture(resource); + Tessellator tessellator = Tessellator.getInstance(); + VertexBuffer buf = tessellator.getBuffer(); + buf.begin(7, DefaultVertexFormats.POSITION_TEX); + GlStateManager.color(1, 1, 1, alpha); + + int textureX = iconIndex % 8 * 18; + int textureY = 198 + iconIndex / 8 * 18; + + buf.pos(x, y + 18, 0).tex(textureX * 0.00390625, (textureY + 18) * 0.00390625).endVertex(); + buf.pos(x + 18, y + 18, 0).tex((textureX + 18) * 0.00390625, (textureY + 18) * 0.00390625).endVertex(); + buf.pos(x + 18, y, 0).tex((textureX + 18) * 0.00390625, textureY * 0.00390625).endVertex(); + buf.pos(x, y, 0).tex(textureX * 0.00390625, textureY * 0.00390625).endVertex(); + + tessellator.draw(); + } + } diff --git a/src/main/java/vazkii/botania/common/brew/potion/PotionSoulCross.java b/src/main/java/vazkii/botania/common/brew/potion/PotionSoulCross.java index 8498a6800..23b4cc7fe 100644 --- a/src/main/java/vazkii/botania/common/brew/potion/PotionSoulCross.java +++ b/src/main/java/vazkii/botania/common/brew/potion/PotionSoulCross.java @@ -14,24 +14,24 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.living.LivingDeathEvent; -import vazkii.botania.common.core.handler.ConfigHandler; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import vazkii.botania.common.lib.LibPotionNames; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class PotionSoulCross extends PotionMod { public PotionSoulCross() { - super(ConfigHandler.potionIDSoulCross, LibPotionNames.SOUL_CROSS, false, 0x47453d, 0); + super(LibPotionNames.SOUL_CROSS, false, 0x47453d, 0); MinecraftForge.EVENT_BUS.register(this); + setBeneficial(); } @SubscribeEvent public void onEntityKill(LivingDeathEvent event) { - Entity e = event.source.getEntity(); - if(e != null && e instanceof EntityLivingBase) { - EntityLivingBase living = (EntityLivingBase) e; + Entity killer = event.getSource().getEntity(); + if(killer != null && killer instanceof EntityLivingBase) { + EntityLivingBase living = (EntityLivingBase) killer; if(hasEffect(living)) - living.heal(event.entityLiving.getMaxHealth() / 20); + living.heal(event.getEntityLiving().getMaxHealth() / 20); } } diff --git a/src/main/java/vazkii/botania/common/core/BotaniaCreativeTab.java b/src/main/java/vazkii/botania/common/core/BotaniaCreativeTab.java index 7e7bdfee7..3007a4da1 100644 --- a/src/main/java/vazkii/botania/common/core/BotaniaCreativeTab.java +++ b/src/main/java/vazkii/botania/common/core/BotaniaCreativeTab.java @@ -10,8 +10,6 @@ */ package vazkii.botania.common.core; -import java.util.List; - import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; @@ -25,10 +23,13 @@ import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.lib.LibMisc; +import javax.annotation.Nonnull; +import java.util.List; + public final class BotaniaCreativeTab extends CreativeTabs { - public static BotaniaCreativeTab INSTANCE = new BotaniaCreativeTab(); - List list; + public static final BotaniaCreativeTab INSTANCE = new BotaniaCreativeTab(); + List list; public BotaniaCreativeTab() { super(LibMisc.MOD_ID); @@ -36,6 +37,7 @@ public final class BotaniaCreativeTab extends CreativeTabs { setBackgroundImageName(LibResources.GUI_CREATIVE); } + @Nonnull @Override public ItemStack getIconItemStack() { return new ItemStack(ModItems.lexicon); @@ -52,7 +54,7 @@ public final class BotaniaCreativeTab extends CreativeTabs { } @Override - public void displayAllReleventItems(List list) { + public void displayAllRelevantItems(@Nonnull List list) { this.list = list; addItem(ModItems.lexicon); @@ -299,30 +301,11 @@ public final class BotaniaCreativeTab extends CreativeTabs { addBlock(ModBlocks.manaBeacon); addItem(ModItems.signalFlare); - addStack(new ItemStack(Blocks.dirt, 1, 1)); addBlock(ModBlocks.dirtPath); addBlock(ModFluffBlocks.dirtPathSlab); - addBlock(ModBlocks.prismarine); - addBlock(ModBlocks.seaLamp); - addBlock(ModFluffBlocks.prismarineStairs); - addBlock(ModFluffBlocks.prismarineSlab); - addBlock(ModFluffBlocks.prismarineWall); - addBlock(ModFluffBlocks.prismarineBrickStairs); - addBlock(ModFluffBlocks.prismarineBrickSlab); - addBlock(ModFluffBlocks.darkPrismarineStairs); - addBlock(ModFluffBlocks.darkPrismarineSlab); - addBlock(ModBlocks.blazeBlock); - addBlock(ModBlocks.reedBlock); - addBlock(ModFluffBlocks.reedStairs); - addBlock(ModFluffBlocks.reedSlab); - addBlock(ModFluffBlocks.reedWall); - addBlock(ModBlocks.thatch); - addBlock(ModFluffBlocks.thatchStairs); - addBlock(ModFluffBlocks.thatchSlab); - addBlock(ModBlocks.customBrick); addBlock(ModFluffBlocks.netherBrickStairs); addBlock(ModFluffBlocks.netherBrickSlab); @@ -379,15 +362,6 @@ public final class BotaniaCreativeTab extends CreativeTabs { addBlock(ModFluffBlocks.sunnyQuartzSlab); addBlock(ModFluffBlocks.sunnyQuartzStairs); - if(ConfigHandler.stones18Enabled) { - addBlock(ModFluffBlocks.stone); - for(int i = 0; i < 8; i++) - addBlock(ModFluffBlocks.stoneStairs[i]); - for(int i = 0; i < 8; i++) - addBlock(ModFluffBlocks.stoneSlabs[i]); - addBlock(ModFluffBlocks.stoneWall); - } - addBlock(ModFluffBlocks.biomeStoneA); addBlock(ModFluffBlocks.biomeStoneB); for(int i = 0; i < 24; i++) @@ -402,14 +376,6 @@ public final class BotaniaCreativeTab extends CreativeTabs { for (Block pavementSlab : ModFluffBlocks.pavementSlabs) addBlock(pavementSlab); - if(ConfigHandler.enderStuff19Enabled) { - addBlock(ModBlocks.endStoneBrick); - addBlock(ModFluffBlocks.endStoneSlab); - addBlock(ModFluffBlocks.endStoneStairs); - addBlock(ModFluffBlocks.enderBrickSlab); - addBlock(ModFluffBlocks.enderBrickStairs); - } - addItem(ModItems.cosmetic); } diff --git a/src/main/java/vazkii/botania/common/core/command/CommandDownloadLatest.java b/src/main/java/vazkii/botania/common/core/command/CommandDownloadLatest.java index e7a477b49..c0b19fa53 100644 --- a/src/main/java/vazkii/botania/common/core/command/CommandDownloadLatest.java +++ b/src/main/java/vazkii/botania/common/core/command/CommandDownloadLatest.java @@ -12,36 +12,41 @@ package vazkii.botania.common.core.command; import net.minecraft.command.CommandBase; import net.minecraft.command.ICommandSender; -import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.util.ChatStyle; -import net.minecraft.util.EnumChatFormatting; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.text.Style; +import net.minecraft.util.text.TextComponentTranslation; +import net.minecraft.util.text.TextFormatting; import vazkii.botania.common.core.version.ThreadDownloadMod; import vazkii.botania.common.core.version.VersionChecker; +import javax.annotation.Nonnull; + public class CommandDownloadLatest extends CommandBase { private static final boolean ENABLED = true; + @Nonnull @Override public String getCommandName() { return "botania-download-latest"; } + @Nonnull @Override - public String getCommandUsage(ICommandSender var1) { + public String getCommandUsage(@Nonnull ICommandSender var1) { return "/botania-download-latest "; } @Override - public void processCommand(ICommandSender var1, String[] var2) { + public void execute(@Nonnull MinecraftServer server, @Nonnull ICommandSender var1, @Nonnull String[] var2) { if(!ENABLED) - var1.addChatMessage(new ChatComponentTranslation("botania.versioning.disabled").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED))); + var1.addChatMessage(new TextComponentTranslation("botania.versioning.disabled").setStyle(new Style().setColor(TextFormatting.RED))); else if(var2.length == 1) if(VersionChecker.downloadedFile) - var1.addChatMessage(new ChatComponentTranslation("botania.versioning.downloadedAlready").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED))); + var1.addChatMessage(new TextComponentTranslation("botania.versioning.downloadedAlready").setStyle(new Style().setColor(TextFormatting.RED))); else if(VersionChecker.startedDownload) - var1.addChatMessage(new ChatComponentTranslation("botania.versioning.downloadingAlready").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED))); + var1.addChatMessage(new TextComponentTranslation("botania.versioning.downloadingAlready").setStyle(new Style().setColor(TextFormatting.RED))); else new ThreadDownloadMod("Botania " + var2[0] + ".jar"); } diff --git a/src/main/java/vazkii/botania/common/core/command/CommandOpen.java b/src/main/java/vazkii/botania/common/core/command/CommandOpen.java index 6e6b3b2bc..c0f142445 100644 --- a/src/main/java/vazkii/botania/common/core/command/CommandOpen.java +++ b/src/main/java/vazkii/botania/common/core/command/CommandOpen.java @@ -14,32 +14,38 @@ import net.minecraft.command.CommandBase; import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.util.ChatStyle; -import net.minecraft.util.EnumChatFormatting; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.text.Style; +import net.minecraft.util.text.TextComponentTranslation; +import net.minecraft.util.text.TextFormatting; +import vazkii.botania.common.core.helper.PlayerHelper; import vazkii.botania.common.item.ItemLexicon; +import javax.annotation.Nonnull; + public class CommandOpen extends CommandBase { + @Nonnull @Override public String getCommandName() { return "botania-open"; } + @Nonnull @Override - public String getCommandUsage(ICommandSender p_71518_1_) { + public String getCommandUsage(@Nonnull ICommandSender sender) { return ""; } @Override - public void processCommand(ICommandSender sender, String[] args) { + public void execute(@Nonnull MinecraftServer server, @Nonnull ICommandSender sender, @Nonnull String[] args) { if(sender instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) sender; - ItemStack stack = player.getCurrentEquippedItem(); - if(stack != null && stack.getItem() instanceof ItemLexicon) { + ItemStack stack = PlayerHelper.getFirstHeldItemClass(player, ItemLexicon.class); + if(stack != null) { ItemLexicon.setForcedPage(stack, args[0]); ItemLexicon.setQueueTicks(stack, 5); - } else sender.addChatMessage(new ChatComponentTranslation("botaniamisc.noLexicon").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED))); + } else sender.addChatMessage(new TextComponentTranslation("botaniamisc.noLexicon").setStyle(new Style().setColor(TextFormatting.RED))); } } @@ -50,8 +56,8 @@ public class CommandOpen extends CommandBase { } @Override - public boolean canCommandSenderUseCommand(ICommandSender p_71519_1_) { - return p_71519_1_ instanceof EntityPlayer; + public boolean checkPermission(MinecraftServer server, ICommandSender sender) { + return sender instanceof EntityPlayer; } } diff --git a/src/main/java/vazkii/botania/common/core/command/CommandShare.java b/src/main/java/vazkii/botania/common/core/command/CommandShare.java index ef9001966..10b187f99 100644 --- a/src/main/java/vazkii/botania/common/core/command/CommandShare.java +++ b/src/main/java/vazkii/botania/common/core/command/CommandShare.java @@ -14,30 +14,34 @@ import net.minecraft.command.CommandBase; import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.server.MinecraftServer; -import net.minecraft.util.IChatComponent; -import net.minecraft.util.StatCollector; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.translation.I18n; + +import javax.annotation.Nonnull; public class CommandShare extends CommandBase { + @Nonnull @Override public String getCommandName() { return "botania-share"; } + @Nonnull @Override - public String getCommandUsage(ICommandSender p_71518_1_) { + public String getCommandUsage(@Nonnull ICommandSender sender) { return ""; } @Override - public void processCommand(ICommandSender sender, String[] args) { - String json = StatCollector.translateToLocal("botaniamisc.shareMsg"); - json = json.replaceAll("%name%", sender.getCommandSenderName()); + public void execute(@Nonnull MinecraftServer server, @Nonnull ICommandSender sender, @Nonnull String[] args) { + String json = I18n.translateToLocal("botaniamisc.shareMsg"); + json = json.replaceAll("%name%", sender.getName()); json = json.replaceAll("%entry%", args[0]); - json = json.replaceAll("%entryname%", StatCollector.translateToLocal(args[0])); + json = json.replaceAll("%entryname%", I18n.translateToLocal(args[0])); - IChatComponent component = IChatComponent.Serializer.func_150699_a(json); - MinecraftServer.getServer().getConfigurationManager().sendChatMsg(component); + ITextComponent component = ITextComponent.Serializer.jsonToComponent(json); + server.getPlayerList().sendChatMsg(component); } @@ -47,7 +51,7 @@ public class CommandShare extends CommandBase { } @Override - public boolean canCommandSenderUseCommand(ICommandSender p_71519_1_) { - return p_71519_1_ instanceof EntityPlayer; + public boolean checkPermission(MinecraftServer server, ICommandSender sender) { + return sender instanceof EntityPlayer; } } diff --git a/src/main/java/vazkii/botania/common/core/command/CommandSkyblockSpread.java b/src/main/java/vazkii/botania/common/core/command/CommandSkyblockSpread.java index 3be7ca074..c4d89764e 100644 --- a/src/main/java/vazkii/botania/common/core/command/CommandSkyblockSpread.java +++ b/src/main/java/vazkii/botania/common/core/command/CommandSkyblockSpread.java @@ -14,20 +14,25 @@ import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.StatCollector; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.translation.I18n; import vazkii.botania.common.core.helper.MathHelper; import vazkii.botania.common.world.SkyblockWorldEvents; +import javax.annotation.Nonnull; + public class CommandSkyblockSpread extends CommandBase { + @Nonnull @Override public String getCommandName() { return "botania-skyblock-spread"; } + @Nonnull @Override - public String getCommandUsage(ICommandSender p_71518_1_) { + public String getCommandUsage(@Nonnull ICommandSender sender) { return " []"; } @@ -37,31 +42,31 @@ public class CommandSkyblockSpread extends CommandBase { } @Override - public void processCommand(ICommandSender sender, String[] args) { + public void execute(@Nonnull MinecraftServer server, @Nonnull ICommandSender sender, @Nonnull String[] args) throws CommandException { int maxAllowed = 1000000; int minAllowed = 250; int minDist = 100; int maxrange = 200000; if(args.length == 2) - maxrange = parseInt(sender, args[1]); + maxrange = parseInt(args[1]); if(maxrange > maxAllowed) throw new CommandException("botaniamisc.skyblockRangeTooHigh"); if(maxrange < minAllowed) - throw new CommandException(StatCollector.translateToLocal("botaniamisc.skyblockRangeTooLow")); + throw new CommandException(I18n.translateToLocal("botaniamisc.skyblockRangeTooLow")); - EntityPlayer player = getPlayer(sender, args[0]); + EntityPlayer player = getPlayer(server, sender, args[0]); if(player != null) { - ChunkCoordinates spawn = player.worldObj.getSpawnPoint(); + BlockPos spawn = player.worldObj.getSpawnPoint(); int x, z; do { - x = player.worldObj.rand.nextInt(maxrange) - maxrange / 2 + spawn.posX; - z = player.worldObj.rand.nextInt(maxrange) - maxrange / 2 + spawn.posZ; - } while(MathHelper.pointDistancePlane(x, z, spawn.posX, spawn.posZ) < minDist); + x = player.worldObj.rand.nextInt(maxrange) - maxrange / 2 + spawn.getX(); + z = player.worldObj.rand.nextInt(maxrange) - maxrange / 2 + spawn.getZ(); + } while(MathHelper.pointDistancePlane(x, z, spawn.getX(), spawn.getZ()) < minDist); - SkyblockWorldEvents.spawnPlayer(player, x, spawn.posY, z, true); + SkyblockWorldEvents.spawnPlayer(player, new BlockPos(x, spawn.getY(), z), true); } } diff --git a/src/main/java/vazkii/botania/common/core/handler/AliasHandler.java b/src/main/java/vazkii/botania/common/core/handler/AliasHandler.java deleted file mode 100644 index aad356ac8..000000000 --- a/src/main/java/vazkii/botania/common/core/handler/AliasHandler.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [May 16, 2014, 6:24:12 PM (GMT)] - */ -package vazkii.botania.common.core.handler; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import vazkii.botania.client.lib.LibResources; -import cpw.mods.fml.common.event.FMLMissingMappingsEvent; -import cpw.mods.fml.common.event.FMLMissingMappingsEvent.MissingMapping; -import cpw.mods.fml.common.registry.GameRegistry.Type; - -public final class AliasHandler { - - public static void onMissingMappings(FMLMissingMappingsEvent event) { - List mappings = event.get(); - for(MissingMapping mapping : mappings) { - String name = mapping.name.substring(LibResources.PREFIX_MOD.length() * 2); - - if(mapping.type == Type.ITEM) - remapItem(mapping, getItem(name)); - else remapBlock(mapping, getBlock(name)); - } - } - - private static void remapItem(MissingMapping mapping, Item item) { - if(item != null) - mapping.remap(item); - } - - private static void remapBlock(MissingMapping mapping, Block block) { - if(block != null) - mapping.remap(block); - } - - private static Item getItem(String name) { - for(Object o : Item.itemRegistry.getKeys()) { - Item i = (Item) Item.itemRegistry.getObject(o); - if(i.getUnlocalizedName().substring("item.".length()).equals(name)) - return i; - } - - return null; - } - - private static Block getBlock(String name) { - for(Object o : Block.blockRegistry.getKeys()) { - Block b = (Block) Block.blockRegistry.getObject(o); - if(b.getUnlocalizedName().substring("tile.".length()).equals(name)) - return b; - } - - return null; - } -} diff --git a/src/main/java/vazkii/botania/common/core/handler/BiomeDecorationHandler.java b/src/main/java/vazkii/botania/common/core/handler/BiomeDecorationHandler.java index b5fa63798..989921d6e 100644 --- a/src/main/java/vazkii/botania/common/core/handler/BiomeDecorationHandler.java +++ b/src/main/java/vazkii/botania/common/core/handler/BiomeDecorationHandler.java @@ -10,73 +10,66 @@ */ package vazkii.botania.common.core.handler; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.util.math.BlockPos; import net.minecraftforge.event.terraingen.DecorateBiomeEvent; import net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType; +import net.minecraftforge.fml.common.eventhandler.Event.Result; +import net.minecraftforge.fml.common.eventhandler.EventPriority; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import vazkii.botania.api.item.IFlowerlessBiome; import vazkii.botania.api.item.IFlowerlessWorld; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.common.block.BlockModFlower; import vazkii.botania.common.block.ModBlocks; -import vazkii.botania.common.block.subtile.generating.SubTileDaybloom; -import vazkii.botania.common.block.tile.TileSpecialFlower; -import vazkii.botania.common.lib.LibBlockNames; -import cpw.mods.fml.common.eventhandler.Event.Result; -import cpw.mods.fml.common.eventhandler.EventPriority; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -public class BiomeDecorationHandler { +public final class BiomeDecorationHandler { + + private BiomeDecorationHandler() {} @SubscribeEvent(priority = EventPriority.LOWEST) - public void onWorldDecoration(DecorateBiomeEvent.Decorate event) { - if((event.getResult() == Result.ALLOW || event.getResult() == Result.DEFAULT) && event.type == EventType.FLOWERS) { + public static void onWorldDecoration(DecorateBiomeEvent.Decorate event) { + if((event.getResult() == Result.ALLOW || event.getResult() == Result.DEFAULT) && event.getType() == EventType.FLOWERS) { boolean flowers = true; - if(event.world.provider instanceof IFlowerlessWorld) - flowers = ((IFlowerlessWorld) event.world.provider).generateFlowers(event.world); - else if(event.world.getBiomeGenForCoords(event.chunkX, event.chunkZ) instanceof IFlowerlessBiome) - flowers = ((IFlowerlessBiome) event.world.getBiomeGenForCoords(event.chunkX, event.chunkZ)).canGenerateFlowers(event.world, event.chunkX, event.chunkZ); + if(event.getWorld().provider instanceof IFlowerlessWorld) + flowers = ((IFlowerlessWorld) event.getWorld().provider).generateFlowers(event.getWorld()); + else if(event.getWorld().getBiomeGenForCoords(event.getPos()) instanceof IFlowerlessBiome) + flowers = ((IFlowerlessBiome) event.getWorld().getBiomeGenForCoords(event.getPos())).canGenerateFlowers(event.getWorld(), event.getPos().getX(), event.getPos().getZ()); if(!flowers) return; int dist = Math.min(8, Math.max(1, ConfigHandler.flowerPatchSize)); for(int i = 0; i < ConfigHandler.flowerQuantity; i++) { - if(event.rand.nextInt(ConfigHandler.flowerPatchChance) == 0) { - int x = event.chunkX + event.rand.nextInt(16) + 8; - int z = event.chunkZ + event.rand.nextInt(16) + 8; - int y = event.world.getTopSolidOrLiquidBlock(x, z); + if(event.getRand().nextInt(ConfigHandler.flowerPatchChance) == 0) { + int x = event.getPos().getX() + event.getRand().nextInt(16) + 8; + int z = event.getPos().getZ() + event.getRand().nextInt(16) + 8; + int y = event.getWorld().getTopSolidOrLiquidBlock(event.getPos()).getY(); - int color = event.rand.nextInt(16); - boolean primus = event.rand.nextInt(380) == 0; + EnumDyeColor color = EnumDyeColor.byMetadata(event.getRand().nextInt(16)); for(int j = 0; j < ConfigHandler.flowerDensity * ConfigHandler.flowerPatchChance; j++) { - int x1 = x + event.rand.nextInt(dist * 2) - dist; - int y1 = y + event.rand.nextInt(4) - event.rand.nextInt(4); - int z1 = z + event.rand.nextInt(dist * 2) - dist; - - if(event.world.isAirBlock(x1, y1, z1) && (!event.world.provider.hasNoSky || y1 < 127) && ModBlocks.flower.canBlockStay(event.world, x1, y1, z1)) { - if(primus) { - event.world.setBlock(x1, y1, z1, ModBlocks.specialFlower, 0, 2); - TileSpecialFlower flower = (TileSpecialFlower) event.world.getTileEntity(x1, y1, z1); - flower.setSubTile(event.rand.nextBoolean() ? LibBlockNames.SUBTILE_NIGHTSHADE_PRIME : LibBlockNames.SUBTILE_DAYBLOOM_PRIME); - SubTileDaybloom subtile = (SubTileDaybloom) flower.getSubTile(); - subtile.setPrimusPosition(); - } else { - event.world.setBlock(x1, y1, z1, ModBlocks.flower, color, 2); - if(event.rand.nextDouble() < ConfigHandler.flowerTallChance && ((BlockModFlower) ModBlocks.flower).func_149851_a(event.world, x1, y1, z1, false)) - BlockModFlower.placeDoubleFlower(event.world, x1, y1, z1, color, 0); - } + int x1 = x + event.getRand().nextInt(dist * 2) - dist; + int y1 = y + event.getRand().nextInt(4) - event.getRand().nextInt(4); + int z1 = z + event.getRand().nextInt(dist * 2) - dist; + BlockPos pos2 = new BlockPos(x1, y1, z1); + if(event.getWorld().isAirBlock(pos2) && (!event.getWorld().provider.getHasNoSky() || y1 < 127) && ModBlocks.flower.canPlaceBlockAt(event.getWorld(), pos2)) { + event.getWorld().setBlockState(pos2, ModBlocks.flower.getDefaultState().withProperty(BotaniaStateProps.COLOR, color), 2); + if(event.getRand().nextDouble() < ConfigHandler.flowerTallChance && ((BlockModFlower) ModBlocks.flower).canGrow(event.getWorld(), pos2, event.getWorld().getBlockState(pos2), false)) + BlockModFlower.placeDoubleFlower(event.getWorld(), pos2, color, 0); } } } } for(int i = 0; i < ConfigHandler.mushroomQuantity; i++) { - int x = event.chunkX + event.rand.nextInt(16) + 8; - int z = event.chunkZ + event.rand.nextInt(16) + 8; - int y = event.rand.nextInt(26) + 4; - - int color = event.rand.nextInt(16); - if(event.world.isAirBlock(x, y, z) && ModBlocks.mushroom.canBlockStay(event.world, x, y, z)) - event.world.setBlock(x, y, z, ModBlocks.mushroom, color, 2); + int x = event.getPos().getX() + event.getRand().nextInt(16) + 8; + int z = event.getPos().getZ() + event.getRand().nextInt(16) + 8; + int y = event.getRand().nextInt(26) + 4; + BlockPos pos3 = new BlockPos(x, y, z); + EnumDyeColor color = EnumDyeColor.byMetadata(event.getRand().nextInt(16)); + if(event.getWorld().isAirBlock(pos3) && ModBlocks.mushroom.canPlaceBlockAt(event.getWorld(), pos3)) + event.getWorld().setBlockState(pos3, ModBlocks.mushroom.getDefaultState().withProperty(BotaniaStateProps.COLOR, color), 2); } } } diff --git a/src/main/java/vazkii/botania/common/core/handler/ChestGenHandler.java b/src/main/java/vazkii/botania/common/core/handler/ChestGenHandler.java deleted file mode 100644 index b5b1315d9..000000000 --- a/src/main/java/vazkii/botania/common/core/handler/ChestGenHandler.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jul 15, 2014, 3:17:00 PM (GMT)] - */ -package vazkii.botania.common.core.handler; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.WeightedRandomChestContent; -import net.minecraftforge.common.ChestGenHooks; -import vazkii.botania.common.item.ModItems; - -public final class ChestGenHandler { - - public static void init() { - String c = ChestGenHooks.BONUS_CHEST; - ChestGenHooks.addItem(c, new WeightedRandomChestContent(new ItemStack(ModItems.lexicon), 1, 1, 7)); - ChestGenHooks.addItem(c, new WeightedRandomChestContent(new ItemStack(ModItems.blackLotus), 1, 1, 1)); - - c = ChestGenHooks.STRONGHOLD_CORRIDOR; - ChestGenHooks.addItem(c, new WeightedRandomChestContent(new ItemStack(ModItems.manaResource, 1, 1), 1, 1, 8)); - ChestGenHooks.addItem(c, new WeightedRandomChestContent(new ItemStack(ModItems.manaResource, 1, 1), 1, 3, 2)); - ChestGenHooks.addItem(c, new WeightedRandomChestContent(new ItemStack(ModItems.blackLotus), 1, 1, 6)); - ChestGenHooks.addItem(c, new WeightedRandomChestContent(new ItemStack(ModItems.overgrowthSeed), 1, 1, 2)); - - c = ChestGenHooks.DUNGEON_CHEST; - ChestGenHooks.addItem(c, new WeightedRandomChestContent(new ItemStack(ModItems.manaResource, 1, 0), 1, 5, 9)); - ChestGenHooks.addItem(c, new WeightedRandomChestContent(new ItemStack(ModItems.lexicon), 1, 1, 6)); - ChestGenHooks.addItem(c, new WeightedRandomChestContent(new ItemStack(ModItems.manaBottle), 1, 1, 5)); - ChestGenHooks.addItem(c, new WeightedRandomChestContent(new ItemStack(ModItems.blackLotus), 1, 1, 6)); - ChestGenHooks.addItem(c, new WeightedRandomChestContent(new ItemStack(ModItems.overgrowthSeed), 1, 1, 2)); - - c = ChestGenHooks.PYRAMID_DESERT_CHEST; - ChestGenHooks.addItem(c, new WeightedRandomChestContent(new ItemStack(ModItems.blackLotus), 1, 1, 6)); - ChestGenHooks.addItem(c, new WeightedRandomChestContent(new ItemStack(ModItems.overgrowthSeed), 1, 1, 2)); - - c = ChestGenHooks.MINESHAFT_CORRIDOR; - ChestGenHooks.addItem(c, new WeightedRandomChestContent(new ItemStack(ModItems.blackLotus), 1, 1, 6)); - ChestGenHooks.addItem(c, new WeightedRandomChestContent(new ItemStack(ModItems.overgrowthSeed), 1, 1, 2)); - - c = ChestGenHooks.PYRAMID_JUNGLE_CHEST; - ChestGenHooks.addItem(c, new WeightedRandomChestContent(new ItemStack(ModItems.blackLotus), 1, 1, 6)); - ChestGenHooks.addItem(c, new WeightedRandomChestContent(new ItemStack(ModItems.overgrowthSeed), 1, 1, 2)); - - c = ChestGenHooks.VILLAGE_BLACKSMITH; - ChestGenHooks.addItem(c, new WeightedRandomChestContent(new ItemStack(ModItems.blackLotus), 1, 1, 6)); - } - -} diff --git a/src/main/java/vazkii/botania/common/core/handler/CommonTickHandler.java b/src/main/java/vazkii/botania/common/core/handler/CommonTickHandler.java index 5ebadc969..f816b37f8 100644 --- a/src/main/java/vazkii/botania/common/core/handler/CommonTickHandler.java +++ b/src/main/java/vazkii/botania/common/core/handler/CommonTickHandler.java @@ -10,40 +10,18 @@ */ package vazkii.botania.common.core.handler; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; +import net.minecraftforge.fml.common.gameevent.TickEvent.WorldTickEvent; import vazkii.botania.api.corporea.CorporeaHelper; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent; -import cpw.mods.fml.common.gameevent.TickEvent.Phase; -import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; public final class CommonTickHandler { + private CommonTickHandler() {} + @SubscribeEvent - public void onTick(WorldTickEvent event) { + public static void onTick(WorldTickEvent event) { if(event.phase == Phase.END) { - /*List entities = new ArrayList(event.world.loadedEntityList); - for(Entity entity : entities) - if(entity instanceof EntityItem) - TerrasteelCraftingHandler.onEntityUpdate((EntityItem) entity);*/ - - CorporeaHelper.clearCache(); - } - } - - @SideOnly(Side.CLIENT) - @SubscribeEvent - public void onTick(ClientTickEvent event) { - if(event.phase == Phase.END) { - /*World world = Minecraft.getMinecraft().theWorld; - if(world != null) { - List entities = new ArrayList(world.loadedEntityList); - for(Entity entity : entities) - if(entity instanceof EntityItem) - TerrasteelCraftingHandler.onEntityUpdate((EntityItem) entity); - }*/ - CorporeaHelper.clearCache(); } } diff --git a/src/main/java/vazkii/botania/common/core/handler/ConfigHandler.java b/src/main/java/vazkii/botania/common/core/handler/ConfigHandler.java index 84761a3db..e44892d86 100644 --- a/src/main/java/vazkii/botania/common/core/handler/ConfigHandler.java +++ b/src/main/java/vazkii/botania/common/core/handler/ConfigHandler.java @@ -10,36 +10,30 @@ */ package vazkii.botania.common.core.handler; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.text.Style; +import net.minecraft.util.text.TextComponentString; +import net.minecraft.util.text.TextComponentTranslation; +import net.minecraft.util.text.TextFormatting; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.common.config.Property; +import net.minecraftforge.fml.client.event.ConfigChangedEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import vazkii.botania.common.Botania; +import vazkii.botania.common.lib.LibMisc; + import java.io.File; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.potion.Potion; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.util.ChatStyle; -import net.minecraft.util.EnumChatFormatting; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import vazkii.botania.common.Botania; -import vazkii.botania.common.lib.LibMisc; -import vazkii.botania.common.lib.LibPotionNames; -import cpw.mods.fml.client.event.ConfigChangedEvent; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - public final class ConfigHandler { public static Configuration config; public static ConfigAdaptor adaptor; - private static final String CATEGORY_POTIONS = "potions"; - - public static int hardcorePassiveGeneration = 72000; public static boolean useAdaptativeConfig = true; @@ -71,6 +65,7 @@ public final class ConfigHandler { public static int glSecondaryTextureUnit = 7; public static boolean altFlowerTextures = false; + public static boolean staticFloaters = false; public static boolean matrixMode = false; public static boolean referencesEnabled = true; @@ -84,9 +79,7 @@ public final class ConfigHandler { public static boolean enchanterEnabled = true; public static boolean fluxfieldEnabled = true; public static boolean relicsEnabled = true; - public static boolean stones18Enabled = true; public static boolean ringOfOdinFireResist = true; - public static boolean enderStuff19Enabled = true; public static boolean invertMagnetRing = false; public static boolean enableThaumcraftStablizers = true; @@ -100,23 +93,13 @@ public final class ConfigHandler { public static double flowerTallChance = 0.05; public static int mushroomQuantity = 40; - private static boolean verifiedPotionArray = false; - private static int potionArrayLimit = 0; - - public static int potionIDSoulCross = 91; - public static int potionIDFeatherfeet = 92; - public static int potionIDEmptiness = 93; - public static int potionIDBloodthirst = 94; - public static int potionIDAllure = 95; - public static int potionIDClear = 96; - public static void loadConfig(File configFile) { config = new Configuration(configFile); config.load(); load(); - FMLCommonHandler.instance().bus().register(new ChangeListener()); + MinecraftForge.EVENT_BUS.register(ChangeListener.class); } public static void load() { @@ -201,8 +184,8 @@ public final class ConfigHandler { desc = "The GL Texture Unit to use for the secondary sampler passed in to the Lexica Botania's category button shader. DO NOT TOUCH THIS IF YOU DON'T KNOW WHAT YOU'RE DOING"; glSecondaryTextureUnit = loadPropInt("shaders.secondaryUnit", desc, glSecondaryTextureUnit); - desc = "Set this to true to use alternate flower textures by Futureazoo, not all flowers are textured. http://redd.it/2b3o3f"; - altFlowerTextures = loadPropBool("flowerTextures.alt", desc, altFlowerTextures); + desc = "Set this to true if you use lots of floating flowers and are experiencing rendering lag. Will disable the floating flowers' animations and render them statically for a major performance boost. Hit F3+A in-world after toggling this."; + staticFloaters = loadPropBool("staticFloaters.enabled", desc, staticFloaters); desc = "Set this to true if you are the chosen one. For lovers of glitch art and just general mad people."; matrixMode = loadPropBool("matrixMode.enabled", desc, matrixMode); @@ -237,15 +220,9 @@ public final class ConfigHandler { desc = "Set this to false to disable the Relic System. This only disables the entries, drops and achievements. Old ones that are already in the world will stay."; relicsEnabled = loadPropBool("relics.enabled", desc, relicsEnabled); - desc = "Set this to false to disable the 1.8 Stones available as mana alchemy recipes. This only disables the recipes and entries. Old ones that are already in the world will stay."; - stones18Enabled = loadPropBool("18stones.enabled", desc, stones18Enabled); - desc = "Set this to false to make the Ring of Odin not apply fire resistance. Mostly for people who use Witchery transformations."; ringOfOdinFireResist = loadPropBool("ringOfOdin.fireResist", desc, ringOfOdinFireResist); - desc = "Set this to false to disable the 1.9 Ender features available as recipes. This only disables the recipes and entries. Old ones that are already in the world will stay."; - enderStuff19Enabled = loadPropBool("19enderStuff.enabled", desc, enderStuff19Enabled); - desc = "Set this to true to invert the Ring of Magnetization's controls (from shift to stop to shift to work)"; invertMagnetRing = loadPropBool("magnetRing.invert", desc, invertMagnetRing); @@ -261,9 +238,6 @@ public final class ConfigHandler { desc = "The quantity of Botania flower patches to generate in the world, defaults to 2, the lower the number the less patches generate."; flowerQuantity = loadPropInt("worldgen.flower.quantity", desc, flowerQuantity); - desc = "The amount of time it takes a Passive flower to decay and turn into a dead bush. Defaults to 72000, 60 minutes. Setting this to -1 disables the feature altogether."; - hardcorePassiveGeneration = loadPropInt("passiveDecay.time", desc, hardcorePassiveGeneration); - desc = "The density of each Botania flower patch generated, defaults to 2, the lower the number, the less each patch will have."; adaptor.addMappingInt(0, "worldgen.flower.density", 16); adaptor.addMappingInt(238, "worldgen.flower.density", 2); @@ -285,13 +259,6 @@ public final class ConfigHandler { desc = "The quantity of Botania mushrooms to generate underground, in the world, defaults to 40, the lower the number the less patches generate."; mushroomQuantity = loadPropInt("worldgen.mushroom.quantity", desc, mushroomQuantity); - potionIDSoulCross = loadPropPotionId(LibPotionNames.SOUL_CROSS, potionIDSoulCross); - potionIDFeatherfeet = loadPropPotionId(LibPotionNames.FEATHER_FEET, potionIDFeatherfeet); - potionIDEmptiness = loadPropPotionId(LibPotionNames.EMPTINESS, potionIDEmptiness); - potionIDBloodthirst = loadPropPotionId(LibPotionNames.BLOODTHIRST, potionIDBloodthirst); - potionIDAllure = loadPropPotionId(LibPotionNames.ALLURE, potionIDAllure); - potionIDClear = loadPropPotionId(LibPotionNames.CLEAR, potionIDClear); - if(config.hasChanged()) config.save(); } @@ -305,7 +272,7 @@ public final class ConfigHandler { public static int loadPropInt(String propName, String desc, int default_) { Property prop = config.get(Configuration.CATEGORY_GENERAL, propName, default_); - prop.comment = desc; + prop.setComment(desc); if(adaptor != null) adaptor.adaptPropertyInt(prop, prop.getInt(default_)); @@ -315,7 +282,7 @@ public final class ConfigHandler { public static double loadPropDouble(String propName, String desc, double default_) { Property prop = config.get(Configuration.CATEGORY_GENERAL, propName, default_); - prop.comment = desc; + prop.setComment(desc); if(adaptor != null) adaptor.adaptPropertyDouble(prop, prop.getDouble(default_)); @@ -325,7 +292,7 @@ public final class ConfigHandler { public static boolean loadPropBool(String propName, String desc, boolean default_) { Property prop = config.get(Configuration.CATEGORY_GENERAL, propName, default_); - prop.comment = desc; + prop.setComment(desc); if(adaptor != null) adaptor.adaptPropertyBool(prop, prop.getBoolean(default_)); @@ -333,36 +300,14 @@ public final class ConfigHandler { return prop.getBoolean(default_); } - public static int loadPropPotionId(String propName, int default_) { - if(!verifiedPotionArray) - verifyPotionArray(); - - Property prop = config.get(CATEGORY_POTIONS, propName, default_); - int val = prop.getInt(default_); - if(val > potionArrayLimit) { - val = default_; - prop.set(default_); - } - - return val; - } - - private static void verifyPotionArray() { - if(Loader.isModLoaded("DragonAPI")) - potionArrayLimit = Potion.potionTypes.length; - else potionArrayLimit = 127; - - verifiedPotionArray = true; - } - public static class ConfigAdaptor { private boolean enabled; private int lastBuild; private int currentBuild; - private Map> adaptableValues = new HashMap(); - private List changes = new ArrayList(); + private final Map> adaptableValues = new HashMap<>(); + private final List changes = new ArrayList<>(); public ConfigAdaptor(boolean enabled) { this.enabled = enabled; @@ -409,10 +354,9 @@ public final class ConfigHandler { if(!enabled) return; - AdaptableValue adapt = new AdaptableValue(version, val); + AdaptableValue adapt = new AdaptableValue<>(version, val); if(!adaptableValues.containsKey(key)) { - ArrayList list = new ArrayList(); - adaptableValues.put(key, list); + adaptableValues.put(key, new ArrayList<>()); } List list = adaptableValues.get(key); @@ -435,33 +379,33 @@ public final class ConfigHandler { if(changes.size() == 0) return; - player.addChatComponentMessage(new ChatComponentTranslation("botaniamisc.adaptativeConfigChanges").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GOLD))); + player.addChatComponentMessage(new TextComponentTranslation("botaniamisc.adaptativeConfigChanges").setStyle(new Style().setColor(TextFormatting.GOLD))); for(String change : changes) - player.addChatMessage(new ChatComponentText(change).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.LIGHT_PURPLE))); + player.addChatMessage(new TextComponentString(change).setStyle(new Style().setColor(TextFormatting.LIGHT_PURPLE))); } public void addMappingInt(int version, String key, int val) { - this.addMapping(version, key, val); + this.addMapping(version, key, val); } public void addMappingDouble(int version, String key, double val) { - this.addMapping(version, key, val); + this.addMapping(version, key, val); } public void addMappingBool(int version, String key, boolean val) { - this.addMapping(version, key, val); + this.addMapping(version, key, val); } public void adaptPropertyInt(Property prop, int val) { - this.adaptProperty(prop, val); + this.adaptProperty(prop, val); } public void adaptPropertyDouble(Property prop, double val) { - this.adaptProperty(prop, val); + this.adaptProperty(prop, val); } public void adaptPropertyBool(Property prop, boolean val) { - this.adaptProperty(prop, val); + this.adaptProperty(prop, val); } public static class AdaptableValue { @@ -483,8 +427,8 @@ public final class ConfigHandler { public static class ChangeListener { @SubscribeEvent - public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent eventArgs) { - if(eventArgs.modID.equals(LibMisc.MOD_ID)) + public static void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent eventArgs) { + if(eventArgs.getModID().equals(LibMisc.MOD_ID)) load(); } diff --git a/src/main/java/vazkii/botania/common/core/handler/IMCHandler.java b/src/main/java/vazkii/botania/common/core/handler/IMCHandler.java index a12ad98f9..c8f289e8b 100644 --- a/src/main/java/vazkii/botania/common/core/handler/IMCHandler.java +++ b/src/main/java/vazkii/botania/common/core/handler/IMCHandler.java @@ -1,21 +1,15 @@ package vazkii.botania.common.core.handler; -import java.util.Iterator; - +import com.google.common.collect.ImmutableList; +import net.minecraftforge.fml.common.event.FMLInterModComms.IMCMessage; import vazkii.botania.common.item.equipment.bauble.ItemMagnetRing; import vazkii.botania.common.lib.LibMisc; -import com.google.common.collect.ImmutableList; - -import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage; - public final class IMCHandler { public static void processMessages(ImmutableList messageList) { - Iterator iterator = messageList.iterator(); - while(iterator.hasNext()) { - IMCMessage message = iterator.next(); - if(message != null && message.key != null && message.key.equals(LibMisc.BLACKLIST_ITEM) && message.isStringMessage()) { + for (IMCMessage message : messageList) { + if (message != null && message.key != null && message.key.equals(LibMisc.BLACKLIST_ITEM) && message.isStringMessage()) { String value = message.getStringValue(); ItemMagnetRing.addItemToBlackList(value); } diff --git a/src/main/java/vazkii/botania/common/core/handler/InternalMethodHandler.java b/src/main/java/vazkii/botania/common/core/handler/InternalMethodHandler.java index d157b494f..f1780852f 100644 --- a/src/main/java/vazkii/botania/common/core/handler/InternalMethodHandler.java +++ b/src/main/java/vazkii/botania/common/core/handler/InternalMethodHandler.java @@ -13,25 +13,33 @@ package vazkii.botania.common.core.handler; import java.util.ArrayList; import java.util.List; +import baubles.common.lib.PlayerHandler; +import baubles.common.network.PacketHandler; +import baubles.common.network.PacketSyncBauble; +import buildcraft.api.transport.IPipeTile; import net.minecraft.block.Block; import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.init.Blocks; import net.minecraft.inventory.IInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import vazkii.botania.api.boss.IBotaniaBoss; +import net.minecraftforge.fml.common.Optional; +import net.minecraftforge.items.IItemHandlerModifiable; +import net.minecraftforge.items.wrapper.InvWrapper; +import vazkii.botania.api.BotaniaAPIClient; import vazkii.botania.api.corporea.CorporeaHelper; import vazkii.botania.api.corporea.ICorporeaSpark; import vazkii.botania.api.corporea.IWrappedInventory; +import vazkii.botania.api.corporea.InvWithLocation; import vazkii.botania.api.internal.DummyMethodHandler; import vazkii.botania.api.internal.IManaNetwork; import vazkii.botania.api.lexicon.LexiconPage; @@ -46,10 +54,7 @@ import vazkii.botania.api.subtile.SubTileFunctional; import vazkii.botania.api.subtile.SubTileGenerating; import vazkii.botania.client.core.handler.BossBarHandler; import vazkii.botania.client.core.handler.HUDHandler; -import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.common.Botania; -import vazkii.botania.common.block.BlockModFlower; -import vazkii.botania.common.block.BlockSpecialFlower; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.subtile.functional.SubTileSolegnolia; import vazkii.botania.common.integration.corporea.WrappedDeepStorage; @@ -68,11 +73,7 @@ import vazkii.botania.common.lexicon.page.PageMultiblock; import vazkii.botania.common.lexicon.page.PagePetalRecipe; import vazkii.botania.common.lexicon.page.PageRuneRecipe; import vazkii.botania.common.lexicon.page.PageText; -import baubles.common.lib.PlayerHandler; -import baubles.common.network.PacketHandler; -import baubles.common.network.PacketSyncBauble; -import buildcraft.api.transport.IPipeTile; -import cpw.mods.fml.common.Optional; +import vazkii.botania.common.lib.LibMisc; public class InternalMethodHandler extends DummyMethodHandler { @@ -102,27 +103,23 @@ public class InternalMethodHandler extends DummyMethodHandler { } @Override - public IIcon getSubTileIconForName(String name) { - IIcon icon = (ConfigHandler.altFlowerTextures ? BlockSpecialFlower.iconsAlt : BlockSpecialFlower.icons).get(name); - return icon == null ? Blocks.red_flower.getIcon(0, 0) : icon; + public ModelResourceLocation getSubTileBlockModelForName(String name) { + return BotaniaAPIClient.getRegisteredSubtileBlockModels().get(name); } @Override - public void registerBasicSignatureIcons(String name, IIconRegister register) { - IIcon normal = IconHelper.forName(register, name); - IIcon alt = IconHelper.forName(register, BlockModFlower.ALT_DIR + "/" + name); - BlockSpecialFlower.icons.put(name, normal); - BlockSpecialFlower.iconsAlt.put(name, alt == null ? normal : alt); + public ModelResourceLocation getSubTileItemModelForName(String name) { + return BotaniaAPIClient.getRegisteredSubtileItemModels().get(name); } @Override public LexiconPage petalRecipesPage(String key, List recipes) { - return new PagePetalRecipe(key, recipes); + return new PagePetalRecipe<>(key, recipes); } @Override public LexiconPage petalRecipePage(String key, RecipePetals recipe) { - return new PagePetalRecipe(key, recipe); + return new PagePetalRecipe<>(key, recipe); } @Override @@ -190,6 +187,12 @@ public class InternalMethodHandler extends DummyMethodHandler { return PlayerHandler.getPlayerBaubles(player); } + @Override + public IItemHandlerModifiable getBaublesInventoryWrapped(EntityPlayer player) { + IInventory inv = getBaublesInventory(player); + return inv == null ? null : new InvWrapper(inv); + } + @Override public void drawSimpleManaHUD(int color, int mana, int maxMana, String name, ScaledResolution res) { HUDHandler.drawSimpleManaHUD(color, mana, maxMana, name, res); @@ -212,7 +215,7 @@ public class InternalMethodHandler extends DummyMethodHandler { @Override public void sparkleFX(World world, double x, double y, double z, float r, float g, float b, float size, int m) { - Botania.proxy.sparkleFX(world, x, y, z, r, g, b, size, m); + Botania.proxy.sparkleFX(x, y, z, r, g, b, size, m); } @Override @@ -220,11 +223,6 @@ public class InternalMethodHandler extends DummyMethodHandler { return BossBarHandler.defaultBossBar; } - @Override - public void setBossStatus(IBotaniaBoss status) { - BossBarHandler.setCurrentBoss(status); - } - @Override public boolean shouldForceCheck() { return ConfigHandler.flowerForceCheck; @@ -232,9 +230,9 @@ public class InternalMethodHandler extends DummyMethodHandler { @Override public int getPassiveFlowerDecay() { - return ConfigHandler.hardcorePassiveGeneration; + return LibMisc.PASSIVE_FLOWER_DECAY; } - + @Override @Optional.Method(modid = "BuildCraft|Transport") public boolean isBuildcraftPipe(TileEntity tile) { @@ -242,8 +240,8 @@ public class InternalMethodHandler extends DummyMethodHandler { } @Override - public void breakOnAllCursors(EntityPlayer player, Item item, ItemStack stack, int x, int y, int z, int side) { - ItemLokiRing.breakOnAllCursors(player, item, stack, x, y, z, side); + public void breakOnAllCursors(EntityPlayer player, Item item, ItemStack stack, BlockPos pos, EnumFacing side) { + ItemLokiRing.breakOnAllCursors(player, item, stack, pos, side); } @Override @@ -257,8 +255,8 @@ public class InternalMethodHandler extends DummyMethodHandler { } @Override - public boolean isBotaniaFlower(World world, int x, int y, int z) { - Block block = world.getBlock(x, y, z); + public boolean isBotaniaFlower(World world, BlockPos pos) { + Block block = world.getBlockState(pos).getBlock(); return block == ModBlocks.flower || block == ModBlocks.shinyFlower || block == ModBlocks.specialFlower; } @@ -270,9 +268,9 @@ public class InternalMethodHandler extends DummyMethodHandler { @Override - public List wrapInventory(List inventories) { - ArrayList arrayList = new ArrayList(); - for(IInventory inv : inventories) { + public List wrapInventory(List inventories) { + List arrayList = new ArrayList(); + for(InvWithLocation inv : inventories) { ICorporeaSpark spark = CorporeaHelper.getSparkForInventory(inv); IWrappedInventory wrapped = null; // try StorageDrawers integration diff --git a/src/main/java/vazkii/botania/common/core/handler/ManaNetworkHandler.java b/src/main/java/vazkii/botania/common/core/handler/ManaNetworkHandler.java index 54608e1c4..7628fd202 100644 --- a/src/main/java/vazkii/botania/common/core/handler/ManaNetworkHandler.java +++ b/src/main/java/vazkii/botania/common/core/handler/ManaNetworkHandler.java @@ -10,32 +10,33 @@ */ package vazkii.botania.common.core.handler; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.WeakHashMap; - import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import vazkii.botania.api.internal.IManaNetwork; import vazkii.botania.api.mana.ManaNetworkEvent; import vazkii.botania.api.mana.ManaNetworkEvent.Action; import vazkii.botania.api.mana.ManaNetworkEvent.ManaBlockType; import vazkii.botania.api.mana.TileSignature; -import vazkii.botania.common.core.helper.MathHelper; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +import java.util.Comparator; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.WeakHashMap; +import java.util.function.BinaryOperator; public final class ManaNetworkHandler implements IManaNetwork { public static final ManaNetworkHandler instance = new ManaNetworkHandler(); - public WeakHashMap> manaPools = new WeakHashMap(); - public WeakHashMap> manaCollectors = new WeakHashMap(); + private final WeakHashMap> manaPools = new WeakHashMap<>(); + private final WeakHashMap> manaCollectors = new WeakHashMap<>(); @SubscribeEvent public void onNetworkEvent(ManaNetworkEvent event) { - Map> map = event.type == ManaBlockType.COLLECTOR ? manaCollectors : manaPools; + Map> map = event.type == ManaBlockType.COLLECTOR ? manaCollectors : manaPools; if(event.action == Action.ADD) add(map, event.tile); else remove(map, event.tile); @@ -48,14 +49,14 @@ public final class ManaNetworkHandler implements IManaNetwork { } @Override - public TileEntity getClosestPool(ChunkCoordinates pos, World world, int limit) { + public TileEntity getClosestPool(BlockPos pos, World world, int limit) { if(manaPools.containsKey(world)) return getClosest(manaPools.get(world), pos, world.isRemote, limit); return null; } @Override - public TileEntity getClosestCollector(ChunkCoordinates pos, World world, int limit) { + public TileEntity getClosestCollector(BlockPos pos, World world, int limit) { if(manaCollectors.containsKey(world)) return getClosest(manaCollectors.get(world), pos, world.isRemote, limit); return null; @@ -69,85 +70,48 @@ public final class ManaNetworkHandler implements IManaNetwork { return isIn(tile, manaPools); } - private synchronized boolean isIn(TileEntity tile, Map> map) { - List list = map.get(tile.getWorldObj()); - if(list == null) - return false; - - for(TileSignature sig : list) - if(sig.tile == tile) - return true; - - return false; + private boolean isIn(TileEntity tile, Map> map) { + Set set = map.get(tile.getWorld()); + return set != null && set.contains(new TileSignature(tile, tile.getWorld().isRemote)); } - private synchronized TileEntity getClosest(List tiles, ChunkCoordinates pos, boolean remoteCheck, int limit) { - float closest = Float.MAX_VALUE; - TileEntity closestTile = null; - - for(TileSignature sig : tiles) { - if(sig.remoteWorld != remoteCheck) - continue; - - TileEntity tile = sig.tile; - if(tile.isInvalid()) - continue; - float distance = MathHelper.pointDistanceSpace(tile.xCoord, tile.yCoord, tile.zCoord, pos.posX, pos.posY, pos.posZ); - if(distance > limit) - continue; - - if(distance < closest) { - closest = distance; - closestTile = tile; - } - } - - return closestTile; + private TileEntity getClosest(Set tiles, BlockPos pos, boolean remoteCheck, int limit) { + return tiles.stream() + .filter(ts -> ts.isRemote() == remoteCheck) + .map(TileSignature::getTile) + .filter(t -> !t.isInvalid()) + .filter(t -> t.getPos().distanceSq(pos) <= limit * limit) + .reduce(BinaryOperator.minBy(Comparator.comparing(t -> t.getPos().distanceSq(pos), Double::compare))) + .orElse(null); } - private synchronized void remove(Map> map, TileEntity tile) { - World world = tile.getWorldObj(); + private void remove(Map> map, TileEntity tile) { + World world = tile.getWorld(); if(!map.containsKey(world)) return; - List sigs = map.get(world); - for(TileSignature sig : sigs) - if(sig.tile.equals(tile)) { - sigs.remove(sig); - break; - } + map.get(world).remove(new TileSignature(tile, tile.getWorld().isRemote)); } - private synchronized void add(Map> map, TileEntity tile) { - World world = tile.getWorldObj(); - - List tiles; - if(!map.containsKey(world)) - map.put(world, new ArrayList()); - - tiles = map.get(world); - - if(!tiles.contains(tile)) - tiles.add(new TileSignature(tile, tile.getWorldObj().isRemote)); + private void add(Map> map, TileEntity tile) { + World world = tile.getWorld(); + map.putIfAbsent(world, new HashSet<>()); + map.get(world).add(new TileSignature(tile, tile.getWorld().isRemote)); } @Override - public List getAllCollectorsInWorld(World world) { + public Set getAllCollectorsInWorld(World world) { return getAllInWorld(manaCollectors, world); } @Override - public List getAllPoolsInWorld(World world) { + public Set getAllPoolsInWorld(World world) { return getAllInWorld(manaPools, world); } - private List getAllInWorld(Map> map, World world) { - if(!map.containsKey(world)) - return new ArrayList(); - - return map.get(world); + private Set getAllInWorld(Map> map, World world) { + return map.getOrDefault(world, new HashSet<>()); } - } diff --git a/src/main/java/vazkii/botania/common/core/handler/MethodHandles.java b/src/main/java/vazkii/botania/common/core/handler/MethodHandles.java new file mode 100644 index 000000000..fec57d0b4 --- /dev/null +++ b/src/main/java/vazkii/botania/common/core/handler/MethodHandles.java @@ -0,0 +1,95 @@ +package vazkii.botania.common.core.handler; + +import com.google.common.base.Throwables; +import net.minecraft.block.SoundType; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.tileentity.MobSpawnerBaseLogic; +import net.minecraftforge.fml.relauncher.ReflectionHelper; +import vazkii.botania.common.Botania; +import vazkii.botania.common.lib.LibObfuscation; + +import java.lang.invoke.MethodHandle; +import java.lang.reflect.Field; +import java.lang.reflect.Method; + +import static java.lang.invoke.MethodHandles.publicLookup; + +// MethodHandles for frequently reflected fields and methods. +// Handles suffixed with _getter and _setter are for fields, while those without suffixes are normal methods. +public final class MethodHandles { + + public static final MethodHandle + itemAge_getter, itemAge_setter, pickupDelay_getter, // EntityItem, pickup delay already has setter in vanilla + spawnRange_getter, spawnCount_getter, maxNearbyEntities_getter, + maxSpawnDelay_getter, minSpawnDelay_getter, + spawnDelay_getter, spawnDelay_setter, prevMobRotation_setter, mobRotation_setter, potentialSpawns_getter, + randomEntity_getter, isActivated; // MobSpawnerBaseLogic + + + static { + try { + Field f = ReflectionHelper.findField(EntityItem.class, LibObfuscation.AGE); + f.setAccessible(true); + itemAge_getter = publicLookup().unreflectGetter(f); + itemAge_setter = publicLookup().unreflectSetter(f); + + f = ReflectionHelper.findField(EntityItem.class, LibObfuscation.PICKUP_DELAY); + f.setAccessible(true); + pickupDelay_getter = publicLookup().unreflectGetter(f); + + f = ReflectionHelper.findField(MobSpawnerBaseLogic.class, LibObfuscation.SPAWN_RANGE); + f.setAccessible(true); + spawnRange_getter = publicLookup().unreflectGetter(f); + + f = ReflectionHelper.findField(MobSpawnerBaseLogic.class, LibObfuscation.SPAWN_COUNT); + f.setAccessible(true); + spawnCount_getter = publicLookup().unreflectGetter(f); + + f = ReflectionHelper.findField(MobSpawnerBaseLogic.class, LibObfuscation.MAX_NEARBY_ENTITIES); + f.setAccessible(true); + maxNearbyEntities_getter = publicLookup().unreflectGetter(f); + + f = ReflectionHelper.findField(MobSpawnerBaseLogic.class, LibObfuscation.MAX_SPAWN_DELAY); + f.setAccessible(true); + maxSpawnDelay_getter = publicLookup().unreflectGetter(f); + + f = ReflectionHelper.findField(MobSpawnerBaseLogic.class, LibObfuscation.MIN_SPAWN_DELAY); + f.setAccessible(true); + minSpawnDelay_getter = publicLookup().unreflectGetter(f); + + f = ReflectionHelper.findField(MobSpawnerBaseLogic.class, LibObfuscation.SPAWN_DELAY); + f.setAccessible(true); + spawnDelay_getter = publicLookup().unreflectGetter(f); + + f = ReflectionHelper.findField(MobSpawnerBaseLogic.class, LibObfuscation.SPAWN_DELAY); + f.setAccessible(true); + spawnDelay_setter = publicLookup().unreflectSetter(f); + + f = ReflectionHelper.findField(MobSpawnerBaseLogic.class, LibObfuscation.PREV_MOB_ROTATION); + f.setAccessible(true); + prevMobRotation_setter = publicLookup().unreflectSetter(f); + + f = ReflectionHelper.findField(MobSpawnerBaseLogic.class, LibObfuscation.MOB_ROTATION); + f.setAccessible(true); + mobRotation_setter = publicLookup().unreflectSetter(f); + + f = ReflectionHelper.findField(MobSpawnerBaseLogic.class, LibObfuscation.POTENTIAL_ENTITY_SPAWNS); + f.setAccessible(true); + potentialSpawns_getter = publicLookup().unreflectGetter(f); + + f = ReflectionHelper.findField(MobSpawnerBaseLogic.class, LibObfuscation.RANDOM_ENTITY); + f.setAccessible(true); + randomEntity_getter = publicLookup().unreflectGetter(f); + + Method m = ReflectionHelper.findMethod(MobSpawnerBaseLogic.class, null, LibObfuscation.IS_ACTIVATED); + m.setAccessible(true); + isActivated = publicLookup().unreflect(m); + } catch (Throwable t) { + Botania.LOGGER.fatal("Couldn't initialize methodhandles! Things will be broken!"); + t.printStackTrace(); + throw Throwables.propagate(t); + } + } + + private MethodHandles() {} +} diff --git a/src/main/java/vazkii/botania/common/core/handler/ModSounds.java b/src/main/java/vazkii/botania/common/core/handler/ModSounds.java new file mode 100644 index 000000000..311be693d --- /dev/null +++ b/src/main/java/vazkii/botania/common/core/handler/ModSounds.java @@ -0,0 +1,64 @@ +package vazkii.botania.common.core.handler; + +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.SoundEvent; +import net.minecraftforge.fml.common.registry.GameRegistry; + +public final class ModSounds { + + public static void init() { + String[] sounds = { + "botania:airRod", + "botania:agricarnation", + "botania:altarCraft", + "botania:babylonAttack", + "botania:babylonSpawn", + "botania:bellows", + "botania:bifrostRod", + "botania:blackLotus", + "botania:dash", + "botania:ding", + "botania:divaCharm", + "botania:divinationRod", + "botania:doit", + "botania:enchanterForm", + "botania:enchanterFade", + "botania:enchanterEnchant", + "botania:endoflame", + "botania:equipBauble", + "botania:gaiaTrap", + "botania:goldenLaurel", + "botania:holyCloak", + "botania:laputaStart", + "botania:lexiconOpen", + "botania:lexiconPage", + "botania:lightRelay", + "botania:manaBlaster", + "botania:manaPoolCraft", + "botania:missile", + "botania:orechid", + "botania:potionCreate", + "botania:runeAltarCraft", + "botania:runeAltarStart", + "botania:spreaderFire", + "botania:starcaller", + "botania:terraBlade", + "botania:terraformRod", + "botania:terraPickMode", + "botania:terrasteelCraft", + "botania:thermalily", + "botania:unholyCloak", + "botania:way", + "botania:music.gaia1", + "botania:music.gaia2" + }; + + for (String s : sounds) { + ResourceLocation loc = new ResourceLocation(s); + GameRegistry.register(new SoundEvent(loc), loc); + } + } + + private ModSounds() {} + +} diff --git a/src/main/java/vazkii/botania/common/core/handler/PixieHandler.java b/src/main/java/vazkii/botania/common/core/handler/PixieHandler.java index bccd71985..c46996666 100644 --- a/src/main/java/vazkii/botania/common/core/handler/PixieHandler.java +++ b/src/main/java/vazkii/botania/common/core/handler/PixieHandler.java @@ -1,27 +1,37 @@ package vazkii.botania.common.core.handler; +import baubles.common.container.InventoryBaubles; +import baubles.common.lib.PlayerHandler; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; +import net.minecraft.init.MobEffects; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraftforge.event.entity.living.LivingHurtEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import vazkii.botania.api.item.IPixieSpawner; +import vazkii.botania.common.core.helper.PlayerHelper; import vazkii.botania.common.entity.EntityPixie; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.item.equipment.armor.elementium.ItemElementiumHelm; -import baubles.common.container.InventoryBaubles; -import baubles.common.lib.PlayerHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -public class PixieHandler { +public final class PixieHandler { + + private PixieHandler() {} + + private static final Potion[] potions = { + MobEffects.BLINDNESS, + MobEffects.WITHER, + MobEffects.SLOWNESS, + MobEffects.WEAKNESS + }; @SubscribeEvent - public void onDamageTaken(LivingHurtEvent event) { - if(!event.entityLiving.worldObj.isRemote && event.entityLiving instanceof EntityPlayer && event.source.getEntity() != null && event.source.getEntity() instanceof EntityLivingBase) { - EntityPlayer player = (EntityPlayer) event.entityLiving; - ItemStack stack = player.getCurrentEquippedItem(); + public static void onDamageTaken(LivingHurtEvent event) { + if(!event.getEntityLiving().worldObj.isRemote && event.getEntityLiving() instanceof EntityPlayer && event.getSource().getEntity() != null && event.getSource().getEntity() instanceof EntityLivingBase) { + EntityPlayer player = (EntityPlayer) event.getEntityLiving(); + ItemStack stack = PlayerHelper.getFirstHeldItemClass(player, IPixieSpawner.class); float chance = getChance(stack); for (ItemStack element : player.inventory.armorInventory) @@ -36,34 +46,23 @@ public class PixieHandler { pixie.setPosition(player.posX, player.posY + 2, player.posZ); if(((ItemElementiumHelm) ModItems.elementiumHelm).hasArmorSet(player)) { - int[] potions = new int[] { - Potion.blindness.id, - Potion.wither.id, - Potion.moveSlowdown.id, - Potion.weakness.id - }; - pixie.setApplyPotionEffect(new PotionEffect(potions[event.entity.worldObj.rand.nextInt(potions.length)], 40, 0)); + pixie.setApplyPotionEffect(new PotionEffect(potions[event.getEntityLiving().worldObj.rand.nextInt(potions.length)], 40, 0)); } float dmg = 4; if(stack != null && stack.getItem() == ModItems.elementiumSword) dmg += 2; - pixie.setProps((EntityLivingBase) event.source.getEntity(), player, 0, dmg); + pixie.setProps((EntityLivingBase) event.getSource().getEntity(), player, 0, dmg); player.worldObj.spawnEntityInWorld(pixie); } } } - float getChance(ItemStack stack) { - if(stack == null) + private static float getChance(ItemStack stack) { + if(stack == null || !(stack.getItem() instanceof IPixieSpawner)) return 0F; - - Item item = stack.getItem(); - if(item instanceof IPixieSpawner) - return ((IPixieSpawner) item).getPixieChance(stack); - - return 0F; + else return ((IPixieSpawner) stack.getItem()).getPixieChance(stack); } } diff --git a/src/main/java/vazkii/botania/common/core/handler/SheddingHandler.java b/src/main/java/vazkii/botania/common/core/handler/SheddingHandler.java index aef3cbdd6..c62c3c78b 100644 --- a/src/main/java/vazkii/botania/common/core/handler/SheddingHandler.java +++ b/src/main/java/vazkii/botania/common/core/handler/SheddingHandler.java @@ -10,9 +10,6 @@ */ package vazkii.botania.common.core.handler; -import java.util.ArrayList; -import java.util.Map.Entry; - import net.minecraft.entity.Entity; import net.minecraft.entity.EntityList; import net.minecraft.entity.EntityLiving; @@ -27,32 +24,39 @@ import net.minecraft.entity.passive.EntityVillager; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.config.Property; import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import vazkii.botania.common.lexicon.LexiconData; import vazkii.botania.common.lexicon.page.PageShedding; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map.Entry; public final class SheddingHandler { - public static ArrayList patterns = new ArrayList(); - public static ArrayList defaultPatterns = new ArrayList(); + private SheddingHandler() {} + + private static final List patterns = new ArrayList<>(); + private static final List defaultPatterns = new ArrayList<>(); @SubscribeEvent - public void onLivingUpdate(LivingUpdateEvent event) { - if(event.entity.worldObj.isRemote) + public static void onLivingUpdate(LivingUpdateEvent event) { + if(event.getEntityLiving().worldObj.isRemote) return; - ShedPattern pattern = getShedPattern(event.entity); + ShedPattern pattern = getShedPattern(event.getEntityLiving()); if(pattern != null) { - if(event.entity.worldObj.rand.nextInt(pattern.getRate()) == 0) - event.entity.entityDropItem(pattern.getItemStack(), 0.0F); + if(event.getEntityLiving().worldObj.rand.nextInt(pattern.getRate()) == 0) + event.getEntityLiving().entityDropItem(pattern.getItemStack(), 0.0F); } } - public static ShedPattern getShedPattern(Entity entity) { + private static ShedPattern getShedPattern(Entity entity) { for(ShedPattern pattern : patterns) if(pattern.EntityClass.isInstance(entity)) return pattern; @@ -70,31 +74,29 @@ public final class SheddingHandler { int i = 1; for(ShedPattern pattern : patterns) { - PageShedding page = new PageShedding(String.valueOf(i), (String)EntityList.classToStringMapping.get(pattern.EntityClass), pattern.lexiconSize, pattern.getItemStack()); + PageShedding page = new PageShedding(String.valueOf(i), EntityList.CLASS_TO_NAME.get(pattern.EntityClass), pattern.lexiconSize, pattern.getItemStack()); LexiconData.shedding.addPage(page); } } public static void loadFromConfig(Configuration config) { - defaultPatterns.add(new ShedPattern(EntityChicken.class, new ItemStack(Items.feather), 26000, 20)); - defaultPatterns.add(new ShedPattern(EntitySquid.class, new ItemStack(Items.dye), 18000, 20)); - defaultPatterns.add(new ShedPattern(EntityVillager.class, new ItemStack(Items.emerald), 226000, 40)); - defaultPatterns.add(new ShedPattern(EntitySpider.class, new ItemStack(Items.string), 12000, 40)); - defaultPatterns.add(new ShedPattern(EntityBlaze.class, new ItemStack(Items.blaze_powder), 8000, 40)); - defaultPatterns.add(new ShedPattern(EntityGhast.class, new ItemStack(Items.ghast_tear), 9001, 30)); - defaultPatterns.add(new ShedPattern(EntitySkeleton.class, new ItemStack(Items.bone), 36000, 40)); - defaultPatterns.add(new ShedPattern(EntitySlime.class, new ItemStack(Items.slime_ball), 21000, 40)); + defaultPatterns.add(new ShedPattern(EntityChicken.class, new ItemStack(Items.FEATHER), 26000, 20)); + defaultPatterns.add(new ShedPattern(EntitySquid.class, new ItemStack(Items.DYE), 18000, 20)); + defaultPatterns.add(new ShedPattern(EntityVillager.class, new ItemStack(Items.EMERALD), 226000, 40)); + defaultPatterns.add(new ShedPattern(EntitySpider.class, new ItemStack(Items.STRING), 12000, 40)); + defaultPatterns.add(new ShedPattern(EntityBlaze.class, new ItemStack(Items.BLAZE_POWDER), 8000, 40)); + defaultPatterns.add(new ShedPattern(EntityGhast.class, new ItemStack(Items.GHAST_TEAR), 9001, 30)); + defaultPatterns.add(new ShedPattern(EntitySkeleton.class, new ItemStack(Items.BONE), 36000, 40)); + defaultPatterns.add(new ShedPattern(EntitySlime.class, new ItemStack(Items.SLIME_BALL), 21000, 40)); - ArrayList defaultNames = new ArrayList(); + ArrayList defaultNames = new ArrayList<>(); for(ShedPattern pattern : defaultPatterns) { loadFromConfig(config, pattern.getEntityString(), pattern); defaultNames.add(pattern.getEntityString()); } - for(Object o : EntityList.stringToClassMapping.entrySet()) { - Entry entry = (Entry) o; - + for(Entry> entry : EntityList.NAME_TO_CLASS.entrySet()) { if(EntityLiving.class.isAssignableFrom(entry.getValue())) { String name = entry.getKey(); if(!defaultNames.contains(name)) @@ -103,36 +105,36 @@ public final class SheddingHandler { } } - public static void loadFromConfig(Configuration config, String key, ShedPattern defaultPattern) { + private static void loadFromConfig(Configuration config, String key, ShedPattern defaultPattern) { String itemName = ""; int metadata = 0; int rate = -1; int lexiconSize = 40; if(defaultPattern != null) { - itemName = Item.itemRegistry.getNameForObject(defaultPattern.getItemStack().getItem()); + itemName = Item.REGISTRY.getNameForObject(defaultPattern.getItemStack().getItem()).toString(); metadata = defaultPattern.getItemStack().getItemDamage(); rate = defaultPattern.rate; lexiconSize = defaultPattern.lexiconSize; } Property prop = config.get("Shedding", key + ".item", itemName); - prop.comment = "Configuration of Shedding for "+key; + prop.setComment("Configuration of Shedding for "+key); itemName = prop.getString(); rate = config.get("Shedding", key + ".rate", rate).getInt(); metadata = config.get("Shedding", key + ".metadata", metadata).getInt(); lexiconSize = config.get("Shedding", key + ".lexiconDisplaySize", lexiconSize).getInt(); - if(itemName != null && !itemName.isEmpty() && rate != -1) - patterns.add(new ShedPattern((Class) EntityList.stringToClassMapping.get(key), new ItemStack((Item) Item.itemRegistry.getObject(itemName), 1, metadata), rate, lexiconSize)); + if(itemName != null && Item.REGISTRY.getObject(new ResourceLocation(itemName)) != null && rate != -1) + patterns.add(new ShedPattern(EntityList.NAME_TO_CLASS.get(key), new ItemStack(Item.REGISTRY.getObject(new ResourceLocation(itemName)), 1, metadata), rate, lexiconSize)); } - public static class ShedPattern { + private static class ShedPattern { - Class EntityClass; - ItemStack itemStack; - int rate; - int lexiconSize; + private final Class EntityClass; + private final ItemStack itemStack; + private final int rate; + private final int lexiconSize; public ShedPattern(Class EntityClass, ItemStack itemStack, int rate, int lexiconSize) { this.EntityClass = EntityClass; @@ -149,7 +151,7 @@ public final class SheddingHandler { } public String getEntityString() { - return (String) EntityList.classToStringMapping.get(EntityClass); + return EntityList.CLASS_TO_NAME.get(EntityClass); } } diff --git a/src/main/java/vazkii/botania/common/core/handler/SpawnerChangingHandler.java b/src/main/java/vazkii/botania/common/core/handler/SpawnerChangingHandler.java deleted file mode 100644 index 338bcaa74..000000000 --- a/src/main/java/vazkii/botania/common/core/handler/SpawnerChangingHandler.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jul 30, 2014, 12:37:24 PM (GMT)] - */ -package vazkii.botania.common.core.handler; - -import net.minecraft.entity.EntityList; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.tileentity.TileEntityMobSpawner; -import net.minecraftforge.event.entity.player.PlayerInteractEvent; -import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public final class SpawnerChangingHandler { - - @SubscribeEvent - public void onInteract(PlayerInteractEvent event) { - if(event.entityPlayer == null || event.entityPlayer.capabilities == null || event.world == null) - return; // Cauldron breaks stuff - - if(event.entityPlayer.capabilities.isCreativeMode && !event.world.isRemote && event.action == Action.RIGHT_CLICK_BLOCK && !event.entityPlayer.isSneaking()) { - ItemStack stack = event.entityPlayer.getCurrentEquippedItem(); - if(stack != null && stack.getItem() == Items.spawn_egg) { - TileEntity tile = event.world.getTileEntity(event.x, event.y, event.z); - if(tile instanceof TileEntityMobSpawner) { - TileEntityMobSpawner spawner = (TileEntityMobSpawner) tile; - spawner.func_145881_a().setEntityName(EntityList.getStringFromID(stack.getItemDamage())); - event.world.markBlockForUpdate(event.x, event.y, event.z); - event.setCanceled(true); - } - } - } - } - -} diff --git a/src/main/java/vazkii/botania/common/core/handler/TerrasteelCraftingHandler.java b/src/main/java/vazkii/botania/common/core/handler/TerrasteelCraftingHandler.java deleted file mode 100644 index 59150bbcc..000000000 --- a/src/main/java/vazkii/botania/common/core/handler/TerrasteelCraftingHandler.java +++ /dev/null @@ -1,188 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Apr 14, 2014, 4:30:40 PM (GMT)] - */ -package vazkii.botania.common.core.handler; - -import java.util.List; - -import net.minecraft.entity.item.EntityItem; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.tileentity.TileEntityBeacon; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MathHelper; -import vazkii.botania.api.mana.IManaPool; -import vazkii.botania.common.Botania; -import vazkii.botania.common.block.tile.mana.TilePool; -import vazkii.botania.common.core.helper.ItemNBTHelper; -import vazkii.botania.common.item.ModItems; - -// This is legacy code and is no longer used. Check out TileTerraPlate instead. -public final class TerrasteelCraftingHandler { - - private static final String TAG_TIME = "Botania-CraftingTime"; - private static final int TIME = 100; - private static final int MANA_PER_TICK = (int) (TilePool.MAX_MANA / 2 / TIME * 0.9); - - public static void onEntityUpdate(EntityItem item) { - ItemStack stack = item.getEntityItem(); - if(stack != null && stack.getItem() == ModItems.manaResource && stack.getItemDamage() == 0) { - int time = validateCraftingItem(item); - - if(time != -1) { - doParticles(item, time); - if(time == TIME) - item.worldObj.playSoundAtEntity(item, "botania:terrasteelCraft", 1F, 1F); - - getManaFromPools : { - int x = MathHelper.floor_double(item.posX); - int y = MathHelper.floor_double(item.posY); - int z = MathHelper.floor_double(item.posZ); - - int range = 12; - - for(int i = -range; i < range + 1; i++) - for(int j = -range; j < range + 1; j++) - for(int k = - range; k < range + 1; k++) { - TileEntity tile = item.worldObj.getTileEntity(x + i, y + j, z + k); - - if(tile instanceof IManaPool) { - IManaPool pool = (IManaPool) tile; - - if(!item.worldObj.isRemote && pool.getCurrentMana() >= MANA_PER_TICK) { - pool.recieveMana(-MANA_PER_TICK); - item.worldObj.markBlockForUpdate(tile.xCoord, tile.yCoord, tile.zCoord); - incrementCraftingTime(item, time); - break getManaFromPools; - } - } - } - } - } - } - } - - static int validateCraftingItem(EntityItem item) { - ItemStack estack = item.getEntityItem(); - if(estack.stackSize != 1) - return -1; - - int x = MathHelper.floor_double(item.posX); - int y = MathHelper.floor_double(item.posY); - int z = MathHelper.floor_double(item.posZ); - - if(item.worldObj.getBlock(x, y - 1, z) != Blocks.beacon) - return -1; - - TileEntityBeacon beacon = (TileEntityBeacon) item.worldObj.getTileEntity(x, y - 1, z); - if(beacon.getLevels() <= 0) - return -1; - - List items = item.worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1)); - - EntityItem diamond = null; - EntityItem pearl = null; - - for(EntityItem otherItem : items) { - if(otherItem == item) - continue; - - ItemStack stack = otherItem.getEntityItem(); - if(stack.getItem() == ModItems.manaResource && stack.stackSize == 1) { - int meta = stack.getItemDamage(); - if(meta == 1) { - if(pearl == null) { - pearl = otherItem; - continue; - } else return -1; - } else if(meta == 2) { - if(diamond == null) { - diamond = otherItem; - continue; - } else return -1; - } else return -1; - } else return -1; - } - - if(diamond != null && pearl != null) { - int time = getTimeInCrafting(item); - if(time > 0) { - diamond.delayBeforeCanPickup = 1; - diamond.age = 0; - pearl.delayBeforeCanPickup = 1; - pearl.age = 0; - item.delayBeforeCanPickup = 1; - item.age = 0; - } - - return time; - } - return -1; - } - - static int getTimeInCrafting(EntityItem item) { - ItemStack stack = item.getEntityItem(); - return ItemNBTHelper.getInt(stack, TAG_TIME, 0); - } - - static void doParticles(EntityItem item, int ticks) { - if(item.worldObj.isRemote) { - int totalSpiritCount = 3; - double tickIncrement = 360D / totalSpiritCount; - - int speed = 5; - double wticks = ticks * speed - tickIncrement; - - double r = Math.sin((ticks - TIME) / 10D) * 2; - double g = Math.sin(wticks * Math.PI / 180 * 0.55); - - for(int i = 0; i < totalSpiritCount; i++) { - double x = (int) item.posX + Math.sin(wticks * Math.PI / 180) * r + 0.5; - double y = (int) item.posY + 0.25; - double z = (int) item.posZ + Math.cos(wticks * Math.PI / 180) * r + 0.5; - - wticks += tickIncrement; - float[] colorsfx = new float[] { - 0F, (float) ticks / (float) TIME, 1F - (float) ticks / (float) TIME - }; - Botania.proxy.wispFX(item.worldObj, x, y, z, colorsfx[0], colorsfx[1], colorsfx[2], 0.85F, (float)g * 0.05F, 0.25F); - Botania.proxy.wispFX(item.worldObj, x, y, z, colorsfx[0], colorsfx[1], colorsfx[2], (float) Math.random() * 0.1F + 0.1F, (float) (Math.random() - 0.5) * 0.05F, (float) (Math.random() - 0.5) * 0.05F, (float) (Math.random() - 0.5) * 0.05F, 0.9F); - - if(ticks == TIME) - for(int j = 0; j < 15; j++) - Botania.proxy.wispFX(item.worldObj, item.posX, item.posY, item.posZ, colorsfx[0], colorsfx[1], colorsfx[2], (float) Math.random() * 0.15F + 0.15F, (float) (Math.random() - 0.5F) * 0.125F, (float) (Math.random() - 0.5F) * 0.125F, (float) (Math.random() - 0.5F) * 0.125F); - } - } - } - - static void incrementCraftingTime(EntityItem item, int time) { - if(time >= TIME) - finalizeCraftingRecipe(item); - - else { - ItemStack stack = item.getEntityItem(); - ItemNBTHelper.setInt(stack, TAG_TIME, time + 1); - } - } - - static void finalizeCraftingRecipe(EntityItem item) { - int x = MathHelper.floor_double(item.posX); - int y = MathHelper.floor_double(item.posY); - int z = MathHelper.floor_double(item.posZ); - - List items = item.worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1)); - for(EntityItem otherItem : items) - if(otherItem != item) - otherItem.setDead(); - else item.setEntityItemStack(new ItemStack(ModItems.manaResource, 1, 4)); - } - -} diff --git a/src/main/java/vazkii/botania/common/core/helper/InventoryHelper.java b/src/main/java/vazkii/botania/common/core/helper/InventoryHelper.java index d553eda94..6205bdb8a 100644 --- a/src/main/java/vazkii/botania/common/core/helper/InventoryHelper.java +++ b/src/main/java/vazkii/botania/common/core/helper/InventoryHelper.java @@ -10,354 +10,94 @@ */ package vazkii.botania.common.core.helper; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; -import net.minecraft.inventory.InventoryLargeChest; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.TextComponentString; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.items.CapabilityItemHandler; +import net.minecraftforge.items.IItemHandler; +import net.minecraftforge.items.ItemHandlerHelper; +import net.minecraftforge.items.VanillaDoubleChestItemHandler; +import vazkii.botania.api.corporea.InvWithLocation; +import vazkii.botania.common.block.tile.TileSimpleInventory; + +import javax.annotation.Nonnull; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import java.util.Spliterator; +import java.util.Spliterators; +import java.util.stream.Stream; +import java.util.stream.StreamSupport; -//From OpenBlocksLib: https://github.com/OpenMods/OpenModsLib public class InventoryHelper { - public static void tryInsertStack(IInventory targetInventory, int slot, ItemStack stack, boolean canMerge) { - if(targetInventory.isItemValidForSlot(slot, stack)) { - ItemStack targetStack = targetInventory.getStackInSlot(slot); - if(targetStack == null) { - int space = targetInventory.getInventoryStackLimit(); - int mergeAmount = Math.min(space, stack.stackSize); + public static InvWithLocation getInventoryWithLocation(World world, BlockPos pos, EnumFacing side) { + IItemHandler ret = getInventory(world, pos, side); + if(ret == null) + return null; + else return new InvWithLocation(ret, world, pos); + } - ItemStack copy = stack.copy(); - copy.stackSize = mergeAmount; - targetInventory.setInventorySlotContents(slot, copy); - stack.stackSize -= mergeAmount; - } else if(canMerge) { - if(targetInventory.isItemValidForSlot(slot, stack) && areMergeCandidates(stack, targetStack)) { - int space = Math.min(targetInventory.getInventoryStackLimit(), targetStack.getMaxStackSize()) - targetStack.stackSize; - int mergeAmount = Math.min(space, stack.stackSize); + public static IItemHandler getInventory(World world, BlockPos pos, EnumFacing side) { + TileEntity te = world.getTileEntity(pos); - ItemStack copy = targetStack.copy(); - copy.stackSize += mergeAmount; - targetInventory.setInventorySlotContents(slot, copy); - stack.stackSize -= mergeAmount; + if(te == null) + return null; + + if(te instanceof TileEntityChest) { + IItemHandler doubleChest = VanillaDoubleChestItemHandler.get(((TileEntityChest) te)); + if(doubleChest != VanillaDoubleChestItemHandler.NO_ADJACENT_CHESTS_INSTANCE) + return doubleChest; + } + + IItemHandler ret = te.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, side) ? + te.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, side) : null; + + if(ret == null && te.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null)) + ret = te.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null); + + return ret; + } + + public static void dropInventory(TileSimpleInventory inv, World world, IBlockState state, BlockPos pos) { + if(inv != null) { + for(int j1 = 0; j1 < inv.getSizeInventory(); ++j1) { + ItemStack itemstack = inv.getItemHandler().getStackInSlot(j1); + + if(itemstack != null) { + net.minecraft.inventory.InventoryHelper.spawnItemStack(world, pos.getX(), pos.getY(), pos.getZ(), itemstack); } } + + world.updateComparatorOutputLevel(pos, state.getBlock()); } } - protected static boolean areMergeCandidates(ItemStack source, ItemStack target) { - return source.isItemEqual(target) && ItemStack.areItemStackTagsEqual(source, target) && target.stackSize < target.getMaxStackSize(); - } - - public static void insertItemIntoInventory(IInventory inventory, ItemStack stack) { - insertItemIntoInventory(inventory, stack, ForgeDirection.UNKNOWN, -1); - } - - public static void insertItemIntoInventory(IInventory inventory, ItemStack stack, ForgeDirection side, int intoSlot) { - insertItemIntoInventory(inventory, stack, side, intoSlot, true); - } - - public static void insertItemIntoInventory(IInventory inventory, ItemStack stack, ForgeDirection side, int intoSlot, boolean doMove) { - insertItemIntoInventory(inventory, stack, side, intoSlot, doMove, true); - } - - public static void insertItemIntoInventory(IInventory inventory, ItemStack stack, ForgeDirection side, int intoSlot, boolean doMove, boolean canStack) { - if(stack == null) return; - - IInventory targetInventory = inventory; - - if(!doMove) { - targetInventory = new GenericInventory("temporary.inventory", false, targetInventory.getSizeInventory()); - ((GenericInventory)targetInventory).copyFrom(inventory); - } - - int i = 0; - int[] attemptSlots; - - if(inventory instanceof ISidedInventory && side != ForgeDirection.UNKNOWN) { - attemptSlots = ((ISidedInventory)inventory).getAccessibleSlotsFromSide(side.ordinal()); - if(attemptSlots == null) - attemptSlots = new int[0]; - } else { - attemptSlots = new int[inventory.getSizeInventory()]; - for(int a = 0; a < inventory.getSizeInventory(); a++) - attemptSlots[a] = a; - } - if(intoSlot > -1) { - Set x = new HashSet(); - for(int attemptedSlot : attemptSlots) - x.add(attemptedSlot); - - if(x.contains(intoSlot)) - attemptSlots = new int[] { intoSlot }; - else attemptSlots = new int[0]; - } - while(stack.stackSize > 0 && i < attemptSlots.length) { - if(side != ForgeDirection.UNKNOWN && inventory instanceof ISidedInventory) - if(!((ISidedInventory)inventory).canInsertItem(attemptSlots[i], stack, side.ordinal())) { - i++; - continue; - } - - tryInsertStack(targetInventory, attemptSlots[i], stack, canStack); - i++; - } - } - - public static int testInventoryInsertion(IInventory inventory, ItemStack item, ForgeDirection side) { - if(item == null || item.stackSize == 0) - return 0; - item = item.copy(); - - if(inventory == null) - return 0; - - inventory.getSizeInventory(); - - int itemSizeCounter = item.stackSize; - int[] availableSlots; - - if(inventory instanceof ISidedInventory) - availableSlots = ((ISidedInventory) inventory).getAccessibleSlotsFromSide(side.ordinal()); - else { - availableSlots = buildSlotsForLinearInventory(inventory); - } - - for(int i : availableSlots) { - if(itemSizeCounter <= 0) + public static void withdrawFromInventory(TileSimpleInventory inv, EntityPlayer player) { + for(int i = inv.getSizeInventory() - 1; i >= 0; i--) { + ItemStack stackAt = inv.getItemHandler().getStackInSlot(i); + if(stackAt != null) { + ItemStack copy = stackAt.copy(); + ItemHandlerHelper.giveItemToPlayer(player, copy); + inv.getItemHandler().setStackInSlot(i, null); + player.worldObj.updateComparatorOutputLevel(inv.getPos(), null); break; - - if (!inventory.isItemValidForSlot(i, item)) - continue; - - if(side != ForgeDirection.UNKNOWN && inventory instanceof ISidedInventory) - if(!((ISidedInventory)inventory).canInsertItem(i, item, side.ordinal())) - continue; - - ItemStack inventorySlot = inventory.getStackInSlot(i); - if(inventorySlot == null) - itemSizeCounter -= Math.min(Math.min(itemSizeCounter, inventory.getInventoryStackLimit()), item.getMaxStackSize()); - else if(areMergeCandidates(item, inventorySlot)) { - int space = Math.min(inventory.getInventoryStackLimit(), inventorySlot.getMaxStackSize()) - inventorySlot.stackSize; - itemSizeCounter -= Math.min(itemSizeCounter, space); } } - - if(itemSizeCounter != item.stackSize) { - itemSizeCounter = Math.max(itemSizeCounter, 0); - return item.stackSize - itemSizeCounter; - } - - return 0; } - public static IInventory getInventory(World world, int x, int y, int z) { - TileEntity tileEntity = world.getTileEntity(x, y, z); - if(tileEntity instanceof TileEntityChest) { - Block chestBlock = world.getBlock(x, y, z); - if(world.getBlock(x - 1, y, z) == chestBlock) - return new InventoryLargeChest("Large chest", (IInventory)world.getTileEntity(x - 1, y, z), (IInventory)tileEntity); - if(world.getBlock(x + 1, y, z) == chestBlock) - return new InventoryLargeChest("Large chest", (IInventory)tileEntity, (IInventory)world.getTileEntity(x + 1, y, z)); - if(world.getBlock(x, y, z - 1) == chestBlock) - return new InventoryLargeChest("Large chest", (IInventory)world.getTileEntity(x, y, z - 1), (IInventory)tileEntity); - if(world.getBlock(x, y, z + 1) == chestBlock) - return new InventoryLargeChest("Large chest", (IInventory)tileEntity, (IInventory)world.getTileEntity(x, y, z + 1)); - } - return tileEntity instanceof IInventory ? (IInventory)tileEntity : null; - } - - public static IInventory getInventory(World world, int x, int y, int z, ForgeDirection direction) { - if(direction != null && direction != ForgeDirection.UNKNOWN) { - x += direction.offsetX; - y += direction.offsetY; - z += direction.offsetZ; - } - return getInventory(world, x, y, z); - - } - - public static IInventory getInventory(IInventory inventory) { - if(inventory instanceof TileEntityChest) { - TileEntity te = (TileEntity)inventory; - return getInventory(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord); - } - return inventory; - } - - public static int[] buildSlotsForLinearInventory(IInventory inv) { - int[] slots = new int[inv.getSizeInventory()]; - for (int i = 0; i < slots.length; i++) - slots[i] = i; - - return slots; - } - - public static class GenericInventory implements IInventory { - - protected String inventoryTitle; - protected int slotsCount; - protected ItemStack[] inventoryContents; - protected boolean isInvNameLocalized; - - public GenericInventory(String name, boolean isInvNameLocalized, int size) { - this.isInvNameLocalized = isInvNameLocalized; - slotsCount = size; - inventoryTitle = name; - inventoryContents = new ItemStack[size]; - } - - @Override - public ItemStack decrStackSize(int par1, int par2) { - if(inventoryContents[par1] != null) { - ItemStack itemstack; - - if(inventoryContents[par1].stackSize <= par2) { - itemstack = inventoryContents[par1]; - inventoryContents[par1] = null; - return itemstack; - } - - itemstack = inventoryContents[par1].splitStack(par2); - if(inventoryContents[par1].stackSize == 0) - inventoryContents[par1] = null; - - return itemstack; - } - return null; - } - - @Override - public int getInventoryStackLimit() { - return 64; - } - - @Override - public int getSizeInventory() { - return slotsCount; - } - - @Override - public ItemStack getStackInSlot(int i) { - return inventoryContents[i]; - } - - public ItemStack getStackInSlot(Enum i) { - return getStackInSlot(i.ordinal()); - } - - @Override - public ItemStack getStackInSlotOnClosing(int i) { - if(i >= inventoryContents.length) - return null; - - if(inventoryContents[i] != null) { - ItemStack itemstack = inventoryContents[i]; - inventoryContents[i] = null; - return itemstack; - } - - return null; - } - - public boolean isItem(int slot, Item item) { - return inventoryContents[slot] != null && inventoryContents[slot].getItem() == item; - } - - @Override - public boolean isItemValidForSlot(int i, ItemStack itemstack) { - return true; - } - - @Override - public boolean isUseableByPlayer(EntityPlayer entityplayer) { - return true; - } - - public void clearAndSetSlotCount(int amount) { - slotsCount = amount; - inventoryContents = new ItemStack[amount]; - } - - public void readFromNBT(NBTTagCompound tag) { - if(tag.hasKey("size")) - slotsCount = tag.getInteger("size"); - - NBTTagList nbttaglist = tag.getTagList("Items", 10); - inventoryContents = new ItemStack[slotsCount]; - for(int i = 0; i < nbttaglist.tagCount(); i++) { - NBTTagCompound stacktag = nbttaglist.getCompoundTagAt(i); - int j = stacktag.getByte("Slot"); - if(j >= 0 && j < inventoryContents.length) - inventoryContents[j] = ItemStack.loadItemStackFromNBT(stacktag); - } - } - - @Override - public void setInventorySlotContents(int i, ItemStack itemstack) { - inventoryContents[i] = itemstack; - - if(itemstack != null && itemstack.stackSize > getInventoryStackLimit()) - itemstack.stackSize = getInventoryStackLimit(); - } - - public void writeToNBT(NBTTagCompound tag) { - tag.setInteger("size", getSizeInventory()); - NBTTagList nbttaglist = new NBTTagList(); - for(int i = 0; i < inventoryContents.length; i++) { - if(inventoryContents[i] != null) { - NBTTagCompound stacktag = new NBTTagCompound(); - stacktag.setByte("Slot", (byte)i); - inventoryContents[i].writeToNBT(stacktag); - nbttaglist.appendTag(stacktag); - } - } - tag.setTag("Items", nbttaglist); - } - - public void copyFrom(IInventory inventory) { - for(int i = 0; i < inventory.getSizeInventory(); i++) - if(i < getSizeInventory()) { - ItemStack stack = inventory.getStackInSlot(i); - if(stack != null) - setInventorySlotContents(i, stack.copy()); - else setInventorySlotContents(i, null); - } - } - - public List contents() { - return Arrays.asList(inventoryContents); - } - - @Override - public String getInventoryName() { - return null; - } - - @Override - public boolean hasCustomInventoryName() { - return false; - } - - @Override - public void markDirty() { } - - @Override - public void openInventory() { } - - @Override - public void closeInventory() { } - } } diff --git a/src/main/java/vazkii/botania/common/core/helper/ItemNBTHelper.java b/src/main/java/vazkii/botania/common/core/helper/ItemNBTHelper.java index 41c73315f..449012319 100644 --- a/src/main/java/vazkii/botania/common/core/helper/ItemNBTHelper.java +++ b/src/main/java/vazkii/botania/common/core/helper/ItemNBTHelper.java @@ -19,6 +19,8 @@ import net.minecraft.nbt.NBTTagList; public final class ItemNBTHelper { + private static final int[] EMPTY_INT_ARRAY = new int[0]; + /** Checks if an ItemStack has a Tag Compound **/ public static boolean detectNBT(ItemStack stack) { return stack.hasTagCompound(); @@ -63,6 +65,10 @@ public final class ItemNBTHelper { getNBT(stack).setInteger(tag, i); } + public static void setIntArray(ItemStack stack, String tag, int[] val) { + getNBT(stack).setIntArray(tag, val); + } + public static void setLong(ItemStack stack, String tag, long l) { getNBT(stack).setLong(tag, l); } @@ -88,6 +94,10 @@ public final class ItemNBTHelper { getNBT(stack).setTag(tag, list); } + public static void removeEntry(ItemStack stack, String tag) { + getNBT(stack).removeTag(tag); + } + // GETTERS /////////////////////////////////////////////////////////////////// public static boolean verifyExistance(ItemStack stack, String tag) { @@ -110,6 +120,10 @@ public final class ItemNBTHelper { return verifyExistance(stack, tag) ? getNBT(stack).getInteger(tag) : defaultExpected; } + public static int[] getIntArray(ItemStack stack, String tag) { + return verifyExistance(stack, tag) ? getNBT(stack).getIntArray(tag) : EMPTY_INT_ARRAY; + } + public static long getLong(ItemStack stack, String tag, long defaultExpected) { return verifyExistance(stack, tag) ? getNBT(stack).getLong(tag) : defaultExpected; } diff --git a/src/main/java/vazkii/botania/common/core/helper/MathHelper.java b/src/main/java/vazkii/botania/common/core/helper/MathHelper.java index e31af7042..f7f7a1474 100644 --- a/src/main/java/vazkii/botania/common/core/helper/MathHelper.java +++ b/src/main/java/vazkii/botania/common/core/helper/MathHelper.java @@ -11,12 +11,49 @@ package vazkii.botania.common.core.helper; import net.minecraft.entity.Entity; +import net.minecraft.util.math.BlockPos; import vazkii.botania.api.internal.VanillaPacketDispatcher; public final class MathHelper { + public static int[] doubleArrayToIntArray(double[] doubles) { + int[] ret = new int[doubles.length * 2]; + for (int i = 0; i < doubles.length; i++) { + long l = Double.doubleToLongBits(doubles[i]); + ret[i] = (int) (l >>> 32); + ret[i + 1] = (int) l; + } + return ret; + } + + public static int[] longArrayToIntArray(long[] longs) { + int[] ret = new int[longs.length * 2]; + for (int i = 0; i < longs.length; i++) { + ret[i] = (int) (longs[i] >>> 32); + ret[i + 1] = (int) longs[i]; + } + return ret; + } + + public static long[] intArrayToLongArray(int[] ints) { + long[] ret = new long[ints.length / 2]; + for (int i = 0; i < ints.length; i += 2) { + ret[i / 2] = ((long) ints[i]) << 32 | ints[i + 1]; + } + return ret; + } + + public static double[] intArrayToDoubleArray(int[] ints) { + double[] ret = new double[ints.length / 2]; + for (int i = 0; i < ints.length; i += 2) { + long l = ((long) ints[i]) << 32 | ints[i + 1]; + ret[i / 2] = Double.longBitsToDouble(l); + } + return ret; + } + public static float pointDistanceSpace(double x1, double y1, double z1, double x2, double y2, double z2) { - return (float) Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2) + Math.pow(z1 - z2, 2)); + return (float) Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2) + (z1 - z2) * (z1 - z2)); } // Backwards compatibility @@ -26,10 +63,10 @@ public final class MathHelper { public static void setEntityMotionFromVector(Entity entity, Vector3 originalPosVector, float modifier) { Vector3 entityVector = Vector3.fromEntityCenter(entity); - Vector3 finalVector = originalPosVector.copy().subtract(entityVector); + Vector3 finalVector = originalPosVector.subtract(entityVector); if(finalVector.mag() > 1) - finalVector.normalize(); + finalVector = finalVector.normalize(); entity.motionX = finalVector.x * modifier; entity.motionY = finalVector.y * modifier; diff --git a/src/main/java/vazkii/botania/common/core/helper/ObfuscationHelper.java b/src/main/java/vazkii/botania/common/core/helper/ObfuscationHelper.java deleted file mode 100644 index 8bc4782b0..000000000 --- a/src/main/java/vazkii/botania/common/core/helper/ObfuscationHelper.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 17, 2014, 4:52:37 PM (GMT)] - */ -package vazkii.botania.common.core.helper; - -import net.minecraft.client.particle.EffectRenderer; -import net.minecraft.util.ResourceLocation; -import vazkii.botania.common.lib.LibObfuscation; -import cpw.mods.fml.relauncher.ReflectionHelper; - -public class ObfuscationHelper { - - public static ResourceLocation getParticleTexture() { - return ReflectionHelper.getPrivateValue(EffectRenderer.class, null, LibObfuscation.PARTICLE_TEXTURES); - } -} diff --git a/src/main/java/vazkii/botania/common/core/helper/PlayerHelper.java b/src/main/java/vazkii/botania/common/core/helper/PlayerHelper.java new file mode 100644 index 000000000..51ab904cf --- /dev/null +++ b/src/main/java/vazkii/botania/common/core/helper/PlayerHelper.java @@ -0,0 +1,104 @@ +package vazkii.botania.common.core.helper; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumHand; + +import java.util.function.Predicate; + +public final class PlayerHelper { + + // Checks if either of the player's hands has an item. + public static boolean hasAnyHeldItem(EntityPlayer player) { + return player.getHeldItemMainhand() != null || player.getHeldItemOffhand() != null; + } + + // Checks main hand, then off hand for this item. + public static boolean hasHeldItem(EntityPlayer player, Item item) { + return (player.getHeldItemMainhand() != null && player.getHeldItemMainhand().getItem() == item) + || (player.getHeldItemOffhand() != null && player.getHeldItemOffhand().getItem() == item); + } + + // Checks main hand, then off hand for this item class. + public static boolean hasHeldItemClass(EntityPlayer player, Item template) { + return hasHeldItemClass(player, template.getClass()); + } + + // Checks main hand, then off hand for this item class. + public static boolean hasHeldItemClass(EntityPlayer player, Class template) { + return (player.getHeldItemMainhand() != null && template.isAssignableFrom(player.getHeldItemMainhand().getItem().getClass())) + || (player.getHeldItemOffhand() != null && template.isAssignableFrom(player.getHeldItemOffhand().getItem().getClass())); + } + + // Checks main hand, then off hand for this item. Null otherwise. + public static ItemStack getFirstHeldItem(EntityPlayer player, Item item) { + ItemStack main = player.getHeldItemMainhand(); + ItemStack offhand = player.getHeldItemOffhand(); + if(main != null && item == main.getItem()) { + return main; + } else if(offhand != null && item == offhand.getItem()) { + return offhand; + } else return null; + } + + // Checks main hand, then off hand for this item class. Null otherwise. + public static ItemStack getFirstHeldItemClass(EntityPlayer player, Class template) { + ItemStack main = player.getHeldItemMainhand(); + ItemStack offhand = player.getHeldItemOffhand(); + if(main != null && template.isAssignableFrom(main.getItem().getClass())) { + return main; + } else if(offhand != null && template.isAssignableFrom(offhand.getItem().getClass())) { + return offhand; + } else return null; + } + + public static ItemStack getAmmo(EntityPlayer player, Predicate ammoFunc) { + // Mainly from ItemBow.findAmmo + if (ammoFunc.test(player.getHeldItem(EnumHand.OFF_HAND))) + { + return player.getHeldItem(EnumHand.OFF_HAND); + } + else if (ammoFunc.test(player.getHeldItem(EnumHand.MAIN_HAND))) + { + return player.getHeldItem(EnumHand.MAIN_HAND); + } + else + { + for (int i = 0; i < player.inventory.getSizeInventory(); ++i) + { + ItemStack itemstack = player.inventory.getStackInSlot(i); + + if (ammoFunc.test(itemstack)) + { + return itemstack; + } + } + + return null; + } + } + + public static boolean hasAmmo(EntityPlayer player, Predicate ammoFunc) { + return getAmmo(player, ammoFunc) != null; + } + + public static void consumeAmmo(EntityPlayer player, Predicate ammoFunc) { + ItemStack ammo = getAmmo(player, ammoFunc); + if(ammo != null) { + ammo.stackSize--; + if(ammo.stackSize == 0) + player.inventory.deleteStack(ammo); + } + } + + public static boolean hasItem(EntityPlayer player, Predicate itemFunc) { + for (int i = 0; i < player.inventory.getSizeInventory(); i++) { + if (itemFunc.test(player.inventory.getStackInSlot(i))) + return true; + } + return false; + } + + private PlayerHelper() {} +} diff --git a/src/main/java/vazkii/botania/common/core/helper/Quat.java b/src/main/java/vazkii/botania/common/core/helper/Quat.java index c3268e470..d6d246815 100644 --- a/src/main/java/vazkii/botania/common/core/helper/Quat.java +++ b/src/main/java/vazkii/botania/common/core/helper/Quat.java @@ -10,42 +10,26 @@ */ package vazkii.botania.common.core.helper; +import java.util.Arrays; import java.util.Formatter; import java.util.Locale; +import java.util.Objects; -public class Quat { +public final class Quat { - public double x; - public double y; - public double z; - public double s; - - public Quat() { - s = 1.0D; - x = 0.0D; - y = 0.0D; - z = 0.0D; - } - - public Quat(Quat quat) { - x = quat.x; - y = quat.y; - z = quat.z; - s = quat.s; - } + public static final Quat IDENTITY = new Quat(0, 0, 0, 1); + public final double x; + public final double y; + public final double z; + public final double s; + private final int hashCode; public Quat(double d, double d1, double d2, double d3) { x = d1; y = d2; z = d3; s = d; - } - - public void set(Quat quat) { - x = quat.x; - y = quat.y; - z = quat.z; - s = quat.s; + this.hashCode = Arrays.hashCode(new double[] { d, d1, d2, d3 } ); } public static Quat aroundAxis(double ax, double ay, double az, double angle) { @@ -54,62 +38,69 @@ public class Quat { return new Quat(Math.cos(angle), ax * d4, ay * d4, az * d4); } - public void multiply(Quat quat) { + public Quat multiply(Quat quat) { double d = s * quat.s - x * quat.x - y * quat.y - z * quat.z; double d1 = s * quat.x + x * quat.s - y * quat.z + z * quat.y; double d2 = s * quat.y + x * quat.z + y * quat.s - z * quat.x; double d3 = s * quat.z - x * quat.y + y * quat.x + z * quat.s; - s = d; - x = d1; - y = d2; - z = d3; + return new Quat(d1, d2, d3, d); } - public void rightMultiply(Quat quat) { + public Quat rightMultiply(Quat quat) { double d = s * quat.s - x * quat.x - y * quat.y - z * quat.z; double d1 = s * quat.x + x * quat.s + y * quat.z - z * quat.y; double d2 = s * quat.y - x * quat.z + y * quat.s + z * quat.x; double d3 = s * quat.z + x * quat.y - y * quat.x + z * quat.s; - s = d; - x = d1; - y = d2; - z = d3; + return new Quat(d1, d2, d3, d); } public double mag() { return Math.sqrt(x * x + y * y + z * z + s * s); } - public void normalize() { + public Quat normalize() { double d = mag(); if (d == 0.0D) { - return; + return this; } else { d = 1.0D / d; - x *= d; - y *= d; - z *= d; - s *= d; - return; + return new Quat(x * d, y * d, z * d, s * d); } } - public void rotate(Vector3 vec) { + public Vector3 rotate(Vector3 vec) { double d = -x * vec.x - y * vec.y - z * vec.z; double d1 = s * vec.x + y * vec.z - z * vec.y; double d2 = s * vec.y - x * vec.z + z * vec.x; double d3 = s * vec.z + x * vec.y - y * vec.x; - vec.x = d1 * s - d * x - d2 * z + d3 * y; - vec.y = d2 * s - d * y + d1 * z - d3 * x; - vec.z = d3 * s - d * z - d1 * y + d2 * x; + + double vx = d1 * s - d * x - d2 * z + d3 * y; + double vy = d2 * s - d * y + d1 * z - d3 * x; + double vz = d3 * s - d * z - d1 * y + d2 * x; + + return new Vector3(vx, vy, vz); + } + + @Override + public int hashCode() { + return hashCode; + } + + @Override + public boolean equals(Object o) { + return o instanceof Quat + && ((Quat) o).x == this.x + && ((Quat) o).y == this.y + && ((Quat) o).z == this.z + && ((Quat) o).s == this.s; } @Override public String toString() { StringBuilder stringbuilder = new StringBuilder(); Formatter formatter = new Formatter(stringbuilder, Locale.US); - formatter.format("Quaternion:\n", new Object[0]); - formatter.format(" < %f %f %f %f >\n", Double.valueOf(s), Double.valueOf(x), Double.valueOf(y), Double.valueOf(z)); + formatter.format("Quaternion:%n"); + formatter.format(" < %f %f %f %f >%n", s, x, y, z); formatter.close(); return stringbuilder.toString(); } diff --git a/src/main/java/vazkii/botania/common/core/helper/Vector3.java b/src/main/java/vazkii/botania/common/core/helper/Vector3.java index 02c47ba54..c5eb1cf4d 100644 --- a/src/main/java/vazkii/botania/common/core/helper/Vector3.java +++ b/src/main/java/vazkii/botania/common/core/helper/Vector3.java @@ -10,34 +10,32 @@ */ package vazkii.botania.common.core.helper; -import java.math.BigDecimal; -import java.math.MathContext; -import java.math.RoundingMode; - import net.minecraft.entity.Entity; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.Vec3; - +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Vec3d; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import org.lwjgl.opengl.GL11; import org.lwjgl.util.vector.Vector3f; import org.lwjgl.util.vector.Vector4f; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import java.math.BigDecimal; +import java.math.MathContext; +import java.math.RoundingMode; +import java.util.Arrays; +import java.util.Objects; public class Vector3 { - public static Vector3 zero = new Vector3(); - public static Vector3 one = new Vector3(1, 1, 1); - public static Vector3 center = new Vector3(0.5, 0.5, 0.5); + public static final Vector3 ZERO = new Vector3(0, 0, 0); + public static final Vector3 ONE = new Vector3(1, 1, 1); + public static final Vector3 CENTER = new Vector3(0.5, 0.5, 0.5); - public double x; - public double y; - public double z; - - public Vector3() { - } + public final double x; + public final double y; + public final double z; public Vector3(double d, double d1, double d2) { x = d; @@ -45,20 +43,12 @@ public class Vector3 z = d2; } - public Vector3(Vector3 vec) { - x = vec.x; - y = vec.y; - z = vec.z; + public Vector3(Vec3d vec) { + this(vec.xCoord, vec.yCoord, vec.zCoord); } - public Vector3(Vec3 vec) { - x = vec.xCoord; - y = vec.yCoord; - z = vec.zCoord; - } - - public Vector3 copy() { - return new Vector3(this); + public static Vector3 fromBlockPos(BlockPos pos) { + return new Vector3(pos.getX(), pos.getY(), pos.getZ()); } public static Vector3 fromEntity(Entity e) { @@ -66,29 +56,15 @@ public class Vector3 } public static Vector3 fromEntityCenter(Entity e) { - return new Vector3(e.posX, e.posY - e.yOffset + e.height / 2, e.posZ); + return new Vector3(e.posX, e.posY - e.getYOffset() + e.height / 2, e.posZ); } public static Vector3 fromTileEntity(TileEntity e) { - return new Vector3(e.xCoord, e.yCoord, e.zCoord); + return fromBlockPos(e.getPos()); } public static Vector3 fromTileEntityCenter(TileEntity e) { - return new Vector3(e.xCoord + 0.5, e.yCoord + 0.5, e.zCoord + 0.5); - } - - public Vector3 set(double d, double d1, double d2) { - x = d; - y = d1; - z = d2; - return this; - } - - public Vector3 set(Vector3 vec) { - x = vec.x; - y = vec.y; - z = vec.z; - return this; + return fromTileEntity(e).add(0.5); } public double dotProduct(Vector3 vec) { @@ -109,67 +85,35 @@ public class Vector3 double d = y * vec.z - z * vec.y; double d1 = z * vec.x - x * vec.z; double d2 = x * vec.y - y * vec.x; - x = d; - y = d1; - z = d2; - return this; + return new Vector3(d, d1, d2); } public Vector3 add(double d, double d1, double d2) { - x += d; - y += d1; - z += d2; - return this; + return new Vector3(x + d, y + d1, z + d2); } public Vector3 add(Vector3 vec) { - x += vec.x; - y += vec.y; - z += vec.z; - return this; + return add(vec.x, vec.y, vec.z); } public Vector3 add(double d) { return add(d, d, d); } - public Vector3 sub(Vector3 vec) { - return subtract(vec); - } - public Vector3 subtract(Vector3 vec) { - x -= vec.x; - y -= vec.y; - z -= vec.z; - return this; - } - - public Vector3 negate(Vector3 vec) { - x = -x; - y = -y; - z = -z; - return this; + return new Vector3(x - vec.x, y - vec.y, z - vec.z); } public Vector3 multiply(double d) { - x *= d; - y *= d; - z *= d; - return this; + return multiply(d, d, d); } public Vector3 multiply(Vector3 f) { - x *= f.x; - y *= f.y; - z *= f.z; - return this; + return multiply(f.x, f.y, f.z); } public Vector3 multiply(double fx, double fy, double fz) { - x *= fx; - y *= fy; - z *= fz; - return this; + return new Vector3(x * fx, y * fy, z * fz); } public double mag() { @@ -183,7 +127,7 @@ public class Vector3 public Vector3 normalize() { double d = mag(); if(d != 0) - multiply(1 / d); + return multiply(1 / d); return this; } @@ -203,37 +147,27 @@ public class Vector3 public Vector3 xCrossProduct() { double d = z; double d1 = -y; - x = 0; - y = d; - z = d1; - return this; + return new Vector3(0, d, d1); } public Vector3 zCrossProduct() { double d = y; - double d1 = -x; - x = d; - y = d1; - z = 0; - return this; + return new Vector3(d, d1, 0); } public Vector3 yCrossProduct() { double d = -z; double d1 = x; - x = d; - y = 0; - z = d1; - return this; + return new Vector3(d, 0, d1); } - public Vec3 toVec3D() { - return Vec3.createVectorHelper(x, y, z); + public Vec3d toVec3D() { + return new Vec3d(x, y, z); } public double angle(Vector3 vec) { - return Math.acos(copy().normalize().dotProduct(vec.copy().normalize())); + return Math.acos(normalize().dotProduct(vec.normalize())); } public boolean isInside(AxisAlignedBB aabb) { @@ -248,12 +182,10 @@ public class Vector3 return x == 0 ? y == 0 || z == 0 : y == 0 && z == 0; } - @SideOnly(Side.CLIENT) public Vector3f vector3f() { return new Vector3f((float)x, (float)y, (float)z); } - @SideOnly(Side.CLIENT) public Vector4f vector4f() { return new Vector4f((float)x, (float)y, (float)z, 1); } @@ -264,10 +196,7 @@ public class Vector3 } public Vector3 negate() { - x = -x; - y = -y; - z = -z; - return this; + return new Vector3(-x, -y, -z); } public double scalarProject(Vector3 b) { @@ -278,18 +207,15 @@ public class Vector3 public Vector3 project(Vector3 b) { double l = b.magSquared(); if(l == 0) { - set(0, 0, 0); - return this; + return ZERO; } double m = dotProduct(b)/l; - set(b).multiply(m); - return this; + return b.multiply(m); } public Vector3 rotate(double angle, Vector3 axis) { - Quat.aroundAxis(axis.copy().normalize(), angle).rotate(this); - return this; + return Quat.aroundAxis(axis.normalize(), angle).rotate(this); } @Override @@ -300,4 +226,9 @@ public class Vector3 Vector3 v = (Vector3)o; return x == v.x && y == v.y && z == v.z; } + + @Override + public int hashCode() { + return Objects.hash(x, y, z); + } } \ No newline at end of file diff --git a/src/main/java/vazkii/botania/common/core/loot/BindUuid.java b/src/main/java/vazkii/botania/common/core/loot/BindUuid.java new file mode 100644 index 000000000..5afbfeb31 --- /dev/null +++ b/src/main/java/vazkii/botania/common/core/loot/BindUuid.java @@ -0,0 +1,49 @@ +package vazkii.botania.common.core.loot; + +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonObject; +import com.google.gson.JsonSerializationContext; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.storage.loot.LootContext; +import net.minecraft.world.storage.loot.conditions.LootCondition; +import net.minecraft.world.storage.loot.functions.LootFunction; +import vazkii.botania.common.item.ModItems; +import vazkii.botania.common.item.relic.ItemRelic; +import vazkii.botania.common.lib.LibMisc; + +import javax.annotation.Nonnull; +import java.util.Random; + +public class BindUuid extends LootFunction { + + protected BindUuid(LootCondition[] conditionsIn) { + super(conditionsIn); + } + + @Nonnull + @Override + public ItemStack apply(@Nonnull ItemStack stack, @Nonnull Random rand, @Nonnull LootContext context) { + if (context.getKillerPlayer() != null) { + ((ItemRelic) ModItems.dice).bindToUUID(context.getKillerPlayer().getUniqueID(), stack); + } + + return stack; + } + + public static class Serializer extends LootFunction.Serializer { + protected Serializer() { + super(new ResourceLocation(LibMisc.MOD_ID, "bind_uuid"), BindUuid.class); + } + + @Override + public void serialize(@Nonnull JsonObject object, @Nonnull BindUuid functionClazz, @Nonnull JsonSerializationContext serializationContext) {} + + @Nonnull + @Override + public BindUuid deserialize(@Nonnull JsonObject object, @Nonnull JsonDeserializationContext deserializationContext, @Nonnull LootCondition[] conditionsIn) { + return new BindUuid(conditionsIn); + } + } + +} diff --git a/src/main/java/vazkii/botania/common/core/loot/EnableRelics.java b/src/main/java/vazkii/botania/common/core/loot/EnableRelics.java new file mode 100644 index 000000000..2dc8b3ba7 --- /dev/null +++ b/src/main/java/vazkii/botania/common/core/loot/EnableRelics.java @@ -0,0 +1,37 @@ +package vazkii.botania.common.core.loot; + +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonObject; +import com.google.gson.JsonSerializationContext; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.storage.loot.LootContext; +import net.minecraft.world.storage.loot.conditions.LootCondition; +import vazkii.botania.common.core.handler.ConfigHandler; +import vazkii.botania.common.lib.LibMisc; + +import javax.annotation.Nonnull; +import java.util.Random; + +public class EnableRelics implements LootCondition { + + @Override + public boolean testCondition(@Nonnull Random rand, @Nonnull LootContext context) { + return ConfigHandler.relicsEnabled; + } + + public static class Serializer extends LootCondition.Serializer { + protected Serializer() { + super(new ResourceLocation(LibMisc.MOD_ID, "enable_relics"), EnableRelics.class); + } + + @Override + public void serialize(@Nonnull JsonObject json, @Nonnull EnableRelics value, @Nonnull JsonSerializationContext context) {} + + @Nonnull + @Override + public EnableRelics deserialize(@Nonnull JsonObject json, @Nonnull JsonDeserializationContext context) { + return new EnableRelics(); + } + } + +} diff --git a/src/main/java/vazkii/botania/common/core/loot/LootHandler.java b/src/main/java/vazkii/botania/common/core/loot/LootHandler.java new file mode 100644 index 000000000..2e341947d --- /dev/null +++ b/src/main/java/vazkii/botania/common/core/loot/LootHandler.java @@ -0,0 +1,69 @@ +package vazkii.botania.common.core.loot; + +import com.google.common.collect.ImmutableList; +import net.minecraft.entity.item.EntityMinecartChest; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.storage.loot.LootEntry; +import net.minecraft.world.storage.loot.LootEntryTable; +import net.minecraft.world.storage.loot.LootPool; +import net.minecraft.world.storage.loot.LootTableList; +import net.minecraft.world.storage.loot.RandomValueRange; +import net.minecraft.world.storage.loot.conditions.LootCondition; +import net.minecraft.world.storage.loot.conditions.LootConditionManager; +import net.minecraft.world.storage.loot.functions.LootFunctionManager; +import net.minecraftforge.event.LootTableLoadEvent; +import net.minecraftforge.event.entity.player.PlayerInteractEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import vazkii.botania.common.lib.LibMisc; + +import java.util.List; + +public final class LootHandler { + + private static final List TABLES = ImmutableList.of( + "gaia_guardian", "gaia_guardian_2", + "inject/abandoned_mineshaft", "inject/desert_pyramid", + "inject/jungle_temple", "inject/simple_dungeon", + "inject/spawn_bonus_chest", "inject/stronghold_corridor", + "inject/village_blacksmith" + ); + + public LootHandler() { + for (String s : TABLES) { + LootTableList.register(new ResourceLocation(LibMisc.MOD_ID, s)); + } + + LootConditionManager.registerCondition(new TrueGuardianKiller.Serializer()); + LootConditionManager.registerCondition(new EnableRelics.Serializer()); + LootFunctionManager.registerFunction(new BindUuid.Serializer()); + } + + @SubscribeEvent + public void lootLoad(LootTableLoadEvent evt) { + String prefix = "minecraft:chests/"; + String name = evt.getName().toString(); + + if (name.startsWith(prefix)) { + String file = name.substring(name.indexOf(prefix) + prefix.length()); + switch (file) { + case "abandoned_mineshaft": + case "desert_pyramid": + case "jungle_temple": + case "simple_dungeon": + case "spawn_bonus_chest": + case "stronghold_corridor": + case "village_blacksmith": evt.getTable().addPool(getInjectPool(file)); break; + default: break; + } + } + } + + private LootPool getInjectPool(String entryName) { + return new LootPool(new LootEntry[] { getInjectEntry(entryName, 1) }, new LootCondition[0], new RandomValueRange(1), new RandomValueRange(0, 1), "botania_inject_pool"); + } + + private LootEntryTable getInjectEntry(String name, int weight) { + return new LootEntryTable(new ResourceLocation(LibMisc.MOD_ID, "inject/" + name), weight, 0, new LootCondition[0], "botania_inject_entry"); + } + +} diff --git a/src/main/java/vazkii/botania/common/core/loot/TrueGuardianKiller.java b/src/main/java/vazkii/botania/common/core/loot/TrueGuardianKiller.java new file mode 100644 index 000000000..6279fc2bb --- /dev/null +++ b/src/main/java/vazkii/botania/common/core/loot/TrueGuardianKiller.java @@ -0,0 +1,38 @@ +package vazkii.botania.common.core.loot; + +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonObject; +import com.google.gson.JsonSerializationContext; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.storage.loot.LootContext; +import net.minecraft.world.storage.loot.conditions.LootCondition; +import vazkii.botania.common.entity.EntityDoppleganger; +import vazkii.botania.common.lib.LibMisc; + +import javax.annotation.Nonnull; +import java.util.Random; + +public class TrueGuardianKiller implements LootCondition { + + @Override + public boolean testCondition(@Nonnull Random rand, @Nonnull LootContext context) { + return context.getLootedEntity() instanceof EntityDoppleganger + && context.getKillerPlayer() == ((EntityDoppleganger) context.getLootedEntity()).trueKiller; + } + + public static class Serializer extends LootCondition.Serializer { + protected Serializer() { + super(new ResourceLocation(LibMisc.MOD_ID, "true_guardian_killer"), TrueGuardianKiller.class); + } + + @Override + public void serialize(@Nonnull JsonObject json, @Nonnull TrueGuardianKiller value, @Nonnull JsonSerializationContext context) {} + + @Nonnull + @Override + public TrueGuardianKiller deserialize(@Nonnull JsonObject json, @Nonnull JsonDeserializationContext context) { + return new TrueGuardianKiller(); + } + } + +} diff --git a/src/main/java/vazkii/botania/common/core/proxy/CommonProxy.java b/src/main/java/vazkii/botania/common/core/proxy/CommonProxy.java deleted file mode 100644 index 906433dd6..000000000 --- a/src/main/java/vazkii/botania/common/core/proxy/CommonProxy.java +++ /dev/null @@ -1,333 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 13, 2014, 7:45:37 PM (GMT)] - */ -package vazkii.botania.common.core.proxy; - -import net.minecraft.block.Block; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.boss.EntityDragon; -import net.minecraft.entity.boss.EntityDragonPart; -import net.minecraft.entity.boss.EntityWither; -import net.minecraft.entity.item.EntityEnderCrystal; -import net.minecraft.entity.item.EntityItemFrame; -import net.minecraft.entity.item.EntityPainting; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemRecord; -import net.minecraft.item.ItemStack; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; -import net.minecraftforge.common.MinecraftForge; - -import org.apache.logging.log4j.Level; - -import vazkii.botania.api.BotaniaAPI; -import vazkii.botania.api.lexicon.ITwoNamedPage; -import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.api.lexicon.LexiconPage; -import vazkii.botania.common.Botania; -import vazkii.botania.common.achievement.ModAchievements; -import vazkii.botania.common.block.ModBlocks; -import vazkii.botania.common.block.ModMultiblocks; -import vazkii.botania.common.block.subtile.generating.SubTileNarslimmus; -import vazkii.botania.common.block.tile.TileLightRelay.EntityPlayerMover; -import vazkii.botania.common.block.tile.corporea.TileCorporeaIndex; -import vazkii.botania.common.brew.ModBrews; -import vazkii.botania.common.brew.ModPotions; -import vazkii.botania.common.core.command.CommandDownloadLatest; -import vazkii.botania.common.core.command.CommandOpen; -import vazkii.botania.common.core.command.CommandShare; -import vazkii.botania.common.core.command.CommandSkyblockSpread; -import vazkii.botania.common.core.handler.BiomeDecorationHandler; -import vazkii.botania.common.core.handler.ChestGenHandler; -import vazkii.botania.common.core.handler.CommonTickHandler; -import vazkii.botania.common.core.handler.ConfigHandler; -import vazkii.botania.common.core.handler.InternalMethodHandler; -import vazkii.botania.common.core.handler.ManaNetworkHandler; -import vazkii.botania.common.core.handler.PixieHandler; -import vazkii.botania.common.core.handler.SheddingHandler; -import vazkii.botania.common.core.handler.SpawnerChangingHandler; -import vazkii.botania.common.core.helper.Vector3; -import vazkii.botania.common.crafting.ModBrewRecipes; -import vazkii.botania.common.crafting.ModCraftingRecipes; -import vazkii.botania.common.crafting.ModElvenTradeRecipes; -import vazkii.botania.common.crafting.ModManaAlchemyRecipes; -import vazkii.botania.common.crafting.ModManaConjurationRecipes; -import vazkii.botania.common.crafting.ModManaInfusionRecipes; -import vazkii.botania.common.crafting.ModPetalRecipes; -import vazkii.botania.common.crafting.ModPureDaisyRecipes; -import vazkii.botania.common.crafting.ModRuneRecipes; -import vazkii.botania.common.entity.EntityCorporeaSpark; -import vazkii.botania.common.entity.EntityDoppleganger; -import vazkii.botania.common.entity.EntityFlameRing; -import vazkii.botania.common.entity.EntityMagicLandmine; -import vazkii.botania.common.entity.EntityMagicMissile; -import vazkii.botania.common.entity.EntityManaBurst; -import vazkii.botania.common.entity.EntityPinkWither; -import vazkii.botania.common.entity.EntitySignalFlare; -import vazkii.botania.common.entity.EntitySpark; -import vazkii.botania.common.entity.ModEntities; -import vazkii.botania.common.integration.buildcraft.StatementAPIPlugin; -import vazkii.botania.common.integration.etfuturum.ModBanners; -import vazkii.botania.common.item.ModItems; -import vazkii.botania.common.lexicon.LexiconData; -import vazkii.botania.common.lib.LibMisc; -import vazkii.botania.common.network.GuiHandler; -import vazkii.botania.common.world.SkyblockWorldEvents; -import vazkii.botania.common.world.WorldTypeSkyblock; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.FMLLog; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLInterModComms; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerAboutToStartEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; -import cpw.mods.fml.common.network.NetworkRegistry; - -public class CommonProxy { - - public void preInit(FMLPreInitializationEvent event) { - BotaniaAPI.internalHandler = new InternalMethodHandler(); - - ConfigHandler.loadConfig(event.getSuggestedConfigurationFile()); - - ModBlocks.init(); - ModItems.init(); - ModEntities.init(); - ModPotions.init(); - ModBrews.init(); - - ModCraftingRecipes.init(); - ModPetalRecipes.init(); - ModPureDaisyRecipes.init(); - ModRuneRecipes.init(); - ModManaAlchemyRecipes.init(); - ModManaConjurationRecipes.init(); - ModManaInfusionRecipes.init(); - ModElvenTradeRecipes.init(); - ModBrewRecipes.init(); - ModAchievements.init(); - ModMultiblocks.init(); - - if(Botania.etFuturumLoaded) - ModBanners.init(); - - ChestGenHandler.init(); - - LexiconData.init(); - - if(Botania.gardenOfGlassLoaded) - new WorldTypeSkyblock(); - } - - public void init(FMLInitializationEvent event) { - NetworkRegistry.INSTANCE.registerGuiHandler(Botania.instance, new GuiHandler()); - - MinecraftForge.TERRAIN_GEN_BUS.register(new BiomeDecorationHandler()); - MinecraftForge.EVENT_BUS.register(ManaNetworkHandler.instance); - MinecraftForge.EVENT_BUS.register(new PixieHandler()); - MinecraftForge.EVENT_BUS.register(new SheddingHandler()); - MinecraftForge.EVENT_BUS.register(new SpawnerChangingHandler()); - MinecraftForge.EVENT_BUS.register(new SubTileNarslimmus.SpawnIntercepter()); - MinecraftForge.EVENT_BUS.register(TileCorporeaIndex.getInputHandler()); - - if(Botania.gardenOfGlassLoaded) - MinecraftForge.EVENT_BUS.register(new SkyblockWorldEvents()); - - FMLCommonHandler.instance().bus().register(new CommonTickHandler()); - - FMLInterModComms.sendMessage("ProjectE", "interdictionblacklist", EntityManaBurst.class.getCanonicalName()); - - if(Botania.bcTriggersLoaded) - new StatementAPIPlugin(); - } - - public void postInit(FMLPostInitializationEvent event) { - if(Botania.thaumcraftLoaded) { - ModBrews.initTC(); - ModBrewRecipes.initTC(); - } - - ModBlocks.addDispenserBehaviours(); - ModBlocks.registerMultiparts(); - ConfigHandler.loadPostInit(); - LexiconData.postInit(); - - registerNEIStuff(); - - int words = 0; - for(LexiconEntry entry : BotaniaAPI.getAllEntries()) - for(LexiconPage page : entry.pages) { - words += countWords(page.getUnlocalizedName()); - if(page instanceof ITwoNamedPage) - words += countWords(((ITwoNamedPage) page).getSecondUnlocalizedName()); - } - FMLLog.log(Level.INFO, "[Botania] The Lexica Botania has %d words.", words); - - registerDefaultEntityBlacklist(); - } - - private int countWords(String s) { - String s1 = StatCollector.translateToLocal(s); - return s1.split(" ").length; - } - - private void registerDefaultEntityBlacklist() { - // Vanilla - BotaniaAPI.blacklistEntityFromGravityRod(EntityDragon.class); - BotaniaAPI.blacklistEntityFromGravityRod(EntityDragonPart.class); - BotaniaAPI.blacklistEntityFromGravityRod(EntityWither.class); - BotaniaAPI.blacklistEntityFromGravityRod(EntityItemFrame.class); - BotaniaAPI.blacklistEntityFromGravityRod(EntityEnderCrystal.class); - BotaniaAPI.blacklistEntityFromGravityRod(EntityPainting.class); - - // Botania - BotaniaAPI.blacklistEntityFromGravityRod(EntityCorporeaSpark.class); - BotaniaAPI.blacklistEntityFromGravityRod(EntityDoppleganger.class); - BotaniaAPI.blacklistEntityFromGravityRod(EntityFlameRing.class); - BotaniaAPI.blacklistEntityFromGravityRod(EntityMagicLandmine.class); - BotaniaAPI.blacklistEntityFromGravityRod(EntityMagicMissile.class); - BotaniaAPI.blacklistEntityFromGravityRod(EntityManaBurst.class); - BotaniaAPI.blacklistEntityFromGravityRod(EntityPinkWither.class); - BotaniaAPI.blacklistEntityFromGravityRod(EntitySignalFlare.class); - BotaniaAPI.blacklistEntityFromGravityRod(EntitySpark.class); - BotaniaAPI.blacklistEntityFromGravityRod(EntityPlayerMover.class); - } - - // Overriding the internal method handler will break everything as it changes regularly. - // So just don't be a moron and don't override it. Thanks. - public void serverAboutToStart(FMLServerAboutToStartEvent event) { - String clname = BotaniaAPI.internalHandler.getClass().getName(); - String expect = "vazkii.botania.common.core.handler.InternalMethodHandler"; - if(!clname.equals(expect)) { - new IllegalAccessError("The Botania API internal method handler has been overriden. " - + "This will cause crashes and compatibility issues, and that's why it's marked as" - + " \"Do not Override\". Whoever had the brilliant idea of overriding it needs to go" - + " back to elementary school and learn to read. (Expected classname: " + expect + ", Actual classname: " + clname + ")").printStackTrace(); - FMLCommonHandler.instance().exitJava(1, true); - } - } - - public void serverStarting(FMLServerStartingEvent event) { - event.registerServerCommand(new CommandDownloadLatest()); - event.registerServerCommand(new CommandShare()); - event.registerServerCommand(new CommandOpen()); - if(Botania.gardenOfGlassLoaded) - event.registerServerCommand(new CommandSkyblockSpread()); - } - - public void registerNEIStuff() { - // NO-OP - } - - public void setEntryToOpen(LexiconEntry entry) { - // NO-OP - } - - public void setToTutorialIfFirstLaunch() { - // NO-OP - } - - public void setLexiconStack(ItemStack stack) { - // NO-OP - } - - public boolean isTheClientPlayer(EntityLivingBase entity) { - return false; - } - - public boolean isClientPlayerWearingMonocle() { - return false; - } - - public String getLastVersion() { - return LibMisc.BUILD; - } - - public void setExtraReach(EntityLivingBase entity, float reach) { - if(entity instanceof EntityPlayerMP) - ((EntityPlayerMP) entity).theItemInWorldManager.setBlockReachDistance(Math.max(5, ((EntityPlayerMP) entity).theItemInWorldManager.getBlockReachDistance() + reach)); - } - - public boolean openWikiPage(World world, Block block, MovingObjectPosition pos) { - return false; - } - - public void playRecordClientSided(World world, int x, int y, int z, ItemRecord record) { - // NO-OP - } - - public void setMultiblock(World world, int x, int y, int z, double radius, Block block) { - // NO-OP - } - - public void removeSextantMultiblock() { - // NO-OP - } - - public long getWorldElapsedTicks() { - return MinecraftServer.getServer().worldServers[0].getTotalWorldTime(); - } - - public void setSparkleFXNoClip(boolean noclip) { - // NO-OP - } - - public void setSparkleFXCorrupt(boolean corrupt) { - // NO-OP - } - - public void sparkleFX(World world, double x, double y, double z, float r, float g, float b, float size, int m) { - sparkleFX(world, x, y, z, r, g, b, size, m, false); - } - - public void sparkleFX(World world, double x, double y, double z, float r, float g, float b, float size, int m, boolean fake) { - // NO-OP - } - - public void setWispFXDistanceLimit(boolean limit) { - // NO-OP - } - - public void setWispFXDepthTest(boolean depth) { - // NO-OP - } - - public void wispFX(World world, double x, double y, double z, float r, float g, float b, float size) { - wispFX(world, x, y, z, r, g, b, size, 0F); - } - - public void wispFX(World world, double x, double y, double z, float r, float g, float b, float size, float gravity) { - wispFX(world, x, y, z, r, g, b, size, gravity, 1F); - } - - public void wispFX(World world, double x, double y, double z, float r, float g, float b, float size, float gravity, float maxAgeMul) { - wispFX(world, x, y, z, r, g, b, size, 0, -gravity, 0, maxAgeMul); - } - - public void wispFX(World world, double x, double y, double z, float r, float g, float b, float size, float motionx, float motiony, float motionz) { - wispFX(world, x, y, z, r, g, b, size, motionx, motiony, motionz, 1F); - } - - public void wispFX(World world, double x, double y, double z, float r, float g, float b, float size, float motionx, float motiony, float motionz, float maxAgeMul) { - // NO-OP - } - - public void lightningFX(World world, Vector3 vectorStart, Vector3 vectorEnd, float ticksPerMeter, int colorOuter, int colorInner) { - lightningFX(world, vectorStart, vectorEnd, ticksPerMeter, System.nanoTime(), colorOuter, colorInner); - } - - public void lightningFX(World world, Vector3 vectorStart, Vector3 vectorEnd, float ticksPerMeter, long seed, int colorOuter, int colorInner) { - // NO-OP - } - -} diff --git a/src/main/java/vazkii/botania/common/core/proxy/IProxy.java b/src/main/java/vazkii/botania/common/core/proxy/IProxy.java new file mode 100644 index 000000000..1ef11ecac --- /dev/null +++ b/src/main/java/vazkii/botania/common/core/proxy/IProxy.java @@ -0,0 +1,96 @@ +package vazkii.botania.common.core.proxy; + +import net.minecraft.block.Block; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemRecord; +import net.minecraft.item.ItemStack; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.world.World; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; +import vazkii.botania.api.boss.IBotaniaBoss; +import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.common.core.helper.Vector3; + +public interface IProxy { + void preInit(FMLPreInitializationEvent event); + + void init(FMLInitializationEvent event); + + void postInit(FMLPostInitializationEvent event); + + void setEntryToOpen(LexiconEntry entry); + + void setToTutorialIfFirstLaunch(); + + void setLexiconStack(ItemStack stack); + + boolean isTheClientPlayer(EntityLivingBase entity); + + EntityPlayer getClientPlayer(); + + boolean isClientPlayerWearingMonocle(); + + String getLastVersion(); + + void setExtraReach(EntityLivingBase entity, float reach); + + boolean openWikiPage(World world, Block block, RayTraceResult pos); + + void playRecordClientSided(World world, BlockPos pos, ItemRecord record); + + void setMultiblock(World world, int x, int y, int z, double radius, Block block); + + void removeSextantMultiblock(); + + long getWorldElapsedTicks(); + + void setSparkleFXNoClip(boolean noclip); + + void setSparkleFXCorrupt(boolean corrupt); + + default void sparkleFX(double x, double y, double z, float r, float g, float b, float size, int m) { + sparkleFX(x, y, z, r, g, b, size, m, false); + } + + void sparkleFX(double x, double y, double z, float r, float g, float b, float size, int m, boolean fake); + + void setWispFXDistanceLimit(boolean limit); + + void setWispFXDepthTest(boolean depth); + + default void wispFX(double x, double y, double z, float r, float g, float b, float size) { + wispFX(x, y, z, r, g, b, size, 0F); + } + + default void wispFX(double x, double y, double z, float r, float g, float b, float size, float gravity) { + wispFX(x, y, z, r, g, b, size, gravity, 1F); + } + + default void wispFX(double x, double y, double z, float r, float g, float b, float size, float gravity, float maxAgeMul) { + wispFX(x, y, z, r, g, b, size, 0, -gravity, 0, maxAgeMul); + } + + default void wispFX(double x, double y, double z, float r, float g, float b, float size, float motionx, float motiony, float motionz) { + wispFX(x, y, z, r, g, b, size, motionx, motiony, motionz, 1F); + } + + void wispFX(double x, double y, double z, float r, float g, float b, float size, float motionx, float motiony, float motionz, float maxAgeMul); + + default void lightningFX(Vector3 vectorStart, Vector3 vectorEnd, float ticksPerMeter, int colorOuter, int colorInner) { + lightningFX(vectorStart, vectorEnd, ticksPerMeter, System.nanoTime(), colorOuter, colorInner); + } + + void lightningFX(Vector3 vectorStart, Vector3 vectorEnd, float ticksPerMeter, long seed, int colorOuter, int colorInner); + + void addBoss(IBotaniaBoss boss); + + void removeBoss(IBotaniaBoss boss); + + int getClientRenderDistance(); + + Object getEmptyModelBiped(); +} diff --git a/src/main/java/vazkii/botania/common/core/proxy/ServerProxy.java b/src/main/java/vazkii/botania/common/core/proxy/ServerProxy.java new file mode 100644 index 000000000..dfc8f3ed4 --- /dev/null +++ b/src/main/java/vazkii/botania/common/core/proxy/ServerProxy.java @@ -0,0 +1,133 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + * + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + * + * File Created @ [Jan 13, 2014, 7:45:37 PM (GMT)] + */ +package vazkii.botania.common.core.proxy; + +import net.minecraft.block.Block; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemRecord; +import net.minecraft.item.ItemStack; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.world.World; +import net.minecraftforge.fml.common.FMLCommonHandler; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; +import vazkii.botania.api.boss.IBotaniaBoss; +import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.common.core.helper.Vector3; +import vazkii.botania.common.lib.LibMisc; + +public class ServerProxy implements IProxy { + + @Override + public void preInit(FMLPreInitializationEvent event) {} + + @Override + public void init(FMLInitializationEvent event) {} + + @Override + public void postInit(FMLPostInitializationEvent event) {} + + @Override + public void setEntryToOpen(LexiconEntry entry) {} + + @Override + public void setToTutorialIfFirstLaunch() {} + + @Override + public void setLexiconStack(ItemStack stack) {} + + @Override + public boolean isTheClientPlayer(EntityLivingBase entity) { + return false; + } + + @Override + public EntityPlayer getClientPlayer() { + return null; + } + + @Override + public boolean isClientPlayerWearingMonocle() { + return false; + } + + @Override + public String getLastVersion() { + return LibMisc.BUILD; + } + + @Override + public void setExtraReach(EntityLivingBase entity, float reach) { + if(entity instanceof EntityPlayerMP) + ((EntityPlayerMP) entity).interactionManager.setBlockReachDistance(Math.max(5, ((EntityPlayerMP) entity).interactionManager.getBlockReachDistance() + reach)); + } + + @Override + public boolean openWikiPage(World world, Block block, RayTraceResult pos) { + return false; + } + + @Override + public void playRecordClientSided(World world, BlockPos pos, ItemRecord record) {} + + @Override + public void setMultiblock(World world, int x, int y, int z, double radius, Block block) {} + + @Override + public void removeSextantMultiblock() {} + + @Override + public long getWorldElapsedTicks() { + return FMLCommonHandler.instance().getMinecraftServerInstance().worldServers[0].getTotalWorldTime(); + } + + @Override + public void setSparkleFXNoClip(boolean noclip) {} + + @Override + public void setSparkleFXCorrupt(boolean corrupt) {} + + @Override + public void sparkleFX(double x, double y, double z, float r, float g, float b, float size, int m, boolean fake) {} + + @Override + public void setWispFXDistanceLimit(boolean limit) {} + + @Override + public void setWispFXDepthTest(boolean depth) {} + + @Override + public void wispFX(double x, double y, double z, float r, float g, float b, float size, float motionx, float motiony, float motionz, float maxAgeMul) {} + + @Override + public void lightningFX(Vector3 vectorStart, Vector3 vectorEnd, float ticksPerMeter, long seed, int colorOuter, int colorInner) {} + + @Override + public void addBoss(IBotaniaBoss boss) {} + + @Override + public void removeBoss(IBotaniaBoss boss) {} + + @Override + public int getClientRenderDistance() { + return 0; + } + + @Override + public Object getEmptyModelBiped() { + return null; + } + +} diff --git a/src/main/java/vazkii/botania/common/core/version/AdaptorNotifier.java b/src/main/java/vazkii/botania/common/core/version/AdaptorNotifier.java index 4db165e9b..ca406f7f7 100644 --- a/src/main/java/vazkii/botania/common/core/version/AdaptorNotifier.java +++ b/src/main/java/vazkii/botania/common/core/version/AdaptorNotifier.java @@ -12,16 +12,18 @@ package vazkii.botania.common.core.version; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent; import vazkii.botania.common.core.handler.ConfigHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent; public final class AdaptorNotifier { - boolean triedToWarnPlayer; + private AdaptorNotifier() {} + + private static boolean triedToWarnPlayer; @SubscribeEvent - public void onTick(ClientTickEvent event) { + public static void onTick(ClientTickEvent event) { if(!triedToWarnPlayer && Minecraft.getMinecraft().thePlayer != null) { EntityPlayer player = Minecraft.getMinecraft().thePlayer; ConfigHandler.adaptor.tellChanges(player); diff --git a/src/main/java/vazkii/botania/common/core/version/ThreadDownloadMod.java b/src/main/java/vazkii/botania/common/core/version/ThreadDownloadMod.java index 4bdb6fce7..9029c4c6a 100644 --- a/src/main/java/vazkii/botania/common/core/version/ThreadDownloadMod.java +++ b/src/main/java/vazkii/botania/common/core/version/ThreadDownloadMod.java @@ -10,30 +10,30 @@ */ package vazkii.botania.common.core.version; -import java.awt.Desktop; +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.Style; +import net.minecraft.util.text.TextComponentTranslation; +import net.minecraft.util.text.TextFormatting; + +import java.awt.*; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.net.URL; -import net.minecraft.client.Minecraft; -import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.util.ChatStyle; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IChatComponent; -import net.minecraft.util.StatCollector; - public class ThreadDownloadMod extends Thread { - String fileName; + private final String fileName; - byte[] buffer = new byte[10240]; + private byte[] buffer = new byte[10240]; - int totalBytesDownloaded; - int bytesJustDownloaded; + private int totalBytesDownloaded; + private int bytesJustDownloaded; - InputStream webReader; + private InputStream webReader; public ThreadDownloadMod(String fileName) { setName("Botania Download File Thread"); @@ -46,7 +46,7 @@ public class ThreadDownloadMod extends Thread { @Override public void run() { try { - IChatComponent component = IChatComponent.Serializer.func_150699_a(String.format(StatCollector.translateToLocal("botania.versioning.startingDownload"), fileName)); + ITextComponent component = ITextComponent.Serializer.jsonToComponent(I18n.format("botania.versioning.startingDownload", fileName)); if(Minecraft.getMinecraft().thePlayer != null) Minecraft.getMinecraft().thePlayer.addChatMessage(component); @@ -58,7 +58,7 @@ public class ThreadDownloadMod extends Thread { try { url.openStream().close(); // Add to DL Counter - } catch(IOException e) { } + } catch(IOException ignored) {} url = new URL(base + "files/" + file); webReader = url.openStream(); @@ -82,25 +82,19 @@ public class ThreadDownloadMod extends Thread { f.renameTo(f1); if(Minecraft.getMinecraft().thePlayer != null) - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentTranslation("botania.versioning.doneDownloading", fileName).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GREEN))); + Minecraft.getMinecraft().thePlayer.addChatMessage(new TextComponentTranslation("botania.versioning.doneDownloading", fileName).setStyle(new Style().setColor(TextFormatting.GREEN))); Desktop.getDesktop().open(dir); VersionChecker.downloadedFile = true; - finalize(); - } catch(Throwable e) { + } catch (IOException e) { e.printStackTrace(); sendError(); - try { - finalize(); - } catch(Throwable e1) { - e1.printStackTrace(); - } } } private void sendError() { if(Minecraft.getMinecraft().thePlayer != null) - Minecraft.getMinecraft().thePlayer.addChatComponentMessage(new ChatComponentTranslation("botania.versioning.error").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED))); + Minecraft.getMinecraft().thePlayer.addChatComponentMessage(new TextComponentTranslation("botania.versioning.error").setStyle(new Style().setColor(TextFormatting.RED))); } } \ No newline at end of file diff --git a/src/main/java/vazkii/botania/common/core/version/ThreadVersionChecker.java b/src/main/java/vazkii/botania/common/core/version/ThreadVersionChecker.java index 909434221..b4ffac40f 100644 --- a/src/main/java/vazkii/botania/common/core/version/ThreadVersionChecker.java +++ b/src/main/java/vazkii/botania/common/core/version/ThreadVersionChecker.java @@ -27,7 +27,7 @@ public class ThreadVersionChecker extends Thread { @Override public void run() { try { - URL url = new URL("https://raw.githubusercontent.com/Vazkii/Botania/master/version/" + MinecraftForge.MC_VERSION + ".txt"); + URL url = new URL("https://raw.githubusercontent.com/Vazkii/BotaniaV2/master/version/" + MinecraftForge.MC_VERSION + ".txt"); BufferedReader r = new BufferedReader(new InputStreamReader(url.openStream())); VersionChecker.onlineVersion = r.readLine(); r.close(); @@ -36,4 +36,4 @@ public class ThreadVersionChecker extends Thread { } VersionChecker.doneChecking = true; } -} +} \ No newline at end of file diff --git a/src/main/java/vazkii/botania/common/core/version/VersionChecker.java b/src/main/java/vazkii/botania/common/core/version/VersionChecker.java index 9f4f5351b..9e5c727eb 100644 --- a/src/main/java/vazkii/botania/common/core/version/VersionChecker.java +++ b/src/main/java/vazkii/botania/common/core/version/VersionChecker.java @@ -12,45 +12,46 @@ package vazkii.botania.common.core.version; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.util.ChatStyle; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IChatComponent; -import net.minecraft.util.StatCollector; -import vazkii.botania.common.lib.LibMisc; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent; -import cpw.mods.fml.common.gameevent.TickEvent.Phase; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.Style; +import net.minecraft.util.text.TextComponentTranslation; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.util.text.translation.I18n; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; public final class VersionChecker { + private VersionChecker() {} + private static final int FLAVOUR_MESSAGES = 65; public static boolean doneChecking = false; public static String onlineVersion = ""; - public static boolean triedToWarnPlayer = false; + private static boolean triedToWarnPlayer = false; public static boolean startedDownload = false; public static boolean downloadedFile = false; - public void init() { + public static void init() { new ThreadVersionChecker(); - FMLCommonHandler.instance().bus().register(this); + MinecraftForge.EVENT_BUS.register(VersionChecker.class); } @SubscribeEvent - public void onTick(ClientTickEvent event) { + public static void onTick(ClientTickEvent event) { if(doneChecking && event.phase == Phase.END && Minecraft.getMinecraft().thePlayer != null && !triedToWarnPlayer) { if(!onlineVersion.isEmpty()) { EntityPlayer player = Minecraft.getMinecraft().thePlayer; int onlineBuild = Integer.parseInt(onlineVersion.split("-")[1]); int clientBuild = LibMisc.BUILD.contains("GRADLE") ? Integer.MAX_VALUE : Integer.parseInt(LibMisc.BUILD); if(onlineBuild > clientBuild) { - player.addChatComponentMessage(new ChatComponentTranslation("botania.versioning.flavour" + player.worldObj.rand.nextInt(FLAVOUR_MESSAGES)).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.LIGHT_PURPLE))); - player.addChatComponentMessage(new ChatComponentTranslation("botania.versioning.outdated", clientBuild, onlineBuild)); + player.addChatComponentMessage(new TextComponentTranslation("botania.versioning.flavour" + player.worldObj.rand.nextInt(FLAVOUR_MESSAGES)).setStyle(new Style().setColor(TextFormatting.LIGHT_PURPLE))); + player.addChatComponentMessage(new TextComponentTranslation("botania.versioning.outdated", clientBuild, onlineBuild)); - IChatComponent component = IChatComponent.Serializer.func_150699_a(StatCollector.translateToLocal("botania.versioning.updateMessage").replaceAll("%version%", onlineVersion)); + ITextComponent component = ITextComponent.Serializer.fromJsonLenient(I18n.translateToLocal("botania.versioning.updateMessage").replaceAll("%version%", onlineVersion)); player.addChatComponentMessage(component); } } diff --git a/src/main/java/vazkii/botania/common/crafting/ModBrewRecipes.java b/src/main/java/vazkii/botania/common/crafting/ModBrewRecipes.java index bafdb0bb5..138f05d6f 100644 --- a/src/main/java/vazkii/botania/common/crafting/ModBrewRecipes.java +++ b/src/main/java/vazkii/botania/common/crafting/ModBrewRecipes.java @@ -14,10 +14,12 @@ import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.recipe.RecipeBrew; import vazkii.botania.common.brew.ModBrews; import vazkii.botania.common.item.ModItems; +import vazkii.botania.common.lib.LibOreDict; public class ModBrewRecipes { @@ -46,34 +48,35 @@ public class ModBrewRecipes { public static RecipeBrew warpWardBrew; public static void init() { - speedBrew = BotaniaAPI.registerBrewRecipe(ModBrews.speed, new ItemStack(Items.nether_wart), new ItemStack(Items.sugar), new ItemStack(Items.redstone)); - strengthBrew = BotaniaAPI.registerBrewRecipe(ModBrews.strength, new ItemStack(Items.nether_wart), new ItemStack(Items.blaze_powder), new ItemStack(Items.glowstone_dust)); - hasteBrew = BotaniaAPI.registerBrewRecipe(ModBrews.haste, new ItemStack(Items.nether_wart), new ItemStack(Items.sugar), new ItemStack(Items.gold_nugget)); - healingBrew = BotaniaAPI.registerBrewRecipe(ModBrews.healing, new ItemStack(Items.nether_wart), new ItemStack(Items.speckled_melon), new ItemStack(Items.potato)); - jumpBoostBrew = BotaniaAPI.registerBrewRecipe(ModBrews.jumpBoost, new ItemStack(Items.nether_wart), new ItemStack(Items.feather), new ItemStack(Items.carrot)); - regenerationBrew = BotaniaAPI.registerBrewRecipe(ModBrews.regen, new ItemStack(Items.nether_wart), new ItemStack(Items.ghast_tear), new ItemStack(Items.glowstone_dust)); - weakRegenerationBrew = BotaniaAPI.registerBrewRecipe(ModBrews.regenWeak, new ItemStack(Items.nether_wart), new ItemStack(Items.ghast_tear), new ItemStack(Items.redstone)); - resistanceBrew = BotaniaAPI.registerBrewRecipe(ModBrews.resistance, new ItemStack(Items.nether_wart), new ItemStack(Items.iron_ingot), new ItemStack(Items.leather)); - fireResistanceBrew = BotaniaAPI.registerBrewRecipe(ModBrews.fireResistance, new ItemStack(Items.nether_wart), new ItemStack(Items.magma_cream), new ItemStack(Blocks.netherrack)); - waterBreathingBrew = BotaniaAPI.registerBrewRecipe(ModBrews.waterBreathing, new ItemStack(Items.nether_wart), new ItemStack(ModItems.manaResource, 1, 10), new ItemStack(Items.glowstone_dust)); - invisibilityBrew = BotaniaAPI.registerBrewRecipe(ModBrews.invisibility, new ItemStack(Items.nether_wart), new ItemStack(Items.snowball), new ItemStack(Items.glowstone_dust)); - nightVisionBrew = BotaniaAPI.registerBrewRecipe(ModBrews.nightVision, new ItemStack(Items.nether_wart), new ItemStack(Items.spider_eye), new ItemStack(Items.golden_carrot)); - absorptionBrew = BotaniaAPI.registerBrewRecipe(ModBrews.absorption, new ItemStack(Items.nether_wart), new ItemStack(Items.golden_apple), new ItemStack(Items.potato)); + speedBrew = BotaniaAPI.registerBrewRecipe(ModBrews.speed, new ItemStack(Items.NETHER_WART), new ItemStack(Items.SUGAR), new ItemStack(Items.REDSTONE)); + strengthBrew = BotaniaAPI.registerBrewRecipe(ModBrews.strength, new ItemStack(Items.NETHER_WART), new ItemStack(Items.BLAZE_POWDER), new ItemStack(Items.GLOWSTONE_DUST)); + hasteBrew = BotaniaAPI.registerBrewRecipe(ModBrews.haste, new ItemStack(Items.NETHER_WART), new ItemStack(Items.SUGAR), new ItemStack(Items.GOLD_NUGGET)); + healingBrew = BotaniaAPI.registerBrewRecipe(ModBrews.healing, new ItemStack(Items.NETHER_WART), new ItemStack(Items.SPECKLED_MELON), new ItemStack(Items.POTATO)); + jumpBoostBrew = BotaniaAPI.registerBrewRecipe(ModBrews.jumpBoost, new ItemStack(Items.NETHER_WART), new ItemStack(Items.FEATHER), new ItemStack(Items.CARROT)); + regenerationBrew = BotaniaAPI.registerBrewRecipe(ModBrews.regen, new ItemStack(Items.NETHER_WART), new ItemStack(Items.GHAST_TEAR), new ItemStack(Items.GLOWSTONE_DUST)); + weakRegenerationBrew = BotaniaAPI.registerBrewRecipe(ModBrews.regenWeak, new ItemStack(Items.NETHER_WART), new ItemStack(Items.GHAST_TEAR), new ItemStack(Items.REDSTONE)); + resistanceBrew = BotaniaAPI.registerBrewRecipe(ModBrews.resistance, new ItemStack(Items.NETHER_WART), new ItemStack(Items.IRON_INGOT), new ItemStack(Items.LEATHER)); + fireResistanceBrew = BotaniaAPI.registerBrewRecipe(ModBrews.fireResistance, new ItemStack(Items.NETHER_WART), new ItemStack(Items.MAGMA_CREAM), new ItemStack(Blocks.NETHERRACK)); + waterBreathingBrew = BotaniaAPI.registerBrewRecipe(ModBrews.waterBreathing, new ItemStack(Items.NETHER_WART), LibOreDict.PRISMARINE_SHARD, new ItemStack(Items.GLOWSTONE_DUST)); + invisibilityBrew = BotaniaAPI.registerBrewRecipe(ModBrews.invisibility, new ItemStack(Items.NETHER_WART), new ItemStack(Items.SNOWBALL), new ItemStack(Items.GLOWSTONE_DUST)); + nightVisionBrew = BotaniaAPI.registerBrewRecipe(ModBrews.nightVision, new ItemStack(Items.NETHER_WART), new ItemStack(Items.SPIDER_EYE), new ItemStack(Items.GOLDEN_CARROT)); + absorptionBrew = BotaniaAPI.registerBrewRecipe(ModBrews.absorption, new ItemStack(Items.NETHER_WART), new ItemStack(Items.GOLDEN_APPLE), new ItemStack(Items.POTATO)); - overloadBrew = BotaniaAPI.registerBrewRecipe(ModBrews.overload, new ItemStack(Items.nether_wart), new ItemStack(Items.blaze_powder), new ItemStack(Items.sugar), new ItemStack(Items.glowstone_dust), new ItemStack(ModItems.manaResource), new ItemStack(Items.spider_eye)); - soulCrossBrew = BotaniaAPI.registerBrewRecipe(ModBrews.soulCross, new ItemStack(Items.nether_wart), new ItemStack(Blocks.soul_sand), new ItemStack(Items.paper), new ItemStack(Items.apple), new ItemStack(Items.bone)); - featherFeetBrew = BotaniaAPI.registerBrewRecipe(ModBrews.featherfeet, new ItemStack(Items.nether_wart), new ItemStack(Items.feather), new ItemStack(Items.leather), new ItemStack(Blocks.wool, 1, -1)); - emptinessBrew = BotaniaAPI.registerBrewRecipe(ModBrews.emptiness, new ItemStack(Items.nether_wart), new ItemStack(Items.gunpowder), new ItemStack(Items.rotten_flesh), new ItemStack(Items.bone), new ItemStack(Items.string), new ItemStack(Items.ender_pearl)); - bloodthirstBrew = BotaniaAPI.registerBrewRecipe(ModBrews.bloodthirst, new ItemStack(Items.nether_wart), new ItemStack(Items.fermented_spider_eye), new ItemStack(Items.dye, 1, 4), new ItemStack(Items.fire_charge), new ItemStack(Items.iron_ingot)); - allureBrew = BotaniaAPI.registerBrewRecipe(ModBrews.allure, new ItemStack(Items.nether_wart), new ItemStack(Items.fish), new ItemStack(Items.quartz), new ItemStack(Items.golden_carrot)); - clearBrew = BotaniaAPI.registerBrewRecipe(ModBrews.clear, new ItemStack(Items.nether_wart), new ItemStack(Items.quartz), new ItemStack(Items.emerald), new ItemStack(Items.melon)); + overloadBrew = BotaniaAPI.registerBrewRecipe(ModBrews.overload, new ItemStack(Items.NETHER_WART), new ItemStack(Items.BLAZE_POWDER), new ItemStack(Items.SUGAR), new ItemStack(Items.GLOWSTONE_DUST), new ItemStack(ModItems.manaResource), new ItemStack(Items.SPIDER_EYE)); + soulCrossBrew = BotaniaAPI.registerBrewRecipe(ModBrews.soulCross, new ItemStack(Items.NETHER_WART), new ItemStack(Blocks.SOUL_SAND), new ItemStack(Items.PAPER), new ItemStack(Items.APPLE), new ItemStack(Items.BONE)); + featherFeetBrew = BotaniaAPI.registerBrewRecipe(ModBrews.featherfeet, new ItemStack(Items.NETHER_WART), new ItemStack(Items.FEATHER), new ItemStack(Items.LEATHER), new ItemStack(Blocks.WOOL, 1, -1)); + emptinessBrew = BotaniaAPI.registerBrewRecipe(ModBrews.emptiness, new ItemStack(Items.NETHER_WART), new ItemStack(Items.GUNPOWDER), new ItemStack(Items.ROTTEN_FLESH), new ItemStack(Items.BONE), new ItemStack(Items.STRING), new ItemStack(Items.ENDER_PEARL)); + bloodthirstBrew = BotaniaAPI.registerBrewRecipe(ModBrews.bloodthirst, new ItemStack(Items.NETHER_WART), new ItemStack(Items.FERMENTED_SPIDER_EYE), new ItemStack(Items.DYE, 1, 4), new ItemStack(Items.FIRE_CHARGE), new ItemStack(Items.IRON_INGOT)); + allureBrew = BotaniaAPI.registerBrewRecipe(ModBrews.allure, new ItemStack(Items.NETHER_WART), new ItemStack(Items.FISH), new ItemStack(Items.QUARTZ), new ItemStack(Items.GOLDEN_CARROT)); + clearBrew = BotaniaAPI.registerBrewRecipe(ModBrews.clear, new ItemStack(Items.NETHER_WART), new ItemStack(Items.QUARTZ), new ItemStack(Items.EMERALD), new ItemStack(Items.MELON)); } public static void initTC() { - Item resource = (Item) Item.itemRegistry.getObject("Thaumcraft:ItemResource"); - Item bathSalts = (Item) Item.itemRegistry.getObject("Thaumcraft:ItemBathSalts"); + Item salisMundus = Item.REGISTRY.getObject(new ResourceLocation("thaumcraft", "salis_mundus")); + Item bathSalts = Item.REGISTRY.getObject(new ResourceLocation("thaumcraft", "bath_salts")); + Item amber = Item.REGISTRY.getObject(new ResourceLocation("thaumcraft", "amber")); - warpWardBrew = BotaniaAPI.registerBrewRecipe(ModBrews.warpWard, new ItemStack(Items.nether_wart), new ItemStack(resource, 1, 14), new ItemStack(bathSalts), new ItemStack(resource, 1, 6)); + warpWardBrew = BotaniaAPI.registerBrewRecipe(ModBrews.warpWard, new ItemStack(Items.NETHER_WART), new ItemStack(salisMundus), new ItemStack(bathSalts), new ItemStack(amber)); } diff --git a/src/main/java/vazkii/botania/common/crafting/ModCraftingRecipes.java b/src/main/java/vazkii/botania/common/crafting/ModCraftingRecipes.java index 3a9a13b49..d8236f92e 100644 --- a/src/main/java/vazkii/botania/common/crafting/ModCraftingRecipes.java +++ b/src/main/java/vazkii/botania/common/crafting/ModCraftingRecipes.java @@ -10,42 +10,48 @@ */ package vazkii.botania.common.crafting; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - import net.minecraft.block.Block; +import net.minecraft.block.BlockDoublePlant; +import net.minecraft.block.BlockFlower; import net.minecraft.init.Blocks; import net.minecraft.init.Items; +import net.minecraft.item.EnumDyeColor; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.oredict.OreDictionary; +import net.minecraftforge.oredict.RecipeSorter; import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; - -import org.apache.logging.log4j.Level; - import vazkii.botania.api.BotaniaAPI; import vazkii.botania.common.Botania; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.ModFluffBlocks; import vazkii.botania.common.block.tile.TileCraftCrate; import vazkii.botania.common.core.handler.ConfigHandler; +import vazkii.botania.common.crafting.recipe.ArmorUpgradeRecipe; +import vazkii.botania.common.crafting.recipe.ManaUpgradeRecipe; +import vazkii.botania.common.crafting.recipe.ShapelessManaUpgradeRecipe; import vazkii.botania.common.item.ItemSignalFlare; import vazkii.botania.common.item.ItemTwigWand; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.lib.LibOreDict; -import cpw.mods.fml.common.FMLLog; -import cpw.mods.fml.common.registry.GameRegistry; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; public final class ModCraftingRecipes { public static IRecipe recipeLexicon; public static List recipesPetals; public static List recipesDyes; + public static List recipesDyesVanilla; public static List recipesPetalBlocks; + public static List recipesReversePetalBlocks; public static IRecipe recipePestleAndMortar; public static List recipesTwigWand; public static List recipesApothecary; @@ -161,11 +167,6 @@ public final class ModCraftingRecipes { public static IRecipe recipeFireRod; public static IRecipe recipeVineBall; public static IRecipe recipeSlingshot; - public static IRecipe recipeMossStone; - public static IRecipe recipePrismarine; - public static IRecipe recipePrismarineBrick; - public static IRecipe recipeDarkPrismarine; - public static IRecipe recipeSeaLamp; public static IRecipe recipeLensInfluence; public static IRecipe recipeLensWeight; public static IRecipe recipeLensPaint; @@ -187,8 +188,6 @@ public final class ModCraftingRecipes { public static IRecipe recipeSpawnerClaw; public static IRecipe recipeCraftCrate; public static IRecipe recipePlaceholder; - public static IRecipe recipeReedBlock; - public static IRecipe recipeThatch; public static IRecipe recipeNetherBrick; public static IRecipe recipeSoulBrick; public static IRecipe recipeSnowBrick; @@ -246,10 +245,6 @@ public final class ModCraftingRecipes { public static IRecipe recipeCorporeaIndex; public static IRecipe recipeCorporeaFunnel; public static IRecipe recipeCorporeaInterceptor; - public static IRecipe recipeEndStoneBricks; - public static IRecipe recipeEndStoneChiseledBricks; - public static IRecipe recipeEnderBricks; - public static IRecipe recipePillarEnderBricks; public static IRecipe recipeLivingwoodBow; public static IRecipe recipeCrystalBow; public static List recipesCosmeticItems; @@ -263,8 +258,6 @@ public final class ModCraftingRecipes { public static List recipesPetalsDouble; public static IRecipe recipeKeepIvy; public static IRecipe recipeBlackHoleTalisman; - public static List recipe18StonePolish; - public static List recipe18StoneBrick; public static List recipe18StoneChisel; public static IRecipe recipeBlazeBlock; public static List recipesAltarMeta; @@ -323,7 +316,7 @@ public final class ModCraftingRecipes { int recipeListSize = CraftingManager.getInstance().getRecipeList().size(); // Lexicon Recipe - addShapelessOreDictRecipe(new ItemStack(ModItems.lexicon), "treeSapling", Items.book); + addShapelessOreDictRecipe(new ItemStack(ModItems.lexicon), "treeSapling", Items.BOOK); recipeLexicon = BotaniaAPI.getLatestAddedRecipe(); // Petal/Dye Recipes @@ -335,6 +328,23 @@ public final class ModCraftingRecipes { addShapelessOreDictRecipe(new ItemStack(ModItems.dye, 1, i), LibOreDict.PETAL[i], LibOreDict.PESTLE_AND_MORTAR); recipesDyes = BotaniaAPI.getLatestAddedRecipes(16); + // Vanilla flowers + mortar and pestle to dye + GameRegistry.addShapelessRecipe(new ItemStack(ModItems.dye, 1, EnumDyeColor.YELLOW.getMetadata()), new ItemStack(ModItems.pestleAndMortar), new ItemStack(Blocks.YELLOW_FLOWER, 1, BlockFlower.EnumFlowerType.DANDELION.getMeta())); + GameRegistry.addShapelessRecipe(new ItemStack(ModItems.dye, 1, EnumDyeColor.RED.getMetadata()), new ItemStack(ModItems.pestleAndMortar), new ItemStack(Blocks.RED_FLOWER, 1, BlockFlower.EnumFlowerType.POPPY.getMeta())); + GameRegistry.addShapelessRecipe(new ItemStack(ModItems.dye, 1, EnumDyeColor.LIGHT_BLUE.getMetadata()), new ItemStack(ModItems.pestleAndMortar), new ItemStack(Blocks.RED_FLOWER, 1, BlockFlower.EnumFlowerType.BLUE_ORCHID.getMeta())); + GameRegistry.addShapelessRecipe(new ItemStack(ModItems.dye, 1, EnumDyeColor.MAGENTA.getMetadata()), new ItemStack(ModItems.pestleAndMortar), new ItemStack(Blocks.RED_FLOWER, 1, BlockFlower.EnumFlowerType.ALLIUM.getMeta())); + GameRegistry.addShapelessRecipe(new ItemStack(ModItems.dye, 1, EnumDyeColor.SILVER.getMetadata()), new ItemStack(ModItems.pestleAndMortar), new ItemStack(Blocks.RED_FLOWER, 1, BlockFlower.EnumFlowerType.HOUSTONIA.getMeta())); + GameRegistry.addShapelessRecipe(new ItemStack(ModItems.dye, 1, EnumDyeColor.RED.getMetadata()), new ItemStack(ModItems.pestleAndMortar), new ItemStack(Blocks.RED_FLOWER, 1, BlockFlower.EnumFlowerType.RED_TULIP.getMeta())); + GameRegistry.addShapelessRecipe(new ItemStack(ModItems.dye, 1, EnumDyeColor.ORANGE.getMetadata()), new ItemStack(ModItems.pestleAndMortar), new ItemStack(Blocks.RED_FLOWER, 1, BlockFlower.EnumFlowerType.ORANGE_TULIP.getMeta())); + GameRegistry.addShapelessRecipe(new ItemStack(ModItems.dye, 1, EnumDyeColor.SILVER.getMetadata()), new ItemStack(ModItems.pestleAndMortar), new ItemStack(Blocks.RED_FLOWER, 1, BlockFlower.EnumFlowerType.WHITE_TULIP.getMeta())); + GameRegistry.addShapelessRecipe(new ItemStack(ModItems.dye, 1, EnumDyeColor.PINK.getMetadata()), new ItemStack(ModItems.pestleAndMortar), new ItemStack(Blocks.RED_FLOWER, 1, BlockFlower.EnumFlowerType.PINK_TULIP.getMeta())); + GameRegistry.addShapelessRecipe(new ItemStack(ModItems.dye, 1, EnumDyeColor.SILVER.getMetadata()), new ItemStack(ModItems.pestleAndMortar), new ItemStack(Blocks.RED_FLOWER, 1, BlockFlower.EnumFlowerType.OXEYE_DAISY.getMeta())); + GameRegistry.addShapelessRecipe(new ItemStack(ModItems.dye, 2, EnumDyeColor.YELLOW.getMetadata()), new ItemStack(ModItems.pestleAndMortar), new ItemStack(Blocks.DOUBLE_PLANT, 1, BlockDoublePlant.EnumPlantType.SUNFLOWER.getMeta())); + GameRegistry.addShapelessRecipe(new ItemStack(ModItems.dye, 2, EnumDyeColor.MAGENTA.getMetadata()), new ItemStack(ModItems.pestleAndMortar), new ItemStack(Blocks.DOUBLE_PLANT, 1, BlockDoublePlant.EnumPlantType.SYRINGA.getMeta())); + GameRegistry.addShapelessRecipe(new ItemStack(ModItems.dye, 2, EnumDyeColor.RED.getMetadata()), new ItemStack(ModItems.pestleAndMortar), new ItemStack(Blocks.DOUBLE_PLANT, 1, BlockDoublePlant.EnumPlantType.ROSE.getMeta())); + GameRegistry.addShapelessRecipe(new ItemStack(ModItems.dye, 2, EnumDyeColor.PINK.getMetadata()), new ItemStack(ModItems.pestleAndMortar), new ItemStack(Blocks.DOUBLE_PLANT, 1, BlockDoublePlant.EnumPlantType.PAEONIA.getMeta())); + recipesDyesVanilla = BotaniaAPI.getLatestAddedRecipes(14); + // Petal Block Recipes for(int i = 0; i < 16; i++) addOreDictRecipe(new ItemStack(ModBlocks.petalBlock, 1, i), @@ -342,12 +352,17 @@ public final class ModCraftingRecipes { 'P', LibOreDict.PETAL[i]); recipesPetalBlocks = BotaniaAPI.getLatestAddedRecipes(16); + // Reverse Petal Block + for(int i = 0; i < 16; i++) + GameRegistry.addShapelessRecipe(new ItemStack(ModItems.petal, 9, i), new ItemStack(ModBlocks.petalBlock, 1, i)); + recipesReversePetalBlocks = BotaniaAPI.getLatestAddedRecipes(16); + // Pestle and Mortar Recipe addOreDictRecipe(new ItemStack(ModItems.pestleAndMortar), " S", "W ", "B ", 'S', "stickWood", 'W', "plankWood", - 'B', Items.bowl); + 'B', Items.BOWL); recipePestleAndMortar = BotaniaAPI.getLatestAddedRecipe(); // Wand of the Forest Recipes @@ -440,7 +455,7 @@ public final class ModCraftingRecipes { addOreDictRecipe(new ItemStack(ModItems.lens, 1, 7), " P ", "ALA", " R ", - 'P', new ItemStack(Blocks.piston), + 'P', new ItemStack(Blocks.PISTON), 'R', "dustRedstone", 'A', "gemLapis", 'L', new ItemStack(ModItems.lens)); @@ -462,9 +477,9 @@ public final class ModCraftingRecipes { for(int i = 0; i < 16; i++) addOreDictRecipe(new ItemStack(ModBlocks.unstableBlock, 2, i), "OPO", "PMP", "OPO", - 'O', new ItemStack(Blocks.obsidian), + 'O', new ItemStack(Blocks.OBSIDIAN), 'P', LibOreDict.PETAL[i], - 'M', new ItemStack(Items.ender_pearl)); + 'M', new ItemStack(Items.ENDER_PEARL)); recipesUnstableBlocks = BotaniaAPI.getLatestAddedRecipes(16); // Mana Pylon Recipe @@ -487,7 +502,7 @@ public final class ModCraftingRecipes { "RR", "RR", 'R', LibOreDict.LIVING_ROCK); recipeLivingrockDecor1 = BotaniaAPI.getLatestAddedRecipe(); - addShapelessOreDictRecipe(new ItemStack(ModBlocks.livingrock, 1, 2), new ItemStack(ModBlocks.livingrock, 1, 1), new ItemStack(Items.wheat_seeds)); + addShapelessOreDictRecipe(new ItemStack(ModBlocks.livingrock, 1, 2), new ItemStack(ModBlocks.livingrock, 1, 1), new ItemStack(Items.WHEAT_SEEDS)); recipeLivingrockDecor2 = BotaniaAPI.getLatestAddedRecipe(); addShapelessOreDictRecipe(new ItemStack(ModBlocks.livingrock, 2, 3), new ItemStack(ModBlocks.livingrock, 1, 1), "cobblestone"); recipeLivingrockDecor3 = BotaniaAPI.getLatestAddedRecipe(); @@ -499,7 +514,7 @@ public final class ModCraftingRecipes { // Livingwood Decorative Blocks addShapelessOreDictRecipe(new ItemStack(ModBlocks.livingwood, 4, 1), LibOreDict.LIVING_WOOD); recipeLivingwoodDecor1 = BotaniaAPI.getLatestAddedRecipe(); - addShapelessOreDictRecipe(new ItemStack(ModBlocks.livingwood, 1, 2), new ItemStack(ModBlocks.livingwood, 1, 1), new ItemStack(Items.wheat_seeds)); + addShapelessOreDictRecipe(new ItemStack(ModBlocks.livingwood, 1, 2), new ItemStack(ModBlocks.livingwood, 1, 1), new ItemStack(Items.WHEAT_SEEDS)); recipeLivingwoodDecor2 = BotaniaAPI.getLatestAddedRecipe(); addOreDictRecipe(new ItemStack(ModBlocks.livingwood, 4, 3), "WW", "WW", @@ -514,7 +529,7 @@ public final class ModCraftingRecipes { // Dreamwood Decorative Blocks addShapelessOreDictRecipe(new ItemStack(ModBlocks.dreamwood, 4, 1), LibOreDict.DREAM_WOOD); - addShapelessOreDictRecipe(new ItemStack(ModBlocks.dreamwood, 1, 2), new ItemStack(ModBlocks.dreamwood, 1, 1), new ItemStack(Items.wheat_seeds)); + addShapelessOreDictRecipe(new ItemStack(ModBlocks.dreamwood, 1, 2), new ItemStack(ModBlocks.dreamwood, 1, 1), new ItemStack(Items.WHEAT_SEEDS)); addOreDictRecipe(new ItemStack(ModBlocks.dreamwood, 4, 3), "WW", "WW", 'W', new ItemStack(ModBlocks.dreamwood, 1, 1)); @@ -544,7 +559,7 @@ public final class ModCraftingRecipes { addOreDictRecipe(new ItemStack(ModBlocks.manaVoid), "SSS", "O O", "SSS", 'S', LibOreDict.LIVING_ROCK, - 'O', new ItemStack(Blocks.obsidian)); + 'O', new ItemStack(Blocks.OBSIDIAN)); recipeManaVoid = BotaniaAPI.getLatestAddedRecipe(); // Mana Tablet Recipe @@ -562,7 +577,7 @@ public final class ModCraftingRecipes { addOreDictRecipe(new ItemStack(ModBlocks.manaDetector), "RSR", "SCS", "RSR", 'R', "dustRedstone", - 'C', new ItemStack(Items.comparator), + 'C', new ItemStack(Items.COMPARATOR), 'S', LibOreDict.LIVING_ROCK); recipeManaDetector = BotaniaAPI.getLatestAddedRecipe(); @@ -572,7 +587,7 @@ public final class ModCraftingRecipes { 'S', new ItemStack(ModBlocks.spreader, 1, 1), 'M', LibOreDict.RUNE[8], 'D', LibOreDict.MANA_DIAMOND, - 'T', new ItemStack(Blocks.tnt), + 'T', new ItemStack(Blocks.TNT), 'W', LibOreDict.LIVING_WOOD); recipeManaBlaster = BotaniaAPI.getLatestAddedRecipe(); @@ -580,13 +595,13 @@ public final class ModCraftingRecipes { addOreDictRecipe(new ItemStack(ModBlocks.turntable), "WWW", "WPW", "WWW", 'W', LibOreDict.LIVING_WOOD, - 'P', Blocks.sticky_piston); + 'P', Blocks.STICKY_PISTON); recipeTurntable = BotaniaAPI.getLatestAddedRecipe(); // Fertilizer Recipes - GameRegistry.addShapelessRecipe(new ItemStack(ModItems.fertilizer, Botania.gardenOfGlassLoaded ? 3 : 1), new ItemStack(Items.dye, 1, 15), new ItemStack(ModItems.dye, 1, Short.MAX_VALUE), new ItemStack(ModItems.dye, 1, Short.MAX_VALUE), new ItemStack(ModItems.dye, 1, Short.MAX_VALUE), new ItemStack(ModItems.dye, 1, Short.MAX_VALUE)); + GameRegistry.addShapelessRecipe(new ItemStack(ModItems.fertilizer, Botania.gardenOfGlassLoaded ? 3 : 1), new ItemStack(Items.DYE, 1, 15), new ItemStack(ModItems.dye, 1, Short.MAX_VALUE), new ItemStack(ModItems.dye, 1, Short.MAX_VALUE), new ItemStack(ModItems.dye, 1, Short.MAX_VALUE), new ItemStack(ModItems.dye, 1, Short.MAX_VALUE)); recipeFertilizerPowder = BotaniaAPI.getLatestAddedRecipe(); - GameRegistry.addShapelessRecipe(new ItemStack(ModItems.fertilizer), new ItemStack(Items.dye, 1, 15), new ItemStack(Items.dye, 1, 11), new ItemStack(Items.dye, 1, 11), new ItemStack(Items.dye, 1, 1), new ItemStack(Items.dye, 1, 1)); + GameRegistry.addShapelessRecipe(new ItemStack(ModItems.fertilizer), new ItemStack(Items.DYE, 1, 15), new ItemStack(Items.DYE, 1, 11), new ItemStack(Items.DYE, 1, 11), new ItemStack(Items.DYE, 1, 1), new ItemStack(Items.DYE, 1, 1)); recipeFerilizerDye = BotaniaAPI.getLatestAddedRecipe(); // Livingwood Twig Recipe @@ -598,7 +613,7 @@ public final class ModCraftingRecipes { // Rod of the Lands Recipe addOreDictRecipe(new ItemStack(ModItems.dirtRod), " D", " T ", "E ", - 'D', new ItemStack(Blocks.dirt), + 'D', new ItemStack(Blocks.DIRT), 'T', LibOreDict.LIVINGWOOD_TWIG, 'E', LibOreDict.RUNE[2]); recipeDirtRod = BotaniaAPI.getLatestAddedRecipe(); @@ -680,39 +695,40 @@ public final class ModCraftingRecipes { recipeGrassHorn = BotaniaAPI.getLatestAddedRecipe(); // Terrasteel Armor Recipes - addOreDictRecipe(new ItemStack(ModItems.terrasteelHelmRevealing), + RecipeSorter.register("botania:armorUpgrade", ArmorUpgradeRecipe.class, RecipeSorter.Category.SHAPED, ""); + GameRegistry.addRecipe(new ArmorUpgradeRecipe(new ItemStack(ModItems.terrasteelHelmRevealing), "TRT", "SAS", " S ", 'T', LibOreDict.LIVINGWOOD_TWIG, 'S', LibOreDict.TERRA_STEEL, 'R', LibOreDict.RUNE[4], - 'A', new ItemStack(ModItems.manasteelHelmRevealing)); - addOreDictRecipe(new ItemStack(ModItems.terrasteelHelm), + 'A', new ItemStack(ModItems.manasteelHelmRevealing))); + GameRegistry.addRecipe(new ArmorUpgradeRecipe(new ItemStack(ModItems.terrasteelHelm), "TRT", "SAS", " S ", 'T', LibOreDict.LIVINGWOOD_TWIG, 'S', LibOreDict.TERRA_STEEL, 'R', LibOreDict.RUNE[4], - 'A', new ItemStack(ModItems.manasteelHelm)); + 'A', new ItemStack(ModItems.manasteelHelm))); recipeTerrasteelHelm = BotaniaAPI.getLatestAddedRecipe(); - addOreDictRecipe(new ItemStack(ModItems.terrasteelChest), + GameRegistry.addRecipe(new ArmorUpgradeRecipe(new ItemStack(ModItems.terrasteelChest), "TRT", "SAS", " S ", 'T', LibOreDict.LIVINGWOOD_TWIG, 'S', LibOreDict.TERRA_STEEL, 'R', LibOreDict.RUNE[5], - 'A', new ItemStack(ModItems.manasteelChest)); + 'A', new ItemStack(ModItems.manasteelChest))); recipeTerrasteelChest = BotaniaAPI.getLatestAddedRecipe(); - addOreDictRecipe(new ItemStack(ModItems.terrasteelLegs), + GameRegistry.addRecipe(new ArmorUpgradeRecipe(new ItemStack(ModItems.terrasteelLegs), "TRT", "SAS", " S ", 'T', LibOreDict.LIVINGWOOD_TWIG, 'S', LibOreDict.TERRA_STEEL, 'R', LibOreDict.RUNE[6], - 'A', new ItemStack(ModItems.manasteelLegs)); + 'A', new ItemStack(ModItems.manasteelLegs))); recipeTerrasteelLegs = BotaniaAPI.getLatestAddedRecipe(); - addOreDictRecipe(new ItemStack(ModItems.terrasteelBoots), + GameRegistry.addRecipe(new ArmorUpgradeRecipe(new ItemStack(ModItems.terrasteelBoots), "TRT", "SAS", " S ", 'T', LibOreDict.LIVINGWOOD_TWIG, 'S', LibOreDict.TERRA_STEEL, 'R', LibOreDict.RUNE[7], - 'A', new ItemStack(ModItems.manasteelBoots)); + 'A', new ItemStack(ModItems.manasteelBoots))); recipeTerrasteelBoots = BotaniaAPI.getLatestAddedRecipe(); // Terra Blade Recipe @@ -731,10 +747,11 @@ public final class ModCraftingRecipes { recipeTinyPlanet = BotaniaAPI.getLatestAddedRecipe(); // Mana Band Recipe - addOreDictRecipe(new ItemStack(ModItems.manaRing), + RecipeSorter.register("botania:manaUpgrade", ManaUpgradeRecipe.class, RecipeSorter.Category.SHAPED, ""); + GameRegistry.addRecipe(new ManaUpgradeRecipe(new ItemStack(ModItems.manaRing), "TI ", "I I", " I ", 'T', new ItemStack(ModItems.manaTablet, 1, Short.MAX_VALUE), - 'I', LibOreDict.MANA_STEEL); + 'I', LibOreDict.MANA_STEEL)); recipeManaRing = BotaniaAPI.getLatestAddedRecipe(); // Aura Band Recipe @@ -745,7 +762,8 @@ public final class ModCraftingRecipes { recipeAuraRing = BotaniaAPI.getLatestAddedRecipe(); // Greater Mana Band Recipe - addShapelessOreDictRecipe(new ItemStack(ModItems.manaRingGreater), LibOreDict.TERRA_STEEL, new ItemStack(ModItems.manaRing)); + RecipeSorter.register("botania:manaUpgradeShapeless", ShapelessManaUpgradeRecipe.class, RecipeSorter.Category.SHAPELESS, ""); + GameRegistry.addRecipe(new ShapelessManaUpgradeRecipe(new ItemStack(ModItems.manaRingGreater), LibOreDict.TERRA_STEEL, new ItemStack(ModItems.manaRing, 1, Short.MAX_VALUE))); recipeGreaterManaRing = BotaniaAPI.getLatestAddedRecipe(); // Greater Aura Band Recipe @@ -758,7 +776,7 @@ public final class ModCraftingRecipes { 'E', LibOreDict.RUNE[2], 'A', LibOreDict.RUNE[3], 'S', LibOreDict.MANA_STEEL, - 'L', new ItemStack(Items.leather)); + 'L', new ItemStack(Items.LEATHER)); recipeTravelBelt = BotaniaAPI.getLatestAddedRecipe(); // Tectonic Girdle Recipe @@ -767,13 +785,13 @@ public final class ModCraftingRecipes { 'E', LibOreDict.RUNE[2], 'A', LibOreDict.RUNE[1], 'S', LibOreDict.MANA_STEEL, - 'L', new ItemStack(Items.leather)); + 'L', new ItemStack(Items.LEATHER)); recipeKnocbackBelt = BotaniaAPI.getLatestAddedRecipe(); // Snowflake Pendant Recipe addOreDictRecipe(new ItemStack(ModItems.icePendant), "WS ", "S S", "MSR", - 'S', new ItemStack(Items.string), + 'S', new ItemStack(Items.STRING), 'M', LibOreDict.MANA_STEEL, 'R', LibOreDict.RUNE[0], 'W', LibOreDict.RUNE[7]); @@ -782,7 +800,7 @@ public final class ModCraftingRecipes { // Pyroclast Pendant Recipe addOreDictRecipe(new ItemStack(ModItems.lavaPendant), "MS ", "S S", "DSF", - 'S', new ItemStack(Items.string), + 'S', new ItemStack(Items.STRING), 'D', LibOreDict.MANA_STEEL, 'M', LibOreDict.RUNE[5], 'F', LibOreDict.RUNE[1]); @@ -808,7 +826,7 @@ public final class ModCraftingRecipes { "SGS", "BPB", "SGS", 'S', LibOreDict.LIVING_ROCK, 'G', "ingotGold", - 'B', new ItemStack(Items.brewing_stand), + 'B', new ItemStack(Items.BREWING_STAND), 'P', LibOreDict.MANA_PEARL); recipeAlchemyCatalyst = BotaniaAPI.getLatestAddedRecipe(); @@ -823,18 +841,18 @@ public final class ModCraftingRecipes { "MSM", "SES", "MSM", 'M', LibOreDict.MANA_STEEL, 'S', LibOreDict.LIVING_ROCK, - 'E', new ItemStack(Items.ender_eye)); + 'E', new ItemStack(Items.ENDER_EYE)); recipeForestEye = BotaniaAPI.getLatestAddedRecipe(); // Redstone Root Recipe - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.manaResource, 1, 6), "dustRedstone", new ItemStack(Blocks.tallgrass, 1, 1))); + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.manaResource, 1, 6), "dustRedstone", new ItemStack(Blocks.TALLGRASS, 1, 1))); recipeRedstoneRoot = BotaniaAPI.getLatestAddedRecipe(); // Drum of the Wild Recipe addOreDictRecipe(new ItemStack(ModBlocks.forestDrum), "WLW", "WHW", "WLW", 'W', LibOreDict.LIVING_WOOD, - 'L', new ItemStack(Items.leather), + 'L', new ItemStack(Items.LEATHER), 'H', new ItemStack(ModItems.grassHorn)); recipeForestDrum = BotaniaAPI.getLatestAddedRecipe(); @@ -843,8 +861,8 @@ public final class ModCraftingRecipes { "WMP", "M M", "SM ", 'W', LibOreDict.RUNE[0], 'M', LibOreDict.MANA_STEEL, - 'P', new ItemStack(Items.fish, 1, 3), - 'S', new ItemStack(Items.fish, 1, 1)); + 'P', new ItemStack(Items.FISH, 1, 3), + 'S', new ItemStack(Items.FISH, 1, 1)); recipeWaterRing = BotaniaAPI.getLatestAddedRecipe(); // Ring of the Mantle Recipe @@ -852,7 +870,7 @@ public final class ModCraftingRecipes { "EMP", "M M", " M ", 'E', LibOreDict.RUNE[2], 'M', LibOreDict.MANA_STEEL, - 'P', new ItemStack(Items.golden_pickaxe)); + 'P', new ItemStack(Items.GOLDEN_PICKAXE)); recipeMiningRing = BotaniaAPI.getLatestAddedRecipe(); // Ring of Magnetization Recipe @@ -863,11 +881,11 @@ public final class ModCraftingRecipes { recipeMagnetRing = BotaniaAPI.getLatestAddedRecipe(); // Terra Shatterer Recipe - addOreDictRecipe(new ItemStack(ModItems.terraPick), + GameRegistry.addRecipe(new ManaUpgradeRecipe(new ItemStack(ModItems.terraPick), "ITI", "ILI", " L ", 'T', new ItemStack(ModItems.manaTablet, 1, Short.MAX_VALUE), 'I', LibOreDict.TERRA_STEEL, - 'L', LibOreDict.LIVINGWOOD_TWIG); + 'L', LibOreDict.LIVINGWOOD_TWIG)); recipeTerraPick = BotaniaAPI.getLatestAddedRecipe(); // Charm of the Diva Recipe @@ -884,7 +902,7 @@ public final class ModCraftingRecipes { "LLL", "ILI", "FEF", 'L', LibOreDict.LIFE_ESSENCE, 'I', LibOreDict.ELEMENTIUM, - 'F', new ItemStack(Items.feather), + 'F', new ItemStack(Items.FEATHER), 'E', LibOreDict.ENDER_AIR_BOTTLE); recipeFlightTiara = BotaniaAPI.getLatestAddedRecipe(); @@ -912,33 +930,33 @@ public final class ModCraftingRecipes { // Quartz Recipes if(ConfigHandler.darkQuartzEnabled) - recipeDarkQuartz = addQuartzRecipes(0, Items.coal, ModFluffBlocks.darkQuartz, ModFluffBlocks.darkQuartzStairs, ModFluffBlocks.darkQuartzSlab); + recipeDarkQuartz = addQuartzRecipes(0, Items.COAL, ModFluffBlocks.darkQuartz, ModFluffBlocks.darkQuartzStairs, ModFluffBlocks.darkQuartzSlab); addQuartzRecipes(1, null, ModFluffBlocks.manaQuartz, ModFluffBlocks.manaQuartzStairs, ModFluffBlocks.manaQuartzSlab); - recipeBlazeQuartz = addQuartzRecipes(2, Items.blaze_powder, ModFluffBlocks.blazeQuartz, ModFluffBlocks.blazeQuartzStairs, ModFluffBlocks.blazeQuartzSlab); + recipeBlazeQuartz = addQuartzRecipes(2, Items.BLAZE_POWDER, ModFluffBlocks.blazeQuartz, ModFluffBlocks.blazeQuartzStairs, ModFluffBlocks.blazeQuartzSlab); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.quartz, 8, 3), "QQQ", "QCQ", "QQQ", 'Q', "gemQuartz", - 'C', new ItemStack(Blocks.red_flower, 1, 2))); + 'C', new ItemStack(Blocks.RED_FLOWER, 1, 2))); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.quartz, 8, 3), "QQQ", "QCQ", "QQQ", 'Q', "gemQuartz", - 'C', new ItemStack(Blocks.red_flower, 1, 7))); + 'C', new ItemStack(Blocks.RED_FLOWER, 1, 7))); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.quartz, 8, 3), "QQQ", "QCQ", "QQQ", 'Q', "gemQuartz", - 'C', new ItemStack(Blocks.double_plant, 1, 1))); + 'C', new ItemStack(Blocks.DOUBLE_PLANT, 1, 1))); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.quartz, 8, 3), "QQQ", "QCQ", "QQQ", 'Q', "gemQuartz", - 'C', new ItemStack(Blocks.double_plant, 1, 5))); + 'C', new ItemStack(Blocks.DOUBLE_PLANT, 1, 5))); recipesLavenderQuartz = BotaniaAPI.getLatestAddedRecipes(4); addQuartzRecipes(3, null, ModFluffBlocks.lavenderQuartz, ModFluffBlocks.lavenderQuartzStairs, ModFluffBlocks.lavenderQuartzSlab); - recipeRedQuartz = addQuartzRecipes(4, Items.redstone, ModFluffBlocks.redQuartz, ModFluffBlocks.redQuartzStairs, ModFluffBlocks.redQuartzSlab); + recipeRedQuartz = addQuartzRecipes(4, Items.REDSTONE, ModFluffBlocks.redQuartz, ModFluffBlocks.redQuartzStairs, ModFluffBlocks.redQuartzSlab); addQuartzRecipes(5, null, ModFluffBlocks.elfQuartz, ModFluffBlocks.elfQuartzStairs, ModFluffBlocks.elfQuartzSlab); - recipeSunnyQuartz = addQuartzRecipes(6, Item.getItemFromBlock(Blocks.double_plant), ModFluffBlocks.sunnyQuartz, ModFluffBlocks.sunnyQuartzStairs, ModFluffBlocks.sunnyQuartzSlab); + recipeSunnyQuartz = addQuartzRecipes(6, Item.getItemFromBlock(Blocks.DOUBLE_PLANT), ModFluffBlocks.sunnyQuartz, ModFluffBlocks.sunnyQuartzStairs, ModFluffBlocks.sunnyQuartzSlab); // Alfheim Portal Recipe addOreDictRecipe(new ItemStack(ModBlocks.alfPortal), @@ -952,13 +970,13 @@ public final class ModCraftingRecipes { " T ", "TPT", " E ", 'T', LibOreDict.TERRASTEEL_NUGGET, 'P', new ItemStack(ModBlocks.pylon), - 'E', new ItemStack(Items.ender_eye)); + 'E', new ItemStack(Items.ENDER_EYE)); recipeNaturaPylon = BotaniaAPI.getLatestAddedRecipe(); // Rod of the Seas Recipe addOreDictRecipe(new ItemStack(ModItems.waterRod), " B", " T ", "R ", - 'B', new ItemStack(Items.potionitem), + 'B', new ItemStack(Items.POTIONITEM), 'T', LibOreDict.LIVINGWOOD_TWIG, 'R', LibOreDict.RUNE[0]); recipeWaterRod = BotaniaAPI.getLatestAddedRecipe(); @@ -1073,7 +1091,7 @@ public final class ModCraftingRecipes { // Rod of the Skies Recipe addOreDictRecipe(new ItemStack(ModItems.tornadoRod), " F", " T ", "R ", - 'F', new ItemStack(Items.feather), + 'F', new ItemStack(Items.FEATHER), 'T', LibOreDict.LIVINGWOOD_TWIG, 'R', LibOreDict.RUNE[3]); recipeTornadoRod = BotaniaAPI.getLatestAddedRecipe(); @@ -1081,7 +1099,7 @@ public final class ModCraftingRecipes { // Rod of the Hells Recipe addOreDictRecipe(new ItemStack(ModItems.fireRod), " F", " T ", "R ", - 'F', new ItemStack(Items.blaze_powder), + 'F', new ItemStack(Items.BLAZE_POWDER), 'T', LibOreDict.LIVINGWOOD_TWIG, 'R', LibOreDict.RUNE[1]); recipeFireRod = BotaniaAPI.getLatestAddedRecipe(); @@ -1089,7 +1107,7 @@ public final class ModCraftingRecipes { // Vine Ball Recipe addOreDictRecipe(new ItemStack(ModItems.vineBall), "VVV", "VVV", "VVV", - 'V', new ItemStack(Blocks.vine)); + 'V', new ItemStack(Blocks.VINE)); recipeVineBall = BotaniaAPI.getLatestAddedRecipe(); // Livingwood Slingshot Recipe @@ -1099,38 +1117,6 @@ public final class ModCraftingRecipes { 'A', LibOreDict.RUNE[3]); recipeSlingshot = BotaniaAPI.getLatestAddedRecipe(); - // Moss Stone Recipe - addShapelessOreDictRecipe(new ItemStack(Blocks.mossy_cobblestone), "cobblestone", new ItemStack(ModItems.vineBall)); - recipeMossStone = BotaniaAPI.getLatestAddedRecipe(); - - // Prismarine Recipe - addOreDictRecipe(new ItemStack(ModBlocks.prismarine, 1, 0), - " S ", "SBS", " S ", - 'S', LibOreDict.PRISMARINE_SHARD, - 'B', "cobblestone"); - recipePrismarine = BotaniaAPI.getLatestAddedRecipe(); - - // Prismarine Brick Recipe - addOreDictRecipe(new ItemStack(ModBlocks.prismarine, 1, 1), - " S ", "SBS", " S ", - 'S', LibOreDict.PRISMARINE_SHARD, - 'B', new ItemStack(Blocks.stonebrick)); - recipePrismarineBrick = BotaniaAPI.getLatestAddedRecipe(); - - // Dark Prismarine Recipe - addOreDictRecipe(new ItemStack(ModBlocks.prismarine, 1, 2), - " S ", "SBS", " S ", - 'S', LibOreDict.PRISMARINE_SHARD, - 'B', new ItemStack(Blocks.nether_brick)); - recipeDarkPrismarine = BotaniaAPI.getLatestAddedRecipe(); - - // Sea Lantern Recipe - addOreDictRecipe(new ItemStack(ModBlocks.seaLamp), - " S ", "SBS", " S ", - 'S', LibOreDict.PRISMARINE_SHARD, - 'B', "glowstone"); - recipeSeaLamp = BotaniaAPI.getLatestAddedRecipe(); - // Influence Lens Recipe addOreDictRecipe(new ItemStack(ModItems.lens, 1, 12), "PRP", "PLP", "PPP", @@ -1151,7 +1137,7 @@ public final class ModCraftingRecipes { addOreDictRecipe(new ItemStack(ModItems.lens, 1, 14), " E ", "WLW", " E ", 'E', LibOreDict.ELEMENTIUM, - 'W', new ItemStack(Blocks.wool, 1, Short.MAX_VALUE), + 'W', new ItemStack(Blocks.WOOL, 1, Short.MAX_VALUE), 'L', new ItemStack(ModItems.lens)); recipeLensPaint = BotaniaAPI.getLatestAddedRecipe(); @@ -1164,7 +1150,7 @@ public final class ModCraftingRecipes { recipeLensRedirect = BotaniaAPI.getLatestAddedRecipe(); // Celebratory Lens Recipe - addShapelessOreDictRecipe(new ItemStack(ModItems.lens, 1, 20), new ItemStack(ModItems.lens), new ItemStack(Items.fireworks), LibOreDict.ELEMENTIUM); + addShapelessOreDictRecipe(new ItemStack(ModItems.lens, 1, 20), new ItemStack(ModItems.lens), new ItemStack(Items.FIREWORKS), LibOreDict.ELEMENTIUM); recipeLensFirework = BotaniaAPI.getLatestAddedRecipe(); // Flare Lens Recipe @@ -1177,7 +1163,7 @@ public final class ModCraftingRecipes { "F", "S", "D", 'F', new ItemStack(ModBlocks.shinyFlower, 1, i), 'S', new ItemStack(ModItems.grassSeeds), - 'D', new ItemStack(Blocks.dirt)); + 'D', new ItemStack(Blocks.DIRT)); recipesMiniIsland = BotaniaAPI.getLatestAddedRecipes(16); // Gaia Pylon Recipe @@ -1192,12 +1178,12 @@ public final class ModCraftingRecipes { addOreDictRecipe(new ItemStack(ModBlocks.forestDrum, 1, 1), "WLW", "WEW", "WLW", 'W', LibOreDict.DREAM_WOOD, - 'L', new ItemStack(Items.leather), + 'L', new ItemStack(Items.LEATHER), 'E', LibOreDict.ELEMENTIUM); recipeGatherDrum = BotaniaAPI.getLatestAddedRecipe(); // Mana Lens: Kindle Recipe - addShapelessOreDictRecipe(new ItemStack(ModItems.lens, 1, 15), new ItemStack(ModItems.lens), new ItemStack(Items.fire_charge)); + addShapelessOreDictRecipe(new ItemStack(ModItems.lens, 1, 15), new ItemStack(ModItems.lens), new ItemStack(Items.FIRE_CHARGE)); recipeLensFire = BotaniaAPI.getLatestAddedRecipe(); // Mana Lens: Piston Recipe @@ -1221,11 +1207,11 @@ public final class ModCraftingRecipes { recipesLaputaShardUpgrade = BotaniaAPI.getLatestAddedRecipes(19); // Necrodermal Virus Recipe - addShapelessOreDictRecipe(new ItemStack(ModItems.virus), LibOreDict.PIXIE_DUST, new ItemStack(ModItems.vineBall), new ItemStack(Items.magma_cream), new ItemStack(Items.fermented_spider_eye), new ItemStack(Items.ender_eye), new ItemStack(Items.skull, 1, 2)); + addShapelessOreDictRecipe(new ItemStack(ModItems.virus), LibOreDict.PIXIE_DUST, new ItemStack(ModItems.vineBall), new ItemStack(Items.MAGMA_CREAM), new ItemStack(Items.FERMENTED_SPIDER_EYE), new ItemStack(Items.ENDER_EYE), new ItemStack(Items.SKULL, 1, 2)); recipeVirusZombie = BotaniaAPI.getLatestAddedRecipe(); // Nullodermal Virus Recipe - addShapelessOreDictRecipe(new ItemStack(ModItems.virus, 1, 1), LibOreDict.PIXIE_DUST, new ItemStack(ModItems.vineBall), new ItemStack(Items.magma_cream), new ItemStack(Items.fermented_spider_eye), new ItemStack(Items.ender_eye), new ItemStack(Items.skull)); + addShapelessOreDictRecipe(new ItemStack(ModItems.virus, 1, 1), LibOreDict.PIXIE_DUST, new ItemStack(ModItems.vineBall), new ItemStack(Items.MAGMA_CREAM), new ItemStack(Items.FERMENTED_SPIDER_EYE), new ItemStack(Items.ENDER_EYE), new ItemStack(Items.SKULL)); recipeVirusSkeleton = BotaniaAPI.getLatestAddedRecipe(); // Ring of Far Reach Recipe @@ -1242,9 +1228,9 @@ public final class ModCraftingRecipes { // Life Imbuer Recipe addOreDictRecipe(new ItemStack(ModBlocks.spawnerClaw), "BSB", "PMP", "PEP", - 'B', new ItemStack(Items.blaze_rod), + 'B', new ItemStack(Items.BLAZE_ROD), 'S', LibOreDict.ELEMENTIUM, - 'P', new ItemStack(ModBlocks.prismarine, 1, 2), + 'P', new ItemStack(Blocks.PRISMARINE, 1, 2), 'M', new ItemStack(ModBlocks.storage), 'E', LibOreDict.ENDER_AIR_BOTTLE); recipeSpawnerClaw = BotaniaAPI.getLatestAddedRecipe(); @@ -1252,45 +1238,33 @@ public final class ModCraftingRecipes { // Crafty Crate Recipe GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.openCrate, 1, 1), "WCW", "W W", "W W", - 'C', "craftingTableWood", + 'C', "workbench", 'W', new ItemStack(ModBlocks.dreamwood, 1, 1))); recipeCraftCrate = BotaniaAPI.getLatestAddedRecipe(); // Crafting Placeholder Recipe - addShapelessOreDictRecipe(new ItemStack(ModItems.manaResource, 32, 11), "craftingTableWood", LibOreDict.LIVING_ROCK); + addShapelessOreDictRecipe(new ItemStack(ModItems.manaResource, 32, 11), "workbench", LibOreDict.LIVING_ROCK); recipePlaceholder = BotaniaAPI.getLatestAddedRecipe(); - // Reed Block Recipe - GameRegistry.addRecipe(new ItemStack(ModBlocks.reedBlock), - "rrr", "rrr", "rrr", - 'r', new ItemStack(Items.reeds)); - recipeReedBlock = BotaniaAPI.getLatestAddedRecipe(); - - // Thatch Recipe - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.thatch), - "ww", "ww", - 'w', "cropWheat")); - recipeThatch = BotaniaAPI.getLatestAddedRecipe(); - // Nether Brick Recipe GameRegistry.addRecipe(new ItemStack(ModBlocks.customBrick, 4, 0), " B ", "BSB", " B ", - 'B', new ItemStack(Blocks.netherrack), - 'S', new ItemStack(Blocks.stonebrick)); + 'B', new ItemStack(Blocks.NETHERRACK), + 'S', new ItemStack(Blocks.STONEBRICK)); recipeNetherBrick = BotaniaAPI.getLatestAddedRecipe(); // Soul Brick Recipe GameRegistry.addRecipe(new ItemStack(ModBlocks.customBrick, 4, 1), " B ", "BSB", " B ", - 'B', new ItemStack(Blocks.soul_sand), - 'S', new ItemStack(Blocks.stonebrick)); + 'B', new ItemStack(Blocks.SOUL_SAND), + 'S', new ItemStack(Blocks.STONEBRICK)); recipeSoulBrick = BotaniaAPI.getLatestAddedRecipe(); // Snow Brick Recipe GameRegistry.addRecipe(new ItemStack(ModBlocks.customBrick, 4, 2), " B ", "BSB", " B ", - 'B', new ItemStack(Blocks.snow), - 'S', new ItemStack(Blocks.stonebrick)); + 'B', new ItemStack(Blocks.SNOW), + 'S', new ItemStack(Blocks.STONEBRICK)); recipeSnowBrick = BotaniaAPI.getLatestAddedRecipe(); // Roof Tile Recipe @@ -1312,24 +1286,24 @@ public final class ModCraftingRecipes { GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.enderEye), "RER", "EOE", "RER", 'R', "dustRedstone", - 'E', new ItemStack(Items.ender_eye), - 'O', new ItemStack(Blocks.obsidian))); + 'E', new ItemStack(Items.ENDER_EYE), + 'O', new ItemStack(Blocks.OBSIDIAN))); recipeEnderEyeBlock = BotaniaAPI.getLatestAddedRecipe(); // The Spectator Recipe addOreDictRecipe(new ItemStack(ModItems.itemFinder), " I ", "IYI", "IEI", 'I', "ingotIron", - 'Y', new ItemStack(Items.ender_eye), + 'Y', new ItemStack(Items.ENDER_EYE), 'E', "gemEmerald"); recipeItemFinder = BotaniaAPI.getLatestAddedRecipe(); // Crimson Pendant Recipe addOreDictRecipe(new ItemStack(ModItems.superLavaPendant), "BBB", "BPB", "NGN", - 'B', new ItemStack(Items.blaze_rod), + 'B', new ItemStack(Items.BLAZE_ROD), 'P', new ItemStack(ModItems.lavaPendant), - 'N', new ItemStack(Blocks.nether_brick), + 'N', new ItemStack(Blocks.NETHER_BRICK), 'G', LibOreDict.LIFE_ESSENCE); recipeSuperLavaPendant = BotaniaAPI.getLatestAddedRecipe(); @@ -1337,9 +1311,9 @@ public final class ModCraftingRecipes { addOreDictRecipe(new ItemStack(ModItems.enderHand), "PLO", "LEL", "OL ", 'P', LibOreDict.MANA_PEARL, - 'L', new ItemStack(Items.leather), - 'E', new ItemStack(Blocks.ender_chest), - 'O', new ItemStack(Blocks.obsidian)); + 'L', new ItemStack(Items.LEATHER), + 'E', new ItemStack(Blocks.ENDER_CHEST), + 'O', new ItemStack(Blocks.OBSIDIAN)); recipeEnderHand = BotaniaAPI.getLatestAddedRecipe(); // Vitreous Pickaxe Recipe @@ -1355,14 +1329,14 @@ public final class ModCraftingRecipes { "EPE", "EOE", 'E', LibOreDict.ELEMENTIUM, 'P', LibOreDict.PIXIE_DUST, - 'O', new ItemStack(Blocks.obsidian)); + 'O', new ItemStack(Blocks.OBSIDIAN)); recipeStarfield = BotaniaAPI.getLatestAddedRecipe(); // Spark Recipe for(int i = 0; i < 16; i++) addOreDictRecipe(new ItemStack(ModItems.spark), " P ", "BNB", " P ", - 'B', new ItemStack(Items.blaze_powder), + 'B', new ItemStack(Items.BLAZE_POWDER), 'P', LibOreDict.PETAL[i], 'N', "nuggetGold"); recipesSpark = BotaniaAPI.getLatestAddedRecipes(16); @@ -1393,7 +1367,7 @@ public final class ModCraftingRecipes { recipeGravityRod = BotaniaAPI.getLatestAddedRecipe(); // Timeless Ivy Recipe - addShapelessOreDictRecipe(new ItemStack(ModItems.regenIvy), new ItemStack(Blocks.vine), LibOreDict.LIFE_ESSENCE, LibOreDict.ELEMENTIUM); + addShapelessOreDictRecipe(new ItemStack(ModItems.regenIvy), new ItemStack(Blocks.VINE), LibOreDict.LIFE_ESSENCE, LibOreDict.ELEMENTIUM); recipeRegenIvy = BotaniaAPI.getLatestAddedRecipe(); // Gaia Mana Spreader Recipe @@ -1436,7 +1410,7 @@ public final class ModCraftingRecipes { addOreDictRecipe(new ItemStack(ModBlocks.brewery), "RSR", "RAR", "RMR", 'R', LibOreDict.LIVING_ROCK, - 'S', new ItemStack(Items.brewing_stand), + 'S', new ItemStack(Items.BREWING_STAND), 'A', LibOreDict.RUNE[8], 'M', new ItemStack(ModBlocks.storage)); recipeBrewery = BotaniaAPI.getLatestAddedRecipe(); @@ -1445,7 +1419,7 @@ public final class ModCraftingRecipes { addOreDictRecipe(new ItemStack(ModItems.bloodPendant), " P ", "PGP", "DP ", 'P', LibOreDict.PRISMARINE_SHARD, - 'G', new ItemStack(Items.ghast_tear), + 'G', new ItemStack(Items.GHAST_TEAR), 'D', LibOreDict.MANA_DIAMOND); recipeBloodPendant = BotaniaAPI.getLatestAddedRecipe(); @@ -1462,10 +1436,10 @@ public final class ModCraftingRecipes { recipeTerraPlate = BotaniaAPI.getLatestAddedRecipe(); // Red String Recipe - addShapelessOreDictRecipe(new ItemStack(ModItems.manaResource, 1, 12), new ItemStack(Items.string), "blockRedstone", LibOreDict.PIXIE_DUST, LibOreDict.ENDER_AIR_BOTTLE); + addShapelessOreDictRecipe(new ItemStack(ModItems.manaResource, 1, 12), new ItemStack(Items.STRING), "blockRedstone", LibOreDict.PIXIE_DUST, LibOreDict.ENDER_AIR_BOTTLE); recipeRedString = BotaniaAPI.getLatestAddedRecipe(); // Are you in a pinch? - addShapelessOreDictRecipe(new ItemStack(ModItems.manaResource, 1, 12), new ItemStack(Items.string), "blockRedstone", LibOreDict.PIXIE_DUST, LibOreDict.ENDER_AIR_BOTTLE, new ItemStack(Blocks.pumpkin)); + addShapelessOreDictRecipe(new ItemStack(ModItems.manaResource, 1, 12), new ItemStack(Items.STRING), "blockRedstone", LibOreDict.PIXIE_DUST, LibOreDict.ENDER_AIR_BOTTLE, new ItemStack(Blocks.PUMPKIN)); // Red String Container Recipe addOreDictRecipe(new ItemStack(ModBlocks.redStringContainer), @@ -1480,7 +1454,7 @@ public final class ModCraftingRecipes { "RRR", "RDS", "RRR", 'R', LibOreDict.LIVING_ROCK, 'S', LibOreDict.RED_STRING, - 'D', new ItemStack(Blocks.dispenser)); + 'D', new ItemStack(Blocks.DISPENSER)); recipeRedStringDispenser = BotaniaAPI.getLatestAddedRecipe(); // Red String Fertilizer Recipe @@ -1496,7 +1470,7 @@ public final class ModCraftingRecipes { "RRR", "RCS", "RRR", 'R', LibOreDict.LIVING_ROCK, 'S', LibOreDict.RED_STRING, - 'C', new ItemStack(Items.comparator)); + 'C', new ItemStack(Items.COMPARATOR)); recipeRedStringComparator = BotaniaAPI.getLatestAddedRecipe(); // Red String Spoofer Recipe @@ -1512,7 +1486,7 @@ public final class ModCraftingRecipes { "RRR", "RMS", "RRR", 'R', LibOreDict.LIVING_ROCK, 'S', LibOreDict.RED_STRING, - 'M', new ItemStack(Blocks.stone_button)); + 'M', new ItemStack(Blocks.STONE_BUTTON)); recipeRedStringInterceptor = BotaniaAPI.getLatestAddedRecipe(); // Rod of the Arcane Barrage Recipe @@ -1526,7 +1500,7 @@ public final class ModCraftingRecipes { // Cloak of Virtue Recipe addOreDictRecipe(new ItemStack(ModItems.holyCloak), "WWW", "GWG", "GSG", - 'W', new ItemStack(Blocks.wool), + 'W', new ItemStack(Blocks.WOOL), 'G', "dustGlowstone", 'S', LibOreDict.LIFE_ESSENCE); recipeHolyCloak = BotaniaAPI.getLatestAddedRecipe(); @@ -1534,7 +1508,7 @@ public final class ModCraftingRecipes { // Cloak of Sin Recipe addOreDictRecipe(new ItemStack(ModItems.unholyCloak), "WWW", "RWR", "RSR", - 'W', new ItemStack(Blocks.wool, 1, 15), + 'W', new ItemStack(Blocks.WOOL, 1, 15), 'R', "dustRedstone", 'S', LibOreDict.LIFE_ESSENCE); recipeUnholyCloak = BotaniaAPI.getLatestAddedRecipe(); @@ -1544,19 +1518,19 @@ public final class ModCraftingRecipes { " P ", "ICI", " I ", 'P', LibOreDict.MANA_PEARL, 'I', LibOreDict.MANA_STEEL, - 'C', "craftingTableWood"); + 'C', "workbench"); recipeCraftingHalo = BotaniaAPI.getLatestAddedRecipe(); // Mana Lens: Flash Recipe GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.lens, 1, 17), "GFG", "FLF", "GFG", 'G', "glowstone", - 'F', new ItemStack(Items.fire_charge), + 'F', new ItemStack(Items.FIRE_CHARGE), 'L', new ItemStack(ModItems.lens))); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.lens, 1, 17), "FGF", "GLG", "FGF", 'G', "glowstone", - 'F', new ItemStack(Items.fire_charge), + 'F', new ItemStack(Items.FIRE_CHARGE), 'L', new ItemStack(ModItems.lens))); recipesLensFlash = BotaniaAPI.getLatestAddedRecipes(2); @@ -1569,7 +1543,7 @@ public final class ModCraftingRecipes { recipePrism = BotaniaAPI.getLatestAddedRecipe(); // Trodden Dirt Recipe - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModBlocks.dirtPath, 4), new ItemStack(Blocks.dirt, 1, 1), new ItemStack(Blocks.dirt, 1, 1), new ItemStack(Blocks.dirt, 1, 1), "sand")); + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModBlocks.dirtPath, 4), new ItemStack(Blocks.DIRT, 1, 1), new ItemStack(Blocks.DIRT, 1, 1), new ItemStack(Blocks.DIRT, 1, 1), "sand")); recipeDirtPath = BotaniaAPI.getLatestAddedRecipe(); // Dreamwood Twig Recipe @@ -1583,7 +1557,7 @@ public final class ModCraftingRecipes { "GN", "IN", " N", 'G', new ItemStack(ModBlocks.manaGlass), 'I', LibOreDict.MANA_STEEL, - 'N', new ItemStack(Items.gold_nugget)); + 'N', new ItemStack(Items.GOLD_NUGGET)); recipeMonocle = BotaniaAPI.getLatestAddedRecipe(); // Lens Clip Recipe @@ -1604,7 +1578,7 @@ public final class ModCraftingRecipes { // Rod of the Molten Core Recipe addOreDictRecipe(new ItemStack(ModItems.smeltRod), " BF", " TB", "T ", - 'B', new ItemStack(Items.blaze_rod), + 'B', new ItemStack(Items.BLAZE_ROD), 'F', LibOreDict.RUNE[1], 'T', LibOreDict.LIVINGWOOD_TWIG); recipeSmeltRod = BotaniaAPI.getLatestAddedRecipe(); @@ -1612,8 +1586,8 @@ public final class ModCraftingRecipes { // World Seed Recipe addOreDictRecipe(new ItemStack(ModItems.worldSeed, 4), "G", "S", "D", - 'G', new ItemStack(Blocks.grass), - 'S', new ItemStack(Items.wheat_seeds), + 'G', new ItemStack(Blocks.GRASS), + 'S', new ItemStack(Items.WHEAT_SEEDS), 'D', LibOreDict.DRAGONSTONE); recipeWorldSeed = BotaniaAPI.getLatestAddedRecipe(); @@ -1627,7 +1601,7 @@ public final class ModCraftingRecipes { // Thorn Chakram Recipe addOreDictRecipe(new ItemStack(ModItems.thornChakram, 2), "VVV", "VTV", "VVV", - 'V', new ItemStack(Blocks.vine), + 'V', new ItemStack(Blocks.VINE), 'T', LibOreDict.TERRA_STEEL); recipeThornChakram = BotaniaAPI.getLatestAddedRecipe(); @@ -1646,7 +1620,7 @@ public final class ModCraftingRecipes { }); for(int i = 0; i < count; i++) { - List recipe = new ArrayList(); + List recipe = new ArrayList<>(); for(int j = 0; j < 3; j++) { String s = ""; for(int k = 0; k < 3; k++) @@ -1680,43 +1654,19 @@ public final class ModCraftingRecipes { addOreDictRecipe(new ItemStack(ModBlocks.corporeaIndex), "AOA", "OSO", "DOD", 'A', LibOreDict.ENDER_AIR_BOTTLE, - 'O', new ItemStack(Blocks.obsidian), + 'O', new ItemStack(Blocks.OBSIDIAN), 'S', new ItemStack(ModItems.corporeaSpark), 'D', LibOreDict.DRAGONSTONE); recipeCorporeaIndex = BotaniaAPI.getLatestAddedRecipe(); // Corporea Funnel Recipe - addShapelessOreDictRecipe(new ItemStack(ModBlocks.corporeaFunnel), new ItemStack(Blocks.dropper), new ItemStack(ModItems.corporeaSpark)); + addShapelessOreDictRecipe(new ItemStack(ModBlocks.corporeaFunnel), new ItemStack(Blocks.DROPPER), new ItemStack(ModItems.corporeaSpark)); recipeCorporeaFunnel = BotaniaAPI.getLatestAddedRecipe(); // Corporea Interceptor Recipe addShapelessOreDictRecipe(new ItemStack(ModBlocks.corporeaInterceptor), "blockRedstone", new ItemStack(ModItems.corporeaSpark)); recipeCorporeaInterceptor = BotaniaAPI.getLatestAddedRecipe(); - // End Stone Brick Recipes - if(ConfigHandler.enderStuff19Enabled) { - GameRegistry.addRecipe(new ItemStack(ModBlocks.endStoneBrick, 4), - "SS", "SS", - 'S', new ItemStack(Blocks.end_stone)); - recipeEndStoneBricks = BotaniaAPI.getLatestAddedRecipe(); - - GameRegistry.addRecipe(new ItemStack(ModBlocks.endStoneBrick, 1, 1), - "S", "S", - 'S', new ItemStack(ModFluffBlocks.endStoneSlab)); - recipeEndStoneChiseledBricks = BotaniaAPI.getLatestAddedRecipe(); - - GameRegistry.addRecipe(new ItemStack(ModBlocks.endStoneBrick, 4, 2), - " B ", "BPB", " B ", - 'B', new ItemStack(ModBlocks.endStoneBrick), - 'P', new ItemStack(Items.ender_pearl)); - recipeEnderBricks = BotaniaAPI.getLatestAddedRecipe(); - - GameRegistry.addRecipe(new ItemStack(ModBlocks.endStoneBrick, 2, 3), - "B", "B", - 'B', new ItemStack(ModBlocks.endStoneBrick, 1, 2)); - recipePillarEnderBricks = BotaniaAPI.getLatestAddedRecipe(); - } - // Livingwood Bow Recipe addOreDictRecipe(new ItemStack(ModItems.livingwoodBow), " TS", "T S", " TS", @@ -1742,36 +1692,36 @@ public final class ModCraftingRecipes { // Shimmering Mushroom Recipes for(int i = 0; i < 16; i++) { - GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.mushroom, 1, i), new ItemStack(Blocks.red_mushroom), new ItemStack(ModItems.dye, 1, i)); - GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.mushroom, 1, i), new ItemStack(Blocks.brown_mushroom), new ItemStack(ModItems.dye, 1, i)); + GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.mushroom, 1, i), new ItemStack(Blocks.RED_MUSHROOM), new ItemStack(ModItems.dye, 1, i)); + GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.mushroom, 1, i), new ItemStack(Blocks.BROWN_MUSHROOM), new ItemStack(ModItems.dye, 1, i)); } recipesMushrooms = BotaniaAPI.getLatestAddedRecipes(32); - GameRegistry.addShapelessRecipe(new ItemStack(Items.mushroom_stew), new ItemStack(ModBlocks.mushroom, 1, Short.MAX_VALUE), new ItemStack(ModBlocks.mushroom, 1, Short.MAX_VALUE), new ItemStack(Items.bowl)); + GameRegistry.addShapelessRecipe(new ItemStack(Items.MUSHROOM_STEW), new ItemStack(ModBlocks.mushroom, 1, Short.MAX_VALUE), new ItemStack(ModBlocks.mushroom, 1, Short.MAX_VALUE), new ItemStack(Items.BOWL)); // Ring of Correction Recipe addOreDictRecipe(new ItemStack(ModItems.swapRing), "CM ", "M M", " M ", - 'C', new ItemStack(Blocks.clay), + 'C', new ItemStack(Blocks.CLAY), 'M', LibOreDict.MANA_STEEL); recipeSwapRing = BotaniaAPI.getLatestAddedRecipe(); // Horn of the Covering Recipe - addShapelessOreDictRecipe(new ItemStack(ModItems.grassHorn, 1, 2), new ItemStack(ModItems.grassHorn), new ItemStack(Items.snowball)); + addShapelessOreDictRecipe(new ItemStack(ModItems.grassHorn, 1, 2), new ItemStack(ModItems.grassHorn), new ItemStack(Items.SNOWBALL)); recipeSnowHorn = BotaniaAPI.getLatestAddedRecipe(); // Flower Pouch Recipe GameRegistry.addShapedRecipe(new ItemStack(ModItems.flowerBag), "WPW", "W W", " W ", 'P', new ItemStack(ModItems.petal, 1, Short.MAX_VALUE), - 'W', new ItemStack(Blocks.wool, 1, Short.MAX_VALUE)); + 'W', new ItemStack(Blocks.WOOL, 1, Short.MAX_VALUE)); recipeFlowerBag = BotaniaAPI.getLatestAddedRecipe(); // Phantom Ink Recipe - addShapelessOreDictRecipe(new ItemStack(ModItems.phantomInk, 4), LibOreDict.MANA_PEARL, "dye", "blockGlass", new ItemStack(Items.glass_bottle), new ItemStack(Items.glass_bottle), new ItemStack(Items.glass_bottle), new ItemStack(Items.glass_bottle)); + addShapelessOreDictRecipe(new ItemStack(ModItems.phantomInk, 4), LibOreDict.MANA_PEARL, "dye", "blockGlass", new ItemStack(Items.GLASS_BOTTLE), new ItemStack(Items.GLASS_BOTTLE), new ItemStack(Items.GLASS_BOTTLE), new ItemStack(Items.GLASS_BOTTLE)); recipePhantomInk = BotaniaAPI.getLatestAddedRecipe(); // Minecart with Mana Pool Recipe - GameRegistry.addShapelessRecipe(new ItemStack(ModItems.poolMinecart), new ItemStack(Items.minecart), new ItemStack(ModBlocks.pool)); + GameRegistry.addShapelessRecipe(new ItemStack(ModItems.poolMinecart), new ItemStack(Items.MINECART), new ItemStack(ModBlocks.pool)); recipePoolCart = BotaniaAPI.getLatestAddedRecipe(); // Mana Pump Recipe @@ -1779,7 +1729,7 @@ public final class ModCraftingRecipes { "SSS", "IBI", "SSS", 'S', LibOreDict.LIVING_ROCK, 'I', LibOreDict.MANA_STEEL, - 'B', new ItemStack(Items.bucket)); + 'B', new ItemStack(Items.BUCKET)); recipePump = BotaniaAPI.getLatestAddedRecipe(); // Double Petal Recipes @@ -1788,7 +1738,7 @@ public final class ModCraftingRecipes { recipesPetalsDouble = BotaniaAPI.getLatestAddedRecipes(16); // Resolute Ivy Recipe - addShapelessOreDictRecipe(new ItemStack(ModItems.keepIvy), LibOreDict.PIXIE_DUST, new ItemStack(Blocks.vine), LibOreDict.ENDER_AIR_BOTTLE); + addShapelessOreDictRecipe(new ItemStack(ModItems.keepIvy), LibOreDict.PIXIE_DUST, new ItemStack(Blocks.VINE), LibOreDict.ENDER_AIR_BOTTLE); recipeKeepIvy = BotaniaAPI.getLatestAddedRecipe(); // Black Hole Talisman Recipe @@ -1799,25 +1749,22 @@ public final class ModCraftingRecipes { 'A', LibOreDict.ENDER_AIR_BOTTLE); recipeBlackHoleTalisman = BotaniaAPI.getLatestAddedRecipe(); - // 1.8 Stone Recipes - recipe18StonePolish = new ArrayList(); - recipe18StoneBrick = new ArrayList(); - recipe18StoneChisel = new ArrayList(); - for(int i = 0; i < 4; i++) { - addOreDictRecipe(new ItemStack(ModFluffBlocks.stone, 8, i + 4), - "SSS", "S S", "SSS", - 'S', LibOreDict.STONE_18_VARIANTS[i]); - recipe18StonePolish.add(BotaniaAPI.getLatestAddedRecipe()); + // 1.8 Stone Chiseling + if (Botania.quarkLoaded) { + recipe18StoneChisel = new ArrayList<>(); + ItemStack[] quarkBlocks = { + new ItemStack(Block.REGISTRY.getObject(new ResourceLocation("Quark", "world_stone_bricks")), 1, 2), + new ItemStack(Block.REGISTRY.getObject(new ResourceLocation("Quark", "world_stone_bricks")), 1, 3), + new ItemStack(Block.REGISTRY.getObject(new ResourceLocation("Quark", "world_stone_bricks")), 1, 1), + new ItemStack(Block.REGISTRY.getObject(new ResourceLocation("Quark", "world_stone_bricks")), 1, 0), + }; - addOreDictRecipe(new ItemStack(ModFluffBlocks.stone, 4, i + 8), - "SS", "SS", - 'S', LibOreDict.STONE_18_VARIANTS[i]); - recipe18StoneBrick.add(BotaniaAPI.getLatestAddedRecipe()); - - addOreDictRecipe(new ItemStack(ModFluffBlocks.stone, 1, i + 12), - "S", "S", - 'S', new ItemStack(ModFluffBlocks.stoneSlabs[i + 4], 1, 0)); - recipe18StoneChisel.add(BotaniaAPI.getLatestAddedRecipe()); + /*for(int i = 0; i < 4; i++) { todo readd chiseled versions + addOreDictRecipe(new ItemStack(ModFluffBlocks.stone, 4, i + 12), + "SS", "SS", + 'S', quarkBlocks[i]); + recipe18StoneChisel.add(BotaniaAPI.getLatestAddedRecipe()); + }*/ } // Blaze Light Recipe @@ -1825,7 +1772,7 @@ public final class ModCraftingRecipes { "BBB", "BBB", "BBB", 'B', Botania.gardenOfGlassLoaded ? "powderBlaze" : "rodBlaze"); recipeBlazeBlock = BotaniaAPI.getLatestAddedRecipe(); - addShapelessOreDictRecipe(new ItemStack(Botania.gardenOfGlassLoaded ? Items.blaze_powder : Items.blaze_rod, 9), LibOreDict.BLAZE_BLOCK); + addShapelessOreDictRecipe(new ItemStack(Botania.gardenOfGlassLoaded ? Items.BLAZE_POWDER : Items.BLAZE_ROD, 9), LibOreDict.BLAZE_BLOCK); // Metamorphic Petal Apothecary Recipes for(int i = 0; i < 8; i++) @@ -1853,8 +1800,8 @@ public final class ModCraftingRecipes { // Incense Stick Recipe addOreDictRecipe(new ItemStack(ModItems.incenseStick), " G", " B ", "T ", - 'G', new ItemStack(Items.ghast_tear), - 'B', new ItemStack(Items.blaze_powder), + 'G', new ItemStack(Items.GHAST_TEAR), + 'B', new ItemStack(Items.BLAZE_POWDER), 'T', LibOreDict.LIVINGWOOD_TWIG); recipeIncenseStick = BotaniaAPI.getLatestAddedRecipe(); @@ -1883,14 +1830,14 @@ public final class ModCraftingRecipes { recipeHourglass = BotaniaAPI.getLatestAddedRecipe(); // Spectral Rail Recipe - GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.ghostRail), new ItemStack(Blocks.rail), new ItemStack(ModBlocks.platform, 1, 1)); + GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.ghostRail), new ItemStack(Blocks.RAIL), new ItemStack(ModBlocks.platform, 1, 1)); recipeGhostRail = BotaniaAPI.getLatestAddedRecipe(); // Drum of the Canopy Recipe addOreDictRecipe(new ItemStack(ModBlocks.forestDrum, 1, 2), "WLW", "WHW", "WLW", 'W', LibOreDict.LIVING_WOOD, - 'L', new ItemStack(Items.leather), + 'L', new ItemStack(Items.LEATHER), 'H', new ItemStack(ModItems.grassHorn, 1, 1)); recipeCanopyDrum = BotaniaAPI.getLatestAddedRecipe(); @@ -1906,12 +1853,12 @@ public final class ModCraftingRecipes { if(Botania.gardenOfGlassLoaded) addOreDictRecipe(new ItemStack(ModBlocks.cocoon), "SSS", "SFS", "SIS", - 'S', new ItemStack(Items.string), + 'S', new ItemStack(Items.STRING), 'F', new ItemStack(ModBlocks.felPumpkin), 'I', LibOreDict.MANA_STEEL); else addOreDictRecipe(new ItemStack(ModBlocks.cocoon), "SSS", "SPS", "SDS", - 'S', new ItemStack(Items.string), + 'S', new ItemStack(Items.STRING), 'P', LibOreDict.PIXIE_DUST, 'D', LibOreDict.DRAGONSTONE); recipeCocoon = BotaniaAPI.getLatestAddedRecipe(); @@ -1919,11 +1866,11 @@ public final class ModCraftingRecipes { // Fel Pumpkin GameRegistry.addRecipe(new ItemStack(ModBlocks.felPumpkin), " S ", "BPF", " G ", - 'S', new ItemStack(Items.string), - 'B', new ItemStack(Items.bone), - 'P', new ItemStack(Blocks.pumpkin), - 'F', new ItemStack(Items.rotten_flesh), - 'G', new ItemStack(Items.gunpowder)); + 'S', new ItemStack(Items.STRING), + 'B', new ItemStack(Items.BONE), + 'P', new ItemStack(Blocks.PUMPKIN), + 'F', new ItemStack(Items.ROTTEN_FLESH), + 'G', new ItemStack(Items.GUNPOWDER)); recipeFelPumpkin = BotaniaAPI.getLatestAddedRecipe(); // Luminizer Recipe @@ -1953,25 +1900,25 @@ public final class ModCraftingRecipes { addOreDictRecipe(new ItemStack(ModItems.cacophonium), " G ", "GNG", "GG ", 'G', "ingotGold", - 'N', new ItemStack(Blocks.noteblock)); + 'N', new ItemStack(Blocks.NOTEBLOCK)); else addOreDictRecipe(new ItemStack(ModItems.cacophonium), " G ", "GNG", "GG ", 'G', "ingotBrass", - 'N', new ItemStack(Blocks.noteblock)); + 'N', new ItemStack(Blocks.NOTEBLOCK)); recipeCacophonium = BotaniaAPI.getLatestAddedRecipe(); // Manastorm Charge Recipe addOreDictRecipe(new ItemStack(ModBlocks.manaBomb), "LTL", "TGT", "LTL", 'L', LibOreDict.LIVING_WOOD, - 'T', new ItemStack(Blocks.tnt), + 'T', new ItemStack(Blocks.TNT), 'G', LibOreDict.LIFE_ESSENCE); recipeManaBomb = BotaniaAPI.getLatestAddedRecipe(); // Cobweb Recipe - addOreDictRecipe(new ItemStack(Blocks.web), + addOreDictRecipe(new ItemStack(Blocks.WEB), "S S", " M ", "S S", - 'S', new ItemStack(Items.string), + 'S', new ItemStack(Items.STRING), 'M', LibOreDict.MANA_STRING); recipeCobweb = BotaniaAPI.getLatestAddedRecipe(); @@ -2007,7 +1954,7 @@ public final class ModCraftingRecipes { // Flare Chakram Recipe addOreDictRecipe(new ItemStack(ModItems.thornChakram, 2, 1), "BBB", "CPC", "BBB", - 'B', new ItemStack(Items.blaze_powder), + 'B', new ItemStack(Items.BLAZE_POWDER), 'P', LibOreDict.PIXIE_DUST, 'C', new ItemStack(ModItems.thornChakram)); recipeFireChakram = BotaniaAPI.getLatestAddedRecipe(); @@ -2026,7 +1973,7 @@ public final class ModCraftingRecipes { "SSS", "RL ", "SSS", 'S', new ItemStack(ModFluffBlocks.livingwoodSlab), 'R', LibOreDict.RUNE[3], - 'L', new ItemStack(Items.leather)); + 'L', new ItemStack(Items.LEATHER)); recipeBellows = BotaniaAPI.getLatestAddedRecipe(); // Manaweave Cloth Recipe @@ -2067,26 +2014,26 @@ public final class ModCraftingRecipes { // Pavement Recipes addShapelessOreDictRecipe(new ItemStack(ModFluffBlocks.pavement, 3, 0), LibOreDict.LIVING_ROCK, "cobblestone", "gravel"); - addShapelessOreDictRecipe(new ItemStack(ModFluffBlocks.pavement, 3, 1), LibOreDict.LIVING_ROCK, "cobblestone", "gravel", new ItemStack(Items.coal)); - addShapelessOreDictRecipe(new ItemStack(ModFluffBlocks.pavement, 3, 2), LibOreDict.LIVING_ROCK, "cobblestone", "gravel", new ItemStack(Items.dye, 1, 4)); - addShapelessOreDictRecipe(new ItemStack(ModFluffBlocks.pavement, 3, 3), LibOreDict.LIVING_ROCK, "cobblestone", "gravel", new ItemStack(Items.redstone)); - addShapelessOreDictRecipe(new ItemStack(ModFluffBlocks.pavement, 3, 4), LibOreDict.LIVING_ROCK, "cobblestone", "gravel", new ItemStack(Items.wheat)); - addShapelessOreDictRecipe(new ItemStack(ModFluffBlocks.pavement, 3, 5), LibOreDict.LIVING_ROCK, "cobblestone", "gravel", new ItemStack(Items.slime_ball)); + addShapelessOreDictRecipe(new ItemStack(ModFluffBlocks.pavement, 3, 1), LibOreDict.LIVING_ROCK, "cobblestone", "gravel", new ItemStack(Items.COAL)); + addShapelessOreDictRecipe(new ItemStack(ModFluffBlocks.pavement, 3, 2), LibOreDict.LIVING_ROCK, "cobblestone", "gravel", new ItemStack(Items.DYE, 1, 4)); + addShapelessOreDictRecipe(new ItemStack(ModFluffBlocks.pavement, 3, 3), LibOreDict.LIVING_ROCK, "cobblestone", "gravel", new ItemStack(Items.REDSTONE)); + addShapelessOreDictRecipe(new ItemStack(ModFluffBlocks.pavement, 3, 4), LibOreDict.LIVING_ROCK, "cobblestone", "gravel", new ItemStack(Items.WHEAT)); + addShapelessOreDictRecipe(new ItemStack(ModFluffBlocks.pavement, 3, 5), LibOreDict.LIVING_ROCK, "cobblestone", "gravel", new ItemStack(Items.SLIME_BALL)); recipesPavement = BotaniaAPI.getLatestAddedRecipes(6); // Cellular Block Recipe - GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.cellBlock, 3), new ItemStack(Blocks.cactus), new ItemStack(Blocks.cactus), new ItemStack(Blocks.cactus), new ItemStack(Blocks.cactus), new ItemStack(Items.carrot), new ItemStack(Items.potato)); + GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.cellBlock, 3), new ItemStack(Blocks.CACTUS), new ItemStack(Blocks.CACTUS), new ItemStack(Blocks.CACTUS), new ItemStack(Blocks.CACTUS), new ItemStack(Items.CARROT), new ItemStack(Items.POTATO)); recipeCellBlock = BotaniaAPI.getLatestAddedRecipe(); // Corporea Retainer Recipe - addShapelessOreDictRecipe(new ItemStack(ModBlocks.corporeaRetainer), new ItemStack(Blocks.chest), new ItemStack(ModItems.corporeaSpark)); + addShapelessOreDictRecipe(new ItemStack(ModBlocks.corporeaRetainer), new ItemStack(Blocks.CHEST), new ItemStack(ModItems.corporeaSpark)); recipeCorporeaRetainer = BotaniaAPI.getLatestAddedRecipe(); // Teru Teru Bozu Recipe addOreDictRecipe(new ItemStack(ModBlocks.teruTeruBozu), "C", "C", "S", 'C', LibOreDict.MANAWEAVE_CLOTH, - 'S', new ItemStack(Blocks.double_plant)); + 'S', new ItemStack(Blocks.DOUBLE_PLANT)); recipeTeruTeruBozu = BotaniaAPI.getLatestAddedRecipe(); // Livingwood Avatar Recipe @@ -2104,28 +2051,28 @@ public final class ModCraftingRecipes { recipeSextant = BotaniaAPI.getLatestAddedRecipe(); // Alternate Pasture Seed Recipes - GameRegistry.addShapelessRecipe(new ItemStack(ModItems.grassSeeds, 1, 3), new ItemStack(ModItems.grassSeeds), new ItemStack(Blocks.deadbush)); - GameRegistry.addShapelessRecipe(new ItemStack(ModItems.grassSeeds, 1, 4), new ItemStack(ModItems.grassSeeds), new ItemStack(Items.wheat)); - GameRegistry.addShapelessRecipe(new ItemStack(ModItems.grassSeeds, 1, 5), new ItemStack(ModItems.grassSeeds), new ItemStack(Items.dye, 1, 2)); - GameRegistry.addShapelessRecipe(new ItemStack(ModItems.grassSeeds, 1, 6), new ItemStack(ModItems.grassSeeds), new ItemStack(Items.blaze_powder)); - GameRegistry.addShapelessRecipe(new ItemStack(ModItems.grassSeeds, 1, 7), new ItemStack(ModItems.grassSeeds), new ItemStack(ModItems.manaResource, 1, 10)); - GameRegistry.addShapelessRecipe(new ItemStack(ModItems.grassSeeds, 1, 8), new ItemStack(ModItems.grassSeeds), new ItemStack(Items.spider_eye)); + GameRegistry.addShapelessRecipe(new ItemStack(ModItems.grassSeeds, 1, 3), new ItemStack(ModItems.grassSeeds), new ItemStack(Blocks.DEADBUSH)); + GameRegistry.addShapelessRecipe(new ItemStack(ModItems.grassSeeds, 1, 4), new ItemStack(ModItems.grassSeeds), new ItemStack(Items.WHEAT)); + GameRegistry.addShapelessRecipe(new ItemStack(ModItems.grassSeeds, 1, 5), new ItemStack(ModItems.grassSeeds), new ItemStack(Items.DYE, 1, 2)); + GameRegistry.addShapelessRecipe(new ItemStack(ModItems.grassSeeds, 1, 6), new ItemStack(ModItems.grassSeeds), new ItemStack(Items.BLAZE_POWDER)); + GameRegistry.addShapelessRecipe(new ItemStack(ModItems.grassSeeds, 1, 7), new ItemStack(ModItems.grassSeeds), new ItemStack(Items.PRISMARINE_SHARD)); + GameRegistry.addShapelessRecipe(new ItemStack(ModItems.grassSeeds, 1, 8), new ItemStack(ModItems.grassSeeds), new ItemStack(Items.SPIDER_EYE)); recipesAltGrassSeeds = BotaniaAPI.getLatestAddedRecipes(6); // Planestrider's Sash Recipe GameRegistry.addRecipe(new ItemStack(ModItems.speedUpBelt), " M ", "PBP", " S ", - 'M', new ItemStack(Items.filled_map, 1, Short.MAX_VALUE), + 'M', new ItemStack(Items.FILLED_MAP, 1, Short.MAX_VALUE), 'P', new ItemStack(ModItems.grassSeeds), 'B', new ItemStack(ModItems.travelBelt), - 'S', new ItemStack(Items.sugar)); + 'S', new ItemStack(Items.SUGAR)); recipeSpeedUpBelt = BotaniaAPI.getLatestAddedRecipe(); // Bauble Case Recipe addOreDictRecipe(new ItemStack(ModItems.baubleBox), " M ", "MCG", " M ", 'M', LibOreDict.MANA_STEEL, - 'C', new ItemStack(Blocks.chest), + 'C', new ItemStack(Blocks.CHEST), 'G', "ingotGold"); recipeBaubleCase = BotaniaAPI.getLatestAddedRecipe(); @@ -2168,7 +2115,7 @@ public final class ModCraftingRecipes { // Revealing Helmet Recipes if(Botania.thaumcraftLoaded) { - Item goggles = (Item) Item.itemRegistry.getObject("Thaumcraft:ItemGoggles"); + Item goggles = Item.REGISTRY.getObject(new ResourceLocation("thaumcraft", "goggles")); GameRegistry.addShapelessRecipe(new ItemStack(ModItems.manasteelHelmRevealing), new ItemStack(ModItems.manasteelHelm), goggles); recipeHelmetOfRevealing = BotaniaAPI.getLatestAddedRecipe(); //We want manasteel to show in the Lexicon GameRegistry.addShapelessRecipe(new ItemStack(ModItems.terrasteelHelmRevealing), new ItemStack(ModItems.terrasteelHelm), goggles); @@ -2182,16 +2129,10 @@ public final class ModCraftingRecipes { addStairsAndSlabs(ModBlocks.livingrock, 1, ModFluffBlocks.livingrockBrickStairs, ModFluffBlocks.livingrockBrickSlab); addStairsAndSlabs(ModBlocks.dreamwood, 0, ModFluffBlocks.dreamwoodStairs, ModFluffBlocks.dreamwoodSlab); addStairsAndSlabs(ModBlocks.dreamwood, 1, ModFluffBlocks.dreamwoodPlankStairs, ModFluffBlocks.dreamwoodPlankSlab); - addStairsAndSlabs(ModBlocks.prismarine, 0, ModFluffBlocks.prismarineStairs, ModFluffBlocks.prismarineSlab); - addStairsAndSlabs(ModBlocks.prismarine, 1, ModFluffBlocks.prismarineBrickStairs, ModFluffBlocks.prismarineBrickSlab); - addStairsAndSlabs(ModBlocks.prismarine, 2, ModFluffBlocks.darkPrismarineStairs, ModFluffBlocks.darkPrismarineSlab); - addStairsAndSlabs(ModBlocks.reedBlock, 0, ModFluffBlocks.reedStairs, ModFluffBlocks.reedSlab); - addStairsAndSlabs(ModBlocks.thatch, 0, ModFluffBlocks.thatchStairs, ModFluffBlocks.thatchSlab); addStairsAndSlabs(ModBlocks.customBrick, 0, ModFluffBlocks.netherBrickStairs, ModFluffBlocks.netherBrickSlab); addStairsAndSlabs(ModBlocks.customBrick, 1, ModFluffBlocks.soulBrickStairs, ModFluffBlocks.soulBrickSlab); addStairsAndSlabs(ModBlocks.customBrick, 2, ModFluffBlocks.snowBrickStairs, ModFluffBlocks.snowBrickSlab); addStairsAndSlabs(ModBlocks.customBrick, 3, ModFluffBlocks.tileStairs, ModFluffBlocks.tileSlab); - addStairsAndSlabs(ModBlocks.endStoneBrick, 0, ModFluffBlocks.endStoneStairs, ModFluffBlocks.endStoneSlab); addStairsAndSlabs(ModBlocks.shimmerrock, 0, ModFluffBlocks.shimmerrockStairs, ModFluffBlocks.shimmerrockSlab); addStairsAndSlabs(ModBlocks.shimmerwoodPlanks, 0, ModFluffBlocks.shimmerwoodPlankStairs, ModFluffBlocks.shimmerwoodPlankSlab); @@ -2199,12 +2140,8 @@ public final class ModCraftingRecipes { addWall(ModBlocks.livingrock, 0, ModFluffBlocks.livingrockWall, 0); addWall(ModBlocks.livingwood, 0, ModFluffBlocks.livingwoodWall, 0); addWall(ModBlocks.dreamwood, 0, ModFluffBlocks.dreamwoodWall, 0); - addWall(ModBlocks.prismarine, 0, ModFluffBlocks.prismarineWall, 0); - addWall(ModBlocks.reedBlock, 0, ModFluffBlocks.reedWall, 0); for(int i = 0; i < 8; i++) addWall(ModFluffBlocks.biomeStoneA, i + 8, ModFluffBlocks.biomeStoneWall, i); - for(int i = 0; i < 4; i++) - addWall(ModFluffBlocks.stone, i, ModFluffBlocks.stoneWall, i); // Pane Recipes addPane(ModBlocks.manaGlass, ModFluffBlocks.managlassPane); @@ -2215,59 +2152,27 @@ public final class ModCraftingRecipes { for(int i = 0; i < 8; i++) { GameRegistry.addSmelting(new ItemStack(ModFluffBlocks.biomeStoneA, 1, i + 8), new ItemStack(ModFluffBlocks.biomeStoneA, 1, i), 0.1F); GameRegistry.addRecipe(new ItemStack(ModFluffBlocks.biomeStoneB, 4, i), "SS", "SS", 'S', new ItemStack(ModFluffBlocks.biomeStoneA, 1, i)); - GameRegistry.addRecipe(new ItemStack(ModFluffBlocks.biomeStoneB, 1, i + 8), "S", "S", 'S', new ItemStack(ModFluffBlocks.biomeStoneSlabs[i + 16])); + GameRegistry.addRecipe(new ItemStack(ModFluffBlocks.biomeStoneB, 4, i + 8), "SS", "SS", 'S', new ItemStack(ModFluffBlocks.biomeStoneB, 1, i)); addStairsAndSlabs(ModFluffBlocks.biomeStoneA, i, ModFluffBlocks.biomeStoneStairs[i], ModFluffBlocks.biomeStoneSlabs[i]); addStairsAndSlabs(ModFluffBlocks.biomeStoneA, i + 8, ModFluffBlocks.biomeStoneStairs[i + 8], ModFluffBlocks.biomeStoneSlabs[i + 8]); addStairsAndSlabs(ModFluffBlocks.biomeStoneB, i, ModFluffBlocks.biomeStoneStairs[i + 16], ModFluffBlocks.biomeStoneSlabs[i + 16]); } - // 1.8 Block Stone Stairs & Slabs - for(int i = 0; i < 4; i++) { - addOreDictRecipe(new ItemStack(ModFluffBlocks.stoneSlabs[i], 6), - "QQQ", - 'Q', LibOreDict.STONE_18_VARIANTS[i]); - addOreDictRecipe(new ItemStack(ModFluffBlocks.stoneStairs[i], 4), - " Q", " QQ", "QQQ", - 'Q', LibOreDict.STONE_18_VARIANTS[i]); - addOreDictRecipe(new ItemStack(ModFluffBlocks.stoneStairs[i], 4), - "Q ", "QQ ", "QQQ", - 'Q', LibOreDict.STONE_18_VARIANTS[i]); - addOreDictRecipe(new ItemStack(ModFluffBlocks.stone, 1, i), - "Q", "Q", - 'Q', new ItemStack(ModFluffBlocks.stoneSlabs[i])); - - addOreDictRecipe(new ItemStack(ModFluffBlocks.stoneSlabs[i + 4], 6), - "QQQ", - 'Q', LibOreDict.STONE_18_VARIANTS[i + 8]); - addOreDictRecipe(new ItemStack(ModFluffBlocks.stoneStairs[i + 4], 4), - " Q", " QQ", "QQQ", - 'Q', LibOreDict.STONE_18_VARIANTS[i + 8]); - addOreDictRecipe(new ItemStack(ModFluffBlocks.stoneStairs[i + 4], 4), - "Q ", "QQ ", "QQQ", - 'Q', LibOreDict.STONE_18_VARIANTS[i + 8]); - addOreDictRecipe(new ItemStack(ModFluffBlocks.stone, 1, i + 8), //VERY VERY - "Q", "Q", //BIG BIG - 'Q', new ItemStack(ModFluffBlocks.stoneSlabs[i + 4])); //PROBLEM PROBLEM - } - - // Pavement Stairsm & Stairs + // Pavement Stairs & Stairs for(int i = 0; i < ModFluffBlocks.pavementStairs.length; i++) addStairsAndSlabs(ModFluffBlocks.pavement, i, ModFluffBlocks.pavementStairs[i], ModFluffBlocks.pavementSlabs[i]); // Misc Recipes - GameRegistry.addShapelessRecipe(new ItemStack(Items.reeds, 9, 0), new ItemStack(ModBlocks.reedBlock)); - GameRegistry.addShapelessRecipe(new ItemStack(Items.wheat, 4, 0), new ItemStack(ModBlocks.thatch)); - if(Botania.gardenOfGlassLoaded) initGardenOfGlass(); int newRecipeListSize = CraftingManager.getInstance().getRecipeList().size(); - FMLLog.log(Level.INFO, "[Botania] Registered %d recipes.", newRecipeListSize - recipeListSize); + Botania.LOGGER.info("Registered %d recipes.", newRecipeListSize - recipeListSize); } private static void initGardenOfGlass() { // Root to Sapling - addShapelessOreDictRecipe(new ItemStack(Blocks.sapling), LibOreDict.ROOT, LibOreDict.ROOT, LibOreDict.ROOT, LibOreDict.ROOT); + addShapelessOreDictRecipe(new ItemStack(Blocks.SAPLING), LibOreDict.ROOT, LibOreDict.ROOT, LibOreDict.ROOT, LibOreDict.ROOT); recipeRootToSapling = BotaniaAPI.getLatestAddedRecipe(); // Root to Fertilizer @@ -2275,17 +2180,17 @@ public final class ModCraftingRecipes { recipeRootToFertilizer = BotaniaAPI.getLatestAddedRecipe(); // Pebble to Cobble - addShapelessOreDictRecipe(new ItemStack(Blocks.cobblestone), LibOreDict.PEBBLE, LibOreDict.PEBBLE, LibOreDict.PEBBLE, LibOreDict.PEBBLE); + addShapelessOreDictRecipe(new ItemStack(Blocks.COBBLESTONE), LibOreDict.PEBBLE, LibOreDict.PEBBLE, LibOreDict.PEBBLE, LibOreDict.PEBBLE); recipePebbleCobblestone = BotaniaAPI.getLatestAddedRecipe(); // Magma Pearl to Slimeball - addShapelessOreDictRecipe(new ItemStack(Items.slime_ball), new ItemStack(Items.magma_cream), new ItemStack(Items.water_bucket)); + addShapelessOreDictRecipe(new ItemStack(Items.SLIME_BALL), new ItemStack(Items.MAGMA_CREAM), new ItemStack(Items.WATER_BUCKET)); recipeMagmaToSlimeball = BotaniaAPI.getLatestAddedRecipe(); // Ender Portal - addOreDictRecipe(new ItemStack(Blocks.end_portal_frame), + addOreDictRecipe(new ItemStack(Blocks.END_PORTAL_FRAME), "OGO", - 'O', new ItemStack(Blocks.obsidian), + 'O', new ItemStack(Blocks.OBSIDIAN), 'G', LibOreDict.LIFE_ESSENCE); recipeEndPortal = BotaniaAPI.getLatestAddedRecipe(); } @@ -2305,12 +2210,34 @@ public final class ModCraftingRecipes { 'Q', new ItemStack(slab)); } + // Same as above, but use od for forward recipes, only use block and meta for slab -> full block recipe + private static void addStairsAndSlabsWithOredict(String od, Block block, int meta, Block stairs, Block slab) { + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(slab, 6), + "QQQ", + 'Q', od)); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(stairs, 4), + " Q", " QQ", "QQQ", + 'Q', od)); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(stairs, 4), + "Q ", "QQ ", "QQQ", + 'Q', od)); + GameRegistry.addRecipe(new ItemStack(block, 1, meta), + "Q", "Q", + 'Q', new ItemStack(slab)); + } + private static void addWall(Block block, int blockMeta, Block wall, int wallMeta) { GameRegistry.addRecipe(new ItemStack(wall, 6, wallMeta), "BBB", "BBB", 'B', new ItemStack(block, 1, blockMeta)); } + private static void addWallWithOreDict(String od, Block wall, int wallMeta) { + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(wall, 6, wallMeta), + "BBB", "BBB", + 'B', od)); + } + private static void addPane(Block block, Block pane) { GameRegistry.addRecipe(new ItemStack(pane, 16), "BBB", "BBB", @@ -2330,7 +2257,7 @@ public final class ModCraftingRecipes { addStairsAndSlabs(block, 0, stairs, slab); if(req != null) { - if(req == Items.coal) + if(req == Items.COAL) GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.quartz, 8, meta), "QQQ", "QCQ", "QQQ", 'Q', "gemQuartz", diff --git a/src/main/java/vazkii/botania/common/crafting/ModElvenTradeRecipes.java b/src/main/java/vazkii/botania/common/crafting/ModElvenTradeRecipes.java index d247b00c2..88cde7916 100644 --- a/src/main/java/vazkii/botania/common/crafting/ModElvenTradeRecipes.java +++ b/src/main/java/vazkii/botania/common/crafting/ModElvenTradeRecipes.java @@ -1,8 +1,5 @@ package vazkii.botania.common.crafting; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; @@ -12,6 +9,9 @@ import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.lib.LibOreDict; +import java.util.ArrayList; +import java.util.List; + public class ModElvenTradeRecipes { public static RecipeElvenTrade dreamwoodRecipe; @@ -24,23 +24,23 @@ public class ModElvenTradeRecipes { public static void init() { dreamwoodRecipe = BotaniaAPI.registerElvenTradeRecipe(new ItemStack(ModBlocks.dreamwood), LibOreDict.LIVING_WOOD); - elementiumRecipes = new ArrayList(); + elementiumRecipes = new ArrayList<>(); elementiumRecipes.add(BotaniaAPI.registerElvenTradeRecipe(new ItemStack(ModItems.manaResource, 1, 7), LibOreDict.MANA_STEEL, LibOreDict.MANA_STEEL)); elementiumRecipes.add(BotaniaAPI.registerElvenTradeRecipe(new ItemStack(ModBlocks.storage, 1, 2), new ItemStack(ModBlocks.storage), new ItemStack(ModBlocks.storage))); pixieDustRecipe = BotaniaAPI.registerElvenTradeRecipe(new ItemStack(ModItems.manaResource, 1, 8), LibOreDict.MANA_PEARL); - dragonstoneRecipes = new ArrayList(); + dragonstoneRecipes = new ArrayList<>(); dragonstoneRecipes.add(BotaniaAPI.registerElvenTradeRecipe(new ItemStack(ModItems.manaResource, 1, 9), LibOreDict.MANA_DIAMOND)); dragonstoneRecipes.add(BotaniaAPI.registerElvenTradeRecipe(new ItemStack(ModBlocks.storage, 1, 4), new ItemStack(ModBlocks.storage, 1, 3))); - elvenQuartzRecipe = BotaniaAPI.registerElvenTradeRecipe(new ItemStack(ModItems.quartz, 1, 5), new ItemStack(Items.quartz)); + elvenQuartzRecipe = BotaniaAPI.registerElvenTradeRecipe(new ItemStack(ModItems.quartz, 1, 5), new ItemStack(Items.QUARTZ)); alfglassRecipe = BotaniaAPI.registerElvenTradeRecipe(new ItemStack(ModBlocks.elfGlass), new ItemStack(ModBlocks.manaGlass)); - BotaniaAPI.registerElvenTradeRecipe(new ItemStack(Items.iron_ingot), new ItemStack(Items.iron_ingot)); - BotaniaAPI.registerElvenTradeRecipe(new ItemStack(Blocks.iron_block), new ItemStack(Blocks.iron_block)); - BotaniaAPI.registerElvenTradeRecipe(new ItemStack(Items.ender_pearl), new ItemStack(Items.ender_pearl)); - BotaniaAPI.registerElvenTradeRecipe(new ItemStack(Items.diamond), new ItemStack(Items.diamond)); - BotaniaAPI.registerElvenTradeRecipe(new ItemStack(Blocks.diamond_block), new ItemStack(Blocks.diamond_block)); + BotaniaAPI.registerElvenTradeRecipe(new ItemStack(Items.IRON_INGOT), new ItemStack(Items.IRON_INGOT)); + BotaniaAPI.registerElvenTradeRecipe(new ItemStack(Blocks.IRON_BLOCK), new ItemStack(Blocks.IRON_BLOCK)); + BotaniaAPI.registerElvenTradeRecipe(new ItemStack(Items.ENDER_PEARL), new ItemStack(Items.ENDER_PEARL)); + BotaniaAPI.registerElvenTradeRecipe(new ItemStack(Items.DIAMOND), new ItemStack(Items.DIAMOND)); + BotaniaAPI.registerElvenTradeRecipe(new ItemStack(Blocks.DIAMOND_BLOCK), new ItemStack(Blocks.DIAMOND_BLOCK)); } } diff --git a/src/main/java/vazkii/botania/common/crafting/ModManaAlchemyRecipes.java b/src/main/java/vazkii/botania/common/crafting/ModManaAlchemyRecipes.java index efe392ab1..1f4dff2bd 100644 --- a/src/main/java/vazkii/botania/common/crafting/ModManaAlchemyRecipes.java +++ b/src/main/java/vazkii/botania/common/crafting/ModManaAlchemyRecipes.java @@ -10,9 +10,6 @@ */ package vazkii.botania.common.crafting; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -23,6 +20,9 @@ import vazkii.botania.common.block.ModFluffBlocks; import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.item.ModItems; +import java.util.ArrayList; +import java.util.List; + public final class ModManaAlchemyRecipes { public static RecipeManaInfusion leatherRecipe; @@ -53,23 +53,23 @@ public final class ModManaAlchemyRecipes { public static List flowersRecipes; public static void init() { - leatherRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.leather), new ItemStack(Items.rotten_flesh), 600); + leatherRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.LEATHER), new ItemStack(Items.ROTTEN_FLESH), 600); - woodRecipes = new ArrayList(); - woodRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.log, 1, 0), new ItemStack(Blocks.log2, 1, 1), 40)); - woodRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.log, 1, 1), new ItemStack(Blocks.log, 1, 0), 40)); - woodRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.log, 1, 2), new ItemStack(Blocks.log, 1, 1), 40)); - woodRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.log, 1, 3), new ItemStack(Blocks.log, 1, 2), 40)); - woodRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.log2, 1, 0), new ItemStack(Blocks.log, 1, 3), 40)); - woodRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.log2, 1, 1), new ItemStack(Blocks.log2, 1, 0), 40)); + woodRecipes = new ArrayList<>(); + woodRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.LOG, 1, 0), new ItemStack(Blocks.LOG2, 1, 1), 40)); + woodRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.LOG, 1, 1), new ItemStack(Blocks.LOG, 1, 0), 40)); + woodRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.LOG, 1, 2), new ItemStack(Blocks.LOG, 1, 1), 40)); + woodRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.LOG, 1, 3), new ItemStack(Blocks.LOG, 1, 2), 40)); + woodRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.LOG2, 1, 0), new ItemStack(Blocks.LOG, 1, 3), 40)); + woodRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.LOG2, 1, 1), new ItemStack(Blocks.LOG2, 1, 0), 40)); - saplingRecipes = new ArrayList(); + saplingRecipes = new ArrayList<>(); for(int i = 0; i < 6; i++) - saplingRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.sapling, 1, i == 5 ? 0 : i + 1), new ItemStack(Blocks.sapling, 1, i), 120)); + saplingRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.SAPLING, 1, i == 5 ? 0 : i + 1), new ItemStack(Blocks.SAPLING, 1, i), 120)); - glowstoneDustRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.glowstone_dust, 4), new ItemStack(Blocks.glowstone), 25); - quartzRecipes = new ArrayList(); - quartzRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.quartz, 4), new ItemStack(Blocks.quartz_block, 1, Short.MAX_VALUE), 25)); + glowstoneDustRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.GLOWSTONE_DUST, 4), new ItemStack(Blocks.GLOWSTONE), 25); + quartzRecipes = new ArrayList<>(); + quartzRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.QUARTZ, 4), new ItemStack(Blocks.QUARTZ_BLOCK, 1, Short.MAX_VALUE), 25)); if(ConfigHandler.darkQuartzEnabled) quartzRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(ModItems.quartz, 4, 0), new ItemStack(ModFluffBlocks.darkQuartz, 1, Short.MAX_VALUE), 25)); quartzRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(ModItems.quartz, 4, 1), new ItemStack(ModFluffBlocks.manaQuartz, 1, Short.MAX_VALUE), 25)); @@ -78,85 +78,84 @@ public final class ModManaAlchemyRecipes { quartzRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(ModItems.quartz, 4, 4), new ItemStack(ModFluffBlocks.redQuartz, 1, Short.MAX_VALUE), 25)); quartzRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(ModItems.quartz, 4, 5), new ItemStack(ModFluffBlocks.elfQuartz, 1, Short.MAX_VALUE), 25)); - chiseledBrickRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.stonebrick, 1, 3), new ItemStack(Blocks.stonebrick), 150); - iceRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.ice), new ItemStack(Blocks.snow), 2250); + chiseledBrickRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.STONEBRICK, 1, 3), new ItemStack(Blocks.STONEBRICK), 150); + iceRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.ICE), new ItemStack(Blocks.SNOW), 2250); - swampFolliageRecipes = new ArrayList(); - swampFolliageRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.waterlily), new ItemStack(Blocks.vine), 320)); - swampFolliageRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.vine), new ItemStack(Blocks.waterlily), 320)); + swampFolliageRecipes = new ArrayList<>(); + swampFolliageRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.WATERLILY), new ItemStack(Blocks.VINE), 320)); + swampFolliageRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.VINE), new ItemStack(Blocks.WATERLILY), 320)); - fishRecipes = new ArrayList(); + fishRecipes = new ArrayList<>(); for(int i = 0; i < 4; i++) - fishRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.fish, 1, i == 3 ? 0 : i + 1), new ItemStack(Items.fish, 1, i), 200)); + fishRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.FISH, 1, i == 3 ? 0 : i + 1), new ItemStack(Items.FISH, 1, i), 200)); - cropRecipes = new ArrayList(); - cropRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.wheat_seeds), new ItemStack(Items.dye, 1, 3), 6000)); - cropRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.potato), new ItemStack(Items.wheat), 6000)); - cropRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.carrot), new ItemStack(Items.potato), 6000)); - cropRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.melon_seeds), new ItemStack(Items.carrot), 6000)); - cropRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.pumpkin_seeds), new ItemStack(Items.melon_seeds), 6000)); - cropRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.dye, 1, 3), new ItemStack(Items.pumpkin_seeds), 6000)); + cropRecipes = new ArrayList<>(); + cropRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.WHEAT_SEEDS), new ItemStack(Items.DYE, 1, 3), 6000)); + cropRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.POTATO), new ItemStack(Items.WHEAT), 6000)); + cropRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.CARROT), new ItemStack(Items.POTATO), 6000)); + cropRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.MELON_SEEDS), new ItemStack(Items.CARROT), 6000)); + cropRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.PUMPKIN_SEEDS), new ItemStack(Items.MELON_SEEDS), 6000)); + cropRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.DYE, 1, 3), new ItemStack(Items.PUMPKIN_SEEDS), 6000)); - potatoRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.potato), new ItemStack(Items.poisonous_potato), 1200); - netherWartRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.nether_wart), new ItemStack(Items.blaze_rod), 4000); + potatoRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.POTATO), new ItemStack(Items.POISONOUS_POTATO), 1200); + netherWartRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.NETHER_WART), new ItemStack(Items.BLAZE_ROD), 4000); - gunpowderAndFlintRecipes = new ArrayList(); - gunpowderAndFlintRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.flint), new ItemStack(Items.gunpowder), 200)); - gunpowderAndFlintRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.gunpowder), new ItemStack(Items.flint), 4000)); + gunpowderAndFlintRecipes = new ArrayList<>(); + gunpowderAndFlintRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.FLINT), new ItemStack(Items.GUNPOWDER), 200)); + gunpowderAndFlintRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.GUNPOWDER), new ItemStack(Items.FLINT), 4000)); - nameTagRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.name_tag), new ItemStack(Items.writable_book), 16000); + nameTagRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.NAME_TAG), new ItemStack(Items.WRITABLE_BOOK), 16000); - stringRecipes = new ArrayList(); + stringRecipes = new ArrayList<>(); for(int i = 0; i < 16; i++) - stringRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.string, 3), new ItemStack(Blocks.wool, 1, i), 100)); + stringRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.STRING, 3), new ItemStack(Blocks.WOOL, 1, i), 100)); - slimeballCactusRecipes = new ArrayList(); - slimeballCactusRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.slime_ball), new ItemStack(Blocks.cactus), 1200)); - slimeballCactusRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.cactus), new ItemStack(Items.slime_ball), 1200)); + slimeballCactusRecipes = new ArrayList<>(); + slimeballCactusRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.SLIME_BALL), new ItemStack(Blocks.CACTUS), 1200)); + slimeballCactusRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.CACTUS), new ItemStack(Items.SLIME_BALL), 1200)); - enderPearlRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.ender_pearl), new ItemStack(Items.ghast_tear), 28000); + enderPearlRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.ENDER_PEARL), new ItemStack(Items.GHAST_TEAR), 28000); - redstoneToGlowstoneRecipes = new ArrayList(); - redstoneToGlowstoneRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.redstone), new ItemStack(Items.glowstone_dust), 300)); - redstoneToGlowstoneRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.glowstone_dust), new ItemStack(Items.redstone), 300)); + redstoneToGlowstoneRecipes = new ArrayList<>(); + redstoneToGlowstoneRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.REDSTONE), new ItemStack(Items.GLOWSTONE_DUST), 300)); + redstoneToGlowstoneRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.GLOWSTONE_DUST), new ItemStack(Items.REDSTONE), 300)); - sandRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Block.getBlockFromName("sand")), new ItemStack(Blocks.cobblestone), 50); - redSandRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Block.getBlockFromName("sand"), 1, 1), new ItemStack(Blocks.hardened_clay), 50); + sandRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Block.getBlockFromName("sand")), new ItemStack(Blocks.COBBLESTONE), 50); + redSandRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Block.getBlockFromName("sand"), 1, 1), new ItemStack(Blocks.HARDENED_CLAY), 50); - clayBreakdownRecipes = new ArrayList(); - clayBreakdownRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.clay_ball, 4), new ItemStack(Blocks.clay), 25)); - clayBreakdownRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.brick, 4), new ItemStack(Blocks.brick_block), 25)); + clayBreakdownRecipes = new ArrayList<>(); + clayBreakdownRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.CLAY_BALL, 4), new ItemStack(Blocks.CLAY), 25)); + clayBreakdownRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.BRICK, 4), new ItemStack(Blocks.BRICK_BLOCK), 25)); - coarseDirtRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.dirt, 1, 1), new ItemStack(Blocks.dirt), 120); + coarseDirtRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.DIRT, 1, 1), new ItemStack(Blocks.DIRT), 120); - prismarineRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(ModItems.manaResource, 1, 10), new ItemStack(Items.quartz), 200); + prismarineRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.PRISMARINE_SHARD), new ItemStack(Items.QUARTZ), 200); - if(ConfigHandler.stones18Enabled) { - stoneRecipes = new ArrayList(); - stoneRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(ModFluffBlocks.stone), "stone", 200)); - for(int i = 0; i < 4; i++) - stoneRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(ModFluffBlocks.stone, 1, i), new ItemStack(ModFluffBlocks.stone, 1, i == 0 ? 3 : i - 1), 200)); - } + stoneRecipes = new ArrayList<>(); + stoneRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.STONE, 1, 5), new ItemStack(Blocks.STONE), 200)); // Stone->Andesite + stoneRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.STONE, 1, 3), new ItemStack(Blocks.STONE, 1, 5), 200)); // Andesite->Diorite + stoneRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.STONE, 1, 1), new ItemStack(Blocks.STONE, 1, 3), 200)); // Diorite->Granite + stoneRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.STONE, 1, 5), new ItemStack(Blocks.STONE, 1, 1), 200)); // Granite->Andesite - tallgrassRecipes = new ArrayList(); - tallgrassRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.deadbush), new ItemStack(Blocks.tallgrass, 1, 2), 500)); - tallgrassRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.tallgrass, 1, 1), new ItemStack(Blocks.deadbush), 500)); - tallgrassRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.tallgrass, 1, 2), new ItemStack(Blocks.tallgrass, 1, 1), 500)); + tallgrassRecipes = new ArrayList<>(); + tallgrassRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.DEADBUSH), new ItemStack(Blocks.TALLGRASS, 1, 2), 500)); + tallgrassRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.TALLGRASS, 1, 1), new ItemStack(Blocks.DEADBUSH), 500)); + tallgrassRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.TALLGRASS, 1, 2), new ItemStack(Blocks.TALLGRASS, 1, 1), 500)); - flowersRecipes = new ArrayList(); - flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.red_flower), new ItemStack(Blocks.yellow_flower), 400)); - flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.red_flower, 1, 1), new ItemStack(Blocks.red_flower), 400)); - flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.red_flower, 1, 2), new ItemStack(Blocks.red_flower, 1, 1), 400)); - flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.red_flower, 1, 3), new ItemStack(Blocks.red_flower, 1, 2), 400)); - flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.red_flower, 1, 4), new ItemStack(Blocks.red_flower, 1, 3), 400)); - flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.red_flower, 1, 5), new ItemStack(Blocks.red_flower, 1, 4), 400)); - flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.red_flower, 1, 6), new ItemStack(Blocks.red_flower, 1, 5), 400)); - flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.red_flower, 1, 7), new ItemStack(Blocks.red_flower, 1, 6), 400)); - flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.red_flower, 1, 8), new ItemStack(Blocks.red_flower, 1, 7), 400)); - flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.double_plant), new ItemStack(Blocks.red_flower, 1, 8), 400)); - flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.double_plant, 1, 1), new ItemStack(Blocks.double_plant), 400)); - flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.double_plant, 1, 4), new ItemStack(Blocks.double_plant, 1, 1), 400)); - flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.double_plant, 1, 5), new ItemStack(Blocks.double_plant, 1, 4), 400)); - flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.yellow_flower), new ItemStack(Blocks.double_plant, 1, 5), 400)); + flowersRecipes = new ArrayList<>(); + flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.RED_FLOWER), new ItemStack(Blocks.YELLOW_FLOWER), 400)); + flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 1), new ItemStack(Blocks.RED_FLOWER), 400)); + flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 2), new ItemStack(Blocks.RED_FLOWER, 1, 1), 400)); + flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 3), new ItemStack(Blocks.RED_FLOWER, 1, 2), 400)); + flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 4), new ItemStack(Blocks.RED_FLOWER, 1, 3), 400)); + flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 5), new ItemStack(Blocks.RED_FLOWER, 1, 4), 400)); + flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 6), new ItemStack(Blocks.RED_FLOWER, 1, 5), 400)); + flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 7), new ItemStack(Blocks.RED_FLOWER, 1, 6), 400)); + flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 8), new ItemStack(Blocks.RED_FLOWER, 1, 7), 400)); + flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.DOUBLE_PLANT), new ItemStack(Blocks.RED_FLOWER, 1, 8), 400)); + flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.DOUBLE_PLANT, 1, 1), new ItemStack(Blocks.DOUBLE_PLANT), 400)); + flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.DOUBLE_PLANT, 1, 4), new ItemStack(Blocks.DOUBLE_PLANT, 1, 1), 400)); + flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.DOUBLE_PLANT, 1, 5), new ItemStack(Blocks.DOUBLE_PLANT, 1, 4), 400)); + flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.YELLOW_FLOWER), new ItemStack(Blocks.DOUBLE_PLANT, 1, 5), 400)); } } diff --git a/src/main/java/vazkii/botania/common/crafting/ModManaConjurationRecipes.java b/src/main/java/vazkii/botania/common/crafting/ModManaConjurationRecipes.java index 3923d2df1..fcbce4a27 100644 --- a/src/main/java/vazkii/botania/common/crafting/ModManaConjurationRecipes.java +++ b/src/main/java/vazkii/botania/common/crafting/ModManaConjurationRecipes.java @@ -10,9 +10,6 @@ */ package vazkii.botania.common.crafting; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -20,6 +17,9 @@ import net.minecraft.item.ItemStack; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.recipe.RecipeManaInfusion; +import java.util.ArrayList; +import java.util.List; + public class ModManaConjurationRecipes { public static RecipeManaInfusion redstoneRecipe; @@ -34,22 +34,22 @@ public class ModManaConjurationRecipes { public static RecipeManaInfusion grassRecipe; public static void init() { - redstoneRecipe = BotaniaAPI.registerManaConjurationRecipe(new ItemStack(Items.redstone, 2), new ItemStack(Items.redstone), 5000); - glowstoneRecipe = BotaniaAPI.registerManaConjurationRecipe(new ItemStack(Items.glowstone_dust, 2), new ItemStack(Items.glowstone_dust), 5000); - quartzRecipe = BotaniaAPI.registerManaConjurationRecipe(new ItemStack(Items.quartz, 2), new ItemStack(Items.quartz), 2500); - coalRecipe = BotaniaAPI.registerManaConjurationRecipe(new ItemStack(Items.coal, 2), new ItemStack(Items.coal), 2100); - snowballRecipe = BotaniaAPI.registerManaConjurationRecipe(new ItemStack(Items.snowball, 2), new ItemStack(Items.snowball), 200); - netherrackRecipe = BotaniaAPI.registerManaConjurationRecipe(new ItemStack(Blocks.netherrack, 2), new ItemStack(Blocks.netherrack), 200); - soulSandRecipe = BotaniaAPI.registerManaConjurationRecipe(new ItemStack(Blocks.soul_sand, 2), new ItemStack(Blocks.soul_sand), 1500); + redstoneRecipe = BotaniaAPI.registerManaConjurationRecipe(new ItemStack(Items.REDSTONE, 2), new ItemStack(Items.REDSTONE), 5000); + glowstoneRecipe = BotaniaAPI.registerManaConjurationRecipe(new ItemStack(Items.GLOWSTONE_DUST, 2), new ItemStack(Items.GLOWSTONE_DUST), 5000); + quartzRecipe = BotaniaAPI.registerManaConjurationRecipe(new ItemStack(Items.QUARTZ, 2), new ItemStack(Items.QUARTZ), 2500); + coalRecipe = BotaniaAPI.registerManaConjurationRecipe(new ItemStack(Items.COAL, 2), new ItemStack(Items.COAL), 2100); + snowballRecipe = BotaniaAPI.registerManaConjurationRecipe(new ItemStack(Items.SNOWBALL, 2), new ItemStack(Items.SNOWBALL), 200); + netherrackRecipe = BotaniaAPI.registerManaConjurationRecipe(new ItemStack(Blocks.NETHERRACK, 2), new ItemStack(Blocks.NETHERRACK), 200); + soulSandRecipe = BotaniaAPI.registerManaConjurationRecipe(new ItemStack(Blocks.SOUL_SAND, 2), new ItemStack(Blocks.SOUL_SAND), 1500); gravelRecipe = BotaniaAPI.registerManaConjurationRecipe(new ItemStack(Block.getBlockFromName("gravel"), 2), new ItemStack(Block.getBlockFromName("gravel")), 720); - leavesRecipes = new ArrayList(); + leavesRecipes = new ArrayList<>(); for(int i = 0; i < 4; i++) - leavesRecipes.add(BotaniaAPI.registerManaConjurationRecipe(new ItemStack(Blocks.leaves, 2, i), new ItemStack(Blocks.leaves, 1, i), 2000)); + leavesRecipes.add(BotaniaAPI.registerManaConjurationRecipe(new ItemStack(Blocks.LEAVES, 2, i), new ItemStack(Blocks.LEAVES, 1, i), 2000)); for(int i = 0; i < 2; i++) - leavesRecipes.add(BotaniaAPI.registerManaConjurationRecipe(new ItemStack(Blocks.leaves2, 2, i), new ItemStack(Blocks.leaves2, 1, i), 2000)); + leavesRecipes.add(BotaniaAPI.registerManaConjurationRecipe(new ItemStack(Blocks.LEAVES2, 2, i), new ItemStack(Blocks.LEAVES2, 1, i), 2000)); - grassRecipe = BotaniaAPI.registerManaConjurationRecipe(new ItemStack(Blocks.tallgrass, 2, 1), new ItemStack(Blocks.tallgrass, 1, 1), 800); + grassRecipe = BotaniaAPI.registerManaConjurationRecipe(new ItemStack(Blocks.TALLGRASS, 2, 1), new ItemStack(Blocks.TALLGRASS, 1, 1), 800); } } diff --git a/src/main/java/vazkii/botania/common/crafting/ModManaInfusionRecipes.java b/src/main/java/vazkii/botania/common/crafting/ModManaInfusionRecipes.java index 974c8377c..1e1d95c22 100644 --- a/src/main/java/vazkii/botania/common/crafting/ModManaInfusionRecipes.java +++ b/src/main/java/vazkii/botania/common/crafting/ModManaInfusionRecipes.java @@ -10,19 +10,20 @@ */ package vazkii.botania.common.crafting; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.recipe.RecipeManaInfusion; import vazkii.botania.common.Botania; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.item.ModItems; +import java.util.ArrayList; +import java.util.List; + public final class ModManaInfusionRecipes { public static List manasteelRecipes; @@ -43,48 +44,48 @@ public final class ModManaInfusionRecipes { public static RecipeManaInfusion sugarCaneRecipe; public static void init() { - manasteelRecipes = new ArrayList(); + manasteelRecipes = new ArrayList<>(); manasteelRecipes.add(BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaResource, 1, 0), "ingotIron", 3000)); - manasteelRecipes.add(BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModBlocks.storage, 1, 0), new ItemStack(Blocks.iron_block), 27000)); + manasteelRecipes.add(BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModBlocks.storage, 1, 0), new ItemStack(Blocks.IRON_BLOCK), 27000)); - manaPearlRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaResource, 1, 1), new ItemStack(Items.ender_pearl), 6000); + manaPearlRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaResource, 1, 1), new ItemStack(Items.ENDER_PEARL), 6000); - manaDiamondRecipes = new ArrayList(); + manaDiamondRecipes = new ArrayList<>(); manaDiamondRecipes.add(BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaResource, 1, 2), "gemDiamond", 10000)); - manaDiamondRecipes.add(BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModBlocks.storage, 1, 3), new ItemStack(Blocks.diamond_block), 90000)); + manaDiamondRecipes.add(BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModBlocks.storage, 1, 3), new ItemStack(Blocks.DIAMOND_BLOCK), 90000)); - manaPowderRecipes = new ArrayList(); - manaPowderRecipes.add(BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaResource, 1, 23), new ItemStack(Items.gunpowder), 500)); - manaPowderRecipes.add(BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaResource, 1, 23), new ItemStack(Items.redstone), 500)); - manaPowderRecipes.add(BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaResource, 1, 23), new ItemStack(Items.glowstone_dust), 500)); - manaPowderRecipes.add(BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaResource, 1, 23), new ItemStack(Items.sugar), 500)); + manaPowderRecipes = new ArrayList<>(); + manaPowderRecipes.add(BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaResource, 1, 23), new ItemStack(Items.GUNPOWDER), 500)); + manaPowderRecipes.add(BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaResource, 1, 23), new ItemStack(Items.REDSTONE), 500)); + manaPowderRecipes.add(BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaResource, 1, 23), new ItemStack(Items.GLOWSTONE_DUST), 500)); + manaPowderRecipes.add(BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaResource, 1, 23), new ItemStack(Items.SUGAR), 500)); for(int i = 0; i < 16; i++) manaPowderRecipes.add(BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaResource, 1, 23), new ItemStack(ModItems.dye, 1, i), 400)); - pistonRelayRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModBlocks.pistonRelay), new ItemStack(Blocks.piston), 15000); - manaCookieRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaCookie), new ItemStack(Items.cookie), 20000); - grassSeedsRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.grassSeeds), new ItemStack(Blocks.tallgrass, 1, 1), 2500); - podzolSeedsRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.grassSeeds, 1, 1), new ItemStack(Blocks.deadbush), 2500); + pistonRelayRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModBlocks.pistonRelay), new ItemStack(Blocks.PISTON), 15000); + manaCookieRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaCookie), new ItemStack(Items.COOKIE), 20000); + grassSeedsRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.grassSeeds), new ItemStack(Blocks.TALLGRASS, 1, 1), 2500); + podzolSeedsRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.grassSeeds, 1, 1), new ItemStack(Blocks.DEADBUSH), 2500); - mycelSeedsRecipes = new ArrayList(); - mycelSeedsRecipes.add(BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.grassSeeds, 1, 2), new ItemStack(Blocks.red_mushroom), 6500)); - mycelSeedsRecipes.add(BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.grassSeeds, 1, 2), new ItemStack(Blocks.brown_mushroom), 6500)); + mycelSeedsRecipes = new ArrayList<>(); + mycelSeedsRecipes.add(BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.grassSeeds, 1, 2), new ItemStack(Blocks.RED_MUSHROOM), 6500)); + mycelSeedsRecipes.add(BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.grassSeeds, 1, 2), new ItemStack(Blocks.BROWN_MUSHROOM), 6500)); - manaQuartzRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.quartz, 1, 1), new ItemStack(Items.quartz), 250); - tinyPotatoRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModBlocks.tinyPotato), new ItemStack(Items.potato), 1337); + manaQuartzRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.quartz, 1, 1), new ItemStack(Items.QUARTZ), 250); + tinyPotatoRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModBlocks.tinyPotato), new ItemStack(Items.POTATO), 1337); if(Botania.thaumcraftLoaded) { - Item inkwell = (Item) Item.itemRegistry.getObject("Thaumcraft:ItemInkwell"); + Item inkwell = Item.REGISTRY.getObject(new ResourceLocation("thaumcraft", "scribing_tools")); manaInkwellRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaInkwell, 1, ModItems.manaInkwell.getMaxDamage()), new ItemStack(inkwell), 35000); } - managlassRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModBlocks.manaGlass), new ItemStack(Blocks.glass), 150); - manaStringRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaResource, 1, 16), new ItemStack(Items.string), 5000); + managlassRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModBlocks.manaGlass), new ItemStack(Blocks.GLASS), 150); + manaStringRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaResource, 1, 16), new ItemStack(Items.STRING), 5000); if(Botania.gardenOfGlassLoaded) - sugarCaneRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(Items.reeds), new ItemStack(Blocks.hay_block), 2000); + sugarCaneRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(Items.REEDS), new ItemStack(Blocks.HAY_BLOCK), 2000); - BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaBottle), new ItemStack(Items.glass_bottle), 5000); + BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaBottle), new ItemStack(Items.GLASS_BOTTLE), 5000); } } diff --git a/src/main/java/vazkii/botania/common/crafting/ModMigrationRecipes.java b/src/main/java/vazkii/botania/common/crafting/ModMigrationRecipes.java new file mode 100644 index 000000000..2c83807c3 --- /dev/null +++ b/src/main/java/vazkii/botania/common/crafting/ModMigrationRecipes.java @@ -0,0 +1,20 @@ +package vazkii.botania.common.crafting; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fml.common.registry.GameRegistry; +import vazkii.botania.common.item.ModItems; + +/** + * Migration recipes for things that will be removed in the future + */ +public final class ModMigrationRecipes { + + public static void init() { + // Prismarine -> vanilla + GameRegistry.addShapelessRecipe(new ItemStack(Items.PRISMARINE_SHARD), new ItemStack(ModItems.manaResource, 1, 10)); + } + + private ModMigrationRecipes() {} + +} diff --git a/src/main/java/vazkii/botania/common/crafting/ModPetalRecipes.java b/src/main/java/vazkii/botania/common/crafting/ModPetalRecipes.java index 696dbd6e8..61366e49d 100644 --- a/src/main/java/vazkii/botania/common/crafting/ModPetalRecipes.java +++ b/src/main/java/vazkii/botania/common/crafting/ModPetalRecipes.java @@ -10,8 +10,6 @@ */ package vazkii.botania.common.crafting; -import java.util.Arrays; - import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import vazkii.botania.api.BotaniaAPI; @@ -23,6 +21,8 @@ import vazkii.botania.common.item.block.ItemBlockSpecialFlower; import vazkii.botania.common.lib.LibBlockNames; import vazkii.botania.common.lib.LibOreDict; +import java.util.Arrays; + public final class ModPetalRecipes { public static final String white = LibOreDict.PETAL[0], orange = LibOreDict.PETAL[1], magenta = LibOreDict.PETAL[2], lightBlue = LibOreDict.PETAL[3], yellow = LibOreDict.PETAL[4], lime = LibOreDict.PETAL[5], pink = LibOreDict.PETAL[6], gray = LibOreDict.PETAL[7], lightGray = LibOreDict.PETAL[8], cyan = LibOreDict.PETAL[9], purple = LibOreDict.PETAL[10], blue = LibOreDict.PETAL[11], brown = LibOreDict.PETAL[12], green = LibOreDict.PETAL[13], red = LibOreDict.PETAL[14], black = LibOreDict.PETAL[15]; @@ -75,13 +75,12 @@ public final class ModPetalRecipes { public static RecipePetals marimorphosisRecipe; public static RecipePetals bubbellRecipe; public static RecipePetals solegnoliaRecipe; + public static RecipePetals bergamuteRecipe; public static void init() { pureDaisyRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_PUREDAISY), white, white, white, white); manastarRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_MANASTAR), lightBlue, green, red, cyan); - daybloomRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_DAYBLOOM), yellow, yellow, orange, lightBlue); - nightshadeRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_NIGHTSHADE), black, black, purple, gray); endoflameRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_ENDOFLAME), brown, brown, red, lightGray, manaPowder); hydroangeasRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_HYDROANGEAS), blue, blue, cyan, cyan, manaPowder); thermalilyRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_THERMALILY), red, orange, orange, runeEarth, runeFire); @@ -125,8 +124,9 @@ public final class ModPetalRecipes { marimorphosisRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_MARIMORPHOSIS), gray, yellow, green, red, runeEarth, runeFire, redstoneRoot); bubbellRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_BUBBELL), cyan, cyan, lightBlue, lightBlue, blue, blue, runeWater, runeSummer, pixieDust); solegnoliaRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_SOLEGNOLIA), brown, brown, red, blue, redstoneRoot); + bergamuteRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_BERGAMUTE), orange, green, green, redstoneRoot); // todo temporary - ItemStack stack = new ItemStack(Items.skull, 1, 3); + ItemStack stack = new ItemStack(Items.SKULL, 1, 3); ItemNBTHelper.setString(stack, "SkullOwner", "Vazkii"); Object[] inputs = new Object[16]; Arrays.fill(inputs, pink); diff --git a/src/main/java/vazkii/botania/common/crafting/ModPureDaisyRecipes.java b/src/main/java/vazkii/botania/common/crafting/ModPureDaisyRecipes.java index eb846ed31..0c2f02505 100644 --- a/src/main/java/vazkii/botania/common/crafting/ModPureDaisyRecipes.java +++ b/src/main/java/vazkii/botania/common/crafting/ModPureDaisyRecipes.java @@ -18,14 +18,14 @@ import vazkii.botania.common.lib.LibOreDict; public final class ModPureDaisyRecipes { public static void init() { - BotaniaAPI.registerPureDaisyRecipe("stone", ModBlocks.livingrock, 0); - BotaniaAPI.registerPureDaisyRecipe("logWood", ModBlocks.livingwood, 0); + BotaniaAPI.registerPureDaisyRecipe("stone", ModBlocks.livingrock.getDefaultState()); + BotaniaAPI.registerPureDaisyRecipe("logWood", ModBlocks.livingwood.getDefaultState()); - BotaniaAPI.registerPureDaisyRecipe("netherrack", Blocks.cobblestone, 0); - BotaniaAPI.registerPureDaisyRecipe("soulSand", Blocks.sand, 0); - BotaniaAPI.registerPureDaisyRecipe("ice", Blocks.packed_ice, 0); - BotaniaAPI.registerPureDaisyRecipe(LibOreDict.BLAZE_BLOCK, Blocks.obsidian, 0); - BotaniaAPI.registerPureDaisyRecipe(Blocks.water, Blocks.snow, 0); + BotaniaAPI.registerPureDaisyRecipe("netherrack", Blocks.COBBLESTONE.getDefaultState()); + BotaniaAPI.registerPureDaisyRecipe("soulSand", Blocks.SAND.getDefaultState()); + BotaniaAPI.registerPureDaisyRecipe("ice", Blocks.PACKED_ICE.getDefaultState()); + BotaniaAPI.registerPureDaisyRecipe(LibOreDict.BLAZE_BLOCK, Blocks.OBSIDIAN.getDefaultState()); + BotaniaAPI.registerPureDaisyRecipe(Blocks.WATER, Blocks.SNOW.getDefaultState()); } } diff --git a/src/main/java/vazkii/botania/common/crafting/ModRuneRecipes.java b/src/main/java/vazkii/botania/common/crafting/ModRuneRecipes.java index defe59666..276cc75bb 100644 --- a/src/main/java/vazkii/botania/common/crafting/ModRuneRecipes.java +++ b/src/main/java/vazkii/botania/common/crafting/ModRuneRecipes.java @@ -10,9 +10,6 @@ */ package vazkii.botania.common.crafting; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -23,6 +20,9 @@ import vazkii.botania.common.crafting.recipe.HeadRecipe; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.lib.LibOreDict; +import java.util.ArrayList; +import java.util.List; + public final class ModRuneRecipes { public static RecipeRuneAltar recipeWaterRune; @@ -49,24 +49,24 @@ public final class ModRuneRecipes { final int costTier2 = 8000; final int costTier3 = 12000; - recipeWaterRune = BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 2, 0), costTier1, LibOreDict.MANA_POWDER, LibOreDict.MANA_STEEL, new ItemStack(Items.dye, 1, 15), new ItemStack(Items.reeds), new ItemStack(Items.fishing_rod)); - recipeFireRune = BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 2, 1), costTier1, LibOreDict.MANA_POWDER, LibOreDict.MANA_STEEL, new ItemStack(Items.netherbrick), new ItemStack(Items.gunpowder), new ItemStack(Items.nether_wart)); + recipeWaterRune = BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 2, 0), costTier1, LibOreDict.MANA_POWDER, LibOreDict.MANA_STEEL, new ItemStack(Items.DYE, 1, 15), new ItemStack(Items.REEDS), new ItemStack(Items.FISHING_ROD)); + recipeFireRune = BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 2, 1), costTier1, LibOreDict.MANA_POWDER, LibOreDict.MANA_STEEL, new ItemStack(Items.NETHERBRICK), new ItemStack(Items.GUNPOWDER), new ItemStack(Items.NETHER_WART)); - recipesEarthRune = new ArrayList(); - recipesEarthRune.add(BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 2, 2), costTier1, LibOreDict.MANA_POWDER, LibOreDict.MANA_STEEL, "stone", new ItemStack(Blocks.coal_block), new ItemStack(Blocks.brown_mushroom))); - recipesEarthRune.add(BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 2, 2), costTier1, LibOreDict.MANA_POWDER, LibOreDict.MANA_STEEL, "stone", new ItemStack(Blocks.coal_block), new ItemStack(Blocks.red_mushroom))); + recipesEarthRune = new ArrayList<>(); + recipesEarthRune.add(BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 2, 2), costTier1, LibOreDict.MANA_POWDER, LibOreDict.MANA_STEEL, "stone", new ItemStack(Blocks.COAL_BLOCK), new ItemStack(Blocks.BROWN_MUSHROOM))); + recipesEarthRune.add(BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 2, 2), costTier1, LibOreDict.MANA_POWDER, LibOreDict.MANA_STEEL, "stone", new ItemStack(Blocks.COAL_BLOCK), new ItemStack(Blocks.RED_MUSHROOM))); - recipesAirRune = new ArrayList(); + recipesAirRune = new ArrayList<>(); for(int i = 0; i < 16; i++) - recipesAirRune.add(BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 2, 3), costTier1, LibOreDict.MANA_POWDER, LibOreDict.MANA_STEEL, new ItemStack(Blocks.carpet, 1, i), new ItemStack(Items.feather), new ItemStack(Items.string))); + recipesAirRune.add(BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 2, 3), costTier1, LibOreDict.MANA_POWDER, LibOreDict.MANA_STEEL, new ItemStack(Blocks.CARPET, 1, i), new ItemStack(Items.FEATHER), new ItemStack(Items.STRING))); - recipeSpringRune = BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 1, 4), costTier2, LibOreDict.RUNE[0], LibOreDict.RUNE[1], "treeSapling", "treeSapling", "treeSapling", new ItemStack(Items.wheat)); - recipeSummerRune = BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 1, 5), costTier2, LibOreDict.RUNE[2], LibOreDict.RUNE[3], new ItemStack(Block.getBlockFromName("sand")), new ItemStack(Block.getBlockFromName("sand")), new ItemStack(Items.slime_ball), new ItemStack(Items.melon)); - recipeAutumnRune = BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 1, 6), costTier2, LibOreDict.RUNE[1], LibOreDict.RUNE[3], "treeLeaves", "treeLeaves", "treeLeaves", new ItemStack(Items.spider_eye)); + recipeSpringRune = BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 1, 4), costTier2, LibOreDict.RUNE[0], LibOreDict.RUNE[1], "treeSapling", "treeSapling", "treeSapling", new ItemStack(Items.WHEAT)); + recipeSummerRune = BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 1, 5), costTier2, LibOreDict.RUNE[2], LibOreDict.RUNE[3], new ItemStack(Block.getBlockFromName("sand")), new ItemStack(Block.getBlockFromName("sand")), new ItemStack(Items.SLIME_BALL), new ItemStack(Items.MELON)); + recipeAutumnRune = BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 1, 6), costTier2, LibOreDict.RUNE[1], LibOreDict.RUNE[3], "treeLeaves", "treeLeaves", "treeLeaves", new ItemStack(Items.SPIDER_EYE)); - recipesWinterRune = new ArrayList(); + recipesWinterRune = new ArrayList<>(); for(int i = 0; i < 16; i++) - recipesWinterRune.add(BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 1, 7), costTier2, LibOreDict.RUNE[0], LibOreDict.RUNE[2], new ItemStack(Blocks.snow), new ItemStack(Blocks.snow), new ItemStack(Blocks.wool, 1, i), new ItemStack(Items.cake))); + recipesWinterRune.add(BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 1, 7), costTier2, LibOreDict.RUNE[0], LibOreDict.RUNE[2], new ItemStack(Blocks.SNOW), new ItemStack(Blocks.SNOW), new ItemStack(Blocks.WOOL, 1, i), new ItemStack(Items.CAKE))); recipeManaRune = BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 1, 8), costTier2, LibOreDict.MANA_STEEL, LibOreDict.MANA_STEEL, LibOreDict.MANA_STEEL, LibOreDict.MANA_STEEL, LibOreDict.MANA_STEEL, LibOreDict.MANA_PEARL); @@ -78,7 +78,7 @@ public final class ModRuneRecipes { recipeEnvyRune = BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 1, 14), costTier3, LibOreDict.MANA_DIAMOND, LibOreDict.MANA_DIAMOND, LibOreDict.RUNE[7], LibOreDict.RUNE[0]); recipePrideRune = BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 1, 15), costTier3, LibOreDict.MANA_DIAMOND, LibOreDict.MANA_DIAMOND, LibOreDict.RUNE[5], LibOreDict.RUNE[1]); - recipeHead = new HeadRecipe(new ItemStack(Items.skull, 1, 3), 22500, new ItemStack(Items.skull), LibOreDict.PIXIE_DUST, LibOreDict.PRISMARINE_SHARD, new ItemStack(Items.name_tag), new ItemStack(Items.golden_apple)); + recipeHead = new HeadRecipe(new ItemStack(Items.SKULL, 1, 3), 22500, new ItemStack(Items.SKULL), LibOreDict.PIXIE_DUST, LibOreDict.PRISMARINE_SHARD, new ItemStack(Items.NAME_TAG), new ItemStack(Items.GOLDEN_APPLE)); BotaniaAPI.runeAltarRecipes.add(recipeHead); } } diff --git a/src/main/java/vazkii/botania/common/crafting/recipe/AesirRingRecipe.java b/src/main/java/vazkii/botania/common/crafting/recipe/AesirRingRecipe.java index 5f784a685..d332d4154 100644 --- a/src/main/java/vazkii/botania/common/crafting/recipe/AesirRingRecipe.java +++ b/src/main/java/vazkii/botania/common/crafting/recipe/AesirRingRecipe.java @@ -14,13 +14,17 @@ import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; import vazkii.botania.api.item.IRelic; import vazkii.botania.common.item.ModItems; +import javax.annotation.Nonnull; +import java.util.UUID; + public class AesirRingRecipe implements IRecipe { @Override - public boolean matches(InventoryCrafting var1, World var2) { + public boolean matches(@Nonnull InventoryCrafting var1, @Nonnull World var2) { boolean foundThorRing = false; boolean foundOdinRing = false; boolean foundLokiRing = false; @@ -42,24 +46,39 @@ public class AesirRingRecipe implements IRecipe { } @Override - public ItemStack getCraftingResult(InventoryCrafting var1) { + public ItemStack getCraftingResult(@Nonnull InventoryCrafting var1) { String soulbind = null; + UUID soulbindUUID = null; + boolean hasUUID = false; for(int i = 0; i < var1.getSizeInventory(); i++) { ItemStack stack = var1.getStackInSlot(i); if(stack != null) { if(stack.getItem() instanceof IRelic) { - String bind = ((IRelic) stack.getItem()).getSoulbindUsername(stack); - if(soulbind == null) - soulbind = bind; - else if(!soulbind.equals(bind)) - return null; + if(((IRelic) stack.getItem()).hasUUID(stack)) { + hasUUID = true; + UUID bindUUID = ((IRelic) stack.getItem()).getSoulbindUUID(stack); + if(soulbindUUID == null) + soulbindUUID = bindUUID; + else if(!soulbindUUID.equals(bindUUID)) + return null; + } + else { + String bind = ((IRelic) stack.getItem()).getSoulbindUsername(stack); + if(soulbind == null) + soulbind = bind; + else if(!soulbind.equals(bind)) + return null; + } } else return null; } } ItemStack stack = new ItemStack(ModItems.aesirRing); - ((IRelic) ModItems.aesirRing).bindToUsername(soulbind, stack); + if(hasUUID) + ((IRelic) ModItems.aesirRing).bindToUUID(soulbindUUID, stack); + else + ((IRelic) ModItems.aesirRing).bindToUsername(soulbind, stack); return stack; } @@ -73,4 +92,10 @@ public class AesirRingRecipe implements IRecipe { return null; } + @Nonnull + @Override + public ItemStack[] getRemainingItems(@Nonnull InventoryCrafting inv) { + return ForgeHooks.defaultRecipeGetRemainingItems(inv); + } + } diff --git a/src/main/java/vazkii/botania/common/crafting/recipe/AncientWillRecipe.java b/src/main/java/vazkii/botania/common/crafting/recipe/AncientWillRecipe.java index 15a972168..4164646c2 100644 --- a/src/main/java/vazkii/botania/common/crafting/recipe/AncientWillRecipe.java +++ b/src/main/java/vazkii/botania/common/crafting/recipe/AncientWillRecipe.java @@ -14,13 +14,16 @@ import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; import vazkii.botania.api.item.IAncientWillContainer; import vazkii.botania.common.item.ModItems; +import javax.annotation.Nonnull; + public class AncientWillRecipe implements IRecipe { @Override - public boolean matches(InventoryCrafting var1, World var2) { + public boolean matches(@Nonnull InventoryCrafting var1, @Nonnull World var2) { boolean foundWill = false; boolean foundItem = false; @@ -41,7 +44,7 @@ public class AncientWillRecipe implements IRecipe { } @Override - public ItemStack getCraftingResult(InventoryCrafting var1) { + public ItemStack getCraftingResult(@Nonnull InventoryCrafting var1) { ItemStack item = null; int will = -1; @@ -73,4 +76,9 @@ public class AncientWillRecipe implements IRecipe { return null; } + @Nonnull + @Override + public ItemStack[] getRemainingItems(@Nonnull InventoryCrafting inv) { + return ForgeHooks.defaultRecipeGetRemainingItems(inv); + } } diff --git a/src/main/java/vazkii/botania/common/crafting/recipe/ArmorUpgradeRecipe.java b/src/main/java/vazkii/botania/common/crafting/recipe/ArmorUpgradeRecipe.java new file mode 100644 index 000000000..98a9a70d5 --- /dev/null +++ b/src/main/java/vazkii/botania/common/crafting/recipe/ArmorUpgradeRecipe.java @@ -0,0 +1,41 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + * + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + * + * File Created @ [Apr 4, 2016, 7:49:08 PM (EST)] + */ +package vazkii.botania.common.crafting.recipe; + +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.ShapedOreRecipe; +import vazkii.botania.common.core.helper.ItemNBTHelper; + +public class ArmorUpgradeRecipe extends ShapedOreRecipe { + + public ArmorUpgradeRecipe(ItemStack output, Object... inputs) { + super(output, inputs); + } + + @Override + public ItemStack getCraftingResult(InventoryCrafting var1) { + ItemStack out = output.copy(); + for (int i = 0; i < var1.getSizeInventory(); i++) { + ItemStack stack = var1.getStackInSlot(i); + if (stack != null && stack.getItem() instanceof ItemArmor && stack.hasTagCompound()) { + EnchantmentHelper.setEnchantments(EnchantmentHelper.getEnchantments(stack), out); + byte runicHardening = ItemNBTHelper.getByte(stack, "RS.HARDEN", (byte)0); + if (runicHardening != 0) + ItemNBTHelper.setByte(out, "RS.HARDEN", runicHardening); + break; + } + } + return out; + } +} diff --git a/src/main/java/vazkii/botania/common/crafting/recipe/BlackHoleTalismanExtractRecipe.java b/src/main/java/vazkii/botania/common/crafting/recipe/BlackHoleTalismanExtractRecipe.java index 294001eff..ef86d804e 100644 --- a/src/main/java/vazkii/botania/common/crafting/recipe/BlackHoleTalismanExtractRecipe.java +++ b/src/main/java/vazkii/botania/common/crafting/recipe/BlackHoleTalismanExtractRecipe.java @@ -15,13 +15,16 @@ import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; import vazkii.botania.common.item.ItemBlackHoleTalisman; import vazkii.botania.common.item.ModItems; +import javax.annotation.Nonnull; + public class BlackHoleTalismanExtractRecipe implements IRecipe { @Override - public boolean matches(InventoryCrafting var1, World var2) { + public boolean matches(@Nonnull InventoryCrafting var1, @Nonnull World var2) { boolean foundTalisman = false; for(int i = 0; i < var1.getSizeInventory(); i++) { @@ -37,7 +40,7 @@ public class BlackHoleTalismanExtractRecipe implements IRecipe { } @Override - public ItemStack getCraftingResult(InventoryCrafting var1) { + public ItemStack getCraftingResult(@Nonnull InventoryCrafting var1) { ItemStack talisman = null; for(int i = 0; i < var1.getSizeInventory(); i++) { @@ -66,4 +69,9 @@ public class BlackHoleTalismanExtractRecipe implements IRecipe { return null; } + @Nonnull + @Override + public ItemStack[] getRemainingItems(@Nonnull InventoryCrafting inv) { + return ForgeHooks.defaultRecipeGetRemainingItems(inv); + } } diff --git a/src/main/java/vazkii/botania/common/crafting/recipe/CompositeLensRecipe.java b/src/main/java/vazkii/botania/common/crafting/recipe/CompositeLensRecipe.java index 7fc42916b..3b84a0a64 100644 --- a/src/main/java/vazkii/botania/common/crafting/recipe/CompositeLensRecipe.java +++ b/src/main/java/vazkii/botania/common/crafting/recipe/CompositeLensRecipe.java @@ -15,14 +15,17 @@ import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; import vazkii.botania.api.mana.ICompositableLens; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.item.lens.ItemLens; +import javax.annotation.Nonnull; + public class CompositeLensRecipe implements IRecipe { @Override - public boolean matches(InventoryCrafting var1, World var2) { + public boolean matches(@Nonnull InventoryCrafting var1, @Nonnull World var2) { boolean foundLens = false; boolean foundSecondLens = false; boolean foundSlimeball = false; @@ -34,7 +37,7 @@ public class CompositeLensRecipe implements IRecipe { if(foundLens) foundSecondLens = true; else foundLens = true; - } else if(stack.getItem() == Items.slime_ball) + } else if(stack.getItem() == Items.SLIME_BALL) foundSlimeball = true; else return false; // Found an invalid item, breaking the recipe } @@ -44,7 +47,7 @@ public class CompositeLensRecipe implements IRecipe { } @Override - public ItemStack getCraftingResult(InventoryCrafting var1) { + public ItemStack getCraftingResult(@Nonnull InventoryCrafting var1) { ItemStack lens = null; ItemStack secondLens = null; @@ -81,4 +84,10 @@ public class CompositeLensRecipe implements IRecipe { public ItemStack getRecipeOutput() { return null; } + + @Nonnull + @Override + public ItemStack[] getRemainingItems(@Nonnull InventoryCrafting inv) { + return ForgeHooks.defaultRecipeGetRemainingItems(inv); + } } \ No newline at end of file diff --git a/src/main/java/vazkii/botania/common/crafting/recipe/CosmeticAttachRecipe.java b/src/main/java/vazkii/botania/common/crafting/recipe/CosmeticAttachRecipe.java index 3803e08b1..44a305842 100644 --- a/src/main/java/vazkii/botania/common/crafting/recipe/CosmeticAttachRecipe.java +++ b/src/main/java/vazkii/botania/common/crafting/recipe/CosmeticAttachRecipe.java @@ -14,13 +14,16 @@ import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; import vazkii.botania.api.item.ICosmeticAttachable; import vazkii.botania.api.item.ICosmeticBauble; +import javax.annotation.Nonnull; + public class CosmeticAttachRecipe implements IRecipe { @Override - public boolean matches(InventoryCrafting var1, World var2) { + public boolean matches(@Nonnull InventoryCrafting var1, @Nonnull World var2) { boolean foundCosmetic = false; boolean foundAttachable = false; @@ -41,7 +44,7 @@ public class CosmeticAttachRecipe implements IRecipe { } @Override - public ItemStack getCraftingResult(InventoryCrafting var1) { + public ItemStack getCraftingResult(@Nonnull InventoryCrafting var1) { ItemStack cosmeticItem = null; ItemStack attachableItem = null; @@ -72,4 +75,10 @@ public class CosmeticAttachRecipe implements IRecipe { public ItemStack getRecipeOutput() { return null; } + + @Nonnull + @Override + public ItemStack[] getRemainingItems(@Nonnull InventoryCrafting inv) { + return ForgeHooks.defaultRecipeGetRemainingItems(inv); + } } diff --git a/src/main/java/vazkii/botania/common/crafting/recipe/CosmeticRemoveRecipe.java b/src/main/java/vazkii/botania/common/crafting/recipe/CosmeticRemoveRecipe.java index af26d305f..1bc4b2c85 100644 --- a/src/main/java/vazkii/botania/common/crafting/recipe/CosmeticRemoveRecipe.java +++ b/src/main/java/vazkii/botania/common/crafting/recipe/CosmeticRemoveRecipe.java @@ -14,13 +14,16 @@ import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; import vazkii.botania.api.item.ICosmeticAttachable; import vazkii.botania.api.item.ICosmeticBauble; +import javax.annotation.Nonnull; + public class CosmeticRemoveRecipe implements IRecipe { @Override - public boolean matches(InventoryCrafting var1, World var2) { + public boolean matches(@Nonnull InventoryCrafting var1, @Nonnull World var2) { boolean foundAttachable = false; for(int i = 0; i < var1.getSizeInventory(); i++) { @@ -36,7 +39,7 @@ public class CosmeticRemoveRecipe implements IRecipe { } @Override - public ItemStack getCraftingResult(InventoryCrafting var1) { + public ItemStack getCraftingResult(@Nonnull InventoryCrafting var1) { ItemStack attachableItem = null; for(int i = 0; i < var1.getSizeInventory(); i++) { @@ -64,4 +67,9 @@ public class CosmeticRemoveRecipe implements IRecipe { return null; } + @Nonnull + @Override + public ItemStack[] getRemainingItems(@Nonnull InventoryCrafting inv) { + return ForgeHooks.defaultRecipeGetRemainingItems(inv); + } } diff --git a/src/main/java/vazkii/botania/common/crafting/recipe/HeadRecipe.java b/src/main/java/vazkii/botania/common/crafting/recipe/HeadRecipe.java index 5472e75ad..75318f07f 100644 --- a/src/main/java/vazkii/botania/common/crafting/recipe/HeadRecipe.java +++ b/src/main/java/vazkii/botania/common/crafting/recipe/HeadRecipe.java @@ -11,9 +11,9 @@ package vazkii.botania.common.crafting.recipe; import net.minecraft.init.Items; -import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; +import net.minecraft.util.text.translation.I18n; +import net.minecraftforge.items.IItemHandler; import vazkii.botania.api.recipe.RecipeRuneAltar; import vazkii.botania.common.core.helper.ItemNBTHelper; @@ -26,18 +26,18 @@ public class HeadRecipe extends RecipeRuneAltar { } @Override - public boolean matches(IInventory inv) { + public boolean matches(IItemHandler inv) { boolean matches = super.matches(inv); if(matches) { - for(int i = 0; i < inv.getSizeInventory(); i++) { + for(int i = 0; i < inv.getSlots(); i++) { ItemStack stack = inv.getStackInSlot(i); if(stack == null) break; - if(stack.getItem() == Items.name_tag) { + if(stack.getItem() == Items.NAME_TAG) { name = stack.getDisplayName(); - if(name.equals(StatCollector.translateToLocal("item.nameTag.name"))) + if(name.equals(I18n.translateToLocal("item.nameTag.name"))) return false; } } @@ -48,7 +48,7 @@ public class HeadRecipe extends RecipeRuneAltar { @Override public ItemStack getOutput() { - ItemStack stack = new ItemStack(Items.skull, 1, 3); + ItemStack stack = new ItemStack(Items.SKULL, 1, 3); if(!name.isEmpty()) ItemNBTHelper.setString(stack, "SkullOwner", name); return stack; diff --git a/src/main/java/vazkii/botania/common/crafting/recipe/HelmRevealingRecipe.java b/src/main/java/vazkii/botania/common/crafting/recipe/HelmRevealingRecipe.java index 0ac847be8..2ec883464 100644 --- a/src/main/java/vazkii/botania/common/crafting/recipe/HelmRevealingRecipe.java +++ b/src/main/java/vazkii/botania/common/crafting/recipe/HelmRevealingRecipe.java @@ -15,15 +15,19 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.item.ModItems; +import javax.annotation.Nonnull; + public class HelmRevealingRecipe implements IRecipe { @Override - public boolean matches(InventoryCrafting var1, World var2) { - Item goggles = (Item) Item.itemRegistry.getObject("Thaumcraft:ItemGoggles"); + public boolean matches(@Nonnull InventoryCrafting var1, @Nonnull World var2) { + Item goggles = Item.REGISTRY.getObject(new ResourceLocation("thaumcraft", "goggles")); if(goggles == null) return false; // NO TC loaded @@ -43,7 +47,7 @@ public class HelmRevealingRecipe implements IRecipe { } @Override - public ItemStack getCraftingResult(InventoryCrafting var1) { + public ItemStack getCraftingResult(@Nonnull InventoryCrafting var1) { ItemStack helm = null; for(int i = 0; i < var1.getSizeInventory(); i++) { @@ -100,4 +104,9 @@ public class HelmRevealingRecipe implements IRecipe { return helmItem == ModItems.manasteelHelm || helmItem == ModItems.terrasteelHelm || helmItem == ModItems.elementiumHelm; } + @Nonnull + @Override + public ItemStack[] getRemainingItems(@Nonnull InventoryCrafting inv) { + return ForgeHooks.defaultRecipeGetRemainingItems(inv); + } } \ No newline at end of file diff --git a/src/main/java/vazkii/botania/common/crafting/recipe/KeepIvyRecipe.java b/src/main/java/vazkii/botania/common/crafting/recipe/KeepIvyRecipe.java index 6b60ef83b..295660da9 100644 --- a/src/main/java/vazkii/botania/common/crafting/recipe/KeepIvyRecipe.java +++ b/src/main/java/vazkii/botania/common/crafting/recipe/KeepIvyRecipe.java @@ -14,14 +14,17 @@ import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.item.ItemKeepIvy; import vazkii.botania.common.item.ModItems; +import javax.annotation.Nonnull; + public class KeepIvyRecipe implements IRecipe { @Override - public boolean matches(InventoryCrafting var1, World var2) { + public boolean matches(@Nonnull InventoryCrafting var1, @Nonnull World var2) { boolean foundIvy = false; boolean foundItem = false; @@ -40,7 +43,7 @@ public class KeepIvyRecipe implements IRecipe { } @Override - public ItemStack getCraftingResult(InventoryCrafting var1) { + public ItemStack getCraftingResult(@Nonnull InventoryCrafting var1) { ItemStack item = null; for(int i = 0; i < var1.getSizeInventory(); i++) { @@ -65,4 +68,9 @@ public class KeepIvyRecipe implements IRecipe { return null; } + @Nonnull + @Override + public ItemStack[] getRemainingItems(@Nonnull InventoryCrafting inv) { + return ForgeHooks.defaultRecipeGetRemainingItems(inv); + } } diff --git a/src/main/java/vazkii/botania/common/crafting/recipe/LensDyeingRecipe.java b/src/main/java/vazkii/botania/common/crafting/recipe/LensDyeingRecipe.java index 4f1fab8f9..6ee297ea1 100644 --- a/src/main/java/vazkii/botania/common/crafting/recipe/LensDyeingRecipe.java +++ b/src/main/java/vazkii/botania/common/crafting/recipe/LensDyeingRecipe.java @@ -10,26 +10,26 @@ */ package vazkii.botania.common.crafting.recipe; -import java.util.Arrays; -import java.util.List; - import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; import net.minecraftforge.oredict.OreDictionary; import vazkii.botania.api.mana.ILens; import vazkii.botania.common.item.lens.ItemLens; import vazkii.botania.common.lib.LibOreDict; +import javax.annotation.Nonnull; +import java.util.Arrays; +import java.util.List; + public class LensDyeingRecipe implements IRecipe { - private static final List DYES = Arrays.asList(new String[] { - "dyeWhite", "dyeOrange", "dyeMagenta", "dyeLightBlue", "dyeYellow", "dyeLime", "dyePink", "dyeGray", "dyeLightGray", "dyeCyan", "dyePurple", "dyeBlue", "dyeBrown", "dyeGreen", "dyeRed", "dyeBlack", LibOreDict.MANA_PEARL - }); + private static final List DYES = Arrays.asList("dyeWhite", "dyeOrange", "dyeMagenta", "dyeLightBlue", "dyeYellow", "dyeLime", "dyePink", "dyeGray", "dyeLightGray", "dyeCyan", "dyePurple", "dyeBlue", "dyeBrown", "dyeGreen", "dyeRed", "dyeBlack", LibOreDict.MANA_PEARL); @Override - public boolean matches(InventoryCrafting var1, World var2) { + public boolean matches(@Nonnull InventoryCrafting var1, @Nonnull World var2) { boolean foundLens = false; boolean foundDye = false; @@ -52,7 +52,7 @@ public class LensDyeingRecipe implements IRecipe { } @Override - public ItemStack getCraftingResult(InventoryCrafting var1) { + public ItemStack getCraftingResult(@Nonnull InventoryCrafting var1) { ItemStack lens = null; int color = -1; @@ -97,4 +97,9 @@ public class LensDyeingRecipe implements IRecipe { return -1; } + @Nonnull + @Override + public ItemStack[] getRemainingItems(@Nonnull InventoryCrafting inv) { + return ForgeHooks.defaultRecipeGetRemainingItems(inv); + } } diff --git a/src/main/java/vazkii/botania/common/crafting/recipe/ManaGunClipRecipe.java b/src/main/java/vazkii/botania/common/crafting/recipe/ManaGunClipRecipe.java index 7403daaf8..15b5d050d 100644 --- a/src/main/java/vazkii/botania/common/crafting/recipe/ManaGunClipRecipe.java +++ b/src/main/java/vazkii/botania/common/crafting/recipe/ManaGunClipRecipe.java @@ -14,13 +14,16 @@ import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; import vazkii.botania.common.item.ItemManaGun; import vazkii.botania.common.item.ModItems; +import javax.annotation.Nonnull; + public class ManaGunClipRecipe implements IRecipe { @Override - public boolean matches(InventoryCrafting var1, World var2) { + public boolean matches(@Nonnull InventoryCrafting var1, @Nonnull World var2) { boolean foundGun = false; boolean foundClip = false; @@ -41,7 +44,7 @@ public class ManaGunClipRecipe implements IRecipe { } @Override - public ItemStack getCraftingResult(InventoryCrafting var1) { + public ItemStack getCraftingResult(@Nonnull InventoryCrafting var1) { ItemStack gun = null; for(int i = 0; i < var1.getSizeInventory(); i++) { @@ -71,5 +74,9 @@ public class ManaGunClipRecipe implements IRecipe { return null; } - + @Nonnull + @Override + public ItemStack[] getRemainingItems(@Nonnull InventoryCrafting inv) { + return ForgeHooks.defaultRecipeGetRemainingItems(inv); + } } diff --git a/src/main/java/vazkii/botania/common/crafting/recipe/ManaGunLensRecipe.java b/src/main/java/vazkii/botania/common/crafting/recipe/ManaGunLensRecipe.java index 38b6a15f2..b6722e3d5 100644 --- a/src/main/java/vazkii/botania/common/crafting/recipe/ManaGunLensRecipe.java +++ b/src/main/java/vazkii/botania/common/crafting/recipe/ManaGunLensRecipe.java @@ -14,14 +14,17 @@ import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; import vazkii.botania.api.mana.ILens; import vazkii.botania.api.mana.ILensControl; import vazkii.botania.common.item.ItemManaGun; +import javax.annotation.Nonnull; + public class ManaGunLensRecipe implements IRecipe { @Override - public boolean matches(InventoryCrafting var1, World var2) { + public boolean matches(@Nonnull InventoryCrafting var1, @Nonnull World var2) { boolean foundLens = false; boolean foundGun = false; @@ -45,7 +48,7 @@ public class ManaGunLensRecipe implements IRecipe { } @Override - public ItemStack getCraftingResult(InventoryCrafting var1) { + public ItemStack getCraftingResult(@Nonnull InventoryCrafting var1) { ItemStack lens = null; ItemStack gun = null; @@ -79,4 +82,9 @@ public class ManaGunLensRecipe implements IRecipe { return null; } + @Nonnull + @Override + public ItemStack[] getRemainingItems(@Nonnull InventoryCrafting inv) { + return ForgeHooks.defaultRecipeGetRemainingItems(inv); + } } diff --git a/src/main/java/vazkii/botania/common/crafting/recipe/ManaGunRemoveLensRecipe.java b/src/main/java/vazkii/botania/common/crafting/recipe/ManaGunRemoveLensRecipe.java index b926d525d..1730be1e3 100644 --- a/src/main/java/vazkii/botania/common/crafting/recipe/ManaGunRemoveLensRecipe.java +++ b/src/main/java/vazkii/botania/common/crafting/recipe/ManaGunRemoveLensRecipe.java @@ -14,12 +14,15 @@ import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; import vazkii.botania.common.item.ItemManaGun; +import javax.annotation.Nonnull; + public class ManaGunRemoveLensRecipe implements IRecipe { @Override - public boolean matches(InventoryCrafting var1, World var2) { + public boolean matches(@Nonnull InventoryCrafting var1, @Nonnull World var2) { boolean foundGun = false; for(int i = 0; i < var1.getSizeInventory(); i++) { @@ -36,7 +39,7 @@ public class ManaGunRemoveLensRecipe implements IRecipe { } @Override - public ItemStack getCraftingResult(InventoryCrafting var1) { + public ItemStack getCraftingResult(@Nonnull InventoryCrafting var1) { ItemStack gun = null; for(int i = 0; i < var1.getSizeInventory(); i++) { @@ -63,4 +66,9 @@ public class ManaGunRemoveLensRecipe implements IRecipe { return null; } + @Nonnull + @Override + public ItemStack[] getRemainingItems(@Nonnull InventoryCrafting inv) { + return ForgeHooks.defaultRecipeGetRemainingItems(inv); + } } diff --git a/src/main/java/vazkii/botania/common/crafting/recipe/ManaUpgradeRecipe.java b/src/main/java/vazkii/botania/common/crafting/recipe/ManaUpgradeRecipe.java new file mode 100644 index 000000000..b34cbd3bd --- /dev/null +++ b/src/main/java/vazkii/botania/common/crafting/recipe/ManaUpgradeRecipe.java @@ -0,0 +1,44 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + * + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + * + * File Created @ [Apr 4, 2016, 1:16:22 PM (EST)] + */ +package vazkii.botania.common.crafting.recipe; + +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.ShapedOreRecipe; +import vazkii.botania.api.mana.IManaItem; + +public class ManaUpgradeRecipe extends ShapedOreRecipe { + public ManaUpgradeRecipe(ItemStack output, Object... inputs) { + super(output, inputs); + } + + public static ItemStack output(ItemStack output, InventoryCrafting var1) { + ItemStack out = output.copy(); + if (!(out.getItem() instanceof IManaItem)) + return out; + IManaItem outItem = (IManaItem) out.getItem(); + for (int i = 0; i < var1.getSizeInventory(); i++) { + ItemStack stack = var1.getStackInSlot(i); + if (stack != null) { + if (stack.getItem() instanceof IManaItem) { + IManaItem item = (IManaItem) stack.getItem(); + outItem.addMana(out, item.getMana(stack)); + } + } + } + return out; + } + + @Override + public ItemStack getCraftingResult(InventoryCrafting var1) { + return output(output, var1); + } +} diff --git a/src/main/java/vazkii/botania/common/crafting/recipe/PhantomInkRecipe.java b/src/main/java/vazkii/botania/common/crafting/recipe/PhantomInkRecipe.java index fd510dffe..68c5d8889 100644 --- a/src/main/java/vazkii/botania/common/crafting/recipe/PhantomInkRecipe.java +++ b/src/main/java/vazkii/botania/common/crafting/recipe/PhantomInkRecipe.java @@ -14,13 +14,16 @@ import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; import vazkii.botania.api.item.IPhantomInkable; import vazkii.botania.common.item.ModItems; +import javax.annotation.Nonnull; + public class PhantomInkRecipe implements IRecipe { @Override - public boolean matches(InventoryCrafting var1, World var2) { + public boolean matches(@Nonnull InventoryCrafting var1, @Nonnull World var2) { boolean foundInk = false; boolean foundItem = false; @@ -41,7 +44,7 @@ public class PhantomInkRecipe implements IRecipe { } @Override - public ItemStack getCraftingResult(InventoryCrafting var1) { + public ItemStack getCraftingResult(@Nonnull InventoryCrafting var1) { ItemStack item = null; for(int i = 0; i < var1.getSizeInventory(); i++) { @@ -66,4 +69,9 @@ public class PhantomInkRecipe implements IRecipe { return null; } + @Nonnull + @Override + public ItemStack[] getRemainingItems(@Nonnull InventoryCrafting inv) { + return ForgeHooks.defaultRecipeGetRemainingItems(inv); + } } diff --git a/src/main/java/vazkii/botania/common/crafting/recipe/RegenIvyRecipe.java b/src/main/java/vazkii/botania/common/crafting/recipe/RegenIvyRecipe.java index 3f763b36f..518d85b58 100644 --- a/src/main/java/vazkii/botania/common/crafting/recipe/RegenIvyRecipe.java +++ b/src/main/java/vazkii/botania/common/crafting/recipe/RegenIvyRecipe.java @@ -15,14 +15,17 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.item.ItemRegenIvy; import vazkii.botania.common.item.ModItems; +import javax.annotation.Nonnull; + public class RegenIvyRecipe implements IRecipe { @Override - public boolean matches(InventoryCrafting var1, World var2) { + public boolean matches(@Nonnull InventoryCrafting var1, @Nonnull World var2) { ItemStack tool = null; boolean foundIvy = false; int materialsFound = 0; @@ -55,7 +58,7 @@ public class RegenIvyRecipe implements IRecipe { } @Override - public ItemStack getCraftingResult(InventoryCrafting var1) { + public ItemStack getCraftingResult(@Nonnull InventoryCrafting var1) { ItemStack tool = null; for(int i = 0; i < var1.getSizeInventory(); i++) { @@ -82,4 +85,9 @@ public class RegenIvyRecipe implements IRecipe { return null; } + @Nonnull + @Override + public ItemStack[] getRemainingItems(@Nonnull InventoryCrafting inv) { + return ForgeHooks.defaultRecipeGetRemainingItems(inv); + } } diff --git a/src/main/java/vazkii/botania/common/crafting/recipe/ShapelessManaUpgradeRecipe.java b/src/main/java/vazkii/botania/common/crafting/recipe/ShapelessManaUpgradeRecipe.java new file mode 100644 index 000000000..0ed3c7fdd --- /dev/null +++ b/src/main/java/vazkii/botania/common/crafting/recipe/ShapelessManaUpgradeRecipe.java @@ -0,0 +1,26 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + * + * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + * + * File Created @ [Apr 4, 2016, 1:20:34 PM (EST)] + */ +package vazkii.botania.common.crafting.recipe; + +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.ShapelessOreRecipe; + +public class ShapelessManaUpgradeRecipe extends ShapelessOreRecipe { + public ShapelessManaUpgradeRecipe(ItemStack output, Object... inputs) { + super(output, inputs); + } + + @Override + public ItemStack getCraftingResult(InventoryCrafting var1) { + return ManaUpgradeRecipe.output(output, var1); + } +} diff --git a/src/main/java/vazkii/botania/common/crafting/recipe/SpecialFloatingFlowerRecipe.java b/src/main/java/vazkii/botania/common/crafting/recipe/SpecialFloatingFlowerRecipe.java index 2958c526c..57e1265ab 100644 --- a/src/main/java/vazkii/botania/common/crafting/recipe/SpecialFloatingFlowerRecipe.java +++ b/src/main/java/vazkii/botania/common/crafting/recipe/SpecialFloatingFlowerRecipe.java @@ -15,13 +15,16 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.item.block.ItemBlockSpecialFlower; +import javax.annotation.Nonnull; + public class SpecialFloatingFlowerRecipe implements IRecipe { @Override - public boolean matches(InventoryCrafting var1, World var2) { + public boolean matches(@Nonnull InventoryCrafting var1, @Nonnull World var2) { boolean foundFloatingFlower = false; boolean foundSpecialFlower = false; @@ -42,7 +45,7 @@ public class SpecialFloatingFlowerRecipe implements IRecipe { } @Override - public ItemStack getCraftingResult(InventoryCrafting var1) { + public ItemStack getCraftingResult(@Nonnull InventoryCrafting var1) { ItemStack specialFlower = null; for(int i = 0; i < var1.getSizeInventory(); i++) { @@ -67,4 +70,9 @@ public class SpecialFloatingFlowerRecipe implements IRecipe { return null; } + @Nonnull + @Override + public ItemStack[] getRemainingItems(@Nonnull InventoryCrafting inv) { + return ForgeHooks.defaultRecipeGetRemainingItems(inv); + } } diff --git a/src/main/java/vazkii/botania/common/crafting/recipe/SpellClothRecipe.java b/src/main/java/vazkii/botania/common/crafting/recipe/SpellClothRecipe.java index f0aeb8f23..95ac205d4 100644 --- a/src/main/java/vazkii/botania/common/crafting/recipe/SpellClothRecipe.java +++ b/src/main/java/vazkii/botania/common/crafting/recipe/SpellClothRecipe.java @@ -15,19 +15,22 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; import vazkii.botania.common.item.ModItems; +import javax.annotation.Nonnull; + public class SpellClothRecipe implements IRecipe { @Override - public boolean matches(InventoryCrafting var1, World var2) { + public boolean matches(@Nonnull InventoryCrafting var1, @Nonnull World var2) { boolean foundCloth = false; boolean foundEnchanted = false; for(int i = 0; i < var1.getSizeInventory(); i++) { ItemStack stack = var1.getStackInSlot(i); if(stack != null) { - if(stack.isItemEnchanted() && !foundEnchanted) + if(stack.isItemEnchanted() && !foundEnchanted && stack.getItem() != ModItems.spellCloth) foundEnchanted = true; else if(stack.getItem() == ModItems.spellCloth && !foundCloth) @@ -41,7 +44,7 @@ public class SpellClothRecipe implements IRecipe { } @Override - public ItemStack getCraftingResult(InventoryCrafting var1) { + public ItemStack getCraftingResult(@Nonnull InventoryCrafting var1) { ItemStack stackToDisenchant = null; for(int i = 0; i < var1.getSizeInventory(); i++) { ItemStack stack = var1.getStackInSlot(i); @@ -71,4 +74,9 @@ public class SpellClothRecipe implements IRecipe { return null; } + @Nonnull + @Override + public ItemStack[] getRemainingItems(@Nonnull InventoryCrafting inv) { + return ForgeHooks.defaultRecipeGetRemainingItems(inv); + } } diff --git a/src/main/java/vazkii/botania/common/crafting/recipe/TerraPickTippingRecipe.java b/src/main/java/vazkii/botania/common/crafting/recipe/TerraPickTippingRecipe.java index 733367684..5eebc1e8e 100644 --- a/src/main/java/vazkii/botania/common/crafting/recipe/TerraPickTippingRecipe.java +++ b/src/main/java/vazkii/botania/common/crafting/recipe/TerraPickTippingRecipe.java @@ -14,13 +14,16 @@ import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.item.equipment.tool.terrasteel.ItemTerraPick; +import javax.annotation.Nonnull; + public class TerraPickTippingRecipe implements IRecipe { @Override - public boolean matches(InventoryCrafting var1, World var2) { + public boolean matches(@Nonnull InventoryCrafting var1, @Nonnull World var2) { boolean foundTerraPick = false; boolean foundElementiumPick = false; @@ -41,7 +44,7 @@ public class TerraPickTippingRecipe implements IRecipe { } @Override - public ItemStack getCraftingResult(InventoryCrafting var1) { + public ItemStack getCraftingResult(@Nonnull InventoryCrafting var1) { ItemStack terraPick = null; for(int i = 0; i < var1.getSizeInventory(); i++) { @@ -68,4 +71,9 @@ public class TerraPickTippingRecipe implements IRecipe { return null; } + @Nonnull + @Override + public ItemStack[] getRemainingItems(@Nonnull InventoryCrafting inv) { + return ForgeHooks.defaultRecipeGetRemainingItems(inv); + } } diff --git a/src/main/java/vazkii/botania/common/entity/EntityBabylonWeapon.java b/src/main/java/vazkii/botania/common/entity/EntityBabylonWeapon.java index 5dd088788..d4ad4bad2 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityBabylonWeapon.java +++ b/src/main/java/vazkii/botania/common/entity/EntityBabylonWeapon.java @@ -10,22 +10,29 @@ */ package vazkii.botania.common.entity; -import java.util.List; - import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; +import net.minecraft.network.datasync.DataParameter; +import net.minecraft.network.datasync.DataSerializers; +import net.minecraft.network.datasync.EntityDataManager; import net.minecraft.util.DamageSource; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; +import vazkii.botania.api.sound.BotaniaSoundEvents; import vazkii.botania.common.Botania; +import vazkii.botania.common.core.helper.PlayerHelper; import vazkii.botania.common.core.helper.Vector3; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.item.equipment.tool.ToolCommons; import vazkii.botania.common.item.relic.ItemKingKey; +import javax.annotation.Nonnull; +import java.util.List; + public class EntityBabylonWeapon extends EntityThrowableCopy { private static final String TAG_CHARGING = "charging"; @@ -35,6 +42,13 @@ public class EntityBabylonWeapon extends EntityThrowableCopy { private static final String TAG_DELAY = "delay"; private static final String TAG_ROTATION = "rotation"; + private static final DataParameter CHARGING = EntityDataManager.createKey(EntityBabylonWeapon.class, DataSerializers.BOOLEAN); + private static final DataParameter VARIETY = EntityDataManager.createKey(EntityBabylonWeapon.class, DataSerializers.VARINT); + private static final DataParameter CHARGE_TICKS = EntityDataManager.createKey(EntityBabylonWeapon.class, DataSerializers.VARINT); + private static final DataParameter LIVE_TICKS = EntityDataManager.createKey(EntityBabylonWeapon.class, DataSerializers.VARINT); + private static final DataParameter DELAY = EntityDataManager.createKey(EntityBabylonWeapon.class, DataSerializers.VARINT); + private static final DataParameter ROTATION = EntityDataManager.createKey(EntityBabylonWeapon.class, DataSerializers.FLOAT); + public EntityBabylonWeapon(World world) { super(world); } @@ -45,21 +59,20 @@ public class EntityBabylonWeapon extends EntityThrowableCopy { @Override protected void entityInit() { + super.entityInit(); setSize(0F, 0F); - dataWatcher.addObject(20, (byte) 0); - dataWatcher.addObject(21, 0); - dataWatcher.addObject(22, 0); - dataWatcher.addObject(23, 0); - dataWatcher.addObject(24, 0); - dataWatcher.addObject(25, 0F); + dataManager.register(CHARGING, false); + dataManager.register(VARIETY, 0); + dataManager.register(CHARGE_TICKS, 0); + dataManager.register(LIVE_TICKS, 0); + dataManager.register(DELAY, 0); + dataManager.register(ROTATION, 0F); + } - dataWatcher.setObjectWatched(20); - dataWatcher.setObjectWatched(21); - dataWatcher.setObjectWatched(22); - dataWatcher.setObjectWatched(23); - dataWatcher.setObjectWatched(24); - dataWatcher.setObjectWatched(25); + @Override + public boolean isImmuneToExplosions() { + return true; } @Override @@ -72,8 +85,8 @@ public class EntityBabylonWeapon extends EntityThrowableCopy { EntityPlayer player = (EntityPlayer) thrower; boolean charging = isCharging(); if(!worldObj.isRemote) { - ItemStack stack = player == null ? null : player.getCurrentEquippedItem(); - boolean newCharging = stack != null && stack.getItem() == ModItems.kingKey && ItemKingKey.isCharging(stack); + ItemStack stack = player == null ? null : PlayerHelper.getFirstHeldItem(player, ModItems.kingKey); + boolean newCharging = stack != null && ItemKingKey.isCharging(stack); if(charging != newCharging) { setCharging(newCharging); charging = newCharging; @@ -97,31 +110,31 @@ public class EntityBabylonWeapon extends EntityThrowableCopy { setChargeTicks(chargeTime + 1); if(worldObj.rand.nextInt(20) == 0) - worldObj.playSoundAtEntity(this, "botania:babylonSpawn", 0.1F, 1F + worldObj.rand.nextFloat() * 3F); + worldObj.playSound(null, posX, posY, posZ, BotaniaSoundEvents.babylonSpawn, SoundCategory.PLAYERS, 0.1F, 1F + worldObj.rand.nextFloat() * 3F); } else { if(liveTime < delay) { motionX = 0; motionY = 0; motionZ = 0; } else if (liveTime == delay && player != null) { - Vector3 playerLook = null; - MovingObjectPosition lookat = ToolCommons.raytraceFromEntity(worldObj, player, true, 64); + Vector3 playerLook; + RayTraceResult lookat = ToolCommons.raytraceFromEntity(worldObj, player, true, 64); if(lookat == null) playerLook = new Vector3(player.getLookVec()).multiply(64).add(Vector3.fromEntity(player)); - else playerLook = new Vector3(lookat.blockX + 0.5, lookat.blockY + 0.5, lookat.blockZ + 0.5); + else playerLook = new Vector3(lookat.getBlockPos().getX() + 0.5, lookat.getBlockPos().getY() + 0.5, lookat.getBlockPos().getZ() + 0.5); Vector3 thisVec = Vector3.fromEntityCenter(this); - Vector3 motionVec = playerLook.sub(thisVec).normalize().multiply(2); + Vector3 motionVec = playerLook.subtract(thisVec).normalize().multiply(2); x = motionVec.x; y = motionVec.y; z = motionVec.z; - worldObj.playSoundAtEntity(this, "botania:babylonAttack", 2F, 0.1F + worldObj.rand.nextFloat() * 3F); + worldObj.playSound(null, posX, posY, posZ, BotaniaSoundEvents.babylonAttack, SoundCategory.PLAYERS, 2F, 0.1F + worldObj.rand.nextFloat() * 3F); } setLiveTicks(liveTime + 1); if(!worldObj.isRemote) { - AxisAlignedBB axis = AxisAlignedBB.getBoundingBox(posX, posY, posZ, lastTickPosX, lastTickPosY, lastTickPosZ).expand(2, 2, 2); + AxisAlignedBB axis = new AxisAlignedBB(posX, posY, posZ, lastTickPosX, lastTickPosY, lastTickPosZ).expand(2, 2, 2); List entities = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axis); for(EntityLivingBase living : entities) { if(living == thrower) @@ -131,7 +144,7 @@ public class EntityBabylonWeapon extends EntityThrowableCopy { if(player != null) living.attackEntityFrom(DamageSource.causePlayerDamage(player), 20); else living.attackEntityFrom(DamageSource.generic, 20); - onImpact(new MovingObjectPosition(living)); + onImpact(new RayTraceResult(living)); return; } } @@ -145,14 +158,14 @@ public class EntityBabylonWeapon extends EntityThrowableCopy { motionZ = z; if(liveTime > delay) - Botania.proxy.wispFX(worldObj, posX, posY, posZ, 1F, 1F, 0F, 0.3F, 0F); + Botania.proxy.wispFX(posX, posY, posZ, 1F, 1F, 0F, 0.3F, 0F); if(liveTime > 200 + delay) setDead(); } @Override - protected void onImpact(MovingObjectPosition pos) { + protected void onImpact(RayTraceResult pos) { EntityLivingBase thrower = getThrower(); if(pos.entityHit == null || pos.entityHit != thrower) { worldObj.createExplosion(this, posX, posY, posZ, 3F, false); @@ -161,7 +174,7 @@ public class EntityBabylonWeapon extends EntityThrowableCopy { } @Override - public void writeEntityToNBT(NBTTagCompound cmp) { + public void writeEntityToNBT(@Nonnull NBTTagCompound cmp) { super.writeEntityToNBT(cmp); cmp.setBoolean(TAG_CHARGING, isCharging()); cmp.setInteger(TAG_VARIETY, getVariety()); @@ -172,7 +185,7 @@ public class EntityBabylonWeapon extends EntityThrowableCopy { } @Override - public void readEntityFromNBT(NBTTagCompound cmp) { + public void readEntityFromNBT(@Nonnull NBTTagCompound cmp) { super.readEntityFromNBT(cmp); setCharging(cmp.getBoolean(TAG_CHARGING)); setVariety(cmp.getInteger(TAG_VARIETY)); @@ -183,51 +196,51 @@ public class EntityBabylonWeapon extends EntityThrowableCopy { } public boolean isCharging() { - return dataWatcher.getWatchableObjectByte(20) == 1; + return dataManager.get(CHARGING); } public void setCharging(boolean charging) { - dataWatcher.updateObject(20, (byte) (charging ? 1 : 0)); + dataManager.set(CHARGING, charging); } public int getVariety() { - return dataWatcher.getWatchableObjectInt(21); + return dataManager.get(VARIETY); } public void setVariety(int var) { - dataWatcher.updateObject(21, var); + dataManager.set(VARIETY, var); } public int getChargeTicks() { - return dataWatcher.getWatchableObjectInt(22); + return dataManager.get(CHARGE_TICKS); } public void setChargeTicks(int ticks) { - dataWatcher.updateObject(22, ticks); + dataManager.set(CHARGE_TICKS, ticks); } public int getLiveTicks() { - return dataWatcher.getWatchableObjectInt(23); + return dataManager.get(LIVE_TICKS); } public void setLiveTicks(int ticks) { - dataWatcher.updateObject(23, ticks); + dataManager.set(LIVE_TICKS, ticks); } public int getDelay() { - return dataWatcher.getWatchableObjectInt(24); + return dataManager.get(DELAY); } public void setDelay(int delay) { - dataWatcher.updateObject(24, delay); + dataManager.set(DELAY, delay); } public float getRotation() { - return dataWatcher.getWatchableObjectFloat(25); + return dataManager.get(ROTATION); } public void setRotation(float rot) { - dataWatcher.updateObject(25, rot); + dataManager.set(ROTATION, rot); } } diff --git a/src/main/java/vazkii/botania/common/entity/EntityCorporeaSpark.java b/src/main/java/vazkii/botania/common/entity/EntityCorporeaSpark.java index 62f89441b..d8737843c 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityCorporeaSpark.java +++ b/src/main/java/vazkii/botania/common/entity/EntityCorporeaSpark.java @@ -10,22 +10,32 @@ */ package vazkii.botania.common.entity; -import java.util.ArrayList; -import java.util.List; - +import com.google.common.base.Optional; +import com.google.common.base.Predicates; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.inventory.IInventory; +import net.minecraft.item.EnumDyeColor; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MathHelper; +import net.minecraft.network.datasync.DataParameter; +import net.minecraft.network.datasync.DataSerializers; +import net.minecraft.network.datasync.EntityDataManager; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; import vazkii.botania.api.corporea.ICorporeaSpark; +import vazkii.botania.api.corporea.InvWithLocation; import vazkii.botania.common.core.helper.InventoryHelper; import vazkii.botania.common.item.ModItems; +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.List; + public class EntityCorporeaSpark extends Entity implements ICorporeaSpark { private static final int SCAN_RANGE = 8; @@ -34,12 +44,16 @@ public class EntityCorporeaSpark extends Entity implements ICorporeaSpark { private static final String TAG_NETWORK = "network"; private static final String TAG_INVIS = "invis"; - ICorporeaSpark master; - List connections = new ArrayList(); - List connectionsClient = new ArrayList(); - List relatives = new ArrayList(); - boolean firstUpdateClient = true; - boolean firstUpdateServer = true; + private static final DataParameter MASTER = EntityDataManager.createKey(EntityCorporeaSpark.class, DataSerializers.BOOLEAN); + private static final DataParameter NETWORK = EntityDataManager.createKey(EntityCorporeaSpark.class, DataSerializers.VARINT); + public static final DataParameter INVISIBILITY = EntityDataManager.createKey(EntityCorporeaSpark.class, DataSerializers.VARINT); + private static final DataParameter ITEM_DISPLAY_TICKS = EntityDataManager.createKey(EntityCorporeaSpark.class, DataSerializers.VARINT); + private static final DataParameter> DISPLAY_STACK = EntityDataManager.createKey(EntityCorporeaSpark.class, DataSerializers.OPTIONAL_ITEM_STACK); + + private ICorporeaSpark master; + private List connections = new ArrayList<>(); + private List relatives = new ArrayList<>(); + private boolean firstTick = true; public EntityCorporeaSpark(World world) { super(world); @@ -49,17 +63,17 @@ public class EntityCorporeaSpark extends Entity implements ICorporeaSpark { @Override protected void entityInit() { setSize(0.1F, 0.5F); - dataWatcher.addObject(EntitySpark.INVISIBILITY_DATA_WATCHER_KEY, 0); - dataWatcher.addObject(28, 0); - dataWatcher.addObject(29, 0); - dataWatcher.addObject(30, 0); - dataWatcher.addObject(31, new ItemStack(Blocks.stone, 0, 0)); + dataManager.register(INVISIBILITY, 0); + dataManager.register(MASTER, false); + dataManager.register(NETWORK, 0); + dataManager.register(ITEM_DISPLAY_TICKS, 0); + dataManager.register(DISPLAY_STACK, Optional.absent()); + } - dataWatcher.setObjectWatched(EntitySpark.INVISIBILITY_DATA_WATCHER_KEY); - dataWatcher.setObjectWatched(28); - dataWatcher.setObjectWatched(29); - dataWatcher.setObjectWatched(30); - dataWatcher.setObjectWatched(31); + @Nonnull + @Override + public ItemStack getPickedResult(RayTraceResult target) { + return isMaster() ? new ItemStack(ModItems.corporeaSpark, 1, 1) : new ItemStack(ModItems.corporeaSpark); } @Override @@ -70,24 +84,25 @@ public class EntityCorporeaSpark extends Entity implements ICorporeaSpark { @Override public void onUpdate() { super.onUpdate(); - IInventory inv = getInventory(); + + if(worldObj.isRemote) + return; + + InvWithLocation inv = getSparkInventory(); if(inv == null) { - if(!worldObj.isRemote) - setDead(); + dropAndKill(); return; } if(isMaster()) master = this; - if(worldObj.isRemote ? firstUpdateClient : firstUpdateServer) { + if(firstTick) { if(isMaster()) restartNetwork(); else findNetwork(); - if(worldObj.isRemote) - firstUpdateClient = false; - else firstUpdateServer = false; + firstTick = false; } if(master != null && (((Entity) master).isDead || master.getNetwork() != getNetwork())) @@ -100,13 +115,15 @@ public class EntityCorporeaSpark extends Entity implements ICorporeaSpark { setItemDisplayTicks(displayTicks + 1); } + private void dropAndKill() { + entityDropItem(new ItemStack(ModItems.corporeaSpark, 1, isMaster() ? 1 : 0), 0F); + setDead(); + } + @Override public void setDead() { super.setDead(); - if(!worldObj.isRemote) - entityDropItem(new ItemStack(ModItems.corporeaSpark, 1, isMaster() ? 1 : 0), 0F); connections.remove(this); - connectionsClient.remove(this); restartNetwork(); } @@ -124,30 +141,27 @@ public class EntityCorporeaSpark extends Entity implements ICorporeaSpark { } this.master = master; - if(worldObj.isRemote) - connectionsClient = connections; - else this.connections = connections; + this.connections = connections; } - List getNearbySparks() { - return worldObj.getEntitiesWithinAABB(ICorporeaSpark.class, AxisAlignedBB.getBoundingBox(posX - SCAN_RANGE, posY - SCAN_RANGE, posZ - SCAN_RANGE, posX + SCAN_RANGE, posY + SCAN_RANGE, posZ + SCAN_RANGE)); + private List getNearbySparks() { + List ret = worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(posX - SCAN_RANGE, posY - SCAN_RANGE, posZ - SCAN_RANGE, posX + SCAN_RANGE, posY + SCAN_RANGE, posZ + SCAN_RANGE), Predicates.instanceOf(ICorporeaSpark.class)); + return ((List) ret); } - void restartNetwork() { - if(worldObj.isRemote) - connectionsClient = new ArrayList(); - else connections = new ArrayList(); - relatives = new ArrayList(); + private void restartNetwork() { + connections = new ArrayList<>(); + relatives = new ArrayList<>(); if(master != null) { ICorporeaSpark oldMaster = master; master = null; - oldMaster.registerConnections(oldMaster, this, new ArrayList()); + oldMaster.registerConnections(oldMaster, this, new ArrayList<>()); } } - void findNetwork() { + private void findNetwork() { List sparks = getNearbySparks(); if(sparks.size() > 0) { for(ICorporeaSpark spark : sparks) @@ -163,33 +177,33 @@ public class EntityCorporeaSpark extends Entity implements ICorporeaSpark { } } - void displayRelatives(ArrayList checked, ICorporeaSpark spark) { + private static void displayRelatives(EntityPlayer player, List checked, ICorporeaSpark spark) { if(spark == null) return; List sparks = spark.getRelatives(); if(sparks.isEmpty()) - EntitySpark.particleBeam((Entity) spark, (Entity) spark.getMaster()); + EntitySpark.particleBeam(player, (Entity) spark, (Entity) spark.getMaster()); else for(ICorporeaSpark endSpark : sparks) { if(!checked.contains(endSpark)) { - EntitySpark.particleBeam((Entity) spark, (Entity) endSpark); + EntitySpark.particleBeam(player, (Entity) spark, (Entity) endSpark); checked.add(endSpark); - displayRelatives(checked, endSpark); + displayRelatives(player, checked, endSpark); } } } @Override - public IInventory getInventory() { + public InvWithLocation getSparkInventory() { int x = MathHelper.floor_double(posX); int y = MathHelper.floor_double(posY - 1); int z = MathHelper.floor_double(posZ); - return InventoryHelper.getInventory(worldObj, x, y, z); + return InventoryHelper.getInventoryWithLocation(worldObj, new BlockPos(x, y, z), EnumFacing.UP); } @Override public List getConnections() { - return worldObj.isRemote ? connectionsClient : connections; + return connections; } @Override @@ -217,67 +231,68 @@ public class EntityCorporeaSpark extends Entity implements ICorporeaSpark { } public void setMaster(boolean master) { - dataWatcher.updateObject(28, master ? 1 : 0); + dataManager.set(MASTER, master); } @Override public boolean isMaster() { - return dataWatcher.getWatchableObjectInt(28) == 1; + return dataManager.get(MASTER); } - public void setNetwork(int network) { - dataWatcher.updateObject(29, network); + public void setNetwork(EnumDyeColor network) { + dataManager.set(NETWORK, network.getMetadata()); } @Override - public int getNetwork() { - return dataWatcher.getWatchableObjectInt(29); + public EnumDyeColor getNetwork() { + return EnumDyeColor.byMetadata(dataManager.get(NETWORK)); } public int getItemDisplayTicks() { - return dataWatcher.getWatchableObjectInt(30); + return dataManager.get(ITEM_DISPLAY_TICKS); } public void setItemDisplayTicks(int ticks) { - dataWatcher.updateObject(30, ticks); + dataManager.set(ITEM_DISPLAY_TICKS, ticks); } - public ItemStack getDisplayedItem() { - return dataWatcher.getWatchableObjectItemStack(31); + public Optional getDisplayedItem() { + return dataManager.get(DISPLAY_STACK); } public void setDisplayedItem(ItemStack stack) { - dataWatcher.updateObject(31, stack); + dataManager.set(DISPLAY_STACK, Optional.fromNullable(stack)); } @Override - public boolean interactFirst(EntityPlayer player) { - ItemStack stack = player.getCurrentEquippedItem(); + public boolean processInitialInteract(EntityPlayer player, ItemStack stack, EnumHand hand) { if(stack != null) { if(stack.getItem() == ModItems.twigWand) { if(player.isSneaking()) { - setDead(); - if(isMaster()) - restartNetwork(); - if(player.worldObj.isRemote) - player.swingItem(); + if(!player.worldObj.isRemote) { + dropAndKill(); + if(isMaster()) + restartNetwork(); + } else player.swingArm(hand); return true; } else { - displayRelatives(new ArrayList(), master); + if(!player.worldObj.isRemote) { + displayRelatives(player, new ArrayList<>(), master); + } return true; } } else if(stack.getItem() == ModItems.dye) { int color = stack.getItemDamage(); - if(color != getNetwork()) { - setNetwork(color); + if(color != getNetwork().getMetadata()) { + if(!worldObj.isRemote) { + setNetwork(EnumDyeColor.byMetadata(color)); - if(master != null) - restartNetwork(); - else findNetwork(); + if(master != null) + restartNetwork(); + else findNetwork(); - stack.stackSize--; - if(player.worldObj.isRemote) - player.swingItem(); + stack.stackSize--; + } else player.swingArm(hand); } } } @@ -287,8 +302,8 @@ public class EntityCorporeaSpark extends Entity implements ICorporeaSpark { public boolean doPhantomInk(ItemStack stack) { if(stack != null && stack.getItem() == ModItems.phantomInk && !worldObj.isRemote) { - int invis = dataWatcher.getWatchableObjectInt(EntitySpark.INVISIBILITY_DATA_WATCHER_KEY); - dataWatcher.updateObject(EntitySpark.INVISIBILITY_DATA_WATCHER_KEY, ~invis & 1); + int invis = dataManager.get(INVISIBILITY); + dataManager.set(INVISIBILITY, ~invis & 1); return true; } @@ -296,17 +311,17 @@ public class EntityCorporeaSpark extends Entity implements ICorporeaSpark { } @Override - protected void readEntityFromNBT(NBTTagCompound cmp) { + protected void readEntityFromNBT(@Nonnull NBTTagCompound cmp) { setMaster(cmp.getBoolean(TAG_MASTER)); - setNetwork(cmp.getInteger(TAG_NETWORK)); - dataWatcher.updateObject(EntitySpark.INVISIBILITY_DATA_WATCHER_KEY, cmp.getInteger(TAG_INVIS)); + setNetwork(EnumDyeColor.byMetadata(cmp.getInteger(TAG_NETWORK))); + dataManager.set(INVISIBILITY, cmp.getInteger(TAG_INVIS)); } @Override - protected void writeEntityToNBT(NBTTagCompound cmp) { + protected void writeEntityToNBT(@Nonnull NBTTagCompound cmp) { cmp.setBoolean(TAG_MASTER, isMaster()); - cmp.setInteger(TAG_NETWORK, getNetwork()); - cmp.setInteger(TAG_INVIS, dataWatcher.getWatchableObjectInt(EntitySpark.INVISIBILITY_DATA_WATCHER_KEY)); + cmp.setInteger(TAG_NETWORK, getNetwork().getMetadata()); + cmp.setInteger(TAG_INVIS, dataManager.get(INVISIBILITY)); } } diff --git a/src/main/java/vazkii/botania/common/entity/EntityDoppleganger.java b/src/main/java/vazkii/botania/common/entity/EntityDoppleganger.java index fcf87b340..0a2cb5ecf 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityDoppleganger.java +++ b/src/main/java/vazkii/botania/common/entity/EntityDoppleganger.java @@ -10,86 +10,101 @@ */ package vazkii.botania.common.entity; -import java.awt.Rectangle; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; -import java.util.regex.Pattern; - +import com.google.common.base.Optional; import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityCreature; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.EntityAISwimming; import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.monster.EntitySkeleton; import net.minecraft.entity.monster.EntityWitch; import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.monster.SkeletonType; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.init.Items; -import net.minecraft.item.Item; +import net.minecraft.init.MobEffects; +import net.minecraft.init.SoundEvents; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemRecord; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.datasync.DataParameter; +import net.minecraft.network.datasync.DataSerializers; +import net.minecraft.network.datasync.EntityDataManager; +import net.minecraft.network.play.server.SPacketRemoveEntityEffect; +import net.minecraft.pathfinding.PathNavigateGround; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.tileentity.TileEntityBeacon; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.util.ChatStyle; -import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.MathHelper; +import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.math.Vec3d; +import net.minecraft.util.text.Style; +import net.minecraft.util.text.TextComponentTranslation; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.world.BossInfo; +import net.minecraft.world.BossInfoServer; import net.minecraft.world.EnumDifficulty; import net.minecraft.world.World; +import net.minecraft.world.WorldServer; import net.minecraftforge.common.util.FakePlayer; - +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import org.lwjgl.opengl.ARBShaderObjects; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - -import vazkii.botania.api.boss.IBotaniaBossWithShader; +import vazkii.botania.api.boss.IBotaniaBoss; import vazkii.botania.api.internal.ShaderCallback; import vazkii.botania.api.lexicon.multiblock.Multiblock; import vazkii.botania.api.lexicon.multiblock.MultiblockSet; import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent; +import vazkii.botania.api.sound.BotaniaSoundEvents; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.PylonVariant; import vazkii.botania.client.core.handler.BossBarHandler; import vazkii.botania.client.core.helper.ShaderHelper; import vazkii.botania.common.Botania; import vazkii.botania.common.achievement.ModAchievements; import vazkii.botania.common.block.ModBlocks; -import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.core.helper.Vector3; import vazkii.botania.common.item.ModItems; -import vazkii.botania.common.item.relic.ItemRelic; -import vazkii.botania.common.lib.LibObfuscation; -import cpw.mods.fml.relauncher.ReflectionHelper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import vazkii.botania.common.lib.LibMisc; +import vazkii.botania.common.network.PacketBotaniaEffect; +import vazkii.botania.common.network.PacketHandler; -public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWithShader { +import javax.annotation.Nonnull; +import java.awt.Rectangle; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.regex.Pattern; +import java.util.stream.Collectors; - public static final int SPAWN_TICKS = 160; - private static final float RANGE = 12F; +public class EntityDoppleganger extends EntityLiving implements IBotaniaBoss { + + public static final float ARENA_RANGE = 12F; + private static final int SPAWN_TICKS = 160; private static final float MAX_HP = 800F; - public static final int MOB_SPAWN_START_TICKS = 20; - public static final int MOB_SPAWN_END_TICKS = 80; - public static final int MOB_SPAWN_BASE_TICKS = 800; - public static final int MOB_SPAWN_TICKS = MOB_SPAWN_BASE_TICKS + MOB_SPAWN_START_TICKS + MOB_SPAWN_END_TICKS; - public static final int MOB_SPAWN_WAVES = 10; - public static final int MOB_SPAWN_WAVE_TIME = MOB_SPAWN_BASE_TICKS / MOB_SPAWN_WAVES; + private static final int MOB_SPAWN_START_TICKS = 20; + private static final int MOB_SPAWN_END_TICKS = 80; + private static final int MOB_SPAWN_BASE_TICKS = 800; + private static final int MOB_SPAWN_TICKS = MOB_SPAWN_BASE_TICKS + MOB_SPAWN_START_TICKS + MOB_SPAWN_END_TICKS; + private static final int MOB_SPAWN_WAVES = 10; + private static final int MOB_SPAWN_WAVE_TIME = MOB_SPAWN_BASE_TICKS / MOB_SPAWN_WAVES; private static final String TAG_INVUL_TIME = "invulTime"; private static final String TAG_AGGRO = "aggro"; @@ -100,139 +115,125 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi private static final String TAG_HARD_MODE = "hardMode"; private static final String TAG_PLAYER_COUNT = "playerCount"; - private static final int[][] PYLON_LOCATIONS = new int[][] { - { 4, 1, 4 }, - { 4, 1, -4 }, - { -4, 1, 4 }, - { -4, 1, -4 } + private static final DataParameter INVUL_TIME = EntityDataManager.createKey(EntityDoppleganger.class, DataSerializers.VARINT); + private static final DataParameter PLAYER_COUNT = EntityDataManager.createKey(EntityDoppleganger.class, DataSerializers.VARINT); + private static final DataParameter HARD_MODE = EntityDataManager.createKey(EntityDoppleganger.class, DataSerializers.BOOLEAN); + private static final DataParameter SOURCE = EntityDataManager.createKey(EntityDoppleganger.class, DataSerializers.BLOCK_POS); + private static final DataParameter> BOSSINFO_ID = EntityDataManager.createKey(EntityDoppleganger.class, DataSerializers.OPTIONAL_UNIQUE_ID); + + private static final BlockPos[] PYLON_LOCATIONS = { + new BlockPos(4, 1, 4), + new BlockPos(4, 1, -4), + new BlockPos(-4, 1, 4), + new BlockPos(-4, 1, -4) }; - private static final List CHEATY_BLOCKS = Arrays.asList(new String[] { - "OpenBlocks:beartrap", - "ThaumicTinkerer:magnet" - }); - - boolean spawnLandmines = false; - boolean spawnPixies = false; - boolean anyWithArmor = false; - - List playersWhoAttacked = new ArrayList(); + private static final List CHEATY_BLOCKS = Arrays.asList("OpenBlocks:beartrap", + "ThaumicTinkerer:magnet"); private static boolean isPlayingMusic = false; - public EntityDoppleganger(World par1World) { - super(par1World); + private boolean spawnLandmines = false; + private boolean spawnPixies = false; + private boolean anyWithArmor = false; + private boolean aggro = false; + private int tpDelay = 0; + private int mobSpawnTicks = 0; + private final List playersWhoAttacked = new ArrayList<>(); + private final BossInfoServer bossInfo = (BossInfoServer) (new BossInfoServer(this.getDisplayName(), BossInfo.Color.PINK, BossInfo.Overlay.PROGRESS)).setCreateFog(true); + public EntityPlayer trueKiller = null; + + public EntityDoppleganger(World world) { + super(world); setSize(0.6F, 1.8F); - getNavigator().setCanSwim(true); tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIWatchClosest(this, EntityPlayer.class, Float.MAX_VALUE)); + tasks.addTask(1, new EntityAIWatchClosest(this, EntityPlayer.class, ARENA_RANGE * 1.5F)); isImmuneToFire = true; experienceValue = 825; + Botania.proxy.addBoss(this); } public static MultiblockSet makeMultiblockSet() { Multiblock mb = new Multiblock(); - for(int[] p : PYLON_LOCATIONS) - mb.addComponent(p[0], p[1] + 1, p[2], ModBlocks.pylon, 2); + for(BlockPos p : PYLON_LOCATIONS) + mb.addComponent(p.up(), ModBlocks.pylon.getDefaultState().withProperty(BotaniaStateProps.PYLON_VARIANT, PylonVariant.GAIA)); for(int i = 0; i < 3; i++) for(int j = 0; j < 3; j++) - mb.addComponent(new BeaconComponent(new ChunkCoordinates(i - 1, 0, j - 1))); + mb.addComponent(new BeaconComponent(new BlockPos(i - 1, 0, j - 1))); - mb.addComponent(new BeaconBeamComponent(new ChunkCoordinates(0, 1, 0))); - mb.setRenderOffset(0, -1, 0); + mb.addComponent(new BeaconBeamComponent(new BlockPos(0, 1, 0))); + mb.setRenderOffset(new BlockPos(0, -1, 0)); return mb.makeSet(); } - public static boolean spawn(EntityPlayer player, ItemStack par1ItemStack, World par3World, int par4, int par5, int par6, boolean hard) { - if(par3World.getTileEntity(par4, par5, par6) instanceof TileEntityBeacon && isTruePlayer(player)) { - if(par3World.difficultySetting == EnumDifficulty.PEACEFUL) { - if(!par3World.isRemote) - player.addChatMessage(new ChatComponentTranslation("botaniamisc.peacefulNoob").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED))); + public static boolean spawn(EntityPlayer player, ItemStack stack, World world, BlockPos pos, boolean hard) { + if(world.getTileEntity(pos) instanceof TileEntityBeacon && isTruePlayer(player)) { + if(world.getDifficulty() == EnumDifficulty.PEACEFUL) { + player.addChatMessage(new TextComponentTranslation("botaniamisc.peacefulNoob").setStyle(new Style().setColor(TextFormatting.RED))); return false; } - for(int[] coords : PYLON_LOCATIONS) { - int x = par4 + coords[0]; - int y = par5 + coords[1]; - int z = par6 + coords[2]; + for(BlockPos coords : PYLON_LOCATIONS) { + BlockPos pos_ = pos.add(coords); - Block blockat = par3World.getBlock(x, y, z); - int meta = par3World.getBlockMetadata(x, y, z); - if(blockat != ModBlocks.pylon || meta != 2) { - if(!par3World.isRemote) - player.addChatMessage(new ChatComponentTranslation("botaniamisc.needsCatalysts").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED))); + IBlockState state = world.getBlockState(pos_); + Block blockat = state.getBlock(); + if(blockat != ModBlocks.pylon || state.getValue(BotaniaStateProps.PYLON_VARIANT) != PylonVariant.GAIA) { + player.addChatMessage(new TextComponentTranslation("botaniamisc.needsCatalysts").setStyle(new Style().setColor(TextFormatting.RED))); return false; } } - if(!hasProperArena(par3World, par4, par5, par6)) { - for(int i = 0; i < 360; i += 8) { - float r = 1F; - float g = 0F; - float b = 1F; - float rad = i * (float) Math.PI / 180F; - double x = par4 + 0.5 - Math.cos(rad) * RANGE; - double y = par5 + 0.5; - double z = par6 + 0.5 - Math.sin(rad) * RANGE; + if(!hasProperArena(world, pos)) { + PacketHandler.sendTo((EntityPlayerMP) player, + new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.ARENA_INDICATOR, pos.getX(), pos.getY(), pos.getZ())); - Botania.proxy.sparkleFX(par3World, x, y, z, r, g, b, 5F, 120); - } - - if(!par3World.isRemote) - player.addChatMessage(new ChatComponentTranslation("botaniamisc.badArena").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED))); + player.addChatMessage(new TextComponentTranslation("botaniamisc.badArena").setStyle(new Style().setColor(TextFormatting.RED))); return false; } - par1ItemStack.stackSize--; + stack.stackSize--; - if(par3World.isRemote) - return true; - - EntityDoppleganger e = new EntityDoppleganger(par3World); - e.setPosition(par4 + 0.5, par5 + 3, par6 + 0.5); + EntityDoppleganger e = new EntityDoppleganger(world); + e.setPosition(pos.getX() + 0.5, pos.getY() + 3, pos.getZ() + 0.5); e.setInvulTime(SPAWN_TICKS); e.setHealth(1F); - e.setSource(par4, par5, par6); - e.setMobSpawnTicks(MOB_SPAWN_TICKS); + e.setSource(pos); + e.mobSpawnTicks = MOB_SPAWN_TICKS; e.setHardMode(hard); - List players = e.getPlayersAround(); - int playerCount = 0; - for(EntityPlayer p : players) - if(isTruePlayer(p)) - playerCount++; - + int playerCount = (int) e.getPlayersAround().stream().filter(EntityDoppleganger::isTruePlayer).count(); e.setPlayerCount(playerCount); - e.getAttributeMap().getAttributeInstance(SharedMonsterAttributes.maxHealth).setBaseValue(MAX_HP * playerCount); + e.getAttributeMap().getAttributeInstance(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(MAX_HP * playerCount); + if (hard) + e.getAttributeMap().getAttributeInstance(SharedMonsterAttributes.ARMOR).setBaseValue(15); - par3World.playSoundAtEntity(e, "mob.enderdragon.growl", 10F, 0.1F); - par3World.spawnEntityInWorld(e); + e.playSound(SoundEvents.ENTITY_ENDERDRAGON_GROWL, 10F, 0.1F); + world.spawnEntityInWorld(e); return true; } return false; } - private static boolean hasProperArena(World world, int sx, int sy, int sz) { + private static boolean hasProperArena(World world, BlockPos startPos) { int heightCheck = 3; int heightMin = 2; - int range = (int) Math.ceil(RANGE); + int range = (int) Math.ceil(ARENA_RANGE); for(int i = -range; i < range + 1; i++) for(int j = -range; j < range + 1; j++) { - if(Math.abs(i) == 4 && Math.abs(j) == 4 || vazkii.botania.common.core.helper.MathHelper.pointDistancePlane(i, j, 0, 0) > RANGE) + if(Math.abs(i) == 4 && Math.abs(j) == 4 || vazkii.botania.common.core.helper.MathHelper.pointDistancePlane(i, j, 0, 0) > ARENA_RANGE) continue; // Ignore pylons and out of circle - int x = sx + i; - int z = sz + j; int air = 0; yCheck: { for(int k = heightCheck + heightMin + 1; k >= -heightCheck; k--) { - int y = sy + k; - boolean isAir = world.getBlock(x, y, z).getCollisionBoundingBoxFromPool(world, x, y, z) == null; + BlockPos pos = startPos.add(i, k, j); + boolean isAir = world.getBlockState(pos).getCollisionBoundingBox(world, pos) == null; if(isAir) air++; else { @@ -251,97 +252,59 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi return true; } - @Override - protected boolean isAIEnabled() { - return true; - } - @Override protected void entityInit() { super.entityInit(); - dataWatcher.addObject(20, 0); // Invul Time - dataWatcher.addObject(21, (byte) 0); // Aggro - dataWatcher.addObject(22, 0); // TP Delay - dataWatcher.addObject(23, 0); // Source X - dataWatcher.addObject(24, 0); // Source Y - dataWatcher.addObject(25, 0); // Source Z - dataWatcher.addObject(26, 0); // Ticks spawning mobs - dataWatcher.addObject(27, (byte) 0); // Hard Mode - dataWatcher.addObject(28, 0); // Player count + dataManager.register(INVUL_TIME, 0); + dataManager.register(SOURCE, BlockPos.ORIGIN); + dataManager.register(HARD_MODE, false); + dataManager.register(PLAYER_COUNT, 0); + dataManager.register(BOSSINFO_ID, Optional.absent()); } public int getInvulTime() { - return dataWatcher.getWatchableObjectInt(20); + return dataManager.get(INVUL_TIME); } - public boolean isAggored() { - return dataWatcher.getWatchableObjectByte(21) == 1; - } - - public int getTPDelay() { - return dataWatcher.getWatchableObjectInt(22); - } - - public ChunkCoordinates getSource() { - int x = dataWatcher.getWatchableObjectInt(23); - int y = dataWatcher.getWatchableObjectInt(24); - int z = dataWatcher.getWatchableObjectInt(25); - return new ChunkCoordinates(x, y, z); - } - - public int getMobSpawnTicks() { - return dataWatcher.getWatchableObjectInt(26); + public BlockPos getSource() { + return dataManager.get(SOURCE); } public boolean isHardMode() { - return dataWatcher.getWatchableObjectByte(27) == 1; + return dataManager.get(HARD_MODE); } public int getPlayerCount() { - return dataWatcher.getWatchableObjectInt(28); + return dataManager.get(PLAYER_COUNT); } public void setInvulTime(int time) { - dataWatcher.updateObject(20, time); + dataManager.set(INVUL_TIME, time); } - public void setAggroed(boolean aggored) { - dataWatcher.updateObject(21, (byte) (aggored ? 1 : 0)); - } - - public void setTPDelay(int delay) { - dataWatcher.updateObject(22, delay); - } - - public void setSource(int x, int y, int z) { - dataWatcher.updateObject(23, x); - dataWatcher.updateObject(24, y); - dataWatcher.updateObject(25, z); - } - - public void setMobSpawnTicks(int ticks) { - dataWatcher.updateObject(26, ticks); + public void setSource(BlockPos pos) { + dataManager.set(SOURCE, pos); } public void setHardMode(boolean hardMode) { - dataWatcher.updateObject(27, (byte) (hardMode ? 1 : 0)); + dataManager.set(HARD_MODE, hardMode); } public void setPlayerCount(int count) { - dataWatcher.updateObject(28, count); + dataManager.set(PLAYER_COUNT, count); } @Override public void writeEntityToNBT(NBTTagCompound par1nbtTagCompound) { super.writeEntityToNBT(par1nbtTagCompound); par1nbtTagCompound.setInteger(TAG_INVUL_TIME, getInvulTime()); - par1nbtTagCompound.setBoolean(TAG_AGGRO, isAggored()); - par1nbtTagCompound.setInteger(TAG_MOB_SPAWN_TICKS, getMobSpawnTicks()); + par1nbtTagCompound.setBoolean(TAG_AGGRO, aggro); + par1nbtTagCompound.setInteger(TAG_MOB_SPAWN_TICKS, mobSpawnTicks); - ChunkCoordinates source = getSource(); - par1nbtTagCompound.setInteger(TAG_SOURCE_X, source.posX); - par1nbtTagCompound.setInteger(TAG_SOURCE_Y, source.posY); - par1nbtTagCompound.setInteger(TAG_SOURCE_Z, source.posZ); + BlockPos source = getSource(); + par1nbtTagCompound.setInteger(TAG_SOURCE_X, source.getX()); + par1nbtTagCompound.setInteger(TAG_SOURCE_Y, source.getY()); + par1nbtTagCompound.setInteger(TAG_SOURCE_Z, source.getZ()); par1nbtTagCompound.setBoolean(TAG_HARD_MODE, isHardMode()); par1nbtTagCompound.setInteger(TAG_PLAYER_COUNT, getPlayerCount()); @@ -351,13 +314,13 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi public void readEntityFromNBT(NBTTagCompound par1nbtTagCompound) { super.readEntityFromNBT(par1nbtTagCompound); setInvulTime(par1nbtTagCompound.getInteger(TAG_INVUL_TIME)); - setAggroed(par1nbtTagCompound.getBoolean(TAG_AGGRO)); - setMobSpawnTicks(par1nbtTagCompound.getInteger(TAG_MOB_SPAWN_TICKS)); + aggro = par1nbtTagCompound.getBoolean(TAG_AGGRO); + mobSpawnTicks = par1nbtTagCompound.getInteger(TAG_MOB_SPAWN_TICKS); int x = par1nbtTagCompound.getInteger(TAG_SOURCE_X); int y = par1nbtTagCompound.getInteger(TAG_SOURCE_Y); int z = par1nbtTagCompound.getInteger(TAG_SOURCE_Z); - setSource(x, y, z); + setSource(new BlockPos(x, y, z)); setHardMode(par1nbtTagCompound.getBoolean(TAG_HARD_MODE)); if(par1nbtTagCompound.hasKey(TAG_PLAYER_COUNT)) @@ -366,23 +329,21 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi } @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - Entity e = par1DamageSource.getEntity(); - if((par1DamageSource.damageType.equals("player") || e instanceof EntityPixie) && e != null && isTruePlayer(e) && getInvulTime() == 0) { - EntityPlayer player = (EntityPlayer) e; - if(!playersWhoAttacked.contains(player.getCommandSenderName())) - playersWhoAttacked.add(player.getCommandSenderName()); + public boolean attackEntityFrom(@Nonnull DamageSource source, float par2) { + Entity e = source.getEntity(); - float dmg = par2; - boolean crit = false; - if(e instanceof EntityPlayer) { - EntityPlayer p = (EntityPlayer) e; - crit = p.fallDistance > 0.0F && !p.onGround && !p.isOnLadder() && !p.isInWater() && !p.isPotionActive(Potion.blindness) && p.ridingEntity == null; - } + if (e instanceof EntityPlayer && isTruePlayer(e) && getInvulTime() == 0) { + EntityPlayer player = (EntityPlayer) e; + + if(!playersWhoAttacked.contains(player.getUniqueID())) + playersWhoAttacked.add(player.getUniqueID()); + + boolean crit = player.fallDistance > 0.0F && !player.onGround && !player.isOnLadder() && !player.isInWater() && !player.isPotionActive(MobEffects.BLINDNESS) && !player.isRiding(); int cap = crit ? 60 : 40; - return super.attackEntityFrom(par1DamageSource, Math.min(cap, dmg) * (isHardMode() ? 0.6F : 1F)); + return super.attackEntityFrom(source, Math.min(cap, par2)); } + return false; } @@ -393,52 +354,52 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi EntityPlayer player = (EntityPlayer) e; - String name = player.getCommandSenderName(); + String name = player.getName(); return !(player instanceof FakePlayer || FAKE_PLAYER_PATTERN.matcher(name).matches()); } @Override - protected void damageEntity(DamageSource par1DamageSource, float par2) { + protected void damageEntity(@Nonnull DamageSource par1DamageSource, float par2) { super.damageEntity(par1DamageSource, par2); Entity attacker = par1DamageSource.getEntity(); if(attacker != null) { Vector3 thisVector = Vector3.fromEntityCenter(this); Vector3 playerVector = Vector3.fromEntityCenter(attacker); - Vector3 motionVector = thisVector.copy().sub(playerVector).copy().normalize().multiply(0.75); + Vector3 motionVector = thisVector.subtract(playerVector).normalize().multiply(0.75); if(getHealth() > 0) { motionX = -motionVector.x; motionY = 0.5; motionZ = -motionVector.z; - setTPDelay(4); - spawnPixies = isAggored(); + tpDelay = 4; + spawnPixies = aggro; } - setAggroed(true); + aggro = true; } } @Override - public void onDeath(DamageSource p_70645_1_) { - super.onDeath(p_70645_1_); - EntityLivingBase entitylivingbase = func_94060_bK(); + public void onDeath(@Nonnull DamageSource source) { + super.onDeath(source); + EntityLivingBase entitylivingbase = getAttackingEntity(); if(entitylivingbase instanceof EntityPlayer) { ((EntityPlayer) entitylivingbase).addStat(ModAchievements.gaiaGuardianKill, 1); if(!anyWithArmor) ((EntityPlayer) entitylivingbase).addStat(ModAchievements.gaiaGuardianNoArmor, 1); } - worldObj.playSoundAtEntity(this, "random.explode", 20F, (1F + (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) * 0.2F) * 0.7F); - worldObj.spawnParticle("hugeexplosion", posX, posY, posZ, 1D, 0D, 0D); + this.playSound(SoundEvents.ENTITY_GENERIC_EXPLODE, 20F, (1F + (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) * 0.2F) * 0.7F); + worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_HUGE, posX, posY, posZ, 1D, 0D, 0D); } @Override protected void applyEntityAttributes() { super.applyEntityAttributes(); - getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.4); - getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(MAX_HP); - getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue(1.0); + getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.4); + getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(MAX_HP); + getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(1.0); } @Override @@ -447,161 +408,186 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi } @Override - protected void dropFewItems(boolean par1, int par2) { - if(par1) { - for(int pl = 0; pl < playersWhoAttacked.size(); pl++) { - boolean hard = isHardMode(); - entityDropItem(new ItemStack(ModItems.manaResource, pl == 0 ? hard ? 16 : 8 : hard ? 10 : 6, 5), 1F); - boolean droppedRecord = false; + public ResourceLocation getLootTable() { + return new ResourceLocation(LibMisc.MOD_ID, isHardMode() ? "gaia_guardian_2" : "gaia_guardian"); + } - if(hard) { - entityDropItem(new ItemStack(ModItems.ancientWill, 1, rand.nextInt(6)), 1F); - if(ConfigHandler.relicsEnabled) { - ItemStack dice = new ItemStack(ModItems.dice); - ItemRelic.bindToUsernameS(playersWhoAttacked.get(pl), dice); - entityDropItem(dice, 1F); - } - - if(Math.random() < 0.25) - entityDropItem(new ItemStack(ModItems.overgrowthSeed, rand.nextInt(3) + 1), 1F); - if(Math.random() < 0.5) { - boolean voidLotus = Math.random() < 0.3F; - entityDropItem(new ItemStack(ModItems.blackLotus, voidLotus ? 1 : rand.nextInt(3) + 1, voidLotus ? 1 : 0), 1F); - } - if(Math.random() < 0.9) - entityDropItem(new ItemStack(ModItems.manaResource, 16 + rand.nextInt(12)), 1F); - if(Math.random() < 0.7) - entityDropItem(new ItemStack(ModItems.manaResource, 8 + rand.nextInt(6), 1), 1F); - if(Math.random() < 0.5) - entityDropItem(new ItemStack(ModItems.manaResource, 4 + rand.nextInt(3), 2), 1F); - - int runes = rand.nextInt(6) + 1; - for(int i = 0; i < runes; i++) - if(Math.random() < 0.3) - entityDropItem(new ItemStack(ModItems.rune, 2 + rand.nextInt(3), rand.nextInt(16)), 1F); - - if(Math.random() < 0.2) - entityDropItem(new ItemStack(ModItems.pinkinator), 1F); - if(Math.random() < 0.3) { - int i = Item.getIdFromItem(Items.record_13); - int j = Item.getIdFromItem(Items.record_wait); - int k = i + rand.nextInt(j - i + 1); - entityDropItem(new ItemStack(Item.getItemById(k)), 1F); - droppedRecord = true; - } - } - - if(!droppedRecord && Math.random() < 0.2) - entityDropItem(new ItemStack(hard ? ModItems.recordGaia2 : ModItems.recordGaia1), 1F); - } + @Override + protected void dropLoot(boolean wasRecentlyHit, int lootingModifier, @Nonnull DamageSource source) + { + // Save true killer, they get extra loot + if ("player".equals(source.getDamageType()) + && source.getEntity() instanceof EntityPlayer) { + this.trueKiller = ((EntityPlayer) source.getEntity()); } + + // Drop equipment and clear it so multiple calls to super don't do it again + super.dropEquipment(wasRecentlyHit, lootingModifier); + + for (EntityEquipmentSlot e : EntityEquipmentSlot.values()) { + this.setItemStackToSlot(e, null); + } + + // Generate loot table for every single attacking player + for (UUID u : playersWhoAttacked) { + EntityPlayer player = worldObj.getPlayerEntityByUUID(u); + if (player == null) + continue; + + EntityPlayer saveLastAttacker = this.attackingPlayer; + double savePosX = posX; + double savePosY = posY; + double savePosZ = posZ; + + attackingPlayer = player; // Fake attacking player as the killer + posX = player.posX; // Spoof pos so drops spawn at the player + posY = player.posY; + posZ = player.posZ; + super.dropLoot(wasRecentlyHit, lootingModifier, DamageSource.causePlayerDamage(player)); + posX = savePosX; + posY = savePosY; + posZ = savePosZ; + attackingPlayer = saveLastAttacker; + } + + trueKiller = null; } @Override public void setDead() { - ChunkCoordinates source = getSource(); - Botania.proxy.playRecordClientSided(worldObj, source.posX, source.posY, source.posZ, null); + Botania.proxy.removeBoss(this); + BlockPos source = getSource(); + Botania.proxy.playRecordClientSided(worldObj, source, null); isPlayingMusic = false; super.setDead(); } - public List getPlayersAround() { - ChunkCoordinates source = getSource(); + private List getPlayersAround() { + BlockPos source = getSource(); float range = 15F; - List players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(source.posX + 0.5 - range, source.posY + 0.5 - range, source.posZ + 0.5 - range, source.posX + 0.5 + range, source.posY + 0.5 + range, source.posZ + 0.5 + range)); - return players; + return worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(source.getX() + 0.5 - range, source.getY() + 0.5 - range, source.getZ() + 0.5 - range, source.getX() + 0.5 + range, source.getY() + 0.5 + range, source.getZ() + 0.5 + range)); } @Override public void onLivingUpdate() { super.onLivingUpdate(); - if(ridingEntity != null) { - if(ridingEntity.riddenByEntity != null) - ridingEntity.riddenByEntity = null; - ridingEntity = null; + BlockPos source = getSource(); + float range = ARENA_RANGE; + int invul = getInvulTime(); + + if (worldObj.isRemote) { + for(int i = 0; i < 360; i += 8) { + float r = 0.6F; + float g = 0F; + float b = 0.2F; + float m = 0.15F; + float mv = 0.35F; + + float rad = i * (float) Math.PI / 180F; + double x = source.getX() + 0.5 - Math.cos(rad) * range; + double y = source.getY() + 0.5; + double z = source.getZ() + 0.5 - Math.sin(rad) * range; + + Botania.proxy.wispFX(x, y, z, r, g, b, 0.5F, (float) (Math.random() - 0.5F) * m, (float) (Math.random() - 0.5F) * mv, (float) (Math.random() - 0.5F) * m); + } + + if(worldObj.isRemote && !isPlayingMusic && !isDead && !getPlayersAround().isEmpty()) { + Botania.proxy.playRecordClientSided(worldObj, source, (ItemRecord) (isHardMode() ? ModItems.recordGaia2 : ModItems.recordGaia1)); + isPlayingMusic = true; + } + + EntityPlayer player = Botania.proxy.getClientPlayer(); + + player.capabilities.isFlying = player.capabilities.isFlying && player.capabilities.isCreativeMode; + + if(invul > 10) { + Vector3 pos = Vector3.fromEntityCenter(this).subtract(new Vector3(0, 0.2, 0)); + for (BlockPos arr : PYLON_LOCATIONS) { + Vector3 pylonPos = new Vector3(source.getX() + arr.getX(), source.getY() + arr.getY(), source.getZ() + arr.getZ()); + double worldTime = ticksExisted; + worldTime /= 5; + + float rad = 0.75F + (float) Math.random() * 0.05F; + double xp = pylonPos.x + 0.5 + Math.cos(worldTime) * rad; + double zp = pylonPos.z + 0.5 + Math.sin(worldTime) * rad; + + Vector3 partPos = new Vector3(xp, pylonPos.y, zp); + Vector3 mot = pos.subtract(partPos).multiply(0.04); + + float r = 0.7F + (float) Math.random() * 0.3F; + float g = (float) Math.random() * 0.3F; + float b = 0.7F + (float) Math.random() * 0.3F; + + Botania.proxy.wispFX(partPos.x, partPos.y, partPos.z, r, g, b, 0.25F + (float) Math.random() * 0.1F, -0.075F - (float) Math.random() * 0.015F); + Botania.proxy.wispFX(partPos.x, partPos.y, partPos.z, r, g, b, 0.4F, (float) mot.x, (float) mot.y, (float) mot.z); + } + } + + return; } - boolean peaceful = worldObj.difficultySetting == EnumDifficulty.PEACEFUL; - if(!worldObj.isRemote && peaceful) + dataManager.set(BOSSINFO_ID, Optional.of(bossInfo.getUniqueId())); + bossInfo.setPercent(getHealth() / getMaxHealth()); + + if(!getPassengers().isEmpty()) + this.dismountRidingEntity(); + + if(worldObj.getDifficulty() == EnumDifficulty.PEACEFUL) setDead(); - if(!worldObj.isRemote) { - int radius = 1; - int posXInt = MathHelper.floor_double(posX); - int posYInt = MathHelper.floor_double(posY); - int posZInt = MathHelper.floor_double(posZ); - for(int i = -radius; i < radius + 1; i++) - for(int j = -radius; j < radius + 1; j++) - for(int k = -radius; k < radius + 1; k++) { - int xp = posXInt + i; - int yp = posYInt + j; - int zp = posZInt + k; - if(isCheatyBlock(worldObj, xp, yp, zp)) { - Block block = worldObj.getBlock(xp, yp, zp); - List items = block.getDrops(worldObj, xp, yp, zp, 0, 0); - for(ItemStack stack : items) { - if(ConfigHandler.blockBreakParticles) - worldObj.playAuxSFX(2001, xp, yp, zp, Block.getIdFromBlock(block) + (worldObj.getBlockMetadata(xp, yp, zp) << 12)); - worldObj.spawnEntityInWorld(new EntityItem(worldObj, xp + 0.5, yp + 0.5, zp + 0.5, stack)); - } - worldObj.setBlockToAir(xp, yp, zp); - } + int radius = 1; + int posXInt = MathHelper.floor_double(posX); + int posYInt = MathHelper.floor_double(posY); + int posZInt = MathHelper.floor_double(posZ); + for(int i = -radius; i < radius + 1; i++) + for(int j = -radius; j < radius + 1; j++) + for(int k = -radius; k < radius + 1; k++) { + int xp = posXInt + i; + int yp = posYInt + j; + int zp = posZInt + k; + BlockPos posp = new BlockPos(xp, yp, zp); + if(isCheatyBlock(worldObj, posp)) { + worldObj.destroyBlock(posp, true); } - } + } - ChunkCoordinates source = getSource(); boolean hard = isHardMode(); - float range = RANGE + 3F; List players = getPlayersAround(); int playerCount = getPlayerCount(); - if(worldObj.isRemote && !isPlayingMusic && !isDead && !players.isEmpty()) { - Botania.proxy.playRecordClientSided(worldObj, source.posX, source.posY, source.posZ, (ItemRecord) (hard ? ModItems.recordGaia2 : ModItems.recordGaia1)); - isPlayingMusic = true; - } - - range = RANGE; - for(int i = 0; i < 360; i += 8) { - float r = 0.6F; - float g = 0F; - float b = 0.2F; - float m = 0.15F; - float mv = 0.35F; - - float rad = i * (float) Math.PI / 180F; - double x = source.posX + 0.5 - Math.cos(rad) * range; - double y = source.posY + 0.5; - double z = source.posZ + 0.5 - Math.sin(rad) * range; - - Botania.proxy.wispFX(worldObj, x, y, z, r, g, b, 0.5F, (float) (Math.random() - 0.5F) * m, (float) (Math.random() - 0.5F) * mv, (float) (Math.random() - 0.5F) * m); - } - if(players.isEmpty() && !worldObj.playerEntities.isEmpty()) setDead(); else { for(EntityPlayer player : players) { - if(player.inventory.armorInventory[0] != null || player.inventory.armorInventory[1] != null || player.inventory.armorInventory[2] != null || player.inventory.armorInventory[3] != null) - anyWithArmor = true; + for(EntityEquipmentSlot e : EntityEquipmentSlot.values()) { + if(e.getSlotType() == EntityEquipmentSlot.Type.ARMOR && player.getItemStackFromSlot(e) != null) { + anyWithArmor = true; + break; + } + } - List remove = new ArrayList(); - Collection active = player.getActivePotionEffects(); - for(PotionEffect effect : active) - if(effect.getDuration() < 200 && effect.getIsAmbient() && !ReflectionHelper.getPrivateValue(Potion.class, Potion.potionTypes[effect.getPotionID()], LibObfuscation.IS_BAD_EFFECT)) - remove.add(effect); + List potionsToRemove = player.getActivePotionEffects().stream() + .filter(effect -> effect.getDuration() < 160 && effect.getIsAmbient() && !effect.getPotion().isBadEffect()) + .map(PotionEffect::getPotion) + .distinct() + .collect(Collectors.toList()); - active.removeAll(remove); + potionsToRemove.forEach(potion -> { + player.removePotionEffect(potion); + ((WorldServer) worldObj).getPlayerChunkMap().getEntry(posXInt >> 4, posZInt >> 4).sendPacket(new SPacketRemoveEntityEffect(player.getEntityId(), potion)); + }); player.capabilities.isFlying = player.capabilities.isFlying && player.capabilities.isCreativeMode; - - if(vazkii.botania.common.core.helper.MathHelper.pointDistanceSpace(player.posX, player.posY, player.posZ, source.posX + 0.5, source.posY + 0.5, source.posZ + 0.5) >= range) { - Vector3 sourceVector = new Vector3(source.posX + 0.5, source.posY + 0.5, source.posZ + 0.5); + if(vazkii.botania.common.core.helper.MathHelper.pointDistanceSpace(player.posX, player.posY, player.posZ, source.getX() + 0.5, source.getY() + 0.5, source.getZ() + 0.5) >= range) { + Vector3 sourceVector = new Vector3(source.getX() + 0.5, source.getY() + 0.5, source.getZ() + 0.5); Vector3 playerVector = Vector3.fromEntityCenter(player); - Vector3 motion = sourceVector.copy().sub(playerVector).copy().normalize(); + Vector3 motion = sourceVector.subtract(playerVector).normalize(); player.motionX = motion.x; player.motionY = 0.2; player.motionZ = motion.z; + player.velocityChanged = true; } } } @@ -609,65 +595,34 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi if(isDead) return; - int invul = getInvulTime(); - int mobTicks = getMobSpawnTicks(); boolean spawnMissiles = hard && ticksExisted % 15 < 4; - if(invul > 10) { - Vector3 pos = Vector3.fromEntityCenter(this).subtract(new Vector3(0, 0.2, 0)); - for(int i = 0; i < PYLON_LOCATIONS.length; i++) { - int[] arr = PYLON_LOCATIONS[i]; - int x = arr[0]; - int y = arr[1]; - int z = arr[2]; - - Vector3 pylonPos = new Vector3(source.posX + x, source.posY + y, source.posZ + z); - double worldTime = ticksExisted; - worldTime /= 5; - - float rad = 0.75F + (float) Math.random() * 0.05F; - double xp = pylonPos.x + 0.5 + Math.cos(worldTime) * rad; - double zp = pylonPos.z + 0.5 + Math.sin(worldTime) * rad; - - Vector3 partPos = new Vector3(xp, pylonPos.y, zp); - Vector3 mot = pos.copy().sub(partPos).multiply(0.04); - - float r = 0.7F + (float) Math.random() * 0.3F; - float g = (float) Math.random() * 0.3F; - float b = 0.7F + (float) Math.random() * 0.3F; - - Botania.proxy.wispFX(worldObj, partPos.x, partPos.y, partPos.z, r, g, b, 0.25F + (float) Math.random() * 0.1F, -0.075F - (float) Math.random() * 0.015F); - Botania.proxy.wispFX(worldObj, partPos.x, partPos.y, partPos.z, r, g, b, 0.4F, (float) mot.x, (float) mot.y, (float) mot.z); - } - } - - if(invul > 0 && mobTicks == MOB_SPAWN_TICKS) { + if(invul > 0 && mobSpawnTicks == MOB_SPAWN_TICKS) { if(invul < SPAWN_TICKS) { if(invul > SPAWN_TICKS / 2 && worldObj.rand.nextInt(SPAWN_TICKS - invul + 1) == 0) for(int i = 0; i < 2; i++) spawnExplosionParticle(); } - if(!worldObj.isRemote) { - setHealth(getHealth() + (getMaxHealth() - 1F) / SPAWN_TICKS); - setInvulTime(invul - 1); - } + setHealth(getHealth() + (getMaxHealth() - 1F) / SPAWN_TICKS); + setInvulTime(invul - 1); + motionY = 0; } else { - if(isAggored()) { + if(aggro) { boolean dying = getHealth() / getMaxHealth() < 0.2; - if(dying && mobTicks > 0) { + if(dying && mobSpawnTicks > 0) { motionX = 0; motionY = 0; motionZ = 0; - int reverseTicks = MOB_SPAWN_TICKS - mobTicks; + int reverseTicks = MOB_SPAWN_TICKS - mobSpawnTicks; if(reverseTicks < MOB_SPAWN_START_TICKS) { motionY = 0.2; setInvulTime(invul + 1); } - if(reverseTicks > MOB_SPAWN_START_TICKS * 2 && mobTicks > MOB_SPAWN_END_TICKS && mobTicks % MOB_SPAWN_WAVE_TIME == 0 && !worldObj.isRemote) { + if(reverseTicks > MOB_SPAWN_START_TICKS * 2 && mobSpawnTicks > MOB_SPAWN_END_TICKS && mobSpawnTicks % MOB_SPAWN_WAVE_TIME == 0) { for(int pl = 0; pl < playerCount; pl++) for(int i = 0; i < 3 + worldObj.rand.nextInt(2); i++) { EntityLiving entity = null; @@ -681,10 +636,10 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi } case 1 : { entity = new EntitySkeleton(worldObj); - ((EntitySkeleton) entity).setCurrentItemOrArmor(0, new ItemStack(Items.bow)); + entity.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(Items.BOW)); if(worldObj.rand.nextInt(8) == 0) { - ((EntitySkeleton) entity).setSkeletonType(1); - ((EntitySkeleton) entity).setCurrentItemOrArmor(0, new ItemStack(hard ? ModItems.elementiumSword : Items.stone_sword)); + ((EntitySkeleton) entity).func_189768_a(SkeletonType.WITHER); + entity.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(hard ? ModItems.elementiumSword : Items.STONE_SWORD)); } break; } @@ -700,6 +655,8 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi } if(entity != null) { + if(!entity.isImmuneToFire()) + entity.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, 600, 0)); range = 6F; entity.setPosition(posX + 0.5 + Math.random() * range - range / 2, posY - 1, posZ + 0.5 + Math.random() * range - range / 2); worldObj.spawnEntityInWorld(entity); @@ -713,26 +670,26 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi } } - setMobSpawnTicks(mobTicks - 1); - setTPDelay(10); - } else if(getTPDelay() > 0 && !worldObj.isRemote) { + mobSpawnTicks--; + tpDelay = 10; + } else if(tpDelay > 0) { if(invul > 0) setInvulTime(invul - 1); - setTPDelay(getTPDelay() - 1); - if(getTPDelay() == 0 && getHealth() > 0) { + tpDelay--; + if(tpDelay == 0 && getHealth() > 0) { int tries = 0; while(!teleportRandomly() && tries < 50) tries++; if(tries >= 50) - teleportTo(source.posX + 0.5, source.posY + 1.6, source.posZ + 0.5); + teleportTo(source.getX() + 0.5, source.getY() + 1.6, source.getZ() + 0.5); if(spawnLandmines) { int count = dying && hard ? 7 : 6; for(int i = 0; i < count; i++) { - int x = source.posX - 10 + rand.nextInt(20); - int z = source.posZ - 10 + rand.nextInt(20); - int y = worldObj.getTopSolidOrLiquidBlock(x, z); + int x = source.getX() - 10 + rand.nextInt(20); + int z = source.getZ() - 10 + rand.nextInt(20); + int y = worldObj.getTopSolidOrLiquidBlock(new BlockPos(x, -1, z)).getY(); EntityMagicLandmine landmine = new EntityMagicLandmine(worldObj); landmine.setPosition(x + 0.5, y, z + 0.5); @@ -751,7 +708,7 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi worldObj.spawnEntityInWorld(pixie); } - setTPDelay(hard ? (dying ? 35 : 45) : (dying ? 40 : 60)); + tpDelay = hard ? (dying ? 35 : 45) : (dying ? 40 : 60); spawnLandmines = true; spawnPixies = false; } @@ -761,40 +718,69 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi spawnMissile(); } else { range = 3F; - players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(posX - range, posY - range, posZ - range, posX + range, posY + range, posZ + range)); + players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(posX - range, posY - range, posZ - range, posX + range, posY + range, posZ + range)); if(!players.isEmpty()) damageEntity(DamageSource.causePlayerDamage(players.get(0)), 0); } } } - void spawnMissile() { - if(!worldObj.isRemote) { - EntityMagicMissile missile = new EntityMagicMissile(this, true); - missile.setPosition(posX + (Math.random() - 0.5 * 0.1), posY + 2.4 + (Math.random() - 0.5 * 0.1), posZ + (Math.random() - 0.5 * 0.1)); - if(missile.getTarget()) { - worldObj.playSoundAtEntity(this, "botania:missile", 0.6F, 0.8F + (float) Math.random() * 0.2F); - worldObj.spawnEntityInWorld(missile); - } + @Override + public boolean isNonBoss() + { + return false; + } + + @Override + public void addTrackingPlayer(EntityPlayerMP player) + { + super.addTrackingPlayer(player); + this.bossInfo.addPlayer(player); + } + + @Override + public void removeTrackingPlayer(EntityPlayerMP player) + { + super.removeTrackingPlayer(player); + this.bossInfo.removePlayer(player); + } + + @Override + protected void collideWithNearbyEntities() { + if(getInvulTime() == 0) + super.collideWithNearbyEntities(); + } + + @Override + public boolean canBePushed() { + return super.canBePushed() && getInvulTime() == 0; + } + + private void spawnMissile() { + EntityMagicMissile missile = new EntityMagicMissile(this, true); + missile.setPosition(posX + (Math.random() - 0.5 * 0.1), posY + 2.4 + (Math.random() - 0.5 * 0.1), posZ + (Math.random() - 0.5 * 0.1)); + if(missile.getTarget()) { + this.playSound(BotaniaSoundEvents.missile, 0.6F, 0.8F + (float) Math.random() * 0.2F); + worldObj.spawnEntityInWorld(missile); } } - public static boolean isCheatyBlock(World world, int x, int y, int z) { - Block block = world.getBlock(x, y, z); - String name = Block.blockRegistry.getNameForObject(block); + private static boolean isCheatyBlock(World world, BlockPos pos) { + Block block = world.getBlockState(pos).getBlock(); + String name = Block.REGISTRY.getNameForObject(block).toString(); return CHEATY_BLOCKS.contains(name); } // EntityEnderman code below ============================================================================ - protected boolean teleportRandomly() { + private boolean teleportRandomly() { double d0 = posX + (rand.nextDouble() - 0.5D) * 64.0D; double d1 = posY + (rand.nextInt(64) - 32); double d2 = posZ + (rand.nextDouble() - 0.5D) * 64.0D; return teleportTo(d0, d1, d2); } - protected boolean teleportTo(double par1, double par3, double par5) { + private boolean teleportTo(double par1, double par3, double par5) { double d3 = posX; double d4 = posY; double d5 = posZ; @@ -802,33 +788,32 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi posY = par3; posZ = par5; boolean flag = false; - int i = MathHelper.floor_double(posX); - int j = MathHelper.floor_double(posY); - int k = MathHelper.floor_double(posZ); + BlockPos pos = new BlockPos(this); - if(worldObj.blockExists(i, j, k)) { + if(worldObj.isBlockLoaded(pos)) { boolean flag1 = false; - while(!flag1 && j > 0) { - Block block = worldObj.getBlock(i, j - 1, k); + while(!flag1 && pos.getY() > 0) { + IBlockState state = worldObj.getBlockState(pos.down()); + Block block = state.getBlock(); - if(block.getMaterial().blocksMovement()) + if(block.getMaterial(state).blocksMovement()) flag1 = true; else { --posY; - --j; + pos = pos.down(); } } if(flag1) { setPosition(posX, posY, posZ); - if(worldObj.getCollidingBoundingBoxes(this, boundingBox).isEmpty() && !worldObj.isAnyLiquid(boundingBox)) + if(worldObj.getCollisionBoxes(this, getEntityBoundingBox()).isEmpty() && !worldObj.containsAnyLiquid(getEntityBoundingBox())) flag = true; // Prevent out of bounds teleporting - ChunkCoordinates source = getSource(); - if(vazkii.botania.common.core.helper.MathHelper.pointDistanceSpace(posX, posY, posZ, source.posX, source.posY, source.posZ) > 12) + BlockPos source = getSource(); + if(vazkii.botania.common.core.helper.MathHelper.pointDistanceSpace(posX, posY, posZ, source.getX(), source.getY(), source.getZ()) > 12) flag = false; } } @@ -847,11 +832,22 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi double d7 = d3 + (posX - d3) * d6 + (rand.nextDouble() - 0.5D) * width * 2.0D; double d8 = d4 + (posY - d4) * d6 + rand.nextDouble() * height; double d9 = d5 + (posZ - d5) * d6 + (rand.nextDouble() - 0.5D) * width * 2.0D; - worldObj.spawnParticle("portal", d7, d8, d9, f, f1, f2); + worldObj.spawnParticle(EnumParticleTypes.PORTAL, d7, d8, d9, f, f1, f2); + } + + playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1.0F, 1.0F); + + Vec3d origPos = new Vec3d(d3, d4 + height / 2, d5); + Vec3d newPos = new Vec3d(posX, posY + height / 2, posZ); + + if(origPos.squareDistanceTo(newPos) > 1) { + for(EntityPlayer player : getPlayersAround()) { + RayTraceResult rtr = player.getEntityBoundingBox().expandXyz(0.25).calculateIntercept(origPos, newPos); + if(rtr != null) + player.attackEntityFrom(DamageSource.causeMobDamage(this), 6); + } } - worldObj.playSoundEffect(d3, d4, d5, "mob.endermen.portal", 1.0F, 1.0F); - playSound("mob.endermen.portal", 1.0F, 1.0F); return true; } } @@ -885,24 +881,31 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi @Override @SideOnly(Side.CLIENT) - public void bossBarRenderCallback(ScaledResolution res, int x, int y) { - GL11.glPushMatrix(); + public int bossBarRenderCallback(ScaledResolution res, int x, int y) { + GlStateManager.pushMatrix(); int px = x + 160; int py = y + 12; Minecraft mc = Minecraft.getMinecraft(); - ItemStack stack = new ItemStack(Items.skull, 1, 3); - mc.renderEngine.bindTexture(TextureMap.locationItemsTexture); + ItemStack stack = new ItemStack(Items.SKULL, 1, 3); + mc.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); net.minecraft.client.renderer.RenderHelper.enableGUIStandardItemLighting(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - RenderItem.getInstance().renderItemIntoGUI(mc.fontRenderer, mc.renderEngine, stack, px, py); + GlStateManager.enableRescaleNormal(); + mc.getRenderItem().renderItemIntoGUI(stack, px, py); net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting(); - boolean unicode = mc.fontRenderer.getUnicodeFlag(); - mc.fontRenderer.setUnicodeFlag(true); - mc.fontRenderer.drawStringWithShadow("" + getPlayerCount(), px + 15, py + 4, 0xFFFFFF); - mc.fontRenderer.setUnicodeFlag(unicode); - GL11.glPopMatrix(); + boolean unicode = mc.fontRendererObj.getUnicodeFlag(); + mc.fontRendererObj.setUnicodeFlag(true); + mc.fontRendererObj.drawStringWithShadow("" + getPlayerCount(), px + 15, py + 4, 0xFFFFFF); + mc.fontRendererObj.setUnicodeFlag(unicode); + GlStateManager.popMatrix(); + + return 5; + } + + @Override + public UUID getBossInfoUuid() { + return dataManager.get(BOSSINFO_ID).or(new UUID(0, 0)); } @Override @@ -918,47 +921,42 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi @SideOnly(Side.CLIENT) public ShaderCallback getBossBarShaderCallback(boolean background, int shader) { if(shaderCallback == null) - shaderCallback = new ShaderCallback() { - - @Override - public void call(int shader) { - int grainIntensityUniform = ARBShaderObjects.glGetUniformLocationARB(shader, "grainIntensity"); - int hpFractUniform = ARBShaderObjects.glGetUniformLocationARB(shader, "hpFract"); + shaderCallback = shader1 -> { + int grainIntensityUniform = ARBShaderObjects.glGetUniformLocationARB(shader1, "grainIntensity"); + int hpFractUniform = ARBShaderObjects.glGetUniformLocationARB(shader1, "hpFract"); float time = getInvulTime(); float grainIntensity = time > 20 ? 1F : Math.max(isHardMode() ? 0.5F : 0F, time / 20F); ARBShaderObjects.glUniform1fARB(grainIntensityUniform, grainIntensity); ARBShaderObjects.glUniform1fARB(hpFractUniform, getHealth() / getMaxHealth()); - } - - }; + }; return background ? null : shaderCallback; } - public static class BeaconComponent extends MultiblockComponent { + private static class BeaconComponent extends MultiblockComponent { - public BeaconComponent(ChunkCoordinates relPos) { - super(relPos, Blocks.iron_block, 0); + public BeaconComponent(BlockPos relPos) { + super(relPos, Blocks.IRON_BLOCK.getDefaultState()); } @Override - public boolean matches(World world, int x, int y, int z) { - return world.getBlock(x, y, z).isBeaconBase(world, x, y, z, x - relPos.posX, y - relPos.posY, z - relPos.posZ); - }; + public boolean matches(World world, BlockPos pos) { + return world.getBlockState(pos).getBlock().isBeaconBase(world, pos, pos.add(new BlockPos(-relPos.getX(), -relPos.getY(), -relPos.getZ()))); + } } - public static class BeaconBeamComponent extends MultiblockComponent { + private static class BeaconBeamComponent extends MultiblockComponent { - public BeaconBeamComponent(ChunkCoordinates relPos) { - super(relPos, Blocks.beacon, 0); + public BeaconBeamComponent(BlockPos relPos) { + super(relPos, Blocks.BEACON.getDefaultState()); } @Override - public boolean matches(World world, int x, int y, int z) { - return world.getTileEntity(x, y, z) instanceof TileEntityBeacon; + public boolean matches(World world, BlockPos pos) { + return world.getTileEntity(pos) instanceof TileEntityBeacon; } } } diff --git a/src/main/java/vazkii/botania/common/entity/EntityEnderAirBottle.java b/src/main/java/vazkii/botania/common/entity/EntityEnderAirBottle.java index 0a470bc23..71add9d03 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityEnderAirBottle.java +++ b/src/main/java/vazkii/botania/common/entity/EntityEnderAirBottle.java @@ -10,17 +10,22 @@ */ package vazkii.botania.common.entity; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.block.state.pattern.BlockStateMatcher; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + public class EntityEnderAirBottle extends EntityThrowable { public EntityEnderAirBottle(World world) { @@ -32,45 +37,35 @@ public class EntityEnderAirBottle extends EntityThrowable { } @Override - protected void onImpact(MovingObjectPosition pos) { - if(pos.entityHit == null && !worldObj.isRemote) { - List coordsList = getCoordsToPut(pos.blockX, pos.blockY, pos.blockZ); - worldObj.playAuxSFX(2002, (int)Math.round(posX), (int)Math.round(posY), (int)Math.round(posZ), 8); + protected void onImpact(@Nonnull RayTraceResult pos) { + if(pos.getBlockPos() != null && !worldObj.isRemote) { + List coordsList = getCoordsToPut(pos.getBlockPos()); + worldObj.playEvent(2002, new BlockPos(this), 8); - for(ChunkCoordinates coords : coordsList) { - worldObj.setBlock(coords.posX, coords.posY, coords.posZ, Blocks.end_stone); + for(BlockPos coords : coordsList) { + worldObj.setBlockState(coords, Blocks.END_STONE.getDefaultState()); if(Math.random() < 0.1) - worldObj.playAuxSFX(2001, coords.posX, coords.posY, coords.posZ, Block.getIdFromBlock(Blocks.end_stone)); + worldObj.playEvent(2001, coords, Block.getStateId(Blocks.END_STONE.getDefaultState())); } setDead(); } } - public List getCoordsToPut(int xCoord, int yCoord, int zCoord) { - List possibleCoords = new ArrayList(); - List selectedCoords = new ArrayList(); + private List getCoordsToPut(BlockPos pos) { + List possibleCoords = new ArrayList<>(); int range = 4; int rangeY = 4; - for(int i = -range; i < range + 1; i++) - for(int j = -rangeY; j < rangeY; j++) - for(int k = -range; k < range + 1; k++) { - int x = xCoord + i; - int y = yCoord + j; - int z = zCoord + k; - Block block = worldObj.getBlock(x, y, z); - if(block != null && block.isReplaceableOreGen(worldObj, x, y, z, Blocks.stone)) - possibleCoords.add(new ChunkCoordinates(x, y, z)); - } - - int count = 64; - while(!possibleCoords.isEmpty() && count > 0) { - ChunkCoordinates coords = possibleCoords.get(worldObj.rand.nextInt(possibleCoords.size())); - possibleCoords.remove(coords); - selectedCoords.add(coords); - count--; + for (BlockPos bPos : BlockPos.getAllInBox(pos.add(-range, -rangeY, -range), pos.add(range, rangeY, range))) { + IBlockState state = worldObj.getBlockState(bPos); + Block block = state.getBlock(); + if(block.isReplaceableOreGen(state, worldObj, bPos, BlockStateMatcher.forBlock(Blocks.STONE))) + possibleCoords.add(bPos); } - return selectedCoords; + + Collections.shuffle(possibleCoords, rand); + + return possibleCoords.stream().limit(64).collect(Collectors.toList()); } } diff --git a/src/main/java/vazkii/botania/common/entity/EntityFallingStar.java b/src/main/java/vazkii/botania/common/entity/EntityFallingStar.java index 82d1f4c0b..5808bd112 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityFallingStar.java +++ b/src/main/java/vazkii/botania/common/entity/EntityFallingStar.java @@ -10,18 +10,19 @@ */ package vazkii.botania.common.entity; -import java.util.List; - import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.DamageSource; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; import vazkii.botania.common.Botania; import vazkii.botania.common.core.handler.ConfigHandler; +import java.util.List; + public class EntityFallingStar extends EntityThrowableCopy { public EntityFallingStar(World world) { @@ -43,19 +44,19 @@ public class EntityFallingStar extends EntityThrowableCopy { float xs = (float) (Math.random() - 0.5) * dist; float ys = (float) (Math.random() - 0.5) * dist; float zs = (float) (Math.random() - 0.5) * dist; - Botania.proxy.sparkleFX(worldObj, posX + xs, posY + ys, posZ + zs, 1F, 0.4F, 1F, 2F, 6); + Botania.proxy.sparkleFX(posX + xs, posY + ys, posZ + zs, 1F, 0.4F, 1F, 2F, 6); } EntityLivingBase thrower = getThrower(); if(!worldObj.isRemote && thrower != null) { - AxisAlignedBB axis = AxisAlignedBB.getBoundingBox(posX, posY, posZ, lastTickPosX, lastTickPosY, lastTickPosZ).expand(2, 2, 2); + AxisAlignedBB axis = new AxisAlignedBB(posX, posY, posZ, lastTickPosX, lastTickPosY, lastTickPosZ).expand(2, 2, 2); List entities = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axis); for(EntityLivingBase living : entities) { if(living == thrower) continue; if(living.hurtTime == 0) { - onImpact(new MovingObjectPosition(living)); + onImpact(new RayTraceResult(living)); return; } } @@ -66,17 +67,22 @@ public class EntityFallingStar extends EntityThrowableCopy { } @Override - protected void onImpact(MovingObjectPosition pos) { + protected void onImpact(RayTraceResult pos) { + if (worldObj.isRemote) + return; + EntityLivingBase thrower = getThrower(); if(pos.entityHit != null && thrower != null && pos.entityHit != thrower && !pos.entityHit.isDead) { if(thrower instanceof EntityPlayer) - pos.entityHit.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) thrower), 10); - else pos.entityHit.attackEntityFrom(DamageSource.generic, 10); + pos.entityHit.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) thrower), Math.random() < 0.25 ? 10 : 5); + else pos.entityHit.attackEntityFrom(DamageSource.generic, Math.random() < 0.25 ? 10 : 5); } - Block block = worldObj.getBlock(pos.blockX, pos.blockY, pos.blockZ); - if(ConfigHandler.blockBreakParticles && !block.isAir(worldObj, pos.blockX, pos.blockY, pos.blockZ)) - worldObj.playAuxSFX(2001, pos.blockX, pos.blockY, pos.blockZ, Block.getIdFromBlock(block) + (worldObj.getBlockMetadata(pos.blockX, pos.blockY, pos.blockZ) << 12)); + if (pos.getBlockPos() != null) { + IBlockState state = worldObj.getBlockState(pos.getBlockPos()); + if(ConfigHandler.blockBreakParticles && !state.getBlock().isAir(state, worldObj, pos.getBlockPos())) + worldObj.playEvent(2001, pos.getBlockPos(), Block.getStateId(state)); + } setDead(); } diff --git a/src/main/java/vazkii/botania/common/entity/EntityFlameRing.java b/src/main/java/vazkii/botania/common/entity/EntityFlameRing.java index b77f34f00..023c72b66 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityFlameRing.java +++ b/src/main/java/vazkii/botania/common/entity/EntityFlameRing.java @@ -11,17 +11,20 @@ package vazkii.botania.common.entity; -import java.util.List; - import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.SoundEvents; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.DamageSource; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.world.World; import vazkii.botania.common.Botania; import vazkii.botania.common.core.helper.MathHelper; +import javax.annotation.Nonnull; +import java.util.List; + public class EntityFlameRing extends Entity { @@ -51,18 +54,18 @@ public class EntityFlameRing extends Entity { double x = Math.cos(rad) * renderRadius; double z = Math.sin(rad) * renderRadius; - Botania.proxy.wispFX(worldObj, posX + x, posY - 0.2, posZ + z, 1F, (float) Math.random() * 0.25F, (float) Math.random() * 0.25F, 0.65F + (float) Math.random() * 0.45F, (float) (Math.random() - 0.5F) * 0.15F, 0.055F + (float) Math.random() * 0.025F, (float) (Math.random() - 0.5F) * 0.15F); + Botania.proxy.wispFX(posX + x, posY - 0.2, posZ + z, 1F, (float) Math.random() * 0.25F, (float) Math.random() * 0.25F, 0.65F + (float) Math.random() * 0.45F, (float) (Math.random() - 0.5F) * 0.15F, 0.055F + (float) Math.random() * 0.025F, (float) (Math.random() - 0.5F) * 0.15F); float gs = (float) Math.random() * 0.15F; float smokeRadius = (float) (renderRadius - Math.random() * renderRadius * 0.9); x = Math.cos(rad) * smokeRadius; z = Math.sin(rad) * smokeRadius; - Botania.proxy.wispFX(worldObj, posX + x, posY - 0.2, posZ + z, gs, gs, gs, 0.65F + (float) Math.random() * 0.45F, -0.155F - (float) Math.random() * 0.025F); + Botania.proxy.wispFX(posX + x, posY - 0.2, posZ + z, gs, gs, gs, 0.65F + (float) Math.random() * 0.45F, -0.155F - (float) Math.random() * 0.025F); } } if(worldObj.rand.nextInt(20) == 0) - worldObj.playSoundAtEntity(this, "fire.fire", 1F, 1F); + worldObj.playSound(posX, posY, posZ, SoundEvents.BLOCK_FIRE_AMBIENT, SoundCategory.BLOCKS, 1F, 1F, false); if(worldObj.isRemote) return; @@ -73,7 +76,7 @@ public class EntityFlameRing extends Entity { } if(ticksExisted > 45) { - AxisAlignedBB boundingBox = AxisAlignedBB.getBoundingBox(posX, posY, posZ, posX, posY, posZ).expand(radius, radius, radius); + AxisAlignedBB boundingBox = new AxisAlignedBB(posX, posY, posZ, posX, posY, posZ).expand(radius, radius, radius); List entities = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, boundingBox); if(entities.isEmpty()) @@ -89,19 +92,14 @@ public class EntityFlameRing extends Entity { } @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { + public boolean attackEntityFrom(@Nonnull DamageSource par1DamageSource, float par2) { return false; } @Override - protected void readEntityFromNBT(NBTTagCompound var1) { - // NO-OP - } - + protected void readEntityFromNBT(@Nonnull NBTTagCompound var1) {} @Override - protected void writeEntityToNBT(NBTTagCompound var1) { - // NO-OP - } + protected void writeEntityToNBT(@Nonnull NBTTagCompound var1) {} } \ No newline at end of file diff --git a/src/main/java/vazkii/botania/common/entity/EntityFlyingCreature.java b/src/main/java/vazkii/botania/common/entity/EntityFlyingCreature.java deleted file mode 100644 index b9c27de8c..000000000 --- a/src/main/java/vazkii/botania/common/entity/EntityFlyingCreature.java +++ /dev/null @@ -1,89 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [? (GMT)] - */ -package vazkii.botania.common.entity; - -import net.minecraft.block.Block; -import net.minecraft.entity.passive.EntityAmbientCreature; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; - -public class EntityFlyingCreature extends EntityAmbientCreature { - - public EntityFlyingCreature(World par1World) { - super(par1World); - } - - @Override - protected void fall(float par1) { - // NO-OP - } - - @Override - protected void updateFallState(double par1, boolean par3) { - // NO-OP - } - - @Override - public void moveEntityWithHeading(float par1, float par2) { - if(isInWater()) { - moveFlying(par1, par2, 0.02F); - moveEntity(motionX, motionY, motionZ); - motionX *= 0.800000011920929D; - motionY *= 0.800000011920929D; - motionZ *= 0.800000011920929D; - } else if(handleLavaMovement()) { - moveFlying(par1, par2, 0.02F); - moveEntity(motionX, motionY, motionZ); - motionX *= 0.5D; - motionY *= 0.5D; - motionZ *= 0.5D; - } else { - float f2 = 0.91F; - - if (onGround) { - f2 = 0.54600006F; - Block block = worldObj.getBlock(MathHelper.floor_double(posX), MathHelper.floor_double(boundingBox.minY) - 1, MathHelper.floor_double(posZ)); - f2 = block.slipperiness * 0.91F; - } - - float f3 = 0.16277136F / (f2 * f2 * f2); - moveFlying(par1, par2, onGround ? 0.1F * f3 : 0.02F); - f2 = 0.91F; - - if (onGround) { - f2 = 0.54600006F; - Block block = worldObj.getBlock(MathHelper.floor_double(posX), MathHelper.floor_double(boundingBox.minY) - 1, MathHelper.floor_double(posZ)); - f2 = block.slipperiness * 0.91F; - } - - moveEntity(motionX, motionY, motionZ); - motionX *= f2; - motionY *= f2; - motionZ *= f2; - } - - prevLimbSwingAmount = limbSwingAmount; - double d0 = posX - prevPosX; - double d1 = posZ - prevPosZ; - float f4 = MathHelper.sqrt_double(d0 * d0 + d1 * d1) * 4.0F; - - if(f4 > 1.0F) - f4 = 1.0F; - - limbSwingAmount += (f4 - limbSwingAmount) * 0.4F; - limbSwing += limbSwingAmount; - } - - @Override - public boolean isOnLadder() { - return false; - } -} \ No newline at end of file diff --git a/src/main/java/vazkii/botania/common/entity/EntityMagicLandmine.java b/src/main/java/vazkii/botania/common/entity/EntityMagicLandmine.java index 8d56c4336..fde3e92ee 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityMagicLandmine.java +++ b/src/main/java/vazkii/botania/common/entity/EntityMagicLandmine.java @@ -10,24 +10,27 @@ */ package vazkii.botania.common.entity; -import java.util.List; - import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.MobEffects; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.DamageSource; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.world.World; +import vazkii.botania.api.sound.BotaniaSoundEvents; import vazkii.botania.common.Botania; +import javax.annotation.Nonnull; +import java.util.List; + public class EntityMagicLandmine extends Entity { public EntityDoppleganger summoner; - public EntityMagicLandmine(World par1World) { - super(par1World); + public EntityMagicLandmine(World world) { + super(world); setSize(0F, 0F); } @@ -46,22 +49,22 @@ public class EntityMagicLandmine extends Entity { //Botania.proxy.wispFX(worldObj, posX, posY, posZ, r, g, b, 0.6F, -0.2F, 1); for(int i = 0; i < 6; i++) - Botania.proxy.wispFX(worldObj, posX - range + Math.random() * range * 2, posY, posZ - range + Math.random() * range * 2, r, g, b, 0.4F, -0.015F, 1); + Botania.proxy.wispFX(posX - range + Math.random() * range * 2, posY, posZ - range + Math.random() * range * 2, r, g, b, 0.4F, -0.015F, 1); if(ticksExisted >= 55) { - worldObj.playSoundEffect(posX, posY, posZ, "botania:gaiaTrap", 0.3F, 1F); + worldObj.playSound(null, posX, posY, posZ, BotaniaSoundEvents.gaiaTrap, SoundCategory.NEUTRAL, 0.3F, 1F); float m = 0.35F; g = 0.4F; for(int i = 0; i < 25; i++) - Botania.proxy.wispFX(worldObj, posX, posY + 1, posZ, r, g, b, 0.5F, (float) (Math.random() - 0.5F) * m, (float) (Math.random() - 0.5F) * m, (float) (Math.random() - 0.5F) * m); + Botania.proxy.wispFX(posX, posY + 1, posZ, r, g, b, 0.5F, (float) (Math.random() - 0.5F) * m, (float) (Math.random() - 0.5F) * m, (float) (Math.random() - 0.5F) * m); if(!worldObj.isRemote) { - List players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(posX - range, posY - range, posZ - range, posX + range, posY + range, posZ + range)); + List players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(posX - range, posY - range, posZ - range, posX + range, posY + range, posZ + range)); for(EntityPlayer player : players) { - player.attackEntityFrom(summoner == null ? DamageSource.generic : DamageSource.causeMobDamage(summoner), 10); - player.addPotionEffect(new PotionEffect(Potion.blindness.id, 25, 0)); - PotionEffect wither = new PotionEffect(Potion.wither.id, 70, 3); + player.attackEntityFrom(DamageSource.causeIndirectMagicDamage(this, summoner), 10); + player.addPotionEffect(new PotionEffect(MobEffects.BLINDNESS, 25, 0)); + PotionEffect wither = new PotionEffect(MobEffects.WITHER, 70, 3); wither.getCurativeItems().clear(); player.addPotionEffect(wither); } @@ -76,11 +79,11 @@ public class EntityMagicLandmine extends Entity { } @Override - protected void readEntityFromNBT(NBTTagCompound var1) { + protected void readEntityFromNBT(@Nonnull NBTTagCompound var1) { } @Override - protected void writeEntityToNBT(NBTTagCompound var1) { + protected void writeEntityToNBT(@Nonnull NBTTagCompound var1) { } } diff --git a/src/main/java/vazkii/botania/common/entity/EntityMagicMissile.java b/src/main/java/vazkii/botania/common/entity/EntityMagicMissile.java index 88fda7c89..20f3a5ce0 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityMagicMissile.java +++ b/src/main/java/vazkii/botania/common/entity/EntityMagicMissile.java @@ -10,8 +10,7 @@ */ package vazkii.botania.common.entity; -import java.util.List; - +import com.google.common.base.Predicates; import net.minecraft.block.Block; import net.minecraft.block.BlockBush; import net.minecraft.block.BlockLeaves; @@ -21,18 +20,26 @@ import net.minecraft.entity.monster.IMob; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; +import net.minecraft.network.datasync.DataParameter; +import net.minecraft.network.datasync.DataSerializers; +import net.minecraft.network.datasync.EntityDataManager; import net.minecraft.util.DamageSource; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.ReflectionHelper; import vazkii.botania.common.Botania; import vazkii.botania.common.core.helper.Vector3; import vazkii.botania.common.lib.LibObfuscation; -import cpw.mods.fml.relauncher.ReflectionHelper; + +import javax.annotation.Nonnull; +import java.util.List; public class EntityMagicMissile extends EntityThrowable { private static final String TAG_TIME = "time"; + private static final DataParameter EVIL = EntityDataManager.createKey(EntityMagicMissile.class, DataSerializers.BOOLEAN); + private static final DataParameter TARGET = EntityDataManager.createKey(EntityMagicMissile.class, DataSerializers.VARINT); double lockX, lockY = -1, lockZ; int time = 0; @@ -50,24 +57,24 @@ public class EntityMagicMissile extends EntityThrowable { @Override protected void entityInit() { - dataWatcher.addObject(25, (byte) 0); - dataWatcher.addObject(26, 0); + dataManager.register(EVIL, false); + dataManager.register(TARGET, 0); } public void setEvil(boolean evil) { - dataWatcher.updateObject(25, (byte) (evil ? 1 : 0)); + dataManager.set(EVIL, evil); } public boolean isEvil() { - return dataWatcher.getWatchableObjectByte(25) == 1; + return dataManager.get(EVIL); } public void setTarget(EntityLivingBase e) { - dataWatcher.updateObject(26, e == null ? -1 : e.getEntityId()); + dataManager.set(TARGET, e == null ? -1 : e.getEntityId()); } public EntityLivingBase getTargetEntity() { - int id = dataWatcher.getWatchableObjectInt(26); + int id = dataManager.get(TARGET); Entity e = worldObj.getEntityByID(id); if(e != null && e instanceof EntityLivingBase) return (EntityLivingBase) e; @@ -91,18 +98,18 @@ public class EntityMagicMissile extends EntityThrowable { boolean evil = isEvil(); Vector3 thisVec = Vector3.fromEntityCenter(this); Vector3 oldPos = new Vector3(lastTickPosX, lastTickPosY, lastTickPosZ); - Vector3 diff = thisVec.copy().sub(oldPos); - Vector3 step = diff.copy().normalize().multiply(0.05); + Vector3 diff = thisVec.subtract(oldPos); + Vector3 step = diff.normalize().multiply(0.05); int steps = (int) (diff.mag() / step.mag()); - Vector3 particlePos = oldPos.copy(); + Vector3 particlePos = oldPos; Botania.proxy.setSparkleFXCorrupt(evil); for(int i = 0; i < steps; i++) { - Botania.proxy.sparkleFX(worldObj, particlePos.x, particlePos.y, particlePos.z, 1F, evil ? 0F : 0.4F, 1F, 0.8F, 2); + Botania.proxy.sparkleFX(particlePos.x, particlePos.y, particlePos.z, 1F, evil ? 0F : 0.4F, 1F, 0.8F, 2); if(worldObj.rand.nextInt(steps) <= 1) - Botania.proxy.sparkleFX(worldObj, particlePos.x + (Math.random() - 0.5) * 0.4, particlePos.y + (Math.random() - 0.5) * 0.4, particlePos.z + (Math.random() - 0.5) * 0.4, 1F, evil ? 0F : 0.4F, 1F, 0.8F, 2); + Botania.proxy.sparkleFX(particlePos.x + (Math.random() - 0.5) * 0.4, particlePos.y + (Math.random() - 0.5) * 0.4, particlePos.z + (Math.random() - 0.5) * 0.4, 1F, evil ? 0F : 0.4F, 1F, 0.8F, 2); - particlePos.add(step); + particlePos = particlePos.add(step); } Botania.proxy.setSparkleFXCorrupt(false); @@ -115,15 +122,15 @@ public class EntityMagicMissile extends EntityThrowable { } Vector3 targetVec = evil ? new Vector3(lockX, lockY, lockZ) : Vector3.fromEntityCenter(target); - Vector3 diffVec = targetVec.copy().sub(thisVec); - Vector3 motionVec = diffVec.copy().normalize().multiply(evil ? 0.5 : 0.6); + Vector3 diffVec = targetVec.subtract(thisVec); + Vector3 motionVec = diffVec.normalize().multiply(evil ? 0.5 : 0.6); motionX = motionVec.x; motionY = motionVec.y; if(time < 10) motionY = Math.abs(motionY); motionZ = motionVec.z; - List targetList = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(posX - 0.5, posY - 0.5, posZ - 0.5, posX + 0.5, posY + 0.5, posZ + 0.5)); + List targetList = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(posX - 0.5, posY - 0.5, posZ - 0.5, posX + 0.5, posY + 0.5, posZ + 0.5)); if(targetList.contains(target) && target != null) { EntityLivingBase thrower = getThrower(); if(thrower != null) { @@ -162,7 +169,7 @@ public class EntityMagicMissile extends EntityThrowable { setTarget(null); double range = 12; - List entities = worldObj.getEntitiesWithinAABB(isEvil() ? EntityPlayer.class : IMob.class, AxisAlignedBB.getBoundingBox(posX - range, posY - range, posZ - range, posX + range, posY + range, posZ + range)); + List entities = worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(posX - range, posY - range, posZ - range, posX + range, posY + range, posZ + range), Predicates.instanceOf(isEvil() ? EntityPlayer.class : IMob.class)); while(entities.size() > 0) { Entity e = (Entity) entities.get(worldObj.rand.nextInt(entities.size())); if(!(e instanceof EntityLivingBase) || e.isDead) { // Just in case... @@ -179,11 +186,24 @@ public class EntityMagicMissile extends EntityThrowable { } @Override - protected void onImpact(MovingObjectPosition pos) { - Block block = worldObj.getBlock(pos.blockX, pos.blockY, pos.blockZ); - - if(!(block instanceof BlockBush) && !(block instanceof BlockLeaves) && (pos.entityHit == null || getTargetEntity() == pos.entityHit)) - setDead(); + protected void onImpact(@Nonnull RayTraceResult pos) { + switch (pos.typeOfHit) { + case BLOCK: { + Block block = worldObj.getBlockState(pos.getBlockPos()).getBlock(); + if(!(block instanceof BlockBush) && !(block instanceof BlockLeaves)) + setDead(); + break; + } + case ENTITY: { + if (pos.entityHit == getTargetEntity()) + setDead(); + break; + } + default: { + setDead(); + break; + } + } } } diff --git a/src/main/java/vazkii/botania/common/entity/EntityManaBurst.java b/src/main/java/vazkii/botania/common/entity/EntityManaBurst.java index c51478a19..e5c88aeec 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityManaBurst.java +++ b/src/main/java/vazkii/botania/common/entity/EntityManaBurst.java @@ -10,29 +10,30 @@ */ package vazkii.botania.common.entity; -import java.awt.Color; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; -import java.util.UUID; - +import com.google.common.base.Optional; import net.minecraft.block.Block; import net.minecraft.block.BlockBush; import net.minecraft.block.BlockLeaves; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.datasync.DataParameter; +import net.minecraft.network.datasync.DataSerializers; +import net.minecraft.network.datasync.EntityDataManager; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.Vec3; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.internal.IManaBurst; import vazkii.botania.api.internal.VanillaPacketDispatcher; @@ -49,8 +50,16 @@ import vazkii.botania.common.Botania; import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.core.helper.Vector3; import vazkii.botania.common.item.equipment.bauble.ItemTinyPlanet; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import javax.annotation.Nonnull; +import java.awt.*; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Objects; +import java.util.Random; +import java.util.Set; +import java.util.UUID; public class EntityManaBurst extends EntityThrowable implements IManaBurst { @@ -72,58 +81,65 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { private static final String TAG_SHOOTER_UUID_MOST = "shooterUUIDMost"; private static final String TAG_SHOOTER_UUID_LEAST = "shooterUUIDLeast"; + private static final DataParameter COLOR = EntityDataManager.createKey(EntityManaBurst.class, DataSerializers.VARINT); + private static final DataParameter MANA = EntityDataManager.createKey(EntityManaBurst.class, DataSerializers.VARINT); + private static final DataParameter START_MANA = EntityDataManager.createKey(EntityManaBurst.class, DataSerializers.VARINT); + private static final DataParameter MIN_MANA_LOSS = EntityDataManager.createKey(EntityManaBurst.class, DataSerializers.VARINT); + private static final DataParameter MANA_LOSS_PER_TICK = EntityDataManager.createKey(EntityManaBurst.class, DataSerializers.FLOAT); + private static final DataParameter GRAVITY = EntityDataManager.createKey(EntityManaBurst.class, DataSerializers.FLOAT); + private static final DataParameter SOURCE_COORDS = EntityDataManager.createKey(EntityManaBurst.class, DataSerializers.BLOCK_POS); + private static final DataParameter> SOURCE_LENS = EntityDataManager.createKey(EntityManaBurst.class, DataSerializers.OPTIONAL_ITEM_STACK); + + float accumulatedManaLoss = 0; boolean fake = false; - - final int dataWatcherEntries = 10; - final int dataWatcherStart = 32 - dataWatcherEntries; - - List alreadyCollidedAt = new ArrayList(); - + final Set alreadyCollidedAt = new HashSet<>(); boolean fullManaLastTick = true; - UUID shooterIdentity = null; int _ticksExisted = 0; boolean scanBeam = false; - public List propsList = new ArrayList(); + public final List propsList = new ArrayList<>(); public EntityManaBurst(World world) { super(world); setSize(0F, 0F); - for(int i = 0; i < dataWatcherEntries; i++) { - int j = dataWatcherStart + i; - if(i == 4 || i == 5) - dataWatcher.addObject(j, 0F); - else if(i == 9) - dataWatcher.addObject(j, new ItemStack(Blocks.stone, 0, 0)); - else dataWatcher.addObject(j, 0); + } - dataWatcher.setObjectWatched(j); - } + @Override + protected void entityInit() { + super.entityInit(); + dataManager.register(COLOR, 0); + dataManager.register(MANA, 0); + dataManager.register(START_MANA, 0); + dataManager.register(MIN_MANA_LOSS, 0); + dataManager.register(MANA_LOSS_PER_TICK, 0F); + dataManager.register(GRAVITY, 0F); + dataManager.register(SOURCE_COORDS, BlockPos.ORIGIN); + dataManager.register(SOURCE_LENS, Optional.absent()); } public EntityManaBurst(IManaSpreader spreader, boolean fake) { - this(((TileEntity)spreader).getWorldObj()); + this(((TileEntity)spreader).getWorld()); TileEntity tile = (TileEntity) spreader; this.fake = fake; - setBurstSourceCoords(tile.xCoord, tile.yCoord, tile.zCoord); - setLocationAndAngles(tile.xCoord + 0.5, tile.yCoord + 0.5, tile.zCoord + 0.5, 0, 0); + setBurstSourceCoords(tile.getPos()); + setLocationAndAngles(tile.getPos().getX() + 0.5, tile.getPos().getY() + 0.5, tile.getPos().getZ() + 0.5, 0, 0); rotationYaw = -(spreader.getRotationX() + 90F); rotationPitch = spreader.getRotationY(); float f = 0.4F; double mx = MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI) * f / 2D; double mz = -(MathHelper.cos(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI) * f) / 2D; - double my = MathHelper.sin((rotationPitch + func_70183_g()) / 180.0F * (float) Math.PI) * f / 2D; + double my = MathHelper.sin((rotationPitch) / 180.0F * (float) Math.PI) * f / 2D; setMotion(mx, my, mz); } public EntityManaBurst(EntityPlayer player) { this(player.worldObj); - setBurstSourceCoords(0, -1, 0); + setBurstSourceCoords(new BlockPos(0, -1, 0)); setLocationAndAngles(player.posX, player.posY + player.getEyeHeight(), player.posZ, player.rotationYaw + 180, -player.rotationPitch); posX -= MathHelper.cos((rotationYaw + 180) / 180.0F * (float) Math.PI) * 0.16F; @@ -131,228 +147,165 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { posZ -= MathHelper.sin((rotationYaw + 180) / 180.0F * (float) Math.PI) * 0.16F; setPosition(posX, posY, posZ); - yOffset = 0.0F; float f = 0.4F; double mx = MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI) * f / 2D; double mz = -(MathHelper.cos(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI) * f) / 2D; - double my = MathHelper.sin((rotationPitch + func_70183_g()) / 180.0F * (float) Math.PI) * f / 2D; + double my = MathHelper.sin((rotationPitch) / 180.0F * (float) Math.PI) * f / 2D; setMotion(mx, my, mz); } - float accumulatedManaLoss = 0; + // Copy of EntityThrowable.onUpdate. Relevant edits indicated. + private void superUpdate() { + this.lastTickPosX = this.posX; + this.lastTickPosY = this.posY; + this.lastTickPosZ = this.posZ; + // super.onUpdate(); Botania - inline supersuperclass's onUpdate + { + if (!this.worldObj.isRemote) + { + this.setFlag(6, this.isGlowing()); + } - private int ticksInAir; + this.onEntityUpdate(); + } - // Hacked code copied from super.onUpdate, to use Vector3 rather than the world vector pool - public void superUpdate() { - lastTickPosX = posX; - lastTickPosY = posY; - lastTickPosZ = posZ; - onEntityUpdate(); + if (this.throwableShake > 0) + { + --this.throwableShake; + } - if(throwableShake > 0) - --throwableShake; + // Botania - remove inGround check and its else branch. Bursts are never inGround. - Vec3 vec3 = new Vector3(posX, posY, posZ).toVec3D(); - Vec3 vec31 = new Vector3(posX + motionX, posY + motionY, posZ + motionZ).toVec3D(); - MovingObjectPosition movingobjectposition = clip(vec3, vec31); + Vec3d vec3d = new Vec3d(this.posX, this.posY, this.posZ); + Vec3d vec3d1 = new Vec3d(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + RayTraceResult raytraceresult = this.worldObj.rayTraceBlocks(vec3d, vec3d1); + vec3d = new Vec3d(this.posX, this.posY, this.posZ); + vec3d1 = new Vec3d(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); - if(movingobjectposition != null) - vec31 = new Vector3(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord).toVec3D(); + if (raytraceresult != null) + { + vec3d1 = new Vec3d(raytraceresult.hitVec.xCoord, raytraceresult.hitVec.yCoord, raytraceresult.hitVec.zCoord); + } - if(!worldObj.isRemote) { + if(!worldObj.isRemote) { // Botania - only do entity colliding on server Entity entity = null; - List list = worldObj.getEntitiesWithinAABBExcludingEntity(this, boundingBox.addCoord(motionX, motionY, motionZ).expand(1.0D, 1.0D, 1.0D)); + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox().addCoord(this.motionX, this.motionY, this.motionZ).expandXyz(1.0D)); double d0 = 0.0D; - EntityLivingBase entitylivingbase = getThrower(); + boolean flag = false; - for(int j = 0; j < list.size(); ++j) { - Entity entity1 = (Entity) list.get(j); + for (int i = 0; i < list.size(); ++i) + { + Entity entity1 = (Entity)list.get(i); - if(entity1.canBeCollidedWith() && (entity1 != entitylivingbase || ticksInAir >= 5)) { - float f = 0.3F; - AxisAlignedBB axisalignedbb = entity1.boundingBox.expand(f, f, f); - MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31); + if (entity1.canBeCollidedWith()) + { + if (entity1 == this.ignoreEntity) + { + flag = true; + } + else if (this.ticksExisted < 2 && this.ignoreEntity == null) + { + this.ignoreEntity = entity1; + flag = true; + } + else + { + flag = false; + AxisAlignedBB axisalignedbb = entity1.getEntityBoundingBox().expandXyz(0.30000001192092896D); + RayTraceResult raytraceresult1 = axisalignedbb.calculateIntercept(vec3d, vec3d1); - if(movingobjectposition1 != null) { - double d1 = vec3.distanceTo(movingobjectposition1.hitVec); + if (raytraceresult1 != null) + { + double d1 = vec3d.squareDistanceTo(raytraceresult1.hitVec); - if (d1 < d0 || d0 == 0.0D) { - entity = entity1; - d0 = d1; + if (d1 < d0 || d0 == 0.0D) + { + entity = entity1; + d0 = d1; + } } } } } - if(entity != null) - movingobjectposition = new MovingObjectPosition(entity); + if (this.ignoreEntity != null) + { + /*if (flag) + { + this.ignoreTime = 2; + } + else if (this.ignoreTime-- <= 0) + { + this.ignoreEntity = null; + }*/ + } + + if (entity != null) + { + raytraceresult = new RayTraceResult(entity); + } + } // End wrap - only do entity colliding on server + + if (raytraceresult != null) + { + if (raytraceresult.typeOfHit == RayTraceResult.Type.BLOCK && this.worldObj.getBlockState(raytraceresult.getBlockPos()).getBlock() == Blocks.PORTAL) + { + this.setPortal(raytraceresult.getBlockPos()); + } + else + { + this.onImpact(raytraceresult); + } } - if(movingobjectposition != null) - onImpact(movingobjectposition); + this.posX += this.motionX; + this.posY += this.motionY; + this.posZ += this.motionZ; + float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.rotationYaw = (float)(MathHelper.atan2(this.motionX, this.motionZ) * (180D / Math.PI)); - posX += motionX; - posY += motionY; - posZ += motionZ; - float f1 = MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ); - rotationYaw = (float)(Math.atan2(motionX, motionZ) * 180.0D / Math.PI); + for (this.rotationPitch = (float)(MathHelper.atan2(this.motionY, (double)f) * (180D / Math.PI)); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) + { + ; + } - for(rotationPitch = (float)(Math.atan2(motionY, f1) * 180.0D / Math.PI); rotationPitch - prevRotationPitch < -180.0F; prevRotationPitch -= 360.0F); + while (this.rotationPitch - this.prevRotationPitch >= 180.0F) + { + this.prevRotationPitch += 360.0F; + } - while(rotationPitch - prevRotationPitch >= 180.0F) - prevRotationPitch += 360.0F; + while (this.rotationYaw - this.prevRotationYaw < -180.0F) + { + this.prevRotationYaw -= 360.0F; + } - while(rotationYaw - prevRotationYaw < -180.0F) - prevRotationYaw -= 360.0F; + while (this.rotationYaw - this.prevRotationYaw >= 180.0F) + { + this.prevRotationYaw += 360.0F; + } - while(rotationYaw - prevRotationYaw >= 180.0F) - prevRotationYaw += 360.0F; + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + float f1 = 0.99F; + float f2 = this.getGravityVelocity(); - rotationPitch = prevRotationPitch + (rotationPitch - prevRotationPitch) * 0.2F; - rotationYaw = prevRotationYaw + (rotationYaw - prevRotationYaw) * 0.2F; - float f3 = getGravityVelocity(); - - motionY -= f3; - setPosition(posX, posY, posZ); - } - - public MovingObjectPosition clip(Vec3 par1Vec3, Vec3 par2Vec3) { - boolean par3 = false; - boolean par4 = false; - if (!Double.isNaN(par1Vec3.xCoord) && !Double.isNaN(par1Vec3.yCoord) && !Double.isNaN(par1Vec3.zCoord)) { - if (!Double.isNaN(par2Vec3.xCoord) && !Double.isNaN(par2Vec3.yCoord) && !Double.isNaN(par2Vec3.zCoord)) { - int i = MathHelper.floor_double(par2Vec3.xCoord); - int j = MathHelper.floor_double(par2Vec3.yCoord); - int k = MathHelper.floor_double(par2Vec3.zCoord); - int l = MathHelper.floor_double(par1Vec3.xCoord); - int i1 = MathHelper.floor_double(par1Vec3.yCoord); - int j1 = MathHelper.floor_double(par1Vec3.zCoord); - Block block = worldObj.getBlock(l, i1, j1); - int l1 = worldObj.getBlockMetadata(l, i1, j1); - - if (block != null && (!par4 || block == null || block.getCollisionBoundingBoxFromPool(worldObj, l, i1, j1) != null) && block != Blocks.air && block.canCollideCheck(l1, par3)) { - MovingObjectPosition movingobjectposition = block.collisionRayTrace(worldObj, l, i1, j1, par1Vec3, par2Vec3); - - if (movingobjectposition != null) - return movingobjectposition; - } - - int k1 = 200; - - while (k1-- >= 0) { - if (Double.isNaN(par1Vec3.xCoord) || Double.isNaN(par1Vec3.yCoord) || Double.isNaN(par1Vec3.zCoord)) - return null; - - if (l == i && i1 == j && j1 == k) - return null; - - boolean flag2 = true; - boolean flag3 = true; - boolean flag4 = true; - double d0 = 999.0D; - double d1 = 999.0D; - double d2 = 999.0D; - - if (i > l) - d0 = l + 1.0D; - else if (i < l) - d0 = l + 0.0D; - else flag2 = false; - - if (j > i1) - d1 = i1 + 1.0D; - else if (j < i1) - d1 = i1 + 0.0D; - else flag3 = false; - - if (k > j1) - d2 = j1 + 1.0D; - else if (k < j1) - d2 = j1 + 0.0D; - else flag4 = false; - - double d3 = 999.0D; - double d4 = 999.0D; - double d5 = 999.0D; - double d6 = par2Vec3.xCoord - par1Vec3.xCoord; - double d7 = par2Vec3.yCoord - par1Vec3.yCoord; - double d8 = par2Vec3.zCoord - par1Vec3.zCoord; - - if (flag2) - d3 = (d0 - par1Vec3.xCoord) / d6; - - if (flag3) - d4 = (d1 - par1Vec3.yCoord) / d7; - - if (flag4) - d5 = (d2 - par1Vec3.zCoord) / d8; - - byte b0; - - if (d3 < d4 && d3 < d5) { - if (i > l) - b0 = 4; - else b0 = 5; - - par1Vec3.xCoord = d0; - par1Vec3.yCoord += d7 * d3; - par1Vec3.zCoord += d8 * d3; - } else if (d4 < d5) { - if (j > i1) - b0 = 0; - else b0 = 1; - - par1Vec3.xCoord += d6 * d4; - par1Vec3.yCoord = d1; - par1Vec3.zCoord += d8 * d4; - } else { - if (k > j1) - b0 = 2; - else b0 = 3; - - par1Vec3.xCoord += d6 * d5; - par1Vec3.yCoord += d7 * d5; - par1Vec3.zCoord = d2; - } - - Vec3 vec32 = new Vector3(par1Vec3.xCoord, par1Vec3.yCoord, par1Vec3.zCoord).toVec3D(); - l = (int)(vec32.xCoord = MathHelper.floor_double(par1Vec3.xCoord)); - - if (b0 == 5) { - --l; - ++vec32.xCoord; - } - - i1 = (int)(vec32.yCoord = MathHelper.floor_double(par1Vec3.yCoord)); - - if (b0 == 1) { - --i1; - ++vec32.yCoord; - } - - j1 = (int)(vec32.zCoord = MathHelper.floor_double(par1Vec3.zCoord)); - - if (b0 == 3) { - --j1; - ++vec32.zCoord; - } - - Block block1 = worldObj.getBlock(l, i1, j1); - int j2 = worldObj.getBlockMetadata(l, i1, j1); - - if ((!par4 || block1 == null || block1.getCollisionBoundingBoxFromPool(worldObj, l, i1, j1) != null) && block1 != Blocks.air && block1.canCollideCheck(j2, par3)) { - MovingObjectPosition movingobjectposition1 = block1.collisionRayTrace(worldObj, l, i1, j1, par1Vec3, par2Vec3); - - if (movingobjectposition1 != null) - return movingobjectposition1; - } - } - - return null; + if (this.isInWater()) + { + for (int j = 0; j < 4; ++j) + { + float f3 = 0.25F; + this.worldObj.spawnParticle(EnumParticleTypes.WATER_BUBBLE, this.posX - this.motionX * (double)f3, this.posY - this.motionY * (double)f3, this.posZ - this.motionZ * (double)f3, this.motionX, this.motionY, this.motionZ, new int[0]); } - else return null; - } else return null; + + f1 = 0.8F; + } + + // Botania - don't apply drag + // this.motionX *= (double)f1; + // this.motionY *= (double)f1; + // this.motionZ *= (double)f1; + this.motionY -= (double)f2; + this.setPosition(this.posX, this.posY, this.posZ); } @Override @@ -398,9 +351,9 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { @Override @SideOnly(Side.CLIENT) - public void setPositionAndRotation2(double p_70056_1_, double p_70056_3_, double p_70056_5_, float p_70056_7_, float p_70056_8_, int p_70056_9_) { - setPosition(p_70056_1_, p_70056_3_, p_70056_5_); - setRotation(p_70056_7_, p_70056_8_); + public void setPositionAndRotationDirect(double x, double y, double z, float yaw, float pitch, int posRotationIncrements, boolean teleport) { + setPosition(x, y, z); + setRotation(yaw, pitch); } @Override @@ -408,8 +361,8 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { return false; } - public TileEntity collidedTile = null; - public boolean noParticles = false; + private TileEntity collidedTile = null; + private boolean noParticles = false; public TileEntity getCollidedTile(boolean noParticles) { this.noParticles = noParticles; @@ -440,16 +393,16 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { stack.writeToNBT(lensCmp); par1nbtTagCompound.setTag(TAG_LENS_STACK, lensCmp); - ChunkCoordinates coords = getBurstSourceChunkCoordinates(); - par1nbtTagCompound.setInteger(TAG_SPREADER_X, coords.posX); - par1nbtTagCompound.setInteger(TAG_SPREADER_Y, coords.posY); - par1nbtTagCompound.setInteger(TAG_SPREADER_Z, coords.posZ); + BlockPos coords = getBurstSourceBlockPos(); + par1nbtTagCompound.setInteger(TAG_SPREADER_X, coords.getX()); + par1nbtTagCompound.setInteger(TAG_SPREADER_Y, coords.getY()); + par1nbtTagCompound.setInteger(TAG_SPREADER_Z, coords.getZ()); par1nbtTagCompound.setDouble(TAG_LAST_MOTION_X, motionX); par1nbtTagCompound.setDouble(TAG_LAST_MOTION_Y, motionY); par1nbtTagCompound.setDouble(TAG_LAST_MOTION_Z, motionZ); - UUID identity = getShooterUIID(); + UUID identity = getShooterUUID(); boolean hasShooter = identity != null; par1nbtTagCompound.setBoolean(TAG_HAS_SHOOTER, hasShooter); if(hasShooter) { @@ -473,13 +426,13 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { ItemStack stack = ItemStack.loadItemStackFromNBT(lensCmp); if(stack != null) setSourceLens(stack); - else setSourceLens(new ItemStack(Blocks.stone, 0, 0)); + else setSourceLens(new ItemStack(Blocks.STONE, 0, 0)); int x = par1nbtTagCompound.getInteger(TAG_SPREADER_X); int y = par1nbtTagCompound.getInteger(TAG_SPREADER_Y); int z = par1nbtTagCompound.getInteger(TAG_SPREADER_Z); - setBurstSourceCoords(x, y, z); + setBurstSourceCoords(new BlockPos(x, y, z)); double lastMotionX = par1nbtTagCompound.getDouble(TAG_LAST_MOTION_X); double lastMotionY = par1nbtTagCompound.getDouble(TAG_LAST_MOTION_Y); @@ -491,7 +444,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { if(hasShooter) { long most = par1nbtTagCompound.getLong(TAG_SHOOTER_UUID_MOST); long least = par1nbtTagCompound.getLong(TAG_SHOOTER_UUID_LEAST); - UUID identity = getShooterUIID(); + UUID identity = getShooterUUID(); if(identity == null || most != identity.getMostSignificantBits() || least != identity.getLeastSignificantBits()) shooterIdentity = new UUID(most, least); } @@ -522,48 +475,52 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { size = 4F; if(!noParticles && shouldDoFakeParticles()) - Botania.proxy.sparkleFX(worldObj, posX, posY, posZ, r, g, b, 0.4F * size, 1, true); + Botania.proxy.sparkleFX(posX, posY, posZ, r, g, b, 0.4F * size, 1, true); } else { boolean monocle = Botania.proxy.isClientPlayerWearingMonocle(); if(monocle) Botania.proxy.setWispFXDepthTest(false); if(ConfigHandler.subtlePowerSystem) - Botania.proxy.wispFX(worldObj, posX, posY, posZ, r, g, b, 0.1F * size, (float) (Math.random() - 0.5F) * 0.02F, (float) (Math.random() - 0.5F) * 0.02F, (float) (Math.random() - 0.5F) * 0.01F); + Botania.proxy.wispFX(posX, posY, posZ, r, g, b, 0.1F * size, (float) (Math.random() - 0.5F) * 0.02F, (float) (Math.random() - 0.5F) * 0.02F, (float) (Math.random() - 0.5F) * 0.01F); else { float or = r; float og = g; float ob = b; + double luminance = 0.2126 * r + 0.7152 * g + 0.0722 * b; // Standard relative luminance calculation + double savedPosX = posX; double savedPosY = posY; double savedPosZ = posZ; Vector3 currentPos = Vector3.fromEntity(this); Vector3 oldPos = new Vector3(prevPosX, prevPosY, prevPosZ); - Vector3 diffVec = oldPos.copy().sub(currentPos); - Vector3 diffVecNorm = diffVec.copy().normalize(); + Vector3 diffVec = oldPos.subtract(currentPos); + Vector3 diffVecNorm = diffVec.normalize(); double distance = 0.095; do { - r = or + ((float) Math.random() - 0.5F) * 0.25F; - g = og + ((float) Math.random() - 0.5F) * 0.25F; - b = ob + ((float) Math.random() - 0.5F) * 0.25F; + if (luminance < 0.1) { + r = or + (float) Math.random() * 0.125F; + g = og + (float) Math.random() * 0.125F; + b = ob + (float) Math.random() * 0.125F; + } size = osize + ((float) Math.random() - 0.5F) * 0.065F + (float) Math.sin(new Random(entityUniqueID.getMostSignificantBits()).nextInt(9001)) * 0.4F; - Botania.proxy.wispFX(worldObj, posX, posY, posZ, r, g, b, 0.2F * size, (float) -motionX * 0.01F, (float) -motionY * 0.01F, (float) -motionZ * 0.01F); + Botania.proxy.wispFX(posX, posY, posZ, r, g, b, 0.2F * size, (float) -motionX * 0.01F, (float) -motionY * 0.01F, (float) -motionZ * 0.01F); posX += diffVecNorm.x * distance; posY += diffVecNorm.y * distance; posZ += diffVecNorm.z * distance; currentPos = Vector3.fromEntity(this); - diffVec = oldPos.copy().sub(currentPos); + diffVec = oldPos.subtract(currentPos); if(getEntityData().hasKey(ItemTinyPlanet.TAG_ORBIT)) break; } while(Math.abs(diffVec.mag()) > distance); - Botania.proxy.wispFX(worldObj, posX, posY, posZ, r, g, b, 0.1F * size, (float) (Math.random() - 0.5F) * 0.06F, (float) (Math.random() - 0.5F) * 0.06F, (float) (Math.random() - 0.5F) * 0.06F); + Botania.proxy.wispFX(posX, posY, posZ, or, og, ob, 0.1F * size, (float) (Math.random() - 0.5F) * 0.06F, (float) (Math.random() - 0.5F) * 0.06F, (float) (Math.random() - 0.5F) * 0.06F); posX = savedPosX; posY = savedPosY; @@ -576,32 +533,33 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { } @Override - protected void onImpact(MovingObjectPosition movingobjectposition) { + protected void onImpact(@Nonnull RayTraceResult rtr) { boolean collided = false; boolean dead = false; - if(movingobjectposition.entityHit == null) { - TileEntity tile = worldObj.getTileEntity(movingobjectposition.blockX, movingobjectposition.blockY, movingobjectposition.blockZ); - Block block = worldObj.getBlock(movingobjectposition.blockX, movingobjectposition.blockY, movingobjectposition.blockZ); + if(rtr.entityHit == null) { + TileEntity tile = worldObj.getTileEntity(rtr.getBlockPos()); + IBlockState state = worldObj.getBlockState(rtr.getBlockPos()); + Block block = state.getBlock(); - if(tile instanceof IManaCollisionGhost && ((IManaCollisionGhost) tile).isGhost() && !(block instanceof IManaTrigger) || block instanceof BlockBush || block instanceof BlockLeaves) + if(block instanceof IManaCollisionGhost && ((IManaCollisionGhost) block).isGhost(state, worldObj, rtr.getBlockPos()) && !(block instanceof IManaTrigger) || block instanceof BlockBush || block instanceof BlockLeaves) return; if(BotaniaAPI.internalHandler.isBuildcraftPipe(tile)) return; - ChunkCoordinates coords = getBurstSourceChunkCoordinates(); - if(tile != null && (tile.xCoord != coords.posX || tile.yCoord != coords.posY || tile.zCoord != coords.posZ)) + BlockPos coords = getBurstSourceBlockPos(); + if(tile != null && !tile.getPos().equals(coords)) collidedTile = tile; - if(tile == null || tile.xCoord != coords.posX || tile.yCoord != coords.posY || tile.zCoord != coords.posZ) { + if(tile == null || !tile.getPos().equals(coords)) { if(!fake && !noParticles && (!worldObj.isRemote || tile instanceof IClientManaHandler) && tile != null && tile instanceof IManaReceiver && ((IManaReceiver) tile).canRecieveManaFromBursts()) - onRecieverImpact((IManaReceiver) tile, tile.xCoord, tile.yCoord, tile.zCoord); + onRecieverImpact((IManaReceiver) tile, tile.getPos()); if(block instanceof IManaTrigger) - ((IManaTrigger) block).onBurstCollision(this, worldObj, movingobjectposition.blockX, movingobjectposition.blockY, movingobjectposition.blockZ); + ((IManaTrigger) block).onBurstCollision(this, worldObj, rtr.getBlockPos()); - boolean ghost = tile instanceof IManaCollisionGhost; + boolean ghost = block instanceof IManaCollisionGhost; dead = !ghost; if(ghost) return; @@ -612,10 +570,10 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { ILensEffect lens = getLensInstance(); if(lens != null) - dead = lens.collideBurst(this, movingobjectposition, collidedTile != null && collidedTile instanceof IManaReceiver && ((IManaReceiver) collidedTile).canRecieveManaFromBursts(), dead, getSourceLens()); + dead = lens.collideBurst(this, rtr, collidedTile != null && collidedTile instanceof IManaReceiver && ((IManaReceiver) collidedTile).canRecieveManaFromBursts(), dead, getSourceLens()); - if(collided && !hasAlreadyCollidedAt(movingobjectposition.blockX, movingobjectposition.blockY, movingobjectposition.blockZ)) - alreadyCollidedAt.add(getCollisionLocString(movingobjectposition.blockX, movingobjectposition.blockY, movingobjectposition.blockZ)); + if(collided && !hasAlreadyCollidedAt(rtr.getBlockPos())) + alreadyCollidedAt.add(rtr.getBlockPos()); if(dead && !isDead) { if(!fake) { @@ -630,15 +588,15 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { if(!ConfigHandler.subtlePowerSystem) for(int i = 0; i < 4; i++) - Botania.proxy.wispFX(worldObj, posX, posY, posZ, r, g, b, 0.15F * size, (float) (Math.random() - 0.5F) * 0.04F, (float) (Math.random() - 0.5F) * 0.04F, (float) (Math.random() - 0.5F) * 0.04F); - Botania.proxy.sparkleFX(worldObj, (float) posX, (float) posY, (float) posZ, r, g, b, 4, 2); + Botania.proxy.wispFX(posX, posY, posZ, r, g, b, 0.15F * size, (float) (Math.random() - 0.5F) * 0.04F, (float) (Math.random() - 0.5F) * 0.04F, (float) (Math.random() - 0.5F) * 0.04F); + Botania.proxy.sparkleFX((float) posX, (float) posY, (float) posZ, r, g, b, 4, 2); } setDead(); } } - protected void onRecieverImpact(IManaReceiver tile, int x, int y, int z) { + private void onRecieverImpact(IManaReceiver tile, BlockPos pos) { int mana = getMana(); if(tile instanceof IManaCollector) mana *= ((IManaCollector) tile).getManaYieldMultiplier(this); @@ -646,7 +604,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { tile.recieveMana(mana); if(tile instanceof IThrottledPacket) ((IThrottledPacket) tile).markDispatchable(); - else VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, x, y, z); + else VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos); } @Override @@ -660,10 +618,8 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { } else setDeathTicksForFakeParticle(); } - public TileEntity getShooter() { - ChunkCoordinates coords = getBurstSourceChunkCoordinates(); - TileEntity tile = worldObj.getTileEntity(coords.posX, coords.posY, coords.posZ); - return tile; + private TileEntity getShooter() { + return worldObj.getTileEntity(getBurstSourceBlockPos()); } @Override @@ -687,90 +643,85 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { @Override public int getColor() { - return dataWatcher.getWatchableObjectInt(dataWatcherStart); + return dataManager.get(COLOR); } @Override public void setColor(int color) { - dataWatcher.updateObject(dataWatcherStart, color); + dataManager.set(COLOR, color); } @Override public int getMana() { - return dataWatcher.getWatchableObjectInt(dataWatcherStart + 1); + return dataManager.get(MANA); } @Override public void setMana(int mana) { - dataWatcher.updateObject(dataWatcherStart + 1, mana); + dataManager.set(MANA, mana); } @Override public int getStartingMana() { - return dataWatcher.getWatchableObjectInt(dataWatcherStart + 2); + return dataManager.get(START_MANA); } @Override public void setStartingMana(int mana) { - dataWatcher.updateObject(dataWatcherStart + 2, mana); + dataManager.set(START_MANA, mana); } @Override public int getMinManaLoss() { - return dataWatcher.getWatchableObjectInt(dataWatcherStart + 3); + return dataManager.get(MIN_MANA_LOSS); } @Override public void setMinManaLoss(int minManaLoss) { - dataWatcher.updateObject(dataWatcherStart + 3, minManaLoss); + dataManager.set(MIN_MANA_LOSS, minManaLoss); } @Override public float getManaLossPerTick() { - return dataWatcher.getWatchableObjectFloat(dataWatcherStart + 4); + return dataManager.get(MANA_LOSS_PER_TICK); } @Override public void setManaLossPerTick(float mana) { - dataWatcher.updateObject(dataWatcherStart + 4, mana); + dataManager.set(MANA_LOSS_PER_TICK, mana); } @Override public float getGravity() { - return dataWatcher.getWatchableObjectFloat(dataWatcherStart + 5); + return dataManager.get(GRAVITY); } @Override public void setGravity(float gravity) { - dataWatcher.updateObject(dataWatcherStart + 5, gravity); - } - - final int coordsStart = dataWatcherStart + 6; - - @Override - public ChunkCoordinates getBurstSourceChunkCoordinates() { - int x = dataWatcher.getWatchableObjectInt(coordsStart); - int y = dataWatcher.getWatchableObjectInt(coordsStart + 1); - int z = dataWatcher.getWatchableObjectInt(coordsStart + 2); - - return new ChunkCoordinates(x, y, z); + dataManager.set(GRAVITY, gravity); } @Override - public void setBurstSourceCoords(int x, int y, int z) { - dataWatcher.updateObject(coordsStart, x); - dataWatcher.updateObject(coordsStart + 1, y); - dataWatcher.updateObject(coordsStart + 2, z); + public BlockPos getBurstSourceBlockPos() { + return dataManager.get(SOURCE_COORDS); + } + + @Override + public void setBurstSourceCoords(BlockPos pos) { + dataManager.set(SOURCE_COORDS, pos); } @Override public ItemStack getSourceLens() { - return dataWatcher.getWatchableObjectItemStack(dataWatcherStart + 9); + Optional stack = dataManager.get(SOURCE_LENS); + if(!stack.isPresent()) + return new ItemStack(Blocks.STONE, 0, 0); + else return stack.get(); } @Override public void setSourceLens(ItemStack lens) { - dataWatcher.updateObject(dataWatcherStart + 9, lens == null ? new ItemStack(Blocks.stone, 0, 0) : lens); + dataManager.set(SOURCE_LENS, lens == null ? Optional.absent() : Optional.of(lens)); } @Override @@ -782,7 +733,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { _ticksExisted = ticks; } - public ILensEffect getLensInstance() { + private ILensEffect getLensInstance() { ItemStack lens = getSourceLens(); if(lens != null && lens.getItem() instanceof ILensEffect) return (ILensEffect) lens.getItem(); @@ -790,8 +741,6 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { return null; } - final int motionStart = dataWatcherStart + 10; - @Override public void setMotion(double x, double y, double z) { motionX = x; @@ -800,18 +749,14 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { } @Override - public boolean hasAlreadyCollidedAt(int x, int y, int z) { - return alreadyCollidedAt.contains(getCollisionLocString(x, y, z)); + public boolean hasAlreadyCollidedAt(BlockPos pos) { + return alreadyCollidedAt.contains(pos); } @Override - public void setCollidedAt(int x, int y, int z) { - if(!hasAlreadyCollidedAt(x, y, z)) - alreadyCollidedAt.add(getCollisionLocString(x, y, z)); - } - - private String getCollisionLocString(int x, int y, int z) { - return x + ":" + y + ":" + z; + public void setCollidedAt(BlockPos pos) { + if(!hasAlreadyCollidedAt(pos)) + alreadyCollidedAt.add(pos.toImmutable()); } @Override @@ -820,7 +765,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { } @Override - public UUID getShooterUIID() { + public UUID getShooterUUID() { return shooterIdentity; } @@ -828,20 +773,21 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { public void ping() { TileEntity tile = getShooter(); if(tile != null && tile instanceof IPingable) - ((IPingable) tile).pingback(this, getShooterUIID()); + ((IPingable) tile).pingback(this, getShooterUUID()); } - public boolean shouldDoFakeParticles() { - if(ConfigHandler.staticWandBeam) + protected boolean shouldDoFakeParticles() { + if (ConfigHandler.staticWandBeam) return true; TileEntity tile = getShooter(); - if(tile != null && tile instanceof IManaSpreader) - return getMana() != getStartingMana() && fullManaLastTick || Math.abs(((IManaSpreader) tile).getBurstParticleTick() - getTicksExisted()) < 4; - return false; + return tile != null + && tile instanceof IManaSpreader + && (getMana() != getStartingMana() && fullManaLastTick + || Math.abs(((IManaSpreader) tile).getBurstParticleTick() - getTicksExisted()) < 4); } - public void incrementFakeParticleTick() { + private void incrementFakeParticleTick() { TileEntity tile = getShooter(); if(tile != null && tile instanceof IManaSpreader) { IManaSpreader spreader = (IManaSpreader) tile; @@ -851,18 +797,17 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { } } - public void setDeathTicksForFakeParticle() { - ChunkCoordinates coords = getBurstSourceChunkCoordinates(); - TileEntity tile = worldObj.getTileEntity(coords.posX, coords.posY, coords.posZ); + private void setDeathTicksForFakeParticle() { + BlockPos coords = getBurstSourceBlockPos(); + TileEntity tile = worldObj.getTileEntity(coords); if(tile != null && tile instanceof IManaSpreader) ((IManaSpreader) tile).setLastBurstDeathTick(getTicksExisted()); } public static class PositionProperties { - public final ChunkCoordinates coords; - public final Block block; - public final int meta; + public final BlockPos coords; + public final IBlockState state; public boolean invalid = false; @@ -870,9 +815,8 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { int x = MathHelper.floor_double(entity.posX); int y = MathHelper.floor_double(entity.posY); int z = MathHelper.floor_double(entity.posZ); - coords = new ChunkCoordinates(x, y, z); - block = entity.worldObj.getBlock(x, y, z); - meta = entity.worldObj.getBlockMetadata(x, y, z); + coords = new BlockPos(x, y, z); + state = entity.worldObj.getBlockState(coords); } public boolean coordsEqual(PositionProperties props) { @@ -880,14 +824,24 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { } public boolean contentsEqual(World world) { - if(!world.blockExists(coords.posX, coords.posY, coords.posZ)) { + if(!world.isBlockLoaded(coords)) { invalid = true; return false; } - Block block = world.getBlock(coords.posX , coords.posY, coords.posZ); - int meta = world.getBlockMetadata(coords.posX, coords.posY, coords.posZ); - return block == this.block && meta == this.meta; + return world.getBlockState(coords) == this.state; + } + + @Override + public int hashCode() { + return Objects.hash(coords, state); + } + + @Override + public boolean equals(Object o) { + return o instanceof PositionProperties + && ((PositionProperties) o).state == state + && ((PositionProperties) o).coords.equals(coords); } } diff --git a/src/main/java/vazkii/botania/common/entity/EntityManaStorm.java b/src/main/java/vazkii/botania/common/entity/EntityManaStorm.java index 4343aad6c..4049ae21e 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityManaStorm.java +++ b/src/main/java/vazkii/botania/common/entity/EntityManaStorm.java @@ -18,6 +18,8 @@ import vazkii.botania.common.core.helper.Vector3; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.item.lens.ItemLens; +import javax.annotation.Nonnull; + public class EntityManaStorm extends Entity { private static final String TAG_TIME = "time"; @@ -31,14 +33,12 @@ public class EntityManaStorm extends Entity { public int burstsFired; public int deathTime; - public EntityManaStorm(World p_i1582_1_) { - super(p_i1582_1_); + public EntityManaStorm(World world) { + super(world); } @Override - protected void entityInit() { - // NO-OP - } + protected void entityInit() {} @Override public void onUpdate() { @@ -61,7 +61,7 @@ public class EntityManaStorm extends Entity { } } - public void spawnBurst() { + private void spawnBurst() { EntityManaBurst burst = new EntityManaBurst(worldObj); burst.setPosition(posX, posY, posZ); @@ -82,14 +82,14 @@ public class EntityManaStorm extends Entity { } @Override - protected void readEntityFromNBT(NBTTagCompound cmp) { + protected void readEntityFromNBT(@Nonnull NBTTagCompound cmp) { liveTime = cmp.getInteger(TAG_TIME); burstsFired = cmp.getInteger(TAG_BURSTS_FIRED); deathTime = cmp.getInteger(TAG_DEATH_TIME); } @Override - protected void writeEntityToNBT(NBTTagCompound cmp) { + protected void writeEntityToNBT(@Nonnull NBTTagCompound cmp) { cmp.setInteger(TAG_TIME, liveTime); cmp.setInteger(TAG_BURSTS_FIRED, burstsFired); cmp.setInteger(TAG_DEATH_TIME, deathTime); diff --git a/src/main/java/vazkii/botania/common/entity/EntityPinkWither.java b/src/main/java/vazkii/botania/common/entity/EntityPinkWither.java index 8d050076e..fd10c6256 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityPinkWither.java +++ b/src/main/java/vazkii/botania/common/entity/EntityPinkWither.java @@ -10,17 +10,31 @@ */ package vazkii.botania.common.entity; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.EntityAIAttackRanged; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAITasks; import net.minecraft.entity.boss.EntityWither; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.MathHelper; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumHand; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; +import javax.annotation.Nonnull; +import java.util.Iterator; + public class EntityPinkWither extends EntityWither { - public EntityPinkWither(World p_i1701_1_) { - super(p_i1701_1_); + public EntityPinkWither(World world) { + super(world); + + this.tasks.taskEntries.removeIf(entry -> entry.action instanceof EntityAIAttackRanged); // Remove firing wither skulls + + this.targetTasks.taskEntries.removeIf(entry -> entry.action instanceof EntityAIHurtByTarget + || entry.action instanceof EntityAINearestAttackableTarget); // Remove revenge and aggro } @Override @@ -32,43 +46,30 @@ public class EntityPinkWither extends EntityWither { double d10 = func_82214_u(j); double d2 = func_82208_v(j); double d4 = func_82213_w(j); - worldObj.spawnParticle("heart", d10 + rand.nextGaussian() * 0.30000001192092896D, d2 + rand.nextGaussian() * 0.30000001192092896D, d4 + rand.nextGaussian() * 0.30000001192092896D, 0.0D, 0.0D, 0.0D); + worldObj.spawnParticle(EnumParticleTypes.HEART, d10 + rand.nextGaussian() * 0.30000001192092896D, d2 + rand.nextGaussian() * 0.30000001192092896D, d4 + rand.nextGaussian() * 0.30000001192092896D, 0.0D, 0.0D, 0.0D); } } @Override - public void setAttackTarget(EntityLivingBase p_70624_1_) { - // NO-OP + public void updateAITasks() { + if(this.ticksExisted % 20 == 0) + this.heal(1.0F); } @Override - protected void attackEntity(Entity p_70785_1_, float p_70785_2_) { - // NO-OP - } - - @Override - public boolean attackEntityAsMob(Entity p_70652_1_) { - return false; - } - - @Override - protected boolean interact(EntityPlayer player) { + protected boolean processInteract(EntityPlayer player, EnumHand hand, ItemStack stack) { if(!player.isSneaking()) { - player.mountEntity(this); + player.startRiding(this); return true; } return false; } @Override - protected boolean isAIEnabled() { - return false; - } + protected void dropFewItems(boolean wasRecentlyHit, int lootingModifier) {} @Override - protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) { - // NO-OP - } + public void addTrackingPlayer(@Nonnull EntityPlayerMP player) {} // COPYPASTA diff --git a/src/main/java/vazkii/botania/common/entity/EntityPixie.java b/src/main/java/vazkii/botania/common/entity/EntityPixie.java index 870a13f72..7d6dabf12 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityPixie.java +++ b/src/main/java/vazkii/botania/common/entity/EntityPixie.java @@ -10,19 +10,27 @@ */ package vazkii.botania.common.entity; +import net.minecraft.entity.EntityFlying; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.network.datasync.DataParameter; +import net.minecraft.network.datasync.DataSerializers; +import net.minecraft.network.datasync.EntityDataManager; import net.minecraft.potion.PotionEffect; import net.minecraft.util.DamageSource; import net.minecraft.world.World; import vazkii.botania.common.Botania; -public class EntityPixie extends EntityFlyingCreature { +import javax.annotation.Nonnull; - EntityLivingBase summoner = null; - float damage = 0; - PotionEffect effect = null; +public class EntityPixie extends EntityFlying { + + private static final DataParameter TYPE = EntityDataManager.createKey(EntityPixie.class, DataSerializers.VARINT); + + private EntityLivingBase summoner = null; + private float damage = 0; + private PotionEffect effect = null; public EntityPixie(World world) { super(world); @@ -32,21 +40,21 @@ public class EntityPixie extends EntityFlyingCreature { @Override protected void entityInit() { super.entityInit(); - dataWatcher.addObject(20, 0); + dataManager.register(TYPE, 0); } @Override protected void applyEntityAttributes() { super.applyEntityAttributes(); - getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(2.0); + getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(2.0); } public void setType(int type) { - dataWatcher.updateObject(20, type); + dataManager.set(TYPE, type); } public int getType() { - return dataWatcher.getWatchableObjectInt(20); + return dataManager.get(TYPE); } public void setProps(EntityLivingBase target, EntityLivingBase summoner, int type, float damage) { @@ -61,7 +69,7 @@ public class EntityPixie extends EntityFlyingCreature { } @Override - protected void updateEntityActionState() { + protected void updateAITasks() { EntityLivingBase target = getAttackTarget(); if(target != null) { double d0 = target.posX + target.width / 2 - posX; @@ -87,7 +95,7 @@ public class EntityPixie extends EntityFlyingCreature { } else target.attackEntityFrom(DamageSource.causeMobDamage(this), damage); if(effect != null && !(target instanceof EntityPlayer)) target.addPotionEffect(effect); - die(); + setDead(); } } @@ -95,7 +103,7 @@ public class EntityPixie extends EntityFlyingCreature { } @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { + public boolean attackEntityFrom(@Nonnull DamageSource par1DamageSource, float par2) { if(getType() == 0 && par1DamageSource.getEntity() != summoner || getType() == 1 && par1DamageSource.getEntity() instanceof EntityPlayer) return super.attackEntityFrom(par1DamageSource, par2); return false; @@ -105,21 +113,22 @@ public class EntityPixie extends EntityFlyingCreature { public void onEntityUpdate() { super.onEntityUpdate(); - if(getAttackTarget() == null || ticksExisted > 200) - die(); + if(!worldObj.isRemote + && (getAttackTarget() == null || ticksExisted > 200)) + setDead(); boolean dark = getType() == 1; if(worldObj.isRemote) for(int i = 0; i < 4; i++) - Botania.proxy.sparkleFX(worldObj, posX + (Math.random() - 0.5) * 0.25, posY + 0.5 + (Math.random() - 0.5) * 0.25, posZ + (Math.random() - 0.5) * 0.25, dark ? 0.1F : 1F, dark ? 0.025F : 0.25F, dark ? 0.09F : 0.9F, 0.1F + (float) Math.random() * 0.25F, 12); + Botania.proxy.sparkleFX(posX + (Math.random() - 0.5) * 0.25, posY + 0.5 + (Math.random() - 0.5) * 0.25, posZ + (Math.random() - 0.5) * 0.25, dark ? 0.1F : 1F, dark ? 0.025F : 0.25F, dark ? 0.09F : 0.9F, 0.1F + (float) Math.random() * 0.25F, 12); } - public void die() { - setDead(); - - if(worldObj.isRemote && getType() == 0) + @Override + public void setDead() { + if(worldObj != null && worldObj.isRemote && getType() == 0) for(int i = 0; i < 12; i++) - Botania.proxy.sparkleFX(worldObj, posX + (Math.random() - 0.5) * 0.25, posY + 0.5 + (Math.random() - 0.5) * 0.25, posZ + (Math.random() - 0.5) * 0.25, 1F, 0.25F, 0.9F, 1F + (float) Math.random() * 0.25F, 5); + Botania.proxy.sparkleFX(posX + (Math.random() - 0.5) * 0.25, posY + 0.5 + (Math.random() - 0.5) * 0.25, posZ + (Math.random() - 0.5) * 0.25, 1F, 0.25F, 0.9F, 1F + (float) Math.random() * 0.25F, 5); + super.setDead(); } @Override @@ -127,4 +136,9 @@ public class EntityPixie extends EntityFlyingCreature { return false; } + @Override + public boolean canBeLeashedTo(EntityPlayer player) { + return false; + } + } \ No newline at end of file diff --git a/src/main/java/vazkii/botania/common/entity/EntityPoolMinecart.java b/src/main/java/vazkii/botania/common/entity/EntityPoolMinecart.java index 1c5c260d8..5387c8850 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityPoolMinecart.java +++ b/src/main/java/vazkii/botania/common/entity/EntityPoolMinecart.java @@ -11,60 +11,86 @@ package vazkii.botania.common.entity; import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.item.EntityMinecart; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.datasync.DataParameter; +import net.minecraft.network.datasync.DataSerializers; +import net.minecraft.network.datasync.EntityDataManager; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; import vazkii.botania.api.internal.VanillaPacketDispatcher; import vazkii.botania.api.mana.IManaPool; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.common.Botania; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.tile.mana.TilePool; import vazkii.botania.common.block.tile.mana.TilePump; import vazkii.botania.common.item.ModItems; -import vazkii.botania.common.lib.LibMisc; + +import javax.annotation.Nonnull; +import java.awt.*; public class EntityPoolMinecart extends EntityMinecart { private static final int TRANSFER_RATE = 10000; private static final String TAG_MANA = "mana"; + private static final DataParameter MANA = EntityDataManager.createKey(EntityPoolMinecart.class, DataSerializers.VARINT); - public EntityPoolMinecart(World p_i1712_1_) { - super(p_i1712_1_); + public EntityPoolMinecart(World world) { + super(world); } - public EntityPoolMinecart(World p_i1715_1_, double p_i1715_2_, double p_i1715_4_, double p_i1715_6_) { - super(p_i1715_1_, p_i1715_2_, p_i1715_4_, p_i1715_6_); + public EntityPoolMinecart(World world, double x, double y, double z) { + super(world, x, y, z); } @Override protected void entityInit() { super.entityInit(); - dataWatcher.addObject(16, 0); + dataManager.register(MANA, 0); } + @Nonnull @Override - public Block func_145817_o() { - return ModBlocks.pool; + public IBlockState getDisplayTile() { + return ModBlocks.pool.getDefaultState(); } + @Nonnull @Override public ItemStack getCartItem() { return new ItemStack(ModItems.poolMinecart); } + @Nonnull @Override - public int getMinecartType() { - return 0; + public EntityMinecart.Type getType() { + return Type.RIDEABLE; } @Override - public void killMinecart(DamageSource p_94095_1_) { - super.killMinecart(p_94095_1_); - func_145778_a(Item.getItemFromBlock(ModBlocks.pool), 1, 0.0F); + public boolean canBeRidden() { + return false; + } + + @Nonnull + @Override + public ItemStack getPickedResult(RayTraceResult target) { + return new ItemStack(ModItems.poolMinecart); + } + + @Override + public void killMinecart(DamageSource source) { + super.killMinecart(source); + dropItemWithOffset(Item.getItemFromBlock(ModBlocks.pool), 1, 0.0F); } @Override @@ -73,24 +99,36 @@ public class EntityPoolMinecart extends EntityMinecart { } @Override - public void moveMinecartOnRail(int x, int y, int z, double par4) { - super.moveMinecartOnRail(x, y, z, par4); + public void onUpdate() { + super.onUpdate(); - for(ForgeDirection dir : LibMisc.CARDINAL_DIRECTIONS) { - int xp = x + dir.offsetX; - int zp = z + dir.offsetZ; - Block block = worldObj.getBlock(xp, y, zp); + if(worldObj.isRemote) { + double particleChance = 1F - (double) getMana() / (double) TilePool.MAX_MANA * 0.1; + Color color = TilePool.PARTICLE_COLOR; + double x = MathHelper.floor_double(posX); + double y = MathHelper.floor_double(posY); + double z = MathHelper.floor_double(posZ); + if(Math.random() > particleChance) + Botania.proxy.wispFX(x + 0.3 + Math.random() * 0.5, y + 0.85 + Math.random() * 0.25, z + Math.random(), color.getRed(), color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random() / 3F, (float) -Math.random() / 25F, 2F); + } + } + + @Override + public void moveMinecartOnRail(BlockPos pos) { + super.moveMinecartOnRail(pos); + + for(EnumFacing dir : EnumFacing.HORIZONTALS) { + BlockPos posP = pos.offset(dir); + Block block = worldObj.getBlockState(posP).getBlock(); if(block == ModBlocks.pump) { - int xp_ = xp + dir.offsetX; - int zp_ = zp + dir.offsetZ; - int meta = worldObj.getBlockMetadata(xp, y, zp); - TileEntity tile = worldObj.getTileEntity(xp_, y, zp_); - TileEntity tile_ = worldObj.getTileEntity(xp, y, zp); + BlockPos posP_ = posP.offset(dir); + TileEntity tile = worldObj.getTileEntity(posP_); + TileEntity tile_ = worldObj.getTileEntity(posP); TilePump pump = (TilePump) tile_; if(tile != null && tile instanceof IManaPool && !pump.hasRedstone) { IManaPool pool = (IManaPool) tile; - ForgeDirection pumpDir = ForgeDirection.getOrientation(meta); + EnumFacing pumpDir = worldObj.getBlockState(posP).getValue(BotaniaStateProps.CARDINALS); boolean did = false; boolean can = false; @@ -119,7 +157,7 @@ public class EntityPoolMinecart extends EntityMinecart { } if(did) { - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, xp_, y, zp_); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, posP_); pump.hasCart = true; if(!pump.active) pump.setActive(true); @@ -136,23 +174,23 @@ public class EntityPoolMinecart extends EntityMinecart { } @Override - protected void writeEntityToNBT(NBTTagCompound p_70014_1_) { - super.writeEntityToNBT(p_70014_1_); - p_70014_1_.setInteger(TAG_MANA, getMana()); + protected void writeEntityToNBT(@Nonnull NBTTagCompound cmp) { + super.writeEntityToNBT(cmp); + cmp.setInteger(TAG_MANA, getMana()); } @Override - protected void readEntityFromNBT(NBTTagCompound p_70037_1_) { - super.readEntityFromNBT(p_70037_1_); - setMana(p_70037_1_.getInteger(TAG_MANA)); + protected void readEntityFromNBT(NBTTagCompound cmp) { + super.readEntityFromNBT(cmp); + setMana(cmp.getInteger(TAG_MANA)); } public int getMana() { - return dataWatcher.getWatchableObjectInt(16); + return dataManager.get(MANA); } public void setMana(int mana) { - dataWatcher.updateObject(16, mana); + dataManager.set(MANA, mana); } } diff --git a/src/main/java/vazkii/botania/common/entity/EntitySignalFlare.java b/src/main/java/vazkii/botania/common/entity/EntitySignalFlare.java index bcecb6ffb..b3620bcea 100644 --- a/src/main/java/vazkii/botania/common/entity/EntitySignalFlare.java +++ b/src/main/java/vazkii/botania/common/entity/EntitySignalFlare.java @@ -11,25 +11,33 @@ package vazkii.botania.common.entity; import net.minecraft.entity.Entity; -import net.minecraft.entity.passive.EntitySheep; +import net.minecraft.init.SoundEvents; +import net.minecraft.item.EnumDyeColor; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.datasync.DataParameter; +import net.minecraft.network.datasync.DataSerializers; +import net.minecraft.network.datasync.EntityDataManager; import net.minecraft.world.World; import vazkii.botania.common.Botania; +import javax.annotation.Nonnull; + public class EntitySignalFlare extends Entity { private static final String COLOR_TAG = "color"; + private static final String FIRED_Y_TAG = "firedY"; + private static final DataParameter COLOR = EntityDataManager.createKey(EntitySignalFlare.class, DataSerializers.VARINT); + private static final DataParameter FIRED_Y = EntityDataManager.createKey(EntitySignalFlare.class, DataSerializers.VARINT); - public EntitySignalFlare(World par1World) { - super(par1World); + public EntitySignalFlare(World world) { + super(world); setSize(0F, 0F); - dataWatcher.addObject(30, 0); - dataWatcher.setObjectWatched(30); } @Override protected void entityInit() { - // NO-OP + dataManager.register(COLOR, 0); + dataManager.register(FIRED_Y, 0); } @Override @@ -40,39 +48,52 @@ public class EntitySignalFlare extends Entity { if(!isDead) { if(ticksExisted % 10 == 0) - playSound("creeper.primed", 1F, 1F); + playSound(SoundEvents.ENTITY_CREEPER_PRIMED, 1F, 1F); int color = getColor(); if(color < 16 && color >= 0) { - float[] colorArray = EntitySheep.fleeceColorTable[color]; + int hex = EnumDyeColor.byMetadata(color).getMapColor().colorValue; + int r = (hex & 0xFF0000) >> 16; + int g = (hex & 0xFF00) >> 8; + int b = (hex & 0xFF); Botania.proxy.setWispFXDistanceLimit(false); for(int i = 0; i < 3; i++) - Botania.proxy.wispFX(worldObj, posX, posY, posZ + 0.5, colorArray[0], colorArray[1], colorArray[2], (float) Math.random() * 5 + 1F, (float) (Math.random() - 0.5F), 10F * (float) Math.sqrt(256F / (256F - (float) posY)), (float) (Math.random() - 0.5F)); + Botania.proxy.wispFX(posX, posY, posZ + 0.5, r / 255F, g / 255F, b / 255F, (float) Math.random() * 5 + 1F, (float) (Math.random() - 0.5F), 10F * (float) Math.sqrt(256F / (256F - (float) posY)), (float) (Math.random() - 0.5F)); for(int i = 0; i < 4; i++) - Botania.proxy.wispFX(worldObj, posX + 0.5, 256, posZ + 0.5, colorArray[0], colorArray[1], colorArray[2], (float) Math.random() * 15 + 8F, (float) (Math.random() - 0.5F) * 8F, 0F, (float) (Math.random() - 0.5F) * 8F); + Botania.proxy.wispFX(posX + 0.5, Math.min(256, getFiredAt() + Botania.proxy.getClientRenderDistance() * 16), posZ + 0.5, r / 255F, g / 255F, b / 255F, (float) Math.random() * 15 + 8F, (float) (Math.random() - 0.5F) * 8F, 0F, (float) (Math.random() - 0.5F) * 8F); Botania.proxy.setWispFXDistanceLimit(true); } } } @Override - protected void readEntityFromNBT(NBTTagCompound nbttagcompound) { + protected void readEntityFromNBT(@Nonnull NBTTagCompound nbttagcompound) { setColor(nbttagcompound.getInteger(COLOR_TAG)); + setFiredAt(nbttagcompound.getInteger(FIRED_Y_TAG)); } @Override - protected void writeEntityToNBT(NBTTagCompound nbttagcompound) { + protected void writeEntityToNBT(@Nonnull NBTTagCompound nbttagcompound) { nbttagcompound.setInteger(COLOR_TAG, getColor()); + nbttagcompound.setInteger(FIRED_Y_TAG, getFiredAt()); } public void setColor(int color) { - dataWatcher.updateObject(30, color); + dataManager.set(COLOR, color); } public int getColor() { - return dataWatcher.getWatchableObjectInt(30); + return dataManager.get(COLOR); + } + + public void setFiredAt(int y) { + dataManager.set(FIRED_Y, y); + } + + public int getFiredAt() { + return dataManager.get(FIRED_Y); } } diff --git a/src/main/java/vazkii/botania/common/entity/EntitySpark.java b/src/main/java/vazkii/botania/common/entity/EntitySpark.java index e89206d3e..562a45cc1 100644 --- a/src/main/java/vazkii/botania/common/entity/EntitySpark.java +++ b/src/main/java/vazkii/botania/common/entity/EntitySpark.java @@ -10,45 +10,58 @@ */ package vazkii.botania.common.entity; -import java.awt.Color; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.WeakHashMap; - +import baubles.common.lib.PlayerHandler; +import gnu.trove.map.hash.TObjectIntHashMap; +import net.minecraft.client.entity.AbstractClientPlayer; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.datasync.DataParameter; +import net.minecraft.network.datasync.DataSerializers; +import net.minecraft.network.datasync.EntityDataManager; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MathHelper; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; import vazkii.botania.api.mana.IManaItem; import vazkii.botania.api.mana.IManaPool; import vazkii.botania.api.mana.spark.ISparkAttachable; import vazkii.botania.api.mana.spark.ISparkEntity; import vazkii.botania.api.mana.spark.SparkHelper; +import vazkii.botania.api.mana.spark.SparkUpgradeType; import vazkii.botania.common.Botania; import vazkii.botania.common.core.helper.Vector3; import vazkii.botania.common.item.ModItems; -import baubles.common.lib.PlayerHandler; +import vazkii.botania.common.network.PacketBotaniaEffect; +import vazkii.botania.common.network.PacketHandler; + +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.WeakHashMap; public class EntitySpark extends Entity implements ISparkEntity { private static final int TRANSFER_RATE = 1000; private static final String TAG_UPGRADE = "upgrade"; private static final String TAG_INVIS = "invis"; - public static final int INVISIBILITY_DATA_WATCHER_KEY = 27; + public static final DataParameter INVISIBILITY = EntityDataManager.createKey(EntitySpark.class, DataSerializers.VARINT); + private static final DataParameter UPGRADE = EntityDataManager.createKey(EntitySpark.class, DataSerializers.VARINT); - Set transfers = Collections.newSetFromMap(new WeakHashMap()); + private final Set transfers = Collections.newSetFromMap(new WeakHashMap<>()); - int removeTransferants = 2; - boolean firstTick = false; + private int removeTransferants = 2; public EntitySpark(World world) { super(world); @@ -58,45 +71,45 @@ public class EntitySpark extends Entity implements ISparkEntity { @Override protected void entityInit() { setSize(0.1F, 0.5F); - dataWatcher.addObject(INVISIBILITY_DATA_WATCHER_KEY, 0); - dataWatcher.addObject(28, 0); - dataWatcher.setObjectWatched(INVISIBILITY_DATA_WATCHER_KEY); - dataWatcher.setObjectWatched(28); + dataManager.register(INVISIBILITY, 0); + dataManager.register(UPGRADE, 0); + } + + @Nonnull + @Override + public ItemStack getPickedResult(RayTraceResult target) { + return new ItemStack(ModItems.spark); } @Override public void onUpdate() { super.onUpdate(); + if(worldObj.isRemote) + return; + ISparkAttachable tile = getAttachedTile(); if(tile == null) { - if(!worldObj.isRemote) - setDead(); + dropAndKill(); return; } - boolean first = worldObj.isRemote && !firstTick; - int upgrade = getUpgrade(); + SparkUpgradeType upgrade = getUpgrade(); List allSparks = null; - if(first || upgrade == 2 || upgrade == 3) + if(upgrade == SparkUpgradeType.DOMINANT || upgrade == SparkUpgradeType.RECESSIVE) allSparks = SparkHelper.getSparksAround(worldObj, posX, posY, posZ); - if(first) - first = true; - Collection transfers = getTransfers(); - - if(upgrade != 0) { - switch(upgrade) { - case 1 : { // Dispersive + switch(upgrade) { + case DISPERSIVE : { List players = SparkHelper.getEntitiesAround(EntityPlayer.class, worldObj, posX, posY, posZ); - Map> receivingPlayers = new HashMap(); + Map> receivingPlayers = new HashMap<>(); ItemStack input = new ItemStack(ModItems.spark); for(EntityPlayer player : players) { - List stacks = new ArrayList(); + List stacks = new ArrayList<>(); stacks.addAll(Arrays.asList(player.inventory.mainInventory)); stacks.addAll(Arrays.asList(player.inventory.armorInventory)); stacks.addAll(Arrays.asList(PlayerHandler.getPlayerBaubles(player).stackList)); @@ -107,11 +120,11 @@ public class EntitySpark extends Entity implements ISparkEntity { IManaItem manaItem = (IManaItem) stack.getItem(); if(manaItem.canReceiveManaFromItem(stack, input)) { - Map receivingStacks; + TObjectIntHashMap receivingStacks; boolean add = false; if(!receivingPlayers.containsKey(player)) { add = true; - receivingStacks = new HashMap(); + receivingStacks = new TObjectIntHashMap<>(); } else receivingStacks = receivingPlayers.get(player); int recv = Math.min(getAttachedTile().getCurrentMana(), Math.min(TRANSFER_RATE, manaItem.getMaxMana(stack) - manaItem.getMana(stack))); @@ -125,11 +138,11 @@ public class EntitySpark extends Entity implements ISparkEntity { } if(!receivingPlayers.isEmpty()) { - List keys = new ArrayList(receivingPlayers.keySet()); + List keys = new ArrayList<>(receivingPlayers.keySet()); Collections.shuffle(keys); EntityPlayer player = keys.iterator().next(); - Map items = receivingPlayers.get(player); + TObjectIntHashMap items = receivingPlayers.get(player); ItemStack stack = items.keySet().iterator().next(); int cost = items.get(stack); int manaToPut = Math.min(getAttachedTile().getCurrentMana(), cost); @@ -140,14 +153,14 @@ public class EntitySpark extends Entity implements ISparkEntity { break; } - case 2 : { // Dominant - List validSparks = new ArrayList(); + case DOMINANT : { + List validSparks = new ArrayList<>(); for(ISparkEntity spark : allSparks) { if(spark == this) continue; - int upgrade_ = spark.getUpgrade(); - if(upgrade_ == 0 && spark.getAttachedTile() instanceof IManaPool) + SparkUpgradeType upgrade_ = spark.getUpgrade(); + if(upgrade_ == SparkUpgradeType.NONE && spark.getAttachedTile() instanceof IManaPool) validSparks.add(spark); } if(validSparks.size() > 0) @@ -155,18 +168,19 @@ public class EntitySpark extends Entity implements ISparkEntity { break; } - case 3 : { // Recessive + case RECESSIVE : { for(ISparkEntity spark : allSparks) { if(spark == this) continue; - int upgrade_ = spark.getUpgrade(); - if(upgrade_ != 2 && upgrade_ != 3 && upgrade_ != 4) + SparkUpgradeType upgrade_ = spark.getUpgrade(); + if(upgrade_ != SparkUpgradeType.DOMINANT && upgrade_ != SparkUpgradeType.RECESSIVE && upgrade_ != SparkUpgradeType.ISOLATED) transfers.add(spark); } break; } - } + case NONE: + default: break; } if(!transfers.isEmpty()) { @@ -194,127 +208,87 @@ public class EntitySpark extends Entity implements ISparkEntity { if(removeTransferants > 0) removeTransferants--; - getTransfers(); + filterTransfers(); } - void particlesTowards(Entity e) { - Vector3 thisVec = Vector3.fromEntityCenter(this).add(0, 0, 0); - Vector3 receiverVec = Vector3.fromEntityCenter(e).add(0, 0, 0); - - double rc = 0.45; - thisVec.add((Math.random() - 0.5) * rc, (Math.random() - 0.5) * rc, (Math.random() - 0.5) * rc); - receiverVec.add((Math.random() - 0.5) * rc, (Math.random() - 0.5) * rc, (Math.random() - 0.5) * rc); - - Vector3 motion = receiverVec.copy().sub(thisVec); - motion.multiply(0.04F); - float r = 0.4F + 0.3F * (float) Math.random(); - float g = 0.4F + 0.3F * (float) Math.random(); - float b = 0.4F + 0.3F * (float) Math.random(); - float size = 0.125F + 0.125F * (float) Math.random(); - - Botania.proxy.wispFX(worldObj, thisVec.x, thisVec.y, thisVec.z, r, g, b, size, (float) motion.x, (float) motion.y, (float) motion.z); + private void particlesTowards(Entity e) { + PacketHandler.sendToNearby(worldObj, this, + new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.SPARK_MANA_FLOW, posX, posY, posZ, + getEntityId(), e.getEntityId())); } - public static void particleBeam(Entity e1, Entity e2) { - if(e1 == null || e2 == null) - return; - - Vector3 orig = new Vector3(e1.posX , e1.posY + 0.25, e1.posZ); - Vector3 end = new Vector3(e2.posX, e2.posY + 0.25, e2.posZ); - Vector3 diff = end.copy().sub(orig); - Vector3 movement = diff.copy().normalize().multiply(0.1); - int iters = (int) (diff.mag() / movement.mag()); - float huePer = 1F / iters; - float hueSum = (float) Math.random(); - - Vector3 currentPos = orig.copy(); - for(int i = 0; i < iters; i++) { - float hue = i * huePer + hueSum; - Color color = Color.getHSBColor(hue, 1F, 1F); - float r = Math.min(1F, color.getRed() / 255F + 0.4F); - float g = Math.min(1F, color.getGreen() / 255F + 0.4F); - float b = Math.min(1F, color.getBlue() / 255F + 0.4F); - - Botania.proxy.setSparkleFXNoClip(true); - Botania.proxy.sparkleFX(e1.worldObj, currentPos.x, currentPos.y, currentPos.z, r, g, b, 1F, 12); - Botania.proxy.setSparkleFXNoClip(false); - currentPos.add(movement); + public static void particleBeam(EntityPlayer player, Entity e1, Entity e2) { + if(e1 != null && e2 != null && !e1.worldObj.isRemote) { + PacketHandler.sendTo(((EntityPlayerMP) player), + new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.SPARK_NET_INDICATOR, e1.posX, e1.posY, e1.posZ, + e1.getEntityId(), e2.getEntityId())); } } + private void dropAndKill() { + SparkUpgradeType upgrade = getUpgrade(); + entityDropItem(new ItemStack(ModItems.spark), 0F); + if(upgrade != SparkUpgradeType.NONE) + entityDropItem(new ItemStack(ModItems.sparkUpgrade, 1, upgrade.ordinal() - 1), 0F); + setDead(); + } + @Override public boolean canBeCollidedWith() { return true; } @Override - public boolean interactFirst(EntityPlayer player) { - ItemStack stack = player.getCurrentEquippedItem(); + public boolean processInitialInteract(EntityPlayer player, ItemStack stack, EnumHand hand) { if(stack != null) { - int upgrade = getUpgrade(); + if(worldObj.isRemote) + return stack.getItem() == ModItems.twigWand || stack.getItem() == ModItems.sparkUpgrade + || stack.getItem() == ModItems.phantomInk; + + SparkUpgradeType upgrade = getUpgrade(); if(stack.getItem() == ModItems.twigWand) { if(player.isSneaking()) { - if(upgrade > 0) { - if(!worldObj.isRemote) - entityDropItem(new ItemStack(ModItems.sparkUpgrade, 1, upgrade - 1), 0F); - setUpgrade(0); + if(upgrade != SparkUpgradeType.NONE) { + entityDropItem(new ItemStack(ModItems.sparkUpgrade, 1, upgrade.ordinal() - 1), 0F); + setUpgrade(SparkUpgradeType.NONE); transfers.clear(); removeTransferants = 2; - } else setDead(); - if(player.worldObj.isRemote) - player.swingItem(); + } else dropAndKill(); + player.swingArm(hand); return true; } else { List allSparks = SparkHelper.getSparksAround(worldObj, posX, posY, posZ); for(ISparkEntity spark : allSparks) - particleBeam(this, (Entity) spark); + particleBeam(player, this, (Entity) spark); return true; } - } else if(stack.getItem() == ModItems.sparkUpgrade && upgrade == 0) { + } else if(stack.getItem() == ModItems.sparkUpgrade && upgrade == SparkUpgradeType.NONE) { int newUpgrade = stack.getItemDamage() + 1; - setUpgrade(newUpgrade); + setUpgrade(SparkUpgradeType.values()[newUpgrade]); stack.stackSize--; - if(player.worldObj.isRemote) - player.swingItem(); + player.swingArm(hand); + return true; + } else if (stack.getItem() == ModItems.phantomInk) { + int invis = dataManager.get(INVISIBILITY); + dataManager.set(INVISIBILITY, ~invis & 1); return true; } } - return doPhantomInk(stack); - } - - public boolean doPhantomInk(ItemStack stack) { - if(stack != null && stack.getItem() == ModItems.phantomInk && !worldObj.isRemote) { - int invis = dataWatcher.getWatchableObjectInt(INVISIBILITY_DATA_WATCHER_KEY); - dataWatcher.updateObject(INVISIBILITY_DATA_WATCHER_KEY, ~invis & 1); - return true; - } - return false; } @Override - protected void readEntityFromNBT(NBTTagCompound cmp) { - setUpgrade(cmp.getInteger(TAG_UPGRADE)); - dataWatcher.updateObject(INVISIBILITY_DATA_WATCHER_KEY, cmp.getInteger(TAG_INVIS)); + protected void readEntityFromNBT(@Nonnull NBTTagCompound cmp) { + setUpgrade(SparkUpgradeType.values()[cmp.getInteger(TAG_UPGRADE)]); + dataManager.set(INVISIBILITY, cmp.getInteger(TAG_INVIS)); } @Override - protected void writeEntityToNBT(NBTTagCompound cmp) { - cmp.setInteger(TAG_UPGRADE, getUpgrade()); - cmp.setInteger(TAG_INVIS, dataWatcher.getWatchableObjectInt(INVISIBILITY_DATA_WATCHER_KEY)); - } - - @Override - public void setDead() { - super.setDead(); - if(!worldObj.isRemote) { - int upgrade = getUpgrade(); - entityDropItem(new ItemStack(ModItems.spark), 0F); - if(upgrade > 0) - entityDropItem(new ItemStack(ModItems.sparkUpgrade, 1, upgrade - 1), 0F); - } + protected void writeEntityToNBT(@Nonnull NBTTagCompound cmp) { + cmp.setInteger(TAG_UPGRADE, getUpgrade().ordinal()); + cmp.setInteger(TAG_INVIS, dataManager.get(INVISIBILITY)); } @Override @@ -322,31 +296,32 @@ public class EntitySpark extends Entity implements ISparkEntity { int x = MathHelper.floor_double(posX); int y = MathHelper.floor_double(posY) - 1; int z = MathHelper.floor_double(posZ); - TileEntity tile = worldObj.getTileEntity(x, y, z); + TileEntity tile = worldObj.getTileEntity(new BlockPos(x, y, z)); if(tile != null && tile instanceof ISparkAttachable) return (ISparkAttachable) tile; return null; } + private void filterTransfers() { + Iterator iter = transfers.iterator(); + while (iter.hasNext()) { + ISparkEntity spark = iter.next(); + SparkUpgradeType upgr = getUpgrade(); + SparkUpgradeType supgr = spark.getUpgrade(); + ISparkAttachable atile = spark.getAttachedTile(); + + if(!(spark != this + && !spark.areIncomingTransfersDone() + && atile != null && !atile.isFull() + && (upgr == SparkUpgradeType.NONE && supgr == SparkUpgradeType.DOMINANT || upgr == SparkUpgradeType.RECESSIVE && (supgr == SparkUpgradeType.NONE || supgr == SparkUpgradeType.DISPERSIVE) || !(atile instanceof IManaPool)))) + iter.remove(); + } + } @Override public Collection getTransfers() { - Collection removals = new ArrayList(); - - for(ISparkEntity e : transfers) { - ISparkEntity spark = e; - int upgr = getUpgrade(); - int supgr = spark.getUpgrade(); - ISparkAttachable atile = spark.getAttachedTile(); - - if(!(spark != this && !spark.areIncomingTransfersDone() && atile != null && !atile.isFull() && (upgr == 0 && supgr == 2 || upgr == 3 && (supgr == 0 || supgr == 1) || !(atile instanceof IManaPool)))) - removals.add(e); - } - - if(!removals.isEmpty()) - transfers.removeAll(removals); - + filterTransfers(); return transfers; } @@ -362,13 +337,13 @@ public class EntitySpark extends Entity implements ISparkEntity { } @Override - public int getUpgrade() { - return dataWatcher.getWatchableObjectInt(28); + public SparkUpgradeType getUpgrade() { + return SparkUpgradeType.values()[dataManager.get(UPGRADE)]; } @Override - public void setUpgrade(int upgrade) { - dataWatcher.updateObject(28, upgrade); + public void setUpgrade(SparkUpgradeType upgrade) { + dataManager.set(UPGRADE, upgrade.ordinal()); } @Override @@ -376,8 +351,7 @@ public class EntitySpark extends Entity implements ISparkEntity { ISparkAttachable tile = getAttachedTile(); if(tile instanceof IManaPool) return removeTransferants > 0; - - return tile != null && tile.areIncomingTranfersDone(); + return tile != null && tile.areIncomingTranfersDone(); } } diff --git a/src/main/java/vazkii/botania/common/entity/EntityThornChakram.java b/src/main/java/vazkii/botania/common/entity/EntityThornChakram.java index 5fea97229..6fc9f4d01 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityThornChakram.java +++ b/src/main/java/vazkii/botania/common/entity/EntityThornChakram.java @@ -13,128 +13,153 @@ package vazkii.botania.common.entity; import net.minecraft.block.Block; import net.minecraft.block.BlockBush; import net.minecraft.block.BlockLeaves; +import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityThrowable; +import net.minecraft.init.MobEffects; import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.datasync.DataParameter; +import net.minecraft.network.datasync.DataSerializers; +import net.minecraft.network.datasync.EntityDataManager; import net.minecraft.potion.PotionEffect; import net.minecraft.util.DamageSource; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import vazkii.botania.common.core.helper.MathHelper; import vazkii.botania.common.core.helper.Vector3; import vazkii.botania.common.item.ModItems; +import javax.annotation.Nonnull; + public class EntityThornChakram extends EntityThrowable { + private static final DataParameter BOUNCES = EntityDataManager.createKey(EntityThornChakram.class, DataSerializers.VARINT); + private static final DataParameter FLARE = EntityDataManager.createKey(EntityThornChakram.class, DataSerializers.BOOLEAN); + private static final DataParameter RETURN_TO = EntityDataManager.createKey(EntityThornChakram.class, DataSerializers.VARINT); private static final int MAX_BOUNCES = 16; - boolean bounced = false; + private boolean bounced = false; + private ItemStack stack; public EntityThornChakram(World world) { super(world); } - public EntityThornChakram(World world, EntityLivingBase e) { + public EntityThornChakram(World world, EntityLivingBase e, ItemStack stack) { super(world, e); + this.stack = stack.copy(); } @Override protected void entityInit() { - dataWatcher.addObject(30, 0); - dataWatcher.addObject(31, (byte) 0); - - dataWatcher.setObjectWatched(30); - dataWatcher.setObjectWatched(31); + super.entityInit(); + dataManager.register(BOUNCES, 0); + dataManager.register(FLARE, false); + dataManager.register(RETURN_TO, -1); } @Override public void onUpdate() { + // Standard motion double mx = motionX; double my = motionY; double mz = motionZ; super.onUpdate(); - if(isFire()) { + if(!bounced) { + // Reset the drag applied by super + motionX = mx; + motionY = my; + motionZ = mz; + } + + bounced = false; + + // Returning motion + if(isReturning()) { + Entity thrower = worldObj.getEntityByID(getEntityToReturnTo()); + Vector3 motion = Vector3.fromEntityCenter(thrower).subtract(Vector3.fromEntityCenter(this)).normalize(); + motionX = motion.x; + motionY = motion.y; + motionZ = motion.z; + } + + // Client FX + if(worldObj.isRemote && isFire()) { double r = 0.1; double m = 0.1; for(int i = 0; i < 3; i++) - worldObj.spawnParticle("flame", posX + r * (Math.random() - 0.5), posY + r * (Math.random() - 0.5), posZ + r * (Math.random() - 0.5), m * (Math.random() - 0.5), m * (Math.random() - 0.5), m * (Math.random() - 0.5)); + worldObj.spawnParticle(EnumParticleTypes.FLAME, posX + r * (Math.random() - 0.5), posY + r * (Math.random() - 0.5), posZ + r * (Math.random() - 0.5), m * (Math.random() - 0.5), m * (Math.random() - 0.5), m * (Math.random() - 0.5)); } - int bounces = getTimesBounced(); - if(bounces >= MAX_BOUNCES || ticksExisted > 60) { + // Server state control + if(!worldObj.isRemote && (getTimesBounced() >= MAX_BOUNCES || ticksExisted > 60)) { EntityLivingBase thrower = getThrower(); - noClip = true; - if(thrower == null) + if(thrower == null) { dropAndKill(); - else { - Vector3 motion = Vector3.fromEntityCenter(thrower).sub(Vector3.fromEntityCenter(this)).normalize(); - motionX = motion.x; - motionY = motion.y; - motionZ = motion.z; - if(MathHelper.pointDistanceSpace(posX, posY, posZ, thrower.posX, thrower.posY, thrower.posZ) < 1) - if(!(thrower instanceof EntityPlayer && (((EntityPlayer) thrower).capabilities.isCreativeMode || ((EntityPlayer) thrower).inventory.addItemStackToInventory(getItemStack())))) - dropAndKill(); - else if(!worldObj.isRemote) - setDead(); + } else { + setEntityToReturnTo(thrower.getEntityId()); + if(getDistanceSqToEntity(thrower) < 2) + dropAndKill(); } - } else { - if(!bounced) { - motionX = mx; - motionY = my; - motionZ = mz; - } - bounced = false; } } private void dropAndKill() { - if(!worldObj.isRemote) { - ItemStack stack = getItemStack(); - EntityItem item = new EntityItem(worldObj, posX, posY, posZ, stack); - worldObj.spawnEntityInWorld(item); - setDead(); - } + ItemStack stack = getItemStack(); + EntityItem item = new EntityItem(worldObj, posX, posY, posZ, stack); + worldObj.spawnEntityInWorld(item); + setDead(); } private ItemStack getItemStack() { - return new ItemStack(ModItems.thornChakram, 1, isFire() ? 1 : 0); + return stack != null ? stack.copy() : new ItemStack(ModItems.thornChakram, 1, isFire() ? 1 : 0); } @Override - protected void onImpact(MovingObjectPosition pos) { - if(noClip) + protected void onImpact(@Nonnull RayTraceResult pos) { + if(isReturning()) return; - Block block = worldObj.getBlock(pos.blockX, pos.blockY, pos.blockZ); - worldObj.getTileEntity(pos.blockX, pos.blockY, pos.blockZ); - if(block instanceof BlockBush || block instanceof BlockLeaves) - return; + switch (pos.typeOfHit) { + case BLOCK: { + Block block = worldObj.getBlockState(pos.getBlockPos()).getBlock(); + if(block instanceof BlockBush || block instanceof BlockLeaves) + return; - boolean fire = isFire(); - EntityLivingBase thrower = getThrower(); - if(pos.entityHit != null && pos.entityHit instanceof EntityLivingBase && pos.entityHit != thrower) { - ((EntityLivingBase) pos.entityHit).attackEntityFrom(thrower != null ? thrower instanceof EntityPlayer ? DamageSource.causePlayerDamage((EntityPlayer) thrower) : DamageSource.causeMobDamage(thrower) : DamageSource.generic, 12); - if(fire) - ((EntityLivingBase) pos.entityHit).setFire(5); - else if(worldObj.rand.nextInt(3) == 0) - ((EntityLivingBase) pos.entityHit).addPotionEffect(new PotionEffect(Potion.poison.id, 60, 0)); - } else { - int bounces = getTimesBounced(); - if(bounces < MAX_BOUNCES) { - Vector3 currentMovementVec = new Vector3(motionX, motionY, motionZ); - ForgeDirection dir = ForgeDirection.getOrientation(pos.sideHit); - Vector3 normalVector = new Vector3(dir.offsetX, dir.offsetY, dir.offsetZ).normalize(); - Vector3 movementVec = normalVector.multiply(-2 * currentMovementVec.dotProduct(normalVector)).add(currentMovementVec); + int bounces = getTimesBounced(); + if(bounces < MAX_BOUNCES) { + Vector3 currentMovementVec = new Vector3(motionX, motionY, motionZ); + EnumFacing dir = pos.sideHit; + Vector3 normalVector = new Vector3(dir.getFrontOffsetX(), dir.getFrontOffsetY(), dir.getFrontOffsetZ()).normalize(); + Vector3 movementVec = normalVector.multiply(-2 * currentMovementVec.dotProduct(normalVector)).add(currentMovementVec); - motionX = movementVec.x; - motionY = movementVec.y; - motionZ = movementVec.z; - bounced = true; + motionX = movementVec.x; + motionY = movementVec.y; + motionZ = movementVec.z; + bounced = true; + + if(!worldObj.isRemote) + setTimesBounced(getTimesBounced() + 1); + } + + break; + } + case ENTITY: { + if(!worldObj.isRemote && pos.entityHit != null && pos.entityHit instanceof EntityLivingBase && pos.entityHit != getThrower()) { + EntityLivingBase thrower = getThrower(); + pos.entityHit.attackEntityFrom(thrower != null ? thrower instanceof EntityPlayer ? DamageSource.causeThrownDamage(this, thrower) : DamageSource.causeMobDamage(thrower) : DamageSource.generic, 12); + if(isFire()) + pos.entityHit.setFire(5); + else if(worldObj.rand.nextInt(3) == 0) + ((EntityLivingBase) pos.entityHit).addPotionEffect(new PotionEffect(MobEffects.POISON, 60, 0)); + } + + break; } } } @@ -144,20 +169,50 @@ public class EntityThornChakram extends EntityThrowable { return 0F; } - public int getTimesBounced() { - return dataWatcher.getWatchableObjectInt(30); + private int getTimesBounced() { + return dataManager.get(BOUNCES); } - public void setTimesBounced(int times) { - dataWatcher.updateObject(30, times); + private void setTimesBounced(int times) { + dataManager.set(BOUNCES, times); } public boolean isFire() { - return dataWatcher.getWatchableObjectByte(31) != 0; + return dataManager.get(FLARE); } public void setFire(boolean fire) { - dataWatcher.updateObject(31, (byte) (fire ? 1 : 0)); + dataManager.set(FLARE, fire); + } + + private boolean isReturning() { + return getEntityToReturnTo() > -1; + } + + private int getEntityToReturnTo() { + return dataManager.get(RETURN_TO); + } + + private void setEntityToReturnTo(int entityID) { + dataManager.set(RETURN_TO, entityID); + } + + @Override + public void writeEntityToNBT(NBTTagCompound compound) { + super.writeEntityToNBT(compound); + if(stack != null) { + compound.setTag("fly_stack", stack.writeToNBT(new NBTTagCompound())); + } + compound.setBoolean("flare", isFire()); + } + + @Override + public void readEntityFromNBT(NBTTagCompound compound) { + super.readEntityFromNBT(compound); + if(compound.hasKey("fly_stack")) { + stack = ItemStack.loadItemStackFromNBT(compound.getCompoundTag("fly_stack")); + } + setFire(compound.getBoolean("flare")); } } diff --git a/src/main/java/vazkii/botania/common/entity/EntityThrowableCopy.java b/src/main/java/vazkii/botania/common/entity/EntityThrowableCopy.java index 38202c607..3a73143c7 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityThrowableCopy.java +++ b/src/main/java/vazkii/botania/common/entity/EntityThrowableCopy.java @@ -10,8 +10,6 @@ */ package vazkii.botania.common.entity; -import java.util.List; - import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -19,22 +17,31 @@ import net.minecraft.entity.IProjectile; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MathHelper; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.Vec3; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.world.WorldServer; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import javax.annotation.Nonnull; +import java.util.List; +import java.util.UUID; // A copy of the vanilla EntityThrowable class // Doing this because if I didn't do this it'd be an EntityThrowable // And we all know how much mods like deflecting EntityThrowables -public abstract class EntityThrowableCopy extends Entity implements IProjectile { - private int field_145788_c = -1; - private int field_145786_d = -1; - private int field_145787_e = -1; - private Block field_145785_f; +public abstract class EntityThrowableCopy extends Entity implements IProjectile +{ + private int xTile; + private int yTile; + private int zTile; + private Block inTile; protected boolean inGround; public int throwableShake; /** The entity that threw this throwable item. */ @@ -42,182 +49,190 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile private String throwerName; private int ticksInGround; private int ticksInAir; - public EntityThrowableCopy(World p_i1776_1_) + public Entity field_184539_c; + private int field_184540_av; + + public EntityThrowableCopy(World worldIn) { - super(p_i1776_1_); - setSize(0.25F, 0.25F); + super(worldIn); + this.xTile = -1; + this.yTile = -1; + this.zTile = -1; + this.setSize(0.25F, 0.25F); } - @Override - protected void entityInit() {} + public EntityThrowableCopy(World worldIn, double x, double y, double z) + { + this(worldIn); + this.setPosition(x, y, z); + } + + public EntityThrowableCopy(World worldIn, EntityLivingBase throwerIn) + { + this(worldIn, throwerIn.posX, throwerIn.posY + (double)throwerIn.getEyeHeight() - 0.10000000149011612D, throwerIn.posZ); + this.thrower = throwerIn; + } + + protected void entityInit() + { + } /** * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge * length * 64 * renderDistanceWeight Args: distance */ - @Override @SideOnly(Side.CLIENT) - public boolean isInRangeToRenderDist(double p_70112_1_) + public boolean isInRangeToRenderDist(double distance) { - double d1 = boundingBox.getAverageEdgeLength() * 4.0D; - d1 *= 64.0D; - return p_70112_1_ < d1 * d1; + double d0 = this.getEntityBoundingBox().getAverageEdgeLength() * 4.0D; + + if (Double.isNaN(d0)) + { + d0 = 4.0D; + } + + d0 = d0 * 64.0D; + return distance < d0 * d0; } - public EntityThrowableCopy(World p_i1777_1_, EntityLivingBase p_i1777_2_) + public void func_184538_a(Entity p_184538_1_, float p_184538_2_, float p_184538_3_, float p_184538_4_, float p_184538_5_, float p_184538_6_) { - super(p_i1777_1_); - thrower = p_i1777_2_; - setSize(0.25F, 0.25F); - setLocationAndAngles(p_i1777_2_.posX, p_i1777_2_.posY + p_i1777_2_.getEyeHeight(), p_i1777_2_.posZ, p_i1777_2_.rotationYaw, p_i1777_2_.rotationPitch); - posX -= MathHelper.cos(rotationYaw / 180.0F * (float)Math.PI) * 0.16F; - posY -= 0.10000000149011612D; - posZ -= MathHelper.sin(rotationYaw / 180.0F * (float)Math.PI) * 0.16F; - setPosition(posX, posY, posZ); - yOffset = 0.0F; - float f = 0.4F; - motionX = -MathHelper.sin(rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float)Math.PI) * f; - motionZ = MathHelper.cos(rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float)Math.PI) * f; - motionY = -MathHelper.sin((rotationPitch + func_70183_g()) / 180.0F * (float)Math.PI) * f; - setThrowableHeading(motionX, motionY, motionZ, func_70182_d(), 1.0F); - } + float f = -MathHelper.sin(p_184538_3_ * 0.017453292F) * MathHelper.cos(p_184538_2_ * 0.017453292F); + float f1 = -MathHelper.sin((p_184538_2_ + p_184538_4_) * 0.017453292F); + float f2 = MathHelper.cos(p_184538_3_ * 0.017453292F) * MathHelper.cos(p_184538_2_ * 0.017453292F); + this.setThrowableHeading((double)f, (double)f1, (double)f2, p_184538_5_, p_184538_6_); + this.motionX += p_184538_1_.motionX; + this.motionZ += p_184538_1_.motionZ; - public EntityThrowableCopy(World p_i1778_1_, double p_i1778_2_, double p_i1778_4_, double p_i1778_6_) - { - super(p_i1778_1_); - ticksInGround = 0; - setSize(0.25F, 0.25F); - setPosition(p_i1778_2_, p_i1778_4_, p_i1778_6_); - yOffset = 0.0F; - } - - protected float func_70182_d() - { - return 1.5F; - } - - protected float func_70183_g() - { - return 0.0F; + if (!p_184538_1_.onGround) + { + this.motionY += p_184538_1_.motionY; + } } /** * Similar to setArrowHeading, it's point the throwable entity to a x, y, z direction. */ - @Override - public void setThrowableHeading(double p_70186_1_, double p_70186_3_, double p_70186_5_, float p_70186_7_, float p_70186_8_) + public void setThrowableHeading(double x, double y, double z, float velocity, float inaccuracy) { - float f2 = MathHelper.sqrt_double(p_70186_1_ * p_70186_1_ + p_70186_3_ * p_70186_3_ + p_70186_5_ * p_70186_5_); - p_70186_1_ /= f2; - p_70186_3_ /= f2; - p_70186_5_ /= f2; - p_70186_1_ += rand.nextGaussian() * 0.007499999832361937D * p_70186_8_; - p_70186_3_ += rand.nextGaussian() * 0.007499999832361937D * p_70186_8_; - p_70186_5_ += rand.nextGaussian() * 0.007499999832361937D * p_70186_8_; - p_70186_1_ *= p_70186_7_; - p_70186_3_ *= p_70186_7_; - p_70186_5_ *= p_70186_7_; - motionX = p_70186_1_; - motionY = p_70186_3_; - motionZ = p_70186_5_; - float f3 = MathHelper.sqrt_double(p_70186_1_ * p_70186_1_ + p_70186_5_ * p_70186_5_); - prevRotationYaw = rotationYaw = (float)(Math.atan2(p_70186_1_, p_70186_5_) * 180.0D / Math.PI); - prevRotationPitch = rotationPitch = (float)(Math.atan2(p_70186_3_, f3) * 180.0D / Math.PI); - ticksInGround = 0; + float f = MathHelper.sqrt_double(x * x + y * y + z * z); + x = x / (double)f; + y = y / (double)f; + z = z / (double)f; + x = x + this.rand.nextGaussian() * 0.007499999832361937D * (double)inaccuracy; + y = y + this.rand.nextGaussian() * 0.007499999832361937D * (double)inaccuracy; + z = z + this.rand.nextGaussian() * 0.007499999832361937D * (double)inaccuracy; + x = x * (double)velocity; + y = y * (double)velocity; + z = z * (double)velocity; + this.motionX = x; + this.motionY = y; + this.motionZ = z; + float f1 = MathHelper.sqrt_double(x * x + z * z); + this.prevRotationYaw = this.rotationYaw = (float)(MathHelper.atan2(x, z) * (180D / Math.PI)); + this.prevRotationPitch = this.rotationPitch = (float)(MathHelper.atan2(y, (double)f1) * (180D / Math.PI)); + this.ticksInGround = 0; } /** - * Sets the velocity to the args. Args: x, y, z + * Updates the velocity of the entity to a new value. */ - @Override @SideOnly(Side.CLIENT) - public void setVelocity(double p_70016_1_, double p_70016_3_, double p_70016_5_) + public void setVelocity(double x, double y, double z) { - motionX = p_70016_1_; - motionY = p_70016_3_; - motionZ = p_70016_5_; + this.motionX = x; + this.motionY = y; + this.motionZ = z; - if (prevRotationPitch == 0.0F && prevRotationYaw == 0.0F) + if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { - float f = MathHelper.sqrt_double(p_70016_1_ * p_70016_1_ + p_70016_5_ * p_70016_5_); - prevRotationYaw = rotationYaw = (float)(Math.atan2(p_70016_1_, p_70016_5_) * 180.0D / Math.PI); - prevRotationPitch = rotationPitch = (float)(Math.atan2(p_70016_3_, f) * 180.0D / Math.PI); + float f = MathHelper.sqrt_double(x * x + z * z); + this.prevRotationYaw = this.rotationYaw = (float)(MathHelper.atan2(x, z) * (180D / Math.PI)); + this.prevRotationPitch = this.rotationPitch = (float)(MathHelper.atan2(y, (double)f) * (180D / Math.PI)); } } /** * Called to update the entity's position/logic. */ - @Override public void onUpdate() { - lastTickPosX = posX; - lastTickPosY = posY; - lastTickPosZ = posZ; + this.lastTickPosX = this.posX; + this.lastTickPosY = this.posY; + this.lastTickPosZ = this.posZ; super.onUpdate(); - if (throwableShake > 0) + if (this.throwableShake > 0) { - --throwableShake; + --this.throwableShake; } - if (inGround) + if (this.inGround) { - if (worldObj.getBlock(field_145788_c, field_145786_d, field_145787_e) == field_145785_f) + if (this.worldObj.getBlockState(new BlockPos(this.xTile, this.yTile, this.zTile)).getBlock() == this.inTile) { - ++ticksInGround; + ++this.ticksInGround; - if (ticksInGround == 1200) + if (this.ticksInGround == 1200) { - setDead(); + this.setDead(); } return; } - inGround = false; - motionX *= rand.nextFloat() * 0.2F; - motionY *= rand.nextFloat() * 0.2F; - motionZ *= rand.nextFloat() * 0.2F; - ticksInGround = 0; - ticksInAir = 0; + this.inGround = false; + this.motionX *= (double)(this.rand.nextFloat() * 0.2F); + this.motionY *= (double)(this.rand.nextFloat() * 0.2F); + this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); + this.ticksInGround = 0; + this.ticksInAir = 0; } else { - ++ticksInAir; + ++this.ticksInAir; } - Vec3 vec3 = Vec3.createVectorHelper(posX, posY, posZ); - Vec3 vec31 = Vec3.createVectorHelper(posX + motionX, posY + motionY, posZ + motionZ); - MovingObjectPosition movingobjectposition = worldObj.rayTraceBlocks(vec3, vec31); - vec3 = Vec3.createVectorHelper(posX, posY, posZ); - vec31 = Vec3.createVectorHelper(posX + motionX, posY + motionY, posZ + motionZ); + Vec3d vec3d = new Vec3d(this.posX, this.posY, this.posZ); + Vec3d vec3d1 = new Vec3d(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + RayTraceResult raytraceresult = this.worldObj.rayTraceBlocks(vec3d, vec3d1); + vec3d = new Vec3d(this.posX, this.posY, this.posZ); + vec3d1 = new Vec3d(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); - if (movingobjectposition != null) + if (raytraceresult != null) { - vec31 = Vec3.createVectorHelper(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord); + vec3d1 = new Vec3d(raytraceresult.hitVec.xCoord, raytraceresult.hitVec.yCoord, raytraceresult.hitVec.zCoord); } - if (!worldObj.isRemote) - { - Entity entity = null; - List list = worldObj.getEntitiesWithinAABBExcludingEntity(this, boundingBox.addCoord(motionX, motionY, motionZ).expand(1.0D, 1.0D, 1.0D)); - double d0 = 0.0D; - EntityLivingBase entitylivingbase = getThrower(); + Entity entity = null; + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox().addCoord(this.motionX, this.motionY, this.motionZ).expandXyz(1.0D)); + double d0 = 0.0D; + boolean flag = false; - for (int j = 0; j < list.size(); ++j) + for (int i = 0; i < list.size(); ++i) + { + Entity entity1 = (Entity)list.get(i); + + if (entity1.canBeCollidedWith()) { - Entity entity1 = (Entity)list.get(j); - - if (entity1.canBeCollidedWith() && (entity1 != entitylivingbase || ticksInAir >= 5)) + if (entity1 == this.field_184539_c) { - float f = 0.3F; - AxisAlignedBB axisalignedbb = entity1.boundingBox.expand(f, f, f); - MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31); + flag = true; + } + else if (this.ticksExisted < 2 && this.field_184539_c == null) + { + this.field_184539_c = entity1; + flag = true; + } + else + { + flag = false; + AxisAlignedBB axisalignedbb = entity1.getEntityBoundingBox().expandXyz(0.30000001192092896D); + RayTraceResult raytraceresult1 = axisalignedbb.calculateIntercept(vec3d, vec3d1); - if (movingobjectposition1 != null) + if (raytraceresult1 != null) { - double d1 = vec3.distanceTo(movingobjectposition1.hitVec); + double d1 = vec3d.squareDistanceTo(raytraceresult1.hitVec); if (d1 < d0 || d0 == 0.0D) { @@ -227,72 +242,84 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile } } } + } - if (entity != null) + if (this.field_184539_c != null) + { + if (flag) { - movingobjectposition = new MovingObjectPosition(entity); + this.field_184540_av = 2; + } + else if (this.field_184540_av-- <= 0) + { + this.field_184539_c = null; } } - if (movingobjectposition != null) + if (entity != null) { - if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && worldObj.getBlock(movingobjectposition.blockX, movingobjectposition.blockY, movingobjectposition.blockZ) == Blocks.portal) + raytraceresult = new RayTraceResult(entity); + } + + if (raytraceresult != null) + { + if (raytraceresult.typeOfHit == RayTraceResult.Type.BLOCK && this.worldObj.getBlockState(raytraceresult.getBlockPos()).getBlock() == Blocks.PORTAL) { - setInPortal(); + this.setPortal(raytraceresult.getBlockPos()); } else { - onImpact(movingobjectposition); + this.onImpact(raytraceresult); } } - posX += motionX; - posY += motionY; - posZ += motionZ; - float f1 = MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ); - rotationYaw = (float)(Math.atan2(motionX, motionZ) * 180.0D / Math.PI); + this.posX += this.motionX; + this.posY += this.motionY; + this.posZ += this.motionZ; + float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.rotationYaw = (float)(MathHelper.atan2(this.motionX, this.motionZ) * (180D / Math.PI)); - for (rotationPitch = (float)(Math.atan2(motionY, f1) * 180.0D / Math.PI); rotationPitch - prevRotationPitch < -180.0F; prevRotationPitch -= 360.0F) + for (this.rotationPitch = (float)(MathHelper.atan2(this.motionY, (double)f) * (180D / Math.PI)); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { ; } - while (rotationPitch - prevRotationPitch >= 180.0F) + while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { - prevRotationPitch += 360.0F; + this.prevRotationPitch += 360.0F; } - while (rotationYaw - prevRotationYaw < -180.0F) + while (this.rotationYaw - this.prevRotationYaw < -180.0F) { - prevRotationYaw -= 360.0F; + this.prevRotationYaw -= 360.0F; } - while (rotationYaw - prevRotationYaw >= 180.0F) + while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { - prevRotationYaw += 360.0F; + this.prevRotationYaw += 360.0F; } - rotationPitch = prevRotationPitch + (rotationPitch - prevRotationPitch) * 0.2F; - rotationYaw = prevRotationYaw + (rotationYaw - prevRotationYaw) * 0.2F; - float f2 = 0.99F; - float f3 = getGravityVelocity(); + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + float f1 = 0.99F; + float f2 = this.getGravityVelocity(); - if (isInWater()) + if (this.isInWater()) { - for (int i = 0; i < 4; ++i) + for (int j = 0; j < 4; ++j) { - float f4 = 0.25F; - worldObj.spawnParticle("bubble", posX - motionX * f4, posY - motionY * f4, posZ - motionZ * f4, motionX, motionY, motionZ); + float f3 = 0.25F; + this.worldObj.spawnParticle(EnumParticleTypes.WATER_BUBBLE, this.posX - this.motionX * (double)f3, this.posY - this.motionY * (double)f3, this.posZ - this.motionZ * (double)f3, this.motionX, this.motionY, this.motionZ); } - f2 = 0.8F; + f1 = 0.8F; } - motionX *= f2; - motionY *= f2; - motionZ *= f2; - motionY -= f3; - setPosition(posX, posY, posZ); + this.motionX *= (double)f1; + this.motionY *= (double)f1; + this.motionZ *= (double)f1; + this.motionY -= (double)f2; + this.setPosition(this.posX, this.posY, this.posZ); } /** @@ -306,63 +333,84 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile /** * Called when this EntityThrowable hits a block or entity. */ - protected abstract void onImpact(MovingObjectPosition p_70184_1_); + protected abstract void onImpact(RayTraceResult result); /** * (abstract) Protected helper method to write subclass entity data to NBT. */ - @Override - public void writeEntityToNBT(NBTTagCompound p_70014_1_) + public void writeEntityToNBT(@Nonnull NBTTagCompound compound) { - p_70014_1_.setShort("xTile", (short)field_145788_c); - p_70014_1_.setShort("yTile", (short)field_145786_d); - p_70014_1_.setShort("zTile", (short)field_145787_e); - p_70014_1_.setByte("inTile", (byte)Block.getIdFromBlock(field_145785_f)); - p_70014_1_.setByte("shake", (byte)throwableShake); - p_70014_1_.setByte("inGround", (byte)(inGround ? 1 : 0)); + compound.setInteger("xTile", this.xTile); + compound.setInteger("yTile", this.yTile); + compound.setInteger("zTile", this.zTile); + ResourceLocation resourcelocation = (ResourceLocation)Block.REGISTRY.getNameForObject(this.inTile); + compound.setString("inTile", resourcelocation == null ? "" : resourcelocation.toString()); + compound.setByte("shake", (byte)this.throwableShake); + compound.setByte("inGround", (byte)(this.inGround ? 1 : 0)); - if ((throwerName == null || throwerName.length() == 0) && thrower != null && thrower instanceof EntityPlayer) + if ((this.throwerName == null || this.throwerName.isEmpty()) && this.thrower instanceof EntityPlayer) { - throwerName = thrower.getCommandSenderName(); + this.throwerName = this.thrower.getName(); } - p_70014_1_.setString("ownerName", throwerName == null ? "" : throwerName); + compound.setString("ownerName", this.throwerName == null ? "" : this.throwerName); } /** * (abstract) Protected helper method to read subclass entity data from NBT. */ - @Override - public void readEntityFromNBT(NBTTagCompound p_70037_1_) + public void readEntityFromNBT(@Nonnull NBTTagCompound compound) { - field_145788_c = p_70037_1_.getShort("xTile"); - field_145786_d = p_70037_1_.getShort("yTile"); - field_145787_e = p_70037_1_.getShort("zTile"); - field_145785_f = Block.getBlockById(p_70037_1_.getByte("inTile") & 255); - throwableShake = p_70037_1_.getByte("shake") & 255; - inGround = p_70037_1_.getByte("inGround") == 1; - throwerName = p_70037_1_.getString("ownerName"); + this.xTile = compound.getInteger("xTile"); + this.yTile = compound.getInteger("yTile"); + this.zTile = compound.getInteger("zTile"); - if (throwerName != null && throwerName.length() == 0) + if (compound.hasKey("inTile", 8)) { - throwerName = null; + this.inTile = Block.getBlockFromName(compound.getString("inTile")); + } + else + { + this.inTile = Block.getBlockById(compound.getByte("inTile") & 255); } - } - @Override - @SideOnly(Side.CLIENT) - public float getShadowSize() - { - return 0.0F; + this.throwableShake = compound.getByte("shake") & 255; + this.inGround = compound.getByte("inGround") == 1; + this.thrower = null; + this.throwerName = compound.getString("ownerName"); + + if (this.throwerName != null && this.throwerName.isEmpty()) + { + this.throwerName = null; + } + + this.thrower = this.getThrower(); } public EntityLivingBase getThrower() { - if (thrower == null && throwerName != null && throwerName.length() > 0) + if (this.thrower == null && this.throwerName != null && !this.throwerName.isEmpty()) { - thrower = worldObj.getPlayerEntityByName(throwerName); + this.thrower = this.worldObj.getPlayerEntityByName(this.throwerName); + + if (this.thrower == null && this.worldObj instanceof WorldServer) + { + try + { + Entity entity = ((WorldServer)this.worldObj).getEntityFromUuid(UUID.fromString(this.throwerName)); + + if (entity instanceof EntityLivingBase) + { + this.thrower = (EntityLivingBase)entity; + } + } + catch (Throwable var2) + { + this.thrower = null; + } + } } - return thrower; + return this.thrower; } } \ No newline at end of file diff --git a/src/main/java/vazkii/botania/common/entity/EntityThrownItem.java b/src/main/java/vazkii/botania/common/entity/EntityThrownItem.java index dff1c91c6..4210251b8 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityThrownItem.java +++ b/src/main/java/vazkii/botania/common/entity/EntityThrownItem.java @@ -10,71 +10,79 @@ */ package vazkii.botania.common.entity; -import java.util.List; - import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; -import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.DamageSource; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.Vec3; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; +import vazkii.botania.common.core.handler.MethodHandles; import vazkii.botania.common.core.helper.Vector3; +import javax.annotation.Nonnull; +import java.util.List; + public class EntityThrownItem extends EntityItem { - public EntityThrownItem(World par1World) { - super(par1World); + public EntityThrownItem(World world) { + super(world); } - public EntityThrownItem(World p_i1710_1_, double p_i1710_2_, - double p_i1710_4_, double p_i1710_6_, EntityItem item) { - super(p_i1710_1_, p_i1710_2_, p_i1710_4_, p_i1710_6_, item.getEntityItem()); + public EntityThrownItem(World world, double x, + double y, double z, EntityItem item) { + super(world, x, y, z, item.getEntityItem()); - delayBeforeCanPickup = item.delayBeforeCanPickup; + int pickupDelay = 0; + try { + pickupDelay = (int) MethodHandles.pickupDelay_getter.invokeExact(item); + } catch (Throwable ignored) {} + + setPickupDelay(pickupDelay); motionX = item.motionX; motionY = item.motionY; motionZ = item.motionZ; } @Override - public boolean isEntityInvulnerable() { + public boolean isEntityInvulnerable(@Nonnull DamageSource source) { return true; } @Override public void onUpdate() { super.onUpdate(); - Vec3 vec3 = Vec3.createVectorHelper(posX, posY, posZ); - Vec3 vec31 = Vec3.createVectorHelper(posX + motionX, posY + motionY, posZ + motionZ); + Vec3d vec3 = new Vec3d(posX, posY, posZ); + Vec3d vec31 = new Vec3d(posX + motionX, posY + motionY, posZ + motionZ); - MovingObjectPosition movingobjectposition = worldObj.rayTraceBlocks(vec3, vec31); + RayTraceResult RayTraceResult = worldObj.rayTraceBlocks(vec3, vec31); if (!worldObj.isRemote) { Entity entity = null; - List list = worldObj.getEntitiesWithinAABBExcludingEntity(this, boundingBox.addCoord(motionX*2, motionY*2, motionZ*2).expand(2.0D, 2.0D, 2.0D)); + List list = worldObj.getEntitiesWithinAABBExcludingEntity(this, getEntityBoundingBox().addCoord(motionX*2, motionY*2, motionZ*2).expand(2.0D, 2.0D, 2.0D)); double d0 = 0.0D; - for (int j = 0; j < list.size(); ++j) - { - Entity entity1 = (Entity)list.get(j); + for (Entity entity1 : list) { + int pickupDelay; + try { + pickupDelay = (int) MethodHandles.pickupDelay_getter.invokeExact(this); + } catch (Throwable ignored) { + continue; + } - if (entity1.canBeCollidedWith() && (!(entity1 instanceof EntityPlayer) || delayBeforeCanPickup == 0)) - { + if (entity1.canBeCollidedWith() && (!(entity1 instanceof EntityPlayer) || pickupDelay == 0)) { float f = 1.0F; - AxisAlignedBB axisalignedbb = entity1.boundingBox.expand(f, f, f); - MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31); + AxisAlignedBB axisalignedbb = entity1.getEntityBoundingBox().expand(f, f, f); + RayTraceResult RayTraceResult1 = axisalignedbb.calculateIntercept(vec3, vec31); - if (movingobjectposition1 != null) - { - double d1 = vec3.distanceTo(movingobjectposition1.hitVec); + if (RayTraceResult1 != null) { + double d1 = vec3.distanceTo(RayTraceResult1.hitVec); - if (d1 < d0 || d0 == 0.0D) - { + if (d1 < d0 || d0 == 0.0D) { entity = entity1; d0 = d1; } @@ -84,20 +92,20 @@ public class EntityThrownItem extends EntityItem { if (entity != null) { - movingobjectposition = new MovingObjectPosition(entity); + RayTraceResult = new RayTraceResult(entity); } } - if (movingobjectposition != null) + if (RayTraceResult != null) { - if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && worldObj.getBlock(movingobjectposition.blockX, movingobjectposition.blockY, movingobjectposition.blockZ) == Blocks.portal) + if (RayTraceResult.typeOfHit == net.minecraft.util.math.RayTraceResult.Type.BLOCK && worldObj.getBlockState(RayTraceResult.getBlockPos()).getBlock() == Blocks.PORTAL) { - setInPortal(); + setPortal(RayTraceResult.getBlockPos()); } else { - if (movingobjectposition.entityHit != null) { - movingobjectposition.entityHit.attackEntityFrom(DamageSource.magic, 2.0F); + if (RayTraceResult.entityHit != null) { + RayTraceResult.entityHit.attackEntityFrom(DamageSource.magic, 2.0F); if (!worldObj.isRemote) { Entity item = getEntityItem().getItem().createEntity(worldObj, this, getEntityItem()); if (item == null) { diff --git a/src/main/java/vazkii/botania/common/entity/EntityVineBall.java b/src/main/java/vazkii/botania/common/entity/EntityVineBall.java index cfeadd723..0cd26a163 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityVineBall.java +++ b/src/main/java/vazkii/botania/common/entity/EntityVineBall.java @@ -10,59 +10,83 @@ */ package vazkii.botania.common.entity; +import com.google.common.collect.ImmutableMap; import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.block.BlockVine; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.projectile.EntityThrowable; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.item.Item; +import net.minecraft.network.datasync.DataParameter; +import net.minecraft.network.datasync.DataSerializers; +import net.minecraft.network.datasync.EntityDataManager; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; import vazkii.botania.common.block.ModBlocks; +import vazkii.botania.common.item.ModItems; + +import javax.annotation.Nonnull; +import java.util.Map; public class EntityVineBall extends EntityThrowable { - public EntityVineBall(World par1World) { - super(par1World); - dataWatcher.addObject(30, 0F); - dataWatcher.setObjectWatched(30); + private static final DataParameter GRAVITY = EntityDataManager.createKey(EntityVineBall.class, DataSerializers.FLOAT); + private static final Map propMap = ImmutableMap.of(EnumFacing.NORTH, BlockVine.NORTH, EnumFacing.SOUTH, BlockVine.SOUTH, + EnumFacing.WEST, BlockVine.WEST, EnumFacing.EAST, BlockVine.EAST); + + public EntityVineBall(World world) { + super(world); } - public EntityVineBall(EntityPlayer player, boolean gravity) { - super(player.worldObj, player); - dataWatcher.addObject(30, gravity ? 0.03F : 0F); - dataWatcher.setObjectWatched(30); + public EntityVineBall(EntityLivingBase thrower, boolean gravity) { + super(thrower.worldObj, thrower); + dataManager.set(GRAVITY, gravity ? 0.03F : 0F); } @Override - protected void onImpact(MovingObjectPosition var1) { - if(var1 != null) { - int meta = var1.sideHit; - int[] metaPlace = new int[] { - 1, 4, 8, 2 - }; + protected void entityInit() { + super.entityInit(); + dataManager.register(GRAVITY, 0F); + } - if(meta > 1 && meta < 6) { - ForgeDirection dir = ForgeDirection.getOrientation(meta); - int x = var1.blockX + dir.offsetX; - int y = var1.blockY + dir.offsetY; - int z = var1.blockZ + dir.offsetZ; - while(y > 0) { - Block block = worldObj.getBlock(x, y, z); - if(block.isAir(worldObj, x, y, z)) { - worldObj.setBlock(x, y, z, ModBlocks.solidVines, metaPlace[meta - 2], 1 | 2); - worldObj.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(ModBlocks.solidVines) + (metaPlace[meta - 2] << 12)); - y--; - } else break; + @Override + protected void onImpact(@Nonnull RayTraceResult var1) { + + if(worldObj.isRemote) { + for(int j = 0; j < 16; j++) { + this.worldObj.spawnParticle(EnumParticleTypes.ITEM_CRACK, this.posX, this.posY, this.posZ, Math.random() * 0.2 - 0.1, Math.random() * 0.25, Math.random() * 0.2 - 0.1, Item.getIdFromItem(ModItems.vineBall)); + } + } else { + if(var1 != null) { + EnumFacing dir = var1.sideHit; + + if(dir != null && dir.getAxis() != EnumFacing.Axis.Y) { + BlockPos pos = var1.getBlockPos().offset(dir); + while(pos.getY() > 0) { + IBlockState state = worldObj.getBlockState(pos); + Block block = state.getBlock(); + if(block.isAir(state, worldObj, pos)) { + IBlockState stateSet = ModBlocks.solidVines.getDefaultState().withProperty(propMap.get(dir.getOpposite()), true); + worldObj.setBlockState(pos, stateSet, 1 | 2); + worldObj.playEvent(2001, pos, Block.getStateId(stateSet)); + pos = pos.down(); + } else break; + } } + } + setDead(); } - - setDead(); } @Override protected float getGravityVelocity() { - return dataWatcher.getWatchableObjectFloat(30); + return dataManager.get(GRAVITY); } } diff --git a/src/main/java/vazkii/botania/common/entity/ModEntities.java b/src/main/java/vazkii/botania/common/entity/ModEntities.java index ad4625bc8..7fb8fc032 100644 --- a/src/main/java/vazkii/botania/common/entity/ModEntities.java +++ b/src/main/java/vazkii/botania/common/entity/ModEntities.java @@ -10,10 +10,10 @@ */ package vazkii.botania.common.entity; +import net.minecraftforge.fml.common.registry.EntityRegistry; import vazkii.botania.common.Botania; import vazkii.botania.common.block.tile.TileLightRelay.EntityPlayerMover; import vazkii.botania.common.lib.LibEntityNames; -import cpw.mods.fml.common.registry.EntityRegistry; public final class ModEntities { diff --git a/src/main/java/vazkii/botania/common/integration/buildcraft/StatementAPIPlugin.java b/src/main/java/vazkii/botania/common/integration/buildcraft/StatementAPIPlugin.java index 49b424d97..28364aa84 100644 --- a/src/main/java/vazkii/botania/common/integration/buildcraft/StatementAPIPlugin.java +++ b/src/main/java/vazkii/botania/common/integration/buildcraft/StatementAPIPlugin.java @@ -1,18 +1,18 @@ package vazkii.botania.common.integration.buildcraft; -import java.util.ArrayList; -import java.util.Collection; - -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; -import vazkii.botania.api.mana.IManaBlock; -import vazkii.botania.api.mana.IManaReceiver; -import vazkii.botania.common.block.tile.TileRuneAltar; import buildcraft.api.statements.IStatementContainer; import buildcraft.api.statements.ITriggerExternal; import buildcraft.api.statements.ITriggerInternal; import buildcraft.api.statements.ITriggerProvider; import buildcraft.api.statements.StatementManager; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumFacing; +import vazkii.botania.api.mana.IManaBlock; +import vazkii.botania.api.mana.IManaReceiver; +import vazkii.botania.common.block.tile.TileRuneAltar; + +import java.util.ArrayList; +import java.util.Collection; public class StatementAPIPlugin implements ITriggerProvider { @@ -38,14 +38,14 @@ public class StatementAPIPlugin implements ITriggerProvider { @Override public Collection getInternalTriggers(IStatementContainer container) { - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList<>(); list.add(triggerManaDetector); return list; } @Override - public Collection getExternalTriggers(ForgeDirection side, TileEntity tile) { - ArrayList list = new ArrayList(); + public Collection getExternalTriggers(EnumFacing side, TileEntity tile) { + ArrayList list = new ArrayList<>(); if (tile instanceof IManaBlock) { list.add(triggerManaEmpty); diff --git a/src/main/java/vazkii/botania/common/integration/buildcraft/StatementBase.java b/src/main/java/vazkii/botania/common/integration/buildcraft/StatementBase.java index cbf799357..461410606 100644 --- a/src/main/java/vazkii/botania/common/integration/buildcraft/StatementBase.java +++ b/src/main/java/vazkii/botania/common/integration/buildcraft/StatementBase.java @@ -1,16 +1,16 @@ package vazkii.botania.common.integration.buildcraft; -import net.minecraft.util.IIcon; import buildcraft.api.statements.IStatement; import buildcraft.api.statements.IStatementParameter; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; public abstract class StatementBase implements IStatement { - protected IIcon icon; @Override - public IIcon getIcon() { - return icon; - } + @SideOnly(Side.CLIENT) + public abstract TextureAtlasSprite getGuiSprite(); @Override public int maxParameters() { diff --git a/src/main/java/vazkii/botania/common/integration/buildcraft/TriggerManaDetector.java b/src/main/java/vazkii/botania/common/integration/buildcraft/TriggerManaDetector.java index 4210c9da8..2f07c69e9 100644 --- a/src/main/java/vazkii/botania/common/integration/buildcraft/TriggerManaDetector.java +++ b/src/main/java/vazkii/botania/common/integration/buildcraft/TriggerManaDetector.java @@ -1,43 +1,48 @@ package vazkii.botania.common.integration.buildcraft; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; -import vazkii.botania.api.internal.IManaBurst; -import vazkii.botania.client.core.helper.IconHelper; -import vazkii.botania.common.Botania; -import vazkii.botania.common.lib.LibTriggerNames; import buildcraft.api.statements.IStatementContainer; import buildcraft.api.statements.IStatementParameter; import buildcraft.api.statements.ITriggerInternal; +import com.google.common.base.Predicates; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.entity.Entity; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.text.translation.I18n; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.api.internal.IManaBurst; +import vazkii.botania.client.core.handler.MiscellaneousIcons; +import vazkii.botania.common.Botania; +import vazkii.botania.common.lib.LibTriggerNames; public class TriggerManaDetector extends StatementBase implements ITriggerInternal { + @Override + @SideOnly(Side.CLIENT) + public TextureAtlasSprite getGuiSprite() { + return MiscellaneousIcons.INSTANCE.manaDetectorIcon; + } + @Override public String getUniqueTag() { return "botania:manaDetector"; } - @Override - public void registerIcons(IIconRegister iconRegister) { - icon = IconHelper.forName(iconRegister, "triggers/manaDetector"); - } - @Override public String getDescription() { - return StatCollector.translateToLocal(LibTriggerNames.TRIGGER_MANA_DETECTOR); + return I18n.translateToLocal(LibTriggerNames.TRIGGER_MANA_DETECTOR); } @Override public boolean isTriggerActive(IStatementContainer source, IStatementParameter[] parameters) { - World world = source.getTile().getWorldObj(); - int x = source.getTile().xCoord, y = source.getTile().yCoord, z = source.getTile().zCoord; + World world = source.getTile().getWorld(); + int x = source.getTile().getPos().getX(), y = source.getTile().getPos().getY(), z = source.getTile().getPos().getZ(); - boolean output = world.getEntitiesWithinAABB(IManaBurst.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1)).size() != 0; + boolean output = world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(x, y, z, x + 1, y + 1, z + 1), Predicates.instanceOf(IManaBurst.class)).size() != 0; if(output) for(int i = 0; i < 4; i++) - Botania.proxy.sparkleFX(world, x + Math.random(), y + Math.random(), z + Math.random(), 1F, 0.2F, 0.2F, 0.7F + 0.5F * (float) Math.random(), 5); + Botania.proxy.sparkleFX(x + Math.random(), y + Math.random(), z + Math.random(), 1F, 0.2F, 0.2F, 0.7F + 0.5F * (float) Math.random(), 5); return output; } diff --git a/src/main/java/vazkii/botania/common/integration/buildcraft/TriggerManaLevel.java b/src/main/java/vazkii/botania/common/integration/buildcraft/TriggerManaLevel.java index f655d56af..462527a7e 100644 --- a/src/main/java/vazkii/botania/common/integration/buildcraft/TriggerManaLevel.java +++ b/src/main/java/vazkii/botania/common/integration/buildcraft/TriggerManaLevel.java @@ -1,19 +1,19 @@ package vazkii.botania.common.integration.buildcraft; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.StatCollector; -import net.minecraftforge.common.util.ForgeDirection; - -import org.apache.commons.lang3.text.WordUtils; - -import vazkii.botania.api.mana.IManaBlock; -import vazkii.botania.api.mana.IManaReceiver; -import vazkii.botania.client.core.helper.IconHelper; -import vazkii.botania.common.lib.LibTriggerNames; import buildcraft.api.statements.IStatementContainer; import buildcraft.api.statements.IStatementParameter; import buildcraft.api.statements.ITriggerExternal; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.text.translation.I18n; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import org.apache.commons.lang3.text.WordUtils; +import vazkii.botania.api.mana.IManaBlock; +import vazkii.botania.api.mana.IManaReceiver; +import vazkii.botania.client.core.handler.MiscellaneousIcons; +import vazkii.botania.common.lib.LibTriggerNames; public class TriggerManaLevel extends StatementBase implements ITriggerExternal { public enum State { @@ -23,7 +23,7 @@ public class TriggerManaLevel extends StatementBase implements ITriggerExternal FULL }; - private State state; + private final State state; public TriggerManaLevel(State state) { this.state = state; @@ -35,17 +35,18 @@ public class TriggerManaLevel extends StatementBase implements ITriggerExternal } @Override - public void registerIcons(IIconRegister iconRegister) { - icon = IconHelper.forName(iconRegister, "triggers/mana" + WordUtils.capitalizeFully(state.name())); + @SideOnly(Side.CLIENT) + public TextureAtlasSprite getGuiSprite() { + return MiscellaneousIcons.INSTANCE.manaLevelTriggerIcons.get(state); } @Override public String getDescription() { - return StatCollector.translateToLocal(LibTriggerNames.TRIGGER_MANA_PREFIX + WordUtils.capitalizeFully(state.name())); + return I18n.translateToLocal(LibTriggerNames.TRIGGER_MANA_PREFIX + WordUtils.capitalizeFully(state.name())); } @Override - public boolean isTriggerActive(TileEntity target, ForgeDirection side, IStatementContainer source, IStatementParameter[] parameters) { + public boolean isTriggerActive(TileEntity target, EnumFacing side, IStatementContainer source, IStatementParameter[] parameters) { if(target instanceof IManaBlock) { if(state == State.EMPTY) return ((IManaBlock) target).getCurrentMana() == 0; else if(state == State.CONTAINS) return ((IManaBlock) target).getCurrentMana() > 0; diff --git a/src/main/java/vazkii/botania/common/integration/buildcraft/TriggerRuneAltarCanCraft.java b/src/main/java/vazkii/botania/common/integration/buildcraft/TriggerRuneAltarCanCraft.java index cbad8aa76..c61ffa787 100644 --- a/src/main/java/vazkii/botania/common/integration/buildcraft/TriggerRuneAltarCanCraft.java +++ b/src/main/java/vazkii/botania/common/integration/buildcraft/TriggerRuneAltarCanCraft.java @@ -1,15 +1,17 @@ package vazkii.botania.common.integration.buildcraft; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.StatCollector; -import net.minecraftforge.common.util.ForgeDirection; -import vazkii.botania.client.core.helper.IconHelper; -import vazkii.botania.common.block.tile.TileRuneAltar; -import vazkii.botania.common.lib.LibTriggerNames; import buildcraft.api.statements.IStatementContainer; import buildcraft.api.statements.IStatementParameter; import buildcraft.api.statements.ITriggerExternal; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.text.translation.I18n; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.client.core.handler.MiscellaneousIcons; +import vazkii.botania.common.block.tile.TileRuneAltar; +import vazkii.botania.common.lib.LibTriggerNames; public class TriggerRuneAltarCanCraft extends StatementBase implements ITriggerExternal { @@ -19,17 +21,18 @@ public class TriggerRuneAltarCanCraft extends StatementBase implements ITriggerE } @Override - public void registerIcons(IIconRegister iconRegister) { - icon = IconHelper.forName(iconRegister, "triggers/runeAltarCanCraft"); + @SideOnly(Side.CLIENT) + public TextureAtlasSprite getGuiSprite() { + return MiscellaneousIcons.INSTANCE.runeAltarTriggerIcon; } @Override public String getDescription() { - return StatCollector.translateToLocal(LibTriggerNames.TRIGGER_RUNE_ALTAR_CAN_CRAFT); + return I18n.translateToLocal(LibTriggerNames.TRIGGER_RUNE_ALTAR_CAN_CRAFT); } @Override - public boolean isTriggerActive(TileEntity target, ForgeDirection side, IStatementContainer source, IStatementParameter[] parameters) { + public boolean isTriggerActive(TileEntity target, EnumFacing side, IStatementContainer source, IStatementParameter[] parameters) { if(target instanceof TileRuneAltar) return ((TileRuneAltar) target).hasValidRecipe(); return false; } diff --git a/src/main/java/vazkii/botania/common/integration/coloredlights/ColoredLightHelper.java b/src/main/java/vazkii/botania/common/integration/coloredlights/ColoredLightHelper.java deleted file mode 100644 index 46786e369..000000000 --- a/src/main/java/vazkii/botania/common/integration/coloredlights/ColoredLightHelper.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Dec 26, 2014, 7:26:31 PM (GMT)] - */ -package vazkii.botania.common.integration.coloredlights; - - -/* - * This class is presentto help with the Colored Lights mod without needing to package - * the API or hold a dependency, please understand. - */ -public class ColoredLightHelper { - - // Begin API Copypasta - // https://github.com/CptSpaceToaster/CptsModdingLight/blob/1.7.2/src/main/java/coloredlightscore/src/api/CLApi.java - - public static int r[] = new int[] { 0, 15, 0, 8, 0, 10, 0, 10, 5, 15, 8, 15, 0, 15, 15, 15 }; - public static int g[] = new int[] { 0, 0, 15, 3, 0, 0, 15, 10, 5, 10, 15, 15, 8, 0, 12, 15 }; - public static int b[] = new int[] { 0, 0, 0, 0, 15, 15, 15, 10, 5, 13, 0, 0, 15, 15, 10, 15 }; - - public static int makeRGBLightValue(float r, float g, float b, float currentLightValue) { - // Clamp color channels - if (r < 0.0f) - r = 0.0f; - else if (r > 1.0f) - r = 1.0f; - - if (g < 0.0f) - g = 0.0f; - else if (g > 1.0f) - g = 1.0f; - - if (b < 0.0f) - b = 0.0f; - else if (b > 1.0f) - b = 1.0f; - - int brightness = (int) (currentLightValue * 15.0f); - brightness &= 0xf; - - return brightness | ((int) (15.0F * b) << 15) + ((int) (15.0F * g) << 10) + ((int) (15.0F * r) << 5); - } - - // End API Copypasta - - private static int packedColors[][] = null; - - public static int getPackedColor(int meta, int light) { - if(packedColors == null) - initPackedColors(); - - return packedColors[meta][light]; - } - - private static void initPackedColors() { - packedColors = new int[16][16]; - for(int i = 0; i < 16; i++) - for(int j = 0; j < 16; j++) - packedColors[i][j] = makeRGBLightValue(r[15 - i], g[15 - i], b[15 - i], j / 16F); - } - -} diff --git a/src/main/java/vazkii/botania/common/integration/coloredlights/ILightHelper.java b/src/main/java/vazkii/botania/common/integration/coloredlights/ILightHelper.java deleted file mode 100644 index e813b5132..000000000 --- a/src/main/java/vazkii/botania/common/integration/coloredlights/ILightHelper.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [May 16, 2015, 8:30:41 PM (GMT)] - */ -package vazkii.botania.common.integration.coloredlights; - -/* - * This interface is use for wrappers for compatibility with the colored lights mod. - * It has one version for colored lights, and one version which leaves the light values unmodified for vanilla - */ -public interface ILightHelper { - - public int makeRGBLightValue(float r, float g, float b, int currentLightValue); - public int getPackedColor(int meta, int light); -} diff --git a/src/main/java/vazkii/botania/common/integration/coloredlights/LightHelper.java b/src/main/java/vazkii/botania/common/integration/coloredlights/LightHelper.java deleted file mode 100644 index a2788419e..000000000 --- a/src/main/java/vazkii/botania/common/integration/coloredlights/LightHelper.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [May 16, 2015, 8:30:41 PM (GMT)] - */ -package vazkii.botania.common.integration.coloredlights; - -import vazkii.botania.common.Botania; - -/* - * This class acts as ColoredLightHelper if the colored lights mod is installed, and leaves the light values unmodified otherwise - */ -public class LightHelper { - - public static int makeRGBLightValue(float r, float g, float b, float currentLightValue) { - return Botania.lightHelper.makeRGBLightValue(r, g, b, (int) currentLightValue); - } - - public static int getPackedColor(int meta, int light) { - return Botania.lightHelper.getPackedColor(meta, light); - } -} diff --git a/src/main/java/vazkii/botania/common/integration/coloredlights/LightHelperColored.java b/src/main/java/vazkii/botania/common/integration/coloredlights/LightHelperColored.java deleted file mode 100644 index 9b9f4580c..000000000 --- a/src/main/java/vazkii/botania/common/integration/coloredlights/LightHelperColored.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [May 16, 2015, 8:30:41 PM (GMT)] - */ -package vazkii.botania.common.integration.coloredlights; - -/* - * This is an implementation of ILightHelper for when the colored lights mod is installed - */ -public class LightHelperColored implements ILightHelper { - - @Override - public int makeRGBLightValue(float r, float g, float b, int currentLightValue) { - return ColoredLightHelper.makeRGBLightValue(r, g, b, currentLightValue); - } - - @Override - public int getPackedColor(int meta, int light) { - return ColoredLightHelper.getPackedColor(meta, light); - } - -} diff --git a/src/main/java/vazkii/botania/common/integration/coloredlights/LightHelperVanilla.java b/src/main/java/vazkii/botania/common/integration/coloredlights/LightHelperVanilla.java deleted file mode 100644 index 441d0dd57..000000000 --- a/src/main/java/vazkii/botania/common/integration/coloredlights/LightHelperVanilla.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [May 16, 2015, 8:30:41 PM (GMT)] - */ -package vazkii.botania.common.integration.coloredlights; - -/* - * This is an implementation of ILightHelper for when the colored lights mod isn't installed - */ -public class LightHelperVanilla implements ILightHelper { - - @Override - public int makeRGBLightValue(float r, float g, float b, int currentLightValue) { - return currentLightValue; - } - - @Override - public int getPackedColor(int meta, int light) { - return light; - } - -} diff --git a/src/main/java/vazkii/botania/common/integration/corporea/WrappedDeepStorage.java b/src/main/java/vazkii/botania/common/integration/corporea/WrappedDeepStorage.java index b15b3097f..ab999e521 100644 --- a/src/main/java/vazkii/botania/common/integration/corporea/WrappedDeepStorage.java +++ b/src/main/java/vazkii/botania/common/integration/corporea/WrappedDeepStorage.java @@ -9,18 +9,18 @@ */ package vazkii.botania.common.integration.corporea; -import java.util.ArrayList; -import java.util.List; - -import org.apache.logging.log4j.Level; - -import cpw.mods.fml.common.FMLLog; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; +import net.minecraftforge.items.wrapper.InvWrapper; import powercrystals.minefactoryreloaded.api.IDeepStorageUnit; import vazkii.botania.api.corporea.CorporeaRequest; import vazkii.botania.api.corporea.ICorporeaSpark; import vazkii.botania.api.corporea.IWrappedInventory; +import vazkii.botania.api.corporea.InvWithLocation; +import vazkii.botania.common.Botania; + +import java.util.ArrayList; +import java.util.List; /** * Wrapper for StorageDrawers compatibility. @@ -31,16 +31,16 @@ public class WrappedDeepStorage extends WrappedInventoryBase { private static boolean checkedInterface = false; private static boolean deepStoragePresent = false; - private IDeepStorageUnit inv; + private final IDeepStorageUnit invRaw; private WrappedDeepStorage(IDeepStorageUnit inv, ICorporeaSpark spark) { - this.inv = inv; + this.invRaw = inv; this.spark = spark; } @Override - public IInventory getWrappedObject() { - return (IInventory) inv; + public InvWithLocation getWrappedObject() { + return new InvWithLocation(new InvWrapper(((IInventory) invRaw)), spark.getSparkInventory().world, spark.getSparkInventory().pos); } @Override @@ -57,7 +57,7 @@ public class WrappedDeepStorage extends WrappedInventoryBase { List stacks = new ArrayList(); boolean removedAny = false; - ItemStack prototype = inv.getStoredItemType(); + ItemStack prototype = invRaw.getStoredItemType(); if(prototype == null) { // for the case of barrel without contents set return stacks; @@ -85,7 +85,7 @@ public class WrappedDeepStorage extends WrappedInventoryBase { request.extractedItems += rem; if(doit && rem > 0) { - decreaseStoredCount(inv, rem); + decreaseStoredCount(invRaw, rem); removedAny = true; if(spark != null) @@ -109,11 +109,10 @@ public class WrappedDeepStorage extends WrappedInventoryBase { * * @return wrapped inventory or null if it has incompatible type. */ - public static IWrappedInventory wrap(IInventory inv, ICorporeaSpark spark) { - if(!isDeepStorageNeeded()) { - return null; - } - return inv instanceof IDeepStorageUnit ? new WrappedDeepStorage((IDeepStorageUnit) inv, spark) : null; + public static IWrappedInventory wrap(InvWithLocation inv, ICorporeaSpark spark) { + if(isDeepStorageNeeded() && inv.handler instanceof InvWrapper && ((InvWrapper) inv.handler).getInv() instanceof IDeepStorageUnit) { + return new WrappedDeepStorage(((IDeepStorageUnit) ((InvWrapper) inv.handler).getInv()), spark); + } else return null; } /** @@ -129,7 +128,7 @@ public class WrappedDeepStorage extends WrappedInventoryBase { deepStoragePresent = false; } checkedInterface = true; - FMLLog.log(Level.INFO, "[Botania] Corporea support for Deep Storage: %b", deepStoragePresent); + Botania.LOGGER.info("Corporea support for Deep Storage: %b", deepStoragePresent); } return deepStoragePresent; } diff --git a/src/main/java/vazkii/botania/common/integration/corporea/WrappedIInventory.java b/src/main/java/vazkii/botania/common/integration/corporea/WrappedIInventory.java index 837df4b9c..af10215bb 100644 --- a/src/main/java/vazkii/botania/common/integration/corporea/WrappedIInventory.java +++ b/src/main/java/vazkii/botania/common/integration/corporea/WrappedIInventory.java @@ -9,27 +9,26 @@ */ package vazkii.botania.common.integration.corporea; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; -import vazkii.botania.api.corporea.CorporeaHelper; import vazkii.botania.api.corporea.CorporeaRequest; import vazkii.botania.api.corporea.ICorporeaSpark; import vazkii.botania.api.corporea.IWrappedInventory; +import vazkii.botania.api.corporea.InvWithLocation; + +import java.util.ArrayList; +import java.util.List; public class WrappedIInventory extends WrappedInventoryBase{ - private IInventory inv; + private final InvWithLocation inv; - private WrappedIInventory(IInventory inv, ICorporeaSpark spark) { + private WrappedIInventory(InvWithLocation inv, ICorporeaSpark spark) { this.inv = inv; this.spark = spark; } @Override - public IInventory getWrappedObject() { + public InvWithLocation getWrappedObject() { return inv; } @@ -46,46 +45,31 @@ public class WrappedIInventory extends WrappedInventoryBase{ private List iterateOverSlots(CorporeaRequest request, boolean doit) { List stacks = new ArrayList(); - boolean removedAny = false; - for (int i = inv.getSizeInventory() - 1; i >= 0; i--) { - if(!CorporeaHelper.isValidSlot(inv, i)) - continue; - - ItemStack stackAt = inv.getStackInSlot(i); + for (int i = inv.handler.getSlots() - 1; i >= 0; i--) { + ItemStack stackAt = inv.handler.getStackInSlot(i); // WARNING: this code is very similar in all implementations of // IWrappedInventory - keep it synch if(isMatchingItemStack(request.matcher, request.checkNBT, stackAt)) { int rem = Math.min(stackAt.stackSize, request.count == -1 ? stackAt.stackSize : request.count); if(rem > 0) { - ItemStack copy = stackAt.copy(); - if(rem < copy.stackSize) - copy.stackSize = rem; - stacks.add(copy); + stacks.add(inv.handler.extractItem(i, rem, !doit)); + if(doit && spark != null) + spark.onItemExtracted(stackAt); } request.foundItems += stackAt.stackSize; request.extractedItems += rem; - if(doit && rem > 0) { - inv.decrStackSize(i, rem); - removedAny = true; - if(spark != null) - spark.onItemExtracted(stackAt); - } if(request.count != -1) request.count -= rem; } } - if(removedAny) { - inv.markDirty(); - } - return stacks; } - public static IWrappedInventory wrap(IInventory inv, ICorporeaSpark spark) { + public static IWrappedInventory wrap(InvWithLocation inv, ICorporeaSpark spark) { return new WrappedIInventory(inv, spark); } diff --git a/src/main/java/vazkii/botania/common/integration/corporea/WrappedInventoryBase.java b/src/main/java/vazkii/botania/common/integration/corporea/WrappedInventoryBase.java index 9ff62e35e..5b11f17d0 100644 --- a/src/main/java/vazkii/botania/common/integration/corporea/WrappedInventoryBase.java +++ b/src/main/java/vazkii/botania/common/integration/corporea/WrappedInventoryBase.java @@ -9,15 +9,15 @@ */ package vazkii.botania.common.integration.corporea; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - import net.minecraft.item.ItemStack; import vazkii.botania.api.corporea.CorporeaHelper; import vazkii.botania.api.corporea.ICorporeaSpark; import vazkii.botania.api.corporea.IWrappedInventory; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + public abstract class WrappedInventoryBase implements IWrappedInventory { protected ICorporeaSpark spark; diff --git a/src/main/java/vazkii/botania/common/integration/corporea/WrappedStorageDrawers.java b/src/main/java/vazkii/botania/common/integration/corporea/WrappedStorageDrawers.java index 2ee27ce9c..19973269b 100644 --- a/src/main/java/vazkii/botania/common/integration/corporea/WrappedStorageDrawers.java +++ b/src/main/java/vazkii/botania/common/integration/corporea/WrappedStorageDrawers.java @@ -9,17 +9,18 @@ */ package vazkii.botania.common.integration.corporea; -import java.util.ArrayList; -import java.util.List; - import com.jaquadro.minecraft.storagedrawers.api.storage.IDrawer; import com.jaquadro.minecraft.storagedrawers.api.storage.IDrawerGroup; - import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; +import net.minecraftforge.items.wrapper.InvWrapper; import vazkii.botania.api.corporea.CorporeaRequest; import vazkii.botania.api.corporea.ICorporeaSpark; import vazkii.botania.api.corporea.IWrappedInventory; +import vazkii.botania.api.corporea.InvWithLocation; + +import java.util.ArrayList; +import java.util.List; /** * Wrapper for StorageDrawers compatibility. @@ -27,16 +28,16 @@ import vazkii.botania.api.corporea.IWrappedInventory; */ public class WrappedStorageDrawers extends WrappedInventoryBase { - private IDrawerGroup inv; + private final IDrawerGroup invRaw; private WrappedStorageDrawers(IDrawerGroup inv, ICorporeaSpark spark) { - this.inv = inv; + this.invRaw = inv; this.spark = spark; } @Override - public IInventory getWrappedObject() { - return (IInventory) inv; + public InvWithLocation getWrappedObject() { + return new InvWithLocation(new InvWrapper((IInventory) invRaw), spark.getSparkInventory().world, spark.getSparkInventory().pos); } @Override @@ -53,8 +54,8 @@ public class WrappedStorageDrawers extends WrappedInventoryBase { List stacks = new ArrayList(); boolean removedAny = false; - for(int i = 0; i < inv.getDrawerCount(); i++) { - IDrawer drawer = inv.getDrawer(i); + for(int i = 0; i < invRaw.getDrawerCount(); i++) { + IDrawer drawer = invRaw.getDrawer(i); if(drawer == null) { continue; } @@ -93,7 +94,7 @@ public class WrappedStorageDrawers extends WrappedInventoryBase { } } if(removedAny) { - inv.markDirtyIfNeeded(); + invRaw.markDirtyIfNeeded(); } return stacks; } @@ -107,7 +108,9 @@ public class WrappedStorageDrawers extends WrappedInventoryBase { * * @return wrapped inventory or null if it has incompatible type. */ - public static IWrappedInventory wrap(IInventory inv, ICorporeaSpark spark) { - return inv instanceof IDrawerGroup ? new WrappedStorageDrawers((IDrawerGroup) inv, spark) : null; + public static IWrappedInventory wrap(InvWithLocation inv, ICorporeaSpark spark) { + if(inv.world.getTileEntity(inv.pos) instanceof IDrawerGroup) { + return new WrappedStorageDrawers((IDrawerGroup) inv.world.getTileEntity(inv.pos), spark); + } else return null; } } diff --git a/src/main/java/vazkii/botania/common/integration/etfuturum/ModBanners.java b/src/main/java/vazkii/botania/common/integration/etfuturum/ModBanners.java deleted file mode 100644 index 8b140b780..000000000 --- a/src/main/java/vazkii/botania/common/integration/etfuturum/ModBanners.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Aug 25, 2015, 7:11:35 PM (GMT)] - */ -package vazkii.botania.common.integration.etfuturum; - -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.EnumHelper; -import vazkii.botania.common.block.ModBlocks; -import vazkii.botania.common.item.ModItems; - -public final class ModBanners { - - public static void init() { - try { - Class> clazz = (Class>) Class.forName("ganymedes01.etfuturum.tileentities.TileEntityBanner$EnumBannerPattern"); - addPattern(clazz, "flower", "flr", new ItemStack(ModItems.manaResource, 1, 3)); - addPattern(clazz, "lexicon", "lex", new ItemStack(ModItems.lexicon)); - addPattern(clazz, "logo", "lgo", new ItemStack(ModItems.manaResource, 1, 4)); - addPattern(clazz, "sapling", "spl", new ItemStack(ModItems.manaResource, 1, 13)); - addPattern(clazz, "tiny_potato", "tpt", new ItemStack(ModBlocks.tinyPotato)); - - addPattern(clazz, "spark_dispersive", "sds", new ItemStack(ModItems.sparkUpgrade, 1, 0)); - addPattern(clazz, "spark_dominant", "sdm", new ItemStack(ModItems.sparkUpgrade, 1, 1)); - addPattern(clazz, "spark_recessive", "src", new ItemStack(ModItems.sparkUpgrade, 1, 2)); - addPattern(clazz, "spark_isolated", "sis", new ItemStack(ModItems.sparkUpgrade, 1, 3)); - - addPattern(clazz, "fish", "fis", new ItemStack(Items.fish)); - addPattern(clazz, "axe", "axe", new ItemStack(Items.iron_axe)); - addPattern(clazz, "hoe", "hoe", new ItemStack(Items.iron_hoe)); - addPattern(clazz, "pickaxe", "pik", new ItemStack(Items.iron_pickaxe)); - addPattern(clazz, "shovel", "shv", new ItemStack(Items.iron_shovel)); - addPattern(clazz, "sword", "srd", new ItemStack(Items.iron_sword)); - } catch (ClassNotFoundException e) { - // Looks like we don't have EtFuturum around, let's not do any of this nonsense then - } - } - - public static void addPattern(Class> clazz, String name, String id, ItemStack craftingItem) { - name = "botania_" + name; - id = "bt_" + id; - EnumHelper.addEnum(clazz, name.toUpperCase(), new Class[] { String.class, String.class, ItemStack.class }, new Object[] { name, id, craftingItem }); - } -} diff --git a/src/main/java/vazkii/botania/common/integration/multipart/MultipartHandler.java b/src/main/java/vazkii/botania/common/integration/multipart/MultipartHandler.java index de6ef54c6..f05bb4ba3 100644 --- a/src/main/java/vazkii/botania/common/integration/multipart/MultipartHandler.java +++ b/src/main/java/vazkii/botania/common/integration/multipart/MultipartHandler.java @@ -7,7 +7,8 @@ * Botania License: http://botaniamod.net/license.php * * File Created @ [Sep 1, 2015, 5:32:15 PM (GMT)] - */ + *//* + package vazkii.botania.common.integration.multipart; import java.util.ArrayList; @@ -68,4 +69,4 @@ public class MultipartHandler { } } -} +}*/ diff --git a/src/main/java/vazkii/botania/common/item/IFloatingFlowerVariant.java b/src/main/java/vazkii/botania/common/item/IFloatingFlowerVariant.java index 823e21044..94e981ad9 100644 --- a/src/main/java/vazkii/botania/common/item/IFloatingFlowerVariant.java +++ b/src/main/java/vazkii/botania/common/item/IFloatingFlowerVariant.java @@ -11,7 +11,7 @@ package vazkii.botania.common.item; import net.minecraft.item.ItemStack; -import vazkii.botania.common.block.decor.IFloatingFlower.IslandType; +import vazkii.botania.api.item.IFloatingFlower.IslandType; public interface IFloatingFlowerVariant { public IslandType getIslandType(ItemStack stack); diff --git a/src/main/java/vazkii/botania/common/item/Item16Colors.java b/src/main/java/vazkii/botania/common/item/Item16Colors.java index 5abafdc6c..d647f98d6 100644 --- a/src/main/java/vazkii/botania/common/item/Item16Colors.java +++ b/src/main/java/vazkii/botania/common/item/Item16Colors.java @@ -10,42 +10,43 @@ */ package vazkii.botania.common.item; -import java.awt.Color; -import java.util.List; - import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.passive.EntitySheep; +import net.minecraft.item.EnumDyeColor; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.client.core.handler.ModelHandler; + +import javax.annotation.Nonnull; +import java.util.List; public class Item16Colors extends ItemMod { public Item16Colors(String name) { - super(); + super(name); setHasSubtypes(true); - setUnlocalizedName(name); } @Override - public int getColorFromItemStack(ItemStack par1ItemStack, int par2) { - if(par1ItemStack.getItemDamage() >= EntitySheep.fleeceColorTable.length) - return 0xFFFFFF; - - float[] color = EntitySheep.fleeceColorTable[par1ItemStack.getItemDamage()]; - return new Color(color[0], color[1], color[2]).getRGB(); - } - - @Override - public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) { + @SideOnly(Side.CLIENT) + public void getSubItems(@Nonnull Item item, CreativeTabs tab, List stacks) { for(int i = 0; i < 16; i++) - par3List.add(new ItemStack(item, 1, i)); + stacks.add(new ItemStack(item, 1, i)); } + @Nonnull @Override public String getUnlocalizedName(ItemStack par1ItemStack) { return getUnlocalizedNameLazy(par1ItemStack) + par1ItemStack.getItemDamage(); } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerItemAllMeta(this, EnumDyeColor.values().length); + } + String getUnlocalizedNameLazy(ItemStack par1ItemStack) { return super.getUnlocalizedName(par1ItemStack); } diff --git a/src/main/java/vazkii/botania/common/item/ItemAncientWill.java b/src/main/java/vazkii/botania/common/item/ItemAncientWill.java index 5001267df..8a9a6b710 100644 --- a/src/main/java/vazkii/botania/common/item/ItemAncientWill.java +++ b/src/main/java/vazkii/botania/common/item/ItemAncientWill.java @@ -10,30 +10,29 @@ */ package vazkii.botania.common.item; -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.resources.I18n; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.oredict.RecipeSorter; import net.minecraftforge.oredict.RecipeSorter.Category; -import vazkii.botania.client.core.helper.IconHelper; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.crafting.recipe.AncientWillRecipe; import vazkii.botania.common.lib.LibItemNames; -import cpw.mods.fml.common.registry.GameRegistry; + +import javax.annotation.Nonnull; +import java.util.List; public class ItemAncientWill extends ItemMod { private static final int SUBTYPES = 6; - IIcon[] icons; - public ItemAncientWill() { - setUnlocalizedName(LibItemNames.ANCIENT_WILL); + super(LibItemNames.ANCIENT_WILL); setHasSubtypes(true); setMaxStackSize(1); @@ -42,37 +41,33 @@ public class ItemAncientWill extends ItemMod { } @Override - public void getSubItems(Item item, CreativeTabs tab, List list) { + @SideOnly(Side.CLIENT) + public void getSubItems(@Nonnull Item item, CreativeTabs tab, List list) { for(int i = 0; i < SUBTYPES; i++) list.add(new ItemStack(item, 1, i)); } + @SideOnly(Side.CLIENT) @Override - public void registerIcons(IIconRegister par1IconRegister) { - icons = new IIcon[SUBTYPES]; - for(int i = 0; i < icons.length; i++) - icons[i] = IconHelper.forItem(par1IconRegister, this, i); - } - - @Override - public IIcon getIconFromDamage(int dmg) { - return icons[Math.min(icons.length - 1, dmg)]; - } - - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean adv) { - addStringToTooltip(StatCollector.translateToLocal("botaniamisc.craftToAddWill"), list); - addStringToTooltip(StatCollector.translateToLocal("botania.armorset.will" + stack.getItemDamage() + ".shortDesc"), list); + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean adv) { + addStringToTooltip(I18n.format("botaniamisc.craftToAddWill"), list); + addStringToTooltip(I18n.format("botania.armorset.will" + stack.getItemDamage() + ".shortDesc"), list); } public void addStringToTooltip(String s, List tooltip) { tooltip.add(s.replaceAll("&", "\u00a7")); } + @Nonnull @Override public String getUnlocalizedName(ItemStack par1ItemStack) { return super.getUnlocalizedName(par1ItemStack) + par1ItemStack.getItemDamage(); } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerItemAppendMeta(this, 6, LibItemNames.ANCIENT_WILL); + } } diff --git a/src/main/java/vazkii/botania/common/item/ItemAutocraftingHalo.java b/src/main/java/vazkii/botania/common/item/ItemAutocraftingHalo.java index abafbe8c7..b84491605 100644 --- a/src/main/java/vazkii/botania/common/item/ItemAutocraftingHalo.java +++ b/src/main/java/vazkii/botania/common/item/ItemAutocraftingHalo.java @@ -16,6 +16,7 @@ import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; +import net.minecraftforge.items.IItemHandler; import vazkii.botania.client.lib.LibResources; import vazkii.botania.common.lib.LibItemNames; @@ -33,7 +34,7 @@ public class ItemAutocraftingHalo extends ItemCraftingHalo { if(entity instanceof EntityPlayer && !equipped) { EntityPlayer player = (EntityPlayer) entity; - IInventory inv = getFakeInv(player); + IItemHandler inv = getFakeInv(player); for(int i = 1; i < SEGMENTS; i++) tryCraft(player, stack, i, false, inv, false); diff --git a/src/main/java/vazkii/botania/common/item/ItemBaubleBox.java b/src/main/java/vazkii/botania/common/item/ItemBaubleBox.java index 925627a2a..ab0349f05 100644 --- a/src/main/java/vazkii/botania/common/item/ItemBaubleBox.java +++ b/src/main/java/vazkii/botania/common/item/ItemBaubleBox.java @@ -10,57 +10,106 @@ */ package vazkii.botania.common.item; +import baubles.api.IBauble; +import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTBase; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; import net.minecraft.world.World; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.capabilities.ICapabilityProvider; +import net.minecraftforge.common.capabilities.ICapabilitySerializable; +import net.minecraftforge.common.util.Constants; +import net.minecraftforge.items.CapabilityItemHandler; +import net.minecraftforge.items.IItemHandler; +import net.minecraftforge.items.ItemStackHandler; +import vazkii.botania.api.mana.IManaItem; import vazkii.botania.common.Botania; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.lib.LibGuiIDs; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + public class ItemBaubleBox extends ItemMod { private static final String TAG_ITEMS = "InvItems"; - private static final String TAG_SLOT = "Slot"; public ItemBaubleBox() { - setUnlocalizedName(LibItemNames.BAUBLE_BOX); + super(LibItemNames.BAUBLE_BOX); setMaxStackSize(1); } + @Nonnull @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { - player.openGui(Botania.instance, LibGuiIDs.BAUBLE_BOX, world, 0, 0, 0); - return stack; + public ICapabilityProvider initCapabilities(ItemStack stack, NBTTagCompound oldCapNbt) { + return new InvProvider(); } + private static class InvProvider implements ICapabilitySerializable { - public static ItemStack[] loadStacks(ItemStack stack) { - NBTTagList var2 = ItemNBTHelper.getList(stack, TAG_ITEMS, 10, false); - ItemStack[] inventorySlots = new ItemStack[36]; - for(int var3 = 0; var3 < var2.tagCount(); ++var3) { - NBTTagCompound var4 = var2.getCompoundTagAt(var3); - byte var5 = var4.getByte(TAG_SLOT); - if(var5 >= 0 && var5 < inventorySlots.length) - inventorySlots[var5] = ItemStack.loadItemStackFromNBT(var4); + private final IItemHandler inv = new ItemStackHandler(24) { + @Override + public ItemStack insertItem(int slot, ItemStack toInsert, boolean simulate) { + if(toInsert != null && + (toInsert.getItem() instanceof IManaItem + || toInsert.getItem() instanceof IBauble)) + return super.insertItem(slot, toInsert, simulate); + else return toInsert; + } + }; + + @Override + public boolean hasCapability(Capability capability, @Nullable EnumFacing facing) { + return capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY; } - return inventorySlots; + @Override + public T getCapability(Capability capability, @Nullable EnumFacing facing) { + if(capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) + return CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.cast(inv); + else return null; + } + + @Override + public NBTBase serializeNBT() { + return CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.writeNBT(inv, null); + } + + @Override + public void deserializeNBT(NBTBase nbt) { + CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.readNBT(inv, null, nbt); + } } - public static void setStacks(ItemStack stack, ItemStack[] inventorySlots) { - NBTTagList var2 = new NBTTagList(); - for(int var3 = 0; var3 < inventorySlots.length; ++var3) - if(inventorySlots[var3] != null) { - NBTTagCompound var4 = new NBTTagCompound(); - var4.setByte(TAG_SLOT, (byte)var3); - inventorySlots[var3].writeToNBT(var4); - var2.appendTag(var4); - } + @Override + public void onUpdate(ItemStack stack, World world, Entity entity, int slot, boolean selected) { + if(stack.getTagCompound() != null && stack.getTagCompound().hasKey(TAG_ITEMS)) { + NBTTagList oldData = stack.getTagCompound().getTagList(TAG_ITEMS, Constants.NBT.TAG_COMPOUND); + IItemHandler newInv = stack.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null); - ItemNBTHelper.setList(stack, TAG_ITEMS, var2); + CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.readNBT(newInv, null, oldData); + + stack.getTagCompound().removeTag(TAG_ITEMS); + + if(stack.getTagCompound().getSize() == 0) + stack.setTagCompound(null); + } + } + + @Nonnull + @Override + public ActionResult onItemRightClick(@Nonnull ItemStack stack, World world, EntityPlayer player, EnumHand hand) { + player.openGui(Botania.instance, LibGuiIDs.BAUBLE_BOX, world, hand == EnumHand.OFF_HAND ? 1 : 0, 0, 0); + return ActionResult.newResult(EnumActionResult.SUCCESS, stack); } } diff --git a/src/main/java/vazkii/botania/common/item/ItemBlackHoleTalisman.java b/src/main/java/vazkii/botania/common/item/ItemBlackHoleTalisman.java index 98cd2cd1c..98ab43385 100644 --- a/src/main/java/vazkii/botania/common/item/ItemBlackHoleTalisman.java +++ b/src/main/java/vazkii/botania/common/item/ItemBlackHoleTalisman.java @@ -2,46 +2,55 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + * * Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php - * + * * File Created @ [Mar 31, 2015, 11:04:12 PM (GMT)] */ package vazkii.botania.common.item; -import java.util.Arrays; -import java.util.List; - import net.minecraft.block.Block; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.resources.I18n; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; +import net.minecraft.init.SoundEvents; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import net.minecraftforge.items.CapabilityItemHandler; +import net.minecraftforge.items.IItemHandler; +import net.minecraftforge.items.ItemHandlerHelper; import net.minecraftforge.oredict.RecipeSorter; import net.minecraftforge.oredict.RecipeSorter.Category; import vazkii.botania.api.item.IBlockProvider; import vazkii.botania.client.core.handler.ItemsRemainingRenderHandler; -import vazkii.botania.client.core.helper.IconHelper; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.core.helper.InventoryHelper; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.crafting.recipe.BlackHoleTalismanExtractRecipe; import vazkii.botania.common.lib.LibItemNames; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import javax.annotation.Nonnull; +import java.util.Arrays; +import java.util.List; public class ItemBlackHoleTalisman extends ItemMod implements IBlockProvider { @@ -49,10 +58,8 @@ public class ItemBlackHoleTalisman extends ItemMod implements IBlockProvider { private static final String TAG_BLOCK_META = "blockMeta"; private static final String TAG_BLOCK_COUNT = "blockCount"; - IIcon enabledIcon; - public ItemBlackHoleTalisman() { - setUnlocalizedName(LibItemNames.BLACK_HOLE_TALISMAN); + super(LibItemNames.BLACK_HOLE_TALISMAN); setMaxStackSize(1); setHasSubtypes(true); @@ -60,85 +67,71 @@ public class ItemBlackHoleTalisman extends ItemMod implements IBlockProvider { RecipeSorter.register("botania:blackHoleTalismanExtract", BlackHoleTalismanExtractRecipe.class, Category.SHAPELESS, ""); } + @Nonnull @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if(getBlock(par1ItemStack) != Blocks.air && par3EntityPlayer.isSneaking()) { - int dmg = par1ItemStack.getItemDamage(); - par1ItemStack.setItemDamage(~dmg & 1); - par2World.playSoundAtEntity(par3EntityPlayer, "random.orb", 0.3F, 0.1F); + public ActionResult onItemRightClick(@Nonnull ItemStack stack, World world, EntityPlayer player, EnumHand hand) { + if(getBlock(stack) != Blocks.AIR && player.isSneaking()) { + int dmg = stack.getItemDamage(); + stack.setItemDamage(~dmg & 1); + player.playSound(SoundEvents.ENTITY_EXPERIENCE_ORB_PICKUP, 0.3F, 0.1F); + return ActionResult.newResult(EnumActionResult.SUCCESS, stack); } - return par1ItemStack; + return ActionResult.newResult(EnumActionResult.PASS, stack); } + @Nonnull @Override - public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { - Block block = par3World.getBlock(par4, par5, par6); - int meta = par3World.getBlockMetadata(par4, par5, par6); - boolean set = setBlock(par1ItemStack, block, meta); + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) { + IBlockState state = world.getBlockState(pos); - if(!set) { - Block bBlock = getBlock(par1ItemStack); - int bmeta = getBlockMeta(par1ItemStack); + if (Item.getItemFromBlock(state.getBlock()) != null + && setBlock(stack, state.getBlock(), state.getBlock().getMetaFromState(state))) { + return EnumActionResult.SUCCESS; + } else { + Block bBlock = getBlock(stack); + int bmeta = getBlockMeta(stack); - TileEntity tile = par3World.getTileEntity(par4, par5, par6); - if(tile != null && tile instanceof IInventory) { - IInventory inv = (IInventory) tile; - int[] slots = inv instanceof ISidedInventory ? ((ISidedInventory) inv).getAccessibleSlotsFromSide(par7) : InventoryHelper.buildSlotsForLinearInventory(inv); - for(int slot : slots) { - ItemStack stackInSlot = inv.getStackInSlot(slot); - if(stackInSlot == null) { - ItemStack stack = new ItemStack(bBlock, 1, bmeta); - int maxSize = stack.getMaxStackSize(); - stack.stackSize = remove(par1ItemStack, maxSize); - if(stack.stackSize != 0) { - if(inv.isItemValidForSlot(slot, stack) && (!(inv instanceof ISidedInventory) || ((ISidedInventory) inv).canInsertItem(slot, stack, par7))) { - inv.setInventorySlotContents(slot, stack); - inv.markDirty(); - set = true; - } - } - } else if(stackInSlot.getItem() == Item.getItemFromBlock(bBlock) && stackInSlot.getItemDamage() == bmeta) { - int maxSize = stackInSlot.getMaxStackSize(); - int missing = maxSize - stackInSlot.stackSize; - if(inv.isItemValidForSlot(slot, stackInSlot) && (!(inv instanceof ISidedInventory) || ((ISidedInventory) inv).canInsertItem(slot, stackInSlot, par7))) { - stackInSlot.stackSize += remove(par1ItemStack, missing); - inv.markDirty(); - set = true; - } - } + if(bBlock == null) + return EnumActionResult.PASS; + + TileEntity tile = world.getTileEntity(pos); + if(tile != null && tile.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, side)) { + if(!world.isRemote) { + IItemHandler inv = tile.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, side); + ItemStack toAdd = new ItemStack(bBlock, 1, bmeta); + int maxSize = toAdd.getMaxStackSize(); + toAdd.stackSize = remove(stack, maxSize); + ItemStack remainder = ItemHandlerHelper.insertItemStacked(inv, toAdd, false); + if(remainder != null) + add(stack, remainder.stackSize); } + return EnumActionResult.SUCCESS; } else { - ForgeDirection dir = ForgeDirection.getOrientation(par7); - int entities = par3World.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(par4 + dir.offsetX, par5 + dir.offsetY, par6 + dir.offsetZ, par4 + dir.offsetX + 1, par5 + dir.offsetY + 1, par6 + dir.offsetZ + 1)).size(); + if(player.capabilities.isCreativeMode || getBlockCount(stack) > 0) { + ItemStack toUse = new ItemStack(bBlock, 1, bmeta); - if(entities == 0) { - int remove = par2EntityPlayer.capabilities.isCreativeMode ? 1 : remove(par1ItemStack, 1); - if(remove > 0) { - ItemStack stack = new ItemStack(bBlock, 1, bmeta); - ItemsRemainingRenderHandler.set(stack, getBlockCount(par1ItemStack)); - - Item.getItemFromBlock(bBlock).onItemUse(stack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10); - set = true; + if (Item.getItemFromBlock(bBlock).onItemUse(toUse, player, world, pos, hand, side, hitX, hitY, hitZ) == EnumActionResult.SUCCESS) { + remove(stack, 1); + ItemsRemainingRenderHandler.set(toUse, getBlockCount(stack)); + return EnumActionResult.SUCCESS; } } } } - par2EntityPlayer.setCurrentItemOrArmor(0, par1ItemStack); - return set; + return EnumActionResult.PASS; } @Override - public void onUpdate(ItemStack itemstack, World p_77663_2_, Entity entity, int p_77663_4_, boolean p_77663_5_) { + public void onUpdate(ItemStack itemstack, World world, Entity entity, int slot, boolean selected) { Block block = getBlock(itemstack); - if(!entity.worldObj.isRemote && itemstack.getItemDamage() == 1 && block != Blocks.air && entity instanceof EntityPlayer) { + if(!entity.worldObj.isRemote && itemstack.getItemDamage() == 1 && block != Blocks.AIR && entity instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) entity; int meta = getBlockMeta(itemstack); int highest = -1; int[] counts = new int[player.inventory.getSizeInventory() - player.inventory.armorInventory.length]; - Arrays.fill(counts, 0); for(int i = 0; i < counts.length; i++) { ItemStack stack = player.inventory.getStackInSlot(i); @@ -186,17 +179,19 @@ public class ItemBlackHoleTalisman extends ItemMod implements IBlockProvider { } } + @Nonnull @Override - public String getItemStackDisplayName(ItemStack par1ItemStack) { + public String getItemStackDisplayName(@Nonnull ItemStack par1ItemStack) { Block block = getBlock(par1ItemStack); int meta = getBlockMeta(par1ItemStack); ItemStack stack = new ItemStack(block, 1, meta); - return super.getItemStackDisplayName(par1ItemStack) + (stack == null || stack.getItem() == null ? "" : " (" + EnumChatFormatting.GREEN + stack.getDisplayName() + EnumChatFormatting.RESET + ")"); + return super.getItemStackDisplayName(par1ItemStack) + (stack == null || stack.getItem() == null ? "" : " (" + TextFormatting.GREEN + stack.getDisplayName() + TextFormatting.RESET + ")"); } + @Nonnull @Override - public ItemStack getContainerItem(ItemStack itemStack) { + public ItemStack getContainerItem(@Nonnull ItemStack itemStack) { int count = getBlockCount(itemStack); if(count == 0) return null; @@ -217,14 +212,9 @@ public class ItemBlackHoleTalisman extends ItemMod implements IBlockProvider { return getContainerItem(stack) != null; } - @Override - public boolean doesContainerItemLeaveCraftingGrid(ItemStack p_77630_1_) { - return false; - } - private boolean setBlock(ItemStack stack, Block block, int meta) { - if(getBlock(stack) == Blocks.air || getBlockCount(stack) == 0) { - ItemNBTHelper.setString(stack, TAG_BLOCK_NAME, Block.blockRegistry.getNameForObject(block)); + if(Item.getItemFromBlock(block) != null && (getBlock(stack) == Blocks.AIR || getBlockCount(stack) == 0)) { + ItemNBTHelper.setString(stack, TAG_BLOCK_NAME, Block.REGISTRY.getNameForObject(block).toString()); ItemNBTHelper.setInt(stack, TAG_BLOCK_META, meta); return true; } @@ -238,29 +228,16 @@ public class ItemBlackHoleTalisman extends ItemMod implements IBlockProvider { @Override @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) { - itemIcon = IconHelper.forItem(par1IconRegister, this, 0); - enabledIcon = IconHelper.forItem(par1IconRegister, this, 1); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamage(int par1) { - return par1 == 1 ? enabledIcon : itemIcon; - } - - @Override - @SideOnly(Side.CLIENT) - public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { + public void addInformation(ItemStack par1ItemStack, EntityPlayer player, List stacks, boolean par4) { Block block = getBlock(par1ItemStack); - if(block != null && block != Blocks.air) { + if(block != null && block != Blocks.AIR) { int count = getBlockCount(par1ItemStack); - par3List.add(count + " " + StatCollector.translateToLocal(new ItemStack(block, 1, getBlockMeta(par1ItemStack)).getUnlocalizedName() + ".name")); + stacks.add(count + " " + I18n.format(new ItemStack(block, 1, getBlockMeta(par1ItemStack)).getUnlocalizedName() + ".name")); } if(par1ItemStack.getItemDamage() == 1) - addStringToTooltip(StatCollector.translateToLocal("botaniamisc.active"), par3List); - else addStringToTooltip(StatCollector.translateToLocal("botaniamisc.inactive"), par3List); + addStringToTooltip(I18n.format("botaniamisc.active"), stacks); + else addStringToTooltip(I18n.format("botaniamisc.inactive"), stacks); } void addStringToTooltip(String s, List tooltip) { @@ -283,8 +260,7 @@ public class ItemBlackHoleTalisman extends ItemMod implements IBlockProvider { } public static Block getBlock(ItemStack stack) { - Block block = Block.getBlockFromName(getBlockName(stack)); - return block; + return Block.getBlockFromName(getBlockName(stack)); } public static int getBlockMeta(ItemStack stack) { @@ -320,4 +296,10 @@ public class ItemBlackHoleTalisman extends ItemMod implements IBlockProvider { return 0; } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerItemAppendMeta(this, 2, LibItemNames.BLACK_HOLE_TALISMAN); + } + } diff --git a/src/main/java/vazkii/botania/common/item/ItemBlackLotus.java b/src/main/java/vazkii/botania/common/item/ItemBlackLotus.java index 69002fd3d..8a62d69b1 100644 --- a/src/main/java/vazkii/botania/common/item/ItemBlackLotus.java +++ b/src/main/java/vazkii/botania/common/item/ItemBlackLotus.java @@ -10,20 +10,26 @@ */ package vazkii.botania.common.item; -import java.util.List; - +import net.minecraft.client.resources.I18n; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.StatCollector; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.internal.VanillaPacketDispatcher; import vazkii.botania.api.item.IManaDissolvable; import vazkii.botania.api.mana.IManaPool; -import vazkii.botania.common.Botania; +import vazkii.botania.api.sound.BotaniaSoundEvents; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.lib.LibItemNames; +import vazkii.botania.common.network.PacketBotaniaEffect; +import vazkii.botania.common.network.PacketHandler; + +import javax.annotation.Nonnull; +import java.util.List; public class ItemBlackLotus extends ItemMod implements IManaDissolvable { @@ -31,21 +37,23 @@ public class ItemBlackLotus extends ItemMod implements IManaDissolvable { private static final int MANA_PER_T2 = 100000; public ItemBlackLotus() { - setUnlocalizedName(LibItemNames.BLACK_LOTUS); + super(LibItemNames.BLACK_LOTUS); setHasSubtypes(true); } @Override - public void getSubItems(Item item, CreativeTabs tab, List list) { + @SideOnly(Side.CLIENT) + public void getSubItems(@Nonnull Item item, CreativeTabs tab, List list) { for(int i = 0; i < 2; i++) list.add(new ItemStack(item, 1, i)); } @Override - public boolean hasEffect(ItemStack par1ItemStack, int pass) { + public boolean hasEffect(ItemStack par1ItemStack) { return par1ItemStack.getItemDamage() > 0; } + @Nonnull @Override public String getUnlocalizedName(ItemStack par1ItemStack) { return super.getUnlocalizedName(par1ItemStack) + par1ItemStack.getItemDamage(); @@ -62,28 +70,23 @@ public class ItemBlackLotus extends ItemMod implements IManaDissolvable { if(!item.worldObj.isRemote) { pool.recieveMana(t2 ? MANA_PER_T2 : MANA_PER); stack.stackSize--; - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(item.worldObj, tile.xCoord, tile.yCoord, tile.zCoord); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(item.worldObj, tile.getPos()); } - for(int i = 0; i < 50; i++) { - float r = (float) Math.random() * 0.25F; - float g = 0F; - float b = (float) Math.random() * 0.25F; - float s = 0.45F * (float) Math.random() * 0.25F; - - float m = 0.045F; - float mx = ((float) Math.random() - 0.5F) * m; - float my = (float) Math.random() * m; - float mz = ((float) Math.random() - 0.5F) * m; - - Botania.proxy.wispFX(item.worldObj, item.posX, tile.yCoord + 0.5F, item.posZ, r, g, b, s, mx, my, mz); - } - item.worldObj.playSoundAtEntity(item, "botania:blackLotus", 0.5F, t2 ? 0.1F : 1F); + PacketHandler.sendToNearby(item.worldObj, item, new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.BLACK_LOTUS_DISSOLVE, item.posX, tile.getPos().getY() + 0.5, item.posZ)); + item.playSound(BotaniaSoundEvents.blackLotus, 0.5F, t2 ? 0.1F : 1F); } + @SideOnly(Side.CLIENT) @Override - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean adv) { - list.add(StatCollector.translateToLocal("botaniamisc.lotusDesc")); + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean adv) { + list.add(I18n.format("botaniamisc.lotusDesc")); + } + + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerItemAppendMeta(this, 2, LibItemNames.BLACK_LOTUS); } } diff --git a/src/main/java/vazkii/botania/common/item/ItemBottledMana.java b/src/main/java/vazkii/botania/common/item/ItemBottledMana.java index a2bec1876..534a5d7ca 100644 --- a/src/main/java/vazkii/botania/common/item/ItemBottledMana.java +++ b/src/main/java/vazkii/botania/common/item/ItemBottledMana.java @@ -2,122 +2,130 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + * * Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php - * + * * File Created @ [Jun 27, 2014, 2:41:19 AM (GMT)] */ package vazkii.botania.common.item; -import java.util.List; -import java.util.Random; - import net.minecraft.block.Block; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.resources.I18n; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.init.Items; +import net.minecraft.init.MobEffects; +import net.minecraft.init.SoundEvents; import net.minecraft.item.EnumAction; import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ActionResult; import net.minecraft.util.DamageSource; -import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; -import net.minecraft.util.StatCollector; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; -import vazkii.botania.client.core.helper.IconHelper; +import net.minecraftforge.fml.common.FMLCommonHandler; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.entity.EntityPixie; import vazkii.botania.common.entity.EntitySignalFlare; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; +import java.util.List; +import java.util.Random; + public class ItemBottledMana extends ItemMod { - IIcon[] icons; private static final String TAG_SEED = "randomSeed"; public ItemBottledMana() { - setUnlocalizedName(LibItemNames.MANA_BOTTLE); + super(LibItemNames.MANA_BOTTLE); setMaxStackSize(1); setMaxDamage(6); } - public void effect(EntityPlayer player, int id) { + public void effect(ItemStack stack, EntityLivingBase living, int id) { switch(id) { case 0 : { // Random motion - player.motionX = (Math.random() - 0.5) * 3; - player.motionZ = (Math.random() - 0.5) * 3; + living.motionX = (Math.random() - 0.5) * 3; + living.motionZ = (Math.random() - 0.5) * 3; break; } case 1 : { // Water - if(!player.worldObj.isRemote && !player.worldObj.provider.isHellWorld) - player.worldObj.setBlock(MathHelper.floor_double(player.posX), MathHelper.floor_double(player.posY), MathHelper.floor_double(player.posZ), Blocks.flowing_water); + if(!living.worldObj.isRemote && !living.worldObj.provider.doesWaterVaporize()) + living.worldObj.setBlockState(new BlockPos(living), Blocks.FLOWING_WATER.getDefaultState()); break; } case 2 : { // Set on Fire - if(!player.worldObj.isRemote) - player.setFire(4); + if(!living.worldObj.isRemote) + living.setFire(4); break; } case 3 : { // Mini Explosion - if(!player.worldObj.isRemote) - player.worldObj.createExplosion(null, player.posX, player.posY, player.posZ, 0.25F, false); + if(!living.worldObj.isRemote) + living.worldObj.createExplosion(null, living.posX, living.posY, living.posZ, 0.25F, false); break; } case 4 : { // Mega Jump - if(!player.worldObj.provider.isHellWorld) { - if(!player.worldObj.isRemote) - player.addPotionEffect(new PotionEffect(Potion.resistance.id, 300, 5)); - player.motionY = 6; + if(!living.worldObj.provider.doesWaterVaporize()) { + if(!living.worldObj.isRemote) + living.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 300, 5)); + living.motionY = 6; } break; } case 5 : { // Randomly set HP - if(!player.worldObj.isRemote) - player.setHealth(player.worldObj.rand.nextInt(19) + 1); + if(!living.worldObj.isRemote) + living.setHealth(living.worldObj.rand.nextInt(19) + 1); break; } case 6 : { // Lots O' Hearts - if(!player.worldObj.isRemote) - player.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 20 * 60 * 2, 9)); + if(!living.worldObj.isRemote) + living.addPotionEffect(new PotionEffect(MobEffects.ABSORPTION, 20 * 60 * 2, 9)); break; } case 7 : { // All your inventory is belong to us - if(!player.worldObj.isRemote) - for(int i = 0; i < player.inventory.getSizeInventory(); i++) - if(i != player.inventory.currentItem) { - ItemStack stackAt = player.inventory.getStackInSlot(i); + if(!living.worldObj.isRemote && living instanceof EntityPlayer) { + EntityPlayer player = ((EntityPlayer) living); + for(int i = 0; i < player.inventory.getSizeInventory(); i++) { + ItemStack stackAt = player.inventory.getStackInSlot(i); + if(stackAt != stack) { if(stackAt != null) - player.dropPlayerItemWithRandomChoice(stackAt, true); + player.entityDropItem(stackAt, 0); player.inventory.setInventorySlotContents(i, null); } + } + } break; } case 8 : { // Break your neck - player.rotationPitch = (float) Math.random() * 360F; - player.rotationYaw = (float) Math.random() * 180F; + living.rotationPitch = (float) Math.random() * 360F; + living.rotationYaw = (float) Math.random() * 180F; break; } case 9 : { // Highest Possible - int x = MathHelper.floor_double(player.posX); - MathHelper.floor_double(player.posY); - int z = MathHelper.floor_double(player.posZ); + int x = MathHelper.floor_double(living.posX); + MathHelper.floor_double(living.posY); + int z = MathHelper.floor_double(living.posZ); for(int i = 256; i > 0; i--) { - Block block = player.worldObj.getBlock(x, i, z); - if(!block.isAir(player.worldObj, x, i, z)) { - if(player instanceof EntityPlayerMP) { - EntityPlayerMP mp = (EntityPlayerMP) player; - mp.playerNetServerHandler.setPlayerLocation(player.posX, i + 1.6, player.posZ, player.rotationYaw, player.rotationPitch); + Block block = living.worldObj.getBlockState(new BlockPos(x, i, z)).getBlock(); + if(!block.isAir(living.worldObj.getBlockState(new BlockPos(x, i, z)), living.worldObj, new BlockPos(x, i, z))) { + if(living instanceof EntityPlayerMP) { + EntityPlayerMP mp = (EntityPlayerMP) living; + mp.connection.setPlayerLocation(living.posX, i + 1.6, living.posZ, living.rotationYaw, living.rotationPitch); } break; } @@ -126,55 +134,55 @@ public class ItemBottledMana extends ItemMod { break; } case 10 : { // HYPERSPEEEEEED - if(!player.worldObj.isRemote) - player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 60, 200)); + if(!living.worldObj.isRemote) + living.addPotionEffect(new PotionEffect(MobEffects.SPEED, 60, 200)); break; } case 11 : { // Night Vision - if(!player.worldObj.isRemote) - player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 6000, 0)); + if(!living.worldObj.isRemote) + living.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, 6000, 0)); break; } case 12 : { // Flare - if(!player.worldObj.isRemote) { - EntitySignalFlare flare = new EntitySignalFlare(player.worldObj); - flare.setPosition(player.posX, player.posY, player.posZ); - flare.setColor(player.worldObj.rand.nextInt(16)); - player.worldObj.playSoundAtEntity(player, "random.explode", 40F, (1.0F + (player.worldObj.rand.nextFloat() - player.worldObj.rand.nextFloat()) * 0.2F) * 0.7F); + if(!living.worldObj.isRemote) { + EntitySignalFlare flare = new EntitySignalFlare(living.worldObj); + flare.setPosition(living.posX, living.posY, living.posZ); + flare.setColor(living.worldObj.rand.nextInt(16)); + flare.playSound(SoundEvents.ENTITY_GENERIC_EXPLODE, 40F, (1.0F + (living.worldObj.rand.nextFloat() - living.worldObj.rand.nextFloat()) * 0.2F) * 0.7F); - player.worldObj.spawnEntityInWorld(flare); + living.worldObj.spawnEntityInWorld(flare); int range = 5; - List entities = player.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(player.posX - range, player.posY - range, player.posZ - range, player.posX + range, player.posY + range, player.posZ + range)); + List entities = living.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(living.posX - range, living.posY - range, living.posZ - range, living.posX + range, living.posY + range, living.posZ + range)); for(EntityLivingBase entity : entities) - if(entity != player && (!(entity instanceof EntityPlayer) || MinecraftServer.getServer() == null || MinecraftServer.getServer().isPVPEnabled())) - entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 50, 5)); + if(entity != living && (!(entity instanceof EntityPlayer) || FMLCommonHandler.instance().getMinecraftServerInstance() == null || FMLCommonHandler.instance().getMinecraftServerInstance().isPVPEnabled())) + entity.addPotionEffect(new PotionEffect(MobEffects.SLOWNESS, 50, 5)); } break; } case 13 : { // Pixie Friend - if(!player.worldObj.isRemote) { - EntityPixie pixie = new EntityPixie(player.worldObj); - pixie.setPosition(player.posX, player.posY + 1.5, player.posZ); - player.worldObj.spawnEntityInWorld(pixie); + if(!living.worldObj.isRemote) { + EntityPixie pixie = new EntityPixie(living.worldObj); + pixie.setPosition(living.posX, living.posY + 1.5, living.posZ); + living.worldObj.spawnEntityInWorld(pixie); } break; } case 14 : { // Nausea + Blindness :3 - if(!player.worldObj.isRemote) { - player.addPotionEffect(new PotionEffect(Potion.confusion.id, 160, 3)); - player.addPotionEffect(new PotionEffect(Potion.blindness.id, 160, 0)); + if(!living.worldObj.isRemote) { + living.addPotionEffect(new PotionEffect(MobEffects.NAUSEA, 160, 3)); + living.addPotionEffect(new PotionEffect(MobEffects.BLINDNESS, 160, 0)); } break; } case 15 : { // Drop own Head - if(!player.worldObj.isRemote) { - player.attackEntityFrom(DamageSource.magic, player.getHealth() - 1); - ItemStack stack = new ItemStack(Items.skull, 1, 3); - ItemNBTHelper.setString(stack, "SkullOwner", player.getCommandSenderName()); - player.dropPlayerItemWithRandomChoice(stack, true); + if(!living.worldObj.isRemote && living instanceof EntityPlayer) { + living.attackEntityFrom(DamageSource.magic, living.getHealth() - 1); + ItemStack skull = new ItemStack(Items.SKULL, 1, 3); + ItemNBTHelper.setString(skull, "SkullOwner", living.getName()); + living.entityDropItem(skull, 0); } break; } @@ -182,58 +190,46 @@ public class ItemBottledMana extends ItemMod { } @Override - public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) { - getSeed(par1ItemStack); + public void onUpdate(ItemStack par1ItemStack, World world, Entity par3Entity, int par4, boolean par5) {} + + private void randomEffect(EntityLivingBase player, ItemStack stack) { + effect(stack, player, new Random(getSeed(stack)).nextInt(16)); } - public void randomEffect(EntityPlayer player, ItemStack stack) { - effect(player, new Random(getSeed(stack)).nextInt(16)); - } - - long getSeed(ItemStack stack) { + private long getSeed(ItemStack stack) { long seed = ItemNBTHelper.getLong(stack, TAG_SEED, -1); if(seed == -1) return randomSeed(stack); return seed; } - long randomSeed(ItemStack stack) { + private long randomSeed(ItemStack stack) { long seed = Math.abs(itemRand.nextLong()); ItemNBTHelper.setLong(stack, TAG_SEED, seed); return seed; } + @SideOnly(Side.CLIENT) @Override - public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { - par3List.add(StatCollector.translateToLocal("botaniamisc.bottleTooltip")); + public void addInformation(ItemStack par1ItemStack, EntityPlayer player, List stacks, boolean par4) { + stacks.add(I18n.format("botaniamisc.bottleTooltip")); + } + + @Nonnull + @Override + public ActionResult onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) { + player.setActiveHand(hand); + return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack); } @Override - public void registerIcons(IIconRegister par1IconRegister) { - icons = new IIcon[6]; - for(int i = 0; i < icons.length; i++) - icons[i] = IconHelper.forItem(par1IconRegister, this, i); - } - - @Override - public IIcon getIconFromDamage(int par1) { - return icons[Math.min(icons.length - 1, par1)]; - } - - @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - par3EntityPlayer.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack)); - return par1ItemStack; - } - - @Override - public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - randomEffect(par3EntityPlayer, par1ItemStack); + public ItemStack onItemUseFinish(@Nonnull ItemStack par1ItemStack, World world, EntityLivingBase living) { + randomEffect(living, par1ItemStack); par1ItemStack.setItemDamage(par1ItemStack.getItemDamage() + 1); randomSeed(par1ItemStack); if(par1ItemStack.getItemDamage() == 6) - return new ItemStack(Items.glass_bottle); + return new ItemStack(Items.GLASS_BOTTLE); return par1ItemStack; } @@ -242,9 +238,16 @@ public class ItemBottledMana extends ItemMod { return 20; } + @Nonnull @Override public EnumAction getItemUseAction(ItemStack par1ItemStack) { - return EnumAction.drink; + return EnumAction.DRINK; + } + + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerItemAppendMeta(this, 6, LibItemNames.MANA_BOTTLE); } } diff --git a/src/main/java/vazkii/botania/common/item/ItemCacophonium.java b/src/main/java/vazkii/botania/common/item/ItemCacophonium.java index e5c52b05e..1737d3632 100644 --- a/src/main/java/vazkii/botania/common/item/ItemCacophonium.java +++ b/src/main/java/vazkii/botania/common/item/ItemCacophonium.java @@ -10,9 +10,8 @@ */ package vazkii.botania.common.item; -import java.util.List; - import net.minecraft.block.Block; +import net.minecraft.client.resources.I18n; import net.minecraft.entity.EntityList; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; @@ -20,12 +19,26 @@ import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.monster.EntitySlime; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; +import net.minecraft.init.SoundEvents; import net.minecraft.inventory.IInventory; import net.minecraft.item.EnumAction; import net.minecraft.item.ItemStack; import net.minecraft.stats.Achievement; -import net.minecraft.util.StatCollector; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.SoundEvent; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.ReflectionHelper; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import org.apache.logging.log4j.core.helpers.Strings; +import vazkii.botania.api.sound.BotaniaSoundEvents; +import vazkii.botania.common.Botania; import vazkii.botania.common.achievement.ICraftAchievement; import vazkii.botania.common.achievement.ModAchievements; import vazkii.botania.common.block.ModBlocks; @@ -33,70 +46,52 @@ import vazkii.botania.common.block.tile.TileCacophonium; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.lib.LibItemNames; import vazkii.botania.common.lib.LibObfuscation; -import cpw.mods.fml.relauncher.ReflectionHelper; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.lang.reflect.InvocationTargetException; +import java.util.List; public class ItemCacophonium extends ItemMod implements ICraftAchievement { private static final String TAG_SOUND = "sound"; private static final String TAG_SOUND_NAME = "soundName"; - private static final String TAG_HAS_SOUND = "hasSound"; public ItemCacophonium() { + super(LibItemNames.CACOPHONIUM); setMaxStackSize(1); - setUnlocalizedName(LibItemNames.CACOPHONIUM); } @Override - public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer player, EntityLivingBase entity) { + public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer player, EntityLivingBase entity, EnumHand hand) { if(entity instanceof EntityLiving) { EntityLiving living = (EntityLiving) entity; - String sound = null; - try { - if(living instanceof EntityCreeper) - sound = "creeper.primed"; - else if(living instanceof EntitySlime) - sound = "mob.slime." + (((EntitySlime) living).getSlimeSize() > 1 ? "big" : "small"); - else sound = (String) ReflectionHelper.findMethod(EntityLiving.class, living, LibObfuscation.GET_LIVING_SOUND).invoke(living); + SoundEvent sound = null; - if(sound != null) { - String s = EntityList.getEntityString(entity); - if(s == null) - s = "generic"; - - ItemNBTHelper.setString(stack, TAG_SOUND, sound); - ItemNBTHelper.setString(stack, TAG_SOUND_NAME, "entity." + s + ".name"); - ItemNBTHelper.setBoolean(stack, TAG_HAS_SOUND, true); - player.inventory.setInventorySlotContents(player.inventory.currentItem, stack.copy()); - - if(player.worldObj.isRemote) - player.swingItem(); - - return true; + if(living instanceof EntityCreeper) + sound = SoundEvents.ENTITY_CREEPER_PRIMED; + else if(living instanceof EntitySlime) + sound = ((EntitySlime) living).isSmallSlime() ? SoundEvents.ENTITY_SMALL_SLIME_SQUISH : SoundEvents.ENTITY_SLIME_SQUISH; + else { + try { + sound = (SoundEvent) ReflectionHelper.findMethod(EntityLiving.class, living, LibObfuscation.GET_LIVING_SOUND).invoke(living); + } catch (InvocationTargetException | IllegalAccessException ignored) { + Botania.LOGGER.debug("Couldn't get living sound"); } - } catch (Exception e) { - e.printStackTrace(); } - } - return false; - } + if(sound != null) { + String s = EntityList.getEntityString(entity); + if(s == null) + s = "generic"; - @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int s, float xs, float ys, float zs) { - boolean can = isDOIT(stack); - if(!can) { - String sound = ItemNBTHelper.getString(stack, TAG_SOUND, ""); - isDOIT(stack); - if(sound != null && !sound.isEmpty()) - can = true; - } + ItemNBTHelper.setString(stack, TAG_SOUND, sound.getRegistryName().toString()); + ItemNBTHelper.setString(stack, TAG_SOUND_NAME, "entity." + s + ".name"); + player.setHeldItem(hand, stack); + + if(player.worldObj.isRemote) + player.swingArm(hand); - if(can) { - Block block = world.getBlock(x, y, z); - if(block == Blocks.noteblock) { - world.setBlock(x, y, z, ModBlocks.cacophonium); - ((TileCacophonium) world.getTileEntity(x, y, z)).stack = stack.copy(); - stack.stackSize--; return true; } } @@ -104,17 +99,35 @@ public class ItemCacophonium extends ItemMod implements ICraftAchievement { return false; } + @Nonnull @Override - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean adv) { - if(isDOIT(stack)) - list.add(StatCollector.translateToLocal("botaniamisc.justDoIt")); - else if(ItemNBTHelper.getBoolean(stack, TAG_HAS_SOUND, false)) - list.add(StatCollector.translateToLocal(ItemNBTHelper.getString(stack, TAG_SOUND_NAME, ""))); + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float xs, float ys, float zs) { + if(getSound(stack) != null) { + Block block = world.getBlockState(pos).getBlock(); + if(block == Blocks.NOTEBLOCK) { + world.setBlockState(pos, ModBlocks.cacophonium.getDefaultState()); + ((TileCacophonium) world.getTileEntity(pos)).stack = stack.copy(); + stack.stackSize--; + return EnumActionResult.SUCCESS; + } + } + + return EnumActionResult.PASS; } + @SideOnly(Side.CLIENT) + @Override + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean adv) { + if(isDOIT(stack)) + list.add(I18n.format("botaniamisc.justDoIt")); + else if(getSound(stack) != null) + list.add(I18n.format(ItemNBTHelper.getString(stack, TAG_SOUND_NAME, ""))); + } + + @Nonnull @Override public EnumAction getItemUseAction(ItemStack par1ItemStack) { - return EnumAction.block; + return EnumAction.BLOCK; } @Override @@ -122,30 +135,35 @@ public class ItemCacophonium extends ItemMod implements ICraftAchievement { return 72000; } + @Nonnull @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if(ItemNBTHelper.getBoolean(par1ItemStack, TAG_HAS_SOUND, false) || isDOIT(par1ItemStack)) - par3EntityPlayer.setItemInUse(par1ItemStack, 72000); - return par1ItemStack; + public ActionResult onItemRightClick(@Nonnull ItemStack stack, World world, EntityPlayer player, EnumHand hand) { + if(getSound(stack) != null) + player.setActiveHand(hand); + return ActionResult.newResult(EnumActionResult.SUCCESS, stack); } @Override - public void onUsingTick(ItemStack stack, EntityPlayer player, int count) { + public void onUsingTick(ItemStack stack, EntityLivingBase player, int count) { if(count % (isDOIT(stack) ? 20 : 6) == 0) - playSound(player.worldObj, stack, player.posX, player.posY, player.posZ, 0.9F); + playSound(player.worldObj, stack, player.posX, player.posY, player.posZ, SoundCategory.PLAYERS, 0.9F); } - public static void playSound(World world, ItemStack stack, double x, double y, double z, float volume) { + public static void playSound(World world, ItemStack stack, double x, double y, double z, SoundCategory category, float volume) { if(stack == null) return; - String sound = ItemNBTHelper.getString(stack, TAG_SOUND, ""); - boolean doit = isDOIT(stack); - if(doit) - sound = "botania:doit"; + SoundEvent sound = getSound(stack); - if(sound != null && !sound.isEmpty()) - world.playSoundEffect(x, y, z, sound, volume, doit ? 1F : (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F + 1.0F); + if(sound != null) + world.playSound(null, x, y, z, sound, category, volume, sound == BotaniaSoundEvents.doit ? 1F : (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F + 1.0F); + } + + @Nullable + private static SoundEvent getSound(ItemStack stack) { + if(isDOIT(stack)) + return BotaniaSoundEvents.doit; + else return SoundEvent.REGISTRY.getObject(new ResourceLocation(ItemNBTHelper.getString(stack, TAG_SOUND, ""))); } private static boolean isDOIT(ItemStack stack) { diff --git a/src/main/java/vazkii/botania/common/item/ItemClip.java b/src/main/java/vazkii/botania/common/item/ItemClip.java index 6f3ac2b50..b8f0e34b7 100644 --- a/src/main/java/vazkii/botania/common/item/ItemClip.java +++ b/src/main/java/vazkii/botania/common/item/ItemClip.java @@ -15,8 +15,8 @@ import vazkii.botania.common.lib.LibItemNames; public class ItemClip extends ItemMod { public ItemClip() { + super(LibItemNames.CLIP); setMaxStackSize(1); - setUnlocalizedName(LibItemNames.CLIP); } } diff --git a/src/main/java/vazkii/botania/common/item/ItemCorporeaSpark.java b/src/main/java/vazkii/botania/common/item/ItemCorporeaSpark.java index 2efd3a7e7..aa55c48a2 100644 --- a/src/main/java/vazkii/botania/common/item/ItemCorporeaSpark.java +++ b/src/main/java/vazkii/botania/common/item/ItemCorporeaSpark.java @@ -10,72 +10,71 @@ */ package vazkii.botania.common.item; -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import net.minecraftforge.items.CapabilityItemHandler; import vazkii.botania.api.corporea.CorporeaHelper; -import vazkii.botania.client.core.helper.IconHelper; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.entity.EntityCorporeaSpark; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; +import java.util.List; + public class ItemCorporeaSpark extends ItemMod { - public static IIcon invIcon, worldIcon, invIconMaster, worldIconMaster, iconColorStar; - public ItemCorporeaSpark() { - setUnlocalizedName(LibItemNames.CORPOREA_SPARK); + super(LibItemNames.CORPOREA_SPARK); setHasSubtypes(true); } @Override - public void getSubItems(Item item, CreativeTabs tab, List list) { + @SideOnly(Side.CLIENT) + public void getSubItems(@Nonnull Item item, CreativeTabs tab, List list) { for(int i = 0; i < 2; i++) list.add(new ItemStack(item, 1, i)); } + @Nonnull @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xv, float yv, float zv) { - TileEntity tile = world.getTileEntity(x, y, z); - if(tile instanceof IInventory && !CorporeaHelper.doesBlockHaveSpark(world, x, y, z)) { + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float xv, float yv, float zv) { + TileEntity tile = world.getTileEntity(pos); + if(tile != null && (tile.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, EnumFacing.UP) || tile.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null)) + && !CorporeaHelper.doesBlockHaveSpark(world, pos)) { stack.stackSize--; if(!world.isRemote) { EntityCorporeaSpark spark = new EntityCorporeaSpark(world); if(stack.getItemDamage() == 1) spark.setMaster(true); - spark.setPosition(x + 0.5, y + 1.5, z + 0.5); + spark.setPosition(pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5); world.spawnEntityInWorld(spark); - world.markBlockForUpdate(x, y, z); + world.notifyBlockUpdate(pos, world.getBlockState(pos), world.getBlockState(pos), 0); } - return true; + return EnumActionResult.SUCCESS; } - return false; - } - - @Override - public void registerIcons(IIconRegister par1IconRegister) { - invIcon = IconHelper.forItem(par1IconRegister, this, 0); - worldIcon = IconHelper.forItem(par1IconRegister, this, 1); - invIconMaster = IconHelper.forItem(par1IconRegister, this, 2); - worldIconMaster = IconHelper.forItem(par1IconRegister, this, 3); - iconColorStar = IconHelper.forItem(par1IconRegister, this, "Star"); + return EnumActionResult.PASS; } + @Nonnull @Override public String getUnlocalizedName(ItemStack par1ItemStack) { return super.getUnlocalizedName(par1ItemStack) + par1ItemStack.getItemDamage(); } + @SideOnly(Side.CLIENT) @Override - public IIcon getIconFromDamage(int meta) { - return meta == 0 ? invIcon : invIconMaster; + public void registerModels() { + ModelHandler.registerItemAppendMeta(this, 2, LibItemNames.CORPOREA_SPARK); } } diff --git a/src/main/java/vazkii/botania/common/item/ItemCraftPattern.java b/src/main/java/vazkii/botania/common/item/ItemCraftPattern.java index d799748f6..cbdad90d7 100644 --- a/src/main/java/vazkii/botania/common/item/ItemCraftPattern.java +++ b/src/main/java/vazkii/botania/common/item/ItemCraftPattern.java @@ -10,62 +10,63 @@ */ package vazkii.botania.common.item; -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import vazkii.botania.client.core.helper.IconHelper; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.block.tile.TileCraftCrate; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; +import java.util.List; + public class ItemCraftPattern extends ItemMod { - IIcon[] icons; - public ItemCraftPattern() { + super(LibItemNames.CRAFT_PATTERN); setHasSubtypes(true); - setUnlocalizedName(LibItemNames.CRAFT_PATTERN); setMaxStackSize(1); } + @Nonnull @Override - public boolean onItemUse(ItemStack stack, EntityPlayer p, World world, int x, int y, int z, int s, float xs, float ys, float zs) { - TileEntity tile = world.getTileEntity(x, y, z); - if(tile != null && tile instanceof TileCraftCrate && !world.isRemote) { + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer p, World world, BlockPos pos, EnumHand hand, EnumFacing side, float xs, float ys, float zs) { + TileEntity tile = world.getTileEntity(pos); + if(tile != null && tile instanceof TileCraftCrate) { TileCraftCrate crate = (TileCraftCrate) tile; crate.pattern = stack.getItemDamage(); - world.markBlockForUpdate(x, y, z); + world.notifyBlockUpdate(pos, world.getBlockState(pos), world.getBlockState(pos), 8); + return EnumActionResult.SUCCESS; } - return false; + return EnumActionResult.PASS; } @Override - public void getSubItems(Item item, CreativeTabs tab, List list) { + @SideOnly(Side.CLIENT) + public void getSubItems(@Nonnull Item item, CreativeTabs tab, List list) { for(int i = 0; i < TileCraftCrate.PATTERNS.length; i++) list.add(new ItemStack(item, 1, i)); } - @Override - public void registerIcons(IIconRegister par1IconRegister) { - icons = new IIcon[TileCraftCrate.PATTERNS.length]; - for(int i = 0; i < icons.length; i++) - icons[i] = IconHelper.forItem(par1IconRegister, this, i); - } - - @Override - public IIcon getIconFromDamage(int dmg) { - return icons[Math.min(icons.length - 1, dmg)]; - } - + @Nonnull @Override public String getUnlocalizedName(ItemStack par1ItemStack) { return super.getUnlocalizedName(par1ItemStack) + par1ItemStack.getItemDamage(); } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerItemAppendMeta(this, 9, LibItemNames.CRAFT_PATTERN); + } + } diff --git a/src/main/java/vazkii/botania/common/item/ItemCraftingHalo.java b/src/main/java/vazkii/botania/common/item/ItemCraftingHalo.java index d393f213a..1daa3ac33 100644 --- a/src/main/java/vazkii/botania/common/item/ItemCraftingHalo.java +++ b/src/main/java/vazkii/botania/common/item/ItemCraftingHalo.java @@ -10,18 +10,16 @@ */ package vazkii.botania.common.item; -import java.awt.Color; - -import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.ItemRenderer; -import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.resources.I18n; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -29,47 +27,50 @@ import net.minecraft.init.Blocks; import net.minecraft.inventory.ContainerWorkbench; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.stats.Achievement; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; -import net.minecraft.util.Vec3; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.Vec3d; +import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; import net.minecraftforge.client.event.RenderWorldLastEvent; import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.util.ForgeDirection; - +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.PlayerEvent.ItemCraftedEvent; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import net.minecraftforge.items.CapabilityItemHandler; +import net.minecraftforge.items.ItemHandlerHelper; +import net.minecraftforge.items.IItemHandler; +import net.minecraftforge.items.ItemStackHandler; import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - +import vazkii.botania.client.core.handler.ClientMethodHandles; import vazkii.botania.client.core.handler.ClientTickHandler; import vazkii.botania.client.gui.crafting.InventoryCraftingHalo; import vazkii.botania.client.lib.LibResources; import vazkii.botania.common.Botania; import vazkii.botania.common.achievement.ICraftAchievement; import vazkii.botania.common.achievement.ModAchievements; -import vazkii.botania.common.core.helper.InventoryHelper; -import vazkii.botania.common.core.helper.InventoryHelper.GenericInventory; import vazkii.botania.common.core.helper.ItemNBTHelper; +import vazkii.botania.common.core.helper.PlayerHelper; import vazkii.botania.common.core.helper.Vector3; import vazkii.botania.common.lib.LibGuiIDs; import vazkii.botania.common.lib.LibItemNames; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import javax.annotation.Nonnull; public class ItemCraftingHalo extends ItemMod implements ICraftAchievement { private static final ResourceLocation glowTexture = new ResourceLocation(LibResources.MISC_GLOW_GREEN); - private static final ItemStack craftingTable = new ItemStack(Blocks.crafting_table); + private static final ItemStack craftingTable = new ItemStack(Blocks.CRAFTING_TABLE); public static final int SEGMENTS = 12; @@ -82,43 +83,56 @@ public class ItemCraftingHalo extends ItemMod implements ICraftAchievement { public ItemCraftingHalo() { this(LibItemNames.CRAFTING_HALO); MinecraftForge.EVENT_BUS.register(this); - FMLCommonHandler.instance().bus().register(this); } public ItemCraftingHalo(String name) { - setUnlocalizedName(name); + super(name); setMaxStackSize(1); } + @Nonnull @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { + public ActionResult onItemRightClick(@Nonnull ItemStack stack, World world, EntityPlayer player, EnumHand hand) { int segment = getSegmentLookedAt(stack, player); ItemStack itemForPos = getItemForSlot(stack, segment); if(segment == 0) - player.openGui(Botania.instance, LibGuiIDs.CRAFTING_HALO, world, 0, 0, 0); + player.openGui(Botania.instance, LibGuiIDs.CRAFTING_HALO, world, hand == EnumHand.OFF_HAND ? 1 : 0, 0, 0); else { if(itemForPos == null) assignRecipe(stack, itemForPos, segment); else tryCraft(player, stack, segment, true, getFakeInv(player), true); } - return stack; + return ActionResult.newResult(EnumActionResult.SUCCESS, stack); } - public static IInventory getFakeInv(EntityPlayer player) { - GenericInventory tempInv = new GenericInventory("temp", false, player.inventory.getSizeInventory() - 4); - tempInv.copyFrom(player.inventory); - return tempInv; + public static IItemHandler getFakeInv(EntityPlayer player) { + ItemStackHandler ret = new ItemStackHandler(player.inventory.mainInventory.length); + for(int i = 0; i < player.inventory.mainInventory.length; i++) { + ItemStack stack = player.inventory.mainInventory[i]; + if(stack != null) + ret.setStackInSlot(i, player.inventory.mainInventory[i].copy()); + } + + return ret; } @Override public void onUpdate(ItemStack stack, World world, Entity entity, int pos, boolean equipped) { + if (!(entity instanceof EntityLivingBase)) + return; + EntityLivingBase living = ((EntityLivingBase) entity); + boolean eqLastTick = wasEquipped(stack); + + if (!equipped && living.getHeldItemOffhand() == stack) + equipped = true; + if(eqLastTick != equipped) setEquipped(stack, equipped); - if(!equipped && entity instanceof EntityLivingBase) { + if(!equipped) { int angles = 360; int segAngles = angles / SEGMENTS; float shift = segAngles / 2; @@ -126,7 +140,7 @@ public class ItemCraftingHalo extends ItemMod implements ICraftAchievement { } } - void tryCraft(EntityPlayer player, ItemStack stack, int slot, boolean particles, IInventory inv, boolean validate) { + void tryCraft(EntityPlayer player, ItemStack stack, int slot, boolean particles, IItemHandler inv, boolean validate) { ItemStack itemForPos = getItemForSlot(stack, slot); if(itemForPos == null) return; @@ -135,12 +149,12 @@ public class ItemCraftingHalo extends ItemMod implements ICraftAchievement { if(validate) recipe = validateRecipe(player, stack, recipe, slot); - if(canCraft(player, recipe, inv)) + if(canCraft(recipe, inv)) doCraft(player, recipe, particles); } private static ItemStack[] validateRecipe(EntityPlayer player, ItemStack stack, ItemStack[] recipe, int slot) { - InventoryCrafting fakeInv = new InventoryCrafting(new ContainerWorkbench(player.inventory, player.worldObj, 0, 0, 0), 3, 3); + InventoryCrafting fakeInv = new InventoryCrafting(new ContainerWorkbench(player.inventory, player.worldObj, BlockPos.ORIGIN), 3, 3); for(int i = 0; i < 9; i++) fakeInv.setInventorySlotContents(i, recipe[i]); @@ -158,32 +172,32 @@ public class ItemCraftingHalo extends ItemMod implements ICraftAchievement { return recipe; } - private static boolean canCraft(EntityPlayer player, ItemStack[] recipe, IInventory inv) { + private static boolean canCraft(ItemStack[] recipe, IItemHandler inv) { if(recipe == null) return false; - if(recipe[9].stackSize != InventoryHelper.testInventoryInsertion(inv, recipe[9], ForgeDirection.UNKNOWN)) + if(ItemHandlerHelper.insertItemStacked(inv, recipe[9], true) != null) return false; return consumeRecipeIngredients(recipe, inv, null); } private static void doCraft(EntityPlayer player, ItemStack[] recipe, boolean particles) { - consumeRecipeIngredients(recipe, player.inventory, player); + consumeRecipeIngredients(recipe, player.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, EnumFacing.UP), player); if(!player.inventory.addItemStackToInventory(recipe[9])) - player.dropPlayerItemWithRandomChoice(recipe[9], false); + player.dropItem(recipe[9], false); if(!particles) return; - Vec3 lookVec3 = player.getLookVec(); + Vec3d lookVec3 = player.getLookVec(); Vector3 centerVector = Vector3.fromEntityCenter(player).add(lookVec3.xCoord * 3, 1.3, lookVec3.zCoord * 3); float m = 0.1F; for(int i = 0; i < 4; i++) - Botania.proxy.wispFX(player.worldObj, centerVector.x, centerVector.y, centerVector.z, 1F, 0F, 1F, 0.2F + 0.2F * (float) Math.random(), ((float) Math.random() - 0.5F) * m, ((float) Math.random() - 0.5F) * m, ((float) Math.random() - 0.5F) * m); + Botania.proxy.wispFX(centerVector.x, centerVector.y, centerVector.z, 1F, 0F, 1F, 0.2F + 0.2F * (float) Math.random(), ((float) Math.random() - 0.5F) * m, ((float) Math.random() - 0.5F) * m, ((float) Math.random() - 0.5F) * m); } - private static boolean consumeRecipeIngredients(ItemStack[] recipe, IInventory inv, EntityPlayer player) { + private static boolean consumeRecipeIngredients(ItemStack[] recipe, IItemHandler inv, EntityPlayer player) { for(int i = 0; i < 9; i++) { ItemStack ingredient = recipe[i]; if(ingredient != null && !consumeFromInventory(ingredient, inv, player)) @@ -193,8 +207,8 @@ public class ItemCraftingHalo extends ItemMod implements ICraftAchievement { return true; } - private static boolean consumeFromInventory(ItemStack stack, IInventory inv, EntityPlayer player) { - for(int i = 0; i < inv.getSizeInventory(); i++) { + private static boolean consumeFromInventory(ItemStack stack, IItemHandler inv, EntityPlayer player) { + for(int i = 0; i < inv.getSlots(); i++) { ItemStack stackAt = inv.getStackInSlot(i); if(stackAt != null && stack.isItemEqual(stackAt) && ItemStack.areItemStackTagsEqual(stack, stackAt)) { boolean consume = true; @@ -204,17 +218,15 @@ public class ItemCraftingHalo extends ItemMod implements ICraftAchievement { if(container == stackAt) consume = false; else { - InventoryHelper.insertItemIntoInventory(inv, container); - if(container.stackSize != 0 && player != null) - player.dropPlayerItemWithRandomChoice(container, false); + if(player == null) + ItemHandlerHelper.insertItem(inv, container, false); + else + ItemHandlerHelper.giveItemToPlayer(player, container); } } - if(consume) { - stackAt.stackSize--; - if(stackAt.stackSize == 0) - inv.setInventorySlotContents(i, null); - } + if(consume) + inv.extractItem(i, 1, false); return true; } @@ -260,7 +272,7 @@ public class ItemCraftingHalo extends ItemMod implements ICraftAchievement { // Screw the way minecraft handles rotation // Really... private static float getCheckingAngle(EntityLivingBase player, float base) { - float yaw = MathHelper.wrapAngleTo180_float(player.rotationYaw) + 90F; + float yaw = MathHelper.wrapDegrees(player.rotationYaw) + 90F; int angles = 360; int segAngles = angles / SEGMENTS; float shift = segAngles / 2; @@ -393,27 +405,37 @@ public class ItemCraftingHalo extends ItemMod implements ICraftAchievement { @SubscribeEvent public void onRenderWorldLast(RenderWorldLastEvent event) { EntityPlayer player = Minecraft.getMinecraft().thePlayer; - ItemStack stack = player.getCurrentEquippedItem(); - if(stack != null && stack.getItem() instanceof ItemCraftingHalo) - render(stack, player, event.partialTicks); + ItemStack stack = PlayerHelper.getFirstHeldItemClass(player, ItemCraftingHalo.class); + if(stack != null) + render(stack, player, event.getPartialTicks()); } @SideOnly(Side.CLIENT) public void render(ItemStack stack, EntityPlayer player, float partialTicks) { Minecraft mc = Minecraft.getMinecraft(); - Tessellator tess = Tessellator.instance; - Tessellator.renderingWorldRenderer = false; + Tessellator tess = Tessellator.getInstance(); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + double renderPosX, renderPosY, renderPosZ; + + try { + renderPosX = (double) ClientMethodHandles.renderPosX_getter.invokeExact(Minecraft.getMinecraft().getRenderManager()); + renderPosY = (double) ClientMethodHandles.renderPosY_getter.invokeExact(Minecraft.getMinecraft().getRenderManager()); + renderPosZ = (double) ClientMethodHandles.renderPosZ_getter.invokeExact(Minecraft.getMinecraft().getRenderManager()); + } catch (Throwable t) { + t.printStackTrace(); + return; + } + + GlStateManager.pushMatrix(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); float alpha = ((float) Math.sin((ClientTickHandler.ticksInGame + partialTicks) * 0.2F) * 0.5F + 0.5F) * 0.4F + 0.3F; double posX = player.prevPosX + (player.posX - player.prevPosX) * partialTicks; double posY = player.prevPosY + (player.posY - player.prevPosY) * partialTicks; double posZ = player.prevPosZ + (player.posZ - player.prevPosZ) * partialTicks; - GL11.glTranslated(posX - RenderManager.renderPosX, posY - RenderManager.renderPosY, posZ - RenderManager.renderPosZ); + GlStateManager.translate(posX - renderPosX, posY - renderPosY + player.getDefaultEyeHeight(), posZ - renderPosZ); float base = getRotationBase(stack); @@ -434,83 +456,67 @@ public class ItemCraftingHalo extends ItemMod implements ICraftAchievement { for(int seg = 0; seg < SEGMENTS; seg++) { boolean inside = false; float rotationAngle = (seg + 0.5F) * segAngles + shift; - GL11.glPushMatrix(); - GL11.glRotatef(rotationAngle, 0F, 1F, 0F); - GL11.glTranslatef(s * m, -0.75F, 0F); + GlStateManager.pushMatrix(); + GlStateManager.rotate(rotationAngle, 0F, 1F, 0F); + GlStateManager.translate(s * m, -0.75F, 0F); if(segmentLookedAt == seg) inside = true; ItemStack slotStack = getItemForSlot(stack, seg); if(slotStack != null) { - mc.renderEngine.bindTexture(slotStack.getItem() instanceof ItemBlock ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture); + mc.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + RenderHelper.enableStandardItemLighting(); + float scale = seg == 0 ? 0.9F : 0.8F; + GlStateManager.scale(scale, scale, scale); + GlStateManager.rotate(180F, 0F, 1F, 0F); + GlStateManager.translate(seg == 0 ? 0.5F : 0F, seg == 0 ? -0.1F : 0.6F, 0F); - if(slotStack.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(slotStack.getItem()).getRenderType())) { - float scale = seg == 0 ? 0.75F : 0.6F; - GL11.glScalef(scale, scale, scale); - GL11.glRotatef(180F, 0F, 1F, 0F); - GL11.glTranslatef(seg == 0 ? 0.5F : 0F, seg == 0 ? -0.1F : 0.6F, 0F); - - RenderBlocks.getInstance().renderBlockAsItem(Block.getBlockFromItem(slotStack.getItem()), slotStack.getItemDamage(), 1F); - } else { - GL11.glScalef(0.75F, 0.75F, 0.75F); - GL11.glTranslatef(0F, 0F, 0.5F); - GL11.glRotatef(90F, 0F, 1F, 0F); - int renderPass = 0; - do { - IIcon icon = slotStack.getItem().getIcon(slotStack, renderPass); - if(icon != null) { - Color color = new Color(slotStack.getItem().getColorFromItemStack(slotStack, renderPass)); - GL11.glColor3ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue()); - float f = icon.getMinU(); - float f1 = icon.getMaxU(); - float f2 = icon.getMinV(); - float f3 = icon.getMaxV(); - ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F); - GL11.glColor3f(1F, 1F, 1F); - } - renderPass++; - } while(renderPass < slotStack.getItem().getRenderPasses(slotStack.getItemDamage())); - } + GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F); + Minecraft.getMinecraft().getRenderItem().renderItem(slotStack, ItemCameraTransforms.TransformType.GUI); + RenderHelper.disableStandardItemLighting(); } - GL11.glPopMatrix(); + GlStateManager.popMatrix(); - GL11.glPushMatrix(); - GL11.glRotatef(180F, 1F, 0F, 0F); + GlStateManager.pushMatrix(); + GlStateManager.rotate(180F, 1F, 0F, 0F); float a = alpha; if(inside) { a += 0.3F; y0 = -y; } - if(seg % 2 == 0) - GL11.glColor4f(0.6F, 0.6F, 0.6F, a); - else GL11.glColor4f(1F, 1F, 1F, a); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glDisable(GL11.GL_CULL_FACE); + if(seg % 2 == 0) + GlStateManager.color(0.6F, 0.6F, 0.6F, a); + else GlStateManager.color(1F, 1F, 1F, a); + + GlStateManager.disableCull(); ItemCraftingHalo item = (ItemCraftingHalo) stack.getItem(); mc.renderEngine.bindTexture(item.getGlowResource()); - tess.startDrawingQuads(); + tess.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); for(int i = 0; i < segAngles; i++) { float ang = i + seg * segAngles + shift; double xp = Math.cos(ang * Math.PI / 180F) * s; double zp = Math.sin(ang * Math.PI / 180F) * s; - tess.addVertexWithUV(xp * m, y, zp * m, u, v); - tess.addVertexWithUV(xp, y0, zp, u, 0); + tess.getBuffer().pos(xp * m, y, zp * m).tex(u, v).endVertex(); + tess.getBuffer().pos(xp, y0, zp).tex(u, 0).endVertex(); xp = Math.cos((ang + 1) * Math.PI / 180F) * s; zp = Math.sin((ang + 1) * Math.PI / 180F) * s; - tess.addVertexWithUV(xp, y0, zp, 0, 0); - tess.addVertexWithUV(xp * m, y, zp * m, 0, v); + tess.getBuffer().pos(xp, y0, zp).tex(0, 0).endVertex(); + tess.getBuffer().pos(xp * m, y, zp * m).tex(0, v).endVertex(); } y0 = 0; tess.draw(); - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glPopMatrix(); + GlStateManager.enableCull(); + GlStateManager.popMatrix(); } - GL11.glPopMatrix(); + GlStateManager.popMatrix(); } @SideOnly(Side.CLIENT) @@ -522,26 +528,26 @@ public class ItemCraftingHalo extends ItemMod implements ICraftAchievement { public static void renderHUD(ScaledResolution resolution, EntityPlayer player, ItemStack stack) { Minecraft mc = Minecraft.getMinecraft(); int slot = getSegmentLookedAt(stack, player); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); if(slot == 0) { String name = craftingTable.getDisplayName(); - int l = mc.fontRenderer.getStringWidth(name); + int l = mc.fontRendererObj.getStringWidth(name); int x = resolution.getScaledWidth() / 2 - l / 2; int y = resolution.getScaledHeight() / 2 - 65; Gui.drawRect(x - 6, y - 6, x + l + 6, y + 37, 0x22000000); Gui.drawRect(x - 4, y - 4, x + l + 4, y + 35, 0x22000000); net.minecraft.client.renderer.RenderHelper.enableGUIStandardItemLighting(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, craftingTable, resolution.getScaledWidth() / 2 - 8, resolution.getScaledHeight() / 2 - 52); + GlStateManager.enableRescaleNormal(); + mc.getRenderItem().renderItemAndEffectIntoGUI(craftingTable, resolution.getScaledWidth() / 2 - 8, resolution.getScaledHeight() / 2 - 52); net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting(); - mc.fontRenderer.drawStringWithShadow(name, x, y, 0xFFFFFF); + mc.fontRendererObj.drawStringWithShadow(name, x, y, 0xFFFFFF); } else { ItemStack[] recipe = getCraftingItems(stack, slot); - String label = StatCollector.translateToLocal("botaniamisc.unsetRecipe"); + String label = I18n.format("botaniamisc.unsetRecipe"); boolean setRecipe = false; if(recipe[9] == null) @@ -570,7 +576,7 @@ public class ItemCraftingHalo extends ItemMod implements ICraftAchievement { Gui.drawRect(x - 2, y - 2, x + 56, y + 56, 0x22000000); net.minecraft.client.renderer.RenderHelper.enableGUIStandardItemLighting(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GlStateManager.enableRescaleNormal(); for(int i = 0; i < 9; i++) { ItemStack stack = recipe[i]; if(stack != null) { @@ -578,24 +584,24 @@ public class ItemCraftingHalo extends ItemMod implements ICraftAchievement { int ypos = y + i / 3 * 18; Gui.drawRect(xpos, ypos, xpos + 16, ypos + 16, 0x22000000); - RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, stack, xpos, ypos); + mc.getRenderItem().renderItemAndEffectIntoGUI(stack, xpos, ypos); } } - RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, recipe[9], x + 72, y + 18); - RenderItem.getInstance().renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, recipe[9], x + 72, y + 18); + mc.getRenderItem().renderItemAndEffectIntoGUI(recipe[9], x + 72, y + 18); + mc.getRenderItem().renderItemOverlayIntoGUI(mc.fontRendererObj, recipe[9], x + 72, y + 18, ""); net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting(); } int yoff = 110; - if(setRecipe && !canCraft(player, recipe, getFakeInv(player))) { - String warning = EnumChatFormatting.RED + StatCollector.translateToLocal("botaniamisc.cantCraft"); - mc.fontRenderer.drawStringWithShadow(warning, resolution.getScaledWidth() / 2 - mc.fontRenderer.getStringWidth(warning) / 2, resolution.getScaledHeight() / 2 - yoff, 0xFFFFFF); + if(setRecipe && !canCraft(recipe, getFakeInv(player))) { + String warning = TextFormatting.RED + I18n.format("botaniamisc.cantCraft"); + mc.fontRendererObj.drawStringWithShadow(warning, resolution.getScaledWidth() / 2 - mc.fontRendererObj.getStringWidth(warning) / 2, resolution.getScaledHeight() / 2 - yoff, 0xFFFFFF); yoff += 12; } - mc.fontRenderer.drawStringWithShadow(label, resolution.getScaledWidth() / 2 - mc.fontRenderer.getStringWidth(label) / 2, resolution.getScaledHeight() / 2 - yoff, 0xFFFFFF); + mc.fontRendererObj.drawStringWithShadow(label, resolution.getScaledWidth() / 2 - mc.fontRendererObj.getStringWidth(label) / 2, resolution.getScaledHeight() / 2 - yoff, 0xFFFFFF); } @Override diff --git a/src/main/java/vazkii/botania/common/item/ItemEnderHand.java b/src/main/java/vazkii/botania/common/item/ItemEnderHand.java index f6ef375a5..b26a2a3ff 100644 --- a/src/main/java/vazkii/botania/common/item/ItemEnderHand.java +++ b/src/main/java/vazkii/botania/common/item/ItemEnderHand.java @@ -13,7 +13,12 @@ package vazkii.botania.common.item; import net.minecraft.block.Block; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.SoundEvents; import net.minecraft.item.ItemStack; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.SoundCategory; import net.minecraft.world.World; import vazkii.botania.api.item.IBlockProvider; import vazkii.botania.api.mana.IManaUsingItem; @@ -22,6 +27,8 @@ import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.item.rod.ItemExchangeRod; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; + public class ItemEnderHand extends ItemMod implements IManaUsingItem, IBlockProvider { private static final int COST_PROVIDE = 5; @@ -29,26 +36,30 @@ public class ItemEnderHand extends ItemMod implements IManaUsingItem, IBlockProv private static final int COST_OTHER = 5000; public ItemEnderHand() { + super(LibItemNames.ENDER_HAND); setMaxStackSize(1); - setUnlocalizedName(LibItemNames.ENDER_HAND); } + @Nonnull @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { + public ActionResult onItemRightClick(@Nonnull ItemStack stack, World world, EntityPlayer player, EnumHand hand) { if(ManaItemHandler.requestManaExact(stack, player, COST_SELF, false)) { - player.displayGUIChest(player.getInventoryEnderChest()); + if(!player.worldObj.isRemote) + player.displayGUIChest(player.getInventoryEnderChest()); ManaItemHandler.requestManaExact(stack, player, COST_SELF, true); - world.playSoundAtEntity(player, "mob.endermen.portal", 1F, 1F); + player.playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1F, 1F); + return ActionResult.newResult(EnumActionResult.SUCCESS, stack); } - return stack; + return ActionResult.newResult(EnumActionResult.PASS, stack); } @Override - public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer iplayer, EntityLivingBase entity) { - if(ConfigHandler.enderPickpocketEnabled && entity instanceof EntityPlayer && ManaItemHandler.requestManaExact(stack, iplayer, COST_OTHER, false)) { - iplayer.displayGUIChest(((EntityPlayer) entity).getInventoryEnderChest()); - ManaItemHandler.requestManaExact(stack, iplayer, COST_OTHER, true); - iplayer.worldObj.playSoundAtEntity(iplayer, "mob.endermen.portal", 1F, 1F); + public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer player, EntityLivingBase entity, EnumHand hand) { + if(ConfigHandler.enderPickpocketEnabled && entity instanceof EntityPlayer && ManaItemHandler.requestManaExact(stack, player, COST_OTHER, false)) { + if(!player.worldObj.isRemote) + player.displayGUIChest(((EntityPlayer) entity).getInventoryEnderChest()); + ManaItemHandler.requestManaExact(stack, player, COST_OTHER, true); + player.playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1F, 1F); return true; } diff --git a/src/main/java/vazkii/botania/common/item/ItemFertilizer.java b/src/main/java/vazkii/botania/common/item/ItemFertilizer.java index 6940d2d04..ba62b754b 100644 --- a/src/main/java/vazkii/botania/common/item/ItemFertilizer.java +++ b/src/main/java/vazkii/botania/common/item/ItemFertilizer.java @@ -10,60 +10,64 @@ */ package vazkii.botania.common.item; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumDyeColor; import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.common.Botania; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.List; + public class ItemFertilizer extends ItemMod { public ItemFertilizer() { - super(); - setUnlocalizedName(LibItemNames.FERTILIZER); + super(LibItemNames.FERTILIZER); } + @Nonnull @Override - public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { + public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) { final int range = 3; - if(!par3World.isRemote) { - List validCoords = new ArrayList(); + if(!world.isRemote) { + List validCoords = new ArrayList<>(); for(int i = -range - 1; i < range; i++) for(int j = -range - 1; j < range; j++) { for(int k = 2; k >= -2; k--) { - int x = par4 + i + 1; - int y = par5 + k + 1; - int z = par6 + j + 1; - if(par3World.isAirBlock(x, y, z) && (!par3World.provider.hasNoSky || y < 255) && ModBlocks.flower.canBlockStay(par3World, x, y, z)) - validCoords.add(new ChunkCoordinates(x, y, z)); + BlockPos pos_ = pos.add(i + 1, k + 1, j + 1); + if(world.isAirBlock(pos_) && (!world.provider.getHasNoSky() || pos_.getY() < 255) && ModBlocks.flower.canPlaceBlockAt(world, pos_)) + validCoords.add(pos_); } } - int flowerCount = Math.min(validCoords.size(), par3World.rand.nextBoolean() ? 3 : 4); + int flowerCount = Math.min(validCoords.size(), world.rand.nextBoolean() ? 3 : 4); for(int i = 0; i < flowerCount; i++) { - ChunkCoordinates coords = validCoords.get(par3World.rand.nextInt(validCoords.size())); + BlockPos coords = validCoords.get(world.rand.nextInt(validCoords.size())); validCoords.remove(coords); - par3World.setBlock(coords.posX, coords.posY, coords.posZ, ModBlocks.flower, par3World.rand.nextInt(16), 1 | 2); + world.setBlockState(coords, ModBlocks.flower.getDefaultState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.byMetadata(world.rand.nextInt(16))), 1 | 2); } par1ItemStack.stackSize--; } else { for(int i = 0; i < 15; i++) { - double x = par4 - range + par3World.rand.nextInt(range * 2 + 1) + Math.random(); - double y = par5 + 1; - double z = par6 - range + par3World.rand.nextInt(range * 2 + 1) + Math.random(); + double x = pos.getX() - range + world.rand.nextInt(range * 2 + 1) + Math.random(); + double y = pos.getY() + 1; + double z = pos.getZ() - range + world.rand.nextInt(range * 2 + 1) + Math.random(); float red = (float) Math.random(); float green = (float) Math.random(); float blue = (float) Math.random(); - Botania.proxy.wispFX(par3World, x, y, z, red, green, blue, 0.15F + (float) Math.random() * 0.25F, -(float) Math.random() * 0.1F - 0.05F); + Botania.proxy.wispFX(x, y, z, red, green, blue, 0.15F + (float) Math.random() * 0.25F, -(float) Math.random() * 0.1F - 0.05F); } } - return true; + return EnumActionResult.SUCCESS; } } diff --git a/src/main/java/vazkii/botania/common/item/ItemFlowerBag.java b/src/main/java/vazkii/botania/common/item/ItemFlowerBag.java index a57e00bfb..ae02fa878 100644 --- a/src/main/java/vazkii/botania/common/item/ItemFlowerBag.java +++ b/src/main/java/vazkii/botania/common/item/ItemFlowerBag.java @@ -10,150 +10,187 @@ */ package vazkii.botania.common.item; +import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.SoundEvents; import net.minecraft.inventory.IInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTBase; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; +import net.minecraft.network.play.server.SPacketCollectItem; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.capabilities.ICapabilityProvider; +import net.minecraftforge.common.capabilities.ICapabilitySerializable; +import net.minecraftforge.common.util.Constants; import net.minecraftforge.event.entity.player.EntityItemPickupEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.items.CapabilityItemHandler; +import net.minecraftforge.items.IItemHandler; +import net.minecraftforge.items.IItemHandlerModifiable; +import net.minecraftforge.items.ItemHandlerHelper; +import net.minecraftforge.items.ItemStackHandler; +import net.minecraftforge.items.wrapper.InvWrapper; import vazkii.botania.common.Botania; import vazkii.botania.common.block.ModBlocks; -import vazkii.botania.common.core.helper.InventoryHelper; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.lib.LibGuiIDs; import vazkii.botania.common.lib.LibItemNames; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; public class ItemFlowerBag extends ItemMod { private static final String TAG_ITEMS = "InvItems"; - private static final String TAG_SLOT = "Slot"; public ItemFlowerBag() { - setUnlocalizedName(LibItemNames.FLOWER_BAG); + super(LibItemNames.FLOWER_BAG); setMaxStackSize(1); MinecraftForge.EVENT_BUS.register(this); } + @Nonnull + @Override + public ICapabilityProvider initCapabilities(ItemStack stack, NBTTagCompound oldCapNbt) { + return new InvProvider(); + } + + private static class InvProvider implements ICapabilitySerializable { + + private final IItemHandler inv = new ItemStackHandler(16) { + @Override + public ItemStack insertItem(int slot, ItemStack toInsert, boolean simulate) { + if(toInsert != null + && toInsert.getItem() == Item.getItemFromBlock(ModBlocks.flower) + && toInsert.getItemDamage() == slot) + return super.insertItem(slot, toInsert, simulate); + else return toInsert; + } + }; + + @Override + public boolean hasCapability(Capability capability, @Nullable EnumFacing facing) { + return capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY; + } + + @Override + public T getCapability(Capability capability, @Nullable EnumFacing facing) { + if(capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) + return CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.cast(inv); + else return null; + } + + @Override + public NBTBase serializeNBT() { + return CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.writeNBT(inv, null); + } + + @Override + public void deserializeNBT(NBTBase nbt) { + CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.readNBT(inv, null, nbt); + } + } + + @Override + public void onUpdate(ItemStack stack, World world, Entity entity, int slot, boolean selected) { + if(stack.getTagCompound() != null && stack.getTagCompound().hasKey(TAG_ITEMS)) { + NBTTagList oldData = stack.getTagCompound().getTagList(TAG_ITEMS, Constants.NBT.TAG_COMPOUND); + IItemHandler newInv = stack.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null); + + CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.readNBT(newInv, null, oldData); + + stack.getTagCompound().removeTag(TAG_ITEMS); + + if(stack.getTagCompound().getSize() == 0) + stack.setTagCompound(null); + } + } + @SubscribeEvent public void onPickupItem(EntityItemPickupEvent event) { - ItemStack stack = event.item.getEntityItem(); - if(stack.getItem() == Item.getItemFromBlock(ModBlocks.flower) && stack.stackSize > 0) { - int color = stack.getItemDamage(); + ItemStack entityStack = event.getItem().getEntityItem(); + if(entityStack.getItem() == Item.getItemFromBlock(ModBlocks.flower) && entityStack.stackSize > 0) { + int color = entityStack.getItemDamage(); if(color > 15) return; - for(int i = 0; i < event.entityPlayer.inventory.getSizeInventory(); i++) { - if(i == event.entityPlayer.inventory.currentItem) + for(int i = 0; i < event.getEntityPlayer().inventory.getSizeInventory(); i++) { + if(i == event.getEntityPlayer().inventory.currentItem) continue; // prevent item deletion - ItemStack invStack = event.entityPlayer.inventory.getStackInSlot(i); - if(invStack != null && invStack.getItem() == this) { - ItemStack[] bagInv = loadStacks(invStack); - ItemStack stackAt = bagInv[color]; - boolean didChange = false; - if(stackAt == null) { - bagInv[color] = stack.copy(); - stack.stackSize = 0; - didChange = true; - } else { - int stackAtSize = stackAt.stackSize; - int stackSize = stack.stackSize; - int spare = 64 - stackAtSize; - int pass = Math.min(spare, stackSize); - if(pass > 0) { - stackAt.stackSize += pass; - stack.stackSize -= pass; - didChange = true; + ItemStack bag = event.getEntityPlayer().inventory.getStackInSlot(i); + if(bag != null && bag.getItem() == this) { + IItemHandler bagInv = bag.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null); + + ItemStack result = bagInv.insertItem(color, entityStack, false); + + if(result == null) + event.getItem().setDead(); + else { + event.getItem().setEntityItemStack(result); + } + + if(result != entityStack) { + event.setCanceled(true); + if (!event.getItem().isSilent()) { + event.getItem().worldObj.playSound(null, event.getEntityPlayer().posX, event.getEntityPlayer().posY, event.getEntityPlayer().posZ, + SoundEvents.ENTITY_ITEM_PICKUP, SoundCategory.PLAYERS, 0.2F, + ((event.getItem().worldObj.rand.nextFloat() - event.getItem().worldObj.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); } + ((EntityPlayerMP) event.getEntityPlayer()).connection.sendPacket(new SPacketCollectItem(event.getItem().getEntityId(), event.getEntityPlayer().getEntityId())); + event.getEntityPlayer().openContainer.detectAndSendChanges(); } - - if(didChange) - setStacks(invStack, bagInv); } - - if(stack.stackSize == 0) - return; } } } + @Nonnull @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { - player.openGui(Botania.instance, LibGuiIDs.FLOWER_BAG, world, 0, 0, 0); - return stack; + public ActionResult onItemRightClick(@Nonnull ItemStack stack, World world, EntityPlayer player, EnumHand hand) { + player.openGui(Botania.instance, LibGuiIDs.FLOWER_BAG, world, hand == EnumHand.OFF_HAND ? 1 : 0, 0, 0); + return ActionResult.newResult(EnumActionResult.SUCCESS, stack); } + @Nonnull @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int s, float xs, float ys, float zs) { - TileEntity tile = world.getTileEntity(x, y, z); - if(tile != null && tile instanceof IInventory) { + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float xs, float ys, float zs) { + TileEntity tile = world.getTileEntity(pos); + if(tile != null) { if(!world.isRemote) { - ForgeDirection side = ForgeDirection.getOrientation(s); - IInventory inv = (IInventory) tile; - ItemStack[] stacks = loadStacks(stack); - ItemStack[] newStacks = new ItemStack[stacks.length]; - boolean putAny = false; + IItemHandler tileInv = null; + if(tile.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, side)) + tileInv = tile.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, side); + else if(tile instanceof IInventory) + tileInv = new InvWrapper(((IInventory) tile)); - int i = 0; - for(ItemStack petal : stacks) { - if(petal != null) { - int count = InventoryHelper.testInventoryInsertion(inv, petal, side); - InventoryHelper.insertItemIntoInventory(inv, petal, side, -1); + if(tileInv == null) + return EnumActionResult.FAIL; - ItemStack newPetal = petal.copy(); - if(newPetal.stackSize == 0) - newPetal = null; + IItemHandlerModifiable bagInv = (IItemHandlerModifiable) stack.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null); - newStacks[i] = newPetal; - putAny |= count > 0; - } - - i++; - } - - setStacks(stack, newStacks); - if(putAny && inv instanceof TileEntityChest) { - inv = InventoryHelper.getInventory(inv); - player.displayGUIChest(inv); + for(int i = 0; i < bagInv.getSlots(); i++) { + ItemStack flower = bagInv.getStackInSlot(i); + bagInv.setStackInSlot(i, ItemHandlerHelper.insertItemStacked(tileInv, flower, false)); } } - return true; + return EnumActionResult.SUCCESS; } - return false; - } - - public static ItemStack[] loadStacks(ItemStack stack) { - NBTTagList var2 = ItemNBTHelper.getList(stack, TAG_ITEMS, 10, false); - ItemStack[] inventorySlots = new ItemStack[16]; - for(int var3 = 0; var3 < var2.tagCount(); ++var3) { - NBTTagCompound var4 = var2.getCompoundTagAt(var3); - byte var5 = var4.getByte(TAG_SLOT); - if(var5 >= 0 && var5 < inventorySlots.length) - inventorySlots[var5] = ItemStack.loadItemStackFromNBT(var4); - } - - return inventorySlots; - } - - public static void setStacks(ItemStack stack, ItemStack[] inventorySlots) { - NBTTagList var2 = new NBTTagList(); - for(int var3 = 0; var3 < inventorySlots.length; ++var3) - if(inventorySlots[var3] != null) { - NBTTagCompound var4 = new NBTTagCompound(); - var4.setByte(TAG_SLOT, (byte)var3); - inventorySlots[var3].writeToNBT(var4); - var2.appendTag(var4); - } - - ItemNBTHelper.setList(stack, TAG_ITEMS, var2); + return EnumActionResult.PASS; } } diff --git a/src/main/java/vazkii/botania/common/item/ItemGaiaHead.java b/src/main/java/vazkii/botania/common/item/ItemGaiaHead.java index ec8205310..ee156c1f6 100644 --- a/src/main/java/vazkii/botania/common/item/ItemGaiaHead.java +++ b/src/main/java/vazkii/botania/common/item/ItemGaiaHead.java @@ -10,86 +10,131 @@ */ package vazkii.botania.common.item; +import net.minecraft.block.Block; import net.minecraft.block.BlockSkull; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.model.ModelBiped; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntitySkull; -import net.minecraft.util.MathHelper; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.common.Botania; import vazkii.botania.common.block.ModBlocks; +import vazkii.botania.common.block.tile.TileGaiaHead; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; + public class ItemGaiaHead extends ItemMod { public ItemGaiaHead() { - setUnlocalizedName(LibItemNames.GAIA_HEAD); + super(LibItemNames.GAIA_HEAD); } - // I couldn't deal with it. @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float sideX, float sideY, float sideZ) { - // The side of the wall the head is being used on. - ForgeDirection sideDir = ForgeDirection.getOrientation(side); - - // If we can replace the block we're clicking on, then we'll go ahead - // and replace it (eg, snow). - if (world.getBlock(x, y, z).isReplaceable(world, x, y, z) && sideDir != ForgeDirection.DOWN) { - sideDir = ForgeDirection.UP; - y--; - } - - // Skulls can't be placed on the bottom side of a block. - if (sideDir == ForgeDirection.DOWN) - return false; - - // If the side we're trying to place the skull on isn't solid, then - // we can't place it either. - if (!world.isSideSolid(x, y, z, sideDir)) - return false; - - // Figure out where the skull actually goes based on the side we're placing it against. - switch(sideDir) { - case UP: y++; break; // If we're placing it on the top, then the skull goes 1 block above. - case NORTH: z--; break; // Placing it on the north side (Z- axis). - case SOUTH: z++; break; // Placing it on the south side (Z+ axis). - case WEST: x--; break; // Placing it on the west side (X- axis). - case EAST: x++; break; // Placing it on the east side (X+ axis). - default: return false; // Oops, this shouldn't happen. - } - - // We can't place blocks as a measly client. - if(world.isRemote) - return true; - - // If the skull says no, who are we to argue? - if (!ModBlocks.gaiaHead.canPlaceBlockOnSide(world, x, y, z, side)) - return false; - - // Gaia head, instead of skull - world.setBlock(x, y, z, ModBlocks.gaiaHead, sideDir.ordinal(), 2); - int headAngle = 0; - - // If we place the skull on top of a block, we should also make it - // face the player by rotating it. - if (sideDir == ForgeDirection.UP) - headAngle = MathHelper.floor_double(player.rotationYaw * 16.0F / 360.0F + 0.5D) & 15; - - // Update the skull's orientation if it lets us. - TileEntity tileentity = world.getTileEntity(x, y, z); - - if (tileentity != null && tileentity instanceof TileEntitySkull) { - ((TileEntitySkull) tileentity).func_145903_a(headAngle); - ((BlockSkull) Blocks.skull).func_149965_a(world, x, y, z, (TileEntitySkull) tileentity); - } - - // Remove a head from the stack. - --stack.stackSize; - - // Call it a success and leave. - return true; + public boolean isValidArmor(ItemStack stack, EntityEquipmentSlot armorType, Entity entity) { + return armorType == EntityEquipmentSlot.HEAD; } + @SideOnly(Side.CLIENT) + @Nonnull + @Override + public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, EntityEquipmentSlot armorSlot, ModelBiped _default) { + return (ModelBiped) Botania.proxy.getEmptyModelBiped(); + } + + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + super.registerModels(); + ForgeHooksClient.registerTESRItemStack(this, 0, TileGaiaHead.class); + } + + // Copied from vanila skull itemBlock. Relevant edits are indicated. + @Nonnull + @Override + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { + if (facing == EnumFacing.DOWN) { + return EnumActionResult.FAIL; + } else { + if (worldIn.getBlockState(pos).getBlock().isReplaceable(worldIn, pos)) { + facing = EnumFacing.UP; + pos = pos.down(); + } + IBlockState iblockstate = worldIn.getBlockState(pos); + Block block = iblockstate.getBlock(); + boolean flag = block.isReplaceable(worldIn, pos); + + if (!flag) { + if (!worldIn.getBlockState(pos).getMaterial().isSolid() && !worldIn.isSideSolid(pos, facing, true)) { + return EnumActionResult.FAIL; + } + + pos = pos.offset(facing); + } + + if (playerIn.canPlayerEdit(pos, facing, stack) && Blocks.SKULL.canPlaceBlockAt(worldIn, pos)) { + if (worldIn.isRemote) { + return EnumActionResult.SUCCESS; + } else { + worldIn.setBlockState(pos, ModBlocks.gaiaHead.getDefaultState().withProperty(BlockSkull.FACING, facing), 11); // Botania - skull -> gaia head + int i = 0; + + if (facing == EnumFacing.UP) { + i = MathHelper.floor_double((double) (playerIn.rotationYaw * 16.0F / 360.0F) + 0.5D) & 15; + } + + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntitySkull) { + TileEntitySkull tileentityskull = (TileEntitySkull) tileentity; + + if (stack.getMetadata() == 3) // Botania - do not retrieve skins + { + /*GameProfile gameprofile = null; + + if (stack.hasTagCompound()) + { + NBTTagCompound nbttagcompound = stack.getTagCompound(); + + if (nbttagcompound.hasKey("SkullOwner", 10)) + { + gameprofile = NBTUtil.readGameProfileFromNBT(nbttagcompound.getCompoundTag("SkullOwner")); + } + else if (nbttagcompound.hasKey("SkullOwner", 8) && !nbttagcompound.getString("SkullOwner").isEmpty()) + { + gameprofile = new GameProfile((UUID)null, nbttagcompound.getString("SkullOwner")); + } + } + + tileentityskull.setPlayerProfile(gameprofile);*/ + } else { + tileentityskull.setType(3); // Botania - Force type to 3 (humanoid) + } + + tileentityskull.setSkullRotation(i); + Blocks.SKULL.checkWitherSpawn(worldIn, pos, tileentityskull); + } + + --stack.stackSize; + return EnumActionResult.SUCCESS; + } + } else { + return EnumActionResult.FAIL; + } + } + } } diff --git a/src/main/java/vazkii/botania/common/item/ItemGrassHorn.java b/src/main/java/vazkii/botania/common/item/ItemGrassHorn.java index dec75518f..e706ed3de 100644 --- a/src/main/java/vazkii/botania/common/item/ItemGrassHorn.java +++ b/src/main/java/vazkii/botania/common/item/ItemGrassHorn.java @@ -10,86 +10,79 @@ */ package vazkii.botania.common.item; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Random; - import net.minecraft.block.Block; import net.minecraft.block.BlockBush; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; +import net.minecraft.init.SoundEvents; import net.minecraft.item.EnumAction; +import net.minecraft.item.IItemPropertyGetter; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.IIcon; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import vazkii.botania.api.item.IGrassHornExcempt; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.item.IHornHarvestable; import vazkii.botania.api.item.IHornHarvestable.EnumHornType; import vazkii.botania.api.subtile.ISpecialFlower; -import vazkii.botania.client.core.helper.IconHelper; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.lib.LibItemNames; +import vazkii.botania.common.lib.LibMisc; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Locale; +import java.util.Random; public class ItemGrassHorn extends ItemMod { private static final int SUBTYPES = 3; - IIcon[] icons; - IIcon vuvuzelaIcon; public ItemGrassHorn() { - super(); + super(LibItemNames.GRASS_HORN); setMaxStackSize(1); - setUnlocalizedName(LibItemNames.GRASS_HORN); setHasSubtypes(true); + addPropertyOverride(new ResourceLocation(LibMisc.MOD_ID, "vuvuzela"), + (stack, worldIn, entityIn) -> stack.getDisplayName().toLowerCase(Locale.ROOT).contains("vuvuzela") ? 1 : 0); } @Override - public void getSubItems(Item item, CreativeTabs tab, List list) { + @SideOnly(Side.CLIENT) + public void getSubItems(@Nonnull Item item, CreativeTabs tab, List list) { for(int i = 0; i < SUBTYPES; i++) list.add(new ItemStack(item, 1, i)); } - @Override - public void registerIcons(IIconRegister par1IconRegister) { - icons = new IIcon[SUBTYPES]; - for(int i = 0; i < icons.length; i++) - icons[i] = IconHelper.forItem(par1IconRegister, this, i); - vuvuzelaIcon = IconHelper.forName(par1IconRegister, "vuvuzela"); - } - - @Override - public IIcon getIconIndex(ItemStack par1ItemStack) { - return par1ItemStack.getDisplayName().toLowerCase().contains("vuvuzela") ? vuvuzelaIcon : super.getIconIndex(par1ItemStack); - } - - @Override - public IIcon getIcon(ItemStack stack, int pass) { - return getIconIndex(stack); - } - - @Override - public IIcon getIconFromDamage(int par1) { - return icons[Math.min(icons.length - 1, par1)]; - } - + @Nonnull @Override public String getUnlocalizedName(ItemStack par1ItemStack) { - return getUnlocalizedNameLazy(par1ItemStack) + par1ItemStack.getItemDamage(); + return super.getUnlocalizedName(par1ItemStack) + par1ItemStack.getItemDamage(); } - String getUnlocalizedNameLazy(ItemStack par1ItemStack) { - return super.getUnlocalizedName(par1ItemStack); + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerItemAppendMeta(this, 3, LibItemNames.GRASS_HORN); } + @Nonnull @Override public EnumAction getItemUseAction(ItemStack par1ItemStack) { - return EnumAction.bow; + return EnumAction.BOW; } @Override @@ -97,65 +90,59 @@ public class ItemGrassHorn extends ItemMod { return 72000; } + @Nonnull @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - par3EntityPlayer.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack)); - return par1ItemStack; + public ActionResult onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) { + player.setActiveHand(hand); + return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack); } @Override - public void onUsingTick(ItemStack stack, EntityPlayer player, int time) { - if(time != getMaxItemUseDuration(stack) && time % 5 == 0) - breakGrass(player.worldObj, stack, stack.getItemDamage(), (int) player.posX, (int) player.posY, (int) player.posZ); - - if(!player.worldObj.isRemote) - player.worldObj.playSoundAtEntity(player, "note.bassattack", 1F, 0.001F); + public void onUsingTick(ItemStack stack, EntityLivingBase player, int time) { + if(!player.worldObj.isRemote) { + if(time != getMaxItemUseDuration(stack) && time % 5 == 0) + breakGrass(player.worldObj, stack, stack.getItemDamage(), new BlockPos(player)); + player.worldObj.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.BLOCK_NOTE_BASS, SoundCategory.BLOCKS, 1F, 0.001F); + } } - public static void breakGrass(World world, ItemStack stack, int stackDmg, int srcx, int srcy, int srcz) { + public static void breakGrass(World world, ItemStack stack, int stackDmg, BlockPos srcPos) { EnumHornType type = EnumHornType.getTypeForMeta(stackDmg); - Random rand = new Random(srcx ^ srcy ^ srcz); + Random rand = new Random(srcPos.hashCode()); int range = 12 - stackDmg * 3; int rangeY = 3 + stackDmg * 4; - List coords = new ArrayList(); + List coords = new ArrayList<>(); - for(int i = -range; i < range + 1; i++) - for(int j = -range; j < range + 1; j++) - for(int k = -rangeY; k < rangeY + 1; k++) { - int x = srcx + i; - int y = srcy + k; - int z = srcz + j; - - Block block = world.getBlock(x, y, z); - if(block instanceof IHornHarvestable ? ((IHornHarvestable) block).canHornHarvest(world, x, y, z, stack, type) : stackDmg == 0 && block instanceof BlockBush && !(block instanceof ISpecialFlower) && (!(block instanceof IGrassHornExcempt) || ((IGrassHornExcempt) block).canUproot(world, x, y, z)) || stackDmg == 1 && block.isLeaves(world, x, y, z) || stackDmg == 2 && block == Blocks.snow_layer) - coords.add(new ChunkCoordinates(x, y, z)); - } + for(BlockPos pos : BlockPos.getAllInBox(srcPos.add(-range, -rangeY, -range), srcPos.add(range, rangeY, range))) { + Block block = world.getBlockState(pos).getBlock(); + if(block instanceof IHornHarvestable + ? ((IHornHarvestable) block).canHornHarvest(world, pos, stack, type) + : stackDmg == 0 && block instanceof BlockBush && !(block instanceof ISpecialFlower) + || stackDmg == 1 && block.isLeaves(world.getBlockState(pos), world, pos) + || stackDmg == 2 && block == Blocks.SNOW_LAYER) + coords.add(pos); + } Collections.shuffle(coords, rand); int count = Math.min(coords.size(), 32 + stackDmg * 16); for(int i = 0; i < count; i++) { - ChunkCoordinates currCoords = coords.get(i); - List items = new ArrayList(); - Block block = world.getBlock(currCoords.posX, currCoords.posY, currCoords.posZ); - int meta = world.getBlockMetadata(currCoords.posX, currCoords.posY, currCoords.posZ); - items.addAll(block.getDrops(world, currCoords.posX, currCoords.posY, currCoords.posZ, meta, 0)); + BlockPos currCoords = coords.get(i); + IBlockState state = world.getBlockState(currCoords); + Block block = state.getBlock(); + List items = block.getDrops(world, currCoords, state, 0); - if(block instanceof IHornHarvestable && ((IHornHarvestable) block).hasSpecialHornHarvest(world, currCoords.posX, currCoords.posY, currCoords.posZ, stack, type)) - ((IHornHarvestable) block).harvestByHorn(world, currCoords.posX, currCoords.posY, currCoords.posZ, stack, type); - else if(!world.isRemote) { - world.setBlockToAir(currCoords.posX, currCoords.posY, currCoords.posZ); + if(block instanceof IHornHarvestable && ((IHornHarvestable) block).hasSpecialHornHarvest(world, currCoords, stack, type)) + ((IHornHarvestable) block).harvestByHorn(world, currCoords, stack, type); + else { + world.setBlockToAir(currCoords); if(ConfigHandler.blockBreakParticles) - world.playAuxSFX(2001, currCoords.posX, currCoords.posY, currCoords.posZ, Block.getIdFromBlock(block) + (meta << 12)); + world.playEvent(2001, currCoords, Block.getStateId(state)); for(ItemStack stack_ : items) - world.spawnEntityInWorld(new EntityItem(world, currCoords.posX + 0.5, currCoords.posY + 0.5, currCoords.posZ + 0.5, stack_)); + world.spawnEntityInWorld(new EntityItem(world, currCoords.getX() + 0.5, currCoords.getY() + 0.5, currCoords.getZ() + 0.5, stack_)); } } } - @Override - public boolean isFull3D() { - return true; - } } diff --git a/src/main/java/vazkii/botania/common/item/ItemGrassSeeds.java b/src/main/java/vazkii/botania/common/item/ItemGrassSeeds.java index b63033154..4bac00777 100644 --- a/src/main/java/vazkii/botania/common/item/ItemGrassSeeds.java +++ b/src/main/java/vazkii/botania/common/item/ItemGrassSeeds.java @@ -10,36 +10,41 @@ */ package vazkii.botania.common.item; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Random; -import java.util.Set; - +import gnu.trove.map.hash.TIntObjectHashMap; import net.minecraft.block.Block; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.BlockDirt; +import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import vazkii.botania.client.core.helper.IconHelper; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.api.item.IFloatingFlower.IslandType; +import vazkii.botania.api.state.BotaniaStateProps; +import vazkii.botania.api.state.enums.AltGrassVariant; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.Botania; import vazkii.botania.common.block.ModBlocks; -import vazkii.botania.common.block.decor.IFloatingFlower.IslandType; import vazkii.botania.common.lib.LibItemNames; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.TickEvent; -import cpw.mods.fml.common.gameevent.TickEvent.Phase; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import java.util.Set; public class ItemGrassSeeds extends ItemMod implements IFloatingFlowerVariant { @@ -47,7 +52,7 @@ public class ItemGrassSeeds extends ItemMod implements IFloatingFlowerVariant { * Represents a map of dimension IDs to a set of all block swappers * active in that dimension. */ - private static Map> blockSwappers = new HashMap>(); + private static final TIntObjectHashMap> blockSwappers = new TIntObjectHashMap<>(); private static final IslandType[] ISLAND_TYPES = { IslandType.GRASS, IslandType.PODZOL, IslandType.MYCEL, @@ -56,50 +61,36 @@ public class ItemGrassSeeds extends ItemMod implements IFloatingFlowerVariant { }; private static final int SUBTYPES = 9; - IIcon[] icons; public ItemGrassSeeds() { - super(); - setUnlocalizedName(LibItemNames.GRASS_SEEDS); + super(LibItemNames.GRASS_SEEDS); setHasSubtypes(true); - FMLCommonHandler.instance().bus().register(this); - } - - @Override - public void getSubItems(Item par1, CreativeTabs par2, List par3) { - for(int i = 0; i < SUBTYPES; i++) - par3.add(new ItemStack(par1, 1, i)); + MinecraftForge.EVENT_BUS.register(this); } @Override @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) { - icons = new IIcon[SUBTYPES]; + public void getSubItems(@Nonnull Item item, CreativeTabs par2, List par3) { for(int i = 0; i < SUBTYPES; i++) - icons[i] = IconHelper.forItem(par1IconRegister, this, i); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamage(int par1) { - return icons[Math.min(icons.length - 1, par1)]; + par3.add(new ItemStack(item, 1, i)); } + @Nonnull @Override public String getUnlocalizedName(ItemStack stack) { return super.getUnlocalizedName() + stack.getItemDamage(); } + @Nonnull @Override - public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { - Block block = par3World.getBlock(par4, par5, par6); - int bmeta = par3World.getBlockMetadata(par4, par5, par6); + public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) { + IBlockState state = world.getBlockState(pos); - if((block == Blocks.dirt || block == Blocks.grass && par1ItemStack.getItemDamage() != 0) && bmeta == 0) { + if((state.getBlock() == Blocks.DIRT && state.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.DIRT) || (state.getBlock() == Blocks.GRASS && par1ItemStack.getItemDamage() != 0)) { int meta = par1ItemStack.getItemDamage(); - BlockSwapper swapper = addBlockSwapper(par3World, par4, par5, par6, meta); - par3World.setBlock(par4, par5, par6, swapper.blockToSet, swapper.metaToSet, 1 | 2); + BlockSwapper swapper = addBlockSwapper(world, pos, meta); + world.setBlockState(pos, swapper.stateToSet, 1 | 2); for(int i = 0; i < 50; i++) { double x = (Math.random() - 0.5) * 3; double y = Math.random() - 0.5 + 1; @@ -161,13 +152,20 @@ public class ItemGrassSeeds extends ItemMod implements IFloatingFlowerVariant { float velMul = 0.025F; - Botania.proxy.wispFX(par3World, par4 + 0.5 + x, par5 + 0.5 + y, par6 + 0.5 + z, r, g, b, (float) Math.random() * 0.15F + 0.15F, (float) -x * velMul, (float) -y * velMul, (float) -z * velMul); + Botania.proxy.wispFX(pos.getX() + 0.5 + x, pos.getY() + 0.5 + y, pos.getZ() + 0.5 + z, r, g, b, (float) Math.random() * 0.15F + 0.15F, (float) -x * velMul, (float) -y * velMul, (float) -z * velMul); } par1ItemStack.stackSize--; + return EnumActionResult.SUCCESS; } - return true; + return EnumActionResult.PASS; + } + + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerItemAppendMeta(this, 9, LibItemNames.GRASS_SEEDS); } @SubscribeEvent @@ -177,7 +175,7 @@ public class ItemGrassSeeds extends ItemMod implements IFloatingFlowerVariant { return; if(event.phase == Phase.END) { - int dim = event.world.provider.dimensionId; + int dim = event.world.provider.getDimension(); if(blockSwappers.containsKey(dim)) { Set swappers = blockSwappers.get(dim); @@ -201,23 +199,21 @@ public class ItemGrassSeeds extends ItemMod implements IFloatingFlowerVariant { * calling this method will recieve a marker block swapper which contains * the provided information but is not ticked. * @param world The world the swapper will be in. - * @param x The x-position of the swapper. - * @param y The y-position of the swapper. - * @param z The z-position of the swapper. + * @param pos The position of the swapper. * @param meta The meta value representing the type of block being swapped. * @return The created block swapper. */ - private static BlockSwapper addBlockSwapper(World world, int x, int y, int z, int meta) { - BlockSwapper swapper = swapperFromMeta(world, x, y, z, meta); + private static BlockSwapper addBlockSwapper(World world, BlockPos pos, int meta) { + BlockSwapper swapper = swapperFromMeta(world, pos, meta); // Block swappers are only registered on the server if(world.isRemote) return swapper; // If a set for the dimension doesn't exist, create it. - int dim = world.provider.dimensionId; + int dim = world.provider.getDimension(); if(!blockSwappers.containsKey(dim)) - blockSwappers.put(dim, new HashSet()); + blockSwappers.put(dim, new HashSet<>()); // Add the block swapper blockSwappers.get(dim).add(swapper); @@ -225,17 +221,17 @@ public class ItemGrassSeeds extends ItemMod implements IFloatingFlowerVariant { return swapper; } - private static BlockSwapper swapperFromMeta(World world, int x, int y, int z, int meta) { + private static BlockSwapper swapperFromMeta(World world, BlockPos pos, int meta) { switch(meta) { - case 1 : return new BlockSwapper(world, new ChunkCoordinates(x, y, z), Blocks.dirt, 2); - case 2 : return new BlockSwapper(world, new ChunkCoordinates(x, y, z), Blocks.mycelium, 0); - case 3 : return new BlockSwapper(world, new ChunkCoordinates(x, y, z), ModBlocks.altGrass, 0); - case 4 : return new BlockSwapper(world, new ChunkCoordinates(x, y, z), ModBlocks.altGrass, 1); - case 5 : return new BlockSwapper(world, new ChunkCoordinates(x, y, z), ModBlocks.altGrass, 2); - case 6 : return new BlockSwapper(world, new ChunkCoordinates(x, y, z), ModBlocks.altGrass, 3); - case 7 : return new BlockSwapper(world, new ChunkCoordinates(x, y, z), ModBlocks.altGrass, 4); - case 8 : return new BlockSwapper(world, new ChunkCoordinates(x, y, z), ModBlocks.altGrass, 5); - default : return new BlockSwapper(world, new ChunkCoordinates(x, y, z), Blocks.grass, 0); + case 1 : return new BlockSwapper(world, pos, Blocks.DIRT.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.PODZOL)); + case 2 : return new BlockSwapper(world, pos, Blocks.MYCELIUM.getDefaultState()); + case 3 : return new BlockSwapper(world, pos, ModBlocks.altGrass.getDefaultState().withProperty(BotaniaStateProps.ALTGRASS_VARIANT, AltGrassVariant.DRY)); + case 4 : return new BlockSwapper(world, pos, ModBlocks.altGrass.getDefaultState().withProperty(BotaniaStateProps.ALTGRASS_VARIANT, AltGrassVariant.GOLDEN)); + case 5 : return new BlockSwapper(world, pos, ModBlocks.altGrass.getDefaultState().withProperty(BotaniaStateProps.ALTGRASS_VARIANT, AltGrassVariant.VIVID)); + case 6 : return new BlockSwapper(world, pos, ModBlocks.altGrass.getDefaultState().withProperty(BotaniaStateProps.ALTGRASS_VARIANT, AltGrassVariant.SCORCHED)); + case 7 : return new BlockSwapper(world, pos, ModBlocks.altGrass.getDefaultState().withProperty(BotaniaStateProps.ALTGRASS_VARIANT, AltGrassVariant.INFUSED)); + case 8 : return new BlockSwapper(world, pos, ModBlocks.altGrass.getDefaultState().withProperty(BotaniaStateProps.ALTGRASS_VARIANT, AltGrassVariant.MUTATED)); + default : return new BlockSwapper(world, pos, Blocks.GRASS.getDefaultState()); } } @@ -244,7 +240,7 @@ public class ItemGrassSeeds extends ItemMod implements IFloatingFlowerVariant { * centered around a provided point to a provided block/metadata. */ private static class BlockSwapper { - + /** * The range of the block swapper, in blocks. */ @@ -257,10 +253,9 @@ public class ItemGrassSeeds extends ItemMod implements IFloatingFlowerVariant { private final World world; private final Random rand; - private final Block blockToSet; - private final int metaToSet; + private final IBlockState stateToSet; - private ChunkCoordinates startCoords; + private final BlockPos startCoords; private int ticksExisted = 0; /** @@ -268,14 +263,12 @@ public class ItemGrassSeeds extends ItemMod implements IFloatingFlowerVariant { * coordinates, target block, and target metadata. * @param world The world to swap blocks in. * @param coords The central coordinates to swap blocks around. - * @param block The target block to swap dirt and grass to. - * @param meta The metadata of the target block to swap dirt and grass to. + * @param state The target blockstate to swap dirt and grass to. */ - public BlockSwapper(World world, ChunkCoordinates coords, Block block, int meta) { + public BlockSwapper(World world, BlockPos coords, IBlockState state) { this.world = world; - this.blockToSet = block; - this.metaToSet = meta; - this.rand = new Random(coords.posX ^ coords.posY ^ coords.posZ); + this.stateToSet = state; + this.rand = new Random(coords.hashCode()); this.startCoords = coords; } @@ -287,24 +280,10 @@ public class ItemGrassSeeds extends ItemMod implements IFloatingFlowerVariant { * should be removed. */ public boolean tick() { - ++ticksExisted; - - // Go through all blocks in the specified RANGE, and then - // try and spread around that block if it is our target block already - for(int i = -RANGE; i <= RANGE; i++) { - for(int j = -RANGE; j <= RANGE; j++) { - int x = startCoords.posX + i; - int y = startCoords.posY; - int z = startCoords.posZ + j; - Block block = world.getBlock(x, y, z); - int meta = world.getBlockMetadata(x, y, z); - - if(block == blockToSet && meta == metaToSet) { - // Only make changes every 20 ticks - if(ticksExisted % 20 != 0) continue; - - tickBlock(x, y, z); - } + if(++ticksExisted % 20 == 0) { + for(BlockPos pos : BlockPos.getAllInBox(startCoords.add(-RANGE, 0, -RANGE), startCoords.add(RANGE, 0, RANGE))) { + if(world.getBlockState(pos) == stateToSet) + tickBlock(pos); } } @@ -315,12 +294,10 @@ public class ItemGrassSeeds extends ItemMod implements IFloatingFlowerVariant { /** * Tick a specific block position, finding the valid blocks * immediately adjacent to it and then replacing one at random. - * @param x The x-coordinate to use. - * @param y The y-coordinate to use. - * @param z The z-coordinate to use. + * @param pos The positions to use. */ - public void tickBlock(int x, int y, int z) { - List validCoords = new ArrayList(); + public void tickBlock(BlockPos pos) { + List validCoords = new ArrayList<>(); // Go around this block and aggregate valid blocks. for(int xOffset = -TICK_RANGE; xOffset <= TICK_RANGE; xOffset++) { @@ -328,17 +305,17 @@ public class ItemGrassSeeds extends ItemMod implements IFloatingFlowerVariant { // Skip the current block if(xOffset == 0 && zOffset == 0) continue; - if(isValidSwapPosition(x + xOffset, y, z + zOffset)) - validCoords.add(new ChunkCoordinates(x + xOffset, y, z + zOffset)); + if(isValidSwapPosition(pos.add(xOffset, 0, zOffset))) + validCoords.add(pos.add(xOffset, 0, zOffset)); } } // If we can make changes, and have at least 1 block to swap, // then swap a random block from the valid blocks we could swap. if(!validCoords.isEmpty() && !world.isRemote) { - ChunkCoordinates toSwap = validCoords.get(rand.nextInt(validCoords.size())); + BlockPos toSwap = validCoords.get(rand.nextInt(validCoords.size())); - world.setBlock(toSwap.posX, toSwap.posY, toSwap.posZ, blockToSet, metaToSet, 1 | 2); + world.setBlockState(toSwap, stateToSet, 1 | 2); } } @@ -346,16 +323,12 @@ public class ItemGrassSeeds extends ItemMod implements IFloatingFlowerVariant { * Determines if a given position is a valid location to spread to, which * means that the block must be either dirt or grass (with meta 0), * and have a block above it which does not block grass growth. - * @param x The x-coordinate to check. - * @param y The y-coordinate to check. - * @param z The z-coordinate to check. + * @param pos The position to check. * @return True if the position is valid to swap, false otherwise. */ - public boolean isValidSwapPosition(int x, int y, int z) { - Block block = world.getBlock(x, y, z); - int meta = world.getBlockMetadata(x, y, z); - - Block aboveBlock = world.getBlock(x, y + 1, z); + public boolean isValidSwapPosition(BlockPos pos) { + IBlockState state = world.getBlockState(pos); + Block block = state.getBlock(); // Valid blocks to spread to are either dirt or grass, and do not // have blocks which block grass growth. @@ -364,9 +337,9 @@ public class ItemGrassSeeds extends ItemMod implements IFloatingFlowerVariant { // The major rule is that a block which reduces light // levels by 2 or more blocks grass growth. - return (block == Blocks.dirt || block == Blocks.grass) - && (meta == 0) - && (aboveBlock.getLightOpacity(world, x, y, z) <= 1); + return (block == Blocks.DIRT || block == Blocks.GRASS) + && (block != Blocks.DIRT || state.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.DIRT) + && (world.getBlockState(pos.up()).getLightOpacity(world, pos.up()) <= 1); } } diff --git a/src/main/java/vazkii/botania/common/item/ItemKeepIvy.java b/src/main/java/vazkii/botania/common/item/ItemKeepIvy.java index 663dd323a..5182b7741 100644 --- a/src/main/java/vazkii/botania/common/item/ItemKeepIvy.java +++ b/src/main/java/vazkii/botania/common/item/ItemKeepIvy.java @@ -10,24 +10,23 @@ */ package vazkii.botania.common.item; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.PlayerDropsEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent; +import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.oredict.RecipeSorter; import net.minecraftforge.oredict.RecipeSorter.Category; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.crafting.recipe.KeepIvyRecipe; import vazkii.botania.common.lib.LibItemNames; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent; -import cpw.mods.fml.common.registry.GameRegistry; + +import java.util.ArrayList; +import java.util.List; public class ItemKeepIvy extends ItemMod { @@ -38,24 +37,23 @@ public class ItemKeepIvy extends ItemMod { private static final String TAG_DROP_PREFIX = "dropPrefix"; public ItemKeepIvy() { - setUnlocalizedName(LibItemNames.KEEP_IVY); + super(LibItemNames.KEEP_IVY); GameRegistry.addRecipe(new KeepIvyRecipe()); RecipeSorter.register("botania:keepIvy", KeepIvyRecipe.class, Category.SHAPELESS, ""); - MinecraftForge.EVENT_BUS.register(this); - FMLCommonHandler.instance().bus().register(this); + MinecraftForge.EVENT_BUS.register(ItemKeepIvy.class); } @SubscribeEvent public void onPlayerDrops(PlayerDropsEvent event) { - List keeps = new ArrayList(); - for(EntityItem item : event.drops) { + List keeps = new ArrayList<>(); + for(EntityItem item : event.getDrops()) { ItemStack stack = item.getEntityItem(); if(stack != null && ItemNBTHelper.detectNBT(stack) && ItemNBTHelper.getBoolean(stack, TAG_KEEP, false)) keeps.add(item); } if(keeps.size() > 0) { - event.drops.removeAll(keeps); + event.getDrops().removeAll(keeps); NBTTagCompound cmp = new NBTTagCompound(); @@ -70,7 +68,7 @@ public class ItemKeepIvy extends ItemMod { i++; } - NBTTagCompound data = event.entityPlayer.getEntityData(); + NBTTagCompound data = event.getEntityPlayer().getEntityData(); if(!data.hasKey(EntityPlayer.PERSISTED_NBT_TAG)) data.setTag(EntityPlayer.PERSISTED_NBT_TAG, new NBTTagCompound()); @@ -80,7 +78,7 @@ public class ItemKeepIvy extends ItemMod { } @SubscribeEvent - public void onPlayerRespawn(PlayerRespawnEvent event) { + public static void onPlayerRespawn(PlayerRespawnEvent event) { NBTTagCompound data = event.player.getEntityData(); if(data.hasKey(EntityPlayer.PERSISTED_NBT_TAG)) { NBTTagCompound cmp = data.getCompoundTag(EntityPlayer.PERSISTED_NBT_TAG); diff --git a/src/main/java/vazkii/botania/common/item/ItemLaputaShard.java b/src/main/java/vazkii/botania/common/item/ItemLaputaShard.java index fa7504baf..fd9df9ade 100644 --- a/src/main/java/vazkii/botania/common/item/ItemLaputaShard.java +++ b/src/main/java/vazkii/botania/common/item/ItemLaputaShard.java @@ -10,34 +10,48 @@ */ package vazkii.botania.common.item; -import java.util.List; - import net.minecraft.block.Block; import net.minecraft.block.BlockFalling; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.resources.I18n; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityThrowable; +import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.StatCollector; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.internal.IManaBurst; import vazkii.botania.api.mana.BurstProperties; import vazkii.botania.api.mana.ILaputaImmobile; import vazkii.botania.api.mana.ILensEffect; import vazkii.botania.api.mana.ITinyPlanetExcempt; +import vazkii.botania.api.sound.BotaniaSoundEvents; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.achievement.ModAchievements; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.core.helper.MathHelper; import vazkii.botania.common.entity.EntityManaBurst; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; +import java.util.List; + public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanetExcempt { private static final String TAG_BLOCK = "_block"; + private static final String TAG_BLOCK_NAME = "_blockname"; private static final String TAG_META = "_meta"; private static final String TAG_TILE = "_tile"; private static final String TAG_X = "_x"; @@ -54,50 +68,53 @@ public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanet private static final int BASE_OFFSET = 42; public ItemLaputaShard() { - setUnlocalizedName(LibItemNames.LAPUTA_SHARD); + super(LibItemNames.LAPUTA_SHARD); setHasSubtypes(true); } @Override - public void getSubItems(Item item, CreativeTabs tab, List list) { + @SideOnly(Side.CLIENT) + public void getSubItems(@Nonnull Item item, CreativeTabs tab, List list) { super.getSubItems(item, tab, list); for(int i = 0; i < 4; i++) list.add(new ItemStack(item, 1, (i + 1) * 5 - 1)); } + @SideOnly(Side.CLIENT) @Override - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean adv) { - list.add(String.format(StatCollector.translateToLocal("botaniamisc.shardLevel"), StatCollector.translateToLocal("botania.roman" + (stack.getItemDamage() + 1)))); + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean adv) { + list.add(I18n.format("botaniamisc.shardLevel", I18n.format("botania.roman" + (stack.getItemDamage() + 1)))); } + @Nonnull @Override - public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { - if(par5 < 160 && !par3World.provider.isHellWorld) { - par3World.playSound(par4 + 0.5D, par5 + 0.5D, par6 + 0.5D, "botania:laputaStart", 1.0F + par3World.rand.nextFloat(), par3World.rand.nextFloat() * 0.7F + 1.3F, false); - spawnBurstFirst(par3World, par4, par5, par6, par1ItemStack); + public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) { + if(!world.isRemote && pos.getY() < 160 && !world.provider.doesWaterVaporize()) { + world.playSound(null, pos, BotaniaSoundEvents.laputaStart, SoundCategory.BLOCKS, 1.0F + world.rand.nextFloat(), world.rand.nextFloat() * 0.7F + 1.3F); + spawnBurstFirst(world, pos, par1ItemStack); par1ItemStack.stackSize--; if(par1ItemStack.getItemDamage() == 19) - par2EntityPlayer.addStat(ModAchievements.l20ShardUse, 1); + player.addStat(ModAchievements.l20ShardUse, 1); } - return true; + return EnumActionResult.SUCCESS; } - public void spawnBurstFirst(World world, int srcx, int srcy, int srcz, ItemStack lens) { + public void spawnBurstFirst(World world, BlockPos pos, ItemStack lens) { int range = BASE_RANGE + lens.getItemDamage(); boolean pointy = world.rand.nextDouble() < 0.25; double heightscale = (world.rand.nextDouble() + 0.5) * ((double)BASE_RANGE / (double)range); - spawnBurst(world, srcx, srcy, srcz, lens, pointy, heightscale); + spawnBurst(world, pos, lens, pointy, heightscale); } - public void spawnBurst(World world, int srcx, int srcy, int srcz, ItemStack lens) { + public void spawnBurst(World world, BlockPos pos, ItemStack lens) { boolean pointy = ItemNBTHelper.getBoolean(lens, TAG_POINTY, false); double heightscale = ItemNBTHelper.getDouble(lens, TAG_HEIGHTSCALE, 1); - spawnBurst(world, srcx, srcy, srcz, lens, pointy, heightscale); + spawnBurst(world, pos, lens, pointy, heightscale); } - public void spawnBurst(World world, int srcx, int srcy, int srcz, ItemStack lens, boolean pointy, double heightscale) { + public void spawnBurst(World world, BlockPos pos, ItemStack lens, boolean pointy, double heightscale) { int range = BASE_RANGE + lens.getItemDamage(); int i = ItemNBTHelper.getInt(lens, TAG_ITERATION_I, 0); @@ -113,42 +130,39 @@ public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanet for(; i < range * 2 + 1; i++) { for(; j > -BASE_RANGE * 2; j--) { for(; k < range * 2 + 1; k++) { - int x = srcx - range + i; - int y = srcy - BASE_RANGE + j; - int z = srcz - range + k; + BlockPos pos_ = pos.add(-range + i, -BASE_RANGE + j, -range + k); - if(inRange(x, y, z, srcx, srcy, srcz, range, heightscale, pointy)) { - Block block = world.getBlock(x, y, z); - if(!block.isAir(world, x, y, z) && !block.isReplaceable(world, x, y, z) && !(block instanceof BlockFalling) && (!(block instanceof ILaputaImmobile) || ((ILaputaImmobile) block).canMove(world, x, y, z)) && block.getBlockHardness(world, x, y, z) != -1) { - int id = Block.getIdFromBlock(block); - int meta = world.getBlockMetadata(x, y, z); - TileEntity tile = world.getTileEntity(x, y, z); + if(inRange(pos_, pos, range, heightscale, pointy)) { + IBlockState state = world.getBlockState(pos_); + Block block = state.getBlock(); + if(!block.isAir(state, world, pos_) && !block.isReplaceable(world, pos_) && !(block instanceof BlockFalling) && (!(block instanceof ILaputaImmobile) || ((ILaputaImmobile) block).canMove(world, pos_)) && state.getBlockHardness(world, pos_) != -1) { + TileEntity tile = world.getTileEntity(pos_); if(tile != null) { - TileEntity newTile = block.createTileEntity(world, meta); - world.setTileEntity(x, y, z, newTile); + TileEntity newTile = block.createTileEntity(world, state); + world.setTileEntity(pos_, newTile); } - world.setBlockToAir(x, y, z); - world.playAuxSFX(2001, x, y, z, id + (meta << 12)); + world.setBlockToAir(pos_); + world.playEvent(2001, pos_, Block.getStateId(state)); ItemStack copyLens = new ItemStack(this, 1, lens.getItemDamage()); - ItemNBTHelper.setInt(copyLens, TAG_BLOCK, id); - ItemNBTHelper.setInt(copyLens, TAG_META, meta); + ItemNBTHelper.setString(copyLens, TAG_BLOCK_NAME, Block.REGISTRY.getNameForObject(block).toString()); + ItemNBTHelper.setInt(copyLens, TAG_META, block.getMetaFromState(state)); NBTTagCompound cmp = new NBTTagCompound(); if(tile != null) tile.writeToNBT(cmp); ItemNBTHelper.setCompound(copyLens, TAG_TILE, cmp); - ItemNBTHelper.setInt(copyLens, TAG_X, srcx); - ItemNBTHelper.setInt(copyLens, TAG_Y, srcy); - ItemNBTHelper.setInt(copyLens, TAG_Y_START, y); - ItemNBTHelper.setInt(copyLens, TAG_Z, srcz); + ItemNBTHelper.setInt(copyLens, TAG_X, pos.getX()); + ItemNBTHelper.setInt(copyLens, TAG_Y, pos.getY()); + ItemNBTHelper.setInt(copyLens, TAG_Y_START, pos_.getY()); + ItemNBTHelper.setInt(copyLens, TAG_Z, pos.getZ()); ItemNBTHelper.setBoolean(copyLens, TAG_POINTY, pointy); ItemNBTHelper.setDouble(copyLens, TAG_HEIGHTSCALE, heightscale); ItemNBTHelper.setInt(copyLens, TAG_ITERATION_I, i); ItemNBTHelper.setInt(copyLens, TAG_ITERATION_J, j); ItemNBTHelper.setInt(copyLens, TAG_ITERATION_K, k); - EntityManaBurst burst = getBurst(world, x, y, z, copyLens); + EntityManaBurst burst = getBurst(world, pos_, copyLens); world.spawnEntityInWorld(burst); return; } @@ -161,19 +175,19 @@ public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanet } } - private boolean inRange(int x, int y, int z, int srcx, int srcy, int srcz, int range, double heightscale, boolean pointy) { - if(y >= srcy) - return MathHelper.pointDistanceSpace(x, 0, z, srcx, 0, srcz) < range; + private boolean inRange(BlockPos pos, BlockPos srcPos, int range, double heightscale, boolean pointy) { + if(pos.getY() >= srcPos.getY()) + return MathHelper.pointDistanceSpace(pos.getX(), 0, pos.getZ(), srcPos.getX(), 0, srcPos.getZ()) < range; else if(!pointy) - return MathHelper.pointDistanceSpace(x, y / heightscale, z, srcx, srcy / heightscale, srcz) < range; - else return MathHelper.pointDistanceSpace(x, 0, z, srcx, 0, srcz) < range - (srcy - y) / heightscale; + return MathHelper.pointDistanceSpace(pos.getX(), pos.getY() / heightscale, pos.getZ(), srcPos.getX(), srcPos.getY() / heightscale, srcPos.getZ()) < range; + else return MathHelper.pointDistanceSpace(pos.getX(), 0, pos.getZ(), srcPos.getX(), 0, srcPos.getZ()) < range - (srcPos.getY() - pos.getY()) / heightscale; } - public EntityManaBurst getBurst(World world, int x, int y, int z, ItemStack stack) { + public EntityManaBurst getBurst(World world, BlockPos pos, ItemStack stack) { EntityManaBurst burst = new EntityManaBurst(world); - burst.posX = x + 0.5; - burst.posY = y + 0.5; - burst.posZ = z + 0.5; + burst.posX = pos.getX() + 0.5; + burst.posY = pos.getY() + 0.5; + burst.posZ = pos.getZ() + 0.5; burst.setColor(0x00EAFF); burst.setMana(1); @@ -188,12 +202,10 @@ public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanet } @Override - public void apply(ItemStack stack, BurstProperties props) { - // NO-OP - } + public void apply(ItemStack stack, BurstProperties props) {} @Override - public boolean collideBurst(IManaBurst burst, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) { + public boolean collideBurst(IManaBurst burst, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) { return false; } @@ -208,7 +220,7 @@ public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanet entity.motionZ = 0; final int spawnTicks = 2; - final int placeTicks = net.minecraft.util.MathHelper.floor_double(targetDistance / speed); + final int placeTicks = net.minecraft.util.math.MathHelper.floor_double(targetDistance / speed); ItemStack lens = burst.getSourceLens(); @@ -218,29 +230,35 @@ public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanet int z = ItemNBTHelper.getInt(lens, TAG_Z, 0); if(y != -1) - spawnBurst(entity.worldObj, x, y, z, lens); + spawnBurst(entity.worldObj, new BlockPos(x, y, z), lens); } else if(burst.getTicksExisted() == placeTicks) { - int x = net.minecraft.util.MathHelper.floor_double(entity.posX); + int x = net.minecraft.util.math.MathHelper.floor_double(entity.posX); int y = ItemNBTHelper.getInt(lens, TAG_Y_START, -1) + targetDistance; - int z = net.minecraft.util.MathHelper.floor_double(entity.posZ); + int z = net.minecraft.util.math.MathHelper.floor_double(entity.posZ); + BlockPos pos = new BlockPos(x, y, z); - if(entity.worldObj.isAirBlock(x, y, z)) { - int id = ItemNBTHelper.getInt(lens, TAG_BLOCK, 0); - Block block = Block.getBlockById(id); + if(entity.worldObj.isAirBlock(pos)) { + Block block = Blocks.AIR; + if (lens.hasTagCompound()) { + if (lens.getTagCompound().hasKey(TAG_BLOCK_NAME)) { + block = Block.getBlockFromName(ItemNBTHelper.getString(lens, TAG_BLOCK_NAME, "")); + } else if (lens.getTagCompound().hasKey(TAG_BLOCK)) { + // Attempt to read legacy tag (integer ID) if string block ID is absent + block = Block.getBlockById(ItemNBTHelper.getInt(lens, TAG_BLOCK, 0)); + } + } int meta = ItemNBTHelper.getInt(lens, TAG_META, 0); TileEntity tile = null; NBTTagCompound tilecmp = ItemNBTHelper.getCompound(lens, TAG_TILE, false); if(tilecmp.hasKey("id")) - tile = TileEntity.createAndLoadEntity(tilecmp); + tile = TileEntity.func_190200_a(entity.worldObj, tilecmp); - entity.worldObj.setBlock(x, y, z, block, meta, 1 | 2); - entity.worldObj.playAuxSFX(2001, x, y, z, id + (meta << 12)); + entity.worldObj.setBlockState(pos, block.getStateFromMeta(meta), 1 | 2); + entity.worldObj.playEvent(2001, pos, Block.getStateId(block.getStateFromMeta(meta))); if(tile != null) { - tile.xCoord = x; - tile.yCoord = y; - tile.zCoord = z; - entity.worldObj.setTileEntity(x, y, z, tile); + tile.setPos(pos); + entity.worldObj.setTileEntity(pos, tile); } } @@ -253,10 +271,10 @@ public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanet public boolean doParticles(IManaBurst burst, ItemStack stack) { EntityThrowable entity = (EntityThrowable) burst; ItemStack lens = burst.getSourceLens(); - int id = ItemNBTHelper.getInt(lens, TAG_BLOCK, 0); - Block.getBlockById(id); + String id = ItemNBTHelper.getString(lens, TAG_BLOCK_NAME, "minecraft:air"); + Block b = Block.getBlockFromName(id); int meta = ItemNBTHelper.getInt(lens, TAG_META, 0); - entity.worldObj.spawnParticle("blockcrack_" + id + "_" + meta, entity.posX, entity.posY, entity.posZ, entity.motionX, entity.motionY, entity.motionZ); + entity.worldObj.spawnParticle(EnumParticleTypes.BLOCK_CRACK, entity.posX, entity.posY, entity.posZ, entity.motionX, entity.motionY, entity.motionZ, Block.getStateId(b.getStateFromMeta(meta))); return true; } @@ -266,4 +284,10 @@ public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanet return false; } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerItemAllMeta(this, 20); + } + } diff --git a/src/main/java/vazkii/botania/common/item/ItemLexicon.java b/src/main/java/vazkii/botania/common/item/ItemLexicon.java index 0c57f3c3e..a7e7a7ba0 100644 --- a/src/main/java/vazkii/botania/common/item/ItemLexicon.java +++ b/src/main/java/vazkii/botania/common/item/ItemLexicon.java @@ -10,79 +10,93 @@ */ package vazkii.botania.common.item; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.block.Block; import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.resources.I18n; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.util.ChatStyle; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.StatCollector; -import net.minecraft.util.Vec3; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.math.Vec3d; +import net.minecraft.util.text.Style; +import net.minecraft.util.text.TextComponentTranslation; +import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.lexicon.ILexicon; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.lexicon.KnowledgeType; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.recipe.IElvenItem; +import vazkii.botania.api.sound.BotaniaSoundEvents; import vazkii.botania.common.Botania; import vazkii.botania.common.achievement.ModAchievements; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.core.helper.MathHelper; +import vazkii.botania.common.core.helper.PlayerHelper; import vazkii.botania.common.item.relic.ItemDice; import vazkii.botania.common.lib.LibGuiIDs; import vazkii.botania.common.lib.LibItemNames; import vazkii.botania.common.lib.LibMisc; +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.List; + public class ItemLexicon extends ItemMod implements ILexicon, IElvenItem { private static final String TAG_KNOWLEDGE_PREFIX = "knowledge."; private static final String TAG_FORCED_MESSAGE = "forcedMessage"; private static final String TAG_QUEUE_TICKS = "queueTicks"; - boolean skipSound = false; + private boolean skipSound = false; public ItemLexicon() { - super(); + super(LibItemNames.LEXICON); setMaxStackSize(1); - setUnlocalizedName(LibItemNames.LEXICON); } + @Nonnull @Override - public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { - if(par2EntityPlayer.isSneaking()) { - Block block = par3World.getBlock(par4, par5, par6); + public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) { + if(player.isSneaking()) { + Block block = world.getBlockState(pos).getBlock(); if(block != null) { if(block instanceof ILexiconable) { - LexiconEntry entry = ((ILexiconable) block).getEntry(par3World, par4, par5, par6, par2EntityPlayer, par1ItemStack); + LexiconEntry entry = ((ILexiconable) block).getEntry(world, pos, player, par1ItemStack); if(entry != null && isKnowledgeUnlocked(par1ItemStack, entry.getKnowledgeType())) { Botania.proxy.setEntryToOpen(entry); Botania.proxy.setLexiconStack(par1ItemStack); - openBook(par2EntityPlayer, par1ItemStack, par3World, false); - return true; + openBook(player, par1ItemStack, world, false); + return EnumActionResult.SUCCESS; } - } else if(par3World.isRemote) { - MovingObjectPosition pos = new MovingObjectPosition(par4, par5, par6, par7, Vec3.createVectorHelper(par8, par9, par10)); - return Botania.proxy.openWikiPage(par3World, block, pos); + } else if(world.isRemote) { + RayTraceResult mop = new RayTraceResult(new Vec3d(par8, par9, par10), side, pos); + return Botania.proxy.openWikiPage(world, block, mop) ? EnumActionResult.SUCCESS : EnumActionResult.FAIL; } } } - return false; + return EnumActionResult.PASS; } @Override - public void getSubItems(Item item, CreativeTabs tab, List list) { + @SideOnly(Side.CLIENT) + public void getSubItems(@Nonnull Item item, CreativeTabs tab, List list) { list.add(new ItemStack(item)); ItemStack creative = new ItemStack(item); for(String s : BotaniaAPI.knowledgeTypes.keySet()) { @@ -92,14 +106,15 @@ public class ItemLexicon extends ItemMod implements ILexicon, IElvenItem { list.add(creative); } + @SideOnly(Side.CLIENT) @Override - public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { + public void addInformation(ItemStack par1ItemStack, EntityPlayer player, List stacks, boolean par4) { if(GuiScreen.isShiftKeyDown()) { - String edition = EnumChatFormatting.GOLD + String.format(StatCollector.translateToLocal("botaniamisc.edition"), getEdition()); + String edition = TextFormatting.GOLD + I18n.format("botaniamisc.edition", getEdition()); if(!edition.isEmpty()) - par3List.add(edition); + stacks.add(edition); - List typesKnown = new ArrayList(); + List typesKnown = new ArrayList<>(); for(String s : BotaniaAPI.knowledgeTypes.keySet()) { KnowledgeType type = BotaniaAPI.knowledgeTypes.get(s); if(isKnowledgeUnlocked(par1ItemStack, type)) @@ -107,39 +122,41 @@ public class ItemLexicon extends ItemMod implements ILexicon, IElvenItem { } String format = typesKnown.size() == 1 ? "botaniamisc.knowledgeTypesSingular" : "botaniamisc.knowledgeTypesPlural"; - addStringToTooltip(String.format(StatCollector.translateToLocal(format), typesKnown.size()), par3List); + addStringToTooltip(I18n.format(format, typesKnown.size()), stacks); for(KnowledgeType type : typesKnown) - addStringToTooltip(" \u2022 " + StatCollector.translateToLocal(type.getUnlocalizedName()), par3List); + addStringToTooltip(" \u2022 " + I18n.format(type.getUnlocalizedName()), stacks); - } else addStringToTooltip(StatCollector.translateToLocal("botaniamisc.shiftinfo"), par3List); + } else addStringToTooltip(I18n.format("botaniamisc.shiftinfo"), stacks); } private void addStringToTooltip(String s, List tooltip) { tooltip.add(s.replaceAll("&", "\u00a7")); } + @SideOnly(Side.CLIENT) public static String getEdition() { String version = LibMisc.BUILD; int build = version.contains("GRADLE") ? 0 : Integer.parseInt(version); - return build == 0 ? StatCollector.translateToLocal("botaniamisc.devEdition") : MathHelper.numberToOrdinal(build); + return build == 0 ? I18n.format("botaniamisc.devEdition") : MathHelper.numberToOrdinal(build); } + @Nonnull @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { + public ActionResult onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) { String force = getForcedPage(par1ItemStack); if(force != null && !force.isEmpty()) { LexiconEntry entry = getEntryFromForce(par1ItemStack); if(entry != null) Botania.proxy.setEntryToOpen(entry); - else par3EntityPlayer.addChatMessage(new ChatComponentTranslation("botaniamisc.cantOpen").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED))); + else player.addChatMessage(new TextComponentTranslation("botaniamisc.cantOpen").setStyle(new Style().setColor(TextFormatting.RED))); setForcedPage(par1ItemStack, ""); } - openBook(par3EntityPlayer, par1ItemStack, par2World, skipSound); + openBook(player, par1ItemStack, world, skipSound); skipSound = false; - return par1ItemStack; + return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack); } public static void openBook(EntityPlayer player, ItemStack stack, World world, boolean skipSound) { @@ -150,7 +167,7 @@ public class ItemLexicon extends ItemMod implements ILexicon, IElvenItem { if(!l.isKnowledgeUnlocked(stack, BotaniaAPI.relicKnowledge) && l.isKnowledgeUnlocked(stack, BotaniaAPI.elvenKnowledge)) for(ItemStack rstack : ItemDice.relicStacks) { Item item = rstack.getItem(); - if(player.inventory.hasItem(item)) { + if(PlayerHelper.hasItem(player, s -> s != null && s.getItem() == item)) { l.unlockKnowledge(stack, BotaniaAPI.relicKnowledge); break; } @@ -160,7 +177,7 @@ public class ItemLexicon extends ItemMod implements ILexicon, IElvenItem { player.addStat(ModAchievements.lexiconUse, 1); player.openGui(Botania.instance, LibGuiIDs.LEXICON, world, 0, 0, 0); if(!world.isRemote && !skipSound) - world.playSoundAtEntity(player, "botania:lexiconOpen", 0.5F, 1F); + world.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.lexiconOpen, SoundCategory.PLAYERS, 0.5F, 1F); } @Override @@ -169,15 +186,16 @@ public class ItemLexicon extends ItemMod implements ILexicon, IElvenItem { if(ticks > 0 && entity instanceof EntityPlayer) { skipSound = ticks < 5; if(ticks == 1) - onItemRightClick(stack, world, (EntityPlayer) entity); + onItemRightClick(stack, world, (EntityPlayer) entity, EnumHand.MAIN_HAND); setQueueTicks(stack, ticks - 1); } } + @Nonnull @Override public EnumRarity getRarity(ItemStack par1ItemStack) { - return EnumRarity.uncommon; + return EnumRarity.UNCOMMON; } @Override @@ -222,4 +240,11 @@ public class ItemLexicon extends ItemMod implements ILexicon, IElvenItem { return isKnowledgeUnlocked(stack, BotaniaAPI.elvenKnowledge); } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelLoader.registerItemVariants(this, new ModelResourceLocation("botania:lexicon_default", "inventory")); + ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory")); + } + } diff --git a/src/main/java/vazkii/botania/common/item/ItemManaCookie.java b/src/main/java/vazkii/botania/common/item/ItemManaCookie.java index 04aa14620..b98ccc4d3 100644 --- a/src/main/java/vazkii/botania/common/item/ItemManaCookie.java +++ b/src/main/java/vazkii/botania/common/item/ItemManaCookie.java @@ -10,66 +10,58 @@ */ package vazkii.botania.common.item; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; +import net.minecraft.init.MobEffects; +import net.minecraft.item.IItemPropertyGetter; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.util.IIcon; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; -import vazkii.botania.client.core.helper.IconHelper; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.client.lib.LibResources; +import vazkii.botania.client.render.IModelRegister; import vazkii.botania.common.achievement.ModAchievements; import vazkii.botania.common.core.BotaniaCreativeTab; import vazkii.botania.common.lib.LibItemNames; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import vazkii.botania.common.lib.LibMisc; -public class ItemManaCookie extends ItemFood { +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.util.Locale; - private IIcon totalBiscuitIcon; +public class ItemManaCookie extends ItemFood implements IModelRegister { public ItemManaCookie() { super(0, 0.1F, false); - setPotionEffect(Potion.field_76443_y.id, 1, 0, 1F); + setPotionEffect(new PotionEffect(MobEffects.SATURATION, 20, 0), 1F); setCreativeTab(BotaniaCreativeTab.INSTANCE); + GameRegistry.register(this, new ResourceLocation(LibMisc.MOD_ID, LibItemNames.MANA_COOKIE)); setUnlocalizedName(LibItemNames.MANA_COOKIE); + addPropertyOverride(new ResourceLocation(LibMisc.MOD_ID, "totalbiscuit"), + (stack, worldIn, entityIn) -> stack.getDisplayName().toLowerCase(Locale.ROOT).contains("totalbiscuit") ? 1F : 0F); } @Override - protected void onFoodEaten(ItemStack p_77849_1_, World p_77849_2_, EntityPlayer p_77849_3_) { - super.onFoodEaten(p_77849_1_, p_77849_2_, p_77849_3_); - p_77849_3_.addStat(ModAchievements.manaCookieEat, 1); + protected void onFoodEaten(ItemStack stack, World world, @Nonnull EntityPlayer player) { + super.onFoodEaten(stack, world, player); + player.addStat(ModAchievements.manaCookieEat, 1); } + @Nonnull @Override - public Item setUnlocalizedName(String par1Str) { - GameRegistry.registerItem(this, par1Str); - return super.setUnlocalizedName(par1Str); - } - - @Override - public String getUnlocalizedNameInefficiently(ItemStack par1ItemStack) { + public String getUnlocalizedNameInefficiently(@Nonnull ItemStack par1ItemStack) { return super.getUnlocalizedNameInefficiently(par1ItemStack).replaceAll("item.", "item." + LibResources.PREFIX_MOD); } - @Override - public IIcon getIcon(ItemStack stack, int pass) { - return getIconIndex(stack); - } - - @Override - public IIcon getIconIndex(ItemStack stack) { - return stack.getDisplayName().toLowerCase().equals("totalbiscuit") ? totalBiscuitIcon : super.getIconIndex(stack); - } - - @Override @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) { - itemIcon = IconHelper.forItem(par1IconRegister, this); - totalBiscuitIcon = IconHelper.forName(par1IconRegister, "totalBiscuit"); + @Override + public void registerModels() { + ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory")); } - } diff --git a/src/main/java/vazkii/botania/common/item/ItemManaGun.java b/src/main/java/vazkii/botania/common/item/ItemManaGun.java index 30a8c2ef3..c5138f6cb 100644 --- a/src/main/java/vazkii/botania/common/item/ItemManaGun.java +++ b/src/main/java/vazkii/botania/common/item/ItemManaGun.java @@ -10,31 +10,39 @@ */ package vazkii.botania.common.item; -import java.awt.Color; -import java.util.List; - import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.resources.I18n; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.MobEffects; +import net.minecraft.init.SoundEvents; +import net.minecraft.item.IItemPropertyGetter; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.oredict.RecipeSorter; import net.minecraftforge.oredict.RecipeSorter.Category; import vazkii.botania.api.mana.BurstProperties; import vazkii.botania.api.mana.ILens; import vazkii.botania.api.mana.IManaUsingItem; import vazkii.botania.api.mana.ManaItemHandler; +import vazkii.botania.api.sound.BotaniaSoundEvents; import vazkii.botania.client.core.handler.ClientTickHandler; import vazkii.botania.client.core.handler.ItemsRemainingRenderHandler; -import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.common.achievement.ModAchievements; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.crafting.recipe.ManaGunClipRecipe; @@ -42,9 +50,11 @@ import vazkii.botania.common.crafting.recipe.ManaGunLensRecipe; import vazkii.botania.common.crafting.recipe.ManaGunRemoveLensRecipe; import vazkii.botania.common.entity.EntityManaBurst; import vazkii.botania.common.lib.LibItemNames; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import javax.annotation.Nonnull; +import java.awt.*; +import java.util.ArrayList; +import java.util.List; public class ItemManaGun extends ItemMod implements IManaUsingItem { @@ -55,14 +65,11 @@ public class ItemManaGun extends ItemMod implements IManaUsingItem { private static final int CLIP_SLOTS = 6; private static final int COOLDOWN = 30; - IIcon[] icons; - public ItemManaGun() { - super(); + super(LibItemNames.MANA_GUN); setMaxDamage(COOLDOWN); setMaxStackSize(1); setNoRepair(); - setUnlocalizedName(LibItemNames.MANA_GUN); GameRegistry.addRecipe(new ManaGunLensRecipe()); GameRegistry.addRecipe(new ManaGunRemoveLensRecipe()); @@ -72,68 +79,45 @@ public class ItemManaGun extends ItemMod implements IManaUsingItem { RecipeSorter.register("botania:manaGunClip", ManaGunClipRecipe.class, Category.SHAPELESS, ""); } + @Nonnull @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { + public ActionResult onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) { int effCd = COOLDOWN; - PotionEffect effect = par3EntityPlayer.getActivePotionEffect(Potion.digSpeed); + PotionEffect effect = player.getActivePotionEffect(MobEffects.HASTE); if(effect != null) effCd -= (effect.getAmplifier() + 1) * 8; - if(par3EntityPlayer.isSneaking() && hasClip(par1ItemStack)) { + if(player.isSneaking() && hasClip(par1ItemStack)) { rotatePos(par1ItemStack); - par2World.playSoundAtEntity(par3EntityPlayer, "random.click", 0.6F, (1.0F + (par2World.rand.nextFloat() - par2World.rand.nextFloat()) * 0.2F) * 0.7F); - if(par2World.isRemote) - par3EntityPlayer.swingItem(); + world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.BLOCK_STONE_BUTTON_CLICK_ON, SoundCategory.PLAYERS, 0.6F, (1.0F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F) * 0.7F); + if(world.isRemote) + player.swingArm(hand); ItemStack lens = getLens(par1ItemStack); ItemsRemainingRenderHandler.set(lens, -2); par1ItemStack.setItemDamage(effCd); + return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack); } else if(par1ItemStack.getItemDamage() == 0) { - EntityManaBurst burst = getBurst(par3EntityPlayer, par1ItemStack, true); - if(burst != null && ManaItemHandler.requestManaExact(par1ItemStack, par3EntityPlayer, burst.getMana(), true)) { - if(!par2World.isRemote) { - par2World.playSoundAtEntity(par3EntityPlayer, "botania:manaBlaster", 0.6F, 1F); - par3EntityPlayer.addStat(ModAchievements.manaBlasterShoot, 1); + EntityManaBurst burst = getBurst(player, par1ItemStack, true); + if(burst != null && ManaItemHandler.requestManaExact(par1ItemStack, player, burst.getMana(), true)) { + if(!world.isRemote) { + world.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.manaBlaster, SoundCategory.PLAYERS, 0.6F, 1); + player.addStat(ModAchievements.manaBlasterShoot, 1); if(isSugoiKawaiiDesuNe(par1ItemStack)) - par3EntityPlayer.addStat(ModAchievements.desuGun, 1); - par2World.spawnEntityInWorld(burst); + player.addStat(ModAchievements.desuGun, 1); + world.spawnEntityInWorld(burst); } else { - par3EntityPlayer.swingItem(); - par3EntityPlayer.motionX -= burst.motionX * 0.1; - par3EntityPlayer.motionY -= burst.motionY * 0.3; - par3EntityPlayer.motionZ -= burst.motionZ * 0.1; + player.swingArm(hand); + player.motionX -= burst.motionX * 0.1; + player.motionY -= burst.motionY * 0.3; + player.motionZ -= burst.motionZ * 0.1; } par1ItemStack.setItemDamage(effCd); - } else if(!par2World.isRemote) - par2World.playSoundAtEntity(par3EntityPlayer, "random.click", 0.6F, (1.0F + (par2World.rand.nextFloat() - par2World.rand.nextFloat()) * 0.2F) * 0.7F); + } else if(!world.isRemote) + world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.BLOCK_LEVER_CLICK, SoundCategory.PLAYERS, 0.6F, (1.0F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F) * 0.7F); + return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack); } - return par1ItemStack; - } - - @Override - public void registerIcons(IIconRegister par1IconRegister) { - int states = 3; - icons = new IIcon[states * 2]; - - for(int i = 0; i < states; i++) { - icons[i] = IconHelper.forItem(par1IconRegister, this, i); - icons[states + i] = IconHelper.forName(par1IconRegister, "desuGun" + i); - } - } - - @Override - public boolean requiresMultipleRenderPasses() { - return true; - } - - @Override - public IIcon getIcon(ItemStack stack, int pass) { - boolean desu = isSugoiKawaiiDesuNe(stack); - int index = pass; - if(index == 0 && hasClip(stack)) - index = 2; - - return icons[Math.min(2, index) + (desu ? 3 : 0)]; + return ActionResult.newResult(EnumActionResult.PASS, par1ItemStack); } // ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN @@ -154,36 +138,17 @@ public class ItemManaGun extends ItemMod implements IManaUsingItem { return stack.getDisplayName().equalsIgnoreCase("desu gun"); } - @Override - @SideOnly(Side.CLIENT) - public int getColorFromItemStack(ItemStack par1ItemStack, int par2) { - if(par2 == 0) - return 0xFFFFFF; - - EntityManaBurst burst = getBurst(Minecraft.getMinecraft().thePlayer, par1ItemStack, false); - Color color = new Color(burst == null ? 0x20FF20 : burst.getColor()); - - float mul = (float) (Math.sin((double) ClientTickHandler.ticksInGame / 5) * 0.15F); - int c = (int) (255 * mul); - - return new Color(Math.max(0, Math.min(255, color.getRed() + c)), Math.max(0, Math.min(255, color.getGreen() + c)), Math.max(0, Math.min(255, color.getBlue() + c))).getRGB(); - } - @Override public boolean hasContainerItem(ItemStack stack) { return getLens(stack) != null; } + @Nonnull @Override - public ItemStack getContainerItem(ItemStack itemStack) { + public ItemStack getContainerItem(@Nonnull ItemStack itemStack) { return getLens(itemStack); } - @Override - public boolean doesContainerItemLeaveCraftingGrid(ItemStack p_77630_1_) { - return false; - } - public EntityManaBurst getBurst(EntityPlayer player, ItemStack stack, boolean request) { EntityManaBurst burst = new EntityManaBurst(player); @@ -215,32 +180,33 @@ public class ItemManaGun extends ItemMod implements IManaUsingItem { return null; } + @SideOnly(Side.CLIENT) @Override - public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { + public void addInformation(ItemStack par1ItemStack, EntityPlayer player, List stacks, boolean par4) { boolean clip = hasClip(par1ItemStack); if(clip && !GuiScreen.isShiftKeyDown()) { - addStringToTooltip(StatCollector.translateToLocal("botaniamisc.shiftinfo"), par3List); + addStringToTooltip(I18n.format("botaniamisc.shiftinfo"), stacks); return; } ItemStack lens = getLens(par1ItemStack); if(lens != null) { - List tooltip = lens.getTooltip(par2EntityPlayer, false); + List tooltip = lens.getTooltip(player, false); if(tooltip.size() > 1) - par3List.addAll(tooltip.subList(1, tooltip.size())); + stacks.addAll(tooltip.subList(1, tooltip.size())); } if(clip) { int pos = getClipPos(par1ItemStack); - addStringToTooltip(StatCollector.translateToLocal("botaniamisc.hasClip"), par3List); + addStringToTooltip(I18n.format("botaniamisc.hasClip"), stacks); for(int i = 0; i < CLIP_SLOTS; i++) { - String name = ""; - EnumChatFormatting formatting = i == pos ? EnumChatFormatting.GREEN : EnumChatFormatting.GRAY; + String name; + TextFormatting formatting = i == pos ? TextFormatting.GREEN : TextFormatting.GRAY; ItemStack lensAt = getLensAtPos(par1ItemStack, i); if(lensAt == null) - name = StatCollector.translateToLocal("botaniamisc.clipEmpty"); + name = I18n.format("botaniamisc.clipEmpty"); else name = lensAt.getDisplayName(); - addStringToTooltip(formatting + " - " + name, par3List); + addStringToTooltip(formatting + " - " + name, stacks); } } } @@ -249,10 +215,11 @@ public class ItemManaGun extends ItemMod implements IManaUsingItem { tooltip.add(s.replaceAll("&", "\u00a7")); } + @Nonnull @Override - public String getItemStackDisplayName(ItemStack par1ItemStack) { + public String getItemStackDisplayName(@Nonnull ItemStack par1ItemStack) { ItemStack lens = getLens(par1ItemStack); - return super.getItemStackDisplayName(par1ItemStack) + (lens == null ? "" : " (" + EnumChatFormatting.GREEN + lens.getDisplayName() + EnumChatFormatting.RESET + ")"); + return super.getItemStackDisplayName(par1ItemStack) + (lens == null ? "" : " (" + TextFormatting.GREEN + lens.getDisplayName() + TextFormatting.RESET + ")"); } public static boolean hasClip(ItemStack stack) { @@ -294,8 +261,7 @@ public class ItemManaGun extends ItemMod implements IManaUsingItem { public static ItemStack getLensAtPos(ItemStack stack, int pos) { NBTTagCompound cmp = ItemNBTHelper.getCompound(stack, TAG_LENS + pos, true); if(cmp != null) { - ItemStack lens = ItemStack.loadItemStackFromNBT(cmp); - return lens; + return ItemStack.loadItemStackFromNBT(cmp); } return null; } @@ -329,13 +295,18 @@ public class ItemManaGun extends ItemMod implements IManaUsingItem { return null; } - @Override - public boolean isFull3D() { - return true; + public static List getAllLens(ItemStack stack) { + List ret = new ArrayList<>(); + + for (int i = 0; i < 6; i++) { + ret.add(getLensAtPos(stack, i)); + } + + return ret; } @Override - public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) { + public void onUpdate(ItemStack par1ItemStack, World world, Entity par3Entity, int par4, boolean par5) { if(par1ItemStack.isItemDamaged()) par1ItemStack.setItemDamage(par1ItemStack.getItemDamage() - 1); } @@ -344,4 +315,23 @@ public class ItemManaGun extends ItemMod implements IManaUsingItem { public boolean usesMana(ItemStack stack) { return true; } + + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelLoader.registerItemVariants(this, + new ModelResourceLocation("botania:desuGunClip", "inventory"), + new ModelResourceLocation("botania:desuGun", "inventory"), + new ModelResourceLocation("botania:manaGunClip", "inventory"), + new ModelResourceLocation("botania:manaGun", "inventory")); + ModelLoader.setCustomMeshDefinition(this, stack -> { + if (hasClip(stack) && isSugoiKawaiiDesuNe(stack)) + return new ModelResourceLocation("botania:desuGunClip", "inventory"); + else if (isSugoiKawaiiDesuNe(stack)) + return new ModelResourceLocation("botania:desuGun", "inventory"); + else if(hasClip(stack)) + return new ModelResourceLocation("botania:manaGunClip", "inventory"); + else return new ModelResourceLocation("botania:manaGun", "inventory"); + }); + } } diff --git a/src/main/java/vazkii/botania/common/item/ItemManaMirror.java b/src/main/java/vazkii/botania/common/item/ItemManaMirror.java index 27d99c709..880162575 100644 --- a/src/main/java/vazkii/botania/common/item/ItemManaMirror.java +++ b/src/main/java/vazkii/botania/common/item/ItemManaMirror.java @@ -10,29 +10,34 @@ */ package vazkii.botania.common.item; -import java.awt.Color; - -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumDyeColor; import net.minecraft.item.ItemStack; import net.minecraft.server.MinecraftServer; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.fml.common.FMLCommonHandler; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.mana.IManaItem; import vazkii.botania.api.mana.IManaPool; import vazkii.botania.api.mana.IManaTooltipDisplay; +import vazkii.botania.api.sound.BotaniaSoundEvents; import vazkii.botania.api.wand.ICoordBoundItem; -import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.common.block.tile.mana.TilePool; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.lib.LibItemNames; -public class ItemManaMirror extends ItemMod implements IManaItem, ICoordBoundItem, IManaTooltipDisplay { +import javax.annotation.Nonnull; +import java.awt.*; - IIcon[] icons; +public class ItemManaMirror extends ItemMod implements IManaItem, ICoordBoundItem, IManaTooltipDisplay { private static final String TAG_MANA = "mana"; private static final String TAG_MANA_BACKLOG = "manaBacklog"; @@ -45,19 +50,12 @@ public class ItemManaMirror extends ItemMod implements IManaItem, ICoordBoundIte private static final DummyPool fallbackPool = new DummyPool(); public ItemManaMirror() { - super(); + super(LibItemNames.MANA_MIRROR); setMaxStackSize(1); setMaxDamage(1000); - setUnlocalizedName(LibItemNames.MANA_MIRROR); setNoRepair(); } - @Override - public int getColorFromItemStack(ItemStack par1ItemStack, int par2) { - float mana = getMana(par1ItemStack); - return par2 == 1 ? Color.HSBtoRGB(0.528F, mana / TilePool.MAX_MANA, 1F) : 0xFFFFFF; - } - @Override public int getDamage(ItemStack stack) { float mana = getMana(stack); @@ -65,30 +63,8 @@ public class ItemManaMirror extends ItemMod implements IManaItem, ICoordBoundIte } @Override - public int getDisplayDamage(ItemStack stack) { - return getDamage(stack); - } - - @Override - public void registerIcons(IIconRegister par1IconRegister) { - icons = new IIcon[2]; - for(int i = 0; i < icons.length; i++) - icons[i] = IconHelper.forItem(par1IconRegister, this, i); - } - - @Override - public IIcon getIcon(ItemStack stack, int pass) { - return icons[Math.min(1, pass)]; - } - - @Override - public boolean isFull3D() { - return true; - } - - @Override - public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) { - if(par2World.isRemote) + public void onUpdate(ItemStack par1ItemStack, World world, Entity par3Entity, int par4, boolean par5) { + if(world.isRemote) return; IManaPool pool = getManaPool(par1ItemStack); @@ -103,23 +79,19 @@ public class ItemManaMirror extends ItemMod implements IManaItem, ICoordBoundIte } } + @Nonnull @Override - public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { - if(par2EntityPlayer.isSneaking() && !par3World.isRemote) { - TileEntity tile = par3World.getTileEntity(par4, par5, par6); + public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) { + if(player.isSneaking() && !world.isRemote) { + TileEntity tile = world.getTileEntity(pos); if(tile != null && tile instanceof IManaPool) { bindPool(par1ItemStack, tile); - par3World.playSoundAtEntity(par2EntityPlayer, "botania:ding", 1F, 1F); - return true; + world.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.ding, SoundCategory.PLAYERS, 1F, 1F); + return EnumActionResult.SUCCESS; } } - return false; - } - - @Override - public boolean requiresMultipleRenderPasses() { - return true; + return EnumActionResult.PASS; } /*public int getMana(ItemStack stack) { @@ -160,22 +132,22 @@ public class ItemManaMirror extends ItemMod implements IManaItem, ICoordBoundIte if(pool != null) { pool.recieveMana(mana); TileEntity tile = (TileEntity) pool; - tile.getWorldObj().func_147453_f(tile.xCoord, tile.yCoord, tile.zCoord, tile.getWorldObj().getBlock(tile.xCoord, tile.yCoord, tile.zCoord)); + tile.getWorld().func_147453_f(tile.xCoord, tile.yCoord, tile.zCoord, tile.getWorld().getBlock(tile.xCoord, tile.yCoord, tile.zCoord)); } }*/ public void bindPool(ItemStack stack, TileEntity pool) { - ItemNBTHelper.setInt(stack, TAG_POS_X, pool == null ? 0 : pool.xCoord); - ItemNBTHelper.setInt(stack, TAG_POS_Y, pool == null ? -1 : pool.yCoord); - ItemNBTHelper.setInt(stack, TAG_POS_Z, pool == null ? 0 : pool.zCoord); - ItemNBTHelper.setInt(stack, TAG_DIM, pool == null ? 0 : pool.getWorldObj().provider.dimensionId); + ItemNBTHelper.setInt(stack, TAG_POS_X, pool == null ? 0 : pool.getPos().getX()); + ItemNBTHelper.setInt(stack, TAG_POS_Y, pool == null ? -1 : pool.getPos().getY()); + ItemNBTHelper.setInt(stack, TAG_POS_Z, pool == null ? 0 : pool.getPos().getZ()); + ItemNBTHelper.setInt(stack, TAG_DIM, pool == null ? 0 : pool.getWorld().provider.getDimension()); } - public ChunkCoordinates getPoolCoords(ItemStack stack) { + public BlockPos getPoolCoords(ItemStack stack) { int x = ItemNBTHelper.getInt(stack, TAG_POS_X, 0); int y = ItemNBTHelper.getInt(stack, TAG_POS_Y, -1); int z = ItemNBTHelper.getInt(stack, TAG_POS_Z, 0); - return new ChunkCoordinates(x, y, z); + return new BlockPos(x, y, z); } public int getDimension(ItemStack stack) { @@ -183,24 +155,24 @@ public class ItemManaMirror extends ItemMod implements IManaItem, ICoordBoundIte } public IManaPool getManaPool(ItemStack stack) { - MinecraftServer server = MinecraftServer.getServer(); + MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance(); if(server == null) return fallbackPool; - ChunkCoordinates coords = getPoolCoords(stack); - if(coords.posY == -1) + BlockPos coords = getPoolCoords(stack); + if(coords.getY() == -1) return null; int dim = getDimension(stack); World world = null; for(World w : server.worldServers) - if(w.provider.dimensionId == dim) { + if(w.provider.getDimension() == dim) { world = w; break; } if(world != null) { - TileEntity tile = world.getTileEntity(coords.posX, coords.posY, coords.posZ); + TileEntity tile = world.getTileEntity(coords); if(tile != null && tile instanceof IManaPool) return (IManaPool) tile; } @@ -236,9 +208,7 @@ public class ItemManaMirror extends ItemMod implements IManaItem, ICoordBoundIte } @Override - public void recieveMana(int mana) { - // NO-OP - } + public void recieveMana(int mana) {} @Override public boolean canRecieveManaFromBursts() { @@ -255,6 +225,14 @@ public class ItemManaMirror extends ItemMod implements IManaItem, ICoordBoundIte return false; } + @Override + public EnumDyeColor getColor() { + return EnumDyeColor.WHITE; + } + + @Override + public void setColor(EnumDyeColor color) {} + } @Override @@ -263,7 +241,7 @@ public class ItemManaMirror extends ItemMod implements IManaItem, ICoordBoundIte } @Override - public ChunkCoordinates getBinding(ItemStack stack) { + public BlockPos getBinding(ItemStack stack) { IManaPool pool = getManaPool(stack); return pool == null || pool instanceof DummyPool ? null : getPoolCoords(stack); diff --git a/src/main/java/vazkii/botania/common/item/ItemManaTablet.java b/src/main/java/vazkii/botania/common/item/ItemManaTablet.java index f66cab2a8..333524059 100644 --- a/src/main/java/vazkii/botania/common/item/ItemManaTablet.java +++ b/src/main/java/vazkii/botania/common/item/ItemManaTablet.java @@ -10,64 +10,56 @@ */ package vazkii.botania.common.item; -import java.awt.Color; -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.resources.I18n; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.mana.ICreativeManaProvider; import vazkii.botania.api.mana.IManaItem; import vazkii.botania.api.mana.IManaTooltipDisplay; -import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; +import java.awt.*; +import java.util.List; + public class ItemManaTablet extends ItemMod implements IManaItem, ICreativeManaProvider, IManaTooltipDisplay { - IIcon[] icons; - - private static final int MAX_MANA = 500000; + public static final int MAX_MANA = 500000; private static final String TAG_MANA = "mana"; private static final String TAG_CREATIVE = "creative"; private static final String TAG_ONE_USE = "oneUse"; public ItemManaTablet() { - super(); + super(LibItemNames.MANA_TABLET); setMaxStackSize(1); setMaxDamage(1000); - setUnlocalizedName(LibItemNames.MANA_TABLET); setNoRepair(); } @Override - public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) { + @SideOnly(Side.CLIENT) + public void getSubItems(@Nonnull Item item, CreativeTabs tab, List stacks) { // Empty tablet - par3List.add(new ItemStack(par1, 1)); + stacks.add(new ItemStack(item, 1)); // Full tablet - ItemStack fullPower = new ItemStack(par1, 1); + ItemStack fullPower = new ItemStack(item, 1); setMana(fullPower, MAX_MANA); - par3List.add(fullPower); + stacks.add(fullPower); // Creative Tablet - ItemStack creative = new ItemStack(par1, 1); + ItemStack creative = new ItemStack(item, 1); setMana(creative, MAX_MANA); setStackCreative(creative); - par3List.add(creative); - } - - @Override - public int getColorFromItemStack(ItemStack par1ItemStack, int par2) { - float mana = getMana(par1ItemStack); - return par2 == 1 ? Color.HSBtoRGB(0.528F, mana / MAX_MANA, 1F) : 0xFFFFFF; + stacks.add(creative); } @Override @@ -80,27 +72,11 @@ public class ItemManaTablet extends ItemMod implements IManaItem, ICreativeManaP return 0; } + @SideOnly(Side.CLIENT) @Override - public void registerIcons(IIconRegister par1IconRegister) { - icons = new IIcon[2]; - for(int i = 0; i < icons.length; i++) - icons[i] = IconHelper.forItem(par1IconRegister, this, i); - } - - @Override - public IIcon getIcon(ItemStack stack, int pass) { - return icons[Math.min(1, pass)]; - } - - @Override - public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { + public void addInformation(ItemStack par1ItemStack, EntityPlayer player, List stacks, boolean par4) { if(isStackCreative(par1ItemStack)) - par3List.add(StatCollector.translateToLocal("botaniamisc.creative")); - } - - @Override - public boolean requiresMultipleRenderPasses() { - return true; + stacks.add(I18n.format("botaniamisc.creative")); } @Override diff --git a/src/main/java/vazkii/botania/common/item/ItemMod.java b/src/main/java/vazkii/botania/common/item/ItemMod.java index 4e20174df..58c5eb080 100644 --- a/src/main/java/vazkii/botania/common/item/ItemMod.java +++ b/src/main/java/vazkii/botania/common/item/ItemMod.java @@ -10,37 +10,43 @@ */ package vazkii.botania.common.item; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import vazkii.botania.client.core.helper.IconHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.client.lib.LibResources; +import vazkii.botania.client.render.IModelRegister; import vazkii.botania.common.core.BotaniaCreativeTab; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import vazkii.botania.common.lib.LibMisc; -public class ItemMod extends Item { +import javax.annotation.Nonnull; - public ItemMod() { - super(); +public abstract class ItemMod extends Item implements IModelRegister { + + public ItemMod(String name) { setCreativeTab(BotaniaCreativeTab.INSTANCE); + if(shouldRegister()) + GameRegistry.register(this, new ResourceLocation(LibMisc.MOD_ID, name)); + setUnlocalizedName(name); } - @Override - public Item setUnlocalizedName(String par1Str) { - GameRegistry.registerItem(this, par1Str); - return super.setUnlocalizedName(par1Str); + protected boolean shouldRegister() { + return true; } + @Nonnull @Override - public String getUnlocalizedNameInefficiently(ItemStack par1ItemStack) { + public String getUnlocalizedNameInefficiently(@Nonnull ItemStack par1ItemStack) { return super.getUnlocalizedNameInefficiently(par1ItemStack).replaceAll("item\\.", "item." + LibResources.PREFIX_MOD); } - @Override @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) { - itemIcon = IconHelper.forItem(par1IconRegister, this); + @Override + public void registerModels() { + ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory")); } } \ No newline at end of file diff --git a/src/main/java/vazkii/botania/common/item/ItemObedienceStick.java b/src/main/java/vazkii/botania/common/item/ItemObedienceStick.java index acce895e6..5b27380d5 100644 --- a/src/main/java/vazkii/botania/common/item/ItemObedienceStick.java +++ b/src/main/java/vazkii/botania/common/item/ItemObedienceStick.java @@ -13,6 +13,10 @@ package vazkii.botania.common.item; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import vazkii.botania.api.mana.IManaCollector; import vazkii.botania.api.mana.IManaPool; @@ -24,45 +28,45 @@ import vazkii.botania.common.core.helper.MathHelper; import vazkii.botania.common.core.helper.Vector3; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; + public class ItemObedienceStick extends ItemMod { public ItemObedienceStick() { + super(LibItemNames.OBEDIENCE_STICK); setMaxStackSize(1); - setUnlocalizedName(LibItemNames.OBEDIENCE_STICK); } + @Nonnull @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int s, float xs, float ys, float zs) { - TileEntity tileAt = world.getTileEntity(x, y, z); + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float xs, float ys, float zs) { + TileEntity tileAt = world.getTileEntity(pos); if(tileAt != null && (tileAt instanceof IManaPool || tileAt instanceof IManaCollector)) { boolean pool = tileAt instanceof IManaPool; Actuator act = pool ? Actuator.functionalActuator : Actuator.generatingActuator; - int range = pool ? SubTileFunctional.RANGE : SubTileGenerating.RANGE; + int range = pool ? SubTileFunctional.LINK_RANGE : SubTileGenerating.LINK_RANGE; - for(int i = -range; i < range + 1; i++) - for(int j = -range; j < range + 1; j++) - for(int k = -range; k < range + 1; k++) { - int xp = x + i; - int yp = y + j; - int zp = z + k; - if(MathHelper.pointDistanceSpace(xp, yp, zp, x, y, z) > range) - continue; + for(BlockPos pos_ : BlockPos.getAllInBox(pos.add(-range, -range, -range), pos.add(range, range, range))) { + if(pos_.distanceSq(pos) > range * range) + continue; - TileEntity tile = world.getTileEntity(xp, yp, zp); - if(tile instanceof ISubTileContainer) { - SubTileEntity subtile = ((ISubTileContainer) tile).getSubTile(); - if(act.actuate(subtile, tileAt)) { - Vector3 orig = new Vector3(xp + 0.5, yp + 0.5, zp + 0.5); - Vector3 end = new Vector3(x + 0.5, y + 0.5, z + 0.5); - ItemTwigWand.doParticleBeam(world, orig, end); - } - } + TileEntity tile = world.getTileEntity(pos_); + if(tile instanceof ISubTileContainer) { + SubTileEntity subtile = ((ISubTileContainer) tile).getSubTile(); + if(act.actuate(subtile, tileAt)) { + Vector3 orig = new Vector3(pos_.getX() + 0.5, pos_.getY() + 0.5, pos_.getZ() + 0.5); + Vector3 end = new Vector3(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5); + ItemTwigWand.doParticleBeam(world, orig, end); } + } + } if(player.worldObj.isRemote) - player.swingItem(); + player.swingArm(hand); + return EnumActionResult.SUCCESS; } - return false; + + return EnumActionResult.PASS; } public static abstract class Actuator { diff --git a/src/main/java/vazkii/botania/common/item/ItemOpenBucket.java b/src/main/java/vazkii/botania/common/item/ItemOpenBucket.java index 8acc06d90..50354752c 100644 --- a/src/main/java/vazkii/botania/common/item/ItemOpenBucket.java +++ b/src/main/java/vazkii/botania/common/item/ItemOpenBucket.java @@ -13,50 +13,55 @@ package vazkii.botania.common.item; import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; -import vazkii.botania.common.block.subtile.functional.SubTileSpectranthemum; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; + public class ItemOpenBucket extends ItemMod { public ItemOpenBucket() { + super(LibItemNames.OPEN_BUCKET); setMaxStackSize(1); - setUnlocalizedName(LibItemNames.OPEN_BUCKET); } + @Nonnull @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - MovingObjectPosition movingobjectposition = getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, true); + public ActionResult onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) { + RayTraceResult RayTraceResult = rayTrace(world, player, true); - if(movingobjectposition == null) - return par1ItemStack; + if(RayTraceResult == null) + return ActionResult.newResult(EnumActionResult.PASS, par1ItemStack); else { - if(movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { - int i = movingobjectposition.blockX; - int j = movingobjectposition.blockY; - int k = movingobjectposition.blockZ; + if(RayTraceResult.typeOfHit == net.minecraft.util.math.RayTraceResult.Type.BLOCK) { + BlockPos pos = RayTraceResult.getBlockPos(); - if(!par2World.canMineBlock(par3EntityPlayer, i, j, k)) - return par1ItemStack; + if(!world.isBlockModifiable(player, pos)) + return ActionResult.newResult(EnumActionResult.PASS, par1ItemStack); - if(!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, par1ItemStack)) - return par1ItemStack; + if(!player.canPlayerEdit(pos, RayTraceResult.sideHit, par1ItemStack)) + return ActionResult.newResult(EnumActionResult.PASS, par1ItemStack); - Material material = par2World.getBlock(i, j, k).getMaterial(); - int l = par2World.getBlockMetadata(i, j, k); + Material material = world.getBlockState(pos).getMaterial(); + int l = world.getBlockState(pos).getBlock().getMetaFromState(world.getBlockState(pos)); // hack to get meta so we don't have to know the level prop - if((material == Material.lava || material == Material.water) && l == 0) { - par2World.setBlockToAir(i, j, k); + if((material == Material.LAVA || material == Material.WATER) && l == 0) { + world.setBlockToAir(pos); for(int x = 0; x < 5; x++) - par2World.spawnParticle("explode", i + Math.random(), j + Math.random(), k + Math.random(), 0, 0, 0); - - return par1ItemStack; + world.spawnParticle(EnumParticleTypes.EXPLOSION_NORMAL, pos.getX() + Math.random(), pos.getY() + Math.random(), pos.getZ() + Math.random(), 0, 0, 0); + + return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack); } } - return par1ItemStack; + return ActionResult.newResult(EnumActionResult.PASS, par1ItemStack); } } diff --git a/src/main/java/vazkii/botania/common/item/ItemOvergrowthSeed.java b/src/main/java/vazkii/botania/common/item/ItemOvergrowthSeed.java index fd9c25a08..bfe420a78 100644 --- a/src/main/java/vazkii/botania/common/item/ItemOvergrowthSeed.java +++ b/src/main/java/vazkii/botania/common/item/ItemOvergrowthSeed.java @@ -11,35 +11,46 @@ package vazkii.botania.common.item; import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.oredict.OreDictionary; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; + public class ItemOvergrowthSeed extends ItemMod { public ItemOvergrowthSeed() { - setUnlocalizedName(LibItemNames.OVERGROWTH_SEED); + super(LibItemNames.OVERGROWTH_SEED); } + @Nonnull @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int s, float xs, float ys, float zs) { - Block block = world.getBlock(x, y, z); - ItemStack blockStack = new ItemStack(block); + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float xs, float ys, float zs) { + IBlockState state = world.getBlockState(pos); + if(Item.getItemFromBlock(state.getBlock()) == null) + return EnumActionResult.PASS; + ItemStack blockStack = new ItemStack(state.getBlock()); int[] ids = OreDictionary.getOreIDs(blockStack); for(int i : ids) { String name = OreDictionary.getOreName(i); if(name.equals("grass")) { - world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(block)); - world.setBlock(x, y, z, ModBlocks.enchantedSoil); + world.playEvent(2001, pos, Block.getStateId(state)); + world.setBlockState(pos, ModBlocks.enchantedSoil.getDefaultState()); stack.stackSize--; - return true; + return EnumActionResult.SUCCESS; } } - return false; + return EnumActionResult.PASS; } } diff --git a/src/main/java/vazkii/botania/common/item/ItemPhantomInk.java b/src/main/java/vazkii/botania/common/item/ItemPhantomInk.java index c3a90547b..4daf6ff4a 100644 --- a/src/main/java/vazkii/botania/common/item/ItemPhantomInk.java +++ b/src/main/java/vazkii/botania/common/item/ItemPhantomInk.java @@ -10,16 +10,16 @@ */ package vazkii.botania.common.item; +import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.oredict.RecipeSorter; import net.minecraftforge.oredict.RecipeSorter.Category; import vazkii.botania.common.crafting.recipe.PhantomInkRecipe; import vazkii.botania.common.lib.LibItemNames; -import cpw.mods.fml.common.registry.GameRegistry; public class ItemPhantomInk extends ItemMod { public ItemPhantomInk() { - setUnlocalizedName(LibItemNames.PHANTOM_INK); + super(LibItemNames.PHANTOM_INK); GameRegistry.addRecipe(new PhantomInkRecipe()); RecipeSorter.register("botania:phantomInk", PhantomInkRecipe.class, Category.SHAPELESS, ""); } diff --git a/src/main/java/vazkii/botania/common/item/ItemPinkinator.java b/src/main/java/vazkii/botania/common/item/ItemPinkinator.java index d684432db..f2bc9d8f5 100644 --- a/src/main/java/vazkii/botania/common/item/ItemPinkinator.java +++ b/src/main/java/vazkii/botania/common/item/ItemPinkinator.java @@ -10,30 +10,39 @@ */ package vazkii.botania.common.item; -import java.util.List; - +import net.minecraft.client.resources.I18n; import net.minecraft.entity.boss.EntityWither; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.SoundEvents; import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.StatCollector; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.common.achievement.ModAchievements; import vazkii.botania.common.entity.EntityPinkWither; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; +import java.util.List; + public class ItemPinkinator extends ItemMod { public ItemPinkinator() { - setUnlocalizedName(LibItemNames.PINKINATOR); + super(LibItemNames.PINKINATOR); setMaxStackSize(1); setFull3D(); } + @Nonnull @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { + public ActionResult onItemRightClick(@Nonnull ItemStack stack, World world, EntityPlayer player, EnumHand hand) { int range = 16; - List withers = world.getEntitiesWithinAABB(EntityWither.class, AxisAlignedBB.getBoundingBox(player.posX - range, player.posY - range, player.posZ - range, player.posX + range, player.posY + range, player.posZ + range)); + List withers = world.getEntitiesWithinAABB(EntityWither.class, new AxisAlignedBB(player.posX - range, player.posY - range, player.posZ - range, player.posX + range, player.posY + range, player.posZ + range)); for(EntityWither wither : withers) if(!wither.isDead && !(wither instanceof EntityPinkWither)) { if(!world.isRemote) { @@ -41,21 +50,22 @@ public class ItemPinkinator extends ItemMod { EntityPinkWither pink = new EntityPinkWither(world); pink.setLocationAndAngles(wither.posX, wither.posY, wither.posZ, wither.rotationYaw, wither.rotationPitch); world.spawnEntityInWorld(pink); - world.playSoundAtEntity(wither, "random.explode", 4F, (1F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F) * 0.7F); + pink.playSound(SoundEvents.ENTITY_GENERIC_EXPLODE, 4F, (1F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F) * 0.7F); } player.addStat(ModAchievements.pinkinator, 1); - world.spawnParticle("hugeexplosion", wither.posX, wither.posY, wither.posZ, 1D, 0D, 0D); + world.spawnParticle(EnumParticleTypes.EXPLOSION_HUGE, wither.posX, wither.posY, wither.posZ, 1D, 0D, 0D); stack.stackSize--; - return stack; + return ActionResult.newResult(EnumActionResult.SUCCESS, stack); } - return stack; + return ActionResult.newResult(EnumActionResult.PASS, stack); } + @SideOnly(Side.CLIENT) @Override - public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) { - p_77624_3_.add(StatCollector.translateToLocal("botaniamisc.pinkinatorDesc")); + public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean advanced) { + tooltip.add(I18n.format("botaniamisc.pinkinatorDesc")); } } diff --git a/src/main/java/vazkii/botania/common/item/ItemPoolMinecart.java b/src/main/java/vazkii/botania/common/item/ItemPoolMinecart.java index 248d72917..46bf17e79 100644 --- a/src/main/java/vazkii/botania/common/item/ItemPoolMinecart.java +++ b/src/main/java/vazkii/botania/common/item/ItemPoolMinecart.java @@ -10,6 +10,7 @@ */ package vazkii.botania.common.item; +import com.mojang.authlib.GameProfile; import mods.railcraft.api.core.items.IMinecartItem; import net.minecraft.block.BlockRailBase; import net.minecraft.entity.item.EntityMinecart; @@ -17,41 +18,45 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.stats.Achievement; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.fml.common.Optional; import vazkii.botania.common.achievement.ICraftAchievement; import vazkii.botania.common.achievement.ModAchievements; import vazkii.botania.common.entity.EntityPoolMinecart; import vazkii.botania.common.lib.LibItemNames; -import com.mojang.authlib.GameProfile; - -import cpw.mods.fml.common.Optional; +import javax.annotation.Nonnull; @Optional.Interface(modid = "Railcraft", iface = "mods.railcraft.api.core.items.IMinecartItem", striprefs = true) public class ItemPoolMinecart extends ItemMod implements ICraftAchievement, IMinecartItem { public ItemPoolMinecart() { + super(LibItemNames.POOL_MINECART); setMaxStackSize(1); - setUnlocalizedName(LibItemNames.POOL_MINECART); } + @Nonnull @Override - public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { - if(BlockRailBase.func_150051_a(p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_))) { - if(!p_77648_3_.isRemote) { - EntityMinecart entityminecart = new EntityPoolMinecart(p_77648_3_, p_77648_4_ + 0.5, p_77648_5_ + 0.5, p_77648_6_ + 0.5); + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) { + if(BlockRailBase.isRailBlock(world.getBlockState(pos))) { + if(!world.isRemote) { + EntityMinecart entityminecart = new EntityPoolMinecart(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5); - if(p_77648_1_.hasDisplayName()) - entityminecart.setMinecartName(p_77648_1_.getDisplayName()); + if(stack.hasDisplayName()) + entityminecart.setCustomNameTag(stack.getDisplayName()); - p_77648_3_.spawnEntityInWorld(entityminecart); + world.spawnEntityInWorld(entityminecart); } - --p_77648_1_.stackSize; - return true; + --stack.stackSize; + return EnumActionResult.SUCCESS; } - return false; + return EnumActionResult.PASS; } @Override @@ -66,12 +71,12 @@ public class ItemPoolMinecart extends ItemMod implements ICraftAchievement, IMin @Override public EntityMinecart placeCart(GameProfile owner, ItemStack cart, World world, int i, int j, int k) { - if(BlockRailBase.func_150051_a(world.getBlock(i, j, k))) { + if(BlockRailBase.isRailBlock(world.getBlockState(new BlockPos(i, j, k)))) { if(!world.isRemote) { EntityMinecart entityminecart = new EntityPoolMinecart(world, i + 0.5,j + 0.5, k + 0.5); if(cart.hasDisplayName()) - entityminecart.setMinecartName(cart.getDisplayName()); + entityminecart.setCustomNameTag(cart.getDisplayName()); if(world.spawnEntityInWorld(entityminecart)) return entityminecart; diff --git a/src/main/java/vazkii/botania/common/item/ItemRegenIvy.java b/src/main/java/vazkii/botania/common/item/ItemRegenIvy.java index 20d725430..a3de78fe2 100644 --- a/src/main/java/vazkii/botania/common/item/ItemRegenIvy.java +++ b/src/main/java/vazkii/botania/common/item/ItemRegenIvy.java @@ -11,18 +11,18 @@ package vazkii.botania.common.item; import net.minecraft.item.ItemStack; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.common.eventhandler.EventPriority; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; +import net.minecraftforge.fml.common.gameevent.TickEvent.PlayerTickEvent; +import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.oredict.RecipeSorter; import net.minecraftforge.oredict.RecipeSorter.Category; import vazkii.botania.api.mana.ManaItemHandler; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.crafting.recipe.RegenIvyRecipe; import vazkii.botania.common.lib.LibItemNames; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.EventPriority; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.TickEvent.Phase; -import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent; -import cpw.mods.fml.common.registry.GameRegistry; public class ItemRegenIvy extends ItemMod { @@ -30,14 +30,14 @@ public class ItemRegenIvy extends ItemMod { private static final int MANA_PER_DAMAGE = 200; public ItemRegenIvy() { - setUnlocalizedName(LibItemNames.REGEN_IVY); + super(LibItemNames.REGEN_IVY); GameRegistry.addRecipe(new RegenIvyRecipe()); RecipeSorter.register("botania:regenIvy", RegenIvyRecipe.class, Category.SHAPELESS, ""); - FMLCommonHandler.instance().bus().register(this); + MinecraftForge.EVENT_BUS.register(ItemRegenIvy.class); } @SubscribeEvent(priority = EventPriority.LOWEST) - public void onTick(PlayerTickEvent event) { + public static void onTick(PlayerTickEvent event) { if(event.phase == Phase.END && !event.player.worldObj.isRemote) for(int i = 0; i < event.player.inventory.getSizeInventory(); i++) { ItemStack stack = event.player.inventory.getStackInSlot(i); diff --git a/src/main/java/vazkii/botania/common/item/ItemSextant.java b/src/main/java/vazkii/botania/common/item/ItemSextant.java index fff78921f..a64a5e064 100644 --- a/src/main/java/vazkii/botania/common/item/ItemSextant.java +++ b/src/main/java/vazkii/botania/common/item/ItemSextant.java @@ -13,15 +13,21 @@ package vazkii.botania.common.item; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.EnumAction; import net.minecraft.item.ItemStack; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; - +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import org.lwjgl.opengl.GL11; - import vazkii.botania.api.lexicon.multiblock.Multiblock; import vazkii.botania.common.Botania; import vazkii.botania.common.core.helper.ItemNBTHelper; @@ -29,8 +35,10 @@ import vazkii.botania.common.core.helper.MathHelper; import vazkii.botania.common.core.helper.Vector3; import vazkii.botania.common.item.equipment.tool.ToolCommons; import vazkii.botania.common.lib.LibItemNames; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import javax.annotation.Nonnull; +import java.util.EnumMap; +import java.util.Map; public class ItemSextant extends ItemMod { @@ -39,13 +47,14 @@ public class ItemSextant extends ItemMod { private static final String TAG_SOURCE_Z = "sourceZ"; public ItemSextant() { - setUnlocalizedName(LibItemNames.SEXTANT); + super(LibItemNames.SEXTANT); setMaxStackSize(1); } + @Nonnull @Override public EnumAction getItemUseAction(ItemStack par1ItemStack) { - return EnumAction.bow; + return EnumAction.BOW; } @Override @@ -54,59 +63,63 @@ public class ItemSextant extends ItemMod { } @Override - public void onUsingTick(ItemStack stack, EntityPlayer player, int count) { - if(getMaxItemUseDuration(stack) - count < 10) + public void onUsingTick(ItemStack stack, EntityLivingBase living, int count) { + if(getMaxItemUseDuration(stack) - count < 10 + || !(living instanceof EntityPlayer)) return; int x = ItemNBTHelper.getInt(stack, TAG_SOURCE_X, 0); int y = ItemNBTHelper.getInt(stack, TAG_SOURCE_Y, -1); int z = ItemNBTHelper.getInt(stack, TAG_SOURCE_Z, 0); if(y != -1) { - World world = player.worldObj; + World world = living.worldObj; Vector3 source = new Vector3(x, y, z); - double radius = calculateRadius(stack, player); + double radius = calculateRadius(stack, ((EntityPlayer) living)); if(count % 10 == 0) for(int i = 0; i < 360; i++) { float radian = (float) (i * Math.PI / 180); double xp = x + Math.cos(radian) * radius; double zp = z + Math.sin(radian) * radius; - Botania.proxy.wispFX(world, xp + 0.5, source.y + 1, zp + 0.5, 0F, 1F, 1F, 0.3F, -0.01F); + Botania.proxy.wispFX(xp + 0.5, source.y + 1, zp + 0.5, 0F, 1F, 1F, 0.3F, -0.01F); } } } @Override - public void onPlayerStoppedUsing(ItemStack stack, World world, EntityPlayer player, int time) { - double radius = calculateRadius(stack, player); + public void onPlayerStoppedUsing(ItemStack stack, World world, EntityLivingBase living, int time) { + if(!(living instanceof EntityPlayer)) return; + + double radius = calculateRadius(stack, ((EntityPlayer) living)); if(radius > 1) { int x = ItemNBTHelper.getInt(stack, TAG_SOURCE_X, 0); int y = ItemNBTHelper.getInt(stack, TAG_SOURCE_Y, -1); int z = ItemNBTHelper.getInt(stack, TAG_SOURCE_Z, 0); if(y != -1) - Botania.proxy.setMultiblock(world, x, y, z, radius, Blocks.cobblestone); + Botania.proxy.setMultiblock(world, x, y, z, radius, Blocks.COBBLESTONE); } } + @Nonnull @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { + public ActionResult onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) { Botania.proxy.removeSextantMultiblock(); - if(!par3EntityPlayer.isSneaking()) { - MovingObjectPosition pos = ToolCommons.raytraceFromEntity(par2World, par3EntityPlayer, false, 128); - if(pos != null && pos.entityHit == null) { - if(!par2World.isRemote) { - ItemNBTHelper.setInt(par1ItemStack, TAG_SOURCE_X, pos.blockX); - ItemNBTHelper.setInt(par1ItemStack, TAG_SOURCE_Y, pos.blockY); - ItemNBTHelper.setInt(par1ItemStack, TAG_SOURCE_Z, pos.blockZ); + if(!player.isSneaking()) { + RayTraceResult pos = ToolCommons.raytraceFromEntity(world, player, false, 128); + if(pos != null && pos.entityHit == null && pos.getBlockPos() != null) { + if(!world.isRemote) { + ItemNBTHelper.setInt(par1ItemStack, TAG_SOURCE_X, pos.getBlockPos().getX()); + ItemNBTHelper.setInt(par1ItemStack, TAG_SOURCE_Y, pos.getBlockPos().getY()); + ItemNBTHelper.setInt(par1ItemStack, TAG_SOURCE_Z, pos.getBlockPos().getZ()); } } else ItemNBTHelper.setInt(par1ItemStack, TAG_SOURCE_Y, -1); - par3EntityPlayer.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack)); + player.setActiveHand(hand); } - return par1ItemStack; + return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack); } public static double calculateRadius(ItemStack stack, EntityPlayer player) { @@ -115,28 +128,29 @@ public class ItemSextant extends ItemMod { int z = ItemNBTHelper.getInt(stack, TAG_SOURCE_Z, 0); World world = player.worldObj; Vector3 source = new Vector3(x, y, z); - Botania.proxy.wispFX(world, source.x + 0.5, source.y + 1, source.z + 0.5, 1F, 0F, 0F, 0.2F, -0.1F); + Botania.proxy.wispFX(source.x + 0.5, source.y + 1, source.z + 0.5, 1F, 0F, 0F, 0.2F, -0.1F); Vector3 centerVec = Vector3.fromEntityCenter(player); - Vector3 diffVec = source.copy().subtract(centerVec); + Vector3 diffVec = source.subtract(centerVec); Vector3 lookVec = new Vector3(player.getLookVec()); double mul = diffVec.y / lookVec.y; - lookVec.multiply(mul).add(centerVec); + lookVec = lookVec.multiply(mul).add(centerVec); - lookVec.x = net.minecraft.util.MathHelper.floor_double(lookVec.x); - lookVec.z = net.minecraft.util.MathHelper.floor_double(lookVec.z); + lookVec = new Vector3(net.minecraft.util.math.MathHelper.floor_double(lookVec.x), + lookVec.y, + net.minecraft.util.math.MathHelper.floor_double(lookVec.z)); return MathHelper.pointDistancePlane(source.x, source.z, lookVec.x, lookVec.z); } @SideOnly(Side.CLIENT) public static void renderHUD(ScaledResolution resolution, EntityPlayer player, ItemStack stack) { - ItemStack onUse = player.getItemInUse(); + ItemStack onUse = player.getActiveItemStack(); int time = player.getItemInUseCount(); if(onUse == stack && stack.getItem().getMaxItemUseDuration(stack) - time >= 10) { double radius = calculateRadius(stack, player); - FontRenderer font = Minecraft.getMinecraft().fontRenderer; + FontRenderer font = Minecraft.getMinecraft().fontRendererObj; int x = resolution.getScaledWidth() / 2 + 30; int y = resolution.getScaledHeight() / 2; @@ -145,10 +159,10 @@ public class ItemSextant extends ItemMod { if(radius > 0) { radius += 4; - GL11.glDisable(GL11.GL_TEXTURE_2D); + GlStateManager.disableTexture2D(); GL11.glLineWidth(3F); GL11.glBegin(GL11.GL_LINE_STRIP); - GL11.glColor4f(0F, 1F, 1F, 1F); + GlStateManager.color(0F, 1F, 1F, 1F); for(int i = 0; i < 361; i++) { float radian = (float) (i * Math.PI / 180); double xp = x + Math.cos(radian) * radius; @@ -156,7 +170,7 @@ public class ItemSextant extends ItemMod { GL11.glVertex2d(xp, yp); } GL11.glEnd(); - GL11.glEnable(GL11.GL_TEXTURE_2D); + GlStateManager.enableTexture2D(); } } } @@ -164,8 +178,12 @@ public class ItemSextant extends ItemMod { public static class MultiblockSextant extends Multiblock { @Override - public Multiblock[] createRotations() { - return new Multiblock[] { this }; + public Map createRotations() { + Map ret = new EnumMap<>(EnumFacing.class); + for (EnumFacing e : EnumFacing.VALUES) { + ret.put(e, this); + } + return ret; } } diff --git a/src/main/java/vazkii/botania/common/item/ItemSignalFlare.java b/src/main/java/vazkii/botania/common/item/ItemSignalFlare.java index c7a86d197..ac95ae870 100644 --- a/src/main/java/vazkii/botania/common/item/ItemSignalFlare.java +++ b/src/main/java/vazkii/botania/common/item/ItemSignalFlare.java @@ -10,126 +10,104 @@ */ package vazkii.botania.common.item; -import java.awt.Color; -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.resources.I18n; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.passive.EntitySheep; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.MobEffects; +import net.minecraft.init.SoundEvents; +import net.minecraft.item.EnumDyeColor; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.world.World; -import vazkii.botania.client.core.helper.IconHelper; +import net.minecraftforge.fml.common.FMLCommonHandler; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.achievement.ModAchievements; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.entity.EntitySignalFlare; import vazkii.botania.common.lib.LibItemNames; -public class ItemSignalFlare extends ItemMod { +import javax.annotation.Nonnull; +import java.util.List; - IIcon[] icons; +public class ItemSignalFlare extends ItemMod { private static final String TAG_COLOR = "color"; public ItemSignalFlare() { - super(); + super(LibItemNames.SIGNAL_FLARE); setMaxStackSize(1); setNoRepair(); setMaxDamage(200); - setUnlocalizedName(LibItemNames.SIGNAL_FLARE); } + @Nonnull @Override - public boolean isFull3D() { - return true; - } - - @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { + public ActionResult onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) { if(par1ItemStack.getItemDamage() == 0) { - if(par2World.isRemote) - par3EntityPlayer.swingItem(); + if(world.isRemote) + player.swingArm(hand); else { - EntitySignalFlare flare = new EntitySignalFlare(par2World); - flare.setPosition(par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ); + EntitySignalFlare flare = new EntitySignalFlare(world); + flare.setPosition(player.posX, player.posY, player.posZ); flare.setColor(getColor(par1ItemStack)); - par2World.playSoundAtEntity(par3EntityPlayer, "random.explode", 40F, (1.0F + (par2World.rand.nextFloat() - par2World.rand.nextFloat()) * 0.2F) * 0.7F); + flare.setFiredAt((int) player.posY); + world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_GENERIC_EXPLODE, SoundCategory.PLAYERS, 40F, (1.0F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F) * 0.7F); - par2World.spawnEntityInWorld(flare); + world.spawnEntityInWorld(flare); int stunned = 0; int range = 5; - List entities = par2World.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(par3EntityPlayer.posX - range, par3EntityPlayer.posY - range, par3EntityPlayer.posZ - range, par3EntityPlayer.posX + range, par3EntityPlayer.posY + range, par3EntityPlayer.posZ + range)); + List entities = world.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(player.posX - range, player.posY - range, player.posZ - range, player.posX + range, player.posY + range, player.posZ + range)); for(EntityLivingBase entity : entities) - if(entity != par3EntityPlayer && (!(entity instanceof EntityPlayer) || MinecraftServer.getServer() == null || MinecraftServer.getServer().isPVPEnabled())) { - entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 50, 5)); + if(entity != player && (!(entity instanceof EntityPlayer) || FMLCommonHandler.instance().getMinecraftServerInstance() == null || FMLCommonHandler.instance().getMinecraftServerInstance().isPVPEnabled())) { + entity.addPotionEffect(new PotionEffect(MobEffects.SLOWNESS, 50, 5)); stunned++; } if(stunned >= 100) - par3EntityPlayer.addStat(ModAchievements.signalFlareStun, 1); + player.addStat(ModAchievements.signalFlareStun, 1); } - par1ItemStack.damageItem(200, par3EntityPlayer); + par1ItemStack.damageItem(200, player); + return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack); } - return par1ItemStack; + return ActionResult.newResult(EnumActionResult.PASS, par1ItemStack); } @Override - public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) { + public void onUpdate(ItemStack par1ItemStack, World world, Entity par3Entity, int par4, boolean par5) { if(par1ItemStack.isItemDamaged()) par1ItemStack.setItemDamage(par1ItemStack.getItemDamage() - 1); } @Override - public void registerIcons(IIconRegister par1IconRegister) { - icons = new IIcon[2]; - for(int i = 0; i < icons.length; i++) - icons[i] = IconHelper.forItem(par1IconRegister, this, i); - } - - @Override - public IIcon getIcon(ItemStack stack, int pass) { - return icons[Math.min(1, pass)]; - } - - @Override - public int getColorFromItemStack(ItemStack par1ItemStack, int par2) { - if(par2 == 0) - return 0xFFFFFF; - - int colorv = getColor(par1ItemStack); - if(colorv >= EntitySheep.fleeceColorTable.length || colorv < 0) - return 0xFFFFFF; - - float[] color = EntitySheep.fleeceColorTable[getColor(par1ItemStack)]; - return new Color(color[0], color[1], color[2]).getRGB(); - } - - @Override - public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) { + @SideOnly(Side.CLIENT) + public void getSubItems(@Nonnull Item item, CreativeTabs tab, List stacks) { for(int i = 0; i < 16; i++) - par3List.add(forColor(i)); + stacks.add(forColor(i)); } + @SideOnly(Side.CLIENT) @Override - public boolean requiresMultipleRenderPasses() { - return true; - } - - @Override - public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { + public void addInformation(ItemStack par1ItemStack, EntityPlayer player, List stacks, boolean par4) { int storedColor = getColor(par1ItemStack); - par3List.add(String.format(StatCollector.translateToLocal("botaniamisc.flareColor"), StatCollector.translateToLocal("botania.color" + storedColor))); + stacks.add(I18n.format("botaniamisc.flareColor", I18n.format("botania.color" + storedColor))); + } + + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerItemAllMeta(this, EnumDyeColor.values().length); } public static ItemStack forColor(int color) { diff --git a/src/main/java/vazkii/botania/common/item/ItemSlimeBottle.java b/src/main/java/vazkii/botania/common/item/ItemSlimeBottle.java index 3a9b37420..f8f7018e9 100644 --- a/src/main/java/vazkii/botania/common/item/ItemSlimeBottle.java +++ b/src/main/java/vazkii/botania/common/item/ItemSlimeBottle.java @@ -10,37 +10,24 @@ */ package vazkii.botania.common.item; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; +import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; -import vazkii.botania.client.core.helper.IconHelper; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.block.subtile.generating.SubTileNarslimmus; import vazkii.botania.common.lib.LibItemNames; public class ItemSlimeBottle extends ItemMod { - IIcon activeIcon; - public ItemSlimeBottle() { - setUnlocalizedName(LibItemNames.SLIME_BOTTLE); + super(LibItemNames.SLIME_BOTTLE); setMaxStackSize(1); setHasSubtypes(true); } - @Override - public void registerIcons(IIconRegister par1IconRegister) { - itemIcon = IconHelper.forItem(par1IconRegister, this, 0); - activeIcon = IconHelper.forItem(par1IconRegister, this, 1); - } - - @Override - public IIcon getIconFromDamage(int dmg) { - return dmg == 0 ? itemIcon : activeIcon; - } - @Override public void onUpdate(ItemStack stack, World world, Entity entity, int something, boolean somethingelse) { if(!world.isRemote) { @@ -54,4 +41,10 @@ public class ItemSlimeBottle extends ItemMod { } } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerItemAppendMeta(this, 2, LibItemNames.SLIME_BOTTLE); + } + } diff --git a/src/main/java/vazkii/botania/common/item/ItemSlingshot.java b/src/main/java/vazkii/botania/common/item/ItemSlingshot.java index cd52a80f4..50941026b 100644 --- a/src/main/java/vazkii/botania/common/item/ItemSlingshot.java +++ b/src/main/java/vazkii/botania/common/item/ItemSlingshot.java @@ -10,65 +10,76 @@ */ package vazkii.botania.common.item; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.SoundEvents; import net.minecraft.item.EnumAction; import net.minecraft.item.ItemStack; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.SoundCategory; import net.minecraft.world.World; +import vazkii.botania.common.core.helper.PlayerHelper; import vazkii.botania.common.entity.EntityVineBall; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; +import java.util.function.Predicate; + public class ItemSlingshot extends ItemMod { + private static final Predicate AMMO_FUNC = s -> s != null && s.getItem() == ModItems.vineBall; + public ItemSlingshot() { + super(LibItemNames.SLINGSHOT); setMaxStackSize(1); - setUnlocalizedName(LibItemNames.SLINGSHOT); } @Override - public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4) { + public void onPlayerStoppedUsing(ItemStack par1ItemStack, World world, EntityLivingBase living, int par4) { int j = getMaxItemUseDuration(par1ItemStack) - par4; - if(par3EntityPlayer.capabilities.isCreativeMode || par3EntityPlayer.inventory.hasItem(ModItems.vineBall)) { + if(!world.isRemote && (!(living instanceof EntityPlayer) || ((EntityPlayer) living).capabilities.isCreativeMode || PlayerHelper.hasAmmo(((EntityPlayer) living), AMMO_FUNC))) { float f = j / 20.0F; f = (f * f + f * 2.0F) / 3.0F; if(f < 1F) return; - if(!par3EntityPlayer.capabilities.isCreativeMode) - par3EntityPlayer.inventory.consumeInventoryItem(ModItems.vineBall); + if(living instanceof EntityPlayer && !((EntityPlayer) living).capabilities.isCreativeMode) + PlayerHelper.consumeAmmo(((EntityPlayer) living), AMMO_FUNC); - if(!par2World.isRemote) { - EntityVineBall ball = new EntityVineBall(par3EntityPlayer, false); - ball.motionX *= 1.6; - ball.motionY *= 1.6; - ball.motionZ *= 1.6; - par2World.spawnEntityInWorld(ball); - } + EntityVineBall ball = new EntityVineBall(living, false); + ball.setHeadingFromThrower(living, living.rotationPitch, living.rotationYaw, 0F, 1.5F, 1F); + ball.motionX *= 1.6; + ball.motionY *= 1.6; + ball.motionZ *= 1.6; + world.spawnEntityInWorld(ball); + world.playSound(null, living.posX, living.posY, living.posZ, SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.NEUTRAL, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); } } - @Override - public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - return par1ItemStack; - } - @Override public int getMaxItemUseDuration(ItemStack par1ItemStack) { return 72000; } + @Nonnull @Override public EnumAction getItemUseAction(ItemStack par1ItemStack) { - return EnumAction.bow; + return EnumAction.BOW; } + @Nonnull @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if(par3EntityPlayer.capabilities.isCreativeMode || par3EntityPlayer.inventory.hasItem(ModItems.vineBall)) - par3EntityPlayer.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack)); + public ActionResult onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) { + if(player.capabilities.isCreativeMode || PlayerHelper.hasAmmo(player, AMMO_FUNC)) { + player.setActiveHand(hand); + return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack); + } - return par1ItemStack; + return ActionResult.newResult(EnumActionResult.PASS, par1ItemStack); } } diff --git a/src/main/java/vazkii/botania/common/item/ItemSpark.java b/src/main/java/vazkii/botania/common/item/ItemSpark.java index c017efc98..1c048f1b5 100644 --- a/src/main/java/vazkii/botania/common/item/ItemSpark.java +++ b/src/main/java/vazkii/botania/common/item/ItemSpark.java @@ -10,60 +10,51 @@ */ package vazkii.botania.common.item; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.stats.Achievement; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import vazkii.botania.api.internal.VanillaPacketDispatcher; import vazkii.botania.api.mana.IManaGivingItem; import vazkii.botania.api.mana.spark.ISparkAttachable; -import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.common.achievement.ICraftAchievement; import vazkii.botania.common.achievement.ModAchievements; import vazkii.botania.common.entity.EntitySpark; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; + public class ItemSpark extends ItemMod implements ICraftAchievement, IManaGivingItem { - public static IIcon invIcon, worldIcon; - public ItemSpark() { - setUnlocalizedName(LibItemNames.SPARK); + super(LibItemNames.SPARK); } + @Nonnull @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xv, float yv, float zv) { - TileEntity tile = world.getTileEntity(x, y, z); + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float xv, float yv, float zv) { + TileEntity tile = world.getTileEntity(pos); if(tile instanceof ISparkAttachable) { ISparkAttachable attach = (ISparkAttachable) tile; if(attach.canAttachSpark(stack) && attach.getAttachedSpark() == null) { stack.stackSize--; if(!world.isRemote) { EntitySpark spark = new EntitySpark(world); - spark.setPosition(x + 0.5, y + 1.5, z + 0.5); + spark.setPosition(pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5); world.spawnEntityInWorld(spark); attach.attachSpark(spark); - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, x, y, z); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos); } - return true; + return EnumActionResult.SUCCESS; } } - return false; - } - - @Override - public void registerIcons(IIconRegister par1IconRegister) { - invIcon = IconHelper.forItem(par1IconRegister, this, 0); - worldIcon = IconHelper.forItem(par1IconRegister, this, 1); - } - - @Override - public IIcon getIconFromDamage(int p_77617_1_) { - return invIcon; + return EnumActionResult.PASS; } @Override diff --git a/src/main/java/vazkii/botania/common/item/ItemSparkUpgrade.java b/src/main/java/vazkii/botania/common/item/ItemSparkUpgrade.java index 20b3f1e81..368567c21 100644 --- a/src/main/java/vazkii/botania/common/item/ItemSparkUpgrade.java +++ b/src/main/java/vazkii/botania/common/item/ItemSparkUpgrade.java @@ -10,54 +10,45 @@ */ package vazkii.botania.common.item; -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import vazkii.botania.client.core.helper.IconHelper; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; +import java.util.List; + public class ItemSparkUpgrade extends ItemMod { - private static final int VARIANTS = 4; - - public static IIcon[] worldIcons; - IIcon[] invIcons; + public static final int VARIANTS = 4; public ItemSparkUpgrade() { - setUnlocalizedName(LibItemNames.SPARK_UPGRADE); + super(LibItemNames.SPARK_UPGRADE); setHasSubtypes(true); } @Override - public void registerIcons(IIconRegister par1IconRegister) { - worldIcons = new IIcon[VARIANTS]; - invIcons = new IIcon[VARIANTS]; - for(int i = 0; i < VARIANTS; i++) { - worldIcons[i] = IconHelper.forItem(par1IconRegister, this, "L" + i); - invIcons[i] = IconHelper.forItem(par1IconRegister, this, i); - } - } - - @Override - public IIcon getIconFromDamage(int meta) { - return invIcons[Math.min(invIcons.length - 1, meta)]; - } - - @Override - public void getSubItems(Item item, CreativeTabs tab, List list) { + @SideOnly(Side.CLIENT) + public void getSubItems(@Nonnull Item item, CreativeTabs tab, List list) { for(int i = 0; i < VARIANTS; i++) list.add(new ItemStack(item, 1, i)); } + @Nonnull @Override public String getUnlocalizedName(ItemStack par1ItemStack) { return getUnlocalizedNameLazy(par1ItemStack) + par1ItemStack.getItemDamage(); } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerItemAppendMeta(this, 4, LibItemNames.SPARK_UPGRADE); + } + String getUnlocalizedNameLazy(ItemStack par1ItemStack) { return super.getUnlocalizedName(par1ItemStack); } diff --git a/src/main/java/vazkii/botania/common/item/ItemSpawnerMover.java b/src/main/java/vazkii/botania/common/item/ItemSpawnerMover.java index 981d009a4..7c23c5350 100644 --- a/src/main/java/vazkii/botania/common/item/ItemSpawnerMover.java +++ b/src/main/java/vazkii/botania/common/item/ItemSpawnerMover.java @@ -10,51 +10,41 @@ */ package vazkii.botania.common.item; -import java.util.List; - import net.minecraft.block.Block; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.resources.I18n; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.internal.VanillaPacketDispatcher; -import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.common.Botania; import vazkii.botania.common.achievement.ModAchievements; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; +import java.util.List; + public class ItemSpawnerMover extends ItemMod { public static final String TAG_SPAWNER = "spawner"; private static final String TAG_PLACE_DELAY = "placeDelay"; - IIcon iconNormal, iconSpawner; - public ItemSpawnerMover() { - setUnlocalizedName(LibItemNames.SPAWNER_MOVER); + super(LibItemNames.SPAWNER_MOVER); setMaxStackSize(1); - } - - @Override - public void registerIcons(IIconRegister par1IconRegister) { - iconNormal = IconHelper.forItem(par1IconRegister, this, 0); - iconSpawner = IconHelper.forItem(par1IconRegister, this, 1); - } - - @Override - public IIcon getIcon(ItemStack stack, int pass) { - return getIconIndex(stack); - } - - @Override - public IIcon getIconIndex(ItemStack par1ItemStack) { - return hasData(par1ItemStack) ? iconSpawner : iconNormal; + addPropertyOverride(new ResourceLocation("botania", "full"), (stack, worldIn, entityIn) -> hasData(stack) ? 1 : 0); } public static NBTTagCompound getSpawnerTag(ItemStack stack) { @@ -89,11 +79,12 @@ public class ItemSpawnerMover extends ItemMod { return 0; } + @SideOnly(Side.CLIENT) @Override - public void addInformation(ItemStack stack, EntityPlayer player, List infoList, boolean advancedTooltips) { + public void addInformation(ItemStack stack, EntityPlayer player, List infoList, boolean advancedTooltips) { String id = getEntityId(stack); if (id != null) - infoList.add(StatCollector.translateToLocal("entity." + id + ".name")); + infoList.add(I18n.format("entity." + id + ".name")); } @Override @@ -103,100 +94,80 @@ public class ItemSpawnerMover extends ItemMod { tag.setInteger(TAG_PLACE_DELAY, tag.getInteger(TAG_PLACE_DELAY) - 1); } + @Nonnull @Override - public boolean onItemUse(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) { + public EnumActionResult onItemUse(ItemStack itemstack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float xOffset, float yOffset, float zOffset) { if(getEntityId(itemstack) == null) { - if(world.getBlock(x, y, z).equals(Blocks.mob_spawner)) { - TileEntity te = world.getTileEntity(x, y, z); + if(world.getBlockState(pos).getBlock().equals(Blocks.MOB_SPAWNER)) { + TileEntity te = world.getTileEntity(pos); NBTTagCompound tag = new NBTTagCompound(); tag.setTag(TAG_SPAWNER, new NBTTagCompound()); te.writeToNBT(tag.getCompoundTag(TAG_SPAWNER)); tag.setInteger(TAG_PLACE_DELAY, 20); itemstack.setTagCompound(tag); - world.setBlockToAir(x, y, z); + world.setBlockToAir(pos); player.renderBrokenItemStack(itemstack); for(int i = 0; i < 50; i++) { float red = (float) Math.random(); float green = (float) Math.random(); float blue = (float) Math.random(); - Botania.proxy.wispFX(world, x + 0.5, y + 0.5, z + 0.5, red, green, blue, (float) Math.random() * 0.1F + 0.05F, (float) (Math.random() - 0.5F) * 0.15F, (float) (Math.random() - 0.5F) * 0.15F, (float) (Math.random() - 0.5F) * 0.15F); + Botania.proxy.wispFX(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, red, green, blue, (float) Math.random() * 0.1F + 0.05F, (float) (Math.random() - 0.5F) * 0.15F, (float) (Math.random() - 0.5F) * 0.15F, (float) (Math.random() - 0.5F) * 0.15F); } - return true; - } else return false; + return EnumActionResult.SUCCESS; + } else return EnumActionResult.PASS; } else { - if(getDelay(itemstack) <= 0 && placeBlock(itemstack, player, world, x, y, z, side, xOffset, yOffset, zOffset)) - return true; - return false; + return getDelay(itemstack) <= 0 && placeBlock(itemstack, player, world, pos, side, xOffset, yOffset, zOffset) ? EnumActionResult.SUCCESS : EnumActionResult.PASS; } } - private boolean placeBlock(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) { - Block block = world.getBlock(x, y, z); + // Adapted from ItemBlock.onItemUse + private boolean placeBlock(ItemStack itemstack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float xOffset, float yOffset, float zOffset) { + IBlockState iblockstate = world.getBlockState(pos); + Block block = iblockstate.getBlock(); - if(block == Blocks.snow_layer) - side = 1; - else if(block != Blocks.vine && block != Blocks.tallgrass && block != Blocks.deadbush && !block.isReplaceable(world, x, y, z)) { - switch (side) { - case 0: - --y; - break; - case 1: - ++y; - break; - case 2: - --z; - break; - case 3: - ++z; - break; - case 4: - --x; - break; - case 5: - ++x; - break; - } + if(!block.isReplaceable(world, pos)) { + pos = pos.offset(side); } - if(itemstack.stackSize == 0) + if(itemstack.stackSize == 0) { return false; - else if(!player.canPlayerEdit(x, y, z, side, itemstack)) + } else if(!player.canPlayerEdit(pos, side, itemstack)) { return false; - else if(y == 255 && block.getMaterial().isSolid()) - return false; - else if(world.canPlaceEntityOnSide(Blocks.mob_spawner, x, y, z, false, side, player, itemstack)) { - int meta = block.onBlockPlaced(world, x, y, z, side, xOffset, yOffset, zOffset, 0); + } else if(world.canBlockBePlaced(Blocks.MOB_SPAWNER, pos, false, side, null, itemstack)) { + int meta = this.getMetadata(itemstack.getMetadata()); + IBlockState iblockstate1 = Blocks.MOB_SPAWNER.onBlockPlaced(world, pos, side, xOffset, yOffset, zOffset, meta, player); - if(placeBlockAt(itemstack, player, world, x, y, z, side, xOffset, yOffset, zOffset, meta)) { - world.playSoundEffect(x + 0.5F, y + 0.5F, z + 0.5F, block.stepSound.func_150496_b(), (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F); + if (placeBlockAt(itemstack, player, world, pos, side, xOffset, yOffset, zOffset, iblockstate1)) { + world.playSound(null, pos, Blocks.MOB_SPAWNER.getSoundType().getPlaceSound(), SoundCategory.BLOCKS, (Blocks.MOB_SPAWNER.getSoundType().getVolume() + 1.0F) / 2.0F, Blocks.MOB_SPAWNER.getSoundType().getPitch() * 0.8F); + --itemstack.stackSize; player.renderBrokenItemStack(itemstack); player.addStat(ModAchievements.spawnerMoverUse, 1); for(int i = 0; i < 100; i++) - Botania.proxy.sparkleFX(world, x + Math.random(), y + Math.random(), z + Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), 0.45F + 0.2F * (float) Math.random(), 6); - - --itemstack.stackSize; + Botania.proxy.sparkleFX(pos.getX() + Math.random(), pos.getY() + Math.random(), pos.getZ() + Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), 0.45F + 0.2F * (float) Math.random(), 6); } return true; + } else { + return false; } - else return false; } - private boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) { - if (!world.setBlock(x, y, z, Blocks.mob_spawner, metadata, 3)) + // Adapted from ItemBlock.placeBlockAt + private boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, IBlockState state) { + if (!world.setBlockState(pos, state, 3)) return false; - Block block = world.getBlock(x, y, z); - if(block.equals(Blocks.mob_spawner)) { - TileEntity te = world.getTileEntity(x, y, z); + Block block = world.getBlockState(pos).getBlock(); + if(block.equals(Blocks.MOB_SPAWNER)) { + TileEntity te = world.getTileEntity(pos); NBTTagCompound tag = stack.getTagCompound(); if (tag.hasKey(TAG_SPAWNER)) tag = tag.getCompoundTag(TAG_SPAWNER); - tag.setInteger("x", x); - tag.setInteger("y", y); - tag.setInteger("z", z); + tag.setInteger("x", pos.getX()); + tag.setInteger("y", pos.getY()); + tag.setInteger("z", pos.getZ()); te.readFromNBT(tag); - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, x, y, z); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos); } return true; diff --git a/src/main/java/vazkii/botania/common/item/ItemSpellCloth.java b/src/main/java/vazkii/botania/common/item/ItemSpellCloth.java index d8782f5d5..e300e8431 100644 --- a/src/main/java/vazkii/botania/common/item/ItemSpellCloth.java +++ b/src/main/java/vazkii/botania/common/item/ItemSpellCloth.java @@ -10,50 +10,46 @@ */ package vazkii.botania.common.item; -import java.awt.Color; - import net.minecraft.item.ItemStack; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.oredict.RecipeSorter; import net.minecraftforge.oredict.RecipeSorter.Category; import vazkii.botania.common.crafting.recipe.SpellClothRecipe; import vazkii.botania.common.lib.LibItemNames; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import javax.annotation.Nonnull; +import java.awt.*; public class ItemSpellCloth extends ItemMod { public ItemSpellCloth() { + super(LibItemNames.SPELL_CLOTH); setMaxDamage(35); setMaxStackSize(1); setNoRepair(); - setUnlocalizedName(LibItemNames.SPELL_CLOTH); GameRegistry.addRecipe(new SpellClothRecipe()); RecipeSorter.register("botania:spellCloth", SpellClothRecipe.class, Category.SHAPELESS, ""); } @Override - @SideOnly(Side.CLIENT) - public int getColorFromItemStack(ItemStack par1ItemStack, int par2) { - return Color.HSBtoRGB(0.55F, ((float) par1ItemStack.getMaxDamage() - (float) par1ItemStack.getItemDamage()) / par1ItemStack.getMaxDamage() * 0.5F, 1F); + public boolean isBookEnchantable(ItemStack stack, ItemStack book) { + return false; } @Override - public boolean hasContainerItem() { + public boolean hasContainerItem(ItemStack stack) { return true; } + @Nonnull @Override - public ItemStack getContainerItem(ItemStack itemStack) { + public ItemStack getContainerItem(@Nonnull ItemStack itemStack) { ItemStack stack = itemStack.copy(); stack.setItemDamage(stack.getItemDamage() + 1); return stack; } - @Override - public boolean doesContainerItemLeaveCraftingGrid(ItemStack par1ItemStack) { - return false; - } - } diff --git a/src/main/java/vazkii/botania/common/item/ItemTemperanceStone.java b/src/main/java/vazkii/botania/common/item/ItemTemperanceStone.java index 371d5a089..f36629641 100644 --- a/src/main/java/vazkii/botania/common/item/ItemTemperanceStone.java +++ b/src/main/java/vazkii/botania/common/item/ItemTemperanceStone.java @@ -10,61 +10,56 @@ */ package vazkii.botania.common.item; -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.SoundEvents; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.SoundCategory; import net.minecraft.world.World; -import vazkii.botania.client.core.helper.IconHelper; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.lib.LibItemNames; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import javax.annotation.Nonnull; +import java.util.List; public class ItemTemperanceStone extends ItemMod { - IIcon enabledIcon; - public ItemTemperanceStone() { - setUnlocalizedName(LibItemNames.TEMPERANCE_STONE); + super(LibItemNames.TEMPERANCE_STONE); setMaxStackSize(1); setHasSubtypes(true); } + @Nonnull @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - int dmg = par1ItemStack.getItemDamage(); - par1ItemStack.setItemDamage(~dmg & 1); - par2World.playSoundAtEntity(par3EntityPlayer, "random.orb", 0.3F, 0.1F); - - return par1ItemStack; + public ActionResult onItemRightClick(@Nonnull ItemStack stack, World world, EntityPlayer player, EnumHand hand) { + int dmg = stack.getItemDamage(); + stack.setItemDamage(~dmg & 1); + world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_EXPERIENCE_ORB_PICKUP, SoundCategory.NEUTRAL, 0.3F, 0.1F); + return ActionResult.newResult(EnumActionResult.SUCCESS, stack); } @Override @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) { - itemIcon = IconHelper.forItem(par1IconRegister, this, 0); - enabledIcon = IconHelper.forItem(par1IconRegister, this, 1); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamage(int par1) { - return par1 == 1 ? enabledIcon : itemIcon; - } - - @Override - @SideOnly(Side.CLIENT) - public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { + public void addInformation(ItemStack par1ItemStack, EntityPlayer player, List stacks, boolean par4) { if(par1ItemStack.getItemDamage() == 1) - addStringToTooltip(StatCollector.translateToLocal("botaniamisc.active"), par3List); - else addStringToTooltip(StatCollector.translateToLocal("botaniamisc.inactive"), par3List); + addStringToTooltip(I18n.format("botaniamisc.active"), stacks); + else addStringToTooltip(I18n.format("botaniamisc.inactive"), stacks); } - void addStringToTooltip(String s, List tooltip) { + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerItemAppendMeta(this, 2, LibItemNames.TEMPERANCE_STONE); + } + + private void addStringToTooltip(String s, List tooltip) { tooltip.add(s.replaceAll("&", "\u00a7")); } diff --git a/src/main/java/vazkii/botania/common/item/ItemThornChakram.java b/src/main/java/vazkii/botania/common/item/ItemThornChakram.java index 1d790d9ae..5a93994d4 100644 --- a/src/main/java/vazkii/botania/common/item/ItemThornChakram.java +++ b/src/main/java/vazkii/botania/common/item/ItemThornChakram.java @@ -9,69 +9,66 @@ * File Created @ [Jan 25, 2015, 6:42:47 PM (GMT)] */ package vazkii.botania.common.item; -import java.util.List; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.SoundEvents; import net.minecraft.inventory.IInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.stats.Achievement; -import net.minecraft.util.IIcon; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.SoundCategory; import net.minecraft.world.World; -import vazkii.botania.client.core.helper.IconHelper; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.achievement.ICraftAchievement; import vazkii.botania.common.achievement.ModAchievements; import vazkii.botania.common.entity.EntityThornChakram; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; +import java.util.List; + public class ItemThornChakram extends ItemMod implements ICraftAchievement { - IIcon iconFire; - public ItemThornChakram() { - setUnlocalizedName(LibItemNames.THORN_CHAKRAM); + super(LibItemNames.THORN_CHAKRAM); setMaxStackSize(6); setHasSubtypes(true); } + @SideOnly(Side.CLIENT) @Override - public void getSubItems(Item item, CreativeTabs tab, List list) { + public void getSubItems(@Nonnull Item item, CreativeTabs tab, List list) { for(int i = 0; i < 2; i++) list.add(new ItemStack(item, 1, i)); } - @Override - public void registerIcons(IIconRegister par1IconRegister) { - itemIcon = IconHelper.forItem(par1IconRegister, this, 0); - iconFire = IconHelper.forItem(par1IconRegister, this, 1); - } - - @Override - public IIcon getIconFromDamage(int dmg) { - return dmg == 0 ? itemIcon : iconFire; - } - + @Nonnull @Override public String getUnlocalizedName(ItemStack stack) { return super.getUnlocalizedName() + stack.getItemDamage(); } + @Nonnull @Override - public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { - --p_77659_1_.stackSize; - - p_77659_2_.playSoundAtEntity(p_77659_3_, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); - - if(!p_77659_2_.isRemote) { - EntityThornChakram c = new EntityThornChakram(p_77659_2_, p_77659_3_); - c.setFire(p_77659_1_.getItemDamage() != 0); - p_77659_2_.spawnEntityInWorld(c); + public ActionResult onItemRightClick(@Nonnull ItemStack stack, World world, EntityPlayer player, EnumHand hand) { + if(!world.isRemote) { + ItemStack copy = stack.copy(); + copy.stackSize = 1; + EntityThornChakram c = new EntityThornChakram(world, player, copy); + c.setHeadingFromThrower(player, player.rotationPitch, player.rotationYaw, 0.0F, 1.5F, 1.0F); + c.setFire(stack.getItemDamage() != 0); + world.spawnEntityInWorld(c); + world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.PLAYERS, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + --stack.stackSize; } - - return p_77659_1_; + return ActionResult.newResult(EnumActionResult.SUCCESS, stack); } @Override @@ -79,4 +76,10 @@ public class ItemThornChakram extends ItemMod implements ICraftAchievement { return ModAchievements.terrasteelWeaponCraft; } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerItemAppendMeta(this, 2, LibItemNames.THORN_CHAKRAM); + } + } diff --git a/src/main/java/vazkii/botania/common/item/ItemTwigWand.java b/src/main/java/vazkii/botania/common/item/ItemTwigWand.java index de32dd143..71b29d596 100644 --- a/src/main/java/vazkii/botania/common/item/ItemTwigWand.java +++ b/src/main/java/vazkii/botania/common/item/ItemTwigWand.java @@ -10,33 +10,38 @@ */ package vazkii.botania.common.item; -import java.awt.Color; -import java.util.List; - import net.minecraft.block.Block; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.resources.I18n; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; -import net.minecraft.entity.passive.EntitySheep; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; +import net.minecraft.item.EnumDyeColor; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.IIcon; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.StatCollector; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.internal.VanillaPacketDispatcher; +import vazkii.botania.api.sound.BotaniaSoundEvents; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.api.wand.ICoordBoundItem; import vazkii.botania.api.wand.ITileBound; import vazkii.botania.api.wand.IWandBindable; import vazkii.botania.api.wand.IWandable; -import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.common.Botania; import vazkii.botania.common.achievement.ModAchievements; import vazkii.botania.common.block.BlockPistonRelay; @@ -47,9 +52,11 @@ import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.core.helper.Vector3; import vazkii.botania.common.lib.LibItemNames; -public class ItemTwigWand extends Item16Colors implements ICoordBoundItem { +import javax.annotation.Nonnull; +import java.awt.*; +import java.util.List; - IIcon[] icons; +public class ItemTwigWand extends Item16Colors implements ICoordBoundItem { private static final String TAG_COLOR1 = "color1"; private static final String TAG_COLOR2 = "color2"; @@ -57,48 +64,51 @@ public class ItemTwigWand extends Item16Colors implements ICoordBoundItem { private static final String TAG_BOUND_TILE_Y = "boundTileY"; private static final String TAG_BOUND_TILE_Z = "boundTileZ"; private static final String TAG_BIND_MODE = "bindMode"; + private static final BlockPos UNBOUND_POS = new BlockPos(0, -1, 0); public ItemTwigWand() { super(LibItemNames.TWIG_WAND); setMaxStackSize(1); + addPropertyOverride(new ResourceLocation("botania", "bindmode"), (stack, worldIn, entityIn) -> getBindMode(stack) ? 1 : 0); } + @Nonnull @Override - public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { - Block block = par3World.getBlock(par4, par5, par6); - ChunkCoordinates boundTile = getBoundTile(par1ItemStack); + public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) { + Block block = world.getBlockState(pos).getBlock(); + BlockPos boundTile = getBoundTile(par1ItemStack); - if(boundTile.posY != -1 && par2EntityPlayer.isSneaking() && (boundTile.posX != par4 || boundTile.posY != par5 || boundTile.posZ != par6)) { - TileEntity tile = par3World.getTileEntity(boundTile.posX, boundTile.posY, boundTile.posZ); + if(boundTile.getY() != -1 && player.isSneaking() && !pos.equals(boundTile)) { + TileEntity tile = world.getTileEntity(boundTile); if(tile instanceof IWandBindable) { - if(((IWandBindable) tile).bindTo(par2EntityPlayer, par1ItemStack, par4, par5, par6, par7)) { - Vector3 orig = new Vector3(boundTile.posX + 0.5, boundTile.posY + 0.5, boundTile.posZ + 0.5); - Vector3 end = new Vector3(par4 + 0.5, par5 + 0.5, par6 + 0.5); - doParticleBeam(par3World, orig, end); + if(((IWandBindable) tile).bindTo(player, par1ItemStack, pos, side)) { + Vector3 orig = new Vector3(boundTile.getX() + 0.5, boundTile.getY() + 0.5, boundTile.getZ() + 0.5); + Vector3 end = new Vector3(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5); + doParticleBeam(world, orig, end); - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(par3World, boundTile.posX, boundTile.posY, boundTile.posZ); - setBoundTile(par1ItemStack, 0, -1, 0); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, boundTile); + setBoundTile(par1ItemStack, UNBOUND_POS); } - return true; - } else setBoundTile(par1ItemStack, 0, -1, 0); - } else if(par2EntityPlayer.isSneaking()) { - block.rotateBlock(par3World, par4, par5, par6, ForgeDirection.getOrientation(par7)); - if(par3World.isRemote) - par2EntityPlayer.swingItem(); + return EnumActionResult.SUCCESS; + } else setBoundTile(par1ItemStack, UNBOUND_POS); + } else if(player.isSneaking()) { + block.rotateBlock(world, pos, side); + if(world.isRemote) + player.swingArm(hand); } - if(block == Blocks.lapis_block && ConfigHandler.enchanterEnabled) { - int meta = -1; - if(TileEnchanter.canEnchanterExist(par3World, par4, par5, par6, 0)) - meta = 0; - else if(TileEnchanter.canEnchanterExist(par3World, par4, par5, par6, 1)) - meta = 1; + if(block == Blocks.LAPIS_BLOCK && ConfigHandler.enchanterEnabled) { + EnumFacing.Axis axis = null; + if(TileEnchanter.canEnchanterExist(world, pos, EnumFacing.Axis.X)) + axis = EnumFacing.Axis.X; + else if(TileEnchanter.canEnchanterExist(world, pos, EnumFacing.Axis.Z)) + axis = EnumFacing.Axis.Z; - if(meta != -1 && !par3World.isRemote) { - par3World.setBlock(par4, par5, par6, ModBlocks.enchanter, meta, 1 | 2); - par2EntityPlayer.addStat(ModAchievements.enchanterMake, 1); - par3World.playSoundEffect(par4, par5, par6, "botania:enchanterBlock", 0.5F, 0.6F); + if(axis != null && !world.isRemote) { + world.setBlockState(pos, ModBlocks.enchanter.getDefaultState().withProperty(BotaniaStateProps.ENCHANTER_DIRECTION, axis), 1 | 2); + player.addStat(ModAchievements.enchanterMake, 1); + world.playSound(null, pos, BotaniaSoundEvents.enchanterForm, SoundCategory.BLOCKS, 0.5F, 0.6F); for(int i = 0; i < 50; i++) { float red = (float) Math.random(); float green = (float) Math.random(); @@ -110,56 +120,57 @@ public class ItemTwigWand extends Item16Colors implements ICoordBoundItem { float velMul = 0.07F; - Botania.proxy.wispFX(par3World, par4 + 0.5 + x, par5 + 0.5 + y, par6 + 0.5 + z, red, green, blue, (float) Math.random() * 0.15F + 0.15F, (float) -x * velMul, (float) -y * velMul, (float) -z * velMul); + Botania.proxy.wispFX(pos.getX() + 0.5 + x, pos.getY() + 0.5 + y, pos.getZ() + 0.5 + z, red, green, blue, (float) Math.random() * 0.15F + 0.15F, (float) -x * velMul, (float) -y * velMul, (float) -z * velMul); } } } else if(block instanceof IWandable) { - TileEntity tile = par3World.getTileEntity(par4, par5, par6); + TileEntity tile = world.getTileEntity(pos); boolean bindable = tile instanceof IWandBindable; - boolean wanded = false; - if(getBindMode(par1ItemStack) && bindable && par2EntityPlayer.isSneaking() && ((IWandBindable) tile).canSelect(par2EntityPlayer, par1ItemStack, par4, par5, par6, par7)) { - if(boundTile.posX == par4 && boundTile.posY == par5 && boundTile.posZ == par6) - setBoundTile(par1ItemStack, 0, -1, 0); - else setBoundTile(par1ItemStack, par4, par5, par6); + boolean wanded; + if(getBindMode(par1ItemStack) && bindable && player.isSneaking() && ((IWandBindable) tile).canSelect(player, par1ItemStack, pos, side)) { + if(boundTile.equals(pos)) + setBoundTile(par1ItemStack, UNBOUND_POS); + else setBoundTile(par1ItemStack, pos); - if(par3World.isRemote) - par2EntityPlayer.swingItem(); - par3World.playSoundAtEntity(par2EntityPlayer, "botania:ding", 0.1F, 1F); + if(world.isRemote) + player.swingArm(hand); + world.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.ding, SoundCategory.PLAYERS, 0.11F, 1F); wanded = true; } else { - wanded = ((IWandable) block).onUsedByWand(par2EntityPlayer, par1ItemStack, par3World, par4, par5, par6, par7); - if(wanded && par3World.isRemote) - par2EntityPlayer.swingItem(); + wanded = ((IWandable) block).onUsedByWand(player, par1ItemStack, world, pos, side); + if(wanded && world.isRemote) + player.swingArm(hand); } - return wanded; - } else if(BlockPistonRelay.playerPositions.containsKey(par2EntityPlayer.getCommandSenderName()) && !par3World.isRemote) { - String bindPos = BlockPistonRelay.playerPositions.get(par2EntityPlayer.getCommandSenderName()); - String currentPos = BlockPistonRelay.getCoordsAsString(par3World.provider.dimensionId, par4, par5, par6); + return wanded ? EnumActionResult.SUCCESS : EnumActionResult.FAIL; + } else if(((BlockPistonRelay) (ModBlocks.pistonRelay)).playerPositions.containsKey(player.getUniqueID()) && !world.isRemote) { + BlockPistonRelay.DimWithPos bindPos = ((BlockPistonRelay) (ModBlocks.pistonRelay)).playerPositions.get(player.getUniqueID()); + BlockPistonRelay.DimWithPos currentPos = new BlockPistonRelay.DimWithPos(world.provider.getDimension(), pos); - BlockPistonRelay.playerPositions.remove(par2EntityPlayer.getCommandSenderName()); - BlockPistonRelay.mappedPositions.put(bindPos, currentPos); - BlockPistonRelay.WorldData.get(par3World).markDirty(); + ((BlockPistonRelay) (ModBlocks.pistonRelay)).playerPositions.remove(player.getUniqueID()); + ((BlockPistonRelay) (ModBlocks.pistonRelay)).mappedPositions.put(bindPos, currentPos); + BlockPistonRelay.WorldData.get(world).markDirty(); - par3World.playSoundAtEntity(par2EntityPlayer, "botania:ding", 1F, 1F); + world.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.ding, SoundCategory.PLAYERS, 1F, 1F); + return EnumActionResult.SUCCESS; } - return false; + return EnumActionResult.PASS; } public static void doParticleBeam(World world, Vector3 orig, Vector3 end) { if(!world.isRemote) return; - Vector3 diff = end.copy().sub(orig); - Vector3 movement = diff.copy().normalize().multiply(0.05); + Vector3 diff = end.subtract(orig); + Vector3 movement = diff.normalize().multiply(0.05); int iters = (int) (diff.mag() / movement.mag()); float huePer = 1F / iters; float hueSum = (float) Math.random(); - Vector3 currentPos = orig.copy(); + Vector3 currentPos = orig; for(int i = 0; i < iters; i++) { float hue = i * huePer + hueSum; Color color = Color.getHSBColor(hue, 1F, 1F); @@ -168,88 +179,53 @@ public class ItemTwigWand extends Item16Colors implements ICoordBoundItem { float b = color.getBlue() / 255F; Botania.proxy.setSparkleFXNoClip(true); - Botania.proxy.sparkleFX(world, currentPos.x, currentPos.y, currentPos.z, r, g, b, 0.5F, 4); + Botania.proxy.sparkleFX(currentPos.x, currentPos.y, currentPos.z, r, g, b, 0.5F, 4); Botania.proxy.setSparkleFXNoClip(false); - currentPos.add(movement); + currentPos = currentPos.add(movement); } } @Override - public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) { - ChunkCoordinates coords = getBoundTile(par1ItemStack); - TileEntity tile = par2World.getTileEntity(coords.posX, coords.posY, coords.posZ); + public void onUpdate(ItemStack par1ItemStack, World world, Entity par3Entity, int par4, boolean par5) { + BlockPos coords = getBoundTile(par1ItemStack); + TileEntity tile = world.getTileEntity(coords); if(tile == null || !(tile instanceof IWandBindable)) - setBoundTile(par1ItemStack, 0, -1, 0); + setBoundTile(par1ItemStack, UNBOUND_POS); } + @Nonnull @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { + public ActionResult onItemRightClick(@Nonnull ItemStack stack, World world, EntityPlayer player, EnumHand hand) { if(!world.isRemote && player.isSneaking()) { setBindMode(stack, !getBindMode(stack)); - world.playSoundAtEntity(player, "botania:ding", 0.1F, 1F); + world.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.ding, SoundCategory.PLAYERS, 0.1F, 1F); } - return stack; + return ActionResult.newResult(EnumActionResult.SUCCESS, stack); } @Override - public boolean isFull3D() { - return true; - } - - @Override - public void registerIcons(IIconRegister par1IconRegister) { - icons = new IIcon[4]; - for(int i = 0; i < icons.length; i++) - icons[i] = IconHelper.forItem(par1IconRegister, this, i); - } - - @Override - public IIcon getIcon(ItemStack stack, int pass) { - if(pass == 3 && !getBindMode(stack)) - pass = 0; - - return icons[Math.min(icons.length - 1, pass)]; - } - - @Override - public int getColorFromItemStack(ItemStack par1ItemStack, int par2) { - if(par2 == 0 || par2 == 3) - return 0xFFFFFF; - - float[] color = EntitySheep.fleeceColorTable[par2 == 1 ? getColor1(par1ItemStack) : getColor2(par1ItemStack)]; - return new Color(color[0], color[1], color[2]).getRGB(); - } - - @Override - public boolean requiresMultipleRenderPasses() { - return true; - } - - @Override - public int getRenderPasses(int metadata) { - return 4; - } - - @Override - public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) { + public void getSubItems(@Nonnull Item item, CreativeTabs tab, List stacks) { for(int i = 0; i < 16; i++) - par3List.add(forColors(i, i)); + stacks.add(forColors(i, i)); } + @Nonnull @Override public String getUnlocalizedName(ItemStack par1ItemStack) { return getUnlocalizedNameLazy(par1ItemStack); } + @SideOnly(Side.CLIENT) @Override - public void addInformation(ItemStack stack, EntityPlayer p, List list, boolean adv) { - list.add(StatCollector.translateToLocal(getModeString(stack))); + public void addInformation(ItemStack stack, EntityPlayer p, List list, boolean adv) { + list.add(I18n.format(getModeString(stack))); } + @Nonnull @Override public EnumRarity getRarity(ItemStack par1ItemStack) { - return EnumRarity.rare; + return EnumRarity.RARE; } public static ItemStack forColors(int color1, int color2) { @@ -268,17 +244,17 @@ public class ItemTwigWand extends Item16Colors implements ICoordBoundItem { return ItemNBTHelper.getInt(stack, TAG_COLOR2, 0); } - public static void setBoundTile(ItemStack stack, int x, int y, int z) { - ItemNBTHelper.setInt(stack, TAG_BOUND_TILE_X, x); - ItemNBTHelper.setInt(stack, TAG_BOUND_TILE_Y, y); - ItemNBTHelper.setInt(stack, TAG_BOUND_TILE_Z, z); + public static void setBoundTile(ItemStack stack, BlockPos pos) { + ItemNBTHelper.setInt(stack, TAG_BOUND_TILE_X, pos.getX()); + ItemNBTHelper.setInt(stack, TAG_BOUND_TILE_Y, pos.getY()); + ItemNBTHelper.setInt(stack, TAG_BOUND_TILE_Z, pos.getZ()); } - public static ChunkCoordinates getBoundTile(ItemStack stack) { + public static BlockPos getBoundTile(ItemStack stack) { int x = ItemNBTHelper.getInt(stack, TAG_BOUND_TILE_X, 0); int y = ItemNBTHelper.getInt(stack, TAG_BOUND_TILE_Y, -1); int z = ItemNBTHelper.getInt(stack, TAG_BOUND_TILE_Z, 0); - return new ChunkCoordinates(x, y, z); + return new BlockPos(x, y, z); } public static boolean getBindMode(ItemStack stack) { @@ -294,16 +270,16 @@ public class ItemTwigWand extends Item16Colors implements ICoordBoundItem { } @Override - public ChunkCoordinates getBinding(ItemStack stack) { - ChunkCoordinates bound = getBoundTile(stack); - if(bound.posY != -1) + public BlockPos getBinding(ItemStack stack) { + BlockPos bound = getBoundTile(stack); + if(bound.getY() != -1) return bound; - MovingObjectPosition pos = Minecraft.getMinecraft().objectMouseOver; - if(pos != null) { - TileEntity tile = Minecraft.getMinecraft().theWorld.getTileEntity(pos.blockX, pos.blockY, pos.blockZ); + RayTraceResult pos = Minecraft.getMinecraft().objectMouseOver; + if(pos != null && pos.typeOfHit == RayTraceResult.Type.BLOCK) { + TileEntity tile = Minecraft.getMinecraft().theWorld.getTileEntity(pos.getBlockPos()); if(tile != null && tile instanceof ITileBound) { - ChunkCoordinates coords = ((ITileBound) tile).getBinding(); + BlockPos coords = ((ITileBound) tile).getBinding(); return coords; } } @@ -311,4 +287,10 @@ public class ItemTwigWand extends Item16Colors implements ICoordBoundItem { return null; } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory")); + } + } diff --git a/src/main/java/vazkii/botania/common/item/ItemVineBall.java b/src/main/java/vazkii/botania/common/item/ItemVineBall.java index 0c871586e..59d52dbb0 100644 --- a/src/main/java/vazkii/botania/common/item/ItemVineBall.java +++ b/src/main/java/vazkii/botania/common/item/ItemVineBall.java @@ -2,37 +2,48 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + * * Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php - * + * * File Created @ [Jun 26, 2014, 7:50:37 PM (GMT)] */ package vazkii.botania.common.item; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.SoundEvents; import net.minecraft.item.ItemStack; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.SoundCategory; import net.minecraft.world.World; import vazkii.botania.common.entity.EntityVineBall; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; + public class ItemVineBall extends ItemMod { public ItemVineBall() { - setUnlocalizedName(LibItemNames.VINE_BALL); + super(LibItemNames.VINE_BALL); } + @Nonnull @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if(!par3EntityPlayer.capabilities.isCreativeMode) + public ActionResult onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) { + if(!player.capabilities.isCreativeMode) --par1ItemStack.stackSize; - par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (par2World.rand.nextFloat() * 0.4F + 0.8F)); + world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.NEUTRAL, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); - if(!par2World.isRemote) - par2World.spawnEntityInWorld(new EntityVineBall(par3EntityPlayer, true)); + if(!world.isRemote) { + EntityVineBall ball = new EntityVineBall(player, true); + ball.setHeadingFromThrower(player, player.rotationPitch, player.rotationYaw, 0.0F, 1.5F, 1.0F); + world.spawnEntityInWorld(ball); + } - return par1ItemStack; + return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack); } } diff --git a/src/main/java/vazkii/botania/common/item/ItemVirus.java b/src/main/java/vazkii/botania/common/item/ItemVirus.java index 1ccca7d49..351c99776 100644 --- a/src/main/java/vazkii/botania/common/item/ItemVirus.java +++ b/src/main/java/vazkii/botania/common/item/ItemVirus.java @@ -10,58 +10,84 @@ */ package vazkii.botania.common.item; -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AbstractAttributeMap; import net.minecraft.entity.ai.attributes.AttributeModifier; -import net.minecraft.entity.ai.attributes.BaseAttributeMap; -import net.minecraft.entity.ai.attributes.IAttribute; import net.minecraft.entity.ai.attributes.IAttributeInstance; import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.passive.HorseType; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.SoundEvents; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.DamageSource; -import net.minecraft.util.IIcon; +import net.minecraft.util.EnumHand; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.living.LivingHurtEvent; -import vazkii.botania.client.core.helper.IconHelper; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.relauncher.ReflectionHelper; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import net.minecraftforge.items.CapabilityItemHandler; +import net.minecraftforge.items.IItemHandler; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.lib.LibItemNames; import vazkii.botania.common.lib.LibObfuscation; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.ReflectionHelper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import javax.annotation.Nonnull; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.List; public class ItemVirus extends ItemMod { - IIcon[] icons; - private static final int SUBTYPES = 2; public ItemVirus() { - setUnlocalizedName(LibItemNames.VIRUS); + super(LibItemNames.VIRUS); setHasSubtypes(true); - MinecraftForge.EVENT_BUS.register(this); + MinecraftForge.EVENT_BUS.register(ItemVirus.class); } @Override - public boolean itemInteractionForEntity(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, EntityLivingBase par3EntityLivingBase) { + public boolean itemInteractionForEntity(ItemStack par1ItemStack, EntityPlayer player, EntityLivingBase par3EntityLivingBase, EnumHand hand) { if(par3EntityLivingBase instanceof EntityHorse) { + if(player.worldObj.isRemote) + return true; EntityHorse horse = (EntityHorse) par3EntityLivingBase; - if(horse.getHorseType() != 3 && horse.getHorseType() != 4 && horse.isTame()) { - horse.setHorseType(3 + par1ItemStack.getItemDamage()); - BaseAttributeMap attributes = horse.getAttributeMap(); - IAttributeInstance movementSpeed = attributes.getAttributeInstance(SharedMonsterAttributes.movementSpeed); - IAttributeInstance health = attributes.getAttributeInstance(SharedMonsterAttributes.maxHealth); + if(horse.getType() != HorseType.ZOMBIE && horse.getType() != HorseType.SKELETON && horse.isTame()) { + IItemHandler inv = horse.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null); + ItemStack saddle = inv.getStackInSlot(0); + + for (int i = 1; i < inv.getSlots(); i++) + if(inv.getStackInSlot(i) != null) + horse.entityDropItem(inv.getStackInSlot(i), 0); + if (horse.isChested()) + horse.entityDropItem(new ItemStack(Blocks.CHEST), 0); + + horse.setType(par1ItemStack.getItemDamage() == 0 ? HorseType.ZOMBIE : HorseType.SKELETON); + + // Reinit the horse chest to the right new size + Method m = ReflectionHelper.findMethod(EntityHorse.class, horse, LibObfuscation.INIT_HORSE_CHEST); + try { + m.invoke(horse); + } catch (IllegalAccessException | InvocationTargetException ignored) {} + + // Put the saddle back + horse.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).insertItem(0, saddle, false); + + AbstractAttributeMap attributes = horse.getAttributeMap(); + IAttributeInstance movementSpeed = attributes.getAttributeInstance(SharedMonsterAttributes.MOVEMENT_SPEED); + IAttributeInstance health = attributes.getAttributeInstance(SharedMonsterAttributes.MAX_HEALTH); health.applyModifier(new AttributeModifier("Ermergerd Virus D:", health.getBaseValue(), 0)); movementSpeed.applyModifier(new AttributeModifier("Ermergerd Virus D:", movementSpeed.getBaseValue(), 0)); - IAttributeInstance jumpHeight = attributes.getAttributeInstance(ReflectionHelper.getPrivateValue(EntityHorse.class, null, LibObfuscation.HORSE_JUMP_STRENGTH)); + IAttributeInstance jumpHeight = attributes.getAttributeInstance(ReflectionHelper.getPrivateValue(EntityHorse.class, null, LibObfuscation.HORSE_JUMP_STRENGTH)); jumpHeight.applyModifier(new AttributeModifier("Ermergerd Virus D:", jumpHeight.getBaseValue() * 0.5, 0)); - par2EntityPlayer.worldObj.playSound(par3EntityLivingBase.posX + 0.5D, par3EntityLivingBase.posY + 0.5D, par3EntityLivingBase.posZ + 0.5D, "mob.zombie.remedy", 1.0F + par3EntityLivingBase.worldObj.rand.nextFloat(), par3EntityLivingBase.worldObj.rand.nextFloat() * 0.7F + 1.3F, false); + horse.playSound(SoundEvents.ENTITY_ZOMBIE_VILLAGER_CURE, 1.0F + par3EntityLivingBase.worldObj.rand.nextFloat(), par3EntityLivingBase.worldObj.rand.nextFloat() * 0.7F + 1.3F); + horse.spawnExplosionParticle(); par1ItemStack.stackSize--; return true; @@ -71,46 +97,35 @@ public class ItemVirus extends ItemMod { } @SubscribeEvent - public void onLivingHurt(LivingHurtEvent event) { - EntityLivingBase entity = event.entityLiving; - if(entity.ridingEntity != null && entity.ridingEntity instanceof EntityLivingBase) - entity = (EntityLivingBase) entity.ridingEntity; + public static void onLivingHurt(LivingHurtEvent event) { + EntityLivingBase entity = event.getEntityLiving(); + if(entity.isRiding() && entity.getRidingEntity() instanceof EntityLivingBase) + entity = (EntityLivingBase) entity.getRidingEntity(); - if(entity instanceof EntityHorse && event.source == DamageSource.fall) { + if(entity instanceof EntityHorse && event.getSource() == DamageSource.fall) { EntityHorse horse = (EntityHorse) entity; - if((horse.getHorseType() == 3 || horse.getHorseType() == 4) && horse.isTame()) + if((horse.getType() == HorseType.ZOMBIE || horse.getType() == HorseType.SKELETON) && horse.isTame()) event.setCanceled(true); } } @Override @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs tab, List list) { + public void getSubItems(@Nonnull Item item, CreativeTabs tab, List list) { for(int i = 0; i < SUBTYPES; i++) list.add(new ItemStack(item, 1, i)); } + @Nonnull @Override + public String getUnlocalizedName(ItemStack stack) { + return super.getUnlocalizedName(stack) + stack.getItemDamage(); + } + @SideOnly(Side.CLIENT) - public IIcon getIconFromDamage(int par1) { - return icons[Math.min(icons.length - 1, par1)]; - } - @Override - public String getUnlocalizedName(ItemStack par1ItemStack) { - return getUnlocalizedNameLazy(par1ItemStack) + par1ItemStack.getItemDamage(); - } - - String getUnlocalizedNameLazy(ItemStack par1ItemStack) { - return super.getUnlocalizedName(par1ItemStack); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) { - icons = new IIcon[SUBTYPES]; - for(int i = 0; i < SUBTYPES; i++) - icons[i] = IconHelper.forItem(par1IconRegister, this, i); + public void registerModels() { + ModelHandler.registerItemAppendMeta(this, 2, LibItemNames.VIRUS); } } diff --git a/src/main/java/vazkii/botania/common/item/ItemWaterBowl.java b/src/main/java/vazkii/botania/common/item/ItemWaterBowl.java index a873f5258..32024fa7c 100644 --- a/src/main/java/vazkii/botania/common/item/ItemWaterBowl.java +++ b/src/main/java/vazkii/botania/common/item/ItemWaterBowl.java @@ -10,13 +10,47 @@ */ package vazkii.botania.common.item; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.capabilities.ICapabilityProvider; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.capability.templates.FluidHandlerItemStackSimple; import vazkii.botania.common.lib.LibItemNames; -public class ItemWaterBowl extends ItemMod { +import javax.annotation.Nonnull; + +public class ItemWaterBowl extends ItemMod { public ItemWaterBowl() { + super(LibItemNames.WATER_BOWL); setMaxStackSize(1); - setUnlocalizedName(LibItemNames.WATER_BOWL); + } + + @Nonnull + @Override + public ICapabilityProvider initCapabilities(ItemStack stack, NBTTagCompound nbt) { + return new Handler(stack); + } + + private static class Handler extends FluidHandlerItemStackSimple.SwapEmpty { + + private Handler(ItemStack stack) { + super(stack, new ItemStack(Items.BOWL), Fluid.BUCKET_VOLUME); + setFluid(new FluidStack(FluidRegistry.WATER, Fluid.BUCKET_VOLUME)); + } + + @Override + public boolean canFillFluidType(FluidStack fluid) { + return false; + } + + @Override + public boolean canDrainFluidType(FluidStack fluid) { + return fluid.getFluid() == FluidRegistry.WATER; + } } } diff --git a/src/main/java/vazkii/botania/common/item/ItemWorldSeed.java b/src/main/java/vazkii/botania/common/item/ItemWorldSeed.java index 9d1fc7f54..cc5edb63e 100644 --- a/src/main/java/vazkii/botania/common/item/ItemWorldSeed.java +++ b/src/main/java/vazkii/botania/common/item/ItemWorldSeed.java @@ -11,39 +11,48 @@ package vazkii.botania.common.item; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.SoundEvents; import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import vazkii.botania.common.Botania; import vazkii.botania.common.core.helper.MathHelper; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; + public class ItemWorldSeed extends ItemMod { public ItemWorldSeed() { - setUnlocalizedName(LibItemNames.WORLD_SEED); + super(LibItemNames.WORLD_SEED); } + @Nonnull @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { - ChunkCoordinates coords = world.getSpawnPoint(); + public ActionResult onItemRightClick(@Nonnull ItemStack stack, World world, EntityPlayer player, EnumHand hand) { + BlockPos coords = world.getSpawnPoint(); - if(MathHelper.pointDistanceSpace(coords.posX + 0.5, coords.posY + 0.5, coords.posZ + 0.5, player.posX, player.posY, player.posZ) > 24) { + if(MathHelper.pointDistanceSpace(coords.getX() + 0.5, coords.getY() + 0.5, coords.getZ() + 0.5, player.posX, player.posY, player.posZ) > 24) { player.rotationPitch = 0F; player.rotationYaw = 0F; - player.setPositionAndUpdate(coords.posX + 0.5, coords.posY + 1.6, coords.posZ + 0.5); + player.setPositionAndUpdate(coords.getX() + 0.5, coords.getY() + 0.5, coords.getZ() + 0.5); - while(!world.getCollidingBoundingBoxes(player, player.boundingBox).isEmpty()) + while(!world.getCollisionBoxes(player, player.getEntityBoundingBox()).isEmpty()) player.setPositionAndUpdate(player.posX, player.posY + 1, player.posZ); - world.playSoundAtEntity(player, "mob.endermen.portal", 1F, 1F); + world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ENDERMEN_TELEPORT, SoundCategory.PLAYERS, 1F, 1F); for(int i = 0; i < 50; i++) - Botania.proxy.sparkleFX(world, player.posX + Math.random() * player.width, player.posY - 1.6 + Math.random() * player.height, player.posZ + Math.random() * player.width, 0.25F, 1F, 0.25F, 1F, 10); + Botania.proxy.sparkleFX(player.posX + Math.random() * player.width, player.posY - 1.6 + Math.random() * player.height, player.posZ + Math.random() * player.width, 0.25F, 1F, 0.25F, 1F, 10); stack.stackSize--; + return ActionResult.newResult(EnumActionResult.SUCCESS, stack); } - return stack; + return ActionResult.newResult(EnumActionResult.PASS, stack); } } diff --git a/src/main/java/vazkii/botania/common/item/ModItems.java b/src/main/java/vazkii/botania/common/item/ModItems.java index d029d5a93..9567534fc 100644 --- a/src/main/java/vazkii/botania/common/item/ModItems.java +++ b/src/main/java/vazkii/botania/common/item/ModItems.java @@ -423,6 +423,7 @@ public final class ModItems { OreDictionary.registerOre(LibOreDict.DYE[i], new ItemStack(dye, 1, i)); OreDictionary.registerOre(LibOreDict.RUNE[i], new ItemStack(rune, 1, i)); } + OreDictionary.registerOre(LibOreDict.DYE_WILDCARD, new ItemStack(dye, 1, OreDictionary.WILDCARD_VALUE)); for(int i = 0; i < 7; i++) OreDictionary.registerOre(LibOreDict.QUARTZ[i], new ItemStack(quartz, 1, i)); @@ -458,12 +459,13 @@ public final class ModItems { BotaniaAPI.blackListItemFromLoonium(lexicon); BotaniaAPI.blackListItemFromLoonium(overgrowthSeed); BotaniaAPI.blackListItemFromLoonium(blackLotus); - int min = Item.getIdFromItem(Items.record_13); - int max = Item.getIdFromItem(Items.record_wait); + int min = Item.getIdFromItem(Items.RECORD_13); + int max = Item.getIdFromItem(Items.RECORD_WAIT); for(int i = min; i <= max; i++) BotaniaAPI.blackListItemFromLoonium(Item.getItemById(i)); - OreDictionary.registerOre("rodBlaze", Items.blaze_rod); - OreDictionary.registerOre("powderBlaze", Items.blaze_powder); + OreDictionary.registerOre("rodBlaze", Items.BLAZE_ROD); + OreDictionary.registerOre("powderBlaze", Items.BLAZE_POWDER); + OreDictionary.registerOre(LibOreDict.PRISMARINE_SHARD, new ItemStack(Items.PRISMARINE_SHARD)); } } diff --git a/src/main/java/vazkii/botania/common/item/block/ItemBlockElven.java b/src/main/java/vazkii/botania/common/item/block/ItemBlockElven.java index 8fad997dd..f1fd4f4dd 100644 --- a/src/main/java/vazkii/botania/common/item/block/ItemBlockElven.java +++ b/src/main/java/vazkii/botania/common/item/block/ItemBlockElven.java @@ -22,7 +22,7 @@ public class ItemBlockElven extends ItemBlockMod implements IElvenItem { @Override public boolean isElvenItem(ItemStack stack) { - return ((IElvenItem) field_150939_a).isElvenItem(stack); + return ((IElvenItem) block).isElvenItem(stack); } } diff --git a/src/main/java/vazkii/botania/common/item/block/ItemBlockFloatingSpecialFlower.java b/src/main/java/vazkii/botania/common/item/block/ItemBlockFloatingSpecialFlower.java index f6ef345a2..56e950c45 100644 --- a/src/main/java/vazkii/botania/common/item/block/ItemBlockFloatingSpecialFlower.java +++ b/src/main/java/vazkii/botania/common/item/block/ItemBlockFloatingSpecialFlower.java @@ -12,7 +12,9 @@ package vazkii.botania.common.item.block; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; +import net.minecraft.util.text.translation.I18n; + +import javax.annotation.Nonnull; public class ItemBlockFloatingSpecialFlower extends ItemBlockSpecialFlower { @@ -20,10 +22,11 @@ public class ItemBlockFloatingSpecialFlower extends ItemBlockSpecialFlower { super(block1); } + @Nonnull @Override - public String getItemStackDisplayName(ItemStack stack) { + public String getItemStackDisplayName(@Nonnull ItemStack stack) { String flowerName = getUnlocalizedName(stack) + ".name"; - return String.format(StatCollector.translateToLocal("botaniamisc.floatingPrefix"), StatCollector.translateToLocal(flowerName)); + return String.format(I18n.translateToLocal("botaniamisc.floatingPrefix"), I18n.translateToLocal(flowerName)); } } diff --git a/src/main/java/vazkii/botania/common/item/block/ItemBlockMod.java b/src/main/java/vazkii/botania/common/item/block/ItemBlockMod.java index a3491afb0..bca4aab76 100644 --- a/src/main/java/vazkii/botania/common/item/block/ItemBlockMod.java +++ b/src/main/java/vazkii/botania/common/item/block/ItemBlockMod.java @@ -21,14 +21,17 @@ import vazkii.botania.client.lib.LibResources; import vazkii.botania.common.achievement.ICraftAchievement; import vazkii.botania.common.achievement.IPickupAchievement; +import javax.annotation.Nonnull; + public class ItemBlockMod extends ItemBlock implements IPickupAchievement, ICraftAchievement { public ItemBlockMod(Block block) { super(block); } + @Nonnull @Override - public String getUnlocalizedNameInefficiently(ItemStack par1ItemStack) { + public String getUnlocalizedNameInefficiently(@Nonnull ItemStack par1ItemStack) { return getUnlocalizedNameInefficiently_(par1ItemStack).replaceAll("tile.", "tile." + LibResources.PREFIX_MOD); } @@ -38,12 +41,12 @@ public class ItemBlockMod extends ItemBlock implements IPickupAchievement, ICraf @Override public Achievement getAchievementOnCraft(ItemStack stack, EntityPlayer player, IInventory matrix) { - return field_150939_a instanceof ICraftAchievement ? ((ICraftAchievement) field_150939_a).getAchievementOnCraft(stack, player, matrix) : null; + return block instanceof ICraftAchievement ? ((ICraftAchievement) block).getAchievementOnCraft(stack, player, matrix) : null; } @Override public Achievement getAchievementOnPickup(ItemStack stack, EntityPlayer player, EntityItem item) { - return field_150939_a instanceof IPickupAchievement ? ((IPickupAchievement) field_150939_a).getAchievementOnPickup(stack, player, item) : null; + return block instanceof IPickupAchievement ? ((IPickupAchievement) block).getAchievementOnPickup(stack, player, item) : null; } } diff --git a/src/main/java/vazkii/botania/common/item/block/ItemBlockModSlab.java b/src/main/java/vazkii/botania/common/item/block/ItemBlockModSlab.java index 0883b4a59..a8c442b55 100644 --- a/src/main/java/vazkii/botania/common/item/block/ItemBlockModSlab.java +++ b/src/main/java/vazkii/botania/common/item/block/ItemBlockModSlab.java @@ -15,15 +15,18 @@ import net.minecraft.item.ItemSlab; import net.minecraft.item.ItemStack; import vazkii.botania.common.block.decor.slabs.BlockModSlab; +import javax.annotation.Nonnull; + public class ItemBlockModSlab extends ItemSlab { public ItemBlockModSlab(Block par1) { - super(par1, ((BlockModSlab)par1).getSingleBlock(), ((BlockModSlab)par1).getFullBlock(), false); + super(par1, ((BlockModSlab)par1).getSingleBlock(), ((BlockModSlab)par1).getFullBlock()); } + @Nonnull @Override public String getUnlocalizedName(ItemStack par1ItemStack) { - return field_150939_a.getUnlocalizedName().replaceAll("tile.", "tile.botania:"); + return block.getUnlocalizedName().replaceAll("tile.", "tile.botania:"); } } diff --git a/src/main/java/vazkii/botania/common/item/block/ItemBlockPool.java b/src/main/java/vazkii/botania/common/item/block/ItemBlockPool.java index 7c399f962..86aaa4aed 100644 --- a/src/main/java/vazkii/botania/common/item/block/ItemBlockPool.java +++ b/src/main/java/vazkii/botania/common/item/block/ItemBlockPool.java @@ -10,24 +10,39 @@ */ package vazkii.botania.common.item.block; -import java.util.List; - import net.minecraft.block.Block; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.IItemPropertyGetter; import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.api.state.enums.PoolVariant; +import vazkii.botania.common.lib.LibMisc; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.util.List; public class ItemBlockPool extends ItemBlockWithMetadataAndName { public ItemBlockPool(Block par2Block) { super(par2Block); + addPropertyOverride(new ResourceLocation(LibMisc.MOD_ID, "full"), (stack, worldIn, entityIn) -> { + boolean renderFull = stack.getItemDamage() == PoolVariant.CREATIVE.ordinal() || (stack.hasTagCompound() && stack.getTagCompound().getBoolean("RenderFull")); + return renderFull ? 1F : 0F; + }); } + @SideOnly(Side.CLIENT) @Override - public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { + public void addInformation(@Nonnull ItemStack par1ItemStack, @Nonnull EntityPlayer player, @Nonnull List stacks, boolean par4) { if(par1ItemStack.getItemDamage() == 1) for(int i = 0; i < 2; i++) - par3List.add(StatCollector.translateToLocal("botaniamisc.creativePool" + i)); + stacks.add(I18n.format("botaniamisc.creativePool" + i)); } } diff --git a/src/main/java/vazkii/botania/common/item/block/ItemBlockSpecialFlower.java b/src/main/java/vazkii/botania/common/item/block/ItemBlockSpecialFlower.java index 7c3074bfc..8bf880b26 100644 --- a/src/main/java/vazkii/botania/common/item/block/ItemBlockSpecialFlower.java +++ b/src/main/java/vazkii/botania/common/item/block/ItemBlockSpecialFlower.java @@ -10,18 +10,20 @@ */ package vazkii.botania.common.item.block; -import java.util.List; - import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.resources.I18n; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.stats.Achievement; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.lexicon.IRecipeKeyProvider; import vazkii.botania.api.subtile.SubTileEntity; @@ -34,68 +36,66 @@ import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.lib.LibBlockNames; import vazkii.botania.common.lib.LibMisc; +import javax.annotation.Nonnull; +import java.util.List; + public class ItemBlockSpecialFlower extends ItemBlockMod implements IRecipeKeyProvider { public ItemBlockSpecialFlower(Block block1) { super(block1); + setHasSubtypes(true); } @Override - public IIcon getIconIndex(ItemStack stack) { - return BotaniaAPI.getSignatureForName(getType(stack)).getIconForStack(stack); - } - - @Override - public IIcon getIcon(ItemStack stack, int pass) { - return getIconIndex(stack); - } - - @Override - public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) { - boolean placed = super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, metadata); + public boolean placeBlockAt(@Nonnull ItemStack stack, @Nonnull EntityPlayer player, World world, @Nonnull BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, @Nonnull IBlockState newState) { + boolean placed = super.placeBlockAt(stack, player, world, pos, side, hitX, hitY, hitZ, newState); if(placed) { String type = getType(stack); - TileEntity te = world.getTileEntity(x, y, z); + TileEntity te = world.getTileEntity(pos); if(te instanceof TileSpecialFlower) { TileSpecialFlower tile = (TileSpecialFlower) te; tile.setSubTile(type); - tile.onBlockAdded(world, x, y, z); - tile.onBlockPlacedBy(world, x, y, z, player, stack); + tile.onBlockAdded(world, pos, newState); + tile.onBlockPlacedBy(world, pos, newState, player, stack); if(!world.isRemote) - world.markBlockForUpdate(x, y, z); + world.notifyBlockUpdate(pos, world.getBlockState(pos), world.getBlockState(pos), 8); } } return placed; } + @Nonnull @Override public String getUnlocalizedName(ItemStack stack) { return BotaniaAPI.getSignatureForName(getType(stack)).getUnlocalizedNameForStack(stack); } + @Nonnull @Override - public String getUnlocalizedNameInefficiently(ItemStack par1ItemStack) { + public String getUnlocalizedNameInefficiently(@Nonnull ItemStack par1ItemStack) { return getUnlocalizedNameInefficiently_(par1ItemStack); } + @SideOnly(Side.CLIENT) @Override - public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { + public void addInformation(@Nonnull ItemStack par1ItemStack, @Nonnull EntityPlayer player, @Nonnull List stacks, boolean par4) { String type = getType(par1ItemStack); SubTileSignature sig = BotaniaAPI.getSignatureForName(type); - sig.addTooltip(par1ItemStack, par2EntityPlayer, par3List); + sig.addTooltip(par1ItemStack, player, stacks); if(ConfigHandler.referencesEnabled) { String refUnlocalized = sig.getUnlocalizedLoreTextForStack(par1ItemStack); - String refLocalized = StatCollector.translateToLocal(refUnlocalized); + String refLocalized = I18n.format(refUnlocalized); if(!refLocalized.equals(refUnlocalized)) - par3List.add(EnumChatFormatting.ITALIC + refLocalized); + stacks.add(TextFormatting.ITALIC + refLocalized); } + System.out.println(type); String mod = BotaniaAPI.subTileMods.get(type); if(!mod.equals(LibMisc.MOD_ID)) - par3List.add(EnumChatFormatting.ITALIC + "[" + mod + "]"); + stacks.add(TextFormatting.ITALIC + "[" + mod + "]"); } public static String getType(ItemStack stack) { @@ -119,22 +119,24 @@ public class ItemBlockSpecialFlower extends ItemBlockMod implements IRecipeKeyPr @Override public Achievement getAchievementOnPickup(ItemStack stack, EntityPlayer player, EntityItem item) { String type = getType(stack); - if(type.equals(LibBlockNames.SUBTILE_DAYBLOOM)) - return ModAchievements.daybloomPickup; - else if(type.equals(LibBlockNames.SUBTILE_ENDOFLAME)) - return ModAchievements.endoflamePickup; - else if(type.equals(LibBlockNames.SUBTILE_KEKIMURUS)) - return ModAchievements.kekimurusPickup; - else if(type.equals(LibBlockNames.SUBTILE_HEISEI_DREAM)) - return ModAchievements.heiseiDreamPickup; - else if(type.equals(LibBlockNames.SUBTILE_POLLIDISIAC)) - return ModAchievements.pollidisiacPickup; - else if(type.equals(LibBlockNames.SUBTILE_BUBBELL)) - return ModAchievements.bubbellPickup; - else if(type.equals(LibBlockNames.SUBTILE_DANDELIFEON)) - return ModAchievements.dandelifeonPickup; - else if(type.equals("")) - return ModAchievements.nullFlower; + switch (type) { +// case LibBlockNames.SUBTILE_DAYBLOOM: TODO fix this here +// return ModAchievements.daybloomPickup; + case LibBlockNames.SUBTILE_ENDOFLAME: + return ModAchievements.endoflamePickup; + case LibBlockNames.SUBTILE_KEKIMURUS: + return ModAchievements.kekimurusPickup; + case LibBlockNames.SUBTILE_HEISEI_DREAM: + return ModAchievements.heiseiDreamPickup; + case LibBlockNames.SUBTILE_POLLIDISIAC: + return ModAchievements.pollidisiacPickup; + case LibBlockNames.SUBTILE_BUBBELL: + return ModAchievements.bubbellPickup; + case LibBlockNames.SUBTILE_DANDELIFEON: + return ModAchievements.dandelifeonPickup; + case "": + return ModAchievements.nullFlower; + } return null; } diff --git a/src/main/java/vazkii/botania/common/item/block/ItemBlockSpecialQuartz.java b/src/main/java/vazkii/botania/common/item/block/ItemBlockSpecialQuartz.java index 7f104d0cf..c062f6045 100644 --- a/src/main/java/vazkii/botania/common/item/block/ItemBlockSpecialQuartz.java +++ b/src/main/java/vazkii/botania/common/item/block/ItemBlockSpecialQuartz.java @@ -15,14 +15,17 @@ import net.minecraft.item.ItemMultiTexture; import net.minecraft.item.ItemStack; import vazkii.botania.common.block.decor.quartz.BlockSpecialQuartz; +import javax.annotation.Nonnull; + public class ItemBlockSpecialQuartz extends ItemMultiTexture { public ItemBlockSpecialQuartz(Block par1) { super(par1, par1, new String[]{ "" }); } + @Nonnull @Override - public String getUnlocalizedName(ItemStack par1ItemStack) { - return par1ItemStack.getItemDamage() >= 3 ? "" : ((BlockSpecialQuartz) field_150939_a).getNames()[par1ItemStack.getItemDamage()]; + public String getUnlocalizedName(@Nonnull ItemStack par1ItemStack) { + return par1ItemStack.getItemDamage() >= 3 ? "" : ((BlockSpecialQuartz) block).getNames()[par1ItemStack.getItemDamage()]; } } \ No newline at end of file diff --git a/src/main/java/vazkii/botania/common/item/block/ItemBlockTinyPotato.java b/src/main/java/vazkii/botania/common/item/block/ItemBlockTinyPotato.java index 0484dc766..44193b07a 100644 --- a/src/main/java/vazkii/botania/common/item/block/ItemBlockTinyPotato.java +++ b/src/main/java/vazkii/botania/common/item/block/ItemBlockTinyPotato.java @@ -10,23 +10,21 @@ */ package vazkii.botania.common.item.block; -import java.util.Arrays; -import java.util.List; - import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.text.TextComponentString; +import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; import vazkii.botania.common.core.helper.ItemNBTHelper; +import java.util.Arrays; +import java.util.List; + public class ItemBlockTinyPotato extends ItemBlockMod { - private static final List TYPOS = Arrays.asList(new String[] { - "vaskii", "vazki", "voskii", "vazkkii", "vazkki", "vazzki", "vaskki", "vozkii", "vazkil", "vaskil", "vazkill", "vaskill", "vaski" - }); + private static final List TYPOS = Arrays.asList("vaskii", "vazki", "voskii", "vazkkii", "vazkki", "vazzki", "vaskki", "vozkii", "vazkil", "vaskil", "vazkill", "vaskill", "vaski"); private static final String NOT_MY_NAME[] = { "Six letter word just to get me along", @@ -60,7 +58,7 @@ public class ItemBlockTinyPotato extends ItemBlockMod { EntityPlayer player = (EntityPlayer) e; int ticks = ItemNBTHelper.getInt(stack, TAG_TICKS, 0); if(ticks < NOT_MY_NAME.length) { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + NOT_MY_NAME[ticks])); + player.addChatMessage(new TextComponentString(TextFormatting.RED + NOT_MY_NAME[ticks])); ItemNBTHelper.setInt(stack, TAG_TICKS, ticks + 1); } } diff --git a/src/main/java/vazkii/botania/common/item/block/ItemBlockWithMetadataAndName.java b/src/main/java/vazkii/botania/common/item/block/ItemBlockWithMetadataAndName.java index e9bad65fd..99bf0a084 100644 --- a/src/main/java/vazkii/botania/common/item/block/ItemBlockWithMetadataAndName.java +++ b/src/main/java/vazkii/botania/common/item/block/ItemBlockWithMetadataAndName.java @@ -14,24 +14,29 @@ import net.minecraft.block.Block; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemBlockWithMetadata; +import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.stats.Achievement; import vazkii.botania.client.lib.LibResources; import vazkii.botania.common.achievement.ICraftAchievement; import vazkii.botania.common.achievement.IPickupAchievement; -public class ItemBlockWithMetadataAndName extends ItemBlockWithMetadata implements IPickupAchievement, ICraftAchievement { +import javax.annotation.Nonnull; + +public class ItemBlockWithMetadataAndName extends ItemBlock implements IPickupAchievement, ICraftAchievement { public ItemBlockWithMetadataAndName(Block par2Block) { - super(par2Block, par2Block); + super(par2Block); + setHasSubtypes(true); } + @Nonnull @Override - public String getUnlocalizedNameInefficiently(ItemStack par1ItemStack) { + public String getUnlocalizedNameInefficiently(@Nonnull ItemStack par1ItemStack) { return super.getUnlocalizedNameInefficiently(par1ItemStack).replaceAll("tile.", "tile." + LibResources.PREFIX_MOD); } + @Nonnull @Override public String getUnlocalizedName(ItemStack par1ItemStack) { return super.getUnlocalizedName(par1ItemStack) + par1ItemStack.getItemDamage(); @@ -39,12 +44,18 @@ public class ItemBlockWithMetadataAndName extends ItemBlockWithMetadata implemen @Override public Achievement getAchievementOnCraft(ItemStack stack, EntityPlayer player, IInventory matrix) { - return field_150939_a instanceof ICraftAchievement ? ((ICraftAchievement) field_150939_a).getAchievementOnCraft(stack, player, matrix) : null; + return block instanceof ICraftAchievement ? ((ICraftAchievement) block).getAchievementOnCraft(stack, player, matrix) : null; } @Override public Achievement getAchievementOnPickup(ItemStack stack, EntityPlayer player, EntityItem item) { - return field_150939_a instanceof IPickupAchievement ? ((IPickupAchievement) field_150939_a).getAchievementOnPickup(stack, player, item) : null; + return block instanceof IPickupAchievement ? ((IPickupAchievement) block).getAchievementOnPickup(stack, player, item) : null; + } + + @Override + public int getMetadata(int damage) + { + return damage; } } diff --git a/src/main/java/vazkii/botania/common/item/brew/ItemBrewBase.java b/src/main/java/vazkii/botania/common/item/brew/ItemBrewBase.java index 8c565500e..4d16cf367 100644 --- a/src/main/java/vazkii/botania/common/item/brew/ItemBrewBase.java +++ b/src/main/java/vazkii/botania/common/item/brew/ItemBrewBase.java @@ -10,95 +10,98 @@ */ package vazkii.botania.common.item.brew; -import java.awt.Color; -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.resources.I18n; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.SoundEvents; import net.minecraft.item.EnumAction; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.stats.Achievement; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.brew.Brew; import vazkii.botania.api.brew.IBrewItem; -import vazkii.botania.client.core.handler.ClientTickHandler; -import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.common.achievement.IPickupAchievement; import vazkii.botania.common.achievement.ModAchievements; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.item.ItemMod; +import vazkii.botania.common.lib.LibMisc; + +import javax.annotation.Nonnull; +import java.util.List; public abstract class ItemBrewBase extends ItemMod implements IBrewItem, IPickupAchievement { private static final String TAG_BREW_KEY = "brewKey"; private static final String TAG_SWIGS_LEFT = "swigsLeft"; - String name; - String texName; - int swigs; - int drinkSpeed; - ItemStack baseItem; + private final int swigs; + private final int drinkSpeed; + private final ItemStack baseItem; - IIcon[] icons; - - public ItemBrewBase(String name, String texName, int swigs, int drinkSpeed, ItemStack baseItem) { - this.name = name; - this.texName = texName; + public ItemBrewBase(String name, int swigs, int drinkSpeed, ItemStack baseItem) { + super(name); this.swigs = swigs; this.drinkSpeed = drinkSpeed; this.baseItem = baseItem; setMaxStackSize(1); - setMaxDamage(swigs); - setUnlocalizedName(name); - setNoRepair(); + addPropertyOverride(new ResourceLocation(LibMisc.MOD_ID, "swigs_taken"), (stack, world, entity) -> swigs - getSwigsLeft(stack)); } @Override - public int getMaxItemUseDuration(ItemStack p_77626_1_) { + public int getMaxItemUseDuration(ItemStack stack) { return drinkSpeed; } + @Nonnull @Override - public EnumAction getItemUseAction(ItemStack p_77661_1_) { - return EnumAction.drink; + public EnumAction getItemUseAction(ItemStack stack) { + return EnumAction.DRINK; + } + + @Nonnull + @Override + public ActionResult onItemRightClick(@Nonnull ItemStack stack, World world, EntityPlayer player, EnumHand hand) { + player.setActiveHand(hand); + return ActionResult.newResult(EnumActionResult.SUCCESS, stack); } @Override - public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { - p_77659_3_.setItemInUse(p_77659_1_, getMaxItemUseDuration(p_77659_1_)); - return p_77659_1_; - } - - @Override - public ItemStack onEaten(ItemStack stack, World world, EntityPlayer player) { + public ItemStack onItemUseFinish(@Nonnull ItemStack stack, World world, EntityLivingBase living) { if(!world.isRemote) { for(PotionEffect effect : getBrew(stack).getPotionEffects(stack)) { - PotionEffect newEffect = new PotionEffect(effect.getPotionID(), effect.getDuration(), effect.getAmplifier(), true); - Potion potion = Potion.potionTypes[newEffect.getPotionID()]; - if(potion.isInstant()) - potion.affectEntity(player, player, newEffect.getAmplifier(), 1F); - else player.addPotionEffect(newEffect); + PotionEffect newEffect = new PotionEffect(effect.getPotion(), effect.getDuration(), effect.getAmplifier(), true, true); + if(effect.getPotion().isInstant()) + effect.getPotion().affectEntity(living, living, living, newEffect.getAmplifier(), 1F); + else living.addPotionEffect(newEffect); } if(world.rand.nextBoolean()) - world.playSoundAtEntity(player, "random.burp", 1F, 1F); + world.playSound(null, living.posX, living.posY, living.posZ, SoundEvents.ENTITY_PLAYER_BURP, SoundCategory.PLAYERS, 1F, 1F); int swigs = getSwigsLeft(stack); - if(!player.capabilities.isCreativeMode) { + if(living instanceof EntityPlayer && !((EntityPlayer) living).capabilities.isCreativeMode) { if(swigs == 1) { - ItemStack copy = baseItem.copy(); - if(!player.inventory.addItemStackToInventory(copy)) + if(!((EntityPlayer) living).inventory.addItemStackToInventory(baseItem.copy())) return baseItem.copy(); - return null; + else { + ItemStack copy = stack.copy(); + copy.stackSize = 0; + return copy; + } } @@ -110,7 +113,8 @@ public abstract class ItemBrewBase extends ItemMod implements IBrewItem, IPickup } @Override - public void getSubItems(Item item, CreativeTabs tab, List list) { + @SideOnly(Side.CLIENT) + public void getSubItems(@Nonnull Item item, CreativeTabs tab, List list) { for(String s : BotaniaAPI.brewMap.keySet()) { ItemStack stack = new ItemStack(item); setBrew(stack, s); @@ -118,52 +122,19 @@ public abstract class ItemBrewBase extends ItemMod implements IBrewItem, IPickup } } + @Nonnull @Override - public void registerIcons(IIconRegister par1IconRegister) { - itemIcon = IconHelper.forName(par1IconRegister, texName + "0"); - - icons = new IIcon[swigs]; - for(int i = 0; i < swigs; i++) - icons[i] = IconHelper.forName(par1IconRegister, texName + "1_" + i); + public String getItemStackDisplayName(@Nonnull ItemStack stack) { + return String.format(net.minecraft.util.text.translation.I18n.translateToLocal(getUnlocalizedNameInefficiently(stack) + ".name"), net.minecraft.util.text.translation.I18n.translateToLocal(getBrew(stack).getUnlocalizedName(stack)), TextFormatting.BOLD + "" + getSwigsLeft(stack) + TextFormatting.RESET); } + @SideOnly(Side.CLIENT) @Override - public boolean requiresMultipleRenderPasses() { - return true; - } - - @Override - public IIcon getIcon(ItemStack stack, int pass) { - return pass == 0 ? itemIcon : icons[Math.max(0, Math.min(icons.length - 1, swigs - getSwigsLeft(stack)))]; - } - - @Override - public int getColorFromItemStack(ItemStack stack, int pass) { - if(pass == 0) - return 0xFFFFFF; - - Color color = new Color(getBrew(stack).getColor(stack)); - int add = (int) (Math.sin(ClientTickHandler.ticksInGame * 0.1) * 16); - - int r = Math.max(0, Math.min(255, color.getRed() + add)); - int g = Math.max(0, Math.min(255, color.getGreen() + add)); - int b = Math.max(0, Math.min(255, color.getBlue() + add)); - - return r << 16 | g << 8 | b; - } - - @Override - public String getItemStackDisplayName(ItemStack stack) { - return String.format(StatCollector.translateToLocal(getUnlocalizedNameInefficiently(stack) + ".name"), StatCollector.translateToLocal(getBrew(stack).getUnlocalizedName(stack)), EnumChatFormatting.BOLD + "" + getSwigsLeft(stack) + EnumChatFormatting.RESET); - } - - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean adv) { + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean adv) { Brew brew = getBrew(stack); for(PotionEffect effect : brew.getPotionEffects(stack)) { - Potion potion = Potion.potionTypes[effect.getPotionID()]; - EnumChatFormatting format = potion.isBadEffect() ? EnumChatFormatting.RED : EnumChatFormatting.GRAY; - list.add(format + StatCollector.translateToLocal(effect.getEffectName()) + (effect.getAmplifier() == 0 ? "" : " " + StatCollector.translateToLocal("botania.roman" + (effect.getAmplifier() + 1))) + EnumChatFormatting.GRAY + (potion.isInstant() ? "" : " (" + Potion.getDurationString(effect) + ")")); + TextFormatting format = effect.getPotion().isBadEffect() ? TextFormatting.RED : TextFormatting.GRAY; + list.add(format + I18n.format(effect.getEffectName()) + (effect.getAmplifier() == 0 ? "" : " " + I18n.format("botania.roman" + (effect.getAmplifier() + 1))) + TextFormatting.GRAY + (effect.getPotion().isInstant() ? "" : " (" + Potion.getPotionDurationString(effect, 1F) + ")")); } } diff --git a/src/main/java/vazkii/botania/common/item/brew/ItemBrewFlask.java b/src/main/java/vazkii/botania/common/item/brew/ItemBrewFlask.java index 5bded703a..0a9ba330c 100644 --- a/src/main/java/vazkii/botania/common/item/brew/ItemBrewFlask.java +++ b/src/main/java/vazkii/botania/common/item/brew/ItemBrewFlask.java @@ -17,7 +17,7 @@ import vazkii.botania.common.lib.LibItemNames; public class ItemBrewFlask extends ItemBrewBase { public ItemBrewFlask() { - super(LibItemNames.BREW_FLASK, LibItemNames.FLASK, 6, 24, new ItemStack(ModItems.vial, 1, 1)); + super(LibItemNames.BREW_FLASK, 6, 24, new ItemStack(ModItems.vial, 1, 1)); } } diff --git a/src/main/java/vazkii/botania/common/item/brew/ItemBrewVial.java b/src/main/java/vazkii/botania/common/item/brew/ItemBrewVial.java index 6ebfeeec3..d62840bf9 100644 --- a/src/main/java/vazkii/botania/common/item/brew/ItemBrewVial.java +++ b/src/main/java/vazkii/botania/common/item/brew/ItemBrewVial.java @@ -17,7 +17,7 @@ import vazkii.botania.common.lib.LibItemNames; public class ItemBrewVial extends ItemBrewBase { public ItemBrewVial() { - super(LibItemNames.BREW_VIAL, LibItemNames.VIAL, 4, 32, new ItemStack(ModItems.vial)); + super(LibItemNames.BREW_VIAL, 4, 32, new ItemStack(ModItems.vial)); } } diff --git a/src/main/java/vazkii/botania/common/item/brew/ItemIncenseStick.java b/src/main/java/vazkii/botania/common/item/brew/ItemIncenseStick.java index 42c1eafd3..67f9fb4ba 100644 --- a/src/main/java/vazkii/botania/common/item/brew/ItemIncenseStick.java +++ b/src/main/java/vazkii/botania/common/item/brew/ItemIncenseStick.java @@ -10,43 +10,40 @@ */ package vazkii.botania.common.item.brew; -import java.awt.Color; -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.resources.I18n; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; +import net.minecraft.util.text.TextFormatting; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.brew.Brew; import vazkii.botania.api.brew.IBrewContainer; import vazkii.botania.api.brew.IBrewItem; -import vazkii.botania.client.core.handler.ClientTickHandler; -import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.item.ItemMod; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; +import java.util.List; + public class ItemIncenseStick extends ItemMod implements IBrewItem, IBrewContainer { private static final String TAG_BREW_KEY = "brewKey"; public static final int TIME_MULTIPLIER = 60; - IIcon[] icons; - public ItemIncenseStick() { - setUnlocalizedName(LibItemNames.INCENSE_STICK); + super(LibItemNames.INCENSE_STICK); setMaxStackSize(1); } @Override - public void getSubItems(Item item, CreativeTabs tab, List list) { + @SideOnly(Side.CLIENT) + public void getSubItems(@Nonnull Item item, CreativeTabs tab, List list) { super.getSubItems(item, tab, list); for(String s : BotaniaAPI.brewMap.keySet()) { ItemStack brewStack = getItemForBrew(BotaniaAPI.brewMap.get(s), new ItemStack(this)); @@ -55,56 +52,20 @@ public class ItemIncenseStick extends ItemMod implements IBrewItem, IBrewContain } } + @SideOnly(Side.CLIENT) @Override - public void registerIcons(IIconRegister par1IconRegister) { - icons = new IIcon[2]; - for(int i = 0; i < icons.length; i++) - icons[i] = IconHelper.forItem(par1IconRegister, this, i); - } - - @Override - public boolean requiresMultipleRenderPasses() { - return true; - } - - @Override - public IIcon getIcon(ItemStack stack, int pass) { - return icons[pass]; - } - - @Override - public int getColorFromItemStack(ItemStack stack, int pass) { - if(pass == 0) - return 0xFFFFFF; - - Brew brew = getBrew(stack); - if(brew == BotaniaAPI.fallbackBrew) - return 0x989898; - - Color color = new Color(brew.getColor(stack)); - int add = (int) (Math.sin(ClientTickHandler.ticksInGame * 0.2) * 24); - - int r = Math.max(0, Math.min(255, color.getRed() + add)); - int g = Math.max(0, Math.min(255, color.getGreen() + add)); - int b = Math.max(0, Math.min(255, color.getBlue() + add)); - - return r << 16 | g << 8 | b; - } - - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean adv) { + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean adv) { Brew brew = getBrew(stack); if(brew == BotaniaAPI.fallbackBrew) { - addStringToTooltip(EnumChatFormatting.LIGHT_PURPLE + StatCollector.translateToLocal("botaniamisc.notInfused"), list); + addStringToTooltip(TextFormatting.LIGHT_PURPLE + I18n.format("botaniamisc.notInfused"), list); return; } - addStringToTooltip(EnumChatFormatting.LIGHT_PURPLE + String.format(StatCollector.translateToLocal("botaniamisc.brewOf"), StatCollector.translateToLocal(brew.getUnlocalizedName(stack))), list); + addStringToTooltip(TextFormatting.LIGHT_PURPLE + I18n.format("botaniamisc.brewOf", I18n.format(brew.getUnlocalizedName(stack))), list); for(PotionEffect effect : brew.getPotionEffects(stack)) { - Potion potion = Potion.potionTypes[effect.getPotionID()]; - EnumChatFormatting format = potion.isBadEffect() ? EnumChatFormatting.RED : EnumChatFormatting.GRAY; - PotionEffect longEffect = new PotionEffect(effect.getPotionID(), effect.getDuration() * TIME_MULTIPLIER, effect.getAmplifier(), false); - addStringToTooltip(" " + format + StatCollector.translateToLocal(effect.getEffectName()) + (effect.getAmplifier() == 0 ? "" : " " + StatCollector.translateToLocal("botania.roman" + (effect.getAmplifier() + 1))) + EnumChatFormatting.GRAY + (potion.isInstant() ? "" : " (" + Potion.getDurationString(longEffect) + ")"), list); + TextFormatting format = effect.getPotion().isBadEffect() ? TextFormatting.RED : TextFormatting.GRAY; + PotionEffect longEffect = new PotionEffect(effect.getPotion(), effect.getDuration() * TIME_MULTIPLIER, effect.getAmplifier(), false, true); + addStringToTooltip(" " + format + I18n.format(effect.getEffectName()) + (effect.getAmplifier() == 0 ? "" : " " + I18n.format("botania.roman" + (effect.getAmplifier() + 1))) + TextFormatting.GRAY + (effect.getPotion().isInstant() ? "" : " (" + Potion.getPotionDurationString(longEffect, 1F) + ")"), list); } } @@ -128,7 +89,7 @@ public class ItemIncenseStick extends ItemMod implements IBrewItem, IBrewContain @Override public ItemStack getItemForBrew(Brew brew, ItemStack stack) { - if(!brew.canInfuseIncense() || brew.getPotionEffects(stack).size() != 1 || Potion.potionTypes[brew.getPotionEffects(stack).get(0).getPotionID()].isInstant()) + if(!brew.canInfuseIncense() || brew.getPotionEffects(stack).size() != 1 || brew.getPotionEffects(stack).get(0).getPotion().isInstant()) return null; ItemStack brewStack = new ItemStack(this); diff --git a/src/main/java/vazkii/botania/common/item/brew/ItemVial.java b/src/main/java/vazkii/botania/common/item/brew/ItemVial.java index 81e3aed7a..6fe3b8421 100644 --- a/src/main/java/vazkii/botania/common/item/brew/ItemVial.java +++ b/src/main/java/vazkii/botania/common/item/brew/ItemVial.java @@ -10,50 +10,41 @@ */ package vazkii.botania.common.item.brew; -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.brew.Brew; import vazkii.botania.api.brew.IBrewContainer; -import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.common.item.ItemMod; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.lib.LibItemNames; -public class ItemVial extends ItemMod implements IBrewContainer { +import javax.annotation.Nonnull; +import java.util.List; - public static IIcon flaskIcon, vialIcon; +public class ItemVial extends ItemMod implements IBrewContainer { public ItemVial() { this(LibItemNames.VIAL); } public ItemVial(String name) { + super(name); setHasSubtypes(true); - setUnlocalizedName(name); } @Override - public void registerIcons(IIconRegister par1IconRegister) { - vialIcon = IconHelper.forName(par1IconRegister, LibItemNames.VIAL + "0"); - flaskIcon = IconHelper.forName(par1IconRegister, LibItemNames.FLASK + "0"); - } - - @Override - public IIcon getIconFromDamage(int i) { - return i == 0 ? vialIcon : flaskIcon; - } - - @Override - public void getSubItems(Item item, CreativeTabs tab, List list) { + @SideOnly(Side.CLIENT) + public void getSubItems(@Nonnull Item item, CreativeTabs tab, List list) { for(int i = 0; i < 2; i++) list.add(new ItemStack(item, 1, i)); } + @Nonnull @Override public String getUnlocalizedName(ItemStack par1ItemStack) { return super.getUnlocalizedName(par1ItemStack) + par1ItemStack.getItemDamage(); @@ -71,4 +62,11 @@ public class ItemVial extends ItemMod implements IBrewContainer { return brew.getManaCost() * (stack.getItemDamage() + 1); } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation("botania:vial", "inventory")); + ModelLoader.setCustomModelResourceLocation(this, 1, new ModelResourceLocation("botania:flask", "inventory")); + } + } diff --git a/src/main/java/vazkii/botania/common/item/equipment/armor/elementium/ItemElementiumArmor.java b/src/main/java/vazkii/botania/common/item/equipment/armor/elementium/ItemElementiumArmor.java index 96980869c..96a87fafa 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/armor/elementium/ItemElementiumArmor.java +++ b/src/main/java/vazkii/botania/common/item/equipment/armor/elementium/ItemElementiumArmor.java @@ -1,11 +1,12 @@ package vazkii.botania.common.item.equipment.armor.elementium; -import java.util.List; - import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.item.IPixieSpawner; import vazkii.botania.client.lib.LibResources; @@ -13,25 +14,25 @@ import vazkii.botania.client.model.armor.ModelArmorElementium; import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.item.equipment.armor.manasteel.ItemManasteelArmor; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public abstract class ItemElementiumArmor extends ItemManasteelArmor implements IPixieSpawner { - public ItemElementiumArmor(int type, String name) { + public ItemElementiumArmor(EntityEquipmentSlot type, String name) { super(type, name, BotaniaAPI.elementiumArmorMaterial); } @Override @SideOnly(Side.CLIENT) - public ModelBiped provideArmorModelForSlot(ItemStack stack, int slot) { - models[slot] = new ModelArmorElementium(slot); - return models[slot]; + public ModelBiped provideArmorModelForSlot(ItemStack stack, EntityEquipmentSlot slot) { + models.put(slot, new ModelArmorElementium(slot)); + return models.get(slot); } @Override - public String getArmorTextureAfterInk(ItemStack stack, int slot) { - return ConfigHandler.enableArmorModels ? LibResources.MODEL_ELEMENTIUM_NEW : slot == 2 ? LibResources.MODEL_ELEMENTIUM_1 : LibResources.MODEL_ELEMENTIUM_0; + public String getArmorTextureAfterInk(ItemStack stack, EntityEquipmentSlot slot) { + return ConfigHandler.enableArmorModels ? LibResources.MODEL_ELEMENTIUM_NEW : slot == EntityEquipmentSlot.LEGS ? LibResources.MODEL_ELEMENTIUM_1 : LibResources.MODEL_ELEMENTIUM_0; } @Override @@ -70,15 +71,17 @@ public abstract class ItemElementiumArmor extends ItemManasteelArmor implements return false; } + @SideOnly(Side.CLIENT) @Override public String getArmorSetName() { - return StatCollector.translateToLocal("botania.armorset.elementium.name"); + return I18n.format("botania.armorset.elementium.name"); } + @SideOnly(Side.CLIENT) @Override public void addArmorSetDescription(ItemStack stack, List list) { super.addArmorSetDescription(stack, list); - addStringToTooltip(StatCollector.translateToLocal("botania.armorset.elementium.desc"), list); + addStringToTooltip(I18n.format("botania.armorset.elementium.desc"), list); } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/armor/elementium/ItemElementiumBoots.java b/src/main/java/vazkii/botania/common/item/equipment/armor/elementium/ItemElementiumBoots.java index d37f6b7ed..a0f96b086 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/armor/elementium/ItemElementiumBoots.java +++ b/src/main/java/vazkii/botania/common/item/equipment/armor/elementium/ItemElementiumBoots.java @@ -1,12 +1,13 @@ package vazkii.botania.common.item.equipment.armor.elementium; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemStack; import vazkii.botania.common.lib.LibItemNames; public class ItemElementiumBoots extends ItemElementiumArmor { public ItemElementiumBoots() { - super(3, LibItemNames.ELEMENTIUM_BOOTS); + super(EntityEquipmentSlot.FEET, LibItemNames.ELEMENTIUM_BOOTS); } @Override diff --git a/src/main/java/vazkii/botania/common/item/equipment/armor/elementium/ItemElementiumChest.java b/src/main/java/vazkii/botania/common/item/equipment/armor/elementium/ItemElementiumChest.java index 2994a3ca2..ff707c5a5 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/armor/elementium/ItemElementiumChest.java +++ b/src/main/java/vazkii/botania/common/item/equipment/armor/elementium/ItemElementiumChest.java @@ -1,12 +1,13 @@ package vazkii.botania.common.item.equipment.armor.elementium; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemStack; import vazkii.botania.common.lib.LibItemNames; public class ItemElementiumChest extends ItemElementiumArmor { public ItemElementiumChest() { - super(1, LibItemNames.ELEMENTIUM_CHEST); + super(EntityEquipmentSlot.CHEST, LibItemNames.ELEMENTIUM_CHEST); } @Override diff --git a/src/main/java/vazkii/botania/common/item/equipment/armor/elementium/ItemElementiumHelm.java b/src/main/java/vazkii/botania/common/item/equipment/armor/elementium/ItemElementiumHelm.java index ef357ddb8..e1f510730 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/armor/elementium/ItemElementiumHelm.java +++ b/src/main/java/vazkii/botania/common/item/equipment/armor/elementium/ItemElementiumHelm.java @@ -1,6 +1,7 @@ package vazkii.botania.common.item.equipment.armor.elementium; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemStack; import vazkii.botania.api.mana.IManaDiscountArmor; import vazkii.botania.common.lib.LibItemNames; @@ -12,7 +13,7 @@ public class ItemElementiumHelm extends ItemElementiumArmor implements IManaDisc } public ItemElementiumHelm(String name) { - super(0, name); + super(EntityEquipmentSlot.HEAD, name); } @Override diff --git a/src/main/java/vazkii/botania/common/item/equipment/armor/elementium/ItemElementiumLegs.java b/src/main/java/vazkii/botania/common/item/equipment/armor/elementium/ItemElementiumLegs.java index d221f4e7f..31f244b9e 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/armor/elementium/ItemElementiumLegs.java +++ b/src/main/java/vazkii/botania/common/item/equipment/armor/elementium/ItemElementiumLegs.java @@ -1,12 +1,13 @@ package vazkii.botania.common.item.equipment.armor.elementium; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemStack; import vazkii.botania.common.lib.LibItemNames; public class ItemElementiumLegs extends ItemElementiumArmor { public ItemElementiumLegs() { - super(2, LibItemNames.ELEMENTIUM_LEGS); + super(EntityEquipmentSlot.LEGS, LibItemNames.ELEMENTIUM_LEGS); } @Override diff --git a/src/main/java/vazkii/botania/common/item/equipment/armor/manasteel/ItemManasteelArmor.java b/src/main/java/vazkii/botania/common/item/equipment/armor/manasteel/ItemManasteelArmor.java index b73a63f8e..1f700ac64 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/armor/manasteel/ItemManasteelArmor.java +++ b/src/main/java/vazkii/botania/common/item/equipment/armor/manasteel/ItemManasteelArmor.java @@ -10,78 +10,74 @@ */ package vazkii.botania.common.item.equipment.armor.manasteel; -import java.util.List; - import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.client.resources.I18n; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; +import net.minecraftforge.client.model.ModelLoader; import net.minecraftforge.common.ISpecialArmor; -import thaumcraft.api.IRunicArmor; +import net.minecraftforge.fml.common.Optional; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import thaumcraft.api.items.IRunicArmor; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.item.IPhantomInkable; import vazkii.botania.api.mana.IManaUsingItem; import vazkii.botania.api.mana.ManaItemHandler; -import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.client.lib.LibResources; import vazkii.botania.client.model.armor.ModelArmorManasteel; +import vazkii.botania.client.render.IModelRegister; import vazkii.botania.common.core.BotaniaCreativeTab; import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.item.equipment.tool.ToolCommons; -import cpw.mods.fml.common.Optional; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import vazkii.botania.common.lib.LibMisc; -@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.IRunicArmor") -public class ItemManasteelArmor extends ItemArmor implements ISpecialArmor, IManaUsingItem, IPhantomInkable, IRunicArmor { +import javax.annotation.Nonnull; +import java.util.EnumMap; +import java.util.List; +import java.util.Map; + +@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.items.IRunicArmor") +public class ItemManasteelArmor extends ItemArmor implements ISpecialArmor, IManaUsingItem, IPhantomInkable, IRunicArmor, IModelRegister { private static final int MANA_PER_DAMAGE = 70; private static final String TAG_PHANTOM_INK = "phantomInk"; - protected ModelBiped[] models = null; - public int type; + protected Map models = null; + public final EntityEquipmentSlot type; - public ItemManasteelArmor(int type, String name) { + public ItemManasteelArmor(EntityEquipmentSlot type, String name) { this(type, name, BotaniaAPI.manasteelArmorMaterial); } - public ItemManasteelArmor(int type, String name, ArmorMaterial mat) { + public ItemManasteelArmor(EntityEquipmentSlot type, String name, ArmorMaterial mat) { super(mat, 0, type); this.type = type; setCreativeTab(BotaniaCreativeTab.INSTANCE); + GameRegistry.register(this, new ResourceLocation(LibMisc.MOD_ID, name)); setUnlocalizedName(name); } + @Nonnull @Override - public Item setUnlocalizedName(String par1Str) { - GameRegistry.registerItem(this, par1Str); - return super.setUnlocalizedName(par1Str); - } - - @Override - public String getUnlocalizedNameInefficiently(ItemStack par1ItemStack) { + public String getUnlocalizedNameInefficiently(@Nonnull ItemStack par1ItemStack) { return super.getUnlocalizedNameInefficiently(par1ItemStack).replaceAll("item.", "item." + LibResources.PREFIX_MOD); } - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) { - itemIcon = IconHelper.forItem(par1IconRegister, this); - } - @Override public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) { if(source.isUnblockable()) @@ -111,42 +107,46 @@ public class ItemManasteelArmor extends ItemArmor implements ISpecialArmor, IMan ToolCommons.damageItem(stack, damage, entity, MANA_PER_DAMAGE); } + @Nonnull @Override - public final String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { + public final String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot slot, String type) { return hasPhantomInk(stack) ? LibResources.MODEL_INVISIBLE_ARMOR : getArmorTextureAfterInk(stack, slot); } - public String getArmorTextureAfterInk(ItemStack stack, int slot) { - return ConfigHandler.enableArmorModels ? LibResources.MODEL_MANASTEEL_NEW : slot == 2 ? LibResources.MODEL_MANASTEEL_1 : LibResources.MODEL_MANASTEEL_0; + public String getArmorTextureAfterInk(ItemStack stack, EntityEquipmentSlot slot) { + return ConfigHandler.enableArmorModels ? LibResources.MODEL_MANASTEEL_NEW : slot == EntityEquipmentSlot.LEGS ? LibResources.MODEL_MANASTEEL_1 : LibResources.MODEL_MANASTEEL_0; } + @Nonnull @Override @SideOnly(Side.CLIENT) - public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) { + public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, EntityEquipmentSlot armorSlot, ModelBiped original) { if(ConfigHandler.enableArmorModels) { ModelBiped model = getArmorModelForSlot(entityLiving, itemStack, armorSlot); if(model == null) model = provideArmorModelForSlot(itemStack, armorSlot); - if(model != null) + if(model != null) { + model.setModelAttributes(original); return model; + } } - return super.getArmorModel(entityLiving, itemStack, armorSlot); + return super.getArmorModel(entityLiving, itemStack, armorSlot, original); } @SideOnly(Side.CLIENT) - public ModelBiped getArmorModelForSlot(EntityLivingBase entity, ItemStack stack, int slot) { + public ModelBiped getArmorModelForSlot(EntityLivingBase entity, ItemStack stack, EntityEquipmentSlot slot) { if(models == null) - models = new ModelBiped[4]; + models = new EnumMap<>(EntityEquipmentSlot.class); - return models[slot]; + return models.get(slot); } @SideOnly(Side.CLIENT) - public ModelBiped provideArmorModelForSlot(ItemStack stack, int slot) { - models[slot] = new ModelArmorManasteel(slot); - return models[slot]; + public ModelBiped provideArmorModelForSlot(ItemStack stack, EntityEquipmentSlot slot) { + models.put(slot, new ModelArmorManasteel(slot)); + return models.get(slot); } @Override @@ -159,21 +159,23 @@ public class ItemManasteelArmor extends ItemArmor implements ISpecialArmor, IMan return true; } + @SideOnly(Side.CLIENT) @Override - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean adv) { + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean adv) { if(GuiScreen.isShiftKeyDown()) addInformationAfterShift(stack, player, list, adv); - else addStringToTooltip(StatCollector.translateToLocal("botaniamisc.shiftinfo"), list); + else addStringToTooltip(I18n.format("botaniamisc.shiftinfo"), list); } - public void addInformationAfterShift(ItemStack stack, EntityPlayer player, List list, boolean adv) { + @SideOnly(Side.CLIENT) + public void addInformationAfterShift(ItemStack stack, EntityPlayer player, List list, boolean adv) { addStringToTooltip(getArmorSetTitle(player), list); addArmorSetDescription(stack, list); ItemStack[] stacks = getArmorSetStacks(); for(int i = 0; i < stacks.length; i++) - addStringToTooltip((hasArmorSetItem(player, i) ? EnumChatFormatting.GREEN : "") + " - " + stacks[i].getDisplayName(), list); + addStringToTooltip((hasArmorSetItem(player, i) ? TextFormatting.GREEN : "") + " - " + stacks[i].getDisplayName(), list); if(hasPhantomInk(stack)) - addStringToTooltip(StatCollector.translateToLocal("botaniamisc.hasPhantomInk"), list); + addStringToTooltip(I18n.format("botaniamisc.hasPhantomInk"), list); } public void addStringToTooltip(String s, List tooltip) { @@ -213,7 +215,7 @@ public class ItemManasteelArmor extends ItemArmor implements ISpecialArmor, IMan return false; } - public int getSetPiecesEquipped(EntityPlayer player) { + private int getSetPiecesEquipped(EntityPlayer player) { int pieces = 0; for(int i = 0; i < 4; i++) if(hasArmorSetItem(player, i)) @@ -222,16 +224,19 @@ public class ItemManasteelArmor extends ItemArmor implements ISpecialArmor, IMan return pieces; } + @SideOnly(Side.CLIENT) public String getArmorSetName() { - return StatCollector.translateToLocal("botania.armorset.manasteel.name"); + return I18n.format("botania.armorset.manasteel.name"); } - public String getArmorSetTitle(EntityPlayer player) { - return StatCollector.translateToLocal("botaniamisc.armorset") + " " + getArmorSetName() + " (" + getSetPiecesEquipped(player) + "/" + getArmorSetStacks().length + ")"; + @SideOnly(Side.CLIENT) + private String getArmorSetTitle(EntityPlayer player) { + return I18n.format("botaniamisc.armorset") + " " + getArmorSetName() + " (" + getSetPiecesEquipped(player) + "/" + getArmorSetStacks().length + ")"; } + @SideOnly(Side.CLIENT) public void addArmorSetDescription(ItemStack stack, List list) { - addStringToTooltip(StatCollector.translateToLocal("botania.armorset.manasteel.desc"), list); + addStringToTooltip(I18n.format("botania.armorset.manasteel.desc"), list); } @Override @@ -249,4 +254,10 @@ public class ItemManasteelArmor extends ItemArmor implements ISpecialArmor, IMan public int getRunicCharge(ItemStack itemstack) { return 0; } + + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory")); + } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/armor/manasteel/ItemManasteelBoots.java b/src/main/java/vazkii/botania/common/item/equipment/armor/manasteel/ItemManasteelBoots.java index 3711be8e8..f23a2c8b9 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/armor/manasteel/ItemManasteelBoots.java +++ b/src/main/java/vazkii/botania/common/item/equipment/armor/manasteel/ItemManasteelBoots.java @@ -10,12 +10,13 @@ */ package vazkii.botania.common.item.equipment.armor.manasteel; +import net.minecraft.inventory.EntityEquipmentSlot; import vazkii.botania.common.lib.LibItemNames; public class ItemManasteelBoots extends ItemManasteelArmor { public ItemManasteelBoots() { - super(3, LibItemNames.MANASTEEL_BOOTS); + super(EntityEquipmentSlot.FEET, LibItemNames.MANASTEEL_BOOTS); } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/armor/manasteel/ItemManasteelChest.java b/src/main/java/vazkii/botania/common/item/equipment/armor/manasteel/ItemManasteelChest.java index 000ef254f..3af2b5ef0 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/armor/manasteel/ItemManasteelChest.java +++ b/src/main/java/vazkii/botania/common/item/equipment/armor/manasteel/ItemManasteelChest.java @@ -10,12 +10,13 @@ */ package vazkii.botania.common.item.equipment.armor.manasteel; +import net.minecraft.inventory.EntityEquipmentSlot; import vazkii.botania.common.lib.LibItemNames; public class ItemManasteelChest extends ItemManasteelArmor { public ItemManasteelChest() { - super(1, LibItemNames.MANASTEEL_CHEST); + super(EntityEquipmentSlot.CHEST, LibItemNames.MANASTEEL_CHEST); } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/armor/manasteel/ItemManasteelHelm.java b/src/main/java/vazkii/botania/common/item/equipment/armor/manasteel/ItemManasteelHelm.java index e06815638..1ba8171d8 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/armor/manasteel/ItemManasteelHelm.java +++ b/src/main/java/vazkii/botania/common/item/equipment/armor/manasteel/ItemManasteelHelm.java @@ -11,6 +11,7 @@ package vazkii.botania.common.item.equipment.armor.manasteel; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemStack; import vazkii.botania.api.mana.IManaDiscountArmor; import vazkii.botania.common.lib.LibItemNames; @@ -22,7 +23,7 @@ public class ItemManasteelHelm extends ItemManasteelArmor implements IManaDiscou } public ItemManasteelHelm(String name) { - super(0, name); + super(EntityEquipmentSlot.HEAD, name); } @Override diff --git a/src/main/java/vazkii/botania/common/item/equipment/armor/manasteel/ItemManasteelLegs.java b/src/main/java/vazkii/botania/common/item/equipment/armor/manasteel/ItemManasteelLegs.java index 0538d979d..96ed84e08 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/armor/manasteel/ItemManasteelLegs.java +++ b/src/main/java/vazkii/botania/common/item/equipment/armor/manasteel/ItemManasteelLegs.java @@ -10,12 +10,13 @@ */ package vazkii.botania.common.item.equipment.armor.manasteel; +import net.minecraft.inventory.EntityEquipmentSlot; import vazkii.botania.common.lib.LibItemNames; public class ItemManasteelLegs extends ItemManasteelArmor { public ItemManasteelLegs() { - super(2, LibItemNames.MANASTEEL_LEGS); + super(EntityEquipmentSlot.LEGS, LibItemNames.MANASTEEL_LEGS); } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/armor/manaweave/ItemManaweaveArmor.java b/src/main/java/vazkii/botania/common/item/equipment/armor/manaweave/ItemManaweaveArmor.java index 97fec9a4d..e38abef77 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/armor/manaweave/ItemManaweaveArmor.java +++ b/src/main/java/vazkii/botania/common/item/equipment/armor/manaweave/ItemManaweaveArmor.java @@ -10,18 +10,20 @@ */ package vazkii.botania.common.item.equipment.armor.manaweave; -import java.util.List; - import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.inventory.IInventory; +import net.minecraft.item.IItemPropertyGetter; import net.minecraft.item.ItemStack; import net.minecraft.stats.Achievement; -import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.BotaniaAPI; -import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.client.core.proxy.ClientProxy; import vazkii.botania.client.lib.LibResources; import vazkii.botania.client.model.armor.ModelArmorManaweave; @@ -30,44 +32,34 @@ import vazkii.botania.common.achievement.ModAchievements; import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.item.equipment.armor.manasteel.ItemManasteelArmor; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import javax.annotation.Nonnull; +import java.util.List; public class ItemManaweaveArmor extends ItemManasteelArmor implements ICraftAchievement { - - IIcon iconChristmas; - public ItemManaweaveArmor(int type, String name) { + public ItemManaweaveArmor(EntityEquipmentSlot type, String name) { super(type, name, BotaniaAPI.manaweaveArmorMaterial); + addPropertyOverride(new ResourceLocation("botania", "holiday"), (stack, worldIn, entityIn) -> ClientProxy.jingleTheBells ? 1 : 0); } @Override @SideOnly(Side.CLIENT) - public ModelBiped provideArmorModelForSlot(ItemStack stack, int slot) { - models[slot] = new ModelArmorManaweave(slot); - return models[slot]; + public ModelBiped provideArmorModelForSlot(ItemStack stack, EntityEquipmentSlot slot) { + models.put(slot, new ModelArmorManaweave(slot)); + return models.get(slot); } @Override - public void registerIcons(IIconRegister par1IconRegister) { - super.registerIcons(par1IconRegister); - iconChristmas = IconHelper.forItem(par1IconRegister, this, "Holiday"); - } - - @Override - public String getArmorTextureAfterInk(ItemStack stack, int slot) { - return ConfigHandler.enableArmorModels ? (ClientProxy.jingleTheBells ? LibResources.MODEL_MANAWEAVE_NEW_HOLIDAY : LibResources.MODEL_MANAWEAVE_NEW) : slot == 2 ? LibResources.MODEL_MANAWEAVE_1 : LibResources.MODEL_MANAWEAVE_0; - } - - @Override - public IIcon getIconFromDamage(int dmg) { - return ClientProxy.jingleTheBells ? iconChristmas : super.getIconFromDamage(dmg); + public String getArmorTextureAfterInk(ItemStack stack, EntityEquipmentSlot slot) { + return ConfigHandler.enableArmorModels ? (ClientProxy.jingleTheBells ? LibResources.MODEL_MANAWEAVE_NEW_HOLIDAY : LibResources.MODEL_MANAWEAVE_NEW) : slot == EntityEquipmentSlot.LEGS ? LibResources.MODEL_MANAWEAVE_1 : LibResources.MODEL_MANAWEAVE_0; } + @Nonnull @Override @SideOnly(Side.CLIENT) - public String getUnlocalizedName(ItemStack p_77667_1_) { - String name = super.getUnlocalizedName(p_77667_1_); + public String getUnlocalizedName(ItemStack stack) { + String name = super.getUnlocalizedName(stack); if(ClientProxy.jingleTheBells) name = name.replaceAll("manaweave", "santaweave"); return name; @@ -78,7 +70,7 @@ public class ItemManaweaveArmor extends ItemManasteelArmor implements ICraftAchi return par2ItemStack.getItem() == ModItems.manaResource && par2ItemStack.getItemDamage() == 22 ? true : super.getIsRepairable(par1ItemStack, par2ItemStack); } - static ItemStack[] armorset; + private static ItemStack[] armorset; @Override public ItemStack[] getArmorSetStacks() { @@ -109,25 +101,28 @@ public class ItemManaweaveArmor extends ItemManasteelArmor implements ICraftAchi return false; } + @SideOnly(Side.CLIENT) @Override public String getArmorSetName() { - return StatCollector.translateToLocal("botania.armorset.manaweave.name"); + return I18n.format("botania.armorset.manaweave.name"); } - + + @SideOnly(Side.CLIENT) @Override - public void addInformationAfterShift(ItemStack stack, EntityPlayer player, List list, boolean adv) { + public void addInformationAfterShift(ItemStack stack, EntityPlayer player, List list, boolean adv) { if(ClientProxy.jingleTheBells) { - addStringToTooltip(StatCollector.translateToLocal("botaniamisc.santaweaveInfo"), list); + addStringToTooltip(I18n.format("botaniamisc.santaweaveInfo"), list); addStringToTooltip("", list); } super.addInformationAfterShift(stack, player, list, adv); } - + + @SideOnly(Side.CLIENT) @Override public void addArmorSetDescription(ItemStack stack, List list) { - addStringToTooltip(StatCollector.translateToLocal("botania.armorset.manaweave.desc0"), list); - addStringToTooltip(StatCollector.translateToLocal("botania.armorset.manaweave.desc1"), list); + addStringToTooltip(I18n.format("botania.armorset.manaweave.desc0"), list); + addStringToTooltip(I18n.format("botania.armorset.manaweave.desc1"), list); } @Override diff --git a/src/main/java/vazkii/botania/common/item/equipment/armor/manaweave/ItemManaweaveBoots.java b/src/main/java/vazkii/botania/common/item/equipment/armor/manaweave/ItemManaweaveBoots.java index 35d18e0eb..89fc43681 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/armor/manaweave/ItemManaweaveBoots.java +++ b/src/main/java/vazkii/botania/common/item/equipment/armor/manaweave/ItemManaweaveBoots.java @@ -10,12 +10,13 @@ */ package vazkii.botania.common.item.equipment.armor.manaweave; +import net.minecraft.inventory.EntityEquipmentSlot; import vazkii.botania.common.lib.LibItemNames; public class ItemManaweaveBoots extends ItemManaweaveArmor { public ItemManaweaveBoots() { - super(3, LibItemNames.MANAWEAVE_BOOTS); + super(EntityEquipmentSlot.FEET, LibItemNames.MANAWEAVE_BOOTS); } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/armor/manaweave/ItemManaweaveChest.java b/src/main/java/vazkii/botania/common/item/equipment/armor/manaweave/ItemManaweaveChest.java index 98f4391f2..5f1287db7 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/armor/manaweave/ItemManaweaveChest.java +++ b/src/main/java/vazkii/botania/common/item/equipment/armor/manaweave/ItemManaweaveChest.java @@ -10,12 +10,13 @@ */ package vazkii.botania.common.item.equipment.armor.manaweave; +import net.minecraft.inventory.EntityEquipmentSlot; import vazkii.botania.common.lib.LibItemNames; public class ItemManaweaveChest extends ItemManaweaveArmor { public ItemManaweaveChest() { - super(1, LibItemNames.MANAWEAVE_CHEST); + super(EntityEquipmentSlot.CHEST, LibItemNames.MANAWEAVE_CHEST); } diff --git a/src/main/java/vazkii/botania/common/item/equipment/armor/manaweave/ItemManaweaveHelm.java b/src/main/java/vazkii/botania/common/item/equipment/armor/manaweave/ItemManaweaveHelm.java index 06ab5cd4a..325b6989e 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/armor/manaweave/ItemManaweaveHelm.java +++ b/src/main/java/vazkii/botania/common/item/equipment/armor/manaweave/ItemManaweaveHelm.java @@ -12,6 +12,7 @@ package vazkii.botania.common.item.equipment.armor.manaweave; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemStack; import net.minecraft.util.DamageSource; import net.minecraft.world.World; @@ -26,7 +27,7 @@ public class ItemManaweaveHelm extends ItemManaweaveArmor implements IManaDiscou private static final int MANA_PER_DAMAGE = 30; public ItemManaweaveHelm() { - super(0, LibItemNames.MANAWEAVE_HELM); + super(EntityEquipmentSlot.HEAD, LibItemNames.MANAWEAVE_HELM); } @Override @@ -35,7 +36,7 @@ public class ItemManaweaveHelm extends ItemManaweaveArmor implements IManaDiscou } @Override - public boolean shouldGiveProficiency(ItemStack stack, int slot, EntityPlayer player) { + public boolean shouldGiveProficiency(ItemStack stack, EntityEquipmentSlot slot, EntityPlayer player) { return hasArmorSet(player); } diff --git a/src/main/java/vazkii/botania/common/item/equipment/armor/manaweave/ItemManaweaveLegs.java b/src/main/java/vazkii/botania/common/item/equipment/armor/manaweave/ItemManaweaveLegs.java index 63d61d161..3030ff90a 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/armor/manaweave/ItemManaweaveLegs.java +++ b/src/main/java/vazkii/botania/common/item/equipment/armor/manaweave/ItemManaweaveLegs.java @@ -10,12 +10,13 @@ */ package vazkii.botania.common.item.equipment.armor.manaweave; +import net.minecraft.inventory.EntityEquipmentSlot; import vazkii.botania.common.lib.LibItemNames; public class ItemManaweaveLegs extends ItemManaweaveArmor { public ItemManaweaveLegs() { - super(2, LibItemNames.MANAWEAVE_LEGS); + super(EntityEquipmentSlot.LEGS, LibItemNames.MANAWEAVE_LEGS); } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/armor/terrasteel/ItemTerrasteelArmor.java b/src/main/java/vazkii/botania/common/item/equipment/armor/terrasteel/ItemTerrasteelArmor.java index 7dcb7b24e..d956cee96 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/armor/terrasteel/ItemTerrasteelArmor.java +++ b/src/main/java/vazkii/botania/common/item/equipment/armor/terrasteel/ItemTerrasteelArmor.java @@ -10,15 +10,16 @@ */ package vazkii.botania.common.item.equipment.armor.terrasteel; -import java.util.List; -import java.util.UUID; - +import com.google.common.collect.Multimap; import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.resources.I18n; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.client.lib.LibResources; import vazkii.botania.client.model.armor.ModelArmorTerrasteel; @@ -26,44 +27,45 @@ import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.item.equipment.armor.manasteel.ItemManasteelArmor; -import com.google.common.collect.HashMultimap; -import com.google.common.collect.Multimap; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import javax.annotation.Nonnull; +import java.util.List; +import java.util.UUID; public class ItemTerrasteelArmor extends ItemManasteelArmor { - public ItemTerrasteelArmor(int type, String name) { + public ItemTerrasteelArmor(EntityEquipmentSlot type, String name) { super(type, name, BotaniaAPI.terrasteelArmorMaterial); } @Override @SideOnly(Side.CLIENT) - public ModelBiped provideArmorModelForSlot(ItemStack stack, int slot) { - models[slot] = new ModelArmorTerrasteel(slot); - return models[slot]; + public ModelBiped provideArmorModelForSlot(ItemStack stack, EntityEquipmentSlot slot) { + models.put(slot, new ModelArmorTerrasteel(slot)); + return models.get(slot); } @Override - public String getArmorTextureAfterInk(ItemStack stack, int slot) { - return ConfigHandler.enableArmorModels ? LibResources.MODEL_TERRASTEEL_NEW : slot == 2 ? LibResources.MODEL_TERRASTEEL_1 : LibResources.MODEL_TERRASTEEL_0; + public String getArmorTextureAfterInk(ItemStack stack, EntityEquipmentSlot slot) { + return ConfigHandler.enableArmorModels ? LibResources.MODEL_TERRASTEEL_NEW : slot == EntityEquipmentSlot.CHEST ? LibResources.MODEL_TERRASTEEL_1 : LibResources.MODEL_TERRASTEEL_0; } @Override public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) { - return par2ItemStack.getItem() == ModItems.manaResource && par2ItemStack.getItemDamage() == 4 ? true : super.getIsRepairable(par1ItemStack, par2ItemStack); + return par2ItemStack.getItem() == ModItems.manaResource && par2ItemStack.getItemDamage() == 4 || super.getIsRepairable(par1ItemStack, par2ItemStack); } + @Nonnull @Override - public Multimap getItemAttributeModifiers() { - Multimap multimap = HashMultimap.create(); - UUID uuid = new UUID(getUnlocalizedName().hashCode(), 0); - multimap.put(SharedMonsterAttributes.knockbackResistance.getAttributeUnlocalizedName(), new AttributeModifier(uuid, "Terrasteel modifier " + type, (double) getArmorDisplay(null, new ItemStack(this), type) / 20, 0)); + public Multimap getAttributeModifiers(@Nonnull EntityEquipmentSlot slot, ItemStack stack) { + Multimap multimap = super.getAttributeModifiers(slot, stack); + UUID uuid = new UUID((getUnlocalizedName() + slot.toString()).hashCode(), 0); + if (slot == this.armorType) { + multimap.put(SharedMonsterAttributes.KNOCKBACK_RESISTANCE.getAttributeUnlocalizedName(), new AttributeModifier(uuid, "Terrasteel modifier " + type, (double) getArmorDisplay(null, new ItemStack(this), type.getIndex()) / 20, 0)); + } return multimap; } - static ItemStack[] armorset; + private static ItemStack[] armorset; @Override public ItemStack[] getArmorSetStacks() { @@ -94,16 +96,18 @@ public class ItemTerrasteelArmor extends ItemManasteelArmor { return false; } + @SideOnly(Side.CLIENT) @Override public String getArmorSetName() { - return StatCollector.translateToLocal("botania.armorset.terrasteel.name"); + return I18n.format("botania.armorset.terrasteel.name"); } + @SideOnly(Side.CLIENT) @Override public void addArmorSetDescription(ItemStack stack, List list) { - addStringToTooltip(StatCollector.translateToLocal("botania.armorset.terrasteel.desc0"), list); - addStringToTooltip(StatCollector.translateToLocal("botania.armorset.terrasteel.desc1"), list); - addStringToTooltip(StatCollector.translateToLocal("botania.armorset.terrasteel.desc2"), list); + addStringToTooltip(I18n.format("botania.armorset.terrasteel.desc0"), list); + addStringToTooltip(I18n.format("botania.armorset.terrasteel.desc1"), list); + addStringToTooltip(I18n.format("botania.armorset.terrasteel.desc2"), list); } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/armor/terrasteel/ItemTerrasteelBoots.java b/src/main/java/vazkii/botania/common/item/equipment/armor/terrasteel/ItemTerrasteelBoots.java index 5ff5aedda..27344b340 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/armor/terrasteel/ItemTerrasteelBoots.java +++ b/src/main/java/vazkii/botania/common/item/equipment/armor/terrasteel/ItemTerrasteelBoots.java @@ -10,12 +10,13 @@ */ package vazkii.botania.common.item.equipment.armor.terrasteel; +import net.minecraft.inventory.EntityEquipmentSlot; import vazkii.botania.common.lib.LibItemNames; public class ItemTerrasteelBoots extends ItemTerrasteelArmor { public ItemTerrasteelBoots() { - super(3, LibItemNames.TERRASTEEL_BOOTS); + super(EntityEquipmentSlot.FEET, LibItemNames.TERRASTEEL_BOOTS); } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/armor/terrasteel/ItemTerrasteelChest.java b/src/main/java/vazkii/botania/common/item/equipment/armor/terrasteel/ItemTerrasteelChest.java index 4f4a7b6a3..8a786a92a 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/armor/terrasteel/ItemTerrasteelChest.java +++ b/src/main/java/vazkii/botania/common/item/equipment/armor/terrasteel/ItemTerrasteelChest.java @@ -10,12 +10,13 @@ */ package vazkii.botania.common.item.equipment.armor.terrasteel; +import net.minecraft.inventory.EntityEquipmentSlot; import vazkii.botania.common.lib.LibItemNames; public class ItemTerrasteelChest extends ItemTerrasteelArmor { public ItemTerrasteelChest() { - super(1, LibItemNames.TERRASTEEL_CHEST); + super(EntityEquipmentSlot.CHEST, LibItemNames.TERRASTEEL_CHEST); } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/armor/terrasteel/ItemTerrasteelHelm.java b/src/main/java/vazkii/botania/common/item/equipment/armor/terrasteel/ItemTerrasteelHelm.java index 213e84f02..748e4c549 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/armor/terrasteel/ItemTerrasteelHelm.java +++ b/src/main/java/vazkii/botania/common/item/equipment/armor/terrasteel/ItemTerrasteelHelm.java @@ -10,58 +10,46 @@ */ package vazkii.botania.common.item.equipment.armor.terrasteel; -import java.util.List; - import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.resources.I18n; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.MobEffects; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; -import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import net.minecraftforge.client.event.RenderPlayerEvent; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.living.LivingHurtEvent; - -import org.lwjgl.opengl.GL11; - +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.item.IAncientWillContainer; -import vazkii.botania.api.item.IBaubleRender.Helper; +import vazkii.botania.api.item.IBaubleRender; import vazkii.botania.api.mana.IManaDiscountArmor; import vazkii.botania.api.mana.IManaGivingItem; import vazkii.botania.api.mana.ManaItemHandler; +import vazkii.botania.client.core.handler.MiscellaneousIcons; import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.lib.LibItemNames; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public class ItemTerrasteelHelm extends ItemTerrasteelArmor implements IManaDiscountArmor, IAncientWillContainer, IManaGivingItem { private static final String TAG_ANCIENT_WILL = "AncientWill"; - static IIcon willIcon; public ItemTerrasteelHelm() { this(LibItemNames.TERRASTEEL_HELM); - MinecraftForge.EVENT_BUS.register(this); } public ItemTerrasteelHelm(String name) { - super(0, name); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) { - super.registerIcons(par1IconRegister); - willIcon = IconHelper.forName(par1IconRegister, "willFlame"); + super(EntityEquipmentSlot.HEAD, name); + MinecraftForge.EVENT_BUS.register(this); } @Override @@ -100,7 +88,7 @@ public class ItemTerrasteelHelm extends ItemTerrasteelArmor implements IManaDisc super.addArmorSetDescription(stack, list); for(int i = 0; i < 6; i++) if(hasAncientWill(stack, i)) - addStringToTooltip(StatCollector.translateToLocal("botania.armorset.will" + i + ".desc"), list); + addStringToTooltip(I18n.format("botania.armorset.will" + i + ".desc"), list); } public static boolean hasAnyWill(ItemStack stack) { @@ -112,32 +100,32 @@ public class ItemTerrasteelHelm extends ItemTerrasteelArmor implements IManaDisc } @SideOnly(Side.CLIENT) - public static void renderOnPlayer(ItemStack stack, RenderPlayerEvent event) { + public static void renderOnPlayer(ItemStack stack, EntityPlayer player) { if(hasAnyWill(stack) && !((ItemTerrasteelArmor) stack.getItem()).hasPhantomInk(stack)) { - GL11.glPushMatrix(); - float f = willIcon.getMinU(); - float f1 = willIcon.getMaxU(); - float f2 = willIcon.getMinV(); - float f3 = willIcon.getMaxV(); - Helper.translateToHeadLevel(event.entityPlayer); - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); - GL11.glRotatef(90F, 0F, 1F, 0F); - GL11.glRotatef(180F, 1F, 0F, 0F); - GL11.glTranslatef(-0.26F, 0.15F, -0.39F); - GL11.glScalef(0.5F, 0.5F, 0.5F); - ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, willIcon.getIconWidth(), willIcon.getIconHeight(), 1F / 16F); - GL11.glPopMatrix(); + GlStateManager.pushMatrix(); + float f = MiscellaneousIcons.INSTANCE.terrasteelHelmWillIcon.getMinU(); + float f1 = MiscellaneousIcons.INSTANCE.terrasteelHelmWillIcon.getMaxU(); + float f2 = MiscellaneousIcons.INSTANCE.terrasteelHelmWillIcon.getMinV(); + float f3 = MiscellaneousIcons.INSTANCE.terrasteelHelmWillIcon.getMaxV(); + IBaubleRender.Helper.translateToHeadLevel(player); + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + GlStateManager.rotate(90F, 0F, 1F, 0F); + GlStateManager.rotate(180F, 1F, 0F, 0F); + GlStateManager.translate(-0.26F, -1.45F, -0.39F); + GlStateManager.scale(0.5F, 0.5F, 0.5F); + IconHelper.renderIconIn3D(Tessellator.getInstance(), f1, f2, f, f3, MiscellaneousIcons.INSTANCE.terrasteelHelmWillIcon.getIconWidth(), MiscellaneousIcons.INSTANCE.terrasteelHelmWillIcon.getIconHeight(), 1F / 16F); + GlStateManager.popMatrix(); } } @SubscribeEvent public void onEntityAttacked(LivingHurtEvent event) { - Entity attacker = event.source.getEntity(); + Entity attacker = event.getSource().getEntity(); if(attacker instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) attacker; if(hasArmorSet(player)) { - boolean crit = player.fallDistance > 0.0F && !player.onGround && !player.isOnLadder() && !player.isInWater() && !player.isPotionActive(Potion.blindness) && player.ridingEntity == null; - ItemStack stack = player.inventory.armorItemInSlot(3); + boolean crit = player.fallDistance > 0.0F && !player.onGround && !player.isOnLadder() && !player.isInWater() && !player.isPotionActive(MobEffects.BLINDNESS) && !player.isRiding(); + ItemStack stack = player.getItemStackFromSlot(EntityEquipmentSlot.HEAD); if(crit && stack != null && stack.getItem() instanceof ItemTerrasteelHelm) { boolean ahrim = hasAncientWill(stack, 0); boolean dharok = hasAncientWill(stack, 1); @@ -147,17 +135,17 @@ public class ItemTerrasteelHelm extends ItemTerrasteelArmor implements IManaDisc boolean karil = hasAncientWill(stack, 5); if(ahrim) - event.entityLiving.addPotionEffect(new PotionEffect(Potion.weakness.id, 20, 1)); + event.getEntityLiving().addPotionEffect(new PotionEffect(MobEffects.WEAKNESS, 20, 1)); if(dharok) - event.ammount *= 1F + (1F - player.getHealth() / player.getMaxHealth()) * 0.5F; + event.setAmount(event.getAmount() * (1F + (1F - player.getHealth() / player.getMaxHealth()) * 0.5F)); if(guthan) - player.heal(event.ammount * 0.25F); + player.heal(event.getAmount() * 0.25F); if(torag) - event.entityLiving.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 60, 1)); + event.getEntityLiving().addPotionEffect(new PotionEffect(MobEffects.SLOWNESS, 60, 1)); if(verac) - event.source.setDamageBypassesArmor(); + event.getSource().setDamageBypassesArmor(); if(karil) - event.entityLiving.addPotionEffect(new PotionEffect(Potion.wither.id, 60, 1)); + event.getEntityLiving().addPotionEffect(new PotionEffect(MobEffects.WITHER, 60, 1)); } } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/armor/terrasteel/ItemTerrasteelLegs.java b/src/main/java/vazkii/botania/common/item/equipment/armor/terrasteel/ItemTerrasteelLegs.java index 536819909..9f81f930a 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/armor/terrasteel/ItemTerrasteelLegs.java +++ b/src/main/java/vazkii/botania/common/item/equipment/armor/terrasteel/ItemTerrasteelLegs.java @@ -10,12 +10,13 @@ */ package vazkii.botania.common.item.equipment.armor.terrasteel; +import net.minecraft.inventory.EntityEquipmentSlot; import vazkii.botania.common.lib.LibItemNames; public class ItemTerrasteelLegs extends ItemTerrasteelArmor { public ItemTerrasteelLegs() { - super(2, LibItemNames.TERRASTEEL_LEGS); + super(EntityEquipmentSlot.LEGS, LibItemNames.TERRASTEEL_LEGS); } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemAuraRing.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemAuraRing.java index 6365a3bcc..9aaed4af5 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemAuraRing.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemAuraRing.java @@ -10,13 +10,13 @@ */ package vazkii.botania.common.item.equipment.bauble; +import baubles.api.BaubleType; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import vazkii.botania.api.mana.IManaGivingItem; import vazkii.botania.api.mana.ManaItemHandler; import vazkii.botania.common.lib.LibItemNames; -import baubles.api.BaubleType; public class ItemAuraRing extends ItemBauble implements IManaGivingItem { diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBauble.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBauble.java index f8d75a891..9fb29ce70 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBauble.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBauble.java @@ -10,32 +10,38 @@ */ package vazkii.botania.common.item.equipment.bauble; -import java.util.List; -import java.util.UUID; - -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; -import thaumcraft.api.IRunicArmor; -import vazkii.botania.api.item.ICosmeticAttachable; -import vazkii.botania.api.item.IPhantomInkable; -import vazkii.botania.common.achievement.ModAchievements; -import vazkii.botania.common.core.helper.ItemNBTHelper; -import vazkii.botania.common.entity.EntityDoppleganger; -import vazkii.botania.common.item.ItemMod; import baubles.api.BaubleType; import baubles.api.IBauble; import baubles.common.container.InventoryBaubles; import baubles.common.lib.PlayerHandler; -import cpw.mods.fml.common.Optional; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.SoundCategory; +import net.minecraft.world.World; +import net.minecraftforge.fml.common.Optional; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import thaumcraft.api.items.IRunicArmor; +import vazkii.botania.api.item.ICosmeticAttachable; +import vazkii.botania.api.item.IPhantomInkable; +import vazkii.botania.api.sound.BotaniaSoundEvents; +import vazkii.botania.common.achievement.ModAchievements; +import vazkii.botania.common.core.helper.ItemNBTHelper; +import vazkii.botania.common.entity.EntityDoppleganger; +import vazkii.botania.common.item.ItemMod; -@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.IRunicArmor") +import javax.annotation.Nonnull; +import java.util.List; +import java.util.UUID; + +@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.items.IRunicArmor") public abstract class ItemBauble extends ItemMod implements IBauble, ICosmeticAttachable, IPhantomInkable, IRunicArmor { private static final String TAG_HASHCODE = "playerHashcode"; @@ -45,31 +51,33 @@ public abstract class ItemBauble extends ItemMod implements IBauble, ICosmeticAt private static final String TAG_PHANTOM_INK = "phantomInk"; public ItemBauble(String name) { - super(); + super(name); setMaxStackSize(1); - setUnlocalizedName(name); } + @Nonnull @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if(!EntityDoppleganger.isTruePlayer(par3EntityPlayer)) - return par1ItemStack; + public ActionResult onItemRightClick(@Nonnull ItemStack stack, World world, EntityPlayer player, EnumHand hand) { + if(!EntityDoppleganger.isTruePlayer(player)) + return ActionResult.newResult(EnumActionResult.FAIL, stack); - if(canEquip(par1ItemStack, par3EntityPlayer)) { - InventoryBaubles baubles = PlayerHandler.getPlayerBaubles(par3EntityPlayer); + ItemStack toEquip = stack.copy(); + toEquip.stackSize = 1; + + if(canEquip(toEquip, player)) { + InventoryBaubles baubles = PlayerHandler.getPlayerBaubles(player); for(int i = 0; i < baubles.getSizeInventory(); i++) { - if(baubles.isItemValidForSlot(i, par1ItemStack)) { + if(baubles.isItemValidForSlot(i, toEquip)) { ItemStack stackInSlot = baubles.getStackInSlot(i); - if(stackInSlot == null || ((IBauble) stackInSlot.getItem()).canUnequip(stackInSlot, par3EntityPlayer)) { - if(!par2World.isRemote) { - baubles.setInventorySlotContents(i, par1ItemStack.copy()); - if(!par3EntityPlayer.capabilities.isCreativeMode) - par3EntityPlayer.inventory.setInventorySlotContents(par3EntityPlayer.inventory.currentItem, null); + if(stackInSlot == null || ((IBauble) stackInSlot.getItem()).canUnequip(stackInSlot, player)) { + if(!world.isRemote) { + baubles.setInventorySlotContents(i, toEquip); + stack.stackSize--; } if(stackInSlot != null) { - ((IBauble) stackInSlot.getItem()).onUnequipped(stackInSlot, par3EntityPlayer); - return stackInSlot.copy(); + ((IBauble) stackInSlot.getItem()).onUnequipped(stackInSlot, player); + return ActionResult.newResult(EnumActionResult.SUCCESS, stackInSlot.copy()); } break; } @@ -77,32 +85,33 @@ public abstract class ItemBauble extends ItemMod implements IBauble, ICosmeticAt } } - return par1ItemStack; + return ActionResult.newResult(EnumActionResult.PASS, stack); } @Override @SideOnly(Side.CLIENT) - public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { + public void addInformation(ItemStack par1ItemStack, EntityPlayer player, List stacks, boolean par4) { if(GuiScreen.isShiftKeyDown()) - addHiddenTooltip(par1ItemStack, par2EntityPlayer, par3List, par4); - else addStringToTooltip(StatCollector.translateToLocal("botaniamisc.shiftinfo"), par3List); + addHiddenTooltip(par1ItemStack, player, stacks, par4); + else addStringToTooltip(I18n.format("botaniamisc.shiftinfo"), stacks); } - public void addHiddenTooltip(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { + @SideOnly(Side.CLIENT) + public void addHiddenTooltip(ItemStack par1ItemStack, EntityPlayer player, List stacks, boolean par4) { BaubleType type = getBaubleType(par1ItemStack); - addStringToTooltip(StatCollector.translateToLocal("botania.baubletype." + type.name().toLowerCase()), par3List); + addStringToTooltip(I18n.format("botania.baubletype." + type.name().toLowerCase()), stacks); String key = vazkii.botania.client.core.helper.RenderHelper.getKeyDisplayString("Baubles Inventory"); if(key != null) - addStringToTooltip(StatCollector.translateToLocal("botania.baubletooltip").replaceAll("%key%", key), par3List); + addStringToTooltip(I18n.format("botania.baubletooltip", key), stacks); ItemStack cosmetic = getCosmeticItem(par1ItemStack); if(cosmetic != null) - addStringToTooltip(String.format(StatCollector.translateToLocal("botaniamisc.hasCosmetic"), cosmetic.getDisplayName()), par3List); + addStringToTooltip(I18n.format("botaniamisc.hasCosmetic", cosmetic.getDisplayName()), stacks); if(hasPhantomInk(par1ItemStack)) - addStringToTooltip(StatCollector.translateToLocal("botaniamisc.hasPhantomInk"), par3List); + addStringToTooltip(I18n.format("botaniamisc.hasPhantomInk"), stacks); } void addStringToTooltip(String s, List tooltip) { @@ -131,7 +140,7 @@ public abstract class ItemBauble extends ItemMod implements IBauble, ICosmeticAt public void onEquipped(ItemStack stack, EntityLivingBase player) { if(player != null) { if(!player.worldObj.isRemote) - player.worldObj.playSoundAtEntity(player, "botania:equipBauble", 0.1F, 1.3F); + player.worldObj.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.equipBauble, SoundCategory.PLAYERS, 0.1F, 1.3F); if(player instanceof EntityPlayer) ((EntityPlayer) player).addStat(ModAchievements.baubleWear, 1); @@ -141,14 +150,10 @@ public abstract class ItemBauble extends ItemMod implements IBauble, ICosmeticAt } } - public void onEquippedOrLoadedIntoWorld(ItemStack stack, EntityLivingBase player) { - // NO-OP - } + public void onEquippedOrLoadedIntoWorld(ItemStack stack, EntityLivingBase player) {} @Override - public void onUnequipped(ItemStack stack, EntityLivingBase player) { - // NO-OP - } + public void onUnequipped(ItemStack stack, EntityLivingBase player) {} @Override public ItemStack getCosmeticItem(ItemStack stack) { @@ -171,16 +176,12 @@ public abstract class ItemBauble extends ItemMod implements IBauble, ICosmeticAt return getContainerItem(stack) != null; } + @Nonnull @Override - public ItemStack getContainerItem(ItemStack itemStack) { + public ItemStack getContainerItem(@Nonnull ItemStack itemStack) { return getCosmeticItem(itemStack); } - @Override - public boolean doesContainerItemLeaveCraftingGrid(ItemStack p_77630_1_) { - return false; - } - public static UUID getBaubleUUID(ItemStack stack) { long most = ItemNBTHelper.getLong(stack, TAG_BAUBLE_UUID_MOST, 0); if(most == 0) { diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBaubleCosmetic.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBaubleCosmetic.java index 6cf98d16b..83c48aa05 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBaubleCosmetic.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBaubleCosmetic.java @@ -2,45 +2,62 @@ * This class was created by . It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania - * + * * Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php - * + * * File Created @ [Feb 22, 2015, 2:01:01 PM (GMT)] */ package vazkii.botania.common.item.equipment.bauble; -import java.util.List; - +import baubles.api.BaubleType; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.EntityRenderer; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.renderer.VertexBuffer; +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.renderer.block.model.IBakedModel; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.resources.I18n; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; -import net.minecraftforge.client.event.RenderPlayerEvent; +import net.minecraft.util.EnumFacing; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.oredict.RecipeSorter; import net.minecraftforge.oredict.RecipeSorter.Category; - import org.lwjgl.opengl.GL11; - import vazkii.botania.api.item.ICosmeticBauble; -import vazkii.botania.client.core.helper.IconHelper; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.crafting.recipe.CosmeticAttachRecipe; import vazkii.botania.common.crafting.recipe.CosmeticRemoveRecipe; import vazkii.botania.common.lib.LibItemNames; -import baubles.api.BaubleType; -import cpw.mods.fml.common.registry.GameRegistry; + +import javax.annotation.Nonnull; +import java.util.List; public class ItemBaubleCosmetic extends ItemBauble implements ICosmeticBauble { + public enum Variants { + BLACK_BOWTIE, BLACK_TIE, RED_GLASSES, PUFFY_SCARF, + ENGINEER_GOGGLES, EYEPATCH, WICKED_EYEPATCH, RED_RIBBONS, + PINK_FLOWER_BUD, POLKA_DOTTED_BOWS, BLUE_BUTTERFLY, CAT_EARS, + WITCH_PIN, DEVIL_TAIL, KAMUI_EYE, GOOGLY_EYES, + FOUR_LEAF_CLOVER, CLOCK_EYE, UNICORN_HORN, DEVIL_HORNS, + HYPER_PLUS, BOTANIST_EMBLEM, ANCIENT_MASK, EERIE_MASK, + ALIEN_ANTENNA, ANAGLYPH_GLASSES, ORANGE_SHADES, GROUCHO_GLASSES, + THICK_EYEBROWS, LUSITANIC_SHIELD, TINY_POTATO_MASK, QUESTGIVER_MARK + } + private static final int SUBTYPES = 32; - IIcon[] icons; + private ItemStack renderStack; public ItemBaubleCosmetic() { super(LibItemNames.COSMETIC); @@ -50,35 +67,33 @@ public class ItemBaubleCosmetic extends ItemBauble implements ICosmeticBauble { GameRegistry.addRecipe(new CosmeticRemoveRecipe()); RecipeSorter.register("botania:cosmeticAttach", CosmeticAttachRecipe.class, Category.SHAPELESS, ""); RecipeSorter.register("botania:cosmeticRemove", CosmeticRemoveRecipe.class, Category.SHAPELESS, ""); + renderStack = new ItemStack(this); } @Override - public void registerIcons(IIconRegister par1IconRegister) { - icons = new IIcon[SUBTYPES]; - for(int i = 0; i < SUBTYPES; i++) - icons[i] = IconHelper.forItem(par1IconRegister, this, i); - } - - @Override - public void getSubItems(Item item, CreativeTabs tab, List list) { + @SideOnly(Side.CLIENT) + public void getSubItems(@Nonnull Item item, CreativeTabs tab, List list) { for(int i = 0; i < SUBTYPES; i++) list.add(new ItemStack(item, 1, i)); } - @Override - public IIcon getIconFromDamage(int dmg) { - return icons[Math.min(SUBTYPES - 1, dmg)]; - } - + @Nonnull @Override public String getUnlocalizedName(ItemStack par1ItemStack) { return super.getUnlocalizedName(par1ItemStack) + par1ItemStack.getItemDamage(); } + @SideOnly(Side.CLIENT) @Override - public void addHiddenTooltip(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { - addStringToTooltip(StatCollector.translateToLocal("botaniamisc.cosmeticBauble"), par3List); - super.addHiddenTooltip(par1ItemStack, par2EntityPlayer, par3List, par4); + public void addHiddenTooltip(ItemStack par1ItemStack, EntityPlayer player, List stacks, boolean par4) { + addStringToTooltip(I18n.format("botaniamisc.cosmeticBauble"), stacks); + super.addHiddenTooltip(par1ItemStack, player, stacks, par4); + } + + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerItemAppendMeta(this, 32, LibItemNames.COSMETIC); } @Override @@ -87,255 +102,282 @@ public class ItemBaubleCosmetic extends ItemBauble implements ICosmeticBauble { } @Override - public void onPlayerBaubleRender(ItemStack stack, RenderPlayerEvent event, RenderType type) { - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); - if(type == RenderType.HEAD) { - Helper.translateToHeadLevel(event.entityPlayer); - switch(stack.getItemDamage()) { - case 2: - faceTranslate(); - scale(0.75F); - GL11.glTranslatef(0.04F, -0.5F, 0F); - renderIcon(2); - break; - case 4: - faceTranslate(); - scale(0.75F); - GL11.glTranslatef(0.04F, -0.5F, 0F); - renderIcon(4); - break; - case 5: - faceTranslate(); - scale(0.35F); - GL11.glTranslatef(0.3F, -0.5F, 0F); - renderIcon(5); - break; - case 6: - faceTranslate(); - scale(0.35F); - GL11.glTranslatef(0.9F, -0.5F, 0F); - renderIcon(6); - break; - case 7: - faceTranslate(); - scale(0.6F); - GL11.glTranslatef(0.2F, 0.3F, 0.6F); - renderIcon(7); - break; - case 8: - faceTranslate(); - GL11.glRotatef(90F, 0F, 1F, 0F); - scale(0.6F); - GL11.glTranslatef(-0.9F, 0F, 0.2F); - renderIcon(8); - break; - case 9: - faceTranslate(); - GL11.glRotatef(90F, 0F, 1F, 0F); - scale(0.6F); - GL11.glTranslatef(-0.9F, -0.2F, 0.2F); - renderIcon(9); - GL11.glTranslatef(0F, 0F, 1F); - renderIcon(9); - break; - case 10: - faceTranslate(); - GL11.glRotatef(90F, 0F, 1F, 0F); - scale(0.4F); - GL11.glTranslatef(-0.5F, -0.1F, 0.3F); - GL11.glRotatef(120F, 0F, 1F, 0F); - renderIcon(10); - GL11.glRotatef(-100F, 0F, 1F, 0F); - renderIcon(10); - break; - case 11: - faceTranslate(); - scale(0.6F); - GL11.glTranslatef(0.2F, -0.1F, 0.6F); - renderIcon(11); - break; - case 15: - faceTranslate(); - GL11.glTranslatef(-0.1F, -0.55F, 0F); - renderIcon(15); - break; - case 17: - faceTranslate(); - scale(0.35F); - GL11.glTranslatef(0.3F, -0.6F, 0F); - renderIcon(17); - break; - case 18: - faceTranslate(); - scale(0.75F); - GL11.glRotatef(90F, 0F, 1F, 0F); - GL11.glTranslatef(-0.3F, 0.1F, 0.55F); - renderIcon(18); - break; - case 19: - faceTranslate(); - scale(0.6F); - GL11.glTranslatef(0.2F, -0.2F, 0.1F); - renderIcon(19); - break; - case 20: - faceTranslate(); - scale(0.25F); - GL11.glTranslatef(0.4F, 0.5F, -0.1F); - renderIcon(20); - GL11.glTranslatef(1.4F, 0F, 0F); - renderIcon(20); - break; - case 22: - faceTranslate(); - scale(0.75F); - GL11.glTranslatef(0.04F, -0.4F, 0F); - renderIcon(22); - break; - case 23: - faceTranslate(); - scale(0.75F); - GL11.glTranslatef(0.04F, -0.4F, 0F); - renderIcon(23); - break; - case 24: - faceTranslate(); - scale(0.6F); - GL11.glTranslatef(0.5F, 0F, 0.1F); - GL11.glRotatef(60F, 0F, 0F, 1F); - renderIcon(24); - break; - case 25: - faceTranslate(); - scale(0.75F); - GL11.glTranslatef(0.04F, -0.5F, 0F); - renderIcon(25); - break; - case 26: - faceTranslate(); - GL11.glTranslatef(-0.1F, -0.4F, 0F); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1F, 1F, 1F, 0.7F); - renderIcon(26); - break; - case 27: - faceTranslate(); - scale(0.75F); - GL11.glTranslatef(0.04F, -0.65F, 0F); - renderIcon(27); - break; - case 28: - faceTranslate(); - scale(0.25F); - GL11.glTranslatef(1.55F, -0.2F, -0.1F); - renderIcon(28); - GL11.glRotatef(180F, 0F, 1F, 0F); - GL11.glTranslatef(-0.1F, 0F, 0.1F); - renderIcon(28); - break; - case 30: - faceTranslate(); - scale(0.75F); - GL11.glTranslatef(0.04F, -0.4F, 0F); - renderIcon(30); - break; - case 31: - faceTranslate(); - scale(0.5F); - GL11.glTranslatef(0.3F, 0.7F, 0.5F); - renderIcon(31); - break; + public void onPlayerBaubleRender(ItemStack stack, EntityPlayer player, RenderType type, float partialTicks) { + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + + renderStack = stack; + + if (stack.getItemDamage() >= 32 || stack.getItemDamage() < 0) return; + Variants variant = Variants.values()[stack.getItemDamage()]; + + if (type == RenderType.HEAD) { + Helper.translateToHeadLevel(player); + Helper.translateToFace(); + Helper.defaultTransforms(); + switch (variant) { + case RED_GLASSES: + GlStateManager.scale(1.25, 1.25, 1.25); + GlStateManager.translate(0F, -0.085F, 0.045F); + renderItem(); + break; + case ENGINEER_GOGGLES: + GlStateManager.scale(1.25, 1.25, 1.25); + GlStateManager.translate(0F, -0.085F, 0.045F); + renderItem(); + break; + case EYEPATCH: + scale(0.55F); + GlStateManager.translate(-0.45F, -0.25F, 0F); + renderItem(); + break; + case WICKED_EYEPATCH: + scale(0.55F); + GlStateManager.translate(0.45F, -0.25F, 0F); + renderItem(); + break; + case RED_RIBBONS: + scale(0.9F); + GlStateManager.translate(0F, 0.75F, 1F); + renderItem(); + break; + case PINK_FLOWER_BUD: + GlStateManager.rotate(-90F, 0F, 1F, 0F); + GlStateManager.translate(0.4F, 0.6F, 0.45F); + renderItem(); + break; + case POLKA_DOTTED_BOWS: + GlStateManager.rotate(-90F, 0F, 1F, 0F); + GlStateManager.translate(0.65F, 0.3F, 0.5F); + renderItem(); + GlStateManager.translate(0F, 0F, -1F); + renderItem(); + break; + case BLUE_BUTTERFLY: + GlStateManager.translate(-0.75F, 0.1F, 1F); + GlStateManager.pushMatrix(); + GlStateManager.rotate(45F, 0F, 1F, 0F); + renderItem(); + GlStateManager.popMatrix(); + + GlStateManager.translate(0F, 0F, -0.75F); + GlStateManager.rotate(-45F, 0F, 1F, 0F); + renderItem(); + break; + case CAT_EARS: + GlStateManager.translate(0F, 0.25F, 0.25F); + renderItem(); + break; + case GOOGLY_EYES: + GlStateManager.rotate(180F, 0F, 1F, 0F); + GlStateManager.scale(1.5F, 1.5F, 1F); + GlStateManager.translate(0F, -0.05F, -0.15F); + renderItem(); + break; + case CLOCK_EYE: + scale(0.75F); + GlStateManager.translate(-0.25F, -0.1F, 0F); + GlStateManager.rotate(180F, 0F, 0F, 1F); + renderItem(); + break; + case UNICORN_HORN: + scale(1.25F); + GlStateManager.rotate(-90F, 0F, 1F, 0F); + GlStateManager.translate(0F, 0.4F, 0F); + renderItem(); + break; + case DEVIL_HORNS: + GlStateManager.translate(0F, 0.2F, 0.25F); + renderItem(); + break; + case HYPER_PLUS: + scale(0.35F); + GlStateManager.translate(-0.7F, 1F, -0.5F); + renderItem(); + GlStateManager.translate(1.45F, 0F, 0F); + renderItem(); + break; + case ANCIENT_MASK: + scale(1.25F); + GlStateManager.translate(0F, 0.025F, 0.01F); + renderItem(); + break; + case EERIE_MASK: + renderItem(); + break; + case ALIEN_ANTENNA: + scale(0.9F); + GlStateManager.rotate(180F, 0F, 1F, 0F); + GlStateManager.translate(0F, 0.75F, -1F); + renderItem(); + break; + case ANAGLYPH_GLASSES: + scale(1.25F); + GlStateManager.translate(0F, -0.025F, 0F); + renderItem(); + break; + case ORANGE_SHADES: + scale(1.25f); + GlStateManager.translate(0F, 0.04F, 0F); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.color(1F, 1F, 1F, 0.7F); + renderItem(); + break; + case GROUCHO_GLASSES: + scale(1.5F); + GlStateManager.translate(0F, -0.2125F, 0F); + renderItem(); + break; + case THICK_EYEBROWS: + scale(0.5F); + GlStateManager.translate(-0.4F, 0.05F, 0F); + renderItem(); + GlStateManager.rotate(180F, 0F, 1F, 0F); + GlStateManager.translate(-0.775F, 0F, 0F); + renderItem(); + break; + case TINY_POTATO_MASK: + scale(1.25F); + GlStateManager.translate(0F, 0.025F, 0F); + renderItem(); + break; + case QUESTGIVER_MARK: + scale(0.8F); + GlStateManager.translate(0F, 1F, 0.3F); + renderItem(); + break; } } else { - Helper.rotateIfSneaking(event.entityPlayer); - switch(stack.getItemDamage()) { - case 0: - chestTranslate(); - scale(0.5F); - GL11.glTranslatef(0.5F, 0.7F, 0F); - renderIcon(0); - break; - case 1: - chestTranslate(); - scale(0.75F); - GL11.glTranslatef(0.15F, -0.1F, 0F); - renderIcon(1); - break; - case 3: - chestTranslate(); - scale(0.6F); - GL11.glTranslatef(0.35F, 0.3F, 0F); - renderIcon(3); - break; - case 12: - chestTranslate(); - scale(0.225F); - GL11.glTranslatef(1.2F, 1.9F, 0F); - renderIcon(12); - break; - case 13: - chestTranslate(); - GL11.glRotatef(-90F, 0F, 1F, 0F); - scale(0.5F); - GL11.glTranslatef(-1.3F, -0.4F, -1F); - renderIcon(13); - break; - case 14: - chestTranslate(); - scale(0.5F); - GL11.glTranslatef(2.3F, 1F, -0.05F); - GL11.glRotatef(180F, 0F, 1F, 0F); - renderIcon(14); - GL11.glRotatef(180F, 0F, 1F, 0F); - GL11.glColor4f(0F, 0F, 0.3F, 1F); - GL11.glTranslatef(-2.6F, 0F, 0.05F); - renderIcon(14); - break; - case 16: - chestTranslate(); - scale(0.225F); - GL11.glTranslatef(2.3F, 1.9F, 0F); - renderIcon(16); - break; - case 21: - chestTranslate(); - scale(0.3F); - GL11.glTranslatef(1.2F, 0.5F, 0F); - renderIcon(21); - break; - case 29: - chestTranslate(); - scale(0.8F); - GL11.glTranslatef(0.2F, -0.2F, -0.35F); - GL11.glRotatef(10F, 0F, 0F, 1F); - renderIcon(29); - break; + Helper.rotateIfSneaking(player); + Helper.translateToChest(); + Helper.defaultTransforms(); + switch (variant) { + case BLACK_BOWTIE: + GlStateManager.translate(0F, 0.15F, 0F); + renderItem(); + break; + case BLACK_TIE: + GlStateManager.translate(0F, -0.15F, 0F); + renderItem(); + break; + case PUFFY_SCARF: + GlStateManager.translate(0F, -0.15F, 0F); + renderItem(); + break; + case WITCH_PIN: + scale(0.35F); + GlStateManager.translate(-0.35F, 0.35F, 0.15F); + renderItem(); + break; + case DEVIL_TAIL: + GlStateManager.rotate(90F, 0F, 1F, 0F); + GlStateManager.translate(0.5F, -0.75F, 0F); + renderItem(); + break; + case KAMUI_EYE: // DON'T LOSE YOUR WAAAAAAAAY + scale(0.9F); + GlStateManager.translate(0.9F, 0.35F, 0F); + renderItem(); + GlStateManager.translate(-1.3F, -0.5F, 0.5F); + GlStateManager.rotate(180F, 0F, 0F, 1F); + GlStateManager.rotate(180F, 1F, 0F, 0F); + renderKamuiBlack(); + break; + case FOUR_LEAF_CLOVER: + scale(0.5F); + GlStateManager.translate(0.35F, 0.3F, -0.075F); + renderItem(); + break; + case BOTANIST_EMBLEM: + scale(0.5F); + GlStateManager.translate(0F, -0.75F, 0F); + renderItem(); + break; + case LUSITANIC_SHIELD: + GlStateManager.rotate(180F, 0F, 1F, 0F); + GlStateManager.translate(0.035F, -0.2F, 0.55F); + GlStateManager.rotate(8F, 0F, 0F, 1F); + renderItem(); + break; } } } - public void faceTranslate() { - GL11.glRotatef(90F, 0F, 1F, 0F); - GL11.glRotatef(180F, 1F, 0F, 0F); - GL11.glTranslatef(-0.4F, 0.1F, -0.25F); - } - - public void chestTranslate() { - GL11.glRotatef(180F, 1F, 0F, 0F); - GL11.glTranslatef(-0.5F, -0.7F, 0.15F); - } - public void scale(float f) { - GL11.glScalef(f, f, f); + GlStateManager.scale(f, f, f); } - public void renderIcon(int i) { - IIcon icon = icons[i]; - float f = icon.getMinU(); - float f1 = icon.getMaxU(); - float f2 = icon.getMinV(); - float f3 = icon.getMaxV(); - ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F); + public void renderItem() { + GlStateManager.pushMatrix(); + Minecraft.getMinecraft().getRenderItem().renderItem(renderStack, ItemCameraTransforms.TransformType.NONE); + GlStateManager.popMatrix(); } + + public void renderKamuiBlack() { + + // Modified copy of RenderItem.renderItem(stack, transformtype) + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + Minecraft.getMinecraft().renderEngine.getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE).setBlurMipmap(false, false); + + IBakedModel model = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getItemModel(renderStack); + + GlStateManager.enableRescaleNormal(); + GlStateManager.alphaFunc(516, 0.1F); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GlStateManager.pushMatrix(); + model = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(model, ItemCameraTransforms.TransformType.NONE, false); + + this.renderModel(model, renderStack, 0xFF00004C); + + GlStateManager.cullFace(GlStateManager.CullFace.BACK); + GlStateManager.popMatrix(); + GlStateManager.disableRescaleNormal(); + GlStateManager.disableBlend(); + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + Minecraft.getMinecraft().renderEngine.getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE).restoreLastBlurMipmap(); + } + + // Adapted from RenderItem.renderModel(model, stack), added extra color param + private void renderModel(IBakedModel model, ItemStack stack, int color) { + Tessellator tessellator = Tessellator.getInstance(); + VertexBuffer worldrenderer = tessellator.getBuffer(); + worldrenderer.begin(7, DefaultVertexFormats.ITEM); + + for (EnumFacing enumfacing : EnumFacing.values()) + { + this.renderQuads(worldrenderer, model.getQuads(null, enumfacing, 0), color, stack); + } + + this.renderQuads(worldrenderer, model.getQuads(null, null, 0), color, stack); + tessellator.draw(); + } + + // Copy of RenderItem.renderQuads + private void renderQuads(VertexBuffer renderer, List quads, int color, ItemStack stack) + { + boolean flag = color == -1 && stack != null; + int i = 0; + + for (int j = quads.size(); i < j; ++i) + { + BakedQuad bakedquad = quads.get(i); + int k = color; + + if (flag && bakedquad.hasTintIndex()) + { + k = Minecraft.getMinecraft().getItemColors().getColorFromItemstack(stack, bakedquad.getTintIndex()); + + if (EntityRenderer.anaglyphEnable) + { + k = TextureUtil.anaglyphColor(k); + } + + k = k | -16777216; + } + + net.minecraftforge.client.model.pipeline.LightUtil.renderQuadColor(renderer, bakedquad, k); + } + } + } diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBaubleModifier.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBaubleModifier.java index d920e453e..c0e27d830 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBaubleModifier.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBaubleModifier.java @@ -10,16 +10,15 @@ */ package vazkii.botania.common.item.equipment.bauble; +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Multimap; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.item.ItemStack; -import com.google.common.collect.HashMultimap; -import com.google.common.collect.Multimap; - public abstract class ItemBaubleModifier extends ItemBauble { - Multimap attributes = HashMultimap.create(); + final Multimap attributes = HashMultimap.create(); public ItemBaubleModifier(String name) { super(name); diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBloodPendant.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBloodPendant.java index 5a7dcd66b..34b82401b 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBloodPendant.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBloodPendant.java @@ -10,29 +10,26 @@ */ package vazkii.botania.common.item.equipment.bauble; -import java.awt.Color; -import java.util.List; - +import baubles.api.BaubleType; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.resources.I18n; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.MobEffects; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; -import net.minecraftforge.client.event.RenderPlayerEvent; - +import net.minecraft.util.text.TextFormatting; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import org.lwjgl.opengl.GL11; - import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.brew.Brew; import vazkii.botania.api.brew.IBrewContainer; @@ -40,25 +37,27 @@ import vazkii.botania.api.brew.IBrewItem; import vazkii.botania.api.item.IBaubleRender; import vazkii.botania.api.mana.IManaUsingItem; import vazkii.botania.api.mana.ManaItemHandler; -import vazkii.botania.client.core.handler.ClientTickHandler; +import vazkii.botania.client.core.handler.MiscellaneousIcons; import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.lib.LibItemNames; -import baubles.api.BaubleType; + +import javax.annotation.Nonnull; +import java.awt.*; +import java.util.List; public class ItemBloodPendant extends ItemBauble implements IBrewContainer, IBrewItem, IManaUsingItem, IBaubleRender { private static final String TAG_BREW_KEY = "brewKey"; - IIcon[] icons; - public ItemBloodPendant() { super(LibItemNames.BLOOD_PENDANT); setMaxStackSize(1); } @Override - public void getSubItems(Item item, CreativeTabs tab, List list) { + @SideOnly(Side.CLIENT) + public void getSubItems(@Nonnull Item item, CreativeTabs tab, List list) { super.getSubItems(item, tab, list); for(String s : BotaniaAPI.brewMap.keySet()) { ItemStack brewStack = getItemForBrew(BotaniaAPI.brewMap.get(s), new ItemStack(this)); @@ -67,57 +66,21 @@ public class ItemBloodPendant extends ItemBauble implements IBrewContainer, IBre } } + @SideOnly(Side.CLIENT) @Override - public void registerIcons(IIconRegister par1IconRegister) { - icons = new IIcon[4]; - for(int i = 0; i < 4; i++) - icons[i] = IconHelper.forItem(par1IconRegister, this, i); - } - - @Override - public boolean requiresMultipleRenderPasses() { - return true; - } - - @Override - public IIcon getIcon(ItemStack stack, int pass) { - return icons[pass]; - } - - @Override - public int getColorFromItemStack(ItemStack stack, int pass) { - if(pass == 0) - return 0xFFFFFF; - - Brew brew = getBrew(stack); - if(brew == BotaniaAPI.fallbackBrew) - return 0xC6000E; - - Color color = new Color(brew.getColor(stack)); - int add = (int) (Math.sin(ClientTickHandler.ticksInGame * 0.2) * 24); - - int r = Math.max(0, Math.min(255, color.getRed() + add)); - int g = Math.max(0, Math.min(255, color.getGreen() + add)); - int b = Math.max(0, Math.min(255, color.getBlue() + add)); - - return r << 16 | g << 8 | b; - } - - @Override - public void addHiddenTooltip(ItemStack stack, EntityPlayer player, List list, boolean adv) { + public void addHiddenTooltip(ItemStack stack, EntityPlayer player, List list, boolean adv) { super.addHiddenTooltip(stack, player, list, adv); Brew brew = getBrew(stack); if(brew == BotaniaAPI.fallbackBrew) { - addStringToTooltip(EnumChatFormatting.LIGHT_PURPLE + StatCollector.translateToLocal("botaniamisc.notInfused"), list); + addStringToTooltip(TextFormatting.LIGHT_PURPLE + I18n.format("botaniamisc.notInfused"), list); return; } - addStringToTooltip(EnumChatFormatting.LIGHT_PURPLE + String.format(StatCollector.translateToLocal("botaniamisc.brewOf"), StatCollector.translateToLocal(brew.getUnlocalizedName(stack))), list); + addStringToTooltip(TextFormatting.LIGHT_PURPLE + I18n.format("botaniamisc.brewOf", I18n.format(brew.getUnlocalizedName(stack))), list); for(PotionEffect effect : brew.getPotionEffects(stack)) { - Potion potion = Potion.potionTypes[effect.getPotionID()]; - EnumChatFormatting format = potion.isBadEffect() ? EnumChatFormatting.RED : EnumChatFormatting.GRAY; - addStringToTooltip(" " + format + StatCollector.translateToLocal(effect.getEffectName()) + (effect.getAmplifier() == 0 ? "" : " " + StatCollector.translateToLocal("botania.roman" + (effect.getAmplifier() + 1))), list); + TextFormatting format = effect.getPotion().isBadEffect() ? TextFormatting.RED : TextFormatting.GRAY; + addStringToTooltip(" " + format + I18n.format(effect.getEffectName()) + (effect.getAmplifier() == 0 ? "" : " " + I18n.format("botania.roman" + (effect.getAmplifier() + 1))), list); } } @@ -135,10 +98,10 @@ public class ItemBloodPendant extends ItemBauble implements IBrewContainer, IBre float cost = (float) brew.getManaCost(stack) / effect.getDuration() / (1 + effect.getAmplifier()) * 2.5F; boolean doRand = cost < 1; if(ManaItemHandler.requestManaExact(stack, eplayer, (int) Math.ceil(cost), false)) { - PotionEffect currentEffect = player.getActivePotionEffect(Potion.potionTypes[effect.getPotionID()]); - boolean nightVision = effect.getPotionID() == Potion.nightVision.id; + PotionEffect currentEffect = player.getActivePotionEffect(effect.getPotion()); + boolean nightVision = effect.getPotion() == MobEffects.NIGHT_VISION; if(currentEffect == null || currentEffect.getDuration() < (nightVision ? 205 : 3)) { - PotionEffect applyEffect = new PotionEffect(effect.getPotionID(), nightVision ? 285 : 80, effect.getAmplifier(), true); + PotionEffect applyEffect = new PotionEffect(effect.getPotion(), nightVision ? 285 : 80, effect.getAmplifier(), true, true); player.addPotionEffect(applyEffect); } @@ -164,7 +127,7 @@ public class ItemBloodPendant extends ItemBauble implements IBrewContainer, IBre @Override public ItemStack getItemForBrew(Brew brew, ItemStack stack) { - if(!brew.canInfuseBloodPendant() || brew.getPotionEffects(stack).size() != 1 || Potion.potionTypes[brew.getPotionEffects(stack).get(0).getPotionID()].isInstant()) + if(!brew.canInfuseBloodPendant() || brew.getPotionEffects(stack).size() != 1 || brew.getPotionEffects(stack).get(0).getPotion().isInstant()) return null; ItemStack brewStack = new ItemStack(this); @@ -183,30 +146,31 @@ public class ItemBloodPendant extends ItemBauble implements IBrewContainer, IBre } @Override - public void onPlayerBaubleRender(ItemStack stack, RenderPlayerEvent event, RenderType type) { + @SideOnly(Side.CLIENT) + public void onPlayerBaubleRender(ItemStack stack, EntityPlayer player, RenderType type, float partialTicks) { if(type == RenderType.BODY) { - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); - Helper.rotateIfSneaking(event.entityPlayer); - boolean armor = event.entityPlayer.getCurrentArmor(2) != null; - GL11.glRotatef(180F, 1F, 0F, 0F); - GL11.glTranslatef(-0.26F, -0.4F, armor ? 0.2F : 0.15F); - GL11.glScalef(0.5F, 0.5F, 0.5F); + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + Helper.rotateIfSneaking(player); + boolean armor = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST) != null; + GlStateManager.rotate(180F, 1F, 0F, 0F); + GlStateManager.translate(-0.26F, -0.4F, armor ? 0.2F : 0.15F); + GlStateManager.scale(0.5F, 0.5F, 0.5F); - for(int i = 2; i < 4; i++) { - IIcon icon = icons[i]; + for(TextureAtlasSprite icon : new TextureAtlasSprite[] { MiscellaneousIcons.INSTANCE.bloodPendantChain, MiscellaneousIcons.INSTANCE.bloodPendantGem }) { float f = icon.getMinU(); float f1 = icon.getMaxU(); float f2 = icon.getMinV(); float f3 = icon.getMaxV(); - ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 32F); + IconHelper.renderIconIn3D(Tessellator.getInstance(), f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 32F); - Color color = new Color(getColorFromItemStack(stack, 1)); + Color color = new Color(Minecraft.getMinecraft().getItemColors().getColorFromItemstack(stack, 1)); GL11.glColor3ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue()); int light = 15728880; int lightmapX = light % 65536; int lightmapY = light / 65536; OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapX, lightmapY); } + GL11.glColor3ub(((byte) 255), ((byte) 255), ((byte) 255)); } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemDivaCharm.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemDivaCharm.java index f0a21d180..5ec2a86dd 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemDivaCharm.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemDivaCharm.java @@ -10,37 +10,37 @@ */ package vazkii.botania.common.item.equipment.bauble; -import java.util.List; - +import baubles.api.BaubleType; +import baubles.common.lib.PlayerHandler; +import com.google.common.base.Predicates; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.ItemRenderer; -import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.monster.IMob; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraftforge.client.event.RenderPlayerEvent; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.AxisAlignedBB; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.living.LivingHurtEvent; - -import org.lwjgl.opengl.GL11; - +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.relauncher.ReflectionHelper; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.item.IBaubleRender; import vazkii.botania.api.mana.IManaUsingItem; import vazkii.botania.api.mana.ManaItemHandler; +import vazkii.botania.api.sound.BotaniaSoundEvents; import vazkii.botania.common.Botania; import vazkii.botania.common.block.subtile.functional.SubTileHeiseiDream; import vazkii.botania.common.lib.LibItemNames; import vazkii.botania.common.lib.LibObfuscation; -import baubles.api.BaubleType; -import baubles.common.lib.PlayerHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.ReflectionHelper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public class ItemDivaCharm extends ItemBauble implements IManaUsingItem, IBaubleRender { @@ -51,32 +51,32 @@ public class ItemDivaCharm extends ItemBauble implements IManaUsingItem, IBauble @SubscribeEvent public void onEntityDamaged(LivingHurtEvent event) { - if(event.source.getEntity() instanceof EntityPlayer && event.entityLiving instanceof EntityLiving && !event.entityLiving.worldObj.isRemote && Math.random() < 0.6F) { - EntityPlayer player = (EntityPlayer) event.source.getEntity(); + if(event.getSource().getEntity() instanceof EntityPlayer && event.getEntityLiving() instanceof EntityLiving && !event.getEntityLiving().worldObj.isRemote && Math.random() < 0.6F) { + EntityPlayer player = (EntityPlayer) event.getSource().getEntity(); ItemStack amulet = PlayerHandler.getPlayerBaubles(player).getStackInSlot(0); if(amulet != null && amulet.getItem() == this) { final int cost = 250; if(ManaItemHandler.requestManaExact(amulet, player, cost, false)) { final int range = 20; - List mobs = player.worldObj.getEntitiesWithinAABB(IMob.class, AxisAlignedBB.getBoundingBox(event.entity.posX - range, event.entity.posY - range, event.entity.posZ - range, event.entity.posX + range, event.entity.posY + range, event.entity.posZ + range)); + List mobs = player.worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(event.getEntityLiving().posX - range, event.getEntityLiving().posY - range, event.getEntityLiving().posZ - range, event.getEntityLiving().posX + range, event.getEntityLiving().posY + range, event.getEntityLiving().posZ + range), Predicates.instanceOf(IMob.class)); if(mobs.size() > 1) { - if(SubTileHeiseiDream.brainwashEntity((EntityLiving) event.entityLiving, mobs)) { - if(event.entityLiving instanceof EntityCreeper) - ReflectionHelper.setPrivateValue(EntityCreeper.class, (EntityCreeper) event.entityLiving, 2, LibObfuscation.TIME_SINCE_IGNITED); - event.entityLiving.heal(event.entityLiving.getMaxHealth()); - if(event.entityLiving.isDead) - event.entityLiving.isDead = false; + if(SubTileHeiseiDream.brainwashEntity((EntityLiving) event.getEntityLiving(), ((List) mobs))) { + if(event.getEntityLiving() instanceof EntityCreeper) + ReflectionHelper.setPrivateValue(EntityCreeper.class, (EntityCreeper) event.getEntityLiving(), 2, LibObfuscation.TIME_SINCE_IGNITED); + event.getEntityLiving().heal(event.getEntityLiving().getMaxHealth()); + if(event.getEntityLiving().isDead) + event.getEntityLiving().isDead = false; ManaItemHandler.requestManaExact(amulet, player, cost, true); - player.worldObj.playSoundAtEntity(player, "botania:divaCharm", 1F, 1F); + player.worldObj.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.divaCharm, SoundCategory.PLAYERS, 1F, 1F); - double x = event.entityLiving.posX; - double y = event.entityLiving.posY; - double z = event.entityLiving.posZ; + double x = event.getEntityLiving().posX; + double y = event.getEntityLiving().posY; + double z = event.getEntityLiving().posZ; for(int i = 0; i < 50; i++) - Botania.proxy.sparkleFX(event.entityLiving.worldObj, x + Math.random() * event.entityLiving.width, y + Math.random() * event.entityLiving.height, z + Math.random() * event.entityLiving.width, 1F, 1F, 0.25F, 1F, 3); + Botania.proxy.sparkleFX(x + Math.random() * event.getEntityLiving().width, y + Math.random() * event.getEntityLiving().height, z + Math.random() * event.getEntityLiving().width, 1F, 1F, 0.25F, 1F, 3); } } } @@ -96,20 +96,15 @@ public class ItemDivaCharm extends ItemBauble implements IManaUsingItem, IBauble @Override @SideOnly(Side.CLIENT) - public void onPlayerBaubleRender(ItemStack stack, RenderPlayerEvent event, RenderType type) { + public void onPlayerBaubleRender(ItemStack stack, EntityPlayer player, RenderType type, float partialTicks) { if(type == RenderType.HEAD) { - float f = itemIcon.getMinU(); - float f1 = itemIcon.getMaxU(); - float f2 = itemIcon.getMinV(); - float f3 = itemIcon.getMaxV(); - boolean armor = event.entityPlayer.getCurrentArmor(3) != null; - Helper.translateToHeadLevel(event.entityPlayer); - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); - GL11.glRotatef(90F, 0F, 1F, 0F); - GL11.glRotatef(180F, 1F, 0F, 0F); - GL11.glTranslatef(-0.4F, 0.1F, armor ? -0.35F : -0.3F); - GL11.glScalef(0.5F, 0.5F, 0.5F); - ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, itemIcon.getIconWidth(), itemIcon.getIconHeight(), 1F / 16F); + Helper.translateToHeadLevel(player); + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + GlStateManager.scale(0.8, 0.8, 0.8); + GlStateManager.rotate(-90, 0, 1, 0); + GlStateManager.rotate(180, 1, 0, 0); + GlStateManager.translate(0.1625, -1.625, 0.40); + Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(this, 1), ItemCameraTransforms.TransformType.GROUND); } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemFlightTiara.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemFlightTiara.java index af3b711b4..c63f591b2 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemFlightTiara.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemFlightTiara.java @@ -10,22 +10,18 @@ */ package vazkii.botania.common.item.equipment.bauble; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.security.SecureRandom; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.adapters.HexBinaryAdapter; - +import baubles.api.BaubleType; +import baubles.common.lib.PlayerHandler; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.resources.I18n; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -34,19 +30,22 @@ import net.minecraft.inventory.IInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.stats.Achievement; -import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; -import net.minecraftforge.client.event.RenderPlayerEvent; +import net.minecraft.util.SoundCategory; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; - +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.PlayerEvent; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import org.lwjgl.opengl.GL11; - import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.item.IBaubleRender; import vazkii.botania.api.mana.IManaUsingItem; import vazkii.botania.api.mana.ManaItemHandler; +import vazkii.botania.api.sound.BotaniaSoundEvents; +import vazkii.botania.client.core.handler.MiscellaneousIcons; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.client.core.helper.RenderHelper; import vazkii.botania.client.core.helper.ShaderHelper; @@ -59,18 +58,19 @@ import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.core.helper.Vector3; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.lib.LibItemNames; -import baubles.api.BaubleType; -import baubles.common.lib.PlayerHandler; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import javax.annotation.Nonnull; +import javax.xml.bind.annotation.adapters.HexBinaryAdapter; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.security.SecureRandom; +import java.util.ArrayList; +import java.util.List; public class ItemFlightTiara extends ItemBauble implements IManaUsingItem, IBaubleRender, ICraftAchievement { - private static ResourceLocation textureHud = new ResourceLocation(LibResources.GUI_HUD_ICONS); - private static ResourceLocation textureHalo = new ResourceLocation(LibResources.MISC_HALO); + private static final ResourceLocation textureHud = new ResourceLocation(LibResources.GUI_HUD_ICONS); + private static final ResourceLocation textureHalo = new ResourceLocation(LibResources.MISC_HALO); private static final String TAG_FLYING = "flying"; private static final String TAG_TIME_LEFT = "timeLeft"; @@ -78,19 +78,17 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem, IBaub private static final String TAG_DASH_COOLDOWN = "dashCooldown"; private static final String TAG_IS_SPRINTING = "isSprinting"; - public static List playersWithFlight = new ArrayList(); + public static final List playersWithFlight = new ArrayList(); private static final int COST = 35; private static final int COST_OVERKILL = COST * 3; private static final int MAX_FLY_TIME = 1200; - public static IIcon[] wingIcons; private static final int SUBTYPES = 8; - private static final int WING_TYPES = 9; + public static final int WING_TYPES = 9; public ItemFlightTiara() { super(LibItemNames.FLIGHT_TIARA); MinecraftForge.EVENT_BUS.register(this); - FMLCommonHandler.instance().bus().register(this); setHasSubtypes(true); } @@ -101,23 +99,16 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem, IBaub @Override @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) { - itemIcon = IconHelper.forItem(par1IconRegister, this, 0); - wingIcons = new IIcon[WING_TYPES]; - for(int i = 0; i < WING_TYPES; i++) - wingIcons[i] = IconHelper.forItem(par1IconRegister, this, i + 1); - } - - @Override - public void getSubItems(Item item, CreativeTabs tab, List list) { + public void getSubItems(@Nonnull Item item, CreativeTabs tab, List list) { for(int i = 0; i < SUBTYPES + 1; i++) list.add(new ItemStack(item, 1, i)); } + @SideOnly(Side.CLIENT) @Override - public void addHiddenTooltip(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { - super.addHiddenTooltip(par1ItemStack, par2EntityPlayer, par3List, par4); - par3List.add(StatCollector.translateToLocal("botania.wings" + par1ItemStack.getItemDamage())); + public void addHiddenTooltip(ItemStack par1ItemStack, EntityPlayer player, List stacks, boolean par4) { + super.addHiddenTooltip(par1ItemStack, player, stacks, par4); + stacks.add(I18n.format("botania.wings" + par1ItemStack.getItemDamage())); } @Override @@ -142,7 +133,7 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem, IBaub // Might as well be called sugar given it's not secure at all :D String salt(String str) { - str = str += "wowsuchsaltmuchsecurityverywow"; + str = str + "wowsuchsaltmuchsecurityverywow"; SecureRandom rand = new SecureRandom(str.getBytes()); int l = str.length(); int steps = rand.nextInt(l); @@ -175,9 +166,7 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem, IBaub int time = ItemNBTHelper.getInt(stack, TAG_TIME_LEFT, MAX_FLY_TIME); int newTime = time; - Vector3 look = new Vector3(p.getLookVec()); - look.y = 0; - look.normalize(); + Vector3 look = new Vector3(p.getLookVec()).multiply(1, 0, 1).normalize(); if(flying) { if(time > 0 && !ItemNBTHelper.getBoolean(stack, TAG_INFINITE_FLIGHT, false)) @@ -187,11 +176,11 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem, IBaub if(!wasSprting && isSprinting && cooldown == 0) { p.motionX += look.x; p.motionZ += look.z; - p.worldObj.playSoundAtEntity(p, "botania:dash", 1F, 1F); + p.worldObj.playSound(null, p.posX, p.posY, p.posZ, BotaniaSoundEvents.dash, SoundCategory.PLAYERS, 1F, 1F); ItemNBTHelper.setInt(stack, TAG_DASH_COOLDOWN, maxCd); } else if(cooldown > 0) { if(maxCd - cooldown < 2) - player.moveFlying(0F, 1F, 5F); + player.moveRelative(0F, 1F, 5F); else if(maxCd - cooldown < 10) player.setSprinting(false); ItemNBTHelper.setInt(stack, TAG_DASH_COOLDOWN, cooldown - 2); @@ -220,8 +209,8 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem, IBaub @SubscribeEvent public void updatePlayerFlyStatus(LivingUpdateEvent event) { - if(event.entityLiving instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer) event.entityLiving; + if(event.getEntityLiving() instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) event.getEntityLiving(); ItemStack tiara = PlayerHandler.getPlayerBaubles(player).getStackInSlot(0); int left = ItemNBTHelper.getInt(tiara, TAG_TIME_LEFT, MAX_FLY_TIME); @@ -232,9 +221,9 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem, IBaub if(!player.worldObj.isRemote) ManaItemHandler.requestManaExact(tiara, player, getCost(tiara, left), true); else if(Math.abs(player.motionX) > 0.1 || Math.abs(player.motionZ) > 0.1) { - double x = event.entityLiving.posX - 0.5; - double y = event.entityLiving.posY - 1.7; - double z = event.entityLiving.posZ - 0.5; + double x = event.getEntityLiving().posX - 0.5; + double y = event.getEntityLiving().posY - 0.5; + double z = event.getEntityLiving().posZ - 0.5; player.getGameProfile().getName(); float r = 1F; @@ -290,11 +279,11 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem, IBaub } for(int i = 0; i < 2; i++) - Botania.proxy.sparkleFX(event.entityLiving.worldObj, x + Math.random() * event.entityLiving.width, y + Math.random() * 0.4, z + Math.random() * event.entityLiving.width, r, g, b, 2F * (float) Math.random(), 20); + Botania.proxy.sparkleFX(x + Math.random() * event.getEntityLiving().width, y + Math.random() * 0.4, z + Math.random() * event.getEntityLiving().width, r, g, b, 2F * (float) Math.random(), 20); } } } else { - if(!player.capabilities.isCreativeMode) { + if(!player.isSpectator() && !player.capabilities.isCreativeMode) { player.capabilities.allowFlying = false; player.capabilities.isFlying = false; player.capabilities.disableDamage = false; @@ -324,7 +313,7 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem, IBaub if(armor != null && armor.getItem() == this) { int left = ItemNBTHelper.getInt(armor, TAG_TIME_LEFT, MAX_FLY_TIME); boolean flying = ItemNBTHelper.getBoolean(armor, TAG_FLYING, false); - return (left > (flying ? 0 : MAX_FLY_TIME / 10) || player.inventory.hasItem(ModItems.flugelEye)) && ManaItemHandler.requestManaExact(armor, player, getCost(armor, left), false); + return (left > (flying ? 0 : MAX_FLY_TIME / 10) || player.inventory.hasItemStack(new ItemStack(ModItems.flugelEye))) && ManaItemHandler.requestManaExact(armor, player, getCost(armor, left), false); } return false; @@ -341,26 +330,26 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem, IBaub @Override @SideOnly(Side.CLIENT) - public void onPlayerBaubleRender(ItemStack stack, RenderPlayerEvent event, RenderType type) { + public void onPlayerBaubleRender(ItemStack stack, EntityPlayer player, RenderType type, float partialTicks) { int meta = stack.getItemDamage(); if(type == RenderType.BODY) { - if(meta > 0 && meta <= ItemFlightTiara.wingIcons.length) { - IIcon icon = ItemFlightTiara.wingIcons[meta - 1]; - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); + if(meta > 0 && meta <= MiscellaneousIcons.INSTANCE.tiaraWingIcons.length) { + TextureAtlasSprite icon = MiscellaneousIcons.INSTANCE.tiaraWingIcons[meta - 1]; + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); - boolean flying = event.entityPlayer.capabilities.isFlying; + boolean flying = player.capabilities.isFlying; float rz = 120F; - float rx = 20F + (float) ((Math.sin((double) (event.entityPlayer.ticksExisted + event.partialRenderTick) * (flying ? 0.4F : 0.2F)) + 0.5F) * (flying ? 30F : 5F)); + float rx = 20F + (float) ((Math.sin((double) (player.ticksExisted + partialTicks) * (flying ? 0.4F : 0.2F)) + 0.5F) * (flying ? 30F : 5F)); float ry = 0F; float h = 0.2F; float i = 0.15F; float s = 1F; - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.pushMatrix(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.color(1F, 1F, 1F, 1F); int light = 15728880; int lightmapX = light % 65536; @@ -385,7 +374,7 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem, IBaub rz = 180F; h = 0.5F; rx = 20F; - ry = -(float) ((Math.sin((double) (event.entityPlayer.ticksExisted + event.partialRenderTick) * (flying ? 0.4F : 0.2F)) + 0.6F) * (flying ? 30F : 5F)); + ry = -(float) ((Math.sin((double) (player.ticksExisted + partialTicks) * (flying ? 0.4F : 0.2F)) + 0.6F) * (flying ? 30F : 5F)); OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapX, lightmapY); break; } @@ -406,7 +395,7 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem, IBaub rz = 0F; ry = -rx; rx = 0F; - GL11.glColor4f(1F, 1F, 1F, 0.5F + (float) Math.cos((double) (event.entityPlayer.ticksExisted + event.partialRenderTick) * 0.3F) * 0.2F); + GlStateManager.color(1F, 1F, 1F, 0.5F + (float) Math.cos((double) (player.ticksExisted + partialTicks) * 0.3F) * 0.2F); break; } case 8 : { // Mega Ultra Chicken @@ -419,7 +408,7 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem, IBaub rx = 0F; s = 1.5F; h = 1.2F; - GL11.glColor4f(1F, 1F, 1F, 0.5F + (flying ? (float) Math.cos((double) (event.entityPlayer.ticksExisted + event.partialRenderTick) * 0.3F) * 0.25F + 0.25F : 0F)); + GlStateManager.color(1F, 1F, 1F, 0.5F + (flying ? (float) Math.cos((double) (player.ticksExisted + partialTicks) * 0.3F) * 0.25F + 0.25F : 0F)); } } @@ -429,73 +418,74 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem, IBaub float f3 = icon.getMaxV(); float sr = 1F / s; - Helper.rotateIfSneaking(event.entityPlayer); + Helper.rotateIfSneaking(player); - GL11.glTranslatef(0F, h, i); + GlStateManager.translate(0F, h, i); - GL11.glRotatef(rz, 0F, 0F, 1F); - GL11.glRotatef(rx, 1F, 0F, 0F); - GL11.glRotatef(ry, 0F, 1F, 0F); - GL11.glScalef(s, s, s); - ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 32F); - GL11.glScalef(sr, sr, sr); - GL11.glRotatef(-ry, 0F, 1F, 0F); - GL11.glRotatef(-rx, 1F, 0F, 0F); - GL11.glRotatef(-rz, 0F, 0F, 1F); + GlStateManager.rotate(rz, 0F, 0F, 1F); + GlStateManager.rotate(rx, 1F, 0F, 0F); + GlStateManager.rotate(ry, 0F, 1F, 0F); + GlStateManager.scale(s, s, s); + IconHelper.renderIconIn3D(Tessellator.getInstance(), f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 32F); + GlStateManager.scale(sr, sr, sr); + GlStateManager.rotate(-ry, 0F, 1F, 0F); + GlStateManager.rotate(-rx, 1F, 0F, 0F); + GlStateManager.rotate(-rz, 0F, 0F, 1F); if(meta != 2) { // Sephiroth - GL11.glScalef(-1F, 1F, 1F); - GL11.glRotatef(rz, 0F, 0F, 1F); - GL11.glRotatef(rx, 1F, 0F, 0F); - GL11.glRotatef(ry, 0F, 1F, 0F); - GL11.glScalef(s, s, s); - ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 32F); - GL11.glScalef(sr, sr, sr); - GL11.glRotatef(-ry, 1F, 0F, 0F); - GL11.glRotatef(-rx, 1F, 0F, 0F); - GL11.glRotatef(-rz, 0F, 0F, 1F); + GlStateManager.scale(-1F, 1F, 1F); + GlStateManager.rotate(rz, 0F, 0F, 1F); + GlStateManager.rotate(rx, 1F, 0F, 0F); + GlStateManager.rotate(ry, 0F, 1F, 0F); + GlStateManager.scale(s, s, s); + IconHelper.renderIconIn3D(Tessellator.getInstance(), f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 32F); + GlStateManager.scale(sr, sr, sr); + GlStateManager.rotate(-ry, 1F, 0F, 0F); + GlStateManager.rotate(-rx, 1F, 0F, 0F); + GlStateManager.rotate(-rz, 0F, 0F, 1F); } - GL11.glColor3f(1F, 1F, 1F); - GL11.glPopMatrix(); + GlStateManager.color(1F, 1F, 1F); + GlStateManager.popMatrix(); } } else if(meta == 1) // Jibril's Halo - renderHalo(event.entityPlayer, event.partialRenderTick); + renderHalo(player, partialTicks); } @SideOnly(Side.CLIENT) public static void renderHalo(EntityPlayer player, float partialTicks) { - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glShadeModel(GL11.GL_SMOOTH); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.shadeModel(GL11.GL_SMOOTH); OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240, 240); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_CULL_FACE); - GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.disableLighting(); + GlStateManager.disableCull(); + GlStateManager.color(1F, 1F, 1F, 1F); Minecraft.getMinecraft().renderEngine.bindTexture(textureHalo); if(player != null) Helper.translateToHeadLevel(player); - GL11.glRotated(30, 1, 0, -1); - GL11.glTranslatef(-0.1F, -0.5F, -0.1F); + GlStateManager.translate(0, 1.5F, 0); + GlStateManager.rotate(30, 1, 0, -1); + GlStateManager.translate(-0.1F, -0.5F, -0.1F); if(player != null) - GL11.glRotatef(player.ticksExisted + partialTicks, 0, 1, 0); - else GL11.glRotatef(Botania.proxy.getWorldElapsedTicks(), 0, 1, 0); + GlStateManager.rotate(player.ticksExisted + partialTicks, 0, 1, 0); + else GlStateManager.rotate(Botania.proxy.getWorldElapsedTicks(), 0, 1, 0); - Tessellator tes = Tessellator.instance; + Tessellator tes = Tessellator.getInstance(); ShaderHelper.useShader(ShaderHelper.halo); - tes.startDrawingQuads(); - tes.addVertexWithUV(-0.75, 0, -0.75, 0, 0); - tes.addVertexWithUV(-0.75, 0, 0.75, 0, 1); - tes.addVertexWithUV(0.75, 0, 0.75, 1, 1); - tes.addVertexWithUV(0.75, 0, -0.75, 1, 0); + tes.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); + tes.getBuffer().pos(-0.75, 0, -0.75).tex(0, 0).endVertex(); + tes.getBuffer().pos(-0.75, 0, 0.75).tex(0, 1).endVertex(); + tes.getBuffer().pos(0.75, 0, 0.75).tex(1, 1).endVertex(); + tes.getBuffer().pos(0.75, 0, -0.75).tex(1, 0).endVertex(); tes.draw(); ShaderHelper.releaseShader(); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glShadeModel(GL11.GL_FLAT); - GL11.glEnable(GL11.GL_CULL_FACE); + GlStateManager.enableLighting(); + GlStateManager.shadeModel(GL11.GL_FLAT); + GlStateManager.enableCull(); } @SideOnly(Side.CLIENT) @@ -521,27 +511,27 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem, IBaub float trans = 1F; if(i == segs - 1) { trans = (float) last / (float) segTime; - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glDisable(GL11.GL_ALPHA_TEST); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.disableAlpha(); } - GL11.glColor4f(1F, 1F, 1F, trans); + GlStateManager.color(1F, 1F, 1F, trans); RenderHelper.drawTexturedModalRect(x, y, 0, u, v, 9, 9); x += 8; } if(player.capabilities.isFlying) { int width = ItemNBTHelper.getInt(stack, TAG_DASH_COOLDOWN, 0); - GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.color(1F, 1F, 1F, 1F); if(width > 0) Gui.drawRect(xo, y - 2, xo + 80, y - 1, 0x88000000); Gui.drawRect(xo, y - 2, xo + width, y - 1, 0xFFFFFFFF); } - GL11.glEnable(GL11.GL_ALPHA_TEST); - GL11.glColor4f(1F, 1F, 1F, 1F); - mc.renderEngine.bindTexture(Gui.icons); + GlStateManager.enableAlpha(); + GlStateManager.color(1F, 1F, 1F, 1F); + mc.renderEngine.bindTexture(Gui.ICONS); } @Override @@ -549,4 +539,10 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem, IBaub return stack.getItemDamage() == 1 ? ModAchievements.tiaraWings : null; } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerItemAllMeta(this, WING_TYPES); + } + } diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemGoldenLaurel.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemGoldenLaurel.java index 278d9e285..ff7608103 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemGoldenLaurel.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemGoldenLaurel.java @@ -10,29 +10,28 @@ */ package vazkii.botania.common.item.equipment.bauble; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.ItemRenderer; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.ChatComponentTranslation; -import net.minecraftforge.client.event.RenderPlayerEvent; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.living.LivingDeathEvent; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.api.item.IBaubleRender; -import vazkii.botania.common.lib.LibItemNames; import baubles.api.BaubleType; import baubles.common.lib.PlayerHandler; -import cpw.mods.fml.common.eventhandler.EventPriority; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.MobEffects; +import net.minecraft.inventory.EntityEquipmentSlot; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.text.TextComponentTranslation; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.living.LivingDeathEvent; +import net.minecraftforge.fml.common.eventhandler.EventPriority; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.api.item.IBaubleRender; +import vazkii.botania.api.sound.BotaniaSoundEvents; +import vazkii.botania.common.lib.LibItemNames; public class ItemGoldenLaurel extends ItemBauble implements IBaubleRender { @@ -43,16 +42,16 @@ public class ItemGoldenLaurel extends ItemBauble implements IBaubleRender { @SubscribeEvent(priority = EventPriority.HIGHEST) public void onPlayerDeath(LivingDeathEvent event) { - if(event.entity instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer) event.entity; + if(event.getEntityLiving() instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) event.getEntityLiving(); ItemStack amulet = PlayerHandler.getPlayerBaubles(player).getStackInSlot(0); if(amulet != null && amulet.getItem() == this) { event.setCanceled(true); player.setHealth(player.getMaxHealth()); - player.addPotionEffect(new PotionEffect(Potion.resistance.id, 300, 6)); - player.addChatMessage(new ChatComponentTranslation("botaniamisc.savedByLaurel")); - player.worldObj.playSoundAtEntity(player, "botania:goldenLaurel", 1F, 0.3F); + player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 300, 6)); + player.addChatMessage(new TextComponentTranslation("botaniamisc.savedByLaurel")); + player.worldObj.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.goldenLaurel, SoundCategory.PLAYERS, 1F, 0.3F); PlayerHandler.getPlayerBaubles(player).setInventorySlotContents(0, null); } } @@ -65,24 +64,20 @@ public class ItemGoldenLaurel extends ItemBauble implements IBaubleRender { @Override @SideOnly(Side.CLIENT) - public void onPlayerBaubleRender(ItemStack stack, RenderPlayerEvent event, RenderType type) { + public void onPlayerBaubleRender(ItemStack stack, EntityPlayer player, RenderType type, float partialTicks) { if(type == RenderType.HEAD) { - float f = itemIcon.getMinU(); - float f1 = itemIcon.getMaxU(); - float f2 = itemIcon.getMinV(); - float f3 = itemIcon.getMaxV(); - boolean armor = event.entityPlayer.getCurrentArmor(3) != null; - Helper.translateToHeadLevel(event.entityPlayer); - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); - GL11.glRotatef(180F, 0F, 0F, 1F); - GL11.glRotatef(90F, 0F, 1F, 0F); - GL11.glRotatef(-100F, 1F, 0F, 0F); - GL11.glTranslatef(-0.5F, -0.55F, 0.3F); + boolean armor = player.getItemStackFromSlot(EntityEquipmentSlot.HEAD) != null; + Helper.translateToHeadLevel(player); + Helper.defaultTransforms(); + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + GlStateManager.translate(0F, -3.2F, -1.825F); + GlStateManager.rotate(-90F, 0F, 1F, 0F); + GlStateManager.scale(1.625F, 1.625F, 1.625F); + GlStateManager.rotate(-80F, 1F, 0F, 0F); if(armor) { - GL11.glScalef(1.1F, 1.1F, 1F); - GL11.glTranslatef(-0.05F, -0.1F, 0F); + GlStateManager.scale(1.1F, 1.1F, 1.1F); } - ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, itemIcon.getIconWidth(), itemIcon.getIconHeight(), 1F / 32F); + Minecraft.getMinecraft().getRenderItem().renderItem(stack, ItemCameraTransforms.TransformType.NONE); } } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemHolyCloak.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemHolyCloak.java index 50776abf6..34b7600c5 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemHolyCloak.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemHolyCloak.java @@ -10,29 +10,29 @@ */ package vazkii.botania.common.item.equipment.bauble; +import baubles.api.BaubleType; +import baubles.common.container.InventoryBaubles; +import baubles.common.lib.PlayerHandler; import net.minecraft.client.Minecraft; import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderPlayerEvent; +import net.minecraft.util.SoundCategory; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.living.LivingHurtEvent; - -import org.lwjgl.opengl.GL11; - +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.item.IBaubleRender; +import vazkii.botania.api.sound.BotaniaSoundEvents; import vazkii.botania.client.lib.LibResources; import vazkii.botania.common.Botania; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.lib.LibItemNames; -import baubles.api.BaubleType; -import baubles.common.container.InventoryBaubles; -import baubles.common.lib.PlayerHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; public class ItemHolyCloak extends ItemBauble implements IBaubleRender { @@ -54,8 +54,8 @@ public class ItemHolyCloak extends ItemBauble implements IBaubleRender { @SubscribeEvent public void onPlayerDamage(LivingHurtEvent event) { - if(event.entityLiving instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer) event.entityLiving; + if(event.getEntityLiving() instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) event.getEntityLiving(); InventoryBaubles baubles = PlayerHandler.getPlayerBaubles(player); ItemStack belt = baubles.getStackInSlot(3); if(belt != null && belt.getItem() instanceof ItemHolyCloak && !isInEffect(belt)) { @@ -79,15 +79,15 @@ public class ItemHolyCloak extends ItemBauble implements IBaubleRender { } public boolean effectOnDamage(LivingHurtEvent event, EntityPlayer player, ItemStack stack) { - if(!event.source.isMagicDamage()) { + if(!event.getSource().isMagicDamage()) { event.setCanceled(true); - player.worldObj.playSoundAtEntity(player, "botania:holyCloak", 1F, 1F); + player.worldObj.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.holyCloak, SoundCategory.PLAYERS, 1F, 1F); for(int i = 0; i < 30; i++) { double x = player.posX + Math.random() * player.width * 2 - player.width; double y = player.posY + Math.random() * player.height; double z = player.posZ + Math.random() * player.width * 2 - player.width; boolean yellow = Math.random() > 0.5; - Botania.proxy.sparkleFX(player.worldObj, x, y, z, yellow ? 1F : 0.3F, yellow ? 1F : 0.3F, yellow ? 0.3F : 1F, 0.8F + (float) Math.random() * 0.4F, 3); + Botania.proxy.sparkleFX(x, y, z, yellow ? 1F : 0.3F, yellow ? 1F : 0.3F, yellow ? 0.3F : 1F, 0.8F + (float) Math.random() * 0.4F, 3); } return true; } @@ -127,15 +127,15 @@ public class ItemHolyCloak extends ItemBauble implements IBaubleRender { @Override @SideOnly(Side.CLIENT) - public void onPlayerBaubleRender(ItemStack stack, RenderPlayerEvent event, RenderType type) { + public void onPlayerBaubleRender(ItemStack stack, EntityPlayer player, RenderType type, float partialTicks) { if(type == RenderType.BODY) { Minecraft.getMinecraft().renderEngine.bindTexture(getRenderTexture()); - Helper.rotateIfSneaking(event.entityPlayer); - boolean armor = event.entityPlayer.getCurrentArmor(2) != null; - GL11.glTranslatef(0F, armor ? -0.07F : -0.01F, 0F); + Helper.rotateIfSneaking(player); + boolean armor = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST) != null; + GlStateManager.translate(0F, armor ? -0.07F : -0.01F, 0F); float s = 0.1F; - GL11.glScalef(s, s, s); + GlStateManager.scale(s, s, s); if(model == null) model = new ModelBiped(); diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemIcePendant.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemIcePendant.java index 881113eaf..dec6f32f5 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemIcePendant.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemIcePendant.java @@ -10,39 +10,27 @@ */ package vazkii.botania.common.item.equipment.bauble; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import net.minecraft.block.material.Material; +import baubles.api.BaubleType; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.enchantment.EnchantmentFrostWalker; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import net.minecraftforge.client.event.RenderPlayerEvent; - -import org.lwjgl.opengl.GL11; - +import net.minecraft.util.math.BlockPos; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.item.IBaubleRender; +import vazkii.botania.client.core.handler.MiscellaneousIcons; import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.common.lib.LibItemNames; -import baubles.api.BaubleType; public class ItemIcePendant extends ItemBauble implements IBaubleRender { - IIcon gemIcon; - public static Map> playerIceBlocks = new HashMap(); - public ItemIcePendant() { super(LibItemNames.ICE_PENDANT); } @@ -52,98 +40,36 @@ public class ItemIcePendant extends ItemBauble implements IBaubleRender { return BaubleType.AMULET; } - @Override - public void registerIcons(IIconRegister par1IconRegister) { - super.registerIcons(par1IconRegister); - gemIcon = IconHelper.forItem(par1IconRegister, this, "Gem"); - } - @Override public void onWornTick(ItemStack stack, EntityLivingBase entity) { super.onWornTick(stack, entity); - - if(entity instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer) entity; - - if(!player.worldObj.isRemote) - tickIceRemovers(player); - - if(!player.isSneaking() && !player.isInsideOfMaterial(Material.water) && !player.worldObj.isRemote) { - int x = MathHelper.floor_double(player.posX); - int y = MathHelper.floor_double(player.posY - (player.isInWater() ? 0 : 1)); - int z = MathHelper.floor_double(player.posZ); - - int range = 3; - for(int i = -range; i < range + 1; i++) - for(int j = -range; j < range + 1; j++) { - int x1 = x + i; - int z1 = z + j; - - addIceBlock(player, new ChunkCoordinates(x1, y, z1)); - } - } + if(!entity.worldObj.isRemote) { + boolean lastOnGround = entity.onGround; + entity.onGround = true; + EnchantmentFrostWalker.freezeNearby(entity, entity.worldObj, new BlockPos(entity), 8); + entity.onGround = lastOnGround; } } - private void addIceBlock(EntityPlayer player, ChunkCoordinates coords) { - String user = player.getCommandSenderName(); - if(!playerIceBlocks.containsKey(user)) - playerIceBlocks.put(user, new ArrayList()); - - List ice = playerIceBlocks.get(user); - if(player.worldObj.getBlock(coords.posX, coords.posY, coords.posZ) == Blocks.water && player.worldObj.getBlockMetadata(coords.posX, coords.posY, coords.posZ) == 0) { - player.worldObj.setBlock(coords.posX, coords.posY, coords.posZ, Blocks.ice); - - if(!player.worldObj.isRemote) - ice.add(new IceRemover(coords)); - } - } - - private void tickIceRemovers(EntityPlayer player) { - String user = player.getCommandSenderName(); - if(!playerIceBlocks.containsKey(user)) - return; - - List removers = playerIceBlocks.get(user); - for(IceRemover ice : new ArrayList(removers)) - ice.tick(player.worldObj, removers); - } - @Override - public void onPlayerBaubleRender(ItemStack stack, RenderPlayerEvent event, RenderType type) { + @SideOnly(Side.CLIENT) + public void onPlayerBaubleRender(ItemStack stack, EntityPlayer player, RenderType type, float partialTicks) { if(type == RenderType.BODY) { - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); - Helper.rotateIfSneaking(event.entityPlayer); - boolean armor = event.entityPlayer.getCurrentArmor(2) != null; - GL11.glRotatef(180F, 1F, 0F, 0F); - GL11.glTranslatef(-0.36F, -0.3F, armor ? 0.2F : 0.15F); - GL11.glRotatef(-45F, 0F, 0F, 1F); - GL11.glScalef(0.5F, 0.5F, 0.5F); + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + Helper.rotateIfSneaking(player); + boolean armor = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST) != null; + GlStateManager.rotate(180F, 1F, 0F, 0F); + GlStateManager.translate(-0.36F, -0.3F, armor ? 0.2F : 0.15F); + GlStateManager.rotate(-45F, 0F, 0F, 1F); + GlStateManager.scale(0.5F, 0.5F, 0.5F); + TextureAtlasSprite gemIcon = MiscellaneousIcons.INSTANCE.snowflakePendantGem; float f = gemIcon.getMinU(); float f1 = gemIcon.getMaxU(); float f2 = gemIcon.getMinV(); float f3 = gemIcon.getMaxV(); - ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, gemIcon.getIconWidth(), gemIcon.getIconHeight(), 1F / 32F); + IconHelper.renderIconIn3D(Tessellator.getInstance(), f1, f2, f, f3, gemIcon.getIconWidth(), gemIcon.getIconHeight(), 1F / 32F); } } - class IceRemover { - - int time = 30; - final ChunkCoordinates coords; - - public IceRemover(ChunkCoordinates coords) { - this.coords = coords; - } - - public void tick(World world, List list) { - if(world.getBlock(coords.posX, coords.posY, coords.posZ) == Blocks.ice) { - if(time-- == 0) - world.setBlock(coords.posX, coords.posY, coords.posZ, Blocks.water, 0, 1 | 2); - else return; - list.remove(this); - } - } - } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemItemFinder.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemItemFinder.java index 2acf57719..ed18bace5 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemItemFinder.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemItemFinder.java @@ -10,63 +10,57 @@ */ package vazkii.botania.common.item.equipment.bauble; -import java.util.ArrayList; -import java.util.List; - +import baubles.api.BaubleType; +import baubles.common.lib.PlayerHandler; +import baubles.common.network.PacketHandler; +import baubles.common.network.PacketSyncBauble; +import gnu.trove.list.array.TIntArrayList; +import gnu.trove.list.array.TLongArrayList; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.passive.EntityHorse; import net.minecraft.entity.passive.EntityVillager; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.AnimalChest; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.village.MerchantRecipe; -import net.minecraftforge.client.event.RenderPlayerEvent; - -import org.lwjgl.opengl.GL11; - +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import net.minecraftforge.items.CapabilityItemHandler; +import net.minecraftforge.items.IItemHandler; +import net.minecraftforge.items.wrapper.InvWrapper; import vazkii.botania.api.item.IBaubleRender; +import vazkii.botania.client.core.handler.MiscellaneousIcons; import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.common.Botania; import vazkii.botania.common.core.helper.ItemNBTHelper; +import vazkii.botania.common.core.helper.MathHelper; import vazkii.botania.common.lib.LibItemNames; -import vazkii.botania.common.lib.LibObfuscation; -import baubles.api.BaubleType; -import baubles.common.container.InventoryBaubles; -import baubles.common.lib.PlayerHandler; -import baubles.common.network.PacketHandler; -import baubles.common.network.PacketSyncBauble; -import cpw.mods.fml.relauncher.ReflectionHelper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; public class ItemItemFinder extends ItemBauble implements IBaubleRender { - IIcon gemIcon; - private static final String TAG_POSITIONS = "highlightPositions"; + private static final String TAG_POSITIONS_OLD = "highlightPositions"; + private static final String TAG_ENTITY_POSITIONS = "highlightPositionsEnt"; + private static final String TAG_BLOCK_POSITIONS = "highlightPositionsBlock1"; public ItemItemFinder() { super(LibItemNames.ITEM_FINDER); } - @Override - public void registerIcons(IIconRegister par1IconRegister) { - super.registerIcons(par1IconRegister); - gemIcon = IconHelper.forItem(par1IconRegister, this, "Gem"); - } - @Override public void onWornTick(ItemStack stack, EntityLivingBase player) { super.onWornTick(stack, player); @@ -79,128 +73,131 @@ public class ItemItemFinder extends ItemBauble implements IBaubleRender { else tickServer(stack, (EntityPlayer) player); } - public void tickClient(ItemStack stack, EntityPlayer player) { + protected void tickClient(ItemStack stack, EntityPlayer player) { if(!Botania.proxy.isTheClientPlayer(player)) return; - String pos = ItemNBTHelper.getString(stack, TAG_POSITIONS, ""); - String[] tokens = pos.split(";"); + long[] blocks = getBlockPositions(stack); + Botania.proxy.setWispFXDepthTest(false); + for(long l : blocks) { + BlockPos pos = BlockPos.fromLong(l); + float m = 0.02F; + Botania.proxy.wispFX(pos.getX() + (float) Math.random(), pos.getY() + (float) Math.random(), pos.getZ() + (float) Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), 0.15F + 0.05F * (float) Math.random(), m * (float) (Math.random() - 0.5), m * (float) (Math.random() - 0.5), m * (float) (Math.random() - 0.5)); + } - for(String token : tokens) { - if(token.isEmpty()) - continue; - - if(token.contains(",")) { - String[] tokens_ = token.split(","); - int x = Integer.parseInt(tokens_[0]); - int y = Integer.parseInt(tokens_[1]); - int z = Integer.parseInt(tokens_[2]); - float m = 0.02F; - Botania.proxy.setWispFXDepthTest(false); - Botania.proxy.wispFX(player.worldObj, x + (float) Math.random(), y + (float) Math.random(), z + (float) Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), 0.15F + 0.05F * (float) Math.random(), m * (float) (Math.random() - 0.5), m * (float) (Math.random() - 0.5), m * (float) (Math.random() - 0.5)); - } else { - int id = Integer.parseInt(token); - Entity e = player.worldObj.getEntityByID(id); - - if(e != null && Math.random() < 0.6) { - Botania.proxy.setWispFXDepthTest(Math.random() < 0.6); - Botania.proxy.wispFX(player.worldObj, e.posX + (float) (Math.random() * 0.5 - 0.25) * 0.45F, e.posY + e.height, e.posZ + (float) (Math.random() * 0.5 - 0.25) * 0.45F, (float) Math.random(), (float) Math.random(), (float) Math.random(), 0.15F + 0.05F * (float) Math.random(), -0.05F - 0.03F * (float) Math.random()); - } + int[] entities = ItemNBTHelper.getIntArray(stack, TAG_ENTITY_POSITIONS); + for(int i : entities) { + Entity e = player.worldObj.getEntityByID(i); + if(e != null && Math.random() < 0.6) { + Botania.proxy.setWispFXDepthTest(Math.random() < 0.6); + Botania.proxy.wispFX(e.posX + (float) (Math.random() * 0.5 - 0.25) * 0.45F, e.posY + e.height, e.posZ + (float) (Math.random() * 0.5 - 0.25) * 0.45F, (float) Math.random(), (float) Math.random(), (float) Math.random(), 0.15F + 0.05F * (float) Math.random(), -0.05F - 0.03F * (float) Math.random()); } } + Botania.proxy.setWispFXDepthTest(true); } - public void tickServer(ItemStack stack, EntityPlayer player) { - ItemStack pstack = player.getCurrentEquippedItem(); - StringBuilder positionsBuilder = new StringBuilder(); + protected void tickServer(ItemStack stack, EntityPlayer player) { + ItemNBTHelper.removeEntry(stack, TAG_POSITIONS_OLD); + TIntArrayList entPosBuilder = new TIntArrayList(); + TLongArrayList blockPosBuilder = new TLongArrayList(); + + scanForStack(player.getHeldItemMainhand(), player, entPosBuilder, blockPosBuilder); + scanForStack(player.getHeldItemOffhand(), player, entPosBuilder, blockPosBuilder); + + int[] currentEnts = entPosBuilder.toArray(); + long[] currentBlocks = blockPosBuilder.toArray(); + + boolean entsEqual = Arrays.equals(currentEnts, ItemNBTHelper.getIntArray(stack, TAG_ENTITY_POSITIONS)); + boolean blocksEqual = Arrays.equals(currentBlocks, getBlockPositions(stack)); + + if(!entsEqual) + ItemNBTHelper.setIntArray(stack, TAG_ENTITY_POSITIONS, currentEnts); + if(!blocksEqual) + setBlockPositions(stack, currentBlocks); + if(!entsEqual || !blocksEqual) + PacketHandler.INSTANCE.sendToAll(new PacketSyncBauble(player, 0)); + } + + private void scanForStack(ItemStack pstack, EntityPlayer player, TIntArrayList entIdBuilder, TLongArrayList blockPosBuilder) { if(pstack != null || player.isSneaking()) { int range = 24; - List entities = player.worldObj.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(player.posX - range, player.posY - range, player.posZ - range, player.posX + range, player.posY + range, player.posZ + range)); + List entities = player.worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(player.posX - range, player.posY - range, player.posZ - range, player.posX + range, player.posY + range, player.posZ + range)); for(Entity e : entities) { if(e == player) continue; + if(e.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null) && !(e instanceof EntityPlayer)) { + if(scanInventory(e.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null), pstack)) + entIdBuilder.add(e.getEntityId()); - if(e instanceof EntityItem) { + } else if(e instanceof EntityItem) { EntityItem item = (EntityItem) e; ItemStack istack = item.getEntityItem(); if(player.isSneaking() || istack.isItemEqual(pstack) && ItemStack.areItemStackTagsEqual(istack, pstack)) - positionsBuilder.append(item.getEntityId()).append(";"); + entIdBuilder.add(item.getEntityId()); } else if(e instanceof IInventory) { IInventory inv = (IInventory) e; - if(scanInventory(inv, pstack)) - positionsBuilder.append(e.getEntityId()).append(";"); - - } else if(e instanceof EntityHorse) { - EntityHorse horse = (EntityHorse) e; - AnimalChest chest = ReflectionHelper.getPrivateValue(EntityHorse.class, horse, LibObfuscation.HORSE_CHEST); - if(scanInventory(chest, pstack)) - positionsBuilder.append(horse.getEntityId()).append(";"); + if(scanInventory(new InvWrapper(inv), pstack)) + entIdBuilder.add(e.getEntityId()); } else if(e instanceof EntityPlayer) { EntityPlayer player_ = (EntityPlayer) e; - InventoryPlayer inv = player_.inventory; - InventoryBaubles binv = PlayerHandler.getPlayerBaubles(player_); - if(scanInventory(inv, pstack) || scanInventory(binv, pstack)) - positionsBuilder.append(player_.getEntityId()).append(";"); + IItemHandler playerInv = player.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null); + IItemHandler binv = new InvWrapper(PlayerHandler.getPlayerBaubles(player_)); + if(scanInventory(binv, pstack) || scanInventory(playerInv, pstack)) + entIdBuilder.add(player_.getEntityId()); } else if(e instanceof EntityVillager) { EntityVillager villager = (EntityVillager) e; ArrayList recipes = villager.getRecipes(player); if(pstack != null && recipes != null) for(MerchantRecipe recipe : recipes) - if(recipe != null && !recipe.isRecipeDisabled() && (equalStacks(pstack, recipe.getItemToBuy()) || equalStacks(pstack, recipe.getItemToSell()))) - positionsBuilder.append(villager.getEntityId()).append(";"); + if(recipe != null && !recipe.isRecipeDisabled() && (equalStacks(pstack, recipe.getItemToBuy()) || equalStacks(pstack, recipe.getItemToSell()))) { + entIdBuilder.add(villager.getEntityId()); + break; + } - } else if(e instanceof EntityLivingBase) { - EntityLivingBase living = (EntityLivingBase) e; - ItemStack estack = living.getEquipmentInSlot(0); - if(pstack != null && estack != null && equalStacks(estack, pstack)) - positionsBuilder.append(living.getEntityId()).append(";"); } } if(pstack != null) { range = 12; - int x = MathHelper.floor_double(player.posX); - int y = MathHelper.floor_double(player.posY); - int z = MathHelper.floor_double(player.posZ); - for(int i = -range; i < range + 1; i++) - for(int j = -range; j < range + 1; j++) - for(int k = -range; k < range + 1; k++) { - int xp = x + i; - int yp = y + j; - int zp = z + k; - TileEntity tile = player.worldObj.getTileEntity(xp, yp, zp); - if(tile != null && tile instanceof IInventory) { - IInventory inv = (IInventory) tile; - if(scanInventory(inv, pstack)) - positionsBuilder.append(xp).append(",").append(yp).append(",").append(zp).append(";"); + BlockPos pos = new BlockPos(player); + for(BlockPos pos_ : BlockPos.getAllInBoxMutable(pos.add(-range, -range, -range), pos.add(range + 1, range + 1, range + 1))) { + TileEntity tile = player.worldObj.getTileEntity(pos_); + if(tile != null) { + boolean foundCap = false; + for(EnumFacing e : EnumFacing.VALUES) { + if(tile.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, e) + && scanInventory(tile.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, e), pstack)) { + blockPosBuilder.add(pos_.toLong()); + foundCap = true; + break; } } + if(!foundCap && tile instanceof IInventory) { + IInventory inv = (IInventory) tile; + if(scanInventory(new InvWrapper(inv), pstack)) + blockPosBuilder.add(pos_.toLong()); + } + } + } } } - - String current = ItemNBTHelper.getString(stack, TAG_POSITIONS, ""); - String positions = positionsBuilder.toString(); - if(!current.equals(positions)) { - ItemNBTHelper.setString(stack, TAG_POSITIONS, positions); - PacketHandler.INSTANCE.sendToAll(new PacketSyncBauble(player, 0)); - } } - boolean equalStacks(ItemStack stack1, ItemStack stack2) { + private boolean equalStacks(ItemStack stack1, ItemStack stack2) { return stack1.isItemEqual(stack2) && ItemStack.areItemStackTagsEqual(stack1, stack2); } - boolean scanInventory(IInventory inv, ItemStack pstack) { + private boolean scanInventory(IItemHandler inv, ItemStack pstack) { if(pstack == null) return false; - for(int l = 0; l < inv.getSizeInventory(); l++) { + for(int l = 0; l < inv.getSlots(); l++) { ItemStack istack = inv.getStackInSlot(l); if(istack != null && equalStacks(istack, pstack)) return true; @@ -209,6 +206,17 @@ public class ItemItemFinder extends ItemBauble implements IBaubleRender { return false; } + private long[] getBlockPositions(ItemStack stack) { + int[] ints = ItemNBTHelper.getIntArray(stack, TAG_BLOCK_POSITIONS); + return MathHelper.intArrayToLongArray(ints); + } + + private void setBlockPositions(ItemStack stack, long[] vals) { + stack.getTagCompound().removeTag(TAG_BLOCK_POSITIONS); + int[] write = MathHelper.longArrayToIntArray(vals); + ItemNBTHelper.setIntArray(stack, TAG_BLOCK_POSITIONS, write); + } + @Override public BaubleType getBaubleType(ItemStack arg0) { return BaubleType.AMULET; @@ -216,20 +224,21 @@ public class ItemItemFinder extends ItemBauble implements IBaubleRender { @Override @SideOnly(Side.CLIENT) - public void onPlayerBaubleRender(ItemStack stack, RenderPlayerEvent event, RenderType type) { + public void onPlayerBaubleRender(ItemStack stack, EntityPlayer player, RenderType type, float partialTicks) { + TextureAtlasSprite gemIcon = MiscellaneousIcons.INSTANCE.itemFinderGem; if(type == RenderType.HEAD) { float f = gemIcon.getMinU(); float f1 = gemIcon.getMaxU(); float f2 = gemIcon.getMinV(); float f3 = gemIcon.getMaxV(); - boolean armor = event.entityPlayer.getCurrentArmor(3) != null; - Helper.translateToHeadLevel(event.entityPlayer); - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); - GL11.glRotatef(90F, 0F, 1F, 0F); - GL11.glRotatef(180F, 1F, 0F, 0F); - GL11.glTranslatef(-0.4F, 0.1F, armor ? -0.3F : -0.25F); - GL11.glScalef(0.75F, 0.75F, 0.75F); - ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, gemIcon.getIconWidth(), gemIcon.getIconHeight(), 1F / 16F); + boolean armor = player.getItemStackFromSlot(EntityEquipmentSlot.HEAD) != null; + Helper.translateToHeadLevel(player); + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + GlStateManager.rotate(90F, 0F, 1F, 0F); + GlStateManager.rotate(180F, 1F, 0F, 0F); + GlStateManager.translate(-0.4F, -1.4F, armor ? -0.3F : -0.25F); + GlStateManager.scale(0.75F, 0.75F, 0.75F); + IconHelper.renderIconIn3D(Tessellator.getInstance(), f1, f2, f, f3, gemIcon.getIconWidth(), gemIcon.getIconHeight(), 1F / 16F); } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemKnockbackBelt.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemKnockbackBelt.java index 78952e312..ea59157e8 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemKnockbackBelt.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemKnockbackBelt.java @@ -10,25 +10,21 @@ */ package vazkii.botania.common.item.equipment.bauble; +import baubles.api.BaubleType; +import com.google.common.collect.Multimap; import net.minecraft.client.Minecraft; import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderPlayerEvent; - -import org.lwjgl.opengl.GL11; - +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.item.IBaubleRender; import vazkii.botania.client.lib.LibResources; import vazkii.botania.common.lib.LibItemNames; -import baubles.api.BaubleType; - -import com.google.common.collect.Multimap; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; public class ItemKnockbackBelt extends ItemBaubleModifier implements IBaubleRender { @@ -46,19 +42,20 @@ public class ItemKnockbackBelt extends ItemBaubleModifier implements IBaubleRend @Override void fillModifiers(Multimap attributes, ItemStack stack) { - attributes.put(SharedMonsterAttributes.knockbackResistance.getAttributeUnlocalizedName(), new AttributeModifier(getBaubleUUID(stack), "Bauble modifier", 1, 0)); + attributes.put(SharedMonsterAttributes.KNOCKBACK_RESISTANCE.getAttributeUnlocalizedName(), new AttributeModifier(getBaubleUUID(stack), "Bauble modifier", 1, 0)); } @Override @SideOnly(Side.CLIENT) - public void onPlayerBaubleRender(ItemStack stack, RenderPlayerEvent event, RenderType type) { + public void onPlayerBaubleRender(ItemStack stack, EntityPlayer player, RenderType type, float partialTicks) { if(type == RenderType.BODY) { Minecraft.getMinecraft().renderEngine.bindTexture(texture); - Helper.rotateIfSneaking(event.entityPlayer); - GL11.glTranslatef(0F, 0.2F, 0F); + Helper.rotateIfSneaking(player); + + GlStateManager.translate(0F, 0.2F, 0F); float s = 1.05F / 16F; - GL11.glScalef(s, s, s); + GlStateManager.scale(s, s, s); if(model == null) model = new ModelBiped(); diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemLavaPendant.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemLavaPendant.java index f07540b22..49179c98d 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemLavaPendant.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemLavaPendant.java @@ -10,27 +10,25 @@ */ package vazkii.botania.common.item.equipment.bauble; +import baubles.api.BaubleType; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraftforge.client.event.RenderPlayerEvent; - -import org.lwjgl.opengl.GL11; - +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.item.IBaubleRender; +import vazkii.botania.client.core.handler.MiscellaneousIcons; import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.common.lib.LibItemNames; -import baubles.api.BaubleType; public class ItemLavaPendant extends ItemBauble implements IBaubleRender { - IIcon gemIcon; - public ItemLavaPendant() { super(LibItemNames.LAVA_PENDANT); } @@ -47,27 +45,22 @@ public class ItemLavaPendant extends ItemBauble implements IBaubleRender { } @Override - public void registerIcons(IIconRegister par1IconRegister) { - super.registerIcons(par1IconRegister); - gemIcon = IconHelper.forItem(par1IconRegister, this, "Gem"); - } - - @Override - public void onPlayerBaubleRender(ItemStack stack, RenderPlayerEvent event, RenderType type) { + @SideOnly(Side.CLIENT) + public void onPlayerBaubleRender(ItemStack stack, EntityPlayer player, RenderType type, float partialTicks) { if(type == RenderType.BODY) { - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); - Helper.rotateIfSneaking(event.entityPlayer); - boolean armor = event.entityPlayer.getCurrentArmor(2) != null; - GL11.glRotatef(180F, 1F, 0F, 0F); - GL11.glTranslatef(-0.36F, -0.24F, armor ? 0.2F : 0.15F); - GL11.glRotatef(-45F, 0F, 0F, 1F); - GL11.glScalef(0.5F, 0.5F, 0.5F); + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + Helper.rotateIfSneaking(player); + boolean armor = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST) != null; + GlStateManager.scale(0.5, 0.5, 0.5); + GlStateManager.rotate(180, 0, 0, 1); + GlStateManager.translate(-0.5, -0.90, armor ? -0.4 : -0.25); + TextureAtlasSprite gemIcon = MiscellaneousIcons.INSTANCE.pyroclastGem; float f = gemIcon.getMinU(); float f1 = gemIcon.getMaxU(); float f2 = gemIcon.getMinV(); float f3 = gemIcon.getMaxV(); - ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, gemIcon.getIconWidth(), gemIcon.getIconHeight(), 1F / 32F); + IconHelper.renderIconIn3D(Tessellator.getInstance(), f1, f2, f, f3, gemIcon.getIconWidth(), gemIcon.getIconHeight(), 1F / 32F); } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemMagnetRing.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemMagnetRing.java index 6fab1bdb9..0b347c03e 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemMagnetRing.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemMagnetRing.java @@ -10,22 +10,23 @@ */ package vazkii.botania.common.item.equipment.bauble; -import java.util.Arrays; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.texture.IIconRegister; +import baubles.api.BaubleType; +import baubles.common.container.InventoryBaubles; +import baubles.common.lib.PlayerHandler; +import com.google.common.collect.ImmutableList; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.item.ItemTossEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.item.IRelic; import vazkii.botania.api.mana.IManaItem; -import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.common.Botania; import vazkii.botania.common.block.subtile.functional.SubTileSolegnolia; import vazkii.botania.common.core.handler.ConfigHandler; @@ -33,24 +34,16 @@ import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.core.helper.MathHelper; import vazkii.botania.common.core.helper.Vector3; import vazkii.botania.common.lib.LibItemNames; -import baubles.api.BaubleType; -import baubles.common.container.InventoryBaubles; -import baubles.common.lib.PlayerHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public class ItemMagnetRing extends ItemBauble { - IIcon iconOff; - private static final String TAG_COOLDOWN = "cooldown"; - private static final List BLACKLIST = Arrays.asList(new String[] { - "appliedenergistics2:item.ItemCrystalSeed", - }); + private static final List BLACKLIST = ImmutableList.of(new ResourceLocation("appliedenergistics2", "item.ItemCrystalSeed")); - int range; + private final int range; public ItemMagnetRing() { this(LibItemNames.MAGNET_RING, 6); @@ -60,29 +53,17 @@ public class ItemMagnetRing extends ItemBauble { public ItemMagnetRing(String name, int range) { super(name); this.range = range; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) { - itemIcon = IconHelper.forItem(par1IconRegister, this, 0); - iconOff = IconHelper.forItem(par1IconRegister, this, 1); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIconIndex(ItemStack stack) { - return getCooldown(stack) <= 0 ? itemIcon : iconOff; + addPropertyOverride(new ResourceLocation("botania", "on"), (stack, worldIn, entityIn) -> ItemMagnetRing.getCooldown(stack) <= 0 ? 1 : 0); } @SubscribeEvent public void onTossItem(ItemTossEvent event) { - InventoryBaubles inv = PlayerHandler.getPlayerBaubles(event.player); + InventoryBaubles inv = PlayerHandler.getPlayerBaubles(event.getPlayer()); for(int i = 0; i < inv.getSizeInventory(); i++) { ItemStack stack = inv.getStackInSlot(i); if(stack != null && stack.getItem() instanceof ItemMagnetRing) { setCooldown(stack, 100); - BotaniaAPI.internalHandler.sendBaubleUpdatePacket(event.player, i); + BotaniaAPI.internalHandler.sendBaubleUpdatePacket(event.getPlayer(), i); } } } @@ -102,10 +83,10 @@ public class ItemMagnetRing extends ItemBauble { if(cooldown <= 0) { if(player.isSneaking() == ConfigHandler.invertMagnetRing) { double x = player.posX; - double y = player.posY -(player.worldObj.isRemote ? 1.62 : 0) + 0.75; + double y = player.posY + 0.75; double z = player.posZ; - List items = player.worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x - range, y - range, z - range, x + range, y + range, z + range)); + List items = player.worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(x - range, y - range, z - range, x + range, y + range, z + range)); int pulled = 0; for(EntityItem item : items) if(canPullItem(item)) { @@ -115,7 +96,7 @@ public class ItemMagnetRing extends ItemBauble { MathHelper.setEntityMotionFromVector(item, new Vector3(x, y, z), 0.45F); if(player.worldObj.isRemote) { boolean red = player.worldObj.rand.nextBoolean(); - Botania.proxy.sparkleFX(player.worldObj, item.posX, item.posY, item.posZ, red ? 1F : 0F, 0F, red ? 0F : 1F, 1F, 3); + Botania.proxy.sparkleFX(item.posX, item.posY, item.posZ, red ? 1F : 0F, 0F, red ? 0F : 1F, 1F, 3); } pulled++; } @@ -128,22 +109,15 @@ public class ItemMagnetRing extends ItemBauble { return false; ItemStack stack = item.getEntityItem(); - if(stack == null || stack.getItem() instanceof IManaItem || stack.getItem() instanceof IRelic || BLACKLIST.contains(itemRegistry.getNameForObject(stack.getItem())) || BotaniaAPI.isItemBlacklistedFromMagnet(stack)) + if(stack == null || stack.getItem() instanceof IManaItem || stack.getItem() instanceof IRelic || BLACKLIST.contains(Item.REGISTRY.getNameForObject(stack.getItem())) || BotaniaAPI.isItemBlacklistedFromMagnet(stack)) return false; - int x = net.minecraft.util.MathHelper.floor_double(item.posX); - int y = (int) Math.floor(item.posY); - int z = net.minecraft.util.MathHelper.floor_double(item.posZ); - Block block = item.worldObj.getBlock(x, y, z); - int meta = item.worldObj.getBlockMetadata(x, y, z); + BlockPos pos = new BlockPos(item); - if(BotaniaAPI.isBlockBlacklistedFromMagnet(block, meta)) + if(BotaniaAPI.isBlockBlacklistedFromMagnet(item.worldObj.getBlockState(pos))) return false; - block = item.worldObj.getBlock(x, y - 1, z); - meta = item.worldObj.getBlockMetadata(x, y - 1, z); - - if(BotaniaAPI.isBlockBlacklistedFromMagnet(block, meta)) + if(BotaniaAPI.isBlockBlacklistedFromMagnet(item.worldObj.getBlockState(pos.down()))) return false; return true; @@ -158,7 +132,7 @@ public class ItemMagnetRing extends ItemBauble { } public static void addItemToBlackList(String item) { - BLACKLIST.add(item); + BLACKLIST.add(new ResourceLocation(item)); } @Override diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemManaRing.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemManaRing.java index b5f3665e8..099ada167 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemManaRing.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemManaRing.java @@ -10,18 +10,21 @@ */ package vazkii.botania.common.item.equipment.bauble; -import java.util.List; - +import baubles.api.BaubleType; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.mana.IManaItem; import vazkii.botania.api.mana.IManaTooltipDisplay; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.lib.LibItemNames; -import baubles.api.BaubleType; + +import javax.annotation.Nonnull; +import java.util.List; public class ItemManaRing extends ItemBauble implements IManaItem, IManaTooltipDisplay { @@ -46,19 +49,9 @@ public class ItemManaRing extends ItemBauble implements IManaItem, IManaTooltipD } @Override - public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - par3List.add(new ItemStack(par1, 1, 10000)); - } - - @Override - public int getDamage(ItemStack stack) { - float mana = getMana(stack); - return 1000 - (int) (mana / getMaxMana(stack) * 1000); - } - - @Override - public int getDisplayDamage(ItemStack stack) { - return getDamage(stack); + @SideOnly(Side.CLIENT) + public void getSubItems(@Nonnull Item item, CreativeTabs tab, List stacks) { + stacks.add(new ItemStack(item, 1, 10000)); } @Override @@ -83,7 +76,6 @@ public class ItemManaRing extends ItemBauble implements IManaItem, IManaTooltipD @Override public void addMana(ItemStack stack, int mana) { setMana(stack, Math.min(getMana(stack) + mana, getMaxMana(stack))); - stack.setItemDamage(getDamage(stack)); } @Override @@ -116,4 +108,16 @@ public class ItemManaRing extends ItemBauble implements IManaItem, IManaTooltipD return (float) getMana(stack) / (float) getMaxMana(stack); } + @Override + public boolean showDurabilityBar(ItemStack stack) { + // For mana rings, always show the durability bar. + return true; + } + + @Override + public double getDurabilityForDisplay(ItemStack stack) { + // As in ItemManaTablet, forge seems to have their durability swapped, hence the 1.0 - + return 1.0 - getManaFractionForDisplay(stack); + } + } diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemMiningRing.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemMiningRing.java index 0a6f6f8c4..09d2d95bd 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemMiningRing.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemMiningRing.java @@ -10,15 +10,15 @@ */ package vazkii.botania.common.item.equipment.bauble; +import baubles.api.BaubleType; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.MobEffects; import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import vazkii.botania.api.mana.IManaUsingItem; import vazkii.botania.api.mana.ManaItemHandler; import vazkii.botania.common.lib.LibItemNames; -import baubles.api.BaubleType; public class ItemMiningRing extends ItemBauble implements IManaUsingItem { @@ -36,10 +36,10 @@ public class ItemMiningRing extends ItemBauble implements IManaUsingItem { if(!hasMana) onUnequipped(stack, player); else { - if(player.getActivePotionEffect(Potion.digSpeed) != null) - player.removePotionEffect(Potion.digSpeed.id); + if(player.getActivePotionEffect(MobEffects.HASTE) != null) + player.removePotionEffect(MobEffects.HASTE); - player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, Integer.MAX_VALUE, 1, true)); + player.addPotionEffect(new PotionEffect(MobEffects.HASTE, Integer.MAX_VALUE, 1, true, true)); } if(player.swingProgress == 0.25F) @@ -49,9 +49,9 @@ public class ItemMiningRing extends ItemBauble implements IManaUsingItem { @Override public void onUnequipped(ItemStack stack, EntityLivingBase player) { - PotionEffect effect = player.getActivePotionEffect(Potion.digSpeed); + PotionEffect effect = player.getActivePotionEffect(MobEffects.HASTE); if(effect != null && effect.getAmplifier() == 1) - player.removePotionEffect(Potion.digSpeed.id); + player.removePotionEffect(MobEffects.HASTE); } @Override diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemMonocle.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemMonocle.java index f2af5e85e..0c6dd68d8 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemMonocle.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemMonocle.java @@ -10,32 +10,32 @@ */ package vazkii.botania.common.item.equipment.bauble; +import baubles.api.BaubleType; +import baubles.common.lib.PlayerHandler; import net.minecraft.block.Block; +import net.minecraft.block.BlockRedstoneComparator; +import net.minecraft.block.BlockRedstoneRepeater; +import net.minecraft.block.BlockRedstoneWire; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.ItemRenderer; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.MovingObjectPosition; -import net.minecraftforge.client.event.RenderPlayerEvent; - -import org.lwjgl.opengl.GL11; - +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.text.TextFormatting; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.item.IBurstViewerBauble; import vazkii.botania.api.item.ICosmeticAttachable; import vazkii.botania.api.item.ICosmeticBauble; import vazkii.botania.common.lib.LibItemNames; -import baubles.api.BaubleType; -import baubles.common.lib.PlayerHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; public class ItemMonocle extends ItemBauble implements IBurstViewerBauble, ICosmeticBauble { @@ -49,45 +49,44 @@ public class ItemMonocle extends ItemBauble implements IBurstViewerBauble, ICosm } @Override - public void onPlayerBaubleRender(ItemStack stack, RenderPlayerEvent event, RenderType type) { + @SideOnly(Side.CLIENT) + public void onPlayerBaubleRender(ItemStack stack, EntityPlayer player, RenderType type, float partialTicks) { if(type == RenderType.HEAD) { - float f = itemIcon.getMinU(); - float f1 = itemIcon.getMaxU(); - float f2 = itemIcon.getMinV(); - float f3 = itemIcon.getMaxV(); - boolean armor = event.entityPlayer.getCurrentArmor(3) != null; - Helper.translateToHeadLevel(event.entityPlayer); - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); - GL11.glRotatef(90F, 0F, 1F, 0F); - GL11.glRotatef(180F, 1F, 0F, 0F); - GL11.glTranslatef(-0.35F, -0.1F, armor ? -0.3F : -0.25F); - GL11.glScalef(0.35F, 0.35F, 0.35F); - ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, itemIcon.getIconWidth(), itemIcon.getIconHeight(), 1F / 16F); + boolean armor = player.getItemStackFromSlot(EntityEquipmentSlot.HEAD) != null; + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + + Helper.translateToHeadLevel(player); + Helper.translateToFace(); + Helper.defaultTransforms(); + GlStateManager.rotate(180F, 0F, 1F, 0F); + GlStateManager.scale(0.5F, 0.5F, 0.5F); + GlStateManager.translate(0.5F, -0.2F, armor ? 0.12F : 0F); + Minecraft.getMinecraft().getRenderItem().renderItem(stack, ItemCameraTransforms.TransformType.NONE); } } @SideOnly(Side.CLIENT) public static void renderHUD(ScaledResolution resolution, EntityPlayer player) { Minecraft mc = Minecraft.getMinecraft(); - MovingObjectPosition pos = mc.objectMouseOver; - if(pos == null) + RayTraceResult pos = mc.objectMouseOver; + if(pos == null || pos.getBlockPos() == null) return; - Block block = player.worldObj.getBlock(pos.blockX, pos.blockY, pos.blockZ); - int meta = player.worldObj.getBlockMetadata(pos.blockX, pos.blockY, pos.blockZ); - player.worldObj.getTileEntity(pos.blockX, pos.blockY, pos.blockZ); + IBlockState state = player.worldObj.getBlockState(pos.getBlockPos()); + Block block = state.getBlock(); + player.worldObj.getTileEntity(pos.getBlockPos()); ItemStack dispStack = null; String text = ""; - if(block == Blocks.redstone_wire) { - dispStack = new ItemStack(Items.redstone); - text = EnumChatFormatting.RED + "" + meta; - } else if(block == Blocks.unpowered_repeater || block == Blocks.powered_repeater) { - dispStack = new ItemStack(Items.repeater); - text = "" + (((meta & 12) >> 2) + 1); - } else if(block == Blocks.unpowered_comparator || block == Blocks.powered_comparator) { - dispStack = new ItemStack(Items.comparator); - text = (meta & 4) == 4 ? "-" : "+"; + if(block == Blocks.REDSTONE_WIRE) { + dispStack = new ItemStack(Items.REDSTONE); + text = TextFormatting.RED + "" + state.getValue(BlockRedstoneWire.POWER); + } else if(block == Blocks.UNPOWERED_REPEATER || block == Blocks.POWERED_REPEATER) { + dispStack = new ItemStack(Items.REPEATER); + text = "" + state.getValue(BlockRedstoneRepeater.DELAY); + } else if(block == Blocks.UNPOWERED_COMPARATOR || block == Blocks.POWERED_COMPARATOR) { + dispStack = new ItemStack(Items.COMPARATOR); + text = state.getValue(BlockRedstoneComparator.MODE) == BlockRedstoneComparator.Mode.SUBTRACT ? "-" : "+"; } if(dispStack == null) @@ -97,10 +96,10 @@ public class ItemMonocle extends ItemBauble implements IBurstViewerBauble, ICosm int y = resolution.getScaledHeight() / 2 - 8; net.minecraft.client.renderer.RenderHelper.enableGUIStandardItemLighting(); - RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, dispStack, x, y); + mc.getRenderItem().renderItemAndEffectIntoGUI(dispStack, x, y); net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting(); - mc.fontRenderer.drawStringWithShadow(text, x + 20, y + 4, 0xFFFFFF); + mc.fontRendererObj.drawStringWithShadow(text, x + 20, y + 4, 0xFFFFFF); } public static boolean hasMonocle(EntityPlayer player) { diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemPixieRing.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemPixieRing.java index d3055c7d3..fcc90e45c 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemPixieRing.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemPixieRing.java @@ -10,10 +10,10 @@ */ package vazkii.botania.common.item.equipment.bauble; +import baubles.api.BaubleType; import net.minecraft.item.ItemStack; import vazkii.botania.api.item.IPixieSpawner; import vazkii.botania.common.lib.LibItemNames; -import baubles.api.BaubleType; public class ItemPixieRing extends ItemBauble implements IPixieSpawner { diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemReachRing.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemReachRing.java index 6d9fa50a9..69ee17884 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemReachRing.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemReachRing.java @@ -10,11 +10,11 @@ */ package vazkii.botania.common.item.equipment.bauble; +import baubles.api.BaubleType; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import vazkii.botania.common.Botania; import vazkii.botania.common.lib.LibItemNames; -import baubles.api.BaubleType; public class ItemReachRing extends ItemBauble { diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemSuperLavaPendant.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemSuperLavaPendant.java index dc776b4ca..701697414 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemSuperLavaPendant.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemSuperLavaPendant.java @@ -10,30 +10,28 @@ */ package vazkii.botania.common.item.equipment.bauble; +import baubles.api.BaubleType; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraftforge.client.event.RenderPlayerEvent; - -import org.lwjgl.opengl.GL11; - +import net.minecraftforge.fml.relauncher.ReflectionHelper; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.item.IBaubleRender; +import vazkii.botania.client.core.handler.MiscellaneousIcons; import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.common.lib.LibItemNames; import vazkii.botania.common.lib.LibObfuscation; -import baubles.api.BaubleType; -import cpw.mods.fml.relauncher.ReflectionHelper; public class ItemSuperLavaPendant extends ItemBauble implements IBaubleRender { - IIcon gemIcon; - public ItemSuperLavaPendant() { super(LibItemNames.SUPER_LAVA_PENDANT); } @@ -58,27 +56,22 @@ public class ItemSuperLavaPendant extends ItemBauble implements IBaubleRender { } @Override - public void registerIcons(IIconRegister par1IconRegister) { - super.registerIcons(par1IconRegister); - gemIcon = IconHelper.forItem(par1IconRegister, this, "Gem"); - } - - @Override - public void onPlayerBaubleRender(ItemStack stack, RenderPlayerEvent event, RenderType type) { + @SideOnly(Side.CLIENT) + public void onPlayerBaubleRender(ItemStack stack, EntityPlayer player, RenderType type, float partialTicks) { if(type == RenderType.BODY) { - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); - Helper.rotateIfSneaking(event.entityPlayer); - boolean armor = event.entityPlayer.getCurrentArmor(2) != null; - GL11.glRotatef(180F, 1F, 0F, 0F); - GL11.glTranslatef(-0.36F, -0.24F, armor ? 0.2F : 0.15F); - GL11.glRotatef(-45F, 0F, 0F, 1F); - GL11.glScalef(0.5F, 0.5F, 0.5F); + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + Helper.rotateIfSneaking(player); + boolean armor = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST) != null; + GlStateManager.scale(0.5, 0.5, 0.5); + GlStateManager.rotate(180, 0, 0, 1); + GlStateManager.translate(-0.5, -0.90, armor ? -0.4 : -0.25); + TextureAtlasSprite gemIcon = MiscellaneousIcons.INSTANCE.crimsonGem; float f = gemIcon.getMinU(); float f1 = gemIcon.getMaxU(); float f2 = gemIcon.getMinV(); float f3 = gemIcon.getMaxV(); - ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, gemIcon.getIconWidth(), gemIcon.getIconHeight(), 1F / 32F); + IconHelper.renderIconIn3D(Tessellator.getInstance(), f1, f2, f, f3, gemIcon.getIconWidth(), gemIcon.getIconHeight(), 1F / 32F); } } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemSwapRing.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemSwapRing.java index 423b2feeb..a1f3d0974 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemSwapRing.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemSwapRing.java @@ -10,17 +10,18 @@ */ package vazkii.botania.common.item.equipment.bauble; -import net.minecraft.block.Block; +import baubles.api.BaubleType; import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.RayTraceResult; import vazkii.botania.api.item.ISortableTool; import vazkii.botania.api.item.ISortableTool.ToolType; import vazkii.botania.common.item.equipment.tool.ToolCommons; import vazkii.botania.common.lib.LibItemNames; -import baubles.api.BaubleType; public class ItemSwapRing extends ItemBauble { @@ -34,27 +35,25 @@ public class ItemSwapRing extends ItemBauble { return; EntityPlayer player = (EntityPlayer) entity; - ItemStack currentStack = player.getCurrentEquippedItem(); + ItemStack currentStack = player.getHeldItemMainhand(); if(currentStack == null || !(currentStack.getItem() instanceof ISortableTool)) return; ISortableTool tool = (ISortableTool) currentStack.getItem(); - MovingObjectPosition pos = ToolCommons.raytraceFromEntity(entity.worldObj, entity, true, 4.5F); + RayTraceResult pos = ToolCommons.raytraceFromEntity(entity.worldObj, entity, true, 4.5F); ToolType typeToFind = null; - if(player.isSwingInProgress && pos != null) { - Block block = entity.worldObj.getBlock(pos.blockX, pos.blockY, pos.blockZ); + if(player.isSwingInProgress && pos != null && pos.getBlockPos() != null) { + IBlockState state = entity.worldObj.getBlockState(pos.getBlockPos()); - if(block != null) { - Material mat = block.getMaterial(); - if(ToolCommons.isRightMaterial(mat, ToolCommons.materialsPick)) - typeToFind = ToolType.PICK; - else if(ToolCommons.isRightMaterial(mat, ToolCommons.materialsShovel)) - typeToFind = ToolType.SHOVEL; - else if(ToolCommons.isRightMaterial(mat, ToolCommons.materialsAxe)) - typeToFind = ToolType.AXE; - } + Material mat = state.getMaterial(); + if(ToolCommons.isRightMaterial(mat, ToolCommons.materialsPick)) + typeToFind = ToolType.PICK; + else if(ToolCommons.isRightMaterial(mat, ToolCommons.materialsShovel)) + typeToFind = ToolType.SHOVEL; + else if(ToolCommons.isRightMaterial(mat, ToolCommons.materialsAxe)) + typeToFind = ToolType.AXE; } if(typeToFind == null) @@ -80,7 +79,7 @@ public class ItemSwapRing extends ItemBauble { } if(bestSlot != -1) { - player.inventory.setInventorySlotContents(player.inventory.currentItem, bestTool); + player.setHeldItem(EnumHand.MAIN_HAND, bestTool); player.inventory.setInventorySlotContents(bestSlot, currentStack); } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemTinyPlanet.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemTinyPlanet.java index 7b03ea5dc..f59b350d5 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemTinyPlanet.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemTinyPlanet.java @@ -10,28 +10,28 @@ */ package vazkii.botania.common.item.equipment.bauble; -import java.util.List; - +import baubles.api.BaubleType; +import com.google.common.base.Predicates; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.world.World; -import net.minecraftforge.client.event.RenderPlayerEvent; - -import org.lwjgl.opengl.GL11; - +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.internal.IManaBurst; import vazkii.botania.api.item.IBaubleRender; import vazkii.botania.api.mana.ITinyPlanetExcempt; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.core.helper.Vector3; import vazkii.botania.common.lib.LibItemNames; -import baubles.api.BaubleType; + +import java.util.List; public class ItemTinyPlanet extends ItemBauble implements IBaubleRender { @@ -61,7 +61,7 @@ public class ItemTinyPlanet extends ItemBauble implements IBaubleRender { public static void applyEffect(World world, double x, double y, double z) { int range = 8; - List entities = world.getEntitiesWithinAABB(IManaBurst.class, AxisAlignedBB.getBoundingBox(x - range, y - range, z - range, x + range, y + range, z + range)); + List entities = world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(x - range, y - range, z - range, x + range, y + range, z + range), Predicates.instanceOf(IManaBurst.class)); for(Entity entity : entities) { IManaBurst burst = (IManaBurst) entity; ItemStack lens = burst.getSourceLens(); @@ -81,7 +81,7 @@ public class ItemTinyPlanet extends ItemBauble implements IBaubleRender { Vector3 targetVec = new Vector3(xTarget, yTarget, zTarget); Vector3 currentVec = new Vector3(entity.posX, entity.posY, entity.posZ); - Vector3 moveVector = targetVec.copy().sub(currentVec); + Vector3 moveVector = targetVec.subtract(currentVec); burst.setMotion(moveVector.x, moveVector.y, moveVector.z); @@ -103,12 +103,13 @@ public class ItemTinyPlanet extends ItemBauble implements IBaubleRender { } @Override - public void onPlayerBaubleRender(ItemStack stack, RenderPlayerEvent event, RenderType type) { + @SideOnly(Side.CLIENT) + public void onPlayerBaubleRender(ItemStack stack, EntityPlayer player, RenderType type, float partialTicks) { if(type == RenderType.HEAD) { - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); - GL11.glTranslatef(0.25F, -0.5F, 0F); - GL11.glScalef(0.5F, 0.5F, 0.5F); - RenderBlocks.getInstance().renderBlockAsItem(ModBlocks.tinyPlanet, 0, 1F); + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + GlStateManager.scale(0.5F, 0.5F, 0.5F); + GlStateManager.translate(0, -1.5F, 0.5F); + Minecraft.getMinecraft().getBlockRendererDispatcher().renderBlockBrightness(ModBlocks.tinyPlanet.getDefaultState(), 1.0F); } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemTravelBelt.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemTravelBelt.java index 1cae596c8..34d9c668b 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemTravelBelt.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemTravelBelt.java @@ -10,33 +10,30 @@ */ package vazkii.botania.common.item.equipment.bauble; -import java.util.ArrayList; -import java.util.List; - +import baubles.api.BaubleType; +import baubles.common.lib.PlayerHandler; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.RenderPlayerEvent; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; - -import org.lwjgl.opengl.GL11; - +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.PlayerEvent; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.item.IBaubleRender; import vazkii.botania.api.mana.IManaUsingItem; import vazkii.botania.api.mana.ManaItemHandler; import vazkii.botania.client.lib.LibResources; import vazkii.botania.common.lib.LibItemNames; -import baubles.api.BaubleType; -import baubles.common.lib.PlayerHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.ArrayList; +import java.util.List; public class ItemTravelBelt extends ItemBauble implements IBaubleRender, IManaUsingItem { @@ -47,7 +44,7 @@ public class ItemTravelBelt extends ItemBauble implements IBaubleRender, IManaUs private static final int COST = 1; private static final int COST_INTERVAL = 10; - public static List playersWithStepup = new ArrayList(); + public static final List playersWithStepup = new ArrayList<>(); final float speed; final float jump; @@ -72,8 +69,8 @@ public class ItemTravelBelt extends ItemBauble implements IBaubleRender, IManaUs @SubscribeEvent public void updatePlayerStepStatus(LivingUpdateEvent event) { - if(event.entityLiving instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer) event.entityLiving; + if(event.getEntityLiving() instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) event.getEntityLiving(); String s = playerStr(player); ItemStack belt = PlayerHandler.getPlayerBaubles(player).getStackInSlot(3); @@ -81,14 +78,16 @@ public class ItemTravelBelt extends ItemBauble implements IBaubleRender, IManaUs if(shouldPlayerHaveStepup(player)) { ItemTravelBelt beltItem = (ItemTravelBelt) belt.getItem(); - if((player.onGround || player.capabilities.isFlying) && player.moveForward > 0F && !player.isInsideOfMaterial(Material.water)) { - float speed = beltItem.getSpeed(belt); - player.moveFlying(0F, 1F, player.capabilities.isFlying ? speed : speed); - beltItem.onMovedTick(belt, player); + if(player.worldObj.isRemote) { + if((player.onGround || player.capabilities.isFlying) && player.moveForward > 0F && !player.isInsideOfMaterial(Material.WATER)) { + float speed = beltItem.getSpeed(belt); + player.moveRelative(0F, 1F, player.capabilities.isFlying ? speed : speed); + beltItem.onMovedTick(belt, player); - if(player.ticksExisted % COST_INTERVAL == 0) - ManaItemHandler.requestManaExact(belt, player, COST, true); - } else beltItem.onNotMovingTick(belt, player); + if(player.ticksExisted % COST_INTERVAL == 0) + ManaItemHandler.requestManaExact(belt, player, COST, true); + } else beltItem.onNotMovingTick(belt, player); + } if(player.isSneaking()) player.stepHeight = 0.50001F; // Not 0.5F because that is the default @@ -109,18 +108,14 @@ public class ItemTravelBelt extends ItemBauble implements IBaubleRender, IManaUs return speed; } - public void onMovedTick(ItemStack stack, EntityPlayer player) { - // NO-OP - } + public void onMovedTick(ItemStack stack, EntityPlayer player) {} - public void onNotMovingTick(ItemStack stack, EntityPlayer player) { - // NO-OP - } + public void onNotMovingTick(ItemStack stack, EntityPlayer player) {} @SubscribeEvent public void onPlayerJump(LivingJumpEvent event) { - if(event.entityLiving instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer) event.entityLiving; + if(event.getEntityLiving() instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) event.getEntityLiving(); ItemStack belt = PlayerHandler.getPlayerBaubles(player).getStackInSlot(3); if(belt != null && belt.getItem() instanceof ItemTravelBelt && ManaItemHandler.requestManaExact(belt, player, COST, false)) { @@ -153,14 +148,15 @@ public class ItemTravelBelt extends ItemBauble implements IBaubleRender, IManaUs @Override @SideOnly(Side.CLIENT) - public void onPlayerBaubleRender(ItemStack stack, RenderPlayerEvent event, RenderType type) { + public void onPlayerBaubleRender(ItemStack stack, EntityPlayer player, RenderType type, float partialTicks) { if(type == RenderType.BODY) { Minecraft.getMinecraft().renderEngine.bindTexture(getRenderTexture()); - Helper.rotateIfSneaking(event.entityPlayer); - GL11.glTranslatef(0F, 0.2F, 0F); + Helper.rotateIfSneaking(player); + + GlStateManager.translate(0F, 0.2F, 0F); float s = 1.05F / 16F; - GL11.glScalef(s, s, s); + GlStateManager.scale(s, s, s); if(model == null) model = new ModelBiped(); diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemUnholyCloak.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemUnholyCloak.java index 1dbd14b56..17a4cc7b4 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemUnholyCloak.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemUnholyCloak.java @@ -10,20 +10,24 @@ */ package vazkii.botania.common.item.equipment.bauble; -import java.util.List; - +import com.google.common.base.Predicates; +import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.monster.IMob; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.DamageSource; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.AxisAlignedBB; import net.minecraftforge.event.entity.living.LivingHurtEvent; +import vazkii.botania.api.sound.BotaniaSoundEvents; import vazkii.botania.client.lib.LibResources; import vazkii.botania.common.Botania; import vazkii.botania.common.lib.LibItemNames; +import java.util.List; + public class ItemUnholyCloak extends ItemHolyCloak { private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_UNHOLY_CLOAK); @@ -34,21 +38,21 @@ public class ItemUnholyCloak extends ItemHolyCloak { @Override public boolean effectOnDamage(LivingHurtEvent event, EntityPlayer player, ItemStack stack) { - if(!event.source.isUnblockable()) { + if(!event.getSource().isUnblockable()) { int range = 6; - List mobs = player.worldObj.getEntitiesWithinAABB(IMob.class, AxisAlignedBB.getBoundingBox(player.posX - range, player.posY - range, player.posZ - range, player.posX + range, player.posY + range, player.posZ + range)); - for(IMob mob : mobs) + List mobs = player.worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(player.posX - range, player.posY - range, player.posZ - range, player.posX + range, player.posY + range, player.posZ + range), Predicates.instanceOf(IMob.class)); + for(IMob mob : ((List) mobs)) if(mob instanceof EntityLivingBase) { EntityLivingBase entity = (EntityLivingBase) mob; - entity.attackEntityFrom(DamageSource.causePlayerDamage(player), event.ammount); + entity.attackEntityFrom(DamageSource.causePlayerDamage(player), event.getAmount()); } - player.worldObj.playSoundAtEntity(player, "botania:unholyCloak", 1F, 1F); + player.worldObj.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.unholyCloak, SoundCategory.PLAYERS, 1F, 1F); for(int i = 0; i < 90; i++) { float rad = i * 4F * (float) Math.PI / 180F; float xMotion = (float) Math.cos(rad) * 0.2F; float zMotion = (float) Math.sin(rad) * 0.2F; - Botania.proxy.wispFX(player.worldObj, player.posX, player.posY + 0.5, player.posZ, 0.4F + (float) Math.random() + 0.25F, 0F, 0F, 0.6F + (float) Math.random() * 0.2F, xMotion, 0F, zMotion); + Botania.proxy.wispFX(player.posX, player.posY + 0.5, player.posZ, 0.4F + (float) Math.random() + 0.25F, 0F, 0F, 0.6F + (float) Math.random() * 0.2F, xMotion, 0F, zMotion); } return true; diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemWaterRing.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemWaterRing.java index 3b3c5d645..24414352b 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemWaterRing.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemWaterRing.java @@ -10,19 +10,23 @@ */ package vazkii.botania.common.item.equipment.bauble; +import baubles.api.BaubleType; +import baubles.common.lib.PlayerHandler; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.MobEffects; import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import vazkii.botania.api.mana.IManaUsingItem; import vazkii.botania.api.mana.ManaItemHandler; import vazkii.botania.common.lib.LibItemNames; -import baubles.api.BaubleType; public class ItemWaterRing extends ItemBauble implements IManaUsingItem { + private static final double SPEED_MULT = 1.2; + private static final double MAX_SPEED = 1.3; + public ItemWaterRing() { super(LibItemNames.WATER_RING); } @@ -31,34 +35,36 @@ public class ItemWaterRing extends ItemBauble implements IManaUsingItem { public void onWornTick(ItemStack stack, EntityLivingBase player) { super.onWornTick(stack, player); - if(player.isInsideOfMaterial(Material.water)) { - double motionX = player.motionX * 1.2; - double motionY = player.motionY * 1.2; - double motionZ = player.motionZ * 1.2; + if(player.isInsideOfMaterial(Material.WATER)) { + if(player instanceof EntityPlayer) { + ItemStack firstRing = PlayerHandler.getPlayerBaubles((EntityPlayer) player).getStackInSlot(1); + if(firstRing != null && firstRing.getItem() instanceof ItemWaterRing && firstRing != stack) { + return; + } + } - boolean changeX = Math.min(1.3, Math.abs(motionX)) == Math.abs(motionX); - boolean changeY = Math.min(1.3, Math.abs(motionY)) == Math.abs(motionY); - boolean changeZ = Math.min(1.3, Math.abs(motionZ)) == Math.abs(motionZ); + double motionX = player.motionX * SPEED_MULT; + double motionY = player.motionY * SPEED_MULT; + double motionZ = player.motionZ * SPEED_MULT; - if(player instanceof EntityPlayer && ((EntityPlayer) player).capabilities.isFlying) - changeX = changeY = changeZ = false; + boolean flying = player instanceof EntityPlayer && ((EntityPlayer) player).capabilities.isFlying; - if(changeX) + if(Math.abs(motionX) < MAX_SPEED && !flying) player.motionX = motionX; - if(changeY) + if(Math.abs(motionY) < MAX_SPEED && !flying) player.motionY = motionY; - if(changeZ) + if(Math.abs(motionZ) < MAX_SPEED && !flying) player.motionZ = motionZ; - PotionEffect effect = player.getActivePotionEffect(Potion.nightVision); + PotionEffect effect = player.getActivePotionEffect(MobEffects.NIGHT_VISION); if(effect == null) { - PotionEffect neweffect = new PotionEffect(Potion.nightVision.id, Integer.MAX_VALUE, -42, true); + PotionEffect neweffect = new PotionEffect(MobEffects.NIGHT_VISION, Integer.MAX_VALUE, -42, true, true); player.addPotionEffect(neweffect); } if(player.getAir() <= 1 && player instanceof EntityPlayer) { int mana = ManaItemHandler.requestMana(stack, (EntityPlayer) player, 300, true); - if(mana > 0) // If zero gets in the player has no air but won't drown. + if (mana > 0) player.setAir(mana); } } else onUnequipped(stack, player); @@ -66,9 +72,9 @@ public class ItemWaterRing extends ItemBauble implements IManaUsingItem { @Override public void onUnequipped(ItemStack stack, EntityLivingBase player) { - PotionEffect effect = player.getActivePotionEffect(Potion.nightVision); + PotionEffect effect = player.getActivePotionEffect(MobEffects.NIGHT_VISION); if(effect != null && effect.getAmplifier() == -42) - player.removePotionEffect(Potion.nightVision.id); + player.removePotionEffect(MobEffects.NIGHT_VISION); } @Override diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/ItemEnderDagger.java b/src/main/java/vazkii/botania/common/item/equipment/tool/ItemEnderDagger.java index e7102c7f0..5cf860cd0 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/ItemEnderDagger.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/ItemEnderDagger.java @@ -10,26 +10,24 @@ */ package vazkii.botania.common.item.equipment.tool; -import java.awt.Color; - -import net.minecraft.client.renderer.texture.IIconRegister; +import com.google.common.collect.Multimap; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.entity.monster.EntityEnderman; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.EnumAction; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemStack; import net.minecraft.util.DamageSource; -import net.minecraft.util.IIcon; import net.minecraft.world.World; import vazkii.botania.api.BotaniaAPI; -import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.common.item.equipment.tool.manasteel.ItemManasteelSword; import vazkii.botania.common.lib.LibItemNames; -public class ItemEnderDagger extends ItemManasteelSword { +import javax.annotation.Nonnull; - IIcon iconFront, iconOverlay; +public class ItemEnderDagger extends ItemManasteelSword { public ItemEnderDagger() { super(BotaniaAPI.manasteelToolMaterial, LibItemNames.ENDER_DAGGER); @@ -38,50 +36,36 @@ public class ItemEnderDagger extends ItemManasteelSword { } @Override - public void registerIcons(IIconRegister par1IconRegister) { - iconFront = IconHelper.forItem(par1IconRegister, this, 0); - iconOverlay = IconHelper.forItem(par1IconRegister, this, 1); - } + public boolean hitEntity(ItemStack stack, EntityLivingBase target, @Nonnull EntityLivingBase attacker) { + if(!target.worldObj.isRemote + && target instanceof EntityEnderman + && attacker instanceof EntityPlayer + && ((EntityPlayer) attacker).getCooledAttackStrength(0) == 1) { + target.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 20); + } - @Override - public boolean requiresMultipleRenderPasses() { + stack.damageItem(1, attacker); return true; } @Override - public IIcon getIcon(ItemStack stack, int pass) { - return pass == 0 ? iconFront : iconOverlay; - } - - @Override - public int getColorFromItemStack(ItemStack par1ItemStack, int par2) { - if(par2 == 0) - return 0xFFFFFF; - - return Color.HSBtoRGB(0.75F, 1F, 1.5F - (float) Math.min(1F, Math.sin(System.currentTimeMillis() / 100D) * 0.5 + 1.2F)); - } - - @Override - public EnumAction getItemUseAction(ItemStack par1ItemStack) { - return EnumAction.none; - } - - @Override - public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) { - if(par2EntityLivingBase instanceof EntityEnderman && par3EntityLivingBase instanceof EntityPlayer) - par2EntityLivingBase.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) par3EntityLivingBase), 20); - par1ItemStack.damageItem(1, par3EntityLivingBase); - return true; - } - - @Override - public void onUpdate(ItemStack stack, World world, Entity player, int par4, boolean par5) { - // NO-OP - } + public void onUpdate(ItemStack stack, World world, Entity player, int par4, boolean par5) {} @Override public boolean usesMana(ItemStack stack) { return false; } + @Nonnull + @Override + public Multimap getItemAttributeModifiers(EntityEquipmentSlot equipmentSlot) { + Multimap multimap = super.getItemAttributeModifiers(equipmentSlot); + + if (equipmentSlot == EntityEquipmentSlot.MAINHAND) { + multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", -1.25, 0)); + } + + return multimap; + } + } diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/ItemGlassPick.java b/src/main/java/vazkii/botania/common/item/equipment/tool/ItemGlassPick.java index f651eb977..7abc350de 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/ItemGlassPick.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/ItemGlassPick.java @@ -17,24 +17,27 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.EnumHelper; import net.minecraftforge.event.world.BlockEvent.HarvestDropsEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import vazkii.botania.common.item.equipment.tool.manasteel.ItemManasteelPick; import vazkii.botania.common.lib.LibItemNames; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +import javax.annotation.Nonnull; public class ItemGlassPick extends ItemManasteelPick { private static final int MANA_PER_DAMAGE = 160; - private static final ToolMaterial MATERIAL = EnumHelper.addToolMaterial("MANASTEEL_GLASS", 0, 125, 4.8F, 1F, 10); + private static final ToolMaterial MATERIAL = EnumHelper.addToolMaterial("MANASTEEL_GLASS", 0, 125, 4.8F, 0F, 10); public ItemGlassPick() { super(MATERIAL, LibItemNames.GLASS_PICK); MinecraftForge.EVENT_BUS.register(this); + attackSpeed = -1; } @SubscribeEvent public void onBlockDrops(HarvestDropsEvent event) { - if(event.harvester != null && event.block != null && event.drops.isEmpty() && event.harvester.getCurrentEquippedItem() != null && event.harvester.getCurrentEquippedItem().getItem() == this && event.block.getMaterial() == Material.glass && event.block.canSilkHarvest(event.world, event.harvester, event.x, event.y, event.z, event.blockMetadata)) - event.drops.add(new ItemStack(event.block, 1, event.blockMetadata)); + if(event.getHarvester() != null && event.getState() != null && event.getDrops().isEmpty() && event.getHarvester().getHeldItemMainhand() != null && event.getHarvester().getHeldItemMainhand().getItem() == this && event.getState().getMaterial() == Material.GLASS && event.getState().getBlock().canSilkHarvest(event.getWorld(), event.getPos(), event.getState(), event.getHarvester())) + event.getDrops().add(new ItemStack(event.getState().getBlock(), 1, event.getState().getBlock().getMetaFromState(event.getState()))); } @Override @@ -43,8 +46,8 @@ public class ItemGlassPick extends ItemManasteelPick { } @Override - public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) { - return par2ItemStack.getItem() == Item.getItemFromBlock(Blocks.glass) ? true : super.getIsRepairable(par1ItemStack, par2ItemStack); + public boolean getIsRepairable(ItemStack par1ItemStack, @Nonnull ItemStack par2ItemStack) { + return par2ItemStack.getItem() == Item.getItemFromBlock(Blocks.GLASS) ? true : super.getIsRepairable(par1ItemStack, par2ItemStack); } @Override diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/ItemStarSword.java b/src/main/java/vazkii/botania/common/item/equipment/tool/ItemStarSword.java index fa1e78b21..f093099ee 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/ItemStarSword.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/ItemStarSword.java @@ -12,14 +12,16 @@ package vazkii.botania.common.item.equipment.tool; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.MobEffects; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.stats.Achievement; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; import vazkii.botania.api.BotaniaAPI; +import vazkii.botania.api.sound.BotaniaSoundEvents; import vazkii.botania.common.achievement.ICraftAchievement; import vazkii.botania.common.achievement.ModAchievements; import vazkii.botania.common.core.helper.Vector3; @@ -28,6 +30,8 @@ import vazkii.botania.common.item.ModItems; import vazkii.botania.common.item.equipment.tool.manasteel.ItemManasteelSword; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; + public class ItemStarSword extends ItemManasteelSword implements ICraftAchievement { private static final int MANA_PER_DAMAGE = 120; @@ -37,30 +41,41 @@ public class ItemStarSword extends ItemManasteelSword implements ICraftAchieveme } @Override - public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) { - super.onUpdate(par1ItemStack, par2World, par3Entity, par4, par5); + public void onUpdate(ItemStack par1ItemStack, World world, Entity par3Entity, int par4, boolean par5) { + super.onUpdate(par1ItemStack, world, par3Entity, par4, par5); if(par3Entity instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) par3Entity; - PotionEffect haste = player.getActivePotionEffect(Potion.digSpeed); + PotionEffect haste = player.getActivePotionEffect(MobEffects.HASTE); float check = haste == null ? 0.16666667F : haste.getAmplifier() == 1 ? 0.5F : 0.4F; - if(player.getCurrentEquippedItem() == par1ItemStack && player.swingProgress == check && !par2World.isRemote && par2World.rand.nextInt(2) == 0) { - MovingObjectPosition pos = ToolCommons.raytraceFromEntity(par2World, par3Entity, true, 48); - if(pos != null) { - Vector3 posVec = new Vector3(pos.blockX, pos.blockY, pos.blockZ); - Vector3 motVec = new Vector3((Math.random() - 0.5) * 18, 24, (Math.random() - 0.5) * 18); - posVec.add(motVec); - motVec.normalize().negate().multiply(1.5); + if(player.getHeldItemMainhand() == par1ItemStack && player.swingProgress == check && !world.isRemote) { + RayTraceResult pos = ToolCommons.raytraceFromEntity(world, par3Entity, true, 48); + if(pos != null && pos.getBlockPos() != null) { + Vector3 posVec = Vector3.fromBlockPos(pos.getBlockPos()); + Vector3 motVec = new Vector3((0.5 * Math.random() - 0.25) * 18, 24, (0.5 * Math.random() - 0.25) * 18); + posVec = posVec.add(motVec); + motVec = motVec.normalize().negate().multiply(1.5); - EntityFallingStar star = new EntityFallingStar(par2World, player); + EntityFallingStar star = new EntityFallingStar(world, player); star.setPosition(posVec.x, posVec.y, posVec.z); star.motionX = motVec.x; star.motionY = motVec.y; star.motionZ = motVec.z; - par2World.spawnEntityInWorld(star); + world.spawnEntityInWorld(star); + + if (!world.isRaining() + && Math.abs(world.getWorldTime() - 18000) < 1800 + && Math.random() < 0.125) { + EntityFallingStar bonusStar = new EntityFallingStar(world, player); + bonusStar.setPosition(posVec.x, posVec.y, posVec.z); + bonusStar.motionX = motVec.x + Math.random() - 0.5; + bonusStar.motionY = motVec.y + Math.random() - 0.5; + bonusStar.motionZ = motVec.z + Math.random() - 0.5; + world.spawnEntityInWorld(bonusStar); + } ToolCommons.damageItem(par1ItemStack, 1, player, MANA_PER_DAMAGE); - par2World.playSoundAtEntity(player, "botania:starcaller", 0.4F, 1.4F); + world.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.starcaller, SoundCategory.PLAYERS, 0.4F, 1.4F); } } } @@ -72,7 +87,7 @@ public class ItemStarSword extends ItemManasteelSword implements ICraftAchieveme } @Override - public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) { + public boolean getIsRepairable(ItemStack par1ItemStack, @Nonnull ItemStack par2ItemStack) { return par2ItemStack.getItem() == ModItems.manaResource && par2ItemStack.getItemDamage() == 4 ? true : super.getIsRepairable(par1ItemStack, par2ItemStack); } diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/ItemThunderSword.java b/src/main/java/vazkii/botania/common/item/equipment/tool/ItemThunderSword.java index 27d6d41f4..ee4b62717 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/ItemThunderSword.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/ItemThunderSword.java @@ -10,20 +10,19 @@ */ package vazkii.botania.common.item.equipment.tool; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.command.IEntitySelector; +import com.google.common.collect.Multimap; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.entity.monster.IMob; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.stats.Achievement; -import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.DamageSource; +import net.minecraft.util.math.AxisAlignedBB; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.common.Botania; import vazkii.botania.common.achievement.ICraftAchievement; @@ -33,6 +32,12 @@ import vazkii.botania.common.core.helper.Vector3; import vazkii.botania.common.item.equipment.tool.manasteel.ItemManasteelSword; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; +import java.util.function.Predicate; + public class ItemThunderSword extends ItemManasteelSword implements ICraftAchievement { private static final String TAG_LIGHTNING_SEED = "lightningSeed"; @@ -42,35 +47,29 @@ public class ItemThunderSword extends ItemManasteelSword implements ICraftAchiev } @Override - public boolean hitEntity(ItemStack stack, EntityLivingBase entity, EntityLivingBase attacker) { + public boolean hitEntity(ItemStack stack, EntityLivingBase entity, @Nonnull EntityLivingBase attacker) { if(!(entity instanceof EntityPlayer) && entity != null) { double range = 8; - final List alreadyTargetedEntities = new ArrayList(); + List alreadyTargetedEntities = new ArrayList<>(); int dmg = 5; long lightningSeed = ItemNBTHelper.getLong(stack, TAG_LIGHTNING_SEED, 0); - IEntitySelector selector = new IEntitySelector() { - - @Override - public boolean isEntityApplicable(Entity e) { - return e instanceof EntityLivingBase && e instanceof IMob && !(e instanceof EntityPlayer) && !alreadyTargetedEntities.contains(e); - } - - }; + Predicate selector = e -> e instanceof EntityLivingBase && e instanceof IMob && !(e instanceof EntityPlayer) && !alreadyTargetedEntities.contains(e); Random rand = new Random(lightningSeed); EntityLivingBase lightningSource = entity; - for(int i = 0; i < 4; i++) { - List entities = entity.worldObj.getEntitiesWithinAABBExcludingEntity(lightningSource, AxisAlignedBB.getBoundingBox(lightningSource.posX - range, lightningSource.posY - range, lightningSource.posZ - range, lightningSource.posX + range, lightningSource.posY + range, lightningSource.posZ + range), selector); + int hops = entity.worldObj.isThundering() ? 10 : 4; + for(int i = 0; i < hops; i++) { + List entities = entity.worldObj.getEntitiesInAABBexcluding(lightningSource, new AxisAlignedBB(lightningSource.posX - range, lightningSource.posY - range, lightningSource.posZ - range, lightningSource.posX + range, lightningSource.posY + range, lightningSource.posZ + range), selector::test); if(entities.isEmpty()) break; - EntityLivingBase target = entities.get(rand.nextInt(entities.size())); + EntityLivingBase target = ((EntityLivingBase) entities.get(rand.nextInt(entities.size()))); if(attacker instanceof EntityPlayer) target.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), dmg); else target.attackEntityFrom(DamageSource.causeMobDamage(attacker), dmg); - Botania.proxy.lightningFX(entity.worldObj, Vector3.fromEntityCenter(lightningSource), Vector3.fromEntityCenter(target), 1, 0x0179C4, 0xAADFFF); + Botania.proxy.lightningFX(Vector3.fromEntityCenter(lightningSource), Vector3.fromEntityCenter(target), 1, 0x0179C4, 0xAADFFF); alreadyTargetedEntities.add(target); lightningSource = target; @@ -90,5 +89,17 @@ public class ItemThunderSword extends ItemManasteelSword implements ICraftAchiev return ModAchievements.terrasteelWeaponCraft; } + @Nonnull + @Override + public Multimap getItemAttributeModifiers(EntityEquipmentSlot equipmentSlot) { + Multimap multimap = super.getItemAttributeModifiers(equipmentSlot); + + if (equipmentSlot == EntityEquipmentSlot.MAINHAND) { + multimap.removeAll(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName()); + multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", -1.5, 0)); + } + + return multimap; + } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/ToolCommons.java b/src/main/java/vazkii/botania/common/item/equipment/tool/ToolCommons.java index c6346db91..44a922aff 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/ToolCommons.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/ToolCommons.java @@ -12,18 +12,20 @@ package vazkii.botania.common.item.equipment.tool; import net.minecraft.block.Block; import net.minecraft.block.material.Material; -import net.minecraft.enchantment.Enchantment; +import net.minecraft.block.state.IBlockState; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Enchantments; import net.minecraft.item.Item; import net.minecraft.item.Item.ToolMaterial; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemTool; -import net.minecraft.util.MathHelper; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.Vec3; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.mana.ManaItemHandler; @@ -34,9 +36,9 @@ import vazkii.botania.common.item.equipment.tool.terrasteel.ItemTerraPick; public final class ToolCommons { - public static Material[] materialsPick = new Material[]{ Material.rock, Material.iron, Material.ice, Material.glass, Material.piston, Material.anvil }; - public static Material[] materialsShovel = new Material[]{ Material.grass, Material.ground, Material.sand, Material.snow, Material.craftedSnow, Material.clay }; - public static Material[] materialsAxe = new Material[]{ Material.coral, Material.leaves, Material.plants, Material.wood, Material.gourd }; + public static final Material[] materialsPick = new Material[]{ Material.ROCK, Material.IRON, Material.ICE, Material.GLASS, Material.PISTON, Material.ANVIL }; + public static final Material[] materialsShovel = new Material[]{ Material.GRASS, Material.GROUND, Material.SAND, Material.SNOW, Material.CRAFTED_SNOW, Material.CLAY }; + public static final Material[] materialsAxe = new Material[]{ Material.CORAL, Material.LEAVES, Material.PLANTS, Material.WOOD, Material.GOURD }; public static void damageItem(ItemStack stack, int dmg, EntityLivingBase entity, int manaPerDamage) { int manaToRequest = dmg * manaPerDamage; @@ -46,13 +48,17 @@ public final class ToolCommons { stack.damageItem(dmg, entity); } - public static void removeBlocksInIteration(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int xs, int ys, int zs, int xe, int ye, int ze, Block block, Material[] materialsListing, boolean silk, int fortune, boolean dispose) { - float blockHardness = block == null ? 1F : block.getBlockHardness(world, x, y, z); + /** + * Pos is the actual block coordinate, posStart and posEnd are deltas from pos + */ + public static void removeBlocksInIteration(EntityPlayer player, ItemStack stack, World world, BlockPos pos, BlockPos posStart, BlockPos posEnd, Block block, Material[] materialsListing, boolean silk, int fortune, boolean dispose) { + float blockHardness = block == null ? 1F : block.getBlockHardness(world.getBlockState(pos), world, pos); - for(int x1 = xs; x1 < xe; x1++) - for(int y1 = ys; y1 < ye; y1++) - for(int z1 = zs; z1 < ze; z1++) - removeBlockWithDrops(player, stack, world, x1 + x, y1 + y, z1 + z, x, y, z, block, materialsListing, silk, fortune, blockHardness, dispose); + for (BlockPos iterPos : BlockPos.getAllInBox(pos.add(posStart), pos.add(posEnd))) { + if (iterPos.equals(pos)) // skip original block space to avoid crash, vanilla code in the tool class will handle it + continue; + removeBlockWithDrops(player, stack, world, iterPos, pos, block, materialsListing, silk, fortune, blockHardness, dispose); + } } public static boolean isRightMaterial(Material material, Material[] materialsListing) { @@ -63,41 +69,42 @@ public final class ToolCommons { return false; } - public static void removeBlockWithDrops(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int bx, int by, int bz, Block block, Material[] materialsListing, boolean silk, int fortune, float blockHardness, boolean dispose) { - removeBlockWithDrops(player, stack, world, x, y, z, bx, by, bz, block, materialsListing, silk, fortune, blockHardness, dispose, true); + public static void removeBlockWithDrops(EntityPlayer player, ItemStack stack, World world, BlockPos pos, BlockPos bPos, Block block, Material[] materialsListing, boolean silk, int fortune, float blockHardness, boolean dispose) { + removeBlockWithDrops(player, stack, world, pos, bPos, block, materialsListing, silk, fortune, blockHardness, dispose, true); } - public static void removeBlockWithDrops(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int bx, int by, int bz, Block block, Material[] materialsListing, boolean silk, int fortune, float blockHardness, boolean dispose, boolean particles) { - if(!world.blockExists(x, y, z)) + public static void removeBlockWithDrops(EntityPlayer player, ItemStack stack, World world, BlockPos pos, BlockPos bPos, Block block, Material[] materialsListing, boolean silk, int fortune, float blockHardness, boolean dispose, boolean particles) { + if(!world.isBlockLoaded(pos)) return; - Block blk = world.getBlock(x, y, z); - int meta = world.getBlockMetadata(x, y, z); + IBlockState state = world.getBlockState(pos); + Block blk = state.getBlock(); if(block != null && blk != block) return; - Material mat = world.getBlock(x, y, z).getMaterial(); - if(!world.isRemote && blk != null && !blk.isAir(world, x, y, z) && blk.getPlayerRelativeBlockHardness(player, world, x, y, z) > 0) { - if(!blk.canHarvestBlock(player, meta) || !isRightMaterial(mat, materialsListing)) + Material mat = world.getBlockState(pos).getMaterial(); + if(!world.isRemote && blk != null && !blk.isAir(state, world, pos) && state.getPlayerRelativeBlockHardness(player, world, pos) > 0) { + if(!blk.canHarvestBlock(player.worldObj, pos, player) || !isRightMaterial(mat, materialsListing)) { return; + } if(!player.capabilities.isCreativeMode) { - int localMeta = world.getBlockMetadata(x, y, z); - blk.onBlockHarvested(world, x, y, z, localMeta, player); + IBlockState localState = world.getBlockState(pos); + blk.onBlockHarvested(world, pos, localState, player); - if(blk.removedByPlayer(world, player, x, y, z, true)) { - blk.onBlockDestroyedByPlayer(world, x, y, z, localMeta); + if(blk.removedByPlayer(state, world, pos, player, true)) { + blk.onBlockDestroyedByPlayer(world, pos, state); if(!dispose || !ItemElementiumPick.isDisposable(blk)) - blk.harvestBlock(world, player, x, y, z, localMeta); + blk.harvestBlock(world, player, pos, state, world.getTileEntity(pos), stack); } damageItem(stack, 1, player, 80); - } else world.setBlockToAir(x, y, z); + } else world.setBlockToAir(pos); if(particles && !world.isRemote && ConfigHandler.blockBreakParticles && ConfigHandler.blockBreakParticlesTool) - world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(blk) + (meta << 12)); + world.playEvent(2001, pos, Block.getStateId(state)); } } @@ -110,7 +117,7 @@ public final class ToolCommons { return 0; ItemTool tool = (ItemTool) item; - ToolMaterial material = tool.func_150913_i(); + ToolMaterial material = tool.getToolMaterial(); int materialLevel = 0; if(material == BotaniaAPI.manasteelToolMaterial) materialLevel = 10; @@ -123,23 +130,23 @@ public final class ToolCommons { if(item == ModItems.terraPick) modifier = ItemTerraPick.getLevel(stack); - int efficiency = EnchantmentHelper.getEnchantmentLevel(Enchantment.efficiency.effectId, stack); + int efficiency = EnchantmentHelper.getEnchantmentLevel(Enchantments.EFFICIENCY, stack); return materialLevel * 100 + modifier * 10 + efficiency; } /** * @author mDiyo */ - public static MovingObjectPosition raytraceFromEntity(World world, Entity player, boolean par3, double range) { + public static RayTraceResult raytraceFromEntity(World world, Entity player, boolean par3, double range) { float f = 1.0F; float f1 = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * f; float f2 = player.prevRotationYaw + (player.rotationYaw - player.prevRotationYaw) * f; double d0 = player.prevPosX + (player.posX - player.prevPosX) * f; double d1 = player.prevPosY + (player.posY - player.prevPosY) * f; - if (!world.isRemote && player instanceof EntityPlayer) + if (player instanceof EntityPlayer) d1 += ((EntityPlayer) player).eyeHeight; double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * f; - Vec3 vec3 = Vec3.createVectorHelper(d0, d1, d2); + Vec3d vec3 = new Vec3d(d0, d1, d2); float f3 = MathHelper.cos(-f2 * 0.017453292F - (float) Math.PI); float f4 = MathHelper.sin(-f2 * 0.017453292F - (float) Math.PI); float f5 = -MathHelper.cos(-f1 * 0.017453292F); @@ -147,7 +154,7 @@ public final class ToolCommons { float f7 = f4 * f5; float f8 = f3 * f5; double d3 = range; - Vec3 vec31 = vec3.addVector(f7 * d3, f6 * d3, f8 * d3); + Vec3d vec31 = vec3.addVector(f7 * d3, f6 * d3, f8 * d3); return world.rayTraceBlocks(vec3, vec31, par3); } diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/bow/ItemCrystalBow.java b/src/main/java/vazkii/botania/common/item/equipment/tool/bow/ItemCrystalBow.java index 541b15fd4..4a753c3c3 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/bow/ItemCrystalBow.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/bow/ItemCrystalBow.java @@ -10,12 +10,13 @@ */ package vazkii.botania.common.item.equipment.tool.bow; -import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.init.Enchantments; +import net.minecraft.init.Items; import net.minecraft.item.ItemStack; -import net.minecraft.world.World; import vazkii.botania.api.mana.ManaItemHandler; import vazkii.botania.common.lib.LibItemNames; @@ -33,20 +34,21 @@ public class ItemCrystalBow extends ItemLivingwoodBow { } @Override - boolean postsEvent() { - return false; + boolean canFire(ItemStack stack, EntityPlayer player) { + int infinity = EnchantmentHelper.getEnchantmentLevel(Enchantments.INFINITY, stack); + return player.capabilities.isCreativeMode || ManaItemHandler.requestManaExactForTool(stack, player, ARROW_COST / (infinity + 1), false); } @Override - boolean canFire(ItemStack p_77615_1_, World p_77615_2_, EntityPlayer p_77615_3_, int p_77615_4_) { - int infinity = EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, p_77615_1_); - return ManaItemHandler.requestManaExactForTool(p_77615_1_, p_77615_3_, ARROW_COST / (infinity + 1), false); + void onFire(ItemStack stack, EntityLivingBase living, boolean infinity, EntityArrow arrow) { + arrow.pickupStatus = EntityArrow.PickupStatus.CREATIVE_ONLY; + if(living instanceof EntityPlayer) + ManaItemHandler.requestManaExactForTool(stack, ((EntityPlayer) living), ARROW_COST / (infinity ? 2 : 1), false); } @Override - void onFire(ItemStack p_77615_1_, World p_77615_2_, EntityPlayer p_77615_3_, int p_77615_4_, boolean infinity, EntityArrow arrow) { - arrow.canBePickedUp = 2; - ManaItemHandler.requestManaExactForTool(p_77615_1_, p_77615_3_, ARROW_COST / (infinity ? 2 : 1), false); + protected ItemStack getAmmo(EntityLivingBase player) { + return new ItemStack(Items.ARROW); } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/bow/ItemLivingwoodBow.java b/src/main/java/vazkii/botania/common/item/equipment/tool/bow/ItemLivingwoodBow.java index c5ea853b9..3d775d710 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/bow/ItemLivingwoodBow.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/bow/ItemLivingwoodBow.java @@ -10,153 +10,196 @@ */ package vazkii.botania.common.item.equipment.tool.bow; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.enchantment.Enchantment; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.init.Enchantments; import net.minecraft.init.Items; -import net.minecraft.item.Item; +import net.minecraft.init.SoundEvents; +import net.minecraft.item.IItemPropertyGetter; +import net.minecraft.item.ItemArrow; import net.minecraft.item.ItemBow; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; +import net.minecraft.stats.StatList; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.SoundCategory; import net.minecraft.world.World; +import net.minecraftforge.client.model.ModelLoader; import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.ForgeEventFactory; import net.minecraftforge.event.entity.player.ArrowLooseEvent; -import net.minecraftforge.event.entity.player.ArrowNockEvent; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.mana.IManaUsingItem; import vazkii.botania.api.mana.ManaItemHandler; -import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.client.lib.LibResources; +import vazkii.botania.client.render.IModelRegister; +import vazkii.botania.common.Botania; import vazkii.botania.common.core.BotaniaCreativeTab; +import vazkii.botania.common.core.helper.PlayerHelper; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.item.equipment.tool.ToolCommons; import vazkii.botania.common.lib.LibItemNames; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import vazkii.botania.common.lib.LibMisc; -public class ItemLivingwoodBow extends ItemBow implements IManaUsingItem { +import javax.annotation.Nonnull; +import java.util.function.Predicate; +public class ItemLivingwoodBow extends ItemBow implements IManaUsingItem, IModelRegister { + + private static final Predicate AMMO_FUNC = s -> s != null && s.getItem() instanceof ItemArrow; public static final int MANA_PER_DAMAGE = 40; - IIcon[] pullIcons = new IIcon[3]; public ItemLivingwoodBow() { this(LibItemNames.LIVINGWOOD_BOW); } public ItemLivingwoodBow(String name) { - super(); setCreativeTab(BotaniaCreativeTab.INSTANCE); + GameRegistry.register(this, new ResourceLocation(LibMisc.MOD_ID, name)); setUnlocalizedName(name); setMaxDamage(500); - setFull3D(); + addPropertyOverride(new ResourceLocation("minecraft:pull"), (stack, worldIn, entityIn) -> { + if (entityIn == null) + { + return 0.0F; + } + else + { + ItemStack itemstack = entityIn.getActiveItemStack(); + return itemstack != null && itemstack.getItem() instanceof ItemLivingwoodBow ? (float)(stack.getMaxItemUseDuration() - entityIn.getItemInUseCount()) * chargeVelocityMultiplier() / 20.0F : 0.0F; + } + }); } + @Nonnull @Override - public Item setUnlocalizedName(String par1Str) { - GameRegistry.registerItem(this, par1Str); - return super.setUnlocalizedName(par1Str); - } - - @Override - public String getUnlocalizedNameInefficiently(ItemStack par1ItemStack) { + public String getUnlocalizedNameInefficiently(@Nonnull ItemStack par1ItemStack) { return super.getUnlocalizedNameInefficiently(par1ItemStack).replaceAll("item.", "item." + LibResources.PREFIX_MOD); } + @Nonnull @Override - public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { - ArrowNockEvent event = new ArrowNockEvent(p_77659_3_, p_77659_1_); - MinecraftForge.EVENT_BUS.post(event); - if(event.isCanceled()) - return event.result; + public ActionResult onItemRightClick(@Nonnull ItemStack stack, @Nonnull World world, EntityPlayer player, @Nonnull EnumHand hand) { + // Copy from superclass with our own check + boolean flag = canFire(stack, player); + ActionResult ret = ForgeEventFactory.onArrowNock(stack, world, player, hand, flag); + if (ret != null) return ret; - if(canFire(p_77659_1_, p_77659_2_, p_77659_3_, 0)) - p_77659_3_.setItemInUse(p_77659_1_, getMaxItemUseDuration(p_77659_1_)); - - return p_77659_1_; + if (!player.capabilities.isCreativeMode && !flag) + { + return new ActionResult<>(EnumActionResult.FAIL, stack); + } + else + { + player.setActiveHand(hand); + return new ActionResult<>(EnumActionResult.SUCCESS, stack); + } } @Override - public void onPlayerStoppedUsing(ItemStack p_77615_1_, World p_77615_2_, EntityPlayer p_77615_3_, int p_77615_4_) { - int j = (int) ((getMaxItemUseDuration(p_77615_1_) - p_77615_4_) * chargeVelocityMultiplier()); + public void onPlayerStoppedUsing(@Nonnull ItemStack stack, @Nonnull World world, EntityLivingBase shooter, int useTicks) { - ArrowLooseEvent event = new ArrowLooseEvent(p_77615_3_, p_77615_1_, j); - MinecraftForge.EVENT_BUS.post(event); - if(event.isCanceled()) - return; - j = event.charge; + boolean isPlayer = shooter instanceof EntityPlayer; + EntityPlayer player = isPlayer ? (EntityPlayer) shooter : null; - boolean flag = canFire(p_77615_1_, p_77615_2_, p_77615_3_, p_77615_4_); - boolean infinity = EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, p_77615_1_) > 0; + // Begin copy modified ItemBow.onPlayerStoppedUsing + boolean flag = !isPlayer || canFire(stack, player); // Botania - Custom canFire check + ItemStack itemstack = this.getAmmo(shooter); - if(flag) { - float f = j / 20.0F; - f = (f * f + f * 2.0F) / 3.0F; + int i = (int) ((getMaxItemUseDuration(stack) - useTicks) * chargeVelocityMultiplier()); // Botania - velocity multiplier + if(isPlayer) + i = net.minecraftforge.event.ForgeEventFactory.onArrowLoose(stack, world, player, i, itemstack != null || flag); + if (i < 0) return; - if(f < 0.1D) - return; + if (itemstack != null || flag) + { + if (itemstack == null) + { + itemstack = new ItemStack(Items.ARROW); + } - if(f > 1.0F) - f = 1.0F; + float f = getArrowVelocity(i); - EntityArrow entityarrow = makeArrow(p_77615_1_, p_77615_2_, p_77615_3_, p_77615_4_, f); + if ((double)f >= 0.1D) + { + boolean infinite = !isPlayer || player.capabilities.isCreativeMode || (itemstack.getItem() instanceof ItemArrow && ((ItemArrow) itemstack.getItem()).isInfinite(itemstack, stack, player)); - if(f == 1.0F) - entityarrow.setIsCritical(true); + if (!world.isRemote) + { + ItemArrow itemarrow = (ItemArrow) (itemstack.getItem() instanceof ItemArrow ? itemstack.getItem() : Items.ARROW); + EntityArrow entityarrow = itemarrow.createArrow(world, itemstack, shooter); + entityarrow.setAim(shooter, shooter.rotationPitch, shooter.rotationYaw, 0.0F, f * 3.0F, 1.0F); - int k = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, p_77615_1_); + if (f == 1.0F) + { + entityarrow.setIsCritical(true); + } - if(k > 0) - entityarrow.setDamage(entityarrow.getDamage() + k * 0.5D + 0.5D); + int j = EnchantmentHelper.getEnchantmentLevel(Enchantments.POWER, stack); - int l = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, p_77615_1_); + if (j > 0) + { + entityarrow.setDamage(entityarrow.getDamage() + (double)j * 0.5D + 0.5D); + } - if(l > 0) - entityarrow.setKnockbackStrength(l); + int k = EnchantmentHelper.getEnchantmentLevel(Enchantments.PUNCH, stack); - if(EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, p_77615_1_) > 0) - entityarrow.setFire(100); + if (k > 0) + { + entityarrow.setKnockbackStrength(k); + } - ToolCommons.damageItem(p_77615_1_, 1, p_77615_3_, MANA_PER_DAMAGE); - p_77615_2_.playSoundAtEntity(p_77615_3_, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + f * 0.5F); + if (EnchantmentHelper.getEnchantmentLevel(Enchantments.FLAME, stack) > 0) + { + entityarrow.setFire(100); + } - onFire(p_77615_1_, p_77615_2_, p_77615_3_, p_77615_4_, infinity, entityarrow); + // Botania - move bow damage into onFire (below) - if(!p_77615_2_.isRemote) - p_77615_2_.spawnEntityInWorld(entityarrow); + if (infinite) + { + entityarrow.pickupStatus = EntityArrow.PickupStatus.CREATIVE_ONLY; + } + + world.spawnEntityInWorld(entityarrow); + onFire(stack, shooter, infinite, entityarrow); + } + + + world.playSound(null, shooter.posX, shooter.posY, shooter.posZ, SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.NEUTRAL, 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + f * 0.5F); + + // Botania - move ammo consumption into onFire (above) + + if(isPlayer) + player.addStat(StatList.getObjectUseStats(this)); + } } + // End modified ItemBow.onPlayerStoppedUsing } float chargeVelocityMultiplier() { return 1F; } - boolean postsEvent() { - return true; + boolean canFire(ItemStack stack, EntityPlayer player) { + return player.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantments.INFINITY, stack) > 0 || PlayerHelper.hasAmmo(player, AMMO_FUNC); } - EntityArrow makeArrow(ItemStack p_77615_1_, World p_77615_2_, EntityPlayer p_77615_3_, int p_77615_4_, float f) { - return new EntityArrow(p_77615_2_, p_77615_3_, f * 2.0F); - } - - boolean canFire(ItemStack p_77615_1_, World p_77615_2_, EntityPlayer p_77615_3_, int p_77615_4_) { - return p_77615_3_.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, p_77615_1_) > 0 || p_77615_3_.inventory.hasItem(Items.arrow); - } - - void onFire(ItemStack p_77615_1_, World p_77615_2_, EntityPlayer p_77615_3_, int p_77615_4_, boolean infinity, EntityArrow arrow) { - if(infinity) - arrow.canBePickedUp = 2; - else p_77615_3_.inventory.consumeInventoryItem(Items.arrow); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) { - itemIcon = IconHelper.forItem(par1IconRegister, this, 0); - for(int i = 0; i < 3; i++) - pullIcons[i] = IconHelper.forItem(par1IconRegister, this, i + 1); + void onFire(ItemStack bow, EntityLivingBase living, boolean infinity, EntityArrow arrow) { + if(living instanceof EntityPlayerMP) { + ToolCommons.damageItem(bow, 1, living, MANA_PER_DAMAGE); + if(((EntityPlayerMP) living).interactionManager.getGameType().isSurvivalOrAdventure()) + PlayerHelper.consumeAmmo(((EntityPlayerMP) living), AMMO_FUNC); + } } @Override @@ -167,7 +210,7 @@ public class ItemLivingwoodBow extends ItemBow implements IManaUsingItem { @Override public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) { - return par2ItemStack.getItem() == ModItems.manaResource && par2ItemStack.getItemDamage() == 3 ? true : super.getIsRepairable(par1ItemStack, par2ItemStack); + return par2ItemStack.getItem() == ModItems.manaResource && par2ItemStack.getItemDamage() == 3 || super.getIsRepairable(par1ItemStack, par2ItemStack); } @Override @@ -175,21 +218,15 @@ public class ItemLivingwoodBow extends ItemBow implements IManaUsingItem { return true; } - @Override - public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { - if(stack != usingItem) - return itemIcon; - - int j = (int) ((getMaxItemUseDuration(stack) - useRemaining) * chargeVelocityMultiplier()); - - if(j >= 18) - return pullIcons[2]; - if(j > 13) - return pullIcons[1]; - if(j > 0) - return pullIcons[0]; - - return itemIcon; + protected ItemStack getAmmo(EntityLivingBase shooter) { + if(shooter instanceof EntityPlayer) + return PlayerHelper.getAmmo((EntityPlayer) shooter, AMMO_FUNC); + else return new ItemStack(Items.ARROW); } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory")); + } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumAxe.java b/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumAxe.java index 0357892a3..5f0fc1b75 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumAxe.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumAxe.java @@ -1,8 +1,5 @@ package vazkii.botania.common.item.equipment.tool.elementium; -import java.util.Random; - -import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.monster.EntityCreeper; @@ -10,17 +7,21 @@ import net.minecraft.entity.monster.EntityPigZombie; import net.minecraft.entity.monster.EntitySkeleton; import net.minecraft.entity.monster.EntityZombie; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Enchantments; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.living.LivingDropsEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import vazkii.botania.api.BotaniaAPI; +import vazkii.botania.common.Botania; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.entity.EntityDoppleganger; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.item.equipment.tool.manasteel.ItemManasteelAxe; import vazkii.botania.common.lib.LibItemNames; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +import java.util.Random; public class ItemElementiumAxe extends ItemManasteelAxe { @@ -34,32 +35,32 @@ public class ItemElementiumAxe extends ItemManasteelAxe { @SubscribeEvent public void onEntityDrops(LivingDropsEvent event) { - if(event.recentlyHit && event.source.getEntity() != null && event.source.getEntity() instanceof EntityPlayer) { - ItemStack weapon = ((EntityPlayer) event.source.getEntity()).getCurrentEquippedItem(); + if(event.isRecentlyHit() && event.getSource().getEntity() != null && event.getSource().getEntity() instanceof EntityPlayer) { + ItemStack weapon = ((EntityPlayer) event.getSource().getEntity()).getHeldItemMainhand(); if(weapon != null && weapon.getItem() == this) { - Random rand = event.entity.worldObj.rand; - int looting = EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, weapon); + Random rand = event.getEntityLiving().worldObj.rand; + int looting = EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, weapon); - if(event.entityLiving instanceof EntitySkeleton && rand.nextInt(26) <= 3 + looting) - addDrop(event, new ItemStack(Items.skull, 1, ((EntitySkeleton)event.entityLiving).getSkeletonType())); - else if(event.entityLiving instanceof EntityZombie && !(event.entityLiving instanceof EntityPigZombie) && rand.nextInt(26) <= 2 + 2 * looting) - addDrop(event, new ItemStack(Items.skull, 1, 2)); - else if(event.entityLiving instanceof EntityCreeper && rand.nextInt(26) <= 2 + 2 * looting) - addDrop(event, new ItemStack(Items.skull, 1, 4)); - else if(event.entityLiving instanceof EntityPlayer && rand.nextInt(11) <= 1 + looting) { - ItemStack stack = new ItemStack(Items.skull, 1, 3); - ItemNBTHelper.setString(stack, "SkullOwner", ((EntityPlayer)event.entityLiving).getCommandSenderName()); + if(event.getEntityLiving() instanceof EntitySkeleton && rand.nextInt(26) <= 3 + looting) + addDrop(event, new ItemStack(Items.SKULL, 1, ((EntitySkeleton) event.getEntityLiving()).func_189771_df().ordinal())); + else if(event.getEntityLiving() instanceof EntityZombie && !(event.getEntityLiving() instanceof EntityPigZombie) && rand.nextInt(26) <= 2 + 2 * looting) + addDrop(event, new ItemStack(Items.SKULL, 1, 2)); + else if(event.getEntityLiving() instanceof EntityCreeper && rand.nextInt(26) <= 2 + 2 * looting) + addDrop(event, new ItemStack(Items.SKULL, 1, 4)); + else if(event.getEntityLiving() instanceof EntityPlayer && rand.nextInt(11) <= 1 + looting) { + ItemStack stack = new ItemStack(Items.SKULL, 1, 3); + ItemNBTHelper.setString(stack, "SkullOwner", event.getEntityLiving().getName()); addDrop(event, stack); - } else if(event.entityLiving instanceof EntityDoppleganger && rand.nextInt(13) < 1 + looting) + } else if(event.getEntityLiving() instanceof EntityDoppleganger && rand.nextInt(13) < 1 + looting) addDrop(event, new ItemStack(ModItems.gaiaHead)); } } } private void addDrop(LivingDropsEvent event, ItemStack drop) { - EntityItem entityitem = new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, drop); - entityitem.delayBeforeCanPickup = 10; - event.drops.add(entityitem); + EntityItem entityitem = new EntityItem(event.getEntityLiving().worldObj, event.getEntityLiving().posX, event.getEntityLiving().posY, event.getEntityLiving().posZ, drop); + entityitem.setPickupDelay(10); + event.getDrops().add(entityitem); } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumPick.java b/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumPick.java index bead2f8fc..adc263411 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumPick.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumPick.java @@ -1,19 +1,16 @@ package vazkii.botania.common.item.equipment.tool.elementium; -import java.util.Arrays; -import java.util.List; - import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.world.BlockEvent.HarvestDropsEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.oredict.OreDictionary; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.item.equipment.tool.manasteel.ItemManasteelPick; import vazkii.botania.common.item.equipment.tool.terrasteel.ItemTerraPick; import vazkii.botania.common.lib.LibItemNames; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class ItemElementiumPick extends ItemManasteelPick { @@ -24,17 +21,14 @@ public class ItemElementiumPick extends ItemManasteelPick { @SubscribeEvent public void onHarvestDrops(HarvestDropsEvent event) { - if(event.harvester != null) { - ItemStack stack = event.harvester.getCurrentEquippedItem(); + if(event.getHarvester() != null) { + ItemStack stack = event.getHarvester().getHeldItemMainhand(); if(stack != null && (stack.getItem() == this || stack.getItem() == ModItems.terraPick && ItemTerraPick.isTipped(stack))) { - for(int i = 0; i < event.drops.size(); i++) { - ItemStack drop = event.drops.get(i); + for(int i = 0; i < event.getDrops().size(); i++) { + ItemStack drop = event.getDrops().get(i); if(drop != null) { - Block block = Block.getBlockFromItem(drop.getItem()); - if(block != null){ - if(isDisposable(block) || (isSemiDisposable(block) && !event.harvester.isSneaking())) - event.drops.remove(i); - } + if(isDisposable(drop) || (isSemiDisposable(drop) && !event.getHarvester().isSneaking())) + event.getDrops().remove(i); } } } @@ -42,7 +36,11 @@ public class ItemElementiumPick extends ItemManasteelPick { } public static boolean isDisposable(Block block) { - for(int id : OreDictionary.getOreIDs(new ItemStack(block))) { + return isDisposable(new ItemStack(block)); + } + + private static boolean isDisposable(ItemStack stack) { + for(int id : OreDictionary.getOreIDs(stack)) { String name = OreDictionary.getOreName(id); if(BotaniaAPI.disposableBlocks.contains(name)) return true; @@ -50,8 +48,12 @@ public class ItemElementiumPick extends ItemManasteelPick { return false; } - public static boolean isSemiDisposable(Block block) { - for(int id : OreDictionary.getOreIDs(new ItemStack(block))) { + private static boolean isSemiDisposable(Block block) { + return isSemiDisposable(new ItemStack(block)); + } + + private static boolean isSemiDisposable(ItemStack stack) { + for(int id : OreDictionary.getOreIDs(stack)) { String name = OreDictionary.getOreName(id); if(BotaniaAPI.semiDisposableBlocks.contains(name)) return true; diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumShears.java b/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumShears.java index 00d373f29..f1e51222f 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumShears.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumShears.java @@ -1,39 +1,46 @@ package vazkii.botania.common.item.equipment.tool.elementium; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.enchantment.Enchantment; +import com.google.common.base.Predicates; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Enchantments; import net.minecraft.item.EnumAction; +import net.minecraft.item.IItemPropertyGetter; import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.IIcon; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.common.IShearable; -import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.common.item.equipment.tool.ToolCommons; import vazkii.botania.common.item.equipment.tool.manasteel.ItemManasteelShears; import vazkii.botania.common.lib.LibItemNames; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import vazkii.botania.common.lib.LibMisc; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.util.List; +import java.util.Locale; +import java.util.Random; public class ItemElementiumShears extends ItemManasteelShears { - IIcon dammitReddit; - public ItemElementiumShears() { super(LibItemNames.ELEMENTIUM_SHEARS); + addPropertyOverride(new ResourceLocation(LibMisc.MOD_ID, "reddit"), + (stack, worldIn, entityIn) -> stack.getDisplayName().equalsIgnoreCase("dammit reddit") ? 1F: 0F); } + @Nonnull @Override public EnumAction getItemUseAction(ItemStack par1ItemStack) { - return EnumAction.bow; + return EnumAction.BOW; } @Override @@ -41,37 +48,26 @@ public class ItemElementiumShears extends ItemManasteelShears { return 72000; } + @Nonnull @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - par3EntityPlayer.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack)); - return par1ItemStack; + public ActionResult onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) { + player.setActiveHand(hand); + return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack); } @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) { - super.registerIcons(par1IconRegister); - dammitReddit = IconHelper.forName(par1IconRegister, "dammitReddit"); - } - - @Override - public IIcon getIconIndex(ItemStack par1ItemStack) { - return par1ItemStack.getDisplayName().equalsIgnoreCase("dammit reddit") ? dammitReddit : super.getIconIndex(par1ItemStack); - } - - @Override - public void onUsingTick(ItemStack stack, EntityPlayer player, int count) { - if(player.worldObj.isRemote) + public void onUsingTick(ItemStack stack, EntityLivingBase living, int count) { + if(living.worldObj.isRemote) return; if(count != getMaxItemUseDuration(stack) && count % 5 == 0) { int range = 12; - List sheep = player.worldObj.getEntitiesWithinAABB(IShearable.class, AxisAlignedBB.getBoundingBox(player.posX - range, player.posY - range, player.posZ - range, player.posX + range, player.posY + range, player.posZ + range)); + List sheep = living.worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(living.posX - range, living.posY - range, living.posZ - range, living.posX + range, living.posY + range, living.posZ + range), Predicates.instanceOf(IShearable.class)); if(sheep.size() > 0) { - for(IShearable target : sheep) { + for(IShearable target : ((List) sheep)) { Entity entity = (Entity) target; - if(target.isShearable(stack, entity.worldObj, (int)entity.posX, (int)entity.posY, (int)entity.posZ)) { - ArrayList drops = target.onSheared(stack, entity.worldObj, (int)entity.posX, (int)entity.posY, (int)entity.posZ, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, stack)); + if(target.isShearable(stack, entity.worldObj, new BlockPos(entity))) { + List drops = target.onSheared(stack, entity.worldObj, new BlockPos(entity), EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, stack)); Random rand = new Random(); for(ItemStack drop : drops) { @@ -81,7 +77,7 @@ public class ItemElementiumShears extends ItemManasteelShears { ent.motionZ += (rand.nextFloat() - rand.nextFloat()) * 0.1F; } - ToolCommons.damageItem(stack, 1, player, MANA_PER_DAMAGE); + ToolCommons.damageItem(stack, 1, living, MANA_PER_DAMAGE); break; } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumShovel.java b/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumShovel.java index 1c2ca7df0..2f41b7764 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumShovel.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumShovel.java @@ -5,10 +5,11 @@ import net.minecraft.block.BlockFalling; import net.minecraft.block.material.Material; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Enchantments; import net.minecraft.item.ItemStack; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.common.item.equipment.tool.ToolCommons; import vazkii.botania.common.item.equipment.tool.manasteel.ItemManasteelShovel; @@ -16,30 +17,29 @@ import vazkii.botania.common.lib.LibItemNames; public class ItemElementiumShovel extends ItemManasteelShovel { - public static Material[] materialsShovel = new Material[]{ Material.grass, Material.ground, Material.sand, Material.snow, Material.craftedSnow, Material.clay }; + public static final Material[] materialsShovel = new Material[]{ Material.GRASS, Material.GROUND, Material.SAND, Material.SNOW, Material.CRAFTED_SNOW, Material.CLAY }; public ItemElementiumShovel() { super(BotaniaAPI.elementiumToolMaterial, LibItemNames.ELEMENTIUM_SHOVEL); } @Override - public boolean onBlockStartBreak(ItemStack stack, int x, int y, int z, EntityPlayer player) { + public boolean onBlockStartBreak(ItemStack stack, BlockPos pos, EntityPlayer player) { World world = player.worldObj; - Material mat = world.getBlock(x, y, z).getMaterial(); + Material mat = world.getBlockState(pos).getMaterial(); if (!ToolCommons.isRightMaterial(mat, materialsShovel)) return false; - MovingObjectPosition block = ToolCommons.raytraceFromEntity(world, player, true, 10); + RayTraceResult block = ToolCommons.raytraceFromEntity(world, player, true, 10); if (block == null) return false; - ForgeDirection.getOrientation(block.sideHit); - int fortune = EnchantmentHelper.getFortuneModifier(player); - boolean silk = EnchantmentHelper.getSilkTouchModifier(player); + int fortune = EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, player.getHeldItemMainhand()); + boolean silk = EnchantmentHelper.getEnchantmentLevel(Enchantments.SILK_TOUCH, player.getHeldItemMainhand()) > 0; - Block blk = world.getBlock(x, y, z); + Block blk = world.getBlockState(pos).getBlock(); if(blk instanceof BlockFalling) - ToolCommons.removeBlocksInIteration(player, stack, world, x, y, z, 0, -12, 0, 1, 12, 1, blk, materialsShovel, silk, fortune, false); + ToolCommons.removeBlocksInIteration(player, stack, world, pos, new BlockPos(0, -12, 0), new BlockPos(1, 12, 1), blk, materialsShovel, silk, fortune, false); return false; } diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/manasteel/ItemManasteelAxe.java b/src/main/java/vazkii/botania/common/item/equipment/tool/manasteel/ItemManasteelAxe.java index 6d673dd6d..ca607fc4f 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/manasteel/ItemManasteelAxe.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/manasteel/ItemManasteelAxe.java @@ -10,34 +10,44 @@ */ package vazkii.botania.common.item.equipment.tool.manasteel; -import java.util.regex.Pattern; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.texture.IIconRegister; +import com.google.common.collect.ImmutableSet; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; -import net.minecraft.item.Item; import net.minecraft.item.ItemAxe; import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.item.ISortableTool; import vazkii.botania.api.mana.IManaUsingItem; import vazkii.botania.api.mana.ManaItemHandler; import vazkii.botania.client.core.handler.ItemsRemainingRenderHandler; -import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.client.lib.LibResources; +import vazkii.botania.client.render.IModelRegister; import vazkii.botania.common.core.BotaniaCreativeTab; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.item.equipment.tool.ToolCommons; import vazkii.botania.common.lib.LibItemNames; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import vazkii.botania.common.lib.LibMisc; -public class ItemManasteelAxe extends ItemAxe implements IManaUsingItem, ISortableTool { +import javax.annotation.Nonnull; +import java.util.Set; +import java.util.regex.Pattern; + +public class ItemManasteelAxe extends ItemAxe implements IManaUsingItem, ISortableTool, IModelRegister { private static final Pattern SAPLING_PATTERN = Pattern.compile("(?:(?:(?:[A-Z-_.:]|^)sapling)|(?:(?:[a-z-_.:]|^)Sapling))(?:[A-Z-_.:]|$)"); @@ -48,37 +58,27 @@ public class ItemManasteelAxe extends ItemAxe implements IManaUsingItem, ISortab } public ItemManasteelAxe(ToolMaterial mat, String name) { - super(mat); + super(mat, 8F, -3.1F); setCreativeTab(BotaniaCreativeTab.INSTANCE); + GameRegistry.register(this, new ResourceLocation(LibMisc.MOD_ID, name)); setUnlocalizedName(name); } + @Nonnull @Override - public Item setUnlocalizedName(String par1Str) { - GameRegistry.registerItem(this, par1Str); - return super.setUnlocalizedName(par1Str); - } - - @Override - public String getUnlocalizedNameInefficiently(ItemStack par1ItemStack) { + public String getUnlocalizedNameInefficiently(@Nonnull ItemStack par1ItemStack) { return super.getUnlocalizedNameInefficiently(par1ItemStack).replaceAll("item.", "item." + LibResources.PREFIX_MOD); } @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) { - itemIcon = IconHelper.forItem(par1IconRegister, this); - } - - @Override - public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) { + public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, @Nonnull EntityLivingBase par3EntityLivingBase) { ToolCommons.damageItem(par1ItemStack, 1, par3EntityLivingBase, getManaPerDamage()); return true; } @Override - public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x, int y, int z, EntityLivingBase entity) { - if (block.getBlockHardness(world, x, y, z) != 0F) + public boolean onBlockDestroyed(@Nonnull ItemStack stack, @Nonnull World world, IBlockState state, @Nonnull BlockPos pos, @Nonnull EntityLivingBase entity) { + if (state.getBlockHardness(world, pos) != 0F) ToolCommons.damageItem(stack, 1, entity, getManaPerDamage()); return true; @@ -88,21 +88,22 @@ public class ItemManasteelAxe extends ItemAxe implements IManaUsingItem, ISortab return MANA_PER_DAMAGE; } + @Nonnull @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int s, float sx, float sy, float sz) { + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float sx, float sy, float sz) { for(int i = 0; i < player.inventory.getSizeInventory(); i++) { ItemStack stackAt = player.inventory.getStackInSlot(i); if(stackAt != null && SAPLING_PATTERN.matcher(stackAt.getItem().getUnlocalizedName()).find()) { - boolean did = stackAt.getItem().onItemUse(stackAt, player, world, x, y, z, s, sx, sy, sz); + EnumActionResult did = stackAt.getItem().onItemUse(stackAt, player, world, pos, hand, side, sx, sy, sz); if(stackAt.stackSize == 0) player.inventory.setInventorySlotContents(i, null); - ItemsRemainingRenderHandler.set(player, new ItemStack(Blocks.sapling), SAPLING_PATTERN); + ItemsRemainingRenderHandler.set(player, new ItemStack(Blocks.SAPLING), SAPLING_PATTERN); return did; } } - return false; + return EnumActionResult.PASS; } @@ -113,7 +114,7 @@ public class ItemManasteelAxe extends ItemAxe implements IManaUsingItem, ISortab } @Override - public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) { + public boolean getIsRepairable(ItemStack par1ItemStack, @Nonnull ItemStack par2ItemStack) { return par2ItemStack.getItem() == ModItems.manaResource && par2ItemStack.getItemDamage() == 0 ? true : super.getIsRepairable(par1ItemStack, par2ItemStack); } @@ -132,4 +133,9 @@ public class ItemManasteelAxe extends ItemAxe implements IManaUsingItem, ISortab return ToolCommons.getToolPriority(stack); } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory")); + } } \ No newline at end of file diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/manasteel/ItemManasteelPick.java b/src/main/java/vazkii/botania/common/item/equipment/tool/manasteel/ItemManasteelPick.java index 0682455c1..10a7f128d 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/manasteel/ItemManasteelPick.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/manasteel/ItemManasteelPick.java @@ -10,34 +10,41 @@ */ package vazkii.botania.common.item.equipment.tool.manasteel; -import java.util.regex.Pattern; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; -import net.minecraft.item.Item; import net.minecraft.item.ItemPickaxe; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.item.ISortableTool; import vazkii.botania.api.mana.IManaUsingItem; import vazkii.botania.api.mana.ManaItemHandler; import vazkii.botania.client.core.handler.ItemsRemainingRenderHandler; -import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.client.lib.LibResources; +import vazkii.botania.client.render.IModelRegister; import vazkii.botania.common.core.BotaniaCreativeTab; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.item.equipment.tool.ToolCommons; import vazkii.botania.common.lib.LibItemNames; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import vazkii.botania.common.lib.LibMisc; -public class ItemManasteelPick extends ItemPickaxe implements IManaUsingItem, ISortableTool { +import javax.annotation.Nonnull; +import java.util.regex.Pattern; + +public class ItemManasteelPick extends ItemPickaxe implements IManaUsingItem, ISortableTool, IModelRegister { private static final Pattern TORCH_PATTERN = Pattern.compile("(?:(?:(?:[A-Z-_.:]|^)torch)|(?:(?:[a-z-_.:]|^)Torch))(?:[A-Z-_.:]|$)"); @@ -50,55 +57,46 @@ public class ItemManasteelPick extends ItemPickaxe implements IManaUsingItem, IS public ItemManasteelPick(ToolMaterial mat, String name) { super(mat); setCreativeTab(BotaniaCreativeTab.INSTANCE); + GameRegistry.register(this, new ResourceLocation(LibMisc.MOD_ID, name)); setUnlocalizedName(name); } + @Nonnull @Override - public Item setUnlocalizedName(String par1Str) { - GameRegistry.registerItem(this, par1Str); - return super.setUnlocalizedName(par1Str); - } - - @Override - public String getUnlocalizedNameInefficiently(ItemStack par1ItemStack) { + public String getUnlocalizedNameInefficiently(@Nonnull ItemStack par1ItemStack) { return super.getUnlocalizedNameInefficiently(par1ItemStack).replaceAll("item.", "item." + LibResources.PREFIX_MOD); } @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) { - itemIcon = IconHelper.forItem(par1IconRegister, this); - } - - @Override - public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) { + public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, @Nonnull EntityLivingBase par3EntityLivingBase) { ToolCommons.damageItem(par1ItemStack, 1, par3EntityLivingBase, getManaPerDmg()); return true; } @Override - public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x, int y, int z, EntityLivingBase entity) { - if(block.getBlockHardness(world, x, y, z) != 0F) + public boolean onBlockDestroyed(@Nonnull ItemStack stack, @Nonnull World world, IBlockState state, @Nonnull BlockPos pos, @Nonnull EntityLivingBase entity) { + if(state.getBlockHardness(world, pos) != 0F) ToolCommons.damageItem(stack, 1, entity, getManaPerDmg()); return true; } + @Nonnull @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int s, float sx, float sy, float sz) { + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float sx, float sy, float sz) { for(int i = 0; i < player.inventory.getSizeInventory(); i++) { ItemStack stackAt = player.inventory.getStackInSlot(i); if(stackAt != null && TORCH_PATTERN.matcher(stackAt.getItem().getUnlocalizedName()).find()) { - boolean did = stackAt.getItem().onItemUse(stackAt, player, world, x, y, z, s, sx, sy, sz); + EnumActionResult did = stackAt.getItem().onItemUse(stackAt, player, world, pos, hand, side, sx, sy, sz); if(stackAt.stackSize == 0) player.inventory.setInventorySlotContents(i, null); - ItemsRemainingRenderHandler.set(player, new ItemStack(Blocks.torch), TORCH_PATTERN); + ItemsRemainingRenderHandler.set(player, new ItemStack(Blocks.TORCH), TORCH_PATTERN); return did; } } - return false; + return EnumActionResult.PASS; } public int getManaPerDmg() { @@ -112,7 +110,7 @@ public class ItemManasteelPick extends ItemPickaxe implements IManaUsingItem, IS } @Override - public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) { + public boolean getIsRepairable(ItemStack par1ItemStack, @Nonnull ItemStack par2ItemStack) { return par2ItemStack.getItem() == ModItems.manaResource && par2ItemStack.getItemDamage() == 0 ? true : super.getIsRepairable(par1ItemStack, par2ItemStack); } @@ -131,4 +129,9 @@ public class ItemManasteelPick extends ItemPickaxe implements IManaUsingItem, IS return ToolCommons.getToolPriority(stack); } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory")); + } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/manasteel/ItemManasteelShears.java b/src/main/java/vazkii/botania/common/item/equipment/tool/manasteel/ItemManasteelShears.java index 17a2c650e..957a750a1 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/manasteel/ItemManasteelShears.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/manasteel/ItemManasteelShears.java @@ -10,36 +10,41 @@ */ package vazkii.botania.common.item.equipment.tool.manasteel; -import java.util.ArrayList; -import java.util.Random; - import net.minecraft.block.Block; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.enchantment.Enchantment; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; +import net.minecraft.init.Enchantments; import net.minecraft.item.ItemShears; import net.minecraft.item.ItemStack; import net.minecraft.stats.StatList; +import net.minecraft.util.EnumHand; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.client.model.ModelLoader; import net.minecraftforge.common.IShearable; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.mana.IManaUsingItem; import vazkii.botania.api.mana.ManaItemHandler; -import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.client.lib.LibResources; +import vazkii.botania.client.render.IModelRegister; import vazkii.botania.common.core.BotaniaCreativeTab; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.item.equipment.tool.ToolCommons; import vazkii.botania.common.lib.LibItemNames; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import vazkii.botania.common.lib.LibMisc; -public class ItemManasteelShears extends ItemShears implements IManaUsingItem { +import javax.annotation.Nonnull; +import java.util.List; +import java.util.Random; + +public class ItemManasteelShears extends ItemShears implements IManaUsingItem, IModelRegister { public static final int MANA_PER_DAMAGE = 30; @@ -49,35 +54,25 @@ public class ItemManasteelShears extends ItemShears implements IManaUsingItem { public ItemManasteelShears(String name) { setCreativeTab(BotaniaCreativeTab.INSTANCE); + GameRegistry.register(this, new ResourceLocation(LibMisc.MOD_ID, name)); setUnlocalizedName(name); } + @Nonnull @Override - public Item setUnlocalizedName(String par1Str) { - GameRegistry.registerItem(this, par1Str); - return super.setUnlocalizedName(par1Str); - } - - @Override - public String getUnlocalizedNameInefficiently(ItemStack par1ItemStack) { + public String getUnlocalizedNameInefficiently(@Nonnull ItemStack par1ItemStack) { return super.getUnlocalizedNameInefficiently(par1ItemStack).replaceAll("item.", "item." + LibResources.PREFIX_MOD); } @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) { - itemIcon = IconHelper.forItem(par1IconRegister, this); - } - - @Override - public boolean itemInteractionForEntity(ItemStack itemstack, EntityPlayer player, EntityLivingBase entity) { + public boolean itemInteractionForEntity(@Nonnull ItemStack itemstack, EntityPlayer player, EntityLivingBase entity, EnumHand hand) { if(entity.worldObj.isRemote) return false; if(entity instanceof IShearable) { IShearable target = (IShearable)entity; - if(target.isShearable(itemstack, entity.worldObj, (int) entity.posX, (int) entity.posY, (int) entity.posZ)) { - ArrayList drops = target.onSheared(itemstack, entity.worldObj, (int) entity.posX, (int) entity.posY, (int) entity.posZ, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack)); + if(target.isShearable(itemstack, entity.worldObj, new BlockPos(entity))) { + List drops = target.onSheared(itemstack, entity.worldObj, new BlockPos(entity), EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, itemstack)); Random rand = new Random(); for(ItemStack stack : drops) { @@ -97,15 +92,15 @@ public class ItemManasteelShears extends ItemShears implements IManaUsingItem { } @Override - public boolean onBlockStartBreak(ItemStack itemstack, int x, int y, int z, EntityPlayer player) { + public boolean onBlockStartBreak(@Nonnull ItemStack itemstack, @Nonnull BlockPos pos, EntityPlayer player) { if (player.worldObj.isRemote) return false; - Block block = player.worldObj.getBlock(x, y, z); + Block block = player.worldObj.getBlockState(pos).getBlock(); if(block instanceof IShearable) { IShearable target = (IShearable)block; - if(target.isShearable(itemstack, player.worldObj, x, y, z)) { - ArrayList drops = target.onSheared(itemstack, player.worldObj, x, y, z, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack)); + if(target.isShearable(itemstack, player.worldObj, pos)) { + List drops = target.onSheared(itemstack, player.worldObj, pos, EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, itemstack)); Random rand = new Random(); for(ItemStack stack : drops) { @@ -114,13 +109,13 @@ public class ItemManasteelShears extends ItemShears implements IManaUsingItem { double d1 = rand.nextFloat() * f + (1D - f) * 0.5; double d2 = rand.nextFloat() * f + (1D - f) * 0.5; - EntityItem entityitem = new EntityItem(player.worldObj, x + d, y + d1, z + d2, stack); - entityitem.delayBeforeCanPickup = 10; + EntityItem entityitem = new EntityItem(player.worldObj, pos.getX() + d, pos.getY() + d1, pos.getZ() + d2, stack); + entityitem.setPickupDelay(10); player.worldObj.spawnEntityInWorld(entityitem); } ToolCommons.damageItem(itemstack, 1, player, MANA_PER_DAMAGE); - player.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(block)], 1); + player.addStat(StatList.getBlockStats(block), 1); } } @@ -142,4 +137,10 @@ public class ItemManasteelShears extends ItemShears implements IManaUsingItem { public boolean usesMana(ItemStack stack) { return true; } + + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory")); + } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/manasteel/ItemManasteelShovel.java b/src/main/java/vazkii/botania/common/item/equipment/tool/manasteel/ItemManasteelShovel.java index 985a84a57..5623f1008 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/manasteel/ItemManasteelShovel.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/manasteel/ItemManasteelShovel.java @@ -11,33 +11,43 @@ package vazkii.botania.common.item.equipment.tool.manasteel; import net.minecraft.block.Block; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; -import net.minecraft.item.Item; import net.minecraft.item.ItemSpade; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.client.model.ModelLoader; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.UseHoeEvent; +import net.minecraftforge.fml.common.eventhandler.Event.Result; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.item.ISortableTool; import vazkii.botania.api.mana.IManaUsingItem; import vazkii.botania.api.mana.ManaItemHandler; -import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.client.lib.LibResources; +import vazkii.botania.client.render.IModelRegister; import vazkii.botania.common.core.BotaniaCreativeTab; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.item.equipment.tool.ToolCommons; import vazkii.botania.common.lib.LibItemNames; -import cpw.mods.fml.common.eventhandler.Event.Result; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import vazkii.botania.common.lib.LibMisc; -public class ItemManasteelShovel extends ItemSpade implements IManaUsingItem, ISortableTool { +import javax.annotation.Nonnull; + +public class ItemManasteelShovel extends ItemSpade implements IManaUsingItem, ISortableTool, IModelRegister { private static final int MANA_PER_DAMAGE = 60; @@ -48,70 +58,61 @@ public class ItemManasteelShovel extends ItemSpade implements IManaUsingItem, IS public ItemManasteelShovel(ToolMaterial mat, String name) { super(mat); setCreativeTab(BotaniaCreativeTab.INSTANCE); + GameRegistry.register(this, new ResourceLocation(LibMisc.MOD_ID, name)); setUnlocalizedName(name); } + @Nonnull @Override - public Item setUnlocalizedName(String par1Str) { - GameRegistry.registerItem(this, par1Str); - return super.setUnlocalizedName(par1Str); - } - - @Override - public String getUnlocalizedNameInefficiently(ItemStack par1ItemStack) { + public String getUnlocalizedNameInefficiently(@Nonnull ItemStack par1ItemStack) { return super.getUnlocalizedNameInefficiently(par1ItemStack).replaceAll("item.", "item." + LibResources.PREFIX_MOD); } @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) { - itemIcon = IconHelper.forItem(par1IconRegister, this); - } - - @Override - public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) { + public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, @Nonnull EntityLivingBase par3EntityLivingBase) { ToolCommons.damageItem(par1ItemStack, 1, par3EntityLivingBase, MANA_PER_DAMAGE); return true; } @Override - public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x, int y, int z, EntityLivingBase entity) { - if (block.getBlockHardness(world, x, y, z) != 0F) + public boolean onBlockDestroyed(@Nonnull ItemStack stack, @Nonnull World world, IBlockState state, @Nonnull BlockPos pos, @Nonnull EntityLivingBase entity) { + if (state.getBlockHardness(world, pos) != 0F) ToolCommons.damageItem(stack, 1, entity, MANA_PER_DAMAGE); return true; } + @Nonnull @Override - public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { - if(!p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_)) - return false; + public EnumActionResult onItemUse(@Nonnull ItemStack stack, EntityPlayer player, @Nonnull World world, BlockPos pos, EnumHand hand, @Nonnull EnumFacing side, float hitX, float hitY, float hitZ) { + if(!player.canPlayerEdit(pos, side, stack)) + return EnumActionResult.PASS; else { - UseHoeEvent event = new UseHoeEvent(p_77648_2_, p_77648_1_, p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_); + UseHoeEvent event = new UseHoeEvent(player, stack, world, pos); if(MinecraftForge.EVENT_BUS.post(event)) - return false; + return EnumActionResult.FAIL; if(event.getResult() == Result.ALLOW) { - ToolCommons.damageItem(p_77648_1_, 1, p_77648_2_, MANA_PER_DAMAGE); - return true; + ToolCommons.damageItem(stack, 1, player, MANA_PER_DAMAGE); + return EnumActionResult.SUCCESS; } - Block block = p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_); + Block block = world.getBlockState(pos).getBlock(); - if(p_77648_7_ != 0 && p_77648_3_.getBlock(p_77648_4_, p_77648_5_ + 1, p_77648_6_).isAir(p_77648_3_, p_77648_4_, p_77648_5_ + 1, p_77648_6_) && (block == Blocks.grass || block == Blocks.dirt)) { - Block block1 = Blocks.farmland; - p_77648_3_.playSoundEffect(p_77648_4_ + 0.5F, p_77648_5_ + 0.5F, p_77648_6_ + 0.5F, block1.stepSound.getStepResourcePath(), (block1.stepSound.getVolume() + 1.0F) / 2.0F, block1.stepSound.getPitch() * 0.8F); + if(side != EnumFacing.DOWN && world.getBlockState(pos.up()).getBlock().isAir(world.getBlockState(pos.up()), world, pos.up()) && (block == Blocks.GRASS || block == Blocks.DIRT)) { + Block block1 = Blocks.FARMLAND; + world.playSound(null, pos, block1.getSoundType().getStepSound(), SoundCategory.BLOCKS, (block1.getSoundType().getVolume() + 1.0F) / 2.0F, block1.getSoundType().getPitch() * 0.8F); - if (p_77648_3_.isRemote) - return true; + if (world.isRemote) + return EnumActionResult.SUCCESS; else { - p_77648_3_.setBlock(p_77648_4_, p_77648_5_, p_77648_6_, block1); - ToolCommons.damageItem(p_77648_1_, 1, p_77648_2_, MANA_PER_DAMAGE); - return true; + world.setBlockState(pos, block1.getDefaultState()); + ToolCommons.damageItem(stack, 1, player, MANA_PER_DAMAGE); + return EnumActionResult.SUCCESS; } } - return false; + return EnumActionResult.PASS; } } @@ -122,7 +123,7 @@ public class ItemManasteelShovel extends ItemSpade implements IManaUsingItem, IS } @Override - public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) { + public boolean getIsRepairable(ItemStack par1ItemStack, @Nonnull ItemStack par2ItemStack) { return par2ItemStack.getItem() == ModItems.manaResource && par2ItemStack.getItemDamage() == 0 ? true : super.getIsRepairable(par1ItemStack, par2ItemStack); } @@ -141,4 +142,9 @@ public class ItemManasteelShovel extends ItemSpade implements IManaUsingItem, IS return ToolCommons.getToolPriority(stack); } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory")); + } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/manasteel/ItemManasteelSword.java b/src/main/java/vazkii/botania/common/item/equipment/tool/manasteel/ItemManasteelSword.java index dc7a7d226..51075af7d 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/manasteel/ItemManasteelSword.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/manasteel/ItemManasteelSword.java @@ -10,35 +10,38 @@ */ package vazkii.botania.common.item.equipment.tool.manasteel; -import net.minecraft.block.Block; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; +import net.minecraft.item.IItemPropertyGetter; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemSword; -import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.mana.IManaUsingItem; import vazkii.botania.api.mana.ManaItemHandler; -import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.client.lib.LibResources; +import vazkii.botania.client.render.IModelRegister; import vazkii.botania.common.core.BotaniaCreativeTab; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.item.equipment.tool.ToolCommons; import vazkii.botania.common.lib.LibItemNames; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import vazkii.botania.common.lib.LibMisc; -public class ItemManasteelSword extends ItemSword implements IManaUsingItem { +import javax.annotation.Nonnull; + +public class ItemManasteelSword extends ItemSword implements IManaUsingItem, IModelRegister { public static final int MANA_PER_DAMAGE = 60; - public static IIcon elucidatorIcon; - public ItemManasteelSword() { this(BotaniaAPI.manasteelToolMaterial, LibItemNames.MANASTEEL_SWORD); } @@ -46,48 +49,28 @@ public class ItemManasteelSword extends ItemSword implements IManaUsingItem { public ItemManasteelSword(ToolMaterial mat, String name) { super(mat); setCreativeTab(BotaniaCreativeTab.INSTANCE); + GameRegistry.register(this, new ResourceLocation(LibMisc.MOD_ID, name)); setUnlocalizedName(name); + addPropertyOverride(new ResourceLocation("botania", "elucidator"), + (stack, worldIn, entityIn) -> "the elucidator".equals(stack.getDisplayName().toLowerCase().trim()) ? 1 : 0); } + @Nonnull @Override - public Item setUnlocalizedName(String par1Str) { - GameRegistry.registerItem(this, par1Str); - return super.setUnlocalizedName(par1Str); - } - - @Override - public String getUnlocalizedNameInefficiently(ItemStack par1ItemStack) { + public String getUnlocalizedNameInefficiently(@Nonnull ItemStack par1ItemStack) { return super.getUnlocalizedNameInefficiently(par1ItemStack).replaceAll("item.", "item." + LibResources.PREFIX_MOD); } @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) { - itemIcon = IconHelper.forItem(par1IconRegister, this); - elucidatorIcon = IconHelper.forName(par1IconRegister, "elucidator"); - } - - @Override - public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) { + public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, @Nonnull EntityLivingBase par3EntityLivingBase) { if(usesMana(par1ItemStack)) ToolCommons.damageItem(par1ItemStack, 1, par3EntityLivingBase, getManaPerDamage()); return true; } @Override - public IIcon getIconIndex(ItemStack par1ItemStack) { - String name = par1ItemStack.getDisplayName().toLowerCase().trim(); - return name.equals("the elucidator") ? elucidatorIcon : super.getIconIndex(par1ItemStack); - } - - @Override - public IIcon getIcon(ItemStack stack, int pass) { - return getIconIndex(stack); - } - - @Override - public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x, int y, int z, EntityLivingBase entity) { - if(usesMana(stack) && block.getBlockHardness(world, x, y, z) != 0F) + public boolean onBlockDestroyed(@Nonnull ItemStack stack, @Nonnull World world, IBlockState state, @Nonnull BlockPos pos, @Nonnull EntityLivingBase entity) { + if(usesMana(stack) && state.getBlockHardness(world, pos) != 0F) ToolCommons.damageItem(stack, 1, entity, getManaPerDamage()); return true; @@ -104,7 +87,7 @@ public class ItemManasteelSword extends ItemSword implements IManaUsingItem { } @Override - public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) { + public boolean getIsRepairable(ItemStack par1ItemStack, @Nonnull ItemStack par2ItemStack) { return par2ItemStack.getItem() == ModItems.manaResource && par2ItemStack.getItemDamage() == 0 ? true : super.getIsRepairable(par1ItemStack, par2ItemStack); } @@ -113,4 +96,9 @@ public class ItemManasteelSword extends ItemSword implements IManaUsingItem { return true; } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory")); + } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraAxe.java b/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraAxe.java index 11ad6a5bf..45c2d870e 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraAxe.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraAxe.java @@ -10,39 +10,40 @@ */ package vazkii.botania.common.item.equipment.tool.terrasteel; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.PriorityQueue; -import java.util.Set; - +import gnu.trove.map.hash.TIntObjectHashMap; import net.minecraft.block.Block; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Enchantments; +import net.minecraft.item.IItemPropertyGetter; import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.IIcon; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.item.ISequentialBreaker; -import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.common.item.ItemTemperanceStone; import vazkii.botania.common.item.equipment.tool.ToolCommons; import vazkii.botania.common.item.equipment.tool.manasteel.ItemManasteelAxe; import vazkii.botania.common.item.relic.ItemLokiRing; import vazkii.botania.common.lib.LibItemNames; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.TickEvent; -import cpw.mods.fml.common.gameevent.TickEvent.Phase; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import vazkii.botania.common.lib.LibMisc; + +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Objects; +import java.util.PriorityQueue; +import java.util.Set; public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker { @@ -51,7 +52,7 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker * The number of blocks per tick which the Terra Truncator will * collect. */ - public static final int BLOCK_SWAP_RATE = 10; + private static final int BLOCK_SWAP_RATE = 10; /** * The maximum radius (in blocks) which the Terra Truncator will go @@ -63,7 +64,7 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker * The maximum number of leaf blocks which the Terra Truncator will chew/go * through once a leaf block is encountered. */ - public static final int LEAF_BLOCK_RANGE = 3; + private static final int LEAF_BLOCK_RANGE = 3; /** * The amount of mana required to restore 1 point of damage. @@ -74,42 +75,29 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker * Represents a map of dimension IDs to a set of all block swappers * active in that dimension. */ - private static Map> blockSwappers = new HashMap>(); - - IIcon iconOn, iconOff; + private static final TIntObjectHashMap> blockSwappers = new TIntObjectHashMap<>(); public ItemTerraAxe() { super(BotaniaAPI.terrasteelToolMaterial, LibItemNames.TERRA_AXE); - FMLCommonHandler.instance().bus().register(this); + MinecraftForge.EVENT_BUS.register(this); + this.attackSpeed = -3f; + addPropertyOverride(new ResourceLocation(LibMisc.MOD_ID, "terraaxe_on"), (stack, world, entity) -> { + if(entity instanceof EntityPlayer && !shouldBreak(((EntityPlayer) entity))) + return 0; + return 1; + }); } - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) { - iconOn = IconHelper.forItem(par1IconRegister, this, 0); - iconOff = IconHelper.forItem(par1IconRegister, this, 1); - } - - @Override - public IIcon getIconFromDamage(int p_77617_1_) { - return iconOn; - } - - @Override - public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { - return shouldBreak(player) ? iconOn : iconOff; - } - - public boolean shouldBreak(EntityPlayer player) { + private boolean shouldBreak(EntityPlayer player) { return !player.isSneaking() && !ItemTemperanceStone.hasTemperanceActive(player); } @Override - public boolean onBlockStartBreak(ItemStack stack, int x, int y, int z, EntityPlayer player) { - MovingObjectPosition raycast = ToolCommons.raytraceFromEntity(player.worldObj, player, true, 10); + public boolean onBlockStartBreak(ItemStack stack, BlockPos pos, EntityPlayer player) { + RayTraceResult raycast = ToolCommons.raytraceFromEntity(player.worldObj, player, true, 10); if(raycast != null) { - breakOtherBlock(player, stack, x, y, z, x, y, z, raycast.sideHit); - ItemLokiRing.breakOnAllCursors(player, this, stack, x, y, z, raycast.sideHit); + breakOtherBlock(player, stack, pos, pos, raycast.sideHit); + ItemLokiRing.breakOnAllCursors(player, this, stack, pos, raycast.sideHit); } return false; @@ -121,10 +109,9 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker } @Override - public void breakOtherBlock(EntityPlayer player, ItemStack stack, int x, int y, int z, int originX, int originY, int originZ, int side) { + public void breakOtherBlock(EntityPlayer player, ItemStack stack, BlockPos pos, BlockPos originPos, EnumFacing side) { if(shouldBreak(player)) { - ChunkCoordinates coords = new ChunkCoordinates(x, y, z); - addBlockSwapper(player.worldObj, player, stack, coords, 32, true); + addBlockSwapper(player.worldObj, player, stack, pos, 32, true); } } @@ -140,7 +127,7 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker return; if(event.phase == Phase.END) { - int dim = event.world.provider.dimensionId; + int dim = event.world.provider.getDimension(); if(blockSwappers.containsKey(dim)) { Set swappers = blockSwappers.get(dim); @@ -171,24 +158,21 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker * @param steps The range of the block swapper, in blocks. * @param leaves If true, will treat leaves specially (see the BlockSwapper * documentation). - * @return The created block swapper. */ - private static BlockSwapper addBlockSwapper(World world, EntityPlayer player, ItemStack stack, ChunkCoordinates origCoords, int steps, boolean leaves) { + private static void addBlockSwapper(World world, EntityPlayer player, ItemStack stack, BlockPos origCoords, int steps, boolean leaves) { BlockSwapper swapper = new BlockSwapper(world, player, stack, origCoords, steps, leaves); // Block swapper registration should only occur on the server if(world.isRemote) - return swapper; + return; // If the mapping for this dimension doesn't exist, create it. - int dim = world.provider.dimensionId; + int dim = world.provider.getDimension(); if(!blockSwappers.containsKey(dim)) - blockSwappers.put(dim, new HashSet()); + blockSwappers.put(dim, new HashSet<>()); // Add the swapper blockSwappers.get(dim).add(swapper); - - return swapper; } /** @@ -213,8 +197,7 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker * for the next candidates for swapping. 1 is a good default. */ public static final int SINGLE_BLOCK_RADIUS = 1; - - + /** * The world the block swapper is doing the swapping in. */ @@ -233,7 +216,7 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker /** * The origin of the swapper (eg, where it started). */ - private final ChunkCoordinates origin; + private final BlockPos origin; /** * Denotes whether leaves should be treated specially. @@ -248,13 +231,13 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker /** * The priority queue of all possible candidates for swapping. */ - private PriorityQueue candidateQueue; + private final PriorityQueue candidateQueue; /** * The set of already swaps coordinates which do not have * to be revisited. */ - private Set completedCoords; + private final Set completedCoords; /** * Creates a new block swapper with the provided parameters. @@ -266,7 +249,7 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker * @param leaves If true, leaves will be treated specially and * severely reduce the radius of further spreading when encountered. */ - public BlockSwapper(World world, EntityPlayer player, ItemStack truncator, ChunkCoordinates origCoords, int range, boolean leaves) { + public BlockSwapper(World world, EntityPlayer player, ItemStack truncator, BlockPos origCoords, int range, boolean leaves) { this.world = world; this.player = player; this.truncator = truncator; @@ -274,8 +257,8 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker this.range = range; this.treatLeavesSpecial = leaves; - this.candidateQueue = new PriorityQueue(); - this.completedCoords = new HashSet(); + this.candidateQueue = new PriorityQueue<>(); + this.completedCoords = new HashSet<>(); // Add the origin to our candidate queue with the original range candidateQueue.offer(new SwapCandidate(this.origin, this.range)); @@ -310,11 +293,11 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker // Otherwise, perform the break and then look at the adjacent tiles. // This is a ridiculous function call here. ToolCommons.removeBlockWithDrops(player, truncator, world, - cand.coordinates.posX, cand.coordinates.posY, cand.coordinates.posZ, - origin.posX, origin.posY, origin.posZ, + cand.coordinates, + origin, null, ToolCommons.materialsAxe, - EnchantmentHelper.getEnchantmentLevel(Enchantment.silkTouch.effectId, truncator) > 0, - EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, truncator), + EnchantmentHelper.getEnchantmentLevel(Enchantments.SILK_TOUCH, truncator) > 0, + EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, truncator), 0F, false, treatLeavesSpecial); remainingSwaps--; @@ -323,11 +306,11 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker // Then, go through all of the adjacent blocks and look if // any of them are any good. - for(ChunkCoordinates adj : adjacent(cand.coordinates)) { - Block block = world.getBlock(adj.posX, adj.posY, adj.posZ); + for(BlockPos adj : adjacent(cand.coordinates)) { + Block block = world.getBlockState(adj).getBlock(); - boolean isWood = block.isWood(world, adj.posX, adj.posY, adj.posZ); - boolean isLeaf = block.isLeaves(world, adj.posX, adj.posY, adj.posZ); + boolean isWood = block.isWood(world, adj); + boolean isLeaf = block.isLeaves(world.getBlockState(adj), world, adj); // If it's not wood or a leaf, we aren't interested. if(!isWood && !isLeaf) @@ -348,8 +331,8 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker return true; } - public List adjacent(ChunkCoordinates original) { - List coords = new ArrayList(); + public List adjacent(BlockPos original) { + List coords = new ArrayList<>(); // Visit all the surrounding blocks in the provided radius. // Gotta love these nested loops, right? for(int dx = -SINGLE_BLOCK_RADIUS; dx <= SINGLE_BLOCK_RADIUS; dx++) @@ -359,12 +342,12 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker if(dx == 0 && dy == 0 && dz == 0) continue; - coords.add(new ChunkCoordinates(original.posX + dx, original.posY + dy, original.posZ + dz)); + coords.add(original.add(dx, dy, dz)); } return coords; } - + /** * Represents a potential candidate for swapping/removal. Sorted by * range (where a larger range is more preferable). As we're using @@ -376,12 +359,12 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker /** * The location of this swap candidate. */ - public ChunkCoordinates coordinates; + public final BlockPos coordinates; /** * The remaining range of this swap candidate. */ - public int range; + public final int range; /** * Constructs a new Swap Candidate with the provided @@ -389,13 +372,13 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker * @param coordinates The coordinates of this candidate. * @param range The remaining range of this candidate. */ - public SwapCandidate(ChunkCoordinates coordinates, int range) { + public SwapCandidate(BlockPos coordinates, int range) { this.coordinates = coordinates; this.range = range; } @Override - public int compareTo(SwapCandidate other) { + public int compareTo(@Nonnull SwapCandidate other) { // Aka, a bigger range implies a smaller value, meaning // bigger ranges will be preferred in a min-heap return other.range - range; @@ -408,6 +391,11 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker SwapCandidate cand = (SwapCandidate) other; return coordinates.equals(cand.coordinates) && range == cand.range; } + + @Override + public int hashCode() { + return Objects.hash(coordinates, range); + } } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraPick.java b/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraPick.java index a9b1d39b2..177ec3045 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraPick.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraPick.java @@ -10,47 +10,49 @@ */ package vazkii.botania.common.item.equipment.tool.terrasteel; -import java.awt.Color; -import java.util.List; - import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.resources.I18n; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Enchantments; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IIcon; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.StatCollector; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.oredict.RecipeSorter; import net.minecraftforge.oredict.RecipeSorter.Category; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.item.ISequentialBreaker; import vazkii.botania.api.mana.IManaGivingItem; import vazkii.botania.api.mana.IManaItem; -import vazkii.botania.client.core.helper.IconHelper; +import vazkii.botania.api.sound.BotaniaSoundEvents; import vazkii.botania.common.achievement.ModAchievements; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.crafting.recipe.TerraPickTippingRecipe; -import vazkii.botania.common.item.ItemSpark; import vazkii.botania.common.item.ItemTemperanceStone; import vazkii.botania.common.item.ModItems; -import vazkii.botania.common.item.equipment.bauble.ItemAuraRing; -import vazkii.botania.common.item.equipment.bauble.ItemGreaterAuraRing; import vazkii.botania.common.item.equipment.tool.ToolCommons; import vazkii.botania.common.item.equipment.tool.manasteel.ItemManasteelPick; import vazkii.botania.common.item.relic.ItemLokiRing; import vazkii.botania.common.item.relic.ItemThorRing; import vazkii.botania.common.lib.LibItemNames; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import javax.annotation.Nonnull; +import java.util.List; public class ItemTerraPick extends ItemManasteelPick implements IManaItem, ISequentialBreaker { @@ -61,7 +63,7 @@ public class ItemTerraPick extends ItemManasteelPick implements IManaItem, ISequ private static final int MAX_MANA = Integer.MAX_VALUE; private static final int MANA_PER_DAMAGE = 100; - private static final Material[] MATERIALS = new Material[] { Material.rock, Material.iron, Material.ice, Material.glass, Material.piston, Material.anvil, Material.grass, Material.ground, Material.sand, Material.snow, Material.craftedSnow, Material.clay }; + private static final Material[] MATERIALS = new Material[] { Material.ROCK, Material.IRON, Material.ICE, Material.GLASS, Material.PISTON, Material.ANVIL, Material.GRASS, Material.GROUND, Material.SAND, Material.SNOW, Material.CRAFTED_SNOW, Material.CLAY }; public static final int[] LEVELS = new int[] { 0, 10000, 1000000, 10000000, 100000000, 1000000000 @@ -71,16 +73,17 @@ public class ItemTerraPick extends ItemManasteelPick implements IManaItem, ISequ 10000 - 1, 1000000 - 1, 10000000 - 1, 100000000 - 1, 1000000000 - 1, MAX_MANA - 1 }; - IIcon iconTool, iconOverlay, iconTipped; - public ItemTerraPick() { super(BotaniaAPI.terrasteelToolMaterial, LibItemNames.TERRA_PICK); GameRegistry.addRecipe(new TerraPickTippingRecipe()); RecipeSorter.register("botania:terraPickTipping", TerraPickTippingRecipe.class, Category.SHAPELESS, ""); + addPropertyOverride(new ResourceLocation("botania", "tipped"), (itemStack, world, entityLivingBase) -> isTipped(itemStack) ? 1 : 0); + addPropertyOverride(new ResourceLocation("botania", "enabled"), (itemStack, world, entityLivingBase) -> isEnabled(itemStack) ? 1 : 0); } @Override - public void getSubItems(Item item, CreativeTabs tab, List list) { + @SideOnly(Side.CLIENT) + public void getSubItems(@Nonnull Item item, CreativeTabs tab, List list) { for(int mana : CREATIVE_MANA) { ItemStack stack = new ItemStack(item); setMana(stack, mana); @@ -88,37 +91,41 @@ public class ItemTerraPick extends ItemManasteelPick implements IManaItem, ISequ } } + @SideOnly(Side.CLIENT) @Override - public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { - String rankFormat = StatCollector.translateToLocal("botaniamisc.toolRank"); - String rank = StatCollector.translateToLocal("botania.rank" + getLevel(par1ItemStack)); - par3List.add(String.format(rankFormat, rank).replaceAll("&", "\u00a7")); + public void addInformation(ItemStack par1ItemStack, EntityPlayer player, List stacks, boolean par4) { + String rank = I18n.format("botania.rank" + getLevel(par1ItemStack)); + String rankFormat = I18n.format("botaniamisc.toolRank", rank); + stacks.add(rankFormat.replaceAll("&", "\u00a7")); if(getMana(par1ItemStack) == Integer.MAX_VALUE) - par3List.add(EnumChatFormatting.RED + StatCollector.translateToLocal("botaniamisc.getALife")); + stacks.add(TextFormatting.RED + I18n.format("botaniamisc.getALife")); } + @Nonnull @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { + public ActionResult onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) { getMana(par1ItemStack); int level = getLevel(par1ItemStack); if(level != 0) { setEnabled(par1ItemStack, !isEnabled(par1ItemStack)); - if(!par2World.isRemote) - par2World.playSoundAtEntity(par3EntityPlayer, "botania:terraPickMode", 0.5F, 0.4F); + if(!world.isRemote) + world.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.terraPickMode, SoundCategory.PLAYERS, 0.5F, 0.4F); } - return par1ItemStack; + return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack); + } + + @Nonnull + @Override + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float sx, float sy, float sz) { + return player.isSneaking() ? super.onItemUse(stack, player, world, pos, hand, side, sx, sy, sz) + : EnumActionResult.PASS; } @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int s, float sx, float sy, float sz) { - return player.isSneaking() && super.onItemUse(stack, player, world, x, y, z, s, sx, sy, sz); - } - - @Override - public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) { - super.onUpdate(par1ItemStack, par2World, par3Entity, par4, par5); + public void onUpdate(ItemStack par1ItemStack, World world, Entity par3Entity, int par4, boolean par5) { + super.onUpdate(par1ItemStack, world, par3Entity, par4, par5); if(isEnabled(par1ItemStack)) { int level = getLevel(par1ItemStack); @@ -130,11 +137,11 @@ public class ItemTerraPick extends ItemManasteelPick implements IManaItem, ISequ } @Override - public boolean onBlockStartBreak(ItemStack stack, int x, int y, int z, EntityPlayer player) { - MovingObjectPosition raycast = ToolCommons.raytraceFromEntity(player.worldObj, player, true, 10); - if(raycast != null) { - breakOtherBlock(player, stack, x, y, z, x, y, z, raycast.sideHit); - ItemLokiRing.breakOnAllCursors(player, this, stack, x, y, z, raycast.sideHit); + public boolean onBlockStartBreak(ItemStack stack, BlockPos pos, EntityPlayer player) { + RayTraceResult raycast = ToolCommons.raytraceFromEntity(player.worldObj, player, true, 10); + if(!player.worldObj.isRemote && raycast != null) { + breakOtherBlock(player, stack, pos, pos, raycast.sideHit); + ItemLokiRing.breakOnAllCursors(player, this, stack, pos, raycast.sideHit); // ^ Doable with API access through the IInternalMethodHandler. } @@ -147,38 +154,40 @@ public class ItemTerraPick extends ItemManasteelPick implements IManaItem, ISequ } @Override - public void breakOtherBlock(EntityPlayer player, ItemStack stack, int x, int y, int z, int originX, int originY, int originZ, int side) { + public void breakOtherBlock(EntityPlayer player, ItemStack stack, BlockPos pos, BlockPos originPos, EnumFacing side) { if(!isEnabled(stack)) return; World world = player.worldObj; - Material mat = world.getBlock(x, y, z).getMaterial(); + Material mat = world.getBlockState(pos).getMaterial(); if(!ToolCommons.isRightMaterial(mat, MATERIALS)) return; - if(world.isAirBlock(x, y, z)) + if(world.isAirBlock(pos)) return; - ForgeDirection direction = ForgeDirection.getOrientation(side); - int fortune = EnchantmentHelper.getFortuneModifier(player); - boolean silk = EnchantmentHelper.getSilkTouchModifier(player); + int fortune = EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, player.getHeldItemMainhand()); + boolean silk = EnchantmentHelper.getEnchantmentLevel(Enchantments.SILK_TOUCH, player.getHeldItemMainhand()) > 0; boolean thor = ItemThorRing.getThorRing(player) != null; - boolean doX = thor || direction.offsetX == 0; - boolean doY = thor || direction.offsetY == 0; - boolean doZ = thor || direction.offsetZ == 0; + boolean doX = thor || side.getFrontOffsetX() == 0; + boolean doY = thor || side.getFrontOffsetY() == 0; + boolean doZ = thor || side.getFrontOffsetZ() == 0; int origLevel = getLevel(stack); int level = origLevel + (thor ? 1 : 0); if(ItemTemperanceStone.hasTemperanceActive(player) && level > 2) level = 2; - int range = Math.max(0, level - 1); + int range = level - 1; int rangeY = Math.max(1, range); if(range == 0 && level != 1) return; - ToolCommons.removeBlocksInIteration(player, stack, world, x, y, z, doX ? -range : 0, doY ? -1 : 0, doZ ? -range : 0, doX ? range + 1 : 1, doY ? rangeY * 2 : 1, doZ ? range + 1 : 1, null, MATERIALS, silk, fortune, isTipped(stack)); + BlockPos beginDiff = new BlockPos(doX ? -range : 0, doY ? -1 : 0, doZ ? -range : 0); + BlockPos endDiff = new BlockPos(doX ? range : 0, doY ? rangeY * 2 - 1 : 0, doZ ? range : 0); + + ToolCommons.removeBlocksInIteration(player, stack, world, pos, beginDiff, endDiff, null, MATERIALS, silk, fortune, isTipped(stack)); if(origLevel == 5) player.addStat(ModAchievements.rankSSPick, 1); } @@ -188,23 +197,6 @@ public class ItemTerraPick extends ItemManasteelPick implements IManaItem, ISequ return Integer.MAX_VALUE; } - @Override - public void registerIcons(IIconRegister par1IconRegister) { - iconTool = IconHelper.forItem(par1IconRegister, this, 0); - iconOverlay = IconHelper.forItem(par1IconRegister, this, 1); - iconTipped = IconHelper.forItem(par1IconRegister, this, 2); - } - - @Override - public boolean requiresMultipleRenderPasses() { - return true; - } - - @Override - public IIcon getIcon(ItemStack stack, int pass) { - return pass == 1 && isEnabled(stack) ? iconOverlay : isTipped(stack) ? iconTipped : iconTool; - } - public static boolean isTipped(ItemStack stack) { return ItemNBTHelper.getBoolean(stack, TAG_TIPPED, false); } @@ -213,16 +205,7 @@ public class ItemTerraPick extends ItemManasteelPick implements IManaItem, ISequ ItemNBTHelper.setBoolean(stack, TAG_TIPPED, true); } - @Override - @SideOnly(Side.CLIENT) - public int getColorFromItemStack(ItemStack par1ItemStack, int par2) { - if(par2 == 0 || !isEnabled(par1ItemStack)) - return 0xFFFFFF; - - return Color.HSBtoRGB(0.375F, (float) Math.min(1F, Math.sin(System.currentTimeMillis() / 200D) * 0.5 + 1F), 1F); - } - - boolean isEnabled(ItemStack stack) { + public static boolean isEnabled(ItemStack stack) { return ItemNBTHelper.getBoolean(stack, TAG_ENABLED, false); } @@ -288,7 +271,7 @@ public class ItemTerraPick extends ItemManasteelPick implements IManaItem, ISequ } @Override - public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) { + public boolean getIsRepairable(ItemStack par1ItemStack, @Nonnull ItemStack par2ItemStack) { return par2ItemStack.getItem() == ModItems.manaResource && par2ItemStack.getItemDamage() == 4 ? true : super.getIsRepairable(par1ItemStack, par2ItemStack); } @@ -297,4 +280,9 @@ public class ItemTerraPick extends ItemManasteelPick implements IManaItem, ISequ return isTipped(stack); } + @Override + public boolean shouldCauseReequipAnimation(ItemStack before, @Nonnull ItemStack after, boolean slotChanged) { + return after.getItem() != this || isEnabled(before) != isEnabled(after); + } + } diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraSword.java b/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraSword.java index 4865193ec..f19ee6299 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraSword.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraSword.java @@ -10,26 +10,26 @@ */ package vazkii.botania.common.item.equipment.tool.terrasteel; -import java.util.List; - -import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.server.MinecraftServer; import net.minecraft.stats.Achievement; -import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.DamageSource; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.RayTraceResult; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.player.AttackEntityEvent; +import net.minecraftforge.event.entity.player.PlayerInteractEvent; +import net.minecraftforge.fml.common.FMLCommonHandler; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.internal.IManaBurst; import vazkii.botania.api.mana.BurstProperties; import vazkii.botania.api.mana.ILensEffect; +import vazkii.botania.api.sound.BotaniaSoundEvents; import vazkii.botania.common.achievement.ICraftAchievement; import vazkii.botania.common.achievement.ModAchievements; import vazkii.botania.common.core.helper.ItemNBTHelper; @@ -38,6 +38,11 @@ import vazkii.botania.common.item.ModItems; import vazkii.botania.common.item.equipment.tool.ToolCommons; import vazkii.botania.common.item.equipment.tool.manasteel.ItemManasteelSword; import vazkii.botania.common.lib.LibItemNames; +import vazkii.botania.common.network.PacketHandler; +import vazkii.botania.common.network.PacketLeftClick; + +import javax.annotation.Nonnull; +import java.util.List; public class ItemTerraSword extends ItemManasteelSword implements ILensEffect, ICraftAchievement { @@ -47,22 +52,32 @@ public class ItemTerraSword extends ItemManasteelSword implements ILensEffect, I public ItemTerraSword() { super(BotaniaAPI.terrasteelToolMaterial, LibItemNames.TERRA_SWORD); + MinecraftForge.EVENT_BUS.register(this); } - @Override - public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) { - super.onUpdate(par1ItemStack, par2World, par3Entity, par4, par5); - if(par3Entity instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer) par3Entity; - PotionEffect haste = player.getActivePotionEffect(Potion.digSpeed); - float check = haste == null ? 0.16666667F : haste.getAmplifier() == 1 ? 0.5F : 0.4F; + @SubscribeEvent + public void leftClick(PlayerInteractEvent.LeftClickEmpty evt) { + if (evt.getItemStack() != null + && evt.getItemStack().getItem() == this) { + PacketHandler.sendToServer(new PacketLeftClick()); + } + } - if(player.getCurrentEquippedItem() == par1ItemStack && player.swingProgress == check && !par2World.isRemote && par2World.rand.nextInt(2) == 0) { - EntityManaBurst burst = getBurst(player, par1ItemStack); - par2World.spawnEntityInWorld(burst); - ToolCommons.damageItem(par1ItemStack, 1, player, MANA_PER_DAMAGE); - par2World.playSoundAtEntity(player, "botania:terraBlade", 0.4F, 1.4F); - } + @SubscribeEvent + public void attackEntity(AttackEntityEvent evt) { + if (!evt.getEntityPlayer().worldObj.isRemote) { + trySpawnBurst(evt.getEntityPlayer()); + } + } + + public void trySpawnBurst(EntityPlayer player) { + if (player.getHeldItemMainhand() != null + && player.getHeldItemMainhand().getItem() == this + && player.getCooledAttackStrength(0) == 1) { + EntityManaBurst burst = getBurst(player, player.getHeldItemMainhand()); + player.worldObj.spawnEntityInWorld(burst); + ToolCommons.damageItem(player.getHeldItemMainhand(), 1, player, MANA_PER_DAMAGE); + player.worldObj.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.terraBlade, SoundCategory.PLAYERS, 0.4F, 1.4F); } } @@ -85,30 +100,28 @@ public class ItemTerraSword extends ItemManasteelSword implements ILensEffect, I burst.setMotion(burst.motionX * motionModifier, burst.motionY * motionModifier, burst.motionZ * motionModifier); ItemStack lens = stack.copy(); - ItemNBTHelper.setString(lens, TAG_ATTACKER_USERNAME, player.getCommandSenderName()); + ItemNBTHelper.setString(lens, TAG_ATTACKER_USERNAME, player.getName()); burst.setSourceLens(lens); return burst; } @Override - public void apply(ItemStack stack, BurstProperties props) { - // NO-OP - } + public void apply(ItemStack stack, BurstProperties props) {} @Override - public boolean collideBurst(IManaBurst burst, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) { + public boolean collideBurst(IManaBurst burst, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) { return dead; } @Override public void updateBurst(IManaBurst burst, ItemStack stack) { EntityThrowable entity = (EntityThrowable) burst; - AxisAlignedBB axis = AxisAlignedBB.getBoundingBox(entity.posX, entity.posY, entity.posZ, entity.lastTickPosX, entity.lastTickPosY, entity.lastTickPosZ).expand(1, 1, 1); + AxisAlignedBB axis = new AxisAlignedBB(entity.posX, entity.posY, entity.posZ, entity.lastTickPosX, entity.lastTickPosY, entity.lastTickPosZ).expand(1, 1, 1); List entities = entity.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axis); String attacker = ItemNBTHelper.getString(burst.getSourceLens(), TAG_ATTACKER_USERNAME, ""); for(EntityLivingBase living : entities) { - if(living instanceof EntityPlayer && (((EntityPlayer) living).getCommandSenderName().equals(attacker) || MinecraftServer.getServer() != null && !MinecraftServer.getServer().isPVPEnabled())) + if(living instanceof EntityPlayer && (living.getName().equals(attacker) || FMLCommonHandler.instance().getMinecraftServerInstance() != null && !FMLCommonHandler.instance().getMinecraftServerInstance().isPVPEnabled())) continue; if(living.hurtTime == 0) { @@ -134,7 +147,7 @@ public class ItemTerraSword extends ItemManasteelSword implements ILensEffect, I } @Override - public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) { + public boolean getIsRepairable(ItemStack par1ItemStack, @Nonnull ItemStack par2ItemStack) { return par2ItemStack.getItem() == ModItems.manaResource && par2ItemStack.getItemDamage() == 4 ? true : super.getIsRepairable(par1ItemStack, par2ItemStack); } diff --git a/src/main/java/vazkii/botania/common/item/interaction/thaumcraft/ItemElementiumHelmRevealing.java b/src/main/java/vazkii/botania/common/item/interaction/thaumcraft/ItemElementiumHelmRevealing.java index 7fdb8e56c..eb87351fd 100644 --- a/src/main/java/vazkii/botania/common/item/interaction/thaumcraft/ItemElementiumHelmRevealing.java +++ b/src/main/java/vazkii/botania/common/item/interaction/thaumcraft/ItemElementiumHelmRevealing.java @@ -11,18 +11,19 @@ package vazkii.botania.common.item.interaction.thaumcraft; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemStack; -import thaumcraft.api.IGoggles; -import thaumcraft.api.nodes.IRevealer; +import net.minecraftforge.fml.common.Optional; +import thaumcraft.api.items.IGoggles; +import thaumcraft.api.items.IRevealer; import vazkii.botania.client.lib.LibResources; import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.item.equipment.armor.elementium.ItemElementiumHelm; import vazkii.botania.common.lib.LibItemNames; -import cpw.mods.fml.common.Optional; @Optional.InterfaceList({ - @Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.IGoggles", striprefs = true), - @Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.nodes.IRevealer", striprefs = true)}) + @Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.items.IGoggles", striprefs = true), + @Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.items.IRevealer", striprefs = true)}) public class ItemElementiumHelmRevealing extends ItemElementiumHelm implements IGoggles, IRevealer { public ItemElementiumHelmRevealing() { @@ -40,7 +41,7 @@ public class ItemElementiumHelmRevealing extends ItemElementiumHelm implements I } @Override - public String getArmorTextureAfterInk(ItemStack stack, int slot) { + public String getArmorTextureAfterInk(ItemStack stack, EntityEquipmentSlot slot) { return ConfigHandler.enableArmorModels ? LibResources.MODEL_ELEMENTIUM_NEW : LibResources.MODEL_ELEMENTIUM_2; } diff --git a/src/main/java/vazkii/botania/common/item/interaction/thaumcraft/ItemManaInkwell.java b/src/main/java/vazkii/botania/common/item/interaction/thaumcraft/ItemManaInkwell.java index b7c1cea9f..a99b2d4bf 100644 --- a/src/main/java/vazkii/botania/common/item/interaction/thaumcraft/ItemManaInkwell.java +++ b/src/main/java/vazkii/botania/common/item/interaction/thaumcraft/ItemManaInkwell.java @@ -10,21 +10,24 @@ */ package vazkii.botania.common.item.interaction.thaumcraft; -import java.util.List; - import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import thaumcraft.api.IScribeTools; +import net.minecraftforge.fml.common.Optional; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import thaumcraft.api.items.IScribeTools; import vazkii.botania.api.mana.IManaItem; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.item.ItemMod; import vazkii.botania.common.lib.LibItemNames; -import cpw.mods.fml.common.Optional; -@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.IScribeTools") +import javax.annotation.Nonnull; +import java.util.List; + +@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.items.IScribeTools") public class ItemManaInkwell extends ItemMod implements IManaItem, IScribeTools { private static final int COST_PER_USE = 50; @@ -34,14 +37,15 @@ public class ItemManaInkwell extends ItemMod implements IManaItem, IScribeTools private static final String TAG_MANA = "mana"; public ItemManaInkwell() { - setUnlocalizedName(LibItemNames.MANA_INKWELL); + super(LibItemNames.MANA_INKWELL); setMaxDamage(USES); setMaxStackSize(1); setNoRepair(); } @Override - public void getSubItems(Item item, CreativeTabs tab, List list) { + @SideOnly(Side.CLIENT) + public void getSubItems(@Nonnull Item item, CreativeTabs tab, List list) { list.add(new ItemStack(item, 1, USES)); list.add(new ItemStack(item)); } @@ -66,11 +70,6 @@ public class ItemManaInkwell extends ItemMod implements IManaItem, IScribeTools super.setDamage(stack, damage); } - @Override - public int getDisplayDamage(ItemStack stack) { - return getDamage(stack); - } - @Override public int getEntityLifespan(ItemStack itemStack, World world) { return Integer.MAX_VALUE; diff --git a/src/main/java/vazkii/botania/common/item/interaction/thaumcraft/ItemManasteelHelmRevealing.java b/src/main/java/vazkii/botania/common/item/interaction/thaumcraft/ItemManasteelHelmRevealing.java index dd9b80dea..c6b522c6c 100644 --- a/src/main/java/vazkii/botania/common/item/interaction/thaumcraft/ItemManasteelHelmRevealing.java +++ b/src/main/java/vazkii/botania/common/item/interaction/thaumcraft/ItemManasteelHelmRevealing.java @@ -11,22 +11,23 @@ package vazkii.botania.common.item.interaction.thaumcraft; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemStack; +import net.minecraftforge.fml.common.Optional; +import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.oredict.RecipeSorter; import net.minecraftforge.oredict.RecipeSorter.Category; -import thaumcraft.api.IGoggles; -import thaumcraft.api.nodes.IRevealer; +import thaumcraft.api.items.IGoggles; +import thaumcraft.api.items.IRevealer; import vazkii.botania.client.lib.LibResources; import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.crafting.recipe.HelmRevealingRecipe; import vazkii.botania.common.item.equipment.armor.manasteel.ItemManasteelHelm; import vazkii.botania.common.lib.LibItemNames; -import cpw.mods.fml.common.Optional; -import cpw.mods.fml.common.registry.GameRegistry; @Optional.InterfaceList({ - @Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.IGoggles", striprefs = true), - @Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.nodes.IRevealer", striprefs = true)}) + @Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.items.IGoggles", striprefs = true), + @Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.items.IRevealer", striprefs = true)}) public class ItemManasteelHelmRevealing extends ItemManasteelHelm implements IGoggles, IRevealer { public ItemManasteelHelmRevealing() { @@ -46,7 +47,7 @@ public class ItemManasteelHelmRevealing extends ItemManasteelHelm implements IGo } @Override - public String getArmorTextureAfterInk(ItemStack stack, int slot) { + public String getArmorTextureAfterInk(ItemStack stack, EntityEquipmentSlot slot) { return ConfigHandler.enableArmorModels ? LibResources.MODEL_MANASTEEL_NEW : LibResources.MODEL_MANASTEEL_2; } diff --git a/src/main/java/vazkii/botania/common/item/interaction/thaumcraft/ItemTerrasteelHelmRevealing.java b/src/main/java/vazkii/botania/common/item/interaction/thaumcraft/ItemTerrasteelHelmRevealing.java index c266bfad0..bd47d39fb 100644 --- a/src/main/java/vazkii/botania/common/item/interaction/thaumcraft/ItemTerrasteelHelmRevealing.java +++ b/src/main/java/vazkii/botania/common/item/interaction/thaumcraft/ItemTerrasteelHelmRevealing.java @@ -11,18 +11,19 @@ package vazkii.botania.common.item.interaction.thaumcraft; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemStack; -import thaumcraft.api.IGoggles; -import thaumcraft.api.nodes.IRevealer; +import net.minecraftforge.fml.common.Optional; +import thaumcraft.api.items.IGoggles; +import thaumcraft.api.items.IRevealer; import vazkii.botania.client.lib.LibResources; import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.item.equipment.armor.terrasteel.ItemTerrasteelHelm; import vazkii.botania.common.lib.LibItemNames; -import cpw.mods.fml.common.Optional; @Optional.InterfaceList({ - @Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.IGoggles", striprefs = true), - @Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.nodes.IRevealer", striprefs = true)}) + @Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.items.IGoggles", striprefs = true), + @Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.items.IRevealer", striprefs = true)}) public class ItemTerrasteelHelmRevealing extends ItemTerrasteelHelm implements IGoggles, IRevealer { public ItemTerrasteelHelmRevealing() { @@ -40,7 +41,7 @@ public class ItemTerrasteelHelmRevealing extends ItemTerrasteelHelm implements I } @Override - public String getArmorTextureAfterInk(ItemStack stack, int slot) { + public String getArmorTextureAfterInk(ItemStack stack, EntityEquipmentSlot slot) { return ConfigHandler.enableArmorModels ? LibResources.MODEL_TERRASTEEL_NEW : LibResources.MODEL_TERRASTEEL_2; } diff --git a/src/main/java/vazkii/botania/common/item/lens/ItemLens.java b/src/main/java/vazkii/botania/common/item/lens/ItemLens.java index 5c58ed735..1feed3d46 100644 --- a/src/main/java/vazkii/botania/common/item/lens/ItemLens.java +++ b/src/main/java/vazkii/botania/common/item/lens/ItemLens.java @@ -10,20 +10,18 @@ */ package vazkii.botania.common.item.lens; -import java.awt.Color; -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.resources.I18n; import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.passive.EntitySheep; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityThrowable; +import net.minecraft.item.EnumDyeColor; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.IIcon; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.StatCollector; +import net.minecraft.util.math.RayTraceResult; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.oredict.RecipeSorter; import net.minecraftforge.oredict.RecipeSorter.Category; import vazkii.botania.api.internal.IManaBurst; @@ -33,14 +31,17 @@ import vazkii.botania.api.mana.ILens; import vazkii.botania.api.mana.ILensControl; import vazkii.botania.api.mana.IManaSpreader; import vazkii.botania.api.mana.ITinyPlanetExcempt; -import vazkii.botania.client.core.helper.IconHelper; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.Botania; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.crafting.recipe.CompositeLensRecipe; import vazkii.botania.common.crafting.recipe.LensDyeingRecipe; import vazkii.botania.common.item.ItemMod; import vazkii.botania.common.lib.LibItemNames; -import cpw.mods.fml.common.registry.GameRegistry; + +import javax.annotation.Nonnull; +import java.awt.*; +import java.util.List; public class ItemLens extends ItemMod implements ILensControl, ICompositableLens, ITinyPlanetExcempt { @@ -81,8 +82,8 @@ public class ItemLens extends ItemMod implements ILensControl, ICompositableLens private static final int[] props = new int[SUBTYPES]; private static final Lens[] lenses = new Lens[SUBTYPES]; - private static Lens fallbackLens = new Lens(); - private static Lens stormLens = new LensStorm(); + private static final Lens fallbackLens = new Lens(); + private static final Lens stormLens = new LensStorm(); static { setProps(NORMAL, PROP_NONE); @@ -135,13 +136,8 @@ public class ItemLens extends ItemMod implements ILensControl, ICompositableLens private static final String TAG_COLOR = "color"; private static final String TAG_COMPOSITE_LENS = "compositeLens"; - public static IIcon iconGlass; - - IIcon[] ringIcons; - public ItemLens() { - super(); - setUnlocalizedName(LibItemNames.LENS); + super(LibItemNames.LENS); setMaxStackSize(1); setHasSubtypes(true); @@ -152,63 +148,38 @@ public class ItemLens extends ItemMod implements ILensControl, ICompositableLens } @Override - public void registerIcons(IIconRegister par1IconRegister) { - iconGlass = IconHelper.forName(par1IconRegister, "lensInside"); - - ringIcons = new IIcon[SUBTYPES]; - for(int i = 0; i < ringIcons.length; i++) - ringIcons[i] = IconHelper.forName(par1IconRegister, LibItemNames.LENS_NAMES[i]); - } - - @Override - public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) { + @SideOnly(Side.CLIENT) + public void getSubItems(@Nonnull Item item, CreativeTabs tab, List stacks) { for(int i = 0; i < SUBTYPES; i++) - par3List.add(new ItemStack(par1, 1, i)); - } - - @Override - public boolean requiresMultipleRenderPasses() { - return true; - } - - @Override - public IIcon getIconFromDamageForRenderPass(int par1, int par2) { - return par2 == 1 ? ringIcons[Math.min(SUBTYPES - 1, par1)] : iconGlass; - } - - @Override - public IIcon getIconFromDamage(int par1) { - return getIconFromDamageForRenderPass(par1, 0); - } - - @Override - public int getColorFromItemStack(ItemStack par1ItemStack, int par2) { - return par2 == 0 ? getLensColor(par1ItemStack) : 0xFFFFFF; + stacks.add(new ItemStack(item, 1, i)); } + @Nonnull @Override public String getUnlocalizedName(ItemStack par1ItemStack) { return "item." + LibItemNames.LENS_NAMES[Math.min(SUBTYPES - 1, par1ItemStack.getItemDamage())]; } + @SideOnly(Side.CLIENT) @Override - public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { + public void addInformation(ItemStack par1ItemStack, EntityPlayer player, List stacks, boolean par4) { int storedColor = getStoredColor(par1ItemStack); if(storedColor != -1) - par3List.add(String.format(StatCollector.translateToLocal("botaniamisc.color"), StatCollector.translateToLocal("botania.color" + storedColor))); + stacks.add(I18n.format("botaniamisc.color", I18n.format("botania.color" + storedColor))); } - public String getItemShortTermName(ItemStack stack) { - return StatCollector.translateToLocal(stack.getUnlocalizedName().replaceAll("item.", "item.botania:") + ".short"); + private String getItemShortTermName(ItemStack stack) { + return net.minecraft.util.text.translation.I18n.translateToLocal(stack.getUnlocalizedName().replaceAll("item.", "item.botania:") + ".short"); } + @Nonnull @Override - public String getItemStackDisplayName(ItemStack stack) { + public String getItemStackDisplayName(@Nonnull ItemStack stack) { ItemStack compositeLens = getCompositeLens(stack); if(compositeLens == null) return super.getItemStackDisplayName(stack); - return String.format(StatCollector.translateToLocal("item.botania:compositeLens.name"), getItemShortTermName(stack), getItemShortTermName(compositeLens)); + return String.format(net.minecraft.util.text.translation.I18n.translateToLocal("item.botania:compositeLens.name"), getItemShortTermName(stack), getItemShortTermName(compositeLens)); } @Override @@ -225,7 +196,7 @@ public class ItemLens extends ItemMod implements ILensControl, ICompositableLens } @Override - public boolean collideBurst(IManaBurst burst, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) { + public boolean collideBurst(IManaBurst burst, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) { EntityThrowable entity = (EntityThrowable) burst; dead = getLens(stack.getItemDamage()).collideBurst(burst, entity, pos, isManaBlock, dead, stack); @@ -262,17 +233,15 @@ public class ItemLens extends ItemMod implements ILensControl, ICompositableLens if(storedColor == 16) return Color.HSBtoRGB(Botania.proxy.getWorldElapsedTicks() * 2 % 360 / 360F, 1F, 1F); - float[] color = EntitySheep.fleeceColorTable[storedColor]; - return new Color(color[0], color[1], color[2]).getRGB(); + return EnumDyeColor.byMetadata(storedColor).getMapColor().colorValue; } public static int getStoredColor(ItemStack stack) { return ItemNBTHelper.getInt(stack, TAG_COLOR, -1); } - public static ItemStack setLensColor(ItemStack stack, int color) { + public static void setLensColor(ItemStack stack, int color) { ItemNBTHelper.setInt(stack, TAG_COLOR, color); - return stack; } @Override @@ -368,4 +337,11 @@ public class ItemLens extends ItemMod implements ILensControl, ICompositableLens public boolean isCombinable(ItemStack stack) { return stack.getItemDamage() != NORMAL; } + + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerItemMetas(this, LibItemNames.LENS_NAMES.length, i -> LibItemNames.LENS_NAMES[i]); + } + } diff --git a/src/main/java/vazkii/botania/common/item/lens/Lens.java b/src/main/java/vazkii/botania/common/item/lens/Lens.java index 96cf391c1..544ea8450 100644 --- a/src/main/java/vazkii/botania/common/item/lens/Lens.java +++ b/src/main/java/vazkii/botania/common/item/lens/Lens.java @@ -12,36 +12,28 @@ package vazkii.botania.common.item.lens; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.item.ItemStack; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.math.RayTraceResult; import vazkii.botania.api.internal.IManaBurst; import vazkii.botania.api.mana.BurstProperties; import vazkii.botania.api.mana.IManaSpreader; public class Lens { - public void apply(ItemStack stack, BurstProperties props) { - // NO-OP - } + public void apply(ItemStack stack, BurstProperties props) {} - public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) { + public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) { return dead; } - public void updateBurst(IManaBurst burst, EntityThrowable entity, ItemStack stack) { - // NO-OP - } + public void updateBurst(IManaBurst burst, EntityThrowable entity, ItemStack stack) {} public boolean allowBurstShooting(ItemStack stack, IManaSpreader spreader, boolean redstone) { return true; } - public void onControlledSpreaderTick(ItemStack stack, IManaSpreader spreader, boolean redstone) { - // NO-OP - } + public void onControlledSpreaderTick(ItemStack stack, IManaSpreader spreader, boolean redstone) {} - public void onControlledSpreaderPulse(ItemStack stack, IManaSpreader spreader, boolean redstone) { - // NO-OP - } + public void onControlledSpreaderPulse(ItemStack stack, IManaSpreader spreader, boolean redstone) {} } diff --git a/src/main/java/vazkii/botania/common/item/lens/LensBounce.java b/src/main/java/vazkii/botania/common/item/lens/LensBounce.java index 28148f736..6f6ef2aa7 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensBounce.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensBounce.java @@ -12,22 +12,22 @@ package vazkii.botania.common.item.lens; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MovingObjectPosition; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import vazkii.botania.api.internal.IManaBurst; import vazkii.botania.common.core.helper.Vector3; public class LensBounce extends Lens { @Override - public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) { - if(!isManaBlock && pos.entityHit == null) { - ChunkCoordinates coords = burst.getBurstSourceChunkCoordinates(); - if(coords.posX != pos.blockX || coords.posY != pos.blockY || coords.posZ != pos.blockZ) { + public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) { + if(!isManaBlock && pos.entityHit == null && pos.getBlockPos() != null) { + BlockPos coords = burst.getBurstSourceBlockPos(); + if(!coords.equals(pos.getBlockPos())) { Vector3 currentMovementVec = new Vector3(entity.motionX, entity.motionY, entity.motionZ); - ForgeDirection dir = ForgeDirection.getOrientation(pos.sideHit); - Vector3 normalVector = new Vector3(dir.offsetX, dir.offsetY, dir.offsetZ).normalize(); + EnumFacing dir = pos.sideHit; + Vector3 normalVector = new Vector3(dir.getFrontOffsetX(), dir.getFrontOffsetY(), dir.getFrontOffsetZ()).normalize(); Vector3 movementVec = normalVector.multiply(-2 * currentMovementVec.dotProduct(normalVector)).add(currentMovementVec); burst.setMotion(movementVec.x, movementVec.y, movementVec.z); diff --git a/src/main/java/vazkii/botania/common/item/lens/LensDamage.java b/src/main/java/vazkii/botania/common/item/lens/LensDamage.java index f1a268901..627c91680 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensDamage.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensDamage.java @@ -10,21 +10,23 @@ */ package vazkii.botania.common.item.lens; -import java.util.List; - import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.DamageSource; +import net.minecraft.util.math.AxisAlignedBB; import vazkii.botania.api.internal.IManaBurst; +import java.util.List; + public class LensDamage extends Lens { @Override public void updateBurst(IManaBurst burst, EntityThrowable entity, ItemStack stack) { - AxisAlignedBB axis = AxisAlignedBB.getBoundingBox(entity.posX, entity.posY, entity.posZ, entity.lastTickPosX, entity.lastTickPosY, entity.lastTickPosZ).expand(1, 1, 1); + if (entity.worldObj.isRemote) + return; + AxisAlignedBB axis = new AxisAlignedBB(entity.posX, entity.posY, entity.posZ, entity.lastTickPosX, entity.lastTickPosY, entity.lastTickPosZ).expand(1, 1, 1); List entities = entity.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axis); for(EntityLivingBase living : entities) { if(living instanceof EntityPlayer) @@ -34,7 +36,7 @@ public class LensDamage extends Lens { int mana = burst.getMana(); if(mana >= 16) { burst.setMana(mana - 16); - if(!burst.isFake() && !entity.worldObj.isRemote) + if(!burst.isFake()) living.attackEntityFrom(DamageSource.magic, 8); break; } diff --git a/src/main/java/vazkii/botania/common/item/lens/LensExplosive.java b/src/main/java/vazkii/botania/common/item/lens/LensExplosive.java index 6d4f8eb10..dd1be21b7 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensExplosive.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensExplosive.java @@ -13,17 +13,17 @@ package vazkii.botania.common.item.lens; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import vazkii.botania.api.internal.IManaBurst; public class LensExplosive extends Lens { @Override - public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) { - if(!burst.isFake()) { - ChunkCoordinates coords = burst.getBurstSourceChunkCoordinates(); - if(!entity.worldObj.isRemote && pos.entityHit == null && !isManaBlock && (pos.blockX != coords.posX || pos.blockY != coords.posY || pos.blockZ != coords.posZ)) + public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) { + if(!entity.worldObj.isRemote && !burst.isFake()) { + BlockPos coords = burst.getBurstSourceBlockPos(); + if(pos.entityHit == null && !isManaBlock && (pos.getBlockPos() == null || !coords.equals(pos.getBlockPos()))) entity.worldObj.createExplosion(entity, entity.posX, entity.posY, entity.posZ, burst.getMana() / 50F, true); } else dead = false; diff --git a/src/main/java/vazkii/botania/common/item/lens/LensFire.java b/src/main/java/vazkii/botania/common/item/lens/LensFire.java index 19ed86c74..188793b48 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensFire.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensFire.java @@ -14,35 +14,35 @@ import net.minecraft.block.Block; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MovingObjectPosition; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import vazkii.botania.api.internal.IManaBurst; +import vazkii.botania.api.internal.VanillaPacketDispatcher; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.tile.TileIncensePlate; public class LensFire extends Lens { @Override - public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) { - ChunkCoordinates coords = burst.getBurstSourceChunkCoordinates(); - if((coords.posX != pos.blockX || coords.posY != pos.blockY || coords.posZ != pos.blockZ) && !burst.isFake() && !isManaBlock) { - ForgeDirection dir = ForgeDirection.getOrientation(pos.sideHit); + public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) { + BlockPos coords = burst.getBurstSourceBlockPos(); + if(!entity.worldObj.isRemote && pos.getBlockPos() != null && !coords.equals(pos.getBlockPos()) && !burst.isFake() && !isManaBlock) { + EnumFacing dir = pos.sideHit; - int x = pos.blockX + dir.offsetX; - int y = pos.blockY + dir.offsetY; - int z = pos.blockZ + dir.offsetZ; + BlockPos pos_ = pos.getBlockPos().offset(dir); - Block blockAt = entity.worldObj.getBlock(pos.blockX, pos.blockY, pos.blockZ); - Block blockAt_ = entity.worldObj.getBlock(x, y, z); + Block blockAt = entity.worldObj.getBlockState(pos.getBlockPos()).getBlock(); + Block blockAt_ = entity.worldObj.getBlockState(pos_).getBlock(); - if(blockAt == Blocks.portal) - entity.worldObj.setBlock(pos.blockX, pos.blockY, pos.blockZ, Blocks.air); + if(blockAt == Blocks.PORTAL) + entity.worldObj.setBlockState(pos.getBlockPos(), Blocks.AIR.getDefaultState()); else if(blockAt == ModBlocks.incensePlate) { - TileIncensePlate plate = (TileIncensePlate) entity.worldObj.getTileEntity(pos.blockX, pos.blockY, pos.blockZ); + TileIncensePlate plate = (TileIncensePlate) entity.worldObj.getTileEntity(pos.getBlockPos()); plate.ignite(); - } else if(blockAt_.isAir(entity.worldObj, x, y, z)) - entity.worldObj.setBlock(x, y, z, Blocks.fire); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(plate); + } else if(blockAt_.isAir(entity.worldObj.getBlockState(pos_), entity.worldObj, pos_)) + entity.worldObj.setBlockState(pos_, Blocks.FIRE.getDefaultState()); } return dead; diff --git a/src/main/java/vazkii/botania/common/item/lens/LensFirework.java b/src/main/java/vazkii/botania/common/item/lens/LensFirework.java index a81ef3553..186dd47e5 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensFirework.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensFirework.java @@ -16,18 +16,18 @@ import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import vazkii.botania.api.internal.IManaBurst; import vazkii.botania.common.core.helper.ItemNBTHelper; public class LensFirework extends Lens { @Override - public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) { - if(!burst.isFake()) { - ChunkCoordinates coords = burst.getBurstSourceChunkCoordinates(); - if(!entity.worldObj.isRemote && pos.entityHit == null && !isManaBlock && (pos.blockX != coords.posX || pos.blockY != coords.posY || pos.blockZ != coords.posZ)) { + public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) { + if(!entity.worldObj.isRemote && !burst.isFake()) { + BlockPos coords = burst.getBurstSourceBlockPos(); + if(pos.entityHit == null && !isManaBlock && (pos.getBlockPos() == null || !pos.getBlockPos().equals(coords))) { ItemStack fireworkStack = generateFirework(burst.getColor()); EntityFireworkRocket rocket = new EntityFireworkRocket(entity.worldObj, entity.posX, entity.posY, entity.posZ, fireworkStack); @@ -39,7 +39,7 @@ public class LensFirework extends Lens { } public ItemStack generateFirework(int color) { - ItemStack stack = new ItemStack(Items.fireworks); + ItemStack stack = new ItemStack(Items.FIREWORKS); NBTTagCompound explosion = new NBTTagCompound(); explosion.setIntArray("Colors", new int[] { color }); @@ -61,7 +61,7 @@ public class LensFirework extends Lens { ItemNBTHelper.setCompound(stack, "Explosion", explosion); NBTTagCompound fireworks = new NBTTagCompound(); - fireworks.setInteger("Flight", (int) Math.random() * 3 + 2); + fireworks.setInteger("Flight", (int) (Math.random() * 3 + 2)); NBTTagList explosions = new NBTTagList(); explosions.appendTag(explosion); diff --git a/src/main/java/vazkii/botania/common/item/lens/LensFlare.java b/src/main/java/vazkii/botania/common/item/lens/LensFlare.java index 96345bf7a..83db6ce41 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensFlare.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensFlare.java @@ -10,15 +10,15 @@ */ package vazkii.botania.common.item.lens; -import java.awt.Color; - -import net.minecraft.entity.passive.EntitySheep; +import net.minecraft.item.EnumDyeColor; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MathHelper; +import net.minecraft.util.math.MathHelper; import vazkii.botania.api.mana.IManaSpreader; import vazkii.botania.common.Botania; +import java.awt.*; + public class LensFlare extends Lens { @Override @@ -48,22 +48,20 @@ public class LensFlare extends Lens { float my = (float) (MathHelper.sin(rotationPitch / 180.0F * (float) Math.PI) * f / 2D); int storedColor = ItemLens.getStoredColor(stack); - float r = 1, g = 1, b = 1; + int hex = -1; TileEntity tile = (TileEntity) spreader; if(storedColor == 16) { - Color c = Color.getHSBColor(tile.getWorldObj().getTotalWorldTime() * 2 % 360 / 360F, 1F, 1F); - r = c.getRed() / 255F; - g = c.getGreen() / 255F; - b = c.getBlue() / 255F; + hex = Color.HSBtoRGB(tile.getWorld().getTotalWorldTime() * 2 % 360 / 360F, 1F, 1F); } else if(storedColor >= 0) { - float[] colortable = EntitySheep.fleeceColorTable[storedColor]; - r = colortable[0]; - g = colortable[1]; - b = colortable[2]; + hex = EnumDyeColor.byMetadata(storedColor).getMapColor().colorValue; } - Botania.proxy.wispFX(tile.getWorldObj(), tile.xCoord + 0.5, tile.yCoord + 0.5, tile.zCoord + 0.5, r, g, b, 0.4F, mx, my, mz); + float r = ((hex & 0xFF0000) >> 16) / 255F; + float g = ((hex & 0xFF00) >> 8) / 255F; + float b = (hex & 0xFF) / 255F; + + Botania.proxy.wispFX(tile.getPos().getX() + 0.5, tile.getPos().getY() + 0.5, tile.getPos().getZ() + 0.5, r, g, b, 0.4F, mx, my, mz); } } diff --git a/src/main/java/vazkii/botania/common/item/lens/LensInfluence.java b/src/main/java/vazkii/botania/common/item/lens/LensInfluence.java index 43c4fa01c..0549d384c 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensInfluence.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensInfluence.java @@ -10,8 +10,7 @@ */ package vazkii.botania.common.item.lens; -import java.util.List; - +import com.google.common.base.Predicates; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityFallingBlock; import net.minecraft.entity.item.EntityItem; @@ -19,21 +18,23 @@ import net.minecraft.entity.item.EntityXPOrb; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.math.AxisAlignedBB; import vazkii.botania.api.internal.IManaBurst; import vazkii.botania.common.item.ModItems; +import java.util.List; + public class LensInfluence extends Lens { @Override public void updateBurst(IManaBurst burst, EntityThrowable entity, ItemStack stack) { if(!burst.isFake()) { double range = 3.5; - List movables = entity.worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range)); - movables.addAll(entity.worldObj.getEntitiesWithinAABB(EntityXPOrb.class, AxisAlignedBB.getBoundingBox(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range))); - movables.addAll(entity.worldObj.getEntitiesWithinAABB(EntityArrow.class, AxisAlignedBB.getBoundingBox(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range))); - movables.addAll(entity.worldObj.getEntitiesWithinAABB(EntityFallingBlock.class, AxisAlignedBB.getBoundingBox(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range))); - movables.addAll(entity.worldObj.getEntitiesWithinAABB(IManaBurst.class, AxisAlignedBB.getBoundingBox(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range))); + List movables = entity.worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range)); + movables.addAll(entity.worldObj.getEntitiesWithinAABB(EntityXPOrb.class, new AxisAlignedBB(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range))); + movables.addAll(entity.worldObj.getEntitiesWithinAABB(EntityArrow.class, new AxisAlignedBB(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range))); + movables.addAll(entity.worldObj.getEntitiesWithinAABB(EntityFallingBlock.class, new AxisAlignedBB(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range))); + movables.addAll(entity.worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range), Predicates.instanceOf(IManaBurst.class))); for(Entity movable : movables) { if(movable == burst) diff --git a/src/main/java/vazkii/botania/common/item/lens/LensLight.java b/src/main/java/vazkii/botania/common/item/lens/LensLight.java index 3d1133564..08fb8eb77 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensLight.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensLight.java @@ -15,9 +15,8 @@ import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MovingObjectPosition; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import vazkii.botania.api.internal.IManaBurst; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.tile.TileManaFlame; @@ -25,23 +24,19 @@ import vazkii.botania.common.block.tile.TileManaFlame; public class LensLight extends Lens { @Override - public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) { - ChunkCoordinates coords = burst.getBurstSourceChunkCoordinates(); - if((coords.posX != pos.blockX || coords.posY != pos.blockY || coords.posZ != pos.blockZ) && !burst.isFake() && !isManaBlock) { - ForgeDirection dir = ForgeDirection.getOrientation(pos.sideHit); + public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) { + BlockPos coords = burst.getBurstSourceBlockPos(); + if(!entity.worldObj.isRemote && pos.getBlockPos() != null && !coords.equals(pos.getBlockPos()) && !burst.isFake() && !isManaBlock) { + BlockPos pos_ = pos.getBlockPos().offset(pos.sideHit); - int x = pos.blockX + dir.offsetX; - int y = pos.blockY + dir.offsetY; - int z = pos.blockZ + dir.offsetZ; - - Block blockAt = entity.worldObj.getBlock(pos.blockX, pos.blockY, pos.blockZ); - Block blockAt_ = entity.worldObj.getBlock(x, y, z); + Block blockAt = entity.worldObj.getBlockState(pos.getBlockPos()).getBlock(); + Block blockAt_ = entity.worldObj.getBlockState(pos_).getBlock(); if(blockAt == ModBlocks.manaFlame) - entity.worldObj.setBlock(pos.blockX, pos.blockY, pos.blockZ, Blocks.air); - else if(blockAt_.isAir(entity.worldObj, x, y, z) || blockAt_.isReplaceable(entity.worldObj, x, y, z)) { - entity.worldObj.setBlock(x, y, z, ModBlocks.manaFlame); - TileEntity tile = entity.worldObj.getTileEntity(x, y, z); + entity.worldObj.setBlockState(pos.getBlockPos(), Blocks.AIR.getDefaultState()); + else if(blockAt_.isAir(entity.worldObj.getBlockState(pos_), entity.worldObj, pos_) || blockAt_.isReplaceable(entity.worldObj, pos_)) { + entity.worldObj.setBlockState(pos_, ModBlocks.manaFlame.getDefaultState()); + TileEntity tile = entity.worldObj.getTileEntity(pos_); if(tile instanceof TileManaFlame) ((TileManaFlame) tile).setColor(burst.getColor()); diff --git a/src/main/java/vazkii/botania/common/item/lens/LensMagnet.java b/src/main/java/vazkii/botania/common/item/lens/LensMagnet.java index 983e46cd5..dc1071e9f 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensMagnet.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensMagnet.java @@ -13,7 +13,7 @@ package vazkii.botania.common.item.lens; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.math.BlockPos; import vazkii.botania.api.internal.IManaBurst; import vazkii.botania.api.mana.IManaReceiver; import vazkii.botania.common.core.helper.MathHelper; @@ -28,53 +28,51 @@ public class LensMagnet extends Lens { @Override public void updateBurst(IManaBurst burst, EntityThrowable entity, ItemStack stack) { - int x = (int) entity.posX; - int y = (int) entity.posY; - int z = (int) entity.posZ; + BlockPos basePos = new BlockPos(entity); boolean magnetized = entity.getEntityData().hasKey(TAG_MAGNETIZED); int range = 3; magnetize : { - for(int i = -range; i < range; i++) - for(int j = -range; j < range; j++) - for(int k = -range; k < range; k++) - if(entity.worldObj.getTileEntity(i + x, j + y, k + z) instanceof IManaReceiver) { - TileEntity tile = entity.worldObj.getTileEntity(i + x, j + y, k + z); + for (BlockPos pos : BlockPos.getAllInBox(basePos.add(-range, -range, -range), basePos.add(range, range, range))) { + if(entity.worldObj.getTileEntity(pos) instanceof IManaReceiver) { + TileEntity tile = entity.worldObj.getTileEntity(pos); - if(magnetized) { - int magX = entity.getEntityData().getInteger(TAG_MAGNETIZED_X); - int magY = entity.getEntityData().getInteger(TAG_MAGNETIZED_Y); - int magZ = entity.getEntityData().getInteger(TAG_MAGNETIZED_Z); - if(tile.xCoord != magX || tile.yCoord != magY || tile.zCoord != magZ) - continue; - } + if(magnetized) { + int magX = entity.getEntityData().getInteger(TAG_MAGNETIZED_X); + int magY = entity.getEntityData().getInteger(TAG_MAGNETIZED_Y); + int magZ = entity.getEntityData().getInteger(TAG_MAGNETIZED_Z); + if(tile.getPos().getX() != magX || tile.getPos().getY() != magY || tile.getPos().getZ() != magZ) + continue; + } - IManaReceiver receiver = (IManaReceiver) tile; + IManaReceiver receiver = (IManaReceiver) tile; - ChunkCoordinates srcCoords = burst.getBurstSourceChunkCoordinates(); + BlockPos srcCoords = burst.getBurstSourceBlockPos(); - if(MathHelper.pointDistanceSpace(tile.xCoord, tile.yCoord, tile.zCoord, srcCoords.posX, srcCoords.posY, srcCoords.posZ) > 3 && receiver.canRecieveManaFromBursts() && !receiver.isFull()) { - Vector3 burstVec = Vector3.fromEntity(entity); - Vector3 tileVec = Vector3.fromTileEntityCenter(tile).add(0, -0.1, 0); - Vector3 motionVec = new Vector3(entity.motionX, entity.motionY, entity.motionZ); + if(tile.getPos().distanceSq(srcCoords) > 9 && receiver.canRecieveManaFromBursts() && !receiver.isFull()) { + Vector3 burstVec = Vector3.fromEntity(entity); + Vector3 tileVec = Vector3.fromTileEntityCenter(tile).add(0, -0.1, 0); + Vector3 motionVec = new Vector3(entity.motionX, entity.motionY, entity.motionZ); - Vector3 normalMotionVec = motionVec.copy().normalize(); - Vector3 magnetVec = tileVec.sub(burstVec).normalize(); - Vector3 differenceVec = normalMotionVec.sub(magnetVec).multiply(motionVec.mag() * 0.1); + Vector3 normalMotionVec = motionVec.normalize(); + Vector3 magnetVec = tileVec.subtract(burstVec).normalize(); + Vector3 differenceVec = normalMotionVec.subtract(magnetVec).multiply(motionVec.mag() * 0.1); - Vector3 finalMotionVec = motionVec.sub(differenceVec); - if(!magnetized) { - finalMotionVec.multiply(0.75); - entity.getEntityData().setBoolean(TAG_MAGNETIZED, true); - entity.getEntityData().setInteger(TAG_MAGNETIZED_X, tile.xCoord); - entity.getEntityData().setInteger(TAG_MAGNETIZED_Y, tile.yCoord); - entity.getEntityData().setInteger(TAG_MAGNETIZED_Z, tile.zCoord); - } - - burst.setMotion(finalMotionVec.x, finalMotionVec.y, finalMotionVec.z); - break magnetize; - } + Vector3 finalMotionVec = motionVec.subtract(differenceVec); + if(!magnetized) { + finalMotionVec = finalMotionVec.multiply(0.75); + entity.getEntityData().setBoolean(TAG_MAGNETIZED, true); + entity.getEntityData().setInteger(TAG_MAGNETIZED_X, tile.getPos().getX()); + entity.getEntityData().setInteger(TAG_MAGNETIZED_Y, tile.getPos().getY()); + entity.getEntityData().setInteger(TAG_MAGNETIZED_Z, tile.getPos().getZ()); } + + burst.setMotion(finalMotionVec.x, finalMotionVec.y, finalMotionVec.z); + break magnetize; + } + } + + } } } diff --git a/src/main/java/vazkii/botania/common/item/lens/LensMine.java b/src/main/java/vazkii/botania/common/item/lens/LensMine.java index 72020182f..52872d4ab 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensMine.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensMine.java @@ -10,17 +10,15 @@ */ package vazkii.botania.common.item.lens; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; import vazkii.botania.api.internal.IManaBurst; import vazkii.botania.api.mana.IManaBlock; @@ -28,47 +26,53 @@ import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.item.ModItems; +import java.util.ArrayList; +import java.util.List; + public class LensMine extends Lens { @Override - public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) { + public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) { World world = entity.worldObj; - int x = pos.blockX; - int y = pos.blockY; - int z = pos.blockZ; - Block block = world.getBlock(x, y, z); - int meta = world.getBlockMetadata(x, y, z); + + BlockPos pos_ = pos.getBlockPos(); + if (world.isRemote || pos_ == null) + return false; + + Block block = world.getBlockState(pos_).getBlock(); + ItemStack composite = ((ItemLens) ModItems.lens).getCompositeLens(stack); boolean warp = composite != null && composite.getItem() == ModItems.lens && composite.getItemDamage() == ItemLens.WARP; - if(warp && (block == ModBlocks.pistonRelay || block == Blocks.piston || block == Blocks.piston_extension || block == Blocks.piston_head)) + if(warp && (block == ModBlocks.pistonRelay || block == Blocks.PISTON || block == Blocks.PISTON_EXTENSION || block == Blocks.PISTON_HEAD)) return false; int harvestLevel = ConfigHandler.harvestLevelBore; - TileEntity tile = world.getTileEntity(x, y, z); + TileEntity tile = world.getTileEntity(pos_); - float hardness = block.getBlockHardness(world, x, y, z); - int neededHarvestLevel = block.getHarvestLevel(meta); + IBlockState state = world.getBlockState(pos_); + float hardness = state.getBlockHardness(world, pos_); + int neededHarvestLevel = block.getHarvestLevel(state); int mana = burst.getMana(); - ChunkCoordinates coords = burst.getBurstSourceChunkCoordinates(); - if((coords.posX != x || coords.posY != y || coords.posZ != z) && !(tile instanceof IManaBlock) && neededHarvestLevel <= harvestLevel && hardness != -1 && hardness < 50F && (burst.isFake() || mana >= 24)) { - List items = new ArrayList(); + BlockPos coords = burst.getBurstSourceBlockPos(); + if(!coords.equals(pos.getBlockPos()) && !(tile instanceof IManaBlock) && neededHarvestLevel <= harvestLevel && hardness != -1 && hardness < 50F && (burst.isFake() || mana >= 24)) { + List items = new ArrayList<>(); - items.addAll(block.getDrops(world, x, y, z, meta, 0)); + items.addAll(block.getDrops(world, pos_, world.getBlockState(pos_), 0)); - if(!burst.hasAlreadyCollidedAt(x, y, z)) { + if(!burst.hasAlreadyCollidedAt(pos_)) { if(!burst.isFake() && !entity.worldObj.isRemote) { - world.setBlockToAir(x, y, z); + world.setBlockToAir(pos_); if(ConfigHandler.blockBreakParticles) - entity.worldObj.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(block) + (meta << 12)); + entity.worldObj.playEvent(2001, pos_, Block.getStateId(state)); - boolean offBounds = coords.posY < 0; + boolean offBounds = coords.getY() < 0; boolean doWarp = warp && !offBounds; - int dropX = doWarp ? coords.posX : x; - int dropY = doWarp ? coords.posY : y; - int dropZ = doWarp ? coords.posZ : z; + int dropX = doWarp ? coords.getX() : pos_.getX(); + int dropY = doWarp ? coords.getY() : pos_.getY(); + int dropZ = doWarp ? coords.getZ() : pos_.getZ(); for(ItemStack stack_ : items) world.spawnEntityInWorld(new EntityItem(world, dropX + 0.5, dropY + 0.5, dropZ + 0.5, stack_)); diff --git a/src/main/java/vazkii/botania/common/item/lens/LensPaint.java b/src/main/java/vazkii/botania/common/item/lens/LensPaint.java index 03afaeb11..4feebdb3e 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensPaint.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensPaint.java @@ -10,76 +10,73 @@ */ package vazkii.botania.common.item.lens; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.passive.EntitySheep; import net.minecraft.entity.projectile.EntityThrowable; +import net.minecraft.item.EnumDyeColor; import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MovingObjectPosition; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.internal.IManaBurst; -import vazkii.botania.common.Botania; +import vazkii.botania.common.network.PacketBotaniaEffect; +import vazkii.botania.common.network.PacketHandler; + +import java.util.ArrayList; +import java.util.List; public class LensPaint extends Lens { @Override - public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) { + public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) { int storedColor = ItemLens.getStoredColor(stack); - if(!burst.isFake() && storedColor > -1 && storedColor < 17) { + if(!entity.worldObj.isRemote && !burst.isFake() && storedColor > -1 && storedColor < 17) { if(pos.entityHit != null && pos.entityHit instanceof EntitySheep) { int r = 20; - int sheepColor = ((EntitySheep) pos.entityHit).getFleeceColor(); - List sheepList = entity.worldObj.getEntitiesWithinAABB(EntitySheep.class, AxisAlignedBB.getBoundingBox(pos.entityHit.posX - r, pos.entityHit.posY - r, pos.entityHit.posZ - r, pos.entityHit.posX + r, pos.entityHit.posY + r, pos.entityHit.posZ + r)); + EnumDyeColor sheepColor = ((EntitySheep) pos.entityHit).getFleeceColor(); + List sheepList = entity.worldObj.getEntitiesWithinAABB(EntitySheep.class, new AxisAlignedBB(pos.entityHit.posX - r, pos.entityHit.posY - r, pos.entityHit.posZ - r, pos.entityHit.posX + r, pos.entityHit.posY + r, pos.entityHit.posZ + r)); for(EntitySheep sheep : sheepList) { if(sheep.getFleeceColor() == sheepColor) - sheep.setFleeceColor(storedColor == 16 ? sheep.worldObj.rand.nextInt(16) : storedColor); + sheep.setFleeceColor(EnumDyeColor.byMetadata(storedColor == 16 ? sheep.worldObj.rand.nextInt(16) : storedColor)); } dead = true; - } else { - Block block = entity.worldObj.getBlock(pos.blockX, pos.blockY, pos.blockZ); - if(BotaniaAPI.paintableBlocks.contains(block)) { - int meta = entity.worldObj.getBlockMetadata(pos.blockX, pos.blockY, pos.blockZ); - List coordsToPaint = new ArrayList(); - List coordsFound = new ArrayList(); + } else if (pos.getBlockPos() != null) { + Block block = entity.worldObj.getBlockState(pos.getBlockPos()).getBlock(); + if(BotaniaAPI.paintableBlocks.containsKey(block)) { + IBlockState state = entity.worldObj.getBlockState(pos.getBlockPos()); + List coordsToPaint = new ArrayList<>(); + List coordsFound = new ArrayList<>(); - ChunkCoordinates theseCoords = new ChunkCoordinates(pos.blockX, pos.blockY, pos.blockZ); + BlockPos theseCoords = pos.getBlockPos(); coordsFound.add(theseCoords); do { - List iterCoords = new ArrayList(coordsFound); - for(ChunkCoordinates coords : iterCoords) { + List iterCoords = new ArrayList<>(coordsFound); + for(BlockPos coords : iterCoords) { coordsFound.remove(coords); coordsToPaint.add(coords); - for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { - Block block_ = entity.worldObj.getBlock(coords.posX + dir.offsetX, coords.posY + dir.offsetY, coords.posZ + dir.offsetZ); - int meta_ = entity.worldObj.getBlockMetadata(coords.posX + dir.offsetX, coords.posY + dir.offsetY, coords.posZ + dir.offsetZ); - ChunkCoordinates coords_ = new ChunkCoordinates(coords.posX + dir.offsetX, coords.posY + dir.offsetY, coords.posZ + dir.offsetZ); - if(block_ == block && meta_ == meta && !coordsFound.contains(coords_) && !coordsToPaint.contains(coords_)) + for(EnumFacing dir : EnumFacing.VALUES) { + IBlockState state_ = entity.worldObj.getBlockState(coords.offset(dir)); + BlockPos coords_ = new BlockPos(coords.offset(dir)); + if(state_ == state && !coordsFound.contains(coords_) && !coordsToPaint.contains(coords_)) coordsFound.add(coords_); } } } while(!coordsFound.isEmpty() && coordsToPaint.size() < 1000); - for(ChunkCoordinates coords : coordsToPaint) { - int placeColor = storedColor == 16 ? entity.worldObj.rand.nextInt(16) : storedColor; - int metaThere = entity.worldObj.getBlockMetadata(coords.posX, coords.posY, coords.posZ); - - if(metaThere != placeColor) { - if(!entity.worldObj.isRemote) - entity.worldObj.setBlockMetadataWithNotify(coords.posX, coords.posY, coords.posZ, placeColor, 2); - float[] color = EntitySheep.fleeceColorTable[placeColor]; - float r = color[0]; - float g = color[1]; - float b = color[2]; - for(int i = 0; i < 4; i++) - Botania.proxy.sparkleFX(entity.worldObj, coords.posX + (float) Math.random(), coords.posY + (float) Math.random(), coords.posZ + (float) Math.random(), r, g, b, 0.6F + (float) Math.random() * 0.3F, 5); + for(BlockPos coords : coordsToPaint) { + EnumDyeColor placeColor = EnumDyeColor.byMetadata(storedColor == 16 ? entity.worldObj.rand.nextInt(16) : storedColor); + IBlockState stateThere = entity.worldObj.getBlockState(coords); + if(stateThere.getValue(BotaniaAPI.paintableBlocks.get(block)) != placeColor + && BotaniaAPI.paintableBlocks.get(block).getAllowedValues().contains(placeColor)) { + entity.worldObj.setBlockState(coords, stateThere.withProperty(BotaniaAPI.paintableBlocks.get(block), placeColor), 2); + PacketHandler.sendToNearby(entity.worldObj, coords, + new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.PAINT_LENS, coords.getX(), coords.getY(), coords.getZ(), placeColor.getMetadata())); } } } diff --git a/src/main/java/vazkii/botania/common/item/lens/LensPhantom.java b/src/main/java/vazkii/botania/common/item/lens/LensPhantom.java index 1bcff6ec5..f193abff8 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensPhantom.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensPhantom.java @@ -12,13 +12,13 @@ package vazkii.botania.common.item.lens; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.item.ItemStack; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.math.RayTraceResult; import vazkii.botania.api.internal.IManaBurst; public class LensPhantom extends Lens { @Override - public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) { + public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) { if(!isManaBlock) { dead = false; burst.setMinManaLoss(Math.max(0, burst.getMinManaLoss() - 4)); diff --git a/src/main/java/vazkii/botania/common/item/lens/LensPiston.java b/src/main/java/vazkii/botania/common/item/lens/LensPiston.java index afedaee18..50bf0829f 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensPiston.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensPiston.java @@ -10,36 +10,31 @@ */ package vazkii.botania.common.item.lens; -import net.minecraft.block.Block; +import net.minecraft.block.material.EnumPushReaction; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MovingObjectPosition; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import vazkii.botania.api.internal.IManaBurst; public class LensPiston extends Lens { @Override - public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) { - ChunkCoordinates coords = burst.getBurstSourceChunkCoordinates(); - if((coords.posX != pos.blockX || coords.posY != pos.blockY || coords.posZ != pos.blockZ) && !burst.isFake() && !isManaBlock && !entity.worldObj.isRemote) { - ForgeDirection dir = ForgeDirection.getOrientation(pos.sideHit).getOpposite(); - int x = pos.blockX + dir.offsetX; - int y = pos.blockY + dir.offsetY; - int z = pos.blockZ + dir.offsetZ; + public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) { + BlockPos coords = burst.getBurstSourceBlockPos(); + if(!entity.worldObj.isRemote && pos.getBlockPos() != null && !coords.equals(pos.getBlockPos()) && !burst.isFake() && !isManaBlock) { + BlockPos pos_ = pos.getBlockPos().offset(pos.sideHit.getOpposite()); - if(entity.worldObj.isAirBlock(x, y, z) || entity.worldObj.getBlock(x, y, z).isReplaceable(entity.worldObj, x, y, z)) { - Block block = entity.worldObj.getBlock(pos.blockX, pos.blockY, pos.blockZ); - int meta = entity.worldObj.getBlockMetadata(pos.blockX, pos.blockY, pos.blockZ); - TileEntity tile = entity.worldObj.getTileEntity(pos.blockX, pos.blockY, pos.blockZ); + if(entity.worldObj.isAirBlock(pos_) || entity.worldObj.getBlockState(pos_).getBlock().isReplaceable(entity.worldObj, pos_)) { + IBlockState state = entity.worldObj.getBlockState(pos.getBlockPos()); + TileEntity tile = entity.worldObj.getTileEntity(pos.getBlockPos()); - if(block.getMobilityFlag() == 0 && block != Blocks.obsidian && block.getBlockHardness(entity.worldObj, pos.blockX, pos.blockY, pos.blockZ) >= 0 && tile == null) { - entity.worldObj.setBlockToAir(pos.blockX, pos.blockY, pos.blockZ); - entity.worldObj.setBlock(x, y, z, block, meta, 1 | 2); - entity.worldObj.playAuxSFX(2001, pos.blockX, pos.blockY, pos.blockZ, Block.getIdFromBlock(block) + (meta << 12)); + if(state.getMobilityFlag() == EnumPushReaction.NORMAL && state.getBlock() != Blocks.OBSIDIAN && state.getBlockHardness(entity.worldObj, pos_) >= 0 && tile == null) { + entity.worldObj.destroyBlock(pos.getBlockPos(), false); + entity.worldObj.setBlockState(pos_, state, 1 | 2); } } } diff --git a/src/main/java/vazkii/botania/common/item/lens/LensRedirect.java b/src/main/java/vazkii/botania/common/item/lens/LensRedirect.java index d4a37bb6a..5e406db0a 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensRedirect.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensRedirect.java @@ -13,35 +13,35 @@ package vazkii.botania.common.item.lens; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import vazkii.botania.api.internal.IManaBurst; -import vazkii.botania.api.mana.IRedirectable; +import vazkii.botania.api.mana.IDirectioned; import vazkii.botania.api.mana.IThrottledPacket; import vazkii.botania.common.core.helper.Vector3; public class LensRedirect extends Lens { @Override - public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) { - ChunkCoordinates coords = burst.getBurstSourceChunkCoordinates(); - if(!entity.worldObj.isRemote && pos.entityHit == null && coords.posY != -1 && (pos.blockX != coords.posX || pos.blockY != coords.posY || pos.blockZ != coords.posZ)) { - TileEntity tile = entity.worldObj.getTileEntity(pos.blockX, pos.blockY, pos.blockZ); - if(tile != null && tile instanceof IRedirectable) { + public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) { + BlockPos coords = burst.getBurstSourceBlockPos(); + if(!entity.worldObj.isRemote && pos.entityHit == null && coords.getY() != -1 && (pos.getBlockPos() == null || !pos.getBlockPos().equals(coords))) { + TileEntity tile = entity.worldObj.getTileEntity(pos.getBlockPos()); + if(tile != null && tile instanceof IDirectioned) { if(!burst.isFake()) { - IRedirectable redir = (IRedirectable) tile; + IDirectioned redir = (IDirectioned) tile; Vector3 tileVec = Vector3.fromTileEntityCenter(tile); - Vector3 sourceVec = new Vector3(coords.posX + 0.5, coords.posY + 0.5, coords.posZ + 0.5); + Vector3 sourceVec = new Vector3(coords.getX() + 0.5, coords.getY() + 0.5, coords.getZ() + 0.5); - AxisAlignedBB axis = entity.worldObj.getBlock(coords.posX, coords.posY, coords.posZ).getCollisionBoundingBoxFromPool(entity.worldObj, coords.posX, coords.posY, coords.posZ); + AxisAlignedBB axis = entity.worldObj.getBlockState(coords).getCollisionBoundingBox(entity.worldObj, coords).offset(coords); if(axis == null) - axis = AxisAlignedBB.getBoundingBox(coords.posX, coords.posY, coords.posZ, coords.posX + 1, coords.posY + 1, coords.posZ + 1); + axis = new AxisAlignedBB(coords, coords.add(1, 1, 1)); if(!sourceVec.isInside(axis)) sourceVec = new Vector3(axis.minX + (axis.maxX - axis.minX) / 2, axis.minY + (axis.maxY - axis.minY) / 2, axis.minZ + (axis.maxZ - axis.minZ) / 2); - Vector3 diffVec = sourceVec.copy().sub(tileVec); + Vector3 diffVec = sourceVec.subtract(tileVec); Vector3 diffVec2D = new Vector3(diffVec.x, diffVec.z, 0); Vector3 rotVec = new Vector3(0, 1, 0); double angle = rotVec.angle(diffVec2D) / Math.PI * 180.0; diff --git a/src/main/java/vazkii/botania/common/item/lens/LensStorm.java b/src/main/java/vazkii/botania/common/item/lens/LensStorm.java index cfbbe061d..92797a2fa 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensStorm.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensStorm.java @@ -12,17 +12,17 @@ package vazkii.botania.common.item.lens; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import vazkii.botania.api.internal.IManaBurst; public class LensStorm extends Lens { @Override - public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) { - if(!burst.isFake()) { - ChunkCoordinates coords = burst.getBurstSourceChunkCoordinates(); - if(!entity.worldObj.isRemote && pos.entityHit == null && !isManaBlock && (pos.blockX != coords.posX || pos.blockY != coords.posY || pos.blockZ != coords.posZ)) + public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) { + if(!entity.worldObj.isRemote && !burst.isFake()) { + BlockPos coords = burst.getBurstSourceBlockPos(); + if(pos.entityHit == null && !isManaBlock && (pos.getBlockPos() == null || !coords.equals(pos.getBlockPos()))) entity.worldObj.createExplosion(entity, entity.posX, entity.posY, entity.posZ, 5F, true); } else dead = false; diff --git a/src/main/java/vazkii/botania/common/item/lens/LensWarp.java b/src/main/java/vazkii/botania/common/item/lens/LensWarp.java index 34f4d0dd8..272be6d4c 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensWarp.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensWarp.java @@ -13,7 +13,7 @@ package vazkii.botania.common.item.lens; import net.minecraft.block.Block; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.item.ItemStack; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.math.RayTraceResult; import vazkii.botania.api.internal.IManaBurst; import vazkii.botania.common.block.BlockPistonRelay; import vazkii.botania.common.block.ModBlocks; @@ -21,19 +21,17 @@ import vazkii.botania.common.block.ModBlocks; public class LensWarp extends Lens { @Override - public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) { - if(burst.isFake()) + public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) { + if(burst.isFake() || pos.getBlockPos() == null) return dead; - Block block = entity.worldObj.getBlock(pos.blockX, pos.blockY, pos.blockZ); + Block block = entity.worldObj.getBlockState(pos.getBlockPos()).getBlock(); if(block == ModBlocks.pistonRelay) { - String key = BlockPistonRelay.mappedPositions.get(BlockPistonRelay.getCoordsAsString(entity.worldObj.provider.dimensionId, pos.blockX, pos.blockY, pos.blockZ)); + BlockPistonRelay.DimWithPos key = ((BlockPistonRelay) (ModBlocks.pistonRelay)).mappedPositions.get(new BlockPistonRelay.DimWithPos(entity.worldObj.provider.getDimension(), pos.getBlockPos())); if(key != null) { - String[] tokens = key.split(":"); - int worldId = Integer.parseInt(tokens[0]), x = Integer.parseInt(tokens[1]), y = Integer.parseInt(tokens[2]), z = Integer.parseInt(tokens[3]); - if(worldId == entity.worldObj.provider.dimensionId) { - entity.setPosition(x + 0.5, y + 0.5, z + 0.5); - burst.setCollidedAt(x, y, z); + if(key.dim == entity.worldObj.provider.getDimension()) { + entity.setPosition(key.blockPos.getX() + 0.5, key.blockPos.getY() + 0.5, key.blockPos.getZ() + 0.5); + burst.setCollidedAt(key.blockPos); return false; } } diff --git a/src/main/java/vazkii/botania/common/item/lens/LensWeight.java b/src/main/java/vazkii/botania/common/item/lens/LensWeight.java index 205d92ac9..ba6a39c44 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensWeight.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensWeight.java @@ -10,33 +10,41 @@ */ package vazkii.botania.common.item.lens; +import com.google.common.collect.ImmutableMap; import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.item.EntityFallingBlock; import net.minecraft.entity.projectile.EntityThrowable; +import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.math.RayTraceResult; import vazkii.botania.api.internal.IManaBurst; import vazkii.botania.common.core.handler.ConfigHandler; +import java.util.Map; + public class LensWeight extends Lens { + private static final Map TECHNICAL_BLOCK_REMAP = ImmutableMap.of( + Blocks.LIT_REDSTONE_ORE.getDefaultState(), Blocks.REDSTONE_ORE.getDefaultState(), + Blocks.LIT_REDSTONE_LAMP.getDefaultState(), Blocks.REDSTONE_LAMP.getDefaultState() + ); + @Override - public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) { - if(!burst.isFake()) { - int x = pos.blockX; - int y = pos.blockY; - int z = pos.blockZ; + public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) { + if(!entity.worldObj.isRemote && !burst.isFake() && pos.getBlockPos() != null) { int harvestLevel = ConfigHandler.harvestLevelWeight; - Block block = entity.worldObj.getBlock(x, y, z); - Block blockBelow = entity.worldObj.getBlock(x, y - 1, z); - int meta = entity.worldObj.getBlockMetadata(x, y, z); - int neededHarvestLevel = block.getHarvestLevel(meta); + Block block = entity.worldObj.getBlockState(pos.getBlockPos()).getBlock(); + IBlockState state = entity.worldObj.getBlockState(pos.getBlockPos()); + int neededHarvestLevel = block.getHarvestLevel(state); - if(blockBelow.isAir(entity.worldObj, x, y - 1, z) && block.getBlockHardness(entity.worldObj, x, y, z) != -1 && neededHarvestLevel <= harvestLevel && entity.worldObj.getTileEntity(x, y, z) == null && block.canSilkHarvest(entity.worldObj, null, x, y, z, meta)) { - EntityFallingBlock falling = new EntityFallingBlock(entity.worldObj, x + 0.5, y + 0.5, z + 0.5, block, meta); - if(!entity.worldObj.isRemote) - entity.worldObj.spawnEntityInWorld(falling); + if(entity.worldObj.isAirBlock(pos.getBlockPos().down()) && state.getBlockHardness(entity.worldObj, pos.getBlockPos()) != -1 && neededHarvestLevel <= harvestLevel && entity.worldObj.getTileEntity(pos.getBlockPos()) == null && block.canSilkHarvest(entity.worldObj, pos.getBlockPos(), state, null)) { + state = TECHNICAL_BLOCK_REMAP.getOrDefault(state, state); + EntityFallingBlock falling = new EntityFallingBlock(entity.worldObj, pos.getBlockPos().getX() + 0.5, pos.getBlockPos().getY() + 0.5, pos.getBlockPos().getZ() + 0.5, state); + falling.fallTime = 1; + entity.worldObj.setBlockToAir(pos.getBlockPos()); + entity.worldObj.spawnEntityInWorld(falling); } } diff --git a/src/main/java/vazkii/botania/common/item/material/ItemDye.java b/src/main/java/vazkii/botania/common/item/material/ItemDye.java index c209a0a83..b4814f715 100644 --- a/src/main/java/vazkii/botania/common/item/material/ItemDye.java +++ b/src/main/java/vazkii/botania/common/item/material/ItemDye.java @@ -11,60 +11,66 @@ package vazkii.botania.common.item.material; import net.minecraft.block.Block; +import net.minecraft.block.BlockCarpet; +import net.minecraft.block.BlockColored; import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.passive.EntitySheep; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; +import net.minecraft.item.EnumDyeColor; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import vazkii.botania.api.internal.VanillaPacketDispatcher; -import vazkii.botania.api.item.IDyablePool; -import vazkii.botania.api.item.IManaDissolvable; import vazkii.botania.api.mana.IManaPool; import vazkii.botania.common.item.Item16Colors; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; + public class ItemDye extends Item16Colors { public ItemDye() { super(LibItemNames.DYE); } + @Nonnull @Override - public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { - Block block = par3World.getBlock(par4, par5, par6); - int meta = par1ItemStack.getItemDamage(); - if(meta != par3World.getBlockMetadata(par4, par5, par6) && (block == Blocks.wool || block == Blocks.carpet)) { - par3World.setBlockMetadataWithNotify(par4, par5, par6, meta, 1 | 2); + public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) { + Block block = world.getBlockState(pos).getBlock(); + EnumDyeColor color = EnumDyeColor.byMetadata(par1ItemStack.getItemDamage()); + if(block == Blocks.WOOL && color != world.getBlockState(pos).getValue(BlockColored.COLOR) + || block == Blocks.CARPET && color != world.getBlockState(pos).getValue(BlockCarpet.COLOR)) { + world.setBlockState(pos, world.getBlockState(pos).withProperty(block == Blocks.WOOL ? BlockColored.COLOR : BlockCarpet.COLOR, color), 1 | 2); par1ItemStack.stackSize--; - return true; + return EnumActionResult.SUCCESS; } - - TileEntity tile = par3World.getTileEntity(par4, par5, par6); - if(tile instanceof IDyablePool) { - IDyablePool dyable = (IDyablePool) tile; - int itemMeta = par1ItemStack.getItemDamage(); - if(meta != dyable.getColor()) { - dyable.setColor(meta); + + TileEntity tile = world.getTileEntity(pos); + if(tile instanceof IManaPool) { + IManaPool pool = (IManaPool) tile; + if(color != pool.getColor()) { + pool.setColor(color); par1ItemStack.stackSize--; - return true; + return EnumActionResult.SUCCESS; } } - - return false; + + return EnumActionResult.PASS; } @Override - public boolean itemInteractionForEntity(ItemStack p_111207_1_, EntityPlayer p_111207_2_, EntityLivingBase p_111207_3_) { - if(p_111207_3_ instanceof EntitySheep) { - EntitySheep entitysheep = (EntitySheep)p_111207_3_; - int i = p_111207_1_.getItemDamage(); + public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer player, EntityLivingBase target, EnumHand hand) { + if(target instanceof EntitySheep) { + EntitySheep entitysheep = (EntitySheep)target; + EnumDyeColor i = EnumDyeColor.byMetadata(stack.getItemDamage()); if(!entitysheep.getSheared() && entitysheep.getFleeceColor() != i) { entitysheep.setFleeceColor(i); - --p_111207_1_.stackSize; + --stack.stackSize; } return true; diff --git a/src/main/java/vazkii/botania/common/item/material/ItemManaPetal.java b/src/main/java/vazkii/botania/common/item/material/ItemManaPetal.java deleted file mode 100644 index 0c35bf25a..000000000 --- a/src/main/java/vazkii/botania/common/item/material/ItemManaPetal.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Feb 2, 2014, 12:57:22 PM (GMT)] - */ -package vazkii.botania.common.item.material; - -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import vazkii.botania.api.recipe.IFlowerComponent; -import vazkii.botania.common.item.Item16Colors; -import vazkii.botania.common.lib.LibItemNames; - -public class ItemManaPetal extends Item16Colors implements IFlowerComponent { - - public ItemManaPetal() { - super(LibItemNames.MANA_PETAL); - } - - @Override - public boolean canFit(ItemStack stack, IInventory apothecary) { - return true; - } - - @Override - public int getParticleColor(ItemStack stack) { - return getColorFromItemStack(stack, 0); - } -} diff --git a/src/main/java/vazkii/botania/common/item/material/ItemManaResource.java b/src/main/java/vazkii/botania/common/item/material/ItemManaResource.java index c3693a99a..6867528b4 100644 --- a/src/main/java/vazkii/botania/common/item/material/ItemManaResource.java +++ b/src/main/java/vazkii/botania/common/item/material/ItemManaResource.java @@ -10,159 +10,132 @@ */ package vazkii.botania.common.item.material; -import java.awt.Color; -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; -import net.minecraft.inventory.IInventory; +import net.minecraft.init.SoundEvents; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.stats.Achievement; -import net.minecraft.util.IIcon; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.PlayerInteractEvent; -import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.api.item.IPetalApothecary; import vazkii.botania.api.recipe.IElvenItem; import vazkii.botania.api.recipe.IFlowerComponent; -import vazkii.botania.client.core.helper.IconHelper; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.Botania; import vazkii.botania.common.achievement.IPickupAchievement; import vazkii.botania.common.achievement.ModAchievements; import vazkii.botania.common.entity.EntityDoppleganger; import vazkii.botania.common.entity.EntityEnderAirBottle; import vazkii.botania.common.item.ItemMod; -import vazkii.botania.common.item.equipment.tool.ToolCommons; import vazkii.botania.common.lib.LibItemNames; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import javax.annotation.Nonnull; +import java.util.List; public class ItemManaResource extends ItemMod implements IFlowerComponent, IElvenItem, IPickupAchievement { final int types = 24; - IIcon[] icons; - - // begin dank_memes - public IIcon tailIcon = null; - public IIcon phiFlowerIcon = null; - public IIcon goldfishIcon = null; - public IIcon nerfBatIcon = null; - // end dank_memes public ItemManaResource() { - super(); - setUnlocalizedName(LibItemNames.MANA_RESOURCE); + super(LibItemNames.MANA_RESOURCE); setHasSubtypes(true); MinecraftForge.EVENT_BUS.register(this); } @SubscribeEvent - public void onPlayerInteract(PlayerInteractEvent event) { - boolean rightEvent = event.action == Action.RIGHT_CLICK_AIR; - ItemStack stack = event.entityPlayer.getCurrentEquippedItem(); - boolean correctStack = stack != null && stack.getItem() == Items.glass_bottle; - boolean ender = event.world.provider.dimensionId == 1; + public void onPlayerInteract(PlayerInteractEvent.RightClickBlock event) { + ItemStack stack = event.getItemStack(); + boolean correctStack = stack != null && stack.getItem() == Items.GLASS_BOTTLE; + boolean ender = event.getWorld().provider.getDimension() == 1; - if(rightEvent && correctStack && ender) { - MovingObjectPosition pos = ToolCommons.raytraceFromEntity(event.world, event.entityPlayer, false, 5F); - - if(pos == null) { + if(correctStack && ender) { + if (event.getWorld().isRemote) { + event.getEntityPlayer().swingArm(event.getHand()); + } else { ItemStack stack1 = new ItemStack(this, 1, 15); - event.entityPlayer.addStat(ModAchievements.enderAirMake, 1); + event.getEntityPlayer().addStat(ModAchievements.enderAirMake, 1); - if(!event.entityPlayer.inventory.addItemStackToInventory(stack1)) - event.entityPlayer.dropPlayerItemWithRandomChoice(stack1, true); + if(!event.getEntityPlayer().inventory.addItemStackToInventory(stack1)) { + event.getEntityPlayer().dropItem(stack1, true); + } else { + event.getEntityPlayer().openContainer.detectAndSendChanges(); + } stack.stackSize--; if(stack.stackSize == 0) - event.entityPlayer.inventory.setInventorySlotContents(event.entityPlayer.inventory.currentItem, null); + event.getEntityPlayer().setHeldItem(event.getHand(), null); - if(event.world.isRemote) - event.entityPlayer.swingItem(); - else event.world.playSoundAtEntity(event.entityPlayer, "random.pop", 0.5F, 1F); + event.getWorld().playSound(null, event.getPos(), SoundEvents.ENTITY_ITEM_PICKUP, SoundCategory.PLAYERS, 0.5F, 1F); + event.setCanceled(true); } } } + @Nonnull @Override - public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { + public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) { if(par1ItemStack.getItemDamage() == 4 || par1ItemStack.getItemDamage() == 14) - return EntityDoppleganger.spawn(par2EntityPlayer, par1ItemStack, par3World, par4, par5, par6, par1ItemStack.getItemDamage() == 14); - else if(par1ItemStack.getItemDamage() == 20 && net.minecraft.item.ItemDye.applyBonemeal(par1ItemStack, par3World, par4, par5, par6, par2EntityPlayer)) { - if(!par3World.isRemote) - par3World.playAuxSFX(2005, par4, par5, par6, 0); + return world.isRemote || EntityDoppleganger.spawn(player, par1ItemStack, world, pos, par1ItemStack.getItemDamage() == 14) ? EnumActionResult.SUCCESS : EnumActionResult.FAIL; + else if(par1ItemStack.getItemDamage() == 20 && net.minecraft.item.ItemDye.applyBonemeal(par1ItemStack, world, pos, player)) { + if(!world.isRemote) + world.playEvent(2005, pos, 0); - return true; + return EnumActionResult.SUCCESS; } - return super.onItemUse(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10); + return super.onItemUse(par1ItemStack, player, world, pos, hand, side, par8, par9, par10); } + @Nonnull @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par3World, EntityPlayer par2EntityPlayer) { + public ActionResult onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) { if(par1ItemStack.getItemDamage() == 15) { - if(!par2EntityPlayer.capabilities.isCreativeMode) + if(!player.capabilities.isCreativeMode) --par1ItemStack.stackSize; - par3World.playSoundAtEntity(par2EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.PLAYERS, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); - if(!par3World.isRemote) - par3World.spawnEntityInWorld(new EntityEnderAirBottle(par3World, par2EntityPlayer)); - else par2EntityPlayer.swingItem(); + if(!world.isRemote) { + EntityEnderAirBottle b = new EntityEnderAirBottle(world, player); + b.setHeadingFromThrower(player, player.rotationPitch, player.rotationYaw, 0F, 1.5F, 1F); + world.spawnEntityInWorld(b); + } + else player.swingArm(hand); + return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack); } - return par1ItemStack; + return ActionResult.newResult(EnumActionResult.PASS, par1ItemStack); } @Override @SideOnly(Side.CLIENT) - public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) { + public void getSubItems(@Nonnull Item item, CreativeTabs tab, List stacks) { for(int i = 0; i < types; i++) if(Botania.gardenOfGlassLoaded || i != 20 && i != 21) - par3List.add(new ItemStack(par1, 1, i)); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) { - icons = new IIcon[types]; - for(int i = 0; i < icons.length; i++) - icons[i] = IconHelper.forName(par1IconRegister, LibItemNames.MANA_RESOURCE_NAMES[i]); - - tailIcon = IconHelper.forName(par1IconRegister, "tail"); - phiFlowerIcon = IconHelper.forName(par1IconRegister, "phiFlower"); - goldfishIcon = IconHelper.forName(par1IconRegister, "goldfish"); - nerfBatIcon = IconHelper.forName(par1IconRegister, "nerfBat"); - } - - @Override - @SideOnly(Side.CLIENT) - public int getColorFromItemStack(ItemStack par1ItemStack, int par2) { - if(par1ItemStack.getItemDamage() == 5 || par1ItemStack.getItemDamage() == 14) - return Color.HSBtoRGB(Botania.proxy.getWorldElapsedTicks() * 2 % 360 / 360F, 0.25F, 1F); - - return 0xFFFFFF; + stacks.add(new ItemStack(item, 1, i)); } + @Nonnull @Override public String getUnlocalizedName(ItemStack par1ItemStack) { return "item." + LibItemNames.MANA_RESOURCE_NAMES[Math.min(types - 1, par1ItemStack.getItemDamage())]; } @Override - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamage(int par1) { - return icons[Math.min(icons.length - 1, par1)]; - } - - @Override - public boolean canFit(ItemStack stack, IInventory apothecary) { + public boolean canFit(ItemStack stack, IPetalApothecary apothecary) { int meta = stack.getItemDamage(); return meta == 6 || meta == 8 || meta == 5 || meta == 23; } @@ -178,8 +151,9 @@ public class ItemManaResource extends ItemMod implements IFlowerComponent, IElve return meta == 7 || meta == 8 || meta == 9; } + @Nonnull @Override - public ItemStack getContainerItem(ItemStack itemStack) { + public ItemStack getContainerItem(@Nonnull ItemStack itemStack) { return itemStack.getItemDamage() == 11 ? itemStack.copy() : null; } @@ -188,4 +162,10 @@ public class ItemManaResource extends ItemMod implements IFlowerComponent, IElve return stack.getItemDamage() == 4 ? ModAchievements.terrasteelPickup : null; } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerItemMetas(this, LibItemNames.MANA_RESOURCE_NAMES.length, i -> LibItemNames.MANA_RESOURCE_NAMES[i]); + } + } diff --git a/src/main/java/vazkii/botania/common/item/material/ItemPestleAndMortar.java b/src/main/java/vazkii/botania/common/item/material/ItemPestleAndMortar.java index 23e836537..a5d7c844b 100644 --- a/src/main/java/vazkii/botania/common/item/material/ItemPestleAndMortar.java +++ b/src/main/java/vazkii/botania/common/item/material/ItemPestleAndMortar.java @@ -10,22 +10,15 @@ */ package vazkii.botania.common.item.material; -import net.minecraft.item.ItemStack; import vazkii.botania.common.item.ItemMod; import vazkii.botania.common.lib.LibItemNames; public class ItemPestleAndMortar extends ItemMod { public ItemPestleAndMortar() { - super(); + super(LibItemNames.PESTLE_AND_MORTAR); setMaxStackSize(1); setContainerItem(this); - setUnlocalizedName(LibItemNames.PESTLE_AND_MORTAR); - } - - @Override - public boolean doesContainerItemLeaveCraftingGrid(ItemStack par1ItemStack) { - return false; } } diff --git a/src/main/java/vazkii/botania/common/item/material/ItemPetal.java b/src/main/java/vazkii/botania/common/item/material/ItemPetal.java index 4f11fbec4..4ababaf64 100644 --- a/src/main/java/vazkii/botania/common/item/material/ItemPetal.java +++ b/src/main/java/vazkii/botania/common/item/material/ItemPetal.java @@ -10,42 +10,91 @@ */ package vazkii.botania.common.item.material; +import net.minecraft.block.Block; +import net.minecraft.block.SoundType; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; +import net.minecraft.item.EnumDyeColor; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; +import vazkii.botania.api.item.IPetalApothecary; import vazkii.botania.api.recipe.IFlowerComponent; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.item.Item16Colors; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; + public class ItemPetal extends Item16Colors implements IFlowerComponent { public ItemPetal() { super(LibItemNames.PETAL); } + @Nonnull @Override - public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { - ItemStack stackToPlace = new ItemStack(ModBlocks.buriedPetals, 1, par1ItemStack.getItemDamage()); - stackToPlace.tryPlaceItemIntoWorld(par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10); + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { + // Copy of ItemBlock.onItemUse + IBlockState iblockstate = world.getBlockState(pos); + Block block = iblockstate.getBlock(); - if(stackToPlace.stackSize == 0) { - if(!par2EntityPlayer.capabilities.isCreativeMode) - par1ItemStack.stackSize--; - - return true; + if (!block.isReplaceable(world, pos)) + { + pos = pos.offset(facing); } - return false; + + if (stack.stackSize != 0 && player.canPlayerEdit(pos, facing, stack) && world.canBlockBePlaced(ModBlocks.buriedPetals, pos, false, facing, null, stack)) + { + int i = this.getMetadata(stack.getMetadata()); + IBlockState iblockstate1 = ModBlocks.buriedPetals.onBlockPlaced(world, pos, facing, hitX, hitY, hitZ, i, player); + + if (placeBlockAt(stack, player, world, pos, facing, hitX, hitY, hitZ, iblockstate1)) + { + SoundType soundtype = ModBlocks.buriedPetals.getSoundType(); + world.playSound(player, pos, soundtype.getPlaceSound(), SoundCategory.BLOCKS, (soundtype.getVolume() + 1.0F) / 2.0F, soundtype.getPitch() * 0.8F); + --stack.stackSize; + } + + return EnumActionResult.SUCCESS; + } + else + { + return EnumActionResult.FAIL; + } + } + + // Direct copy of ItemBlock.placeBlockAt + private boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, IBlockState newState) { + if (!world.setBlockState(pos, newState, 3)) return false; + + IBlockState state = world.getBlockState(pos); + if (state.getBlock() == ModBlocks.buriedPetals) + { + // setTileEntityNBT(world, player, pos, stack); + ModBlocks.buriedPetals.onBlockPlacedBy(world, pos, state, player, stack); + } + + return true; } @Override - public boolean canFit(ItemStack stack, IInventory apothecary) { + public int getMetadata(int stackMeta) { + return MathHelper.clamp_int(stackMeta, 0, 15); + } + + @Override + public boolean canFit(ItemStack stack, IPetalApothecary apothecary) { return true; } @Override public int getParticleColor(ItemStack stack) { - return getColorFromItemStack(stack, 0); + return EnumDyeColor.byMetadata(stack.getItemDamage()).getMapColor().colorValue; } } diff --git a/src/main/java/vazkii/botania/common/item/material/ItemQuartz.java b/src/main/java/vazkii/botania/common/item/material/ItemQuartz.java index 0ab289299..6c935047e 100644 --- a/src/main/java/vazkii/botania/common/item/material/ItemQuartz.java +++ b/src/main/java/vazkii/botania/common/item/material/ItemQuartz.java @@ -10,53 +10,43 @@ */ package vazkii.botania.common.item.material; -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.recipe.IElvenItem; -import vazkii.botania.client.core.helper.IconHelper; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.item.ItemMod; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; +import java.util.List; + public class ItemQuartz extends ItemMod implements IElvenItem { private static final int SUBTYPES = 7; - IIcon[] icons; public ItemQuartz() { - setUnlocalizedName(LibItemNames.QUARTZ); + super(LibItemNames.QUARTZ); setHasSubtypes(true); } @Override - public void getSubItems(Item item, CreativeTabs tab, List list) { + @SideOnly(Side.CLIENT) + public void getSubItems(@Nonnull Item item, CreativeTabs tab, List list) { for(int i = ConfigHandler.darkQuartzEnabled ? 0 : 1; i < SUBTYPES; i++) list.add(new ItemStack(item, 1, i)); } - @Override - public void registerIcons(IIconRegister par1IconRegister) { - icons = new IIcon[SUBTYPES]; - for(int i = 0; i < icons.length; i++) - icons[i] = IconHelper.forItem(par1IconRegister, this, i); - } - - @Override - public IIcon getIconFromDamage(int par1) { - return icons[Math.min(icons.length - 1, par1)]; - } - + @Nonnull @Override public String getUnlocalizedName(ItemStack par1ItemStack) { return getUnlocalizedNameLazy(par1ItemStack) + par1ItemStack.getItemDamage(); } - String getUnlocalizedNameLazy(ItemStack par1ItemStack) { + private String getUnlocalizedNameLazy(ItemStack par1ItemStack) { return super.getUnlocalizedName(par1ItemStack); } @@ -64,4 +54,10 @@ public class ItemQuartz extends ItemMod implements IElvenItem { public boolean isElvenItem(ItemStack stack) { return stack.getItemDamage() == 5; } + + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelHandler.registerItemAppendMeta(this, 7, LibItemNames.QUARTZ); + } } diff --git a/src/main/java/vazkii/botania/common/item/material/ItemRune.java b/src/main/java/vazkii/botania/common/item/material/ItemRune.java index e678f3676..24f7163f1 100644 --- a/src/main/java/vazkii/botania/common/item/material/ItemRune.java +++ b/src/main/java/vazkii/botania/common/item/material/ItemRune.java @@ -10,52 +10,40 @@ */ package vazkii.botania.common.item.material; -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.stats.Achievement; -import net.minecraft.util.IIcon; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import vazkii.botania.api.item.IPetalApothecary; import vazkii.botania.api.recipe.IFlowerComponent; -import vazkii.botania.client.core.helper.IconHelper; +import vazkii.botania.client.core.handler.ModelHandler; import vazkii.botania.common.achievement.IPickupAchievement; import vazkii.botania.common.achievement.ModAchievements; import vazkii.botania.common.item.ItemMod; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; +import java.util.List; + public class ItemRune extends ItemMod implements IFlowerComponent, IPickupAchievement { - IIcon[] icons; - public ItemRune() { - super(); + super(LibItemNames.RUNE); setHasSubtypes(true); - setUnlocalizedName(LibItemNames.RUNE); } @Override - public void registerIcons(IIconRegister par1IconRegister) { - icons = new IIcon[16]; - for(int i = 0; i < icons.length; i++) - icons[i] = IconHelper.forItem(par1IconRegister, this, i); - } - - @Override - public IIcon getIconFromDamage(int par1) { - return icons[Math.min(icons.length - 1, par1)]; - } - - @Override - public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) { + @SideOnly(Side.CLIENT) + public void getSubItems(@Nonnull Item item, CreativeTabs tab, List stacks) { for(int i = 0; i < 16; i++) - par3List.add(new ItemStack(par1, 1, i)); + stacks.add(new ItemStack(item, 1, i)); } + @Nonnull @Override public String getUnlocalizedName(ItemStack par1ItemStack) { return getUnlocalizedNameLazy(par1ItemStack) + par1ItemStack.getItemDamage(); @@ -66,7 +54,7 @@ public class ItemRune extends ItemMod implements IFlowerComponent, IPickupAchiev } @Override - public boolean canFit(ItemStack stack, IInventory apothecary) { + public boolean canFit(ItemStack stack, IPetalApothecary apothecary) { return true; } @@ -80,4 +68,11 @@ public class ItemRune extends ItemMod implements IFlowerComponent, IPickupAchiev return ModAchievements.runePickup; } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + String[] runeNames = { "water", "fire", "earth", "air", "spring", "summer", "autumn", "winter", "mana", "lust", "gluttony", "greed", "sloth", "wrath", "envy", "pride" }; + ModelHandler.registerItemMetas(this, runeNames.length, i -> "rune_" + runeNames[i]); + } + } diff --git a/src/main/java/vazkii/botania/common/item/record/ItemModRecord.java b/src/main/java/vazkii/botania/common/item/record/ItemModRecord.java index 793dd4d7e..5d36bb0a8 100644 --- a/src/main/java/vazkii/botania/common/item/record/ItemModRecord.java +++ b/src/main/java/vazkii/botania/common/item/record/ItemModRecord.java @@ -10,49 +10,49 @@ */ package vazkii.botania.common.item.record; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.item.Item; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.item.ItemRecord; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; -import vazkii.botania.client.core.helper.IconHelper; +import net.minecraft.util.SoundEvent; +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.client.lib.LibResources; +import vazkii.botania.client.render.IModelRegister; import vazkii.botania.common.core.BotaniaCreativeTab; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import vazkii.botania.common.lib.LibMisc; -public class ItemModRecord extends ItemRecord { +import javax.annotation.Nonnull; + +public class ItemModRecord extends ItemRecord implements IModelRegister { private final String file; - public ItemModRecord(String record, String name) { - super("botania:" + record); + public ItemModRecord(String record, SoundEvent sound, String name) { + super("botania:" + record, sound); setCreativeTab(BotaniaCreativeTab.INSTANCE); + GameRegistry.register(this, new ResourceLocation(LibMisc.MOD_ID, name)); setUnlocalizedName(name); file = "botania:music." + record; } + @Nonnull @Override - public Item setUnlocalizedName(String par1Str) { - GameRegistry.registerItem(this, par1Str); - return super.setUnlocalizedName(par1Str); - } - - @Override - public String getUnlocalizedNameInefficiently(ItemStack par1ItemStack) { + public String getUnlocalizedNameInefficiently(@Nonnull ItemStack par1ItemStack) { return super.getUnlocalizedNameInefficiently(par1ItemStack).replaceAll("item\\.", "item." + LibResources.PREFIX_MOD); } - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) { - itemIcon = IconHelper.forItem(par1IconRegister, this); - } - + @Nonnull @Override public ResourceLocation getRecordResource(String name) { return new ResourceLocation(file); } + @SideOnly(Side.CLIENT) + @Override + public void registerModels() { + ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory")); + } } diff --git a/src/main/java/vazkii/botania/common/item/record/ItemRecordGaia1.java b/src/main/java/vazkii/botania/common/item/record/ItemRecordGaia1.java index c1c5d4b9b..758dc699b 100644 --- a/src/main/java/vazkii/botania/common/item/record/ItemRecordGaia1.java +++ b/src/main/java/vazkii/botania/common/item/record/ItemRecordGaia1.java @@ -10,12 +10,13 @@ */ package vazkii.botania.common.item.record; +import vazkii.botania.api.sound.BotaniaSoundEvents; import vazkii.botania.common.lib.LibItemNames; public class ItemRecordGaia1 extends ItemModRecord { public ItemRecordGaia1() { - super("gaia1", LibItemNames.RECORD_GAIA1); + super("gaia1", BotaniaSoundEvents.gaiaMusic1, LibItemNames.RECORD_GAIA1); } } diff --git a/src/main/java/vazkii/botania/common/item/record/ItemRecordGaia2.java b/src/main/java/vazkii/botania/common/item/record/ItemRecordGaia2.java index 2f1f1f6ca..c01774a79 100644 --- a/src/main/java/vazkii/botania/common/item/record/ItemRecordGaia2.java +++ b/src/main/java/vazkii/botania/common/item/record/ItemRecordGaia2.java @@ -10,12 +10,13 @@ */ package vazkii.botania.common.item.record; +import vazkii.botania.api.sound.BotaniaSoundEvents; import vazkii.botania.common.lib.LibItemNames; public class ItemRecordGaia2 extends ItemModRecord { public ItemRecordGaia2() { - super("gaia2", LibItemNames.RECORD_GAIA2); + super("gaia2", BotaniaSoundEvents.gaiaMusic2, LibItemNames.RECORD_GAIA2); } } diff --git a/src/main/java/vazkii/botania/common/item/relic/ItemAesirRing.java b/src/main/java/vazkii/botania/common/item/relic/ItemAesirRing.java index c523bb087..528f53fe0 100644 --- a/src/main/java/vazkii/botania/common/item/relic/ItemAesirRing.java +++ b/src/main/java/vazkii/botania/common/item/relic/ItemAesirRing.java @@ -10,8 +10,9 @@ */ package vazkii.botania.common.item.relic; -import java.util.List; - +import baubles.api.BaubleType; +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Multimap; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.attributes.AttributeModifier; @@ -21,29 +22,27 @@ import net.minecraft.inventory.IInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.stats.Achievement; -import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.math.BlockPos; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.item.ItemTossEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.oredict.RecipeSorter; import net.minecraftforge.oredict.RecipeSorter.Category; -import vazkii.botania.api.item.IExtendedWireframeCoordinateListProvider; import vazkii.botania.api.item.IWireframeCoordinateListProvider; import vazkii.botania.common.achievement.ICraftAchievement; import vazkii.botania.common.achievement.ModAchievements; +import vazkii.botania.common.core.handler.MethodHandles; import vazkii.botania.common.crafting.recipe.AesirRingRecipe; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.lib.LibItemNames; -import baubles.api.BaubleType; -import com.google.common.collect.HashMultimap; -import com.google.common.collect.Multimap; +import java.util.List; +import java.util.UUID; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.registry.GameRegistry; +public class ItemAesirRing extends ItemRelicBauble implements IWireframeCoordinateListProvider, ICraftAchievement { -public class ItemAesirRing extends ItemRelicBauble implements IExtendedWireframeCoordinateListProvider, ICraftAchievement { - - Multimap attributes = HashMultimap.create(); + private final Multimap attributes = HashMultimap.create(); public ItemAesirRing() { super(LibItemNames.AESIR_RING); @@ -54,21 +53,30 @@ public class ItemAesirRing extends ItemRelicBauble implements IExtendedWireframe @SubscribeEvent public void onDropped(ItemTossEvent event) { - if(event.entityItem != null && event.entityItem.getEntityItem() != null && !event.entityItem.worldObj.isRemote) { - ItemStack stack = event.entityItem.getEntityItem(); + if(event.getEntityItem() != null && event.getEntityItem().getEntityItem() != null && !event.getEntityItem().worldObj.isRemote) { + ItemStack stack = event.getEntityItem().getEntityItem(); if(stack.getItem() != null && stack.getItem() == this) { - event.entityItem.setDead(); + event.getEntityItem().setDead(); - String user = getSoulbindUsername(stack); + UUID user = getSoulbindUUID(stack); for(Item item : new Item[] { ModItems.thorRing, ModItems.lokiRing, ModItems.odinRing }) { ItemStack stack1 = new ItemStack(item); - bindToUsername(user, stack1); - EntityItem entity = new EntityItem(event.entityItem.worldObj, event.entityItem.posX, event.entityItem.posY, event.entityItem.posZ, stack1); - entity.motionX = event.entityItem.motionX; - entity.motionY = event.entityItem.motionY; - entity.motionZ = event.entityItem.motionZ; - entity.age = event.entityItem.age; - entity.delayBeforeCanPickup = event.entityItem.delayBeforeCanPickup; + bindToUUID(user, stack1); + EntityItem entity = new EntityItem(event.getEntityItem().worldObj, event.getEntityItem().posX, event.getEntityItem().posY, event.getEntityItem().posZ, stack1); + entity.motionX = event.getEntityItem().motionX; + entity.motionY = event.getEntityItem().motionY; + entity.motionZ = event.getEntityItem().motionZ; + + try { + MethodHandles.itemAge_setter.invokeExact(entity, MethodHandles.itemAge_getter.invokeExact(entity)); + } catch (Throwable ignored) {} + + int pickupDelay = 0; + try { + pickupDelay = (int) MethodHandles.pickupDelay_getter.invokeExact(event.getEntityItem()); + } catch (Throwable ignored) {} + entity.setPickupDelay(pickupDelay); + entity.worldObj.spawnEntityInWorld(entity); } } @@ -86,13 +94,13 @@ public class ItemAesirRing extends ItemRelicBauble implements IExtendedWireframe } @Override - public List getWireframesToDraw(EntityPlayer player, ItemStack stack) { + public List getWireframesToDraw(EntityPlayer player, ItemStack stack) { return ((IWireframeCoordinateListProvider) ModItems.lokiRing).getWireframesToDraw(player, stack); } @Override - public ChunkCoordinates getSourceWireframe(EntityPlayer player, ItemStack stack) { - return ((IExtendedWireframeCoordinateListProvider) ModItems.lokiRing).getSourceWireframe(player, stack); + public BlockPos getSourceWireframe(EntityPlayer player, ItemStack stack) { + return ((IWireframeCoordinateListProvider) ModItems.lokiRing).getSourceWireframe(player, stack); } @Override @@ -110,8 +118,8 @@ public class ItemAesirRing extends ItemRelicBauble implements IExtendedWireframe } - void fillModifiers(Multimap attributes, ItemStack stack) { - attributes.put(SharedMonsterAttributes.maxHealth.getAttributeUnlocalizedName(), new AttributeModifier(getBaubleUUID(stack), "Bauble modifier", 20, 0)); + private void fillModifiers(Multimap attributes, ItemStack stack) { + attributes.put(SharedMonsterAttributes.MAX_HEALTH.getAttributeUnlocalizedName(), new AttributeModifier(getBaubleUUID(stack), "Bauble modifier", 20, 0)); } @Override diff --git a/src/main/java/vazkii/botania/common/item/relic/ItemDice.java b/src/main/java/vazkii/botania/common/item/relic/ItemDice.java index a0594132b..c845baf6b 100644 --- a/src/main/java/vazkii/botania/common/item/relic/ItemDice.java +++ b/src/main/java/vazkii/botania/common/item/relic/ItemDice.java @@ -10,27 +10,30 @@ */ package vazkii.botania.common.item.relic; -import java.util.ArrayList; -import java.util.List; - +import gnu.trove.list.array.TIntArrayList; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.SoundEvents; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.stats.Achievement; -import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.util.ChatStyle; -import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.text.Style; +import net.minecraft.util.text.TextComponentTranslation; +import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; import vazkii.botania.api.item.IRelic; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; + public class ItemDice extends ItemRelic { - private static final int[] SIDES_FOR_MOON_PHASES = new int[] { - -1, 0, 1, 2, -1, 2, 3, 4 - }; + private static final int[] SIDES_FOR_MOON_PHASES = { -1, 0, 1, 2, -1, 2, 3, 4 }; public static ItemStack[] relicStacks; @@ -47,15 +50,15 @@ public class ItemDice extends ItemRelic { }; } + @Nonnull @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { + public ActionResult onItemRightClick(@Nonnull ItemStack stack, World world, EntityPlayer player, EnumHand hand) { if(isRightPlayer(player, stack) && !player.worldObj.isRemote) { int moonPhase = world.provider.getMoonPhase(world.getWorldTime()); - int side = SIDES_FOR_MOON_PHASES[moonPhase]; - int relic = side; + int relic = SIDES_FOR_MOON_PHASES[moonPhase]; if(hasRelicAlready(player, relic)) { - List possible = new ArrayList(); - List alreadyHas = new ArrayList(); + TIntArrayList possible = new TIntArrayList(); + TIntArrayList alreadyHas = new TIntArrayList(); for(int i = 0; i < 6; i++) if(hasRelicAlready(player, i)) alreadyHas.add(i); @@ -66,19 +69,19 @@ public class ItemDice extends ItemRelic { relic = possible.get(world.rand.nextInt(possible.size())); } - world.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / (world.rand.nextFloat() * 0.4F + 0.8F)); + world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.PLAYERS, 0.5F, 0.4F / (world.rand.nextFloat() * 0.4F + 0.8F)); if(hasRelicAlready(player, relic)) { - player.addChatMessage(new ChatComponentTranslation("botaniamisc.dudDiceRoll", relic + 1).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.DARK_GREEN))); + player.addChatMessage(new TextComponentTranslation("botaniamisc.dudDiceRoll", relic + 1).setStyle(new Style().setColor(TextFormatting.DARK_GREEN))); stack.stackSize--; - return stack; + return ActionResult.newResult(EnumActionResult.SUCCESS, stack); } - player.addChatMessage(new ChatComponentTranslation("botaniamisc.diceRoll", relic + 1).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.DARK_GREEN))); - return relicStacks[relic].copy(); + player.addChatMessage(new TextComponentTranslation("botaniamisc.diceRoll", relic + 1).setStyle(new Style().setColor(TextFormatting.DARK_GREEN))); + return ActionResult.newResult(EnumActionResult.SUCCESS, relicStacks[relic].copy()); } - return stack; + return ActionResult.newResult(EnumActionResult.FAIL, stack); } @Override @@ -86,7 +89,7 @@ public class ItemDice extends ItemRelic { return false; } - boolean hasRelicAlready(EntityPlayer player, int relic) { + private boolean hasRelicAlready(EntityPlayer player, int relic) { if(relic < 0 || relic > 5 || !(player instanceof EntityPlayerMP)) return true; @@ -94,7 +97,7 @@ public class ItemDice extends ItemRelic { Item item = relicStacks[relic].getItem(); IRelic irelic = (IRelic) item; Achievement achievement = irelic.getBindAchievement(); - return mpPlayer.func_147099_x().hasAchievementUnlocked(achievement); + return mpPlayer.getStatFile().hasAchievementUnlocked(achievement); } } diff --git a/src/main/java/vazkii/botania/common/item/relic/ItemExcaliber.java b/src/main/java/vazkii/botania/common/item/relic/ItemExcaliber.java deleted file mode 100644 index 471f677e7..000000000 --- a/src/main/java/vazkii/botania/common/item/relic/ItemExcaliber.java +++ /dev/null @@ -1,223 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Mar 29, 2015, 10:12:50 PM (GMT)] - */ -/*package vazkii.botania.common.item.relic; - -import java.util.List; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.attributes.AttributeModifier; -import net.minecraft.entity.boss.IBossDisplayData; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityThrowable; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.server.MinecraftServer; -import net.minecraft.stats.Achievement; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; -import net.minecraftforge.common.util.EnumHelper; -import vazkii.botania.api.BotaniaAPI; -import vazkii.botania.api.internal.IManaBurst; -import vazkii.botania.api.item.IRelic; -import vazkii.botania.api.mana.BurstProperties; -import vazkii.botania.api.mana.ILensEffect; -import vazkii.botania.common.core.helper.ItemNBTHelper; -import vazkii.botania.common.core.helper.Vector3; -import vazkii.botania.common.entity.EntityManaBurst; -import vazkii.botania.common.item.equipment.tool.manasteel.ItemManasteelSword; -import vazkii.botania.common.lib.LibItemNames; - -import com.google.common.collect.HashMultimap; -import com.google.common.collect.Multimap; - -public class ItemExcaliber extends ItemManasteelSword implements IRelic, ILensEffect { - - private static final String TAG_ATTACKER_USERNAME = "attackerUsername"; - private static final String TAG_HOME_ID = "homeID"; - - public static ToolMaterial toolMaterial = EnumHelper.addToolMaterial("B_EXCALIBER", 3, -1, 6.2F, 6F, 40); - - Achievement achievement; - - public ItemExcaliber() { - super(toolMaterial, LibItemNames.EXCALIBER); - } - - @Override - public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) { - if(par3Entity instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer) par3Entity; - ItemRelic.updateRelic(par1ItemStack, player); - if(ItemRelic.isRightPlayer(player, par1ItemStack)) { - PotionEffect haste = player.getActivePotionEffect(Potion.digSpeed); - float check = haste == null ? 0.16666667F : haste.getAmplifier() == 1 ? 0.5F : 0.4F; - - if(player.getCurrentEquippedItem() == par1ItemStack && player.swingProgress == check && !par2World.isRemote) { - EntityManaBurst burst = getBurst(player, par1ItemStack); - par2World.spawnEntityInWorld(burst); - par2World.playSoundAtEntity(player, "botania:terraBlade", 0.4F, 1.4F); - } - } - } - } - - @Override - public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) { - ItemRelic.addBindInfo(p_77624_3_, p_77624_1_, p_77624_2_); - } - - @Override - public void bindToUsername(String playerName, ItemStack stack) { - ItemRelic.bindToUsernameS(playerName, stack); - } - - @Override - public String getSoulbindUsername(ItemStack stack) { - return ItemRelic.getSoulbindUsernameS(stack); - } - - @Override - public Achievement getBindAchievement() { - return achievement; - } - - @Override - public void setBindAchievement(Achievement achievement) { - this.achievement = achievement; - } - - @Override - public boolean usesMana(ItemStack stack) { - return false; - } - - @Override - public boolean isItemTool(ItemStack p_77616_1_) { - return true; - } - - @Override - public int getEntityLifespan(ItemStack itemStack, World world) { - return Integer.MAX_VALUE; - } - - @Override - public Multimap getItemAttributeModifiers() { - Multimap multimap = HashMultimap.create(); - multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Weapon modifier", 10, 0)); - multimap.put(SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Weapon modifier", 0.3, 1)); - return multimap; - } - - public EntityManaBurst getBurst(EntityPlayer player, ItemStack stack) { - EntityManaBurst burst = new EntityManaBurst(player); - - float motionModifier = 7F; - - burst.setColor(0xFFFF20); - burst.setMana(1); - burst.setStartingMana(1); - burst.setMinManaLoss(200); - burst.setManaLossPerTick(1F); - burst.setGravity(0F); - burst.setMotion(burst.motionX * motionModifier, burst.motionY * motionModifier, burst.motionZ * motionModifier); - - ItemStack lens = stack.copy(); - ItemNBTHelper.setString(lens, TAG_ATTACKER_USERNAME, player.getCommandSenderName()); - burst.setSourceLens(lens); - return burst; - } - - @Override - public void apply(ItemStack stack, BurstProperties props) { - // NO-OP - } - - @Override - public boolean collideBurst(IManaBurst burst, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) { - return dead; - } - - @Override - public void updateBurst(IManaBurst burst, ItemStack stack) { - EntityThrowable entity = (EntityThrowable) burst; - AxisAlignedBB axis = AxisAlignedBB.getBoundingBox(entity.posX, entity.posY, entity.posZ, entity.lastTickPosX, entity.lastTickPosY, entity.lastTickPosZ).expand(1, 1, 1); - - String attacker = ItemNBTHelper.getString(burst.getSourceLens(), TAG_ATTACKER_USERNAME, ""); - int homeID = ItemNBTHelper.getInt(stack, TAG_HOME_ID, -1); - if(homeID == -1) { - AxisAlignedBB axis1 = AxisAlignedBB.getBoundingBox(entity.posX, entity.posY, entity.posZ, entity.lastTickPosX, entity.lastTickPosY, entity.lastTickPosZ).expand(5, 5, 5); - List entities = entity.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axis1); - for(EntityLivingBase living : entities) { - if(living instanceof EntityPlayer || living instanceof IBossDisplayData || !(living instanceof IMob) || living.hurtTime != 0) - continue; - - homeID = living.getEntityId(); - ItemNBTHelper.setInt(stack, TAG_HOME_ID, homeID); - break; - } - } - - List entities = entity.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axis); - - if(homeID != -1) { - Entity home = entity.worldObj.getEntityByID(homeID); - if(home != null) { - Vector3 vecEntity = Vector3.fromEntityCenter(home); - Vector3 vecThis = Vector3.fromEntityCenter(entity); - Vector3 vecMotion = vecEntity.sub(vecThis); - Vector3 vecCurrentMotion = new Vector3(entity.motionX, entity.motionY, entity.motionZ); - - vecMotion.normalize().multiply(vecCurrentMotion.mag()); - burst.setMotion(vecMotion.x, vecMotion.y, vecMotion.z); - } - } - - for(EntityLivingBase living : entities) { - if(living instanceof EntityPlayer && (((EntityPlayer) living).getCommandSenderName().equals(attacker) || MinecraftServer.getServer() != null && !MinecraftServer.getServer().isPVPEnabled())) - continue; - - if(living.hurtTime == 0) { - int cost = 1; - int mana = burst.getMana(); - if(mana >= cost) { - burst.setMana(mana - cost); - float damage = 4F + toolMaterial.getDamageVsEntity(); - if(!burst.isFake() && !entity.worldObj.isRemote) { - EntityPlayer player = living.worldObj.getPlayerEntityByName(attacker); - living.attackEntityFrom(player == null ? DamageSource.magic : DamageSource.causePlayerDamage(player), damage); - entity.setDead(); - break; - } - } - } - } - } - - @Override - public boolean doParticles(IManaBurst burst, ItemStack stack) { - return true; - } - - @Override - public EnumRarity getRarity(ItemStack p_77613_1_) { - return BotaniaAPI.rarityRelic; - } - -} - */ \ No newline at end of file diff --git a/src/main/java/vazkii/botania/common/item/relic/ItemFlugelEye.java b/src/main/java/vazkii/botania/common/item/relic/ItemFlugelEye.java index d6f9e20f6..2f76ae11b 100644 --- a/src/main/java/vazkii/botania/common/item/relic/ItemFlugelEye.java +++ b/src/main/java/vazkii/botania/common/item/relic/ItemFlugelEye.java @@ -11,11 +11,18 @@ package vazkii.botania.common.item.relic; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.SoundEvents; import net.minecraft.item.EnumAction; import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import vazkii.botania.api.mana.IManaUsingItem; import vazkii.botania.api.mana.ManaItemHandler; @@ -25,6 +32,8 @@ import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.core.helper.MathHelper; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; + public class ItemFlugelEye extends ItemRelic implements ICoordBoundItem, IManaUsingItem { public ItemFlugelEye() { @@ -36,45 +45,51 @@ public class ItemFlugelEye extends ItemRelic implements ICoordBoundItem, IManaUs private static final String TAG_Z = "z"; private static final String TAG_DIMENSION = "dim"; + @Nonnull @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) { if(player.isSneaking()) { if(world.isRemote) { - player.swingItem(); + player.swingArm(hand); for(int i = 0; i < 10; i++) { - float x1 = (float) (x + Math.random()); - float y1 = y + 1; - float z1 = (float) (z + Math.random()); - Botania.proxy.wispFX(player.worldObj, x1, y1, z1, (float) Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random() * 0.5F, -0.05F + (float) Math.random() * 0.05F); + float x1 = (float) (pos.getX() + Math.random()); + float y1 = pos.getY() + 1; + float z1 = (float) (pos.getZ() + Math.random()); + Botania.proxy.wispFX(x1, y1, z1, (float) Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random() * 0.5F, -0.05F + (float) Math.random() * 0.05F); } } else { - ItemNBTHelper.setInt(stack, TAG_X, x); - ItemNBTHelper.setInt(stack, TAG_Y, y); - ItemNBTHelper.setInt(stack, TAG_Z, z); - ItemNBTHelper.setInt(stack, TAG_DIMENSION, world.provider.dimensionId); - world.playSoundAtEntity(player, "mob.endermen.portal", 1F, 5F); + ItemNBTHelper.setInt(stack, TAG_X, pos.getX()); + ItemNBTHelper.setInt(stack, TAG_Y, pos.getY()); + ItemNBTHelper.setInt(stack, TAG_Z, pos.getZ()); + ItemNBTHelper.setInt(stack, TAG_DIMENSION, world.provider.getDimension()); + world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ENDERMEN_TELEPORT, SoundCategory.PLAYERS, 1F, 5F); } } - return true; + return EnumActionResult.SUCCESS; } @Override - public void onUsingTick(ItemStack stack, EntityPlayer player, int count) { - float x = (float) (player.posX - Math.random() * player.width); - float y = (float) (player.posY - 1.6 + Math.random()); - float z = (float) (player.posZ - Math.random() * player.width); - Botania.proxy.wispFX(player.worldObj, x, y, z, (float) Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random() * 0.7F, -0.05F - (float) Math.random() * 0.05F); + public void onUsingTick(ItemStack stack, EntityLivingBase living, int count) { + float x = (float) (living.posX - Math.random() * living.width); + float y = (float) (living.posY - 1.6 + Math.random()); + float z = (float) (living.posZ - Math.random() * living.width); + Botania.proxy.wispFX(x, y, z, (float) Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random() * 0.7F, -0.05F - (float) Math.random() * 0.05F); + } + + @Nonnull + @Override + public ActionResult onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) { + player.setActiveHand(hand); + return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack); } @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - par3EntityPlayer.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack)); - return par1ItemStack; - } + public ItemStack onItemUseFinish(@Nonnull ItemStack stack, World world, EntityLivingBase living) { + if(!(living instanceof EntityPlayer)) + return stack; - @Override - public ItemStack onEaten(ItemStack stack, World world, EntityPlayer player) { + EntityPlayer player = ((EntityPlayer) living); int x = ItemNBTHelper.getInt(stack, TAG_X, 0); int y = ItemNBTHelper.getInt(stack, TAG_Y, -1); int z = ItemNBTHelper.getInt(stack, TAG_Z, 0); @@ -82,10 +97,10 @@ public class ItemFlugelEye extends ItemRelic implements ICoordBoundItem, IManaUs int cost = (int) (MathHelper.pointDistanceSpace(x + 0.5, y + 0.5, z + 0.5, player.posX, player.posY, player.posZ) * 10); - if(y > -1 && dim == world.provider.dimensionId && ManaItemHandler.requestManaExact(stack, player, cost, true)) { + if(y > -1 && dim == world.provider.getDimension() && ManaItemHandler.requestManaExact(stack, player, cost, true)) { moveParticlesAndSound(player); if(player instanceof EntityPlayerMP && !world.isRemote) - ((EntityPlayerMP) player).playerNetServerHandler.setPlayerLocation(x + 0.5, y + 1.6, z + 0.5, player.rotationYaw, player.rotationPitch); + ((EntityPlayerMP) player).connection.setPlayerLocation(x + 0.5, y + 1.6, z + 0.5, player.rotationYaw, player.rotationPitch); moveParticlesAndSound(player); } @@ -97,10 +112,10 @@ public class ItemFlugelEye extends ItemRelic implements ICoordBoundItem, IManaUs float x = (float) (entity.posX + Math.random()); float y = (float) (entity.posY - 1.6 + Math.random()); float z = (float) (entity.posZ + Math.random()); - Botania.proxy.wispFX(entity.worldObj, x, y, z, (float) Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), -0.3F + (float) Math.random() * 0.2F); + Botania.proxy.wispFX(x, y, z, (float) Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), -0.3F + (float) Math.random() * 0.2F); } if(!entity.worldObj.isRemote) - entity.worldObj.playSoundAtEntity(entity, "mob.endermen.portal", 1F, 1F); + entity.worldObj.playSound(null, entity.posX, entity.posY, entity.posZ, SoundEvents.ENTITY_ENDERMEN_TELEPORT, SoundCategory.PLAYERS, 1F, 1F); } @Override @@ -108,17 +123,18 @@ public class ItemFlugelEye extends ItemRelic implements ICoordBoundItem, IManaUs return 40; } + @Nonnull @Override public EnumAction getItemUseAction(ItemStack par1ItemStack) { - return EnumAction.block; + return EnumAction.BLOCK; } @Override - public ChunkCoordinates getBinding(ItemStack stack) { + public BlockPos getBinding(ItemStack stack) { int x = ItemNBTHelper.getInt(stack, TAG_X, 0); int y = ItemNBTHelper.getInt(stack, TAG_Y, -1); int z = ItemNBTHelper.getInt(stack, TAG_Z, 0); - return y == -1 ? null : new ChunkCoordinates(x, y, z); + return y == -1 ? null : new BlockPos(x, y, z); } @Override @@ -126,314 +142,4 @@ public class ItemFlugelEye extends ItemRelic implements ICoordBoundItem, IManaUs return true; } - /* - // Code from the older iteration of this item: - - private static final ResourceLocation glowTexture = new ResourceLocation(LibResources.MISC_GLOW_CYAN); - - private static final int SEGMENTS = 12; - private static final MultiversePosition FALLBACK_POSITION = new MultiversePosition(0, -1, 0, 0); - - private static final String TAG_EQUIPPED = "equipped"; - private static final String TAG_ROTATION_BASE = "rotationBase"; - private static final String TAG_WARP_PREFIX = "warp"; - private static final String TAG_POS_X = "posX"; - private static final String TAG_POS_Y = "posY"; - private static final String TAG_POS_Z = "posZ"; - private static final String TAG_DIMENSION = "dim"; - private static final String TAG_FIRST_TICK = "firstTick"; - - IIcon[] signs; - - public ItemFlugelEye() { - super(LibItemNames.FLUGEL_EYE); - MinecraftForge.EVENT_BUS.register(this); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) { - super.registerIcons(par1IconRegister); - signs = new IIcon[12]; - for(int i = 0; i < 12; i++) - signs[i] = IconHelper.forName(par1IconRegister, "sign" + i); - } - - @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { - if(isRightPlayer(player, stack)) { - int segment = getSegmentLookedAt(stack, player); - MultiversePosition pos = getWarpPoint(stack, segment); - if(pos.isValid()) { - if(pos.dim == world.provider.dimensionId && player instanceof EntityPlayerMP) { - ((EntityPlayerMP) player).playerNetServerHandler.setPlayerLocation(pos.x, pos.y, pos.z, player.rotationYaw, player.rotationPitch); - world.playSoundAtEntity(player, "mob.endermen.portal", 1F, 1F); - } - } else setWarpPoint(stack, segment, player.posX, player.posY, player.posZ, world.provider.dimensionId); - } - - return stack; - } - - @Override - public boolean onEntitySwing(EntityLivingBase player, ItemStack stack) { - if(player.isSneaking() && player instanceof EntityPlayer && isRightPlayer((EntityPlayer) player, stack)) { - int segment = getSegmentLookedAt(stack, player); - MultiversePosition pos = getWarpPoint(stack, segment); - if(pos.isValid()) { - setWarpPoint(stack, segment, 0, -1, 0, 0); - return true; - } - } - - return false; - } - - @Override - public void onUpdate(ItemStack stack, World world, Entity entity, int pos, boolean equipped) { - super.onUpdate(stack, world, entity, pos, equipped); - boolean eqLastTick = wasEquipped(stack); - boolean firstTick = isFirstTick(stack); - if(eqLastTick != equipped) - setEquipped(stack, equipped); - - if((!equipped || firstTick) && entity instanceof EntityLivingBase) { - int angles = 360; - int segAngles = angles / SEGMENTS; - float shift = segAngles / 2; - setRotationBase(stack, getCheckingAngle((EntityLivingBase) entity) - shift); - if(firstTick) - tickFirst(stack); - } - } - - private static int getSegmentLookedAt(ItemStack stack, EntityLivingBase player) { - float yaw = getCheckingAngle(player, getRotationBase(stack)); - - int angles = 360; - int segAngles = angles / SEGMENTS; - for(int seg = 0; seg < SEGMENTS; seg++) { - float calcAngle = (float) seg * segAngles; - if(yaw >= calcAngle && yaw < calcAngle + segAngles) - return seg; - } - return 0; - } - - private static float getCheckingAngle(EntityLivingBase player) { - return getCheckingAngle(player, 0F); - } - - // Screw the way minecraft handles rotation - // Really... - private static float getCheckingAngle(EntityLivingBase player, float base) { - float yaw = MathHelper.wrapAngleTo180_float(player.rotationYaw) + 90F; - int angles = 360; - int segAngles = angles / SEGMENTS; - float shift = segAngles / 2; - - if(yaw < 0) - yaw = 180F + (180F + yaw); - yaw -= 360F - base; - float angle = 360F - yaw + shift; - - if(angle < 0) - angle = 360F + angle; - - return angle; - } - - public static boolean isFirstTick(ItemStack stack) { - return ItemNBTHelper.getBoolean(stack, TAG_FIRST_TICK, true); - } - - public static void tickFirst(ItemStack stack) { - ItemNBTHelper.setBoolean(stack, TAG_FIRST_TICK, false); - } - - public static boolean wasEquipped(ItemStack stack) { - return ItemNBTHelper.getBoolean(stack, TAG_EQUIPPED, false); - } - - public static void setEquipped(ItemStack stack, boolean equipped) { - ItemNBTHelper.setBoolean(stack, TAG_EQUIPPED, equipped); - } - - public static float getRotationBase(ItemStack stack) { - return ItemNBTHelper.getFloat(stack, TAG_ROTATION_BASE, 0F); - } - - public static void setRotationBase(ItemStack stack, float rotation) { - ItemNBTHelper.setFloat(stack, TAG_ROTATION_BASE, rotation); - } - - public static void setWarpPoint(ItemStack stack, int warp, double x, double y, double z, int dim) { - NBTTagCompound cmp = new NBTTagCompound(); - cmp.setDouble(TAG_POS_X, x); - cmp.setDouble(TAG_POS_Y, y); - cmp.setDouble(TAG_POS_Z, z); - cmp.setInteger(TAG_DIMENSION, dim); - ItemNBTHelper.setCompound(stack, TAG_WARP_PREFIX + warp, cmp); - } - - public static MultiversePosition getWarpPoint(ItemStack stack, int warp) { - NBTTagCompound cmp = ItemNBTHelper.getCompound(stack, TAG_WARP_PREFIX + warp, true); - if(cmp == null) - return FALLBACK_POSITION; - - double x = cmp.getDouble(TAG_POS_X); - double y = cmp.getDouble(TAG_POS_Y); - double z = cmp.getDouble(TAG_POS_Z); - int dim = cmp.getInteger(TAG_DIMENSION); - return new MultiversePosition(x, y, z, dim); - } - - @SideOnly(Side.CLIENT) - @SubscribeEvent - public void onRenderWorldLast(RenderWorldLastEvent event) { - EntityPlayer player = Minecraft.getMinecraft().thePlayer; - ItemStack stack = player.getCurrentEquippedItem(); - if(stack != null && stack.getItem() == this) - render(stack, player, event.partialTicks); - } - - @SideOnly(Side.CLIENT) - public void render(ItemStack stack, EntityPlayer player, float partialTicks) { - Minecraft mc = Minecraft.getMinecraft(); - Tessellator tess = Tessellator.instance; - Tessellator.renderingWorldRenderer = false; - - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - float alpha = ((float) Math.sin((ClientTickHandler.ticksInGame + partialTicks) * 0.2F) * 0.5F + 0.5F) * 0.4F + 0.3F; - - double posX = player.prevPosX + (player.posX - player.prevPosX) * partialTicks; - double posY = player.prevPosY + (player.posY - player.prevPosY) * partialTicks; - double posZ = player.prevPosZ + (player.posZ - player.prevPosZ) * partialTicks; - - GL11.glTranslated(posX - RenderManager.renderPosX, posY - RenderManager.renderPosY, posZ - RenderManager.renderPosZ); - - float base = getRotationBase(stack); - int angles = 360; - int segAngles = angles / SEGMENTS; - float shift = base - segAngles / 2; - - float u = 1F; - float v = 0.25F; - - float s = 3F; - float m = 0.8F; - float y = v * s * 2; - float y0 = 0; - - int segmentLookedAt = getSegmentLookedAt(stack, player); - - for(int seg = 0; seg < SEGMENTS; seg++) { - boolean inside = false; - float rotationAngle = (seg + 0.5F) * segAngles + shift; - if(segmentLookedAt == seg) - inside = true; - - GL11.glPushMatrix(); - GL11.glRotatef(rotationAngle, 0F, 1F, 0F); - GL11.glTranslatef(s * m, -0.75F, 0F); - - mc.renderEngine.bindTexture(TextureMap.locationItemsTexture); - GL11.glScalef(0.75F, 0.75F, 0.75F); - GL11.glTranslatef(0F, 0F, 0.5F); - IIcon icon = signs[seg]; - GL11.glRotatef(90F, 0F, 1F, 0F); - GL11.glColor4f(1F, 1F, 1F, getWarpPoint(stack, seg).isValid() ? 1F : 0.2F); - float f = icon.getMinU(); - float f1 = icon.getMaxU(); - float f2 = icon.getMinV(); - float f3 = icon.getMaxV(); - ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F); - - GL11.glColor3f(1F, 1F, 1F); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glRotatef(180F, 1F, 0F, 0F); - float a = alpha; - if(inside) { - a += 0.3F; - y0 = -y; - } - - if(seg % 2 == 0) - GL11.glColor4f(0.6F, 0.6F, 0.6F, a); - else GL11.glColor4f(1F, 1F, 1F, a); - - mc.renderEngine.bindTexture(glowTexture); - tess.startDrawingQuads(); - for(int i = 0; i < segAngles; i++) { - float ang = i + seg * segAngles + shift; - double xp = Math.cos(ang * Math.PI / 180F) * s; - double zp = Math.sin(ang * Math.PI / 180F) * s; - - tess.addVertexWithUV(xp * m, y, zp * m, u, v); - tess.addVertexWithUV(xp, y0, zp, u, 0); - - xp = Math.cos((ang + 1) * Math.PI / 180F) * s; - zp = Math.sin((ang + 1) * Math.PI / 180F) * s; - - tess.addVertexWithUV(xp, y0, zp, 0, 0); - tess.addVertexWithUV(xp * m, y, zp * m, 0, v); - } - y0 = 0; - tess.draw(); - - GL11.glPopMatrix(); - } - GL11.glPopMatrix(); - } - - @SideOnly(Side.CLIENT) - public static void renderHUD(ScaledResolution resolution, EntityPlayer player, ItemStack stack) { - Minecraft.getMinecraft(); - int slot = getSegmentLookedAt(stack, player); - MultiversePosition pos = getWarpPoint(stack, slot); - - FontRenderer font = Minecraft.getMinecraft().fontRenderer; - String s = StatCollector.translateToLocal("botania.sign" + slot); - font.drawStringWithShadow(s, resolution.getScaledWidth() / 2 - font.getStringWidth(s) / 2, resolution.getScaledHeight() / 2 - 55, 0xFFD409); - - if(pos.isValid()) { - int dist = (int) vazkii.botania.common.core.helper.MathHelper.pointDistanceSpace(pos.x, pos.y, pos.z, player.posX, player.posY - 1.6, player.posZ); - - s = dist == 1 ? StatCollector.translateToLocal("botaniamisc.blockAway") : String.format(StatCollector.translateToLocal("botaniamisc.blocksAway"), dist); - font.drawStringWithShadow(s, resolution.getScaledWidth() / 2 - font.getStringWidth(s) / 2, resolution.getScaledHeight() / 2 - 40, 0x9999FF); - s = StatCollector.translateToLocal("botaniamisc.clickToTeleport"); - font.drawStringWithShadow(s, resolution.getScaledWidth() / 2 - font.getStringWidth(s) / 2, resolution.getScaledHeight() / 2 - 30, 0xFFFFFF); - s = StatCollector.translateToLocal("botaniamisc.clickToRemoveWarp"); - font.drawStringWithShadow(s, resolution.getScaledWidth() / 2 - font.getStringWidth(s) / 2, resolution.getScaledHeight() / 2 - 20, 0xFFFFFF); - } else { - s = StatCollector.translateToLocal("botaniamisc.unboundWarp"); - font.drawStringWithShadow(s, resolution.getScaledWidth() / 2 - font.getStringWidth(s) / 2, resolution.getScaledHeight() / 2 - 40, 0xFFFFFF); - s = StatCollector.translateToLocal("botaniamisc.clickToAddWarp"); - font.drawStringWithShadow(s, resolution.getScaledWidth() / 2 - font.getStringWidth(s) / 2, resolution.getScaledHeight() / 2 - 30, 0xFFFFFF); - } - } - - private static class MultiversePosition { - - public final double x, y, z; - public final int dim; - - public MultiversePosition(double x, double y, double z, int dim) { - this.x = x; - this.y = y; - this.z = z; - this.dim = dim; - } - - boolean isValid() { - return y > 0; - } - - } - */ - } diff --git a/src/main/java/vazkii/botania/common/item/relic/ItemInfiniteFruit.java b/src/main/java/vazkii/botania/common/item/relic/ItemInfiniteFruit.java index 1e24a9fc5..2479fefe8 100644 --- a/src/main/java/vazkii/botania/common/item/relic/ItemInfiniteFruit.java +++ b/src/main/java/vazkii/botania/common/item/relic/ItemInfiniteFruit.java @@ -10,75 +10,73 @@ */ package vazkii.botania.common.item.relic; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumAction; +import net.minecraft.item.IItemPropertyGetter; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.ReflectionHelper; import vazkii.botania.api.mana.IManaUsingItem; import vazkii.botania.api.mana.ManaItemHandler; -import vazkii.botania.client.core.helper.IconHelper; import vazkii.botania.common.lib.LibItemNames; +import vazkii.botania.common.lib.LibMisc; import vazkii.botania.common.lib.LibObfuscation; -import cpw.mods.fml.relauncher.ReflectionHelper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.util.Locale; public class ItemInfiniteFruit extends ItemRelic implements IManaUsingItem { - public static IIcon dasBootIcon; - public ItemInfiniteFruit() { super(LibItemNames.INFINITE_FRUIT); + addPropertyOverride(new ResourceLocation(LibMisc.MOD_ID, "boot"), (stack, worldIn, entityIn) -> ItemInfiniteFruit.isBoot(stack) ? 1F : 0F); } @Override - public int getMaxItemUseDuration(ItemStack p_77626_1_) { + public int getMaxItemUseDuration(ItemStack stack) { return 32; } + @Nonnull @Override - public EnumAction getItemUseAction(ItemStack p_77661_1_) { - return isBoot(p_77661_1_) ? EnumAction.drink : EnumAction.eat; + public EnumAction getItemUseAction(ItemStack stack) { + return isBoot(stack) ? EnumAction.DRINK : EnumAction.EAT; + } + + @Nonnull + @Override + public ActionResult onItemRightClick(@Nonnull ItemStack stack, World world, EntityPlayer player, EnumHand hand) { + if(player.canEat(false) && isRightPlayer(player, stack)) { + player.setActiveHand(hand); + return ActionResult.newResult(EnumActionResult.SUCCESS, stack); + } + return ActionResult.newResult(EnumActionResult.PASS, stack); } @Override - public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { - if(p_77659_3_.canEat(false) && isRightPlayer(p_77659_3_, p_77659_1_)) - p_77659_3_.setItemInUse(p_77659_1_, getMaxItemUseDuration(p_77659_1_)); - return p_77659_1_; - } - - @Override - public void onUsingTick(ItemStack stack, EntityPlayer player, int count) { - super.onUsingTick(stack, player, count); - + public void onUsingTick(ItemStack stack, EntityLivingBase living, int count) { + super.onUsingTick(stack, living, count); + if(!(living instanceof EntityPlayer)) + return; + EntityPlayer player = ((EntityPlayer) living); if(ManaItemHandler.requestManaExact(stack, player, 500, true)) { if(count % 5 == 0) player.getFoodStats().addStats(1, 1F); if(count == 5) if(player.canEat(false)) - ReflectionHelper.setPrivateValue(EntityPlayer.class, player, 20, LibObfuscation.ITEM_IN_USE_COUNT); + ReflectionHelper.setPrivateValue(EntityLivingBase.class, player, 20, LibObfuscation.ITEM_IN_USE_COUNT); } } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) { - itemIcon = IconHelper.forItem(par1IconRegister, this); - dasBootIcon = IconHelper.forName(par1IconRegister, "dasBoot"); - } - - @Override - public IIcon getIconIndex(ItemStack par1ItemStack) { - return isBoot(par1ItemStack) ? dasBootIcon : super.getIconIndex(par1ItemStack); - } - - private boolean isBoot(ItemStack par1ItemStack) { - String name = par1ItemStack.getDisplayName().toLowerCase().trim(); + private static boolean isBoot(ItemStack par1ItemStack) { + String name = par1ItemStack.getDisplayName().toLowerCase(Locale.ROOT).trim(); return name.equals("das boot"); } diff --git a/src/main/java/vazkii/botania/common/item/relic/ItemKingKey.java b/src/main/java/vazkii/botania/common/item/relic/ItemKingKey.java index 2dc32c505..e84dcb1c8 100644 --- a/src/main/java/vazkii/botania/common/item/relic/ItemKingKey.java +++ b/src/main/java/vazkii/botania/common/item/relic/ItemKingKey.java @@ -10,53 +10,47 @@ */ package vazkii.botania.common.item.relic; -import java.util.Random; - -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumAction; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; import vazkii.botania.api.mana.IManaUsingItem; import vazkii.botania.api.mana.ManaItemHandler; -import vazkii.botania.client.core.helper.IconHelper; +import vazkii.botania.api.sound.BotaniaSoundEvents; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.core.helper.Vector3; import vazkii.botania.common.entity.EntityBabylonWeapon; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; +import java.util.Random; + public class ItemKingKey extends ItemRelic implements IManaUsingItem { private static final String TAG_WEAPONS_SPAWNED = "weaponsSpawned"; private static final String TAG_CHARGING = "charging"; - private static final int WEAPON_TYPES = 12; - public static IIcon[] weaponIcons; + public static final int WEAPON_TYPES = 12; public ItemKingKey() { super(LibItemNames.KING_KEY); } + @Nonnull @Override - public void registerIcons(IIconRegister par1IconRegister) { - super.registerIcons(par1IconRegister); - - weaponIcons = new IIcon[WEAPON_TYPES]; - for(int i = 0; i < WEAPON_TYPES; i++) - weaponIcons[i] = IconHelper.forName(par1IconRegister, "gateWeapon" + i); - } - - @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - par3EntityPlayer.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack)); + public ActionResult onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) { + player.setActiveHand(hand); setCharging(par1ItemStack, true); - return par1ItemStack; + return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack); } @Override - public void onPlayerStoppedUsing(ItemStack stack, World world, EntityPlayer player, int time) { + public void onPlayerStoppedUsing(ItemStack stack, World world, EntityLivingBase living, int time) { int spawned = getWeaponsSpawned(stack); if(spawned == 20) { setCharging(stack, false); @@ -65,48 +59,47 @@ public class ItemKingKey extends ItemRelic implements IManaUsingItem { } @Override - public void onUsingTick(ItemStack stack, EntityPlayer player, int count) { + public void onUsingTick(ItemStack stack, EntityLivingBase living, int count) { int spawned = getWeaponsSpawned(stack); - if(count != getMaxItemUseDuration(stack) && spawned < 20 && !player.worldObj.isRemote && ManaItemHandler.requestManaExact(stack, player, 150, true)) { - Vector3 look = new Vector3(player.getLookVec()); - look.y = 0; - look.normalize().negate().multiply(2); + if(count != getMaxItemUseDuration(stack) && spawned < 20 && !living.worldObj.isRemote && (!(living instanceof EntityPlayer) || ManaItemHandler.requestManaExact(stack, ((EntityPlayer) living), 150, true))) { + Vector3 look = new Vector3(living.getLookVec()).multiply(1, 0, 1).normalize().negate().multiply(2); int div = spawned / 5; int mod = spawned % 5; - Vector3 pl = look.copy().add(Vector3.fromEntityCenter(player)).add(0, 1.6, div * 0.1); + Vector3 pl = look.add(Vector3.fromEntityCenter(living)).add(0, living.getEyeHeight(), div * 0.1); - Random rand = player.worldObj.rand; - Vector3 axis = look.copy().normalize().crossProduct(new Vector3(-1, 0, -1)).normalize(); - Vector3 axis1 = axis.copy(); + Random rand = living.worldObj.rand; + Vector3 axis = look.normalize().crossProduct(new Vector3(-1, 0, -1)).normalize(); + Vector3 axis1 = axis; double rot = mod * Math.PI / 4 - Math.PI / 2; - axis1.multiply(div * 3.5 + 5).rotate(rot, look); + axis1 = axis1.multiply(div * 3.5 + 5).rotate(rot, look); if(axis1.y < 0) - axis1.y = -axis1.y; + axis1 = axis1.multiply(0, -1, 0); - Vector3 end = pl.copy().add(axis1); + Vector3 end = pl.add(axis1); - EntityBabylonWeapon weapon = new EntityBabylonWeapon(player.worldObj, player); + EntityBabylonWeapon weapon = new EntityBabylonWeapon(living.worldObj, living); weapon.posX = end.x; weapon.posY = end.y; weapon.posZ = end.z; - weapon.rotationYaw = player.rotationYaw; + weapon.rotationYaw = living.rotationYaw; weapon.setVariety(rand.nextInt(WEAPON_TYPES)); weapon.setDelay(spawned); - weapon.setRotation(MathHelper.wrapAngleTo180_float(-player.rotationYaw + 180)); + weapon.setRotation(MathHelper.wrapDegrees(-living.rotationYaw + 180)); - player.worldObj.spawnEntityInWorld(weapon); - player.worldObj.playSoundAtEntity(weapon, "botania:babylonSpawn", 1F, 1F + player.worldObj.rand.nextFloat() * 3F); + living.worldObj.spawnEntityInWorld(weapon); + weapon.playSound(BotaniaSoundEvents.babylonSpawn, 1F, 1F + living.worldObj.rand.nextFloat() * 3F); setWeaponsSpawned(stack, spawned + 1); } } + @Nonnull @Override public EnumAction getItemUseAction(ItemStack par1ItemStack) { - return EnumAction.bow; + return EnumAction.BOW; } @Override @@ -131,11 +124,6 @@ public class ItemKingKey extends ItemRelic implements IManaUsingItem { ItemNBTHelper.setInt(stack, TAG_WEAPONS_SPAWNED, count); } - @Override - public boolean isFull3D() { - return true; - } - @Override public boolean usesMana(ItemStack stack) { return true; diff --git a/src/main/java/vazkii/botania/common/item/relic/ItemLokiRing.java b/src/main/java/vazkii/botania/common/item/relic/ItemLokiRing.java index 5f77e5635..c0a4d38c0 100644 --- a/src/main/java/vazkii/botania/common/item/relic/ItemLokiRing.java +++ b/src/main/java/vazkii/botania/common/item/relic/ItemLokiRing.java @@ -10,44 +10,45 @@ */ package vazkii.botania.common.item.relic; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.block.Block; +import baubles.api.BaubleType; +import baubles.common.container.InventoryBaubles; +import baubles.common.lib.PlayerHandler; +import baubles.common.network.PacketHandler; +import baubles.common.network.PacketSyncBauble; +import com.google.common.collect.ImmutableList; import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; -import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Enchantments; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.PlayerInteractEvent; -import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action; -import vazkii.botania.api.item.IExtendedWireframeCoordinateListProvider; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.item.ISequentialBreaker; +import vazkii.botania.api.item.IWireframeCoordinateListProvider; import vazkii.botania.api.mana.IManaUsingItem; import vazkii.botania.api.mana.ManaItemHandler; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.item.equipment.tool.ToolCommons; import vazkii.botania.common.lib.LibItemNames; -import baubles.api.BaubleType; -import baubles.common.container.InventoryBaubles; -import baubles.common.lib.PlayerHandler; -import baubles.common.network.PacketHandler; -import baubles.common.network.PacketSyncBauble; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -public class ItemLokiRing extends ItemRelicBauble implements IExtendedWireframeCoordinateListProvider, IManaUsingItem { +import java.util.ArrayList; +import java.util.List; + +public class ItemLokiRing extends ItemRelicBauble implements IWireframeCoordinateListProvider, IManaUsingItem { private static final String TAG_CURSOR_LIST = "cursorList"; private static final String TAG_CURSOR_PREFIX = "cursor"; @@ -61,12 +62,12 @@ public class ItemLokiRing extends ItemRelicBauble implements IExtendedWireframeC public ItemLokiRing() { super(LibItemNames.LOKI_RING); - MinecraftForge.EVENT_BUS.register(this); + MinecraftForge.EVENT_BUS.register(ItemLokiRing.class); } @SubscribeEvent - public void onPlayerInteract(PlayerInteractEvent event) { - EntityPlayer player = event.entityPlayer; + public static void onPlayerInteract(PlayerInteractEvent.RightClickBlock event) { + EntityPlayer player = event.getEntityPlayer(); ItemStack lokiRing = getLokiRing(player); if(lokiRing == null || player.worldObj.isRemote) return; @@ -81,33 +82,31 @@ public class ItemLokiRing extends ItemRelicBauble implements IExtendedWireframeC } } - ItemStack heldItemStack = player.getCurrentEquippedItem(); - ChunkCoordinates originCoords = getOriginPos(lokiRing); - MovingObjectPosition lookPos = ToolCommons.raytraceFromEntity(player.worldObj, player, true, 10F); - List cursors = getCursorList(lokiRing); + ItemStack heldItemStack = event.getItemStack(); + BlockPos originCoords = getOriginPos(lokiRing); + RayTraceResult lookPos = ToolCommons.raytraceFromEntity(player.worldObj, player, true, 10F); + List cursors = getCursorList(lokiRing); int cursorCount = cursors.size(); int cost = Math.min(cursorCount, (int) Math.pow(Math.E, cursorCount * 0.25)); - if(heldItemStack == null && event.action == Action.RIGHT_CLICK_BLOCK && player.isSneaking()) { - if(originCoords.posY == -1 && lookPos != null) { - setOriginPos(lokiRing, lookPos.blockX, lookPos.blockY, lookPos.blockZ); + if(heldItemStack == null && player.isSneaking()) { + if(originCoords.getY() == -1 && lookPos != null && lookPos.getBlockPos() != null) { + setOriginPos(lokiRing, lookPos.getBlockPos()); setCursorList(lokiRing, null); if(player instanceof EntityPlayerMP) PacketHandler.INSTANCE.sendTo(new PacketSyncBauble(player, slot), (EntityPlayerMP) player); - } else if(lookPos != null) { - if(originCoords.posX == lookPos.blockX && originCoords.posY == lookPos.blockY && originCoords.posZ == lookPos.blockZ) { - setOriginPos(lokiRing, 0, -1, 0); + } else if(lookPos != null && lookPos.getBlockPos() != null) { + if(originCoords.equals(lookPos.getBlockPos())) { + setOriginPos(lokiRing, new BlockPos(0, -1, 0)); if(player instanceof EntityPlayerMP) PacketHandler.INSTANCE.sendTo(new PacketSyncBauble(player, slot), (EntityPlayerMP) player); } else { addCursor : { - int relX = lookPos.blockX - originCoords.posX; - int relY = lookPos.blockY - originCoords.posY; - int relZ = lookPos.blockZ - originCoords.posZ; + BlockPos relPos = lookPos.getBlockPos().add(new BlockPos(-originCoords.getX(), -originCoords.getY(), -originCoords.getZ())); - for(ChunkCoordinates cursor : cursors) - if(cursor.posX == relX && cursor.posY == relY && cursor.posZ == relZ) { + for(BlockPos cursor : cursors) + if(cursor.equals(relPos)) { cursors.remove(cursor); setCursorList(lokiRing, cursors); if(player instanceof EntityPlayerMP) @@ -115,20 +114,18 @@ public class ItemLokiRing extends ItemRelicBauble implements IExtendedWireframeC break addCursor; } - addCursor(lokiRing, relX, relY, relZ); + addCursor(lokiRing, relPos); if(player instanceof EntityPlayerMP) PacketHandler.INSTANCE.sendTo(new PacketSyncBauble(player, slot), (EntityPlayerMP) player); } } } - } else if(heldItemStack != null && event.action == Action.RIGHT_CLICK_BLOCK && lookPos != null && player.isSneaking()) { - for(ChunkCoordinates cursor : cursors) { - int x = lookPos.blockX + cursor.posX; - int y = lookPos.blockY + cursor.posY; - int z = lookPos.blockZ + cursor.posZ; + } else if(heldItemStack != null && lookPos != null && lookPos.getBlockPos() != null && player.isSneaking()) { + for(BlockPos cursor : cursors) { + BlockPos pos = lookPos.getBlockPos().add(cursor); Item item = heldItemStack.getItem(); - if(!player.worldObj.isAirBlock(x, y, z) && ManaItemHandler.requestManaExact(lokiRing, player, cost, true)) { - item.onItemUse(player.capabilities.isCreativeMode ? heldItemStack.copy() : heldItemStack, player, player.worldObj, x, y, z, lookPos.sideHit, (float) lookPos.hitVec.xCoord - x, (float) lookPos.hitVec.yCoord - y, (float) lookPos.hitVec.zCoord - z); + if(!player.worldObj.isAirBlock(pos) && ManaItemHandler.requestManaExact(lokiRing, player, cost, true)) { + item.onItemUse(player.capabilities.isCreativeMode ? heldItemStack.copy() : heldItemStack, player, player.worldObj, pos, event.getHand(), lookPos.sideHit, (float) lookPos.hitVec.xCoord - pos.getX(), (float) lookPos.hitVec.yCoord - pos.getY(), (float) lookPos.hitVec.zCoord - pos.getZ()); if(heldItemStack.stackSize == 0) { event.setCanceled(true); return; @@ -138,26 +135,22 @@ public class ItemLokiRing extends ItemRelicBauble implements IExtendedWireframeC } } - public static void breakOnAllCursors(EntityPlayer player, Item item, ItemStack stack, int x, int y, int z, int side) { + public static void breakOnAllCursors(EntityPlayer player, Item item, ItemStack stack, BlockPos pos, EnumFacing side) { ItemStack lokiRing = getLokiRing(player); if(lokiRing == null || player.worldObj.isRemote || !(item instanceof ISequentialBreaker)) return; - List cursors = getCursorList(lokiRing); + List cursors = getCursorList(lokiRing); ISequentialBreaker breaker = (ISequentialBreaker) item; World world = player.worldObj; - boolean silk = EnchantmentHelper.getEnchantmentLevel(Enchantment.silkTouch.effectId, stack) > 0; - int fortune = EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, stack); + boolean silk = EnchantmentHelper.getEnchantmentLevel(Enchantments.SILK_TOUCH, stack) > 0; + int fortune = EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, stack); boolean dispose = breaker.disposeOfTrashBlocks(stack); - for(int i = 0; i < cursors.size(); i++) { - ChunkCoordinates coords = cursors.get(i); - int xp = x + coords.posX; - int yp = y + coords.posY; - int zp = z + coords.posZ; - Block block = world.getBlock(xp, yp, zp); - breaker.breakOtherBlock(player, stack, xp, yp, zp, x, y, z, side); - ToolCommons.removeBlockWithDrops(player, stack, player.worldObj, xp, yp, zp, x, y, z, block, new Material[] { block.getMaterial() }, silk, fortune, block.getBlockHardness(world, xp, yp, zp), dispose); + for (BlockPos coords : cursors) { + IBlockState state = world.getBlockState(coords); + breaker.breakOtherBlock(player, stack, coords, coords, side); + ToolCommons.removeBlockWithDrops(player, stack, player.worldObj, coords, pos, state.getBlock(), new Material[]{state.getMaterial()}, silk, fortune, state.getBlockHardness(world, coords), dispose); } } @@ -173,36 +166,32 @@ public class ItemLokiRing extends ItemRelicBauble implements IExtendedWireframeC @Override @SideOnly(Side.CLIENT) - public List getWireframesToDraw(EntityPlayer player, ItemStack stack) { + public List getWireframesToDraw(EntityPlayer player, ItemStack stack) { if(getLokiRing(player) != stack) - return null; + return ImmutableList.of(); - MovingObjectPosition lookPos = Minecraft.getMinecraft().objectMouseOver; + RayTraceResult lookPos = Minecraft.getMinecraft().objectMouseOver; - if(lookPos != null && !player.worldObj.isAirBlock(lookPos.blockX, lookPos.blockY, lookPos.blockZ) && lookPos.entityHit == null) { - List list = getCursorList(stack); - ChunkCoordinates origin = getOriginPos(stack); + if(lookPos != null && lookPos.getBlockPos() != null && !player.worldObj.isAirBlock(lookPos.getBlockPos()) && lookPos.entityHit == null) { + List list = getCursorList(stack); + BlockPos origin = getOriginPos(stack); - if(origin.posY != -1) { - for(ChunkCoordinates coords : list) { - coords.posX += origin.posX; - coords.posY += origin.posY; - coords.posZ += origin.posZ; + for (int i = 0; i < list.size(); i++) { + if (origin.getY() != -1) { + list.set(i, list.get(i).add(origin)); + } else { + list.set(i, list.get(i).add(lookPos.getBlockPos())); } - } else for(ChunkCoordinates coords : list) { - coords.posX += lookPos.blockX; - coords.posY += lookPos.blockY; - coords.posZ += lookPos.blockZ; } return list; } - return null; + return ImmutableList.of(); } @Override - public ChunkCoordinates getSourceWireframe(EntityPlayer player, ItemStack stack) { + public BlockPos getSourceWireframe(EntityPlayer player, ItemStack stack) { return getLokiRing(player) == stack ? getOriginPos(stack) : null; } @@ -217,22 +206,22 @@ public class ItemLokiRing extends ItemRelicBauble implements IExtendedWireframeC return stack != null && (stack.getItem() == ModItems.lokiRing || stack.getItem() == ModItems.aesirRing); } - private static ChunkCoordinates getOriginPos(ItemStack stack) { + private static BlockPos getOriginPos(ItemStack stack) { int x = ItemNBTHelper.getInt(stack, TAG_X_ORIGIN, 0); int y = ItemNBTHelper.getInt(stack, TAG_Y_ORIGIN, -1); int z = ItemNBTHelper.getInt(stack, TAG_Z_ORIGIN, 0); - return new ChunkCoordinates(x, y, z); + return new BlockPos(x, y, z); } - private static void setOriginPos(ItemStack stack, int x, int y, int z) { - ItemNBTHelper.setInt(stack, TAG_X_ORIGIN, x); - ItemNBTHelper.setInt(stack, TAG_Y_ORIGIN, y); - ItemNBTHelper.setInt(stack, TAG_Z_ORIGIN, z); + private static void setOriginPos(ItemStack stack, BlockPos pos) { + ItemNBTHelper.setInt(stack, TAG_X_ORIGIN, pos.getX()); + ItemNBTHelper.setInt(stack, TAG_Y_ORIGIN, pos.getY()); + ItemNBTHelper.setInt(stack, TAG_Z_ORIGIN, pos.getZ()); } - private static List getCursorList(ItemStack stack) { + private static List getCursorList(ItemStack stack) { NBTTagCompound cmp = ItemNBTHelper.getCompound(stack, TAG_CURSOR_LIST, false); - List cursors = new ArrayList(); + List cursors = new ArrayList<>(); int count = cmp.getInteger(TAG_CURSOR_COUNT); for(int i = 0; i < count; i++) { @@ -240,18 +229,18 @@ public class ItemLokiRing extends ItemRelicBauble implements IExtendedWireframeC int x = cursorCmp.getInteger(TAG_X_OFFSET); int y = cursorCmp.getInteger(TAG_Y_OFFSET); int z = cursorCmp.getInteger(TAG_Z_OFFSET); - cursors.add(new ChunkCoordinates(x, y, z)); + cursors.add(new BlockPos(x, y, z)); } return cursors; } - private static void setCursorList(ItemStack stack, List cursors) { + private static void setCursorList(ItemStack stack, List cursors) { NBTTagCompound cmp = new NBTTagCompound(); if(cursors != null) { int i = 0; - for(ChunkCoordinates cursor : cursors) { - NBTTagCompound cursorCmp = cursorToCmp(cursor.posX, cursor.posY, cursor.posZ); + for(BlockPos cursor : cursors) { + NBTTagCompound cursorCmp = cursorToCmp(cursor); cmp.setTag(TAG_CURSOR_PREFIX + i, cursorCmp); i++; } @@ -261,18 +250,18 @@ public class ItemLokiRing extends ItemRelicBauble implements IExtendedWireframeC ItemNBTHelper.setCompound(stack, TAG_CURSOR_LIST, cmp); } - private static NBTTagCompound cursorToCmp(int x, int y, int z) { + private static NBTTagCompound cursorToCmp(BlockPos pos) { NBTTagCompound cmp = new NBTTagCompound(); - cmp.setInteger(TAG_X_OFFSET, x); - cmp.setInteger(TAG_Y_OFFSET, y); - cmp.setInteger(TAG_Z_OFFSET, z); + cmp.setInteger(TAG_X_OFFSET, pos.getX()); + cmp.setInteger(TAG_Y_OFFSET, pos.getY()); + cmp.setInteger(TAG_Z_OFFSET, pos.getZ()); return cmp; } - private static void addCursor(ItemStack stack, int x, int y, int z) { + private static void addCursor(ItemStack stack, BlockPos pos) { NBTTagCompound cmp = ItemNBTHelper.getCompound(stack, TAG_CURSOR_LIST, false); int count = cmp.getInteger(TAG_CURSOR_COUNT); - cmp.setTag(TAG_CURSOR_PREFIX + count, cursorToCmp(x, y, z)); + cmp.setTag(TAG_CURSOR_PREFIX + count, cursorToCmp(pos)); cmp.setInteger(TAG_CURSOR_COUNT, count + 1); ItemNBTHelper.setCompound(stack, TAG_CURSOR_LIST, cmp); } diff --git a/src/main/java/vazkii/botania/common/item/relic/ItemOdinRing.java b/src/main/java/vazkii/botania/common/item/relic/ItemOdinRing.java index 3eaa7da18..700a6d181 100644 --- a/src/main/java/vazkii/botania/common/item/relic/ItemOdinRing.java +++ b/src/main/java/vazkii/botania/common/item/relic/ItemOdinRing.java @@ -10,9 +10,11 @@ */ package vazkii.botania.common.item.relic; -import java.util.ArrayList; -import java.util.List; - +import baubles.api.BaubleType; +import baubles.common.container.InventoryBaubles; +import baubles.common.lib.PlayerHandler; +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Multimap; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.attributes.AttributeModifier; @@ -21,27 +23,23 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.DamageSource; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.living.LivingAttackEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.lib.LibItemNames; -import baubles.api.BaubleType; -import baubles.common.container.InventoryBaubles; -import baubles.common.lib.PlayerHandler; -import com.google.common.collect.HashMultimap; -import com.google.common.collect.Multimap; - -import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import java.util.ArrayList; +import java.util.List; public class ItemOdinRing extends ItemRelicBauble { - public static List damageNegations = new ArrayList(); + private static final List damageNegations = new ArrayList<>(); - Multimap attributes = HashMultimap.create(); + private final Multimap attributes = HashMultimap.create(); public ItemOdinRing() { super(LibItemNames.ODIN_RING); - MinecraftForge.EVENT_BUS.register(this); + MinecraftForge.EVENT_BUS.register(ItemOdinRing.class); damageNegations.add(DamageSource.drown.damageType); damageNegations.add(DamageSource.fall.damageType); @@ -62,10 +60,10 @@ public class ItemOdinRing extends ItemRelicBauble { } @SubscribeEvent - public void onPlayerAttacked(LivingAttackEvent event) { - if(event.entityLiving instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer) event.entityLiving; - if(getOdinRing(player) != null && damageNegations.contains(event.source.damageType)) + public static void onPlayerAttacked(LivingAttackEvent event) { + if(event.getEntityLiving() instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) event.getEntityLiving(); + if(getOdinRing(player) != null && damageNegations.contains(event.getSource().damageType)) event.setCanceled(true); } } @@ -102,7 +100,7 @@ public class ItemOdinRing extends ItemRelicBauble { void fillModifiers(Multimap attributes, ItemStack stack) { - attributes.put(SharedMonsterAttributes.maxHealth.getAttributeUnlocalizedName(), new AttributeModifier(getBaubleUUID(stack), "Bauble modifier", 20, 0)); + attributes.put(SharedMonsterAttributes.MAX_HEALTH.getAttributeUnlocalizedName(), new AttributeModifier(getBaubleUUID(stack), "Bauble modifier", 20, 0)); } } diff --git a/src/main/java/vazkii/botania/common/item/relic/ItemRelic.java b/src/main/java/vazkii/botania/common/item/relic/ItemRelic.java index 0285c8f7a..170a9cfe5 100644 --- a/src/main/java/vazkii/botania/common/item/relic/ItemRelic.java +++ b/src/main/java/vazkii/botania/common/item/relic/ItemRelic.java @@ -10,67 +10,74 @@ */ package vazkii.botania.common.item.relic; -import java.util.List; - import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.stats.Achievement; import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; +import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; +import net.minecraftforge.common.UsernameCache; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.item.IRelic; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.item.ItemMod; import vazkii.botania.common.item.ModItems; +import javax.annotation.Nonnull; +import java.util.List; +import java.util.UUID; + public class ItemRelic extends ItemMod implements IRelic { - private static final String TAG_SOULBIND = "soulbind"; + private static final String TAG_SOULBIND_NAME = "soulbind"; + private static final String TAG_SOULBIND_UUID = "soulbindUUID"; - Achievement achievement; + private Achievement achievement; public ItemRelic(String name) { - setUnlocalizedName(name); + super(name); setMaxStackSize(1); } @Override - public void onUpdate(ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) { - if(p_77663_3_ instanceof EntityPlayer) - updateRelic(p_77663_1_, (EntityPlayer) p_77663_3_); + public void onUpdate(ItemStack stack, World world, Entity entity, int slot, boolean selected) { + if(!world.isRemote && entity instanceof EntityPlayer) + updateRelic(stack, (EntityPlayer) entity); } + @SideOnly(Side.CLIENT) @Override - public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) { - addBindInfo(p_77624_3_, p_77624_1_, p_77624_2_); + public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean advanced) { + addBindInfo(tooltip, stack, player); } - public static void addBindInfo(List list, ItemStack stack, EntityPlayer player) { + @SideOnly(Side.CLIENT) + public void addBindInfo(List list, ItemStack stack, EntityPlayer player) { if(GuiScreen.isShiftKeyDown()) { - String bind = getSoulbindUsernameS(stack); - if(bind.isEmpty()) - addStringToTooltip(StatCollector.translateToLocal("botaniamisc.relicUnbound"), list); - else { - addStringToTooltip(String.format(StatCollector.translateToLocal("botaniamisc.relicSoulbound"), bind), list); - if(!isRightPlayer(player, stack)) - addStringToTooltip(String.format(StatCollector.translateToLocal("botaniamisc.notYourSagittarius"), bind), list); + if(!hasUUID(stack)) { + addStringToTooltip(I18n.format("botaniamisc.relicUnbound"), list); + } else { + addStringToTooltip(I18n.format("botaniamisc.relicSoulbound", getSoulbindUsername(stack)), list); + if(!getSoulbindUUID(stack).equals(player.getUniqueID())) + addStringToTooltip(I18n.format("botaniamisc.notYourSagittarius", getSoulbindUsername(stack)), list); } if(stack.getItem() == ModItems.aesirRing) - addStringToTooltip(StatCollector.translateToLocal("botaniamisc.dropIkea"), list); + addStringToTooltip(I18n.format("botaniamisc.dropIkea"), list); if(stack.getItem() == ModItems.dice) { addStringToTooltip("", list); String name = stack.getUnlocalizedName() + ".poem"; for(int i = 0; i < 4; i++) - addStringToTooltip(EnumChatFormatting.ITALIC + StatCollector.translateToLocal(name + i), list); + addStringToTooltip(TextFormatting.ITALIC + I18n.format(name + i), list); } - } else addStringToTooltip(StatCollector.translateToLocal("botaniamisc.shiftinfo"), list); + } else addStringToTooltip(I18n.format("botaniamisc.shiftinfo"), list); } public boolean shouldDamageWrongPlayer() { @@ -86,39 +93,47 @@ public class ItemRelic extends ItemMod implements IRelic { tooltip.add(s.replaceAll("&", "\u00a7")); } - public static String getSoulbindUsernameS(ItemStack stack) { - return ItemNBTHelper.getString(stack, TAG_SOULBIND, ""); - } - - public static void updateRelic(ItemStack stack, EntityPlayer player) { + public void updateRelic(ItemStack stack, EntityPlayer player) { if(stack == null || !(stack.getItem() instanceof IRelic)) return; - String soulbind = getSoulbindUsernameS(stack); - if(soulbind.isEmpty()) { - player.addStat(((IRelic) stack.getItem()).getBindAchievement(), 1); - bindToPlayer(player, stack); - soulbind = getSoulbindUsernameS(stack); + boolean rightPlayer = true; + if(hasUUID(stack)) { + // Sync to username todo is this worth 'optimizing'? + if (UsernameCache.containsUUID(getSoulbindUUID(stack))) { + bindToUsername(UsernameCache.getLastKnownUsername(getSoulbindUUID(stack)), stack); + } else { + bindToUsername("", stack); + } + + // UUID trumps username + rightPlayer = getSoulbindUUID(stack).equals(player.getUniqueID()); + } else { + if ("".equals(getSoulbindUsername(stack))) { + // New user + bindToUUID(player.getUniqueID(), stack); + player.addStat(((IRelic) stack.getItem()).getBindAchievement(), 1); + } else { + if (player.getName().equals(getSoulbindUsername(stack))) { + // Old relic, correct owner, convert to UUID + bindToUUID(player.getUniqueID(), stack); + } else { + // Old relic, wrong owner, damage + rightPlayer = false; + } + } } - if(!isRightPlayer(player, stack) && player.ticksExisted % 10 == 0 && (!(stack.getItem() instanceof ItemRelic) || ((ItemRelic) stack.getItem()).shouldDamageWrongPlayer())) + if(!rightPlayer && player.ticksExisted % 10 == 0 && (!(stack.getItem() instanceof ItemRelic) || ((ItemRelic) stack.getItem()).shouldDamageWrongPlayer())) player.attackEntityFrom(damageSource(), 2); } - public static void bindToPlayer(EntityPlayer player, ItemStack stack) { - bindToUsernameS(player.getCommandSenderName(), stack); - } - - public static void bindToUsernameS(String username, ItemStack stack) { - ItemNBTHelper.setString(stack, TAG_SOULBIND, username); - } - - public static boolean isRightPlayer(EntityPlayer player, ItemStack stack) { - return isRightPlayer(player.getCommandSenderName(), stack); - } - - public static boolean isRightPlayer(String player, ItemStack stack) { - return getSoulbindUsernameS(stack).equals(player); + public boolean isRightPlayer(EntityPlayer player, ItemStack stack) { + if (hasUUID(stack)) { + return getSoulbindUUID(stack).equals(player.getUniqueID()); + } else { + return getSoulbindUsername(stack).equals(player.getName()); + } } public static DamageSource damageSource() { @@ -127,12 +142,35 @@ public class ItemRelic extends ItemMod implements IRelic { @Override public void bindToUsername(String playerName, ItemStack stack) { - bindToUsernameS(playerName, stack); + ItemNBTHelper.setString(stack, TAG_SOULBIND_NAME, playerName); } @Override public String getSoulbindUsername(ItemStack stack) { - return getSoulbindUsernameS(stack); + return ItemNBTHelper.getString(stack, TAG_SOULBIND_NAME, ""); + } + + @Override + public void bindToUUID(UUID uuid, ItemStack stack) { + ItemNBTHelper.setString(stack, TAG_SOULBIND_UUID, uuid.toString()); + } + + @Override + public UUID getSoulbindUUID(ItemStack stack) { + if(ItemNBTHelper.verifyExistance(stack, TAG_SOULBIND_UUID)) { + try { + return UUID.fromString(ItemNBTHelper.getString(stack, TAG_SOULBIND_UUID, "")); + } catch (IllegalArgumentException ex) { // Bad UUID in tag + ItemNBTHelper.removeEntry(stack, TAG_SOULBIND_UUID); + } + } + + return null; + } + + @Override + public boolean hasUUID(ItemStack stack) { + return getSoulbindUUID(stack) != null; } @Override @@ -145,8 +183,9 @@ public class ItemRelic extends ItemMod implements IRelic { this.achievement = achievement; } + @Nonnull @Override - public EnumRarity getRarity(ItemStack p_77613_1_) { + public EnumRarity getRarity(ItemStack stack) { return BotaniaAPI.rarityRelic; } diff --git a/src/main/java/vazkii/botania/common/item/relic/ItemRelicBauble.java b/src/main/java/vazkii/botania/common/item/relic/ItemRelicBauble.java index 6d735743b..9e4690736 100644 --- a/src/main/java/vazkii/botania/common/item/relic/ItemRelicBauble.java +++ b/src/main/java/vazkii/botania/common/item/relic/ItemRelicBauble.java @@ -10,8 +10,6 @@ */ package vazkii.botania.common.item.relic; -import java.util.List; - import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -19,22 +17,34 @@ import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.stats.Achievement; import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.item.IRelic; import vazkii.botania.common.item.equipment.bauble.ItemBauble; +import javax.annotation.Nonnull; +import java.util.List; +import java.util.UUID; + public abstract class ItemRelicBauble extends ItemBauble implements IRelic { Achievement achievement; + private final ItemRelic dummy = new ItemRelic("dummy") { // Delegate for relic stuff + @Override + protected boolean shouldRegister() { + return false; + } + }; public ItemRelicBauble(String name) { super(name); } @Override - public void onUpdate(ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) { - if(p_77663_3_ instanceof EntityPlayer) - ItemRelic.updateRelic(p_77663_1_, (EntityPlayer) p_77663_3_); + public void onUpdate(ItemStack stack, World world, Entity entity, int slot, boolean held) { + if(entity instanceof EntityPlayer) + dummy.updateRelic(stack, (EntityPlayer) entity); } @Override @@ -42,35 +52,49 @@ public abstract class ItemRelicBauble extends ItemBauble implements IRelic { super.onWornTick(stack, player); if(player instanceof EntityPlayer) { EntityPlayer ePlayer = (EntityPlayer) player; - ItemRelic.updateRelic(stack, ePlayer); - if(ItemRelic.isRightPlayer(ePlayer, stack)) + dummy.updateRelic(stack, ePlayer); + if(dummy.isRightPlayer(ePlayer, stack)) onValidPlayerWornTick(stack, ePlayer); } } + @SideOnly(Side.CLIENT) @Override - public void addHiddenTooltip(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { - super.addHiddenTooltip(par1ItemStack, par2EntityPlayer, par3List, par4); - ItemRelic.addBindInfo(par3List, par1ItemStack, par2EntityPlayer); + public void addHiddenTooltip(ItemStack par1ItemStack, EntityPlayer player, List stacks, boolean par4) { + super.addHiddenTooltip(par1ItemStack, player, stacks, par4); + dummy.addBindInfo(stacks, par1ItemStack, player); } - public void onValidPlayerWornTick(ItemStack stack, EntityPlayer player) { - // NO-OP - } + public void onValidPlayerWornTick(ItemStack stack, EntityPlayer player) {} @Override public boolean canEquip(ItemStack stack, EntityLivingBase player) { - return player instanceof EntityPlayer && ItemRelic.isRightPlayer((EntityPlayer) player, stack); + return player instanceof EntityPlayer && dummy.isRightPlayer(((EntityPlayer) player), stack); } @Override public void bindToUsername(String playerName, ItemStack stack) { - ItemRelic.bindToUsernameS(playerName, stack); + dummy.bindToUsername(playerName, stack); } @Override public String getSoulbindUsername(ItemStack stack) { - return ItemRelic.getSoulbindUsernameS(stack); + return dummy.getSoulbindUsername(stack); + } + + @Override + public void bindToUUID(UUID uuid, ItemStack stack) { + dummy.bindToUUID(uuid, stack); + } + + @Override + public UUID getSoulbindUUID(ItemStack stack) { + return dummy.getSoulbindUUID(stack); + } + + @Override + public boolean hasUUID(ItemStack stack) { + return dummy.hasUUID(stack); } @Override @@ -83,8 +107,9 @@ public abstract class ItemRelicBauble extends ItemBauble implements IRelic { this.achievement = achievement; } + @Nonnull @Override - public EnumRarity getRarity(ItemStack p_77613_1_) { + public EnumRarity getRarity(ItemStack stack) { return BotaniaAPI.rarityRelic; } diff --git a/src/main/java/vazkii/botania/common/item/relic/ItemThorRing.java b/src/main/java/vazkii/botania/common/item/relic/ItemThorRing.java index 78dd94da2..ac6c5949b 100644 --- a/src/main/java/vazkii/botania/common/item/relic/ItemThorRing.java +++ b/src/main/java/vazkii/botania/common/item/relic/ItemThorRing.java @@ -10,13 +10,13 @@ */ package vazkii.botania.common.item.relic; +import baubles.api.BaubleType; +import baubles.common.container.InventoryBaubles; +import baubles.common.lib.PlayerHandler; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.lib.LibItemNames; -import baubles.api.BaubleType; -import baubles.common.container.InventoryBaubles; -import baubles.common.lib.PlayerHandler; public class ItemThorRing extends ItemRelicBauble { diff --git a/src/main/java/vazkii/botania/common/item/rod/ItemCobbleRod.java b/src/main/java/vazkii/botania/common/item/rod/ItemCobbleRod.java index 0a5df3c44..8a299bed5 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemCobbleRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemCobbleRod.java @@ -14,6 +14,10 @@ import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import vazkii.botania.api.item.IBlockProvider; import vazkii.botania.api.mana.IManaUsingItem; @@ -21,23 +25,21 @@ import vazkii.botania.api.mana.ManaItemHandler; import vazkii.botania.common.item.ItemMod; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; + public class ItemCobbleRod extends ItemMod implements IManaUsingItem, IBlockProvider { static final int COST = 150; public ItemCobbleRod() { + super(LibItemNames.COBBLE_ROD); setMaxStackSize(1); - setUnlocalizedName(LibItemNames.COBBLE_ROD); } + @Nonnull @Override - public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { - return ItemDirtRod.place(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10, Blocks.cobblestone, COST, 0.3F, 0.3F, 0.3F); - } - - @Override - public boolean isFull3D() { - return true; + public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) { + return ItemDirtRod.place(par1ItemStack, player, world, pos, hand, side, par8, par9, par10, Blocks.COBBLESTONE, COST, 0.3F, 0.3F, 0.3F); } @Override @@ -47,14 +49,14 @@ public class ItemCobbleRod extends ItemMod implements IManaUsingItem, IBlockProv @Override public boolean provideBlock(EntityPlayer player, ItemStack requestor, ItemStack stack, Block block, int meta, boolean doit) { - if(block == Blocks.cobblestone && meta == 0) + if(block == Blocks.COBBLESTONE && meta == 0) return !doit || ManaItemHandler.requestManaExactForTool(requestor, player, COST, true); return false; } @Override public int getBlockCount(EntityPlayer player, ItemStack requestor, ItemStack stack, Block block, int meta) { - if(block == Blocks.cobblestone && meta == 0) + if(block == Blocks.COBBLESTONE && meta == 0) return -1; return 0; } diff --git a/src/main/java/vazkii/botania/common/item/rod/ItemDirtRod.java b/src/main/java/vazkii/botania/common/item/rod/ItemDirtRod.java index d09ca7b67..ab447f43b 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemDirtRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemDirtRod.java @@ -17,9 +17,12 @@ import net.minecraft.init.Blocks; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.stats.Achievement; -import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; import vazkii.botania.api.item.IBlockProvider; import vazkii.botania.api.mana.IManaUsingItem; import vazkii.botania.api.mana.ManaItemHandler; @@ -29,6 +32,8 @@ import vazkii.botania.common.achievement.ModAchievements; import vazkii.botania.common.item.ItemMod; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; + public class ItemDirtRod extends ItemMod implements IManaUsingItem, ICraftAchievement, IBlockProvider { static final int COST = 75; @@ -38,39 +43,36 @@ public class ItemDirtRod extends ItemMod implements IManaUsingItem, ICraftAchiev } public ItemDirtRod(String name) { - super(); + super(name); setMaxStackSize(1); - setUnlocalizedName(name); } + @Nonnull @Override - public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { - return place(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10, Blocks.dirt, COST, 0.35F, 0.2F, 0.05F); + public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) { + return place(par1ItemStack, player, world, pos, hand, side, par8, par9, par10, Blocks.DIRT, COST, 0.35F, 0.2F, 0.05F); } - public static boolean place(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10, Block block, int cost, float r, float g, float b) { - if(ManaItemHandler.requestManaExactForTool(par1ItemStack, par2EntityPlayer, cost, false)) { - ForgeDirection dir = ForgeDirection.getOrientation(par7); - int entities = par3World.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(par4 + dir.offsetX, par5 + dir.offsetY, par6 + dir.offsetZ, par4 + dir.offsetX + 1, par5 + dir.offsetY + 1, par6 + dir.offsetZ + 1)).size(); + public static EnumActionResult place(ItemStack par1ItemStack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10, Block block, int cost, float r, float g, float b) { + if(ManaItemHandler.requestManaExactForTool(par1ItemStack, player, cost, false)) { + int entities = world.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(pos.offset(side), pos.offset(side).add(1, 1, 1))).size(); if(entities == 0) { ItemStack stackToPlace = new ItemStack(block); - stackToPlace.tryPlaceItemIntoWorld(par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10); + stackToPlace.onItemUse(player, world, pos, hand, side, par8, par9, par10); if(stackToPlace.stackSize == 0) { - ManaItemHandler.requestManaExactForTool(par1ItemStack, par2EntityPlayer, cost, true); + ManaItemHandler.requestManaExactForTool(par1ItemStack, player, cost, true); for(int i = 0; i < 6; i++) - Botania.proxy.sparkleFX(par3World, par4 + dir.offsetX + Math.random(), par5 + dir.offsetY + Math.random(), par6 + dir.offsetZ + Math.random(), r, g, b, 1F, 5); + Botania.proxy.sparkleFX(pos.getX() + side.getFrontOffsetX() + Math.random(), pos.getY() + side.getFrontOffsetY() + Math.random(), pos.getZ() + side.getFrontOffsetZ() + Math.random(), r, g, b, 1F, 5); + return EnumActionResult.SUCCESS; } } + + return EnumActionResult.FAIL; } - return true; - } - - @Override - public boolean isFull3D() { - return true; + return EnumActionResult.PASS; } @Override @@ -85,14 +87,14 @@ public class ItemDirtRod extends ItemMod implements IManaUsingItem, ICraftAchiev @Override public boolean provideBlock(EntityPlayer player, ItemStack requestor, ItemStack stack, Block block, int meta, boolean doit) { - if(block == Blocks.dirt && meta == 0) + if(block == Blocks.DIRT && meta == 0) return !doit || ManaItemHandler.requestManaExactForTool(requestor, player, COST, true); return false; } @Override public int getBlockCount(EntityPlayer player, ItemStack requestor, ItemStack stack, Block block, int meta) { - if(block == Blocks.dirt && meta == 0) + if(block == Blocks.DIRT && meta == 0) return -1; return 0; } diff --git a/src/main/java/vazkii/botania/common/item/rod/ItemDiviningRod.java b/src/main/java/vazkii/botania/common/item/rod/ItemDiviningRod.java index c8bfde267..6d3589f81 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemDiviningRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemDiviningRod.java @@ -10,14 +10,17 @@ */ package vazkii.botania.common.item.rod; -import java.util.Random; - -import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MathHelper; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.oredict.OreDictionary; import vazkii.botania.api.item.IAvatarTile; @@ -25,11 +28,15 @@ import vazkii.botania.api.item.IAvatarWieldable; import vazkii.botania.api.item.IManaProficiencyArmor; import vazkii.botania.api.mana.IManaUsingItem; import vazkii.botania.api.mana.ManaItemHandler; +import vazkii.botania.api.sound.BotaniaSoundEvents; import vazkii.botania.client.lib.LibResources; import vazkii.botania.common.Botania; import vazkii.botania.common.item.ItemMod; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; +import java.util.Random; + public class ItemDiviningRod extends ItemMod implements IManaUsingItem, IAvatarWieldable { private static final ResourceLocation avatarOverlay = new ResourceLocation(LibResources.MODEL_AVATAR_DIVINING); @@ -37,47 +44,42 @@ public class ItemDiviningRod extends ItemMod implements IManaUsingItem, IAvatarW static final int COST = 3000; public ItemDiviningRod() { + super(LibItemNames.DIVINING_ROD); setMaxStackSize(1); - setUnlocalizedName(LibItemNames.DIVINING_ROD); } + @Nonnull @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer p) { + public ActionResult onItemRightClick(@Nonnull ItemStack stack, World world, EntityPlayer p, EnumHand hand) { if(ManaItemHandler.requestManaExactForTool(stack, p, COST, true)) { if(world.isRemote) { - int x = MathHelper.floor_double(p.posX); - int y = MathHelper.floor_double(p.posY); - int z = MathHelper.floor_double(p.posZ); int range = IManaProficiencyArmor.Helper.hasProficiency(p) ? 20 : 15; long seedxor = world.rand.nextLong(); - doHighlight(world, x, y, z, range, seedxor); - p.swingItem(); - } else world.playSoundAtEntity(p, "botania:divinationRod", 1F, 1F); + doHighlight(world, new BlockPos(p), range, seedxor); + p.swingArm(hand); + } else world.playSound(null, p.posX, p.posY, p.posZ, BotaniaSoundEvents.divinationRod, SoundCategory.PLAYERS, 1F, 1F); + return ActionResult.newResult(EnumActionResult.SUCCESS, stack); } - return stack; + return ActionResult.newResult(EnumActionResult.PASS, stack); } - public void doHighlight(World world, int x, int y, int z, int range, long seedxor) { + public void doHighlight(World world, BlockPos pos, int range, long seedxor) { Botania.proxy.setWispFXDepthTest(false); - for(int i = -range; i < range + 1; i++) - for(int j = -range; j < range + 1; j++) - for(int k = -range; k < range + 1; k++) { - int xp = x + i; - int yp = y + j; - int zp = z + k; - Block block = world.getBlock(xp, yp, zp); - int meta = world.getBlockMetadata(xp, yp, zp); - ItemStack orestack = new ItemStack(block, 1, meta); - for(int id : OreDictionary.getOreIDs(orestack)) { - String s = OreDictionary.getOreName(id); - if(s.matches("^ore[A-Z].+")) { - Random rand = new Random(s.hashCode() ^ seedxor); - Botania.proxy.wispFX(world, xp + world.rand.nextFloat(), yp + world.rand.nextFloat(), zp + world.rand.nextFloat(), rand.nextFloat(), rand.nextFloat(), rand.nextFloat(), 0.25F, 0F, 8); - break; - } - } + for(BlockPos pos_ : BlockPos.getAllInBox(pos.add(-range, -range, -range), pos.add(range, range, range))) { + IBlockState state = world.getBlockState(pos_); + if(Item.getItemFromBlock(state.getBlock()) == null) + continue; + ItemStack orestack = new ItemStack(state.getBlock(), 1, state.getBlock().getMetaFromState(state)); + for(int id : OreDictionary.getOreIDs(orestack)) { + String s = OreDictionary.getOreName(id); + if(s.matches("^ore[A-Z].+")) { + Random rand = new Random(s.hashCode() ^ seedxor); + Botania.proxy.wispFX(pos_.getX() + world.rand.nextFloat(), pos_.getY() + world.rand.nextFloat(), pos_.getZ() + world.rand.nextFloat(), rand.nextFloat(), rand.nextFloat(), rand.nextFloat(), 0.25F, 0F, 8); + break; } + } + } Botania.proxy.setWispFXDepthTest(true); } @@ -89,9 +91,9 @@ public class ItemDiviningRod extends ItemMod implements IManaUsingItem, IAvatarW @Override public void onAvatarUpdate(IAvatarTile tile, ItemStack stack) { TileEntity te = (TileEntity) tile; - World world = te.getWorldObj(); + World world = te.getWorld(); if(tile.getCurrentMana() >= COST && tile.getElapsedFunctionalTicks() % 200 == 0 && tile.isEnabled()) { - doHighlight(world, te.xCoord, te.yCoord, te.zCoord, 18, te.xCoord ^ te.yCoord ^ te.zCoord); + doHighlight(world, te.getPos(), 18, te.getPos().hashCode()); tile.recieveMana(-COST); } } diff --git a/src/main/java/vazkii/botania/common/item/rod/ItemExchangeRod.java b/src/main/java/vazkii/botania/common/item/rod/ItemExchangeRod.java index 01369ff1c..877a75b3f 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemExchangeRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemExchangeRod.java @@ -10,27 +10,31 @@ */ package vazkii.botania.common.item.rod; -import java.util.ArrayList; -import java.util.List; - +import com.google.common.collect.ImmutableList; import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.inventory.IInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.event.entity.player.PlayerInteractEvent; -import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.item.IBlockProvider; import vazkii.botania.api.item.IManaProficiencyArmor; @@ -42,9 +46,10 @@ import vazkii.botania.common.block.BlockCamo; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.item.ItemMod; import vazkii.botania.common.lib.LibItemNames; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.List; public class ItemExchangeRod extends ItemMod implements IManaUsingItem, IWireframeCoordinateListProvider { @@ -62,57 +67,53 @@ public class ItemExchangeRod extends ItemMod implements IManaUsingItem, IWirefra private static final String TAG_EXTRA_RANGE = "extraRange"; public ItemExchangeRod() { + super(LibItemNames.EXCHANGE_ROD); setMaxStackSize(1); - setUnlocalizedName(LibItemNames.EXCHANGE_ROD); MinecraftForge.EVENT_BUS.register(this); } + @Nonnull @Override - public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { - Block wblock = par3World.getBlock(par4, par5, par6); - int wmeta = par3World.getBlockMetadata(par4, par5, par6); + public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) { + IBlockState wstate = world.getBlockState(pos); - if(par2EntityPlayer.isSneaking()) { - TileEntity tile = par3World.getTileEntity(par4, par5, par6); + if(player.isSneaking()) { + TileEntity tile = world.getTileEntity(pos); if(tile == null) { - if(BlockCamo.isValidBlock(wblock)) { - Item item = Item.getItemFromBlock(wblock); - if(!item.getHasSubtypes()) - wmeta = 0; + if(BlockCamo.isValidBlock(wstate)) { + Item item = Item.getItemFromBlock(wstate.getBlock()); - boolean set = setBlock(par1ItemStack, wblock, wmeta); - par2EntityPlayer.setCurrentItemOrArmor(0, par1ItemStack); + boolean set = setBlock(par1ItemStack, wstate.getBlock(), !item.getHasSubtypes() ? 0 : wstate.getBlock().getMetaFromState(wstate)); + player.setItemStackToSlot(hand == EnumHand.MAIN_HAND ? EntityEquipmentSlot.MAINHAND : EntityEquipmentSlot.OFFHAND, par1ItemStack); - displayRemainderCounter(par2EntityPlayer, par1ItemStack); - return set; + displayRemainderCounter(player, par1ItemStack); + return EnumActionResult.SUCCESS; } } } else if(canExchange(par1ItemStack) && !ItemNBTHelper.getBoolean(par1ItemStack, TAG_SWAPPING, false)) { Block block = getBlock(par1ItemStack); int meta = getBlockMeta(par1ItemStack); - List swap = getBlocksToSwap(par3World, par1ItemStack, block, meta, par4, par5, par6, null, 0); + List swap = getBlocksToSwap(world, par1ItemStack, block.getStateFromMeta(meta), pos, null); if(swap.size() > 0) { ItemNBTHelper.setBoolean(par1ItemStack, TAG_SWAPPING, true); - ItemNBTHelper.setInt(par1ItemStack, TAG_SELECT_X, par4); - ItemNBTHelper.setInt(par1ItemStack, TAG_SELECT_Y, par5); - ItemNBTHelper.setInt(par1ItemStack, TAG_SELECT_Z, par6); - setTargetBlock(par1ItemStack, wblock, wmeta); - if(par3World.isRemote) - par2EntityPlayer.swingItem(); + ItemNBTHelper.setInt(par1ItemStack, TAG_SELECT_X, pos.getX()); + ItemNBTHelper.setInt(par1ItemStack, TAG_SELECT_Y, pos.getY()); + ItemNBTHelper.setInt(par1ItemStack, TAG_SELECT_Z, pos.getZ()); + setTargetBlock(par1ItemStack, wstate.getBlock(), wstate.getBlock().getMetaFromState(wstate)); + if(world.isRemote) + player.swingArm(hand); } } - return false; + return EnumActionResult.SUCCESS; } @SubscribeEvent - public void onLeftClick(PlayerInteractEvent event) { - if(event.action == Action.LEFT_CLICK_BLOCK) { - ItemStack stack = event.entityPlayer.getCurrentEquippedItem(); - if(stack != null && stack.getItem() == this && canExchange(stack) && ManaItemHandler.requestManaExactForTool(stack, event.entityPlayer, COST, false)) { - if(exchange(event.world, event.entityPlayer, event.x, event.y, event.z, stack, getBlock(stack), getBlockMeta(stack))) - ManaItemHandler.requestManaExactForTool(stack, event.entityPlayer, COST, true); - } + public void onLeftClick(PlayerInteractEvent.LeftClickBlock event) { + ItemStack stack = event.getItemStack(); + if(stack != null && stack.getItem() == this && canExchange(stack) && ManaItemHandler.requestManaExactForTool(stack, event.getEntityPlayer(), COST, false)) { + if(exchange(event.getWorld(), event.getEntityPlayer(), event.getPos(), stack, getBlock(stack).getStateFromMeta(getBlockMeta(stack)))) + ManaItemHandler.requestManaExactForTool(stack, event.getEntityPlayer(), COST, true); } } @@ -141,31 +142,30 @@ public class ItemExchangeRod extends ItemMod implements IManaUsingItem, IWirefra int z = ItemNBTHelper.getInt(stack, TAG_SELECT_Z, 0); Block targetBlock = getTargetBlock(stack); int targetMeta = getTargetBlockMeta(stack); - List swap = getBlocksToSwap(world, stack, block, meta, x, y, z, targetBlock, targetMeta); + List swap = getBlocksToSwap(world, stack, block.getStateFromMeta(meta), new BlockPos(x, y, z), targetBlock.getStateFromMeta(targetMeta)); if(swap.size() == 0) { ItemNBTHelper.setBoolean(stack, TAG_SWAPPING, false); return; } - ChunkCoordinates coords = swap.get(world.rand.nextInt(swap.size())); - boolean exchange = exchange(world, player, coords.posX, coords.posY, coords.posZ, stack, block, meta); + BlockPos coords = swap.get(world.rand.nextInt(swap.size())); + boolean exchange = exchange(world, player, coords, stack, block.getStateFromMeta(meta)); if(exchange) ManaItemHandler.requestManaExactForTool(stack, player, COST, true); else ItemNBTHelper.setBoolean(stack, TAG_SWAPPING, false); } } - public List getBlocksToSwap(World world, ItemStack stack, Block blockToSwap, int metaToSwap, int xc, int yc, int zc, Block targetBlock, int targetMeta) { + public List getBlocksToSwap(World world, ItemStack stack, IBlockState swapState, BlockPos pos, IBlockState targetState) { // If we have no target block passed in, infer it to be // the block which the swapping is centered on (presumably the block // which the player is looking at) - if(targetBlock == null) { - targetBlock = world.getBlock(xc, yc, zc); - targetMeta = world.getBlockMetadata(xc, yc, zc); + if(targetState == null) { + targetState = world.getBlockState(pos); } // Our result list - List coordsList = new ArrayList(); + List coordsList = new ArrayList<>(); // We subtract 1 from the effective range as the center tile is included // So, with a range of 3, we are visiting tiles at -2, -1, 0, 1, 2 @@ -175,34 +175,33 @@ public class ItemExchangeRod extends ItemMod implements IManaUsingItem, IWirefra for(int offsetX = -effRange; offsetX <= effRange; offsetX++) for(int offsetY = -effRange; offsetY <= effRange; offsetY++) for(int offsetZ = -effRange; offsetZ <= effRange; offsetZ++) { - int x = xc + offsetX, y = yc + offsetY, z = zc + offsetZ; - - Block currentBlock = world.getBlock(x, y, z); - int currentMeta = world.getBlockMetadata(x, y, z); + BlockPos pos_ = pos.add(offsetX, offsetY, offsetZ); + + IBlockState currentState = world.getBlockState(pos_); // If this block is not our target, ignore it, as we don't need // to consider replacing it - if(currentBlock != targetBlock || currentMeta != targetMeta) + if(currentState != targetState) continue; // If this block is already the block we're swapping to, // we don't need to swap again - if(currentBlock == blockToSwap && currentMeta == metaToSwap) + if(currentState == swapState) continue; // Check to see if the block is visible on any side: - for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { - int adjX = x + dir.offsetX, adjY = y + dir.offsetY, adjZ = z + dir.offsetZ; - Block adjBlock = world.getBlock(adjX, adjY, adjZ); - + for(EnumFacing dir : EnumFacing.VALUES) { + BlockPos adjPos = pos_.offset(dir); + IBlockState adjState = world.getBlockState(adjPos); + // If the side of the adjacent block facing this block is // _not_ solid, then this block is considered "visible" // and should be replaced. // If there is a rendering-specific way to check for this, // that should be placed in preference to this. - if(!adjBlock.isSideSolid(world, adjX, adjY, adjZ, dir.getOpposite())) { - coordsList.add(new ChunkCoordinates(x, y, z)); + if(!adjState.isSideSolid(world, adjPos, dir.getOpposite())) { + coordsList.add(pos_); break; } } @@ -211,26 +210,26 @@ public class ItemExchangeRod extends ItemMod implements IManaUsingItem, IWirefra return coordsList; } - public boolean exchange(World world, EntityPlayer player, int x, int y, int z, ItemStack stack, Block blockToSet, int metaToSet) { - TileEntity tile = world.getTileEntity(x, y, z); + public boolean exchange(World world, EntityPlayer player, BlockPos pos, ItemStack stack, IBlockState state) { + TileEntity tile = world.getTileEntity(pos); if(tile != null) return false; - ItemStack placeStack = removeFromInventory(player, stack, blockToSet, metaToSet, false); + ItemStack placeStack = removeFromInventory(player, stack, state.getBlock(), state.getBlock().getMetaFromState(state), false); if(placeStack != null) { - Block blockAt = world.getBlock(x, y, z); - int meta = world.getBlockMetadata(x, y, z); - if(!blockAt.isAir(world, x, y, z) && blockAt.getPlayerRelativeBlockHardness(player, world, x, y, z) > 0 && (blockAt != blockToSet || meta != metaToSet)) { + IBlockState stateAt = world.getBlockState(pos); + Block blockAt = stateAt.getBlock(); + if(!blockAt.isAir(world.getBlockState(pos), world, pos) && stateAt.getPlayerRelativeBlockHardness(player, world, pos) > 0 && stateAt != state) { if(!world.isRemote) { if(!player.capabilities.isCreativeMode) { - List drops = blockAt.getDrops(world, x, y, z, meta, 0); + List drops = blockAt.getDrops(world, pos, stateAt, 0); for(ItemStack drop : drops) - world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, drop)); - removeFromInventory(player, stack, blockToSet, metaToSet, true); + world.spawnEntityInWorld(new EntityItem(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, drop)); + removeFromInventory(player, stack, state.getBlock(), state.getBlock().getMetaFromState(state), true); } - world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(blockAt) + (meta << 12)); - world.setBlock(x, y, z, blockToSet, metaToSet, 1 | 2); - blockToSet.onBlockPlacedBy(world, x, y, z, player, placeStack); + world.playEvent(2001, pos, Block.getStateId(state)); + world.setBlockState(pos, state, 1 | 2); + state.getBlock().onBlockPlacedBy(world, pos, state, player, placeStack); } displayRemainderCounter(player, stack); return true; @@ -242,11 +241,11 @@ public class ItemExchangeRod extends ItemMod implements IManaUsingItem, IWirefra public boolean canExchange(ItemStack stack) { Block block = getBlock(stack); - return block != null && block != Blocks.air; + return block != null && block != Blocks.AIR; } public static ItemStack removeFromInventory(EntityPlayer player, IInventory inv, ItemStack stack, Block block, int meta, boolean doit) { - List providers = new ArrayList(); + List providers = new ArrayList<>(); for(int i = inv.getSizeInventory() - 1; i >= 0; i--) { ItemStack invStack = inv.getStackInSlot(i); if(invStack == null) @@ -333,27 +332,23 @@ public class ItemExchangeRod extends ItemMod implements IManaUsingItem, IWirefra ItemsRemainingRenderHandler.set(new ItemStack(block, 1, meta), count); } - @Override - public boolean isFull3D() { - return true; - } - @Override public boolean usesMana(ItemStack stack) { return true; } private boolean setBlock(ItemStack stack, Block block, int meta) { - ItemNBTHelper.setString(stack, TAG_BLOCK_NAME, Block.blockRegistry.getNameForObject(block)); + ItemNBTHelper.setString(stack, TAG_BLOCK_NAME, Block.REGISTRY.getNameForObject(block).toString()); ItemNBTHelper.setInt(stack, TAG_BLOCK_META, meta); return true; } + @Nonnull @Override - public String getItemStackDisplayName(ItemStack par1ItemStack) { + public String getItemStackDisplayName(@Nonnull ItemStack par1ItemStack) { Block block = getBlock(par1ItemStack); int meta = getBlockMeta(par1ItemStack); - return super.getItemStackDisplayName(par1ItemStack) + (block == null ? "" : " (" + EnumChatFormatting.GREEN + new ItemStack(block, 1, meta).getDisplayName() + EnumChatFormatting.RESET + ")"); + return super.getItemStackDisplayName(par1ItemStack) + (block == null ? "" : " (" + TextFormatting.GREEN + new ItemStack(block, 1, meta).getDisplayName() + TextFormatting.RESET + ")"); } public static String getBlockName(ItemStack stack) { @@ -369,10 +364,9 @@ public class ItemExchangeRod extends ItemMod implements IManaUsingItem, IWirefra return ItemNBTHelper.getInt(stack, TAG_BLOCK_META, 0); } - private boolean setTargetBlock(ItemStack stack, Block block, int meta) { - ItemNBTHelper.setString(stack, TAG_TARGET_BLOCK_NAME, Block.blockRegistry.getNameForObject(block)); + private void setTargetBlock(ItemStack stack, Block block, int meta) { + ItemNBTHelper.setString(stack, TAG_TARGET_BLOCK_NAME, Block.REGISTRY.getNameForObject(block).toString()); ItemNBTHelper.setInt(stack, TAG_TARGET_BLOCK_META, meta); - return true; } public static String getTargetBlockName(ItemStack stack) { @@ -390,33 +384,33 @@ public class ItemExchangeRod extends ItemMod implements IManaUsingItem, IWirefra @Override @SideOnly(Side.CLIENT) - public List getWireframesToDraw(EntityPlayer player, ItemStack stack) { - ItemStack holding = player.getCurrentEquippedItem(); + public List getWireframesToDraw(EntityPlayer player, ItemStack stack) { + ItemStack holding = player.getHeldItemMainhand(); if(holding != stack || !canExchange(stack)) - return null; + return ImmutableList.of(); Block block = getBlock(stack); int meta = getBlockMeta(stack); - MovingObjectPosition pos = Minecraft.getMinecraft().objectMouseOver; - if(pos != null) { - int x = pos.blockX; - int y = pos.blockY; - int z = pos.blockZ; + RayTraceResult pos = Minecraft.getMinecraft().objectMouseOver; + if(pos != null && pos.getBlockPos() != null) { + BlockPos bPos = pos.getBlockPos(); Block targetBlock = null; int targetMeta = 0; if(ItemNBTHelper.getBoolean(stack, TAG_SWAPPING, false)) { - x = ItemNBTHelper.getInt(stack, TAG_SELECT_X, 0); - y = ItemNBTHelper.getInt(stack, TAG_SELECT_Y, 0); - z = ItemNBTHelper.getInt(stack, TAG_SELECT_Z, 0); + bPos = new BlockPos( + ItemNBTHelper.getInt(stack, TAG_SELECT_X, 0), + ItemNBTHelper.getInt(stack, TAG_SELECT_Y, 0), + ItemNBTHelper.getInt(stack, TAG_SELECT_Z, 0) + ); targetBlock = getTargetBlock(stack); targetMeta = getTargetBlockMeta(stack); } - if(!player.worldObj.isAirBlock(x, y, z)) { - List coordsList = getBlocksToSwap(player.worldObj, stack, block, meta, x, y, z, targetBlock, targetMeta); - for(ChunkCoordinates coords : coordsList) - if(coords.posX == x && coords.posY == y && coords.posZ == z) { + if(!player.worldObj.isAirBlock(bPos)) { + List coordsList = getBlocksToSwap(player.worldObj, stack, block.getStateFromMeta(meta), bPos, targetBlock == null ? null : targetBlock.getStateFromMeta(targetMeta)); + for(BlockPos coords : coordsList) + if(coords.equals(bPos)) { coordsList.remove(coords); break; } @@ -424,6 +418,11 @@ public class ItemExchangeRod extends ItemMod implements IManaUsingItem, IWirefra } } + return ImmutableList.of(); + } + + @Override + public BlockPos getSourceWireframe(EntityPlayer player, ItemStack stack) { return null; } diff --git a/src/main/java/vazkii/botania/common/item/rod/ItemFireRod.java b/src/main/java/vazkii/botania/common/item/rod/ItemFireRod.java index 32f3b0ffd..093aacdc3 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemFireRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemFireRod.java @@ -12,9 +12,15 @@ package vazkii.botania.common.item.rod; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.SoundEvents; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import vazkii.botania.api.item.IAvatarTile; import vazkii.botania.api.item.IAvatarWieldable; @@ -26,6 +32,8 @@ import vazkii.botania.common.entity.EntityFlameRing; import vazkii.botania.common.item.ItemMod; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; + public class ItemFireRod extends ItemMod implements IManaUsingItem, IAvatarWieldable { private static final ResourceLocation avatarOverlay = new ResourceLocation(LibResources.MODEL_AVATAR_FIRE); @@ -34,35 +42,32 @@ public class ItemFireRod extends ItemMod implements IManaUsingItem, IAvatarWield private static final int COOLDOWN = 1200; public ItemFireRod() { - setUnlocalizedName(LibItemNames.FIRE_ROD); + super(LibItemNames.FIRE_ROD); setMaxStackSize(1); - setMaxDamage(COOLDOWN); } + @Nonnull @Override - public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer player, World par3World, int x, int y, int z, int par7, float par8, float par9, float par10) { - if(!par3World.isRemote && par1ItemStack.getItemDamage() == 0 && ManaItemHandler.requestManaExactForTool(par1ItemStack, player, COST, false)) { + public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) { + if(!world.isRemote && ManaItemHandler.requestManaExactForTool(par1ItemStack, player, COST, false)) { EntityFlameRing entity = new EntityFlameRing(player.worldObj); - entity.setPosition(x + 0.5, y + 1, z + 0.5); + entity.setPosition(pos.getX() + 0.5, pos.getY() + 1, pos.getZ() + 0.5); player.worldObj.spawnEntityInWorld(entity); - par1ItemStack.setItemDamage(COOLDOWN); + player.getCooldownTracker().setCooldown(this, IManaProficiencyArmor.Helper.hasProficiency(player) ? COOLDOWN / 2 : COOLDOWN); + ManaItemHandler.requestManaExactForTool(par1ItemStack, player, COST, true); - par3World.playSoundAtEntity(player, "mob.blaze.breathe", 1F, 1F); + world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_BLAZE_AMBIENT, SoundCategory.PLAYERS, 1F, 1F); } - return true; + return EnumActionResult.SUCCESS; } @Override - public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) { - if(par1ItemStack.isItemDamaged() && par3Entity instanceof EntityPlayer) - par1ItemStack.setItemDamage(par1ItemStack.getItemDamage() - (IManaProficiencyArmor.Helper.hasProficiency((EntityPlayer) par3Entity) ? 2 : 1)); - } - - @Override - public boolean isFull3D() { - return true; + public void onUpdate(ItemStack par1ItemStack, World world, Entity par3Entity, int par4, boolean par5) { + // Keep for backward compat + if(par1ItemStack.getItemDamage() > 0) + par1ItemStack.setItemDamage(0); } @Override @@ -73,11 +78,11 @@ public class ItemFireRod extends ItemMod implements IManaUsingItem, IAvatarWield @Override public void onAvatarUpdate(IAvatarTile tile, ItemStack stack) { TileEntity te = (TileEntity) tile; - World world = te.getWorldObj(); + World world = te.getWorld(); if(!world.isRemote && tile.getCurrentMana() >= COST && tile.getElapsedFunctionalTicks() % 300 == 0 && tile.isEnabled()) { EntityFlameRing entity = new EntityFlameRing(world); - entity.setPosition(te.xCoord + 0.5, te.yCoord, te.zCoord + 0.5); + entity.setPosition(te.getPos().getX() + 0.5, te.getPos().getY(), te.getPos().getZ() + 0.5); world.spawnEntityInWorld(entity); tile.recieveMana(-COST); } diff --git a/src/main/java/vazkii/botania/common/item/rod/ItemGravityRod.java b/src/main/java/vazkii/botania/common/item/rod/ItemGravityRod.java index 08e2b8f13..730f39adb 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemGravityRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemGravityRod.java @@ -10,17 +10,17 @@ */ package vazkii.botania.common.item.rod; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.MobEffects; import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.world.World; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.item.IManaProficiencyArmor; @@ -28,12 +28,17 @@ import vazkii.botania.api.mana.IManaUsingItem; import vazkii.botania.api.mana.ManaItemHandler; import vazkii.botania.common.Botania; import vazkii.botania.common.core.helper.ItemNBTHelper; +import vazkii.botania.common.core.helper.MathHelper; import vazkii.botania.common.core.helper.Vector3; import vazkii.botania.common.entity.EntityThrownItem; import vazkii.botania.common.item.ItemMod; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.List; + public class ItemGravityRod extends ItemMod implements IManaUsingItem { private static final float RANGE = 3F; @@ -45,12 +50,17 @@ public class ItemGravityRod extends ItemMod implements IManaUsingItem { private static final String TAG_DIST = "dist"; public ItemGravityRod() { + super(LibItemNames.GRAVITY_ROD); setMaxStackSize(1); - setUnlocalizedName(LibItemNames.GRAVITY_ROD); } @Override - public void onUpdate(ItemStack stack, World world, Entity par3Entity, int p_77663_4_, boolean p_77663_5_) { + public boolean shouldCauseReequipAnimation(ItemStack oldStack, @Nonnull ItemStack newStack, boolean slotChanged) { + return newStack.getItem() != this; + } + + @Override + public void onUpdate(ItemStack stack, World world, Entity par3Entity, int slot, boolean held) { if(!(par3Entity instanceof EntityPlayer)) return; @@ -70,14 +80,15 @@ public class ItemGravityRod extends ItemMod implements IManaUsingItem { ItemNBTHelper.setInt(stack, TAG_TICKS_COOLDOWN, ticksCooldown); EntityPlayer player = (EntityPlayer) par3Entity; - PotionEffect haste = player.getActivePotionEffect(Potion.digSpeed); + PotionEffect haste = player.getActivePotionEffect(MobEffects.HASTE); float check = haste == null ? 0.16666667F : haste.getAmplifier() == 1 ? 0.5F : 0.4F; - if(player.getCurrentEquippedItem() == stack && player.swingProgress == check && !world.isRemote) + if(player.getHeldItemMainhand() == stack && player.swingProgress == check && !world.isRemote) leftClick(player); } + @Nonnull @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { + public ActionResult onItemRightClick(@Nonnull ItemStack stack, World world, EntityPlayer player, EnumHand hand) { int targetID = ItemNBTHelper.getInt(stack, TAG_TARGET, -1); int ticksCooldown = ItemNBTHelper.getInt(stack, TAG_TICKS_COOLDOWN, 0); double length = ItemNBTHelper.getDouble(stack, TAG_DIST, -1); @@ -89,13 +100,11 @@ public class ItemGravityRod extends ItemMod implements IManaUsingItem { boolean found = false; Vector3 target = Vector3.fromEntityCenter(player); - List entities = new ArrayList(); + List entities = new ArrayList<>(); int distance = 1; while(entities.size() == 0 && distance < 25) { - target.add(new Vector3(player.getLookVec()).multiply(distance)); - - target.y += 0.5; - entities = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, AxisAlignedBB.getBoundingBox(target.x - RANGE, target.y - RANGE, target.z - RANGE, target.x + RANGE, target.y + RANGE, target.z + RANGE)); + target = target.add(new Vector3(player.getLookVec()).multiply(distance)).add(0, 0.5, 0); + entities = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, new AxisAlignedBB(target.x - RANGE, target.y - RANGE, target.z - RANGE, target.x + RANGE, target.y + RANGE, target.z + RANGE)); distance++; if(entities.contains(taritem)) found = true; @@ -107,13 +116,11 @@ public class ItemGravityRod extends ItemMod implements IManaUsingItem { if(item == null) { Vector3 target = Vector3.fromEntityCenter(player); - List entities = new ArrayList(); + List entities = new ArrayList<>(); int distance = 1; while(entities.size() == 0 && distance < 25) { - target.add(new Vector3(player.getLookVec()).multiply(distance)); - - target.y += 0.5; - entities = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, AxisAlignedBB.getBoundingBox(target.x - RANGE, target.y - RANGE, target.z - RANGE, target.x + RANGE, target.y + RANGE, target.z + RANGE)); + target = target.add(new Vector3(player.getLookVec()).multiply(distance)).add(0, 0.5, 0); + entities = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, new AxisAlignedBB(target.x - RANGE, target.y - RANGE, target.z - RANGE, target.x + RANGE, target.y + RANGE, target.z + RANGE)); distance++; } @@ -127,24 +134,23 @@ public class ItemGravityRod extends ItemMod implements IManaUsingItem { if(item != null) { if(BotaniaAPI.isEntityBlacklistedFromGravityRod(item.getClass())) - return stack; + return ActionResult.newResult(EnumActionResult.FAIL, stack); if(ManaItemHandler.requestManaExactForTool(stack, player, COST, true)) { if(item instanceof EntityItem) - ((EntityItem)item).delayBeforeCanPickup = 5; + ((EntityItem) item).setPickupDelay(5); if(item instanceof EntityLivingBase) { EntityLivingBase targetEntity = (EntityLivingBase)item; targetEntity.fallDistance = 0.0F; - if(targetEntity.getActivePotionEffect(Potion.moveSlowdown) == null) - targetEntity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 2, 3, true)); + if(targetEntity.getActivePotionEffect(MobEffects.SLOWNESS) == null) + targetEntity.addPotionEffect(new PotionEffect(MobEffects.SLOWNESS, 2, 3, true, true)); } - Vector3 target3 = Vector3.fromEntityCenter(player); - target3.add(new Vector3(player.getLookVec()).multiply(length)); - target3.y += 0.5; + Vector3 target3 = Vector3.fromEntityCenter(player) + .add(new Vector3(player.getLookVec()).multiply(length)).add(0, 0.5, 0); if(item instanceof EntityItem) - target3.y += 0.25; + target3 = target3.add(0, 0.25, 0); for(int i = 0; i < 4; i++) { float r = 0.5F + (float) Math.random() * 0.5F; @@ -154,32 +160,20 @@ public class ItemGravityRod extends ItemMod implements IManaUsingItem { float xm = ((float) Math.random() - 0.5F) * m; float ym = ((float) Math.random() - 0.5F) * m; float zm = ((float) Math.random() - 0.5F) * m; - Botania.proxy.wispFX(world, item.posX + item.width / 2, item.posY + item.height / 2, item.posZ + item.width / 2, r, 0F, b, s, xm, ym, zm); + Botania.proxy.wispFX(item.posX + item.width / 2, item.posY + item.height / 2, item.posZ + item.width / 2, r, 0F, b, s, xm, ym, zm); } - setEntityMotionFromVector(item, target3, 0.3333333F); + MathHelper.setEntityMotionFromVector(item, target3, 0.3333333F); ItemNBTHelper.setInt(stack, TAG_TARGET, item.getEntityId()); ItemNBTHelper.setDouble(stack, TAG_DIST, length); } - } - if(item != null) ItemNBTHelper.setInt(stack, TAG_TICKS_TILL_EXPIRE, 5); + return ActionResult.newResult(EnumActionResult.SUCCESS, stack); + } } - return stack; - } - - public static void setEntityMotionFromVector(Entity entity, Vector3 originalPosVector, float modifier) { - Vector3 entityVector = Vector3.fromEntityCenter(entity); - Vector3 finalVector = originalPosVector.copy().subtract(entityVector); - - if(finalVector.mag() > 1) - finalVector.normalize(); - - entity.motionX = finalVector.x * modifier; - entity.motionY = finalVector.y * modifier; - entity.motionZ = finalVector.z * modifier; + return ActionResult.newResult(EnumActionResult.PASS, stack); } @Override @@ -188,24 +182,22 @@ public class ItemGravityRod extends ItemMod implements IManaUsingItem { } public static void leftClick(EntityPlayer player) { - ItemStack stack = player.getHeldItem(); + ItemStack stack = player.getHeldItemMainhand(); if(stack != null && stack.getItem() == ModItems.gravityRod) { int targetID = ItemNBTHelper.getInt(stack, TAG_TARGET, -1); ItemNBTHelper.getDouble(stack, TAG_DIST, -1); - Entity item = null; + Entity item; if(targetID != -1 && player.worldObj.getEntityByID(targetID) != null) { Entity taritem = player.worldObj.getEntityByID(targetID); boolean found = false; Vector3 target = Vector3.fromEntityCenter(player); - List entities = new ArrayList(); + List entities = new ArrayList<>(); int distance = 1; while(entities.size() == 0 && distance < 25) { - target.add(new Vector3(player.getLookVec()).multiply(distance)); - - target.y += 0.5; - entities = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, AxisAlignedBB.getBoundingBox(target.x - RANGE, target.y - RANGE, target.z - RANGE, target.x + RANGE, target.y + RANGE, target.z + RANGE)); + target = target.add(new Vector3(player.getLookVec()).multiply(distance)).add(0, 0.5, 0); + entities = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, new AxisAlignedBB(target.x - RANGE, target.y - RANGE, target.z - RANGE, target.x + RANGE, target.y + RANGE, target.z + RANGE)); distance++; if(entities.contains(taritem)) found = true; @@ -217,7 +209,7 @@ public class ItemGravityRod extends ItemMod implements IManaUsingItem { ItemNBTHelper.setDouble(stack, TAG_DIST, -1); Vector3 moveVector = new Vector3(player.getLookVec().normalize()); if(item instanceof EntityItem) { - ((EntityItem)item).delayBeforeCanPickup = 20; + ((EntityItem) item).setPickupDelay(20); float mot = IManaProficiencyArmor.Helper.hasProficiency(player) ? 2.25F : 1.5F; item.motionX = moveVector.x * mot; item.motionY = moveVector.y; diff --git a/src/main/java/vazkii/botania/common/item/rod/ItemMissileRod.java b/src/main/java/vazkii/botania/common/item/rod/ItemMissileRod.java index fd694ffda..d28642129 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemMissileRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemMissileRod.java @@ -15,6 +15,9 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumAction; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import vazkii.botania.api.item.IAvatarTile; @@ -22,12 +25,15 @@ import vazkii.botania.api.item.IAvatarWieldable; import vazkii.botania.api.item.IManaProficiencyArmor; import vazkii.botania.api.mana.IManaUsingItem; import vazkii.botania.api.mana.ManaItemHandler; +import vazkii.botania.api.sound.BotaniaSoundEvents; import vazkii.botania.client.lib.LibResources; import vazkii.botania.common.Botania; import vazkii.botania.common.entity.EntityMagicMissile; import vazkii.botania.common.item.ItemMod; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; + public class ItemMissileRod extends ItemMod implements IManaUsingItem, IAvatarWieldable { private static final ResourceLocation avatarOverlay = new ResourceLocation(LibResources.MODEL_AVATAR_MISSILE); @@ -36,14 +42,14 @@ public class ItemMissileRod extends ItemMod implements IManaUsingItem, IAvatarWi private static final int COST_AVATAR = 40; public ItemMissileRod() { - super(); + super(LibItemNames.MISSILE_ROD); setMaxStackSize(1); - setUnlocalizedName(LibItemNames.MISSILE_ROD); } + @Nonnull @Override public EnumAction getItemUseAction(ItemStack par1ItemStack) { - return EnumAction.bow; + return EnumAction.BOW; } @Override @@ -52,12 +58,15 @@ public class ItemMissileRod extends ItemMod implements IManaUsingItem, IAvatarWi } @Override - public void onUsingTick(ItemStack stack, EntityPlayer player, int count) { + public void onUsingTick(ItemStack stack, EntityLivingBase living, int count) { + if(!(living instanceof EntityPlayer)) return; + EntityPlayer player = ((EntityPlayer) living); + if(count != getMaxItemUseDuration(stack) && count % (IManaProficiencyArmor.Helper.hasProficiency(player) ? 1 : 2) == 0 && !player.worldObj.isRemote && ManaItemHandler.requestManaExactForTool(stack, player, COST_PER, false)) { if(spawnMissile(player.worldObj, player, player.posX + (Math.random() - 0.5 * 0.1), player.posY + 2.4 + (Math.random() - 0.5 * 0.1), player.posZ + (Math.random() - 0.5 * 0.1))) ManaItemHandler.requestManaExactForTool(stack, player, COST_PER, true); - Botania.proxy.sparkleFX(player.worldObj, player.posX, player.posY + 2.4, player.posZ, 1F, 0.4F, 1F, 6F, 6); + Botania.proxy.sparkleFX(player.posX, player.posY + 2.4, player.posZ, 1F, 0.4F, 1F, 6F, 6); } } @@ -70,7 +79,7 @@ public class ItemMissileRod extends ItemMod implements IManaUsingItem, IAvatarWi missile.setPosition(x, y, z); if(missile.getTarget()) { if(!world.isRemote) { - world.playSoundEffect(x, y, z, "botania:missile", 0.6F, 0.8F + (float) Math.random() * 0.2F); + missile.playSound(BotaniaSoundEvents.missile, 0.6F, 0.8F + (float) Math.random() * 0.2F); world.spawnEntityInWorld(missile); } @@ -79,15 +88,11 @@ public class ItemMissileRod extends ItemMod implements IManaUsingItem, IAvatarWi return false; } + @Nonnull @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - par3EntityPlayer.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack)); - return par1ItemStack; - } - - @Override - public boolean isFull3D() { - return true; + public ActionResult onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) { + player.setActiveHand(hand); + return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack); } @Override @@ -98,12 +103,12 @@ public class ItemMissileRod extends ItemMod implements IManaUsingItem, IAvatarWi @Override public void onAvatarUpdate(IAvatarTile tile, ItemStack stack) { TileEntity te = (TileEntity) tile; - World world = te.getWorldObj(); + World world = te.getWorld(); if(tile.getCurrentMana() >= COST_AVATAR && tile.getElapsedFunctionalTicks() % 3 == 0 && tile.isEnabled()) - if(spawnMissile(world, null, te.xCoord + 0.5 + (Math.random() - 0.5 * 0.1), te.yCoord + 2.5 + (Math.random() - 0.5 * 0.1), te.zCoord + (Math.random() - 0.5 * 0.1))) { + if(spawnMissile(world, null, te.getPos().getX() + 0.5 + (Math.random() - 0.5 * 0.1), te.getPos().getY() + 2.5 + (Math.random() - 0.5 * 0.1), te.getPos().getZ() + (Math.random() - 0.5 * 0.1))) { if(!world.isRemote) tile.recieveMana(-COST_AVATAR); - Botania.proxy.sparkleFX(world, te.xCoord + 0.5, te.yCoord + 2.5, te.zCoord + 0.5, 1F, 0.4F, 1F, 6F, 6); + Botania.proxy.sparkleFX(te.getPos().getX() + 0.5, te.getPos().getY() + 2.5, te.getPos().getZ() + 0.5, 1F, 0.4F, 1F, 6F, 6); } } diff --git a/src/main/java/vazkii/botania/common/item/rod/ItemRainbowRod.java b/src/main/java/vazkii/botania/common/item/rod/ItemRainbowRod.java index 2c2ae87aa..babd13164 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemRainbowRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemRainbowRod.java @@ -10,23 +10,28 @@ */ package vazkii.botania.common.item.rod; -import java.util.List; - import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MathHelper; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.Vec3; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; import vazkii.botania.api.item.IAvatarTile; import vazkii.botania.api.item.IAvatarWieldable; import vazkii.botania.api.item.IManaProficiencyArmor; import vazkii.botania.api.mana.IManaUsingItem; import vazkii.botania.api.mana.ManaItemHandler; +import vazkii.botania.api.sound.BotaniaSoundEvents; +import vazkii.botania.api.state.BotaniaStateProps; import vazkii.botania.client.lib.LibResources; import vazkii.botania.common.Botania; import vazkii.botania.common.block.ModBlocks; @@ -35,6 +40,9 @@ import vazkii.botania.common.core.helper.Vector3; import vazkii.botania.common.item.ItemMod; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; +import java.util.List; + public class ItemRainbowRod extends ItemMod implements IManaUsingItem, IAvatarWieldable { private static final ResourceLocation avatarOverlay = new ResourceLocation(LibResources.MODEL_AVATAR_RAINBOW); @@ -44,68 +52,81 @@ public class ItemRainbowRod extends ItemMod implements IManaUsingItem, IAvatarWi private static final int TIME = 600; public ItemRainbowRod() { - setMaxDamage(TIME); - setUnlocalizedName(LibItemNames.RAINBOW_ROD); + super(LibItemNames.RAINBOW_ROD); setMaxStackSize(1); } + @Nonnull @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if(!par2World.isRemote && par1ItemStack.getItemDamage() == 0 && ManaItemHandler.requestManaExactForTool(par1ItemStack, par3EntityPlayer, MANA_COST, false)) { + public ActionResult onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) { + if(!world.isRemote && ManaItemHandler.requestManaExactForTool(par1ItemStack, player, MANA_COST, false)) { Block place = ModBlocks.bifrost; - Vector3 vector = new Vector3(par3EntityPlayer.getLookVec()).normalize(); + Vector3 vector = new Vector3(player.getLookVec()).normalize(); - double x = par3EntityPlayer.posX; - double y = par3EntityPlayer.posY; - double z = par3EntityPlayer.posZ; + double x = player.posX; + double y = player.posY; + double z = player.posZ; + BlockPos.MutableBlockPos pos = new BlockPos.MutableBlockPos((int) x, (int) y, (int) z); - double lx = 0; - double ly = -1; - double lz = 0; + double lastX = 0; + double lastY = -1; + double lastZ = 0; + BlockPos.MutableBlockPos lastChecker = new BlockPos.MutableBlockPos(); int count = 0; - boolean prof = IManaProficiencyArmor.Helper.hasProficiency(par3EntityPlayer); + boolean prof = IManaProficiencyArmor.Helper.hasProficiency(player); int maxlen = prof ? 160 : 100; int time = prof ? (int) (TIME * 1.6) : TIME; - while(count < maxlen && (int) lx == (int) x && (int) ly == (int) y && (int) lz == (int) z || count < 4 || par2World.getBlock((int) x, (int) y, (int) z).isAir(par2World, (int) x, (int) y, (int) z) || par2World.getBlock((int) x, (int) y, (int) z) == place) { - if(y >= 256 || y <= 0) - break; + BlockPos.MutableBlockPos placePos = new BlockPos.MutableBlockPos(); + while (count < maxlen) { + lastChecker.setPos(lastX, lastY, lastZ); - for(int i = -2; i < 1; i++) - for(int j = -2; j < 1; j++) - if(par2World.getBlock((int) x + i, (int) y, (int) z + j).isAir(par2World, (int) x + i, (int) y, (int) z + j) || par2World.getBlock((int) x + i, (int) y, (int) z + j) == place) { - par2World.setBlock((int) x + i, (int) y, (int) z + j, place); - TileBifrost tile = (TileBifrost) par2World.getTileEntity((int) x + i, (int) y, (int) z + j); - if(tile != null) { - for(int k = 0; k < 4; k++) - Botania.proxy.sparkleFX(par2World, tile.xCoord + Math.random(), tile.yCoord + Math.random(), tile.zCoord + Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), 0.45F + 0.2F * (float) Math.random(), 6); - tile.ticks = time; + if (!lastChecker.equals(pos)) { + if (y >= world.getHeight() || y <= 0 + || (!world.isAirBlock(pos) && world.getBlockState(pos).getBlock() != place)) + break; + + for(int i = -2; i < 1; i++) + for(int j = -2; j < 1; j++) { + placePos.setPos(pos.getX() + i, pos.getY(), pos.getZ() + j); + if(world.isAirBlock(placePos) + || world.getBlockState(placePos).getBlock() == place) { + world.setBlockState(placePos, place.getDefaultState()); + TileBifrost tile = (TileBifrost) world.getTileEntity(placePos); + if(tile != null) { + tile.ticks = time; + } } - } - lx = x; - ly = y; - lz = z; + } + count++; + } + + + lastX = x; + lastY = y; + lastZ = z; x += vector.x; y += vector.y; z += vector.z; - count++; + pos.setPos(x, y, z); } if(count > 0) { - par2World.playSoundAtEntity(par3EntityPlayer, "botania:bifrostRod", 0.5F, 0.25F); - ManaItemHandler.requestManaExactForTool(par1ItemStack, par3EntityPlayer, MANA_COST, false); - par1ItemStack.setItemDamage(TIME); + world.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.bifrostRod, SoundCategory.PLAYERS, 0.5F, 0.25F); + ManaItemHandler.requestManaExactForTool(par1ItemStack, player, MANA_COST, false); + player.getCooldownTracker().setCooldown(this, TIME); } } - return par1ItemStack; + return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack); } + @Nonnull @Override - public ItemStack getContainerItem(ItemStack itemStack) { + public ItemStack getContainerItem(@Nonnull ItemStack itemStack) { return itemStack.copy(); } @@ -115,19 +136,10 @@ public class ItemRainbowRod extends ItemMod implements IManaUsingItem, IAvatarWi } @Override - public boolean doesContainerItemLeaveCraftingGrid(ItemStack par1ItemStack) { - return false; - } - - @Override - public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) { - if(par1ItemStack.isItemDamaged()) - par1ItemStack.setItemDamage(par1ItemStack.getItemDamage() - 1); - } - - @Override - public boolean isFull3D() { - return true; + public void onUpdate(ItemStack par1ItemStack, World world, Entity par3Entity, int par4, boolean par5) { + // Kept for backward compat + if (par1ItemStack.getItemDamage() > 0) + par1ItemStack.setItemDamage(0); } @Override @@ -138,31 +150,29 @@ public class ItemRainbowRod extends ItemMod implements IManaUsingItem, IAvatarWi @Override public void onAvatarUpdate(IAvatarTile tile, ItemStack stack) { TileEntity te = (TileEntity) tile; - World world = te.getWorldObj(); + World world = te.getWorld(); if(world.isRemote || tile.getCurrentMana() < MANA_COST_AVATAR * 25 || !tile.isEnabled()) return; - int x = te.xCoord; - int y = te.yCoord; - int z = te.zCoord; + BlockPos tePos = te.getPos(); int w = 1; int h = 1; int l = 20; AxisAlignedBB axis = null; - switch(te.getBlockMetadata() - 2) { - case 0 : - axis = AxisAlignedBB.getBoundingBox(x - w, y - h, z - l, x + w + 1, y + h, z); + switch(world.getBlockState(tePos).getValue(BotaniaStateProps.CARDINALS)) { + case NORTH : + axis = new AxisAlignedBB(tePos.add(-w, -h, -l), tePos.add(w + 1, h, 0)); break; - case 1 : - axis = AxisAlignedBB.getBoundingBox(x - w, y - h, z + 1, x + w + 1, y + h, z + l + 1); + case SOUTH : + axis = new AxisAlignedBB(tePos.add(-w, -h, 1), tePos.add(w + 1, h, l + 1)); break; - case 2 : - axis = AxisAlignedBB.getBoundingBox(x - l, y - h, z - w, x, y + h, z + w + 1); + case WEST : + axis = new AxisAlignedBB(tePos.add(-l, -h, -w), tePos.add(0, h, w + 1)); break; - case 3 : - axis = AxisAlignedBB.getBoundingBox(x + 1, y - h, z - w, x + l + 1, y + h, z + w + 1); + case EAST : + axis = new AxisAlignedBB(tePos.add(1, -h, -w), tePos.add(l + 1, h, w + 1)); } List players = world.getEntitiesWithinAABB(EntityPlayer.class, axis); @@ -178,17 +188,17 @@ public class ItemRainbowRod extends ItemMod implements IManaUsingItem, IAvatarWi int ex = px + i - diff; int ez = pz + j - diff; - if(!axis.isVecInside(Vec3.createVectorHelper(ex + 0.5, py + 1, ez + 0.5))) + if(!axis.isVecInside(new Vec3d(ex + 0.5, py + 1, ez + 0.5))) continue; - - Block block = world.getBlock(ex, py, ez); - if(block.isAir(world, ex, py, ez)) { - world.setBlock(ex, py, ez, ModBlocks.bifrost); - TileBifrost tileBifrost = (TileBifrost) world.getTileEntity(ex, py, ez); + BlockPos pos = new BlockPos(ex, py, ez); + Block block = world.getBlockState(pos).getBlock(); + if(block.isAir(world.getBlockState(pos), world, pos)) { + world.setBlockState(pos, ModBlocks.bifrost.getDefaultState()); + TileBifrost tileBifrost = (TileBifrost) world.getTileEntity(pos); tileBifrost.ticks = 10; tile.recieveMana(-MANA_COST_AVATAR); } else if(block == ModBlocks.bifrost) { - TileBifrost tileBifrost = (TileBifrost) world.getTileEntity(ex, py, ez); + TileBifrost tileBifrost = (TileBifrost) world.getTileEntity(pos); if(tileBifrost.ticks < 2) { tileBifrost.ticks = 10; tile.recieveMana(-MANA_COST_AVATAR); diff --git a/src/main/java/vazkii/botania/common/item/rod/ItemSkyDirtRod.java b/src/main/java/vazkii/botania/common/item/rod/ItemSkyDirtRod.java index 81b390991..cdd5432f2 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemSkyDirtRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemSkyDirtRod.java @@ -14,48 +14,56 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MathHelper; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; import vazkii.botania.api.mana.ManaItemHandler; import vazkii.botania.common.Botania; import vazkii.botania.common.core.helper.Vector3; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; + public class ItemSkyDirtRod extends ItemDirtRod { public ItemSkyDirtRod() { super(LibItemNames.SKY_DIRT_ROD); } + @Nonnull @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { + public ActionResult onItemRightClick(@Nonnull ItemStack stack, World world, EntityPlayer player, EnumHand hand) { if(!world.isRemote && ManaItemHandler.requestManaExactForTool(stack, player, COST * 2, false)) { Vector3 playerVec = Vector3.fromEntityCenter(player); Vector3 lookVec = new Vector3(player.getLookVec()).multiply(3); - Vector3 placeVec = playerVec.copy().add(lookVec); + Vector3 placeVec = playerVec.add(lookVec); int x = MathHelper.floor_double(placeVec.x); int y = MathHelper.floor_double(placeVec.y) + 1; int z = MathHelper.floor_double(placeVec.z); - int entities = world.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1)).size(); + int entities = world.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(x, y, z, x + 1, y + 1, z + 1)).size(); if(entities == 0) { - ItemStack stackToPlace = new ItemStack(Blocks.dirt); - stackToPlace.tryPlaceItemIntoWorld(player, world, x, y, z, 0, 0F, 0F, 0F); + ItemStack stackToPlace = new ItemStack(Blocks.DIRT); + stackToPlace.onItemUse(player, world, new BlockPos(x, y, z), hand, EnumFacing.DOWN, 0F, 0F, 0F); if(stackToPlace.stackSize == 0) { ManaItemHandler.requestManaExactForTool(stack, player, COST * 2, true); for(int i = 0; i < 6; i++) - Botania.proxy.sparkleFX(world, x + Math.random(), y + Math.random(), z + Math.random(), 0.35F, 0.2F, 0.05F, 1F, 5); + Botania.proxy.sparkleFX(x + Math.random(), y + Math.random(), z + Math.random(), 0.35F, 0.2F, 0.05F, 1F, 5); } } } if(world.isRemote) - player.swingItem(); + player.swingArm(hand); - return stack; + return ActionResult.newResult(EnumActionResult.SUCCESS, stack); } } diff --git a/src/main/java/vazkii/botania/common/item/rod/ItemSmeltRod.java b/src/main/java/vazkii/botania/common/item/rod/ItemSmeltRod.java index 6a72d4671..d2863b97c 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemSmeltRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemSmeltRod.java @@ -10,16 +10,20 @@ */ package vazkii.botania.common.item.rod; -import java.util.Map; -import java.util.WeakHashMap; - import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.SoundEvents; import net.minecraft.item.EnumAction; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; import vazkii.botania.api.item.IManaProficiencyArmor; import vazkii.botania.api.mana.IManaUsingItem; @@ -29,22 +33,27 @@ import vazkii.botania.common.item.ItemMod; import vazkii.botania.common.item.equipment.tool.ToolCommons; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; +import java.util.Map; +import java.util.WeakHashMap; + public class ItemSmeltRod extends ItemMod implements IManaUsingItem { private static final int TIME = 10; private static final int COST = 300; private static final int COST_PER_TICK = COST / TIME; - public static Map playerData = new WeakHashMap(); + public static final Map playerData = new WeakHashMap<>(); public ItemSmeltRod() { - setUnlocalizedName(LibItemNames.SMELT_ROD); + super(LibItemNames.SMELT_ROD); setMaxStackSize(1); } + @Nonnull @Override public EnumAction getItemUseAction(ItemStack par1ItemStack) { - return EnumAction.bow; + return EnumAction.BOW; } @Override @@ -52,25 +61,28 @@ public class ItemSmeltRod extends ItemMod implements IManaUsingItem { return 72000; } + @Nonnull @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - par3EntityPlayer.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack)); - return par1ItemStack; + public ActionResult onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) { + player.setActiveHand(hand); + return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack); } @Override - public void onUsingTick(ItemStack stack, EntityPlayer p, int time) { + public void onUsingTick(ItemStack stack, EntityLivingBase living, int time) { + if(!(living instanceof EntityPlayer)) return; + EntityPlayer p = ((EntityPlayer) living); + if(!ManaItemHandler.requestManaExactForTool(stack, p, COST_PER_TICK, false)) return; - MovingObjectPosition pos = ToolCommons.raytraceFromEntity(p.worldObj, p, false, 32); + RayTraceResult pos = ToolCommons.raytraceFromEntity(p.worldObj, p, false, 32); - if(pos != null) { - Block block = p.worldObj.getBlock(pos.blockX, pos.blockY, pos.blockZ); - int meta = p.worldObj.getBlockMetadata(pos.blockX, pos.blockY, pos.blockZ); + if(pos != null && pos.getBlockPos() != null) { + IBlockState state = p.worldObj.getBlockState(pos.getBlockPos()); - ItemStack blockStack = new ItemStack(block, 1, meta); - ItemStack result = FurnaceRecipes.smelting().getSmeltingResult(blockStack); + ItemStack blockStack = new ItemStack(state.getBlock(), 1, state.getBlock().getMetaFromState(state)); + ItemStack result = FurnaceRecipes.instance().getSmeltingResult(blockStack); if(result != null && result.getItem() instanceof ItemBlock) { boolean decremented = false; @@ -83,21 +95,21 @@ public class ItemSmeltRod extends ItemMod implements IManaUsingItem { decremented = true; if(data.progress <= 0) { if(!p.worldObj.isRemote) { - p.worldObj.setBlock(pos.blockX, pos.blockY, pos.blockZ, Block.getBlockFromItem(result.getItem()), result.getItemDamage(), 1 | 2); - p.worldObj.playSoundAtEntity(p, "fire.ignite", 0.6F, 1F); - p.worldObj.playSoundAtEntity(p, "fire.fire", 1F, 1F); + p.worldObj.setBlockState(pos.getBlockPos(), Block.getBlockFromItem(result.getItem()).getStateFromMeta(result.getItemDamage()), 1 | 2); + p.worldObj.playSound(null, p.posX, p.posY, p.posZ, SoundEvents.ITEM_FLINTANDSTEEL_USE, SoundCategory.PLAYERS, 0.6F, 1F); + p.worldObj.playSound(null, p.posX, p.posY, p.posZ, SoundEvents.BLOCK_FIRE_AMBIENT, SoundCategory.PLAYERS, 1F, 1F); ManaItemHandler.requestManaExactForTool(stack, p, COST_PER_TICK, true); - playerData.remove(p.getGameProfile().getName()); + playerData.remove(p); decremented = false; } for(int i = 0; i < 25; i++) { - double x = pos.blockX + Math.random(); - double y = pos.blockY + Math.random(); - double z = pos.blockZ + Math.random(); + double x = pos.getBlockPos().getX() + Math.random(); + double y = pos.getBlockPos().getY() + Math.random(); + double z = pos.getBlockPos().getZ() + Math.random(); - Botania.proxy.wispFX(p.worldObj, x, y, z, 1F, 0.2F, 0.2F, 0.5F, (float) -Math.random() / 10F); + Botania.proxy.wispFX(x, y, z, 1F, 0.2F, 0.2F, 0.5F, (float) -Math.random() / 10F); } } } @@ -107,39 +119,34 @@ public class ItemSmeltRod extends ItemMod implements IManaUsingItem { playerData.put(p, new SmeltData(pos, IManaProficiencyArmor.Helper.hasProficiency(p) ? (int) (TIME * 0.6) : TIME)); else { for(int i = 0; i < 2; i++) { - double x = pos.blockX + Math.random(); - double y = pos.blockY + Math.random(); - double z = pos.blockZ + Math.random(); - Botania.proxy.wispFX(p.worldObj, x, y, z, 1F, 0.2F, 0.2F, 0.5F, (float) -Math.random() / 10F); + double x = pos.getBlockPos().getX() + Math.random(); + double y = pos.getBlockPos().getY() + Math.random(); + double z = pos.getBlockPos().getZ() + Math.random(); + Botania.proxy.wispFX(x, y, z, 1F, 0.2F, 0.2F, 0.5F, (float) -Math.random() / 10F); } if(time % 10 == 0) - p.worldObj.playSoundAtEntity(p, "fire.fire", (float) Math.random() / 2F + 0.5F, 1F); + p.worldObj.playSound(null, p.posX, p.posY, p.posZ, SoundEvents.BLOCK_FIRE_AMBIENT, SoundCategory.PLAYERS, (float) Math.random() / 2F + 0.5F, 1F); } } } } - @Override - public boolean isFull3D() { - return true; - } - @Override public boolean usesMana(ItemStack stack) { return true; } static class SmeltData { - public MovingObjectPosition pos; + public final RayTraceResult pos; public int progress; - public SmeltData(MovingObjectPosition pos, int progress) { + public SmeltData(RayTraceResult pos, int progress) { this.pos = pos; this.progress = progress; } - public boolean equalPos(MovingObjectPosition pos) { - return pos.blockX == this.pos.blockX && pos.blockY == this.pos.blockY && pos.blockZ == this.pos.blockZ; + public boolean equalPos(RayTraceResult pos) { + return pos.getBlockPos().equals(this.pos.getBlockPos()); } } } diff --git a/src/main/java/vazkii/botania/common/item/rod/ItemTerraformRod.java b/src/main/java/vazkii/botania/common/item/rod/ItemTerraformRod.java index c9e90d09d..0a907e424 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemTerraformRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemTerraformRod.java @@ -10,21 +10,26 @@ */ package vazkii.botania.common.item.rod; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - +import com.google.common.collect.ImmutableList; import net.minecraft.block.Block; import net.minecraft.block.BlockFlower; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; +import net.minecraft.init.SoundEvents; import net.minecraft.inventory.IInventory; import net.minecraft.item.EnumAction; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.stats.Achievement; -import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.oredict.OreDictionary; import vazkii.botania.api.item.IBlockProvider; import vazkii.botania.api.item.IManaProficiencyArmor; @@ -36,13 +41,16 @@ import vazkii.botania.common.achievement.ICraftAchievement; import vazkii.botania.common.achievement.ModAchievements; import vazkii.botania.common.item.ItemMod; import vazkii.botania.common.lib.LibItemNames; -import vazkii.botania.common.lib.LibMisc; + +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.List; public class ItemTerraformRod extends ItemMod implements IManaUsingItem, IBlockProvider, ICraftAchievement{ private static final int COST_PER = 55; - static final List validBlocks = Arrays.asList(new String[] { + private static final List validBlocks = ImmutableList.of( "stone", "dirt", "grass", @@ -53,29 +61,29 @@ public class ItemTerraformRod extends ItemMod implements IManaUsingItem, IBlockP "mycelium", "podzol", "sandstone", - - // Mod support "blockDiorite", "stoneDiorite", "blockGranite", "stoneGranite", "blockAndesite", "stoneAndesite", + + // Mod support "marble", "blockMarble", "limestone", "blockLimestone" - }); + ); public ItemTerraformRod() { - super(); + super(LibItemNames.TERRAFORM_ROD); setMaxStackSize(1); - setUnlocalizedName(LibItemNames.TERRAFORM_ROD); } + @Nonnull @Override public EnumAction getItemUseAction(ItemStack par1ItemStack) { - return EnumAction.bow; + return EnumAction.BOW; } @Override @@ -84,104 +92,81 @@ public class ItemTerraformRod extends ItemMod implements IManaUsingItem, IBlockP } @Override - public void onUsingTick(ItemStack stack, EntityPlayer player, int count) { - if(count != getMaxItemUseDuration(stack) && count % 10 == 0) - terraform(stack, player.worldObj, player); + public void onUsingTick(ItemStack stack, EntityLivingBase living, int count) { + if(count != getMaxItemUseDuration(stack) && count % 10 == 0 && living instanceof EntityPlayer) + terraform(stack, living.worldObj, ((EntityPlayer) living)); } + @Nonnull @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - par3EntityPlayer.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack)); - return par1ItemStack; + public ActionResult onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) { + player.setActiveHand(hand); + return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack); } - public void terraform(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - int range = IManaProficiencyArmor.Helper.hasProficiency(par3EntityPlayer) ? 22 : 16; + private void terraform(ItemStack par1ItemStack, World world, EntityPlayer player) { + int range = IManaProficiencyArmor.Helper.hasProficiency(player) ? 22 : 16; - int xCenter = (int) par3EntityPlayer.posX; - int yCenter = (int) par3EntityPlayer.posY - (par2World.isRemote ? 2 : 1); - int zCenter = (int) par3EntityPlayer.posZ; + BlockPos startCenter = new BlockPos(player).down(); - if(yCenter < 62) // Not below sea level + if(startCenter.getY() < world.getSeaLevel()) // Not below sea level return; - int yStart = yCenter + range; + List blocks = new ArrayList<>(); - List blocks = new ArrayList(); + for(BlockPos pos : BlockPos.getAllInBoxMutable(startCenter.add(-range, -range, -range), startCenter.add(range, range, range))) { + IBlockState state = world.getBlockState(pos); + if(state.getBlock() == Blocks.AIR) + continue; + else if(Item.getItemFromBlock(state.getBlock()) == null) + continue; + int[] ids = OreDictionary.getOreIDs(new ItemStack(state.getBlock(), 1, state.getBlock().getMetaFromState(state))); + for(int id : ids) + if(validBlocks.contains(OreDictionary.getOreName(id))) { + List airBlocks = new ArrayList<>(); - for(int i = -range; i < range + 1; i++) - for(int j = -range; j < range + 1; j++) { - int k = 0; - while(true) { - if(yStart + k < 0) - break; - - int x = xCenter + i; - int y = yStart + k; - int z = zCenter + j; - - Block block = par2World.getBlock(x, y, z); - int meta = par2World.getBlockMetadata(x, y, z); - - int[] ids = OreDictionary.getOreIDs(new ItemStack(block, 1, meta)); - for(int id : ids) - if(validBlocks.contains(OreDictionary.getOreName(id))) { - boolean hasAir = false; - List airBlocks = new ArrayList(); - - for(ForgeDirection dir : LibMisc.CARDINAL_DIRECTIONS) { - int x_ = x + dir.offsetX; - int y_ = y + dir.offsetY; - int z_ = z + dir.offsetZ; - - Block block_ = par2World.getBlock(x_, y_, z_); - if(block_.isAir(par2World, x_, y_, z_) || block_.isReplaceable(par2World, x_, y_, z_) || block_ instanceof BlockFlower && !(block_ instanceof ISpecialFlower) || block_ == Blocks.double_plant) { - airBlocks.add(new ChunkCoordinates(x_, y_, z_)); - hasAir = true; - } - } - - if(hasAir) { - if(y > yCenter) - blocks.add(new CoordsWithBlock(x, y, z, Blocks.air)); - else for(ChunkCoordinates coords : airBlocks) { - if(par2World.getBlock(coords.posX, coords.posY - 1, coords.posZ) != Blocks.air) - blocks.add(new CoordsWithBlock(coords.posX, coords.posY, coords.posZ, Blocks.dirt)); - } - } - break; + for(EnumFacing dir : EnumFacing.HORIZONTALS) { + BlockPos pos_ = pos.offset(dir); + Block block_ = world.getBlockState(pos_).getBlock(); + if(block_.isAir(world.getBlockState(pos_), world, pos_) || block_.isReplaceable(world, pos_) || block_ instanceof BlockFlower && !(block_ instanceof ISpecialFlower) || block_ == Blocks.DOUBLE_PLANT) { + airBlocks.add(pos_); } - --k; + } + + if(!airBlocks.isEmpty()) { + if(pos.getY() > startCenter.getY()) + blocks.add(new CoordsWithBlock(pos, Blocks.AIR)); + else for(BlockPos coords : airBlocks) { + if(world.getBlockState(coords.down()).getBlock() != Blocks.AIR) + blocks.add(new CoordsWithBlock(coords, Blocks.DIRT)); + } + } + break; } - } + } int cost = COST_PER * blocks.size(); - if(par2World.isRemote || ManaItemHandler.requestManaExactForTool(par1ItemStack, par3EntityPlayer, cost, true)) { - if(!par2World.isRemote) + if(world.isRemote || ManaItemHandler.requestManaExactForTool(par1ItemStack, player, cost, true)) { + if(!world.isRemote) for(CoordsWithBlock block : blocks) - par2World.setBlock(block.posX, block.posY, block.posZ, block.block); + world.setBlockState(block, block.block.getDefaultState()); if(!blocks.isEmpty()) { for(int i = 0; i < 10; i++) - par2World.playSoundAtEntity(par3EntityPlayer, "step.sand", 1F, 0.4F); + world.playSound(player, player.posX, player.posY, player.posZ, SoundEvents.BLOCK_SAND_STEP, SoundCategory.BLOCKS, 1F, 0.4F); for(int i = 0; i < 120; i++) - Botania.proxy.sparkleFX(par2World, xCenter - range + range * 2 * Math.random(), yCenter + 2 + (Math.random() - 0.5) * 2, zCenter - range + range * 2 * Math.random(), 0.35F, 0.2F, 0.05F, 2F, 5); + Botania.proxy.sparkleFX(startCenter.getX() - range + range * 2 * Math.random(), startCenter.getY() + 2 + (Math.random() - 0.5) * 2, startCenter.getZ() - range + range * 2 * Math.random(), 0.35F, 0.2F, 0.05F, 2F, 5); } } } - @Override - public boolean isFull3D() { - return true; - } + private static class CoordsWithBlock extends BlockPos { - class CoordsWithBlock extends ChunkCoordinates { + private final Block block; - final Block block; - - public CoordsWithBlock(int x, int y, int z, Block block) { - super(x, y, z); + private CoordsWithBlock(BlockPos pos, Block block) { + super(pos.getX(), pos.getY(), pos.getZ()); this.block = block; } @@ -194,14 +179,14 @@ public class ItemTerraformRod extends ItemMod implements IManaUsingItem, IBlockP @Override public boolean provideBlock(EntityPlayer player, ItemStack requestor, ItemStack stack, Block block, int meta, boolean doit) { - if(block == Blocks.dirt && meta == 0) + if(block == Blocks.DIRT && meta == 0) return !doit || ManaItemHandler.requestManaExactForTool(requestor, player, ItemDirtRod.COST, true); return false; } @Override public int getBlockCount(EntityPlayer player, ItemStack requestor, ItemStack stack, Block block, int meta) { - if(block == Blocks.dirt && meta == 0) + if(block == Blocks.DIRT && meta == 0) return -1; return 0; } diff --git a/src/main/java/vazkii/botania/common/item/rod/ItemTornadoRod.java b/src/main/java/vazkii/botania/common/item/rod/ItemTornadoRod.java index 35df27b53..e82460907 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemTornadoRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemTornadoRod.java @@ -10,25 +10,25 @@ */ package vazkii.botania.common.item.rod; -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumAction; import net.minecraft.item.ItemStack; import net.minecraft.potion.PotionEffect; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.IIcon; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.world.World; import vazkii.botania.api.item.IAvatarTile; import vazkii.botania.api.item.IAvatarWieldable; import vazkii.botania.api.item.IManaProficiencyArmor; import vazkii.botania.api.mana.IManaUsingItem; import vazkii.botania.api.mana.ManaItemHandler; -import vazkii.botania.client.core.helper.IconHelper; +import vazkii.botania.api.sound.BotaniaSoundEvents; import vazkii.botania.client.lib.LibResources; import vazkii.botania.common.Botania; import vazkii.botania.common.brew.ModPotions; @@ -36,6 +36,9 @@ import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.item.ItemMod; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; +import java.util.List; + public class ItemTornadoRod extends ItemMod implements IManaUsingItem, IAvatarWieldable { private static final ResourceLocation avatarOverlay = new ResourceLocation(LibResources.MODEL_AVATAR_TORNADO); @@ -47,19 +50,17 @@ public class ItemTornadoRod extends ItemMod implements IManaUsingItem, IAvatarWi private static final String TAG_FLYING = "flying"; - IIcon iconIdle, iconFlying; - public ItemTornadoRod() { + super(LibItemNames.TORNADO_ROD); setMaxDamage(MAX_DAMAGE); - setUnlocalizedName(LibItemNames.TORNADO_ROD); setMaxStackSize(1); + addPropertyOverride(new ResourceLocation("botania", "flying"), (stack, world, living) -> isFlying(stack) ? 1 : 0); } @Override - public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean holding) { + public void onUpdate(ItemStack par1ItemStack, World world, Entity par3Entity, int par4, boolean holding) { if(par3Entity instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) par3Entity; - player.getCurrentEquippedItem(); boolean damaged = par1ItemStack.getItemDamage() > 0; if(damaged && !isFlying(par1ItemStack)) @@ -68,15 +69,15 @@ public class ItemTornadoRod extends ItemMod implements IManaUsingItem, IAvatarWi int max = FALL_MULTIPLIER * FLY_TIME; if(par1ItemStack.getItemDamage() >= max) { setFlying(par1ItemStack, false); - player.stopUsingItem(); + player.resetActiveHand(); } else if(isFlying(par1ItemStack)) { if(holding) { player.fallDistance = 0F; player.motionY = IManaProficiencyArmor.Helper.hasProficiency(player) ? 1.6 : 1.25; - player.worldObj.playSoundAtEntity(player, "botania:airRod", 0.1F, 0.25F); + player.worldObj.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.airRod, SoundCategory.PLAYERS, 0.1F, 0.25F); for(int i = 0; i < 5; i++) - Botania.proxy.wispFX(player.worldObj, player.posX, player.posY, player.posZ, 0.25F, 0.25F, 0.25F, 0.35F + (float) Math.random() * 0.1F, 0.2F * (float) (Math.random() - 0.5), -0.01F * (float) Math.random(), 0.2F * (float) (Math.random() - 0.5)); + Botania.proxy.wispFX(player.posX, player.posY, player.posZ, 0.25F, 0.25F, 0.25F, 0.35F + (float) Math.random() * 0.1F, 0.2F * (float) (Math.random() - 0.5), -0.01F * (float) Math.random(), 0.2F * (float) (Math.random() - 0.5)); } par1ItemStack.setItemDamage(Math.min(max, par1ItemStack.getItemDamage() + FALL_MULTIPLIER)); @@ -89,38 +90,26 @@ public class ItemTornadoRod extends ItemMod implements IManaUsingItem, IAvatarWi } } + @Nonnull @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { + public ActionResult onItemRightClick(@Nonnull ItemStack par1ItemStack, World world, EntityPlayer player, EnumHand hand) { int meta = par1ItemStack.getItemDamage(); - if(meta != 0 || ManaItemHandler.requestManaExactForTool(par1ItemStack, par3EntityPlayer, COST, false)) { - par3EntityPlayer.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack)); + if(meta != 0 || ManaItemHandler.requestManaExactForTool(par1ItemStack, player, COST, false)) { + player.setActiveHand(hand); if(meta == 0) { + ManaItemHandler.requestManaExactForTool(par1ItemStack, player, COST, true); setFlying(par1ItemStack, true); - ManaItemHandler.requestManaExactForTool(par1ItemStack, par3EntityPlayer, COST, true); } + return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack); } - return par1ItemStack; - } - - @Override - public void onUsingTick(ItemStack stack, EntityPlayer player, int count) { - - } - - @Override - public IIcon getIconIndex(ItemStack par1ItemStack) { - return isFlying(par1ItemStack) ? iconFlying : iconIdle; - } - - @Override - public IIcon getIcon(ItemStack stack, int pass) { - return getIconIndex(stack); + return ActionResult.newResult(EnumActionResult.PASS, par1ItemStack); } + @Nonnull @Override public EnumAction getItemUseAction(ItemStack par1ItemStack) { - return EnumAction.bow; + return EnumAction.BOW; } @Override @@ -128,12 +117,6 @@ public class ItemTornadoRod extends ItemMod implements IManaUsingItem, IAvatarWi return 720000; } - @Override - public void registerIcons(IIconRegister par1IconRegister) { - iconIdle = IconHelper.forItem(par1IconRegister, this, 0); - iconFlying = IconHelper.forItem(par1IconRegister, this, 1); - } - public boolean isFlying(ItemStack stack) { return ItemNBTHelper.getBoolean(stack, TAG_FLYING, false); } @@ -142,11 +125,6 @@ public class ItemTornadoRod extends ItemMod implements IManaUsingItem, IAvatarWi ItemNBTHelper.setBoolean(stack, TAG_FLYING, flying); } - @Override - public boolean isFull3D() { - return true; - } - @Override public boolean usesMana(ItemStack stack) { return true; @@ -155,22 +133,22 @@ public class ItemTornadoRod extends ItemMod implements IManaUsingItem, IAvatarWi @Override public void onAvatarUpdate(IAvatarTile tile, ItemStack stack) { TileEntity te = (TileEntity) tile; - World world = te.getWorldObj(); + World world = te.getWorld(); if(tile.getCurrentMana() >= COST && tile.isEnabled()) { int range = 5; int rangeY = 3; - List players = world.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(te.xCoord + 0.5 - range, te.yCoord + 0.5 - rangeY, te.zCoord + 0.5 - range, te.xCoord + 0.5 + range, te.yCoord + 0.5 + rangeY, te.zCoord + 0.5 + range)); + List players = world.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(te.getPos().add(-0.5 - range, -0.5 - rangeY, -0.5 - range), te.getPos().add(0.5 + range, 0.5 + rangeY, 0.5 + range))); for(EntityPlayer p : players) { if(p.motionY > 0.3 && p.motionY < 2 && !p.isSneaking()) { p.motionY = 2.8; for(int i = 0; i < 20; i++) for(int j = 0; j < 5; j++) - Botania.proxy.wispFX(p.worldObj, p.posX, p.posY + i, p.posZ, 0.25F, 0.25F, 0.25F, 0.35F + (float) Math.random() * 0.1F, 0.2F * (float) (Math.random() - 0.5), -0.01F * (float) Math.random(), 0.2F * (float) (Math.random() - 0.5)); + Botania.proxy.wispFX(p.posX, p.posY + i, p.posZ, 0.25F, 0.25F, 0.25F, 0.35F + (float) Math.random() * 0.1F, 0.2F * (float) (Math.random() - 0.5), -0.01F * (float) Math.random(), 0.2F * (float) (Math.random() - 0.5)); if(!world.isRemote) { - p.worldObj.playSoundAtEntity(p, "botania:dash", 1F, 1F); - p.addPotionEffect(new PotionEffect(ModPotions.featherfeet.id, 100, 0)); + p.worldObj.playSound(null, p.posX, p.posY, p.posZ, BotaniaSoundEvents.dash, SoundCategory.PLAYERS, 1F, 1F); + p.addPotionEffect(new PotionEffect(ModPotions.featherfeet, 100, 0)); tile.recieveMana(-COST); } } @@ -178,6 +156,12 @@ public class ItemTornadoRod extends ItemMod implements IManaUsingItem, IAvatarWi } } + @Override + public boolean shouldCauseReequipAnimation(ItemStack oldStack, @Nonnull ItemStack newStack, boolean slotChanged) { + return newStack.getItem() != this || isFlying(oldStack) != isFlying(newStack); + } + + @Override public ResourceLocation getOverlayResource(IAvatarTile tile, ItemStack stack) { return avatarOverlay; diff --git a/src/main/java/vazkii/botania/common/item/rod/ItemWaterRod.java b/src/main/java/vazkii/botania/common/item/rod/ItemWaterRod.java index 3d8cf2183..42ae3c89a 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemWaterRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemWaterRod.java @@ -1,46 +1,58 @@ package vazkii.botania.common.item.rod; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemBucket; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; import vazkii.botania.api.mana.IManaUsingItem; import vazkii.botania.api.mana.ManaItemHandler; import vazkii.botania.common.Botania; import vazkii.botania.common.item.ItemMod; import vazkii.botania.common.lib.LibItemNames; +import javax.annotation.Nonnull; + public class ItemWaterRod extends ItemMod implements IManaUsingItem { public static final int COST = 75; public ItemWaterRod() { - super(); + super(LibItemNames.WATER_ROD); setMaxStackSize(1); - setUnlocalizedName(LibItemNames.WATER_ROD); } + @Nonnull @Override - public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { - if(ManaItemHandler.requestManaExactForTool(par1ItemStack, par2EntityPlayer, COST, false) && !par3World.provider.isHellWorld) { - ForgeDirection dir = ForgeDirection.getOrientation(par7); + public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) { + if(ManaItemHandler.requestManaExactForTool(par1ItemStack, player, COST, false) && !world.provider.doesWaterVaporize()) { + // Adapted from bucket code + RayTraceResult mop = rayTrace(world, player, false); - ItemStack stackToPlace = new ItemStack(Blocks.flowing_water); - stackToPlace.tryPlaceItemIntoWorld(par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10); + if (mop != null && mop.typeOfHit == RayTraceResult.Type.BLOCK) { + BlockPos hitPos = mop.getBlockPos(); + if(!world.isBlockModifiable(player, hitPos)) + return EnumActionResult.FAIL; + BlockPos placePos = hitPos.offset(mop.sideHit); + if(player.canPlayerEdit(placePos, mop.sideHit, par1ItemStack)) { + if (ManaItemHandler.requestManaExactForTool(par1ItemStack, player, COST, true) + && ((ItemBucket) Items.WATER_BUCKET).tryPlaceContainedLiquid(player, world, placePos)) { + for(int i = 0; i < 6; i++) + Botania.proxy.sparkleFX(pos.getX() + side.getFrontOffsetX() + Math.random(), pos.getY() + side.getFrontOffsetY() + Math.random(), pos.getZ() + side.getFrontOffsetZ() + Math.random(), 0.2F, 0.2F, 1F, 1F, 5); + return EnumActionResult.SUCCESS; + } + } - if(stackToPlace.stackSize == 0) { - ManaItemHandler.requestManaExactForTool(par1ItemStack, par2EntityPlayer, COST, true); - for(int i = 0; i < 6; i++) - Botania.proxy.sparkleFX(par3World, par4 + dir.offsetX + Math.random(), par5 + dir.offsetY + Math.random(), par6 + dir.offsetZ + Math.random(), 0.2F, 0.2F, 1F, 1F, 5); } + return EnumActionResult.FAIL; } - return true; - } - @Override - public boolean isFull3D() { - return true; + return EnumActionResult.PASS; } @Override diff --git a/src/main/java/vazkii/botania/common/lexicon/ALexiconEntry.java b/src/main/java/vazkii/botania/common/lexicon/AlfheimLexiconEntry.java similarity index 60% rename from src/main/java/vazkii/botania/common/lexicon/ALexiconEntry.java rename to src/main/java/vazkii/botania/common/lexicon/AlfheimLexiconEntry.java index 5ffc8b989..4fc32c0bc 100644 --- a/src/main/java/vazkii/botania/common/lexicon/ALexiconEntry.java +++ b/src/main/java/vazkii/botania/common/lexicon/AlfheimLexiconEntry.java @@ -3,9 +3,9 @@ package vazkii.botania.common.lexicon; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.lexicon.LexiconCategory; -public class ALexiconEntry extends BLexiconEntry { +public class AlfheimLexiconEntry extends BasicLexiconEntry { - public ALexiconEntry(String unlocalizedName, LexiconCategory category) { + public AlfheimLexiconEntry(String unlocalizedName, LexiconCategory category) { super(unlocalizedName, category); setKnowledgeType(BotaniaAPI.elvenKnowledge); } diff --git a/src/main/java/vazkii/botania/common/lexicon/BLexiconEntry.java b/src/main/java/vazkii/botania/common/lexicon/BasicLexiconEntry.java similarity index 84% rename from src/main/java/vazkii/botania/common/lexicon/BLexiconEntry.java rename to src/main/java/vazkii/botania/common/lexicon/BasicLexiconEntry.java index ed320fb3b..c0f2afa5b 100644 --- a/src/main/java/vazkii/botania/common/lexicon/BLexiconEntry.java +++ b/src/main/java/vazkii/botania/common/lexicon/BasicLexiconEntry.java @@ -16,9 +16,11 @@ import vazkii.botania.api.lexicon.LexiconCategory; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.lexicon.LexiconPage; -public class BLexiconEntry extends LexiconEntry { +import javax.annotation.Nonnull; - public BLexiconEntry(String unlocalizedName, LexiconCategory category) { +public class BasicLexiconEntry extends LexiconEntry { + + public BasicLexiconEntry(String unlocalizedName, LexiconCategory category) { super(unlocalizedName, category); BotaniaAPI.addEntry(this, category); } @@ -56,8 +58,8 @@ public class BLexiconEntry extends LexiconEntry { } @Override - public int compareTo(LexiconEntry o) { - return o instanceof WLexiconEntry ? 1 : super.compareTo(o); + public int compareTo(@Nonnull LexiconEntry o) { + return o instanceof WelcomeLexiconEntry ? 1 : super.compareTo(o); } } diff --git a/src/main/java/vazkii/botania/common/lexicon/CLexiconEntry.java b/src/main/java/vazkii/botania/common/lexicon/CompatLexiconEntry.java similarity index 77% rename from src/main/java/vazkii/botania/common/lexicon/CLexiconEntry.java rename to src/main/java/vazkii/botania/common/lexicon/CompatLexiconEntry.java index 6a200cbff..541974c24 100644 --- a/src/main/java/vazkii/botania/common/lexicon/CLexiconEntry.java +++ b/src/main/java/vazkii/botania/common/lexicon/CompatLexiconEntry.java @@ -14,11 +14,11 @@ import vazkii.botania.api.lexicon.IAddonEntry; import vazkii.botania.api.lexicon.LexiconCategory; import vazkii.botania.common.lib.LibMisc; -public class CLexiconEntry extends BLexiconEntry implements IAddonEntry { +public class CompatLexiconEntry extends BasicLexiconEntry implements IAddonEntry { - String mod; + final String mod; - public CLexiconEntry(String unlocalizedName, LexiconCategory category, String mod) { + public CompatLexiconEntry(String unlocalizedName, LexiconCategory category, String mod) { super(unlocalizedName, category); this.mod = mod; } diff --git a/src/main/java/vazkii/botania/common/lexicon/DLexiconEntry.java b/src/main/java/vazkii/botania/common/lexicon/DogLexiconEntry.java similarity index 70% rename from src/main/java/vazkii/botania/common/lexicon/DLexiconEntry.java rename to src/main/java/vazkii/botania/common/lexicon/DogLexiconEntry.java index 00a0fc499..ae2190f08 100644 --- a/src/main/java/vazkii/botania/common/lexicon/DLexiconEntry.java +++ b/src/main/java/vazkii/botania/common/lexicon/DogLexiconEntry.java @@ -10,16 +10,19 @@ */ package vazkii.botania.common.lexicon; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.lexicon.LexiconCategory; import vazkii.botania.client.core.handler.PersistentVariableHelper; -public class DLexiconEntry extends BLexiconEntry { +public class DogLexiconEntry extends BasicLexiconEntry { - public DLexiconEntry(String unlocalizedName, LexiconCategory category) { + public DogLexiconEntry(String unlocalizedName, LexiconCategory category) { super(unlocalizedName, category); } @Override + @SideOnly(Side.CLIENT) public boolean isVisible() { return !PersistentVariableHelper.dog; } diff --git a/src/main/java/vazkii/botania/common/lexicon/HLexiconEntry.java b/src/main/java/vazkii/botania/common/lexicon/HeadLexiconEntry.java similarity index 80% rename from src/main/java/vazkii/botania/common/lexicon/HLexiconEntry.java rename to src/main/java/vazkii/botania/common/lexicon/HeadLexiconEntry.java index 099956394..e4cc9a29a 100644 --- a/src/main/java/vazkii/botania/common/lexicon/HLexiconEntry.java +++ b/src/main/java/vazkii/botania/common/lexicon/HeadLexiconEntry.java @@ -12,9 +12,9 @@ package vazkii.botania.common.lexicon; import vazkii.botania.api.lexicon.LexiconCategory; -public class HLexiconEntry extends ALexiconEntry { +public class HeadLexiconEntry extends AlfheimLexiconEntry { - public HLexiconEntry(String unlocalizedName, LexiconCategory category) { + public HeadLexiconEntry(String unlocalizedName, LexiconCategory category) { super(unlocalizedName, category); } diff --git a/src/main/java/vazkii/botania/common/lexicon/LexiconData.java b/src/main/java/vazkii/botania/common/lexicon/LexiconData.java index b07a5b76b..dd2b290a1 100644 --- a/src/main/java/vazkii/botania/common/lexicon/LexiconData.java +++ b/src/main/java/vazkii/botania/common/lexicon/LexiconData.java @@ -10,10 +10,6 @@ */ package vazkii.botania.common.lexicon; -import java.util.ArrayList; -import java.util.List; - -import baubles.common.Config; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; @@ -55,6 +51,9 @@ import vazkii.botania.common.lexicon.page.PageText; import vazkii.botania.common.lib.LibBlockNames; import vazkii.botania.common.lib.LibLexicon; +import java.util.ArrayList; +import java.util.List; + public final class LexiconData { public static LexiconEntry welcome; @@ -120,12 +119,9 @@ public final class LexiconData { public static LexiconEntry marimorphosis; public static LexiconEntry bubbell; public static LexiconEntry solegnolia; + public static LexiconEntry bergamute; public static LexiconEntry generatingIntro; - public static LexiconEntry passiveGen; - public static LexiconEntry primusLoci; - public static LexiconEntry daybloom; - public static LexiconEntry nightshade; public static LexiconEntry endoflame; public static LexiconEntry hydroangeas; public static LexiconEntry thermalily; @@ -275,7 +271,6 @@ public final class LexiconData { public static LexiconEntry decorativeBlocks; public static LexiconEntry dispenserTweaks; public static LexiconEntry shinyFlowers; - public static LexiconEntry prismarine; public static LexiconEntry shedding; public static LexiconEntry tinyPotato; public static LexiconEntry headCreating; @@ -321,46 +316,49 @@ public final class LexiconData { LexiconCategory categoryMisc = BotaniaAPI.categoryMisc; // BASICS ENTRIES - welcome = new WLexiconEntry(); - tutorial = new TLexiconEntry(); + welcome = new WelcomeLexiconEntry(); + tutorial = new TutLexiconEntry(); - flowers = new BLexiconEntry(LibLexicon.BASICS_FLOWERS, categoryBasics); + flowers = new BasicLexiconEntry(LibLexicon.BASICS_FLOWERS, categoryBasics); flowers.setPriority() .setLexiconPages(new PageText("0"), new PageImage("1", LibResources.ENTRY_FLOWERS), new PageText("2"), new PageCraftingRecipe("3", ModCraftingRecipes.recipesPetals), new PageCraftingRecipe("4", ModCraftingRecipes.recipePestleAndMortar), - new PageCraftingRecipe("5", ModCraftingRecipes.recipesDyes), new PageText("6"), + new PageCraftingRecipe("5", ModCraftingRecipes.recipesDyes), + new PageCraftingRecipe("5.5", ModCraftingRecipes.recipesDyesVanilla), + new PageText("6"), new PageCraftingRecipe("7", ModCraftingRecipes.recipeFertilizerPowder), new PageCraftingRecipe("8", ModCraftingRecipes.recipeFerilizerDye), new PageText("10"), new PageText("12"), new PageCraftingRecipe("11", ModCraftingRecipes.recipesPetalsDouble), - new PageCraftingRecipe("9", ModCraftingRecipes.recipesPetalBlocks)) + new PageCraftingRecipe("9", ModCraftingRecipes.recipesPetalBlocks), + new PageCraftingRecipe("13", ModCraftingRecipes.recipesReversePetalBlocks)) .setIcon(new ItemStack(ModBlocks.flower, 1, 6)); - apothecary = new BLexiconEntry(LibLexicon.BASICS_APOTHECARY, categoryBasics); + apothecary = new BasicLexiconEntry(LibLexicon.BASICS_APOTHECARY, categoryBasics); apothecary.setPriority().setLexiconPages(new PageText("0"), new PageImage("1", LibResources.ENTRY_APOTHECARY), new PageText("2"), new PageText("3"), new PageText("4"), new PageText("7"), new PageText("6"), new PageCraftingRecipe("5", ModCraftingRecipes.recipesApothecary)); - lexicon = new BLexiconEntry(LibLexicon.BASICS_LEXICON, categoryBasics); + lexicon = new BasicLexiconEntry(LibLexicon.BASICS_LEXICON, categoryBasics); lexicon.setPriority().setLexiconPages(new PageText("0"), new PageText("3"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeLexicon), new PageText("2")); - wand = new BLexiconEntry(LibLexicon.BASICS_WAND, categoryBasics); + wand = new BasicLexiconEntry(LibLexicon.BASICS_WAND, categoryBasics); wand.setPriority().setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageCraftingRecipe("3", ModCraftingRecipes.recipesTwigWand)); - pureDaisy = new BLexiconEntry(LibLexicon.BASICS_PURE_DAISY, categoryBasics); + pureDaisy = new BasicLexiconEntry(LibLexicon.BASICS_PURE_DAISY, categoryBasics); pureDaisy.setPriority() .setLexiconPages(new PageText("0"), new PageImage("1", LibResources.ENTRY_PURE_DAISY), new PageCraftingRecipe("2", ModCraftingRecipes.recipeLivingwoodTwig), new PageText("4"), - new PagePetalRecipe("3", ModPetalRecipes.pureDaisyRecipe)) + new PagePetalRecipe<>("3", ModPetalRecipes.pureDaisyRecipe)) .setIcon(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_PUREDAISY)); pureDaisy.addExtraDisplayedRecipe(new ItemStack(ModBlocks.livingwood)); pureDaisy.addExtraDisplayedRecipe(new ItemStack(ModBlocks.livingrock)); LexiconRecipeMappings.map(new ItemStack(ModBlocks.livingwood), pureDaisy, 1); LexiconRecipeMappings.map(new ItemStack(ModBlocks.livingrock), pureDaisy, 1); - runicAltar = new BLexiconEntry(LibLexicon.BASICS_RUNE_ALTAR, categoryBasics); + runicAltar = new BasicLexiconEntry(LibLexicon.BASICS_RUNE_ALTAR, categoryBasics); runicAltar.setPriority().setLexiconPages(new PageText("21"), new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipesRuneAltar), new PageText("3"), new PageText("20"), new PageText("22"), new PageRuneRecipe("4", ModRuneRecipes.recipeWaterRune), @@ -380,21 +378,21 @@ public final class LexiconData { new PageRuneRecipe("18", ModRuneRecipes.recipeEnvyRune), new PageRuneRecipe("19", ModRuneRecipes.recipePrideRune)); - terrasteel = new BLexiconEntry(LibLexicon.BASICS_TERRASTEEL, categoryBasics); + terrasteel = new BasicLexiconEntry(LibLexicon.BASICS_TERRASTEEL, categoryBasics); terrasteel.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeTerraPlate), new PageText("2"), new PageMultiblock("4", ModMultiblocks.terrasteelPlate), new PageTerrasteel("3")) .setIcon(new ItemStack(ModItems.manaResource, 1, 4)); - blackLotus = new BLexiconEntry(LibLexicon.BASICS_BLACK_LOTUS, categoryBasics); + blackLotus = new BasicLexiconEntry(LibLexicon.BASICS_BLACK_LOTUS, categoryBasics); blackLotus.setLexiconPages(new PageText("0")).setIcon(new ItemStack(ModItems.blackLotus)); blackLotus.addExtraDisplayedRecipe(new ItemStack(ModItems.blackLotus)); - flowerBag = new BLexiconEntry(LibLexicon.BASICS_FLOWER_BAG, categoryBasics); + flowerBag = new BasicLexiconEntry(LibLexicon.BASICS_FLOWER_BAG, categoryBasics); flowerBag.setLexiconPages(new PageText("0"), new PageText("2"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeFlowerBag)); if (Botania.gardenOfGlassLoaded) { - gardenOfGlass = new BLexiconEntry(LibLexicon.BASICS_GARDEN_OF_GLASS, categoryBasics); + gardenOfGlass = new BasicLexiconEntry(LibLexicon.BASICS_GARDEN_OF_GLASS, categoryBasics); gardenOfGlass.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageCraftingRecipe("3", ModCraftingRecipes.recipeRootToSapling), new PageCraftingRecipe("4", ModCraftingRecipes.recipeRootToFertilizer), @@ -406,18 +404,18 @@ public final class LexiconData { } if (Botania.thaumcraftLoaded) - new CLexiconEntry("wrap", categoryBasics, "Thaumcraft").setLexiconPages(new PageText("0")); // lel + new CompatLexiconEntry("wrap", categoryBasics, "Thaumcraft").setLexiconPages(new PageText("0")); // lel // MANA ENTRIES - manaIntro = new BLexiconEntry(LibLexicon.MANA_INTRO, categoryMana); + manaIntro = new BasicLexiconEntry(LibLexicon.MANA_INTRO, categoryMana); manaIntro.setPriority().setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2")); - spreader = new BLexiconEntry(LibLexicon.MANA_SPREADER, categoryMana); + spreader = new BasicLexiconEntry(LibLexicon.MANA_SPREADER, categoryMana); spreader.setPriority().setLexiconPages(new PageText("0"), new PageImage("1", LibResources.ENTRY_SPREADER), new PageText("2"), new PageText("3"), new PageText("4"), new PageText("11"), new PageCraftingRecipe("5", ModCraftingRecipes.recipesSpreader), new PageText("10")); - pool = new BLexiconEntry(LibLexicon.MANA_POOL, categoryMana); + pool = new BasicLexiconEntry(LibLexicon.MANA_POOL, categoryMana); pool.setPriority() .setLexiconPages(new PageText("0"), new PageText("9"), new PageCraftingRecipe("1", ModCraftingRecipes.recipePool), @@ -430,24 +428,25 @@ public final class LexiconData { new PageManaInfusionRecipe("11", ModManaInfusionRecipes.managlassRecipe), new PageManaInfusionRecipe("12", ModManaInfusionRecipes.manaStringRecipe), new PageCraftingRecipe("13", ModCraftingRecipes.recipeCobweb), - new PageManaInfusionRecipe("7", ModManaInfusionRecipes.manaCookieRecipe)) + new PageManaInfusionRecipe("7", ModManaInfusionRecipes.manaCookieRecipe), + new PageManaInfusionRecipe("15", ModManaAlchemyRecipes.prismarineRecipe)) .setIcon(new ItemStack(ModBlocks.pool)); - sparks = new BLexiconEntry(LibLexicon.MANA_SPARKS, categoryMana); + sparks = new BasicLexiconEntry(LibLexicon.MANA_SPARKS, categoryMana); sparks.setPriority().setLexiconPages(new PageText("0"), new PageText("1"), new PageText("3"), new PageCraftingRecipe("2", ModCraftingRecipes.recipesSpark)); - sparkUpgrades = new ALexiconEntry(LibLexicon.MANA_SPARK_UPGRADES, categoryMana); + sparkUpgrades = new AlfheimLexiconEntry(LibLexicon.MANA_SPARK_UPGRADES, categoryMana); sparkUpgrades.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageText("3"), new PageText("4"), new PageCraftingRecipe("5", ModCraftingRecipes.recipesSparkUpgrades)); if (ConfigHandler.fluxfieldEnabled) { - rfGenerator = new BLexiconEntry(LibLexicon.MANA_RF_GENERATOR, categoryMana); + rfGenerator = new BasicLexiconEntry(LibLexicon.MANA_RF_GENERATOR, categoryMana); rfGenerator.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeRFGenerator)); } - lenses = new BLexiconEntry(LibLexicon.MANA_LENSES, categoryMana); + lenses = new BasicLexiconEntry(LibLexicon.MANA_LENSES, categoryMana); lenses.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipesManaLens), new PageText("4"), new PageText("5"), new PageText("6"), new PageCraftingRecipe("7", ModCraftingRecipes.recipeLensVelocity), new PageText("8"), @@ -467,38 +466,38 @@ public final class LexiconData { new PageCraftingRecipe("35", ModCraftingRecipes.recipeLensPiston), new PageText("36"), new PageCraftingRecipe("37", ModCraftingRecipes.recipesLensFlash)); - distributor = new BLexiconEntry(LibLexicon.MANA_DISTRIBUTOR, categoryMana); + distributor = new BasicLexiconEntry(LibLexicon.MANA_DISTRIBUTOR, categoryMana); distributor.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeDistributor)); - manaVoid = new BLexiconEntry(LibLexicon.MANA_VOID, categoryMana); + manaVoid = new BasicLexiconEntry(LibLexicon.MANA_VOID, categoryMana); manaVoid.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeManaVoid)); - manaTablet = new BLexiconEntry(LibLexicon.MANA_TABLET, categoryMana); + manaTablet = new BasicLexiconEntry(LibLexicon.MANA_TABLET, categoryMana); manaTablet.setPriority().setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipesManaTablet)); - manaMirror = new BLexiconEntry(LibLexicon.MANA_MIRROR, categoryMana); + manaMirror = new BasicLexiconEntry(LibLexicon.MANA_MIRROR, categoryMana); manaMirror.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeManaMirror)); - manaDetector = new BLexiconEntry(LibLexicon.MANA_DETECTOR, categoryMana); + manaDetector = new BasicLexiconEntry(LibLexicon.MANA_DETECTOR, categoryMana); manaDetector.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeManaDetector)); - redstoneSpreader = new BLexiconEntry(LibLexicon.MANA_REDSTONE_SPREADER, categoryMana); + redstoneSpreader = new BasicLexiconEntry(LibLexicon.MANA_REDSTONE_SPREADER, categoryMana); redstoneSpreader.setPriority().setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeRedstoneSpreader)); - manastar = new BLexiconEntry(LibLexicon.MANA_MANASTAR, categoryMana); + manastar = new BasicLexiconEntry(LibLexicon.MANA_MANASTAR, categoryMana); manastar.setPriority().setLexiconPages(new PageText("0"), - new PagePetalRecipe("1", ModPetalRecipes.manastarRecipe)); + new PagePetalRecipe<>("1", ModPetalRecipes.manastarRecipe)); - dreamwoodSpreader = new ALexiconEntry(LibLexicon.MANA_DREAMWOOD_SPREADER, categoryMana); + dreamwoodSpreader = new AlfheimLexiconEntry(LibLexicon.MANA_DREAMWOOD_SPREADER, categoryMana); dreamwoodSpreader.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipesDreamwoodSpreader), new PageText("2"), new PageCraftingRecipe("3", ModCraftingRecipes.recipeUltraSpreader)); - elvenLenses = new ALexiconEntry(LibLexicon.MANA_ELVEN_LENSES, categoryMana); + elvenLenses = new AlfheimLexiconEntry(LibLexicon.MANA_ELVEN_LENSES, categoryMana); elvenLenses.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeLensPaint), new PageText("3"), new PageCraftingRecipe("4", ModCraftingRecipes.recipeLensWarp), new PageText("5"), @@ -506,202 +505,186 @@ public final class LexiconData { new PageCraftingRecipe("8", ModCraftingRecipes.recipeLensFirework), new PageText("9"), new PageCraftingRecipe("10", ModCraftingRecipes.recipeLensFlare)); - prism = new ALexiconEntry(LibLexicon.MANA_PRISM, categoryMana); + prism = new AlfheimLexiconEntry(LibLexicon.MANA_PRISM, categoryMana); prism.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageCraftingRecipe("3", ModCraftingRecipes.recipePrism)); - poolCart = new BLexiconEntry(LibLexicon.MANA_POOL_CART, categoryMana); + poolCart = new BasicLexiconEntry(LibLexicon.MANA_POOL_CART, categoryMana); poolCart.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageCraftingRecipe("3", ModCraftingRecipes.recipePoolCart), new PageCraftingRecipe("4", ModCraftingRecipes.recipePump)); - sparkChanger = new ALexiconEntry(LibLexicon.MANA_SPARK_CHANGER, categoryMana); + sparkChanger = new AlfheimLexiconEntry(LibLexicon.MANA_SPARK_CHANGER, categoryMana); sparkChanger.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeSparkChanger)); - bellows = new BLexiconEntry(LibLexicon.MANA_BELLOWS, categoryMana); + bellows = new BasicLexiconEntry(LibLexicon.MANA_BELLOWS, categoryMana); bellows.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeBellows)); // FUNCTIONAL FLOWERS ENTRIES - functionalIntro = new BLexiconEntry(LibLexicon.FFLOWER_INTRO, categoryFunctionalFlowers); + functionalIntro = new BasicLexiconEntry(LibLexicon.FFLOWER_INTRO, categoryFunctionalFlowers); functionalIntro .setPriority().setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageText("3"), new PageCraftingRecipe("4", ModCraftingRecipes.recipeRedstoneRoot)) .setIcon(null); ; - flowerShrinking = new BLexiconEntry(LibLexicon.FFLOWER_SHRINKING, categoryFunctionalFlowers); + flowerShrinking = new BasicLexiconEntry(LibLexicon.FFLOWER_SHRINKING, categoryFunctionalFlowers); flowerShrinking.setPriority() .setLexiconPages(new PageText("0"), new PageManaInfusionRecipe("1", BotaniaAPI.miniFlowerRecipes)) .setIcon(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_BELLETHORN + "Chibi")); - flowerSpeed = new BLexiconEntry(LibLexicon.FFLOWER_SPEED, categoryFunctionalFlowers); + flowerSpeed = new BasicLexiconEntry(LibLexicon.FFLOWER_SPEED, categoryFunctionalFlowers); flowerSpeed.setPriority().setLexiconPages(new PageText("0"), new PageText("1")); - flowerSpeed.setIcon(new ItemStack(Blocks.dirt, 1, 2)); + flowerSpeed.setIcon(new ItemStack(Blocks.DIRT, 1, 2)); - jadedAmaranthus = new BLexiconEntry(LibLexicon.FFLOWER_JADED_AMARANTHUS, categoryFunctionalFlowers); + jadedAmaranthus = new BasicLexiconEntry(LibLexicon.FFLOWER_JADED_AMARANTHUS, categoryFunctionalFlowers); jadedAmaranthus.setLexiconPages(new PageText("0"), - new PagePetalRecipe("1", ModPetalRecipes.jadedAmaranthusRecipe), new PageText("2")); + new PagePetalRecipe<>("1", ModPetalRecipes.jadedAmaranthusRecipe), new PageText("2")); - bellethorne = new BLexiconEntry(LibLexicon.FFLOWER_BELLETHORNE, categoryFunctionalFlowers); - bellethorne.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.bellethorneRecipe)); + bellethorne = new BasicLexiconEntry(LibLexicon.FFLOWER_BELLETHORNE, categoryFunctionalFlowers); + bellethorne.setLexiconPages(new PageText("0"), new PagePetalRecipe<>("1", ModPetalRecipes.bellethorneRecipe)); - dreadthorne = new BLexiconEntry(LibLexicon.FFLOWER_DREADTHORNE, categoryFunctionalFlowers); - dreadthorne.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.dreadthorneRecipe)); + dreadthorne = new BasicLexiconEntry(LibLexicon.FFLOWER_DREADTHORNE, categoryFunctionalFlowers); + dreadthorne.setLexiconPages(new PageText("0"), new PagePetalRecipe<>("1", ModPetalRecipes.dreadthorneRecipe)); - heiseiDream = new ALexiconEntry(LibLexicon.FFLOWER_HEISEI_DREAM, categoryFunctionalFlowers); - heiseiDream.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.heiseiDreamRecipe)); + heiseiDream = new AlfheimLexiconEntry(LibLexicon.FFLOWER_HEISEI_DREAM, categoryFunctionalFlowers); + heiseiDream.setLexiconPages(new PageText("0"), new PagePetalRecipe<>("1", ModPetalRecipes.heiseiDreamRecipe)); - tigerseye = new BLexiconEntry(LibLexicon.FFLOWER_TIGERSEYE, categoryFunctionalFlowers); - tigerseye.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.tigerseyeRecipe)); + tigerseye = new BasicLexiconEntry(LibLexicon.FFLOWER_TIGERSEYE, categoryFunctionalFlowers); + tigerseye.setLexiconPages(new PageText("0"), new PagePetalRecipe<>("1", ModPetalRecipes.tigerseyeRecipe)); - orechid = Botania.gardenOfGlassLoaded ? new BLexiconEntry(LibLexicon.FFLOWER_ORECHID, categoryFunctionalFlowers) - : new ALexiconEntry(LibLexicon.FFLOWER_ORECHID, categoryFunctionalFlowers); - orechid.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.orechidRecipe)); + orechid = Botania.gardenOfGlassLoaded ? new BasicLexiconEntry(LibLexicon.FFLOWER_ORECHID, categoryFunctionalFlowers) + : new AlfheimLexiconEntry(LibLexicon.FFLOWER_ORECHID, categoryFunctionalFlowers); + orechid.setLexiconPages(new PageText("0"), new PagePetalRecipe<>("1", ModPetalRecipes.orechidRecipe)); if (Botania.gardenOfGlassLoaded) orechid.setPriority(); - orechidIgnem = new ALexiconEntry(LibLexicon.FFLOWER_ORECHID_IGNEM, categoryFunctionalFlowers); - orechidIgnem.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.orechidIgnemRecipe)); + orechidIgnem = new AlfheimLexiconEntry(LibLexicon.FFLOWER_ORECHID_IGNEM, categoryFunctionalFlowers); + orechidIgnem.setLexiconPages(new PageText("0"), new PagePetalRecipe<>("1", ModPetalRecipes.orechidIgnemRecipe)); if (ConfigHandler.fallenKanadeEnabled) { - fallenKanade = new BLexiconEntry(LibLexicon.FFLOWER_FALLEN_KANADE, categoryFunctionalFlowers); + fallenKanade = new BasicLexiconEntry(LibLexicon.FFLOWER_FALLEN_KANADE, categoryFunctionalFlowers); fallenKanade.setLexiconPages(new PageText(Botania.bloodMagicLoaded ? "0a" : "0"), - new PagePetalRecipe("1", ModPetalRecipes.fallenKanadeRecipe)); + new PagePetalRecipe<>("1", ModPetalRecipes.fallenKanadeRecipe)); } - exoflame = new BLexiconEntry(LibLexicon.FFLOWER_EXOFLAME, categoryFunctionalFlowers); - exoflame.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.exoflameRecipe)); + exoflame = new BasicLexiconEntry(LibLexicon.FFLOWER_EXOFLAME, categoryFunctionalFlowers); + exoflame.setLexiconPages(new PageText("0"), new PagePetalRecipe<>("1", ModPetalRecipes.exoflameRecipe)); - agricarnation = new BLexiconEntry(LibLexicon.FFLOWER_AGRICARNATION, categoryFunctionalFlowers); - agricarnation.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.agricarnationRecipe)); + agricarnation = new BasicLexiconEntry(LibLexicon.FFLOWER_AGRICARNATION, categoryFunctionalFlowers); + agricarnation.setLexiconPages(new PageText("0"), new PagePetalRecipe<>("1", ModPetalRecipes.agricarnationRecipe)); - hopperhock = new BLexiconEntry(LibLexicon.FFLOWER_HOPPERHOCK, categoryFunctionalFlowers); + hopperhock = new BasicLexiconEntry(LibLexicon.FFLOWER_HOPPERHOCK, categoryFunctionalFlowers); hopperhock.setLexiconPages(new PageText("0"), new PageText("1"), - new PagePetalRecipe("2", ModPetalRecipes.hopperhockRecipe)); + new PagePetalRecipe<>("2", ModPetalRecipes.hopperhockRecipe)); - tangleberrie = new BLexiconEntry(LibLexicon.FFLOWER_TANGLEBERRIE, categoryFunctionalFlowers); - tangleberrie.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.tangleberrieRecipe)); + tangleberrie = new BasicLexiconEntry(LibLexicon.FFLOWER_TANGLEBERRIE, categoryFunctionalFlowers); + tangleberrie.setLexiconPages(new PageText("0"), new PagePetalRecipe<>("1", ModPetalRecipes.tangleberrieRecipe)); - jiyuulia = new BLexiconEntry(LibLexicon.FFLOWER_JIYUULIA, categoryFunctionalFlowers); - jiyuulia.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.jiyuuliaRecipe)); + jiyuulia = new BasicLexiconEntry(LibLexicon.FFLOWER_JIYUULIA, categoryFunctionalFlowers); + jiyuulia.setLexiconPages(new PageText("0"), new PagePetalRecipe<>("1", ModPetalRecipes.jiyuuliaRecipe)); - rannuncarpus = new BLexiconEntry(LibLexicon.FFLOWER_RANNUNCARPUS, categoryFunctionalFlowers); + rannuncarpus = new BasicLexiconEntry(LibLexicon.FFLOWER_RANNUNCARPUS, categoryFunctionalFlowers); rannuncarpus.setLexiconPages(new PageText("0"), new PageText("1"), - new PagePetalRecipe("2", ModPetalRecipes.rannuncarpusRecipe)); + new PagePetalRecipe<>("2", ModPetalRecipes.rannuncarpusRecipe)); - hyacidus = new BLexiconEntry(LibLexicon.FFLOWER_HYACIDUS, categoryFunctionalFlowers); - hyacidus.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.hyacidusRecipe)); + hyacidus = new BasicLexiconEntry(LibLexicon.FFLOWER_HYACIDUS, categoryFunctionalFlowers); + hyacidus.setLexiconPages(new PageText("0"), new PagePetalRecipe<>("1", ModPetalRecipes.hyacidusRecipe)); - pollidisiac = new BLexiconEntry(LibLexicon.FFLOWER_POLLIDISIAC, categoryFunctionalFlowers); - pollidisiac.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.pollidisiacRecipe)); + pollidisiac = new BasicLexiconEntry(LibLexicon.FFLOWER_POLLIDISIAC, categoryFunctionalFlowers); + pollidisiac.setLexiconPages(new PageText("0"), new PagePetalRecipe<>("1", ModPetalRecipes.pollidisiacRecipe)); - clayconia = new BLexiconEntry(LibLexicon.FFLOWER_CLAYCONIA, categoryFunctionalFlowers); - clayconia.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.clayconiaRecipe)); + clayconia = new BasicLexiconEntry(LibLexicon.FFLOWER_CLAYCONIA, categoryFunctionalFlowers); + clayconia.setLexiconPages(new PageText("0"), new PagePetalRecipe<>("1", ModPetalRecipes.clayconiaRecipe)); - loonium = new ALexiconEntry(LibLexicon.FFLOWER_LOONIUM, categoryFunctionalFlowers); - loonium.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.looniumRecipe)); + loonium = new AlfheimLexiconEntry(LibLexicon.FFLOWER_LOONIUM, categoryFunctionalFlowers); + loonium.setLexiconPages(new PageText("0"), new PagePetalRecipe<>("1", ModPetalRecipes.looniumRecipe)); - daffomill = new BLexiconEntry(LibLexicon.FFLOWER_DAFFOMILL, categoryFunctionalFlowers); - daffomill.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.daffomillRecipe)); + daffomill = new BasicLexiconEntry(LibLexicon.FFLOWER_DAFFOMILL, categoryFunctionalFlowers); + daffomill.setLexiconPages(new PageText("0"), new PagePetalRecipe<>("1", ModPetalRecipes.daffomillRecipe)); - vinculotus = new BLexiconEntry(LibLexicon.FFLOWER_VINCULOTUS, categoryFunctionalFlowers); - vinculotus.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.vinculotusRecipe)); + vinculotus = new BasicLexiconEntry(LibLexicon.FFLOWER_VINCULOTUS, categoryFunctionalFlowers); + vinculotus.setLexiconPages(new PageText("0"), new PagePetalRecipe<>("1", ModPetalRecipes.vinculotusRecipe)); - spectranthemum = new ALexiconEntry(LibLexicon.FFLOWER_SPECTRANTHEMUN, categoryFunctionalFlowers); + spectranthemum = new AlfheimLexiconEntry(LibLexicon.FFLOWER_SPECTRANTHEMUN, categoryFunctionalFlowers); spectranthemum.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), - new PagePetalRecipe("3", ModPetalRecipes.spectranthemumRecipe)); + new PagePetalRecipe<>("3", ModPetalRecipes.spectranthemumRecipe)); - medumone = new BLexiconEntry(LibLexicon.FFLOWER_MEDUMONE, categoryFunctionalFlowers); - medumone.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.medumoneRecipe)); + medumone = new BasicLexiconEntry(LibLexicon.FFLOWER_MEDUMONE, categoryFunctionalFlowers); + medumone.setLexiconPages(new PageText("0"), new PagePetalRecipe<>("1", ModPetalRecipes.medumoneRecipe)); - marimorphosis = new BLexiconEntry(LibLexicon.FFLOWER_MARIMORPHOSIS, categoryFunctionalFlowers); + marimorphosis = new BasicLexiconEntry(LibLexicon.FFLOWER_MARIMORPHOSIS, categoryFunctionalFlowers); marimorphosis.setLexiconPages(new PageText("0"), new PageImage("1", LibResources.ENTRY_METAMORPHIC_STONES), - new PagePetalRecipe("2", ModPetalRecipes.marimorphosisRecipe), + new PagePetalRecipe<>("2", ModPetalRecipes.marimorphosisRecipe), new PageCraftingRecipe("3", ModCraftingRecipes.recipesAltarMeta)); - bubbell = new ALexiconEntry(LibLexicon.FFLOWER_BUBBELL, categoryFunctionalFlowers); - bubbell.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.bubbellRecipe)); + bubbell = new AlfheimLexiconEntry(LibLexicon.FFLOWER_BUBBELL, categoryFunctionalFlowers); + bubbell.setLexiconPages(new PageText("0"), new PagePetalRecipe<>("1", ModPetalRecipes.bubbellRecipe)); - solegnolia = new BLexiconEntry(LibLexicon.FFLOWER_SOLEGNOLIA, categoryFunctionalFlowers); - solegnolia.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.solegnoliaRecipe)); + solegnolia = new BasicLexiconEntry(LibLexicon.FFLOWER_SOLEGNOLIA, categoryFunctionalFlowers); + solegnolia.setLexiconPages(new PageText("0"), new PagePetalRecipe<>("1", ModPetalRecipes.solegnoliaRecipe)); + + bergamute = new BasicLexiconEntry(LibLexicon.FFLOWER_BERGAMUTE, categoryFunctionalFlowers); + bergamute.setLexiconPages(new PageText("0"), new PagePetalRecipe<>("1", ModPetalRecipes.bergamuteRecipe)); // GENERATING FLOWERS ENTRIES - if (ConfigHandler.hardcorePassiveGeneration > 0) { - generatingIntro = new BLexiconEntry(LibLexicon.GFLOWER_INTRO, categoryGenerationFlowers); - generatingIntro.setPriority().setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2")); - } + generatingIntro = new BasicLexiconEntry(LibLexicon.GFLOWER_INTRO, categoryGenerationFlowers); + generatingIntro.setPriority().setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2")); - passiveGen = new BLexiconEntry(LibLexicon.GFLOWER_PASSIVE_GENERATION, categoryGenerationFlowers); - passiveGen.setPriority().setLexiconPages(new PageText("0"), new PageText("1")) - .setIcon(new ItemStack(Blocks.deadbush)); - - primusLoci = new BLexiconEntry(LibLexicon.GFLOWER_PRIMUS_LOCI, categoryGenerationFlowers); - primusLoci.setPriority().setLexiconPages(new PageText("0"), new PageText("1")); - primusLoci.setIcon(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_DAYBLOOM_PRIME)); - primusLoci.addExtraDisplayedRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_DAYBLOOM_PRIME)); - primusLoci.addExtraDisplayedRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_NIGHTSHADE_PRIME)); - - daybloom = new BLexiconEntry(LibLexicon.GFLOWER_DAYBLOOM, categoryGenerationFlowers); - daybloom.setPriority().setLexiconPages(new PageText("0"), new PageText("1"), - new PagePetalRecipe("2", ModPetalRecipes.daybloomRecipe)); - - nightshade = new BLexiconEntry(LibLexicon.GFLOWER_NIGHTSHADE, categoryGenerationFlowers); - nightshade.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.nightshadeRecipe)); - - endoflame = new BLexiconEntry(LibLexicon.GFLOWER_ENDOFLAME, categoryGenerationFlowers); + endoflame = new BasicLexiconEntry(LibLexicon.GFLOWER_ENDOFLAME, categoryGenerationFlowers); endoflame.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("3"), - new PagePetalRecipe("2", ModPetalRecipes.endoflameRecipe)); + new PagePetalRecipe<>("2", ModPetalRecipes.endoflameRecipe)); - hydroangeas = new BLexiconEntry(LibLexicon.GFLOWER_HYDROANGEAS, categoryGenerationFlowers); + hydroangeas = new BasicLexiconEntry(LibLexicon.GFLOWER_HYDROANGEAS, categoryGenerationFlowers); hydroangeas.setLexiconPages(new PageText("0"), new PageImage("2", LibResources.ENTRY_HYDROANGEAS), - new PagePetalRecipe("1", ModPetalRecipes.hydroangeasRecipe)); + new PagePetalRecipe<>("1", ModPetalRecipes.hydroangeasRecipe)); - thermalily = new BLexiconEntry(LibLexicon.GFLOWER_THERMALILY, categoryGenerationFlowers); + thermalily = new BasicLexiconEntry(LibLexicon.GFLOWER_THERMALILY, categoryGenerationFlowers); thermalily.setLexiconPages(new PageText("0"), new PageText("2"), new PageText("3"), - new PagePetalRecipe("1", ModPetalRecipes.thermalilyRecipe)); + new PagePetalRecipe<>("1", ModPetalRecipes.thermalilyRecipe)); - arcaneRose = new BLexiconEntry(LibLexicon.GFLOWER_ARCANE_ROSE, categoryGenerationFlowers); - arcaneRose.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.arcaneRoseRecipe)); + arcaneRose = new BasicLexiconEntry(LibLexicon.GFLOWER_ARCANE_ROSE, categoryGenerationFlowers); + arcaneRose.setLexiconPages(new PageText("0"), new PagePetalRecipe<>("1", ModPetalRecipes.arcaneRoseRecipe)); - munchdew = new BLexiconEntry(LibLexicon.GFLOWER_MUNCHDEW, categoryGenerationFlowers); + munchdew = new BasicLexiconEntry(LibLexicon.GFLOWER_MUNCHDEW, categoryGenerationFlowers); munchdew.setLexiconPages(new PageText("0"), new PageText("1"), - new PagePetalRecipe("2", ModPetalRecipes.munchdewRecipe)); + new PagePetalRecipe<>("2", ModPetalRecipes.munchdewRecipe)); - entropinnyum = new BLexiconEntry(LibLexicon.GFLOWER_ENTROPINNYUM, categoryGenerationFlowers); - entropinnyum.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.entropinnyumRecipe)); + entropinnyum = new BasicLexiconEntry(LibLexicon.GFLOWER_ENTROPINNYUM, categoryGenerationFlowers); + entropinnyum.setLexiconPages(new PageText("0"), new PagePetalRecipe<>("1", ModPetalRecipes.entropinnyumRecipe)); - kekimurus = new ALexiconEntry(LibLexicon.GFLOWER_KEKIMURUS, categoryGenerationFlowers); - kekimurus.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.kekimurusRecipe)); + kekimurus = new AlfheimLexiconEntry(LibLexicon.GFLOWER_KEKIMURUS, categoryGenerationFlowers); + kekimurus.setLexiconPages(new PageText("0"), new PagePetalRecipe<>("1", ModPetalRecipes.kekimurusRecipe)); - gourmaryllis = new BLexiconEntry(LibLexicon.GFLOWER_GOURMARYLLIS, categoryGenerationFlowers); + gourmaryllis = new BasicLexiconEntry(LibLexicon.GFLOWER_GOURMARYLLIS, categoryGenerationFlowers); gourmaryllis.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), - new PagePetalRecipe("3", ModPetalRecipes.gourmaryllisRecipe)); + new PagePetalRecipe<>("3", ModPetalRecipes.gourmaryllisRecipe)); - narslimmus = new BLexiconEntry(LibLexicon.GFLOWER_NARSLIMMUS, categoryGenerationFlowers); - narslimmus.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.narslimmusRecipe)); + narslimmus = new BasicLexiconEntry(LibLexicon.GFLOWER_NARSLIMMUS, categoryGenerationFlowers); + narslimmus.setLexiconPages(new PageText("0"), new PagePetalRecipe<>("1", ModPetalRecipes.narslimmusRecipe)); - spectrolus = new ALexiconEntry(LibLexicon.GFLOWER_SPECTROLUS, categoryGenerationFlowers); + spectrolus = new AlfheimLexiconEntry(LibLexicon.GFLOWER_SPECTROLUS, categoryGenerationFlowers); spectrolus.setLexiconPages(new PageText("0"), new PageText("1"), - new PagePetalRecipe("2", ModPetalRecipes.spectrolusRecipe)); + new PagePetalRecipe<>("2", ModPetalRecipes.spectrolusRecipe)); - rafflowsia = new ALexiconEntry(LibLexicon.GFLOWER_RAFFLOWSIA, categoryGenerationFlowers); + rafflowsia = new AlfheimLexiconEntry(LibLexicon.GFLOWER_RAFFLOWSIA, categoryGenerationFlowers); rafflowsia.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageText("3"), - new PagePetalRecipe("4", ModPetalRecipes.rafflowsiaRecipe)); + new PagePetalRecipe<>("4", ModPetalRecipes.rafflowsiaRecipe)); - dandelifeon = new ALexiconEntry(LibLexicon.GFLOWER_DANDELIFEON, categoryGenerationFlowers); + dandelifeon = new AlfheimLexiconEntry(LibLexicon.GFLOWER_DANDELIFEON, categoryGenerationFlowers); dandelifeon.setLexiconPages(new PageText("_w"), new PageText("0"), new PageText("1"), new PageText("2"), new PageText("3"), new PageText("4"), new PageText("5"), new PageText("6"), new PageText("10"), - new PageText("7"), new PagePetalRecipe("8", ModPetalRecipes.dandelifeonRecipe), + new PageText("7"), new PagePetalRecipe<>("8", ModPetalRecipes.dandelifeonRecipe), new PageCraftingRecipe("9", ModCraftingRecipes.recipeCellBlock)); // DEVICES ENTRIES - pylon = new BLexiconEntry(LibLexicon.DEVICE_PYLON, categoryDevices); + pylon = new BasicLexiconEntry(LibLexicon.DEVICE_PYLON, categoryDevices); pylon.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipePylon)); if (ConfigHandler.enchanterEnabled) { - manaEnchanting = new BLexiconEntry(LibLexicon.DEVICE_MANA_ENCHANTING, categoryDevices); + manaEnchanting = new BasicLexiconEntry(LibLexicon.DEVICE_MANA_ENCHANTING, categoryDevices); manaEnchanting .setLexiconPages(new PageText("0"), new PageText("1"), new PageMultiblock("2", ModMultiblocks.enchanter), new PageText("5"), new PageText("6"), @@ -709,10 +692,10 @@ public final class LexiconData { .setIcon(new ItemStack(ModBlocks.enchanter)); } - turntable = new BLexiconEntry(LibLexicon.DEVICE_TURNTABLE, categoryDevices); + turntable = new BasicLexiconEntry(LibLexicon.DEVICE_TURNTABLE, categoryDevices); turntable.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeTurntable)); - alchemy = new BLexiconEntry(LibLexicon.DEVICE_ALCHEMY, categoryDevices); + alchemy = new BasicLexiconEntry(LibLexicon.DEVICE_ALCHEMY, categoryDevices); alchemy.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeAlchemyCatalyst), new PageManaInfusionRecipe("2", ModManaAlchemyRecipes.leatherRecipe), @@ -740,23 +723,23 @@ public final class LexiconData { new PageManaInfusionRecipe("25", ModManaAlchemyRecipes.flowersRecipes), new PageManaInfusionRecipe("23", ModManaAlchemyRecipes.coarseDirtRecipe)); - openCrate = new BLexiconEntry(LibLexicon.DEVICE_OPEN_CRATE, categoryDevices); + openCrate = new BasicLexiconEntry(LibLexicon.DEVICE_OPEN_CRATE, categoryDevices); openCrate.setPriority().setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeOpenCrate)); - forestEye = new BLexiconEntry(LibLexicon.DEVICE_FOREST_EYE, categoryDevices); + forestEye = new BasicLexiconEntry(LibLexicon.DEVICE_FOREST_EYE, categoryDevices); forestEye.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeForestEye)); - forestDrum = new BLexiconEntry(LibLexicon.DEVICE_FOREST_DRUM, categoryDevices); + forestDrum = new BasicLexiconEntry(LibLexicon.DEVICE_FOREST_DRUM, categoryDevices); forestDrum.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeForestDrum)); - platform = new BLexiconEntry(LibLexicon.DEVICE_PLATFORM, categoryDevices); + platform = new BasicLexiconEntry(LibLexicon.DEVICE_PLATFORM, categoryDevices); platform.setLexiconPages(new PageText("0"), new PageText("2"), new PageCraftingRecipe("1", ModCraftingRecipes.recipePlatform)); - conjurationCatalyst = new ALexiconEntry(LibLexicon.DEVICE_MANA_CONJURATION, categoryDevices); + conjurationCatalyst = new AlfheimLexiconEntry(LibLexicon.DEVICE_MANA_CONJURATION, categoryDevices); conjurationCatalyst.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeConjurationCatalyst), new PageManaInfusionRecipe("2", ModManaConjurationRecipes.redstoneRecipe), @@ -770,14 +753,14 @@ public final class LexiconData { new PageManaInfusionRecipe("10", ModManaConjurationRecipes.leavesRecipes), new PageManaInfusionRecipe("11", ModManaConjurationRecipes.grassRecipe)); - spectralPlatform = new ALexiconEntry(LibLexicon.DEVICE_SPECTRAL_PLATFORM, categoryDevices); + spectralPlatform = new AlfheimLexiconEntry(LibLexicon.DEVICE_SPECTRAL_PLATFORM, categoryDevices); spectralPlatform.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeSpectralPlatform)); - gatherDrum = new ALexiconEntry(LibLexicon.DEVICE_GATHER_DRUM, categoryDevices); + gatherDrum = new AlfheimLexiconEntry(LibLexicon.DEVICE_GATHER_DRUM, categoryDevices); gatherDrum.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeGatherDrum)); - craftCrate = new ALexiconEntry(LibLexicon.DEVICE_CRAFT_CRATE, categoryDevices); + craftCrate = new AlfheimLexiconEntry(LibLexicon.DEVICE_CRAFT_CRATE, categoryDevices); craftCrate .setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipePlaceholder), new PageText("3"), @@ -786,7 +769,7 @@ public final class LexiconData { new PageCraftingRecipe("9", ModCraftingRecipes.recipesPatterns)) .setIcon(new ItemStack(ModBlocks.openCrate, 1, 1)); - brewery = new BLexiconEntry(LibLexicon.DEVICE_BREWERY, categoryDevices); + brewery = new BasicLexiconEntry(LibLexicon.DEVICE_BREWERY, categoryDevices); brewery.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeBrewery), new PageCraftingRecipe("3", ModCraftingRecipes.recipeVial), new PageText("4"), @@ -804,11 +787,11 @@ public final class LexiconData { new PageBrew(ModBrewRecipes.nightVisionBrew, "15a", "15b"), new PageBrew(ModBrewRecipes.absorptionBrew, "16a", "16b")); - flasks = new ALexiconEntry(LibLexicon.DEVICE_FLASKS, categoryDevices); + flasks = new AlfheimLexiconEntry(LibLexicon.DEVICE_FLASKS, categoryDevices); flasks.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeFlask)); - complexBrews = new BLexiconEntry(LibLexicon.DEVICE_COMPLEX_BREWS, categoryDevices); + complexBrews = new BasicLexiconEntry(LibLexicon.DEVICE_COMPLEX_BREWS, categoryDevices); complexBrews.setLexiconPages(new PageText("0"), new PageBrew(ModBrewRecipes.overloadBrew, "1a", "1b"), new PageBrew(ModBrewRecipes.soulCrossBrew, "2a", "2b"), new PageBrew(ModBrewRecipes.featherFeetBrew, "3a", "3b"), @@ -818,60 +801,60 @@ public final class LexiconData { .setIcon(((IBrewContainer) ModItems.vial).getItemForBrew(ModBrews.jumpBoost, new ItemStack(ModItems.vial))); - incense = new BLexiconEntry(LibLexicon.DEVICE_INCENSE, categoryDevices); + incense = new BasicLexiconEntry(LibLexicon.DEVICE_INCENSE, categoryDevices); incense.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageText("5"), new PageCraftingRecipe("3", ModCraftingRecipes.recipeIncenseStick), new PageCraftingRecipe("4", ModCraftingRecipes.recipeIncensePlate)); - hourglass = new BLexiconEntry(LibLexicon.DEVICE_HOURGLASS, categoryDevices); + hourglass = new BasicLexiconEntry(LibLexicon.DEVICE_HOURGLASS, categoryDevices); hourglass.setPriority().setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageText("3"), new PageText("4"), new PageCraftingRecipe("5", ModCraftingRecipes.recipeHourglass)); - ghostRail = new ALexiconEntry(LibLexicon.DEVICE_GHOST_RAIL, categoryDevices); + ghostRail = new AlfheimLexiconEntry(LibLexicon.DEVICE_GHOST_RAIL, categoryDevices); ghostRail.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeGhostRail)); - canopyDrum = new BLexiconEntry(LibLexicon.DEVICE_CANOPY_DRUM, categoryDevices); + canopyDrum = new BasicLexiconEntry(LibLexicon.DEVICE_CANOPY_DRUM, categoryDevices); canopyDrum.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeCanopyDrum)); - cocoon = Botania.gardenOfGlassLoaded ? new BLexiconEntry(LibLexicon.DEVICE_COCOON, categoryDevices) - : new ALexiconEntry(LibLexicon.DEVICE_COCOON, categoryDevices); + cocoon = Botania.gardenOfGlassLoaded ? new BasicLexiconEntry(LibLexicon.DEVICE_COCOON, categoryDevices) + : new AlfheimLexiconEntry(LibLexicon.DEVICE_COCOON, categoryDevices); cocoon.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeCocoon)); - manaBomb = new ALexiconEntry(LibLexicon.DEVICE_MANA_BOMB, categoryDevices); + manaBomb = new AlfheimLexiconEntry(LibLexicon.DEVICE_MANA_BOMB, categoryDevices); manaBomb.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeManaBomb)); - teruTeruBozu = new BLexiconEntry(LibLexicon.DEVICE_TERU_TERU_BOZU, categoryDevices); + teruTeruBozu = new BasicLexiconEntry(LibLexicon.DEVICE_TERU_TERU_BOZU, categoryDevices); teruTeruBozu.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeTeruTeruBozu)); - avatar = new BLexiconEntry(LibLexicon.DEVICE_AVATAR, categoryDevices); + avatar = new BasicLexiconEntry(LibLexicon.DEVICE_AVATAR, categoryDevices); avatar.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeAvatar)); - felPumpkin = new BLexiconEntry(LibLexicon.DEVICE_FEL_PUMPKIN, categoryDevices); + felPumpkin = new BasicLexiconEntry(LibLexicon.DEVICE_FEL_PUMPKIN, categoryDevices); felPumpkin.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeFelPumpkin)); // TOOLS ENTRIES - manaBlaster = new BLexiconEntry(LibLexicon.TOOL_MANA_BLASTER, categoryTools); + manaBlaster = new BasicLexiconEntry(LibLexicon.TOOL_MANA_BLASTER, categoryTools); manaBlaster.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageCraftingRecipe("3", ModCraftingRecipes.recipeManaBlaster)); - grassSeeds = new BLexiconEntry(LibLexicon.TOOL_GRASS_SEEDS, categoryTools); + grassSeeds = new BasicLexiconEntry(LibLexicon.TOOL_GRASS_SEEDS, categoryTools); grassSeeds.setLexiconPages(new PageText("0"), new PageManaInfusionRecipe("1", ModManaInfusionRecipes.grassSeedsRecipe), new PageManaInfusionRecipe("2", ModManaInfusionRecipes.podzolSeedsRecipe), new PageManaInfusionRecipe("3", ModManaInfusionRecipes.mycelSeedsRecipes), new PageText("4"), new PageCraftingRecipe("5", ModCraftingRecipes.recipesAltGrassSeeds)); - dirtRod = new BLexiconEntry(LibLexicon.TOOL_DIRT_ROD, categoryTools); + dirtRod = new BasicLexiconEntry(LibLexicon.TOOL_DIRT_ROD, categoryTools); dirtRod.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeDirtRod)); - terraformRod = new BLexiconEntry(LibLexicon.TOOL_TERRAFORM_ROD, categoryTools); + terraformRod = new BasicLexiconEntry(LibLexicon.TOOL_TERRAFORM_ROD, categoryTools); terraformRod.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageCraftingRecipe("3", ModCraftingRecipes.recipeTerraformRod)); - manasteelGear = new BLexiconEntry(LibLexicon.TOOL_MANASTEEL_GEAR, categoryTools); + manasteelGear = new BasicLexiconEntry(LibLexicon.TOOL_MANASTEEL_GEAR, categoryTools); manasteelGear.setPriority().setLexiconPages(new PageText("0"), new PageText("10"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeManasteelPick), new PageCraftingRecipe("2", ModCraftingRecipes.recipeManasteelShovel), @@ -883,29 +866,29 @@ public final class LexiconData { new PageCraftingRecipe("8", ModCraftingRecipes.recipeManasteelLegs), new PageCraftingRecipe("9", ModCraftingRecipes.recipeManasteelBoots)); - terrasteelArmor = new BLexiconEntry(LibLexicon.TOOL_TERRASTEEL_ARMOR, categoryTools); + terrasteelArmor = new BasicLexiconEntry(LibLexicon.TOOL_TERRASTEEL_ARMOR, categoryTools); terrasteelArmor.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeTerrasteelHelm), new PageCraftingRecipe("2", ModCraftingRecipes.recipeTerrasteelChest), new PageCraftingRecipe("3", ModCraftingRecipes.recipeTerrasteelLegs), new PageCraftingRecipe("4", ModCraftingRecipes.recipeTerrasteelBoots)); - grassHorn = new BLexiconEntry(LibLexicon.TOOL_GRASS_HORN, categoryTools); + grassHorn = new BasicLexiconEntry(LibLexicon.TOOL_GRASS_HORN, categoryTools); grassHorn.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeGrassHorn), new PageCraftingRecipe("2", ModCraftingRecipes.recipeLeafHorn), new PageCraftingRecipe("3", ModCraftingRecipes.recipeSnowHorn)); - terraBlade = new BLexiconEntry(LibLexicon.TOOL_TERRA_SWORD, categoryTools); + terraBlade = new BasicLexiconEntry(LibLexicon.TOOL_TERRA_SWORD, categoryTools); terraBlade.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeTerraSword)); - terraPick = new BLexiconEntry(LibLexicon.TOOL_TERRA_PICK, categoryTools); + terraPick = new BasicLexiconEntry(LibLexicon.TOOL_TERRA_PICK, categoryTools); terraPick.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageText("3"), new PageText("4"), new PageCraftingRecipe("5", ModCraftingRecipes.recipeTerraPick)); - waterRod = new BLexiconEntry(LibLexicon.TOOL_WATER_ROD, categoryTools); + waterRod = new BasicLexiconEntry(LibLexicon.TOOL_WATER_ROD, categoryTools); waterRod.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeWaterRod)); - elfGear = new ALexiconEntry(LibLexicon.TOOL_ELF_GEAR, categoryTools); + elfGear = new AlfheimLexiconEntry(LibLexicon.TOOL_ELF_GEAR, categoryTools); elfGear.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageCraftingRecipe("3", ModCraftingRecipes.recipeElementiumPick), new PageText("4"), new PageCraftingRecipe("5", ModCraftingRecipes.recipeElementiumShovel), new PageText("6"), @@ -917,10 +900,10 @@ public final class LexiconData { new PageCraftingRecipe("14", ModCraftingRecipes.recipeElementiumLegs), new PageCraftingRecipe("15", ModCraftingRecipes.recipeElementiumBoots)); - openBucket = new ALexiconEntry(LibLexicon.TOOL_OPEN_BUCKET, categoryTools); + openBucket = new AlfheimLexiconEntry(LibLexicon.TOOL_OPEN_BUCKET, categoryTools); openBucket.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeOpenBucket)); - rainbowRod = new ALexiconEntry(LibLexicon.TOOL_RAINBOW_ROD, categoryTools); + rainbowRod = new AlfheimLexiconEntry(LibLexicon.TOOL_RAINBOW_ROD, categoryTools); rainbowRod.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("6"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeRainbowRod), new PageCraftingRecipe("3", ModCraftingRecipes.recipeBifrost), @@ -928,112 +911,111 @@ public final class LexiconData { new PageCraftingRecipe("5", ModCraftingRecipes.recipeShimmerwoodPlanks), new PageCraftingRecipe("7", ModCraftingRecipes.recipePoolFabulous)); - tornadoRod = new BLexiconEntry(LibLexicon.TOOL_TORNADO_ROD, categoryTools); + tornadoRod = new BasicLexiconEntry(LibLexicon.TOOL_TORNADO_ROD, categoryTools); tornadoRod.setLexiconPages(new PageText("0"), new PageText("2"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeTornadoRod)); - fireRod = new BLexiconEntry(LibLexicon.TOOL_FIRE_ROD, categoryTools); + fireRod = new BasicLexiconEntry(LibLexicon.TOOL_FIRE_ROD, categoryTools); fireRod.setLexiconPages(new PageText("0"), new PageText("2"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeFireRod)); - vineBall = new BLexiconEntry(LibLexicon.TOOL_VINE_BALL, categoryTools); + vineBall = new BasicLexiconEntry(LibLexicon.TOOL_VINE_BALL, categoryTools); vineBall.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeVineBall), - new PageCraftingRecipe("3", ModCraftingRecipes.recipeSlingshot), - new PageCraftingRecipe("4", ModCraftingRecipes.recipeMossStone)); + new PageCraftingRecipe("3", ModCraftingRecipes.recipeSlingshot)); - laputaShard = new ALexiconEntry(LibLexicon.TOOL_LAPUTA_SHARD, categoryTools); + laputaShard = new AlfheimLexiconEntry(LibLexicon.TOOL_LAPUTA_SHARD, categoryTools); laputaShard.setLexiconPages(new PageText("0"), new PageText("2"), new PageCraftingRecipe("1", ModCraftingRecipes.recipesLaputaShard), new PageCraftingRecipe("3", ModCraftingRecipes.recipesLaputaShardUpgrade)); - virus = new ALexiconEntry(LibLexicon.TOOL_VIRUS, categoryTools); + virus = new AlfheimLexiconEntry(LibLexicon.TOOL_VIRUS, categoryTools); virus.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeVirusZombie), new PageCraftingRecipe("2", ModCraftingRecipes.recipeVirusSkeleton)); - skyDirtRod = new ALexiconEntry(LibLexicon.TOOL_SKY_DIRT_ROD, categoryTools); + skyDirtRod = new AlfheimLexiconEntry(LibLexicon.TOOL_SKY_DIRT_ROD, categoryTools); skyDirtRod.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeSkyDirtRod)); - glassPick = new BLexiconEntry(LibLexicon.TOOL_GLASS_PICK, categoryTools); + glassPick = new BasicLexiconEntry(LibLexicon.TOOL_GLASS_PICK, categoryTools); glassPick.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeGlassPick)); - diviningRod = new BLexiconEntry(LibLexicon.TOOL_DIVINING_ROD, categoryTools); + diviningRod = new BasicLexiconEntry(LibLexicon.TOOL_DIVINING_ROD, categoryTools); diviningRod.setLexiconPages(new PageText("0"), new PageText("2"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeDiviningRod)); - gravityRod = new ALexiconEntry(LibLexicon.TOOL_GRAVITY_ROD, categoryTools); + gravityRod = new AlfheimLexiconEntry(LibLexicon.TOOL_GRAVITY_ROD, categoryTools); gravityRod.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeGravityRod)); - regenIvy = new ALexiconEntry(LibLexicon.TOOL_REGEN_IVY, categoryTools); + regenIvy = new AlfheimLexiconEntry(LibLexicon.TOOL_REGEN_IVY, categoryTools); regenIvy.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeRegenIvy)); - missileRod = new ALexiconEntry(LibLexicon.TOOL_MISSILE_ROD, categoryTools); + missileRod = new AlfheimLexiconEntry(LibLexicon.TOOL_MISSILE_ROD, categoryTools); missileRod.setLexiconPages(new PageText("0"), new PageText("2"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeMissileRod)); - craftingHalo = new BLexiconEntry(LibLexicon.TOOL_CRAFTING_HALO, categoryTools); + craftingHalo = new BasicLexiconEntry(LibLexicon.TOOL_CRAFTING_HALO, categoryTools); craftingHalo.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeCraftingHalo)); - clip = new ALexiconEntry(LibLexicon.TOOL_CLIP, categoryTools); + clip = new AlfheimLexiconEntry(LibLexicon.TOOL_CLIP, categoryTools); clip.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeClip)); - cobbleRod = new BLexiconEntry(LibLexicon.TOOL_COBBLE_ROD, categoryTools); + cobbleRod = new BasicLexiconEntry(LibLexicon.TOOL_COBBLE_ROD, categoryTools); cobbleRod.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeCobbleRod)); - smeltRod = new BLexiconEntry(LibLexicon.TOOL_SMELT_ROD, categoryTools); + smeltRod = new BasicLexiconEntry(LibLexicon.TOOL_SMELT_ROD, categoryTools); smeltRod.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeSmeltRod)); - worldSeed = new ALexiconEntry(LibLexicon.TOOL_WORLD_SEED, categoryTools); + worldSeed = new AlfheimLexiconEntry(LibLexicon.TOOL_WORLD_SEED, categoryTools); worldSeed.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeWorldSeed)); - spellCloth = new BLexiconEntry(LibLexicon.TOOL_SPELL_CLOTH, categoryTools); + spellCloth = new BasicLexiconEntry(LibLexicon.TOOL_SPELL_CLOTH, categoryTools); spellCloth.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeSpellCloth)); - thornChakram = new BLexiconEntry(LibLexicon.TOOL_THORN_CHAKRAM, categoryTools); + thornChakram = new BasicLexiconEntry(LibLexicon.TOOL_THORN_CHAKRAM, categoryTools); thornChakram.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeThornChakram)); - fireChakram = new ALexiconEntry(LibLexicon.TOOL_FIRE_CHAKRAM, categoryTools); + fireChakram = new AlfheimLexiconEntry(LibLexicon.TOOL_FIRE_CHAKRAM, categoryTools); fireChakram.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeFireChakram)); - overgrowthSeed = new BLexiconEntry(LibLexicon.TOOL_OVERGROWTH_SEED, categoryTools); + overgrowthSeed = new BasicLexiconEntry(LibLexicon.TOOL_OVERGROWTH_SEED, categoryTools); overgrowthSeed.setPriority().setLexiconPages(new PageText("0"), new PageText("1")) .setIcon(new ItemStack(ModItems.overgrowthSeed)); overgrowthSeed.addExtraDisplayedRecipe(new ItemStack(ModItems.overgrowthSeed)); overgrowthSeed.addExtraDisplayedRecipe(new ItemStack(ModBlocks.enchantedSoil)); - livingwoodBow = new BLexiconEntry(LibLexicon.TOOL_LIVINGWOOD_BOW, categoryTools); + livingwoodBow = new BasicLexiconEntry(LibLexicon.TOOL_LIVINGWOOD_BOW, categoryTools); livingwoodBow.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeLivingwoodBow)); - crystalBow = new ALexiconEntry(LibLexicon.TOOL_CRYSTAL_BOW, categoryTools); + crystalBow = new AlfheimLexiconEntry(LibLexicon.TOOL_CRYSTAL_BOW, categoryTools); crystalBow.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeCrystalBow)); - temperanceStone = new BLexiconEntry(LibLexicon.TOOL_TEMPERANCE_STONE, categoryTools); + temperanceStone = new BasicLexiconEntry(LibLexicon.TOOL_TEMPERANCE_STONE, categoryTools); temperanceStone.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeTemperanceStone)); - terraAxe = new BLexiconEntry(LibLexicon.TOOL_TERRA_AXE, categoryTools); + terraAxe = new BasicLexiconEntry(LibLexicon.TOOL_TERRA_AXE, categoryTools); terraAxe.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeTerraAxe)); - obedienceStick = new BLexiconEntry(LibLexicon.TOOL_OBEDIENCE_STICK, categoryTools); + obedienceStick = new BasicLexiconEntry(LibLexicon.TOOL_OBEDIENCE_STICK, categoryTools); obedienceStick.setPriority().setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeObedienceStick)); - slimeBottle = new ALexiconEntry(LibLexicon.TOOL_SLIME_BOTTLE, categoryTools); + slimeBottle = new AlfheimLexiconEntry(LibLexicon.TOOL_SLIME_BOTTLE, categoryTools); slimeBottle.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeSlimeBottle)); - exchangeRod = new BLexiconEntry(LibLexicon.TOOL_EXCHANGE_ROD, categoryTools); + exchangeRod = new BasicLexiconEntry(LibLexicon.TOOL_EXCHANGE_ROD, categoryTools); exchangeRod.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageCraftingRecipe("3", ModCraftingRecipes.recipeExchangeRod)); - manaweave = new BLexiconEntry(LibLexicon.TOOL_MANAWEAVE, categoryTools); + manaweave = new BasicLexiconEntry(LibLexicon.TOOL_MANAWEAVE, categoryTools); manaweave.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeManaweaveCloth), new PageCraftingRecipe("3", ModCraftingRecipes.recipeManaweaveHelm), @@ -1041,42 +1023,42 @@ public final class LexiconData { new PageCraftingRecipe("5", ModCraftingRecipes.recipeManaweaveLegs), new PageCraftingRecipe("6", ModCraftingRecipes.recipeManaweaveBoots)); - autocraftingHalo = new BLexiconEntry(LibLexicon.TOOL_AUTOCRAFTING_HALO, categoryTools); + autocraftingHalo = new BasicLexiconEntry(LibLexicon.TOOL_AUTOCRAFTING_HALO, categoryTools); autocraftingHalo.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeAutocraftingHalo)); - sextant = new BLexiconEntry(LibLexicon.TOOL_SEXTANT, categoryTools); + sextant = new BasicLexiconEntry(LibLexicon.TOOL_SEXTANT, categoryTools); sextant.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeSextant)); // ENDER ENTRIES - enderAir = new BLexiconEntry(LibLexicon.ENDER_AIR, categoryEnder); + enderAir = new BasicLexiconEntry(LibLexicon.ENDER_AIR, categoryEnder); enderAir.setPriority().setLexiconPages(new PageText("0")); enderAir.addExtraDisplayedRecipe(new ItemStack(ModItems.manaResource, 1, 15)); LexiconRecipeMappings.map(new ItemStack(ModItems.manaResource, 1, 15), enderAir, 0); - enderEyeBlock = new BLexiconEntry(LibLexicon.ENDER_ENDER_EYE_BLOCK, categoryEnder); + enderEyeBlock = new BasicLexiconEntry(LibLexicon.ENDER_ENDER_EYE_BLOCK, categoryEnder); enderEyeBlock.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeEnderEyeBlock)); - pistonRelay = new BLexiconEntry(LibLexicon.ENDER_PISTON_RELAY, categoryEnder); + pistonRelay = new BasicLexiconEntry(LibLexicon.ENDER_PISTON_RELAY, categoryEnder); pistonRelay.setLexiconPages(new PageText("0"), new PageText("1"), new PageManaInfusionRecipe("2", ModManaInfusionRecipes.pistonRelayRecipe)); - enderHand = new BLexiconEntry(LibLexicon.ENDER_ENDER_HAND, categoryEnder); + enderHand = new BasicLexiconEntry(LibLexicon.ENDER_ENDER_HAND, categoryEnder); enderHand.setLexiconPages(new PageText(ConfigHandler.enderPickpocketEnabled ? "0" : "0a"), new PageText("2"), new PageCraftingRecipe(ConfigHandler.enderPickpocketEnabled ? "1" : "1a", ModCraftingRecipes.recipeEnderHand)); - enderDagger = new BLexiconEntry(LibLexicon.ENDER_ENDER_DAGGER, categoryEnder); + enderDagger = new BasicLexiconEntry(LibLexicon.ENDER_ENDER_DAGGER, categoryEnder); enderDagger.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeEnderDagger)); - spawnerClaw = new ALexiconEntry(LibLexicon.ENDER_SPAWNER_CLAW, categoryEnder); + spawnerClaw = new AlfheimLexiconEntry(LibLexicon.ENDER_SPAWNER_CLAW, categoryEnder); spawnerClaw.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeSpawnerClaw)); - redString = new ALexiconEntry(LibLexicon.ENDER_RED_STRING, categoryEnder); + redString = new AlfheimLexiconEntry(LibLexicon.ENDER_RED_STRING, categoryEnder); redString.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeRedString), new PageText("3"), new PageCraftingRecipe("4", ModCraftingRecipes.recipeRedStringContainer), new PageText("5"), @@ -1086,80 +1068,71 @@ public final class LexiconData { new PageCraftingRecipe("12", ModCraftingRecipes.recipeRedStringRelay), new PageText("13"), new PageCraftingRecipe("14", ModCraftingRecipes.recipeRedStringInterceptor)); - flightTiara = new ALexiconEntry(LibLexicon.ENDER_FLIGHT_TIARA, categoryEnder); + flightTiara = new AlfheimLexiconEntry(LibLexicon.ENDER_FLIGHT_TIARA, categoryEnder); flightTiara.setLexiconPages(new PageText("0"), new PageText("4"), new PageText("5"), new PageText("6"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeFlightTiara), new PageText("2"), new PageCraftingRecipe("3", ModCraftingRecipes.recipesWings)); - corporea = new ALexiconEntry(LibLexicon.ENDER_CORPOREA, categoryEnder); + corporea = new AlfheimLexiconEntry(LibLexicon.ENDER_CORPOREA, categoryEnder); corporea.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageText("3"), new PageText("4"), new PageText("5"), new PageText("6"), new PageCraftingRecipe("7", ModCraftingRecipes.recipeCorporeaSpark), new PageCraftingRecipe("8", ModCraftingRecipes.recipeMasterCorporeaSpark)); - corporeaIndex = new ALexiconEntry(LibLexicon.ENDER_CORPOREA_INDEX, categoryEnder); + corporeaIndex = new AlfheimLexiconEntry(LibLexicon.ENDER_CORPOREA_INDEX, categoryEnder); corporeaIndex.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageText("3"), new PageText("4"), new PageText("5"), new PageText("8"), new PageText("6"), new PageCraftingRecipe("7", ModCraftingRecipes.recipeCorporeaIndex)); - corporeaFunnel = new ALexiconEntry(LibLexicon.ENDER_CORPOREA_FUNNEL, categoryEnder); + corporeaFunnel = new AlfheimLexiconEntry(LibLexicon.ENDER_CORPOREA_FUNNEL, categoryEnder); corporeaFunnel.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeCorporeaFunnel)); - corporeaInterceptor = new ALexiconEntry(LibLexicon.ENDER_CORPOREA_INTERCEPTOR, categoryEnder); + corporeaInterceptor = new AlfheimLexiconEntry(LibLexicon.ENDER_CORPOREA_INTERCEPTOR, categoryEnder); corporeaInterceptor.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeCorporeaInterceptor)); - if (ConfigHandler.enderStuff19Enabled) { - endStoneDecor = new BLexiconEntry(LibLexicon.ENDER_END_STONE_DECOR, categoryEnder); - endStoneDecor.setLexiconPages(new PageText("0"), - new PageCraftingRecipe("1", ModCraftingRecipes.recipeEndStoneBricks), - new PageCraftingRecipe("2", ModCraftingRecipes.recipeEndStoneChiseledBricks), - new PageCraftingRecipe("3", ModCraftingRecipes.recipeEnderBricks), - new PageCraftingRecipe("4", ModCraftingRecipes.recipePillarEnderBricks)); - } - - spawnerMover = new ALexiconEntry(LibLexicon.ENDER_SPAWNER_MOVER, categoryEnder); + spawnerMover = new AlfheimLexiconEntry(LibLexicon.ENDER_SPAWNER_MOVER, categoryEnder); spawnerMover.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeSpawnerMover)); - keepIvy = new ALexiconEntry(LibLexicon.ENDER_KEEP_IVY, categoryEnder); + keepIvy = new AlfheimLexiconEntry(LibLexicon.ENDER_KEEP_IVY, categoryEnder); keepIvy.setLexiconPages(new PageText("0"), new PageText("2"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeKeepIvy)); - blackHoleTalisman = new ALexiconEntry(LibLexicon.ENDER_BLACK_HOLE_TALISMAN, categoryEnder); + blackHoleTalisman = new AlfheimLexiconEntry(LibLexicon.ENDER_BLACK_HOLE_TALISMAN, categoryEnder); blackHoleTalisman.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageCraftingRecipe("3", ModCraftingRecipes.recipeBlackHoleTalisman)); - corporeaCrystalCube = new ALexiconEntry(LibLexicon.ENDER_CORPOREA_CRYSTAL_CUBE, categoryEnder); + corporeaCrystalCube = new AlfheimLexiconEntry(LibLexicon.ENDER_CORPOREA_CRYSTAL_CUBE, categoryEnder); corporeaCrystalCube.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("3"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeCorporeaCrystalCube)); - luminizerTransport = new ALexiconEntry(LibLexicon.ENDER_LUMINIZER_TRANSPORT, categoryEnder); + luminizerTransport = new AlfheimLexiconEntry(LibLexicon.ENDER_LUMINIZER_TRANSPORT, categoryEnder); luminizerTransport.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeLuminizer), new PageText("3"), new PageCraftingRecipe("4", ModCraftingRecipes.recipeDetectorLuminizer), new PageText("5"), new PageCraftingRecipe("6", ModCraftingRecipes.recipeLuminizerLauncher)); - starSword = new ALexiconEntry(LibLexicon.ENDER_STAR_SWORD, categoryEnder); + starSword = new AlfheimLexiconEntry(LibLexicon.ENDER_STAR_SWORD, categoryEnder); starSword.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeStarSword)); - thunderSword = new ALexiconEntry(LibLexicon.ENDER_THUNDER_SWORD, categoryEnder); + thunderSword = new AlfheimLexiconEntry(LibLexicon.ENDER_THUNDER_SWORD, categoryEnder); thunderSword.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeThunderSword)); - corporeaRetainer = new ALexiconEntry(LibLexicon.ENDER_CORPOREA_RETAINER, categoryEnder); + corporeaRetainer = new AlfheimLexiconEntry(LibLexicon.ENDER_CORPOREA_RETAINER, categoryEnder); corporeaRetainer.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageCraftingRecipe("3", ModCraftingRecipes.recipeCorporeaRetainer)); // BAUBLES ENTRIES - baublesIntro = new BLexiconEntry(LibLexicon.BAUBLE_INTRO, categoryBaubles); + baublesIntro = new BasicLexiconEntry(LibLexicon.BAUBLE_INTRO, categoryBaubles); baublesIntro.setPriority().setLexiconPages(new PageText("0"), new PageImage("1", LibResources.ENTRY_BAUBLES), new PageText("2")); - cosmeticBaubles = new BLexiconEntry(LibLexicon.BAUBLE_COSMETIC, categoryBaubles); + cosmeticBaubles = new BasicLexiconEntry(LibLexicon.BAUBLE_COSMETIC, categoryBaubles); { - List pages = new ArrayList(); + List pages = new ArrayList<>(); pages.add(new PageText("0")); pages.add(new PageText("1")); for (int i = 0; i < 32; i++) @@ -1167,93 +1140,93 @@ public final class LexiconData { cosmeticBaubles.setPriority().setLexiconPages(pages.toArray(new LexiconPage[pages.size()])); } - tinyPlanet = new BLexiconEntry(LibLexicon.BAUBLE_TINY_PLANET, categoryBaubles); + tinyPlanet = new BasicLexiconEntry(LibLexicon.BAUBLE_TINY_PLANET, categoryBaubles); tinyPlanet.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeTinyPlanet), new PageCraftingRecipe("2", ModCraftingRecipes.recipeTinyPlanetBlock)); - manaRing = new BLexiconEntry(LibLexicon.BAUBLE_MANA_RING, categoryBaubles); + manaRing = new BasicLexiconEntry(LibLexicon.BAUBLE_MANA_RING, categoryBaubles); manaRing.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeManaRing), new PageCraftingRecipe("2", ModCraftingRecipes.recipeGreaterManaRing)); - auraRing = new BLexiconEntry(LibLexicon.BAUBLE_AURA_RING, categoryBaubles); + auraRing = new BasicLexiconEntry(LibLexicon.BAUBLE_AURA_RING, categoryBaubles); auraRing.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeAuraRing), new PageCraftingRecipe("2", ModCraftingRecipes.recipeGreaterAuraRing)); - travelBelt = new BLexiconEntry(LibLexicon.BAUBLE_TRAVEL_BELT, categoryBaubles); + travelBelt = new BasicLexiconEntry(LibLexicon.BAUBLE_TRAVEL_BELT, categoryBaubles); travelBelt.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeTravelBelt)); - knockbacklBelt = new BLexiconEntry(LibLexicon.BAUBLE_KNOCKBACK_BELT, categoryBaubles); + knockbacklBelt = new BasicLexiconEntry(LibLexicon.BAUBLE_KNOCKBACK_BELT, categoryBaubles); knockbacklBelt.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeKnocbackBelt)); - icePendant = new BLexiconEntry(LibLexicon.BAUBLE_ICE_PENDANT, categoryBaubles); + icePendant = new BasicLexiconEntry(LibLexicon.BAUBLE_ICE_PENDANT, categoryBaubles); icePendant.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeIcePendant)); - lavaPendant = new BLexiconEntry(LibLexicon.BAUBLE_LAVA_PENDANT, categoryBaubles); + lavaPendant = new BasicLexiconEntry(LibLexicon.BAUBLE_LAVA_PENDANT, categoryBaubles); lavaPendant.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeFirePendant)); - goldLaurel = new ALexiconEntry(LibLexicon.BAUBLE_GOLDEN_LAUREL, categoryBaubles); + goldLaurel = new AlfheimLexiconEntry(LibLexicon.BAUBLE_GOLDEN_LAUREL, categoryBaubles); goldLaurel.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeGoldenLaurel)); - waterRing = new BLexiconEntry(LibLexicon.BAUBLE_WATER_RING, categoryBaubles); + waterRing = new BasicLexiconEntry(LibLexicon.BAUBLE_WATER_RING, categoryBaubles); waterRing.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeWaterRing)); - miningRing = new BLexiconEntry(LibLexicon.BAUBLE_MINING_RING, categoryBaubles); + miningRing = new BasicLexiconEntry(LibLexicon.BAUBLE_MINING_RING, categoryBaubles); miningRing.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeMiningRing)); - magnetRing = new BLexiconEntry(LibLexicon.BAUBLE_MAGNET_RING, categoryBaubles); + magnetRing = new BasicLexiconEntry(LibLexicon.BAUBLE_MAGNET_RING, categoryBaubles); magnetRing.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeMagnetRing), new PageCraftingRecipe("2", ModCraftingRecipes.recipeGreaterMagnetRing)); - divaCharm = new ALexiconEntry(LibLexicon.BAUBLE_DIVA_CHARM, categoryBaubles); + divaCharm = new AlfheimLexiconEntry(LibLexicon.BAUBLE_DIVA_CHARM, categoryBaubles); divaCharm.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeDivaCharm)); - pixieRing = new ALexiconEntry(LibLexicon.BAUBLE_PIXIE_RING, categoryBaubles); + pixieRing = new AlfheimLexiconEntry(LibLexicon.BAUBLE_PIXIE_RING, categoryBaubles); pixieRing.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipePixieRing)); - superTravelBelt = new ALexiconEntry(LibLexicon.BAUBLE_SUPER_TRAVEL_BELT, categoryBaubles); + superTravelBelt = new AlfheimLexiconEntry(LibLexicon.BAUBLE_SUPER_TRAVEL_BELT, categoryBaubles); superTravelBelt.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeSuperTravelBelt)); - reachRing = new ALexiconEntry(LibLexicon.BAUBLE_REACH_RING, categoryBaubles); + reachRing = new AlfheimLexiconEntry(LibLexicon.BAUBLE_REACH_RING, categoryBaubles); reachRing.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeReachRing)); - itemFinder = new BLexiconEntry(LibLexicon.BAUBLE_ITEM_FINDER, categoryBaubles); + itemFinder = new BasicLexiconEntry(LibLexicon.BAUBLE_ITEM_FINDER, categoryBaubles); itemFinder.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeItemFinder)); - superLavaPendant = new ALexiconEntry(LibLexicon.BAUBLE_SUPER_LAVA_PENDANT, categoryBaubles); + superLavaPendant = new AlfheimLexiconEntry(LibLexicon.BAUBLE_SUPER_LAVA_PENDANT, categoryBaubles); superLavaPendant.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeSuperLavaPendant)); - bloodPendant = new BLexiconEntry(LibLexicon.BAUBLE_BLOOD_PENDANT, categoryBaubles); + bloodPendant = new BasicLexiconEntry(LibLexicon.BAUBLE_BLOOD_PENDANT, categoryBaubles); bloodPendant.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeBloodPendant)); - judgementCloaks = new ALexiconEntry(LibLexicon.BAUBLE_JUDGEMENT_CLOAKS, categoryBaubles); + judgementCloaks = new AlfheimLexiconEntry(LibLexicon.BAUBLE_JUDGEMENT_CLOAKS, categoryBaubles); judgementCloaks.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeHolyCloak), new PageCraftingRecipe("3", ModCraftingRecipes.recipeUnholyCloak)); - monocle = new BLexiconEntry(LibLexicon.BAUBLE_MONOCLE, categoryBaubles); + monocle = new BasicLexiconEntry(LibLexicon.BAUBLE_MONOCLE, categoryBaubles); monocle.setPriority().setLexiconPages(new PageText("0"), new PageText("2"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeMonocle)); - swapRing = new BLexiconEntry(LibLexicon.BAUBLE_SWAP_RING, categoryBaubles); + swapRing = new BasicLexiconEntry(LibLexicon.BAUBLE_SWAP_RING, categoryBaubles); swapRing.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeSwapRing)); - speedUpBelt = new BLexiconEntry(LibLexicon.BAUBLE_SPEED_UP_BELT, categoryBaubles); + speedUpBelt = new BasicLexiconEntry(LibLexicon.BAUBLE_SPEED_UP_BELT, categoryBaubles); speedUpBelt.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeSpeedUpBelt)); - baubleBox = new BLexiconEntry(LibLexicon.BAUBLE_BOX, categoryBaubles); + baubleBox = new BasicLexiconEntry(LibLexicon.BAUBLE_BOX, categoryBaubles); baubleBox.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeBaubleCase)) .setPriority(); // ALFHOMANCY ENTRIES - alfhomancyIntro = new BLexiconEntry(LibLexicon.ALF_INTRO, categoryAlfhomancy); + alfhomancyIntro = new BasicLexiconEntry(LibLexicon.ALF_INTRO, categoryAlfhomancy); alfhomancyIntro.setPriority() .setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeAlfPortal), @@ -1262,14 +1235,14 @@ public final class LexiconData { new PageText("7")) .setIcon(new ItemStack(ModItems.lexicon)); - elvenMessage = new ALexiconEntry(LibLexicon.ALF_MESSAGE, categoryAlfhomancy); + elvenMessage = new AlfheimLexiconEntry(LibLexicon.ALF_MESSAGE, categoryAlfhomancy); elvenMessage.setPriority() .setLexiconPages(new PageImage("0", LibResources.ENTRY_ELVEN_GARDE), new PageLoreText("1"), new PageLoreText("2"), new PageLoreText("3"), new PageLoreText("4"), new PageLoreText("5"), new PageLoreText("6")) - .setIcon(new ItemStack(Items.writable_book)); + .setIcon(new ItemStack(Items.WRITABLE_BOOK)); - elvenResources = new ALexiconEntry(LibLexicon.ALF_RESOURCES, categoryAlfhomancy); + elvenResources = new AlfheimLexiconEntry(LibLexicon.ALF_RESOURCES, categoryAlfhomancy); elvenResources.setPriority() .setLexiconPages(new PageText("0"), new PageElvenRecipe("1", ModElvenTradeRecipes.dreamwoodRecipe), new PageText("2"), new PageCraftingRecipe("10", ModCraftingRecipes.recipeDreamwoodTwig), @@ -1280,61 +1253,61 @@ public final class LexiconData { new PageElvenRecipe("9", ModElvenTradeRecipes.alfglassRecipe)) .setIcon(new ItemStack(ModItems.manaResource, 1, 9)); - gaiaRitual = new ALexiconEntry(LibLexicon.ALF_GAIA_RITUAL, categoryAlfhomancy); + gaiaRitual = new AlfheimLexiconEntry(LibLexicon.ALF_GAIA_RITUAL, categoryAlfhomancy); gaiaRitual.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeGaiaPylon), new PageMultiblock("2", ModMultiblocks.gaiaRitual), new PageText("3"), new PageText("4"), new PageText("5")).setIcon(new ItemStack(ModItems.manaResource, 1, 5)); LexiconRecipeMappings.map(new ItemStack(ModItems.manaResource, 1, 5), gaiaRitual, 0); - gaiaRitualHardmode = new ALexiconEntry(LibLexicon.ALF_GAIA_RITUAL_HARDMODE, categoryAlfhomancy); + gaiaRitualHardmode = new AlfheimLexiconEntry(LibLexicon.ALF_GAIA_RITUAL_HARDMODE, categoryAlfhomancy); gaiaRitualHardmode .setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeGaiaIngot)) .setIcon(new ItemStack(ModItems.manaResource, 1, 14)); - elvenLore = new ALexiconEntry(LibLexicon.ALF_LORE, categoryAlfhomancy); + elvenLore = new AlfheimLexiconEntry(LibLexicon.ALF_LORE, categoryAlfhomancy); elvenLore .setLexiconPages(new PageText("0"), new PageLoreText("1"), new PageLoreText("2"), new PageLoreText("3"), new PageLoreText("4"), new PageLoreText("5"), new PageLoreText("6"), new PageLoreText("7")) - .setIcon(new ItemStack(Items.writable_book)); + .setIcon(new ItemStack(Items.WRITABLE_BOOK)); if (ConfigHandler.relicsEnabled) { - relics = new ALexiconEntry(LibLexicon.ALF_RELICS, categoryAlfhomancy); + relics = new AlfheimLexiconEntry(LibLexicon.ALF_RELICS, categoryAlfhomancy); relics.setLexiconPages(new PageText("0")).setIcon(new ItemStack(ModItems.dice)); - relicInfo = new RLexiconEntry(LibLexicon.ALF_RELIC_INFO, categoryAlfhomancy, null); + relicInfo = new RelicLexiconEntry(LibLexicon.ALF_RELIC_INFO, categoryAlfhomancy, null); relicInfo.setLexiconPages(new PageText("0"), new PageText("1")).setIcon(new ItemStack(ModItems.dice)); - infiniteFruit = new RLexiconEntry(LibLexicon.ALF_INFINITE_FRUIT, categoryAlfhomancy, + infiniteFruit = new RelicLexiconEntry(LibLexicon.ALF_INFINITE_FRUIT, categoryAlfhomancy, ModAchievements.relicInfiniteFruit); infiniteFruit.setLexiconPages(new PageText("0")); - kingKey = new RLexiconEntry(LibLexicon.ALF_KING_KEY, categoryAlfhomancy, ModAchievements.relicKingKey); + kingKey = new RelicLexiconEntry(LibLexicon.ALF_KING_KEY, categoryAlfhomancy, ModAchievements.relicKingKey); kingKey.setLexiconPages(new PageText("0")); - flugelEye = new RLexiconEntry(LibLexicon.ALF_FLUGEL_EYE, categoryAlfhomancy, + flugelEye = new RelicLexiconEntry(LibLexicon.ALF_FLUGEL_EYE, categoryAlfhomancy, ModAchievements.relicFlugelEye); flugelEye.setLexiconPages(new PageText("0"), new PageText("1")); - thorRing = new RLexiconEntry(LibLexicon.ALF_THOR_RING, categoryAlfhomancy, ModAchievements.relicThorRing); + thorRing = new RelicLexiconEntry(LibLexicon.ALF_THOR_RING, categoryAlfhomancy, ModAchievements.relicThorRing); thorRing.setLexiconPages(new PageText("0")); - lokiRing = new RLexiconEntry(LibLexicon.ALF_LOKI_RING, categoryAlfhomancy, ModAchievements.relicLokiRing); + lokiRing = new RelicLexiconEntry(LibLexicon.ALF_LOKI_RING, categoryAlfhomancy, ModAchievements.relicLokiRing); lokiRing.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageText("3")); - odinRing = new RLexiconEntry(LibLexicon.ALF_ODIN_RING, categoryAlfhomancy, ModAchievements.relicOdinRing); + odinRing = new RelicLexiconEntry(LibLexicon.ALF_ODIN_RING, categoryAlfhomancy, ModAchievements.relicOdinRing); odinRing.setLexiconPages(new PageText("0")); } // MISCLENAEOUS ENTRIES - unstableBlocks = new BLexiconEntry(LibLexicon.MISC_UNSTABLE_BLOCKS, categoryMisc); + unstableBlocks = new BasicLexiconEntry(LibLexicon.MISC_UNSTABLE_BLOCKS, categoryMisc); unstableBlocks.setLexiconPages(new PageText("0"), new PageImage("1", LibResources.ENTRY_UNSTABLE_BLOCK), new PageCraftingRecipe("2", ModCraftingRecipes.recipesUnstableBlocks), new PageText("3"), new PageImage("4", LibResources.ENTRY_UNSTABLE_BEACON), new PageCraftingRecipe("5", ModCraftingRecipes.recipesManaBeacons), new PageText("6"), new PageCraftingRecipe("7", ModCraftingRecipes.recipesSignalFlares)); - decorativeBlocks = new BLexiconEntry(LibLexicon.MISC_DECORATIVE_BLOCKS, categoryMisc); + decorativeBlocks = new BasicLexiconEntry(LibLexicon.MISC_DECORATIVE_BLOCKS, categoryMisc); if (ConfigHandler.darkQuartzEnabled) decorativeBlocks.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeLivingrockDecor1), @@ -1352,8 +1325,6 @@ public final class LexiconData { new PageCraftingRecipe("14", ModCraftingRecipes.recipesLavenderQuartz), new PageCraftingRecipe("15", ModCraftingRecipes.recipeRedQuartz), new PageCraftingRecipe("23", ModCraftingRecipes.recipeSunnyQuartz), new PageText("16"), - new PageCraftingRecipe("17", ModCraftingRecipes.recipeReedBlock), - new PageCraftingRecipe("18", ModCraftingRecipes.recipeThatch), new PageCraftingRecipe("19", ModCraftingRecipes.recipeRoofTile), new PageCraftingRecipe("20", ModCraftingRecipes.recipeNetherBrick), new PageCraftingRecipe("21", ModCraftingRecipes.recipeSoulBrick), @@ -1374,97 +1345,82 @@ public final class LexiconData { new PageCraftingRecipe("14", ModCraftingRecipes.recipesLavenderQuartz), new PageCraftingRecipe("15", ModCraftingRecipes.recipeRedQuartz), new PageCraftingRecipe("23", ModCraftingRecipes.recipeSunnyQuartz), new PageText("16"), - new PageCraftingRecipe("17", ModCraftingRecipes.recipeReedBlock), - new PageCraftingRecipe("18", ModCraftingRecipes.recipeThatch), new PageCraftingRecipe("19", ModCraftingRecipes.recipeRoofTile), new PageCraftingRecipe("20", ModCraftingRecipes.recipeNetherBrick), new PageCraftingRecipe("21", ModCraftingRecipes.recipeSoulBrick), new PageCraftingRecipe("22", ModCraftingRecipes.recipeSnowBrick)); - dispenserTweaks = new BLexiconEntry(LibLexicon.MISC_DISPENSER_TWEAKS, categoryMisc); - dispenserTweaks.setLexiconPages(new PageText("0")).setPriority().setIcon(new ItemStack(Blocks.dispenser)); + dispenserTweaks = new BasicLexiconEntry(LibLexicon.MISC_DISPENSER_TWEAKS, categoryMisc); + dispenserTweaks.setLexiconPages(new PageText("0")).setPriority().setIcon(new ItemStack(Blocks.DISPENSER)); - shinyFlowers = new BLexiconEntry(LibLexicon.MISC_SHINY_FLOWERS, categoryMisc); + shinyFlowers = new BasicLexiconEntry(LibLexicon.MISC_SHINY_FLOWERS, categoryMisc); shinyFlowers.setLexiconPages(new PageText("0"), new PageText("3"), new PageCraftingRecipe("1", ModCraftingRecipes.recipesShinyFlowers), new PageCraftingRecipe("2", ModCraftingRecipes.recipesMiniIsland)); - prismarine = new BLexiconEntry(LibLexicon.MISC_PRISMARINE, categoryMisc); - prismarine.setLexiconPages(new PageText("0"), new PageText("1"), - new PageManaInfusionRecipe("2", ModManaAlchemyRecipes.prismarineRecipe), - new PageCraftingRecipe("3", ModCraftingRecipes.recipePrismarine), - new PageCraftingRecipe("4", ModCraftingRecipes.recipePrismarineBrick), - new PageCraftingRecipe("5", ModCraftingRecipes.recipeDarkPrismarine), - new PageCraftingRecipe("6", ModCraftingRecipes.recipeSeaLamp)); - - tinyPotato = new BLexiconEntry(LibLexicon.MISC_TINY_POTATO, categoryMisc); + tinyPotato = new BasicLexiconEntry(LibLexicon.MISC_TINY_POTATO, categoryMisc); tinyPotato.setLexiconPages(new PageText("0"), new PageManaInfusionRecipe("1", ModManaInfusionRecipes.tinyPotatoRecipe)); - headCreating = new HLexiconEntry(LibLexicon.MISC_HEAD_CREATING, categoryMisc); + headCreating = new HeadLexiconEntry(LibLexicon.MISC_HEAD_CREATING, categoryMisc); headCreating.setLexiconPages(new PageText("0"), new PageText("2"), new PageRuneRecipe("1", ModRuneRecipes.recipeHead)); - azulejo = new BLexiconEntry(LibLexicon.MISC_AZULEJO, categoryMisc); + azulejo = new BasicLexiconEntry(LibLexicon.MISC_AZULEJO, categoryMisc); azulejo.setLexiconPages(new PageText("0"), new PageImage("1", LibResources.ENTRY_AZULEJOS), new PageCraftingRecipe("2", ModCraftingRecipes.recipeAzulejo), new PageCraftingRecipe("3", ModCraftingRecipes.recipesAzulejoCycling)); - starfield = new ALexiconEntry(LibLexicon.MISC_STARFIELD, categoryMisc); + starfield = new AlfheimLexiconEntry(LibLexicon.MISC_STARFIELD, categoryMisc); starfield.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeStarfield)); - dirtPath = new BLexiconEntry(LibLexicon.MISC_DIRT_PATH, categoryMisc); + dirtPath = new BasicLexiconEntry(LibLexicon.MISC_DIRT_PATH, categoryMisc); dirtPath.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeDirtPath), new PageCraftingRecipe("2", ModCraftingRecipes.recipeDirtPathSlab)); - mushrooms = new BLexiconEntry(LibLexicon.MISC_MUSHROOMS, categoryMisc); + mushrooms = new BasicLexiconEntry(LibLexicon.MISC_MUSHROOMS, categoryMisc); mushrooms.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipesMushrooms)); - phantomInk = new BLexiconEntry(LibLexicon.MISC_PHANTOM_INK, categoryMisc); + phantomInk = new BasicLexiconEntry(LibLexicon.MISC_PHANTOM_INK, categoryMisc); phantomInk.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipePhantomInk)); - if (ConfigHandler.stones18Enabled) { - stoneAlchemy = new BLexiconEntry(LibLexicon.MISC_STONE_ALCHEMY, categoryMisc); - stoneAlchemy.setLexiconPages(new PageText("0"), - new PageManaInfusionRecipe("1", ModManaAlchemyRecipes.stoneRecipes), - new PageCraftingRecipe("2", ModCraftingRecipes.recipe18StonePolish), - new PageCraftingRecipe("3", ModCraftingRecipes.recipe18StoneBrick), - new PageCraftingRecipe("4", ModCraftingRecipes.recipe18StoneChisel)); - } + stoneAlchemy = new BasicLexiconEntry(LibLexicon.MISC_STONE_ALCHEMY, categoryMisc); + stoneAlchemy.setLexiconPages(new PageText("0"), + new PageManaInfusionRecipe("1", ModManaAlchemyRecipes.stoneRecipes)); - blazeBlock = new BLexiconEntry(LibLexicon.MISC_BLAZE_BLOCK, categoryMisc); + blazeBlock = new BasicLexiconEntry(LibLexicon.MISC_BLAZE_BLOCK, categoryMisc); blazeBlock.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeBlazeBlock)); - LexiconRecipeMappings.map(new ItemStack(Blocks.obsidian), blazeBlock, 0); + LexiconRecipeMappings.map(new ItemStack(Blocks.OBSIDIAN), blazeBlock, 0); - challenges = new BLexiconEntry(LibLexicon.MISC_CHALLENGES, categoryMisc); + challenges = new BasicLexiconEntry(LibLexicon.MISC_CHALLENGES, categoryMisc); challenges.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2")).setPriority() .setIcon(new ItemStack(ModItems.cosmetic, 1, 31)); - cacophonium = new BLexiconEntry(LibLexicon.MISC_CACOPHONIUM, categoryMisc); + cacophonium = new BasicLexiconEntry(LibLexicon.MISC_CACOPHONIUM, categoryMisc); cacophonium.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeCacophonium), new PageText("2")); - pavement = new BLexiconEntry(LibLexicon.MISC_PAVEMENT, categoryMisc); + pavement = new BasicLexiconEntry(LibLexicon.MISC_PAVEMENT, categoryMisc); pavement.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipesPavement)); - preventingDecay = new DLexiconEntry(LibLexicon.MISC_PRENTING_DECAY, categoryMisc); - preventingDecay.setLexiconPages(new PageText("0")).setIcon(new ItemStack(Blocks.deadbush)); + preventingDecay = new DogLexiconEntry(LibLexicon.MISC_PRENTING_DECAY, categoryMisc); + preventingDecay.setLexiconPages(new PageText("0")).setIcon(new ItemStack(Blocks.DEADBUSH)); if (Botania.bcTriggersLoaded) { - bcIntegration = new CLexiconEntry(LibLexicon.MISC_BC_INTEGRATION, categoryMisc, "BuildCraft"); - bcIntegration.setLexiconPages(new PageText("0")).setIcon(new ItemStack(Items.redstone)); + bcIntegration = new CompatLexiconEntry(LibLexicon.MISC_BC_INTEGRATION, categoryMisc, "BuildCraft"); + bcIntegration.setLexiconPages(new PageText("0")).setIcon(new ItemStack(Items.REDSTONE)); } } public static void postInit() { if (SheddingHandler.hasShedding()) { - shedding = new BLexiconEntry(LibLexicon.MISC_SHEDDING, BotaniaAPI.categoryMisc); - shedding.setLexiconPages(new PageText("0")).setPriority().setIcon(new ItemStack(Items.feather)); + shedding = new BasicLexiconEntry(LibLexicon.MISC_SHEDDING, BotaniaAPI.categoryMisc); + shedding.setLexiconPages(new PageText("0")).setPriority().setIcon(new ItemStack(Items.FEATHER)); SheddingHandler.addToLexicon(); } if (Botania.thaumcraftLoaded) { - tcIntegration = new CLexiconEntry(LibLexicon.MISC_TC_INTEGRATION, BotaniaAPI.categoryMisc, "Thaumcraft"); + tcIntegration = new CompatLexiconEntry(LibLexicon.MISC_TC_INTEGRATION, BotaniaAPI.categoryMisc, "Thaumcraft"); if (ConfigHandler.enableThaumcraftStablizers) tcIntegration.setLexiconPages(new PageText("0"), new PageText("1"), @@ -1481,7 +1437,7 @@ public final class LexiconData { } if (Botania.etFuturumLoaded) { - banners = new CLexiconEntry(LibLexicon.MISC_BANNERS, BotaniaAPI.categoryMisc, "EtFuturum"); + banners = new CompatLexiconEntry(LibLexicon.MISC_BANNERS, BotaniaAPI.categoryMisc, "EtFuturum"); banners.setLexiconPages(new PageText("0"), new PageImage("1", LibResources.ENTRY_BANNERS)) .setIcon(new ItemStack(ModItems.lexicon)); } diff --git a/src/main/java/vazkii/botania/common/lexicon/RLexiconEntry.java b/src/main/java/vazkii/botania/common/lexicon/RelicLexiconEntry.java similarity index 69% rename from src/main/java/vazkii/botania/common/lexicon/RLexiconEntry.java rename to src/main/java/vazkii/botania/common/lexicon/RelicLexiconEntry.java index 1980bbff5..9d0d9ee41 100644 --- a/src/main/java/vazkii/botania/common/lexicon/RLexiconEntry.java +++ b/src/main/java/vazkii/botania/common/lexicon/RelicLexiconEntry.java @@ -11,18 +11,18 @@ package vazkii.botania.common.lexicon; import net.minecraft.client.Minecraft; -import net.minecraft.client.entity.EntityClientPlayerMP; +import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.stats.Achievement; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.lexicon.LexiconCategory; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -public class RLexiconEntry extends BLexiconEntry { +public class RelicLexiconEntry extends BasicLexiconEntry { - Achievement a; + final Achievement a; - public RLexiconEntry(String unlocalizedName, LexiconCategory category, Achievement a) { + public RelicLexiconEntry(String unlocalizedName, LexiconCategory category, Achievement a) { super(unlocalizedName, category); setKnowledgeType(BotaniaAPI.relicKnowledge); this.a = a; @@ -33,7 +33,7 @@ public class RLexiconEntry extends BLexiconEntry { @Override @SideOnly(Side.CLIENT) public boolean isVisible() { - EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer; + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; return a == null || player.capabilities.isCreativeMode || player.getStatFileWriter().hasAchievementUnlocked(a); } diff --git a/src/main/java/vazkii/botania/common/lexicon/TLexiconEntry.java b/src/main/java/vazkii/botania/common/lexicon/TutLexiconEntry.java similarity index 85% rename from src/main/java/vazkii/botania/common/lexicon/TLexiconEntry.java rename to src/main/java/vazkii/botania/common/lexicon/TutLexiconEntry.java index d03e649f5..2a4beb1fd 100644 --- a/src/main/java/vazkii/botania/common/lexicon/TLexiconEntry.java +++ b/src/main/java/vazkii/botania/common/lexicon/TutLexiconEntry.java @@ -16,12 +16,12 @@ import vazkii.botania.api.BotaniaAPI; import vazkii.botania.common.lexicon.page.PageTutorial; import vazkii.botania.common.lib.LibLexicon; -public class TLexiconEntry extends BLexiconEntry { +public class TutLexiconEntry extends BasicLexiconEntry { - public TLexiconEntry() { + public TutLexiconEntry() { super(LibLexicon.BASICS_TUTORIAL, BotaniaAPI.categoryBasics); setPriority(); - setIcon(new ItemStack(Items.book)); + setIcon(new ItemStack(Items.BOOK)); setLexiconPages(new PageTutorial("0")); } diff --git a/src/main/java/vazkii/botania/common/lexicon/WIPLexiconEntry.java b/src/main/java/vazkii/botania/common/lexicon/WIPLexiconEntry.java index da8b7031f..be16aca87 100644 --- a/src/main/java/vazkii/botania/common/lexicon/WIPLexiconEntry.java +++ b/src/main/java/vazkii/botania/common/lexicon/WIPLexiconEntry.java @@ -13,7 +13,7 @@ package vazkii.botania.common.lexicon; import vazkii.botania.api.lexicon.IAddonEntry; import vazkii.botania.api.lexicon.LexiconCategory; -public class WIPLexiconEntry extends BLexiconEntry implements IAddonEntry { +public class WIPLexiconEntry extends BasicLexiconEntry implements IAddonEntry { public WIPLexiconEntry(String unlocalizedName, LexiconCategory category) { super(unlocalizedName, category); diff --git a/src/main/java/vazkii/botania/common/lexicon/WLexiconEntry.java b/src/main/java/vazkii/botania/common/lexicon/WelcomeLexiconEntry.java similarity index 85% rename from src/main/java/vazkii/botania/common/lexicon/WLexiconEntry.java rename to src/main/java/vazkii/botania/common/lexicon/WelcomeLexiconEntry.java index 26d745ec6..f04f75fb2 100644 --- a/src/main/java/vazkii/botania/common/lexicon/WLexiconEntry.java +++ b/src/main/java/vazkii/botania/common/lexicon/WelcomeLexiconEntry.java @@ -18,11 +18,13 @@ import vazkii.botania.common.item.ModItems; import vazkii.botania.common.lexicon.page.PageText; import vazkii.botania.common.lib.LibLexicon; -public class WLexiconEntry extends BLexiconEntry { +import javax.annotation.Nonnull; + +public class WelcomeLexiconEntry extends BasicLexiconEntry { private static final int PAGES = 7; - public WLexiconEntry() { + public WelcomeLexiconEntry() { super(LibLexicon.BASICS_WELCOME, BotaniaAPI.categoryBasics); setPriority(); setIcon(new ItemStack(ModItems.cosmetic, 1, 31)); @@ -34,7 +36,7 @@ public class WLexiconEntry extends BLexiconEntry { } @Override - public int compareTo(LexiconEntry o) { + public int compareTo(@Nonnull LexiconEntry o) { return -1; } diff --git a/src/main/java/vazkii/botania/common/lexicon/page/PageBrew.java b/src/main/java/vazkii/botania/common/lexicon/page/PageBrew.java index c1e7ed883..c7e324b3b 100644 --- a/src/main/java/vazkii/botania/common/lexicon/page/PageBrew.java +++ b/src/main/java/vazkii/botania/common/lexicon/page/PageBrew.java @@ -10,14 +10,13 @@ */ package vazkii.botania.common.lexicon.page; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.resources.I18n; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; +import net.minecraft.util.text.TextFormatting; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.oredict.OreDictionary; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.brew.Brew; @@ -25,13 +24,15 @@ import vazkii.botania.api.internal.IGuiLexiconEntry; import vazkii.botania.api.lexicon.ILexicon; import vazkii.botania.api.lexicon.ITwoNamedPage; import vazkii.botania.api.recipe.RecipeBrew; +import vazkii.botania.common.core.helper.PlayerHelper; import vazkii.botania.common.item.ModItems; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.ArrayList; +import java.util.List; public class PageBrew extends PageRecipe implements ITwoNamedPage { - RecipeBrew recipe; + final RecipeBrew recipe; String text; public PageBrew(RecipeBrew recipe, String unlocalizedName, String bottomText) { @@ -41,6 +42,7 @@ public class PageBrew extends PageRecipe implements ITwoNamedPage { } @Override + @SideOnly(Side.CLIENT) public void renderRecipe(IGuiLexiconEntry gui, int mx, int my) { int width = gui.getWidth() - 30; int height = gui.getHeight(); @@ -48,23 +50,23 @@ public class PageBrew extends PageRecipe implements ITwoNamedPage { int y = gui.getTop() + 12; Brew brew = recipe.getBrew(); - FontRenderer renderer = Minecraft.getMinecraft().fontRenderer; + FontRenderer renderer = Minecraft.getMinecraft().fontRendererObj; boolean unicode = renderer.getUnicodeFlag(); renderer.setUnicodeFlag(true); - String s = EnumChatFormatting.BOLD + String.format(StatCollector.translateToLocal("botaniamisc.brewOf"), StatCollector.translateToLocal(brew.getUnlocalizedName())); + String s = TextFormatting.BOLD + I18n.format("botaniamisc.brewOf", I18n.format(brew.getUnlocalizedName())); renderer.drawString(s, gui.getLeft() + gui.getWidth() / 2 - renderer.getStringWidth(s) / 2, y, 0x222222); renderer.setUnicodeFlag(unicode); PageText.renderText(x, y + 22, width, height, text); - ItemStack book = Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem(); - if(book != null && book.getItem() instanceof ILexicon && ((ILexicon) book.getItem()).isKnowledgeUnlocked(book, BotaniaAPI.elvenKnowledge)) { + ItemStack book = PlayerHelper.getFirstHeldItemClass(Minecraft.getMinecraft().thePlayer, ILexicon.class); + if(book != null && ((ILexicon) book.getItem()).isKnowledgeUnlocked(book, BotaniaAPI.elvenKnowledge)) { renderItemAtLinePos(gui, 20, 2, y + 12, recipe.getOutput(new ItemStack(ModItems.vial))); renderItemAtLinePos(gui, 20, 3, y + 12, recipe.getOutput(new ItemStack(ModItems.vial, 1, 1))); } else renderItemAtLinePos(gui, 0, -1, y + 12, recipe.getOutput(new ItemStack(ModItems.vial))); int i = 0; y = gui.getTop() + gui.getHeight() - 54; - List inputs = new ArrayList(recipe.getInputs()); + List inputs = new ArrayList<>(recipe.getInputs()); int offset = gui.getWidth() / 2 - inputs.size() * 9; for(Object input : inputs) { @@ -98,7 +100,7 @@ public class PageBrew extends PageRecipe implements ITwoNamedPage { @Override public List getDisplayedRecipes() { - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList<>(); list.add(recipe.getOutput(new ItemStack(ModItems.vial))); return list; } diff --git a/src/main/java/vazkii/botania/common/lexicon/page/PageCraftingRecipe.java b/src/main/java/vazkii/botania/common/lexicon/page/PageCraftingRecipe.java index 312a81815..40776c448 100644 --- a/src/main/java/vazkii/botania/common/lexicon/page/PageCraftingRecipe.java +++ b/src/main/java/vazkii/botania/common/lexicon/page/PageCraftingRecipe.java @@ -10,38 +10,37 @@ */ package vazkii.botania.common.lexicon.page; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.resources.I18n; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.item.crafting.ShapedRecipes; import net.minecraft.item.crafting.ShapelessRecipes; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; +import net.minecraftforge.fml.relauncher.ReflectionHelper; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; - import org.lwjgl.opengl.GL11; - import vazkii.botania.api.internal.IGuiLexiconEntry; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.lexicon.LexiconRecipeMappings; import vazkii.botania.client.core.helper.RenderHelper; import vazkii.botania.client.lib.LibResources; -import cpw.mods.fml.relauncher.ReflectionHelper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; public class PageCraftingRecipe extends PageRecipe { private static final ResourceLocation craftingOverlay = new ResourceLocation(LibResources.GUI_CRAFTING_OVERLAY); - List recipes; + final List recipes; int ticksElapsed = 0; int recipeAt = 0; @@ -53,7 +52,7 @@ public class PageCraftingRecipe extends PageRecipe { } public PageCraftingRecipe(String unlocalizedName, IRecipe recipe) { - this(unlocalizedName, Arrays.asList(recipe)); + this(unlocalizedName, Collections.singletonList(recipe)); } @Override @@ -73,36 +72,36 @@ public class PageCraftingRecipe extends PageRecipe { TextureManager render = Minecraft.getMinecraft().renderEngine; render.bindTexture(craftingOverlay); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.color(1F, 1F, 1F, 1F); ((GuiScreen) gui).drawTexturedModalRect(gui.getLeft(), gui.getTop(), 0, 0, gui.getWidth(), gui.getHeight()); int iconX = gui.getLeft() + 115; int iconY = gui.getTop() + 12; - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); if(shapelessRecipe) { ((GuiScreen) gui).drawTexturedModalRect(iconX, iconY, 240, 0, 16, 16); if(mx >= iconX && my >= iconY && mx < iconX + 16 && my < iconY + 16) - RenderHelper.renderTooltip(mx, my, Arrays.asList(StatCollector.translateToLocal("botaniamisc.shapeless"))); + RenderHelper.renderTooltip(mx, my, Collections.singletonList(I18n.format("botaniamisc.shapeless"))); iconY += 20; } render.bindTexture(craftingOverlay); - GL11.glEnable(GL11.GL_BLEND); + GlStateManager.enableBlend(); if(oreDictRecipe) { ((GuiScreen) gui).drawTexturedModalRect(iconX, iconY, 240, 16, 16, 16); if(mx >= iconX && my >= iconY && mx < iconX + 16 && my < iconY + 16) - RenderHelper.renderTooltip(mx, my, Arrays.asList(StatCollector.translateToLocal("botaniamisc.oredict"))); + RenderHelper.renderTooltip(mx, my, Collections.singletonList(I18n.format("botaniamisc.oredict"))); } - GL11.glDisable(GL11.GL_BLEND); + GlStateManager.disableBlend(); } @Override @@ -130,14 +129,14 @@ public class PageCraftingRecipe extends PageRecipe { renderItemAtGridPos(gui, 1 + x, 1 + y, shaped.recipeItems[y * shaped.recipeWidth + x], true); } else if(recipe instanceof ShapedOreRecipe) { ShapedOreRecipe shaped = (ShapedOreRecipe) recipe; - int width = (Integer) ReflectionHelper.getPrivateValue(ShapedOreRecipe.class, shaped, 4); - int height = (Integer) ReflectionHelper.getPrivateValue(ShapedOreRecipe.class, shaped, 5); + int width = ReflectionHelper.getPrivateValue(ShapedOreRecipe.class, shaped, 4); + int height = ReflectionHelper.getPrivateValue(ShapedOreRecipe.class, shaped, 5); for(int y = 0; y < height; y++) for(int x = 0; x < width; x++) { Object input = shaped.getInput()[y * width + x]; if(input != null) - renderItemAtGridPos(gui, 1 + x, 1 + y, input instanceof ItemStack ? (ItemStack) input : ((ArrayList) input).get(0), true); + renderItemAtGridPos(gui, 1 + x, 1 + y, input instanceof ItemStack ? (ItemStack) input : ((List) input).get(0), true); } oreDictRecipe = true; @@ -152,7 +151,7 @@ public class PageCraftingRecipe extends PageRecipe { if(index >= shapeless.recipeItems.size()) break drawGrid; - renderItemAtGridPos(gui, 1 + x, 1 + y, (ItemStack) shapeless.recipeItems.get(index), true); + renderItemAtGridPos(gui, 1 + x, 1 + y, shapeless.recipeItems.get(index), true); } } @@ -170,7 +169,7 @@ public class PageCraftingRecipe extends PageRecipe { Object input = shapeless.getInput().get(index); if(input != null) - renderItemAtGridPos(gui, 1 + x, 1 + y, input instanceof ItemStack ? (ItemStack) input : ((ArrayList) input).get(0), true); + renderItemAtGridPos(gui, 1 + x, 1 + y, input instanceof ItemStack ? (ItemStack) input : ((List) input).get(0), true); } } diff --git a/src/main/java/vazkii/botania/common/lexicon/page/PageElvenRecipe.java b/src/main/java/vazkii/botania/common/lexicon/page/PageElvenRecipe.java index 447d86e6f..a5ee24418 100644 --- a/src/main/java/vazkii/botania/common/lexicon/page/PageElvenRecipe.java +++ b/src/main/java/vazkii/botania/common/lexicon/page/PageElvenRecipe.java @@ -1,35 +1,33 @@ package vazkii.botania.common.lexicon.page; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.oredict.OreDictionary; - import org.lwjgl.opengl.GL11; - import vazkii.botania.api.internal.IGuiLexiconEntry; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.lexicon.LexiconRecipeMappings; import vazkii.botania.api.recipe.RecipeElvenTrade; +import vazkii.botania.client.core.handler.MiscellaneousIcons; import vazkii.botania.client.lib.LibResources; -import vazkii.botania.common.block.BlockAlfPortal; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; public class PageElvenRecipe extends PageRecipe { private static final ResourceLocation elvenTradeOverlay = new ResourceLocation(LibResources.GUI_ELVEN_TRADE_OVERLAY); - List recipes; + final List recipes; int ticksElapsed = 0; int recipeAt = 0; @@ -39,13 +37,14 @@ public class PageElvenRecipe extends PageRecipe { } public PageElvenRecipe(String unlocalizedName, RecipeElvenTrade recipe) { - this(unlocalizedName, Arrays.asList(recipe)); + this(unlocalizedName, Collections.singletonList(recipe)); } @Override public void onPageAdded(LexiconEntry entry, int index) { for(RecipeElvenTrade recipe : recipes) - LexiconRecipeMappings.map(recipe.getOutput(), entry, index); + for(ItemStack output : recipe.getOutputs()) + LexiconRecipeMappings.map(output, entry, index); } @Override @@ -54,13 +53,16 @@ public class PageElvenRecipe extends PageRecipe { RecipeElvenTrade recipe = recipes.get(recipeAt); TextureManager render = Minecraft.getMinecraft().renderEngine; render.bindTexture(elvenTradeOverlay); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.color(1F, 1F, 1F, 1F); ((GuiScreen) gui).drawTexturedModalRect(gui.getLeft(), gui.getTop(), 0, 0, gui.getWidth(), gui.getHeight()); - GL11.glDisable(GL11.GL_BLEND); + GlStateManager.disableBlend(); - renderItemAtGridPos(gui, 3, 1, recipe.getOutput(), false); + List outputs = recipe.getOutputs(); + for(int i = 0; i < outputs.size(); i++) { + renderItemAtOutputPos(gui, i % 2, i / 2, outputs.get(i)); + } List inputs = recipe.getInputs(); int i = 0; @@ -73,9 +75,9 @@ public class PageElvenRecipe extends PageRecipe { i++; } - IIcon portalIcon = BlockAlfPortal.portalTex; - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); - RenderItem.getInstance().renderIcon(gui.getLeft() + 22, gui.getTop() + 36, portalIcon, 48, 48); + TextureAtlasSprite portalIcon = MiscellaneousIcons.INSTANCE.alfPortalTex; + Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + ((GuiScreen) gui).drawTexturedModalRect(gui.getLeft() + 22, gui.getTop() + 36, portalIcon, 48, 48); } @SideOnly(Side.CLIENT) @@ -96,6 +98,26 @@ public class PageElvenRecipe extends PageRecipe { renderItem(gui, xPos, yPos, stack1, false); } + @SideOnly(Side.CLIENT) + public void renderItemAtOutputPos(IGuiLexiconEntry gui, int x, int y, ItemStack stack) { + if(stack == null || stack.getItem() == null) + return; + stack = stack.copy(); + + if(stack.getItemDamage() == Short.MAX_VALUE) + stack.setItemDamage(0); + + int xPos = gui.getLeft() + x * 20 + 94; + int yPos = gui.getTop() + y * 20 + 52; + + ItemStack stack1 = stack.copy(); + if (stack1.getItemDamage() == -1) { + stack1.setItemDamage(0); + } + + renderItem(gui, xPos, yPos, stack1, false); + } + @Override @SideOnly(Side.CLIENT) @@ -114,9 +136,9 @@ public class PageElvenRecipe extends PageRecipe { @Override public List getDisplayedRecipes() { - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList<>(); for(RecipeElvenTrade r : recipes) - list.add(r.getOutput()); + list.addAll(r.getOutputs()); return list; } diff --git a/src/main/java/vazkii/botania/common/lexicon/page/PageEntity.java b/src/main/java/vazkii/botania/common/lexicon/page/PageEntity.java index 89fba690d..89d17e710 100644 --- a/src/main/java/vazkii/botania/common/lexicon/page/PageEntity.java +++ b/src/main/java/vazkii/botania/common/lexicon/page/PageEntity.java @@ -10,39 +10,35 @@ */ package vazkii.botania.common.lexicon.page; -import java.lang.reflect.Constructor; - import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityList; -import net.minecraft.util.MathHelper; +import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.internal.IGuiLexiconEntry; import vazkii.botania.api.lexicon.LexiconPage; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.lang.reflect.Constructor; public class PageEntity extends LexiconPage{ Entity dummyEntity; int relativeMouseX, relativeMouseY; boolean tooltipEntity; - int size; + final int size; Constructor entityConstructor; public PageEntity(String unlocalizedName, String entity, int size) { super(unlocalizedName); - Class EntityClass = (Class) EntityList.stringToClassMapping.get(entity); + Class EntityClass = (Class) EntityList.NAME_TO_CLASS.get(entity); this.size = size; try { - entityConstructor = EntityClass.getConstructor(new Class[] {World.class}); + entityConstructor = EntityClass.getConstructor(World.class); } catch (Exception e) { e.printStackTrace(); } @@ -84,21 +80,20 @@ public class PageEntity extends LexiconPage{ public void renderEntity(IGuiLexiconEntry gui, Entity entity, int x, int y, int scale, float rotation) { dummyEntity.worldObj = Minecraft.getMinecraft() != null ? Minecraft.getMinecraft().theWorld : null; - GL11.glEnable(GL11.GL_COLOR_MATERIAL); - GL11.glPushMatrix(); - GL11.glTranslatef(x, y, 50.0F); - GL11.glScalef(-scale, scale, scale); - GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(rotation, 0.0F, 1.0F, 0.0F); + GlStateManager.enableColorMaterial(); + GlStateManager.pushMatrix(); + GlStateManager.translate(x, y, 50.0F); + GlStateManager.scale(-scale, scale, scale); + GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F); + GlStateManager.rotate(rotation, 0.0F, 1.0F, 0.0F); RenderHelper.enableStandardItemLighting(); - GL11.glTranslatef(0.0F, entity.yOffset, 0.0F); - RenderManager.instance.playerViewY = 180.0F; - RenderManager.instance.renderEntityWithPosYaw(entity, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F); - GL11.glPopMatrix(); + Minecraft.getMinecraft().getRenderManager().playerViewY = 180.0F; + Minecraft.getMinecraft().getRenderManager().doRenderEntity(entity, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F, false); + GlStateManager.popMatrix(); RenderHelper.disableStandardItemLighting(); - GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GlStateManager.disableRescaleNormal(); OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit); - GL11.glDisable(GL11.GL_TEXTURE_2D); + GlStateManager.disableTexture2D(); OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); if(relativeMouseX >= x - dummyEntity.width * scale / 2 - 10 && relativeMouseY >= y - dummyEntity.height * scale - 20 && relativeMouseX <= x + dummyEntity.width * scale / 2 + 10 && relativeMouseY <= y + 20) @@ -108,7 +103,7 @@ public class PageEntity extends LexiconPage{ public void prepDummy() { if(dummyEntity == null || dummyEntity.isDead) { try { - dummyEntity = (Entity) entityConstructor.newInstance(new Object[] {Minecraft.getMinecraft().theWorld}); + dummyEntity = (Entity) entityConstructor.newInstance(Minecraft.getMinecraft().theWorld); } catch (Exception e) { e.printStackTrace(); } diff --git a/src/main/java/vazkii/botania/common/lexicon/page/PageGuide.java b/src/main/java/vazkii/botania/common/lexicon/page/PageGuide.java index 35ff293a9..bfe14bd15 100644 --- a/src/main/java/vazkii/botania/common/lexicon/page/PageGuide.java +++ b/src/main/java/vazkii/botania/common/lexicon/page/PageGuide.java @@ -10,13 +10,15 @@ */ package vazkii.botania.common.lexicon.page; -import java.awt.Desktop; -import java.net.URI; - import net.minecraft.client.gui.GuiButton; -import net.minecraft.util.StatCollector; +import net.minecraft.util.text.translation.I18n; import vazkii.botania.api.internal.IGuiLexiconEntry; +import java.awt.*; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; + public class PageGuide extends PageText { GuiButton button; @@ -27,7 +29,7 @@ public class PageGuide extends PageText { @Override public void onOpened(IGuiLexiconEntry gui) { - button = new GuiButton(101, gui.getLeft() + 30, gui.getTop() + gui.getHeight() - 50, gui.getWidth() - 60, 20, StatCollector.translateToLocal("botaniamisc.playVideo")); + button = new GuiButton(101, gui.getLeft() + 30, gui.getTop() + gui.getHeight() - 50, gui.getWidth() - 60, 20, I18n.translateToLocal("botaniamisc.playVideo")); gui.getButtonList().add(button); } @@ -43,7 +45,7 @@ public class PageGuide extends PageText { Desktop.getDesktop().browse(new URI("https://www.youtube.com/watch?v=rx0xyejC6fI")); if(Math.random() < 0.01) Desktop.getDesktop().browse(new URI("https://www.youtube.com/watch?v=dQw4w9WgXcQ")); - } catch(Exception e) { } + } catch(IOException | URISyntaxException ignored) { } } } diff --git a/src/main/java/vazkii/botania/common/lexicon/page/PageImage.java b/src/main/java/vazkii/botania/common/lexicon/page/PageImage.java index c86a6004a..2dae4ee89 100644 --- a/src/main/java/vazkii/botania/common/lexicon/page/PageImage.java +++ b/src/main/java/vazkii/botania/common/lexicon/page/PageImage.java @@ -12,19 +12,18 @@ package vazkii.botania.common.lexicon.page; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.util.ResourceLocation; - +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import org.lwjgl.opengl.GL11; - import vazkii.botania.api.internal.IGuiLexiconEntry; import vazkii.botania.api.lexicon.LexiconPage; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; public class PageImage extends LexiconPage { - ResourceLocation resource; + final ResourceLocation resource; public PageImage(String unlocalizedName, String resource) { super(unlocalizedName); @@ -37,11 +36,11 @@ public class PageImage extends LexiconPage { TextureManager render = Minecraft.getMinecraft().renderEngine; render.bindTexture(resource); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.color(1F, 1F, 1F, 1F); ((GuiScreen) gui).drawTexturedModalRect(gui.getLeft(), gui.getTop(), 0, 0, gui.getWidth(), gui.getHeight()); - GL11.glDisable(GL11.GL_BLEND); + GlStateManager.disableBlend(); int width = gui.getWidth() - 30; int height = gui.getHeight(); diff --git a/src/main/java/vazkii/botania/common/lexicon/page/PageLoreText.java b/src/main/java/vazkii/botania/common/lexicon/page/PageLoreText.java index 01b9e2788..8540ce8cb 100644 --- a/src/main/java/vazkii/botania/common/lexicon/page/PageLoreText.java +++ b/src/main/java/vazkii/botania/common/lexicon/page/PageLoreText.java @@ -12,10 +12,9 @@ package vazkii.botania.common.lexicon.page; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.util.ResourceLocation; - import org.lwjgl.opengl.GL11; - import vazkii.botania.api.internal.IGuiLexiconEntry; import vazkii.botania.client.lib.LibResources; @@ -31,11 +30,11 @@ public class PageLoreText extends PageText { public void renderScreen(IGuiLexiconEntry gui, int mx, int my) { Minecraft.getMinecraft().renderEngine.bindTexture(paperOverlay); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.color(1F, 1F, 1F, 1F); ((GuiScreen) gui).drawTexturedModalRect(gui.getLeft(), gui.getTop(), 0, 0, gui.getWidth(), gui.getHeight()); - GL11.glDisable(GL11.GL_BLEND); + GlStateManager.disableBlend(); super.renderScreen(gui, mx, my); } diff --git a/src/main/java/vazkii/botania/common/lexicon/page/PageManaInfusionRecipe.java b/src/main/java/vazkii/botania/common/lexicon/page/PageManaInfusionRecipe.java index a23116431..882ee8161 100644 --- a/src/main/java/vazkii/botania/common/lexicon/page/PageManaInfusionRecipe.java +++ b/src/main/java/vazkii/botania/common/lexicon/page/PageManaInfusionRecipe.java @@ -10,23 +10,21 @@ */ package vazkii.botania.common.lexicon.page; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - +import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.resources.I18n; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; +import net.minecraft.util.text.TextFormatting; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.oredict.OreDictionary; - import org.lwjgl.opengl.GL11; - import vazkii.botania.api.internal.IGuiLexiconEntry; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.lexicon.LexiconRecipeMappings; @@ -34,27 +32,33 @@ import vazkii.botania.api.recipe.RecipeManaInfusion; import vazkii.botania.client.core.handler.HUDHandler; import vazkii.botania.client.core.helper.RenderHelper; import vazkii.botania.client.lib.LibResources; -import vazkii.botania.client.render.tile.RenderTilePool; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.tile.mana.TilePool; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import vazkii.botania.common.core.helper.ItemNBTHelper; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; public class PageManaInfusionRecipe extends PageRecipe { private static final ResourceLocation manaInfusionOverlay = new ResourceLocation(LibResources.GUI_MANA_INFUSION_OVERLAY); - List recipes; - int ticksElapsed = 0; - int recipeAt = 0; + private final List recipes; + private int ticksElapsed = 0; + private int recipeAt = 0; + private final ItemStack renderStack; public PageManaInfusionRecipe(String unlocalizedName, List recipes) { super(unlocalizedName); this.recipes = recipes; + renderStack = new ItemStack(ModBlocks.pool, 1, 0); + ItemNBTHelper.setBoolean(renderStack, "RenderFull", true); } public PageManaInfusionRecipe(String unlocalizedName, RecipeManaInfusion recipe) { - this(unlocalizedName, Arrays.asList(recipe)); + this(unlocalizedName, Collections.singletonList(recipe)); } @Override @@ -68,7 +72,7 @@ public class PageManaInfusionRecipe extends PageRecipe { public void renderRecipe(IGuiLexiconEntry gui, int mx, int my) { RecipeManaInfusion recipe = recipes.get(recipeAt); TextureManager render = Minecraft.getMinecraft().renderEngine; - FontRenderer font = Minecraft.getMinecraft().fontRenderer; + FontRenderer font = Minecraft.getMinecraft().fontRendererObj; Object input = recipe.getInput(); if(input instanceof String) @@ -76,19 +80,21 @@ public class PageManaInfusionRecipe extends PageRecipe { renderItemAtGridPos(gui, 1, 1, (ItemStack) input, false); - RenderTilePool.forceMana = true; - renderItemAtGridPos(gui, 2, 1, new ItemStack(ModBlocks.pool, 1, recipe.getOutput().getItem() == Item.getItemFromBlock(ModBlocks.pool) ? 2 : 0), false); + renderStack.setItemDamage(recipe.getOutput().getItem() == Item.getItemFromBlock(ModBlocks.pool) ? 2 : 0); + renderItemAtGridPos(gui, 2, 1, renderStack, false); renderItemAtGridPos(gui, 3, 1, recipe.getOutput(), false); - if(recipe.isAlchemy()) - renderItemAtGridPos(gui, 1, 2, new ItemStack(ModBlocks.alchemyCatalyst), false); - else if(recipe.isConjuration()) - renderItemAtGridPos(gui, 1, 2, new ItemStack(ModBlocks.conjurationCatalyst), false); + if(recipe.getCatalyst() != null) { + Block block = recipe.getCatalyst().getBlock(); + if (Item.getItemFromBlock(block) != null) { + renderItemAtGridPos(gui, 1, 2, new ItemStack(block, 1, block.getMetaFromState(recipe.getCatalyst())), false); + } + } - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - String manaUsage = StatCollector.translateToLocal("botaniamisc.manaUsage"); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + String manaUsage = I18n.format("botaniamisc.manaUsage"); font.drawString(manaUsage, gui.getLeft() + gui.getWidth() / 2 - font.getStringWidth(manaUsage) / 2, gui.getTop() + 105, 0x66000000); int ratio = 10; @@ -100,8 +106,8 @@ public class PageManaInfusionRecipe extends PageRecipe { HUDHandler.renderManaBar(x, y, 0x0000FF, 0.75F, recipe.getManaToConsume(), TilePool.MAX_MANA / ratio); - String ratioString = String.format(StatCollector.translateToLocal("botaniamisc.ratio"), ratio); - String dropString = StatCollector.translateToLocal("botaniamisc.drop") + " " + EnumChatFormatting.BOLD + "(?)"; + String ratioString = I18n.format("botaniamisc.ratio", ratio); + String dropString = I18n.format("botaniamisc.drop") + " " + TextFormatting.BOLD + "(?)"; boolean hoveringOverDrop = false; @@ -118,20 +124,20 @@ public class PageManaInfusionRecipe extends PageRecipe { font.drawString(ratioString, x + 50 - font.getStringWidth(ratioString) / 2, y + 5, 0x99000000); font.setUnicodeFlag(unicode); - GL11.glDisable(GL11.GL_BLEND); + GlStateManager.disableBlend(); render.bindTexture(manaInfusionOverlay); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.color(1F, 1F, 1F, 1F); ((GuiScreen) gui).drawTexturedModalRect(gui.getLeft(), gui.getTop(), 0, 0, gui.getWidth(), gui.getHeight()); - GL11.glDisable(GL11.GL_BLEND); + GlStateManager.disableBlend(); if(hoveringOverDrop) { String key = RenderHelper.getKeyDisplayString("key.drop"); - String tip0 = StatCollector.translateToLocal("botaniamisc.dropTip0").replaceAll("%key%", EnumChatFormatting.GREEN + key + EnumChatFormatting.WHITE); - String tip1 = StatCollector.translateToLocal("botaniamisc.dropTip1").replaceAll("%key%", EnumChatFormatting.GREEN + key + EnumChatFormatting.WHITE); + String tip0 = I18n.format("botaniamisc.dropTip0", TextFormatting.GREEN + key + TextFormatting.WHITE); + String tip1 = I18n.format("botaniamisc.dropTip1", TextFormatting.GREEN + key + TextFormatting.WHITE); RenderHelper.renderTooltip(mx, my, Arrays.asList(tip0, tip1)); } } @@ -153,7 +159,7 @@ public class PageManaInfusionRecipe extends PageRecipe { @Override public List getDisplayedRecipes() { - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList<>(); for(RecipeManaInfusion r : recipes) list.add(r.getOutput()); diff --git a/src/main/java/vazkii/botania/common/lexicon/page/PageMultiblock.java b/src/main/java/vazkii/botania/common/lexicon/page/PageMultiblock.java index e7a7a612d..793170b0d 100644 --- a/src/main/java/vazkii/botania/common/lexicon/page/PageMultiblock.java +++ b/src/main/java/vazkii/botania/common/lexicon/page/PageMultiblock.java @@ -10,46 +10,44 @@ */ package vazkii.botania.common.lexicon.page; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.resources.I18n; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; - +import net.minecraft.util.text.TextFormatting; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - import vazkii.botania.api.internal.IGuiLexiconEntry; import vazkii.botania.api.lexicon.LexiconPage; import vazkii.botania.api.lexicon.multiblock.Multiblock; import vazkii.botania.api.lexicon.multiblock.MultiblockSet; import vazkii.botania.client.core.handler.MultiblockRenderHandler; import vazkii.botania.client.lib.LibResources; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.ArrayList; +import java.util.List; public class PageMultiblock extends LexiconPage { private static final ResourceLocation multiblockOverlay = new ResourceLocation(LibResources.GUI_MULTIBLOCK_OVERLAY); GuiButton button; - MultiblockSet set; - Multiblock mb; + final MultiblockSet set; + final Multiblock mb; int ticksElapsed; public PageMultiblock(String unlocalizedName, MultiblockSet set) { super(unlocalizedName); - mb = set.getForIndex(0); + mb = set.getForFacing(EnumFacing.SOUTH); this.set = set; } @@ -59,62 +57,62 @@ public class PageMultiblock extends LexiconPage { TextureManager render = Minecraft.getMinecraft().renderEngine; render.bindTexture(multiblockOverlay); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glDisable(GL11.GL_ALPHA_TEST); - GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.disableAlpha(); + GlStateManager.color(1F, 1F, 1F, 1F); ((GuiScreen) gui).drawTexturedModalRect(gui.getLeft(), gui.getTop(), 0, 0, gui.getWidth(), gui.getHeight()); - GL11.glDisable(GL11.GL_BLEND); - GL11.glEnable(GL11.GL_ALPHA_TEST); + GlStateManager.disableBlend(); + GlStateManager.enableAlpha(); final float maxX = 90, maxY = 60; - GL11.glPushMatrix(); - GL11.glTranslatef(gui.getLeft() + gui.getWidth() / 2, gui.getTop() + 90, gui.getZLevel() + 100F); + GlStateManager.pushMatrix(); + GlStateManager.translate(gui.getLeft() + gui.getWidth() / 2, gui.getTop() + 90, gui.getZLevel() + 100F); float diag = (float) Math.sqrt(mb.getXSize() * mb.getXSize() + mb.getZSize() * mb.getZSize()); float height = mb.getYSize(); float scaleX = maxX / diag; float scaleY = maxY / height; float scale = -Math.min(scaleY, scaleX); - GL11.glScalef(scale, scale, scale); + GlStateManager.scale(scale, scale, scale); - GL11.glRotatef(-20F, 1, 0, 0); - GL11.glRotatef(gui.getElapsedTicks(), 0, 1, 0); + GlStateManager.rotate(-20F, 1, 0, 0); + GlStateManager.rotate(gui.getElapsedTicks(), 0, 1, 0); MultiblockRenderHandler.renderMultiblockOnPage(mb); - GL11.glPopMatrix(); + GlStateManager.popMatrix(); - FontRenderer font = Minecraft.getMinecraft().fontRenderer; + FontRenderer font = Minecraft.getMinecraft().fontRendererObj; boolean unicode = font.getUnicodeFlag(); - String s = EnumChatFormatting.BOLD + StatCollector.translateToLocal(getUnlocalizedName()); + String s = TextFormatting.BOLD + I18n.format(getUnlocalizedName()); font.setUnicodeFlag(true); font.drawString(s, gui.getLeft() + gui.getWidth() / 2 - font.getStringWidth(s) / 2, gui.getTop() + 16, 0x000000); font.setUnicodeFlag(unicode); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GlStateManager.enableRescaleNormal(); RenderHelper.enableGUIStandardItemLighting(); int x = gui.getLeft() + 15; int y = gui.getTop() + 25; - RenderItem.getInstance().renderItemIntoGUI(font, render, new ItemStack(Blocks.stonebrick), x, y); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(new ItemStack(Blocks.STONEBRICK), x, y); RenderHelper.disableStandardItemLighting(); - GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GlStateManager.disableRescaleNormal(); - GL11.glPushMatrix(); - GL11.glTranslatef(0F, 0F, 200F); + GlStateManager.pushMatrix(); + GlStateManager.translate(0F, 0F, 200F); if(mx >= x && mx < x + 16 && my >= y && my < y + 16) { - List mats = new ArrayList(); - mats.add(StatCollector.translateToLocal("botaniamisc.materialsRequired")); + List mats = new ArrayList<>(); + mats.add(I18n.format("botaniamisc.materialsRequired")); for(ItemStack stack : mb.materials) { String size = "" + stack.stackSize; if(size.length() < 2) size = "0" + size; - mats.add(" " + EnumChatFormatting.AQUA + size + " " + EnumChatFormatting.GRAY + stack.getDisplayName()); + mats.add(" " + TextFormatting.AQUA + size + " " + TextFormatting.GRAY + stack.getDisplayName()); } vazkii.botania.client.core.helper.RenderHelper.renderTooltip(mx, my, mats); } - GL11.glPopMatrix(); + GlStateManager.popMatrix(); } @Override @@ -123,8 +121,9 @@ public class PageMultiblock extends LexiconPage { gui.getButtonList().add(button); } - String getButtonStr() { - return StatCollector.translateToLocal(MultiblockRenderHandler.currentMultiblock == set ? "botaniamisc.unvisualize" : "botaniamisc.visualize"); + @SideOnly(Side.CLIENT) + private String getButtonStr() { + return I18n.format(MultiblockRenderHandler.currentMultiblock == set ? "botaniamisc.unvisualize" : "botaniamisc.visualize"); } @Override diff --git a/src/main/java/vazkii/botania/common/lexicon/page/PagePetalRecipe.java b/src/main/java/vazkii/botania/common/lexicon/page/PagePetalRecipe.java index 1078ca49f..b1d5202ac 100644 --- a/src/main/java/vazkii/botania/common/lexicon/page/PagePetalRecipe.java +++ b/src/main/java/vazkii/botania/common/lexicon/page/PagePetalRecipe.java @@ -10,21 +10,18 @@ */ package vazkii.botania.common.lexicon.page; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.resources.I18n; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.oredict.OreDictionary; - import org.lwjgl.opengl.GL11; - import vazkii.botania.api.internal.IGuiLexiconEntry; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.lexicon.LexiconRecipeMappings; @@ -33,14 +30,16 @@ import vazkii.botania.client.core.handler.ClientTickHandler; import vazkii.botania.client.lib.LibResources; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.core.handler.ConfigHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; public class PagePetalRecipe extends PageRecipe { private static final ResourceLocation petalOverlay = new ResourceLocation(LibResources.GUI_PETAL_OVERLAY); - List recipes; + final List recipes; int ticksElapsed = 0; int recipeAt = 0; @@ -50,7 +49,7 @@ public class PagePetalRecipe extends PageRecipe { } public PagePetalRecipe(String unlocalizedName, T recipe) { - this(unlocalizedName, Arrays.asList(recipe)); + this(unlocalizedName, Collections.singletonList(recipe)); } @Override @@ -70,7 +69,7 @@ public class PagePetalRecipe extends PageRecipe { List inputs = recipe.getInputs(); int degreePerInput = (int) (360F / inputs.size()); - float currentDegree = ConfigHandler.lexiconRotatingItems ? GuiScreen.isShiftKeyDown() ? ticksElapsed : (float) (ticksElapsed + ClientTickHandler.partialTicks) : 0; + float currentDegree = ConfigHandler.lexiconRotatingItems ? GuiScreen.isShiftKeyDown() ? ticksElapsed : ticksElapsed + ClientTickHandler.partialTicks : 0; for(Object obj : inputs) { Object input = obj; @@ -86,11 +85,11 @@ public class PagePetalRecipe extends PageRecipe { render.bindTexture(petalOverlay); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.color(1F, 1F, 1F, 1F); ((GuiScreen) gui).drawTexturedModalRect(gui.getLeft(), gui.getTop(), 0, 0, gui.getWidth(), gui.getHeight()); - GL11.glDisable(GL11.GL_BLEND); + GlStateManager.disableBlend(); } ItemStack getMiddleStack() { @@ -99,20 +98,20 @@ public class PagePetalRecipe extends PageRecipe { @SideOnly(Side.CLIENT) public void renderManaBar(IGuiLexiconEntry gui, T recipe, int mx, int my) { - FontRenderer font = Minecraft.getMinecraft().fontRenderer; - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + FontRenderer font = Minecraft.getMinecraft().fontRendererObj; + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); int x = gui.getLeft() + gui.getWidth() / 2 - 50; int y = gui.getTop() + 120; boolean unicode = font.getUnicodeFlag(); font.setUnicodeFlag(true); - String stopStr = StatCollector.translateToLocal("botaniamisc.shiftToStopSpin"); + String stopStr = I18n.format("botaniamisc.shiftToStopSpin"); font.drawString(stopStr, x + 50 - font.getStringWidth(stopStr) / 2, y + 15, 0x99000000); font.setUnicodeFlag(unicode); - GL11.glDisable(GL11.GL_BLEND); + GlStateManager.disableBlend(); } @Override @@ -132,7 +131,7 @@ public class PagePetalRecipe extends PageRecipe { @Override public List getDisplayedRecipes() { - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList<>(); for(T r : recipes) list.add(r.getOutput()); diff --git a/src/main/java/vazkii/botania/common/lexicon/page/PageRecipe.java b/src/main/java/vazkii/botania/common/lexicon/page/PageRecipe.java index b21fdf062..d0ef3ae09 100644 --- a/src/main/java/vazkii/botania/common/lexicon/page/PageRecipe.java +++ b/src/main/java/vazkii/botania/common/lexicon/page/PageRecipe.java @@ -10,30 +10,30 @@ */ package vazkii.botania.common.lexicon.page; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.RenderItem; +import net.minecraft.client.resources.I18n; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; - +import net.minecraft.util.text.TextFormatting; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - import vazkii.botania.api.internal.IGuiLexiconEntry; import vazkii.botania.api.lexicon.ILexicon; import vazkii.botania.api.lexicon.LexiconPage; import vazkii.botania.api.lexicon.LexiconRecipeMappings; import vazkii.botania.api.lexicon.LexiconRecipeMappings.EntryData; import vazkii.botania.client.gui.lexicon.GuiLexiconEntry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import vazkii.botania.common.core.helper.PlayerHelper; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; public class PageRecipe extends LexiconPage { @@ -63,13 +63,13 @@ public class PageRecipe extends LexiconPage { if(tooltipStack != null) { List tooltipData = tooltipStack.getTooltip(Minecraft.getMinecraft().thePlayer, false); - List parsedTooltip = new ArrayList(); + List parsedTooltip = new ArrayList<>(); boolean first = true; for(String s : tooltipData) { String s_ = s; if(!first) - s_ = EnumChatFormatting.GRAY + s; + s_ = TextFormatting.GRAY + s; parsedTooltip.add(s_); first = false; } @@ -79,24 +79,22 @@ public class PageRecipe extends LexiconPage { int tooltipY = 8 + tooltipData.size() * 11; if(tooltipEntry) { - vazkii.botania.client.core.helper.RenderHelper.renderTooltipOrange(mx, my + tooltipY, Arrays.asList(EnumChatFormatting.GRAY + StatCollector.translateToLocal("botaniamisc.clickToRecipe"))); + vazkii.botania.client.core.helper.RenderHelper.renderTooltipOrange(mx, my + tooltipY, Collections.singletonList(TextFormatting.GRAY + I18n.format("botaniamisc.clickToRecipe"))); tooltipY += 18; } if(tooltipContainerStack != null) - vazkii.botania.client.core.helper.RenderHelper.renderTooltipGreen(mx, my + tooltipY, Arrays.asList(EnumChatFormatting.AQUA + StatCollector.translateToLocal("botaniamisc.craftingContainer"), tooltipContainerStack.getDisplayName())); + vazkii.botania.client.core.helper.RenderHelper.renderTooltipGreen(mx, my + tooltipY, Arrays.asList(TextFormatting.AQUA + I18n.format("botaniamisc.craftingContainer"), tooltipContainerStack.getDisplayName())); } tooltipStack = tooltipContainerStack = null; tooltipEntry = false; - GL11.glDisable(GL11.GL_BLEND); + GlStateManager.disableBlend(); mouseDownLastTick = Mouse.isButtonDown(0); } @SideOnly(Side.CLIENT) - public void renderRecipe(IGuiLexiconEntry gui, int mx, int my) { - // NO-OP - } + public void renderRecipe(IGuiLexiconEntry gui, int mx, int my) {} @SideOnly(Side.CLIENT) public void renderItemAtAngle(IGuiLexiconEntry gui, float angle, ItemStack stack) { @@ -136,22 +134,22 @@ public class PageRecipe extends LexiconPage { @SideOnly(Side.CLIENT) public void renderItem(IGuiLexiconEntry gui, double xPos, double yPos, ItemStack stack, boolean accountForContainer) { - RenderItem render = new RenderItem(); + RenderItem render = Minecraft.getMinecraft().getRenderItem(); boolean mouseDown = Mouse.isButtonDown(0); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.pushMatrix(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); RenderHelper.enableGUIStandardItemLighting(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glEnable(GL11.GL_DEPTH_TEST); - GL11.glPushMatrix(); - GL11.glTranslated(xPos, yPos, 0); - render.renderItemAndEffectIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().getTextureManager(), stack, 0, 0); - render.renderItemOverlayIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().getTextureManager(), stack, 0, 0); - GL11.glPopMatrix(); + GlStateManager.enableRescaleNormal(); + GlStateManager.enableDepth(); + GlStateManager.pushMatrix(); + GlStateManager.translate(xPos, yPos, 0); + render.renderItemAndEffectIntoGUI(stack, 0, 0); + render.renderItemOverlayIntoGUI(Minecraft.getMinecraft().fontRendererObj, stack, 0, 0, ""); + GlStateManager.popMatrix(); RenderHelper.disableStandardItemLighting(); - GL11.glPopMatrix(); + GlStateManager.popMatrix(); int xpi = (int) xPos; int ypi = (int) yPos; @@ -159,9 +157,9 @@ public class PageRecipe extends LexiconPage { tooltipStack = stack; EntryData data = LexiconRecipeMappings.getDataForStack(tooltipStack); - ItemStack book = Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem(); + ItemStack book = PlayerHelper.getFirstHeldItemClass(Minecraft.getMinecraft().thePlayer, ILexicon.class); - if(data != null && (data.entry != gui.getEntry() || data.page != gui.getPageOn()) && book != null && book.getItem() instanceof ILexicon && ((ILexicon) book.getItem()).isKnowledgeUnlocked(book, data.entry.getKnowledgeType())) { + if(data != null && (data.entry != gui.getEntry() || data.page != gui.getPageOn()) && book != null && ((ILexicon) book.getItem()).isKnowledgeUnlocked(book, data.entry.getKnowledgeType())) { tooltipEntry = true; if(!mouseDownLastTick && mouseDown && GuiScreen.isShiftKeyDown()) { @@ -178,7 +176,7 @@ public class PageRecipe extends LexiconPage { } } - GL11.glDisable(GL11.GL_LIGHTING); + GlStateManager.disableLighting(); } } diff --git a/src/main/java/vazkii/botania/common/lexicon/page/PageRuneRecipe.java b/src/main/java/vazkii/botania/common/lexicon/page/PageRuneRecipe.java index 752cd4190..7efb3323b 100644 --- a/src/main/java/vazkii/botania/common/lexicon/page/PageRuneRecipe.java +++ b/src/main/java/vazkii/botania/common/lexicon/page/PageRuneRecipe.java @@ -10,22 +10,21 @@ */ package vazkii.botania.common.lexicon.page; -import java.util.List; - import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.resources.I18n; import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; - +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import org.lwjgl.opengl.GL11; - import vazkii.botania.api.internal.IGuiLexiconEntry; import vazkii.botania.api.recipe.RecipeRuneAltar; import vazkii.botania.client.core.handler.HUDHandler; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.tile.mana.TilePool; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; public class PageRuneRecipe extends PagePetalRecipe { @@ -45,10 +44,10 @@ public class PageRuneRecipe extends PagePetalRecipe { @Override @SideOnly(Side.CLIENT) public void renderManaBar(IGuiLexiconEntry gui, RecipeRuneAltar recipe, int mx, int my) { - FontRenderer font = Minecraft.getMinecraft().fontRenderer; - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - String manaUsage = StatCollector.translateToLocal("botaniamisc.manaUsage"); + FontRenderer font = Minecraft.getMinecraft().fontRendererObj; + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + String manaUsage = I18n.format("botaniamisc.manaUsage"); font.drawString(manaUsage, gui.getLeft() + gui.getWidth() / 2 - font.getStringWidth(manaUsage) / 2, gui.getTop() + 110, 0x66000000); int ratio = 10; @@ -60,15 +59,15 @@ public class PageRuneRecipe extends PagePetalRecipe { HUDHandler.renderManaBar(x, y, 0x0000FF, 0.75F, recipe.getManaUsage(), TilePool.MAX_MANA / ratio); - String ratioString = String.format(StatCollector.translateToLocal("botaniamisc.ratio"), ratio); - String stopStr = StatCollector.translateToLocal("botaniamisc.shiftToStopSpin"); + String ratioString = I18n.format("botaniamisc.ratio", ratio); + String stopStr = I18n.format("botaniamisc.shiftToStopSpin"); boolean unicode = font.getUnicodeFlag(); font.setUnicodeFlag(true); font.drawString(stopStr, x + 50 - font.getStringWidth(stopStr) / 2, y + 15, 0x99000000); font.drawString(ratioString, x + 50 - font.getStringWidth(ratioString) / 2, y + 5, 0x99000000); font.setUnicodeFlag(unicode); - GL11.glDisable(GL11.GL_BLEND); + GlStateManager.disableBlend(); } } diff --git a/src/main/java/vazkii/botania/common/lexicon/page/PageShedding.java b/src/main/java/vazkii/botania/common/lexicon/page/PageShedding.java index 7ba683c6d..0e7ba0d54 100644 --- a/src/main/java/vazkii/botania/common/lexicon/page/PageShedding.java +++ b/src/main/java/vazkii/botania/common/lexicon/page/PageShedding.java @@ -10,39 +10,37 @@ */ package vazkii.botania.common.lexicon.page; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.RenderItem; import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.resources.I18n; import net.minecraft.entity.EntityList; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; - +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.text.TextFormatting; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - import vazkii.botania.api.internal.IGuiLexiconEntry; import vazkii.botania.api.lexicon.LexiconRecipeMappings; import vazkii.botania.api.lexicon.LexiconRecipeMappings.EntryData; import vazkii.botania.client.gui.lexicon.GuiLexiconEntry; import vazkii.botania.client.lib.LibResources; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; public class PageShedding extends PageEntity { private static final ResourceLocation sheddingOverlay = new ResourceLocation(LibResources.GUI_SHEDDING_OVERLAY); - ItemStack shedStack; + final ItemStack shedStack; ItemStack tooltipStack; boolean tooltipEntry; @@ -72,20 +70,20 @@ public class PageShedding extends PageEntity { TextureManager render = Minecraft.getMinecraft().renderEngine; render.bindTexture(sheddingOverlay); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.color(1F, 1F, 1F, 1F); ((GuiScreen) gui).drawTexturedModalRect(gui.getLeft(), gui.getTop(), 0, 0, gui.getWidth(), gui.getHeight()); if(tooltipStack != null) { List tooltipData = tooltipStack.getTooltip(Minecraft.getMinecraft().thePlayer, false); - List parsedTooltip = new ArrayList(); + List parsedTooltip = new ArrayList<>(); boolean first = true; for(String s : tooltipData) { String s_ = s; if(!first) - s_ = EnumChatFormatting.GRAY + s; + s_ = TextFormatting.GRAY + s; parsedTooltip.add(s_); first = false; } @@ -95,37 +93,36 @@ public class PageShedding extends PageEntity { int tooltipY = 8 + tooltipData.size() * 11; if(tooltipEntry) { - vazkii.botania.client.core.helper.RenderHelper.renderTooltipOrange(mx, my + tooltipY, Arrays.asList(EnumChatFormatting.GRAY + StatCollector.translateToLocal("botaniamisc.clickToRecipe"))); - tooltipY += 18; + vazkii.botania.client.core.helper.RenderHelper.renderTooltipOrange(mx, my + tooltipY, Collections.singletonList(TextFormatting.GRAY + I18n.format("botaniamisc.clickToRecipe"))); } } else if(tooltipEntity) { - List parsedTooltip = new ArrayList(); + List parsedTooltip = new ArrayList<>(); parsedTooltip.add(EntityList.getEntityString(dummyEntity)); vazkii.botania.client.core.helper.RenderHelper.renderTooltip(mx, my, parsedTooltip); } tooltipStack = null; tooltipEntry = tooltipEntity = false; - GL11.glDisable(GL11.GL_BLEND); + GlStateManager.disableBlend(); mouseDownLastTick = Mouse.isButtonDown(0); } @SideOnly(Side.CLIENT) public void renderItem(IGuiLexiconEntry gui, int xPos, int yPos, ItemStack stack) { - RenderItem render = new RenderItem(); + RenderItem render = Minecraft.getMinecraft().getRenderItem(); boolean mouseDown = Mouse.isButtonDown(0); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.pushMatrix(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); RenderHelper.enableGUIStandardItemLighting(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glEnable(GL11.GL_DEPTH_TEST); - render.renderItemAndEffectIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().getTextureManager(), stack, xPos, yPos); - render.renderItemOverlayIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().getTextureManager(), stack, xPos, yPos); + GlStateManager.enableRescaleNormal(); + GlStateManager.enableDepth(); + render.renderItemAndEffectIntoGUI(stack, xPos, yPos); + render.renderItemOverlayIntoGUI(Minecraft.getMinecraft().fontRendererObj, stack, xPos, yPos, ""); RenderHelper.disableStandardItemLighting(); - GL11.glPopMatrix(); + GlStateManager.popMatrix(); if(relativeMouseX >= xPos && relativeMouseY >= yPos && relativeMouseX <= xPos + 16 && relativeMouseY <= yPos + 16) { tooltipStack = stack; @@ -142,12 +139,12 @@ public class PageShedding extends PageEntity { } } - GL11.glDisable(GL11.GL_LIGHTING); + GlStateManager.disableLighting(); } @Override public List getDisplayedRecipes() { - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList<>(); list.add(shedStack); return list; } diff --git a/src/main/java/vazkii/botania/common/lexicon/page/PageTerrasteel.java b/src/main/java/vazkii/botania/common/lexicon/page/PageTerrasteel.java index 8f9d313ea..b7fad0753 100644 --- a/src/main/java/vazkii/botania/common/lexicon/page/PageTerrasteel.java +++ b/src/main/java/vazkii/botania/common/lexicon/page/PageTerrasteel.java @@ -10,26 +10,25 @@ */ package vazkii.botania.common.lexicon.page; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; - +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import org.lwjgl.opengl.GL11; - import vazkii.botania.api.internal.IGuiLexiconEntry; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.lexicon.LexiconRecipeMappings; import vazkii.botania.client.lib.LibResources; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.item.ModItems; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.ArrayList; +import java.util.List; public class PageTerrasteel extends PageRecipe { @@ -43,31 +42,31 @@ public class PageTerrasteel extends PageRecipe { @SideOnly(Side.CLIENT) public void renderRecipe(IGuiLexiconEntry gui, int mx, int my) { Block block1 = ModBlocks.livingrock; - Block block2 = Blocks.lapis_block; + Block block2 = Blocks.LAPIS_BLOCK; Block block3 = ModBlocks.terraPlate; - GL11.glTranslatef(0F, 0F, -10F); + GlStateManager.translate(0F, 0F, -10F); renderItem(gui, gui.getLeft() + gui.getWidth() / 2 - 8, gui.getTop() + 103, new ItemStack(block1), false); - GL11.glTranslatef(0F, 0F, 5F); + GlStateManager.translate(0F, 0F, 5F); renderItem(gui, gui.getLeft() + gui.getWidth() / 2 - 8 + 7, gui.getTop() + 106, new ItemStack(block2), false); renderItem(gui, gui.getLeft() + gui.getWidth() / 2 - 8 - 6, gui.getTop() + 106, new ItemStack(block2), false); - GL11.glTranslatef(0F, 0F, 5F); + GlStateManager.translate(0F, 0F, 5F); renderItem(gui, gui.getLeft() + gui.getWidth() / 2 - 8, gui.getTop() + 110, new ItemStack(block1), false); renderItem(gui, gui.getLeft() + gui.getWidth() / 2 - 8 + 14, gui.getTop() + 110, new ItemStack(block1), false); renderItem(gui, gui.getLeft() + gui.getWidth() / 2 - 8 - 13, gui.getTop() + 110, new ItemStack(block1), false); - GL11.glTranslatef(0F, 0F, 5F); + GlStateManager.translate(0F, 0F, 5F); renderItem(gui, gui.getLeft() + gui.getWidth() / 2 - 8 - 6, gui.getTop() + 114, new ItemStack(block2), false); renderItem(gui, gui.getLeft() + gui.getWidth() / 2 - 8 + 7, gui.getTop() + 114, new ItemStack(block2), false); - GL11.glTranslatef(0F, 0F, 5F); + GlStateManager.translate(0F, 0F, 5F); renderItem(gui, gui.getLeft() + gui.getWidth() / 2 - 8 + 1, gui.getTop() + 117, new ItemStack(block1), false); - GL11.glTranslatef(0F, 0F, 5F); + GlStateManager.translate(0F, 0F, 5F); renderItem(gui, gui.getLeft() + gui.getWidth() / 2 - 8, gui.getTop() + 102, new ItemStack(block3), false); - GL11.glTranslatef(0F, 0F, -10F); + GlStateManager.translate(0F, 0F, -10F); renderItem(gui, gui.getLeft() + gui.getWidth() / 2 - 8, gui.getTop() + 30, new ItemStack(ModItems.manaResource, 1, 4), false); renderItem(gui, gui.getLeft() + gui.getWidth() / 2 - 8, gui.getTop() + 80, new ItemStack(ModItems.manaResource, 1, 0), false); @@ -76,11 +75,11 @@ public class PageTerrasteel extends PageRecipe { Minecraft.getMinecraft().renderEngine.bindTexture(terrasteelOverlay); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1F, 1F, 1F, 1F); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.color(1F, 1F, 1F, 1F); ((GuiScreen) gui).drawTexturedModalRect(gui.getLeft(), gui.getTop(), 0, 0, gui.getWidth(), gui.getHeight()); - GL11.glDisable(GL11.GL_BLEND); + GlStateManager.disableBlend(); } @Override @@ -90,7 +89,7 @@ public class PageTerrasteel extends PageRecipe { @Override public List getDisplayedRecipes() { - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList<>(); list.add(new ItemStack(ModItems.manaResource, 1, 4)); return list; } diff --git a/src/main/java/vazkii/botania/common/lexicon/page/PageText.java b/src/main/java/vazkii/botania/common/lexicon/page/PageText.java index a9a221445..3d9b7d44d 100644 --- a/src/main/java/vazkii/botania/common/lexicon/page/PageText.java +++ b/src/main/java/vazkii/botania/common/lexicon/page/PageText.java @@ -10,20 +10,18 @@ */ package vazkii.botania.common.lexicon.page; -import java.util.ArrayList; -import java.util.List; - +import com.google.common.base.Joiner; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; -import net.minecraft.util.StatCollector; +import net.minecraft.client.resources.I18n; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import vazkii.botania.api.internal.IGuiLexiconEntry; import vazkii.botania.api.lexicon.LexiconPage; import vazkii.botania.common.core.handler.ConfigHandler; -import com.google.common.base.Joiner; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.List; public class PageText extends LexiconPage { @@ -51,17 +49,17 @@ public class PageText extends LexiconPage { y += 10; width -= 4; - FontRenderer font = Minecraft.getMinecraft().fontRenderer; + FontRenderer font = Minecraft.getMinecraft().fontRendererObj; boolean unicode = font.getUnicodeFlag(); font.setUnicodeFlag(true); - String text = StatCollector.translateToLocal(unlocalizedText).replaceAll("&", "\u00a7"); + String text = I18n.format(unlocalizedText).replaceAll("&", "\u00a7"); String[] textEntries = text.split("
    "); - List> lines = new ArrayList(); + List> lines = new ArrayList<>(); - String controlCodes = ""; + String controlCodes; for(String s : textEntries) { - List words = new ArrayList(); + List words = new ArrayList<>(); String lineStr = ""; String[] tokens = s.split(" "); for(String token : tokens) { @@ -73,7 +71,7 @@ public class PageText extends LexiconPage { if(font.getStringWidth(lineStr) > width) { lines.add(words); lineStr = controlCodes + spaced; - words = new ArrayList(); + words = new ArrayList<>(); } words.add(controlCodes + token); @@ -81,7 +79,7 @@ public class PageText extends LexiconPage { if(!lineStr.isEmpty()) lines.add(words); - lines.add(new ArrayList()); + lines.add(new ArrayList<>()); } int i = 0; @@ -119,13 +117,12 @@ public class PageText extends LexiconPage { font.setUnicodeFlag(unicode); } - public static String getControlCodes(String s) { + private static String getControlCodes(String s) { String controls = s.replaceAll("(? { + + @Override + public IMessage onMessage(final PacketBotaniaEffect message, final MessageContext ctx) { + Minecraft.getMinecraft().addScheduledTask(new Runnable() { + // Use anon - lambda causes classloading issues + @Override + public void run() { + Minecraft mc = Minecraft.getMinecraft(); + World world = mc.theWorld; + switch (message.type) { + case POOL_CRAFT: { + for(int i = 0; i < 25; i++) { + float red = (float) Math.random(); + float green = (float) Math.random(); + float blue = (float) Math.random(); + Botania.proxy.sparkleFX(message.x + 0.5 + Math.random() * 0.4 - 0.2, message.y + 0.75, message.z + 0.5 + Math.random() * 0.4 - 0.2, + red, green, blue, (float) Math.random(), 10); + } + break; + } + case POOL_CHARGE: { + if(ConfigHandler.chargingAnimationEnabled) { + boolean outputting = message.args[0] == 1; + BlockPos pos = new BlockPos(message.x, message.y, message.z); + Vector3 itemVec = Vector3.fromBlockPos(pos).add(0.5, 0.5 + Math.random() * 0.3, 0.5); + Vector3 tileVec = Vector3.fromBlockPos(pos).add(0.2 + Math.random() * 0.6, 0, 0.2 + Math.random() * 0.6); + Botania.proxy.lightningFX(outputting ? tileVec : itemVec, + outputting ? itemVec : tileVec, 80, world.rand.nextLong(), 0x4400799c, 0x4400C6FF); + } + break; + } + case PAINT_LENS: { + EnumDyeColor placeColor = EnumDyeColor.byMetadata(message.args[0]); + int hex = placeColor.getMapColor().colorValue; + int r = (hex & 0xFF0000) >> 16; + int g = (hex & 0xFF00) >> 8; + int b = (hex & 0xFF); + for(int i = 0; i < 10; i++) { + BlockPos pos = new BlockPos(message.x, message.y, message.z).offset(EnumFacing.VALUES[world.rand.nextInt(6)]); + Botania.proxy.sparkleFX( + pos.getX() + (float) Math.random(), pos.getY() + (float) Math.random(), pos.getZ() + (float) Math.random(), + r / 255F, g / 255F, b / 255F, 0.6F + (float) Math.random() * 0.5F, 5); + } + break; + } + case ARENA_INDICATOR: { + for(int i = 0; i < 360; i += 8) { + float r = 1F; + float g = 0F; + float b = 1F; + float rad = i * (float) Math.PI / 180F; + double x = message.x + 0.5 - Math.cos(rad) * EntityDoppleganger.ARENA_RANGE; + double y = message.y + 0.5; + double z = message.z + 0.5 - Math.sin(rad) * EntityDoppleganger.ARENA_RANGE; + + Botania.proxy.sparkleFX(x, y, z, r, g, b, 5F, 120); + } + break; + } + case ITEM_SMOKE: { + Entity item = world.getEntityByID(message.args[0]); + int p = message.args[1]; + + for(int i = 0; i < p; i++) { + double m = 0.01; + double d0 = item.worldObj.rand.nextGaussian() * m; + double d1 = item.worldObj.rand.nextGaussian() * m; + double d2 = item.worldObj.rand.nextGaussian() * m; + double d3 = 10.0D; + item.worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_NORMAL, + message.x + item.worldObj.rand.nextFloat() * item.width * 2.0F - item.width - d0 * d3, message.y + item.worldObj.rand.nextFloat() * item.height - d1 * d3, + message.z + item.worldObj.rand.nextFloat() * item.width * 2.0F - item.width - d2 * d3, d0, d1, d2); + } + break; + } + case SPARK_NET_INDICATOR: { + Entity e1 = world.getEntityByID(message.args[0]); + Entity e2 = world.getEntityByID(message.args[1]); + + if(e1 == null || e2 == null) + return; + + Vector3 orig = new Vector3(e1.posX , e1.posY + 0.25, e1.posZ); + Vector3 end = new Vector3(e2.posX, e2.posY + 0.25, e2.posZ); + Vector3 diff = end.subtract(orig); + Vector3 movement = diff.normalize().multiply(0.1); + int iters = (int) (diff.mag() / movement.mag()); + float huePer = 1F / iters; + float hueSum = (float) Math.random(); + + Vector3 currentPos = orig; + for(int i = 0; i < iters; i++) { + float hue = i * huePer + hueSum; + Color color = Color.getHSBColor(hue, 1F, 1F); + float r = Math.min(1F, color.getRed() / 255F + 0.4F); + float g = Math.min(1F, color.getGreen() / 255F + 0.4F); + float b = Math.min(1F, color.getBlue() / 255F + 0.4F); + + Botania.proxy.setSparkleFXNoClip(true); + Botania.proxy.sparkleFX(currentPos.x, currentPos.y, currentPos.z, r, g, b, 1F, 12); + Botania.proxy.setSparkleFXNoClip(false); + currentPos = currentPos.add(movement); + } + + break; + } + case SPARK_MANA_FLOW: { + Entity e1 = world.getEntityByID(message.args[0]); + Entity e2 = world.getEntityByID(message.args[1]); + + if(e1 == null || e2 == null) + return; + + double rc = 0.45; + Vector3 thisVec = Vector3.fromEntityCenter(e1).add((Math.random() - 0.5) * rc, (Math.random() - 0.5) * rc, (Math.random() - 0.5) * rc); + Vector3 receiverVec = Vector3.fromEntityCenter(e2).add((Math.random() - 0.5) * rc, (Math.random() - 0.5) * rc, (Math.random() - 0.5) * rc); + + Vector3 motion = receiverVec.subtract(thisVec).multiply(0.04F); + float r = 0.4F + 0.3F * (float) Math.random(); + float g = 0.4F + 0.3F * (float) Math.random(); + float b = 0.4F + 0.3F * (float) Math.random(); + float size = 0.125F + 0.125F * (float) Math.random(); + + Botania.proxy.wispFX(thisVec.x, thisVec.y, thisVec.z, r, g, b, + size, (float) motion.x, (float) motion.y, (float) motion.z); + break; + } + case ENCHANTER_CRAFT: { + for(int i = 0; i < 25; i++) { + float red = (float) Math.random(); + float green = (float) Math.random(); + float blue = (float) Math.random(); + Botania.proxy.sparkleFX( + message.x + Math.random() * 0.4 - 0.2, message.y, message.z + Math.random() * 0.4 - 0.2, + red, green, blue, (float) Math.random(), 10); + } + break; + } + case ENCHANTER_DESTROY: { + for(int i = 0; i < 50; i++) { + float red = (float) Math.random(); + float green = (float) Math.random(); + float blue = (float) Math.random(); + Botania.proxy.wispFX(message.x, message.y, message.z, + red, green, blue, (float) Math.random() * 0.15F + 0.15F, (float) (Math.random() - 0.5F) * 0.25F, (float) (Math.random() - 0.5F) * 0.25F, (float) (Math.random() - 0.5F) * 0.25F); + } + break; + } + case ENTROPINNYUM: { + for(int i = 0; i < 50; i++) + Botania.proxy.sparkleFX(message.x + Math.random() * 4 - 2, message.y + Math.random() * 4 - 2, message.z + Math.random() * 4 - 2, 1F, (float) Math.random() * 0.25F, (float) Math.random() * 0.25F, (float) (Math.random() * 0.65F + 1.25F), 12); + + world.spawnParticle(EnumParticleTypes.EXPLOSION_HUGE, message.x, message.y, message.z, 1D, 0D, 0D); + break; + } + case BLACK_LOTUS_DISSOLVE: { + for(int i = 0; i < 50; i++) { + float r = (float) Math.random() * 0.35F; + float g = 0F; + float b = (float) Math.random() * 0.35F; + float s = 0.45F * (float) Math.random() * 0.25F; + + float m = 0.045F; + float mx = ((float) Math.random() - 0.5F) * m; + float my = (float) Math.random() * m; + float mz = ((float) Math.random() - 0.5F) * m; + + Botania.proxy.wispFX(message.x, message.y, message.z, r, g, b, s, mx, my, mz); + } + + break; + } + } + } + }); + + return null; + } + } + + public enum EffectType { + POOL_CRAFT(0), + POOL_CHARGE(1), // Arg: 1 if outputting, 0 if inputting + PAINT_LENS(1), // Arg: colour + ARENA_INDICATOR(0), + ITEM_SMOKE(2), // Arg: Entity ID, number of particles + SPARK_NET_INDICATOR(2), // Arg: Entity ID from, Entity ID towards + SPARK_MANA_FLOW(2), // Arg: Entity ID from, Entity ID towards + ENCHANTER_CRAFT(0), + ENCHANTER_DESTROY(0), + ENTROPINNYUM(0), + BLACK_LOTUS_DISSOLVE(0); + + private final int argCount; + + EffectType(int argCount) { + this.argCount = argCount; + } + } + +} diff --git a/src/main/java/vazkii/botania/common/network/PacketHandler.java b/src/main/java/vazkii/botania/common/network/PacketHandler.java new file mode 100644 index 000000000..6875cd962 --- /dev/null +++ b/src/main/java/vazkii/botania/common/network/PacketHandler.java @@ -0,0 +1,57 @@ +package vazkii.botania.common.network; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraftforge.fml.common.FMLCommonHandler; +import net.minecraftforge.fml.common.network.simpleimpl.IMessage; +import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper; +import net.minecraftforge.fml.relauncher.Side; +import vazkii.botania.common.lib.LibMisc; + +public final class PacketHandler { + + private static final SimpleNetworkWrapper HANDLER = new SimpleNetworkWrapper(LibMisc.NETWORK_CHANNEL); + + public static void init() { + HANDLER.registerMessage(PacketBotaniaEffect.Handler.class, PacketBotaniaEffect.class, 0, Side.CLIENT); + HANDLER.registerMessage(PacketLeftClick.Handler.class, PacketLeftClick.class, 1, Side.SERVER); + } + + /** + * Send message to all within 64 blocks that have this chunk loaded + */ + public static void sendToNearby(World world, BlockPos pos, IMessage toSend) { + if(world instanceof WorldServer) { + WorldServer ws = ((WorldServer) world); + + for (EntityPlayer player : ws.playerEntities) { + EntityPlayerMP playerMP = ((EntityPlayerMP) player); + + if (playerMP.getDistanceSq(pos) < 64 * 64 + && ws.getPlayerChunkMap().isPlayerWatchingChunk(playerMP, pos.getX() >> 4, pos.getZ() >> 4)) { + HANDLER.sendTo(toSend, playerMP); + } + } + + } + } + + public static void sendToNearby(World world, Entity e, IMessage toSend) { + sendToNearby(world, new BlockPos(e), toSend); + } + + public static void sendTo(EntityPlayerMP playerMP, IMessage toSend) { + HANDLER.sendTo(toSend, playerMP); + } + + public static void sendToServer(IMessage msg) { + HANDLER.sendToServer(msg); + } + + private PacketHandler() {} + +} diff --git a/src/main/java/vazkii/botania/common/network/PacketLeftClick.java b/src/main/java/vazkii/botania/common/network/PacketLeftClick.java new file mode 100644 index 000000000..284059c36 --- /dev/null +++ b/src/main/java/vazkii/botania/common/network/PacketLeftClick.java @@ -0,0 +1,29 @@ +package vazkii.botania.common.network; + +import io.netty.buffer.ByteBuf; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraftforge.fml.common.network.simpleimpl.IMessage; +import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; +import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; +import vazkii.botania.common.item.ModItems; +import vazkii.botania.common.item.equipment.tool.terrasteel.ItemTerraSword; + +public class PacketLeftClick implements IMessage { + @Override + public void fromBytes(ByteBuf buf) {} + + @Override + public void toBytes(ByteBuf buf) {} + + public static class Handler implements IMessageHandler { + + @Override + public IMessage onMessage(PacketLeftClick message, MessageContext ctx) { + EntityPlayerMP player = ctx.getServerHandler().playerEntity; + player.mcServer.addScheduledTask(() -> ((ItemTerraSword) ModItems.terraSword).trySpawnBurst(player)); + return null; + } + } + +} diff --git a/src/main/java/vazkii/botania/common/world/SkyblockWorldEvents.java b/src/main/java/vazkii/botania/common/world/SkyblockWorldEvents.java index 5d84c8233..caab50865 100644 --- a/src/main/java/vazkii/botania/common/world/SkyblockWorldEvents.java +++ b/src/main/java/vazkii/botania/common/world/SkyblockWorldEvents.java @@ -10,36 +10,35 @@ */ package vazkii.botania.common.world; -import java.awt.Color; - import net.minecraft.block.Block; import net.minecraft.block.material.Material; -import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.SoundEvent; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; -import net.minecraftforge.client.event.RenderWorldEvent; import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; import net.minecraftforge.event.entity.player.PlayerInteractEvent; -import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action; -import net.minecraftforge.event.world.BlockEvent.HarvestDropsEvent; -import vazkii.botania.client.render.world.SkyblockSkyRenderer; +import net.minecraftforge.event.world.BlockEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.tile.TileManaFlame; +import vazkii.botania.common.core.handler.MethodHandles; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.item.equipment.tool.ToolCommons; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.awt.*; public final class SkyblockWorldEvents { + private SkyblockWorldEvents() {} + private static final String TAG_MADE_ISLAND = "Botania-MadeIsland"; private static final String TAG_HAS_OWN_ISLAND = "Botania-HasOwnIsland"; private static final String TAG_ISLAND_X = "Botania-IslandX"; @@ -47,9 +46,9 @@ public final class SkyblockWorldEvents { private static final String TAG_ISLAND_Z = "Botania-IslandZ"; @SubscribeEvent - public void onPlayerUpdate(LivingUpdateEvent event) { - if(event.entityLiving instanceof EntityPlayer && !event.entity.worldObj.isRemote) { - EntityPlayer player = (EntityPlayer) event.entityLiving; + public static void onPlayerUpdate(LivingUpdateEvent event) { + if(event.getEntityLiving() instanceof EntityPlayer && !event.getEntityLiving().worldObj.isRemote) { + EntityPlayer player = (EntityPlayer) event.getEntityLiving(); NBTTagCompound data = player.getEntityData(); if(!data.hasKey(EntityPlayer.PERSISTED_NBT_TAG)) data.setTag(EntityPlayer.PERSISTED_NBT_TAG, new NBTTagCompound()); @@ -58,9 +57,9 @@ public final class SkyblockWorldEvents { if(player.ticksExisted > 3 && !persist.getBoolean(TAG_MADE_ISLAND)) { World world = player.worldObj; if(WorldTypeSkyblock.isWorldSkyblock(world)) { - ChunkCoordinates coords = world.getSpawnPoint(); - if(world.getBlock(coords.posX, coords.posY - 4, coords.posZ) != Blocks.bedrock && world.provider.dimensionId == 0) - spawnPlayer(player, coords.posX, coords.posY, coords.posZ, false); + BlockPos coords = world.getSpawnPoint(); + if(world.getBlockState(coords.down(4)).getBlock() != Blocks.BEDROCK && world.provider.getDimension() == 0) + spawnPlayer(player, coords, false); } @@ -70,35 +69,31 @@ public final class SkyblockWorldEvents { } @SubscribeEvent - public void onPlayerInteract(PlayerInteractEvent event) { - if(WorldTypeSkyblock.isWorldSkyblock(event.world)) { - ItemStack equipped = event.entityPlayer.getCurrentEquippedItem(); - if(event.action == Action.RIGHT_CLICK_BLOCK && equipped == null && event.entityPlayer.isSneaking()) { - Block block = event.world.getBlock(event.x, event.y, event.z); - if(block == Blocks.grass || block == Blocks.dirt) { - if(event.world.isRemote) - event.entityPlayer.swingItem(); + public static void onPlayerInteract(PlayerInteractEvent.RightClickBlock event) { + if(WorldTypeSkyblock.isWorldSkyblock(event.getWorld())) { + ItemStack equipped = event.getItemStack(); + if(equipped == null && event.getEntityPlayer().isSneaking()) { + Block block = event.getWorld().getBlockState(event.getPos()).getBlock(); + if(block == Blocks.GRASS || block == Blocks.DIRT) { + if(event.getWorld().isRemote) + event.getEntityPlayer().swingArm(event.getHand()); else { - event.world.playSoundEffect(event.x + 0.5, event.y + 0.5, event.z + 0.5, block.stepSound.getBreakSound(), block.stepSound.getVolume() * 0.4F, block.stepSound.getPitch() + (float) (Math.random() * 0.2 - 0.1)); + event.getWorld().playSound(null, event.getPos(), block.getSoundType().getBreakSound(), SoundCategory.BLOCKS, block.getSoundType().getVolume() * 0.4F, block.getSoundType().getPitch() + (float) (Math.random() * 0.2 - 0.1)); + if(Math.random() < 0.8) - event.entityPlayer.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.manaResource, 1, 21), false); + event.getEntityPlayer().dropItem(new ItemStack(ModItems.manaResource, 1, 21), false); } } - } else if(equipped != null && equipped.getItem() == Items.bowl && event.action == Action.RIGHT_CLICK_BLOCK && !event.world.isRemote) { - MovingObjectPosition movingobjectposition = ToolCommons.raytraceFromEntity(event.world, event.entityPlayer, true, 4.5F); - - if(movingobjectposition != null) { - if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && !event.world.isRemote) { - int i = movingobjectposition.blockX; - int j = movingobjectposition.blockY; - int k = movingobjectposition.blockZ; - - if(event.world.getBlock(i, j, k).getMaterial() == Material.water) { + } else if(equipped != null && equipped.getItem() == Items.BOWL && !event.getWorld().isRemote) { + RayTraceResult RayTraceResult = ToolCommons.raytraceFromEntity(event.getWorld(), event.getEntityPlayer(), true, 4.5F); + if(RayTraceResult != null) { + if (RayTraceResult.typeOfHit == net.minecraft.util.math.RayTraceResult.Type.BLOCK) { + if(event.getWorld().getBlockState(RayTraceResult.getBlockPos()).getMaterial() == Material.WATER) { --equipped.stackSize; if(equipped.stackSize <= 0) - event.entityPlayer.inventory.setInventorySlotContents(event.entityPlayer.inventory.currentItem, new ItemStack(ModItems.waterBowl)); - else event.entityPlayer.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.waterBowl), false); + event.getEntityPlayer().setHeldItem(event.getHand(), new ItemStack(ModItems.waterBowl)); + else event.getEntityPlayer().dropItem(new ItemStack(ModItems.waterBowl), false); } } } @@ -107,23 +102,23 @@ public final class SkyblockWorldEvents { } @SubscribeEvent - public void onDrops(HarvestDropsEvent event) { - if(WorldTypeSkyblock.isWorldSkyblock(event.world) && event.block == Blocks.tallgrass) { + public static void onDrops(BlockEvent.HarvestDropsEvent event) { + if(WorldTypeSkyblock.isWorldSkyblock(event.getWorld()) && event.getState().getBlock() == Blocks.TALLGRASS) { ItemStack stackToRemove = null; - for(ItemStack stack : event.drops) - if(stack.getItem() == Items.wheat_seeds && event.world.rand.nextInt(4) == 0) { + for(ItemStack stack : event.getDrops()) + if(stack.getItem() == Items.WHEAT_SEEDS && event.getWorld().rand.nextInt(4) == 0) { stackToRemove = stack; break; } if(stackToRemove != null) { - event.drops.remove(stackToRemove); - event.drops.add(new ItemStack(event.world.rand.nextBoolean() ? Items.pumpkin_seeds : Items.melon_seeds)); + event.getDrops().remove(stackToRemove); + event.getDrops().add(new ItemStack(event.getWorld().rand.nextBoolean() ? Items.PUMPKIN_SEEDS : Items.MELON_SEEDS)); } } } - - public static void spawnPlayer(EntityPlayer player, int x, int y, int z, boolean fabricated) { + + public static void spawnPlayer(EntityPlayer player, BlockPos pos, boolean fabricated) { NBTTagCompound data = player.getEntityData(); if(!data.hasKey(EntityPlayer.PERSISTED_NBT_TAG)) data.setTag(EntityPlayer.PERSISTED_NBT_TAG, new NBTTagCompound()); @@ -132,12 +127,12 @@ public final class SkyblockWorldEvents { final boolean test = false; if(test || !persist.getBoolean(TAG_HAS_OWN_ISLAND)) { - createSkyblock(player.worldObj, x, y, z); + createSkyblock(player.worldObj, pos); if(player instanceof EntityPlayerMP) { EntityPlayerMP pmp = (EntityPlayerMP) player; - pmp.setPositionAndUpdate(x + 0.5, y + 1.6, z + 0.5); - pmp.setSpawnChunk(new ChunkCoordinates(x, y, z), true); + pmp.setPositionAndUpdate(pos.getX() + 0.5, pos.getY() + 1.6, pos.getZ() + 0.5); + pmp.setSpawnChunk(pos, true, player.worldObj.provider.getDimension()); player.inventory.addItemStackToInventory(new ItemStack(ModItems.lexicon)); } @@ -159,14 +154,14 @@ public final class SkyblockWorldEvents { } } - public static void createSkyblock(World world, int x, int y, int z) { + public static void createSkyblock(World world, BlockPos pos) { for(int i = 0; i < 3; i++) for(int j = 0; j < 4; j++) for(int k = 0; k < 3; k++) - world.setBlock(x - 1 + i, y - 1 - j, z - 1 + k, j == 0 ? Blocks.grass : Blocks.dirt); - world.setBlock(x - 1, y - 2, z, Blocks.flowing_water); - world.setBlock(x + 1, y + 2, z + 1, ModBlocks.manaFlame); - ((TileManaFlame) world.getTileEntity(x + 1, y + 2, z + 1)).setColor(new Color(70 + world.rand.nextInt(185), 70 + world.rand.nextInt(185), 70 + world.rand.nextInt(185)).getRGB()); + world.setBlockState(pos.add(-1 + i, -1 - j, -1 + k), j == 0 ? Blocks.GRASS.getDefaultState() : Blocks.DIRT.getDefaultState()); + world.setBlockState(pos.add(-1, -2, 0), Blocks.FLOWING_WATER.getDefaultState()); + world.setBlockState(pos.add(1, 2, 1), ModBlocks.manaFlame.getDefaultState()); + ((TileManaFlame) world.getTileEntity(pos.add(1, 2, 1))).setColor(new Color(70 + world.rand.nextInt(185), 70 + world.rand.nextInt(185), 70 + world.rand.nextInt(185)).getRGB()); int[][] rootPositions = new int[][] { { -1, -3, -1 }, @@ -182,9 +177,9 @@ public final class SkyblockWorldEvents { { +0, -6, +3 }, }; for(int[] root : rootPositions) - world.setBlock(x + root[0], y + root[1], z + root[2], ModBlocks.root); + world.setBlockState(pos.add(root[0], root[1], root[2]), ModBlocks.root.getDefaultState()); - world.setBlock(x, y - 4, z, Blocks.bedrock); + world.setBlockState(pos.down(4), Blocks.BEDROCK.getDefaultState()); } } diff --git a/src/main/java/vazkii/botania/common/world/WorldTypeSkyblock.java b/src/main/java/vazkii/botania/common/world/WorldTypeSkyblock.java index 98d7f4ee5..ff3b44a9d 100644 --- a/src/main/java/vazkii/botania/common/world/WorldTypeSkyblock.java +++ b/src/main/java/vazkii/botania/common/world/WorldTypeSkyblock.java @@ -10,11 +10,14 @@ */ package vazkii.botania.common.world; +import net.minecraft.server.MinecraftServer; import net.minecraft.world.World; +import net.minecraft.world.WorldServer; import net.minecraft.world.WorldType; -import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.chunk.IChunkGenerator; import net.minecraft.world.gen.ChunkProviderFlat; -import net.minecraftforge.common.MinecraftForge; + +import javax.annotation.Nonnull; public class WorldTypeSkyblock extends WorldType { @@ -31,19 +34,14 @@ public class WorldTypeSkyblock extends WorldType { return true; } - @Override - public boolean hasVoidParticles(boolean flag) { - return false; - } - @Override public int getMinimumSpawnHeight(World world) { return 86; } @Override - public int getSpawnFuzz() { - return 1; + public int getSpawnFuzz(@Nonnull WorldServer world, MinecraftServer server) { + return 0; } @Override @@ -51,9 +49,10 @@ public class WorldTypeSkyblock extends WorldType { return 260f; } + @Nonnull @Override - public IChunkProvider getChunkGenerator(World world, String generatorOptions) { - return new ChunkProviderFlat(world, world.getSeed(), false, "2;1x0;"); + public IChunkGenerator getChunkGenerator(@Nonnull World world, String generatorOptions) { + return new ChunkProviderFlat(world, world.getSeed(), false, "3;minecraft:air;"); } } diff --git a/src/main/resources/assets/botania/ToTextureArtists.txt b/src/main/resources/assets/botania/ToTextureArtists.txt new file mode 100644 index 000000000..c7a21ef7f --- /dev/null +++ b/src/main/resources/assets/botania/ToTextureArtists.txt @@ -0,0 +1,8 @@ +Thanks for improving Botania with your artwork! + +Some things to keep in mind: +1. Keep your textures in powers of two dimensions +2. Edit the jsons in models/block, not the ones in blockstates/ +3. Clean up after yourself - no texture errors on startup! + +Thanks and have at it! \ No newline at end of file diff --git a/src/main/resources/assets/botania/armatures/block/crystalcube_cube.json b/src/main/resources/assets/botania/armatures/block/crystalcube_cube.json new file mode 100644 index 000000000..9b76c413e --- /dev/null +++ b/src/main/resources/assets/botania/armatures/block/crystalcube_cube.json @@ -0,0 +1,19 @@ +{ + "joints": { + "all": { "0": [ 1.0 ] } + }, + "clips": { + "moving": { + "loop": false, + "joint_clips": { + "all": [{ + "variable": "offset_y", + "type": "uniform", + "interpolation": "linear", + "samples": [ 0.275, 0.2875, 0.29665, 0.3, 0.29665, 0.2875, 0.275, 0.2625, 0.25335, 0.25, 0.25335, 0.2625, 0.275 ] + }] + }, + "events": {} + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/armatures/block/pump_head.json b/src/main/resources/assets/botania/armatures/block/pump_head.json new file mode 100644 index 000000000..b3c9aba64 --- /dev/null +++ b/src/main/resources/assets/botania/armatures/block/pump_head.json @@ -0,0 +1,24 @@ +{ + "joints": { + "head": { "0": [ 1.0 ], "1": [ 1.0 ], "2": [ 1.0 ], "3": [ 1.0 ] } + }, + "clips": { + "default": { + "loop": false, + "joint_clips": {}, + "events": {} + }, + "moving": { + "loop": false, + "joint_clips": { + "head": [{ + "variable": "offset_z", + "type": "uniform", + "interpolation": "linear", + "samples": [ 0, 0.5, 0 ] + }] + }, + "events": {} + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/asms/block/crystalcube_cube.json b/src/main/resources/assets/botania/asms/block/crystalcube_cube.json new file mode 100644 index 000000000..969465469 --- /dev/null +++ b/src/main/resources/assets/botania/asms/block/crystalcube_cube.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "world_to_cycle": [ "/", 4 ] + }, + "clips": { + "moving": [ "apply", "botania:block/crystalcube_cube@moving", "#world_to_cycle" ] + }, + "states": [ "moving" ], + "transitions": {}, + "start_state": "moving" +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/asms/block/pump.json b/src/main/resources/assets/botania/asms/block/pump.json new file mode 100644 index 000000000..f1217ed0c --- /dev/null +++ b/src/main/resources/assets/botania/asms/block/pump.json @@ -0,0 +1,13 @@ +{ + "parameters": {}, + "clips": { + "default": "botania:block/pump_head@default", + "moving": [ "apply", "botania:block/pump_head@moving", "#move" ] + }, + "states": [ "default", "moving" ], + "transitions": { + "default": "moving", + "moving": "default" + }, + "start_state": "default" +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/agricarnation.json b/src/main/resources/assets/botania/blockstates/agricarnation.json new file mode 100644 index 000000000..5e38ff9cd --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/agricarnation.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/agricarnation" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/agricarnation" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/agricarnationChibi.json b/src/main/resources/assets/botania/blockstates/agricarnationChibi.json new file mode 100644 index 000000000..b56f4f80e --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/agricarnationChibi.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/agricarnationChibi" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/agricarnationChibi" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/alchemyCatalyst.json b/src/main/resources/assets/botania/blockstates/alchemyCatalyst.json new file mode 100644 index 000000000..1eed16194 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/alchemyCatalyst.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:alchemy_catalyst" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/alfheimPortal.json b/src/main/resources/assets/botania/blockstates/alfheimPortal.json new file mode 100644 index 000000000..7f589eaf8 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/alfheimPortal.json @@ -0,0 +1,7 @@ +{ + "variants": { + "state=off": { "model": "botania:alfheim_portal" }, + "state=on_x": { "model": "botania:alfheim_portal_on" }, + "state=on_z": { "model": "botania:alfheim_portal_on" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/altGrass.json b/src/main/resources/assets/botania/blockstates/altGrass.json new file mode 100644 index 000000000..58e0cf7f6 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/altGrass.json @@ -0,0 +1,40 @@ +{ + "variants": { + "variant=dry": [ + { "model": "botania:dry_grass" }, + { "model": "botania:dry_grass", "y": 90 }, + { "model": "botania:dry_grass", "y": 180 }, + { "model": "botania:dry_grass", "y": 270 } + ], + "variant=golden": [ + { "model": "botania:golden_grass" }, + { "model": "botania:golden_grass", "y": 90 }, + { "model": "botania:golden_grass", "y": 180 }, + { "model": "botania:golden_grass", "y": 270 } + ], + "variant=vivid": [ + { "model": "botania:vivid_grass" }, + { "model": "botania:vivid_grass", "y": 90 }, + { "model": "botania:vivid_grass", "y": 180 }, + { "model": "botania:vivid_grass", "y": 270 } + ], + "variant=scorched": [ + { "model": "botania:scorched_grass" }, + { "model": "botania:scorched_grass", "y": 90 }, + { "model": "botania:scorched_grass", "y": 180 }, + { "model": "botania:scorched_grass", "y": 270 } + ], + "variant=infused": [ + { "model": "botania:infused_grass" }, + { "model": "botania:infused_grass", "y": 90 }, + { "model": "botania:infused_grass", "y": 180 }, + { "model": "botania:infused_grass", "y": 270 } + ], + "variant=mutated": [ + { "model": "botania:mutated_grass" }, + { "model": "botania:mutated_grass", "y": 90 }, + { "model": "botania:mutated_grass", "y": 180 }, + { "model": "botania:mutated_grass", "y": 270 } + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/altar.json b/src/main/resources/assets/botania/blockstates/altar.json new file mode 100644 index 000000000..64dbd0d17 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/altar.json @@ -0,0 +1,14 @@ +{ + "variants": { + "variant=default": { "model": "botania:apothecaries/default_apothecary" }, + "variant=forest": { "model": "botania:apothecaries/forest_apothecary" }, + "variant=plains": { "model": "botania:apothecaries/plains_apothecary" }, + "variant=mountain": { "model": "botania:apothecaries/mountain_apothecary" }, + "variant=fungal": { "model": "botania:apothecaries/fungal_apothecary" }, + "variant=swamp": { "model": "botania:apothecaries/swamp_apothecary" }, + "variant=desert": { "model": "botania:apothecaries/desert_apothecary" }, + "variant=taiga": { "model": "botania:apothecaries/taiga_apothecary" }, + "variant=mesa": { "model": "botania:apothecaries/mesa_apothecary" }, + "variant=mossy": { "model": "botania:apothecaries/mossy_apothecary" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/arcanerose.json b/src/main/resources/assets/botania/blockstates/arcanerose.json new file mode 100644 index 000000000..5ace26e7a --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/arcanerose.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/arcanerose" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/arcanerose" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/avatar.json b/src/main/resources/assets/botania/blockstates/avatar.json new file mode 100644 index 000000000..946bd2921 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/avatar.json @@ -0,0 +1,12 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "botania:dummy", + "textures": { + "particle": "botania:blocks/livingwood0" + } + }, + "variants": { + "normal": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/bellethorn.json b/src/main/resources/assets/botania/blockstates/bellethorn.json new file mode 100644 index 000000000..cad8c4b97 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/bellethorn.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/bellethorn" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/bellethorn" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/bellethornChibi.json b/src/main/resources/assets/botania/blockstates/bellethornChibi.json new file mode 100644 index 000000000..aed72d21b --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/bellethornChibi.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/bellethornChibi" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/bellethornChibi" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/bellows.json b/src/main/resources/assets/botania/blockstates/bellows.json new file mode 100644 index 000000000..946bd2921 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/bellows.json @@ -0,0 +1,12 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "botania:dummy", + "textures": { + "particle": "botania:blocks/livingwood0" + } + }, + "variants": { + "normal": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/bergamute.json b/src/main/resources/assets/botania/blockstates/bergamute.json new file mode 100644 index 000000000..087add64d --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/bergamute.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/bergamute" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/bergamute" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/bifrost.json b/src/main/resources/assets/botania/blockstates/bifrost.json new file mode 100644 index 000000000..73ebd7453 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/bifrost.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:bifrost" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/bifrostPerm.json b/src/main/resources/assets/botania/blockstates/bifrostPerm.json new file mode 100644 index 000000000..73ebd7453 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/bifrostPerm.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:bifrost" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/bifrostPermPane.json b/src/main/resources/assets/botania/blockstates/bifrostPermPane.json new file mode 100644 index 000000000..f26442e9e --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/bifrostPermPane.json @@ -0,0 +1,28 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:pane_post", + "textures": { + "edge": "botania:blocks/bifrostPermPane", + "pane": "botania:blocks/bifrost" + } + }, + "variants": { + "north": { + "true": { "submodel": { "nside": { "model": "minecraft:pane_side" } } }, + "false": { "submodel": { "nside": { "model": "minecraft:pane_noside" } } } + }, + "south": { + "true": { "submodel": { "sside": { "model": "minecraft:pane_side_alt" } } }, + "false": { "submodel": { "sside": { "model": "minecraft:pane_noside_alt", "y": 90 } } } + }, + "west": { + "true": { "submodel": { "wside": { "model": "minecraft:pane_side_alt", "y": 90 } } }, + "false": { "submodel": { "wside": { "model": "minecraft:pane_noside", "y": 270 } } } + }, + "east": { + "true": { "submodel": { "eside": { "model": "minecraft:pane_side", "y": 90 } } }, + "false": { "submodel": { "eside": { "model": "minecraft:pane_noside_alt" } } } + } + } +} diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA.json b/src/main/resources/assets/botania/blockstates/biomeStoneA.json new file mode 100644 index 000000000..27622ac2a --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA.json @@ -0,0 +1,20 @@ +{ + "variants": { + "variant=forest": { "model": "botania:metamorphic/forest_stone" }, + "variant=plains": { "model": "botania:metamorphic/plains_stone" }, + "variant=mountain": { "model": "botania:metamorphic/mountain_stone" }, + "variant=fungal": { "model": "botania:metamorphic/fungal_stone" }, + "variant=swamp": { "model": "botania:metamorphic/swamp_stone" }, + "variant=desert": { "model": "botania:metamorphic/desert_stone" }, + "variant=taiga": { "model": "botania:metamorphic/taiga_stone" }, + "variant=mesa": { "model": "botania:metamorphic/mesa_stone" }, + "variant=forest_cobble": { "model": "botania:metamorphic/forest_cobble_stone" }, + "variant=plains_cobble": { "model": "botania:metamorphic/plains_cobble_stone" }, + "variant=mountain_cobble": { "model": "botania:metamorphic/mountain_cobble_stone" }, + "variant=fungal_cobble": { "model": "botania:metamorphic/fungal_cobble_stone" }, + "variant=swamp_cobble": { "model": "botania:metamorphic/swamp_cobble_stone" }, + "variant=desert_cobble": { "model": "botania:metamorphic/desert_cobble_stone" }, + "variant=taiga_cobble": { "model": "botania:metamorphic/taiga_cobble_stone" }, + "variant=mesa_cobble": { "model": "botania:metamorphic/mesa_cobble_stone" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA0Slab.json b/src/main/resources/assets/botania/blockstates/biomeStoneA0Slab.json new file mode 100644 index 000000000..8ae3b6d68 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA0Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/biomeStone0", + "top": "botania:blocks/biomeStone0", + "side": "botania:blocks/biomeStone0" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA0SlabFull.json b/src/main/resources/assets/botania/blockstates/biomeStoneA0SlabFull.json new file mode 100644 index 000000000..0c58db25e --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA0SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:metamorphic/forest_stone" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA0Stairs.json b/src/main/resources/assets/botania/blockstates/biomeStoneA0Stairs.json new file mode 100644 index 000000000..9a15160a2 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA0Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/biomeStone0", + "top": "botania:blocks/biomeStone0", + "side": "botania:blocks/biomeStone0" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA10Slab.json b/src/main/resources/assets/botania/blockstates/biomeStoneA10Slab.json new file mode 100644 index 000000000..dee3eb2cb --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA10Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/biomeStone10", + "top": "botania:blocks/biomeStone10", + "side": "botania:blocks/biomeStone10" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA10SlabFull.json b/src/main/resources/assets/botania/blockstates/biomeStoneA10SlabFull.json new file mode 100644 index 000000000..05719dcca --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA10SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:metamorphic/mountain_cobble_stone" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA10Stairs.json b/src/main/resources/assets/botania/blockstates/biomeStoneA10Stairs.json new file mode 100644 index 000000000..aa00113cd --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA10Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/biomeStone10", + "top": "botania:blocks/biomeStone10", + "side": "botania:blocks/biomeStone10" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA11Slab.json b/src/main/resources/assets/botania/blockstates/biomeStoneA11Slab.json new file mode 100644 index 000000000..e8cc23536 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA11Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/biomeStone11", + "top": "botania:blocks/biomeStone11", + "side": "botania:blocks/biomeStone11" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA11SlabFull.json b/src/main/resources/assets/botania/blockstates/biomeStoneA11SlabFull.json new file mode 100644 index 000000000..27dbc8c9b --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA11SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:metamorphic/fungal_cobble_stone" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA11Stairs.json b/src/main/resources/assets/botania/blockstates/biomeStoneA11Stairs.json new file mode 100644 index 000000000..f4117bfd2 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA11Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/biomeStone11", + "top": "botania:blocks/biomeStone11", + "side": "botania:blocks/biomeStone11" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA12Slab.json b/src/main/resources/assets/botania/blockstates/biomeStoneA12Slab.json new file mode 100644 index 000000000..4850027be --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA12Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/biomeStone12", + "top": "botania:blocks/biomeStone12", + "side": "botania:blocks/biomeStone12" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA12SlabFull.json b/src/main/resources/assets/botania/blockstates/biomeStoneA12SlabFull.json new file mode 100644 index 000000000..ace8e0d07 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA12SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:metamorphic/swamp_cobble_stone" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA12Stairs.json b/src/main/resources/assets/botania/blockstates/biomeStoneA12Stairs.json new file mode 100644 index 000000000..b22add585 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA12Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/biomeStone12", + "top": "botania:blocks/biomeStone12", + "side": "botania:blocks/biomeStone12" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA13Slab.json b/src/main/resources/assets/botania/blockstates/biomeStoneA13Slab.json new file mode 100644 index 000000000..9761ac673 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA13Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/biomeStone13", + "top": "botania:blocks/biomeStone13", + "side": "botania:blocks/biomeStone13" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA13SlabFull.json b/src/main/resources/assets/botania/blockstates/biomeStoneA13SlabFull.json new file mode 100644 index 000000000..2e3c1d7c3 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA13SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:metamorphic/desert_cobble_stone" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA13Stairs.json b/src/main/resources/assets/botania/blockstates/biomeStoneA13Stairs.json new file mode 100644 index 000000000..9ee2e8e62 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA13Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/biomeStone13", + "top": "botania:blocks/biomeStone13", + "side": "botania:blocks/biomeStone13" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA14Slab.json b/src/main/resources/assets/botania/blockstates/biomeStoneA14Slab.json new file mode 100644 index 000000000..065079c46 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA14Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/biomeStone14", + "top": "botania:blocks/biomeStone14", + "side": "botania:blocks/biomeStone14" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA14SlabFull.json b/src/main/resources/assets/botania/blockstates/biomeStoneA14SlabFull.json new file mode 100644 index 000000000..e918af54b --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA14SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:metamorphic/taiga_cobble_stone" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA14Stairs.json b/src/main/resources/assets/botania/blockstates/biomeStoneA14Stairs.json new file mode 100644 index 000000000..d5dfc9022 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA14Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/biomeStone14", + "top": "botania:blocks/biomeStone14", + "side": "botania:blocks/biomeStone14" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA15Slab.json b/src/main/resources/assets/botania/blockstates/biomeStoneA15Slab.json new file mode 100644 index 000000000..cd96ded79 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA15Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/biomeStone15", + "top": "botania:blocks/biomeStone15", + "side": "botania:blocks/biomeStone15" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA15SlabFull.json b/src/main/resources/assets/botania/blockstates/biomeStoneA15SlabFull.json new file mode 100644 index 000000000..e21f0c3a2 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA15SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:metamorphic/mesa_cobble_stone" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA15Stairs.json b/src/main/resources/assets/botania/blockstates/biomeStoneA15Stairs.json new file mode 100644 index 000000000..4189ab1ee --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA15Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/biomeStone15", + "top": "botania:blocks/biomeStone15", + "side": "botania:blocks/biomeStone15" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA1Slab.json b/src/main/resources/assets/botania/blockstates/biomeStoneA1Slab.json new file mode 100644 index 000000000..3acad118c --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA1Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/biomeStone1", + "top": "botania:blocks/biomeStone1", + "side": "botania:blocks/biomeStone1" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA1SlabFull.json b/src/main/resources/assets/botania/blockstates/biomeStoneA1SlabFull.json new file mode 100644 index 000000000..7e5f4febf --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA1SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:metamorphic/plains_stone" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA1Stairs.json b/src/main/resources/assets/botania/blockstates/biomeStoneA1Stairs.json new file mode 100644 index 000000000..37765c64b --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA1Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/biomeStone1", + "top": "botania:blocks/biomeStone1", + "side": "botania:blocks/biomeStone1" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA2Slab.json b/src/main/resources/assets/botania/blockstates/biomeStoneA2Slab.json new file mode 100644 index 000000000..e76d3dd8f --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA2Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/biomeStone2", + "top": "botania:blocks/biomeStone2", + "side": "botania:blocks/biomeStone2" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA2SlabFull.json b/src/main/resources/assets/botania/blockstates/biomeStoneA2SlabFull.json new file mode 100644 index 000000000..31ca5de05 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA2SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:metamorphic/mountain_stone" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA2Stairs.json b/src/main/resources/assets/botania/blockstates/biomeStoneA2Stairs.json new file mode 100644 index 000000000..81f5f0f57 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA2Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/biomeStone2", + "top": "botania:blocks/biomeStone2", + "side": "botania:blocks/biomeStone2" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA3Slab.json b/src/main/resources/assets/botania/blockstates/biomeStoneA3Slab.json new file mode 100644 index 000000000..f1fe24970 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA3Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/biomeStone3", + "top": "botania:blocks/biomeStone3", + "side": "botania:blocks/biomeStone3" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA3SlabFull.json b/src/main/resources/assets/botania/blockstates/biomeStoneA3SlabFull.json new file mode 100644 index 000000000..91fe895a6 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA3SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:metamorphic/fungal_stone" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA3Stairs.json b/src/main/resources/assets/botania/blockstates/biomeStoneA3Stairs.json new file mode 100644 index 000000000..35f8f419c --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA3Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/biomeStone3", + "top": "botania:blocks/biomeStone3", + "side": "botania:blocks/biomeStone3" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA4Slab.json b/src/main/resources/assets/botania/blockstates/biomeStoneA4Slab.json new file mode 100644 index 000000000..be8a0caa9 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA4Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/biomeStone4", + "top": "botania:blocks/biomeStone4", + "side": "botania:blocks/biomeStone4" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA4SlabFull.json b/src/main/resources/assets/botania/blockstates/biomeStoneA4SlabFull.json new file mode 100644 index 000000000..fd38dc075 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA4SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:metamorphic/swamp_stone" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA4Stairs.json b/src/main/resources/assets/botania/blockstates/biomeStoneA4Stairs.json new file mode 100644 index 000000000..2d60a490d --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA4Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/biomeStone4", + "top": "botania:blocks/biomeStone4", + "side": "botania:blocks/biomeStone4" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA5Slab.json b/src/main/resources/assets/botania/blockstates/biomeStoneA5Slab.json new file mode 100644 index 000000000..b4846b648 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA5Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/biomeStone5", + "top": "botania:blocks/biomeStone5", + "side": "botania:blocks/biomeStone5" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA5SlabFull.json b/src/main/resources/assets/botania/blockstates/biomeStoneA5SlabFull.json new file mode 100644 index 000000000..8d022ec80 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA5SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:metamorphic/desert_stone" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA5Stairs.json b/src/main/resources/assets/botania/blockstates/biomeStoneA5Stairs.json new file mode 100644 index 000000000..c0822d7a1 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA5Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/biomeStone5", + "top": "botania:blocks/biomeStone5", + "side": "botania:blocks/biomeStone5" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA6Slab.json b/src/main/resources/assets/botania/blockstates/biomeStoneA6Slab.json new file mode 100644 index 000000000..8bdfb2408 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA6Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/biomeStone6", + "top": "botania:blocks/biomeStone6", + "side": "botania:blocks/biomeStone6" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA6SlabFull.json b/src/main/resources/assets/botania/blockstates/biomeStoneA6SlabFull.json new file mode 100644 index 000000000..cb4e3f9f0 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA6SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:metamorphic/taiga_stone" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA6Stairs.json b/src/main/resources/assets/botania/blockstates/biomeStoneA6Stairs.json new file mode 100644 index 000000000..4d308e084 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA6Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/biomeStone6", + "top": "botania:blocks/biomeStone6", + "side": "botania:blocks/biomeStone6" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA7Slab.json b/src/main/resources/assets/botania/blockstates/biomeStoneA7Slab.json new file mode 100644 index 000000000..3a6dc3729 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA7Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/biomeStone7", + "top": "botania:blocks/biomeStone7", + "side": "botania:blocks/biomeStone7" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA7SlabFull.json b/src/main/resources/assets/botania/blockstates/biomeStoneA7SlabFull.json new file mode 100644 index 000000000..9482b4a70 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA7SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:metamorphic/mesa_stone" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA7Stairs.json b/src/main/resources/assets/botania/blockstates/biomeStoneA7Stairs.json new file mode 100644 index 000000000..7eba5c4bf --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA7Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/biomeStone7", + "top": "botania:blocks/biomeStone7", + "side": "botania:blocks/biomeStone7" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA8Slab.json b/src/main/resources/assets/botania/blockstates/biomeStoneA8Slab.json new file mode 100644 index 000000000..016d8afd0 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA8Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/biomeStone8", + "top": "botania:blocks/biomeStone8", + "side": "botania:blocks/biomeStone8" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA8SlabFull.json b/src/main/resources/assets/botania/blockstates/biomeStoneA8SlabFull.json new file mode 100644 index 000000000..2422f2551 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA8SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:metamorphic/forest_cobble_stone" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA8Stairs.json b/src/main/resources/assets/botania/blockstates/biomeStoneA8Stairs.json new file mode 100644 index 000000000..c56da5648 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA8Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/biomeStone8", + "top": "botania:blocks/biomeStone8", + "side": "botania:blocks/biomeStone8" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA9Slab.json b/src/main/resources/assets/botania/blockstates/biomeStoneA9Slab.json new file mode 100644 index 000000000..4dd5cd8c7 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA9Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/biomeStone9", + "top": "botania:blocks/biomeStone9", + "side": "botania:blocks/biomeStone9" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA9SlabFull.json b/src/main/resources/assets/botania/blockstates/biomeStoneA9SlabFull.json new file mode 100644 index 000000000..d9543cb48 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA9SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:metamorphic/plains_cobble_stone" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneA9Stairs.json b/src/main/resources/assets/botania/blockstates/biomeStoneA9Stairs.json new file mode 100644 index 000000000..1fd93b694 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneA9Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/biomeStone9", + "top": "botania:blocks/biomeStone9", + "side": "botania:blocks/biomeStone9" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneB.json b/src/main/resources/assets/botania/blockstates/biomeStoneB.json new file mode 100644 index 000000000..d0e0f3229 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneB.json @@ -0,0 +1,20 @@ +{ + "variants": { + "variant=forest": { "model": "botania:metamorphic/forest_brick" }, + "variant=plains": { "model": "botania:metamorphic/plains_brick" }, + "variant=mountain": { "model": "botania:metamorphic/mountain_brick" }, + "variant=fungal": { "model": "botania:metamorphic/fungal_brick" }, + "variant=swamp": { "model": "botania:metamorphic/swamp_brick" }, + "variant=desert": { "model": "botania:metamorphic/desert_brick" }, + "variant=taiga": { "model": "botania:metamorphic/taiga_brick" }, + "variant=mesa": { "model": "botania:metamorphic/mesa_brick" }, + "variant=chiseled_forest": { "model": "botania:metamorphic/forest_brick_chiseled" }, + "variant=chiseled_plains": { "model": "botania:metamorphic/plains_brick_chiseled" }, + "variant=chiseled_mountain": { "model": "botania:metamorphic/mountain_brick_chiseled" }, + "variant=chiseled_fungal": { "model": "botania:metamorphic/fungal_brick_chiseled" }, + "variant=chiseled_swamp": { "model": "botania:metamorphic/swamp_brick_chiseled" }, + "variant=chiseled_desert": { "model": "botania:metamorphic/desert_brick_chiseled" }, + "variant=chiseled_taiga": { "model": "botania:metamorphic/taiga_brick_chiseled" }, + "variant=chiseled_mesa": { "model": "botania:metamorphic/mesa_brick_chiseled" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneB0Slab.json b/src/main/resources/assets/botania/blockstates/biomeStoneB0Slab.json new file mode 100644 index 000000000..27effcde8 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneB0Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/biomeStone16", + "top": "botania:blocks/biomeStone16", + "side": "botania:blocks/biomeStone16" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneB0SlabFull.json b/src/main/resources/assets/botania/blockstates/biomeStoneB0SlabFull.json new file mode 100644 index 000000000..ea96f2b4e --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneB0SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:metamorphic/forest_brick" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneB0Stairs.json b/src/main/resources/assets/botania/blockstates/biomeStoneB0Stairs.json new file mode 100644 index 000000000..9578c7a8c --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneB0Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/biomeStone16", + "top": "botania:blocks/biomeStone16", + "side": "botania:blocks/biomeStone16" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneB1Slab.json b/src/main/resources/assets/botania/blockstates/biomeStoneB1Slab.json new file mode 100644 index 000000000..b2927f15d --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneB1Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/biomeStone17", + "top": "botania:blocks/biomeStone17", + "side": "botania:blocks/biomeStone17" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneB1SlabFull.json b/src/main/resources/assets/botania/blockstates/biomeStoneB1SlabFull.json new file mode 100644 index 000000000..23fb25ad3 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneB1SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:metamorphic/plains_brick" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneB1Stairs.json b/src/main/resources/assets/botania/blockstates/biomeStoneB1Stairs.json new file mode 100644 index 000000000..ae1584afa --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneB1Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/biomeStone17", + "top": "botania:blocks/biomeStone17", + "side": "botania:blocks/biomeStone17" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneB2Slab.json b/src/main/resources/assets/botania/blockstates/biomeStoneB2Slab.json new file mode 100644 index 000000000..b5ea1a1ba --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneB2Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/biomeStone18", + "top": "botania:blocks/biomeStone18", + "side": "botania:blocks/biomeStone18" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneB2SlabFull.json b/src/main/resources/assets/botania/blockstates/biomeStoneB2SlabFull.json new file mode 100644 index 000000000..71e4fecc4 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneB2SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:metamorphic/mountain_brick" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneB2Stairs.json b/src/main/resources/assets/botania/blockstates/biomeStoneB2Stairs.json new file mode 100644 index 000000000..79b4742c8 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneB2Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/biomeStone18", + "top": "botania:blocks/biomeStone18", + "side": "botania:blocks/biomeStone18" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneB3Slab.json b/src/main/resources/assets/botania/blockstates/biomeStoneB3Slab.json new file mode 100644 index 000000000..1309a9e20 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneB3Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/biomeStone19", + "top": "botania:blocks/biomeStone19", + "side": "botania:blocks/biomeStone19" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneB3SlabFull.json b/src/main/resources/assets/botania/blockstates/biomeStoneB3SlabFull.json new file mode 100644 index 000000000..26ea9305a --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneB3SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:metamorphic/fungal_brick" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneB3Stairs.json b/src/main/resources/assets/botania/blockstates/biomeStoneB3Stairs.json new file mode 100644 index 000000000..67e682c24 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneB3Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/biomeStone19", + "top": "botania:blocks/biomeStone19", + "side": "botania:blocks/biomeStone19" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneB4Slab.json b/src/main/resources/assets/botania/blockstates/biomeStoneB4Slab.json new file mode 100644 index 000000000..78e0d7ed4 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneB4Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/biomeStone20", + "top": "botania:blocks/biomeStone20", + "side": "botania:blocks/biomeStone20" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneB4SlabFull.json b/src/main/resources/assets/botania/blockstates/biomeStoneB4SlabFull.json new file mode 100644 index 000000000..f3cd0012d --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneB4SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:metamorphic/swamp_brick" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneB4Stairs.json b/src/main/resources/assets/botania/blockstates/biomeStoneB4Stairs.json new file mode 100644 index 000000000..a39d7f922 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneB4Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/biomeStone20", + "top": "botania:blocks/biomeStone20", + "side": "botania:blocks/biomeStone20" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneB5Slab.json b/src/main/resources/assets/botania/blockstates/biomeStoneB5Slab.json new file mode 100644 index 000000000..97b237701 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneB5Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/biomeStone21", + "top": "botania:blocks/biomeStone21", + "side": "botania:blocks/biomeStone21" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneB5SlabFull.json b/src/main/resources/assets/botania/blockstates/biomeStoneB5SlabFull.json new file mode 100644 index 000000000..d2c6efe9c --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneB5SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:metamorphic/desert_brick" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneB5Stairs.json b/src/main/resources/assets/botania/blockstates/biomeStoneB5Stairs.json new file mode 100644 index 000000000..9b923bb32 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneB5Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/biomeStone21", + "top": "botania:blocks/biomeStone21", + "side": "botania:blocks/biomeStone21" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneB6Slab.json b/src/main/resources/assets/botania/blockstates/biomeStoneB6Slab.json new file mode 100644 index 000000000..62856fcb4 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneB6Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/biomeStone22", + "top": "botania:blocks/biomeStone22", + "side": "botania:blocks/biomeStone22" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneB6SlabFull.json b/src/main/resources/assets/botania/blockstates/biomeStoneB6SlabFull.json new file mode 100644 index 000000000..bc2881dba --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneB6SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:metamorphic/taiga_brick" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneB6Stairs.json b/src/main/resources/assets/botania/blockstates/biomeStoneB6Stairs.json new file mode 100644 index 000000000..f56a3e8cd --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneB6Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/biomeStone22", + "top": "botania:blocks/biomeStone22", + "side": "botania:blocks/biomeStone22" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneB7Slab.json b/src/main/resources/assets/botania/blockstates/biomeStoneB7Slab.json new file mode 100644 index 000000000..ce02273ba --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneB7Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/biomeStone23", + "top": "botania:blocks/biomeStone23", + "side": "botania:blocks/biomeStone23" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneB7SlabFull.json b/src/main/resources/assets/botania/blockstates/biomeStoneB7SlabFull.json new file mode 100644 index 000000000..5c41e50f1 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneB7SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:metamorphic/mesa_brick" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/biomeStoneB7Stairs.json b/src/main/resources/assets/botania/blockstates/biomeStoneB7Stairs.json new file mode 100644 index 000000000..35db19b06 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/biomeStoneB7Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/biomeStone23", + "top": "botania:blocks/biomeStone23", + "side": "botania:blocks/biomeStone23" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/blazeBlock.json b/src/main/resources/assets/botania/blockstates/blazeBlock.json new file mode 100644 index 000000000..ecc5d1fbe --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/blazeBlock.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:blaze_block" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/brewery.json b/src/main/resources/assets/botania/blockstates/brewery.json new file mode 100644 index 000000000..f458ec0ee --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/brewery.json @@ -0,0 +1,12 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "botania:dummy", + "textures": { + "particle": "botania:blocks/livingrock0" + } + }, + "variants": { + "normal": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/bubbell.json b/src/main/resources/assets/botania/blockstates/bubbell.json new file mode 100644 index 000000000..694180568 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/bubbell.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/bubbell" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/bubbell" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/bubbellChibi.json b/src/main/resources/assets/botania/blockstates/bubbellChibi.json new file mode 100644 index 000000000..7f73d9733 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/bubbellChibi.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/bubbellChibi" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/bubbellChibi" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/buriedPetals.json b/src/main/resources/assets/botania/blockstates/buriedPetals.json new file mode 100644 index 000000000..63daacef1 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/buriedPetals.json @@ -0,0 +1,26 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "botania:dummy" + }, + "variants": { + "color": { + "white": { "textures": { "particle": "minecraft:blocks/wool_colored_white" }}, + "orange": { "textures": { "particle": "minecraft:blocks/wool_colored_orange" }}, + "magenta": { "textures": { "particle": "minecraft:blocks/wool_colored_magenta" }}, + "light_blue": { "textures": { "particle": "minecraft:blocks/wool_colored_light_blue" }}, + "yellow": { "textures": { "particle": "minecraft:blocks/wool_colored_yellow" }}, + "lime": { "textures": { "particle": "minecraft:blocks/wool_colored_lime" }}, + "pink": { "textures": { "particle": "minecraft:blocks/wool_colored_pink" }}, + "gray": { "textures": { "particle": "minecraft:blocks/wool_colored_gray" }}, + "silver": { "textures": { "particle": "minecraft:blocks/wool_colored_silver" }}, + "cyan": { "textures": { "particle": "minecraft:blocks/wool_colored_cyan" }}, + "purple": { "textures": { "particle": "minecraft:blocks/wool_colored_purple" }}, + "blue": { "textures": { "particle": "minecraft:blocks/wool_colored_blue" }}, + "brown": { "textures": { "particle": "minecraft:blocks/wool_colored_brown" }}, + "green": { "textures": { "particle": "minecraft:blocks/wool_colored_green" }}, + "red": { "textures": { "particle": "minecraft:blocks/wool_colored_red" }}, + "black": { "textures": { "particle": "minecraft:blocks/wool_colored_black" }} + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/cacophoniumBlock.json b/src/main/resources/assets/botania/blockstates/cacophoniumBlock.json new file mode 100644 index 000000000..10c617df7 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/cacophoniumBlock.json @@ -0,0 +1,6 @@ +{ + "variants": { + "powered=false": { "model": "botania:cacophonium_block" }, + "powered=true": { "model": "botania:cacophonium_block" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/cellBlock.json b/src/main/resources/assets/botania/blockstates/cellBlock.json new file mode 100644 index 000000000..058d79dd6 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/cellBlock.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:cell_block" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/clayconia.json b/src/main/resources/assets/botania/blockstates/clayconia.json new file mode 100644 index 000000000..327e6bee4 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/clayconia.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/clayconia" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/clayconia" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/clayconiaChibi.json b/src/main/resources/assets/botania/blockstates/clayconiaChibi.json new file mode 100644 index 000000000..534a6fde4 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/clayconiaChibi.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/clayconiaChibi" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/clayconiaChibi" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/cocoon.json b/src/main/resources/assets/botania/blockstates/cocoon.json new file mode 100644 index 000000000..575ca5610 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/cocoon.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:cocoon" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/conjurationCatalyst.json b/src/main/resources/assets/botania/blockstates/conjurationCatalyst.json new file mode 100644 index 000000000..359b5d17a --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/conjurationCatalyst.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:conjuration_catalyst" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/corporeaCrystalCube.json b/src/main/resources/assets/botania/blockstates/corporeaCrystalCube.json new file mode 100644 index 000000000..3f84657e0 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/corporeaCrystalCube.json @@ -0,0 +1,35 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "stand": "botania:model/crystalCube_stand", + "base_sides": "botania:model/crystalCube_base_sides", + "base_top": "botania:model/crystalCube_base_top", + "base_bottom": "botania:model/crystalCube_base_bottom", + "cube": "botania:model/crystalCube_cube", + "particle": "botania:blocks/storage2" + } + }, + "variants": { + "static": { + "true": { + "model": "botania:crystalcube_base" + }, + "false": { + "model": "botania:crystalcube_cube" + } + }, + "inventory": [{ + "model": "botania:crystalcube_base", + "transform": "forge:default-block", + "submodel": { + "cube": { + "model": "botania:crystalcube_cube", + "transform": { + "translation": [ 0, 0.5, 0 ] + } + } + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/corporeaFunnel.json b/src/main/resources/assets/botania/blockstates/corporeaFunnel.json new file mode 100644 index 000000000..08b4214ec --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/corporeaFunnel.json @@ -0,0 +1,6 @@ +{ + "variants": { + "powered=false": { "model": "botania:corporea_funnel" }, + "powered=true": { "model": "botania:corporea_funnel" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/corporeaIndex.json b/src/main/resources/assets/botania/blockstates/corporeaIndex.json new file mode 100644 index 000000000..dc3cd27b2 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/corporeaIndex.json @@ -0,0 +1,12 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "botania:dummy", + "textures": { + "particle": "botania:blocks/storage2" + } + }, + "variants": { + "normal": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/corporeaInterceptor.json b/src/main/resources/assets/botania/blockstates/corporeaInterceptor.json new file mode 100644 index 000000000..6b8a3b84f --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/corporeaInterceptor.json @@ -0,0 +1,6 @@ +{ + "variants": { + "powered=false": { "model": "botania:corporea_interceptor" }, + "powered=true": { "model": "botania:corporea_interceptor" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/corporeaRetainer.json b/src/main/resources/assets/botania/blockstates/corporeaRetainer.json new file mode 100644 index 000000000..bd5428952 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/corporeaRetainer.json @@ -0,0 +1,6 @@ +{ + "variants": { + "powered=true": { "model": "botania:corporea_retainer" }, + "powered=false": { "model": "botania:corporea_retainer" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/customBrick.json b/src/main/resources/assets/botania/blockstates/customBrick.json new file mode 100644 index 000000000..41dd56852 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/customBrick.json @@ -0,0 +1,20 @@ +{ + "variants": { + "variant=hellish_brick": { "model": "botania:bricks/hellish_brick" }, + "variant=soul_brick": { "model": "botania:bricks/soul_brick" }, + "variant=frosty_brick": { "model": "botania:bricks/frosty_brick" }, + "variant=roof_tile": { "model": "botania:bricks/roof_tile" }, + "variant=azulejo_1": { "model": "botania:bricks/azulejo_1" }, + "variant=azulejo_2": { "model": "botania:bricks/azulejo_2" }, + "variant=azulejo_3": { "model": "botania:bricks/azulejo_3" }, + "variant=azulejo_4": { "model": "botania:bricks/azulejo_4" }, + "variant=azulejo_5": { "model": "botania:bricks/azulejo_5" }, + "variant=azulejo_6": { "model": "botania:bricks/azulejo_6" }, + "variant=azulejo_7": { "model": "botania:bricks/azulejo_7" }, + "variant=azulejo_8": { "model": "botania:bricks/azulejo_8" }, + "variant=azulejo_9": { "model": "botania:bricks/azulejo_9" }, + "variant=azulejo_10": { "model": "botania:bricks/azulejo_10" }, + "variant=azulejo_11": { "model": "botania:bricks/azulejo_11" }, + "variant=azulejo_12": { "model": "botania:bricks/azulejo_12" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/customBrick0Slab.json b/src/main/resources/assets/botania/blockstates/customBrick0Slab.json new file mode 100644 index 000000000..abdd8bee0 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/customBrick0Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/customBrick0", + "top": "botania:blocks/customBrick0", + "side": "botania:blocks/customBrick0" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/customBrick0SlabFull.json b/src/main/resources/assets/botania/blockstates/customBrick0SlabFull.json new file mode 100644 index 000000000..c7dd413b5 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/customBrick0SlabFull.json @@ -0,0 +1,9 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "minecraft:cube_all", + "textures": { "all": "botania:blocks/customBrick0" } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/customBrick0Stairs.json b/src/main/resources/assets/botania/blockstates/customBrick0Stairs.json new file mode 100644 index 000000000..fafef7906 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/customBrick0Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/customBrick0", + "top": "botania:blocks/customBrick0", + "side": "botania:blocks/customBrick0" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/customBrick1Slab.json b/src/main/resources/assets/botania/blockstates/customBrick1Slab.json new file mode 100644 index 000000000..49c293195 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/customBrick1Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/customBrick1", + "top": "botania:blocks/customBrick1", + "side": "botania:blocks/customBrick1" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/customBrick1SlabFull.json b/src/main/resources/assets/botania/blockstates/customBrick1SlabFull.json new file mode 100644 index 000000000..e299f14db --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/customBrick1SlabFull.json @@ -0,0 +1,9 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "minecraft:cube_all", + "textures": { "all": "botania:blocks/customBrick1" } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/customBrick1Stairs.json b/src/main/resources/assets/botania/blockstates/customBrick1Stairs.json new file mode 100644 index 000000000..7466a8295 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/customBrick1Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/customBrick1", + "top": "botania:blocks/customBrick1", + "side": "botania:blocks/customBrick1" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/customBrick2Slab.json b/src/main/resources/assets/botania/blockstates/customBrick2Slab.json new file mode 100644 index 000000000..4ed57c712 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/customBrick2Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/customBrick2", + "top": "botania:blocks/customBrick2", + "side": "botania:blocks/customBrick2" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/customBrick2SlabFull.json b/src/main/resources/assets/botania/blockstates/customBrick2SlabFull.json new file mode 100644 index 000000000..dd5a23420 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/customBrick2SlabFull.json @@ -0,0 +1,9 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "minecraft:cube_all", + "textures": { "all": "botania:blocks/customBrick2" } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/customBrick2Stairs.json b/src/main/resources/assets/botania/blockstates/customBrick2Stairs.json new file mode 100644 index 000000000..ed0357faf --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/customBrick2Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/customBrick2", + "top": "botania:blocks/customBrick2", + "side": "botania:blocks/customBrick2" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/customBrick3Slab.json b/src/main/resources/assets/botania/blockstates/customBrick3Slab.json new file mode 100644 index 000000000..f4cbb49ce --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/customBrick3Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/customBrick3", + "top": "botania:blocks/customBrick3", + "side": "botania:blocks/customBrick3" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/customBrick3SlabFull.json b/src/main/resources/assets/botania/blockstates/customBrick3SlabFull.json new file mode 100644 index 000000000..cba4e7996 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/customBrick3SlabFull.json @@ -0,0 +1,9 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "minecraft:cube_all", + "textures": { "all": "botania:blocks/customBrick3" } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/customBrick3Stairs.json b/src/main/resources/assets/botania/blockstates/customBrick3Stairs.json new file mode 100644 index 000000000..e26504eb7 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/customBrick3Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/customBrick3", + "top": "botania:blocks/customBrick3", + "side": "botania:blocks/customBrick3" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/daffomill.json b/src/main/resources/assets/botania/blockstates/daffomill.json new file mode 100644 index 000000000..d8864e463 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/daffomill.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/daffomill" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/daffomill" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/dandelifeon.json b/src/main/resources/assets/botania/blockstates/dandelifeon.json new file mode 100644 index 000000000..afd8fd88b --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/dandelifeon.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/dandelifeon" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/dandelifeon" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/daybloom.json b/src/main/resources/assets/botania/blockstates/daybloom.json new file mode 100644 index 000000000..3039b1ff2 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/daybloom.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/daybloom" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/daybloom" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/daybloomDecor.json b/src/main/resources/assets/botania/blockstates/daybloomDecor.json new file mode 100644 index 000000000..ee92199f2 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/daybloomDecor.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/daybloomDecor" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/daybloomDecor" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/daybloomPrime.json b/src/main/resources/assets/botania/blockstates/daybloomPrime.json new file mode 100644 index 000000000..3e8aac7c9 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/daybloomPrime.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/daybloomPrime" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/daybloomPrime" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/desert_cobble_wall.json b/src/main/resources/assets/botania/blockstates/desert_cobble_wall.json new file mode 100644 index 000000000..c0fb44666 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/desert_cobble_wall.json @@ -0,0 +1,19 @@ +{ + "multipart": [ + { "when": { "up": "true" }, + "apply": { "model": "botania:walls/desert_cobble_wall_post" } + }, + { "when": { "north": "true" }, + "apply": { "model": "botania:walls/desert_cobble_wall_side", "uvlock": true } + }, + { "when": { "east": "true" }, + "apply": { "model": "botania:walls/desert_cobble_wall_side", "y": 90, "uvlock": true } + }, + { "when": { "south": "true" }, + "apply": { "model": "botania:walls/desert_cobble_wall_side", "y": 180, "uvlock": true } + }, + { "when": { "west": "true" }, + "apply": { "model": "botania:walls/desert_cobble_wall_side", "y": 270, "uvlock": true } + } + ] +} diff --git a/src/main/resources/assets/botania/blockstates/dirtPath.json b/src/main/resources/assets/botania/blockstates/dirtPath.json new file mode 100644 index 000000000..dba05d34f --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/dirtPath.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:trodden_dirt" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/dirtPath0Slab.json b/src/main/resources/assets/botania/blockstates/dirtPath0Slab.json new file mode 100644 index 000000000..1269589ed --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/dirtPath0Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "minecraft:blocks/grass_path_top", + "top": "minecraft:blocks/grass_path_top", + "side": "minecraft:blocks/grass_path_top" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/dirtPath0SlabFull.json b/src/main/resources/assets/botania/blockstates/dirtPath0SlabFull.json new file mode 100644 index 000000000..8c1f76359 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/dirtPath0SlabFull.json @@ -0,0 +1,9 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "minecraft:cube_all", + "textures": { "all": "minecraft:blocks/grass_path_top" } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/distributor.json b/src/main/resources/assets/botania/blockstates/distributor.json new file mode 100644 index 000000000..abc49f785 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/distributor.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:mana_distributor" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/doubleFlower1.json b/src/main/resources/assets/botania/blockstates/doubleFlower1.json new file mode 100644 index 000000000..339214df2 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/doubleFlower1.json @@ -0,0 +1,24 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:cross" + }, + "variants": { + "df_variant=white,half=lower": [{ "textures": { "cross": "botania:blocks/flower0Tall0" } }], + "df_variant=white,half=upper": [{ "textures": { "cross": "botania:blocks/flower0Tall1" } }], + "df_variant=orange,half=lower": [{ "textures": { "cross": "botania:blocks/flower1Tall0" } }], + "df_variant=orange,half=upper": [{ "textures": { "cross": "botania:blocks/flower1Tall1" } }], + "df_variant=magenta,half=lower": [{ "textures": { "cross": "botania:blocks/flower2Tall0" } }], + "df_variant=magenta,half=upper": [{ "textures": { "cross": "botania:blocks/flower2Tall1" } }], + "df_variant=light_blue,half=lower": [{ "textures": { "cross": "botania:blocks/flower3Tall0" } }], + "df_variant=light_blue,half=upper": [{ "textures": { "cross": "botania:blocks/flower3Tall1" } }], + "df_variant=yellow,half=lower": [{ "textures": { "cross": "botania:blocks/flower4Tall0" } }], + "df_variant=yellow,half=upper": [{ "textures": { "cross": "botania:blocks/flower4Tall1" } }], + "df_variant=lime,half=lower": [{ "textures": { "cross": "botania:blocks/flower5Tall0" } }], + "df_variant=lime,half=upper": [{ "textures": { "cross": "botania:blocks/flower5Tall1" } }], + "df_variant=pink,half=lower": [{ "textures": { "cross": "botania:blocks/flower6Tall0" } }], + "df_variant=pink,half=upper": [{ "textures": { "cross": "botania:blocks/flower6Tall1" } }], + "df_variant=gray,half=lower": [{ "textures": { "cross": "botania:blocks/flower7Tall0" } }], + "df_variant=gray,half=upper": [{ "textures": { "cross": "botania:blocks/flower7Tall1" } }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/doubleFlower2.json b/src/main/resources/assets/botania/blockstates/doubleFlower2.json new file mode 100644 index 000000000..d74db343c --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/doubleFlower2.json @@ -0,0 +1,24 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:cross" + }, + "variants": { + "df_variant=silver,half=lower": [{ "textures": { "cross": "botania:blocks/flower8Tall0" } }], + "df_variant=silver,half=upper": [{ "textures": { "cross": "botania:blocks/flower8Tall1" } }], + "df_variant=cyan,half=lower": [{ "textures": { "cross": "botania:blocks/flower9Tall0" } }], + "df_variant=cyan,half=upper": [{ "textures": { "cross": "botania:blocks/flower9Tall1" } }], + "df_variant=purple,half=lower": [{ "textures": { "cross": "botania:blocks/flower10Tall0" } }], + "df_variant=purple,half=upper": [{ "textures": { "cross": "botania:blocks/flower10Tall1" } }], + "df_variant=blue,half=lower": [{ "textures": { "cross": "botania:blocks/flower11Tall0" } }], + "df_variant=blue,half=upper": [{ "textures": { "cross": "botania:blocks/flower11Tall1" } }], + "df_variant=brown,half=lower": [{ "textures": { "cross": "botania:blocks/flower12Tall0" } }], + "df_variant=brown,half=upper": [{ "textures": { "cross": "botania:blocks/flower12Tall1" } }], + "df_variant=green,half=lower": [{ "textures": { "cross": "botania:blocks/flower13Tall0" } }], + "df_variant=green,half=upper": [{ "textures": { "cross": "botania:blocks/flower13Tall1" } }], + "df_variant=red,half=lower": [{ "textures": { "cross": "botania:blocks/flower14Tall0" } }], + "df_variant=red,half=upper": [{ "textures": { "cross": "botania:blocks/flower14Tall1" } }], + "df_variant=black,half=lower": [{ "textures": { "cross": "botania:blocks/flower15Tall0" } }], + "df_variant=black,half=upper": [{ "textures": { "cross": "botania:blocks/flower15Tall1" } }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/dreadthorn.json b/src/main/resources/assets/botania/blockstates/dreadthorn.json new file mode 100644 index 000000000..ea12ba1a0 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/dreadthorn.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/dreadthorn" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/dreadthorn" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/dreamwood.json b/src/main/resources/assets/botania/blockstates/dreamwood.json new file mode 100644 index 000000000..2c86462f8 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/dreamwood.json @@ -0,0 +1,10 @@ +{ + "variants": { + "variant=default": { "model": "botania:dreamwood" }, + "variant=planks": { "model": "botania:dreamwood_planks" }, + "variant=mossy_planks": { "model": "botania:dreamwood_mossy_planks" }, + "variant=framed": { "model": "botania:dreamwood_framed" }, + "variant=pattern_framed": { "model": "botania:dreamwood_pattern_framed" }, + "variant=glimmering": { "model": "botania:dreamwood_glimmering" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/dreamwood0Slab.json b/src/main/resources/assets/botania/blockstates/dreamwood0Slab.json new file mode 100644 index 000000000..110556584 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/dreamwood0Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/dreamwood0", + "top": "botania:blocks/dreamwood0", + "side": "botania:blocks/dreamwood0" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/dreamwood0SlabFull.json b/src/main/resources/assets/botania/blockstates/dreamwood0SlabFull.json new file mode 100644 index 000000000..796feb957 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/dreamwood0SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:dreamwood" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/dreamwood0Stairs.json b/src/main/resources/assets/botania/blockstates/dreamwood0Stairs.json new file mode 100644 index 000000000..08f651f19 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/dreamwood0Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/dreamwood0", + "top": "botania:blocks/dreamwood0", + "side": "botania:blocks/dreamwood0" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/dreamwood0Wall.json b/src/main/resources/assets/botania/blockstates/dreamwood0Wall.json new file mode 100644 index 000000000..961cad135 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/dreamwood0Wall.json @@ -0,0 +1,19 @@ +{ + "multipart": [ + { "when": { "up": "true" }, + "apply": { "model": "botania:walls/dreamwood_wall_post" } + }, + { "when": { "north": "true" }, + "apply": { "model": "botania:walls/dreamwood_wall_side", "uvlock": true } + }, + { "when": { "east": "true" }, + "apply": { "model": "botania:walls/dreamwood_wall_side", "y": 90, "uvlock": true } + }, + { "when": { "south": "true" }, + "apply": { "model": "botania:walls/dreamwood_wall_side", "y": 180, "uvlock": true } + }, + { "when": { "west": "true" }, + "apply": { "model": "botania:walls/dreamwood_wall_side", "y": 270, "uvlock": true } + } + ] +} diff --git a/src/main/resources/assets/botania/blockstates/dreamwood1Slab.json b/src/main/resources/assets/botania/blockstates/dreamwood1Slab.json new file mode 100644 index 000000000..3ee6100d0 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/dreamwood1Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/dreamwood1", + "top": "botania:blocks/dreamwood1", + "side": "botania:blocks/dreamwood1" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/dreamwood1SlabFull.json b/src/main/resources/assets/botania/blockstates/dreamwood1SlabFull.json new file mode 100644 index 000000000..e1afb1a06 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/dreamwood1SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:dreamwood_planks" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/dreamwood1Stairs.json b/src/main/resources/assets/botania/blockstates/dreamwood1Stairs.json new file mode 100644 index 000000000..e82735595 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/dreamwood1Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/dreamwood1", + "top": "botania:blocks/dreamwood1", + "side": "botania:blocks/dreamwood1" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/elfGlass.json b/src/main/resources/assets/botania/blockstates/elfGlass.json new file mode 100644 index 000000000..46e30264a --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/elfGlass.json @@ -0,0 +1,15 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_all", + "transform": "forge:default-block" + }, + "variants": { + "normal": [ + { "textures": { "all": "botania:blocks/elfGlass0" } }, + { "textures": { "all": "botania:blocks/elfGlass1" } }, + { "textures": { "all": "botania:blocks/elfGlass2" } }, + { "textures": { "all": "botania:blocks/elfGlass3" } } + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/elfGlassPane.json b/src/main/resources/assets/botania/blockstates/elfGlassPane.json new file mode 100644 index 000000000..91e8fff09 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/elfGlassPane.json @@ -0,0 +1,28 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:pane_post", + "textures": { + "edge": "botania:blocks/elfGlassPane", + "pane": "botania:blocks/elfGlass" + } + }, + "variants": { + "north": { + "true": { "submodel": { "nside": { "model": "minecraft:pane_side" } } }, + "false": { "submodel": { "nside": { "model": "minecraft:pane_noside" } } } + }, + "south": { + "true": { "submodel": { "sside": { "model": "minecraft:pane_side_alt" } } }, + "false": { "submodel": { "sside": { "model": "minecraft:pane_noside_alt", "y": 90 } } } + }, + "west": { + "true": { "submodel": { "wside": { "model": "minecraft:pane_side_alt", "y": 90 } } }, + "false": { "submodel": { "wside": { "model": "minecraft:pane_noside", "y": 270 } } } + }, + "east": { + "true": { "submodel": { "eside": { "model": "minecraft:pane_side", "y": 90 } } }, + "false": { "submodel": { "eside": { "model": "minecraft:pane_noside_alt" } } } + } + } +} diff --git a/src/main/resources/assets/botania/blockstates/enchantedSoil.json b/src/main/resources/assets/botania/blockstates/enchantedSoil.json new file mode 100644 index 000000000..3d5fd4c4a --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/enchantedSoil.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:enchanted_soil" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/enchanter.json b/src/main/resources/assets/botania/blockstates/enchanter.json new file mode 100644 index 000000000..536e7f653 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/enchanter.json @@ -0,0 +1,6 @@ +{ + "variants": { + "facing=x": { "model": "botania:mana_enchanter" }, + "facing=z": { "model": "botania:mana_enchanter" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/enderEyeBlock.json b/src/main/resources/assets/botania/blockstates/enderEyeBlock.json new file mode 100644 index 000000000..ccd930d3c --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/enderEyeBlock.json @@ -0,0 +1,6 @@ +{ + "variants": { + "powered=true": { "model": "botania:ender_eye_block_powered" }, + "powered=false": { "model": "botania:ender_eye_block" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/endoflame.json b/src/main/resources/assets/botania/blockstates/endoflame.json new file mode 100644 index 000000000..39e033093 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/endoflame.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/endoflame" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/endoflame" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/entropinnyum.json b/src/main/resources/assets/botania/blockstates/entropinnyum.json new file mode 100644 index 000000000..c34f0cae3 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/entropinnyum.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/entropinnyum" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/entropinnyum" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/exoflame.json b/src/main/resources/assets/botania/blockstates/exoflame.json new file mode 100644 index 000000000..81b76d343 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/exoflame.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/exoflame" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/exoflame" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/fakeAir.json b/src/main/resources/assets/botania/blockstates/fakeAir.json new file mode 100644 index 000000000..482ea550e --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/fakeAir.json @@ -0,0 +1,12 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "botania:dummy", + "textures": { + "particle": "minecraft:items/barrier" + } + }, + "variants": { + "normal": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/fallenKanade.json b/src/main/resources/assets/botania/blockstates/fallenKanade.json new file mode 100644 index 000000000..577aaf195 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/fallenKanade.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/fallenKanade" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/fallenKanade" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/felPumpkin.json b/src/main/resources/assets/botania/blockstates/felPumpkin.json new file mode 100644 index 000000000..c07e63156 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/felPumpkin.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "botania:fel_pumpkin" }, + "facing=south": { "model": "botania:fel_pumpkin", "y": 180 }, + "facing=west": { "model": "botania:fel_pumpkin", "y": 270 }, + "facing=east": { "model": "botania:fel_pumpkin", "y": 90 } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/flower.json b/src/main/resources/assets/botania/blockstates/flower.json new file mode 100644 index 000000000..a908efe68 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/flower.json @@ -0,0 +1,20 @@ +{ + "variants": { + "color=white": { "model": "botania:plants/flower_white" }, + "color=orange": { "model": "botania:plants/flower_orange" }, + "color=magenta": { "model": "botania:plants/flower_magenta" }, + "color=light_blue": { "model": "botania:plants/flower_light_blue" }, + "color=yellow": { "model": "botania:plants/flower_yellow" }, + "color=lime": { "model": "botania:plants/flower_lime" }, + "color=pink": { "model": "botania:plants/flower_pink" }, + "color=gray": { "model": "botania:plants/flower_gray" }, + "color=silver": { "model": "botania:plants/flower_silver" }, + "color=cyan": { "model": "botania:plants/flower_cyan" }, + "color=purple": { "model": "botania:plants/flower_purple" }, + "color=blue": { "model": "botania:plants/flower_blue" }, + "color=brown": { "model": "botania:plants/flower_brown" }, + "color=green": { "model": "botania:plants/flower_green" }, + "color=red": { "model": "botania:plants/flower_red" }, + "color=black": { "model": "botania:plants/flower_black" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/forestDrum.json b/src/main/resources/assets/botania/blockstates/forestDrum.json new file mode 100644 index 000000000..a7f73aba4 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/forestDrum.json @@ -0,0 +1,7 @@ +{ + "variants": { + "variant=wild": { "model": "botania:drum_wild" }, + "variant=gathering": { "model": "botania:drum_gathering" }, + "variant=canopy": { "model": "botania:drum_canopy" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/forestEye.json b/src/main/resources/assets/botania/blockstates/forestEye.json new file mode 100644 index 000000000..8b96be9a7 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/forestEye.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:eye_of_ancients" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/forest_cobble_wall.json b/src/main/resources/assets/botania/blockstates/forest_cobble_wall.json new file mode 100644 index 000000000..30aed1269 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/forest_cobble_wall.json @@ -0,0 +1,19 @@ +{ + "multipart": [ + { "when": { "up": "true" }, + "apply": { "model": "botania:walls/forest_cobble_wall_post" } + }, + { "when": { "north": "true" }, + "apply": { "model": "botania:walls/forest_cobble_wall_side", "uvlock": true } + }, + { "when": { "east": "true" }, + "apply": { "model": "botania:walls/forest_cobble_wall_side", "y": 90, "uvlock": true } + }, + { "when": { "south": "true" }, + "apply": { "model": "botania:walls/forest_cobble_wall_side", "y": 180, "uvlock": true } + }, + { "when": { "west": "true" }, + "apply": { "model": "botania:walls/forest_cobble_wall_side", "y": 270, "uvlock": true } + } + ] +} diff --git a/src/main/resources/assets/botania/blockstates/fungal_cobble_wall.json b/src/main/resources/assets/botania/blockstates/fungal_cobble_wall.json new file mode 100644 index 000000000..cea3da485 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/fungal_cobble_wall.json @@ -0,0 +1,19 @@ +{ + "multipart": [ + { "when": { "up": "true" }, + "apply": { "model": "botania:walls/fungal_cobble_wall_post" } + }, + { "when": { "north": "true" }, + "apply": { "model": "botania:walls/fungal_cobble_wall_side", "uvlock": true } + }, + { "when": { "east": "true" }, + "apply": { "model": "botania:walls/fungal_cobble_wall_side", "y": 90, "uvlock": true } + }, + { "when": { "south": "true" }, + "apply": { "model": "botania:walls/fungal_cobble_wall_side", "y": 180, "uvlock": true } + }, + { "when": { "west": "true" }, + "apply": { "model": "botania:walls/fungal_cobble_wall_side", "y": 270, "uvlock": true } + } + ] +} diff --git a/src/main/resources/assets/botania/blockstates/gaiaHeadBlock.json b/src/main/resources/assets/botania/blockstates/gaiaHeadBlock.json new file mode 100644 index 000000000..4c72d6125 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/gaiaHeadBlock.json @@ -0,0 +1,12 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "botania:dummy", + "textures": { + "particle": "minecraft:blocks/soul_sand" + } + }, + "variants": { + "normal": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/ghostRail.json b/src/main/resources/assets/botania/blockstates/ghostRail.json new file mode 100644 index 000000000..d7a6becb1 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/ghostRail.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "rail": "botania:blocks/ghostRail" + } + }, + "variants": { + "shape": { + "north_south": { "model": "minecraft:rail_flat" }, + "east_west": { "model": "minecraft:rail_flat", "y": 90 }, + "ascending_east": { "model": "minecraft:rail_raised_ne", "y": 90 }, + "ascending_west": { "model": "minecraft:rail_raised_sw", "y": 90 }, + "ascending_north": { "model": "minecraft:rail_raised_ne" }, + "ascending_south": { "model": "minecraft:rail_raised_sw" } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/gourmaryllis.json b/src/main/resources/assets/botania/blockstates/gourmaryllis.json new file mode 100644 index 000000000..2416e8497 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/gourmaryllis.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/gourmaryllis" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/gourmaryllis" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/heiseiDream.json b/src/main/resources/assets/botania/blockstates/heiseiDream.json new file mode 100644 index 000000000..1c547476a --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/heiseiDream.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/heiseiDream" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/heiseiDream" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/hopperhock.json b/src/main/resources/assets/botania/blockstates/hopperhock.json new file mode 100644 index 000000000..befced811 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/hopperhock.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/hopperhock" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/hopperhock" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/hopperhockChibi.json b/src/main/resources/assets/botania/blockstates/hopperhockChibi.json new file mode 100644 index 000000000..0f140cfc2 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/hopperhockChibi.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/hopperhockChibi" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/hopperhockChibi" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/hourglass.json b/src/main/resources/assets/botania/blockstates/hourglass.json new file mode 100644 index 000000000..4e63db707 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/hourglass.json @@ -0,0 +1,12 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "botania:dummy", + "textures": { + "particle": "botania:blocks/manaGlass" + } + }, + "variants": { + "normal": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/hyacidus.json b/src/main/resources/assets/botania/blockstates/hyacidus.json new file mode 100644 index 000000000..02f2e0543 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/hyacidus.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/hyacidus" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/hyacidus" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/hydroangeas.json b/src/main/resources/assets/botania/blockstates/hydroangeas.json new file mode 100644 index 000000000..a1d968249 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/hydroangeas.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/hydroangeas" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/hydroangeas" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/hydroangeasDecor.json b/src/main/resources/assets/botania/blockstates/hydroangeasDecor.json new file mode 100644 index 000000000..61cd3b7d5 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/hydroangeasDecor.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/hydroangeasDecor" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/hydroangeasDecor" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/incensePlate.json b/src/main/resources/assets/botania/blockstates/incensePlate.json new file mode 100644 index 000000000..7fbf37f19 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/incensePlate.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "botania:incense_plate", "y": 180 }, + "facing=south": { "model": "botania:incense_plate" }, + "facing=west": { "model": "botania:incense_plate", "y": 90 }, + "facing=east": { "model": "botania:incense_plate", "y": 270 } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/jadedAmaranthus.json b/src/main/resources/assets/botania/blockstates/jadedAmaranthus.json new file mode 100644 index 000000000..492f3120d --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/jadedAmaranthus.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/jadedAmaranthus" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/jadedAmaranthus" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/jiyuulia.json b/src/main/resources/assets/botania/blockstates/jiyuulia.json new file mode 100644 index 000000000..84286f930 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/jiyuulia.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/jiyuulia" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/jiyuulia" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/kekimurus.json b/src/main/resources/assets/botania/blockstates/kekimurus.json new file mode 100644 index 000000000..0946b31b4 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/kekimurus.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/kekimurus" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/kekimurus" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/lightLauncher.json b/src/main/resources/assets/botania/blockstates/lightLauncher.json new file mode 100644 index 000000000..bd135fbef --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/lightLauncher.json @@ -0,0 +1,6 @@ +{ + "variants": { + "powered=true": { "model": "botania:luminizer_launcher" }, + "powered=false": { "model": "botania:luminizer_launcher" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/lightRelay.json b/src/main/resources/assets/botania/blockstates/lightRelay.json new file mode 100644 index 000000000..6b9542b00 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/lightRelay.json @@ -0,0 +1,27 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "builtin/generated", + "transform": "forge:default-item" + }, + "variants": { + "powered": { + "true": {}, + "false": {} + }, + "variant": { + "default": { + "textures": { + "layer0": "botania:blocks/lightRelay0", + "particle": "botania:blocks/lightRelay1" + } + }, + "detector": { + "textures": { + "layer0": "botania:blocks/lightRelay2", + "particle": "botania:blocks/lightRelay3" + } + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/livingrock.json b/src/main/resources/assets/botania/blockstates/livingrock.json new file mode 100644 index 000000000..3474630d0 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/livingrock.json @@ -0,0 +1,9 @@ +{ + "variants": { + "variant=default": { "model": "botania:livingrock" }, + "variant=brick": { "model": "botania:livingrock_brick" }, + "variant=mossy_brick": { "model": "botania:livingrock_mossy_brick" }, + "variant=cracked_brick": { "model": "botania:livingrock_cracked_brick" }, + "variant=chiseled_brick": { "model": "botania:livingrock_chiseled_brick" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/livingrock0Slab.json b/src/main/resources/assets/botania/blockstates/livingrock0Slab.json new file mode 100644 index 000000000..b228f4123 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/livingrock0Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/livingrock0", + "top": "botania:blocks/livingrock0", + "side": "botania:blocks/livingrock0" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/livingrock0SlabFull.json b/src/main/resources/assets/botania/blockstates/livingrock0SlabFull.json new file mode 100644 index 000000000..0ff8d3a0b --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/livingrock0SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:livingrock" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/livingrock0Stairs.json b/src/main/resources/assets/botania/blockstates/livingrock0Stairs.json new file mode 100644 index 000000000..49d331cc2 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/livingrock0Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/livingrock0", + "top": "botania:blocks/livingrock0", + "side": "botania:blocks/livingrock0" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/livingrock0Wall.json b/src/main/resources/assets/botania/blockstates/livingrock0Wall.json new file mode 100644 index 000000000..11461ad34 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/livingrock0Wall.json @@ -0,0 +1,19 @@ +{ + "multipart": [ + { "when": { "up": "true" }, + "apply": { "model": "botania:walls/livingrock_wall_post" } + }, + { "when": { "north": "true" }, + "apply": { "model": "botania:walls/livingrock_wall_side", "uvlock": true } + }, + { "when": { "east": "true" }, + "apply": { "model": "botania:walls/livingrock_wall_side", "y": 90, "uvlock": true } + }, + { "when": { "south": "true" }, + "apply": { "model": "botania:walls/livingrock_wall_side", "y": 180, "uvlock": true } + }, + { "when": { "west": "true" }, + "apply": { "model": "botania:walls/livingrock_wall_side", "y": 270, "uvlock": true } + } + ] +} diff --git a/src/main/resources/assets/botania/blockstates/livingrock1Slab.json b/src/main/resources/assets/botania/blockstates/livingrock1Slab.json new file mode 100644 index 000000000..872083377 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/livingrock1Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/livingrock1", + "top": "botania:blocks/livingrock1", + "side": "botania:blocks/livingrock1" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/livingrock1SlabFull.json b/src/main/resources/assets/botania/blockstates/livingrock1SlabFull.json new file mode 100644 index 000000000..ad78304be --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/livingrock1SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:livingrock_brick" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/livingrock1Stairs.json b/src/main/resources/assets/botania/blockstates/livingrock1Stairs.json new file mode 100644 index 000000000..3fea9800c --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/livingrock1Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/livingrock1", + "top": "botania:blocks/livingrock1", + "side": "botania:blocks/livingrock1" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/livingwood.json b/src/main/resources/assets/botania/blockstates/livingwood.json new file mode 100644 index 000000000..e3927b205 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/livingwood.json @@ -0,0 +1,10 @@ +{ + "variants": { + "variant=default": { "model": "botania:livingwood" }, + "variant=planks": { "model": "botania:livingwood_planks" }, + "variant=mossy_planks": { "model": "botania:livingwood_mossy_planks" }, + "variant=framed": { "model": "botania:livingwood_framed" }, + "variant=pattern_framed": { "model": "botania:livingwood_pattern_framed" }, + "variant=glimmering": { "model": "botania:livingwood_glimmering" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/livingwood0Slab.json b/src/main/resources/assets/botania/blockstates/livingwood0Slab.json new file mode 100644 index 000000000..69d691de7 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/livingwood0Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/livingwood0", + "top": "botania:blocks/livingwood0", + "side": "botania:blocks/livingwood0" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/livingwood0SlabFull.json b/src/main/resources/assets/botania/blockstates/livingwood0SlabFull.json new file mode 100644 index 000000000..71d8758ab --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/livingwood0SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:livingwood" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/livingwood0Stairs.json b/src/main/resources/assets/botania/blockstates/livingwood0Stairs.json new file mode 100644 index 000000000..d896e6345 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/livingwood0Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/livingwood0", + "top": "botania:blocks/livingwood0", + "side": "botania:blocks/livingwood0" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/livingwood0Wall.json b/src/main/resources/assets/botania/blockstates/livingwood0Wall.json new file mode 100644 index 000000000..f99a5f705 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/livingwood0Wall.json @@ -0,0 +1,19 @@ +{ + "multipart": [ + { "when": { "up": "true" }, + "apply": { "model": "botania:walls/livingwood_wall_post" } + }, + { "when": { "north": "true" }, + "apply": { "model": "botania:walls/livingwood_wall_side", "uvlock": true } + }, + { "when": { "east": "true" }, + "apply": { "model": "botania:walls/livingwood_wall_side", "y": 90, "uvlock": true } + }, + { "when": { "south": "true" }, + "apply": { "model": "botania:walls/livingwood_wall_side", "y": 180, "uvlock": true } + }, + { "when": { "west": "true" }, + "apply": { "model": "botania:walls/livingwood_wall_side", "y": 270, "uvlock": true } + } + ] +} diff --git a/src/main/resources/assets/botania/blockstates/livingwood1Slab.json b/src/main/resources/assets/botania/blockstates/livingwood1Slab.json new file mode 100644 index 000000000..3971fc8c6 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/livingwood1Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/livingwood1", + "top": "botania:blocks/livingwood1", + "side": "botania:blocks/livingwood1" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/livingwood1SlabFull.json b/src/main/resources/assets/botania/blockstates/livingwood1SlabFull.json new file mode 100644 index 000000000..ee151acbe --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/livingwood1SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:livingwood_planks" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/livingwood1Stairs.json b/src/main/resources/assets/botania/blockstates/livingwood1Stairs.json new file mode 100644 index 000000000..ab1065d66 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/livingwood1Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/livingwood1", + "top": "botania:blocks/livingwood1", + "side": "botania:blocks/livingwood1" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/loonium.json b/src/main/resources/assets/botania/blockstates/loonium.json new file mode 100644 index 000000000..7f1c475ca --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/loonium.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/loonium" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/loonium" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/manaBeacon.json b/src/main/resources/assets/botania/blockstates/manaBeacon.json new file mode 100644 index 000000000..09ef83a89 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/manaBeacon.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:unstable_beacon" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/manaBomb.json b/src/main/resources/assets/botania/blockstates/manaBomb.json new file mode 100644 index 000000000..ecd268549 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/manaBomb.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:manastorm_charge" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/manaDetector.json b/src/main/resources/assets/botania/blockstates/manaDetector.json new file mode 100644 index 000000000..ade96b44f --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/manaDetector.json @@ -0,0 +1,6 @@ +{ + "variants": { + "powered=false": { "model": "botania:mana_detector" }, + "powered=true": { "model": "botania:mana_detector_powered" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/manaFlame.json b/src/main/resources/assets/botania/blockstates/manaFlame.json new file mode 100644 index 000000000..6e603cbb6 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/manaFlame.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "botania:dummy", + "textures": { + "particle": "minecraft:blocks/fire_layer_0" + } + }, + "variants": { + "normal": [{}], + "inventory": [{ + "model": "builtin/generated", + "textures": { + "layer0": "minecraft:blocks/fire_layer_0" + }, + "transform": "forge:default-item" + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/manaGlass.json b/src/main/resources/assets/botania/blockstates/manaGlass.json new file mode 100644 index 000000000..f8cce71ca --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/manaGlass.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:mana_glass" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/manaGlassPane.json b/src/main/resources/assets/botania/blockstates/manaGlassPane.json new file mode 100644 index 000000000..4b9443f11 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/manaGlassPane.json @@ -0,0 +1,28 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:pane_post", + "textures": { + "edge": "botania:blocks/manaGlassPane", + "pane": "botania:blocks/manaGlass" + } + }, + "variants": { + "north": { + "true": { "submodel": { "nside": { "model": "minecraft:pane_side" } } }, + "false": { "submodel": { "nside": { "model": "minecraft:pane_noside" } } } + }, + "south": { + "true": { "submodel": { "sside": { "model": "minecraft:pane_side_alt" } } }, + "false": { "submodel": { "sside": { "model": "minecraft:pane_noside_alt", "y": 90 } } } + }, + "west": { + "true": { "submodel": { "wside": { "model": "minecraft:pane_side_alt", "y": 90 } } }, + "false": { "submodel": { "wside": { "model": "minecraft:pane_noside", "y": 270 } } } + }, + "east": { + "true": { "submodel": { "eside": { "model": "minecraft:pane_side", "y": 90 } } }, + "false": { "submodel": { "eside": { "model": "minecraft:pane_noside_alt" } } } + } + } +} diff --git a/src/main/resources/assets/botania/blockstates/manaVoid.json b/src/main/resources/assets/botania/blockstates/manaVoid.json new file mode 100644 index 000000000..c2aed8531 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/manaVoid.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:mana_void" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/manastar.json b/src/main/resources/assets/botania/blockstates/manastar.json new file mode 100644 index 000000000..231686329 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/manastar.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/manastar" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/manastar" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/marimorphosis.json b/src/main/resources/assets/botania/blockstates/marimorphosis.json new file mode 100644 index 000000000..dd45b4746 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/marimorphosis.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/marimorphosis" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/marimorphosis" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/marimorphosisChibi.json b/src/main/resources/assets/botania/blockstates/marimorphosisChibi.json new file mode 100644 index 000000000..b8b180b56 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/marimorphosisChibi.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/marimorphosisChibi" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/marimorphosisChibi" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/medumone.json b/src/main/resources/assets/botania/blockstates/medumone.json new file mode 100644 index 000000000..1de43a6d4 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/medumone.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/medumone" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/medumone" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/mesa_cobble_wall.json b/src/main/resources/assets/botania/blockstates/mesa_cobble_wall.json new file mode 100644 index 000000000..a8e55a55b --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/mesa_cobble_wall.json @@ -0,0 +1,19 @@ +{ + "multipart": [ + { "when": { "up": "true" }, + "apply": { "model": "botania:walls/mesa_cobble_wall_post" } + }, + { "when": { "north": "true" }, + "apply": { "model": "botania:walls/mesa_cobble_wall_side", "uvlock": true } + }, + { "when": { "east": "true" }, + "apply": { "model": "botania:walls/mesa_cobble_wall_side", "y": 90, "uvlock": true } + }, + { "when": { "south": "true" }, + "apply": { "model": "botania:walls/mesa_cobble_wall_side", "y": 180, "uvlock": true } + }, + { "when": { "west": "true" }, + "apply": { "model": "botania:walls/mesa_cobble_wall_side", "y": 270, "uvlock": true } + } + ] +} diff --git a/src/main/resources/assets/botania/blockstates/miniIsland.json b/src/main/resources/assets/botania/blockstates/miniIsland.json new file mode 100644 index 000000000..5a0f66ecb --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/miniIsland.json @@ -0,0 +1,14 @@ +{ + "variants": { + "variant=grass": { "model": "botania:islands/island_grass" }, + "variant=podzol": { "model": "botania:islands/island_podzol" }, + "variant=mycel": { "model": "botania:islands/island_mycel" }, + "variant=snow": { "model": "botania:islands/island_snow" }, + "variant=dry": { "model": "botania:islands/island_dry" }, + "variant=golden": { "model": "botania:islands/island_golden" }, + "variant=vivid": { "model": "botania:islands/island_vivid" }, + "variant=scorched": { "model": "botania:islands/island_scorched" }, + "variant=infused": { "model": "botania:islands/island_infused" }, + "variant=mutated": { "model": "botania:islands/island_mutated" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/mountain_cobble_wall.json b/src/main/resources/assets/botania/blockstates/mountain_cobble_wall.json new file mode 100644 index 000000000..82da2ce3b --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/mountain_cobble_wall.json @@ -0,0 +1,19 @@ +{ + "multipart": [ + { "when": { "up": "true" }, + "apply": { "model": "botania:walls/mountain_cobble_wall_post" } + }, + { "when": { "north": "true" }, + "apply": { "model": "botania:walls/mountain_cobble_wall_side", "uvlock": true } + }, + { "when": { "east": "true" }, + "apply": { "model": "botania:walls/mountain_cobble_wall_side", "y": 90, "uvlock": true } + }, + { "when": { "south": "true" }, + "apply": { "model": "botania:walls/mountain_cobble_wall_side", "y": 180, "uvlock": true } + }, + { "when": { "west": "true" }, + "apply": { "model": "botania:walls/mountain_cobble_wall_side", "y": 270, "uvlock": true } + } + ] +} diff --git a/src/main/resources/assets/botania/blockstates/munchdew.json b/src/main/resources/assets/botania/blockstates/munchdew.json new file mode 100644 index 000000000..a17b88c1e --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/munchdew.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/munchdew" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/munchdew" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/mushroom.json b/src/main/resources/assets/botania/blockstates/mushroom.json new file mode 100644 index 000000000..289615fc6 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/mushroom.json @@ -0,0 +1,20 @@ +{ + "variants": { + "color=white": { "model": "botania:plants/mushroom_white" }, + "color=orange": { "model": "botania:plants/mushroom_orange" }, + "color=magenta": { "model": "botania:plants/mushroom_magenta" }, + "color=light_blue": { "model": "botania:plants/mushroom_light_blue" }, + "color=yellow": { "model": "botania:plants/mushroom_yellow" }, + "color=lime": { "model": "botania:plants/mushroom_lime" }, + "color=pink": { "model": "botania:plants/mushroom_pink" }, + "color=gray": { "model": "botania:plants/mushroom_gray" }, + "color=silver": { "model": "botania:plants/mushroom_silver" }, + "color=cyan": { "model": "botania:plants/mushroom_cyan" }, + "color=purple": { "model": "botania:plants/mushroom_purple" }, + "color=blue": { "model": "botania:plants/mushroom_blue" }, + "color=brown": { "model": "botania:plants/mushroom_brown" }, + "color=green": { "model": "botania:plants/mushroom_green" }, + "color=red": { "model": "botania:plants/mushroom_red" }, + "color=black": { "model": "botania:plants/mushroom_black" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/narslimmus.json b/src/main/resources/assets/botania/blockstates/narslimmus.json new file mode 100644 index 000000000..a3b0f9be9 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/narslimmus.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/narslimmus" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/narslimmus" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/nightshade.json b/src/main/resources/assets/botania/blockstates/nightshade.json new file mode 100644 index 000000000..0b2df4378 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/nightshade.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/nightshade" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/nightshade" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/nightshadeDecor.json b/src/main/resources/assets/botania/blockstates/nightshadeDecor.json new file mode 100644 index 000000000..b4dafe2d2 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/nightshadeDecor.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/nightshadeDecor" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/nightshadeDecor" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/nightshadePrime.json b/src/main/resources/assets/botania/blockstates/nightshadePrime.json new file mode 100644 index 000000000..9b4f450be --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/nightshadePrime.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/nightshadePrime" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/nightshadePrime" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/openCrate.json b/src/main/resources/assets/botania/blockstates/openCrate.json new file mode 100644 index 000000000..9cde21a91 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/openCrate.json @@ -0,0 +1,25 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:orientable_vertical", + "transform": "forge:default-block" + }, + "variants": { + "pattern": { + "none": {}, + "crafty_1_1": { "textures": { "side": "botania:blocks/ocPattern0" } }, + "crafty_2_2": { "textures": { "side": "botania:blocks/ocPattern1" } }, + "crafty_1_2": { "textures": { "side": "botania:blocks/ocPattern2" } }, + "crafty_2_1": { "textures": { "side": "botania:blocks/ocPattern3" } }, + "crafty_1_3": { "textures": { "side": "botania:blocks/ocPattern4" } }, + "crafty_3_1": { "textures": { "side": "botania:blocks/ocPattern5" } }, + "crafty_2_3": { "textures": { "side": "botania:blocks/ocPattern6" } }, + "crafty_3_2": { "textures": { "side": "botania:blocks/ocPattern7" } }, + "crafty_donut": { "textures": { "side": "botania:blocks/ocPattern8" } } + }, + "variant": { + "open": { "x": 180, "textures": { "front": "botania:blocks/openCrate1", "side": "botania:blocks/openCrate0" } }, + "crafty": { "x": 180, "textures": { "front": "botania:blocks/openCrate3", "side": "botania:blocks/openCrate2" } } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/orechid.json b/src/main/resources/assets/botania/blockstates/orechid.json new file mode 100644 index 000000000..2d545ab0b --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/orechid.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/orechid" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/orechid" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/orechidIgnem.json b/src/main/resources/assets/botania/blockstates/orechidIgnem.json new file mode 100644 index 000000000..240726792 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/orechidIgnem.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/orechidIgnem" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/orechidIgnem" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/pavement.json b/src/main/resources/assets/botania/blockstates/pavement.json new file mode 100644 index 000000000..bf31a00b9 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/pavement.json @@ -0,0 +1,10 @@ +{ + "variants": { + "color=white": { "model": "botania:pavement/white_pavement" }, + "color=black": { "model": "botania:pavement/black_pavement" }, + "color=blue": { "model": "botania:pavement/blue_pavement" }, + "color=red": { "model": "botania:pavement/red_pavement" }, + "color=yellow": { "model": "botania:pavement/yellow_pavement" }, + "color=green": { "model": "botania:pavement/green_pavement" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/pavement0Slab.json b/src/main/resources/assets/botania/blockstates/pavement0Slab.json new file mode 100644 index 000000000..75ba25ae6 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/pavement0Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/pavement0", + "top": "botania:blocks/pavement0", + "side": "botania:blocks/pavement0" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/pavement0SlabFull.json b/src/main/resources/assets/botania/blockstates/pavement0SlabFull.json new file mode 100644 index 000000000..c0733d50d --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/pavement0SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:pavement/white_pavement" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/pavement0Stairs.json b/src/main/resources/assets/botania/blockstates/pavement0Stairs.json new file mode 100644 index 000000000..e05796a94 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/pavement0Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/pavement0", + "top": "botania:blocks/pavement0", + "side": "botania:blocks/pavement0" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/pavement1Slab.json b/src/main/resources/assets/botania/blockstates/pavement1Slab.json new file mode 100644 index 000000000..9890b2c28 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/pavement1Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/pavement1", + "top": "botania:blocks/pavement1", + "side": "botania:blocks/pavement1" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/pavement1SlabFull.json b/src/main/resources/assets/botania/blockstates/pavement1SlabFull.json new file mode 100644 index 000000000..75ac52b2d --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/pavement1SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:pavement/blue_pavement" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/pavement1Stairs.json b/src/main/resources/assets/botania/blockstates/pavement1Stairs.json new file mode 100644 index 000000000..1da93233b --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/pavement1Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/pavement1", + "top": "botania:blocks/pavement1", + "side": "botania:blocks/pavement1" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/pavement2Slab.json b/src/main/resources/assets/botania/blockstates/pavement2Slab.json new file mode 100644 index 000000000..902f1ea09 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/pavement2Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/pavement2", + "top": "botania:blocks/pavement2", + "side": "botania:blocks/pavement2" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/pavement2SlabFull.json b/src/main/resources/assets/botania/blockstates/pavement2SlabFull.json new file mode 100644 index 000000000..c0733d50d --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/pavement2SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:pavement/white_pavement" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/pavement2Stairs.json b/src/main/resources/assets/botania/blockstates/pavement2Stairs.json new file mode 100644 index 000000000..b752020a1 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/pavement2Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/pavement2", + "top": "botania:blocks/pavement2", + "side": "botania:blocks/pavement2" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/pavement3Slab.json b/src/main/resources/assets/botania/blockstates/pavement3Slab.json new file mode 100644 index 000000000..717c31065 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/pavement3Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/pavement3", + "top": "botania:blocks/pavement3", + "side": "botania:blocks/pavement3" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/pavement3SlabFull.json b/src/main/resources/assets/botania/blockstates/pavement3SlabFull.json new file mode 100644 index 000000000..37690e037 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/pavement3SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:pavement/red_pavement" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/pavement3Stairs.json b/src/main/resources/assets/botania/blockstates/pavement3Stairs.json new file mode 100644 index 000000000..6af3bf1a0 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/pavement3Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/pavement3", + "top": "botania:blocks/pavement3", + "side": "botania:blocks/pavement3" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/pavement4Slab.json b/src/main/resources/assets/botania/blockstates/pavement4Slab.json new file mode 100644 index 000000000..8a585b586 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/pavement4Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/pavement4", + "top": "botania:blocks/pavement4", + "side": "botania:blocks/pavement4" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/pavement4SlabFull.json b/src/main/resources/assets/botania/blockstates/pavement4SlabFull.json new file mode 100644 index 000000000..ffcf8d19c --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/pavement4SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:pavement/yellow_pavement" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/pavement4Stairs.json b/src/main/resources/assets/botania/blockstates/pavement4Stairs.json new file mode 100644 index 000000000..4d368cd34 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/pavement4Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/pavement4", + "top": "botania:blocks/pavement4", + "side": "botania:blocks/pavement4" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/pavement5Slab.json b/src/main/resources/assets/botania/blockstates/pavement5Slab.json new file mode 100644 index 000000000..93a0d97b1 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/pavement5Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/pavement5", + "top": "botania:blocks/pavement5", + "side": "botania:blocks/pavement5" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/pavement5SlabFull.json b/src/main/resources/assets/botania/blockstates/pavement5SlabFull.json new file mode 100644 index 000000000..3694cd049 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/pavement5SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:pavement/green_pavement" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/pavement5Stairs.json b/src/main/resources/assets/botania/blockstates/pavement5Stairs.json new file mode 100644 index 000000000..2915a047a --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/pavement5Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/pavement5", + "top": "botania:blocks/pavement5", + "side": "botania:blocks/pavement5" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/petalBlock.json b/src/main/resources/assets/botania/blockstates/petalBlock.json new file mode 100644 index 000000000..c2e7134c7 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/petalBlock.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:petal_block" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/pistonRelay.json b/src/main/resources/assets/botania/blockstates/pistonRelay.json new file mode 100644 index 000000000..d554e34dc --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/pistonRelay.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:force_relay" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/plains_cobble_wall.json b/src/main/resources/assets/botania/blockstates/plains_cobble_wall.json new file mode 100644 index 000000000..c4ebfc502 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/plains_cobble_wall.json @@ -0,0 +1,19 @@ +{ + "multipart": [ + { "when": { "up": "true" }, + "apply": { "model": "botania:walls/plains_cobble_wall_post" } + }, + { "when": { "north": "true" }, + "apply": { "model": "botania:walls/plains_cobble_wall_side", "uvlock": true } + }, + { "when": { "east": "true" }, + "apply": { "model": "botania:walls/plains_cobble_wall_side", "y": 90, "uvlock": true } + }, + { "when": { "south": "true" }, + "apply": { "model": "botania:walls/plains_cobble_wall_side", "y": 180, "uvlock": true } + }, + { "when": { "west": "true" }, + "apply": { "model": "botania:walls/plains_cobble_wall_side", "y": 270, "uvlock": true } + } + ] +} diff --git a/src/main/resources/assets/botania/blockstates/platform.json b/src/main/resources/assets/botania/blockstates/platform.json new file mode 100644 index 000000000..f2f52b17f --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/platform.json @@ -0,0 +1,7 @@ +{ + "variants": { + "variant=abstruse": { "model": "botania:abstruse_platform" }, + "variant=spectral": { "model": "botania:spectral_platform" }, + "variant=infrangible": { "model": "botania:infrangible_platform" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/pollidisiac.json b/src/main/resources/assets/botania/blockstates/pollidisiac.json new file mode 100644 index 000000000..0330d0445 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/pollidisiac.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/pollidisiac" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/pollidisiac" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/pool.json b/src/main/resources/assets/botania/blockstates/pool.json new file mode 100644 index 000000000..b4108d997 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/pool.json @@ -0,0 +1,8 @@ +{ + "variants": { + "variant=default": { "model": "botania:default_pool" }, + "variant=diluted": { "model": "botania:diluted_pool" }, + "variant=creative": { "model": "botania:creative_pool" }, + "variant=fabulous": { "model": "botania:fabulous_pool" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/prism.json b/src/main/resources/assets/botania/blockstates/prism.json new file mode 100644 index 000000000..70c9ec09f --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/prism.json @@ -0,0 +1,8 @@ +{ + "variants": { + "has_lens=false,powered=false": { "model": "botania:prism" }, + "has_lens=true,powered=false": { "model": "botania:prism" }, + "has_lens=false,powered=true": { "model": "botania:prism" }, + "has_lens=true,powered=true": { "model": "botania:prism" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/pump.json b/src/main/resources/assets/botania/blockstates/pump.json new file mode 100644 index 000000000..7379c75d5 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/pump.json @@ -0,0 +1,33 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "particle": "botania:blocks/livingrock0" + }, + "transform": "forge:default-block" + }, + "variants": { + "facing": { + "north": {}, + "south": { "y": 180 }, + "west": { "y": 270 }, + "east": { "y": 90 } + }, + "static": { + "true": { + "model": "botania:pump" + }, + "false": { + "model": "botania:pump_head" + } + }, + "inventory": [{ + "model": "botania:pump", + "submodel": { + "head": { + "model": "botania:pump_head" + } + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/puredaisy.json b/src/main/resources/assets/botania/blockstates/puredaisy.json new file mode 100644 index 000000000..f2ee23af9 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/puredaisy.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/puredaisy" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/puredaisy" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/pylon.json b/src/main/resources/assets/botania/blockstates/pylon.json new file mode 100644 index 000000000..f118d25f3 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/pylon.json @@ -0,0 +1,60 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "botania:pylon.obj", + "transform": { + "gui": { + "rotation": [ {"x": 30}, {"y": 225}, {"z": 0} ], + "translation": [ -0.25, 0, 0], + "scale": 0.5625, + "post-rotation": [ {"x": 0}, {"y": 0}, {"z": 0} ] + }, + "ground": { + "rotation": [ {"x": 0}, {"y": 0}, {"z": 0} ], + "translation": [ 0, 0.1875, 0], + "scale": 0.25, + "post-rotation": [ {"x": 0}, {"y": 0}, {"z": 0} ] + }, + "fixed": { + "rotation": [ {"x": 0}, {"y": 0}, {"z": 0} ], + "translation": [ 0, -0.15625, 0.3125 ], + "scale": 0.5, + "post-rotation": [ {"x": 0}, {"y": 0}, {"z": 0} ] + }, + "thirdperson_righthand": { + "rotation": [ {"x": 75}, {"y": 45}, {"z": 0} ], + "translation": [ 0.125, -0.125, 0 ], + "scale": 0.375, + "post-rotation": [ {"x": 0}, {"y": 0}, {"z": 0} ] + }, + "thirdperson_lefthand": { + "rotation": [ {"x": 75}, {"y": 225}, {"z": 0} ], + "translation": [ -0.375, 0.375, -0.125 ], + "scale": 0.375, + "post-rotation": [ {"x": 0}, {"y": 0}, {"z": 0} ] + }, + "firstperson_righthand": { + "rotation": [ {"x": 0}, {"y": 45}, {"z": 0} ], + "translation": [ 0.375, 0, 0.25 ], + "scale": 0.4, + "post-rotation": [ {"x": 0}, {"y": 0}, {"z": 0} ] + }, + "firstperson_lefthand": { + "rotation": [ {"x": 0}, {"y": 225}, {"z": 0} ], + "translation": [ -0.375, 0, -0.25 ], + "scale": 0.4, + "post-rotation": [ {"x": 0}, {"y": 0}, {"z": 0} ] + } + }, + "custom": { + "flip-v": true + } + }, + "variants": { + "variant": { + "mana": { "textures": { "#pylon": "botania:model/pylon" } }, + "natura": { "textures": { "#pylon": "botania:model/pylon1" } }, + "gaia": { "textures": { "#pylon": "botania:model/pylon2" } } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/quartzSlabBlazeFull.json b/src/main/resources/assets/botania/blockstates/quartzSlabBlazeFull.json new file mode 100644 index 000000000..ea9581d54 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/quartzSlabBlazeFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:quartz/blaze_quartz" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/quartzSlabBlazeHalf.json b/src/main/resources/assets/botania/blockstates/quartzSlabBlazeHalf.json new file mode 100644 index 000000000..5a4d1b316 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/quartzSlabBlazeHalf.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/blockBlazeQuartz0", + "top": "botania:blocks/blockBlazeQuartz1", + "side": "botania:blocks/blockBlazeQuartz2" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/quartzSlabDarkFull.json b/src/main/resources/assets/botania/blockstates/quartzSlabDarkFull.json new file mode 100644 index 000000000..94b46c0e7 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/quartzSlabDarkFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:quartz/dark_quartz" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/quartzSlabDarkHalf.json b/src/main/resources/assets/botania/blockstates/quartzSlabDarkHalf.json new file mode 100644 index 000000000..342294d24 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/quartzSlabDarkHalf.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/blockDarkQuartz0", + "top": "botania:blocks/blockDarkQuartz1", + "side": "botania:blocks/blockDarkQuartz2" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/quartzSlabElfFull.json b/src/main/resources/assets/botania/blockstates/quartzSlabElfFull.json new file mode 100644 index 000000000..1a2f63077 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/quartzSlabElfFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:quartz/elf_quartz" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/quartzSlabElfHalf.json b/src/main/resources/assets/botania/blockstates/quartzSlabElfHalf.json new file mode 100644 index 000000000..d45d69008 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/quartzSlabElfHalf.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/blockElfQuartz0", + "top": "botania:blocks/blockElfQuartz1", + "side": "botania:blocks/blockElfQuartz2" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/quartzSlabLavenderFull.json b/src/main/resources/assets/botania/blockstates/quartzSlabLavenderFull.json new file mode 100644 index 000000000..574eb70f6 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/quartzSlabLavenderFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:quartz/lavender_quartz" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/quartzSlabLavenderHalf.json b/src/main/resources/assets/botania/blockstates/quartzSlabLavenderHalf.json new file mode 100644 index 000000000..0eb7e4354 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/quartzSlabLavenderHalf.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/blockLavenderQuartz0", + "top": "botania:blocks/blockLavenderQuartz1", + "side": "botania:blocks/blockLavenderQuartz2" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/quartzSlabManaFull.json b/src/main/resources/assets/botania/blockstates/quartzSlabManaFull.json new file mode 100644 index 000000000..c7c9a15de --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/quartzSlabManaFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:quartz/mana_quartz" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/quartzSlabManaHalf.json b/src/main/resources/assets/botania/blockstates/quartzSlabManaHalf.json new file mode 100644 index 000000000..0aee75219 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/quartzSlabManaHalf.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/blockManaQuartz0", + "top": "botania:blocks/blockManaQuartz1", + "side": "botania:blocks/blockManaQuartz2" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/quartzSlabRedFull.json b/src/main/resources/assets/botania/blockstates/quartzSlabRedFull.json new file mode 100644 index 000000000..965e2aeda --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/quartzSlabRedFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:quartz/red_quartz" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/quartzSlabRedHalf.json b/src/main/resources/assets/botania/blockstates/quartzSlabRedHalf.json new file mode 100644 index 000000000..1b99d3fbd --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/quartzSlabRedHalf.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/blockRedQuartz0", + "top": "botania:blocks/blockRedQuartz1", + "side": "botania:blocks/blockRedQuartz2" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/quartzSlabSunnyFull.json b/src/main/resources/assets/botania/blockstates/quartzSlabSunnyFull.json new file mode 100644 index 000000000..e8211cfc3 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/quartzSlabSunnyFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:quartz/sunny_quartz" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/quartzSlabSunnyHalf.json b/src/main/resources/assets/botania/blockstates/quartzSlabSunnyHalf.json new file mode 100644 index 000000000..87f085275 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/quartzSlabSunnyHalf.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/blockSunnyQuartz0", + "top": "botania:blocks/blockSunnyQuartz1", + "side": "botania:blocks/blockSunnyQuartz2" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/quartzStairsBlaze.json b/src/main/resources/assets/botania/blockstates/quartzStairsBlaze.json new file mode 100644 index 000000000..b564a6eac --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/quartzStairsBlaze.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/blockBlazeQuartz0", + "top": "botania:blocks/blockBlazeQuartz1", + "side": "botania:blocks/blockBlazeQuartz2" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/quartzStairsDark.json b/src/main/resources/assets/botania/blockstates/quartzStairsDark.json new file mode 100644 index 000000000..65e4d1198 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/quartzStairsDark.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/blockDarkQuartz0", + "top": "botania:blocks/blockDarkQuartz1", + "side": "botania:blocks/blockDarkQuartz2" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/quartzStairsElf.json b/src/main/resources/assets/botania/blockstates/quartzStairsElf.json new file mode 100644 index 000000000..24392d84a --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/quartzStairsElf.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/blockElfQuartz0", + "top": "botania:blocks/blockElfQuartz1", + "side": "botania:blocks/blockElfQuartz2" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/quartzStairsLavender.json b/src/main/resources/assets/botania/blockstates/quartzStairsLavender.json new file mode 100644 index 000000000..5667235f1 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/quartzStairsLavender.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/blockLavenderQuartz0", + "top": "botania:blocks/blockLavenderQuartz1", + "side": "botania:blocks/blockLavenderQuartz2" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/quartzStairsMana.json b/src/main/resources/assets/botania/blockstates/quartzStairsMana.json new file mode 100644 index 000000000..39e65c11f --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/quartzStairsMana.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/blockManaQuartz0", + "top": "botania:blocks/blockManaQuartz1", + "side": "botania:blocks/blockManaQuartz2" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/quartzStairsRed.json b/src/main/resources/assets/botania/blockstates/quartzStairsRed.json new file mode 100644 index 000000000..52ae466ee --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/quartzStairsRed.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/blockRedQuartz0", + "top": "botania:blocks/blockRedQuartz1", + "side": "botania:blocks/blockRedQuartz2" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/quartzStairsSunny.json b/src/main/resources/assets/botania/blockstates/quartzStairsSunny.json new file mode 100644 index 000000000..78a3f481b --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/quartzStairsSunny.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/blockSunnyQuartz0", + "top": "botania:blocks/blockSunnyQuartz1", + "side": "botania:blocks/blockSunnyQuartz2" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/quartzTypeBlaze.json b/src/main/resources/assets/botania/blockstates/quartzTypeBlaze.json new file mode 100644 index 000000000..70c4e13aa --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/quartzTypeBlaze.json @@ -0,0 +1,9 @@ +{ + "variants": { + "variant=normal": { "model": "botania:quartz/blaze_quartz" }, + "variant=chiseled": { "model": "botania:quartz/blaze_quartz_chiseled" }, + "variant=pillar_x": { "model": "botania:quartz/blaze_quartz_pillar", "x": 90, "y": 90 }, + "variant=pillar_y": { "model": "botania:quartz/blaze_quartz_pillar" }, + "variant=pillar_z": { "model": "botania:quartz/blaze_quartz_pillar", "x": 90 } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/quartzTypeDark.json b/src/main/resources/assets/botania/blockstates/quartzTypeDark.json new file mode 100644 index 000000000..573bbf826 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/quartzTypeDark.json @@ -0,0 +1,9 @@ +{ + "variants": { + "variant=normal": { "model": "botania:quartz/dark_quartz" }, + "variant=chiseled": { "model": "botania:quartz/dark_quartz_chiseled" }, + "variant=pillar_x": { "model": "botania:quartz/dark_quartz_pillar", "x": 90, "y": 90 }, + "variant=pillar_y": { "model": "botania:quartz/dark_quartz_pillar" }, + "variant=pillar_z": { "model": "botania:quartz/dark_quartz_pillar", "x": 90 } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/quartzTypeElf.json b/src/main/resources/assets/botania/blockstates/quartzTypeElf.json new file mode 100644 index 000000000..f6420fac1 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/quartzTypeElf.json @@ -0,0 +1,9 @@ +{ + "variants": { + "variant=normal": { "model": "botania:quartz/elf_quartz" }, + "variant=chiseled": { "model": "botania:quartz/elf_quartz_chiseled" }, + "variant=pillar_x": { "model": "botania:quartz/elf_quartz_pillar", "x": 90, "y": 90 }, + "variant=pillar_y": { "model": "botania:quartz/elf_quartz_pillar" }, + "variant=pillar_z": { "model": "botania:quartz/elf_quartz_pillar", "x": 90 } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/quartzTypeLavender.json b/src/main/resources/assets/botania/blockstates/quartzTypeLavender.json new file mode 100644 index 000000000..17c644f85 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/quartzTypeLavender.json @@ -0,0 +1,9 @@ +{ + "variants": { + "variant=normal": { "model": "botania:quartz/lavender_quartz" }, + "variant=chiseled": { "model": "botania:quartz/lavender_quartz_chiseled" }, + "variant=pillar_x": { "model": "botania:quartz/lavender_quartz_pillar", "x": 90, "y": 90 }, + "variant=pillar_y": { "model": "botania:quartz/lavender_quartz_pillar" }, + "variant=pillar_z": { "model": "botania:quartz/lavender_quartz_pillar", "x": 90 } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/quartzTypeMana.json b/src/main/resources/assets/botania/blockstates/quartzTypeMana.json new file mode 100644 index 000000000..9747264a3 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/quartzTypeMana.json @@ -0,0 +1,9 @@ +{ + "variants": { + "variant=normal": { "model": "botania:quartz/mana_quartz" }, + "variant=chiseled": { "model": "botania:quartz/mana_quartz_chiseled" }, + "variant=pillar_x": { "model": "botania:quartz/mana_quartz_pillar", "x": 90, "y": 90 }, + "variant=pillar_y": { "model": "botania:quartz/mana_quartz_pillar" }, + "variant=pillar_z": { "model": "botania:quartz/mana_quartz_pillar", "x": 90 } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/quartzTypeRed.json b/src/main/resources/assets/botania/blockstates/quartzTypeRed.json new file mode 100644 index 000000000..feb22538f --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/quartzTypeRed.json @@ -0,0 +1,9 @@ +{ + "variants": { + "variant=normal": { "model": "botania:quartz/red_quartz" }, + "variant=chiseled": { "model": "botania:quartz/red_quartz_chiseled" }, + "variant=pillar_x": { "model": "botania:quartz/red_quartz_pillar", "x": 90, "y": 90 }, + "variant=pillar_y": { "model": "botania:quartz/red_quartz_pillar" }, + "variant=pillar_z": { "model": "botania:quartz/red_quartz_pillar", "x": 90 } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/quartzTypeSunny.json b/src/main/resources/assets/botania/blockstates/quartzTypeSunny.json new file mode 100644 index 000000000..ddcf27955 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/quartzTypeSunny.json @@ -0,0 +1,9 @@ +{ + "variants": { + "variant=normal": { "model": "botania:quartz/sunny_quartz" }, + "variant=chiseled": { "model": "botania:quartz/sunny_quartz_chiseled" }, + "variant=pillar_x": { "model": "botania:quartz/sunny_quartz_pillar", "x": 90, "y": 90 }, + "variant=pillar_y": { "model": "botania:quartz/sunny_quartz_pillar" }, + "variant=pillar_z": { "model": "botania:quartz/sunny_quartz_pillar", "x": 90 } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/rafflowsia.json b/src/main/resources/assets/botania/blockstates/rafflowsia.json new file mode 100644 index 000000000..601c180d5 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/rafflowsia.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/rafflowsia" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/rafflowsia" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/rannuncarpus.json b/src/main/resources/assets/botania/blockstates/rannuncarpus.json new file mode 100644 index 000000000..02998a79d --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/rannuncarpus.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/rannuncarpus" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/rannuncarpus" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/rannuncarpusChibi.json b/src/main/resources/assets/botania/blockstates/rannuncarpusChibi.json new file mode 100644 index 000000000..6fa8e1649 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/rannuncarpusChibi.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/rannuncarpusChibi" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/rannuncarpusChibi" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/redStringComparator.json b/src/main/resources/assets/botania/blockstates/redStringComparator.json new file mode 100644 index 000000000..7ede7d4e9 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/redStringComparator.json @@ -0,0 +1,10 @@ +{ + "variants": { + "facing=north": { "model": "botania:red_string_comparator" }, + "facing=south": { "model": "botania:red_string_comparator", "y": 180 }, + "facing=west": { "model": "botania:red_string_comparator", "y": 270 }, + "facing=east": { "model": "botania:red_string_comparator", "y": 90 }, + "facing=up": { "model": "botania:red_string_comparator", "x": 270 }, + "facing=down": { "model": "botania:red_string_comparator", "x": 90 } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/redStringContainer.json b/src/main/resources/assets/botania/blockstates/redStringContainer.json new file mode 100644 index 000000000..22728cbf9 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/redStringContainer.json @@ -0,0 +1,10 @@ +{ + "variants": { + "facing=north": { "model": "botania:red_string_container" }, + "facing=south": { "model": "botania:red_string_container", "y": 180 }, + "facing=west": { "model": "botania:red_string_container", "y": 270 }, + "facing=east": { "model": "botania:red_string_container", "y": 90 }, + "facing=up": { "model": "botania:red_string_container", "x": 270 }, + "facing=down": { "model": "botania:red_string_container", "x": 90 } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/redStringDispenser.json b/src/main/resources/assets/botania/blockstates/redStringDispenser.json new file mode 100644 index 000000000..94fe15a9c --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/redStringDispenser.json @@ -0,0 +1,10 @@ +{ + "variants": { + "facing=north": { "model": "botania:red_string_dispenser" }, + "facing=south": { "model": "botania:red_string_dispenser", "y": 180 }, + "facing=west": { "model": "botania:red_string_dispenser", "y": 270 }, + "facing=east": { "model": "botania:red_string_dispenser", "y": 90 }, + "facing=up": { "model": "botania:red_string_dispenser", "x": 270 }, + "facing=down": { "model": "botania:red_string_dispenser", "x": 90 } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/redStringFertilizer.json b/src/main/resources/assets/botania/blockstates/redStringFertilizer.json new file mode 100644 index 000000000..3e9c36371 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/redStringFertilizer.json @@ -0,0 +1,10 @@ +{ + "variants": { + "facing=north": { "model": "botania:red_string_fertilizer" }, + "facing=south": { "model": "botania:red_string_fertilizer", "y": 180 }, + "facing=west": { "model": "botania:red_string_fertilizer", "y": 270 }, + "facing=east": { "model": "botania:red_string_fertilizer", "y": 90 }, + "facing=up": { "model": "botania:red_string_fertilizer", "x": 270 }, + "facing=down": { "model": "botania:red_string_fertilizer", "x": 90 } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/redStringInterceptor.json b/src/main/resources/assets/botania/blockstates/redStringInterceptor.json new file mode 100644 index 000000000..bbb573d97 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/redStringInterceptor.json @@ -0,0 +1,10 @@ +{ + "variants": { + "facing=north": { "model": "botania:red_string_interceptor" }, + "facing=south": { "model": "botania:red_string_interceptor", "y": 180 }, + "facing=west": { "model": "botania:red_string_interceptor", "y": 270 }, + "facing=east": { "model": "botania:red_string_interceptor", "y": 90 }, + "facing=up": { "model": "botania:red_string_interceptor", "x": 270 }, + "facing=down": { "model": "botania:red_string_interceptor", "x": 90 } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/redStringRelay.json b/src/main/resources/assets/botania/blockstates/redStringRelay.json new file mode 100644 index 000000000..ca75d0680 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/redStringRelay.json @@ -0,0 +1,10 @@ +{ + "variants": { + "facing=north": { "model": "botania:red_string_relay" }, + "facing=south": { "model": "botania:red_string_relay", "y": 180 }, + "facing=west": { "model": "botania:red_string_relay", "y": 270 }, + "facing=east": { "model": "botania:red_string_relay", "y": 90 }, + "facing=up": { "model": "botania:red_string_relay", "x": 270 }, + "facing=down": { "model": "botania:red_string_relay", "x": 90 } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/rfGenerator.json b/src/main/resources/assets/botania/blockstates/rfGenerator.json new file mode 100644 index 000000000..83fd6c04c --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/rfGenerator.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:mana_fluxfield" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/root.json b/src/main/resources/assets/botania/blockstates/root.json new file mode 100644 index 000000000..c0360095f --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/root.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:root" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/runeAltar.json b/src/main/resources/assets/botania/blockstates/runeAltar.json new file mode 100644 index 000000000..d1b467937 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/runeAltar.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:runic_altar" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/shimmerrock.json b/src/main/resources/assets/botania/blockstates/shimmerrock.json new file mode 100644 index 000000000..91681a0e0 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/shimmerrock.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:shimmerrock" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/shimmerrock0Slab.json b/src/main/resources/assets/botania/blockstates/shimmerrock0Slab.json new file mode 100644 index 000000000..3709fac6a --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/shimmerrock0Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/shimmerrock", + "top": "botania:blocks/shimmerrock", + "side": "botania:blocks/shimmerrock" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/shimmerrock0SlabFull.json b/src/main/resources/assets/botania/blockstates/shimmerrock0SlabFull.json new file mode 100644 index 000000000..91681a0e0 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/shimmerrock0SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:shimmerrock" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/shimmerrock0Stairs.json b/src/main/resources/assets/botania/blockstates/shimmerrock0Stairs.json new file mode 100644 index 000000000..133a6f436 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/shimmerrock0Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/shimmerrock", + "top": "botania:blocks/shimmerrock", + "side": "botania:blocks/shimmerrock" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/shimmerwoodPlanks.json b/src/main/resources/assets/botania/blockstates/shimmerwoodPlanks.json new file mode 100644 index 000000000..0e16dc267 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/shimmerwoodPlanks.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:shimmerwood_planks" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/shimmerwoodPlanks0Slab.json b/src/main/resources/assets/botania/blockstates/shimmerwoodPlanks0Slab.json new file mode 100644 index 000000000..5bf7d62bc --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/shimmerwoodPlanks0Slab.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "botania:blocks/shimmerwoodPlanks", + "top": "botania:blocks/shimmerwoodPlanks", + "side": "botania:blocks/shimmerwoodPlanks" + }, + "transform": "forge:default-block" + }, + "variants": { + "half=top": [{ + "x": 180, + "uvlock": true + }], + "half=bottom": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/shimmerwoodPlanks0SlabFull.json b/src/main/resources/assets/botania/blockstates/shimmerwoodPlanks0SlabFull.json new file mode 100644 index 000000000..0e16dc267 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/shimmerwoodPlanks0SlabFull.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:shimmerwood_planks" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/shimmerwoodPlanks0Stairs.json b/src/main/resources/assets/botania/blockstates/shimmerwoodPlanks0Stairs.json new file mode 100644 index 000000000..5094807bc --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/shimmerwoodPlanks0Stairs.json @@ -0,0 +1,53 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "botania:blocks/shimmerwoodPlanks", + "top": "botania:blocks/shimmerwoodPlanks", + "side": "botania:blocks/shimmerwoodPlanks" + } + }, + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "inventory": [{ "model": "minecraft:stairs" }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/shinyFlower.json b/src/main/resources/assets/botania/blockstates/shinyFlower.json new file mode 100644 index 000000000..9fefe3c99 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/shinyFlower.json @@ -0,0 +1,20 @@ +{ + "variants": { + "color=white": { "model": "botania:plants/glimmering_flower_white" }, + "color=orange": { "model": "botania:plants/glimmering_flower_orange" }, + "color=magenta": { "model": "botania:plants/glimmering_flower_magenta" }, + "color=light_blue": { "model": "botania:plants/glimmering_flower_light_blue" }, + "color=yellow": { "model": "botania:plants/glimmering_flower_yellow" }, + "color=lime": { "model": "botania:plants/glimmering_flower_lime" }, + "color=pink": { "model": "botania:plants/glimmering_flower_pink" }, + "color=gray": { "model": "botania:plants/glimmering_flower_gray" }, + "color=silver": { "model": "botania:plants/glimmering_flower_silver" }, + "color=cyan": { "model": "botania:plants/glimmering_flower_cyan" }, + "color=purple": { "model": "botania:plants/glimmering_flower_purple" }, + "color=blue": { "model": "botania:plants/glimmering_flower_blue" }, + "color=brown": { "model": "botania:plants/glimmering_flower_brown" }, + "color=green": { "model": "botania:plants/glimmering_flower_green" }, + "color=red": { "model": "botania:plants/glimmering_flower_red" }, + "color=black": { "model": "botania:plants/glimmering_flower_black" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/solegnolia.json b/src/main/resources/assets/botania/blockstates/solegnolia.json new file mode 100644 index 000000000..53dee6310 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/solegnolia.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/solegnolia" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/solegnolia" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/solegnoliaChibi.json b/src/main/resources/assets/botania/blockstates/solegnoliaChibi.json new file mode 100644 index 000000000..1f1ff497d --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/solegnoliaChibi.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/solegnoliaChibi" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/solegnoliaChibi" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/solidVine.json b/src/main/resources/assets/botania/blockstates/solidVine.json new file mode 100644 index 000000000..67ee020a5 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/solidVine.json @@ -0,0 +1,36 @@ +{ + "variants": { + "east=false,north=false,south=false,up=false,west=false": { "model": "vine_1" }, + "east=false,north=false,south=true,up=false,west=false": { "model": "vine_1" }, + "east=false,north=false,south=false,up=false,west=true": { "model": "vine_1", "y": 90 }, + "east=false,north=true,south=false,up=false,west=false": { "model": "vine_1", "y": 180 }, + "east=true,north=false,south=false,up=false,west=false": { "model": "vine_1", "y": 270 }, + "east=true,north=true,south=false,up=false,west=false": { "model": "vine_2" }, + "east=true,north=false,south=true,up=false,west=false": { "model": "vine_2", "y": 90 }, + "east=false,north=false,south=true,up=false,west=true": { "model": "vine_2", "y": 180 }, + "east=false,north=true,south=false,up=false,west=true": { "model": "vine_2", "y": 270 }, + "east=true,north=false,south=false,up=false,west=true": { "model": "vine_2_opposite" }, + "east=false,north=true,south=true,up=false,west=false": { "model": "vine_2_opposite", "y": 90 }, + "east=true,north=true,south=true,up=false,west=false": { "model": "vine_3" }, + "east=true,north=false,south=true,up=false,west=true": { "model": "vine_3", "y": 90 }, + "east=false,north=true,south=true,up=false,west=true": { "model": "vine_3", "y": 180 }, + "east=true,north=true,south=false,up=false,west=true": { "model": "vine_3", "y": 270 }, + "east=true,north=true,south=true,up=false,west=true": { "model": "vine_4" }, + "east=false,north=false,south=false,up=true,west=false": { "model": "vine_u" }, + "east=false,north=false,south=true,up=true,west=false": { "model": "vine_1u" }, + "east=false,north=false,south=false,up=true,west=true": { "model": "vine_1u", "y": 90 }, + "east=false,north=true,south=false,up=true,west=false": { "model": "vine_1u", "y": 180 }, + "east=true,north=false,south=false,up=true,west=false": { "model": "vine_1u", "y": 270 }, + "east=true,north=true,south=false,up=true,west=false": { "model": "vine_2u" }, + "east=true,north=false,south=true,up=true,west=false": { "model": "vine_2u", "y": 90 }, + "east=false,north=false,south=true,up=true,west=true": { "model": "vine_2u", "y": 180 }, + "east=false,north=true,south=false,up=true,west=true": { "model": "vine_2u", "y": 270 }, + "east=true,north=false,south=false,up=true,west=true": { "model": "vine_2u_opposite" }, + "east=false,north=true,south=true,up=true,west=false": { "model": "vine_2u_opposite", "y": 90 }, + "east=true,north=true,south=true,up=true,west=false": { "model": "vine_3u" }, + "east=true,north=false,south=true,up=true,west=true": { "model": "vine_3u", "y": 90 }, + "east=false,north=true,south=true,up=true,west=true": { "model": "vine_3u", "y": 180 }, + "east=true,north=true,south=false,up=true,west=true": { "model": "vine_3u", "y": 270 }, + "east=true,north=true,south=true,up=true,west=true": { "model": "vine_4u" } + } +} diff --git a/src/main/resources/assets/botania/blockstates/sparkChanger.json b/src/main/resources/assets/botania/blockstates/sparkChanger.json new file mode 100644 index 000000000..3e3682625 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/sparkChanger.json @@ -0,0 +1,6 @@ +{ + "variants": { + "powered=true": { "model": "botania:spark_tinkerer" }, + "powered=false": { "model": "botania:spark_tinkerer" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/spawnerClaw.json b/src/main/resources/assets/botania/blockstates/spawnerClaw.json new file mode 100644 index 000000000..392aae69c --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/spawnerClaw.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:life_imbuer" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/specialFlower.json b/src/main/resources/assets/botania/blockstates/specialFlower.json new file mode 100644 index 000000000..a2f835615 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/specialFlower.json @@ -0,0 +1,15 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "botania_special:specialFlower", + "transform": "forge:default-item" + }, + "variants": { + "normal": [{ + "custom": { "base": "minecraft:poppy" } + }], + "inventory": [{ + "custom": { "base": "minecraft:poppy" } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/spectranthemum.json b/src/main/resources/assets/botania/blockstates/spectranthemum.json new file mode 100644 index 000000000..7d5752c71 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/spectranthemum.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/spectranthemum" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/spectranthemum" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/spectrolus.json b/src/main/resources/assets/botania/blockstates/spectrolus.json new file mode 100644 index 000000000..8cc462bb8 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/spectrolus.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/spectrolus" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/spectrolus" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/spreader.json b/src/main/resources/assets/botania/blockstates/spreader.json new file mode 100644 index 000000000..2f9baaed6 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/spreader.json @@ -0,0 +1,8 @@ +{ + "variants": { + "variant=mana": { "model": "botania:mana_spreader" }, + "variant=redstone": { "model": "botania:redstone_spreader" }, + "variant=elven": { "model": "botania:elven_spreader" }, + "variant=gaia": { "model": "botania:gaia_spreader" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/starfield.json b/src/main/resources/assets/botania/blockstates/starfield.json new file mode 100644 index 000000000..998b2c14e --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/starfield.json @@ -0,0 +1,6 @@ +{ + "variants": { + "powered=true": { "model": "botania:starfield_creator" }, + "powered=false": { "model": "botania:starfield_creator" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/storage.json b/src/main/resources/assets/botania/blockstates/storage.json new file mode 100644 index 000000000..416692109 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/storage.json @@ -0,0 +1,9 @@ +{ + "variants": { + "variant=manasteel": { "model": "botania:manasteel_block" }, + "variant=terrasteel": { "model": "botania:terrasteel_block" }, + "variant=elementium": { "model": "botania:elementium_block" }, + "variant=mana_diamond": { "model": "botania:mana_diamond_block" }, + "variant=dragonstone": { "model": "botania:dragonstone_block" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/swamp_cobble_wall.json b/src/main/resources/assets/botania/blockstates/swamp_cobble_wall.json new file mode 100644 index 000000000..bf9b57407 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/swamp_cobble_wall.json @@ -0,0 +1,19 @@ +{ + "multipart": [ + { "when": { "up": "true" }, + "apply": { "model": "botania:walls/swamp_cobble_wall_post" } + }, + { "when": { "north": "true" }, + "apply": { "model": "botania:walls/swamp_cobble_wall_side", "uvlock": true } + }, + { "when": { "east": "true" }, + "apply": { "model": "botania:walls/swamp_cobble_wall_side", "y": 90, "uvlock": true } + }, + { "when": { "south": "true" }, + "apply": { "model": "botania:walls/swamp_cobble_wall_side", "y": 180, "uvlock": true } + }, + { "when": { "west": "true" }, + "apply": { "model": "botania:walls/swamp_cobble_wall_side", "y": 270, "uvlock": true } + } + ] +} diff --git a/src/main/resources/assets/botania/blockstates/taiga_cobble_wall.json b/src/main/resources/assets/botania/blockstates/taiga_cobble_wall.json new file mode 100644 index 000000000..89b511062 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/taiga_cobble_wall.json @@ -0,0 +1,19 @@ +{ + "multipart": [ + { "when": { "up": "true" }, + "apply": { "model": "botania:walls/taiga_cobble_wall_post" } + }, + { "when": { "north": "true" }, + "apply": { "model": "botania:walls/taiga_cobble_wall_side", "uvlock": true } + }, + { "when": { "east": "true" }, + "apply": { "model": "botania:walls/taiga_cobble_wall_side", "y": 90, "uvlock": true } + }, + { "when": { "south": "true" }, + "apply": { "model": "botania:walls/taiga_cobble_wall_side", "y": 180, "uvlock": true } + }, + { "when": { "west": "true" }, + "apply": { "model": "botania:walls/taiga_cobble_wall_side", "y": 270, "uvlock": true } + } + ] +} diff --git a/src/main/resources/assets/botania/blockstates/tangleberrie.json b/src/main/resources/assets/botania/blockstates/tangleberrie.json new file mode 100644 index 000000000..7c3368d28 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/tangleberrie.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/tangleberrie" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/tangleberrie" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/terraPlate.json b/src/main/resources/assets/botania/blockstates/terraPlate.json new file mode 100644 index 000000000..3f3da5b1c --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/terraPlate.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:terra_plate" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/teruTeruBozu.json b/src/main/resources/assets/botania/blockstates/teruTeruBozu.json new file mode 100644 index 000000000..d3d2b72a3 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/teruTeruBozu.json @@ -0,0 +1,12 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "botania:dummy", + "textures": { + "particle": "minecraft:blocks/wool_colored_white" + } + }, + "variants": { + "normal": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/thermalily.json b/src/main/resources/assets/botania/blockstates/thermalily.json new file mode 100644 index 000000000..2c1dcc3d0 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/thermalily.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/thermalily" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/thermalily" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/tigerseye.json b/src/main/resources/assets/botania/blockstates/tigerseye.json new file mode 100644 index 000000000..c6994913c --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/tigerseye.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/tigerseye" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/tigerseye" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/tinyPlanetBlock.json b/src/main/resources/assets/botania/blockstates/tinyPlanetBlock.json new file mode 100644 index 000000000..dc46fcfaf --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/tinyPlanetBlock.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:tiny_planet_block" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/tinyPotato.json b/src/main/resources/assets/botania/blockstates/tinyPotato.json new file mode 100644 index 000000000..c8daa4af1 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/tinyPotato.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "botania:tiny_potato" }, + "facing=south": { "model": "botania:tiny_potato", "y": 180 }, + "facing=west": { "model": "botania:tiny_potato", "y": 270 }, + "facing=east": { "model": "botania:tiny_potato", "y": 90 } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/turntable.json b/src/main/resources/assets/botania/blockstates/turntable.json new file mode 100644 index 000000000..a06bb863a --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/turntable.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:turntable" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/unstableBlock.json b/src/main/resources/assets/botania/blockstates/unstableBlock.json new file mode 100644 index 000000000..5083a6d3c --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/unstableBlock.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "botania:unstable_cube" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/vinculotus.json b/src/main/resources/assets/botania/blockstates/vinculotus.json new file mode 100644 index 000000000..39faf2bd5 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/vinculotus.json @@ -0,0 +1,18 @@ +{ + "forge_marker": 1, + "variants": { + "normal": [{ + "model": "botania:shapes/cross_tinted", + "textures": { + "cross": "botania:blocks/vinculotus" + } + }], + "inventory": [{ + "model": "builtin/generated", + "transform": "forge:default-item", + "textures": { + "layer0": "botania:blocks/vinculotus" + } + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/blockstates/waterBowl.json b/src/main/resources/assets/botania/blockstates/waterBowl.json new file mode 100644 index 000000000..40e2821d0 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/waterBowl.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "forge:forgebucket", + "custom": { + "fluid": "water", + "flipGas": false + }, + "textures": { + "base": "botania:items/waterBowl_base", + "fluid": "botania:items/waterBowl_fluid", + "cover": "botania:items/waterBowl_cover" + }, + "transform": "forge:default-item" + }, + "variants": { + "inventory": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/lang/de_DE.lang b/src/main/resources/assets/botania/lang/de_DE.lang index deec3722c..5a6222540 100644 --- a/src/main/resources/assets/botania/lang/de_DE.lang +++ b/src/main/resources/assets/botania/lang/de_DE.lang @@ -1,3 +1,12 @@ +# Note to translators: DO NOT COPY ENTRIES FROM ENGLISH +# I repeat: do NOT copy entries from English!! +# Any entry in this lang file should be in de_DE, or *should not be here at all* +# Copying English entries will cause them to become outdated when the main English lang file changes +# Untranslated entries will automatically be inherited from en_US +# +# Once again, don't copy from English, and THANK YOU for your hard work! + + # MISC itemGroup.Botania=Botania botaniamisc.nextPage=Nächste Seite @@ -45,14 +54,6 @@ botania.color14=Rot botania.color15=Schwarz botania.color16=Regenbogenfarben -# RANKS -botania.rank0=&cD -botania.rank1=&eC -botania.rank2=&bB -botania.rank3=&aA -botania.rank4=&dS -botania.rank5=&6SS - # VERSION CHECKING botania.versioning.flavour0=WAS ZUM!? BOTANIA IST NICHT AKTUALISIERT!? botania.versioning.flavour1=Willst dur mir weismachen, dass du Botania noch nicht aktualisiert hast, du ignoranter Trottel? @@ -71,7 +72,7 @@ botania.versioning.flavour13=Du hast meine Fallenkarte aktiviert! Ich spiele das botania.versioning.flavour14=Wie wäre es mit 'nem Trinkspiel: Für jedes Mal, wenn Botania ein Update hat, trink einen. botania.versioning.flavour15=Ein Botania-Update? Du bist ein wahres Glücksknilz. botania.versioning.outdated=Du verwendest Botania Build %s, der neueste ist Build %s. -botania.versioning.updateMessage=["Klicken für... [",{"text":"Download","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Klicke hierauf, um automatisch die neueste Version herunterzuladen","color":"green"}},"clickEvent":{"action":"run_command","value":"/botania-download-latest %version%"}},"] [",{"text":"Website","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Klicke hierauf, um zur Website der Mod zu gelangen","color":"green"}},"clickEvent":{"action":"open_url","value":"http://botaniamod.net/downloads.php"}},"] [",{"text":"Changelog","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Klicke hierauf, um zum Changelog der Version zu gelangen","color":"green"}},"clickEvent":{"action":"open_url","value":"http://botaniamod.net/changelog.php#%version%"}},"]"] +botania.versioning.updateMessage=["Klicken für... [",{"text":"Download","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Klicke hierauf, um automatisch die neueste Version herunterzuladen","color":"green"}},"clickEvent":{"action":"open_url","value":"http://minecraft.curseforge.com/projects/botania-unofficial/files/latest"}},"] [",{"text":"Website","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Klicke hierauf, um zur Website der Mod zu gelangen","color":"green"}},"clickEvent":{"action":"open_url","value":"http://minecraft.curseforge.com/projects/botania-unofficial"}},"] [",{"text":"Changelog","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Klicke hierauf, um zum Changelog der Version zu gelangen","color":"green"}},"clickEvent":{"action":"open_url","value":"https://github.com/williewillus/Botania/releases/tag/%s"}},"]"] botania.versioning.startingDownload=Starte Download von %s. Bitte entferne deine Festplatte nicht. botania.versioning.doneDownloading=Download von %s beendet. Starte das Spiel neu, um zu updaten. botania.versioning.downloadedAlready=Du hast bereits die neueste Version installiert. Schließe das Spiel, lösche die alte Konfigurationsdatei aus deinem Mods-Ordner und lade das Spiel neu, um zu updaten! @@ -83,7 +84,7 @@ botania.versioning.disabled=Sorry. Dieses Feature ist momentan wegen Server-Host botania.baubletype.amulet=Ausrüstbar im &aAmulett&7-Slot botania.baubletype.ring=Ausrüstbar im &aRing&7-Slot botania.baubletype.belt=Ausrüstbar im &aGürtel&7-Slot -botania.baubletooltip=Drücke &b%key%&7, um das Baubles-Menü zu öffnen +botania.baubletooltip=Drücke &b%s&7, um das Baubles-Menü zu öffnen botania.baubleinfo=Halte &bSHIFT&7 für mehr Info # BLOCK NAMES @@ -413,45 +414,24 @@ botania.category.misc=Verschiedenes # - BASIC # -- LEXICA BOTANIA botania.entry.lexicon=Lexica Botania -botania.page.lexicon0=The &1Lexica Botania&0 is the repository of all knowledge for all botany related matters. But you probably knew that already.
    All information is stored here, as expected. For convenience, if a block happens to have an entry, it can be shift-right clicked with the &1Lexica Botania&0 to open that entry. -botania.page.lexicon1=Crafting the &1Lexica Botania&0. # -- MYSTICAL FLOWERS botania.entry.flowers=Mystische Blumen -botania.page.flowers0=Around the world, you may stumble upon a large variety of Mystical Flora. Spotting these doesn't take much work as the flowers themselves emit a fair amount of shine.
    They come in a total of &416 &0different colors.
    It's also possible to grow these flowers using &1Floral Fertlizer&0 (read on). -botania.page.flowers1=Flowers as far as the eye can see... -botania.page.flowers2=These flowers can be plucked for &1Mystical Petals&0, that can be used for making magical instruments and plants alike.
    These petals can also be crushed into &1Floral Powder&0, by the use of a &1Pestle and Mortar&0, which functions much alike any mundane piece of dye. -botania.page.flowers3=Plucking Petals off Flowers. -botania.page.flowers4=Crafting the &1Pestle and Mortar&0. -botania.page.flowers5=Grinding Petals into Powder. -botania.page.flowers6=By mixing the &1Floral Powder&0 with some &1Bone Meal&0, it's possible to create a different type of fertilizer. The &1Floral Fertlizer&0 will grow a small amount of &1Mystical Flowers&0 in the nearby vacinity, if you ever run low on them. -botania.page.flowers7=Making fertilizer (any powder colors work) -botania.page.flowers8=Using typical flower substances also works # -- PETAL APOTHECARY botania.entry.apothecary=Blütenblatttiegel -botania.page.apothecary0=In order for a botanist to create plantlife that can do it's bidding, one would need special means of infusing plants with mystical energy.
    Luckilly, the &1Petal Apothecary&0 does just that. -botania.page.apothecary1=The &1Petal Apothecary&0. -botania.page.apothecary2=This block, when placed in the world and given some water (by use of a &1Water Bucket&0), will accept any &1Mystical Petals&0 thrown at it, releasing their energies.
    Once one has set the correct petals in, throwing some &1Seeds&0 in will finalize the proccess.
    Tossing in the full bucket will also fill the recipient with water. -botania.page.apothecary3=Quite a few plants can be made using this method, for more information, read on the &4Functional Flora&0 and &4Generation Flora&0 sections of this Lexicon. -botania.page.apothecary4=Crafting the &1Petal Apothecary&0. # -- PURE DAISY botania.entry.pureDaisy=Reines Gänseblümchen -botania.page.pureDaisy0=The &1Pure Daisy&0 is not only the most basic, but also the most important flower a botanist can have.
    This flower will purify any adjacent &1Wood&0 and &1Stone&0 blocks, as seen on the next page, into their purified counterparts, &1Livingwood&0 and &1Livingrock&0, which can be used for crafting. botania.page.pureDaisy1=Gib ihr einfach &4eine Munute&0 oder so... botania.page.pureDaisy2=&1Lebeholz&0 kann zu Zweigen gemacht werden botania.page.pureDaisy3=Weiß ist hell und rein # -- WAND OF THE FOREST botania.entry.wand=Stab des Waldes -botania.page.wand0=The general multi-use tool for a botanist is the &1Wand of the Forest&0.
    This wand, made by, effectively, strapping a pair of &1Mystical Petals&0 of any color to a few &1Livingwood Twigs&0, is required for a good amount of tasks. -botania.page.wand1=The petals used determine the colors of the wand # -- RUNIC ALTAR botania.entry.runeAltar=Runenaltar -botania.page.runeAltar0=&1Runes&0 are extremely important components of complex magical devices or flora.
    In order to create these, one would require a &1Runic Altar&0.
    To utilize this &1Runic Altar&0, start by placing, via right click, the components to the rune you want to create. -botania.page.runeAltar1=Proceed by linking a &1Mana Spreader&0 to the altar, and right click it with a &1Wand of the Forest&0.
    It should be apparent when the altar has received enough &4Mana&0. When that happens, just drop a piece of &1Livingrock&0 on top of it and use the wand on it again to collect your rune. botania.page.runeAltar2=Herstellung des &1Runenaltars&0. botania.page.runeAltar3=Es gibt insgesamt 16 &1Runen&0.
    Die grundlegenden und elementaren Runen sind nach den &4Vier Elementen&0 benannt. Die mittleren Runen sind nach den &4Vier Jahreszeiten&0 benannt und die am forgeschrittendsten Runen nach den &4Sieben Todsünden&0. Auch gibt es eine seperate &1Manarune&0. botania.page.runeAltar4=Die &1Rune des Wassers&0. @@ -473,318 +453,175 @@ botania.page.runeAltar19=Die &1Rune des Hochmuts&0. # -- TERRASTEEL botania.entry.terrasteel=Terrastahl -botania.page.terrasteel0=&1Terrasteel&0 is a powerful metal infused with the magic of nature.
    Creating this metal proves to not be a short order, in order to create it, toss a &1Manasteel Ingot&0, a &1Mana Pearl&0 and a &1Mana Diamond&0 on top of an &4Active &1Beacon&0. A &1Mana Pool&0 must be present nearby, being at least half full. The infusion will create a single &1Terrasteel Ingot&0. -botania.page.terrasteel1=Creating Terrasteel -botania.page.terrasteel2=By combining the &1Terrasteel&0 with a &1Nether Star&0 and &1Blaze Powder&0, it's possible to artificially create a small extract of &1Essence of Eternal Life&0, a very powerful component in the creation of magical flora and natural instruments. -botania.page.terrasteel3=These come not from Kyubey # - MANA # -- AN INTRODUCTION TO MANA botania.entry.mIntro=Eine Einführung in Mana -botania.page.mIntro0=&4Mana&0 is an ethereal substance. In layman's terms, it is a form of &4mystical energy&0. Its sensorial existance is inconstant, and its color depends on the environment its put in.
    Mastering &4Mana&0 is one of the most important skills a botanist needs to master. -botania.page.mIntro1=In order to create &4Mana&0, one would require a set of &4Generating Flowers&0 (read the respective section). This &4Mana&0 can be dispersed by utilizing &1Mana Spreaders&0 and stored in &1Mana Pools&0. &4Mana&0 can be used for a myriad of different things. For starters, it can be used for &4Functional Flowers&0 (read the respective section). -botania.page.mIntro2=To get started with mastering the art of &4Mana&0, one would start by learning how to use &1Dayblooms&0, &1Mana Spreaders&0 and &1Mana Pools&0.
    These form a basic infrastructure for mana, which can be used for all sorts of purposes. Have a read at the &4Functional Flora&0 and &4Magical Apparatus&0 sections of this Lexicon. # -- MANA SPREADER botania.entry.spreader=Manaverbreiter -botania.page.spreader0=The &1Mana Spreader&0 is the most important component in manipulating &4Mana&0.
    This is the block that allows &4Mana&0 to travel from point A to point B. When this block is placed on the ground, it'll face one of 6 basic directions. By shift-right clicking it with a &1Wand of the Forest&0, one can orient it to the opposite of where it was clicked. -botania.page.spreader1=Holding a &1Wand of the Forest&0 -botania.page.spreader2=The &1Mana Spreader&0 has a small internal buffer of &4Mana&0, which will get filled by nearby &4Generating Flowers&0. This buffer can be viewed by looking at the &1Spreader&0 with a &1Wand of the Forest&0, as demonstrated in the last page.
    Note that the block needs to be right clicked with a wand to get accurate and adequate values. -botania.page.spreader3=Holding a &1Wand of the Forest&0 displays a beam which shows where the spreader is pointing at. Hovering over it shows the target. The sparkle that's always shown is the point when &4Mana loss&0 starts to happen.
    If the target of the spreader is a block that can contain &4Mana&0, and isn't full, the spreader will fire a &4Mana Burst&0, which will travel to the target, and pass the &4Mana&0 along to it. -botania.page.spreader4=The spreader only fires one burst at once, it'll only fire another one when the last one hits the target.
    Furthermore, the bursts also start suffering &4mana loss&0 after a small amount of time. This can be seen in the beam, which becomes a lot thinner when this happens. There is also a small amount of &4mana loss&0 when a beam enters a spreader. -botania.page.spreader5=Crafting the &1Mana Spreader&0 -botania.page.spreader6=In order to upgrade the potential of the spreader, one can apply &1Mana Lenses&0. The very basic mana lens does absolutely nothing.
    Lenses can be &4dyed&0 all the 16 colors of the spectrum, or combined with a &1Mana Pearl&0 to create a &1Rainbow Lens&0. These will change the color of the burst. -botania.page.spreader7=The basic lens, it doesn't do anything... -botania.page.spreader8=&4Dyeing&0 lenses! -botania.page.spreader9=&1Rainbow Lens&0 all the way # -- MANA POOL botania.entry.pool=Manabecken -botania.page.pool0=The &1Mana Pool&0 is, simply put, a storage of &4Mana&0.
    Mana can be inserted into it by usage of a &1Mana Spreader&0, and any adjacent &1Mana Spreaders&0 will pull mana from it to increase their internal buffer automatically.
    Any &4Functional Flowers&0 require a nearby &1Mana Pool&0 to draw power from. -botania.page.pool1=Making the &1Mana Pool&0. -botania.page.pool2=Tossing in some resources into the Mana Pool will cause them to get infused with &4Mana&0, turning them into more powerful forms.
    A few examples are &1Iron Ingots&0 or &1Mystical Petals&0.
    &4Mana&0 reading for this block functions like the &1Mana Spreader&0. A &1Redstone Comparator&0 can also output a signal based on the contents. -botania.page.pool3=Infusing &1Manasteel&0 -botania.page.pool4=Infusing &1Mana Pearls&0 -botania.page.pool5=Infusing &1Mana Diamonds&0 -botania.page.pool6=Infusing &1Mana Petals&0 -botania.page.pool7=&1Mana Cookies&0 feed you pretty well. # -- MANA DISTRIBUTOR botania.entry.distributor=Manaverteiler -botania.page.distributor0=Any botanist will eventually reach a point where a single &1Mana Pool&0 setup is not enough.
    The &1Mana Distributor&0 will fix all those issues. By placing it adjacently to a few &1Mana Pools&0 on its sides, when it receives &4Mana&0 through &4Mana Bursts&0 it'll equally spread it to the adjacent pools. -botania.page.distributor1=Crafting the distributor # -- MANA VOID botania.entry.manaVoid=Manaleere -botania.page.manaVoid0=The &1Mana Void&0 is, in layman's terms, the grave for &4Mana&0. Any &4Mana&0 shot into this block will simply vanish into the void, never to be seen again.
    Placing one of these under a &1Mana Pool&0 allows the pool to always accept &4Mana&0, but disposing any it can't hold. -botania.page.manaVoid1=Crafting the void block # -- MANA LENS: VELOCITY botania.entry.lensVelocity=Manalinse: Geschwindigkeit -botania.page.lensVelocity0=The &1Velocity Lens&0 will drastically increase the speed at which a &4Mana Burst&0 travels, but not only does the beam start to lose it's &4Mana&0 a lot faster, it can also carry a bit less. -botania.page.lensVelocity1=Crafting the lens # -- MANA LENS: POTENCY botania.entry.lensPotency=Manalinse: Macht -botania.page.lensPotency0=The &1Potency Lens&0 will double the amount of &4Mana&0 a &4Mana Burst&0 can carry, however, the beam becomes slower and after it starts to lose mana it does so at a lot faster rate. -botania.page.lensPotency1=Crafting the lens # -- MANA LENS: RESISTANCE botania.entry.lensResistance=Manalinse: Resistenz -botania.page.lensResistance0=The &1Resistance Lens&0 will significantly increase the amount of time the &4Mana Burst&0 can go without starting to lose &4Mana&0, but it makes it a a bit slower. -botania.page.lensResistance1=Crafting the lens # -- MANA LENS: EFFICIENCY botania.entry.lensEfficiency=Manalinse: Effizienz -botania.page.lensEfficiency0=The &1Efficiency Lens&0 will decrease the amount of time it takes for the &4Mana Burst&0 to start losing its &4Mana&0, but when that happens, it does so at a lot slower rate. -botania.page.lensEfficiency1=Crafting the lens # -- MANA LENS: BOUNCE botania.entry.lensBounce=Manalinse: Abprall -botania.page.lensBounce0=The &1Bounce Lens&0 will allow the &4Mana Burst&0 to bounce off walls, rather than dissipating on a collision. -botania.page.lensBounce1=Crafting the lens # -- MANA LENS: GRAVITY botania.entry.lensGravity=Manalinse: Schwerkraft -botania.page.lensGravity0=The &1Gravity Lens&0 makes the &4Mana Burst&0 be attracted by the world's gravitational pull, thus moving in an arc. As compensation, it also slightly increases the time before &4Mana&0 loss starts to happen. -botania.page.lensGravity1=Crafting the lens # -- MANA LENS: BORE botania.entry.lensBore=Manalinse: Bohren -botania.page.lensBore0=The &1Bore Lens&0 charges the &4Mana Burst&0 with the ability to break any blocks it comes into contact with, draining its own mana to do so.
    Since this relies on the detection abilities of a &1Mana Spreader&0, it won't fire at just anything, as it needs a &4Mana&0 receving block in the end. -botania.page.lensBore1=Crafting the lens # -- MANA LENS: DAMAGING botania.entry.lensDamaging=Manalinse: Schädigung -botania.page.lensDamaging0=The &1Damaging Lens&0 charges the &4Mana Burst&0 with the power to damage any living beings it comes across, draining its own mana to do so.
    Since this relies on the detection abilities of a &1Mana Spreader&0, it won't fire at just anything, as it needs a &4Mana&0 receving block in the end. -botania.page.lensDamaging1=Crafting the lens # -- MANA LENS: PHANTOM botania.entry.lensPhantom=Manalinse: Phantom -botania.page.lensPhantom0=By utilizing the spacetime continuum tearing properties of the &1Piston Relay&0, it's possible to make a lens that'll allow the &4Mana Burst&0 to pass through blocks. In doing so, the time it can stay without losing mana is decreased. -botania.page.lensPhantom1=Crafting the lens # -- MANA LENS: MAGNETIZING botania.entry.lensMagnet=Manalinse: Magnetisierung -botania.page.lensMagnet0=The &1Magnetizing Lens&0, as its name states, allows the &4Mana Burst&0 to magnetize, or home in, on any nearby blocks that can receive &4Mana&0. Doing so slightly decreases the speed of the burst. -botania.page.lensMagnet1=Crafting the lens # -- MANA LENS: ENTROPIC botania.entry.lensExplosive=Manalinse: Chaos -botania.page.lensExplosive0=The &1Entropic Lens&0 imbues the &4Mana Burst&0 with entropy, causing it to release its energy in the form of an explosion when it collides against something that can't receive &4Mana&0.
    Since this relies on the detection abilities of a &1Mana Spreader&0, it won't fire at just anything, as it needs a &4Mana&0 receving block in the end. -botania.page.lensExplosive1=Crafting the lens # -- PORTABLE MANA TRANSPORT botania.entry.manaTransport=Tragbares Transportieren von Mana -botania.page.manaTransport0=While using &1Mana Spreaders&0 to transport &4Mana&0 around is all well and good, there is also a way of doing it in a different manner.
    The &1Mana Tablet&0 is a portable object which can carry &4Mana&0 on itself. -botania.page.manaTransport1=Tossing one of these on top of a &1Mana Pool&0 will allow for transport of &4Mana&0 between one and another.
    Shift-right clicking the &1Mana Pool&0 with a &1Wand of the Forest&0 will change in which way the &4Mana&0 flows.
    Lastly, unlike normal items, these will never despawn when dropped on the floor. -botania.page.manaTransport2=This doesn't run android -botania.page.manaTransport3=It's also possible to indirectly access the &4Mana&0 reserves of a &1Mana Pool&0, through using a &1Mana Mirror&0, items will pull out of the pool itself.
    To bind a mirror to a pool, one would simply &4shift right-click&0 a pool with the mirror.
    The mirror can't put mana in or take mana out of pools in any other way. botania.page.manaTransport4=Spieglein, Spieglein an der Wand... # -- MANA DETECTOR botania.entry.manaDetector=Manadetektor -botania.page.manaDetector0=A device like the &1Mana Detector&0 is capable to detect when a &4Mana Burst&0 starts flowing through it (the burst doesn't dissipate on collision with this block) and provide a redstone signal when that is the case. -botania.page.manaDetector1=Crafting the detector # -- COMPOSITE MANA LENSES botania.entry.compositeLens=Verbundmanalinse -botania.page.compositeLens0=Having a single &1Mana Lens&0 in a spreader just isn't enough sometimes. By combining two lenses with a &1Slimeball&0 in a crafting table, it's possible to unite them into one, and keep the effects of both.
    The first lens used determines the visuals (texture and color). It's to note that some combinations will not work, and that two lenses of the same type can't be stacked. # -- REDSTONE MANA SPREADER botania.entry.redstoneSpreader=Redstone-Manaverbreiter -botania.page.redstoneSpreader0=By combining a &1Mana Spreader&0 with a piece of &1Redstone&0, it's possible to create a &1Redstone Mana Spreader&0, which fires only when given a &4Redstone signal&0, regardless of having a block in the end to put the mana or not.
    It's to keep in note that this doesn't let the spreader shoot a burst until the last one dissipates or is absorbed. -botania.page.redstoneSpreader1=Just add redstone # -- MANASTAR botania.entry.manastar=Manastern -botania.page.manastar0=The imprecise measurements of the &1Wand of the Forest&0 sometimes won't cut it for telling if you're turning a profit or loss in your &1Mana Pools&0.
    Creating a &1Manastar&0 and placing it next to your pools will have it shine red if there's a loss or blue if there's a profit. The measurement happens every few seconds. -botania.page.manastar1=&rI'm a shooting star leaping through the skies&r. # - FUNCTIONAL FLOWERS # -- AN INTRODUCTION TO FUNCTION botania.entry.fIntro=Eine Einführung in Funktion -botania.page.fIntro0=There are various places in which the &4Mana&0 a botanist generates can be put to use, one of them is an assortment of &4Functional Flowers&0.
    These flowers will drain &4Mana&0 from a nearby &1Mana Pool&0 into themselves, in order to do whatever task they were created for.
    It's to note that these can't receive power directly through &1Mana Spreaders&0. -botania.page.fIntro1=All &4Functional Flowers&0, alike the &4Generating Flowers&0 contain a small buffer of &4Mana&0.
    Standard rules for &4Mana&0 reading apply, right clicking with a &1Wand of the Forest&0 will update the mana readings. -botania.page.fIntro2=It is important to keep in mind that these flowers memorize the &1Mana Pool&0 from which they should pull &4Mana&0 out of. They'll only pull from the nearest pool present at the time of the flower being placed (or the closest placed afterward, if none was present), and none other, unless that one is removed. -botania.page.fIntro3=Lastly, some functional flowers utilize a &1Redstone Root&0 in their creation. If they do, the flower's effect can be toggled with a redstone signal. -botania.page.fIntro4=&1Redstone Root&0 for Redstone Control # -- JADED AMARANTHUS botania.entry.jadedAmaranthus=Jaded-Amarant -botania.page.jadedAmaranthus0=Everyone likes flowers right? The &1Jaded Amaranthus&0 is made just for that purpose.
    Feeding it with &4Mana&0 from &1Mana Pools&0 will have it quickly grow new &1Mystical Flowers&0 around it, in any spots it can. -botania.page.jadedAmaranthus1=&oIt was this or clematis.&r # -- BELLETHRONE botania.entry.bellethorne=Belldorn -botania.page.bellethorne0=The &1Bellethorne&0 is a malevelous flower. By utilizing &4Mana&0 it slowly inflicts harm in any living beings (save for &4players&0) around it. -botania.page.bellethorne1=&oEvery rose has its thorn&r. # -- DREADTHORNE botania.entry.dreadthorne=Schreckdorn -botania.page.dreadthorne0=The &1Dreadthorne&0 is a slightly more specific counterpart to the &1Bellethrorne&0, by which, instead of all mobs around, it'll only hurt &4adult&0 animals and none else. botania.page.dreadthorne1=&oNein, Mr. Bond - ich erwarte von Ihnen, dass Sie sterben&r. # -- HEISEI DREAM botania.entry.heiseiDream=Kehrnelke -botania.page.heiseiDream0=The &1Heisei Dream&0 will, by utilizing &4Mana&0, awaken feelings of anger and revenge in any nearby &4mobs&0, turning them against eachother. -botania.page.heiseiDream1=&oA pleasant era will murder people&r. # -- TIGERSEYE botania.entry.tigerseye=Tigerauge -botania.page.tigerseye0=It's a known fact that &4Creepers&0 are terrified of &4cats&0.
    The &1Tigerseye&0 exploits that very weakness, by emiting a feline aura, petrifying any nearby &4Creepers&0, preventing them from exploding. It also has the effect of making them run away from &4players&0. -botania.page.tigerseye1=&oRisin' up to the challenge of our rivals&r. # -- ORECHID botania.entry.orechid=Erzblüte -botania.page.orechid0=While going mining is all good, a renewable means of getting ore is due. The &1Orechid&0 will use (a massive amount of) &4Mana&0 to generate &4ores&0 in nearby &1Stone&0 blocks.
    The ores it generates are random, but seem to be biased towards more common ores rather than rarer ones. -botania.page.orechid1=&oLizbeth would like this flower&r. # -- FALLEN KANADE botania.entry.fallenKanade=Engelsblüte -botania.page.fallenKanade0=The &1Fallen Kanade&0 is a flower with angelic properties, it'll use &4Mana&0 from nearby &4Mana Pools&0 in order to apply a regeneration effect to any &4players&0 nearby. -botania.page.fallenKanade1=&oHand Sonic, version four&r. # -- EXOFLAME botania.entry.exoflame=Exoflamme -botania.page.exoflame0=Unlike it's generating counterpart, the &1Exoflame&0 utilizes &4Mana&0 with means to generate heat.
    Any &1Furnaces&0 nearby to the &1Exoflame&0 will be fueled, and given an efficiency boost, for the cost of some &4Mana&0. -botania.page.exoflame1=&oBut we should be going nowhere fast&r. # -- AGRICARNATION botania.entry.agricarnation=Agraryophylle -botania.page.agricarnation0=The slow growth of crops is always a problem to feed the masses. The &1Agricarnation&0 is a flower that turns &4Mana&0 into a type of natural fertilizer, causing nearby plantlife to grow at a faster rate. -botania.page.agricarnation1=&0Grandola Vila Morena&r... # -- HOPPERHOCK botania.entry.hopperhock=Trichterkraut -botania.page.hopperhock0=The &1Hopperhock&0 will pick up items around it. Giving it &4Mana&0 is optional, but it'll increase it's range.
    Items picked up will be put in adjacent inventories (e.g. &1Chests&0). Placing &1Item Frames&0 in any of the inventories will specify which items can or can't go in them. -botania.page.hopperhock1=Any inventory which has no &1Item Frame&0 adjacent to it can accept any items, but labeled inventories will take priority.
    The rule using to sort items can be changed by shift-right clicking the flower with a &1Wand of the Forest&0. -botania.page.hopperhock2=&oI guess I'll be talking my loli and leaving&r. # -- TANGLEBERRIE botania.entry.tangleberrie=Wirrbeere -botania.page.tangleberrie0=The &1Tangleberrie&0 is a flower that, at the cost of a small amount of &4Mana&0, will keep any nearby animals or monsters within a circle ward, preventing them from getting out. -botania.page.tangleberrie1=&oTangled, brave and frozen&r. # -- JIYUULIA botania.entry.jiyuulia=Bannbeere -botania.page.jiyuulia0=The &1Jiyuulia&0 is a flower that, at the cost of a small amount of &4Mana&0, will keep any nearby animals or monsters at bay, protecting a circular area from them getting in. -botania.page.jiyuulia1=&oKeep out, please&r. # -- RANNUNCARPUS botania.entry.rannuncarpus=Rannawurzel -botania.page.rannuncarpus0=Quite a handy flower indeed, the &1Rannuncarpus&0 will pick up any nearby blocks in dropped item form and place them in the world nearby. It, however, only places the blocks thrown at it on top of a specific block, to specify this block, place it right below the soil the flower is resting on. -botania.page.rannuncarpus1=Block items, such as &1Sugar Cane&0 will also work, but, much alike any other blocks, will only be placed in a location where they normally would be able to be placed.
    Lastly, giving &4Mana&0 to the flower is optional, but it increases it's range. -botania.page.rannuncarpus2=&oNeed a hand&r? # -- HYACIDUS botania.entry.hyacidus=Cyazinthe -botania.page.hyacidus0=For some reason, poison does not kill. The &1Hyacidus&0, to that, can be used to poison any nearby mobs, bringing them to their knees for a one hit kill after a bit. botania.page.hyacidus1=&oStahl ist immun&r. # -- POLLIDISIAC botania.entry.pollidisiac=Pollidisie -botania.page.pollidisiac0=Animals love eating, that's all they seem to do, really. An interesting behaviour they show is that they only seem to want to eat things that are fed to them.
    The &1Pollidisiac&0 will simply do that, at the cost of some mana, any appropriate nearby food items (&1Wheat&0, &1Carrots&0, etc) will be fed to the animals, putting them in a &obetter mood&r. -botania.page.pollidisiac1=&oHell's Kitchen&r. # -- CLAYCONIA botania.entry.clayconia=Helehmie -botania.page.clayconia0=The &1Clayconia&0 is a simple flower, in essence. All it does is moisten nearby &1Sand&0, turning it into &1Clay&0, this process uses a decent amount of &4Mana&0, but nothing too insane. -botania.page.clayconia1=&oWhat a killer joke&r. # -- LOONIUM botania.entry.loonium=Beutner -botania.page.loonium0=Any weary adventurer knows that &4Dungeons&0 can hold valuable goodies. The &1Loonium&0 can, at the use of an extreme amount of &4Mana&0, materialize these items and drop them in the nearby vacinity. -botania.page.loonium1=&oTank Tank Heal Tank&r! # - GENERATING FLOWERS # -- AN INTRODUCTION TO GENERATION botania.entry.gIntro=Eine Einführung in Generierung -botania.page.gIntro0=&4Generating Mana&0 should be at the top of the priorities for any botanist. Luckilly there's an array of &4Generating Flowers&0 willing to do the job.
    These flowers, as their name shows, generate &4Mana&0, both passively and actively. Unless stated otherwise, all &4Generating Flowers&0 generate &4Mana&0 passively under certain circunstances. -botania.page.gIntro1=All &4Generating Flowers&0, alike the &4Functional Flowers&0 contain a small buffer of &4Mana&0.
    Standard rules for &4Mana&0 reading apply, right clicking with a &1Wand of the Forest&0 will update the mana readings.
    This mana will be stored in the closest &1Mana Spreader&0 around. -botania.page.gIntro2=It is important to keep in mind that these flowers memorize the &1Mana Spreader&0 into which they should put &4Mana&0 into. They'll only store into the nearest spreader present at the time of the flower being placed (or the closest placed afterward, if none was present), and none other, unless that one is removed. # -- DAYBLOOM botania.entry.daybloom=Tagesblüte -botania.page.daybloom0=The &1Daybloom&0 is the most basic and rudimentary &4Generating Flower&0. Simply put, it preforms a modified photosythesis process, in order to transform sunlight into &4Mana&0.
    The process is rather slow, about ten or a dozen of these should get the job done, for now. -botania.page.daybloom1=An interesting thing to take in note is that these flowers tend to compete among themselves for what sunlight hits an area, thus having any others adjacent to it on any of the four cardinal directions will result in diminshing returns of &4Mana&0 production. -botania.page.daybloom2=&oStarting up a brand new day&r. # -- NIGHTSHADE botania.entry.nightshade=Nachtschatten -botania.page.nightshade0=The &1Nightshade&0 is the dark counterpart of the &1Daybloom&0, as it generates &4Mana&0 passively in any situation the &1Daybloom&0 can not, albeit at half the speed.
    Similarly to their shining counterpart, they suffer diminishing returns from having any adjacent. -botania.page.nightshade1=&oThe shadow of the day&r. # -- ENDOFLAME botania.entry.endoflame=Endoflamme -botania.page.endoflame0=While the &1Daybloom&0 is all well and good, a botanist requires more effective means of generating &4Mana&0.
    The &1Endoflame&0 does that exactly, it will absorb any combustible items or blocks dropped on the nearby vacinity (albeit only one at a time) and burn through them to passively generate mana while the fuel lasts. -botania.page.endoflame1=There is a small caveat though, the &1Endoflame&0 will not burn anything that returns a bi-product, an example are &1Lava Buckets&0, that have empty &1Buckets&0 as a bi-product. botania.page.endoflame2=&oNicht Nitor&r. # -- HYDROANGEAS -botania.entry.hydroangeas=Hydroangea -botania.page.hydroangeas0=While you can generate easy &4Mana&0 with the &1Daybloom&0, sometimes you need to create more energy without using any fuels...
    The &1Hydroangeas&0 will devour adjacent water sources to create mana, it does have a cooldown timer though, so power can not be generated instantly. botania.page.hydroangeas1=&oAquane Macht&r. # -- THERMALILY botania.entry.thermalily=Thermalilie -botania.page.thermalily0=There comes a point where slow generating power, like the &1Hydroangeas&0 or the &1Endoflame&0 is not enough. An answer to that is the &1Thermalily&0, which works similarly to the &1Hydroangeas&0, except with &1Lava&0. Care should be taken with this flower, as it generates power at an extremely fast speed. -botania.page.thermalily1=&oLily ought to know&r. # -- ROSA ARCANA -botania.entry.arcanerose=Rosa Arcana -botania.page.arcanerose0=&4Experience Points&0 are a form of magic of sorts. The &1Rosa Arcana&0 can tap into it and absorb the experience of players on the ground around it, turning it into &1Mana&0. -botania.page.arcanerose1=&oGo have a drink, it might take a bit&r. # -- MUNCHDEW botania.entry.munchdew=Mampftau -botania.page.munchdew0=Generating the form of natural energy that is &4Mana&0 should be a pretty good process when done via other living materials. By using the &1Munchdew&0, any &1Leaves&0 near the flower will get munched up and convereted into &4Mana&0.
    It's to note that, though, no saplings or any other items will be dropped from the leaves. -botania.page.munchdew1=&oGuten Appetit&r. # -- ENTROPINNYUM botania.entry.entropinnyum=Entropinnyum -botania.page.entropinnyum0=In order to generate a blast of &4Mana&0, one might in fact, require a blast nearby.
    Igniting a block of &1TNT&0 in the near an &1Entropinnyum&0 will have the latter absorb all the entropy generated by the blast into itself, creating a large amount of &4Mana&0 and nullifiying any possible damage. Lastly, to absorb the explosion, the flower must not have any &4Mana&0 stored in it or the process will fail. -botania.page.entropinnyum1=&oCool guys don't look at explosions&r. # -- KEKIMURUS botania.entry.kekimurus=Kekimurus -botania.page.kekimurus0=&1Cake&0 is delicious, everyone loves it, flowers included.
    The &1Kekimurus&0 is one of these &1Cake&0 aficionados, and will eat any it spots nearby, using it's enriching nutrients to create &4Mana&0. -botania.page.kekimurus1=&oLet them eat cake&r. # - MAGICAL APPARATUS # -- FORCE RELAY botania.entry.pistonRelay=Kraftrelais -botania.page.pistonRelay0=It seems that infusing &1Pistons&0 with &4Mana&0 results in some interesting adverse effects.
    This block tears the fabric of space, relaying any piston force applied to it to the block it's bound to. -botania.page.pistonRelay1=To bind it to a block, right click it with a &1Wand of the Forest&0, and right click on the block you want to bind it to.
    Furthermore, this block is highly unstable, and may create uncanny effects, care is to be taken, it is also resistant to glue. -botania.page.pistonRelay2=Infusing a &1Piston&0 with &4Mana&0. # -- MANA PYLON botania.entry.pylon=Manapylon -botania.page.pylon0=A &1Mana Pylon&0 is a structure that can pull energies from the earth and use them to power enchanting processes.
    For one, setting one adjanced to an &1Enchanting Table&0 as if it was a &1Bookshelf&0 will drastically increase the power it can convey, just 2 of these are enough for it to reach &4Level 30&0. -botania.page.pylon1=&oYou must construct additional pylons!&r # -- MANA ENCHANTING botania.entry.manaEnchanting=Verzaubern mit Mana -botania.page.manaEnchanting0=By utilizing the magical power emited from &1Mana Pylons&0, a structure that can enchant items with books without consuming them can be created, called the &1Mana Enchanteer&0.
    Constructing one of these requires a fair amount of space and materials alike. -botania.page.manaEnchanting1=To construct the &1Mana Enchanter&0, one requires, as well as fair amount of space, 17 &1Obsidian&0 blocks, 10 &1Mystical Flowers&0 of any color, 6 &1Mana Pylons&0 and a &1Lapis Lazuli Block&0.
    The instructions on how to assemble this structure are in the following pages. -botania.page.manaEnchanting2=Start by making an &1Obsidian&0 circle. -botania.page.manaEnchanting3=Put &1Mana Pylons&0 1 block in the air where marked. -botania.page.manaEnchanting4=Put flowers under the pylons and in the center -botania.page.manaEnchanting5=Place a &1Lapis Lazuli Block&0 in the center. -botania.page.manaEnchanting6=After the construct is done, right click the Lapis block with a &1Wand of the Forest&0 and the enchanter should form.
    In order to utilize the enchanter, one would place (via right click) the item to be enchanted in the enchanter itself and drop &1Enchanted Books&0 inside the circle around it. -botania.page.manaEnchanting7=Items that are already enchanted can't be placed in the enchanter.
    To start the enchanting, right click the enchanter with a &1Wand of the Forest&0. It'll scan the books around, and once it's done, a spell circle of sorts will appear around it, indicating the books can be safely picked up again. -botania.page.manaEnchanting8=After the enchanting begins, the enchanter will require &4Mana&0.
    It can be fed via one of two ways, either via &4Mana Bursts&0 or nearby &1Mana Pools&0, the later being much faster, but a bit less efficient, as a small portion of the mana is lost. -botania.page.manaEnchanting9=When enough &4Mana&0 is gathered, the enchanting process will finalize, and the enchantments will be applied to the item.
    The amount of &4Mana&0 required depends on the rarity of the enchantments being applied, their level, and the total amount of enchantments.
    If any book has more than one enchantment, only the first will be accounted for. -botania.page.manaEnchanting10=During the enchanting process, the item can not be removed, but it can after the process has been completed.
    Note that if at any point, any component of the construct is removed, it'll revert to it's original &1Lapis Lazuli Block&0 form. # -- SPREADER TURNTABLE botania.entry.turntable=Verbreiter-Drehscheibe -botania.page.turntable0=The &1Spreader Turntable&0, as it's name implies, can turn &1Mana Spreaders&0 around and around. Placing a spreader above the turntable will rotate it, given that a redstone signal isn't applied.
    To change the speed of the turntable, right click with a &1Wand of the Forest&0, shift-right clicking will invert the movement. -botania.page.turntable1=Spin spin spin spin # -- BOTANICAL ALCHEMY botania.entry.manaAlchemy=Alchemiie mit Mana -botania.page.manaAlchemy0=&4Mana&0 is an extremely volatile substance, to a point that it's complete properties and abilities are unknown.
    One of them is known, though, by attaching an &1Alchemy Catalyst&0, created with a mixture of otherworldly materials to the bottom of a &1Mana Pool&0, it enables the pool to perform &4Alchemy&0. botania.page.manaAlchemy1=Kreieren eines &1Katalysators&0 botania.page.manaAlchemy2=&1Verrottetes Fleisch&0 zu &1Leder&0 botania.page.manaAlchemy3=Verschiedene Arten von &1Holz&0 @@ -808,57 +645,35 @@ botania.page.manaAlchemy19=Zersetzung von &1Pflasterstein&0 zu &1Sand&0 # -- EYE OF THE ANCIENTS botania.entry.forestEye=Auge der Ältesten -botania.page.forestEye0=As the Ancients who used to watch over the world always looked for the living beings on it, this block, the &1Eye of the Ancients&0 will do just that.
    By attaching a &1Comparator&0 next to it, it'll send out a redstone signal equivalent to the amount of animals it can find. -botania.page.forestEye1=The counting only starts at 2, so, with 2 animals around, it'd output a signal of strength 1, with 3 animals, of strength 2 and so on.
    Lastly, the time has worn down the sight of the Ancients, so this block can only see animals in about 6 blocks in any direction. -botania.page.forestEye2=Now you see me... # -- OPEN CRATE botania.entry.openCrate=Offene Kiste -botania.page.openCrate0=Sometimes devices like &1Droppers&0 or &1Dispensers&0 aren't precise or fast enough. A simple solution is to make a crate and punch a hole in the bottom.
    Yeah, it's that simple. The &1Open Crate&0 accepts items from &1Hoppers&0 or any other means of inserting items, and obviously, drops them directly below it. -botania.page.openCrate1=A little interesting effect the &1Open Crate&0 can do is that, when given a redstone signal, any items it drops are prevented from being caught by flowers like the &1Hopperhock&0, &1Rannuncarpus&0 or &1Pollidisiac&0 for around ten seconds more than usual. -botania.page.openCrate2=A super crate box # -- DRUM OF THE WILD botania.entry.forestDrum=Trommel der Wildnis -botania.page.forestDrum0=The &1Drum of the Wild&0 is, in layman's terms, the percussion counterpart of the &1Horn of the Wild&0. It serves the exact same purpose as the handheld horn, but is placed in world.
    To trigger a beat and break nearby folliage, one would fire a &4Mana Burst&0 at the drum. -botania.page.forestDrum1=It's to note that the drum does not store mana, hence, in order to trigger it, a &1Redstone Mana Spreader&0 or a &1Mana Blaster&0 is required. -botania.page.forestDrum2=But if you close your eyes... # -- ABTRUSE PLATFORM botania.entry.platform=Schimmerplattform -botania.page.platform0=By laying &1Livingwood&0 on a very specific format it's possible to create a platform of sorts, that only has a physical body for whoever is on top of it and isn't sneaking. For anyone else, it's like it's not there. &4Mana Bursts&0 will always travel through it without any trouble.
    It's also possible to camouflage this block as any other simple block by simply right clicking it. -botania.page.platform1=It would be Etheral but the name was taken # - MYSTICAL INSTRUMENTS # -- MANA BLASTER botania.entry.manaBlaster=Mana-Blaster -botania.page.manaBlaster0=The &1Mana Blaster&0 is like a portable &1Mana Spreader&0, while shaped like a pistol for easy handling, it's not exactly a firearm, as much as it is just a portable spreader.
    By utilizing &4Mana&0 from &4Mana carrying items&0 in the holder's inventory, it can shoot a mana burst when one is looking at. -botania.page.manaBlaster1=This burst is a bit different from the one fired from speaders, as it's faster, but carries only three quarters of the mana a spreader burst would. There's also a short cooldown period after firing the blaster until another burst can be shot. -botania.page.manaBlaster2=&1Mana Lenses&0 also function with the blaster, to attach one to it, put them side by side on a crafting table, to remove it, simply shift-right click the blaster. -botania.page.manaBlaster3=Crafting the blaster # -- PASTURE SEEDS botania.entry.grassSeeds=Weidesamen -botania.page.grassSeeds0=Watching grass spread is seldom a fun activity. By infusing some &1Tall Grass&0 with &4Mana&0, it's possible to create &1Pasture Seeds&0, which will grow grass in any barren area, via a simple right click on dirt.
    Other types of folliage can also be grown, such a &1Podzol&0 or &1Mycellium&0 with alternate seeds. botania.page.grassSeeds1=&1Weidesamen&0 für Gras botania.page.grassSeeds2=&1Boreale Samen&0 für Podsol botania.page.grassSeeds3=&1Seuchensamen&0 für Myzel # -- ROD THE LANDS botania.entry.dirtRod=Stab der Böden -botania.page.dirtRod0=The &1Rod of the Lands&0 is a rather simpleton tool, by utilizing &4Mana&0 from your inventory (via a &1Mana Tablet&0 or others), it can materialize and place a &1Dirt&0 block down. botania.page.dirtRod1=Ziemlich dreckig # -- TERRA FIRMA ROD botania.entry.terraformRod=Terrafirmastab -botania.page.terraformRod0=While digging away at dirt with a shovel is definitely functional, flattening huge tracts of land can get somewhat tortuous at times.
    By utilizing the &1Terra Firma Rod&0, it's possible to terraform in a quick and enviromental friendly manner. -botania.page.terraformRod1=This rod, will, at the cost of some &4Mana&0 from your inventory, flatten the land to the level you are standing. For this to happen, charge it by &4holding right-click&0 and, slowly but surely, the nearby terrain will be flattened to your level, either by placing &1Dirt&0 or by removing blocks. -botania.page.terraformRod2=Note that blocks removed by the rod are non-recuperable. The terrain will adapt to the changes as best as it can, up to a distance limit, to avoid cuts in hills and the like, for this, the flattening will work in the terrain's natural look. -botania.page.terraformRod3=Quite a justicar # -- MANASTEEL EQUIPMENT botania.entry.manaGear=Manastahl-Equipment -botania.page.manaGear0=&1Manasteel&0, alike other metals, can be shaped into tools and armor alike.
    Tools or armor crafted from this material will share their properties with &1Iron&0, albeit somewhat superior in enchantability and durability. Whenever a &1Manasteel&0 item is to take damage, if there's &4Mana&0 available in the inventory (such as a &1Mana Tablet&0), it'll use that instead. botania.page.manaGear1=Die &1Manastahlspitzhacke&0 botania.page.manaGear2=Die &1Manastahlschaufel&0 botania.page.manaGear3=Die &1Manastahlaxt&0 @@ -871,12 +686,9 @@ botania.page.manaGear9=Die &1Manastahlstiefel&0 # -- HORN OF THE WILD botania.entry.grassHorn=Horn der Wildnis -botania.page.grassHorn0=Clearing out &1Tall Grass&0 by hand can definitely be a nuisance.
    Simply blowing the &1Horn of the Wild&0 will quickly cause any nearby vegetation to uproot, leaving behind drops as if it had been broken by hand. -botania.page.grassHorn1=Crafting the horn # -- TERRASTEEL ARMOR botania.entry.terrasteelArmor=Terrastahlrüstung -botania.page.terrasteelArmor0=Armor made out of &1Terrasteel&0, much alike the &1Manasteel&0 counterpart, can utilize &4Mana&0 from the inventory instead of taking damage.
    This armor, however, has properties more alike &1Diamond&0 instead of &1Iron&0 and increases the wearer's health when worn. botania.page.terrasteelArmor1=Der &1Terrastahlhelmt&0 botania.page.terrasteelArmor2=Der &1Terrastahlbrustpanzer&0 botania.page.terrasteelArmor3=Der &1Terrastahlbeinschutz&0 @@ -884,112 +696,64 @@ botania.page.terrasteelArmor4=Die &1Terrastahlstiefel&0 # -- TERRA BLADE botania.entry.terraSword=Terraklinge -botania.page.terraSword0=The &1Terra Blade&0, crafted from &1Terrasteel Ingots&0, is a sword infused with natural strength. Not only does it par with a &1Diamond Sword&0 in terms of strength and it uses &4Mana&0 from the inventory like &1Manasteel Tools&0, but when it's swinged, there's a chance for it to create a beam that will deal as much damage as a melee hit. -botania.page.terraSword1=No Broken Hero Sword # -- TERRA SHATTERER botania.entry.terraPick=Terra-Brecher -botania.page.terraPick0=The &1Terra Shatterer&0 is a tool that can amass insane quantities of mana on itself, due to the amount of &1Terrasteel&0 required for it's creation.
    The tool functions very much like a &1Mana Tablet&0 by which it can amass &4Mana&0 by being tossed on a &1Mana Pool&0, it can't give the &4Mana&0 back, though, so it doesn't function as a storage method. -botania.page.terraPick1=The amount of &4Mana&0 stored on the tool defines it's &4Rank&0. Ranks go as follows: &4D&0, &4C&0, &4B&0, &4A&0, &4S&0, &4SS&0. &4D&0 being the default rank.
    The amount of &4Mana&0 required to advance from rank to rank increases as the rank does. To advance from &4D&0 to &4C&0, for example, it requires just a few seconds of exposition to a &1Mana Pool&0. -botania.page.terraPick2=To advance from rank &4C&0 to rank &4B&0, a full &1Mana Pool&0 is required, and the cost increases by a tenfold per rank from there on in, all the way to &4SS&0.
    The rank of the tool does not change it's speed, but instead, it increases the power of it's &4Active Ability&0.
    Toggling the tool's ability can be done via right click. -botania.page.terraPick3=While the tool is active, it enables it to break blocks in an extended area. At rank &4C&0 it's a small column, which increases to a square at rank &4B&0, that gets larger trough the ranks. It's to note that the rank &4D&0 tool does not have the active ability.
    Having the tool active consumes &4Mana&0 from it's storage passively, even if not being used to mine. -botania.page.terraPick4=Lastly, the tool takes damage for every single block broken, so a good supply of &4Mana&0 in the wielder's inventory is a must for the higher ranks, as the tool does function like normal &1Manasteel Tools&0, in which it'll use &4Mana&0 instead of actually taking damage, given it's made of &1Terrasteel&0.
    It also won't despawn like regular dropped items. -botania.page.terraPick5=Stronger than a Gastrea # - BAUBLES # -- AN INTRODUCTION TO BAUBLES botania.entry.bIntro=Eine Einführung in Accessoires -botania.page.bIntro0=&4Baubles&0, also commonly refered to as &4Trinkets&0 or &4Charms&0 are pieces of equipment which offer all sorts of different effects, when worn.
    To equip them, one can press the &4B&0 (configurable) key. There's four slots, one &4Amulet&0 slot, two &4Ring&0 slots and one &4Belt&0 slot. -botania.page.bIntro1=The &4Baubles Screen&0 -botania.page.bIntro2=It's to note that, if &4Thaumcraft&0 or any other mod that uses the baubles sytem is installed, this inventory will be shared between the various mods. # -- TINY PLANET botania.entry.tinyPlanet=Winziger Planet -botania.page.tinyPlanet0=The &1Tiny Planet&0 is a bauble with gravitational proprieties, while equipped, the &1Tiny Planet&0 will pull any nearby &4Mana Bursts&0 towards the wearer, having them orbit around him or her. -botania.page.tinyPlanet1=Clearly from rebirth botania.page.tinyPlanet2=Planetarischer als Pluto # -- BAND OF MANA botania.entry.manaRing=Manaband -botania.page.manaRing0=Combining a &1Mana Tablet&0 with some &1Manasteel&0 creates an easilly worn &4Ring&0, that functions exactly similar to the tablet used to make it, but can be worn as a &4Bauble&0.
    Using some &1Terrasteel&0 allows for an upgrade, which lets it store about four times as much &4Mana&0. -botania.page.manaRing1=Creating the ring -botania.page.manaRing2=Upgrading the ring # -- BAND OF AURA botania.entry.auraRing=Auraband -botania.page.auraRing0=The &1Band of Aura&0 is a bit of a deviation from the typical &1Band of Mana&0, in which, instead of storing &4Mana&0, it slowly, while equipped, creates it and stores it into &4Mana&0 containing items in the wearer's inventory.
    Using some &1Terrasteel&0 allows for an upgrade, which lets it generate &4Mana&0 at a significantly faster rate. -botania.page.auraRing1=Creating the ring -botania.page.auraRing2=Upgrading the ring # -- SOUJOURNER'S SASH botania.entry.travelBelt=Schärpe des Reisenden -botania.page.travelBelt0=Traversing terrain sometimes proves to be a hassle. The &1Soujourner's Sash&0 can be equipped in the &4Belt&0 slot, and when worn will increase the movement speed, jump height and resistance to fall damage of the wearer.
    Lastly, if not sneaking, it also allows the wearer to walk over 1 block high gaps without jumping with ease. -botania.page.travelBelt1=...everell # -- TECTONIC GIRDLE botania.entry.knockbackBelt=Tektonikgürtel -botania.page.knockbackBelt0=By harnessing the forces of tectonic movement, the &1Tectonic Girdle&0, when worn, will negate any &4Knockback&0 applied to the wearer by outside attacks. -botania.page.knockbackBelt1=Don't... move # -- SNOWFLAKE PENDANT botania.entry.icePendant=Schneeflockanhänger -botania.page.icePendant0=The &1Snowflake Pendant&0 is a &4Bauble&0 that resonates freezing energy, while it's worn, any nearby still &1Water&0 blocks at foot level will be converted into &1Ice&0.
    The &1Ice&0 will melt shortly afterward the wearer leaves the area. Lastly, this charm will not freeze any blocks if the wearer is sneaking or fully submerged. -botania.page.icePendant1=Do you want to build a snowman? # -- PYROCLAST PENDANT botania.entry.lavaPendant=Pyroklastanhänger -botania.page.lavaPendant0=The &1Pyroclast Pendant&0 is a &4Bauble&0 that absorbs any heat, while it's worn, the wearer becomes completely imprevious to any &4Fire&0 or &4Lava&0 damage. -botania.page.lavaPendant1=Hanako could have used one of these # -- GOLDEN LAUREL CROWN botania.entry.goldenLaurel=Goldener Lorbeerkranz -botania.page.goldenLaurel0=One of the uses for &1Essence of Eternal Life&0 is to, of course, grant a layer of immortality to one that uses it, while wearing a &1Golden Laurel Crown&0, if the wearer were to die, the crown will shatter, regenerating all of their health and giving them a short period of invincibility. -botania.page.goldenLaurel1=Given the theme, probably Viridi # -- RING OF CHORDATA botania.entry.waterRing=Ring der Ozeane -botania.page.waterRing0=The &1Ring of Chordata&0 allows the wearer to swim like a fish. While it's equipped, the wearer is bestowed with the ability to accelarate to a decent speed while underwater. It also gives the wearer good sight underwater and, if &4Mana&0 is present, at the cost of some of it, the ability to breathe indefinitely. botania.page.waterRing1=Butter bei die Fische # -- RING OF THE MANTLE botania.entry.miningRing=Ring des Erdmantels -botania.page.miningRing0=The &1Ring of the Mantle&0 allows one to mine faster, while equipped and &4Mana&0 is present in the inventory, it'll give a &4Haste&0 effect to the wearer. Some &4Mana&0 is used while the wearer swings their arm or equipped item, be it for attacking, mining or just flailing. -botania.page.miningRing1=Diggy diggy hole # -- RING OF MAGNETIZATION botania.entry.magnetRing=Ring des Magnetismus -botania.page.magnetRing0=By turning a &1Magnetizing Lens&0 into a wearable ring, one can use it to magnetize nearby items.
    While equipped, this ring will make any nearby items magnetize towards the wearer, case they aren't sneaking. -botania.page.magnetRing1=How do they work? # -- CHARM OF THE DIVA botania.entry.divaCharm=Talisman der Diva -botania.page.divaCharm0=The &1Charm of the Diva&0 blesses the wearer with the ability to have any attacked mob follow the attacker's will, and, case there are any nearby enemies, go after them instead. This process, of course, requires a bit of &4Mana&0 from the wearer's inventory in order to function. -botania.page.divaCharm1=You shall not disrespect Big Sister # -- FLUGEL TIARA botania.entry.flightTiara=Flügel-Tiara -botania.page.flightTiara0=The &4Flügel&0 were once a dominant species in the lands, now they're but a race past extinct, once created as godslayers, who possessed the ability of flight.
    The usage of &1Essence of Eternal Life&0 allows for a small replica of their power, in the form of the &1Flügel Tiara&0, which, at the cost of &4Mana&0 allows for flight. -botania.page.flightTiara1=Forty thousand books from another world # -- ALFHOMANCY botania.entry.aIntro=Das Protal nach Alfheim -botania.page.aIntro0=Once, in olden times, &4Elves&0 used to share the world with us &4Minecrafters&0. Due to unknown events, they have been banished back to their own world, &4Alfheim&0.
    Experimentation has been done in atempt to bridge the gap between the two worlds but not much has been found thus far. # - MISCLANEOUS # -- UNSTABLE CUBE botania.entry.unstableBlocks=Instabile Würfel -botania.page.unstableBlocks0=Fiddling with highly powerful &4Mana&0 infused objects has lead to the creation of these strange cubes. They seem to emit some visual radiation in the form of colorful lightning, but it doesn't seem like it has any effects other than visual appeal. -botania.page.unstableBlocks1=They look fancy -botania.page.unstableBlocks2=And they come in all 16 colors -botania.page.unstableBlocks3=You also found a way of creating a different version of these that releases an extremely larger amount of energy, this time in the form of a beam towards the sky that extends into a cloud of sorts. This one also seems to be disableable via a &4Redstone Signal&0, you call it &1Unstable Beacon&0, as it looks like one somehow. -botania.page.unstableBlocks4=Fireworks? -botania.page.unstableBlocks5=Combined entropy -botania.page.unstableBlocks6=It's also possible, by using the &1Unstable Beacons&0, to turn them into a manageable and portable utility, in the form of the &1Signal Flare&0.
    This gun of sorts shoots a colored round into the sky that lasts a few seconds, it also stuns any nearby enemies for just as long. -botania.page.unstableBlocks7=&oShoot in case of titan.&r # -- DECORATIVE BLOCKS botania.entry.decorativeBlocks=Dekorative Blöcke -botania.page.decorativeBlocks0=It's possible to turn blocks of &1Livingrock&0 and &1Livingwood&0 into decorative blocks. Each of them features 4 different decorative variations.
    If &4ForgeMultipart&0 is enabled, these will work as &4Microblocks&0. botania.page.decorativeBlocks1=Lebesteinziegel botania.page.decorativeBlocks2=Die Ziegel bemoosen botania.page.decorativeBlocks3=Die Ziegel brüchig machen @@ -1002,9 +766,6 @@ botania.page.decorativeBlocks9=Schimmerndes Lebeholz # -- DISPENSER TWEAKS botania.entry.dispenserTweaks=Dispenser-Änderungen -botania.page.dispenserTweaks0=&1Dispensers&0, among their normal abilities, can also plant all sorts of crops, from &1Seeds&0, &1Potatos&0 or &1Carrots&0 to even &1Nether Wart&0. The crop is planted in the block right in front of the dispenser.
    The &1Dispensers&0 can also use the &1Wand of the Forest&0 for some specific tasks such as triggering a &1Runic Altar&0. # -- GLIMMERING FLOWERS botania.entry.shinyFlowers=Schimmernde Blumen -botania.page.shinyFlowers0=By combining your typical &1Mystical Flowers&0 with some &1Glowstone Dust&0, you can make them sparkle even brighter, and emit actual physical light, of the same brightness as a &1Glowstone Block&0. -botania.page.shinyFlowers1=Pretty Pretty Shiny Shiny diff --git a/src/main/resources/assets/botania/lang/en_US.lang b/src/main/resources/assets/botania/lang/en_US.lang index 131faf4c7..635eb8c94 100644 --- a/src/main/resources/assets/botania/lang/en_US.lang +++ b/src/main/resources/assets/botania/lang/en_US.lang @@ -1,9 +1,18 @@ +# Note to translators: DO NOT COPY ENTRIES FROM ENGLISH +# I repeat: do NOT copy entries from English!! +# +# Copying English entries will cause them to become outdated when this file changes +# Untranslated entries will automatically be inherited from this file. +# +# Once again, don't copy from English, and THANK YOU for your hard work! + # MISC itemGroup.Botania=Botania generator.botania-skyblock=Garden of Glass generator.botania-skyblock.info=Not recommended for botania newcomers # Something that is not localized, translators, do NOT change this line. +# You do not need to copy this into your lang file botaniamisc.noloc=botaniamisc.noloc botaniamisc.nextPage=Next Page @@ -49,9 +58,6 @@ botaniamisc.shiftToRemove=Shift-click to remove botaniamisc.clickToAdd=Add Bookmark botaniamisc.ratio=%sx Zoom (hover to zoom out) botaniamisc.bottleTooltip=It has an acquired taste -botaniamisc.coarseDirt0=Coarse Dirt, grass -botaniamisc.coarseDirt1=won't grow on it -botaniamisc.spawnerTip=Tip: Use a Spawn Egg to change the mob botaniamisc.shardLevel=Shard Power %s botaniamisc.lexiconIndex=Lexicon Index botaniamisc.hasIvy=Has Timeless Ivy @@ -60,13 +66,13 @@ botaniamisc.noLexicon=You need a Lexica Botania in-hand to read this. botaniamisc.cantOpen=It doesn't seem like your Lexica Botania has this page. Perhaps it comes from an outside source...? botaniamisc.clickToShare=Share botaniamisc.drop=Drop -botaniamisc.dropTip0=Tip: You can press %key% in your inv to drop -botaniamisc.dropTip1=CTRL-%key% will drop a full stack +botaniamisc.dropTip0=Tip: You can press %s over an item in your inv to drop +botaniamisc.dropTip1=CTRL-%s will drop a full stack botaniamisc.wandMode.bind=Bind Mode botaniamisc.wandMode.function=Function Mode botaniamisc.playVideo=Play Video botaniamisc.brewOf=Brew of %s -botaniamisc.needsCatalysts=No matter how hard you try to push the Ingot into the Beacon, nothing seems to happen, perhaps your configuration of catalyst pylons might be off. +botaniamisc.needsCatalysts=No matter how hard you try to push the Ingot into the Beacon, nothing seems to happen. Perhaps your configuration of catalyst pylons is off. botaniamisc.peacefulNoob=You try to offer the Ingot, but the peaceful vibes of your world prevent you from doing so. Perhaps you should do something about that. botaniamisc.notInfused=Not Infused botaniamisc.getALife=Get a Life @@ -84,7 +90,7 @@ botaniamisc.nearIndex1=Anything you say will be botaniamisc.nearIndex2=intercepted as a request botaniamisc.startTutorial=Start Tutorial botaniamisc.tutorialStarted=You have started your tutorial, follow the red arrows and read the contents to be guided through the basics of Botania! -botaniamisc.tutorialEnded=Your tutorial is over, you should now have a basic idea of how Botania works, make sure to read through the other pages at your leisure to learn more ways of using the mod. +botaniamisc.tutorialEnded=Your tutorial is over, you should now have a basic idea of how Botania works. Make sure to read through the other pages at your leisure to learn more ways of using the mod. botaniamisc.cosmeticBauble=&oCosmetic botaniamisc.hasCosmetic=&oHas Cosmetic Override: &r%s botaniamisc.typeToSearch=(type to search) @@ -100,12 +106,12 @@ botaniamisc.pinkinatorDesc=Apply directly to Wither botaniamisc.relicUnbound=&6Relic&7, Unbound botaniamisc.relicSoulbound=&6Relic&7, Soulbound to &f%s botaniamisc.notYourSagittarius=&4This relic is not yours -botaniamisc.diceRoll=The dice lands on a %s, you notice that it transforms into something else. -botaniamisc.dudDiceRoll=The dice lands on a %s, it seemed to vanish into thin air afterward. +botaniamisc.diceRoll=The dice lands on a %s and you notice that it transforms into something else. +botaniamisc.dudDiceRoll=The dice lands on a %s and seems to vanish into thin air. botaniamisc.blockAway=1 Block Away botaniamisc.blocksAway=%s Blocks Away -botaniamisc.clickToTeleport=Right click to Teleport -botaniamisc.clickToRemoveWarp=Shift-left click to Remove +botaniamisc.clickToTeleport=Right click to teleport +botaniamisc.clickToRemoveWarp=Shift-left click to remove botaniamisc.unboundWarp=Unbound Warp Point botaniamisc.clickToAddWarp=Right click to bind to this position botaniamisc.hasKeepIvy=Has Resolute Ivy @@ -142,7 +148,7 @@ botaniamisc.changes2=Things change, don't panic. If something seems off, read th botaniamisc.changes3=&oEveryone is afraid of change, yet change is the force that moves us forward. botaniamisc.changes4=&fShift-Left Click&7 to read the changes since then botaniamisc.changes5=&fLeft Click&7 to dismiss this -botaniamisc.badArena=As hard as you try, the Beacon will not accept your sacrifice. You believe the ritual grounds might be improper. It might be a good idea to check for obstructions on the nearby area or large gaps on the floor. +botaniamisc.badArena=As hard as you try, the Beacon will not accept your sacrifice. You believe the ritual grounds might be improper. It might be a good idea to check for obstructions in the nearby area or large gaps in the floor. botaniamisc.tutorialText=Ingame botaniamisc.tutorialVideo=Video botaniamisc.shiftToStopSpin=(SHIFT to stop animation) @@ -171,15 +177,11 @@ botania.nei.lexicaNoInfo=(there's no Extra Info for this entry, sorry!) botania.nei.quickInfo:tile.livingwood0~0=You can create Livingwood by placing Wood next to a Pure Daisy botania.nei.quickInfo:tile.livingrock0~0=You can create Livingrock by placing Stone next to a Pure Daisy -botania.nei.quickInfo:flower.daybloom=In this world, it's kill or be killed -botania.nei.quickInfo:flower.daybloomPrimus=This flower can not be harvested, but can be found rarely in the world -botania.nei.quickInfo:flower.nightshadePrimus=This flower can not be harvested, but can be found rarely in the world - botania.nei.quickInfo:item.bone~0=You're gonna have a bad time botania.nei.quickInfo:item.lexicon~0=What exactly did you expect? botania.nei.quickInfo:item.terrasteel~4=You can get Terrasteel by tossing the right materials on a Terrestrial Agglomeration Plate botania.nei.quickInfo:item.enderAirBottle~15=You can get this by right clicking with a Glass Bottle while in the End -primus + # BUILDCRAFT INTEGRATION botania.triggers.manaDetector=Mana Burst botania.triggers.manaEmpty=Mana Empty @@ -243,15 +245,15 @@ botania.wings9=Wings: The One # ARMOR SETS botania.armorset.manasteel.name=Mana Affinity -botania.armorset.manasteel.desc=10% less Mana cost on Mana Tools and Rods +botania.armorset.manasteel.desc=10%% less Mana cost on Mana Tools and Rods botania.armorset.elementium.name=Great Fairy's Blessing botania.armorset.elementium.desc=Chance for pixies to apply potion effects botania.armorset.terrasteel.name=Will of the Ancients -botania.armorset.terrasteel.desc0=20% less Mana cost on Mana Tools and Rods +botania.armorset.terrasteel.desc0=20%% less Mana cost on Mana Tools and Rods botania.armorset.terrasteel.desc1=Regen even if hunger isn't topped off botania.armorset.terrasteel.desc2=Passive Mana generation on Mana Tablets botania.armorset.manaweave.name=Manatide Prowess -botania.armorset.manaweave.desc0=35% less Mana cost on Mana Tools and Rods +botania.armorset.manaweave.desc0=35%% less Mana cost on Mana Tools and Rods botania.armorset.manaweave.desc1=Increased proficiency with Magical Rods botania.armorset.will0.desc=Critical Hits apply a strong weakness effect (Will of Ahrim) @@ -343,6 +345,7 @@ references.enabled=Enable Tooltip References shaders.enabled=Enable Shader Usage baubleRender.enabled=Enable Bauble Rendering spreader.posShift=Spreader Pos Shift +staticFloaters.enabled=Enable Static Floating Flowers versionChecking.enabled=Enable Version Checking wandBeam.static=Enable Static Wand Beam worldgen.flower.density=Worldgen Flower Density @@ -421,14 +424,14 @@ botania.versioning.startingDownload=[{"text":"Starting download of %s. Please do botania.versioning.doneDownloading=Finished downloading %s. Delete your old Botania .jar and reload your game to update. botania.versioning.downloadedAlready=You already downloaded the latest version. Close your game, delete the old version from your mods folder and load it again to update! botania.versioning.downloadingAlready=The update is already downloading, give it some time, will you? -botania.versioning.error=Woah! It seems like something went wrong while trying to download the Botania update. Is botaniamod.net down? +botania.versioning.error=Woah! It seems like something went wrong while trying to download the Botania update. Is CurseForge down? botania.versioning.disabled=Sorry. This feature is currently disabled due to server host problems, it should be back soon. # BAUBLE TOOLTIPS botania.baubletype.amulet=Equippable in the &aAmulet&7 slot botania.baubletype.ring=Equippable in the &aRing&7 slot botania.baubletype.belt=Equippable in the &aBelt&7 slot -botania.baubletooltip=Press &b%key%&7 to open the Baubles menu +botania.baubletooltip=Press &b%s&7 to open the Baubles menu # RELIC POEMS item.dice.poem0=He deals the cards to find the answer, @@ -800,19 +803,6 @@ tile.botania:dreamwood1Stairs.name=Dreamwood Plank Stairs tile.botania:dreamwood1Slab.name=Dreamwood Plank Slab tile.botania:dreamwood1SlabFull.name=Dreamwood Plank Slab tile.botania:conjurationCatalyst.name=Conjuration Catalyst -tile.botania:prismarine0.name=Prismarine -tile.botania:prismarine1.name=Prismarine Bricks -tile.botania:prismarine2.name=Dark Prismarine -tile.botania:prismarine0Stairs.name=Prismarine Stairs -tile.botania:prismarine0Slab.name=Prismarine Slab -tile.botania:prismarine0SlabFull.name=Prismarine Slab -tile.botania:prismarine1Stairs.name=Prismarine Brick Stairs -tile.botania:prismarine1Slab.name=Prismarine Brick Slab -tile.botania:prismarine1SlabFull.name=Prismarine Brick Slab -tile.botania:prismarine2Stairs.name=Dark Prismarine Stairs -tile.botania:prismarine2Slab.name=Dark Prismarine Slab -tile.botania:prismarine2SlabFull.name=Dark Prismarine Slab -tile.botania:seaLamp.name=Sea Lantern tile.botania:miniIsland0.name=Floating White Flower tile.botania:miniIsland1.name=Floating Orange Flower tile.botania:miniIsland2.name=Floating Magenta Flower @@ -831,14 +821,6 @@ tile.botania:miniIsland14.name=Floating Red Flower tile.botania:miniIsland15.name=Floating Black Flower tile.botania:tinyPotato.name=Tiny Potato tile.botania:spawnerClaw.name=Life Imbuer -tile.botania:reedBlock.name=Reed Block -tile.botania:reedBlock0Stairs.name=Reed Stairs -tile.botania:reedBlock0Slab.name=Reed Slab -tile.botania:reedBlock0SlabFull.name=Reed Slab -tile.botania:thatch.name=Thatch -tile.botania:thatch0Stairs.name=Thatch Stairs -tile.botania:thatch0Slab.name=Thatch Slab -tile.botania:thatch0SlabFull.name=Thatch Slab tile.botania:customBrick0.name=Hellish Brick tile.botania:customBrick1.name=Soul Brick tile.botania:customBrick2.name=Frosty Brick @@ -1067,46 +1049,10 @@ tile.botania:doubleFlower212.name=Tall Mystical Brown Flower tile.botania:doubleFlower213.name=Tall Mystical Green Flower tile.botania:doubleFlower214.name=Tall Mystical Red Flower tile.botania:doubleFlower215.name=Tall Mystical Black Flower -tile.botania:stone0.name=Andesite -tile.botania:stone1.name=Basalt -tile.botania:stone2.name=Diorite -tile.botania:stone3.name=Granite -tile.botania:stone4.name=Polished Andesite -tile.botania:stone5.name=Polished Basalt -tile.botania:stone6.name=Polished Diorite -tile.botania:stone7.name=Polished Granite -tile.botania:stone8.name=Andesite Bricks -tile.botania:stone9.name=Basalt Bricks -tile.botania:stone10.name=Diorite Bricks -tile.botania:stone11.name=Granite Bricks tile.botania:stone12.name=Chiseled Andesite Brick tile.botania:stone13.name=Chiseled Basalt Brick tile.botania:stone14.name=Chiseled Diorite Brick tile.botania:stone15.name=Chiseled Granite Brick -tile.botania:stone0Stairs.name=Andesite Stairs -tile.botania:stone1Stairs.name=Basalt Stairs -tile.botania:stone2Stairs.name=Diorite Stairs -tile.botania:stone3Stairs.name=Granite Stairs -tile.botania:stone8Stairs.name=Andesite Brick Stairs -tile.botania:stone9Stairs.name=Basalt Brick Stairs -tile.botania:stone10Stairs.name=Diorite Brick Stairs -tile.botania:stone11Stairs.name=Granite Brick Stairs -tile.botania:stone0Slab.name=Andesite Slab -tile.botania:stone1Slab.name=Basalt Slab -tile.botania:stone2Slab.name=Diorite Slab -tile.botania:stone3Slab.name=Granite Slab -tile.botania:stone8Slab.name=Andesite Brick Slab -tile.botania:stone9Slab.name=Basalt Brick Slab -tile.botania:stone10Slab.name=Diorite Brick Slab -tile.botania:stone11Slab.name=Granite Brick Slab -tile.botania:stone0SlabFull.name=Andesite Slab -tile.botania:stone1SlabFull.name=Basalt Slab -tile.botania:stone2SlabFull.name=Diorite Slab -tile.botania:stone3SlabFull.name=Granite Slab -tile.botania:stone8SlabFull.name=Andesite Brick Slab -tile.botania:stone9SlabFull.name=Basalt Brick Slab -tile.botania:stone10SlabFull.name=Diorite Brick Slab -tile.botania:stone11SlabFull.name=Granite Brick Slab tile.botania:blazeBlock.name=Blaze Lamp tile.botania:corporeaInterceptor.name=Corporea Interceptor tile.botania:corporeaCrystalCube.name=Corporea Crystal Cube @@ -1218,26 +1164,12 @@ tile.botania:flower.manastar.name=Manastar tile.botania:flower.manastar.reference=Wish upon a star # - GENERATING -tile.botania:flower.daybloom.name=Daybloom -tile.botania:flower.daybloom.reference=A Sting of light -tile.botania:flower.daybloomDecor.name=Daybloom Motif -tile.botania:flower.daybloomDecor.reference=A Sting of light -tile.botania:flower.daybloomPrime.name=Daybloom Primus -tile.botania:flower.daybloomPrime.reference=You should not have this on you tile.botania:flower.endoflame.name=Endoflame tile.botania:flower.endoflame.reference=Squirting Lag tile.botania:flower.hydroangeas.name=Hydroangeas tile.botania:flower.hydroangeas.reference=Just friendly crustaceans -tile.botania:flower.hydroangeasDecor.name=Hydroangeas Motif -tile.botania:flower.hydroangeasDecor.reference=Just friendly crustaceans tile.botania:flower.thermalily.name=Thermalily tile.botania:flower.thermalily.reference=A Scarlet Rose indeed -tile.botania:flower.nightshade.name=Nightshade -tile.botania:flower.nightshade.reference=Ghastly signature -tile.botania:flower.nightshadePrime.name=Nightshade Primus -tile.botania:flower.nightshadePrime.reference=You should not have this on you -tile.botania:flower.nightshadeDecor.name=Nightshade Motif -tile.botania:flower.nightshadeDecor.reference=Ghastly signature tile.botania:flower.arcanerose.name=Rosa Arcana tile.botania:flower.arcanerose.reference=Ten blue orbs in the corner tile.botania:flower.munchdew.name=Munchdew @@ -1315,7 +1247,7 @@ tile.botania:flower.medumone.reference='Twas Hades all along tile.botania:flower.marimorphosis.name=Marimorphosis tile.botania:flower.marimorphosis.reference=U-MA-RU tile.botania:flower.marimorphosisChibi.name=Marimorphosis Petite -tile.botania:flower.marimorphosisChibi.reference=U-MA-RU +tile.botania:flower.marimorphosisChibi.reference=U-MA-RU-CHAN tile.botania:flower.bubbell.name=Bubbell tile.botania:flower.bubbell.reference=And whistle tile.botania:flower.bubbellChibi.name=Bubbell Petite @@ -1324,6 +1256,8 @@ tile.botania:flower.solegnolia.name=Solegnolia tile.botania:flower.solegnolia.reference=All your magnets are belong to us tile.botania:flower.solegnoliaChibi.name=Solegnolia Petite tile.botania:flower.solegnoliaChibi.reference=All your magnets are belong to us +tile.botania:flower.bergamute.name=Bergamute +tile.botania:flower.bergamute.reference=My lips are sealed # ITEM NAMES item.botania:lexicon.name=Lexica Botania @@ -1634,7 +1568,7 @@ item.botania:terraAxe.name=Terra Truncator item.botania:manasteelNugget.name=Manasteel Nugget item.botania:terrasteelNugget.name=Terrasteel Nugget item.botania:elementiumNugget.name=Elementium Nugget -item.botania:root.name=Living Root +item.botania:livingRoot.name=Living Root item.botania:pebble.name=Pebble item.botania:waterBowl.name=Bowl of Water item.botania:obedienceStick.name=Floral Obedience Stick @@ -1975,9 +1909,9 @@ botania.entry.welcome=Welcome To Botania botania.tagline.welcome=Welcome to the Hotel Botania botania.page.welcome0=&oWelcome to Botania! I congratulate you on the fine choice of strapping a sapling and a book together, or just finding this tome in a chest. Whichever applies.
    &oYou can navigate this book using the arrows at the bottom of this page, your mouse wheel or the arrow keys in your keyboard. botania.page.welcome1=&oDespite its looks, Botania is in essence a "tech mod", by definition of requiring you to put to use ingenuity, thought and redstone to create and progress. It's good to keep that in mind.
    &oOf course you'll also be rewarded with cool toys, blocks and equipment, if you're worried. -botania.page.welcome2=&oFor all intents and purposes, Botania is a mod that anybody who likes to play the game with the primary purpose of building cool things will likely enjoy. It is designed to be fully playable standalone, but is also playable with other mods.
    &oExcluding a small few examples, everything in the mod is fully automatable using minecraft and its own features exclusively. +botania.page.welcome2=&oFor all intents and purposes, Botania is a mod for anybody who likes to play the game with the primary purpose of building cool things. It is designed to be fully playable standalone, but is also playable with other mods.
    &oExcluding a couple cases, everything in the mod is fully automatable using only Minecraft and itself. botania.page.welcome3=&oIf you happen to find yourself lost, try checking out the mod's Achievements or Challenges, both of which can be found on the left hand side of this book's main page.
    &oThe book is laid out in a friendly way with a good amount of handy features, so before you start jumping in and playing, take a bit of time to familiarize yourself with what the various tidbits around the place do. -botania.page.welcome4=&oAfter this you'll be taken to a page where you can optionally start a tutorial that will teach you the basics of the mod in around ten minutes, give or take.
    &oHowever, it teaches you only the very basics. So, after you got a good foothold on those concepts, further research is a good idea. +botania.page.welcome4=&oAfter this you'll be taken to a page where you can optionally start a tutorial that will teach you the basics of the mod in around ten minutes, give or take.
    &oHowever, it teaches you only the very basics. So, after you have a good foothold on those concepts, further research is a good idea. botania.page.welcome5=&oIf you're unsure as to what you want to learn about, hold SHIFT while browsing through the various categories to get a quick idea of what each thing is.
    &oThe "Lexicon Index" category can be very helpful for searching, as it contains every entry in the book in one place. botania.page.welcome6=&oAnd that's it for this introduction! You can move on to the tutorial now. I hope you enjoy playing with Botania as much as I enjoyed making it!
    &o~Vazkii, the mod author

    &oCarry on by pressing the "Back" button on the bottom. Your right mouse button or backspace key will have the same effect. @@ -1995,18 +1929,18 @@ botania.page.gardenOfGlass2=After spawning in the &1Garden of Glass&0 you'll fin botania.page.gardenOfGlass3=Creating &1Saplings&0 botania.page.gardenOfGlass4=Creating &1Floral Fertilizer&0 botania.page.gardenOfGlass5=Creating &1Cobblestone&0 -botania.page.gardenOfGlass6=Aside from that, some things in Botania are different to fit the Skyblock play: The &1Orechid&0 is easier to make, faster and much cheaper; The &1Cocoon of Caprice&0 and the &1Mana Spreader&0 have different recipes; the &1Blaze Lamp&0, which can be used to create &1Obsidian&0, uses powder instead of rods; melon or pumpkin seeds may drop from tall grass; floral fertilizer creates more per craft, and &1Sugar Canes&0 and &1Slimeballs&0 can be crafted. +botania.page.gardenOfGlass6=Aside from that, some things in Botania are different to fit the Skyblock play: The &1Orechid&0 is easier to make, faster, and much cheaper; The &1Cocoon of Caprice&0 and the &1Mana Spreader&0 have different recipes; the &1Blaze Lamp&0, which can be used to create &1Obsidian&0, uses powder instead of rods; melon or pumpkin seeds may drop from tall grass; floral fertilizer creates more per craft, and &1Sugar Canes&0 and &1Slimeballs&0 can be crafted. botania.page.gardenOfGlass7=Creating &1Sugar Canes&0 botania.page.gardenOfGlass8=Creating &1Slimeballs&0 botania.page.gardenOfGlass9=A problem that one might face in this world is entering the &4Nether&0. Worry not, however, as &1Blaze Lamps&0, as mentioned previously, can create &1Obsidian&0. To get these lamps, creating &1Blazes&0 using &1Fel Pumpkins&0 might be a good investment.
    Since there's no easily available &1Flint&0, opening the portal with a &1Fire Charge&0 will have to do. botania.page.gardenOfGlass11=Aside from providing light, the &1Mana Flash&0 present in the starting area allows a player who has lost their &1Lexica Botania&0 to exchange a &1Sapling&0 for it, by right clicking with the &1Sapling&0 on the &1Mana Flame&0.
    This can only be done if the player doesn't have a &1Lexica Botania&0 on them. -botania.page.gardenOfGlass12=Lastly, an &1End Portal&0 recipe +botania.page.gardenOfGlass12=Lastly, a way to finish the game # -- LEXICA BOTANIA botania.entry.lexicon=Lexica Botania botania.tagline.lexicon=What you're reading right now, dummy -botania.page.lexicon0=The &1Lexica Botania&0 is the repository of all knowledge for all botany related matters. But you probably knew that already.
    All information is stored here, as expected. For convenience, if a block happens to have an entry, it can be shift-right clicked with the &1Lexica Botania&0 to open that entry. -botania.page.lexicon3=Any entries typed in &oItalics&r are &4basic&0 entries, which contain the very basic knowledge required to play Botania. They should be prioritized over others, most of the sections contain one or more, so a good look through through them is a good idea. +botania.page.lexicon0=The &1Lexica Botania&0 is the repository of all knowledge for all botanical matters. But you probably knew that already.
    All information is stored here, as expected. For convenience, if a block happens to have an entry, it can be shift-right clicked with the &1Lexica Botania&0 to open that entry. +botania.page.lexicon3=Any entries typed in &oItalics&r are &4basic&0 entries, which contain the very basic knowledge required to play Botania and should be prioritized over others. Most of the sections contain one or more of such entries, so a good look through them is a good idea. botania.page.lexicon1=Crafting the &1Lexica Botania&0. botania.page.lexicon2=The &1Lexica Botania&0's title can also be customized. By placing it in an &1Anvil&0 and renaming it, one can not only change its cover, but also the title.
    The Edition of the lexica shown equates to the version of the &4Botania&0 you're running, and no, I don't care about the fourth wall. @@ -2015,28 +1949,30 @@ botania.entry.flowers=Mystical Flowers botania.tagline.flowers=The roots of your studies botania.page.flowers0=Around the world, you may stumble upon a large variety of Mystical Flora. Spotting these doesn't take much work as the flowers themselves emit a fair amount of shine.
    They come in a total of &416 &0different colors.
    It's also possible to grow these flowers using &1Floral Fertilizer&0 (read on). botania.page.flowers1=Flowers as far as the eye can see... -botania.page.flowers2=These flowers can be plucked for &1Mystical Petals&0, that can be used for making magical instruments and plants alike.
    Right clicking a petal on the ground will &4bury it&0, having it emit particles.
    These petals can also be crushed into &1Floral Powder&0, which functions much alike any mundane piece of dye. -botania.page.flowers3=Plucking Petals off Flowers. +botania.page.flowers2=These flowers can be plucked for &1Mystical Petals&0, which can be used for making magical instruments and plants alike.
    Right clicking a petal on the ground will &4bury it&0, having it emit particles.
    These petals can also be crushed into &1Floral Powder&0, which functions much alike any mundane piece of dye. +botania.page.flowers3=Plucking petals off flowers. botania.page.flowers4=Crafting the &1Pestle and Mortar&0. botania.page.flowers5=Grinding Petals into Powder. -botania.page.flowers6=Right clicking the &1Floral Powder&0 in any &1Wool&0 or &1Carpet&0 changes its color to the color of the powder.
    By mixing the &1Floral Powder&0 with some &1Bone Meal&0, it's possible to create a different type of fertilizer. The &1Floral Fertilizer&0 will grow a small amount of &1Mystical Flowers&0 in the nearby vicinity, if you ever run low on them. +botania.page.flowers5.5=Grinding mundane flowers into Powder. +botania.page.flowers6=Right clicking the &1Floral Powder&0 on any &1Wool&0 or &1Carpet&0 changes its color to the color of the powder.
    By mixing the &1Floral Powder&0 with some &1Bone Meal&0, it's possible to create a different type of fertilizer. The &1Floral Fertilizer&0 will grow a small amount of &1Mystical Flowers&0 in the nearby vicinity, if you ever run low on them. botania.page.flowers7=Making fertilizer (any powder colors work) botania.page.flowers8=Using typical flower substances also works botania.page.flowers10=There's also some taller variants of the typical &1Mystical Flowers&0, spread around the place. These can only be gathered with &1Shears&0, but can be used to obtain twice the amount of petals a normal flower would yield. They're a bit too big for dye, though. botania.page.flowers12=Tall flower variants can be made manually by fertilizing a &1Mystical Flower&0 or a &1Buried Petal&0 with &1Bone Meal&0.
    If you find yourself running low on a particular color, try burying a petal of that color and using &1Bone Meal&0 on it. botania.page.flowers11=Prepare for trouble botania.page.flowers9=Petals can also be made into blocks +botania.page.flowers13=And the other way around # -- PETAL APOTHECARY botania.entry.apothecary=Petal Apothecary botania.tagline.apothecary=What you use to make flowers -botania.page.apothecary0=In order for a botanist to create plantlife that can do its bidding, one would need special means of infusing plants with mystical energy.
    Luckily, the &1Petal Apothecary&0 does just that. +botania.page.apothecary0=In order for a botanist to create plantlife that can do their bidding, they would need a special means of infusing plants with mystical energy.
    Luckily, the &1Petal Apothecary&0 does just that. botania.page.apothecary1=The &1Petal Apothecary&0. -botania.page.apothecary2=This block, when placed in the world and given some water (by use of a &1Water Bucket&0), will accept any &1Mystical Petals&0 thrown at it, releasing their energies.
    Once one has set the correct petals in, throwing some &1Seeds&0 in will finalize the proccess.
    Tossing in the full bucket will also fill the recipient with water. -botania.page.apothecary3=Quite a few plants can be made using this method, for more information, read on the &4Functional Flora&0 and &4Generation Flora&0 sections of this Lexicon.
    Shift-right clicking the &1Petal Apothecary&0 with an empty hand will remove the last item thrown in. +botania.page.apothecary2=This block, when placed in the world and given some water (by use of a &1Water Bucket&0), will accept any &1Mystical Petals&0 thrown at it, releasing their energies.
    Once one has inserted the correct petals, throwing some &1Seeds&0 in will finalize the proccess.
    Tossing in a full bucket will also fill the apothecary with water. +botania.page.apothecary3=Quite a few plants can be made using this method. For more information, read on the &4Functional Flora&0 and &4Generation Flora&0 sections of this Lexicon.
    Shift-right clicking the &1Petal Apothecary&0 with an empty hand will remove the last item thrown in. botania.page.apothecary4=Instead of &1Water&0, one can place &1Lava&0 in this block, if that is done, it'll serve as a brazier and incinerator, destroying any items that come in contact.
    Furthermore, tossing in &1Vines&0 also gives the block an overgrown visual. botania.page.apothecary7=&1Comparators&0 can detect whether the block has water or not.
    Since the &1Petal Apothecary&0 can be filled by usage of a dropped &1Water Bucket&0, and &1Dispensers&0 can fill buckets, creating a system that can automatically refill the water in the dish shouldn't prove too difficult. -botania.page.apothecary6=A simple tip for those who want to squeeze the biggest efficiency out of every block is as follows, up to twenty seconds after crafting a flower in this block, right clicking it with an empty hand will pull the items from the inventory required for the recipe and put them into it for quick mass crafting. This only works if it has water. +botania.page.apothecary6=A simple tip for those who want to squeeze the biggest efficiency out of every block is as follows: Up to twenty seconds after crafting a flower, right clicking the apothecary with an empty hand will pull another set of the same ingredients out of your inventory and put them into the apothecary for quick mass crafting. This only works if the apothecary's water is refilled. botania.page.apothecary5=Crafting the &1Petal Apothecary&0. # -- PURE DAISY @@ -2045,13 +1981,13 @@ botania.tagline.pureDaisy=Creator of Livingwood and Livingrock, among others botania.page.pureDaisy0=The &1Pure Daisy&0 is not only the most basic, but also the most important flower a botanist can have.
    This flower will purify any adjacent &1Wood&0 and &1Stone&0 blocks, as seen on the next page, into their purified counterparts, &1Livingwood&0 and &1Livingrock&0, which can be used for crafting. botania.page.pureDaisy1=Just give it &4a minute&0 or so... botania.page.pureDaisy2=&1Livingwood&0 can be turned into twigs -botania.page.pureDaisy4=A few other blocks can also be purified by placing them around the flower. While not as unique and essential as the living blocks, perhaps this might come in handy. This includes &1Netherrack&0 into &1Cobblestone&0, &1Soul Sand&0 into &1Sand&0, &1Ice&0 into &1Packed Ice&0 or &1Water&0 to &1Snow&0. +botania.page.pureDaisy4=A few other blocks can also be purified by placing them around the flower. While not as unique and essential as the living blocks, perhaps this might come in handy. This includes &1Netherrack&0 into &1Cobblestone&0, &1Soul Sand&0 into &1Sand&0, &1Ice&0 into &1Packed Ice&0, and &1Water&0 into &1Snow&0. botania.page.pureDaisy3=White is bright and pure # -- WAND OF THE FOREST botania.entry.wand=Wand of the Forest botania.tagline.wand=Your essential multitool -botania.page.wand0=The general multi-use tool for a botanist is the &1Wand of the Forest&0.
    This wand, made by, effectively, strapping a pair of &1Mystical Petals&0 of any color to a few &1Livingwood Twigs&0, is required for a good amount of tasks. +botania.page.wand0=The general multi-use tool for a botanist is the &1Wand of the Forest&0.
    This wand, made by effectively strapping a pair of &1Mystical Petals&0 of any color to a few &1Livingwood Twigs&0, is required for a good amount of tasks. botania.page.wand1=The wand has two modes, &4Bind Mode&0 and &4Function Mode&0. In &4Bind Mode&0 it can be shift-right clicked on a compatible block to select it. Shift-right clicking elsewhere binds the two blocks. In &4Function Mode&0 it'll simply not do that for shift-right clicking.
    The two modes can be switched freely by shift-right clicking on air. botania.page.wand2=If the wand isn't bound to anything, shift-right clicking a block allows it to be rotated around the axis of the side it's clicked on.
    For example, clicking on the top of a &1Chest&0 rotates it around. Most blocks which can be rotated should work. botania.page.wand3=The petals used determine the colors of the wand @@ -2060,8 +1996,8 @@ botania.page.wand3=The petals used determine the colors of the wand botania.entry.runeAltar=Runic Altar botania.tagline.runeAltar=Create runes for stronger flowers and items botania.page.runeAltar21=Runic creation is a rather important complex in the advancement of the botanical magics. First and foremost, though, this type of crafting requires a decent knowledge of &4Mana Manipulation&0. Before proceeding further, a read through the important entries (those in &oItalics&r) on that section of the &1Lexica Botania&0 might prove enlightening. -botania.page.runeAltar0=&1Runes&0 are extremely important components of complex magical devices or flora.
    In order to create these, one would require a &1Runic Altar&0.
    To utilize this &1Runic Altar&0, start by placing, via either a right click or simply tossing, the components to the rune you want to create. -botania.page.runeAltar1=Proceed by pointing a &1Mana Spreader&0 to the altar so that &4Mana&0 transfer can occur.
    It should be apparent when the altar has received enough &4Mana&0. When that happens, just drop a piece of &1Livingrock&0 on top of it, or right click with it, and use the wand on it again to collect your rune. +botania.page.runeAltar0=&1Runes&0 are extremely important components of complex magical devices or flora.
    In order to create these, one requires a &1Runic Altar&0.
    To utilize this &1Runic Altar&0, start by placing, via either a right click or simply tossing, the components of the rune you want to create. +botania.page.runeAltar1=Proceed by pointing a &1Mana Spreader&0 to the altar so that &4Mana&0 transfer can occur.
    It should be apparent when the altar has received enough &4Mana&0. When that happens, just drop or right click a piece of &1Livingrock&0 on top of it, then use the wand on it again to collect your rune. botania.page.runeAltar2=Crafting the &1Runic Altar&0. botania.page.runeAltar3=A total of 16 &1Runes&0 exist.
    The most basic and elementary runes are named after the &4Four Elements&0. The intermediate runes are named after the &4Four Seasons&0, and the most advanced runes are named after the &4Seven Deadly Sins&0. A separate &1Rune of Mana&0 also exists. botania.page.runeAltar20=Sneaking and right-clicking the &1Runic Altar&0 with an empty hand while it's not accepting mana will remove the last item put into it.
    Last but not least, attaching a &1Comparator&0 to it will emit signal strength &41&0 if the altar is accepting &4Mana&0 and signal strength &42&0 if it's ready to craft the rune. @@ -2086,22 +2022,22 @@ botania.page.runeAltar19=The &1Rune of Pride&0. # -- TERRASTEEL botania.entry.terrasteel=Terrasteel botania.tagline.terrasteel=Powerful metal derived from Mana and nature -botania.page.terrasteel0=&1Terrasteel&0 is a complex magical alloy, infused with a great amount of &4Mana&0. Conjuring it proves not to be a small task. For starters, to create it, one would require a &1Terrestrial Agglomeration Plate&0, set on top of a checkerboard pattern of &1Lapis Lazuli Blocks&0 and &1Livingrock&0. &4Mana&0 would need to be provided to this block, &1Sparks&0 would be the most effective way. +botania.page.terrasteel0=&1Terrasteel&0 is a complex magical alloy, infused with a great amount of &4Mana&0. Conjuring it proves to be no small task. For starters, to create it, one requires a &1Terrestrial Agglomeration Plate&0, set on top of a checkerboard pattern of &1Lapis Lazuli Blocks&0 and &1Livingrock&0. &4Mana&0 needs to be provided to this block, with &1Sparks&0 being the most effective method. botania.page.terrasteel1=Creating the plate -botania.page.terrasteel2=After the plate is set up and ready to receive &4Mana&0, tossing a single &1Manasteel Ingot, Mana Diamond and Mana Pearl&0 on top of it will begin the infusion.
    Picking up any of the items will halt the infusion causing severe &4Mana Loss&0. The infusion uses half a &1Mana Pool&0 total to create a single piece of &4Terrasteel&0, multiple &1Sparks&0 would make it go faster, too. +botania.page.terrasteel2=After the plate is set up and ready to receive &4Mana&0, tossing a single &1Manasteel Ingot, Mana Diamond and Mana Pearl&0 on top of it will begin the infusion.
    Picking up any of the items will halt the infusion causing severe &4Mana Loss&0. The infusion uses mana equivalent to about half a &1Mana Pool&0 to create a single piece of &4Terrasteel&0; multiple &1Sparks&0 will accelerate the process as well. botania.page.terrasteel3=Creating &1Terrasteel&0 (there's &1Livingrock&0 under the plate) botania.page.terrasteel4=T.A. Plate # -- BLACK LOTUS botania.entry.blackLotus=Black Lotus botania.tagline.blackLotus=Rare loot that can make mana -botania.page.blackLotus0=An elusive flower by the name of &1Black Lotus&0 is known to exist, however, it does not grow or reproduce. Where they can be found or come from is not known.
    It is known, however, that it contains a strong amount of concentrated &4Mana&0, that can be released by putting it in contact with a &1Mana Pool&0 that already has some in it. Just tossing it would do. +botania.page.blackLotus0=An elusive flower by the name of &1Black Lotus&0 is known to exist, however, it does not grow or reproduce. Where they can be found or come from is not known.
    It is known, however, that it contains a strong amount of concentrated &4Mana&0 that can be released by putting it inside a &1Mana Pool&0 that already has mana in it. Just tossing it will do. # -- FLOWER POUCH botania.entry.flowerBag=Flower Pouch botania.tagline.flowerBag=A trusty pouch to hold your floral goodness -botania.page.flowerBag0=The laws of physics regarding one's &4Inventory&0 are somewhat skewed in this world. Thanks to that, carrying an array of different colors of flowers turns out to be a major hassle. Luckily, a &1Flower Pouch&0 takes care of all those issues. It can store up to one stack of each color of &1Mystical Flower&0, not only that but it'll passively catch any that enter the holder's inventory. -botania.page.flowerBag2=Items won't be added automatically to the pouch if that's the item being held.
    Furthermore, shift-right clicking the pouch into a &1Chest&0 or other inventory will store the flowers it contains into said inventory. +botania.page.flowerBag0=The laws of physics regarding one's &4Inventory&0 are somewhat skewed in this world. Thanks to that, carrying an array of different colors of flowers turns out to be a major hassle. Luckily, a &1Flower Pouch&0 takes care of all those issues. It can store up to one stack of each color of &1Mystical Flower&0. Not only that but it'll also passively catch any that enter the holder's inventory. +botania.page.flowerBag2=Items won't be added automatically to the pouch if the pouch is held in your dominant hand.
    Furthermore, shift-right clicking the pouch on a &1Chest&0 or other inventory will store all flowers the pouch contains into said inventory. botania.page.flowerBag1=Pull a copter out of it (any colors work) # -- WRAP @@ -2147,6 +2083,7 @@ botania.page.pool11=Infusing &1Managlass&0, clear seamless glass. botania.page.pool12=Infusing &1String&0 botania.page.pool13=Used &1Mana Infused String&0 to make &1Cobwebs&0 botania.page.pool7=A total space biscuit +botania.page.pool15=Creating &1Prismarine Shards&0 # -- SPARKS botania.entry.sparks=Sparks @@ -2491,6 +2428,12 @@ botania.tagline.solegnolia=Creates spaces where the Ring of Magnetization doesn' botania.page.solegnolia0=The &1Ring of Magnetization&0 is a rather handy tool for anyone digging or collecting. It does, however, fall into the problem that it picks up unwanted items near complex systems. The &1Solegnolia&0 disrupts the ring and prevents any items around it from being pulled towards a wearer of one, and any rings whose wearers stand inside the radius from picking items up. It does not require &4Mana&0. botania.page.solegnolia1=On/Off +# -- BERGAMUTE +botania.entry.bergamute=Bergamute +botania.tagline.bergamute=Absorbs sound +botania.page.bergamute0=Anyone that has ever taken on the role of a rancher knows the pain of the cacaphonous din that arises from their herds of animals. The &1Bergamute&0 absorbs sound energy emitted in a close radius around itself, converting it into negligible amounts of mana and emitting it into the environment. The absorption itself needs no &4mana&0 to occur. +botania.page.bergamute1=Deaf to All but the Song + # - GENERATING FLOWERS # -- AN INTRODUCTION TO GENERATION botania.entry.gIntro=An Introduction to Generation @@ -2505,25 +2448,6 @@ botania.tagline.passiveGen=It's free or it's good, pick one botania.page.passiveGen0=The spectrum of &4Generating Flowers&0 can be arranged in two groups, &4Passive&0 and &4Active&0.
    &4Passive Flowers&0 are those that simply create &4Mana&0 using a completely free resource, such as the sun, or water. &4Active Flowers&0 require some sort of resource to transform into &4Mana&0, be it renewable or not. botania.page.passiveGen1=At the start of a botanist's career, only very basic and rudimentary &4Passive Flowers&0 are available, such as the &1Daybloom&0 or &1Nightshade&0.
    These flowers are required to advance on to more potent and effective &4Active Flowers&0, but they should not be relied upon aside from being a stepping stone, as all &4Passive Flowers&0 will decay into a &1Dead Bush&0 after three days of work. -# -- PRIMUS LOCI -botania.entry.primusLoci=Primus Loci -botania.tagline.primusLoci=Rare flower patches with non-decaying flowers -botania.page.primusLoci0=Among one's travels, one might come across an unusual flower patch, with flowers resembling &1Dayblooms&0 and &1Nightshades&0.
    This is called a &4Primus Locus&0, a rare occurence in the world, where two special generating flora, the &1Daybloom Primus&0 and &1Nightshade Primus&0 can appear. -botania.page.primusLoci1=These flowers act as normal &1Dayblooms&0 or &1Nightshades&0, however, they produce mana a little bit faster and do not decay, making them a great find for a fledgling botanist to set up camp around.
    Primus flowers are incredibly fickle, and as such, attempting to move them off their natural resting place will kill them. - -# -- DAYBLOOM -botania.entry.daybloom=Daybloom -botania.tagline.daybloom=Mana from the sky -botania.page.daybloom0=The &1Daybloom&0 is the most basic and rudimentary &4Generating Flower&0. Simply put, it performs a modified photosynthesis process, in order to transform sunlight into &4Mana&0.
    The process is rather slow, but about half a dozen of these should get the job done, for now. -botania.page.daybloom1=&1Dayblooms&0 are classified as &4passive flowers&0, which means they will decay after some use.
    They also produce feeble amounts of &4Mana&0 to begin with, so perhaps hastily upgrading to &1Endoflames&0 or other &1active flowers&0, once available, might be a good idea. -botania.page.daybloom2=&oStarting up a brand new day&r. - -# -- NIGHTSHADE -botania.entry.nightshade=Nightshade -botania.tagline.nightshade=Mana from the moon -botania.page.nightshade0=The &1Nightshade&0 is the dark counterpart of the &1Daybloom&0, as it generates &4Mana&0 passively in any situation the &1Daybloom&0 can not, as long as it's nighttime.
    Alike its shining counterpart, they are classified as &4passive flowers&0, and as such will decay. -botania.page.nightshade1=&oThe shadow of the day&r. - # -- ENDOFLAME botania.entry.endoflame=Endoflame botania.tagline.endoflame=Mana from fuel @@ -3014,7 +2938,6 @@ botania.page.vineBall0=&1Ladders&0 can't stand up on their own, they require som botania.page.vineBall1=It's also possible, by combining some materials such as &1Livingwood&0 or a &1Rune of Air&0 to create a slingshot that lets these &1Vine Balls&0 be shot while completely ignoring the force of gravity. botania.page.vineBall2=This would be in Vineacraft... botania.page.vineBall3=...if that actually existed. -botania.page.vineBall4=Oh, and you can make &1Moss Stone&0 too # -- SHARD OF LAPUTA botania.entry.laputaShard=Shard of Laputa @@ -3088,7 +3011,7 @@ botania.page.clip2=Since we're dubbed by 4Kids we must make do without one # -- ROD OF THE DEPTHS botania.entry.cobbleRod=Rod of the Depths botania.tagline.cobbleRod=A rod to create cobble -botania.page.cobbleRod0=The &1Rod of the Depths&0 acts pretty much as a variant to the the &1Rod of the Lands&0. It does exactly the same thing but with &1Cobblestone&0 for a bit of a higher price.
    For the same &4Mana&0 cost, this item can provide &1Cobblestone&0 to the &1Rod of the Shifting Crust&0. +botania.page.cobbleRod0=The &1Rod of the Depths&0 acts pretty much as a variant to the &1Rod of the Lands&0. It does exactly the same thing but with &1Cobblestone&0 for a bit of a higher price.
    For the same &4Mana&0 cost, this item can provide &1Cobblestone&0 to the &1Rod of the Shifting Crust&0. botania.page.cobbleRod1=It's cobbling time # -- ROD OF THE MOLTEN CORE @@ -3277,8 +3200,8 @@ botania.page.corporea3=&1Corporea Sparks&0 have a view of the inventory directly botania.page.corporea4=It's to note that the &1Master Corporea Spark&0, while being part of the network, can not have the items in its inventory extracted from.
    Futhermore, no requests for items in the network are ever done passively. Corporea does not have the ability to add new items to the network, those should be inserted physically through &1Hoppers&0 or other methods. botania.page.corporea5=Similarly to normal &1Sparks&0, &1Corporea Sparks&0 have a method of augmentation, that being the ability to color them. While in the world, there's an icon floating around the spark that shows which color it has, this can be changed by right clicking on the spark with a piece of &1Floral Powder&0. These colors define networks. A spark may only be in the same network as another spark if the two have the same color. botania.page.corporea6=The ability to color sparks allows for multiple different &4Corporea Networks&0 to be together in a close area, without interfering with each other.
    Viewing the network and removing the spark works exactly the same as a normal spark. Lastly, having two &1Master Corporea Sparks&0 of the same color nearby, while possible, is a bad idea and will cause conflicts and odd behaviour. -botania.page.corporea7=Creating &1Corporea Sparks&0 -botania.page.corporea8=And &1Master Corporea Sparks&0 +botania.page.corporea7=A spark of ingenuity +botania.page.corporea8=Love-coloured # -- CORPOREA INDEX botania.entry.corporeaIndex=Corporea Index @@ -3297,14 +3220,14 @@ botania.page.corporeaIndex7=A certain magical one at that botania.entry.corporeaFunnel=Corporea Funnel botania.tagline.corporeaFunnel=Request items from a Corporea network via redstone botania.page.corporeaFunnel0=A simpler block that utilizes the prospects of the &4Corporea Network&0 is the &1Corporea Funnel&0, when given access to a network through a &1Corporea Spark&0 on top, it'll pull a single item from the network when given a redstone signal.
    This item is put into an inventory 1 or 2 blocks below it, or case one doesn't exist or is full, tossed into the world right above the funnel. -botania.page.corporeaFunnel1=The &1Corporea Funnel&0 may only pull items that match its filter, similarly to a &1Hopperhock&0, the filter is designated by items contained on &1Item Frames&0 placed on it. The item pulled is one of the various items in the frames at random.
    Rotating the item changes how many will be requested at once, starting at 1, rotating once, twice and three times will pull 16, 32 and 64, respectively. +botania.page.corporeaFunnel1=The &1Corporea Funnel&0 may only pull items that match its filter, similarly to a &1Hopperhock&0, the filter is designated by items contained on &1Item Frames&0 placed on it. The item pulled is one of the various items in the frames at random.
    Rotating the item changes how many will be requested at once, starting at 1, rotating will pull 2, 4, 8, 16, 32, 48, and finally 64 items, respectively. botania.page.corporeaFunnel2=Energistically applied # -- CORPOREA INTERCEPTOR botania.entry.corporeaInterceptor=Corporea Interceptor botania.tagline.corporeaInterceptor=Intercept Corporea requests and send redstone signals botania.page.corporeaInterceptor0=The &1Corporea Interceptor&0 does exactly as the name suggests, it intercepts corporea requests. First and foremost, &1Item Frames&0 with items need be attached around the block, these define what items will trigger the interceptor.
    Whenever a request is fired to the corporea network, be it from an Index, Funnel, etc, and there's no items in the network that can fulfil it this block will be triggered. -botania.page.corporeaInterceptor1=Of course, the the block is only triggered if the item requested matches one of items in the &1Item Frames&0 about it. When the block is triggered it'll emit a short redstone pulse. This can be used to do all sorts of things, such as craft the required item using &1Crafty Crates&0 or light up a lamp indicating that the inventory for a resource is out. +botania.page.corporeaInterceptor1=Of course, the block is only triggered if the item requested matches one of items in the &1Item Frames&0 about it. When the block is triggered it'll emit a short redstone pulse. This can be used to do all sorts of things, such as craft the required item using &1Crafty Crates&0 or light up a lamp indicating that the inventory for a resource is out. botania.page.corporeaInterceptor2=So many automation prospects # -- CORPOREA CRYSTAL CUBE @@ -3737,17 +3660,6 @@ botania.page.shinyFlowers3=Combining any color of &1Floating Flower&0 with any f botania.page.shinyFlowers1=Pretty Pretty Shiny Shiny botania.page.shinyFlowers2=Like Laputa but (a lot) tinier -# -- PRISMARINE -botania.entry.prismarine=Prismarine -botania.tagline.prismarine=UFO Commander, we are the future -botania.page.prismarine0=&1Prismarine&0 is an interesting component and building block. Some scholars even go as far as to say it comes from &4the future&0.
    To create it, one requires an &1Alchemy Catalyst&0. Simply tossing some &1Nether Quartz&0 into a &1Mana Pool&0 with the catalyst attached to it will get some of this material. -botania.page.prismarine1=There's various building blocks that can be created using the &1Prismarine Shards&0, to which all but the &1Sea Lantern&0 can be turned into their &1Stair&0 and &1Slab&0 variants. -botania.page.prismarine2=Creating &1Prismarine Shards&0 -botania.page.prismarine3=Crafting &1Prismarine&0 -botania.page.prismarine4=Crafting &1Prismarine Bricks&0 -botania.page.prismarine5=Crafting &1Dark Prismarine&0 -botania.page.prismarine6=Crafting the &1Sea Lantern&0 - # -- NATURAL SHEDDING botania.entry.shedding=Natural Shedding botania.tagline.shedding=Things dropping other things @@ -3802,11 +3714,14 @@ botania.page.phantomInk1=Who you gonna call? # -- STONE ALCHEMY botania.entry.stoneAlchemy=Stone Alchemy botania.tagline.stoneAlchemy=Create new stone types -botania.page.stoneAlchemy0=Using an &1Alchemy Catalyst&0 proves to be a decently functional method of generating new types of &1Stone&0. Simple deal, tossing a piece of &1Stone&0 into the catalized pool will transform it into another in a cyle.
    Similarly to &1Prismarine&0, some scholars admit that this technique came from the future. Stairs and slabs can be made from the rough and brick variants of these. +botania.page.stoneAlchemy0=Using an &1Alchemy Catalyst&0 proves to be a decently functional method of generating new types of &1Stone&0. Simple deal, tossing a piece of &1Stone&0 into the catalized pool will transform it into another in a cycle.
    Stairs and slabs can be made from the rough and brick variants of these. botania.page.stoneAlchemy1=Creating the stones -botania.page.stoneAlchemy2=Polish -botania.page.stoneAlchemy3=Brickage -botania.page.stoneAlchemy4=Chiseling +botania.page.stoneAlchemy2=Brickage +botania.page.stoneAlchemy3=Chiseling + +#botania.page.stoneAlchemy2=Polish +#botania.page.stoneAlchemy3=Brickage +#botania.page.stoneAlchemy4=Chiseling # -- BLAZE LIGHT botania.entry.blazeBlock=Blaze Light @@ -3854,10 +3769,52 @@ botania.page.bcIntegration0=Recent advances in piping technology have allowed &1 # -- BANNER ADDITIONS botania.entry.banners=Banner Additions botania.tagline.banners=Lots of new banner patterns -botania.page.banners0=In the presence of the &1Banners&0 from the future, &1Botania&0 adds &415&0 new icons to them, which can be mixed and matched with the original patterns and icons.
    The following items can be used alongside a dye in the crafting grid to add an icon to a &1Banner&0: &1All Iron Tools&0, &1Spark Augments&0, &1Raw Fish&0, &1Livingwood and Dreamwood Twigs&0, &1Lexica Botania&0, &1Terrasteel&0 and the &1Tiny Potato&0. +botania.page.banners0=&1Botania&0 adds &415&0 new icons to banners, which can be mixed and matched with the original patterns and icons.
    The following items can be used alongside a dye in the crafting grid to add an icon to a &1Banner&0: &1All Iron Tools&0, &1Spark Augments&0, &1Raw Fish&0, &1Livingwood and Dreamwood Twigs&0, &1Lexica Botania&0, &1Terrasteel&0 and the &1Tiny Potato&0. botania.page.banners1=Showcase of the various banners # -- PREVNTING DECAY botania.entry.preventingDecay=Preventing Decay botania.tagline.preventingDecay=Preventing passive flowers' decay botania.page.preventingDecay0=no + +botania.subtitle.airRod=Rod of the Skies whooshes +botania.subtitle.agricarnation=Agricarnation glimmers +botania.subtitle.altarCraft=Petal Apothecary finishes +botania.subtitle.babylonAttack=Key of King's Law unleashed +botania.subtitle.babylonSpawn=Key of King's Law activated +botania.subtitle.bellows=Manatide Bellows hisses +botania.subtitle.bifrostRod=Rod of the Bifrost hums +botania.subtitle.blackLotus=Black Lotus dissolves +botania.subtitle.dash=Player dashes forward +botania.subtitle.ding=Wand of the Forest dings +botania.subtitle.divaCharm=Charm of the Diva echoes +botania.subtitle.divinationRod=Rod of the Plentiful Mantle hums +botania.subtitle.doit=DO IT!! +botania.subtitle.enchanterForm=Mana Enchanter forms +botania.subtitle.enchanterFade=Mana Enchanter fades +botania.subtitle.enchanterEnchant=Mana Enchanter finishes +botania.subtitle.endoflame=Endoflame ignites item +botania.subtitle.equipBauble=Bauble is equipped +botania.subtitle.gaiaTrap=Gaia Guardian's spell swooshes +botania.subtitle.goldenLaurel=Golden Laurel restores your life +botania.subtitle.holyCloak=Cloak of Virtue activates +botania.subtitle.laputaStart=Laputa Shard triggers +botania.subtitle.lexiconOpen=Lexica Botania opens +botania.subtitle.lexiconPage=Lexica Botania page turns +botania.subtitle.lightRelay=Luminizer whooshes +botania.subtitle.manaBlaster=Mana Blaster fires +botania.subtitle.manaPoolCraft=Mana Pool infuses +botania.subtitle.missile=Magic Missile is fired +botania.subtitle.orechid=Stone transforms into ore +botania.subtitle.potionCreate=Brewery finishes +botania.subtitle.runeAltarCraft=Runic Altar finishes +botania.subtitle.runeAltarStart=Runic Altar starts +botania.subtitle.spreaderFire=Spreader shoots mana +botania.subtitle.starcaller=Stars descend from the sky +botania.subtitle.terraBlade=Terrasteel Sword actives +botania.subtitle.terraformRod=Land is terrraformed +botania.subtitle.terraPickMode=Terrasteel Pick powers up +botania.subtitle.terrasteelCraft=Terrasteel finishes +botania.subtitle.thermalily=Thermalily consumes lava +botania.subtitle.unholyCloak=Cloak of Sin activates +botania.subtitle.way=And his name is.... JOHN CENA!!! diff --git a/src/main/resources/assets/botania/lang/es_AR.lang b/src/main/resources/assets/botania/lang/es_AR.lang index 4e97d32bb..bab3bc81f 100644 --- a/src/main/resources/assets/botania/lang/es_AR.lang +++ b/src/main/resources/assets/botania/lang/es_AR.lang @@ -1,3 +1,11 @@ +# Note to translators: DO NOT COPY ENTRIES FROM ENGLISH +# I repeat: do NOT copy entries from English!! +# Any entry in this lang file should be in es_AR, or *should not be here at all* +# Copying English entries will cause them to become outdated when the main English lang file changes +# Untranslated entries will automatically be inherited from en_US +# +# Once again, don't copy from English, and THANK YOU for your hard work! + # MISC itemGroup.Botania=Botania botaniamisc.nextPage=Página Siguiente @@ -43,12 +51,8 @@ botaniamisc.shiftToRemove=Shift + click para quitar botaniamisc.clickToAdd=Click para añadir un señalador aquí botaniamisc.ratio=%s:1 Ratio botaniamisc.bottleTooltip=Ha adquirido gusto -botaniamisc.coarseDirt0=Coarse Dirt, grass -botaniamisc.coarseDirt1=won't grow on it -botaniamisc.spawnerTip=Tip: Usa un huevo de spawn para cambiar el mob botaniamisc.shardLevel=Shard Power %s botaniamisc.lexiconIndex=Índice del Lexicon -botaniamisc.hasIvy=Has Timeless Ivy # COLORS botania.color0=Blanco @@ -69,14 +73,6 @@ botania.color14=Rojo botania.color15=Negro botania.color16=Arco Iris -# RANKS -botania.rank0=&cD -botania.rank1=&eC -botania.rank2=&bB -botania.rank3=&aA -botania.rank4=&dS -botania.rank5=&6SS - # WINGS botania.wings0=No Wings botania.wings1=Wings: Flügel @@ -87,68 +83,15 @@ botania.wings5=Wings: Princesa de la Nieve Negra botania.wings6=Wings: Amo del Pozo botania.wings7=Wings: Sylph -# ROMAN NUMERALS -botania.roman1=I -botania.roman2=II -botania.roman3=III -botania.roman4=IV -botania.roman5=V -botania.roman6=VI -botania.roman7=VII -botania.roman8=VIII -botania.roman9=IX -botania.roman10=X -botania.roman11=XI -botania.roman12=XII -botania.roman13=XIII -botania.roman14=XIV -botania.roman15=XV -botania.roman16=XVI -botania.roman17=XVII -botania.roman18=XVIII -botania.roman19=XIX -botania.roman20=XX - # KNOWLEDGE botania.knowledge.minecraft=Conocimiento Minecraftiano botania.knowledge.alfheim=Conocimiento &aÉlfico&7 # CONFIGURATION blockBreakingParticles.enabled=Partículas al Romper Bloques -blockBreakingParticlesTool.enabled=Tool Block Break Particles -boundBlock.wireframe.enabled=Bound Block Wireframe -darkQuartz.enabled=Enable Smokey Quatrz -fallenKanade.enabled=Enable Fallen Kanade -manaEnchanter.enabled=Enable Mana Enchanter -flower.forceCheck=Flower Force Checking -enderPickpocket.enabled=Enable Ender Pickpocketting -thermalily.obsidian=Thermalily Needs Obsidian -passiveWither.time=Passive Wither Time -flowerParticles.frequency=Flower Particle Frequency -lexicon.enable.rotatingItems=Lexicon Rotating Items -lexicon.render.3D=3D Lexicon Render -powerSystem.subtle=Use Subtle Power System -pylonModel.old=Use Old Pylon Model -elfPortal.particles.enabled=Enable Portal Particles -chargeAnimation.enabled=Charging Animation Enabled -vanillaParticleConfig.enabled=Use Vanilla Particle Config -flowerTextures.alt=Alternate Flower Textures -matrixMode.enabled=Enable Matrix Mode -references.enabled=Enable Tooltip References -shaders.enabled=Enable Shader Usage -spreader.posShift=Spreader Pos Shift versionChecking.enabled=Permitir comprobar la versión -wandBeam.static=Enable Static Wand Beam worldgen.flower.density=Densidad de las Flores al Generar el Mundo worldgen.flower.quantity=Cantidad de Flores al Generar el Mundo -shedRate.chicken=Shed Rate: Chicken -shedRate.squid=Shed Rate: Squid -shedRate.villager=Shed Rate: Villager -shedRate.spider=Shed Rate: Spider -shedRate.blaze=Shed Rate: Blaze -shedRate.ghast=Shed Rate: Ghast -shedRate.skeleton=Shed Rate: Skeleton -shedRate.slime=Shed Rate: Slime # VERSION CHECKING botania.versioning.flavour0=NANI SORE!? BOTANIA ESTÁ DESACTUALIZADO!? @@ -188,7 +131,7 @@ botania.versioning.flavour33=Antes de actualizar tu versión de Botania, te gust botania.versioning.flavour34=De vuelta en la rutina de actualización de Botania. No se necesita diversión. #angbadang botania.versioning.flavour35=Te convertirías en una Niña Mágica a cambio de una actualización de Botania? botania.versioning.outdated=Estás jugando con la versión %s de Botania, la última versión es la %s. -botania.versioning.updateMessage=["Click for... [",{"text":"Download","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Haz click aquí para descargar la última versión de Botania","color":"green"}},"clickEvent":{"action":"run_command","value":"/botania-download-latest %version%"}},"] [",{"text":"Website","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Click this to go to the mod's website","color":"green"}},"clickEvent":{"action":"open_url","value":"http://vazkii.us/mod/Botania/downloads.php"}},"] [",{"text":"Changelog","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Click this to go to the version's Changelog","color":"green"}},"clickEvent":{"action":"open_url","value":"http://vazkii.us/mod/Botania/changelog.php#%version%"}},"]"] +botania.versioning.updateMessage=["Click for... [",{"text":"Download","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Haz click aquí para descargar la última versión de Botania","color":"green"}},"clickEvent":{"action":"open_url","value":"http://minecraft.curseforge.com/projects/botania-unofficial/files/latest"}},"] [",{"text":"Website","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Click this to go to the mod's website","color":"green"}},"clickEvent":{"action":"open_url","value":"http://minecraft.curseforge.com/projects/botania-unofficial"}},"] [",{"text":"Changelog","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Click this to go to the version's Changelog","color":"green"}},"clickEvent":{"action":"open_url","value":"https://github.com/williewillus/Botania/releases/tag/%s"}},"]"] botania.versioning.startingDownload=[{"text":"Comenzando la descarga de la versión %s. Por favor no quites tu disco duro. Te gusta ","color":"aqua"},{"text":"Botania","color":"green"},{"text":"? Quizás puedes apoyar a ","color":"aqua"},{"text":"Vazkii","color":"light_purple"},{"text":" en [","color":"aqua"},{"text":"Patreon","color":"gold","hoverEvent":{"action":"show_text","value":{"text":"Click this to go to Vazkii's Patreon","color":"light_purple"}},"clickEvent":{"action":"open_url","value":"http://www.patreon.com/Vazkii"}},{"text":"]!","color":"aqua"}] botania.versioning.doneDownloading=Descarga de %s completada. Borra el antiguo arhivo .jar de Botania y vuelve a cargar tu juego para que la actualización se efectúe.. botania.versioning.downloadedAlready=Ya descargaste la última versión. Cierra tu juego, borra la versión anterior de la carpeta "mods" y vuelve a iniciar Minecraft ara efectuar la actualización. @@ -200,16 +143,7 @@ botania.versioning.disabled= Lo lamentamos, esta función está desactivada por botania.baubletype.amulet=Equipable en el slot para &aAmuletos&7 botania.baubletype.ring=Equipable en el slot para &aAnillos&7 botania.baubletype.belt=Equipable en el slot para &acinturón&7 -botania.baubletooltip=Oprime la &b%key%&7 para abrir el menú de Baubles - -# ENTITY NAMES -entity.Botania.botania:manaBurst.name=Mana Burst -entity.Botania.botania:signalFlare.name=Signal Flare -entity.Botania.botania:pixie.name=Pixie -entity.Botania.botania:flameRing.name=Flame Ring -entity.Botania.botania:vineBall.name=Vine Ball -entity.Botania.botania:doppleganger.name=Guardian of Gaia -entity.Botania.botania:magicLandmine.name=Gaia Trap +botania.baubletooltip=Oprime la &b%s&7 para abrir el menú de Baubles # BLOCK NAMES tile.botania:flower0.name=Flor Mística Blanca @@ -291,1364 +225,6 @@ tile.botania:enchanter.name=Encantador de Maná tile.botania:turntable.name=Spreader Turntable tile.botania:tinyPlanetBlock.name=Planeta Diminuto tile.botania:alchemyCatalyst.name=Catalizador Alquímico -tile.botania:openCrate0.name=Open Crate -tile.botania:openCrate1.name=Crafty Crate -tile.botania:forestEye.name=Eye of the Ancients tile.botania:storage0.name=Bloque de Acero de Maná tile.botania:storage1.name=Bloque de Acero de la Tierra -tile.botania:storage2.name=Bloque de Elementium -tile.botania:forestDrum0.name=Drum of the Wild -tile.botania:forestDrum1.name=Drum of the Gathering -tile.botania:shinyFlower0.name=Glimmering White Flower -tile.botania:shinyFlower1.name=Glimmering Orange Flower -tile.botania:shinyFlower2.name=Glimmering Magenta Flower -tile.botania:shinyFlower3.name=Glimmering Light Blue Flower -tile.botania:shinyFlower4.name=Glimmering Yellow Flower -tile.botania:shinyFlower5.name=Glimmering Lime Flower -tile.botania:shinyFlower6.name=Glimmering Pink Flower -tile.botania:shinyFlower7.name=Glimmering Gray Flower -tile.botania:shinyFlower8.name=Glimmering Light Gray Flower -tile.botania:shinyFlower9.name=Glimmering Cyan Flower -tile.botania:shinyFlower10.name=Glimmering Purple Flower -tile.botania:shinyFlower11.name=Glimmering Blue Flower -tile.botania:shinyFlower12.name=Glimmering Brown Flower -tile.botania:shinyFlower13.name=Glimmering Green Flower -tile.botania:shinyFlower14.name=Glimmering Red Flower -tile.botania:shinyFlower15.name=Glimmering Black Flower -tile.botania:platform0.name=Abstruse Platform -tile.botania:platform1.name=Spectral Platform -tile.botania:platform2.name=Infrangible Platform -tile.botania:alfheimPortal.name=Elven Gateway Core -tile.botania:blockDarkQuartz.name=Block of Smokey Quartz -tile.botania:chiseledDarkQuartz.name=Chiseled Smokey Quartz Block -tile.botania:pillarDarkQuartz.name=Pillar Smokey Quartz Block -tile.botania:quartzSlabDarkHalf.name=Smokey Quartz Slab -tile.botania:quartzStairsDark.name=Smokey Quartz Stairs -tile.botania:blockManaQuartz.name=Block of Mana Quartz -tile.botania:chiseledManaQuartz.name=Chiseled Mana Quartz Block -tile.botania:pillarManaQuartz.name=Pillar Mana Quartz Block -tile.botania:quartzSlabManaHalf.name=Mana Quartz Slab -tile.botania:quartzStairsMana.name=Mana Quartz Stairs -tile.botania:blockBlazeQuartz.name=Block of Blaze Quartz -tile.botania:chiseledBlazeQuartz.name=Chiseled Blaze Quartz Block -tile.botania:pillarBlazeQuartz.name=Pillar Blaze Quartz Block -tile.botania:quartzSlabBlazeHalf.name=Blaze Quartz Slab -tile.botania:quartzStairsBlaze.name=Blaze Quartz Stairs -tile.botania:blockLavenderQuartz.name=Block of Lavender Quartz -tile.botania:chiseledLavenderQuartz.name=Chiseled Lavender Quartz Block -tile.botania:pillarLavenderQuartz.name=Pillar Lavender Quartz Block -tile.botania:quartzSlabLavenderHalf.name=Lavender Quartz Slab -tile.botania:quartzStairsLavender.name=Lavender Quartz Stairs -tile.botania:blockRedQuartz.name=Block of Redquartz -tile.botania:chiseledRedQuartz.name=Chiseled Redquartz Block -tile.botania:pillarRedQuartz.name=Pillar Redquartz Block -tile.botania:quartzSlabRedHalf.name=Redquartz Slab -tile.botania:quartzStairsRed.name=Redquartz Stairs -tile.botania:blockElfQuartz.name=Block of Elven Quartz -tile.botania:chiseledElfQuartz.name=Chiseled Elven Quartz Block -tile.botania:pillarElfQuartz.name=Pillar Elven Quartz Block -tile.botania:quartzSlabElfHalf.name=Elven Quartz Slab -tile.botania:quartzStairsElf.name=Elven Quartz Stairs -tile.botania:dreamwood0.name=Dreamwood -tile.botania:dreamwood1.name=Dreamwood Planks -tile.botania:dreamwood2.name=Mossy Dreamwood Planks -tile.botania:dreamwood3.name=Framed Dreamwood -tile.botania:dreamwood4.name=Pattern Framed Dreamwood -tile.botania:dreamwood5.name=Glimmering Dreamwood -tile.botania:livingwood0Stairs.name=Livingwood Stairs -tile.botania:livingwood0Slab.name=Livingwood Slab -tile.botania:livingwood1Stairs.name=Livingwood Plank Stairs -tile.botania:livingwood1Slab.name=Livingwood Plank Slab -tile.botania:livingrock0Stairs.name=Livingrock Stairs -tile.botania:livingrock0Slab.name=Livingrock Slab -tile.botania:livingrock1Stairs.name=Livingrock Brick Stairs -tile.botania:livingrock1Slab.name=Livingrock Brick Slab -tile.botania:dreamwood0Stairs.name=Dreamwood Stairs -tile.botania:dreamwood0Slab.name=Dreamwood Slab -tile.botania:dreamwood1Stairs.name=Dreamwood Plank Stairs -tile.botania:dreamwood1Slab.name=Dreamwood Plank Slab -tile.botania:conjurationCatalyst.name=Conjuration Catalyst -tile.botania:prismarine0.name=Prismarine -tile.botania:prismarine1.name=Prismarine Bricks -tile.botania:prismarine2.name=Dark Prismarine -tile.botania:prismarine0Stairs.name=Prismarine Stairs -tile.botania:prismarine0Slab.name=Prismarine Slab -tile.botania:prismarine1Stairs.name=Prismarine Brick Stairs -tile.botania:prismarine1Slab.name=Prismarine Brick Slab -tile.botania:prismarine2Stairs.name=Dark Prismarine Stairs -tile.botania:prismarine2Slab.name=Dark Prismarine Slab -tile.botania:seaLamp.name=Sea Lantern -tile.botania:miniIsland0.name=Floating White Flower -tile.botania:miniIsland1.name=Floating Orange Flower -tile.botania:miniIsland2.name=Floating Magenta Flower -tile.botania:miniIsland3.name=Floating Light Blue Flower -tile.botania:miniIsland4.name=Floating Yellow Flower -tile.botania:miniIsland5.name=Floating Lime Flower -tile.botania:miniIsland6.name=Floating Pink Flower -tile.botania:miniIsland7.name=Floating Gray Flower -tile.botania:miniIsland8.name=Floating Light Gray Flower -tile.botania:miniIsland9.name=Floating Cyan Flower -tile.botania:miniIsland10.name=Floating Purple Flower -tile.botania:miniIsland11.name=Floating Blue Flower -tile.botania:miniIsland12.name=Floating Brown Flower -tile.botania:miniIsland13.name=Floating Green Flower -tile.botania:miniIsland14.name=Floating Red Flower -tile.botania:miniIsland15.name=Floating Black Flower -tile.botania:tinyPotato.name=Tiny Potato -tile.botania:spawnerClaw.name=Life Imbuer -tile.botania:reedBlock.name=Reed Block -tile.botania:reedBlock0Stairs.name=Reed Stairs -tile.botania:reedBlock0Slab.name=Reed Slab -tile.botania:thatch.name=Thatch -tile.botania:thatch0Stairs.name=Thatch Stairs -tile.botania:thatch0Slab.name=Thatch Slab -tile.botania:customBrick0.name=Hellish Brick -tile.botania:customBrick1.name=Soul Brick -tile.botania:customBrick2.name=Frosty Brick -tile.botania:customBrick3.name=Roof Tile -tile.botania:customBrick0Stairs.name=Hellish Brick Stairs -tile.botania:customBrick1Stairs.name=Soul Brick Stairs -tile.botania:customBrick2Stairs.name=Frosty Brick Stairs -tile.botania:customBrick3Stairs.name=Roof Tile Stairs -tile.botania:customBrick0Slab.name=Hellish Brick Slab -tile.botania:customBrick1Slab.name=Soul Brick Slab -tile.botania:customBrick2Slab.name=Frosty Brick Slab -tile.botania:customBrick3Slab.name=Roof Tile Slab -tile.botania:customBrick4.name=Azulejo -tile.botania:customBrick5.name=Azulejo -tile.botania:customBrick6.name=Azulejo -tile.botania:customBrick7.name=Azulejo -tile.botania:customBrick8.name=Azulejo -tile.botania:customBrick9.name=Azulejo -tile.botania:customBrick10.name=Azulejo -tile.botania:customBrick11.name=Azulejo -tile.botania:customBrick12.name=Azulejo -tile.botania:customBrick13.name=Azulejo -tile.botania:customBrick14.name=Azulejo -tile.botania:customBrick15.name=Azulejo -tile.botania:enderEyeBlock.name=Ender Overseer -tile.botania:starfield.name=Starfield Creator -tile.botania:rfGenerator.name=Mana Fluxfield -tile.botania:elfGlass.name=Alfglass - -# FLOWER NAMES -tile.botania:flower..name=Botania Flower -# ^ This is the placeholder name for when no flower type is detected -# The two dots are not a typo -tile.botania:flower..reference=If you have this, it means something went wrong, you should report it - -tile.botania:flower.puredaisy.name=Pure Daisy -tile.botania:flower.puredaisy.reference=What color do you want to be? -tile.botania:flower.manastar.name=Manastar -tile.botania:flower.manastar.reference=Wish upon a star - -# - GENERATING -tile.botania:flower.daybloom.name=Daybloom -tile.botania:flower.daybloom.reference=A Sting of light -tile.botania:flower.endoflame.name=Endoflame -tile.botania:flower.endoflame.reference=A flame like Shana -tile.botania:flower.hydroangeas.name=Hydroangeas -tile.botania:flower.hydroangeas.reference=Just friendly crustaceans -tile.botania:flower.thermalily.name=Thermalily -tile.botania:flower.thermalily.reference=A Scarlet Rose indeed -tile.botania:flower.nightshade.name=Nightshade -tile.botania:flower.nightshade.reference=Ghastly signature -tile.botania:flower.arcanerose.name=Rosa Arcana -tile.botania:flower.arcanerose.reference=Ten blue orbs in the corner -tile.botania:flower.munchdew.name=Munchdew -tile.botania:flower.munchdew.reference=Nommy nommy the art teacher -tile.botania:flower.entropinnyum.name=Entropinnyum -tile.botania:flower.entropinnyum.reference=Magical girls are an option -tile.botania:flower.kekimurus.name=Kekimurus -tile.botania:flower.kekimurus.reference=This flower is a lie -tile.botania:flower.gourmaryllis.name=Gourmaryllis -tile.botania:flower.gourmaryllis.reference=Fuyukai Desu - -# - FUNCTIONAL -tile.botania:flower.bellethorn.name=Bellethorne -tile.botania:flower.bellethorn.reference=killy killy JOKER -tile.botania:flower.dreadthorn.name=Dreadthorne -tile.botania:flower.dreadthorn.reference=Plan C -tile.botania:flower.heiseiDream.name=Heisei Dream -tile.botania:flower.heiseiDream.reference=Heisei heisei kowarete -tile.botania:flower.tigerseye.name=Tigerseye -tile.botania:flower.tigerseye.reference=The palmtop tiger -tile.botania:flower.jadedAmaranthus.name=Jaded Amaranthus -tile.botania:flower.jadedAmaranthus.reference=A couple died for this -tile.botania:flower.orechid.name=Orechid -tile.botania:flower.orechid.reference=I seed what you did there -tile.botania:flower.fallenKanade.name=Fallen Kanade -tile.botania:flower.fallenKanade.reference=I'm not an Angel -tile.botania:flower.exoflame.name=Exoflame -tile.botania:flower.exoflame.reference=Wearing her black ribbons -tile.botania:flower.agricarnation.name=Agricarnation -tile.botania:flower.agricarnation.reference=Wear on the 25th of april -tile.botania:flower.hopperhock.name=Hopperhock -tile.botania:flower.hopperhock.reference=It all funnels into it -tile.botania:flower.tangleberrie.name=Tangleberrie -tile.botania:flower.tangleberrie.reference=No frying pans allowed -tile.botania:flower.jiyuulia.name=Jiyuulia -tile.botania:flower.jiyuulia.reference=Flügel der Freiheit -tile.botania:flower.rannuncarpus.name=Rannuncarpus -tile.botania:flower.rannuncarpus.reference=That's handy -tile.botania:flower.hyacidus.name=Hyacidus -tile.botania:flower.hyacidus.reference=If you don't walk, it doesn't hurt -tile.botania:flower.pollidisiac.name=Pollidisiac -tile.botania:flower.pollidisiac.reference=Birds and bees -tile.botania:flower.clayconia.name=Clayconia -tile.botania:flower.clayconia.reference=Rupees not included -tile.botania:flower.loonium.name=Loonium -tile.botania:flower.loonium.reference=Hold it up above your head -tile.botania:flower.daffomill.name=Daffomill -tile.botania:flower.daffomill.reference=Cook's Assistant -tile.botania:flower.vinculotus.name=Vinculotus -tile.botania:flower.vinculotus.reference=Totally an Extra Utils ripoff - -# ITEM NAMES -item.botania:lexicon.name=Lexica Botania -item.botania:lexicon.bevo=Lexica Botana -item.botania:lexicon.saice=Lexica Botonia -item.botania:petal0.name=Mystical White Petal -item.botania:petal1.name=Mystical Orange Petal -item.botania:petal2.name=Mystical Magenta Petal -item.botania:petal3.name=Mystical Light Blue Petal -item.botania:petal4.name=Mystical Yellow Petal -item.botania:petal5.name=Mystical Lime Petal -item.botania:petal6.name=Mystical Pink Petal -item.botania:petal7.name=Mystical Gray Petal -item.botania:petal8.name=Mystical Light Gray Petal -item.botania:petal9.name=Mystical Cyan Petal -item.botania:petal10.name=Mystical Purple Petal -item.botania:petal11.name=Mystical Blue Petal -item.botania:petal12.name=Mystical Brown Petal -item.botania:petal13.name=Mystical Green Petal -item.botania:petal14.name=Mystical Red Petal -item.botania:petal15.name=Mystical Black Petal -item.botania:dye0.name=Floral White Powder -item.botania:dye1.name=Floral Orange Powder -item.botania:dye2.name=Floral Magenta Powder -item.botania:dye3.name=Floral Light Blue Powder -item.botania:dye4.name=Floral Yellow Powder -item.botania:dye5.name=Floral Lime Powder -item.botania:dye6.name=Floral Pink Powder -item.botania:dye7.name=Floral Gray Powder -item.botania:dye8.name=Floral Light Gray Powder -item.botania:dye9.name=Floral Cyan Powder -item.botania:dye10.name=Floral Purple Powder -item.botania:dye11.name=Floral Blue Powder -item.botania:dye12.name=Floral Brown Powder -item.botania:dye13.name=Floral Green Powder -item.botania:dye14.name=Floral Red Powder -item.botania:dye15.name=Floral Black Powder -item.botania:pestleAndMortar.name=Pestle and Mortar -item.botania:twigWand.name=Wand of the Forest -item.botania:manasteel.name=Manasteel Ingot -item.botania:manaPearl.name=Mana Pearl -item.botania:manaDiamond.name=Mana Diamond -item.botania:lensNormal.name=Mana Lens -item.botania:lensSpeed.name=Mana Lens: Velocity -item.botania:lensSpeed.short=Velocity -item.botania:lensPower.name=Mana Lens: Potency -item.botania:lensPower.short=Potency -item.botania:lensTime.name=Mana Lens: Resistance -item.botania:lensTime.short=Resistance -item.botania:lensEfficiency.name=Mana Lens: Efficiency -item.botania:lensEfficiency.short=Efficiency -item.botania:lensBounce.name=Mana Lens: Bounce -item.botania:lensBounce.short=Bounce -item.botania:lensGravity.name=Mana Lens: Gravity -item.botania:lensGravity.short=Gravity -item.botania:lensMine.name=Mana Lens: Bore -item.botania:lensMine.short=Bore -item.botania:lensDamage.name=Mana Lens: Damaging -item.botania:lensDamage.short=Damaging -item.botania:lensPhantom.name=Mana Lens: Phantom -item.botania:lensPhantom.short=Phantom -item.botania:lensMagnet.name=Mana Lens: Magnetizing -item.botania:lensMagnet.short=Magnetizing -item.botania:lensExplosive.name=Mana Lens: Entropic -item.botania:lensExplosive.short=Entropic -item.botania:lensInfluence.name=Mana Lens: Influence -item.botania:lensInfluence.short=Influence -item.botania:lensWeight.name=Mana Lens: Weight -item.botania:lensWeight.short=Weight -item.botania:lensPaint.name=Mana Lens: Paintslinger -item.botania:lensPaint.short=Paintslinger -item.botania:lensFire.name=Mana Lens: Kindle -item.botania:lensFire.short=Kindle -item.botania:lensPiston.name=Mana Lens: Force -item.botania:lensPiston.short=Force -item.botania:manaPetal0.name=White Mana Petal -item.botania:manaPetal1.name=Orange Mana Petal -item.botania:manaPetal2.name=Magenta Mana Petal -item.botania:manaPetal3.name=Light Blue Mana Petal -item.botania:manaPetal4.name=Yellow Mana Petal -item.botania:manaPetal5.name=Lime Mana Petal -item.botania:manaPetal6.name=Pink Mana Petal -item.botania:manaPetal7.name=Gray Mana Petal -item.botania:manaPetal8.name=Light Gray Mana Petal -item.botania:manaPetal9.name=Cyan Mana Petal -item.botania:manaPetal10.name=Purple Mana Petal -item.botania:manaPetal11.name=Blue Mana Petal -item.botania:manaPetal12.name=Brown Mana Petal -item.botania:manaPetal13.name=Green Mana Petal -item.botania:manaPetal14.name=Red Mana Petal -item.botania:manaPetal15.name=Black Mana Petal -item.botania:rune0.name=Rune of Water -item.botania:rune1.name=Rune of Fire -item.botania:rune2.name=Rune of Earth -item.botania:rune3.name=Rune of Air -item.botania:rune4.name=Rune of Spring -item.botania:rune5.name=Rune of Summer -item.botania:rune6.name=Rune of Autumn -item.botania:rune7.name=Rune of Winter -item.botania:rune8.name=Rune of Mana -item.botania:rune9.name=Rune of Lust -item.botania:rune10.name=Rune of Gluttony -item.botania:rune11.name=Rune of Greed -item.botania:rune12.name=Rune of Sloth -item.botania:rune13.name=Rune of Wrath -item.botania:rune14.name=Rune of Envy -item.botania:rune15.name=Rune of Pride -item.botania:signalFlare.name=Signal Flare -item.botania:manaTablet.name=Mana Tablet -item.botania:manaGun.name=Mana Blaster -item.botania:compositeLens.name=Composite Mana Lens: %s %s -item.botania:manaCookie.name=Mana Cookie -item.botania:fertilizer.name=Floral Fertilizer -item.botania:grassSeeds0.name=Pasture Seeds -item.botania:grassSeeds1.name=Boreal Seeds -item.botania:grassSeeds2.name=Infestation Spores -item.botania:livingwoodTwig.name=Livingwood Twig -item.botania:dirtRod.name=Rod of the Lands -item.botania:terraformRod.name=Terra Firma Rod -item.botania:manaMirror.name=Mana Mirror -item.botania:manasteelHelm.name=Manasteel Helmet -item.botania:manasteelChest.name=Manasteel Chestplate -item.botania:manasteelLegs.name=Manasteel Leggings -item.botania:manasteelBoots.name=Manasteel Boots -item.botania:manasteelPick.name=Manasteel Pickaxe -item.botania:manasteelShovel.name=Manasteel Shovel -item.botania:manasteelAxe.name=Manasteel Axe -item.botania:manasteelSword.name=Manasteel Sword -item.botania:manasteelShears.name=Manasteel Shears -item.botania:grassHorn0.name=Horn of the Wild -item.botania:grassHorn1.name=Horn of the Canopy -item.botania:terrasteel.name=Terrasteel Ingot -item.botania:terrasteelHelm.name=Terrasteel Helmet -item.botania:terrasteelChest.name=Terrasteel Chestplate -item.botania:terrasteelLegs.name=Terrasteel Leggings -item.botania:terrasteelBoots.name=Terrasteel Boots -item.botania:terraSword.name=Terra Blade -item.botania:tinyPlanet.name=Tiny Planet -item.botania:manaRing.name=Band of Mana -item.botania:auraRing.name=Band of Aura -item.botania:manaRingGreater.name=Greater Band of Mana -item.botania:auraRingGreater.name=Greater Band of Aura -item.botania:travelBelt.name=Soujourner's Sash -item.botania:knockbackBelt.name=Tectonic Girdle -item.botania:icePendant.name=Snowflake Pendant -item.botania:lavaPendant.name=Pyroclast Pendant -item.botania:lifeEssence.name=Gaia Spirit -item.botania:goldenLaurel.name=Golden Laurel Crown -item.botania:redstoneRoot.name=Redstone Root -item.botania:magnetRing.name=Ring of Magnetization -item.botania:waterRing.name=Ring of Chordata -item.botania:miningRing.name=Ring of the Mantle -item.botania:reachRing.name=Ring of Far Reach -item.botania:terraPick.name=Terra Shatterer -item.botania:divaCharm.name=Charm of the Diva -item.botania:flightTiara.name=Flügel Tiara -item.botania:enderDagger.name=Soulscribe -item.botania:quartz0.name=Smokey Quartz -item.botania:quartz1.name=Mana Quartz -item.botania:quartz2.name=Blaze Quartz -item.botania:quartz3.name=Lavender Quartz -item.botania:quartz4.name=Redquartz -item.botania:quartz5.name=Elven Quartz -item.botania:elementium.name=Elementium Ingot -item.botania:pixieDust.name=Pixie Dust -item.botania:dragonstone.name=Dragonstone -item.botania:waterRod.name=Rod of the Seas -item.botania:elementiumHelm.name=Elementium Helmet -item.botania:elementiumChest.name=Elementium Chestplate -item.botania:elementiumLegs.name=Elementium Leggings -item.botania:elementiumBoots.name=Elementium Boots -item.botania:elementiumPick.name=Elementium Pickaxe -item.botania:elementiumShovel.name=Elementium Shovel -item.botania:elementiumAxe.name=Elementium Axe -item.botania:elementiumSword.name=Elementium Sword -item.botania:elementiumShears.name=Elementium Shears -item.botania:openBucket.name=Extrapolated Bucket -item.botania:spawnerMover.name=Life Aggregator -item.botania:pixieRing.name=Great Fairy Ring -item.botania:superTravelBelt.name=Globetrotter's Sash -item.botania:rainbowRod.name=Rod of Bifrost -item.botania:tornadoRod.name=Rod of the Skies -item.botania:fireRod.name=Rod of the Hells -item.botania:vineBall.name=Vine Ball -item.botania:slingshot.name=Livingwood Slingshot -item.botania:manaBottle.name=Mana in a Bottle -item.botania:prismarineShard.name=Prismarine Shard -item.botania:laputaShard.name=Shard of Laputa -item.botania:virus0.name=Necrodermal Virus -item.botania:virus1.name=Nullodermal Virus -item.botania:skyDirtRod.name=Rod of the Highlands -item.botania:placeholder.name=Crafting Placeholder -item.botania:manasteelHelmReveal.name=Manasteel Helmet of Revealing -item.botania:terrasteelHelmReveal.name=Terrasteel Helmet of Revealing -item.botania:elementiumHelmReveal.name=Elementium Helmet of Revealing -item.botania:itemFinder.name=The Spectator -item.botania:superLavaPendant.name=Crimson Pendant -item.botania:enderHand.name=Hand of Ender -item.botania:glassPick.name=Vitreous Pickaxe -item.botania:spark.name=Spark -item.botania:sparkUpgrade0.name=Spark Augment: Dispersive -item.botania:sparkUpgrade1.name=Spark Augment: Dominant -item.botania:sparkUpgrade2.name=Spark Augment: Recessive -item.botania:sparkUpgrade3.name=Spark Augment: Isolated -item.botania:diviningRod.name=Rod of Divining -item.botania:gravityRod.name=Rod of the Black Mesa -item.botania:regenIvy.name=Timeless Ivy - -# GUI TEXT -botania.gui.lexicon.header=Lexica Botania, %s Edition Table of Contents -botania.gui.lexicon.wip=(This entry is a Work In Progress. It's not even its final form) - -# LEXICON CATEGORIES -botania.category.basics=Basics and Mechanics -botania.category.mana=Mana Manipulation -botania.category.functionalFlowers=Functional Flora -botania.category.generationFlowers=Generating Flora -botania.category.devices=Natural Apparatus -botania.category.tools=Mystical Items -botania.category.baubles=Baubles and Acessories -botania.category.alfhomancy=Alfhomancy -botania.category.misc=Miscellaneous - -# LEXICON ENTRIES - -# - BASIC -# -- AN INTRODUCTORY CLIP -botania.entry.introVideo=An Introductory Clip -botania.page.introVideo0=For those readers who are not quite readers, a short video guide covering the basics of Botania is also available. It's to keep in note that this guide acts as an aid and not a substitution for the contents of the &1Lexica Botania&0.
    To watch this video simply press the &4ENTER&0 key. - -# -- LEXICA BOTANIA -botania.entry.lexicon=Lexica Botania -botania.page.lexicon0=The &1Lexica Botania&0 is the repository of all knowledge for all botany related matters. But you probably knew that already.
    All information is stored here, as expected. For convenience, if a block happens to have an entry, it can be shift-right clicked with the &1Lexica Botania&0 to open that entry. -botania.page.lexicon3=Any entries typed in &oItalics&r are &4basic&0 entries, which contain the very basic knowledge required to playing Botania. They should be prioritized over others, most of the sections contain one or more, so a good look through through them is a good idea. -botania.page.lexicon1=Crafting the &1Lexica Botania&0. -botania.page.lexicon2=The &1Lexica Botania&0's title can also be customized. By placing it in an &1Anvil&0 and renaming it, one can not only change its cover, but also the title.
    The Edition of the lexica shown equates to the version of the &4Botania&0 you're running, and no, I don't care about the fourth wall. - -# -- MYSTICAL FLOWERS -botania.entry.flowers=Mystical Flowers -botania.page.flowers0=Around the world, you may stumble upon a large variety of Mystical Flora. Spotting these doesn't take much work as the flowers themselves emit a fair amount of shine.
    They come in a total of &416 &0different colors.
    It's also possible to grow these flowers using &1Floral Fertlizer&0 (read on). -botania.page.flowers1=Flowers as far as the eye can see... -botania.page.flowers2=These flowers can be plucked for &1Mystical Petals&0, that can be used for making magical instruments and plants alike.
    Right clicking a petal on the ground will &4bury it&0, having it emit particles.
    These petals can also be crushed into &1Floral Powder&0, which functions much alike any mundane piece of dye. -botania.page.flowers3=Plucking Petals off Flowers. -botania.page.flowers4=Crafting the &1Pestle and Mortar&0. -botania.page.flowers5=Grinding Petals into Powder. -botania.page.flowers6=Right clicking the &1Floral Powder&0 in any &1Wool&0 or &1Carpet&0 changes its color to the color of the powder.
    By mixing the &1Floral Powder&0 with some &1Bone Meal&0, it's possible to create a different type of fertilizer. The &1Floral Fertlizer&0 will grow a small amount of &1Mystical Flowers&0 in the nearby vicinity, if you ever run low on them. -botania.page.flowers7=Making fertilizer (any powder colors work) -botania.page.flowers8=Using typical flower substances also works - -# -- PETAL APOTHECARY -botania.entry.apothecary=Petal Apothecary -botania.page.apothecary0=In order for a botanist to create plantlife that can do its bidding, one would need special means of infusing plants with mystical energy.
    Luckily, the &1Petal Apothecary&0 does just that. -botania.page.apothecary1=The &1Petal Apothecary&0. -botania.page.apothecary2=This block, when placed in the world and given some water (by use of a &1Water Bucket&0), will accept any &1Mystical Petals&0 thrown at it, releasing their energies.
    Once one has set the correct petals in, throwing some &1Seeds&0 in will finalize the proccess.
    Tossing in the full bucket will also fill the recipient with water. -botania.page.apothecary3=Quite a few plants can be made using this method, for more information, read on the &4Functional Flora&0 and &4Generation Flora&0 sections of this Lexicon.
    Shift-right clicking the &1Petal Apothecary&0 with an empty hand will remove the last item thrown in.
    Lastly, tossing in &1Vines&0 also gives the block an overgrown visual. -botania.page.apothecary4=Crafting the &1Petal Apothecary&0. - -# -- PURE DAISY -botania.entry.pureDaisy=Pure Daisy -botania.page.pureDaisy0=The &1Pure Daisy&0 is not only the most basic, but also the most important flower a botanist can have.
    This flower will purify any adjacent &1Wood&0 and &1Stone&0 blocks, as seen on the next page, into their purified counterparts, &1Livingwood&0 and &1Livingrock&0, which can be used for crafting. -botania.page.pureDaisy1=Just give it &4a minute&0 or so... -botania.page.pureDaisy2=&1Livingwood&0 can be turned into twigs -botania.page.pureDaisy3=White is bright and pure - -# -- WAND OF THE FOREST -botania.entry.wand=Wand of the Forest -botania.page.wand0=The general multi-use tool for a botanist is the &1Wand of the Forest&0.
    This wand, made by, effectively, strapping a pair of &1Mystical Petals&0 of any color to a few &1Livingwood Twigs&0, is required for a good amount of tasks. -botania.page.wand1=The wand can be bound to &1Mana Spreaders&0 by shift-right clicking them, and unbound via the same task. If the wand isn't bound to anything, shift-right clicking a block allows it to be rotated around the axis of the side it's clicked on.
    For example, clicking on the top of a &1Chest&0 rotates it around. Most blocks which can be rotated should work. -botania.page.wand2=The petals used determine the colors of the wand - -# -- RUNIC ALTAR -botania.entry.runeAltar=Runic Altar -botania.page.runeAltar21=Runic creation is a rather important complex in the advancement of the botanical magics. First and foremost, though, this type of crafting requires a decent knowledge of &4Mana Manipulation&0. Before proceeding further, a read through the important entries (those in &oItalics&r) on that section of the &1Lexica Botania&0 might prove enlightening. -botania.page.runeAltar0=&1Runes&0 are extremely important components of complex magical devices or flora.
    In order to create these, one would require a &1Runic Altar&0.
    To utilize this &1Runic Altar&0, start by placing, via either a right click or simply tossing, the components to the rune you want to create. -botania.page.runeAltar1=Proceed by linking a &1Mana Spreader&0 to the altar, and right click it with a &1Wand of the Forest&0.
    It should be apparent when the altar has received enough &4Mana&0. When that happens, just drop a piece of &1Livingrock&0 on top of it and use the wand on it again to collect your rune. -botania.page.runeAltar2=Crafting the &1Runic Altar&0. -botania.page.runeAltar3=A total of 16 &1Runes&0 exist.
    The most basic and elementary runes are named after the &4Four Elements&0. The intermediate runes are named after the &4Four Seasons&0, and the most advanced runes are named after the &4Seven Deadly Sins&0. A separate &1Rune of Mana&0 also exists. -botania.page.runeAltar20=Sneaking and right-clicking the &1Runic Altar&0 with an empty hand while it's not accepting mana will remove the last item put into it.
    Last but not least, attaching a &1Comparator&0 to it will emit signal strength &41&0 if the altar is accepting &4Mana&0 and signal strength &42&0 if it's ready to craft the rune. -botania.page.runeAltar4=The &1Rune of Water&0. -botania.page.runeAltar5=The &1Rune of Earth&0. -botania.page.runeAltar6=The &1Rune of Air&0. -botania.page.runeAltar7=The &1Rune of Fire&0. -botania.page.runeAltar8=The &1Rune of Spring&0. -botania.page.runeAltar9=The &1Rune of Summer&0. -botania.page.runeAltar10=The &1Rune of Autumn&0. -botania.page.runeAltar11=The &1Rune of Winter&0. -botania.page.runeAltar12=The &1Rune of Mana&0. -botania.page.runeAltar13=The &1Rune of Lust&0. -botania.page.runeAltar14=The &1Rune of Gluttony&0. -botania.page.runeAltar15=The &1Rune of Greed&0. -botania.page.runeAltar16=The &1Rune of Sloth&0. -botania.page.runeAltar17=The &1Rune of Wrath&0. -botania.page.runeAltar18=The &1Rune of Envy&0. -botania.page.runeAltar19=The &1Rune of Pride&0. - -# -- TERRASTEEL -botania.entry.terrasteel=Terrasteel -botania.page.terrasteel0=&1Terrasteel&0 is a powerful metal infused with the magic of nature.
    Creating this metal proves to not be a short order, in order to create it, toss a &1Manasteel Ingot&0, a &1Mana Pearl&0 and a &1Mana Diamond&0 on top of an &4Active &1Beacon&0. A &1Mana Pool&0 must be present nearby, being at least half full. The infusion will create a single &1Terrasteel Ingot&0. -botania.page.terrasteel1=Creating &1Terrasteel&0 - -# -- WRAP -botania.entry.wrap=Wrap -botania.page.wrap0=It seems like the creator of this mod decided to add a weird game mechanic in the form of &1Wrap&0. I don't really know what it does, probably something bad. :/
    What's that "Fourth Wall" you're talking about...? - -# - MANA -# -- AN INTRODUCTION TO MANA -botania.entry.mIntro=An Introduction to Mana -botania.page.mIntro0=&4Mana&0 is an ethereal substance. In layman's terms, it is a form of &4mystical energy&0. Its sensorial existence is inconstant, and its color depends on the environment its put in.
    Mastering &4Mana&0 is one of the most important skills a botanist needs to master. -botania.page.mIntro1=In order to create &4Mana&0, one would require a set of &4Generating Flowers&0 (read the respective section). This &4Mana&0 can be dispersed by utilizing &1Mana Spreaders&0 and stored in &1Mana Pools&0. &4Mana&0 can be used for a myriad of different things. For starters, it can be used for &4Functional Flowers&0 (read the respective section). -botania.page.mIntro2=To get started with mastering the art of &4Mana&0, one would start by learning how to use &1Dayblooms&0, &1Mana Spreaders&0 and &1Mana Pools&0.
    These form a basic infrastructure for mana, which can be used for all sorts of purposes. Have a read at the &4Functional Flora&0 and &4Magical Apparatus&0 sections of this Lexicon. - -# -- MANA SPREADER -botania.entry.spreader=Mana Spreader -botania.page.spreader0=The &1Mana Spreader&0 is the most important component in manipulating &4Mana&0.
    This is the block that allows &4Mana&0 to travel from point A to point B. When this block is placed on the ground, it'll face one of 6 basic directions. By holding shift-right on it with a &1Wand of the Forest&0, one can orient it to the opposite of where it was clicked. -botania.page.spreader10=Simply shift-right clicking once with the &1Wand of the Forest&0 on it once will bind the wand to it, pressing shift-right click elsewhere will orient the spreader to that point.
    Shift-right clicking the spreader again unbinds it from the wand, note that this last step has to be done, else when trying to bind to another spreader, the last one will simply turn towards it instead. -botania.page.spreader1=Holding a &1Wand of the Forest&0 -botania.page.spreader2=The &1Mana Spreader&0 has a small internal buffer of &4Mana&0, which will get filled by nearby &4Generating Flowers&0. This buffer can be viewed by looking at the &1Spreader&0 with a &1Wand of the Forest&0, as demonstrated in the last page.
    Note that the block needs to be right clicked with a wand to get accurate and adequate values. -botania.page.spreader3=Holding a &1Wand of the Forest&0 displays a beam which shows where the spreader is pointing at. Hovering over it shows the target. The sparkle that's always shown is the point when &4Mana loss&0 starts to happen.
    If the target of the spreader is a block that can contain &4Mana&0, and isn't full, the spreader will fire a &4Mana Burst&0, which will travel to the target, and pass the &4Mana&0 along to it. -botania.page.spreader4=The spreader only fires one burst at once, it'll only fire another one when the last one hits the target.
    Furthermore, the bursts also start suffering &4mana loss&0 after a small amount of time. This can be seen in the beam, which becomes a lot thinner when this happens. There is also a small amount of &4mana loss&0 when a beam enters a spreader. -botania.page.spreader11=Applying a &4Redstone Signal&0 to the spreader will have it cease to function. Case better control is required, a &1Redstone Mana Spreader&0 is recommended, as it can fire bursts without a target block and works on redstone pulses. -botania.page.spreader5=Crafting the &1Mana Spreader&0 - -# -- MANA POOL -botania.entry.pool=Mana Pool -botania.page.pool0=The &1Mana Pool&0 is, simply put, a storage of &4Mana&0.
    Mana can be inserted into it by usage of a &1Mana Spreader&0, and any adjacent &1Mana Spreaders&0 will pull mana from it to increase their internal buffer automatically.
    Any &4Functional Flowers&0 require a nearby &1Mana Pool&0 to draw power from. -botania.page.pool9=&1Mana Pools&0 come in two varieties, a weaker, &1Diluted&0 variety which only stores a very small amount of &4Mana&0 and isn't able to infuse items, and a &1Normal&0 variety, which can store as much as a hundred times more than the dilluted one and can infuse items.
    Whenever "Mana Pool" is refered elsewhere for scale, it refers to a normal one. -botania.page.pool1=Making a &1Dilluted Mana Pool&0. -botania.page.pool10=Infusing a normal &1Mana Pool&0 -botania.page.pool2=Tossing in some resources into a normal &1Mana Pool&0 will cause them to get infused with &4Mana&0, turning them into more powerful forms.
    A few examples are &1Iron Ingots&0 or &1Mystical Petals&0.
    &4Mana&0 reading for this block functions like the &1Mana Spreader&0. A &1Redstone Comparator&0 can also output a signal based on the contents. -botania.page.pool8=For the artistic types, tossing any color of &1Floral Powder&0 in the pool will have it take its color, all sixteen colors are viable for decoration and/or easy labelling. -botania.page.pool3=Infusing &1Manasteel&0 -botania.page.pool4=Infusing &1Mana Pearls&0 -botania.page.pool5=Infusing &1Mana Diamonds&0 -botania.page.pool6=Infusing &1Mana Petals&0 -botania.page.pool7=&1Mana Cookies&0 feed you pretty well. - -# -- SPARKS -botania.entry.sparks=Sparks -botania.page.sparks0=&1Sparks&0 are interesting entities. Created from a combination of raw energy and &4Mana&0, they have the ability to be placed on top of a few specific &4Mana&0 containing or accepting blocks, mainly, &1Mana Pools&0.
    Some blocks have the ability to harness &4Mana&0 from &1Sparks&0, but the uses for them seem rather limited right now. -botania.page.sparks1=&oholds up spork&r - -# -- SPARK AUGMENTATION -botania.entry.sparkUpgrades=Spark Agumentation -botania.page.sparkUpgrades0=As it seems, &1Sparks&0 are a bit more versatile than it was known previously. A variety of &1Augments&0 can be applied to them to enhance their abilities. It's to note that Augments can only be applied to &1Sparks&0 that lie on &1Mana Pools&0.
    A &1Spark&0 can only have a single &1Augment&0 at any given time. -botania.page.sparkUpgrades1=Starting off, the &1Dispersive Augment&0 has the &1Spark&0 use up the &4Mana&0 in the pool below, to charge any nearby players' &4Mana&0 containing items. -botania.page.sparkUpgrades2=The &1Dominant Augment&0 will have the &1Spark&0 pull any &4Mana&0 from nearby non-augmented &1Sparks'&0 pools into its own, until it's completely full. -botania.page.sparkUpgrades3=The &1Recessive Augment&0 will have the &1Spark&0 output all of the &4Mana&0 in its pool into any nearby non-augmented or Dispersive &1Sparks'&0 pools until it's completely empty. -botania.page.sparkUpgrades4=Lastly, the &1Isolated Augment&0 will prevent the &1Spark&0 from interacting with any Dominant or Recessive &1Sparks&0, but still allow it to interact with blocks that can receive their &4Mana&0 through the &1Spark&0 network. -botania.page.sparkUpgrades5=Crafting the Aguments - -# -- MANA DISTRIBUTOR -botania.entry.distributor=Mana Distributor -botania.page.distributor0=Any botanist will eventually reach a point where a single &1Mana Pool&0 setup is not enough.
    The &1Mana Distributor&0 will fix all those issues. By placing it adjacently to a few &1Mana Pools&0 on its sides, when it receives &4Mana&0 through &4Mana Bursts&0 it'll equally spread it to the adjacent pools. -botania.page.distributor1=Crafting the distributor - -# -- MANA VOID -botania.entry.manaVoid=Mana Void -botania.page.manaVoid0=The &1Mana Void&0 is, in layman's terms, the grave for &4Mana&0. Any &4Mana&0 shot into this block will simply vanish into the void, never to be seen again.
    Placing one of these under a &1Mana Pool&0 allows the pool to always accept &4Mana&0, but disposing any it can't hold. -botania.page.manaVoid1=Crafting the void block - -# -- MANA FLUXFIELD -botania.entry.rfGenerator=Mana Fluxfield -botania.page.rfGenerator0=By passing &4Mana&0 through a field of redstone energy, its state can change from a natural energy source to &4Redstone Flux&0.
    Simply pointing a spreader at this block will have it shoot at it, converting the &4Mana&0 that lands on it into &4RF&0. It can then be pulled out with any &4RF&0 transporter. -botania.page.rfGenerator1=The bullet guys. I bit it. - -# -- MANA LENSES -botania.entry.lens=Mana Lenses -botania.page.lens0=In order to upgrade the potential a &1Mana Spreader&0, one can apply &1Mana Lenses&0. The very basic mana lens does absolutely nothing.
    Lenses can be &4dyed&0 all the 16 colors of the spectrum, or combined with a &1Mana Pearl&0 to create a &1Rainbow Lens&0. These will change the color of the burst. -botania.page.lens1=The basic lens, it doesn't do anything. -botania.page.lens2=&4Dyeing&0 lenses! -botania.page.lens3=&1Rainbow Lens&0 all the way -botania.page.lens4=But lenses are not only for fancy colors. One can upgrade them with all sorts of materials to create new lens which can do all sorts of effects on the &4Mana Bursts&0.
    It's to take in mind that, if using a normal &1Mana Spreader&0, there needs to be a block that can receive &4Mana&0 at the end for the burst to fire. A &1Redstone Mana Spreader&0 is recommended for some of the lenses. -botania.page.lens5=Sometimes, though, having a single &1Mana Lens&0 in a spreader just isn't enough sometimes. By combining two lenses with a &1Slimeball&0 in a crafting table, it's possible to unite them into one, and keep the effects of both.
    The first lens used determines the visuals (texture and color). It's to note that some combinations will not work, nor will two lenses of the same type. -botania.page.lens6=The &1Velocity Lens&0 will drastically increase the speed at which a &4Mana Burst&0 travels, but not only does the beam start to lose its &4Mana&0 a lot faster, it can also carry a bit less. -botania.page.lens7=Velocity Lens -botania.page.lens8=The &1Potency Lens&0 will double the amount of &4Mana&0 a &4Mana Burst&0 can carry, however, the beam becomes slower and after it starts to lose mana it does so at a lot faster rate. -botania.page.lens9=Potency Lens -botania.page.lens10=The &1Resistance Lens&0 will significantly increase the amount of time the &4Mana Burst&0 can go without starting to lose &4Mana&0, but it makes it a a bit slower. -botania.page.lens11=Resistance Lens -botania.page.lens12=The &1Efficiency Lens&0 will decrease the amount of time it takes for the &4Mana Burst&0 to start losing its &4Mana&0, but when that happens, it does so at a lot slower rate. -botania.page.lens13=Efficiency Lens -botania.page.lens14=The &1Bounce Lens&0 will allow the &4Mana Burst&0 to bounce off walls, rather than dissipating on a collision. -botania.page.lens15=Bounce Lens -botania.page.lens16=The &1Gravity Lens&0 makes the &4Mana Burst&0 be attracted by the world's gravitational pull, thus moving in an arc. As compensation, it also slightly increases the time before &4Mana&0 loss starts to happen. -botania.page.lens17=Gravity Lens -botania.page.lens18=The &1Bore Lens&0 charges the &4Mana Burst&0 with the ability to break any blocks it comes into contact with, draining its own mana to do so. -botania.page.lens19=Bore Lens -botania.page.lens20=The &1Damaging Lens&0 charges the &4Mana Burst&0 with the power to damage any living beings it comes across, draining its own mana to do so. -botania.page.lens21=Damaging Lens -botania.page.lens22=The &1Phantom Lens&0 is an interesting one. By utilizing the &1Abstruse Platform&0 and its' properties, it's possible to make a lens that'll allow the &4Mana Burst&0 to pass through blocks. In doing so, the time it can stay without losing mana is decreased. -botania.page.lens23=Phantom Lens -botania.page.lens24=The &1Magnetizing Lens&0, as its name states, allows the &4Mana Burst&0 to magnetize, or home in, on any nearby blocks that can receive &4Mana&0. Doing so slightly decreases the speed of the burst. -botania.page.lens25=Magnetizing Lens -botania.page.lens26=The &1Entropic Lens&0 imbues the &4Mana Burst&0 with entropy, causing it to release its energy in the form of an explosion when it collides against something that can't receive &4Mana&0. -botania.page.lens27=Entropic Lens -botania.page.lens28=The &1Influence Lens&0 allows the &4Mana Burst&0 to have influence over any nearby &4dropped items&0, &4experience orbs&0 and even &4falling blocks&0, having them move in the exact same vector of motion as the burst itself. -botania.page.lens29=Influence Lens -botania.page.lens30=The &1Weight Lens&0 carries a strong burden on the &4Mana Burst&0, making any block hit by it, if there doesn't happen to be a block below it, fall, similarly to how &1Sand&0 and &1Gravel&0 do. -botania.page.lens31=Weight Lens -botania.page.lens32=The &1Kindle Lens&0 is infused with a burning spark, when it hits a block it'll set it on fire. It has the ability to both ignite and close &1Nether Portals&0. It doesn't seem to set any living beings on fire, though. -botania.page.lens33=Kindle Lens -botania.page.lens34=The &1Force Lens&0 acts as a &1Piston&0, when it hits a block that a piston can move, it'll do just so. -botania.page.lens35=Force Lens - -# -- PORTABLE MANA TRANSPORT -botania.entry.manaTransport=Portable Mana Transport -botania.page.manaTransport0=While using &1Mana Spreaders&0 to transport &4Mana&0 around is all well and good, there is also a way of doing it in a different manner.
    The &1Mana Tablet&0 is a portable object which can carry &4Mana&0 on itself. -botania.page.manaTransport1=Tossing one of these on top of a &1Mana Pool&0 will allow for transport of &4Mana&0 between one and another.
    Shift-right clicking the &1Mana Pool&0 with a &1Wand of the Forest&0 will change in which way the &4Mana&0 flows.
    Lastly, unlike normal items, these will never despawn when dropped on the floor. -botania.page.manaTransport2=This doesn't run android -botania.page.manaTransport3=It's also possible to indirectly access the &4Mana&0 reserves of a &1Mana Pool&0, through using a &1Mana Mirror&0, items will pull out of the pool itself.
    To bind a mirror to a pool, one would simply &4shift right-click&0 a pool with the mirror.
    The mirror can't put mana in or take mana out of pools in any other way. -botania.page.manaTransport4=Mirror mirror on the wall... - -# -- MANA DETECTOR -botania.entry.manaDetector=Mana Detector -botania.page.manaDetector0=A device like the &1Mana Detector&0 is capable to detect when a &4Mana Burst&0 starts flowing through it (the burst doesn't dissipate on collision with this block) and provide a redstone signal when that is the case. -botania.page.manaDetector1=Crafting the detector - -# -- REDSTONE MANA SPREADER -botania.entry.redstoneSpreader=Redstone Mana Spreader -botania.page.redstoneSpreader0=By combining a &1Mana Spreader&0 with a piece of &1Redstone&0, it's possible to create a &1Redstone Mana Spreader&0, which fires only when given a &4Redstone signal&0, regardless of having a block in the end to put the mana or not.
    It's to keep in note that this doesn't let the spreader shoot a burst until the last one dissipates or is absorbed. -botania.page.redstoneSpreader1=Just add redstone - -# -- MANASTAR -botania.entry.manastar=Manastar -botania.page.manastar0=The imprecise measurements of the &1Wand of the Forest&0 sometimes won't cut it for telling if you're turning a profit or loss in your &1Mana Pools&0.
    Creating a &1Manastar&0 and placing it next to your pools will have it shine red if there's a loss or blue if there's a profit. The measurement happens every few seconds. -botania.page.manastar1=&rI'm a shooting star leaping through the skies&r. - -# -- ELVEN MANA SPREADERS -botania.entry.dreamwoodSpreader=Elven Mana Spreaders -botania.page.dreamwoodSpreader0=Simply put, &1Dreamwood&0 conducts &4Mana&0 better than &1Livingwood&0. Add in some adjustments like &1Elementium&0 or &1Mana Petals&0 and what you get is a &1Mana Spreader&0 that can conduct more &4Mana&0, faster and for more time without &4Mana loss&0.
    On the negative side, it can't be turned into a &1Redstone Mana Spreader&0. -botania.page.dreamwoodSpreader1=Better spreaders, that's it -botania.page.dreamwoodSpreader2=By combining this already powerful spreader with a &1Gaia Spirit&0 and a &1Dragonstone&0 gem, one can create an even more potent variant. The &1Gaia Spreader&0 is within the top percentage of Mana Spreaders, with pretty much upgrades all round. -botania.page.dreamwoodSpreader3=ULTRA_SPREADER - -# -- PAINTSLINGER LENS -botania.entry.paintLens=Paintslinger Lens -botania.page.paintLens0=The &4Elves&0 are one crafty bunch. This lens is somewhat unique in comparison to the other lenses. The &1Paintslinger Lens&0 needs to be dyed one of the 16 colors of the spectrum to function. When it hits a colorable block (&1Wool, Stained Clay or Glass&0...) it'll turn any blocks connected, of the same type and color, into the color of the &4Mana Burst&0 itself. It seems to work with &4Sheep&0 too. -botania.page.paintLens1=A M'AIDER Stranded Girl - -# - FUNCTIONAL FLOWERS -# -- AN INTRODUCTION TO FUNCTION -botania.entry.fIntro=An Introduction to Function -botania.page.fIntro0=There are various places in which the &4Mana&0 a botanist generates can be put to use, one of them is an assortment of &4Functional Flowers&0.
    These flowers will drain &4Mana&0 from a nearby &1Mana Pool&0 into themselves, in order to do whatever task they were created for.
    It's to note that these can't receive power directly through &1Mana Spreaders&0. -botania.page.fIntro1=All &4Functional Flowers&0, alike the &4Generating Flowers&0 contain a small buffer of &4Mana&0.
    Standard rules for &4Mana&0 reading apply, right clicking with a &1Wand of the Forest&0 will update the mana readings. -botania.page.fIntro2=It is important to keep in mind that these flowers memorize the &1Mana Pool&0 from which they should pull &4Mana&0 out of. They'll only pull from the nearest pool present at the time of the flower being placed (or the closest placed afterward, if none was present), and none other, unless that one is removed. -botania.page.fIntro3=Lastly, some functional flowers utilize a &1Redstone Root&0 in their creation. If they do, the flower's effect can be toggled with a redstone signal. -botania.page.fIntro4=&1Redstone Root&0 for Redstone Control - -# -- JADED AMARANTHUS -botania.entry.jadedAmaranthus=Jaded Amaranthus -botania.page.jadedAmaranthus0=Everyone likes flowers right? The &1Jaded Amaranthus&0 is made just for that purpose.
    Feeding it with &4Mana&0 from &1Mana Pools&0 will have it quickly grow new &1Mystical Flowers&0 around it, in any spots it can. -botania.page.jadedAmaranthus1=&oIt was this or clematis.&r - -# -- BELLETHRONE -botania.entry.bellethorne=Bellethorne -botania.page.bellethorne0=The &1Bellethorne&0 is a malevelous flower. By utilizing &4Mana&0 it slowly inflicts harm in any living beings (save for &4players&0) around it. -botania.page.bellethorne1=&oEvery rose has its thorn&r. - -# -- DREADTHORNE -botania.entry.dreadthorne=Dreadthorne -botania.page.dreadthorne0=The &1Dreadthorne&0 is a slightly more specific counterpart to the &1Bellethrorne&0, by which, instead of all mobs around, it'll only hurt &4adult&0 animals and none else. -botania.page.dreadthorne1=&oNo Mr.Bond, I expect you to die&r. - -# -- HEISEI DREAM -botania.entry.heiseiDream=Heisei Dream -botania.page.heiseiDream0=The &1Heisei Dream&0 will, by utilizing &4Mana&0, awaken feelings of anger and revenge in any nearby &4mobs&0, turning them against eachother. -botania.page.heiseiDream1=&oA pleasant era will murder people&r. - -# -- TIGERSEYE -botania.entry.tigerseye=Tigerseye -botania.page.tigerseye0=It's a known fact that &4Creepers&0 are terrified of &4cats&0.
    The &1Tigerseye&0 exploits that very weakness, by emitting a feline aura, petrifying any nearby &4Creepers&0, preventing them from exploding. It also has the effect of making them run away from &4players&0. -botania.page.tigerseye1=&oRisin' up to the challenge of our rivals&r. - -# -- ORECHID -botania.entry.orechid=Orechid -botania.page.orechid0=While going mining is all good, a renewable means of getting ore is due. The &1Orechid&0 will use (a massive amount of) &4Mana&0 to generate &4ores&0 in nearby &1Stone&0 blocks.
    The ores it generates are random, but seem to be biased towards more common ores rather than rarer ones. -botania.page.orechid1=&oLizbeth would like this flower&r. - -# -- FALLEN KANADE -botania.entry.fallenKanade=Fallen Kanade -botania.page.fallenKanade0=The &1Fallen Kanade&0 is a flower with angelic properties, it'll use &4Mana&0 from nearby &4Mana Pools&0 in order to apply a regeneration effect to any &4players&0 nearby. -botania.page.fallenKanade1=&oHand Sonic, version four&r. - -# -- EXOFLAME -botania.entry.exoflame=Exoflame -botania.page.exoflame0=Unlike its generating counterpart, the &1Exoflame&0 utilizes &4Mana&0 with means to generate heat.
    Any &1Furnaces&0 nearby to the &1Exoflame&0 will be fueled, and given an efficiency boost, for the cost of some &4Mana&0. -botania.page.exoflame1=&oBut we should be going nowhere fast&r. - -# -- AGRICARNATION -botania.entry.agricarnation=Agricarnation -botania.page.agricarnation0=The slow growth of crops is always a problem to feed the masses. The &1Agricarnation&0 is a flower that turns &4Mana&0 into a type of natural fertilizer, causing nearby plantlife to grow at a faster rate. -botania.page.agricarnation1=&oGrandola Vila Morena&r... - -# -- HOPPERHOCK -botania.entry.hopperhock=Hopperhock -botania.page.hopperhock0=The &1Hopperhock&0 will pick up items around it. Giving it &4Mana&0 is optional, but it'll increase its range.
    Items picked up will be put in adjacent inventories (e.g. &1Chests&0). Placing &1Item Frames&0 in any of the inventories will specify which items can or can't go in them. -botania.page.hopperhock1=Any inventory which has no &1Item Frame&0 adjacent to it can accept any items, but labelled inventories will take priority.
    The rule using to sort items can be changed by shift-right clicking the flower with a &1Wand of the Forest&0. -botania.page.hopperhock2=&oI guess I'll be talking my loli and leaving&r. - -# -- TANGLEBERRIE -botania.entry.tangleberrie=Tangleberrie -botania.page.tangleberrie0=The &1Tangleberrie&0 is a flower that, at the cost of a small amount of &4Mana&0, will keep any nearby animals or monsters within a circle ward, preventing them from getting out. -botania.page.tangleberrie1=&oTangled, brave and frozen&r. - -# -- JIYUULIA -botania.entry.jiyuulia=Jiyuulia -botania.page.jiyuulia0=The &1Jiyuulia&0 is a flower that, at the cost of a small amount of &4Mana&0, will keep any nearby animals or monsters at bay, protecting a circular area from them getting in. -botania.page.jiyuulia1=&oKeep out, please&r. - -# -- RANNUNCARPUS -botania.entry.rannuncarpus=Rannuncarpus -botania.page.rannuncarpus0=Quite a handy flower indeed, the &1Rannuncarpus&0 will pick up any nearby blocks in dropped item form and place them in the world nearby. It, however, only places the blocks thrown at it on top of a specific block, to specify this block, place it right below the soil the flower is resting on. -botania.page.rannuncarpus1=Block items, such as &1Sugar Cane&0 will also work, but, much alike any other blocks, will only be placed in a location where they normally would be able to be placed.
    Lastly, giving &4Mana&0 to the flower is optional, but it increases its range. -botania.page.rannuncarpus2=&oNeed a hand&r? - -# -- HYACIDUS -botania.entry.hyacidus=Hyacidus -botania.page.hyacidus0=For some reason, poison does not kill. The &1Hyacidus&0, to that, can be used to poison any nearby mobs, bringing them to their knees for a one hit kill after a bit. -botania.page.hyacidus1=&oSteel is immune&r. - -# -- POLLIDISIAC -botania.entry.pollidisiac=Pollidisiac -botania.page.pollidisiac0=Animals love eating, that's all they seem to do, really. An interesting behaviour they show is that they only seem to want to eat things that are fed to them.
    The &1Pollidisiac&0 will simply do that, at the cost of some mana, any appropriate nearby food items (&1Wheat&0, &1Carrots&0, etc) will be fed to the animals, putting them in a &obetter mood&r. -botania.page.pollidisiac1=&oHell's Kitchen&r. - -# -- CLAYCONIA -botania.entry.clayconia=Clayconia -botania.page.clayconia0=The &1Clayconia&0 is a simple flower, in essence. All it does is moisten nearby &1Sand&0, turning it into &1Clay&0, this process uses a decent amount of &4Mana&0, but nothing too insane. -botania.page.clayconia1=&oWhat a killer joke&r. - -# -- LOONIUM -botania.entry.loonium=Loonium -botania.page.loonium0=Any weary adventurer knows that &4Dungeons&0 can hold valuable goodies. The &1Loonium&0 can, at the use of an extreme amount of &4Mana&0, materialize these items and drop them in the nearby vicinity. -botania.page.loonium1=&oTank Tank Heal Tank&r! - -# -- DAFFOMILL -botania.entry.daffomill=Daffomill -botania.page.daffomill0=The &1Daffomill&0 works as a fan of sorts. It pushes, at the cost of a small amount of &4Mana&0, any items found in front of it.
    Shift-right clicking it with a &1Wand of the Forest&0 changes the orientation. Where it's currently facing can be seen via the subtle wind particles it emits. -botania.page.daffomill1=&oWind Turbines? I'm a big fan&r. - -# -- VINCULOTUS -botania.entry.vinculotus=Vinculotus -botania.page.vinculotus0=The &1Vinculotus&0 has the power to create a disturbance among any &4Enderman&0's teleportation powers within a fairly large radius around it. For a cost of &4Mana&0, whenever an &4Enderman&0 would teleport anywhere, instead, they're teleported to the location of the &1Vinculotus&0. -botania.page.vinculotus1=Touch this black lotus with your fingers - -# - GENERATING FLOWERS -# -- AN INTRODUCTION TO GENERATION -botania.entry.gIntro=An Introduction to Generation -botania.page.gIntro0=&4Generating Mana&0 should be at the top of the priorities for any botanist. Luckily there's an array of &4Generating Flowers&0 willing to do the job.
    These flowers, as their name shows, generate &4Mana&0, both passively and actively. Unless stated otherwise, all &4Generating Flowers&0 generate &4Mana&0 passively under certain circumstances. -botania.page.gIntro1=All &4Generating Flowers&0, alike the &4Functional Flowers&0 contain a small buffer of &4Mana&0.
    Standard rules for &4Mana&0 reading apply, right clicking with a &1Wand of the Forest&0 will update the mana readings.
    This mana will be stored in the closest &1Mana Spreader&0 around. -botania.page.gIntro2=It is important to keep in mind that these flowers memorize the &1Mana Spreader&0 into which they should put &4Mana&0 into. They'll only store into the nearest spreader present at the time of the flower being placed (or the closest placed afterward, if none was present), and none other, unless that one is removed. - -# -- DAYBLOOM -botania.entry.daybloom=Daybloom -botania.page.daybloom0=The &1Daybloom&0 is the most basic and rudimentary &4Generating Flower&0. Simply put, it performs a modified photosynthesis process, in order to transform sunlight into &4Mana&0.
    The process is rather slow, about ten or a dozen of these should get the job done, for now. -botania.page.daybloom1=An interesting thing to take in note is that these flowers tend to compete among themselves for what sunlight hits an area, thus having any other of the same type adjacent to it on any of the four cardinal directions will result in diminishing returns of &4Mana&0 production. -botania.page.daybloom1a=An interesting thing to take in note is that these flowers tend to compete among themselves for what sunlight hits an area, thus having any other of the same type adjacent to it on any of the four cardinal directions will result in diminishing returns of &4Mana&0 production.
    These flowers are not very resistant, and after some time they'll wither and die off. -botania.page.daybloom3=Diminishing Returns -botania.page.daybloom2=&oStarting up a brand new day&r. - -# -- NIGHTSHADE -botania.entry.nightshade=Nightshade -botania.page.nightshade0=The &1Nightshade&0 is the dark counterpart of the &1Daybloom&0, as it generates &4Mana&0 passively in any situation the &1Daybloom&0 can not, albeit at half the speed.
    Similarly to their shining counterpart, they suffer diminishing returns from having any adjacent. -botania.page.nightshade0a=The &1Nightshade&0 is the dark counterpart of the &1Daybloom&0, as it generates &4Mana&0 passively in any situation the &1Daybloom&0 can not, albeit at half the speed.
    Similarly to their shining counterpart, they suffer diminishing returns from having any adjacent.
    Similarly to the &1Daybloom&0, these flowers are not very resistant, and after some time they'll wither and die off. -botania.page.nightshade1=&oThe shadow of the day&r. - -# -- ENDOFLAME -botania.entry.endoflame=Endoflame -botania.page.endoflame0=While the &1Daybloom&0 is all well and good, a botanist requires more effective means of generating &4Mana&0.
    The &1Endoflame&0 does that exactly, it will absorb any combustible items or blocks dropped on the nearby vicinity (albeit only one at a time) and burn through them to passively generate mana while the fuel lasts. -botania.page.endoflame1=There is a small caveat though, the &1Endoflame&0 will not burn anything that returns a bi-product, an example are &1Lava Buckets&0, that have empty &1Buckets&0 as a bi-product. -botania.page.endoflame2=&oNot nitor&r. - -# -- HYDROANGEAS -botania.entry.hydroangeas=Hydroangeas -botania.page.hydroangeas0=While passive &4Mana&0 generation can be easily achieved through &1Dayblooms&0, different means of doing so might come in handy. The &1Hydroangeas&0 will suck up any &1Still Water&0 in a 3x3 area around it, on the same height, creating &4Mana&0 from it. They also seem to function faster during &4Rain&0, who'd have thought? -botania.page.hydroangeas0a=While passive &4Mana&0 generation can be easily achieved through &1Dayblooms&0, different means of doing so might come in handy. The &1Hydroangeas&0 will suck up any &1Still Water&0 in a 3x3 area around it, on the same height, creating &4Mana&0 from it. They also seem to function faster during &4Rain&0, who'd have thought?
    Similarly to the &1Daybloom&0, these flowers are not very resistant, and after some time they'll wither and die off. -botania.page.hydroangeas2=A simple &1Hydroangeas&0 system -botania.page.hydroangeas1=&oFrom some Hyperdimension&r? - -# -- THERMALILY -botania.entry.thermalily=Thermalily -botania.page.thermalily0=There comes a point where slow generating power, like the &1Hydroangeas&0 or the &1Endoflame&0 is not enough. An answer to that is the &1Thermalily&0, which works similarly to the &1Hydroangeas&0, except with &1Lava&0. -botania.page.thermalily0a=There comes a point where slow generating power, like the &1Hydroangeas&0 or the &1Endoflame&0 is not enough. An answer to that is the &1Thermalily&0, which works similarly to the &1Hydroangeas&0, except with &1Lava&0.
    Due to the heat the &1Lava&0 produces, there must be a block of &1Obsidian&0 below it for it to be absorbed. -botania.page.thermalily1=&oLily ought to know&r. - -# -- ROSA ARCANA -botania.entry.arcanerose=Rosa Arcana -botania.page.arcanerose0=&4Experience Points&0 are a form of magic of sorts. The &1Rosa Arcana&0 can tap into it and absorb the experience of players on the ground around it, turning it into &1Mana&0. -botania.page.arcanerose1=&oGo have a drink, it might take a bit&r. - -# -- MUNCHDEW -botania.entry.munchdew=Munchdew -botania.page.munchdew0=Generating the form of natural energy that is &4Mana&0 should be a pretty good process when done via other living materials. By using the &1Munchdew&0, any &1Leaves&0 near the flower will get munched up and converted into &4Mana&0.
    It's to note that, though, no saplings or any other items will be dropped from the leaves. -botania.page.munchdew1=&oItadakimasu&r! - -# -- ENTROPINNYUM -botania.entry.entropinnyum=Entropinnyum -botania.page.entropinnyum0=In order to generate a blast of &4Mana&0, one might in fact, require a blast nearby.
    Igniting a block of &1TNT&0 in the near an &1Entropinnyum&0 will have the latter absorb all the entropy generated by the blast into itself, creating a large amount of &4Mana&0 and nullifying any possible damage. Lastly, to absorb the explosion, the flower must not have any &4Mana&0 stored in it or the process will fail. -botania.page.entropinnyum1=&oCool guys don't look at explosions&r. - -# -- KEKIMURUS -botania.entry.kekimurus=Kekimurus -botania.page.kekimurus0=&1Cake&0 is delicious, everyone loves it, flowers included.
    The &1Kekimurus&0 is one of these &1Cake&0 aficionados, and will eat any it spots nearby, using its enriching nutrients to create &4Mana&0. -botania.page.kekimurus1=&oThe flower of Flaxbeard the kekker&r. - -# -- GOURMARYLLIS -botania.entry.gourmaryllis=Gourmaryllis -botania.page.gourmaryllis0=The &1Gourmaryllis&0 is one hungry flower. It'll eat up any food in a small area around it, and turn it into &4Mana&0.
    There's a catch, though, it can only digest a single food at any given time, the &4Mana&0 is created when it's done. Any other food it finds, it'll also devour, but not create any mana from it. -botania.page.gourmaryllis1=The amount of time it takes to digest a delicacy depends on its nutritional value, in layman's terms, the amount of food points it restores.
    So, a &1Steak&0 will take four seconds to digest, a &1Carrot&0 will take two, a loaf of &1Bread&0 will take two and a half, so on. -botania.page.gourmaryllis2=The amount of &4Mana&0 created also makes use of this value, but in a way where the more nutritious the food is, the more efficient it is. For example, a single &1Steak&0 will produce more &1Mana&0 from two &1Carrots&0, both absolutely and per second. -botania.page.gourmaryllis3=&oA hot pot for our new residents&r. - -# - MAGICAL APPARATUS -# -- FORCE RELAY -botania.entry.pistonRelay=Force Relay -botania.page.pistonRelay0=It seems that infusing &1Pistons&0 with &4Mana&0 results in some interesting adverse effects.
    This block tears the fabric of space, relaying any piston force applied to it to the block it's bound to. -botania.page.pistonRelay1=To bind it to a block, right click it with a &1Wand of the Forest&0, and right click on the block you want to bind it to.
    Furthermore, this block is highly unstable, and may create uncanny effects, care is to be taken, it is also resistant to glue, both in pulling and pushing. This allows for a "frame" like setup. -botania.page.pistonRelay2=Infusing a &1Piston&0 with &4Mana&0. - -# -- MANA PYLON -botania.entry.pylon=Mana Pylon -botania.page.pylon0=A &1Mana Pylon&0 is a structure that can pull energies from the earth and use them to power enchanting processes.
    For one, setting one adjusted to an &1Enchanting Table&0 as if it was a &1Bookshelf&0 will drastically increase the power it can convey, just 2 of these are enough for it to reach &4Level 30&0. -botania.page.pylon1=&oYou must construct additional pylons!&r - -# -- MANA ENCHANTING -botania.entry.manaEnchanting=Enchanting with Mana -botania.page.manaEnchanting0=By utilizing the magical power emitted from &1Mana Pylons&0, a structure that can enchant items with books without consuming them can be created, called the &1Mana Enchanter&0.
    Constructing one of these requires a fair amount of space and materials alike. -botania.page.manaEnchanting1=To construct the &1Mana Enchanter&0, one requires, as well as fair amount of space, 17 &1Obsidian&0 blocks, 10 &1Mystical Flowers&0 of any color, 6 &1Mana Pylons&0 and a &1Lapis Lazuli Block&0.
    The instructions on how to assemble this structure are in the following pages. -botania.page.manaEnchanting2=Start by making an &1Obsidian&0 circle. -botania.page.manaEnchanting3=Put &1Mana Pylons&0 1 block in the air where marked. -botania.page.manaEnchanting4=Put flowers under the pylons and in the center -botania.page.manaEnchanting5=Place a &1Lapis Lazuli Block&0 in the center. -botania.page.manaEnchanting6=After the construct is done, right click the Lapis block with a &1Wand of the Forest&0 and the enchanter should form.
    In order to utilize the enchanter, one would place (via right click) the item to be enchanted in the enchanter itself and drop &1Enchanted Books&0 inside the circle around it. -botania.page.manaEnchanting7=Items that are already enchanted can't be placed in the enchanter.
    To start the enchanting, right click the enchanter with a &1Wand of the Forest&0. It'll scan the books around, and once it's done, a spell circle of sorts will appear around it, indicating the books can be safely picked up again. -botania.page.manaEnchanting8=After the enchanting begins, the enchanter will require &4Mana&0.
    It can be fed via one of two ways, either via &4Mana Bursts&0 or nearby &1Sparks&0, by placing a &1Spark&0 on top of the enchanter. The later being much faster. -botania.page.manaEnchanting9=When enough &4Mana&0 is gathered, the enchanting process will finalize, and the enchantments will be applied to the item.
    The amount of &4Mana&0 required depends on the rarity of the enchantments being applied, their level, and the total amount of enchantments.
    If any book has more than one enchantment, only the first will be accounted for. -botania.page.manaEnchanting10=During the enchanting process, the item can not be removed, but it can after the process has been completed.
    Note that if at any point, any component of the construct is removed, it'll revert to its original &1Lapis Lazuli Block&0 form. - -# -- SPREADER TURNTABLE -botania.entry.turntable=Spreader Turntable -botania.page.turntable0=The &1Spreader Turntable&0, as its name implies, can turn &1Mana Spreaders&0 around and around. Placing a spreader above the turntable will rotate it, given that a redstone signal isn't applied.
    To change the speed of the turntable, right click with a &1Wand of the Forest&0, shift-right clicking will invert the movement. -botania.page.turntable1=Spin spin spin spin - -# -- BOTANICAL ALCHEMY -botania.entry.manaAlchemy=Alchemising with Mana -botania.page.manaAlchemy0=&4Mana&0 is an extremely volatile substance, to a point that its complete properties and abilities are unknown.
    One of them is known, though, by attaching an &1Alchemy Catalyst&0, created with a mixture of otherworldly materials to the bottom of a &1Mana Pool&0, it enables the pool to perform &4Alchemy&0. -botania.page.manaAlchemy1=Creating the &1Catalyst&0 -botania.page.manaAlchemy2=&1Rotten Flesh&0 to &1Leather&0 -botania.page.manaAlchemy3=Various types of &1Wood&0 -botania.page.manaAlchemy4=Various types of &1Saplings&0 -botania.page.manaAlchemy5=Breaking down &1Glowstone Blocks&0 -botania.page.manaAlchemy6=Breaking down &1Quartz Blocks&0 -botania.page.manaAlchemy7=Creating &1Chiseled Stone Bricks&0 -botania.page.manaAlchemy8=Further freezing &1Snow&0 into &1Ice&0 -botania.page.manaAlchemy9=Converting between &1Vines&0 and &1Lilypads&0 -botania.page.manaAlchemy10=Various breeds of &1Fish&0 -botania.page.manaAlchemy11=Transmuting &1Seeds&0 and &1Crops&0 -botania.page.manaAlchemy12=Purifying &1Poisonous Potatoes&0 -botania.page.manaAlchemy13=Conjuring &1Nether Wart&0 -botania.page.manaAlchemy14=Converting between &1Gunpowder&0 and &1Flint&0 -botania.page.manaAlchemy15=Making &1Name Tags&0 -botania.page.manaAlchemy16=Splitting &1Wool&0 into &1String&0 -botania.page.manaAlchemy17=Converting between &1Slimeballs&0 and &1Cactus&0 -botania.page.manaAlchemy18=Creating &1Ender Pearls&0 -botania.page.manaAlchemy19=Converting between &1Glowstone&0 and &1Redstone&0 -botania.page.manaAlchemy20=Breaking &1Cobblestone&0 into &1Sand&0 -botania.page.manaAlchemy21=Making &1Coarse Dirt&0 - -# -- EYE OF THE ANCIENTS -botania.entry.forestEye=Eye of the Ancients -botania.page.forestEye0=As the Ancients who used to watch over the world always looked for the living beings on it, this block, the &1Eye of the Ancients&0, will do just that.
    By attaching a &1Comparator&0 next to it, it'll send out a redstone signal equivalent to the amount of animals it can find. -botania.page.forestEye1=The counting only starts at 2, so, with 2 animals around, it'd output a signal of strength 1, with 3 animals, of strength 2 and so on.
    Lastly, the time has worn down the sight of the Ancients, so this block can only see animals in about 6 blocks in any direction. -botania.page.forestEye2=Now you see me... - -# -- OPEN CRATE -botania.entry.openCrate=Open Crate -botania.page.openCrate0=Sometimes devices like &1Droppers&0 or &1Dispensers&0 aren't precise or fast enough. A simple solution is to make a crate and punch a hole in the bottom.
    Yeah, it's that simple. The &1Open Crate&0 accepts items from &1Hoppers&0 or any other means of inserting items, and obviously, drops them directly below it. -botania.page.openCrate1=A little interesting effect the &1Open Crate&0 can do is that, when given a redstone signal, any items it drops are prevented from being caught by flowers like the &1Hopperhock&0, &1Rannuncarpus&0 or &1Pollidisiac&0 for around ten seconds more than usual. -botania.page.openCrate2=A super crate box - -# -- DRUM OF THE WILD -botania.entry.forestDrum=Drum of the Wild -botania.page.forestDrum0=The &1Drum of the Wild&0 is, in layman's terms, the percussion counterpart of the &1Horn of the Wild&0. It serves the exact same purpose as the handheld horn, but is placed in world.
    To trigger a beat and break nearby foliage, one would fire a &4Mana Burst&0 at the drum. -botania.page.forestDrum1=It's to note that the drum does not store mana, hence, in order to trigger it, a &1Redstone Mana Spreader&0 or a &1Mana Blaster&0 is required. -botania.page.forestDrum2=But if you close your eyes... - -# -- ABSTRUSE PLATFORM -botania.entry.platform=Abstruse Platform -botania.page.platform0=By laying &1Livingwood&0 on a very specific format it's possible to create a platform of sorts, that only has a physical body for whoever is on top of it and isn't sneaking. For anyone else, it's like it's not there. &4Mana Bursts&0 will always travel through it without any trouble.
    It's also possible to camouflage this block as any other simple block by simply right clicking it. -botania.page.platform2=Right clicking a platform with a block in it with a &1Wand of the Forest&0 will change all connected platforms with no block set to them to the block on the one clicked. Shift-right clicking removes all blocks. -botania.page.platform1=It would be Ethereal but the name was taken - -# -- CONJURING WITH MANA -botania.entry.manaConjuration=Conjuring with Mana -botania.page.manaConjuration0=Similar to the ability to &4Alchemise with Mana&0, a catalyst also exists for &4Conjuration&0, the magic of materializing resources from magical energy only. The mechanism works in a similar way to the &1Alchemy Catalyst&0 where one tosses an item into the pool with the catalyst below. -botania.page.manaConjuration1=Creating the catalyst -botania.page.manaConjuration2=Conjuring &1Redstone&0 -botania.page.manaConjuration3=Conjuring &1Glowstone&0 -botania.page.manaConjuration4=Conjuring &1Quartz&0 -botania.page.manaConjuration5=Conjuring &1Coal&0 -botania.page.manaConjuration6=Conjuring &1Snow&0 -botania.page.manaConjuration7=Conjuring &1Netherrack&0 -botania.page.manaConjuration8=Conjuring &1Soul Sand&0 -botania.page.manaConjuration9=Conjuring &1Gravel&0 - -# -- SPECTRAL PLATFORM -botania.entry.spectralPlatform=Spectral Platform -botania.page.spectralPlatform0=The &1Spectral Platform&0 isn't more than an &1Abstruse Platform&0 with no physical body whatsoever. Whereas the &1Abstruse Platform&0 would have a physical body in some cases, the &1Spectral Platform&0 lets anything go through it, regardless of their position. -botania.page.spectralPlatform1=This reminds me of a Puzzle - -# -- DRUM OF THE GATHERING -botania.entry.gatherDrum=Drum of the Gathering -botania.page.gatherDrum0=The &1Drum of the Gathering&0 is, in short terms, a &1Drum of the Wild&0 for livestock.
    When a &4Mana Burst&0 collides with it, it'll shear any &4Sheep&0 around with grown fleece. Any &4Cows&0, with &1Empty Buckets&0 below them will have their milk transfered to the buckets. -botania.page.gatherDrum1=Tap your lands - -# -- LIFE IMBUER -botania.entry.spawnerClaw=Life Imbuer -botania.page.spawnerClaw0=&1Monster Spawners&0 are an interesting bunch. They have the ability to bring out life from thin air, but somehow, this only manifests when there's a player nearby.
    This, of course, tends to be a rather limiting factor in the onslaught of any creatures that they can create. -botania.page.spawnerClaw1=By placing a &1Life Imbuer&0 on top of a &1Monster Spawner&0 and giving it a rather decent chunk of &4Mana&0 through a &1Mana Spreader&0, when there aren't any players in the nearby vicinity, the &4Mana&0 will power the spawner, just as if there were players around. -botania.page.spawnerClaw2=Something something shadow dragon - -# -- CRAFTY CRATE -botania.entry.craftCrate=Crafty Crate -botania.page.craftCrate0=As the name suggests, the &1Crafty Crate&0 is a counterpart to the &1Open Crate&0 with the ability to assemble items into other items similarly to a &1Crafting Table&0.
    Like a &1Crafting Table&0, it has a 9 slot inventory, which can be filled with items in the pattern of a recipe. -botania.page.craftCrate1=The items go in from left to right and top to bottom (illustration further in this entry), to that, there's a special item, named the &1Crafting Placeholder&0, which, when placed in, counts as an empty slot in the recipe. This is used to allow for recipes with gaps (eg, furnace, chest, pickaxe...) to also be doable. -botania.page.craftCrate2=Creating the placeholder -botania.page.craftCrate3=To finish the recipe, one of two things can be done.
    First off, filling every of the 9 slots with either recipe components or placeholders will instantly eject the result, the placeholders and any lefovers (e.g. buckets when making cake), this is the most straightforward method. -botania.page.craftCrate4=Right clicking the crate with a &1Wand of the Forest&0 (remember: &1Dispensers&0 can do this) will attempt at crafting with whatever is inside the crate and eject it.
    If this fails all the items inside are simply ejected with no crafting procedure done. -botania.page.craftCrate7=Attaching a &1Comparator&0 to the crate will have it emit a signal equal to the amount of items inside the crate, which can be an extremely valuable asset in creating mechanisms with it. -botania.page.craftCrate5=An example of crafting a &1Diamond Pickaxe&0 -botania.page.craftCrate6=Made in Portugal - -# -- ENDER OVERSEER -botania.entry.enderEyeBlock=Ender Overseer -botania.page.enderEyeBlock0=The eyes of an &4Enderman&0 have an interesting sensitivity to being watched. A block out of these will simply output a &4redstone signal&0 if a player within a 64 block radius is looking directly at it.
    Of course, wearing a &1Pumpkin&0 negates this effect. -botania.page.enderEyeBlock1=MY BRAND - -# - MYSTICAL INSTRUMENTS -# -- MANA BLASTER -botania.entry.manaBlaster=Mana Blaster -botania.page.manaBlaster0=The &1Mana Blaster&0 is like a portable &1Mana Spreader&0, while shaped like a pistol for easy handling, it's not exactly a firearm, as much as it is just a portable spreader.
    By utilizing &4Mana&0 from &4Mana carrying items&0 in the holder's inventory, it can shoot a mana burst when one is looking at. -botania.page.manaBlaster1=This burst is a bit different from the one fired from speaders, as it's faster, but carries only three quarters of the mana a spreader burst would. There's also a short cooldown period after firing the blaster until another burst can be shot. -botania.page.manaBlaster2=&1Mana Lenses&0 also function with the blaster, to attach one to it, put them side by side on a crafting table, to remove it, simply shift-right click the blaster. -botania.page.manaBlaster3=We need more dakka - -# -- PASTURE SEEDS -botania.entry.grassSeeds=Pasture Seeds -botania.page.grassSeeds0=Watching grass spread is seldom a fun activity. By infusing some &1Tall Grass&0 with &4Mana&0, it's possible to create &1Pasture Seeds&0, which will grow grass in any barren area, via a simple right click on dirt.
    Other types of foliage can also be grown, such a &1Podzol&0 or &1Mycellium&0 with alternate seeds. -botania.page.grassSeeds1=&1Pasture Seeds&0 for grass -botania.page.grassSeeds2=&1Boreal Seeds&0 for podzol -botania.page.grassSeeds3=&1Infestation Spores&0 for mycellium - -# -- ROD THE LANDS -botania.entry.dirtRod=Rod of the Lands -botania.page.dirtRod0=The &1Rod of the Lands&0 is a rather simpleton tool, by utilizing &4Mana&0 from your inventory (via a &1Mana Tablet&0 or others), it can materialize and place a &1Dirt&0 block down. -botania.page.dirtRod1=That's dirty - -# -- TERRA FIRMA ROD -botania.entry.terraformRod=Terra Firma Rod -botania.page.terraformRod0=While digging away at dirt with a shovel is definitely functional, flattening huge tracts of land can get somewhat tortuous at times.
    By utilizing the &1Terra Firma Rod&0, it's possible to terraform in a quick and environmental friendly manner. -botania.page.terraformRod1=This rod, will, at the cost of some &4Mana&0 from your inventory, flatten the land to the level you are standing. For this to happen, charge it by &4holding right-click&0 and, slowly but surely, the nearby terrain will be flattened to your level, either by placing &1Dirt&0 or by removing blocks. -botania.page.terraformRod2=Note that blocks removed by the rod are non-recuperable. The terrain will adapt to the changes as best as it can, up to a distance limit, to avoid cuts in hills and the like, for this, the flattening will work in the terrain's natural look.
    Lastly, the rod will cease to function whatsoever below sea level. -botania.page.terraformRod3=Quite a justicar - -# -- MANASTEEL EQUIPMENT -botania.entry.manaGear=Manasteel Equipment -botania.page.manaGear0=&1Manasteel&0, alike other metals, can be shaped into tools and armor alike.
    Tools or armor crafted from this material will share their properties with &1Iron&0, albeit somewhat superior in enchantability and durability. Whenever a &1Manasteel&0 item is to take damage, if there's &4Mana&0 available in the inventory (such as a &1Mana Tablet&0), it'll use that instead. -botania.page.manaGear1=The &1Manasteel Pickaxe&0 -botania.page.manaGear2=The &1Manasteel Shovel&0 -botania.page.manaGear3=The &1Manasteel Axe&0 -botania.page.manaGear4=The &1Manasteel Shears&0 -botania.page.manaGear5=The &1Manasteel Sword&0 -botania.page.manaGear6=The &1Manasteel Helmet&0 -botania.page.manaGear7=The &1Manasteel Chestplate&0 -botania.page.manaGear8=The &1Manasteel Leggings&0 -botania.page.manaGear9=The &1Manasteel Boots&0 - -# -- HORN OF THE WILD -botania.entry.grassHorn=Horn of the Wild -botania.page.grassHorn0=Clearing out &1Tall Grass&0 by hand can definitely be a nuisance.
    Simply blowing the &1Horn of the Wild&0 will quickly cause any nearby vegetation to uproot, leaving behind drops as if it had been broken by hand.
    With some modifications, the horn can be modified to break leaves instead. -botania.page.grassHorn1=Crafting the horn -botania.page.grassHorn2=Modifying the horn - -# -- TERRASTEEL ARMOR -botania.entry.terrasteelArmor=Terrasteel Armor -botania.page.terrasteelArmor0=Armor made out of &1Terrasteel&0, much alike the &1Manasteel&0 counterpart, can utilize &4Mana&0 from the inventory instead of taking damage.
    This armor, however, has properties more alike &1Diamond&0 instead of &1Iron&0 and increases the wearer's health when worn. -botania.page.terrasteelArmor1=The &1Terrasteel Helmet&0 -botania.page.terrasteelArmor2=The &1Terrasteel Chestplate&0 -botania.page.terrasteelArmor3=The &1Terrasteel Leggings&0 -botania.page.terrasteelArmor4=The &1Terrasteel Boots&0 - -# -- TERRA BLADE -botania.entry.terraSword=Terra Blade -botania.page.terraSword0=The &1Terra Blade&0, crafted from &1Terrasteel Ingots&0, is a sword infused with natural strength. Not only does it par with a &1Diamond Sword&0 in terms of strength and it uses &4Mana&0 from the inventory like &1Manasteel Tools&0, but when swung, there's a chance for it to create a beam that will deal as much damage as a melee hit. -botania.page.terraSword1=No Broken Hero Sword - -# -- TERRA SHATTERER -botania.entry.terraPick=Terra Shatterer -botania.page.terraPick0=The &1Terra Shatterer&0 is a tool that can amass insane quantities of mana on itself, due to the amount of &1Terrasteel&0 required for its creation.
    The tool functions very much like a &1Mana Tablet&0 by which it can amass &4Mana&0 by being tossed on a &1Mana Pool&0, it can't give the &4Mana&0 back, though, so it doesn't function as a storage method. -botania.page.terraPick1=The amount of &4Mana&0 stored on the tool defines its &4Rank&0. Ranks go as follows: &4D&0, &4C&0, &4B&0, &4A&0, &4S&0, &4SS&0. &4D&0 being the default rank.
    The amount of &4Mana&0 required to advance from rank to rank increases as the rank does. To advance from &4D&0 to &4C&0, for example, it requires just a few seconds of exposition to a &1Mana Pool&0. -botania.page.terraPick2=To advance from rank &4C&0 to rank &4B&0, a full &1Mana Pool&0 is required, and the cost increases by a tenfold per rank from there on in, all the way to &4SS&0.
    The rank of the tool does not change its speed, but instead, it increases the power of its &4Active Ability&0.
    Toggling the tool's ability can be done via right click. -botania.page.terraPick3=While the tool is active, it enables it to break blocks in an extended area. At rank &4C&0 it's a small column, which increases to a square at rank &4B&0, that gets larger trough the ranks. It's to note that the rank &4D&0 tool does not have the active ability.
    Having the tool active consumes &4Mana&0 from its storage passively, even if not being used to mine. -botania.page.terraPick4=Lastly, the tool takes damage for every single block broken, so a good supply of &4Mana&0 in the wielder's inventory is a must for the higher ranks, as the tool does function like normal &1Manasteel Tools&0, in which it'll use &4Mana&0 instead of actually taking damage, given it's made of &1Terrasteel&0.
    It also won't despawn like regular dropped items. -botania.page.terraPick5=Stronger than a Gastrea - -# -- SOULSCRIBE -botania.entry.enderDagger=Soulscribe -botania.page.enderDagger0=Those &4Endermen&0. They're the second more pesky thing since &4Creepers&0. I swear, the person who came up with them must have taken a &onotch&r too much of their drink.
    However, by infusing a standard dagger with some of their energy, one can create the &1Soulscribe&0, a dagger that tears through &1Endermen&0 as if they were butter. -botania.page.enderDagger1=Due of the type of infusion, though, the dagger only lasts for a few kills, and the energy that radiates from it prevents the &1Manasteel&0 from gathering &4Mana&0 to avoid damage, like typical tools would. Still, all in the name of killing those monsters. -botania.page.enderDagger2=Strike my Soul - -# -- ROD OF THE SEAS -botania.entry.waterRod=Rod of the Seas -botania.page.waterRod0=Similarly to its land counterpart, the &1Rod of the Seas&0 will, at the cost of some &4Mana&0, place down a &1Water&0 block wherever it's used on. Furthermore, it can also be used to refill a &1Petal Apothecary&0. -botania.page.waterRod1=Keep the Earth clean, it isn't Uranus - -# -- ELEMENTIUM EQUIPMENT -botania.entry.elfGear=Elementium Equipment -botania.page.elfGear0=Similarly to other metals, as expected, &1Elementium&0 can, too, be shaped into tools and armor.
    These pieces of equipment have a decent resistance to damage, about half of that of diamond, as well as the ability to drain &4Mana&0 to prevent damage. -botania.page.elfGear1=Each of the tools come with their own ability or power of sorts which makes them unique. The armor allows the wearer to, when hit, have a chance to spawn a &1Pixie&0 that goes after the attacker, dealing decent damage.
    The more pieces of &1Elementium Armor&0 equipped, the higher the chance. -botania.page.elfGear2=Starting off, the &1Elementium Pickaxe&0 will destroy any &1Cobblestone&0, &1Dirt&0, &1Netherrack&0 and other mundane materials, leaving behind only the ores and fine resources.
    Combining the &1Elementium Pickaxe&0 with a &1Terra Shatterer&0 in a crafting square allows for the latter to also get this power. This can't be undone. -botania.page.elfGear3=I can fit a shower in my pocket, screw cobble -botania.page.elfGear4=The &1Elementium Shovel&0 will, case the block dug is affected by gravity (&1Gravel&0, &1Sand&0, etc), dig all the blocks of that material above and/or below it, no more gravel falling while mining. -botania.page.elfGear5=Putting Things on Top of Other Things -botania.page.elfGear6=The &1Elementium Axe&0 doubles as a weapon, if used to strike the finishing blow to a &4Zombie&0, &4Skeleton&0, &4Creeper&0 or even another &4Player&0, it has a chance to decapitate them, leaving their severed head or skull behind. -botania.page.elfGear7=Off with their heads -botania.page.elfGear8=The &1Elementium Shears&0 hold the ability to, when held back like a bow, shear any nearby sheep with speed within a large area of effect centered on the holder. -botania.page.elfGear9=Nui? She's h-arm-less -botania.page.elfGear10=Lastly, the &1Elementium Sword&0 will increase the chance of a &4Pixie&0 spawning when hit (this holds true when no &1Elementium Armor&0 is worn) and increases the strength of any &4Pixies&0 spawned. -botania.page.elfGear11=The Lambent Light -botania.page.elfGear12=Fortuna on the Sixteenth Night -botania.page.elfGear13=When the Seagulls Cry Breakdown -botania.page.elfGear14=Good People Die -botania.page.elfGear15=The out of Infinity - -# -- EXTRAPOLATED BUCKET -botania.entry.openBucket=Extrapolated Bucket -botania.page.openBucket0=By creating a bucket out of &1Elementium&0 one seems to notice an interesting feature. The liquids acquired by it simply vanish into the ether, never to be seen again. This seems like a great clean up tool. -botania.page.openBucket1=A Souvenir from Lewis - -# -- LIFE AGGREGATOR -botania.entry.spawnerMover=Life Aggregator -botania.page.spawnerMover0=By arranging &1Dragonstone&0, &1Elementium&0 and &1Gaia Spirits&0 in a specific pattern, one can create a device that can contain the curious energies of a &1Monster Spawner&0 and materialize it in another point in space.
    It's to note that the device will shatter after being used once. -botania.page.spawnerMover1=We got the spawner, but this isn't a won run yet - -# -- ROD OF BIFROST -botania.entry.rainbowRod=Rod of Bifrost -botania.page.rainbowRod0=&4Bifrost&0, the rainbow bridge that reaches between the world and the realm of the gods.
    While this item, the &1Rod of Bifrost&0 doesn't exactly do that, it allows the holder, via a right click and at the cost of some &4Mana&0, to create a rainbow bridge in the direction he or she is looking at. -botania.page.rainbowRod1=This bridge extends as far as a hundred blocks, and will vanish after about fifteen seconds.
    Only one bridge can be created for any given &1Rod of Bifrost&0 at a time, as soon as the old bridge vanishes, a new one can be created. -botania.page.rainbowRod2=Going my way!! Cut open a path and go! - -# -- ROD OF THE SKIES -botania.entry.tornadoRod=Rod of the Skies -botania.page.tornadoRod0=The &1Rod of the Skies&0 is a magical instrument with the ability to propel one in the air at fast velocity for the cost of some &4Mana&0.
    To do so, one would simply hold it like a bow and watch as their momentum increases.
    The rod takes a small amount of time to recharge, but during that time it'll block any fall damage, keeping the user safe. -botania.page.tornadoRod1=A treasure from Lorule - -# -- ROD OF THE HELLS -botania.entry.fireRod=Rod of the Hells -botania.page.fireRod0=The &1Rod of the Hells&0 contains the essence of a burning flame, using it on the ground will create a circle of fire that burns anything inside it, for a decent cost of &4Mana&0.
    The ring has a decent radius, and takes a small amount of time to fully propagate, it's to note that after that time it burns anything living in it, the caster included. -botania.page.fireRod1=Megu Megu Fire Endless Night - -# -- VINE BALLS -botania.entry.vineBall=Vine Balls -botania.page.vineBall0=&1Ladders&0 can't stand up on their own, they require something on their back, whereas &1Vines&0 don't. Normally, though, &1Vines&0 aren't strong enough for someone to climb them when they're freestanding.
    By combining a few &1Vines&0, it's possible to create a ball that can be thrown, to create a climbable ladder of strong &1Vines&0 where it hits. -botania.page.vineBall1=It's also possible, by combining some materials such as &1Livingwood&0 or a &1Rune of Air&0 to create a slingshot that lets these &1Vine Balls&0 be shot while completely ignoring the force of gravity. -botania.page.vineBall2=This would be in Vineacraft... -botania.page.vineBall3=...if that actually existed. - -# -- SHARD OF LAPUTA -botania.entry.laputaShard=Shard of Laputa -botania.page.laputaShard0=Via a somewhat complex magic activation sequence, combining a few interesting resources, including &1Gaia Spirits&0 would allow one to create a shard that, when used on the ground, will allow one to lift a spherical area around that point up into the air.
    This process consumes the shard and can take upwards of ten minutes depending on the mass of land. -botania.page.laputaShard2=The radius of the island creates start at 14 blocks, on other words, 28 blocks of diameter. It's possible to increase the size by upgrading the shard with additional &1Gaia Spirits&0, each one adds 1 block to the radius, or 2 to the diameter. -botania.page.laputaShard1=Look Shiro, Laputa exists! -botania.page.laputaShard3=Size does matter - -# -- EQUESTRIAN VIRUS -botania.entry.virus=Equestrian Virus -botania.page.virus0=Through the mixing of some ingredients, a type of virus that can alter the genetic code of equestrian life can be made.
    Using one of these viruses on a &1Horse&0 will alter its genetic code, turning it into either a &1Zombie&0 or &1Skeleton Horse&0. Not only will it do that, but it will vastly increase all the &1Horse&0's genetic attributes. -botania.page.virus1=No ponies here -botania.page.virus2=None here either - -# -- ROD OF THE HIGHLANDS -botania.entry.skyDirtRod=Rod of the Highlands -botania.page.skyDirtRod0=While the &1Rod of the Lands&0 is all well and good, being able to place &1Dirt&0 without something to hold it would be great.
    The &1Rod of the Highlands&0 does just that, while maintaining the original power of the &1Rod of the Lands&0, it can also place &1Dirt&0 in mid air, for an increased &4Mana&0 cost. -botania.page.skyDirtRod1=Dirty Stick mk2 - -# -- HAND OF ENDER -botania.entry.enderHand=Hand of Ender -botania.page.enderHand0=The &1Hand of Ender&0 allows the user to access the interdimensional ender field, on other words, their &1Ender Chest&0 inventory. This can be done anywhere by right clicking with the hand at the cost of some &4Mana&0.
    Using the hand on another player will open up &otheir&r inventory instead, at a lot higher &4Mana&0 cost. -botania.page.enderHand0a=The &1Hand of Ender&0 allows the user to access the interdimensional ender field, on other words, their &1Ender Chest&0 inventory. This can be done anywhere by right clicking with the hand at the cost of some &4Mana&0. -botania.page.enderHand1=Zezima hates him! -botania.page.enderHand1a=It's like the 4G of Ender Chests - -# -- VITREOUS PICKAXE -botania.entry.glassPick=Vitreous Pickaxe -botania.page.glassPick0=Placing down &1Glass&0 and having to break it again can be a heartbreaking experience. Luckily, by creating a &1Vitreous Pickaxe&0, one can gather the &1Glass&0 back by mining it with the pick, it's like cheap &4Silk Touch&0 for glass! -botania.page.glassPick1=Trapped inside with food - -# -- ROD OF DIVINING -botania.entry.diviningRod=Rod of Divining -botania.page.diviningRod0=As its name implies, the &1Rod of Divining&0 has the ability to divine in a decently large radius around the user to find any ores. These will shine for a little bit, allowing their location.
    This process, obviously, requires a decent amount of &4Mana&0 from the user's inventory. -botania.page.diviningRod1=inb4 ee3 - -# -- ROD OF THE BLACK MESA -botania.entry.gravityRod=Rod of the Black Mesa -botania.page.gravityRod0=The &1Rod of the Black Mesa&0 is a powerful relic, legend says that the first of these devices was found atop a dark mesa, along with a crowbar.
    To use this device, the user may right click and hold on a monster or item to pick it up. Releasing right click will drop the selected entity, while left click will fire it in a powerful burst. -botania.page.gravityRod1=This power does not come free, of course. It requires significant amounts of &4Mana&0 from the user's inventory. -botania.page.gravityRod2=Why the flax? - -# -- TIMELESS IVY -botania.entry.regenIvy=Timeless Ivy -botania.page.regenIvy0=While &1Manasteel&0 or &1Elementium&0 tools have the ability to harness &4Mana&0 and use it to protect their bodies, other tools or armor don't have this property.
    A handful of &1Timeless Ivy&0 can be attached on to virtually any item, allowing it to be repaired with &4Mana&0. -botania.page.regenIvy1=To apply it, one'd simply craft the tool in question alongside the ivy and 3 of an item that can be used to repair the tool in an anvil (eg. &1Diamonds&0 for a &1Diamond Pickaxe&0).
    Due to not being in direct contact with the material, the amount of &4Mana&0 used by the ivy in comparison to &1Manasteel&0 is rather high. -botania.page.regenIvy2=Cut it in Varrock - -# - BAUBLES -# -- AN INTRODUCTION TO BAUBLES -botania.entry.bIntro=An Introduction to Baubles -botania.page.bIntro0=&4Baubles&0, also commonly referred to as &4Trinkets&0 or &4Charms&0 are pieces of equipment which offer all sorts of different effects, when worn.
    To equip them, one can press the &4B&0 (configurable) key. There's four slots, one &4Amulet&0 slot, two &4Ring&0 slots and one &4Belt&0 slot. -botania.page.bIntro1=The &4Baubles Screen&0 -botania.page.bIntro2=It's to note that, if &4Thaumcraft&0 or any other mod that uses the baubles system is installed, this inventory will be shared between the various mods. - -# -- TINY PLANET -botania.entry.tinyPlanet=Tiny Planet -botania.page.tinyPlanet0=The &1Tiny Planet&0 is a &4Bauble&0 with gravitational proprieties, while equipped, the &1Tiny Planet&0 will pull any nearby &4Mana Bursts&0 towards the wearer, having them orbit around him or her.
    By increasing its mass with some &1Stone&0, it can also be placed in world, for the same effect. -botania.page.tinyPlanet1=Clearly from rebirth -botania.page.tinyPlanet2=More of a planet than Pluto - -# -- BAND OF MANA -botania.entry.manaRing=Band of Mana -botania.page.manaRing0=Combining a &1Mana Tablet&0 with some &1Manasteel&0 creates an easily worn &4Ring&0, that functions exactly similar to the tablet used to make it, but can be worn as a &4Bauble&0.
    Using some &1Terrasteel&0 allows for an upgrade, which lets it store about four times as much &4Mana&0. -botania.page.manaRing1=Creating the ring -botania.page.manaRing2=Upgrading the ring - -# -- BAND OF AURA -botania.entry.auraRing=Band of Aura -botania.page.auraRing0=The &1Band of Aura&0 is a bit of a deviation from the typical &1Band of Mana&0, in which, instead of storing &4Mana&0, it slowly, while equipped, creates it and stores it into &4Mana&0 containing items in the wearer's inventory.
    Using some &1Terrasteel&0 allows for an upgrade, which lets it generate &4Mana&0 at a significantly faster rate. -botania.page.auraRing1=Creating the ring -botania.page.auraRing2=Upgrading the ring - -# -- SOUJOURNER'S SASH -botania.entry.travelBelt=Soujourner's Sash -botania.page.travelBelt0=Traversing terrain sometimes proves to be a hassle. The &1Soujourner's Sash&0 can be equipped in the &4Belt&0 slot, and when worn will increase the movement speed, jump height and resistance to fall damage of the wearer.
    Lastly, if not sneaking, it also allows the wearer to walk over 1 block high gaps without jumping with ease. -botania.page.travelBelt1=...everell - -# -- TECTONIC GIRDLE -botania.entry.knockbackBelt=Tectonic Girdle -botania.page.knockbackBelt0=By harnessing the forces of tectonic movement, the &1Tectonic Girdle&0, when worn, will negate any &4Knockback&0 applied to the wearer by outside attacks. -botania.page.knockbackBelt1=Don't... move - -# -- SNOWFLAKE PENDANT -botania.entry.icePendant=Snowflake Pendant -botania.page.icePendant0=The &1Snowflake Pendant&0 is a &4Bauble&0 that resonates freezing energy, while it's worn, any nearby still &1Water&0 blocks at foot level will be converted into &1Ice&0.
    The &1Ice&0 will melt shortly afterward the wearer leaves the area. Lastly, this charm will not freeze any blocks if the wearer is sneaking or fully submerged. -botania.page.icePendant1=Do you want to build a snowman? - -# -- PYROCLAST PENDANT -botania.entry.lavaPendant=Pyroclast Pendant -botania.page.lavaPendant0=The &1Pyroclast Pendant&0 is a &4Bauble&0 that absorbs low heat, while it's worn, if the wearer is caught on fire and is not directly standing on &1Fire&0, &1Lava&0 or anything else that can induce burning, they'll be extinguished. -botania.page.lavaPendant1=Hanako could have used one of these - -# -- GOLDEN LAUREL CROWN -botania.entry.goldenLaurel=Golden Laurel Crown -botania.page.goldenLaurel0=One of the uses for &1Gaia Spririts&0 is to, grant a layer of immortality to one that uses them, while wearing a &1Golden Laurel Crown&0, if the wearer were to die, the crown will shatter, regenerating all of their health and giving them a short period of invincibility. -botania.page.goldenLaurel1=Given the theme, probably Viridi - -# -- RING OF CHORDATA -botania.entry.waterRing=Ring of Chordata -botania.page.waterRing0=The &1Ring of Chordata&0 allows the wearer to swim like a fish. While it's equipped, the wearer is bestowed with the ability to accelerate to a decent speed while underwater. It also gives the wearer good sight underwater and, if &4Mana&0 is present, at the cost of some of it, the ability to breathe indefinitely. -botania.page.waterRing1=Go swim with the fishes - -# -- RING OF THE MANTLE -botania.entry.miningRing=Ring of the Mantle -botania.page.miningRing0=The &1Ring of the Mantle&0 allows one to mine faster, while equipped and &4Mana&0 is present in the inventory, it'll give a &4Haste&0 effect to the wearer. Some &4Mana&0 is used while the wearer swings their arm or equipped item, be it for attacking, mining or just flailing. -botania.page.miningRing1=Diggy diggy hole - -# -- RING OF MAGNETIZATION -botania.entry.magnetRing=Ring of Magnetization -botania.page.magnetRing0=By turning a &1Magnetizing Lens&0 into a wearable ring, one can use it to magnetize nearby items.
    While equipped, this ring will make any nearby items magnetize towards the wearer, case they aren't sneaking. -botania.page.magnetRing1=How do they work? - -# -- RING OF FAR REACH -botania.entry.reachRing=Ring of Far Reach -botania.page.reachRing0=Through the power of one's Pride, nothing is out of their reach. By wearing the &1Ring of Far Reach&0, the maximum distance the wearer can break, place or interact with blocks, as well as attack or interact with entities is increased by about three blocks. -botania.page.reachRing1=Fire and Blood - -# -- CHARM OF THE DIVA -botania.entry.divaCharm=Charm of the Diva -botania.page.divaCharm0=The &1Charm of the Diva&0 blesses the wearer with the ability to have any attacked mob follow the attacker's will, and, case there are any nearby enemies, go after them instead. This process, of course, requires a bit of &4Mana&0 from the wearer's inventory in order to function. -botania.page.divaCharm1=You shall not disrespect Big Sister - -# -- FLUGEL TIARA -botania.entry.flightTiara=Flügel Tiara -botania.page.flightTiara0=The &4Flügel&0 were once a dominant species in the lands, now they're but a race past extinct, once created as godslayers, who possessed the ability of flight.
    The usage of &1Gaia Spirits&0 allows for a small replica of their power, in the form of the &1Flügel Tiara&0, which, at the cost of &4Mana&0 allows for flight. -botania.page.flightTiara1=Forty thousand books from another world -botania.page.flightTiara2=Combining the Tiara with a variety of Quartz species allows for it to create various different kinds of aesthetic wings, one for each style of quartz.
    The recipes for the various types of quartz can be found in the &4Decorative Blocks&0 entry under &4Misclaneous&0, &1Elven Quartz&0 is acquired by trading &1Nether Quartz&0 with the elves. -botania.page.flightTiara3=Adding Wings (they can be swapped any time) - -# -- GREAT FAIRY RING -botania.entry.pixieRing=Great Fairy Ring -botania.page.pixieRing0=This ring works alongside the &1Elementium Armor&0, insight in the powers of it is advised before using this ring. When worn, the &1Great Fairy Ring&0 will increase the chance for a &4Pixie&0 to spawn when the wearer is hit, this still holds true case no &1Elementium Armor&0 is equipped. -botania.page.pixieRing1=We got square heads, big pointy caps - -# -- GLOBETROTTER'S SASH -botania.entry.superTravelBelt=Globetrotter's Sash -botania.page.superTravelBelt0=The &1Globetrotter's Sash&0 is, in layman's terms, an upgrade to then &1Soujourner's Sash&0, by using &1Gaia Spirits&0 and some Elven resources, this new belt allows the wearer to reach incredible speeds to which the &1Soujourner's Sash&0 doesn't stand a chance. -botania.page.superTravelBelt1=No time for guessing, follow my plan instead - -# -- THE SPECTATOR -botania.entry.itemFinder=The Spectator -botania.page.itemFinder0=&1The Spectator&0 is a headband that allows the wearer to have a better perception of the world. While holding an item, any &4containers&0 (chests, minecarts, donkeys with chests, furnaces, etc...) that have an item of that type, &4dropped items&0 of that type, &4mobs&0 who have that item equipped &o(...)&r -botania.page.itemFinder1=&o(...)&r &4players&0 who have the item in their inventory and &4villagers&0 who want to trade either with or for that item will shine with a green glow, allowing them to be easily spotted.
    While sneaking, all dropped items around the wearer will shine, regardless of the item. -botania.page.itemFinder2=Do you hear their voices? - -# -- CRIMSON PENDANT -botania.entry.superLavaPendant=Crimson Pendant -botania.page.superLavaPendant0=The &1Crimson Pendant&0 is, in simple terms, an upgraded counterpart to the &1Pyroclast Pendant&0, wearing it provides the wearer immunity to all fire and lava damage, instead of just extinguishing them. -botania.page.superLavaPendant1=Runner-up on Monolith Code - -# - ALFHOMANCY -# -- THE PORTAL TO ALFHEIM -botania.entry.aIntro=The Portal to Alfheim -botania.page.aIntro0=Once, in olden times, &4Elves&0 used to share the world with us &4Minecrafters&0. Due to unknown events, they have been banished back to their own world, &4Alfheim&0.
    Experimentation has been done in atempt to bridge the gap between the two worlds, and means of creating a portal that does just that have been devised. -botania.page.aIntro1=Creating this portal proves not to be an easy task, as quite a few exquisite resources are necessary. The requirements are as follows: 8 &1Livingwood&0 blocks, 3 &1Glimmering Livingwood&0 blocks, 1 &1Elven Gateway Core&0 (read on), 2 &1Mana Pools&0 and 2 &1Natura Pylons&0 (read on). -botania.page.aIntro2=Creating the &1Elven Gateway Core&0 -botania.page.aIntro3=Creating &1Natura Pylons&0 -botania.page.aIntro4=Make a frame of &1Livingwood&0 -botania.page.aIntro5=Add &1Glimmering Livingwood&0 -botania.page.aIntro6=Place the &1Elven Gateway Core&0 -botania.page.aIntro7=Add &1Mana Pools&0 -botania.page.aIntro8=Place &1Natura Pylons&0 above the pools -botania.page.aIntro9=To open up the portal, simply right click the core with a &1Wand of the Forest&0.
    The portal requires a substantial amount of &4Mana&0 deposited in both the pools to open up, after that, it'll slowly drain some to keep itself powered. If it runs out of &4Mana&0, the connection will be broken. -botania.page.aIntro10=The amount of &4Mana&0 required to open up the portal is orders of magnitude higher than that to keep it maintained, thus closing the portal to prevent &4Mana&0 loss is a poor strategy.
    Furthermore, the link isn't strong enough to allow living beings to go through it, but it seems that &4items&0 can. -botania.page.aIntro11=The amount of information about &1Alfheim&0 stored in this lexicon is resumed to this entry alone, perhaps &4letting the Elves have a look at it&0 might prove beneficial. - -# -- A MESSAGE FROM ELVEN GARDE -botania.entry.elfMessage=A Message from Elven Garde -botania.page.elfMessage0= -# ^ This is blank on purpose -botania.page.elfMessage1=&oGreetings. We noticed that our portal was opened via a link from another world. That's rather shocking news indeed. We thank you very much for providing us with a repository of the knowledge from your world, as to keep us up to date to what happened since we left it, it's been a while since then, indeed. -botania.page.elfMessage2=&oAfter some discussion with the high council of Elven Garde, we have decided to cooperate with you. You see, reading through your "Lexica Botania" has shown us a good amount of resources from your world that we would be extremely keen as to get our hands on, as these are non-existent in our lands. -botania.page.elfMessage3=&oThe link you have managed to establish is rather weak, no living beings will be able to go through, as you already know. However, there's a positive side to this, the link strikes the fabric of time of both our worlds in a way where it doesn't keep them in sync, that's the reason why you received your book back so quickly. -botania.page.elfMessage4=&oWhen it comes to Mana and other magical energies, we are plenty stocked on them, so worry not about the portal closing on our end. Let's put this in prospect, in order for the advance of both our civilizations, we vow to accept a given set of resources from your world we lack in ours in exchange for resources you lack in yours. -botania.page.elfMessage5=&oWe have taken the liberty of assigning our best scribes to put together a great set of knowledge from our world we're willing to share, you can find it in your lexicon just as you'd find knowledge from yours. We hope you find it enlightening and that it encourages you to invest in our materials. -botania.page.elfMessage6=&oLast but not least, do keep in mind that if you decide to send something we have not vouched to trade for, we will assume it as a gift and keep it for ourselves, just as a forewarning. We look forward to exchanging resources with you.
    Best Regards, the High Council of Elven Garde. - -# -- THE RESOURCES OF ALFHEIM -botania.entry.elfResources=The Resources of Alfheim -botania.page.elfResources0=&4Alfheim&0 contains a very varied amount of exquisite resources. Sadly though, most of them are extremely scarce and hard to come by due to competition between the various clans. The elves are interested in trading some materials, such as &1Dreamwood&0, &1Elementium&0, &1Pixie Dust&0 or &1Dragonstone&0, resources native to their lands. -botania.page.elfResources1=Trading for &1Dreamwood&0 -botania.page.elfResources2=&1Dreamwood&0, similarly to &1Livingwood&0 can be turned into various &4Decorative Blocks&0, have a look through the &4Decorative Blocks&0 entry under &4Miscelaneous&0 for the recipes. -botania.page.elfResources3=Trading for &1Elementium&0 -botania.page.elfResources4=Trading for &1Pixie Dust&0 -botania.page.elfResources5=Trading for &1Dragonstone&0 -botania.page.elfResources6=The &1Elves&0 are also quite keen on the white posh block from the &4Nether&0, &1Nether Quartz&0, the ones they have on their world are tinted green. This quartz works just like any other quartz, be it normal &1Nether Quartz&0 or any of the decorative variants you can find on the &4Decorative Blocks&0 entry under &4Miscelaneous&0. -botania.page.elfResources7=Trading for &1Elven Quartz&0 -botania.page.elfResources8=Alfheim also has its own variant of &1Glass&0, in the form of &1Alfglass&0. Its look is rather light and its patterns are randomized depending on where it's placed. -botania.page.elfResources9=Trading for &1Alfglass&0 - -# -- RITUAL OF GAIA -botania.entry.gaiaRitual=Ritual of Gaia -botania.page.gaiaRitual0=The &4Ritual of Gaia&0 is a procedure often enacted by the elves, which is the only way to acquire &1Gaia Spirits&0, which are essences of the power of the Goddess of Gaia herself.
    This ritual required an &4Active&0 &1Beacon&0 with some &1Gaia Pylons&0 (read on) one level above the beacon as the altar, as well as a single &1Terrasteel Ingot&0 as a sacrifice. -botania.page.gaiaRitual1=Creating &1Gaia Pylons&0 -botania.page.gaiaRitual2=Place the pylons (1 block above the beacon) -botania.page.gaiaRitual3=To start the ritual, simply shift-right click the &1Beacon&0 block with a &1Terrasteel Ingot&0, take a step back and prepare to fight for your life. Good preparation is required, as the fight with the &4Guardian of Gaia&0 can be even harder than that of the &4Wither&0. Upon defeating the &4Guardian&0, one can collect their prize, a handful of &1Spirits of Gaia&0. -botania.page.gaiaRitual4=A few pointers to take in mind are as follows. Enchanted &1Elementium Armor&0 is highly recommended, even more so than conventional &1Diamond Armor&0 due to the &1Pixies&0 it can spawn.
    The effect on the &1Beacon&0 is nullified during the battle, that should be taken in mind when preparing.
    Lastly, stay away from the purple. - -# - MISCLANEOUS -# -- UNSTABLE CUBE -botania.entry.unstableBlocks=Unstable Cubes -botania.page.unstableBlocks0=Fiddling with highly powerful &4Mana&0 infused objects has lead to the creation of these strange cubes. They seem to emit some visual radiation in the form of colorful lightning, but it doesn't seem like it has any effects other than visual appeal. -botania.page.unstableBlocks1=They look fancy -botania.page.unstableBlocks2=And they come in all 16 colors -botania.page.unstableBlocks3=There's also a way of creating a different version of these that releases an extremely larger amount of energy, this time in the form of a beam towards the sky that extends into a cloud of sorts. This one also seems to be disableable via a &4Redstone Signal&0, it's called an &1Unstable Beacon&0, as it looks like one somehow. -botania.page.unstableBlocks4=Fireworks? -botania.page.unstableBlocks5=Combined entropy -botania.page.unstableBlocks6=It's also possible, by using the &1Unstable Beacons&0, to turn them into a manageable and portable utility, in the form of the &1Signal Flare&0.
    This gun of sorts shoots a colored round into the sky that lasts a few seconds, it also stuns any nearby enemies for just as long. -botania.page.unstableBlocks7=Shoot in case of titan - -# -- DECORATIVE BLOCKS -botania.entry.decorativeBlocks=Decorative Blocks -botania.page.decorativeBlocks0=Past functionality, quite a few decorative blocks are available to make your builds look better.
    Starting off. It's possible to turn blocks of &1Livingrock&0 and &1Livingwood&0 into decorative blocks. Each of them features 4 different decorative variations. -botania.page.decorativeBlocks1=Livingrock bricks. -botania.page.decorativeBlocks2=Mossing the bricks -botania.page.decorativeBlocks3=Cracking the bricks -botania.page.decorativeBlocks4=Framing the bricks -botania.page.decorativeBlocks5=Turning wood into planks -botania.page.decorativeBlocks6=Mossing the planks -botania.page.decorativeBlocks7=Framing the planks -botania.page.decorativeBlocks8=Pattern planks -botania.page.decorativeBlocks9=Glimmering livingwood -botania.page.decorativeBlocks10=Carrying on, by combining &1Nether Quartz&0 with all sorts of other substances, it's possible to create a wide array of other decorative &1Quartz&0 blocks.
    As expected, all these items can be crafted into all their decorative block counterparts just like regular &1Quartz&0 blocks are crafted. -botania.page.decorativeBlocks11=Smokey Quartz -botania.page.decorativeBlocks12=Mana Quartz -botania.page.decorativeBlocks13=Blaze Quartz -botania.page.decorativeBlocks14=Lavender Quartz -botania.page.decorativeBlocks15=Redquartz -botania.page.decorativeBlocks16=A few blocks can be organized in methods different than normal to create new building blocks, such as &1Reed Blocks&0, &1Thatch&0, &1Roof Tiles&0 and a few new &1Bricks&0.
    All these also can be crafted into both stairs and slabs. -botania.page.decorativeBlocks17=Crafting &1Reed Blocks&0 -botania.page.decorativeBlocks18=Crafting &1Thatch&0 -botania.page.decorativeBlocks19=Crafting &1Roof Tiles&0 -botania.page.decorativeBlocks20=Crafting &1Hellish Bricks&0 -botania.page.decorativeBlocks21=Crafting &1Soul Bricks&0 -botania.page.decorativeBlocks22=Crafting &1Frosty Bricks&0 - -# -- DISPENSER TWEAKS -botania.entry.dispenserTweaks=Dispenser Tweaks -botania.page.dispenserTweaks0=&1Dispensers&0, among their normal abilities, can also plant all sorts of crops, from &1Seeds&0, &1Potatos&0 or &1Carrots&0 to even &1Nether Wart&0. The crop is planted in the block right in front of the dispenser.
    The &1Dispensers&0 can also use the &1Wand of the Forest&0 for some specific tasks such as triggering a &1Runic Altar&0. - -# -- GLIMMERING FLOWERS -botania.entry.shinyFlowers=Glimmering Flowers -botania.page.shinyFlowers0=By combining your typical &1Mystical Flowers&0 with some &1Glowstone Dust&0, you can make them sparkle even brighter, and emit actual physical light, of the same brightness as a &1Glowstone Block&0.
    With some &1Dirt&0 and &1Pasture Seeds&0 it's possible to turn them into a miniature floating island that will not only emit light, but also look very fancy indeed. -botania.page.shinyFlowers1=Pretty Pretty Shiny Shiny -botania.page.shinyFlowers2=Like Laputa but (a lot) tinier - -# -- PRISMARINE -botania.entry.prismarine=Prismarine -botania.page.prismarine0=&1Prismarine&0 is an interesting component and building block. Some scholars even go as far as to say it comes from &4the future&0.
    To create it, one requires an &1Alchemy Catalyst&0. Simply tossing some &1Nether Quartz&0 into a &1Mana Pool&0 with the catalyst attached to it will get some of this material. -botania.page.prismarine1=There's various building blocks that can be created using the &1Prismarine Shards&0, to which all but the &1Sea Lantern&0 can be turned into their &1Stair&0 and &1Slab&0 variants. -botania.page.prismarine2=Creating &1Prismarine Shards&0 -botania.page.prismarine3=Crafting &1Prismarine&0 -botania.page.prismarine4=Crafting &1Prismarine Bricks&0 -botania.page.prismarine5=Crafting &1Dark Prismarine&0 -botania.page.prismarine6=Crafting the &1Sea Lantern&0 - -# -- NATURAL SHEDDING -botania.entry.shedding=Natural Shedding -botania.page.shedding0=The living and unliving beings that inhabit our lands don't live in a static state. It's common for pieces of their body to fall out, or for them to drop things, or for them to extrude substances. The following pages list some such items that can come from such entities. - -# -- TINY POTATO -botania.entry.tinyPotato=Tiny Potato -botania.page.tinyPotato0=It's a tiny potato, it believes in you, you can do the thing.
    No really, that's it, by tossing a &1Potato&0 in a &1Mana Pool&0, the potato gains a little lively essence and happy feeling. It's a lively one, giving it a right click will make it even more so! -botania.page.tinyPotato1=Put it on Kickstarter, it'll work - -# -- HEAD CREATION -botania.entry.headCreating=Head Creation -botania.page.headCreating0=A typical incantation of the Elves, combining a few resources and a &1Name Tag&0 allows for the creation of a replica of sorts of the head of the person described in the tag. How it works isn't really known, but it seems to be possible to replicate it with a &1Runic Altar&0. -botania.page.headCreating1=Get your head in the game - -# -- AZULEJO -- http://en.wikipedia.org/wiki/Azulejo -botania.entry.azulejo=Azulejos -botania.page.azulejo0=&1Azulejos&0 are a type of decorative block, simply put, they are tileable patterns of blue and white. To create them, one would simply mix a piece of &1Lapis Lazulli&0 with a &1Block of Quartz&0.
    From there, placing it in the crafting grid allows for cycling between the twelve different patterns. -botania.page.azulejo1=The various patterns -botania.page.azulejo2=Crafting a block of &1Azulejo&0 -botania.page.azulejo3=Cycling between the patterns - -# -- STARFIELD CREATOR -botania.entry.starfield=Starfield Creator -botania.page.starfield0=The &1Starfield Creator&0 does exactly as it says, by releasing elven energies into the air, if it's placed in the world, during night time it will create a starry sky that extends for a fair distance. -botania.page.starfield1=Twinkle twinkle +tile.botania:storage2.name=Bloque de Elementium \ No newline at end of file diff --git a/src/main/resources/assets/botania/lang/es_ES.lang b/src/main/resources/assets/botania/lang/es_ES.lang index 5864a1574..a327a1ba5 100644 --- a/src/main/resources/assets/botania/lang/es_ES.lang +++ b/src/main/resources/assets/botania/lang/es_ES.lang @@ -1,12 +1,17 @@ +# Note to translators: DO NOT COPY ENTRIES FROM ENGLISH +# I repeat: do NOT copy entries from English!! +# Any entry in this lang file should be in es_ES, or *should not be here at all* +# Copying English entries will cause them to become outdated when the main English lang file changes +# Untranslated entries will automatically be inherited from en_US +# +# Once again, don't copy from English, and THANK YOU for your hard work! + # Traducción por mojares / Translated by mojares # MISC itemGroup.Botania=Botania generator.botania-skyblock=Jardín de cristal generator.botania-skyblock.info=No recomendado para neófitos en Botania -# Something that is not localized, translators, do NOT change this line. -botaniamisc.noloc=botaniamisc.noloc - botaniamisc.nextPage=Página siguiente botaniamisc.prevPage=Página anterior botaniamisc.back=Atrás @@ -38,7 +43,6 @@ botaniamisc.devEdition=Del escritor botaniamisc.lexiconcover0=Tu guía para todas botaniamisc.lexiconcover1=tus necesidades botánicas botaniamisc.lexiconcover2=de la autora de bestsellers -botaniamisc.lexiconcover3=Lizbeth "Vazkii" Rika botaniamisc.lexiconcover4=Editado por BevoLJ botaniamisc.lexiconcover5=Editado por Saice botaniamisc.shiftinfo=Mantén &bSHIFT&7 apretado para más información @@ -50,9 +54,6 @@ botaniamisc.shiftToRemove=Shift-clic para quitar botaniamisc.clickToAdd=Añadir marcador botaniamisc.ratio=Zoom: %sx botaniamisc.bottleTooltip=Tiene un gusto refinado -botaniamisc.coarseDirt0=Tierra basta, la hierba -botaniamisc.coarseDirt1=no crece sobre ella -botaniamisc.spawnerTip=Consejo: Usa un huevo de engendrar para cambiar la criatura botaniamisc.shardLevel=Potencia de lasca %s botaniamisc.lexiconIndex=Índice del lexicón botaniamisc.hasIvy=Tiene hiedra eterna @@ -61,8 +62,8 @@ botaniamisc.noLexicon=Necesitas un Lexica Botania en la mano para leer eso. botaniamisc.cantOpen=Parece que tu Lexica Botania no tiene esa página. ¿Quizás venga de una fuente externa? botaniamisc.clickToShare=Comparte botaniamisc.drop=Deja caer -botaniamisc.dropTip0=Consejo: puedes presionar %key% en tu inventario para dejarlo caer -botaniamisc.dropTip1=CTRL-%key% dejará caer el montón entero +botaniamisc.dropTip0=Consejo: puedes presionar %s en tu inventario para dejarlo caer +botaniamisc.dropTip1=CTRL-%s dejará caer el montón entero botaniamisc.wandMode.bind=Modo vínculo botaniamisc.wandMode.function=Modo función botaniamisc.playVideo=Reproduce vídeo @@ -173,14 +174,6 @@ botania.color14=rojo botania.color15=negro botania.color16=arcoíris -# RANKS -botania.rank0=&cD -botania.rank1=&eC -botania.rank2=&bB -botania.rank3=&aA -botania.rank4=&dS -botania.rank5=&6SS - # ZODIAC SIGNS botania.sign0=Aries botania.sign1=Tauro @@ -228,39 +221,6 @@ botania.armorset.will3.shortDesc=Los golpes críticos infligen un fuerte efecto botania.armorset.will4.shortDesc=Los golpes críticos atraviesan la armadura botania.armorset.will5.shortDesc=Los golpes críticos infligen un efecto de wither -# ROMAN NUMERALS -botania.roman0= -botania.roman1=I -botania.roman2=II -botania.roman3=III -botania.roman4=IV -botania.roman5=V -botania.roman6=VI -botania.roman7=VII -botania.roman8=VIII -botania.roman9=IX -botania.roman10=X -botania.roman11=XI -botania.roman12=XII -botania.roman13=XIII -botania.roman14=XIV -botania.roman15=XV -botania.roman16=XVI -botania.roman17=XVII -botania.roman18=XVIII -botania.roman19=XIX -botania.roman20=XX -botania.roman21=XXI -botania.roman22=XXII -botania.roman23=XXIII -botania.roman24=XXIV -botania.roman25=XXV -botania.roman26=XXVI -botania.roman27=XXVII -botania.roman28=XXVIII -botania.roman29=XXIX -botania.roman30=XXX - # KNOWLEDGE botania.knowledge.minecraft=Conocimiento minecraftiano botania.knowledge.alfheim=Conocimiento &aélfico&7 @@ -356,7 +316,7 @@ botania.versioning.flavour47=Los rumores dicen que si mueves el camión hay una botania.versioning.flavour48=Me pregunto cuando Bevo va a actualizar su pack.... botania.versioning.flavour49=1 actualización de Botania se balanceaba sobre la tela de una araña. botania.versioning.outdated=Estás jugando con la versión %s de Botania, la última versión es la %s. -botania.versioning.updateMessage=["Clic para... [",{"text":"Descarga","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Haz clic aquí para descargar la última versión de Botania","color":"green"}},"clickEvent":{"action":"run_command","value":"/botania-download-latest %version%"}},"] [",{"text":"Website","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Haz clic aquí para ir a la página del mod","color":"green"}},"clickEvent":{"action":"open_url","value":"http://vazkii.us/mod/Botania/downloads.php"}},"] [",{"text":"Changelog","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Haz clic aquí para ir al registro de cambios","color":"green"}},"clickEvent":{"action":"open_url","value":"http://vazkii.us/mod/Botania/changelog.php#%version%"}},"]"] +botania.versioning.updateMessage=["Clic para... [",{"text":"Descarga","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Haz clic aquí para descargar la última versión de Botania","color":"green"}},"clickEvent":{"action":"open_url","value":"http://minecraft.curseforge.com/projects/botania-unofficial/files/latest"}},"] [",{"text":"Website","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Haz clic aquí para ir a la página del mod","color":"green"}},"clickEvent":{"action":"open_url","value":"http://minecraft.curseforge.com/projects/botania-unofficial"}},"] [",{"text":"Changelog","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Haz clic aquí para ir al registro de cambios","color":"green"}},"clickEvent":{"action":"open_url","value":"https://github.com/williewillus/Botania/releases/tag/%s"}},"]"] botania.versioning.startingDownload=[{"text":"Comenzando la descarga de %s. Por favor no retires tu disco duro. Disfrutando de ","color":"aqua"},{"text":"Botania","color":"green"},{"text":"? Quizás puedes apoyar a ","color":"aqua"},{"text":"Vazkii","color":"light_purple"},{"text":" en [","color":"aqua"},{"text":"Patreon","color":"gold","hoverEvent":{"action":"show_text","value":{"text":"Haz clic aquí para ir al Patreon de Vazkii","color":"light_purple"}},"clickEvent":{"action":"open_url","value":"http://www.patreon.com/Vazkii"}},{"text":"]!","color":"aqua"}] botania.versioning.doneDownloading=Descarga de %s completada. Borra el antiguo archivo .jar de Botania y reinicia tu juego para actualizar. botania.versioning.downloadedAlready=Ya descargaste la última versión. Cierra tu juego, borra la versión anterior de la carpeta mods e inicia el juego para actualizar. @@ -368,7 +328,7 @@ botania.versioning.disabled=Lo sentimos. Esta característica está deshabilitad botania.baubletype.amulet=Equipable en la ranura para &aamuleto&7 botania.baubletype.ring=Equipable en la ranura para &aanillo&7 botania.baubletype.belt=Equipable en la ranura para &acinturón&7 -botania.baubletooltip=Oprime la &b%key%&7 para abrir el menú de ornamentos +botania.baubletooltip=Oprime la &b%s&7 para abrir el menú de ornamentos # RELIC POEMS item.dice.poem0=Echa las cartas para encontrar respuesta, @@ -477,8 +437,6 @@ achievement.botania:aesirRing.desc=Crea el anillo del Aesir combinando los anill achievement.botania:nullFlower=Tranquilízate achievement.botania:nullFlower.desc=Encuentra un bug que te permita encontrar una flor de Botania sin definir. ¡No olvides informar! achievement.botania:desuGun=Amante de dos caras. -achievement.botania:desuGun.desc=ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN -# ^ Don't localize # CHALLENGE LEVELS botania.challengelevel.easy=Fácil @@ -702,16 +660,6 @@ tile.botania:dreamwood0Slab.name=Losa de madera onírica tile.botania:dreamwood1Stairs.name=Escaleras de tablas de madera onírica tile.botania:dreamwood1Slab.name=Losa de tablas de madera onírica tile.botania:conjurationCatalyst.name=Catalizador de conjuración -tile.botania:prismarine0.name=Prismarina -tile.botania:prismarine1.name=Ladrillos de prismarina -tile.botania:prismarine2.name=Prismarina oscura -tile.botania:prismarine0Stairs.name=Escaleras de prismarina -tile.botania:prismarine0Slab.name=Losa de prismarina -tile.botania:prismarine1Stairs.name=Escaleras de ladrillos de prismarina -tile.botania:prismarine1Slab.name=Losa de ladrillos de prismarina -tile.botania:prismarine2Stairs.name=Escaleras de prismarina oscura -tile.botania:prismarine2Slab.name=Losa de prismarina oscura -tile.botania:seaLamp.name=Linterna marina tile.botania:miniIsland0.name=Flor flotante blanca tile.botania:miniIsland1.name=Flor flotante naranja tile.botania:miniIsland2.name=Flor flotante magenta @@ -730,12 +678,6 @@ tile.botania:miniIsland14.name=Flor flotante roja tile.botania:miniIsland15.name=Flor flotante negra tile.botania:tinyPotato.name=Patatita tile.botania:spawnerClaw.name=Imbusor de vida -tile.botania:reedBlock.name=Bloque de caña -tile.botania:reedBlock0Stairs.name=Escaleras de caña -tile.botania:reedBlock0Slab.name=Losa de caña -tile.botania:thatch.name=Paja entrelazada -tile.botania:thatch0Stairs.name=Escaleras de paja entrelazada -tile.botania:thatch0Slab.name=Losa de paja entrelazada tile.botania:customBrick0.name=Ladrillo infernal tile.botania:customBrick1.name=Ladrillo de almas tile.botania:customBrick2.name=Ladrillo de escarcha @@ -932,38 +874,10 @@ tile.botania:doubleFlower212.name=Flor mística alta marrón tile.botania:doubleFlower213.name=Flor mística alta verde tile.botania:doubleFlower214.name=Flor mística alta roja tile.botania:doubleFlower215.name=Flor mística alta negra -tile.botania:stone0.name=Andesita -tile.botania:stone1.name=Basalto -tile.botania:stone2.name=Diorita -tile.botania:stone3.name=Granito -tile.botania:stone4.name=Andesita pulida -tile.botania:stone5.name=Basalto pulido -tile.botania:stone6.name=Diorita pulida -tile.botania:stone7.name=Granito pulido -tile.botania:stone8.name=Ladrillos de andesita -tile.botania:stone9.name=Ladrillos de basalto -tile.botania:stone10.name=Ladrillos de diorita -tile.botania:stone11.name=Ladrillos de granito tile.botania:stone12.name=Ladrillos cincelados de andesita tile.botania:stone13.name=Ladrillos cincelados de basalto tile.botania:stone14.name=Ladrillos cincelados de diorita tile.botania:stone15.name=Ladrillos cincelados de granito -tile.botania:stone0Stairs.name=Escaleras de andesita -tile.botania:stone1Stairs.name=Escaleras de basalto -tile.botania:stone2Stairs.name=Escaleras de diorita -tile.botania:stone3Stairs.name=Escaleras de granito -tile.botania:stone8Stairs.name=Escaleras de ladrillos de andesita -tile.botania:stone9Stairs.name=Escaleras de ladrillos de basalto -tile.botania:stone10Stairs.name=Escaleras de ladrillos de diorita -tile.botania:stone11Stairs.name=Escaleras de ladrillos de granito -tile.botania:stone0Slab.name=Losa de andesita -tile.botania:stone1Slab.name=Losa de basalto -tile.botania:stone2Slab.name=Losa de diorita -tile.botania:stone3Slab.name=Losa de granito -tile.botania:stone8Slab.name=Losa de ladrillos de andesita -tile.botania:stone9Slab.name=Losa de ladrillos de basalto -tile.botania:stone10Slab.name=Losa de ladrillos de diorita -tile.botania:stone11Slab.name=Losa de ladrillos de granito tile.botania:blazeBlock.name=Lámpara de blaze tile.botania:corporeaInterceptor.name=Interceptor de corporea tile.botania:corporeaCrystalCube.name=Cubo de cristal de corporea @@ -980,8 +894,6 @@ tile.botania:lightLauncher.name=Lanzador de luminaria tile.botania:livingrock0Wall.name=Muro de piedra viviente tile.botania:livingwood0Wall.name=Muro de madera viviente tile.botania:dreamwood0Wall.name=Muro de madera onírica -tile.botania:prismarine0Wall.name=Muro de prismarina -tile.botania:reedBlock0Wall.name=Muro de caña tile.botania:biomeStoneA0Wall0.name=Muro metamórfico de roca de bosque tile.botania:biomeStoneA0Wall1.name=Muro metamórfico de roca de llanura tile.botania:biomeStoneA0Wall2.name=Muro metamórfico de roca de montaña @@ -990,10 +902,6 @@ tile.botania:biomeStoneA0Wall4.name=Muro metamórfico de roca de pantano tile.botania:biomeStoneA0Wall5.name=Muro metamórfico de roca de desierto tile.botania:biomeStoneA0Wall6.name=Muro metamórfico de roca taiga tile.botania:biomeStoneA0Wall7.name=Muro metamórfico de roca de mesa -tile.botania:stone0Wall0.name=Muro de andesita -tile.botania:stone0Wall1.name=Muro de basalto -tile.botania:stone0Wall2.name=Muro de diorita -tile.botania:stone0Wall3.name=Muro de granito tile.botania:manaBomb.name=Carga de tormenta de maná tile.botania:buriedPetals0=Pétalo blanco enterrado tile.botania:buriedPetals0.name=Pétalo blanco enterrado @@ -1425,7 +1333,7 @@ item.botania:terraAxe.name=Truncador de Terra item.botania:manasteelNugget.name=Pepita de manacero item.botania:terrasteelNugget.name=Pepita de terracero item.botania:elementiumNugget.name=Pepita de elementio -item.botania:root.name=Raíz viviente +item.botania:livingRoot.name=Raíz viviente item.botania:pebble.name=Guijarro item.botania:waterBowl.name=Cuenco con agua item.botania:obedienceStick.name=Palo de obediencia floral @@ -2355,7 +2263,6 @@ botania.page.vineBall0=Las &1escaleras de mano&0 no se sostienen por si sola, ha botania.page.vineBall1=También es posible combinando algunos materiales tales como &1madera viviente&0 o una &1runa de aire&0 crear un tirachinas que permite arrojar estas &1bolas de enredadera&0 ignorando completamente la fuerza de gravedad. botania.page.vineBall2=Así sería en Enredacraft... botania.page.vineBall3=...si en realidad existiese. -botania.page.vineBall4=Oh, y se puede hace &1piedra musgosa&0 también # -- SHARD OF LAPUTA botania.entry.laputaShard=Lasca de Laputa diff --git a/src/main/resources/assets/botania/lang/fr_FR.lang b/src/main/resources/assets/botania/lang/fr_FR.lang index a7cab9845..5062906d1 100644 --- a/src/main/resources/assets/botania/lang/fr_FR.lang +++ b/src/main/resources/assets/botania/lang/fr_FR.lang @@ -1,10 +1,15 @@ +# Note to translators: DO NOT COPY ENTRIES FROM ENGLISH +# I repeat: do NOT copy entries from English!! +# Any entry in this lang file should be in fr_FR, or *should not be here at all* +# Copying English entries will cause them to become outdated when the main English lang file changes +# Untranslated entries will automatically be inherited from en_US +# +# Once again, don't copy from English, and THANK YOU for your hard work! + # MISC itemGroup.Botania=Botania generator.botania-skyblock=Jardin de verre -generator.botania-skyblock.info=Non recommendé pour les débutants de botania - -# Something that is not localized, translators, do NOT change this line. -botaniamisc.noloc=botaniamisc.noloc +generator.botania-skyblock.info=Non recommandé pour les débutants de botania botaniamisc.nextPage=Page suivante botaniamisc.prevPage=Page précédante @@ -16,7 +21,7 @@ botaniamisc.statusUnknown=Statut inconnu botaniamisc.color=%s teinté botaniamisc.manaUsage=Utilisation de mana botaniamisc.shiftToRead=Maj-cliquez droit pour lire plus -botaniamisc.clickToRecipe=Maj-cliquez vour voir la recette +botaniamisc.clickToRecipe=Maj-cliquez pour voir la recette botaniamisc.clickToIndex=Maj-cliquez pour l'index botaniamisc.flareColor=%s tours botaniamisc.outputtingPower=Partage le mana aux éléments @@ -27,7 +32,7 @@ botaniamisc.compositeLens=Composé avec %s botaniamisc.filter0=Ramassage seulement des éléments en cadres botaniamisc.filter1=Ramassage seulement des éléments hors cadres botaniamisc.filter2=Ramassage de tous les éléments -botaniamisc.creativePool0=Bassin de mana créatif, a du mana à l'infini +botaniamisc.creativePool0=Bassin de mana créatif, possède du mana à l'infini botaniamisc.creativePool1=Digne d'un égoïste botaniamisc.savedByLaurel=Votre couronne de laurier d'or vole en éclats, dès qu'elle vous sauve de la mort. botaniamisc.toolRank=%s&7 rang @@ -49,24 +54,21 @@ botaniamisc.shiftToRemove=Maj-cliquez pour retirer botaniamisc.clickToAdd=Marquez la page botaniamisc.ratio=Zoom: %sx botaniamisc.bottleTooltip=Il a un goût d'acquis -botaniamisc.coarseDirt0=terre grossière, l'herbe -botaniamisc.coarseDirt1=ne poussera pas dessus -botaniamisc.spawnerTip=Aide: utilisez un oeuf pour changer la créature botaniamisc.shardLevel=Puissance d'éclat %s botaniamisc.lexiconIndex=Index du lexique botaniamisc.hasIvy=A lierre éternel botaniamisc.shareMsg=[{"text":"%name%","color":"light_purple"},{"text":" a partagé un ","color":"blue"},{"text":"Lexique Botania","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Vous pouvez le créer avec un livre et une pousse d'arbre !","color":"aqua"}}},{"text":" entrée, cliquez pour la voir : ","color":"blue"},{"text":"[%entryname%]","color":"green","clickEvent":{"action":"run_command","value":"/botania-open %entry%"},"hoverEvent":{"action":"show_text","value":{"text":"Cliquez pour lire ceci","color":"aqua"}}}] botaniamisc.noLexicon=Vous avez besoin d'un Lexique Botania en main pour lire ceci. -botaniamisc.cantOpen=Il ne semble pas que votre Lexique Botania ai cette page. Il provient peut-être d'une source extérieure...? +botaniamisc.cantOpen=Il ne semble pas que votre Lexique Botania contient cette page. Il provient peut-être d'une source extérieure...? botaniamisc.clickToShare=Partagez botaniamisc.drop=Jeter -botaniamisc.dropTip0=Aide: Vous pouvez appuyer %key% dans votre inventaire pour jeter -botaniamisc.dropTip1=Ctrl-%key% jetera une pile entière +botaniamisc.dropTip0=Aide: Vous pouvez appuyer %s dans votre inventaire pour jeter +botaniamisc.dropTip1=Ctrl-%s jetera une pile entière botaniamisc.wandMode.bind=Mode de liaison botaniamisc.wandMode.function=Mode de fonction botaniamisc.playVideo=Jouer la vidéo botaniamisc.brewOf=Brassage de %s -botaniamisc.needsCatalysts=Qu'importe la force avec laquelle vous essayez depoussez le lingot dans la balise, rien ne semble arriver, peut-être que la configuration vos pylônes de catalyseur est débranchée. +botaniamisc.needsCatalysts=Qu'importe la force avec laquelle vous essayez d'insérer le lingot dans la balise, rien ne semble arriver, peut-être que la configuration vos pylônes de catalyseur est débranchée. botaniamisc.peacefulNoob=Vous essayez d'offrir le lingot, mais l'ambiance paisible de votre monde vous empêche de faire ainsi. Peut-être devriez-vous faire quelque chose à cela. botaniamisc.notInfused=Non infusé botaniamisc.getALife=Prennez une vie @@ -84,17 +86,17 @@ botaniamisc.nearIndex1=Tout ce que vous direz pourra être botaniamisc.nearIndex2=intercepte comme demande botaniamisc.startTutorial=Débuter le tutoriel botaniamisc.tutorialStarted=Vous avez débuté le tutoriel. Veuillez suivre les flêches rouges et lire le contenu afin d'être guidé à travers les fondements de Botania! -botaniamisc.tutorialEnded=Le tutoriel est terminé. Vous devez maintenant avoir une idée sur le fonctionnement de Botania, assurez-vous d'avoir lu les autres pages afin de découvrir d'autres manière d'utiliser le mod. +botaniamisc.tutorialEnded=Le tutoriel est terminé. Vous devez maintenant avoir une idée sur le fonctionnement de Botania, assurez-vous d'avoir lu les autres pages afin de découvrir d'autres manières d'utiliser le mod. botaniamisc.cosmeticBauble=&oCosmétique botaniamisc.hasCosmetic=&oA un ajout cosmétique: &r%s botaniamisc.typeToSearch=(texte à rechercher) -botaniamisc.viewOnline=Visionnez en ligne +botaniamisc.viewOnline=Visionner en ligne botaniamisc.history=Histoire -botaniamisc.historyLong=Consultez l'histoire -botaniamisc.historyDesc=Voyez les dernières entrées vititées +botaniamisc.historyLong=Consulter l'histoire +botaniamisc.historyDesc=Voir les dernières entrées visitées botaniamisc.lexiconOptions0=Options de Botania -botaniamisc.lexiconOptions1=Configurez Botania depuis le jeu -botaniamisc.lexiconOptions2=Quelques options réclameront la relance du jeu +botaniamisc.lexiconOptions1=Configurer Botania depuis le jeu +botaniamisc.lexiconOptions2=Quelques options réclameront le redémarrage du jeu botaniamisc.hasPhantomInk=&bcamoufflé par de l'encre sympatique botaniamisc.pinkinatorDesc=S'applique directement au Wither. botaniamisc.relicUnbound=&6Relique&7, déliée @@ -107,7 +109,7 @@ botaniamisc.blocksAway=%s Blocs plus loin botaniamisc.clickToTeleport=Cliquez-droit pour téléporter botaniamisc.clickToRemoveWarp=Maj-cliquez-gauche pour retirer botaniamisc.unboundWarp=Délier un point de déformation -botaniamisc.clickToAddWarp=Cliquez-droit pour lier à cette position +botaniamisc.clickToAddWarp=Cliquer-droit pour lier à cette position botaniamisc.hasKeepIvy=A un lierre résolu botaniamisc.active=&aActive botaniamisc.inactive=&cInactive @@ -117,11 +119,11 @@ botaniamisc.hourglassLock=Ce sablier est verrouillé. Cliquez-droit dessus avec botaniamisc.locked=Verrouillé botaniamisc.stopped=Arrêté botaniamisc.lockedStopped=Verrouillé, Arrêté -botaniamisc.visualize=Visualisez -botaniamisc.unvisualize=Dévisualisez +botaniamisc.visualize=Visualiser +botaniamisc.unvisualize=Dévisualiser botaniamisc.rightClickToAnchor=Cliquez-droit n'importe quel bloc pour ancrer cette apercu de structure à cela. botaniamisc.structureComplete=Structure complété ! -botaniamisc.materialsRequired=Materiaux requis +botaniamisc.materialsRequired=Matériaux requis botaniamisc.challenges=Défis botaniamisc.markCompleted=Marque complété botaniamisc.markNotCompleted=Marque non complété @@ -171,14 +173,6 @@ botania.color14=Rouge botania.color15=Noir botania.color16=Arc-en-ciel -# RANKS -botania.rank0=&cD -botania.rank1=&eC -botania.rank2=&bB -botania.rank3=&aA -botania.rank4=&dS -botania.rank5=&6SS - # ZODIAC SIGNS botania.sign0=Bélier botania.sign1=Taureau @@ -214,7 +208,7 @@ botania.armorset.terrasteel.name=Volonté des ancients botania.armorset.terrasteel.desc0=20% de mana en moins sur les outils à mana botania.armorset.terrasteel.desc1=Régénère même si la faim n'est pas complète botania.armorset.will0.desc=Les coups critiques appliquent un fort effet de faiblesse (Volonté d'Ahrim) -botania.armorset.will1.desc=Les dégâts de coup critiques augmentent avec l'HP inférieur (Volonté de Dharok) +botania.armorset.will1.desc=Les dégâts de coup critiques augmentent avec de faibles PV (Volonté de Dharok) botania.armorset.will2.desc=Les coups critiques guérissent une partie de dégâts reçus (Volonté de Guthan) botania.armorset.will3.desc=Les coups critiques appliquent un fort effet de lenteur (Volonté de Torag) botania.armorset.will4.desc=Les coups critiques transpercent l'armure (Volonté de Verac) @@ -226,39 +220,6 @@ botania.armorset.will3.shortDesc=Fort effet de lenteur sur coups critiques botania.armorset.will4.shortDesc=Transpercent l'armure sur coups critiques botania.armorset.will5.shortDesc=Effet de décrépitude sur coups critiques -# ROMAN NUMERALS -botania.roman0= -botania.roman1=I -botania.roman2=II -botania.roman3=III -botania.roman4=IV -botania.roman5=V -botania.roman6=VI -botania.roman7=VII -botania.roman8=VIII -botania.roman9=IX -botania.roman10=X -botania.roman11=XI -botania.roman12=XII -botania.roman13=XIII -botania.roman14=XIV -botania.roman15=XV -botania.roman16=XVI -botania.roman17=XVII -botania.roman18=XVIII -botania.roman19=XIX -botania.roman20=XX -botania.roman21=XXI -botania.roman22=XXII -botania.roman23=XXIII -botania.roman24=XXIV -botania.roman25=XXV -botania.roman26=XXVI -botania.roman27=XXVII -botania.roman28=XXVIII -botania.roman29=XXIX -botania.roman30=XXX - # KNOWLEDGE botania.knowledge.minecraft=Savoir Minecraftien botania.knowledge.alfheim=Savoir &aElfique&7 @@ -285,7 +246,7 @@ lexicon.render.3D=Rendu 3D du lexique manaBar.height=Hauteur de la barre de mana powerSystem.subtle=Use Subtle Power System pylonModel.old=Utiliser l'ancien modèle de pylône -elfPortal.particles.enabled=Activer Portal Particles +elfPortal.particles.enabled=Activer les particules des portails elfiques chargeAnimation.enabled=Animation de chargement activée vanillaParticleConfig.enabled=Utiliser la config des particules Vanilla manaSpreaders.silent=Diffuseurs de mana silencieux @@ -303,24 +264,24 @@ worldgen.mushroom.quantity=Quantité de génération de champignons # VERSION CHECKING botania.versioning.flavour0=NANI SORE!? BOTANIA EST OBSOLETE!? -botania.versioning.flavour1=Que voulez-vous dire par Botania est obsolète, ignard personnage? +botania.versioning.flavour1=Que voulez-vous dire par Botania est obsolète, fou ignorant ? botania.versioning.flavour2=Ce n'est pas comme si Botania souhaitait devenir obsolète, b-b-BAKA! -botania.versioning.flavour3=Téléportez-moi Scotty. Nous avons une nouvelle version de Botaina. -botania.versioning.flavour4=La mise à jour de Botania update demande si vous avez accepté Vazkii en tant que seigneur et sauveur. +botania.versioning.flavour3=Téléportez-moi Scotty. Nous avons une nouvelle version de Botania. +botania.versioning.flavour4=La mise à jour de Botania demande si vous avez accepté Vazkii en tant que seigneur et sauveur. botania.versioning.flavour5=Hey, une mise à jour de Botania, c'est rare, n'est-ce pas? botania.versioning.flavour6=Que pense le scout à propos de la mise à jour de Botania? -botania.versioning.flavour7=Hey dude, il y a une novuelle mise à jour de Botania. Why am I australian? -botania.versioning.flavour8=Comme avoir une vie est dépassé, voici une mise à jour de Botania. +botania.versioning.flavour7=Hey chéri, il y a une nouvelle mise à jour de Botania. Why am I australian? +botania.versioning.flavour8=Comme n'avoir qu'une vie est dépassé, voici une mise à jour de Botania. botania.versioning.flavour9=Mise à jour Botania basée sur le remerciement. botania.versioning.flavour10=200 mises à jour, c'est pour cela qu'on m'appelle Mister Fahrenheit. botania.versioning.flavour11=Perry l'ornithorinque, permets moi de te présenter le Botania-MaJ-inator. botania.versioning.flavour12=Botania mis à jour. #hoennconfirmed botania.versioning.flavour13=Tu as activé ma Carte Piège! Je joue Mise à Jour de Botania ! -botania.versioning.flavour14=Jouons à un drinking game, buvons un verre à chaque mise à jour de Botania. *hic* +botania.versioning.flavour14=Jouons à un jeu à boire, buvons un verre à chaque mise à jour de Botania. *hic* botania.versioning.flavour15=Ne faites pas attention à la mise à jour de Botania derrière les rideaux. botania.versioning.flavour16=Tu reçois une mise à jour ! Tu reçois une mise à jour ! TOUT LE MONDE RECOIT UNE MISE A JOUR ! botania.versioning.flavour17=Your build's unbalanced and your hair's a Kuriboh! Hey. Hoo. -botania.versioning.flavour18=WhY iS tHiS uPdAtE mEsSaGe CaSeD lIkE tHiS!? +botania.versioning.flavour18=PoUrQuOi La NoTiFiCaTiOn De MiSe à JoUr S'aFfIcHe CoMmE çA !? botania.versioning.flavour19=Afin de mettre à jour Botania vous devez accepter les conditions d'utilisation. botania.versioning.flavour20=wow such botania so update much fix very content botania.versioning.flavour21=Cette mise à jour de Botania va s'auto-détruire dans 3...2... @@ -335,7 +296,7 @@ botania.versioning.flavour29=Mets-le à jour, mets-le à jour, mets-le à jour, botania.versioning.flavour30=Botania utilise Mise à Jour ! C'est super efficace ! botania.versioning.flavour31=Une nouvelle mise à jour de Botania est disponible, 20% plus fraîche. botania.versioning.flavour32=Félicitations ! Tu es le 100'000ème joueur de Botania ayant une version obsolète, cliquez ICI pour un iPad gratuit! -botania.versioning.flavour33=Avant de mette à jour Botania, souhaitez-vous insViverochethe la barre de recherche Ask? +botania.versioning.flavour33=Avant de mettre à jour Botania, souhaitez-vous insViverochethe la barre de recherche Ask? botania.versioning.flavour34=Back on the Botania update treadmill. No fun required. #angbadang botania.versioning.flavour35=Souhaite-tu devenir une magicienne pour la mise à jour de Botania ? botania.versioning.flavour36=Pourquoi la mise à jour de Botania à traversée la route ? Pour passer du côté client. @@ -353,7 +314,7 @@ botania.versioning.flavour47=Rumour says if you move the truck there's a Botania botania.versioning.flavour48=I wonder when Bevo's updating his pack... botania.versioning.flavour49=1 Botania Update on the wall, 1 Botania Update on the wall. botania.versioning.outdated=You are running Botania build %s, the latest is build %s. -botania.versioning.updateMessage=["Click for... [",{"text":"Download","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Click this to automatically download the latest version","color":"green"}},"clickEvent":{"action":"run_command","value":"/botania-download-latest %version%"}},"] [",{"text":"Website","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Click this to go to the mod's website","color":"green"}},"clickEvent":{"action":"open_url","value":"http://botaniamod.net/downloads.php"}},"] [",{"text":"Changelog","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Click this to go to the version's Changelog","color":"green"}},"clickEvent":{"action":"open_url","value":"http://botaniamod.net/changelog.php#%version%"}},"]"] +botania.versioning.updateMessage=["Click for... [",{"text":"Download","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Click this to automatically download the latest version","color":"green"}},"clickEvent":{"action":"open_url","value":"http://minecraft.curseforge.com/projects/botania-unofficial/files/latest"}},"] [",{"text":"Website","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Click this to go to the mod's website","color":"green"}},"clickEvent":{"action":"open_url","value":"http://minecraft.curseforge.com/projects/botania-unofficial"}},"] [",{"text":"Changelog","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Click this to go to the version's Changelog","color":"green"}},"clickEvent":{"action":"open_url","value":"https://github.com/williewillus/Botania/releases/tag/%s"}},"]"] botania.versioning.startingDownload=[{"text":"Starting download of %s. Please do not remove your hard disk. Enjoying ","color":"aqua"},{"text":"Botania","color":"green"},{"text":"? Consider supporting ","color":"aqua"},{"text":"Vazkii","color":"light_purple"},{"text":" on [","color":"aqua"},{"text":"Patreon","color":"gold","hoverEvent":{"action":"show_text","value":{"text":"Click this to go to Vazkii's Patreon","color":"light_purple"}},"clickEvent":{"action":"open_url","value":"http://www.patreon.com/Vazkii"}},{"text":"]!","color":"aqua"}] botania.versioning.doneDownloading=Finished downloading %s. Delete your old Botania .jar and reload your game to update. botania.versioning.downloadedAlready=You already downloaded the latest version. Close your game, delete the old version from your mods folder and load it again to update! @@ -362,51 +323,10 @@ botania.versioning.error=Woah! It seems like something went wrong while trying t botania.versioning.disabled=Sorry. This feature is currently disabled due to server host problems, it should be back soon. # BAUBLE TOOLTIPS -botania.baubletype.amulet=Équipable dans l'emplacement &aAmulet&7 -botania.baubletype.ring=Équipable dans l'emplacement &aRing&7 -botania.baubletype.belt=Équipable dans l'emplacement &aBelt&7 -botania.baubletooltip=Appuyez &b%key%&7 pour ouvrir le menu Baubles - -# RELIC POEMS -item.infiniteFruit.poem0=The fruit of the forbidden garden -item.infiniteFruit.poem1=Eternally cleanses one's hunger, -item.infiniteFruit.poem2=For that it rebuilds its pulp -item.infiniteFruit.poem3=And makes itself younger. - -item.excaliber.poem0=A sword of a true hero -item.excaliber.poem1=Fit for only one of the kind, -item.excaliber.poem2=Sharp and magic conjuring, -item.excaliber.poem3=Enemies it will quickly find. - -item.flugelEye.poem0=A vision of the past on one's mind, -item.flugelEye.poem1=Round and round is the memory matrix, -item.flugelEye.poem2=And their viable interactions -item.flugelEye.poem3=Will take the psyche back to basics. - -item.thorRing.poem0=The force of the Thunder God -item.thorRing.poem1=Will Shatter the salt of the Terra, -item.thorRing.poem2=With unstoppable strength -item.thorRing.poem3=It'll begin anew a new era. - -item.odinRing.poem0=The wise old God lays its blessings, -item.odinRing.poem1=Of virtue, life and divinity, -item.odinRing.poem2=With the hindrance of death on one's hands, -item.odinRing.poem3=They'll form the Holy Trinity. - -item.lokiRing.poem0=Empty handed, a sneaking interaction, -item.lokiRing.poem1=Once on the center, then around the track, -item.lokiRing.poem2=Back to the start one'd go to complete -item.lokiRing.poem3=The power of creating back-to-back. - -item.aesirRing.poem0=The forces of the Gods -item.aesirRing.poem1=In this band form as one, -item.aesirRing.poem2=And when combined all together -item.aesirRing.poem3=Above them will be none. - -item.dice.poem0=He deals the cards to find the answer, -item.dice.poem1=The sacred geometry of chance, -item.dice.poem2=The hidden laws of a probable outcome, -item.dice.poem3=The numbers lead a dance. +botania.baubletype.amulet=A équiper dans l'emplacement &aAmulet&7 +botania.baubletype.ring=A équiper dans l'emplacement &aRing&7 +botania.baubletype.belt=A équiper dans l'emplacement &aBelt&7 +botania.baubletooltip=Appuyez &b%s&7 pour ouvrir le menu Baubles # DEATH MESSAGES death.attack.botania-relic=%s a été puni en utilisant une relique qui n'était pas la sienne @@ -422,7 +342,7 @@ entity.Botania.botania:magicLandmine.name=Piège de Gaïa entity.Botania.botania:spark.name=Étincelle entity.Botania.botania:thrownItem.name=Élément jeté entity.Botania.botania:magicMissile.name=Missile magique -entity.Botania.botania:thornChakram.name=Thorn Chakram +entity.Botania.botania:thornChakram.name=Chakram d'épines entity.Botania.botania:corporeaSpark.name=Étincelle de Corporea entity.Botania.botania:enderAirBottle.name=Bouteille d'air du néant entity.Botania.botania:poolMinecart.name=Wagonnet à bassin de mana @@ -436,7 +356,7 @@ achievement.botania:EndoflammePickup=Arrivée de l'aube achievement.botania:daybloomPickup.desc=Faite une Fleur de jour dans l'apoticaire de pétale achievement.botania:manaPoolPickup=Vague vive achievement.botania:manaPoolPickup.desc=Améliorez un bassin de mana dilué à un normal -achievement.botania:endoflamePickup=Fussion +achievement.botania:endoflamePickup=Fusion achievement.botania:endoflamePickup.desc=Faite une Endoflamme pour augmenter la production de mana achievement.botania:tinyPotatoPet=Soyons juste amis achievement.botania:tinyPotatoPet.desc=Faites d'une minuscule pomme de terre votre animal de compagnie @@ -444,7 +364,7 @@ achievement.botania:sparkCraft=Énergie directe achievement.botania:sparkCraft.desc=Faites une étincelle pour aider à transférer le mana autour achievement.botania:baubleWear=Arts intérieurs achievement.botania:baubleWear.desc=Faite n'importe quelle variété de Bibelot et portez-les -achievement.botania:manaCookieEat=Hérésie pourrie et chocolat +achievement.botania:manaCookieEat=Hérésie accablante et chocolat achievement.botania:manaCookieEat.desc=Infusez et mangez un délicieux cookie de mana achievement.botania:runePickup=Poupée Lilium achievement.botania:runePickup.desc=Utilisez l'autel runique pour créer une rune @@ -466,46 +386,15 @@ achievement.botania:heiseiDreamPickup=Cataclysme Heisei achievement.botania:heiseiDreamPickup.desc=Créez un rève Heisei pour provoquer des ravage sur les créatures achievement.botania:dirtRodCraft=Rockbell achievement.botania:dirtRodCraft.desc=Fabriquez un dil- euh... Baton des landes -achievement.botania:spawnerMoverUse=je ne peux pas lever mon (censuré) -achievement.botania:spawnerMoverUse.desc=Utilisez un aggrégateur de vie pour transporter une cage de monstre +achievement.botania:spawnerMoverUse=Je ne peux pas lever mon (censuré) +achievement.botania:spawnerMoverUse.desc=Utilisez un aggrégateur de vie pour transporter un générateur de monstre achievement.botania:enderAirMake=Imitation à l'air achievement.botania:enderAirMake.desc=Récupérez une bouteille d'air du néant -achievement.botania:corporeaCraft=Poser boissons et friandises +achievement.botania:corporeaCraft=Jeter des boissons gazeuses et des friandises achievement.botania:corporeaCraft.desc=Fabriquez un bloc qui servira au réseau Corporea achievement.botania:signalFlareStun=Voyez les lumières -achievement.botania:signalFlareStun.desc=Aveugnez 100 créatures ou plus d'un coup avec une fusée de détresse -achievement.botania:l20ShardUse=Out of Step -achievement.botania:l20ShardUse.desc=Raise the ground up to the sky with a Power XX Shard of Laputa -achievement.botania:gaiaGuardianNoArmor=Mythologia's End -achievement.botania:gaiaGuardianNoArmor.desc=Slay a Gaia Guardian without wearing any armor at any point during the fight -achievement.botania:rankSSPick=Talent Shredder -achievement.botania:rankSSPick.desc=Dig through the world using a rank SS Terra Shatterer -achievement.botania:superCorporeaRequest=Invader Girl -achievement.botania:superCorporeaRequest.desc=Successfully request 50,000 or more of a single item in a Corporea Index -achievement.botania:pinkinator=Decorator -achievement.botania:pinkinator.desc=Put to use The Pinkinator - -achievement.botania:infiniteFruit=Innocentia -achievement.botania:infiniteFruit.desc=Be rewarded The Fruit of Grisaia for a heroic feat -achievement.botania:excaliber=Streaming Heart -achievement.botania:excaliber.desc=Be rewarded the Holy Sword Excaliber for a heroic feat -achievement.botania:flugelEye=Angel of Death -achievement.botania:flugelEye.desc=Be rewarded the Eye of the Flügel for a heroic feat -achievement.botania:thorRing=One Step Layered -achievement.botania:thorRing.desc=Be rewarded the Ring of Thor for a heroic feat -achievement.botania:odinRing=Lost Time Memory -achievement.botania:odinRing.desc=Be rewarded the Ring of Odin for a heroic feat -achievement.botania:lokiRing=Arithmetic -achievement.botania:lokiRing.desc=Be rewarded the Ring of Loki for a heroic feat -achievement.botania:aesirRing=As the Gods Say -achievement.botania:aesirRing.desc=Create the Ring of the Aesir by combining the Rings of the Gods - -achievement.botania:nullFlower=Take it Easy -achievement.botania:nullFlower.desc=Find a bug that lets you have an undefined Botania Flower. Don't forget to report it! -achievement.botania:desuGun=Two-Faced Lovers -achievement.botania:desuGun.desc=ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN -# ^ Don't localize +achievement.botania:signalFlareStun.desc=Aveuglez 100 créatures ou plus d'un coup avec une fusée de détresse # BLOCK NAMES# CHALLENGE LEVELS botania.challengelevel.easy=Facile @@ -515,46 +404,12 @@ botania.challengelevel.lunatic=Lunatique # CHALLENGE TEXT botania.challenge.flowerFarm=Ferme de fleurs -botania.challenge.flowerFarm.desc=Créez une ferme automatisée des 16 couleurs complètes de fleurs botania flowers. Point bonus si les fleurs sont triées. +botania.challenge.flowerFarm.desc=Créer une ferme automatisée des 16 couleurs complètes de fleurs botania flowers. Point bonus si les fleurs sont triées. botania.challenge.recordFarm=Ferme de disques -botania.challenge.recordFarm.desc=Create a system that produces records through the death of creepers at the hand of skeletons. Bonus points if it doesn't require a player's presence. botania.challenge.reedFarm=Ferme de canne à sucre -botania.challenge.reedFarm.desc=Create an automated sugar cane farm. Bonus points for not using pistons. botania.challenge.cobbleGen=Générateur de pierre -botania.challenge.cobbleGen.desc=Create an automated cobblestone generator and harvester. Bonus points if it also creates smooth stone without a furnace. botania.challenge.pureDaisy=Pâquerette pure auto -botania.challenge.pureDaisy.desc=Completely automate the Pure Daisy. Bonus points if only one spreader is used and/or if the wood/stone input is also automated. botania.challenge.battery=Batterie de mana -botania.challenge.battery.desc=Create a Mana Battery, a system where mana enters one pool and comes out of another, with a good amount of pools as a buffer. Bonus points if the input or output can be changed. - -botania.challenge.apothecaryRefill=Apothecary Refiller -botania.challenge.apothecaryRefill.desc=Create a system that automatically refills the Petal Apothecary if it's empty. Bonus points if the system can also automatically create flowers, given the components. -botania.challenge.treeFarm=Tree Farm -botania.challenge.treeFarm.desc=Create an automated, self-sustaining tree farm. Bonus points if it can do multiple types of tree. -botania.challenge.fullCropFarm=Full Crop Farm -botania.challenge.fullCropFarm.desc=Create a crop farm with all types of crops (wheat, carrot, potato, melon, pumpkin, cocoa and nether wart) that runs at full efficiency. Bonus points if the outputs are sorted. -botania.challenge.animalFarm=Animal Farm -botania.challenge.animalFarm.desc=Create an automated animal farm with all farmable animal types. Bonus points if the food doesn't need to be put in manually. -botania.challenge.boneMealFarm=Bone Meal-type Farm -botania.challenge.boneMealFarm.desc=Create an automated farm that utilizes bone meal to quickly grow crops on demand. Bonus points if the Drum of the Wild isn't used. -botania.challenge.orechid=Automated Orechid -botania.challenge.orechid.desc=Create a system that allows for the Orechid flower to be fully automated. Bonus points if the output is smelted and sorted. - -botania.challenge.mobTower=Spawning Tower -botania.challenge.mobTower.desc=Create a tower style mob farm. Mobs must be sorted and put into specific chambers at the end. Spawners can be used. Bonus points if the farm functions at 100% efficiency without a player's interaction. -botania.challenge.entropinnyumSetup=Entropinnyum Setup -botania.challenge.entropinnyumSetup.desc=Create a system that automatically crafts TNT and safely feeds it to an Entropinnyum flower, creating mana. Bonus points if the sand and gunpowder required for the TNT don't need to be put in manually. -botania.challenge.spectrolusSetup=Spectrolus Setup -botania.challenge.spectrolusSetup.desc=Create a system that feeds a Spectrolus, generating mana. Aside from raw mana, no items may be input from outside the system. Bonus points if it operates at 100% efficiency, never wasting any wool. -botania.challenge.potionBrewer=Automated Brewing -botania.challenge.potionBrewer.desc=Create a system that can make all types of brews automatically on demand. Bonus points if it keeps a set of incense always ignited in the player's base. - -botania.challenge.kekimurusSetup=Kekimurus Setup -botania.challenge.kekimurusSetup.desc=Fully automate a Kekimurus, every part of the system must be automated and self-sustaining. Bonus points if only one crafty crate is used. -botania.challenge.autoQuarry=Automated Quarry -botania.challenge.autoQuarry.desc=Create a mining quarry that digs for ores and stone underground. It should dig out chunks of land and output all of the mined resources, sorting them. Bonus points if it can relocate automatically after it's done with an area. -botania.challenge.runeCrafter=Rune Crafter -botania.challenge.runeCrafter.desc=Create a system that can craft all runes on demand or keep them stocked. Every part of this system must be automated and self-sustaining, including the item inputs. Bonus points if only one Runic Altar block is used. You must be pretty crazy to try this one. # BLOCK NAMES tile.botania:flower0.name=Fleur mystique blanche @@ -729,16 +584,6 @@ tile.botania:dreamwood0Slab.name=Dalle en boisrève tile.botania:dreamwood1Stairs.name=Escalliers en planches de boisrève tile.botania:dreamwood1Slab.name=Dalle en planches de boisrève tile.botania:conjurationCatalyst.name=Catalyseur de conjuration -tile.botania:prismarine0.name=Prismarin -tile.botania:prismarine1.name=Briques prismarine -tile.botania:prismarine2.name=Prismarin sombre -tile.botania:prismarine0Stairs.name=Escalliers en prismarin -tile.botania:prismarine0Slab.name=Dalle en prismarin -tile.botania:prismarine1Stairs.name=Escaliers en briques prismarine -tile.botania:prismarine1Slab.name=Dalle en briques prismarine -tile.botania:prismarine2Stairs.name=Escalliers en prismarin sombre -tile.botania:prismarine2Slab.name=Dalle en prismarin sombre -tile.botania:seaLamp.name=Lanterne marine tile.botania:miniIsland0.name=Fleur flottante blanche tile.botania:miniIsland1.name=Fleur flottante orange tile.botania:miniIsland2.name=Fleur flottante magenta @@ -757,12 +602,6 @@ tile.botania:miniIsland14.name=Fleur flottante rouge tile.botania:miniIsland15.name=Fleur flottante noire tile.botania:tinyPotato.name=Minuscule pomme de terre tile.botania:spawnerClaw.name=Imbueur de vie -tile.botania:reedBlock.name=Bloc de roseau -tile.botania:reedBlock0Stairs.name=Escaliers de roseau -tile.botania:reedBlock0Slab.name=Dalle de roseau -tile.botania:thatch.name=Chaume -tile.botania:thatch0Stairs.name=Escaliers de chaume -tile.botania:thatch0Slab.name=Dalle de chaume tile.botania:customBrick0.name=Brique cauchemardesque tile.botania:customBrick1.name=Brique d'âme tile.botania:customBrick2.name=Brique glaciale @@ -959,38 +798,10 @@ tile.botania:doubleFlower212.name=Fleur mystique marron haute tile.botania:doubleFlower213.name=Fleur mystique verte haute tile.botania:doubleFlower214.name=Fleur mystique rouge haute tile.botania:doubleFlower215.name=Fleur mystique noire haute -tile.botania:stone0.name=Andésite -tile.botania:stone1.name=Basalt -tile.botania:stone2.name=Diorite -tile.botania:stone3.name=Granite -tile.botania:stone4.name=Andésite polie -tile.botania:stone5.name=Basalt poli -tile.botania:stone6.name=Diorite polie -tile.botania:stone7.name=Granite polie -tile.botania:stone8.name=Briques d'andésite -tile.botania:stone9.name=Briques de basalt -tile.botania:stone10.name=Briques de diorite -tile.botania:stone11.name=Briques de granite tile.botania:stone12.name=Brique d'andésite sculpté tile.botania:stone13.name=Brique de basalt sculpté tile.botania:stone14.name=Brique de diorite sculpté tile.botania:stone15.name=Briques de granite sculpté -tile.botania:stone0Stairs.name=Escaliers d'andésite -tile.botania:stone1Stairs.name=Escaliers de basalt -tile.botania:stone2Stairs.name=Escaliers de diorite -tile.botania:stone3Stairs.name=Escaliers de granite -tile.botania:stone8Stairs.name=Escaliers de brique d'andésite -tile.botania:stone9Stairs.name=Escaliers de brique de basalt -tile.botania:stone10Stairs.name=Escaliers de brique de diorite -tile.botania:stone11Stairs.name=Escaliers de brique de granite -tile.botania:stone0Slab.name=Dalle d'andésite -tile.botania:stone1Slab.name=Dalle de basalt -tile.botania:stone2Slab.name=Dalle de diorite -tile.botania:stone3Slab.name=Dalle de granite -tile.botania:stone8Slab.name=Dalle de brique d'andésite -tile.botania:stone9Slab.name=Dalle de brique de basalt -tile.botania:stone10Slab.name=Dalle de brique de diorite -tile.botania:stone11Slab.name=Dalle de brique de granite tile.botania:blazeBlock.name=Lampe de flamme tile.botania:corporeaInterceptor.name=Intercepteur de Corporea tile.botania:corporeaCrystalCube.name=Cube de cristal Corporea @@ -1007,8 +818,6 @@ tile.botania:lightLauncher.name=Lanceur de luminiseur tile.botania:livingrock0Wall.name=Mur de viveroche tile.botania:livingwood0Wall.name=Mur de vifbois tile.botania:dreamwood0Wall.name=Mur de boisrève -tile.botania:prismarine0Wall.name=Mur de prismarin -tile.botania:reedBlock0Wall.name=Mur de bloc de roseau tile.botania:biomeStoneA0Wall0.name=Mur de roche métamorphique des forêts tile.botania:biomeStoneA0Wall1.name=Mur de roche métamorphique des plaines tile.botania:biomeStoneA0Wall2.name=Mur de roche métamorphique des montagnes @@ -1017,10 +826,6 @@ tile.botania:biomeStoneA0Wall4.name=Mur de roche métamorphique des marais tile.botania:biomeStoneA0Wall5.name=Mur de roche métamorphique des déserts tile.botania:biomeStoneA0Wall6.name=Mur de roche métamorphique des taigas tile.botania:biomeStoneA0Wall7.name=Mur de roche métamorphique des mesas -tile.botania:stone0Wall0.name=Mur d'andésite -tile.botania:stone0Wall1.name=Mur de basalt -tile.botania:stone0Wall2.name=Mur de diorite -tile.botania:stone0Wall3.name=Mur de granite tile.botania:manaBomb.name=Charge de manatempète tile.botania:buriedPetals0=Pétale blanche enterrée tile.botania:buriedPetals0.name=Pétale blanche enterrée @@ -1077,70 +882,6 @@ tile.botania:flower.narslimmus.reference=Qu'es-ce-que c'est ? C'est tout collant tile.botania:flower.spectrolus.name=Spectrolus tile.botania:flower.spectrolus.reference=Profiter de la haine -# - FUNCTIONAL -tile.botania:flower.bellethorn.name=Bellethorne -tile.botania:flower.bellethorn.reference=world's end, girl's rondo -tile.botania:flower.bellethornChibi.name=Bellethorne Petite -tile.botania:flower.bellethornChibi.reference=world's end, girl's rondo -tile.botania:flower.dreadthorn.name=Dreadthorne -tile.botania:flower.dreadthorn.reference=Plan C -tile.botania:flower.heiseiDream.name=Heisei Dream -tile.botania:flower.heiseiDream.reference=Heisei heisei kowarete -tile.botania:flower.tigerseye.name=Tigerseye -tile.botania:flower.tigerseye.reference=The palmtop tiger -tile.botania:flower.jadedAmaranthus.name=Jaded Amaranthus -tile.botania:flower.jadedAmaranthus.reference=A couple died for this -tile.botania:flower.orechid.name=Orechid -tile.botania:flower.orechid.reference=I seed what you did there -tile.botania:flower.orechidIgnem.name=Orechid Ignem -tile.botania:flower.orechidIgnem.reference=Red like roses -tile.botania:flower.fallenKanade.name=Fallen Kanade -tile.botania:flower.fallenKanade.reference=I'm not an Angel -tile.botania:flower.exoflame.name=Exoflame -tile.botania:flower.exoflame.reference=Wearing her black ribbons -tile.botania:flower.agricarnation.name=Agricarnation -tile.botania:flower.agricarnation.reference=Wear on the 25th of april -tile.botania:flower.agricarnationChibi.name=Agricarnation Petite -tile.botania:flower.agricarnationChibi.reference=Wear on the 25th of april -tile.botania:flower.hopperhock.name=Hopperhock -tile.botania:flower.hopperhock.reference=It all funnels into it -tile.botania:flower.hopperhockChibi.name=Hopperhock Petite -tile.botania:flower.hopperhockChibi.reference=It all funnels into it -tile.botania:flower.tangleberrie.name=Tangleberrie -tile.botania:flower.tangleberrie.reference=No frying pans allowed -tile.botania:flower.jiyuulia.name=Jiyuulia -tile.botania:flower.jiyuulia.reference=Flügel der Freiheit -tile.botania:flower.rannuncarpus.name=Rannuncarpus -tile.botania:flower.rannuncarpus.reference=That's handy -tile.botania:flower.rannuncarpusChibi.name=Rannuncarpus Petite -tile.botania:flower.rannuncarpusChibi.reference=That's handy -tile.botania:flower.hyacidus.name=Hyacidus -tile.botania:flower.hyacidus.reference=If you don't walk, it doesn't hurt -tile.botania:flower.pollidisiac.name=Pollidisiac -tile.botania:flower.pollidisiac.reference=Birds and bees -tile.botania:flower.clayconia.name=Clayconia -tile.botania:flower.clayconia.reference=Rupees not included -tile.botania:flower.loonium.name=Loonium -tile.botania:flower.loonium.reference=Hold it up above your head -tile.botania:flower.daffomill.name=Daffomill -tile.botania:flower.daffomill.reference=Cook's Assistant -tile.botania:flower.vinculotus.name=Vinculotus -tile.botania:flower.vinculotus.reference=Totally an Extra Utils ripoff -tile.botania:flower.spectranthemum.name=Spectranthemum -tile.botania:flower.spectranthemum.reference=In the shell -tile.botania:flower.medumone.name=Medumone -tile.botania:flower.medumone.reference='Twas Hades all along -tile.botania:flower.marimorphosis.name=Marimorphosis -tile.botania:flower.marimorphosis.reference=Solid as a rock -tile.botania:flower.marimorphosisChibi.name=Marimorphosis Petite -tile.botania:flower.marimorphosisChibi.reference=Solid as a rock -tile.botania:flower.bubbell.name=Bubbell -tile.botania:flower.bubbell.reference=And whistle -tile.botania:flower.bubbellChibi.name=Bubbell Petite -tile.botania:flower.bubbellChibi.reference=And whistle -tile.botania:flower.solegnolia.name=Solegnolia -tile.botania:flower.solegnolia.reference=All your magnets are belong to us - # ITEM NAMES item.botania:lexicon.name=Lexica Botania item.botania:lexicon.bevo=Lexica Botana @@ -1452,7 +1193,7 @@ item.botania:terraAxe.name=Troncateur Terra item.botania:manasteelNugget.name=Pépite de manacier item.botania:terrasteelNugget.name=Pépite de terracier item.botania:elementiumNugget.name=Pépite d'élémentium -item.botania:root.name=Racine vivante +item.botania:livingRoot.name=Racine vivante item.botania:pebble.name=Caillou item.botania:waterBowl.name=bol d'eau item.botania:obedienceStick.name=Bâton d'obéissance floral @@ -1512,685 +1253,75 @@ botania.category.misc=Divers # LEXICON ENTRIES -# - BASIC -# -- WELCOME TO BOTANIA -botania.entry.welcome=Welcome To Botania -botania.page.welcome0=&oWhat is peace? Is it truly just a lack of combat? Is it years of sitting quietly in a garden, surrounded by flowers? Is it watching over a kingdom that you are able to call your own? Is it the completion of almost every task known to man? Is it the ability to watch numbers of resources steadily rise as you watch your collection grow? -botania.page.welcome1=&oIs peace something that can be obtained easily, without work - or is it something difficult to obtain?
    Let's say for a moment - not even a second - that peace is truly just a lack of work; peaceful days surrounded by flowers. -botania.page.welcome2=&oYears spent watching time tick by while you watch your flora perform every single task imaginable, without outside help from polluting machines or computers tangled in cables and pipes.
    Now imagine that everything we just talked about was possible. -botania.page.welcome3=&oImagine that through your hard labor - your cultivation of flowers, your manipulation of mana, your knowledge of the mechanisms of the world and redstone - you could obtain that dreamlike state. Imagine that you could have everything you could ever desire automated with flora. Flora, some magic, and your own ingenuity. -botania.page.welcome4=&oWith the help of this book, your dreams will become a reality.
    The name of this book is deceptive. Despite being called the Lexica Botania, this tome focuses on far more than just flowers. It focuses on a variety of devices, both magical and bordering on technological. -botania.page.welcome5=&oIt holds the secrets of the elves, who have long ago fled from this world, as well as possible clues to the origins of the very world itself. For anyone with a basic knowledge of redstone and the creativity to put it to use, this book offers answers to nearly every problem known to man, without the need to use foreign schools of magic or machinery. -botania.page.welcome6=&oThis book contains instructions on how to perform nearly every task that one could ever need, with only the use of what's in it, and available in the world of Minecraft, assuming you're up to the task of putting them together in ingenious ways.
    Try it out, you'll be amazed at what you can do without outside interference. -botania.page.welcome7=&oThe school of botany does not solely apply to those with a knack for complex thought processes.
    Introduction to the art is simple, and the rewards are vast. A wide range of magical accessories and instruments allow for empowering of one who decides to study the various options therein. -botania.page.welcome8=&oDear reader, I welcome you to the realm of Botania.&r
    - Written by &nGideon Seymour&r, guest writer. (Adapted for use) - -# -- TUTORIAL OF THE BASICS -botania.entry.tutorial=A Tutorial of the Basics -botania.page.tutorial0=While one could just go through the various entries in the book at their issue, there's also a "guided tour" of sorts available. Clicking the button below will guide you through the pages useful to getting the gist of the basic concepts of Botania. - -# -- AN INTRODUCTORY CLIP -botania.entry.introVideo=An Introductory Clip -botania.page.introVideo0=For those readers who are not quite readers, a short video guide covering the basics of Botania is also available. It's to keep in note that this guide acts as an aid and not a substitution for the contents of the &1Lexica Botania&0. - -# -- GARDEN OF GLASS -botania.entry.gardenOfGlass=Garden of Glass -botania.page.gardenOfGlass0=In the &2Garden of Glass&0 nobody can hear you scream.
    You're alone in space.
    How exciting. -botania.page.gardenOfGlass1=The &2Garden of Glass&0 is a skyblock mode for Botania. It's advised only for players who are somewhat experienced in the mod, but if you're new to it, you're more than welcome to try it out anyway.
    Most of the mod functions the same, but some tweaks have been put in place to allow for the skyblock style game. They'll be listed in the following pages. -botania.page.gardenOfGlass2=After spawning in the &1Garden of Glass&0 you'll find &1Living Roots&0 below the landing area. These can be used to create &1Saplings&0 and &1Floral Fertilizer&0. They also work as &1Bone Meal&0. Shift-right clicking a &1Dirt&0 or &1Grass&0 block with an empty hand will have you rummage through the soil, finding some &1Pebbles&0, that can be converted into &1Cobblestone&0. Filling a &1Petal Apothecary&0 can be done with a &1Bowl&0 by clicking on a water block. -botania.page.gardenOfGlass3=Creating &1Saplings&0 -botania.page.gardenOfGlass4=Creating &1Floral Fertilizer&0 -botania.page.gardenOfGlass5=Creating &1Cobblestone&0 -botania.page.gardenOfGlass6=Aside from that, some things in Botania are different to fit the Skyblock play: The &1Orechid&0 is easier to make, faster and much cheaper; The &1Cocoon of Caprice&0 and the &1Mana Spreader&0 have different recipes; the &1Blaze Lamp&0, which can be used to create &1Obsidian&0, uses powder instead of rods; melon or pumpkin seeds may drop from tall grass; floral fertilizer creates more per craft, and &1Sugar Canes&0 and &1Slimeballs&0 can be crafted. -botania.page.gardenOfGlass7=Creating &1Sugar Canes&0 -botania.page.gardenOfGlass8=Creating &1Slimeballs&0 -botania.page.gardenOfGlass9=It's possible to infuse a &1Pumpkin&0 with the fel spirits of monster slain, creating a &1Fel Pumpkin&0. This can be placed atop two &1Iron Bars&0, in a similar fashion to a &1Snow Golem&0, to spawn a &1Blaze&0.
    &1Blazes&0 spawned with this method drop &1Blaze Powder&0 instead of &1Blaze Rods&0. -botania.page.gardenOfGlass10=Nerfing warlocks again -botania.page.gardenOfGlass11=Aside from providing light, the &1Mana Flash&0 present in the starting area allows a player who has lost their &1Lexica Botania&0 to exchange a &1Sapling&0 for it, by right clicking with the &1Sapling&0 on the &1Mana Flame&0.
    This can only be done if the player doesn't have a &1Lexica Botania&0 on them. -botania.page.gardenOfGlass12=Lastly, an &1End Portal&0 recipe - -# -- LEXICA BOTANIA -botania.entry.lexicon=Lexica Botania -botania.page.lexicon0=The &1Lexica Botania&0 is the repository of all knowledge for all botany related matters. But you probably knew that already.
    All information is stored here, as expected. For convenience, if a block happens to have an entry, it can be shift-right clicked with the &1Lexica Botania&0 to open that entry. -botania.page.lexicon3=Any entries typed in &oItalics&r are &4basic&0 entries, which contain the very basic knowledge required to playing Botania. They should be prioritized over others, most of the sections contain one or more, so a good look through through them is a good idea. -botania.page.lexicon1=Crafting the &1Lexica Botania&0. -botania.page.lexicon2=The &1Lexica Botania&0's title can also be customized. By placing it in an &1Anvil&0 and renaming it, one can not only change its cover, but also the title.
    The Edition of the lexica shown equates to the version of the &4Botania&0 you're running, and no, I don't care about the fourth wall. - # -- MYSTICAL FLOWERS botania.entry.flowers=Fleur mystique Flowers -botania.page.flowers0=Around the world, you may stumble upon a large variety of Fleur mystique Flora. Spotting these doesn't take much work as the flowers themselves emit a fair amount of shine.
    They come in a total of &416 &0different colors.
    It's also possible to grow these flowers using &1Floral Fertilizer&0 (read on). -botania.page.flowers1=Flowers as far as the eye can see... -botania.page.flowers2=These flowers can be plucked for &1Fleur mystique Petals&0, that can be used for making magical instruments and plants alike.
    Right clicking a petal on the ground will &4bury it&0, having it emit particles.
    These petals can also be crushed into &1Floral Powder&0, which functions much alike any mundane piece of dye. -botania.page.flowers3=Plucking Petals off Flowers. -botania.page.flowers4=Crafting the &1Pestle and Mortar&0. -botania.page.flowers5=Grinding Petals into Powder. -botania.page.flowers6=Right clicking the &1Floral Powder&0 in any &1Wool&0 or &1Carpet&0 changes its color to the color of the powder.
    By mixing the &1Floral Powder&0 with some &1Bone Meal&0, it's possible to create a different type of fertilizer. The &1Floral Fertilizer&0 will grow a small amount of &1Fleur mystique Flowers&0 in the nearby vicinity, if you ever run low on them. -botania.page.flowers7=Making fertilizer (any powder colors work) -botania.page.flowers8=Using typical flower substances also works -botania.page.flowers10=There's also some taller variants of the typical &1Fleur mystique Flowers&0, spread around the place. These can only be gathered with &1Shears&0, but can be used to obtain twice the amount of petals a normal flower would yield. They're a bit too big for dye, though.
    They can be made manually by fertilizing a &1Fleur mystique Flower&0 with &1Bone Meal&0. -botania.page.flowers11=Prepare for trouble -botania.page.flowers9=Petals can also be made into blocks # -- PETAL APOTHECARY botania.entry.apothecary=Apotiquaire de pétales -botania.page.apothecary0=In order for a botanist to create plantlife that can do its bidding, one would need special means of infusing plants with Fleur mystique energy.
    Luckily, the &1Petal Apothecary&0 does just that. -botania.page.apothecary1=The &1Petal Apothecary&0. -botania.page.apothecary2=This block, when placed in the world and given some water (by use of a &1Water Bucket&0), will accept any &1Fleur mystique Petals&0 thrown at it, releasing their energies.
    Once one has set the correct petals in, throwing some &1Seeds&0 in will finalize the proccess.
    Tossing in the full bucket will also fill the recipient with water. -botania.page.apothecary3=Quite a few plants can be made using this method, for more information, read on the &4Functional Flora&0 and &4Generation Flora&0 sections of this Lexicon.
    Shift-right clicking the &1Petal Apothecary&0 with an empty hand will remove the last item thrown in. -botania.page.apothecary4=Instead of &1Water&0, one can place &1Lava&0 in this block, if that is done, it'll serve as a brazier and incinerator, destroying any items that come in contact.
    Lastly, tossing in &1Vines&0 also gives the block an overgrown visual. -botania.page.apothecary6=A simple tip for those who want to squeeze the biggest efficiency out of every block is as follows, up to twenty seconds after crafting a flower in this block, right clicking it with an empty hand will pull the items from the inventory required for the recipe and put them into it for quick mass crafting. This only works if it has water. -botania.page.apothecary5=Crafting the &1Petal Apothecary&0. # -- PURE DAISY botania.entry.pureDaisy=Pâquerette pure -botania.page.pureDaisy0=The &1Pure Daisy&0 is not only the most basic, but also the most important flower a botanist can have.
    This flower will purify any adjacent &1Wood&0 and &1Stone&0 blocks, as seen on the next page, into their purified counterparts, &1Livingwood&0 and &1Livingrock&0, which can be used for crafting. -botania.page.pureDaisy1=Just give it &4a minute&0 or so... -botania.page.pureDaisy2=&1Livingwood&0 can be turned into twigs -botania.page.pureDaisy4=A few other blocks can also be purified by placing them around the flower. While not as unique and essential as the living blocks, perhaps this might come in handy. This includes &1Netherrack&0 into &1Cobblestone&0, &1Soul Sand&0 into &1Sand&0 or &1Ice&0 into &1Packed Ice&0. -botania.page.pureDaisy3=White is bright and pure # -- WAND OF THE FOREST botania.entry.wand=Bâton de la forêt -botania.page.wand0=The general multi-use tool for a botanist is the &1Wand of the Forest&0.
    This wand, made by, effectively, strapping a pair of &1Fleur mystique Petals&0 of any color to a few &1Vifbois Twigs&0, is required for a good amount of tasks. -botania.page.wand1=The wand has two modes, &4Bind Mode&0 and &4Function Mode&0. In &4Bind Mode&0 it can be shift-right clicked on a compatible block to select it. Shift-right clicking elsewhere binds the two blocks. In &4Function Mode&0 it'll simply not do that for shift-right clicking.
    The two modes can be switched freely by shift-right clicking on air. -botania.page.wand2=If the wand isn't bound to anything, shift-right clicking a block allows it to be rotated around the axis of the side it's clicked on.
    For example, clicking on the top of a &1Chest&0 rotates it around. Most blocks which can be rotated should work. -botania.page.wand3=The petals used determine the colors of the wand # -- RUNIC ALTAR botania.entry.runeAltar=Autel runique -botania.page.runeAltar21=Runic creation is a rather important complex in the advancement of the botanical magics. First and foremost, though, this type of crafting requires a decent knowledge of &4Mana Manipulation&0. Before proceeding further, a read through the important entries (those in &oItalics&r) on that section of the &1Lexica Botania&0 might prove enlightening. -botania.page.runeAltar0=&1Runes&0 are extremely important components of complex magical devices or flora.
    In order to create these, one would require a &1Runic Altar&0.
    To utilize this &1Runic Altar&0, start by placing, via either a right click or simply tossing, the components to the rune you want to create. -botania.page.runeAltar1=Proceed by linking a &1Diffuseur de mana&0 to the altar, and right click it with a &1Wand of the Forest&0.
    It should be apparent when the altar has received enough &4Mana&0. When that happens, just drop a piece of &1Livingrock&0 on top of it and use the wand on it again to collect your rune. -botania.page.runeAltar2=Crafting the &1Runic Altar&0. -botania.page.runeAltar3=A total of 16 &1Runes&0 exist.
    The most basic and elementary runes are named after the &4Four Elements&0. The intermediate runes are named after the &4Four Seasons&0, and the most advanced runes are named after the &4Seven Deadly Sins&0. A separate &1Rune of Mana&0 also exists. -botania.page.runeAltar20=Sneaking and right-clicking the &1Runic Altar&0 with an empty hand while it's not accepting mana will remove the last item put into it.
    Last but not least, attaching a &1Comparator&0 to it will emit signal strength &41&0 if the altar is accepting &4Mana&0 and signal strength &42&0 if it's ready to craft the rune. -botania.page.runeAltar21=Similarly to the &1Petal Apothecary&0, right clicking this block with an empty hand after a recipe is complete will place back the items used for the last recipe for faster mass crafting. -botania.page.runeAltar4=The &1Rune of Water&0. -botania.page.runeAltar5=The &1Rune of Earth&0. -botania.page.runeAltar6=The &1Rune of Air&0. -botania.page.runeAltar7=The &1Rune of Fire&0. -botania.page.runeAltar8=The &1Rune of Spring&0. -botania.page.runeAltar9=The &1Rune of Summer&0. -botania.page.runeAltar10=The &1Rune of Autumn&0. -botania.page.runeAltar11=The &1Rune of Winter&0. -botania.page.runeAltar12=The &1Rune of Mana&0. -botania.page.runeAltar13=The &1Rune of Lust&0. -botania.page.runeAltar14=The &1Rune of Gluttony&0. -botania.page.runeAltar15=The &1Rune of Greed&0. -botania.page.runeAltar16=The &1Rune of Sloth&0. -botania.page.runeAltar17=The &1Rune of Wrath&0. -botania.page.runeAltar18=The &1Rune of Envy&0. -botania.page.runeAltar19=The &1Rune of Pride&0. # -- TERRASTEEL botania.entry.terrasteel=Terracier -botania.page.terrasteel0=&1Terrasteel&0 is a complex magical alloy, infused with a great amount of &4Mana&0. Conjuring it proves not to be a small task. For starters, to create it, one would require a &1Terrestrial Agglomeration Plate&0, set on top of a checkerboard pattern of &1Lapis Lazuli Blocks&0 and &1Livingrock&0. &4Mana&0 would need to be provided to this block, &1Sparks&0 would be the most effective way.. -botania.page.terrasteel1=Creating the plate -botania.page.terrasteel2=After the plate is set up and ready to receive &4Mana&0, tossing a single &1Manasteel Ingot, Mana Diamond and Mana Pearl&0 on top of it will begin the infusion.
    Picking up any of the items will halt the infusion causing severe &4Mana Loss&0. The infusion uses half a &1Mana Pool&0 total to create a single piece of &4Terrasteel&0, multiple &1Sparks&0 would make it go faster, too. -botania.page.terrasteel3=Creating &1Terrasteel&0 (there's &1Livingrock&0 under the plate) # -- BLACK LOTUS botania.entry.blackLotus=Lotus noir -botania.page.blackLotus0=An elusive flower by the name of &1Black Lotus&0 is known to exist, however, it does not grow or reproduce. Where they can be found or come from is not known.
    It is known, however, that it contains a strong amount of concentrated &4Mana&0, that can be released by putting it in contact with a &1Mana Pool&0 that already has some in it. Just tossing it would do. - - -# -- FLOWER POUCH -botania.entry.flowerBag=Flower Pouch -botania.page.flowerBag0=The laws of physics regarding one's &4Inventory&0 are somewhat skewed in this world. Thanks to that, carrying an array of different colors of flowers turns out to be a major hassle. Luckily, a &1Flower Pouch&0 takes care of all those issues. It can store up to one stack of each color of &1Fleur mystique Flower&0, not only that but it'll passively catch any that enter the holder's inventory. -botania.page.flowerBag2=Items won't be added automatically to the pouch if that's the item being held.
    Furthermore, shift-right clicking the pouch into a &1Chest&0 or other inventory will store the flowers it contains into said inventory. -botania.page.flowerBag1=Pull a copter out of it (any colors work) - -# -- WRAP -botania.entry.wrap=Wrap -botania.page.wrap0=It seems like the creator of this mod decided to add a weird game mechanic in the form of &1Wrap&0. I don't really know what it does, probably something bad. :/
    What's this "Fourth Wall" you're talking about...? - -# - MANA -# -- AN INTRODUCTION TO MANA -botania.entry.mIntro=An Introduction to Mana -botania.page.mIntro0=&4Mana&0 is an ethereal substance. In layman's terms, it is a form of &4Fleur mystique energy&0. Its sensorial existence is inconstant, and its color depends on the environment its put in.
    Mastering &4Mana&0 is one of the most important skills a botanist needs to master. -botania.page.mIntro1=In order to create &4Mana&0, one would require a set of &4Generating Flowers&0 (read the respective section). This &4Mana&0 can be dispersed by utilizing &1Diffuseur de manas&0 and stored in &1Mana Pools&0. &4Mana&0 can be used for a myriad of different things. For starters, it can be used for &4Functional Flowers&0 (read the respective section). -botania.page.mIntro2=To get started with mastering the art of &4Mana&0, one would start by learning how to use &1Fleur de jours&0, &1Diffuseur de manas&0 and &1Mana Pools&0.
    These form a basic infrastructure for mana, which can be used for all sorts of purposes. Have a read at the &4Functional Flora&0 and &4Magical Apparatus&0 sections of this Lexicon. # -- Diffuseur de mana botania.entry.spreader=Diffuseur de mana -botania.page.spreader0=The &1Diffuseur de mana&0 is the most important component in manipulating &4Mana&0.
    This is the block that allows &4Mana&0 to travel from point A to point B. When this block is placed on the ground, it'll face one of 6 basic directions. By holding shift-right on it with a &1Wand of the Forest&0, one can orient it to the opposite of where it was clicked. It can be pointed to other blocks with a wand in &4Bind Mode&0. -botania.page.spreader1=Holding a &1Wand of the Forest&0 -botania.page.spreader2=The &1Diffuseur de mana&0 has a small internal buffer of &4Mana&0, which will get filled by nearby &4Generating Flowers&0. This buffer can be viewed by looking at the &1Spreader&0 with a &1Wand of the Forest&0, as demonstrated in the last page.
    Note that the block needs to be right clicked with a wand to get accurate and adequate values. -botania.page.spreader3=Holding a &1Wand of the Forest&0 displays a beam which shows where the spreader is pointing at. Hovering over it shows the target. The sparkle that's always shown is the point when &4Mana loss&0 starts to happen.
    If the target of the spreader is a block that can contain &4Mana&0, and isn't full, the spreader will fire a &4Mana Burst&0, which will travel to the target, and pass the &4Mana&0 along to it. -botania.page.spreader4=The spreader only fires one burst at once, it'll only fire another one when the last one hits the target.
    Furthermore, the bursts also start suffering &4mana loss&0 after a small amount of time. This can be seen in the beam, which becomes a lot thinner when this happens. There is also a small amount of &4mana loss&0 when a beam enters a spreader. -botania.page.spreader11=Applying a &4Redstone Signal&0 to the spreader will have it cease to function. Case better control is required, a &1Redstone Diffuseur de mana&0 is recommended, as it can fire bursts without a target block and works on redstone pulses. -botania.page.spreader5=Crafting the &1Diffuseur de mana&0 -botania.page.spreader10=Right clicking the spreader with a piece of &1Wool&0 will sleeve it. Aside from making it look fancier, it'll also muffle the sound when a burst is shot, making it much less obnoxious when there's a large amount of spreaders in one area.
    Right clicking with an empty hand will remove the sleeve. # -- MANA POOL botania.entry.pool=Bassin de mana -botania.page.pool0=The &1Mana Pool&0 is, simply put, a storage of &4Mana&0.
    Mana can be inserted into it by usage of a &1Diffuseur de mana&0, and any adjacent &1Diffuseur de manas&0 will pull mana from it to increase their internal buffer automatically.
    Any &4Functional Flowers&0 require a nearby &1Mana Pool&0 to draw power from. -botania.page.pool9=&1Mana Pools&0 come in two varieties, a weaker, &1Diluted&0 variety which only stores a very small amount of &4Mana&0 and isn't able to infuse items, and a &1Normal&0 variety, which can store as much as a hundred times more than the dilluted one and can infuse items.
    Whenever "Mana Pool" is refered elsewhere for scale, it refers to a normal one. -botania.page.pool1=Making a &1Dilluted Mana Pool&0. -botania.page.pool10=Infusing a normal &1Mana Pool&0 -botania.page.pool2=Tossing in some resources into a normal &1Mana Pool&0 will cause them to get infused with &4Mana&0, turning them into more powerful forms.
    A few examples are &1Iron Ingots&0 or &1Fleur mystique Petals&0.
    &4Mana&0 reading for this block functions like the &1Diffuseur de mana&0. A &1Redstone Comparator&0 can also output a signal based on the contents. -botania.page.pool8=For the artistic types, tossing any color of &1Floral Powder&0 in the pool will have it take its color, all sixteen colors are viable for decoration and/or easy labelling. -botania.page.pool3=Infusing &1Manasteel&0 -botania.page.pool4=Infusing &1Mana Pearls&0 -botania.page.pool5=Infusing &1Mana Diamonds&0 -botania.page.pool6=Infusing &1Mana Petals&0 -botania.page.pool11=Infusing &1Managlass&0, clear seamless glass. -botania.page.pool12=Infusing &1String&0 -botania.page.pool7=Infusing &1Mana Cookies&0, pretty good food. - -# -- SPARKS -botania.entry.sparks=Sparks -botania.page.sparks0=&1Sparks&0 are interesting entities. Created from a combination of raw energy and &4Mana&0, they have the ability to be placed on top of a few specific &4Mana&0 containing or accepting blocks, mainly, &1Mana Pools&0.
    Some blocks have the ability to harness &4Mana&0 from &1Sparks&0, but the uses for them seem limited to a few blocks right now. -botania.page.sparks1=Placing a &1Spark&0 on top of a &1Mana Pool&0 and another on top of a block that can accept it will allow for the latter to remotely access the reservoirs of the &1Mana Pool&0 when needed, given it's not too far away.
    To remove a &1Spark&0 simply shift-right click it with a &1Wand of the Forest&0. Regular right clicking shows which other &1Sparks&0 it can transfer to. -botania.page.sparks2=&oholds up spork&r - -# -- SPARK AUGMENTATION -botania.entry.sparkUpgrades=Spark Augmentation -botania.page.sparkUpgrades0=As it seems, &1Sparks&0 are a bit more versatile than it was known previously. A variety of &1Augments&0 can be applied to them to enhance their abilities. It's to note that Augments can only be applied to &1Sparks&0 that lie on &1Mana Pools&0.
    A &1Spark&0 can only have a single &1Augment&0 at any given time. -botania.page.sparkUpgrades1=Starting off, the &1Dispersive Augment&0 has the &1Spark&0 use up the &4Mana&0 in the pool below, to charge any nearby players' &4Mana&0 containing items. -botania.page.sparkUpgrades2=The &1Dominant Augment&0 will have the &1Spark&0 pull any &4Mana&0 from nearby non-augmented &1Sparks'&0 pools into its own, until it's completely full. -botania.page.sparkUpgrades3=The &1Recessive Augment&0 will have the &1Spark&0 output all of the &4Mana&0 in its pool into any nearby non-augmented or Dispersive &1Sparks'&0 pools until it's completely empty. -botania.page.sparkUpgrades4=Lastly, the &1Isolated Augment&0 will prevent the &1Spark&0 from interacting with any Dominant or Recessive &1Sparks&0, but still allow it to interact with blocks that can receive their &4Mana&0 through the &1Spark&0 network. -botania.page.sparkUpgrades5=Crafting the Augments - -# -- MANA DISTRIBUTOR -botania.entry.distributor=Mana Distributor -botania.page.distributor0=Any botanist will eventually reach a point where a single &1Mana Pool&0 setup is not enough.
    The &1Mana Distributor&0 will fix all those issues. By placing it adjacently to a few &1Mana Pools&0 on its sides, when it receives &4Mana&0 through &4Mana Bursts&0 it'll equally spread it to the adjacent pools. -botania.page.distributor1=Crafting the distributor - -# -- MANA VOID -botania.entry.manaVoid=Mana Void -botania.page.manaVoid0=The &1Mana Void&0 is, in layman's terms, the grave for &4Mana&0. Any &4Mana&0 shot into this block will simply vanish into the void, never to be seen again.
    Placing one of these under a &1Mana Pool&0 allows the pool to always accept &4Mana&0, but disposing any it can't hold. -botania.page.manaVoid1=Even Chad from accounting? - -# -- MANA FLUXFIELD -botania.entry.rfGenerator=Mana Fluxfield -botania.page.rfGenerator0=By passing &4Mana&0 through a field of redstone energy, its state can change from a natural energy source to &4Redstone Flux&0.
    Simply pointing a spreader at this block will have it shoot at it, converting the &4Mana&0 that lands on it into &4RF&0. It can then be pulled out with any &4RF&0 transporter. -botania.page.rfGenerator1=The bullet guys. I bit it. - -# -- MANA LENSES -botania.entry.lens=Mana Lenses -botania.page.lens0=In order to upgrade the potential a &1Diffuseur de mana&0, one can apply &1Mana Lenses&0. The very basic mana lens does absolutely nothing.
    Lenses can be &4dyed&0, in a workbench, all the 16 colors of the spectrum, or combined with a &1Mana Pearl&0 to create a &1Rainbow Lens&0. These will change the color of the burst. -botania.page.lens1=The basic lens, it doesn't do anything. -botania.page.lens2=&4Dyeing&0 lenses! -botania.page.lens3=&1Rainbow Lens&0 all the way -botania.page.lens4=But lenses are not only for fancy colors. One can upgrade them with all sorts of materials to create new lens which can do all sorts of effects on the &4Mana Bursts&0.
    It's to take in mind that, if using a normal &1Diffuseur de mana&0, there needs to be a &4Mana&0 receiving block at the end for the burst to fire. A &1Redstone Diffuseur de mana&0 is recommended for some lenses. -botania.page.lens5=Sometimes, though, having a single &1Mana Lens&0 in a spreader just isn't enough sometimes. By combining two lenses with a &1Slimeball&0 in a crafting table, it's possible to unite them into one, and keep the effects of both.
    The first lens used determines the visuals (texture and color). It's to note that some combinations will not work, nor will two lenses of the same type. -botania.page.lens6=The &1Velocity Lens&0 will drastically increase the speed at which a &4Mana Burst&0 travels, but not only does the beam start to lose its &4Mana&0 a lot faster, it can also carry a bit less. -botania.page.lens7=Velocity Lens -botania.page.lens8=The &1Potency Lens&0 will double the amount of &4Mana&0 a &4Mana Burst&0 can carry, however, the beam becomes slower and after it starts to lose mana it does so at a lot faster rate. -botania.page.lens9=Potency Lens -botania.page.lens10=The &1Resistance Lens&0 will significantly increase the amount of time the &4Mana Burst&0 can go without starting to lose &4Mana&0, but it makes it a a bit slower. -botania.page.lens11=Resistance Lens -botania.page.lens12=The &1Efficiency Lens&0 will decrease the amount of time it takes for the &4Mana Burst&0 to start losing its &4Mana&0, but when that happens, it does so at a lot slower rate. -botania.page.lens13=Efficiency Lens -botania.page.lens14=The &1Bounce Lens&0 will allow the &4Mana Burst&0 to bounce off walls, rather than dissipating on a collision. -botania.page.lens15=Bounce Lens -botania.page.lens16=The &1Gravity Lens&0 makes the &4Mana Burst&0 be attracted by the world's gravitational pull, thus moving in an arc. As compensation, it also slightly increases the time before &4Mana&0 loss starts to happen. -botania.page.lens17=Gravity Lens -botania.page.lens18=The &1Bore Lens&0 charges the &4Mana Burst&0 with the ability to break any blocks it comes into contact with, draining its own mana to do so. -botania.page.lens19=Bore Lens -botania.page.lens20=The &1Damaging Lens&0 charges the &4Mana Burst&0 with the power to damage any living beings it comes across, draining its own mana to do so. -botania.page.lens21=Damaging Lens -botania.page.lens22=The &1Phantom Lens&0 is an interesting one. By utilizing the &1Abstruse Platform&0 and its' properties, it's possible to make a lens that'll allow the &4Mana Burst&0 to pass through blocks. In doing so, the time it can stay without losing mana is decreased. -botania.page.lens23=Phantom Lens -botania.page.lens24=The &1Magnetizing Lens&0, as its name states, allows the &4Mana Burst&0 to magnetize, or home in, on any nearby blocks that can receive &4Mana&0. Doing so slightly decreases the speed of the burst. -botania.page.lens25=Magnetizing Lens -botania.page.lens26=The &1Entropic Lens&0 imbues the &4Mana Burst&0 with entropy, causing it to release its energy in the form of an explosion when it collides against something that can't receive &4Mana&0. -botania.page.lens27=Entropic Lens -botania.page.lens28=The &1Influence Lens&0 allows the &4Mana Burst&0 to have influence over any nearby &4dropped items&0, &4experience orbs&0 and even &4falling blocks&0, having them move in the exact same vector of motion as the burst itself. -botania.page.lens29=Influence Lens -botania.page.lens30=The &1Weight Lens&0 carries a strong burden on the &4Mana Burst&0, making any block hit by it, if there doesn't happen to be a block below it, fall, similarly to how &1Sand&0 and &1Gravel&0 do. -botania.page.lens31=Weight Lens -botania.page.lens32=The &1Kindle Lens&0 is infused with a burning spark, when it hits a block it'll set it on fire. It has the ability to both ignite and close &1Nether Portals&0. It doesn't seem to set any living beings on fire, though. -botania.page.lens33=Kindle Lens -botania.page.lens34=The &1Force Lens&0 acts as a &1Piston&0, when it hits a block that a piston can move, it'll do just so. -botania.page.lens35=Force Lens -botania.page.lens36=The &1Flash Lens&0, in contact with a block, creates a flame of the same color as the burst that caused it. The flame provides light and is purely decorative.
    If it hits one of these flames, it puts it out instead. -botania.page.lens37=Flash Lens - -# -- MANA TABLET -botania.entry.manaTablet=Tablette de mana -botania.page.manaTablet0=While using &1Diffuseur de manas&0 to transport &4Mana&0 around is all well and good, there is also a way of doing it in a different manner.
    The &1Mana Tablet&0 is a portable object which can carry &4Mana&0 on itself.
    Not only that, but other items can also pull from it as they need it for their uses, making this an essential tool. -botania.page.manaTablet1=Tossing one of these on top of a &1Mana Pool&0 will allow for transport of &4Mana&0 between one and another.
    Shift-right clicking the &1Mana Pool&0 with a &1Wand of the Forest&0 will change in which way the &4Mana&0 flows.
    Lastly, unlike normal items, these will never despawn when dropped on the floor. -botania.page.manaTablet2=Don't put it on your pocket, it might bend - -# -- MANA MIRROR -botania.entry.manaMirror=Miroir de mana -botania.page.manaMirror0=A &1Mana Mirror&0 is an alternative to &4Mana&0 containing items such as a &1Mana Tablet&0. It can be bound to a &1Mana Pool&0 in the world and items will pull out of the pool itself when needing &4Mana&0.
    To bind a mirror to a pool, one would simply &4shift right-click&0 a pool with the mirror. The mirror can't put mana in or take mana out of pools in any other way. -botania.page.manaMirror1=Mirror mirror on the wall... # -- MANA DETECTOR botania.entry.manaDetector=Détecteur de mana -botania.page.manaDetector0=A device like the &1Mana Detector&0 is capable to detect when a &4Mana Burst&0 starts flowing through it (the burst doesn't dissipate on collision with this block) and provide a redstone signal when that is the case. -botania.page.manaDetector1=Crafting the detector # -- REDSTONE MANA SPREADER botania.entry.redstoneSpreader=Diffuseur de mana Redstone -botania.page.redstoneSpreader0=By combining a &1Diffuseur de mana&0 with a piece of &1Redstone&0, it's possible to create a &1Redstone Diffuseur de mana&0, which fires only when given a &4Redstone signal&0, regardless of having a block in the end to put the mana or not.
    It's to keep in note that this doesn't let the spreader shoot a burst until the last one dissipates or is absorbed. -botania.page.redstoneSpreader1=Just add redstone # -- MANASTAR botania.entry.manastar=Manastar -botania.page.manastar0=The imprecise measurements of the &1Wand of the Forest&0 sometimes won't cut it for telling if you're turning a profit or loss in your &1Mana Pools&0.
    Creating a &1Manastar&0 and placing it next to your pools will have it shine red if there's a loss or blue if there's a profit. The measurement happens every few seconds. -botania.page.manastar1=&rI'm a shooting star leaping through the skies&r. # -- ELVEN MANA SPREADERS botania.entry.dreamwoodSpreader=Diffuseur de mana elfique -botania.page.dreamwoodSpreader0=Simply put, &1Dreamwood&0 conducts &4Mana&0 better than &1Livingwood&0. Add in some adjustments like &1Elementium&0 or &1Mana Petals&0 and what you get is a &1Diffuseur de mana&0 that can conduct more &4Mana&0, faster and for more time without &4Mana loss&0.
    On the negative side, it can't be turned into a &1Redstone Diffuseur de mana&0. -botania.page.dreamwoodSpreader1=Better spreaders, that's it -botania.page.dreamwoodSpreader2=By combining this already powerful spreader with a &1Gaia Spirit&0 and a &1Dragonstone&0 gem, one can create an even more potent variant. The &1Gaia Spreader&0 is within the top percentage of Diffuseur de manas, with pretty much upgrades all round.
    It's to note that these spreaders fire a larger payload at once and thus, might fire less often. -botania.page.dreamwoodSpreader3=ULTRA_SPREADER - -# -- PAINTSLINGER LENS -botania.entry.paintLens=Paintslinger Lens -botania.page.paintLens0=The &4Elves&0 are one crafty bunch. This lens is somewhat unique in comparison to the other lenses. The &1Paintslinger Lens&0 needs to be dyed one of the 16 colors of the spectrum to function. When it hits a colorable block (&1Wool, Stained Clay or Glass&0...) it'll turn any blocks connected, of the same type and color, into the color of the &4Mana Burst&0 itself. It seems to work with &4Sheep&0 too. -botania.page.paintLens1=A M'AIDER Stranded Girl # -- WARP LENS botania.entry.warpLens=Lentilles de déformation -botania.page.warpLens0=The &1Mana Lens: Warp&0 is an interesting one. A &4Mana Burst&0 with its effect, when colliding with a &1Force Relay&0 will teleport to the end position of said &1Force Relay&0, maintaining its momentum. Furthermore, when it's used as a composite material to a &1Bore Lens&0 (the &1Bore Lens&0 must be visible) it'll make the lens not break &1Force Relays&0 or &1Pistons&0, as well as teleport any blocks to the spot where the burst was fired. -botania.page.warpLens1=Hakase Quarries # -- MANA PRISM botania.entry.prism=Prisme de mana -botania.page.prism0=The concept of &1Mana Lens&0 allows for the manipulation of the power convyed through &4Mana Bursts&0, the &1Mana Prism&0 works on that technology to allow a burst to have its lens effect switched on the fly.
    Using a &1Spectral Platform&0 as a component, this block does not have a physical presence, entities and bursts can go through it as if it doesn't exist. -botania.page.prism1=Right clicking it with any variety of &1Mana Lens&0 sets the lens in the prism. Whenever a &4Mana Burst&0 goes through the prism, its color and effect will be set to that of the lens in the prism. Case the lens is not dyed, the burst will turn white.
    Using any of the four basic lenses also increases the time the burst can go before losing &4Mana&0, allowing it to go further. -botania.page.prism2=It can also be turned off by the use of a redstone signal. -botania.page.prism3=Another pixel in the wall # -- MANA ON RAILS botania.entry.poolCart=Mana sur les rails -botania.page.poolCart0=What could be an easier way to transport &4Mana&0 over large distances than attaching a &1Mana Pool&0 to a &1Minecart&0 and watch it do the merry-go-round? It's simple. Similarly to other types of carts, one can create a &1Minecart with Mana Pool&0 that can store and transport &4Mana&0 on rails.
    Breaking the cart while there's any &4Mana&0 in it will waste the &4Mana&0, care should be taken with it. -botania.page.poolCart1=Transfering &4Mana&0 between the cart and a pool is done with a &1Mana Pump&0. It can face any of the four cardinal directions and will transfer &4Mana&0 between a pool adjacent to it and a cart with a pool on an rail opposite to the target pool.
    The transfer rate is extremely fast due to the mechanical nature, so fast that overflow is possible, causing &4Mana Loss&0. -botania.page.poolCart2=The side of the pump where the &4Mana&0 will go towards is the pink one, &4Mana&0 is pulled from the blue side.
    The pump can be turned off with redstone, and a &1Comparator&0 on it will output how much &4Mana&0 exists in the cart.
    Lastly, a pool on a cart serves purely for transport, and can not receive, send, transfer or infuse any items with its &4Mana&0. -botania.page.poolCart3=I like trains -botania.page.poolCart4=This is not a pipe # -- SPARK TINKERER botania.entry.sparkChanger=Spark Tinkerer -botania.page.sparkChanger0=The &1Spark Tinkerer&0 is a block with the ability to modify the &1Augments&0 placed on &1Sparks&0. Placing it adjacent to &1Mana Pools&0 or other blocks with a &1Spark&0 attached will connect it to those blocks.
    Right clicking the &1Spark Tinkerer&0 with a &1Spark Augment&0 will put the augment in the block, it can be removed by right clicking again. -botania.page.sparkChanger1=When the &1Spark Tinkerer&0 gets a redstone signal it'll randomly pick a &1Spark&0, between all of those it's connected to that have a different augment from the one stored in it, and swap the augment in that &1Spark&0 with the one stored in the block.
    The stored augment can be withdrawn or deposited with &1Hoppers&0 or other automation methods. -botania.page.sparkChanger2=Hahahaha, water fire... - -# - FUNCTIONAL FLOWERS -# -- AN INTRODUCTION TO FUNCTION -botania.entry.fIntro=An Introduction to Function -botania.page.fIntro0=There are various places in which the &4Mana&0 a botanist generates can be put to use, one of them is an assortment of &4Functional Flowers&0.
    These flowers will drain &4Mana&0 from a nearby &1Mana Pool&0 into themselves, in order to do whatever task they were created for.
    It's to note that these can't receive power directly through &1Diffuseur de manas&0. -botania.page.fIntro1=All &4Functional Flowers&0, alike the &4Generating Flowers&0 contain a small buffer of &4Mana&0.
    Standard rules for &4Mana&0 reading apply, right clicking with a &1Wand of the Forest&0 will update the mana readings. -botania.page.fIntro2=It is important to keep in mind that these flowers memorize the &1Mana Pool&0 from which they should pull &4Mana&0 out of. They'll only pull from the nearest pool present at the time of the flower being placed (or the closest placed afterward, if none was present), and none other, unless that one is removed. It can be bound to another pool with a wand in &4Bind Mode&0. -botania.page.fIntro3=Lastly, some functional flowers utilize a &1Redstone Root&0 in their creation. If they do, the flower's effect can be toggled with a redstone signal. -botania.page.fIntro4=&1Redstone Root&0 for Redstone Control - -# -- FLOWER SHRINKING -botania.entry.flowerShrinking=Flower Shrinking -botania.page.flowerShrinking0=Some functional flowers have a bit too much reach. Sometimes one might not want that to be the case. Tossing one of those few flowers into a &1Mana Pool&0 with an &1Alchemy Catalyst&0 will, at the cost of some &4Mana&0, shrink it, making its radius smaller. Every other function remains the same. -botania.page.flowerShrinking1=Like a nendoroid - -# -- JADED AMARANTHUS -botania.entry.jadedAmaranthus=Jaded Amaranthus -botania.page.jadedAmaranthus0=Everyone likes flowers right? The &1Jaded Amaranthus&0 is made just for that purpose.
    Feeding it with &4Mana&0 from &1Mana Pools&0 will have it quickly grow new &1Fleur mystique Flowers&0 around it, in any spots it can. -botania.page.jadedAmaranthus1=&oIt was this or clematis.&r -botania.page.jadedAmaranthus2=&oWait a minute, did you just summon a bunch of flowers in one turn?
    Yeah, so?
    That's against the rules, isn't it?
    Screw the rules, I have Mana! - -# -- BELLETHRONE -botania.entry.bellethorne=Bellethorne -botania.page.bellethorne0=The &1Bellethorne&0 is a malevelous flower. By utilizing &4Mana&0 it slowly inflicts harm in any living beings (save for &4players&0) around it. -botania.page.bellethorne1=&oEvery rose has its thorn&r. - -# -- DREADTHORNE -botania.entry.dreadthorne=Dreadthorne -botania.page.dreadthorne0=The &1Dreadthorne&0 is a slightly more specific counterpart to the &1Bellethrorne&0, by which, instead of all mobs around, it'll only hurt &4adult&0 animals and none else. -botania.page.dreadthorne1=&oNo Mr.Bond, I expect you to die&r. - -# -- HEISEI DREAM -botania.entry.heiseiDream=Heisei Dream -botania.page.heiseiDream0=The &1Heisei Dream&0 will, by utilizing &4Mana&0, awaken feelings of anger and revenge in any nearby &4mobs&0, turning them against eachother. -botania.page.heiseiDream1=&oA pleasant era will murder people&r. -botania.page.heiseiDream2=&oHeisei, was broken, broken. Who was the one who lied about peace? See, it's forgotten, forgotten, even the punishement blamed on the altar. Hey, it's breaking, breaking, at the end, even the meaning of shaking is killed.
    Well, where shall we go? Let's go somewhere, whose ally are you? Whose replacement am I? - -# -- TIGERSEYE -botania.entry.tigerseye=Tigerseye -botania.page.tigerseye0=It's a known fact that &4Creepers&0 are terrified of &4cats&0.
    The &1Tigerseye&0 exploits that very weakness, by emitting a feline aura, petrifying any nearby &4Creepers&0, preventing them from exploding. It also has the effect of making them run away from &4players&0. -botania.page.tigerseye1=&oRisin' up to the challenge of our rivals&r. - -# -- ORECHID -botania.entry.orechid=Orechid -botania.page.orechid0=While going mining is all good, a renewable means of getting ore is due. The &1Orechid&0 will use (a massive amount of) &4Mana&0 to generate &4ores&0 in nearby &1Stone&0 blocks.
    The ores it generates are random, but seem to be biased towards more common ores rather than rarer ones. -botania.page.orechid1=&oNot dragon poop&r. - -# -- ORECHID IGNEM -botania.entry.orechidIgnem=Orechid Ignem -botania.page.orechidIgnem0=The &1Orechid&0 is a great flower. The ability to create raw ores with &4Mana&0 can be a great boon to any sedentary botanist's life. It, however, can't create ores from the &4Nether&0. Getting that sorted out is easy, by switching the petals a bit, it'll create &4Nether&0 ores in &1Netherrack&0 instead. The flower must be in the &4Nether&0 to work. -botania.page.orechidIgnem1=&oGetting hot in here&r. - -# -- FALLEN KANADE -botania.entry.fallenKanade=Fallen Kanade -botania.page.fallenKanade0=The &1Fallen Kanade&0 is a flower with angelic properties, it'll use &4Mana&0 from nearby &4Mana Pools&0 in order to apply a regeneration effect to any &4players&0 nearby. -botania.page.fallenKanade0a=The &1Fallen Kanade&0 is a flower with angelic properties, it'll use &4Mana&0 from nearby &4Mana Pools&0 in order to apply a regeneration effect to any &4players&0 nearby.
    Interestingly enough, &4Blood Mages&0 have been known to place odd hexes on their altars which cause this flower to malfunction, that might be something to keep in mind. -botania.page.fallenKanade1=&oHand Sonic, version four&r. -botania.page.fallenKanade2=&oI'll marry you. No matter what kind of sickness you have, even if you can't walk or stand, or even if you can't have kids, I'll still marry you. No matter where or how I met you, I'll fall in love with you.
    If I can meet you again, against the six billion to one odds, and even if your body can't move, I'll marry you. - -# -- EXOFLAME -botania.entry.exoflame=Exoflame -botania.page.exoflame0=Unlike its generating counterpart, the &1Exoflame&0 utilizes &4Mana&0 with means to generate heat.
    Any &1Furnaces&0 nearby to the &1Exoflame&0 will be fueled, and given a speed boost, for the cost of some &4Mana&0. -botania.page.exoflame1=&oBut we should be going nowhere fast&r. - -# -- AGRICARNATION -botania.entry.agricarnation=Agricarnation -botania.page.agricarnation0=The slow growth of crops is always a problem to feed the masses. The &1Agricarnation&0 is a flower that turns &4Mana&0 into a type of natural fertilizer, causing nearby plantlife to grow at a faster rate. -botania.page.agricarnation1=&oGrandola Vila Morena&r... - -# -- HOPPERHOCK -botania.entry.hopperhock=Hopperhock -botania.page.hopperhock0=The &1Hopperhock&0 will pick up items around it. Giving it &4Mana&0 is optional, but it'll increase its range.
    Items picked up will be put in adjacent inventories (e.g. &1Chests&0). Placing &1Item Frames&0 on any of the inventories will specify which items can or can't go in them. -botania.page.hopperhock1=Any inventory which has no &1Item Frame&0 adjacent to it can accept any items, but labelled inventories will take priority.
    The rule using to sort items can be changed by shift-right clicking the flower with a &1Wand of the Forest&0. -botania.page.hopperhock2=&oI guess I'll be talking my loli and leaving&r. - -# -- TANGLEBERRIE -botania.entry.tangleberrie=Tangleberrie -botania.page.tangleberrie0=The &1Tangleberrie&0 is a flower that, at the cost of a small amount of &4Mana&0, will keep any nearby animals or monsters within a circle ward, preventing them from getting out. -botania.page.tangleberrie1=&oTangled, brave and frozen&r. - -# -- JIYUULIA -botania.entry.jiyuulia=Jiyuulia -botania.page.jiyuulia0=The &1Jiyuulia&0 is a flower that, at the cost of a small amount of &4Mana&0, will keep any nearby animals or monsters at bay, protecting a circular area from them getting in. -botania.page.jiyuulia1=&oHR HD DT Masterpiece&r. - -# -- RANNUNCARPUS -botania.entry.rannuncarpus=Rannuncarpus -botania.page.rannuncarpus0=Quite a handy flower indeed, the &1Rannuncarpus&0 will pick up any nearby blocks in dropped item form and place them in the world nearby. It, however, only places the blocks thrown at it on top of a specific block, to specify this block, place it right below the soil the flower is resting on. -botania.page.rannuncarpus1=Block items, such as &1Sugar Cane&0 will also work, but, much alike any other blocks, will only be placed in a location where they normally would be able to be placed.
    Lastly, giving &4Mana&0 to the flower is optional, but it increases its range. -botania.page.rannuncarpus2=&oThe Sandpit of Yanille&r? - -# -- HYACIDUS -botania.entry.hyacidus=Hyacidus -botania.page.hyacidus0=For some reason, poison does not kill. The &1Hyacidus&0, to that, can be used to poison any nearby mobs, bringing them to their knees for a one hit kill after a bit. -botania.page.hyacidus1=&oSteel is immune&r. - -# -- POLLIDISIAC -botania.entry.pollidisiac=Pollidisiac -botania.page.pollidisiac0=Animals love eating, that's all they seem to do, really. An interesting behaviour they show is that they only seem to want to eat things that are fed to them.
    The &1Pollidisiac&0 will simply do that, at the cost of some mana, any appropriate nearby food items (&1Wheat&0, &1Carrots&0, etc) will be fed to the animals, putting them in a &obetter mood&r. -botania.page.pollidisiac1=&oHell's Kitchen&r. - -# -- CLAYCONIA -botania.entry.clayconia=Clayconia -botania.page.clayconia0=The &1Clayconia&0 is a simple flower, in essence. All it does is moisten nearby &1Sand&0, turning it into &1Clay&0, this process uses a decent amount of &4Mana&0, but nothing too insane. -botania.page.clayconia1=&oWhat a killer joke&r. - -# -- LOONIUM -botania.entry.loonium=Loonium -botania.page.loonium0=Any weary adventurer knows that &4Dungeons&0 can hold valuable goodies. The &1Loonium&0 can, at the use of an extreme amount of &4Mana&0, materialize these items and drop them in the nearby vicinity. -botania.page.loonium1=&oTank Tank Heal Tank&r! - -# -- DAFFOMILL -botania.entry.daffomill=Daffomill -botania.page.daffomill0=The &1Daffomill&0 works as a fan of sorts. It pushes, at the cost of a small amount of &4Mana&0, any items found in front of it.
    Shift-right clicking it with a &1Wand of the Forest&0 changes the orientation. Where it's currently facing can be seen via the subtle wind particles it emits. -botania.page.daffomill1=&oWind Turbines? I'm a big fan&r. - -# -- VINCULOTUS -botania.entry.vinculotus=Vinculotus -botania.page.vinculotus0=The &1Vinculotus&0 has the power to create a disturbance among any &4Enderman&0's teleportation powers within a fairly large radius around it. For a cost of &4Mana&0, whenever an &4Enderman&0 would teleport anywhere, instead, they're teleported to the location of the &1Vinculotus&0. -botania.page.vinculotus1=&oTouch this black lotus with your fingers&r. - -# -- SPECTRANTHEMUM -botania.entry.spectranthemum=Spectranthemum -botania.page.spectranthemum0=Transporting items a long distance can be an arduous task. Water channels and &1Daffomills&0 won't cut it forever.
    The &1Spectranthemum&0, at the cost of &4Mana&0 wraps the fabric of reality of any dropped items that do not contain &4Mana&0 around it, teleporting them somewhere else in the world. -botania.page.spectranthemum1=In order to specify where the items go, one would use a &1Wand of the Forest&0 in bind mode and bind the flower to a block somewhere, similarly to binding it to a pool.
    In order to view what block the flower is bound to rather than the pool it's pulling &4Mana&0, one would sneak while looking at it with a wand. -botania.page.spectranthemum2=This flower is governed by the &4axiom of chunkloading&0, by which it'll not function on chunks not loaded. This topic is not addressed in full extent this lexicon.
    &oRecommended Reading: "Chunks and Chicken", "Anchors of the World". -botania.page.spectranthemum3=&o(n)spooky(n+2)me&r. - -# -- MEDUMONE -botania.entry.medumone=Medumone -botania.page.medumone0=The &1Medumone&0 is a flower with the ability to completely halt a creature's movement.
    While it receives &4Mana&0, it'll halt any nearby entities in their tracks with a powerful slowness effect, provided they are not players. -botania.page.medumone1=&oThose credits look fake&r... - -# -- MARIMORPHOSIS -botania.entry.marimorphosis=Marimorphosis -botania.page.marimorphosis0=The &1Marimorphosis&0 is a flower that executes metamorphic transformations on nearby &1Stone&0 blocks. These blocks get metamorphised into one of 8 different types of &1Metamorphic Stone&0. All 8 types will generate, but the type(s) that generate more often depend on the biome. All of these can be used to make bricks, chiseled bricks, slabs, stairs and even &1Petal Apothecary&0 variants. -botania.page.marimorphosis1=The various flavours of &1Metamorphic Stone&0 -botania.page.marimorphosis3=Colorful like a ClariS song -botania.page.marimorphosis2=&oThis flower is pretty gneiss&r. - -# -- BUBBELL -botania.entry.bubbell=Bubbell -botania.page.bubbell0=Building underwater is a no small task. Clearing air under the sea is incredibly troublesome and time consuming. Placing down a &1Bubbell&0 underwater and providing it with &4Mana&0 (preferably a priori) will have it start to create a dome of air which will keep water at bay. The dome has about twelve blocks of radius. &4Mana&0 is required constantly to keep it up and going. -botania.page.bubbell1=&oLike some casual game&r. - -# -- SOLEGNOLIA -botania.entry.solegnolia=Solegnolia -botania.page.solegnolia0=The &1Ring of Magnetization&0 is a rather handy tool for anyone digging or collecting. It does, however, fall into the problem that it picks up unwanted items near complex systems.
    The &1Solegnolia&0 disrupts the ring and prevents any items around it from being pulled towards a wearer of one. It uses up a small bit of &4Mana&0 for this, but nothing considerate. -botania.page.solegnolia1=On/Off - -# - GENERATING FLOWERS -# -- AN INTRODUCTION TO GENERATION -botania.entry.gIntro=An Introduction to Generation -botania.page.gIntro0=&4Generating Mana&0 should be at the top of the priorities for any botanist. Luckily there's an array of &4Generating Flowers&0 willing to do the job.
    These flowers, as their name shows, generate &4Mana&0, both passively and actively. Unless stated otherwise, all &4Generating Flowers&0 generate &4Mana&0 passively under certain circumstances. -botania.page.gIntro1=All &4Generating Flowers&0, alike the &4Functional Flowers&0 contain a small buffer of &4Mana&0.
    Standard rules for &4Mana&0 reading apply, right clicking with a &1Wand of the Forest&0 will update the mana readings.
    This mana will be stored in the closest &1Diffuseur de mana&0 around. -botania.page.gIntro2=It is important to keep in mind that these flowers memorize the &1Diffuseur de mana&0 into which they should put &4Mana&0 into. They'll only store into the nearest spreader present at the time of the flower being placed (or the closest placed afterward, if none was present), and none other, unless that one is removed. It can be bound to another spreader with a wand in &4Bind Mode&0. - -# -- DAYBLOOM -botania.entry.daybloom=Fleur de jour -botania.page.daybloom0=The &1Fleur de jour&0 is the most basic and rudimentary &4Generating Flower&0. Simply put, it performs a modified photosynthesis process, in order to transform sunlight into &4Mana&0.
    The process is rather slow, about ten or a dozen of these should get the job done, for now. -botania.page.daybloom1=These flowers tend to compete among themselves for what sunlight hits an area, thus having any other of the same type adjacent to it on any of the four cardinal directions will result in diminishing returns of &4Mana&0 production. This fact only applies to &1Fleur de jours&0 and &1Nightshades&0. They also don't produce much to begin with, so perhaps hastily upgrading to &1Endoflammes&0 or others might be a good idea. -botania.page.daybloom1a=Having any other &1Fleur de jours&0 adjacent to it on any of the four cardinal directions will result in diminishing returns of &4Mana&0 production.
    These flowers are not very resistant, and after some time they'll wither and die off. This only applies to &1Fleur de jours&0 and &1Nightshades&0. They also don't produce much to begin with, so perhaps hastily upgrading to &1Endoflammes&0 or others might be a good idea. -botania.page.daybloom3=Diminishing Returns -botania.page.daybloom2=&oStarting up a brand new day&r. -botania.page.daybloom4=&oHow many of you people out there been hurt in some kind of love affair? And how many times do you swear that you'll never love again? How many lonely, sleepless nights? How many lies? How many fights? And why would you want to put yourself through all that again? "Love is pain," I hear you say. Love has a cruel and bitter way of paying you back for all the faith you ever had in your brain. (...) -botania.page.daybloom5=&oHow could it be that what you need the most can leave you feeling just like a ghost? You never want to feel so sad and lost again. One day you could be looking through an old book in rainy weather. You see a picture of her smiling at you when you were still together. You could be walking down the street and who should you chance to meet. But that same old smile that you've been thinking of all day... # -- NIGHTSHADE botania.entry.nightshade=Ombrenuit -botania.page.nightshade0=The &1Nightshade&0 is the dark counterpart of the &1Fleur de jour&0, as it generates &4Mana&0 passively in any situation the &1Fleur de jour&0 can not, as long as it's nighttime
    Similarly to their shining counterpart, they suffer diminishing returns from having any adjacent. -botania.page.nightshade0a=The &1Nightshade&0 is the dark counterpart of the &1Fleur de jour&0, as it generates &4Mana&0 passively in any situation the &1Fleur de jour&0 can not, as long as it's nighttime. Alike its shining counterpart, they suffer diminishing returns from having any adjacent and are not very resistant, and some time they'll wither and die off. -botania.page.nightshade1=&oThe shadow of the day&r. # -- ENDOFLAME botania.entry.endoflame=Endoflamme -botania.page.endoflame0=While the &1Fleur de jour&0 is all well and good, a botanist requires more effective means of generating &4Mana&0.
    The &1Endoflamme&0 does that exactly, it will absorb any combustible items or blocks dropped on the nearby vicinity (albeit only one at a time) and burn through them to passively generate mana while the fuel lasts. -botania.page.endoflame1=There is a small caveat though, the &1Endoflamme&0 will not burn anything that returns a byproduct, an example are &1Lava Buckets&0, that have empty &1Buckets&0 as a byproduct.
    Due to their behaviour, an &1Open Crate&0, which you read about on the &4Magical Apparatus&0 section, might be a good step on getting it to be self-sustainable. -botania.page.endoflame2=&oNot nitor&r. # -- HYDROANGEAS botania.entry.hydroangeas=Hydroangeas -botania.page.hydroangeas0=While passive &4Mana&0 generation can be easily achieved through &1Fleur de jours&0, different means of doing so might come in handy. The &1Hydroangeas&0 will suck up any &1Still Water&0 in a 3x3 area around it, on the same height, creating &4Mana&0 from it. They also seem to function faster during &4Rain&0, who'd have thought? -botania.page.hydroangeas0a=The &1Hydroangeas&0 will suck up any &1Still Water&0 in a 3x3 area around it, on the same height, creating &4Mana&0 from it. They also seem to function faster during &4Rain&0, who'd have thought?
    Similarly to the &1Fleur de jour&0, these flowers are not very resistant, and after some time they'll wither and die off. -botania.page.hydroangeas2=A simple &1Hydroangeas&0 system -botania.page.hydroangeas3=These flowers, similarly to &1Fleur de jours&0 or &1Nightshades&0 will receive a portion of diminishing returns if put in too compact of a pattern. Having any two &1Hydroangeas&0 one block away from eachother, including diagonals, will drastically reduce the production rate of both, as the roots get tangled. Having even more in the short space will further weaken their potency. The blue particles between them indicate this. -botania.page.hydroangeas1=&oFrom some Hyperdimension&r? # -- THERMALILY botania.entry.thermalily=Therma-lis -botania.page.thermalily0=There comes a point where slow generating power, like the &1Hydroangeas&0 or the &1Endoflamme&0 is not enough. An answer to that is the &1Therma-lis&0, which works similarly to the &1Hydroangeas&0, except with &1Lava&0, it'll produce a very large amount of &1Mana&0 at a spurt when it consumes &1Lava&0, doing this heats up the flower, and it'll need some time to cool down before it can begin the cycle anew. -botania.page.thermalily1=&o0108 Style&r. # -- ROSA ARCANA botania.entry.arcanerose=Rosa Arcana -botania.page.arcanerose0=&4Experience Points&0 are a form of magic of sorts. The &1Rosa Arcana&0 can tap into it and absorb the experience of players on the ground around it, turning it into &1Mana&0. -botania.page.arcanerose1=&oWhen this card is Summoned, toss a coin&r. - -# -- MUNCHDEW -botania.entry.munchdew=Munchdew -botania.page.munchdew0=Generating the form of natural energy that is &4Mana&0 should be a pretty good process when done via other living materials. By using the &1Munchdew&0, any &1Leaves&0 near the flower will get munched up and converted into &4Mana&0.
    It's to note that, though, no saplings or any other items will be dropped from the leaves. -botania.page.munchdew1=This flower outputs a hefty amount of mana per tree eaten.
    However, after if finishes eating all the available leaves, when left without any, it'll take a break from doing so and will only be able to eat again after a bit over a minute. -botania.page.munchdew2=&oYou pay for dinner, Shibazaki&r. - -# -- ENTROPINNYUM -botania.entry.entropinnyum=Entropinnyum -botania.page.entropinnyum0=In order to generate a blast of &4Mana&0, one might in fact, require a blast nearby.
    Igniting a block of &1TNT&0 in the near an &1Entropinnyum&0 will have the latter absorb all the entropy generated by the blast into itself, creating a large amount of &4Mana&0 and nullifying any possible damage. Lastly, to absorb the explosion, the flower must not have any &4Mana&0 stored in it or the process will fail. -botania.page.entropinnyum1=&oCool guys don't look at explosions&r. - -# -- KEKIMURUS -botania.entry.kekimurus=Kekimurus -botania.page.kekimurus0=&1Cake&0 is delicious, everyone loves it, flowers included.
    The &1Kekimurus&0 is one of these &1Cake&0 aficionados, and will eat any it spots nearby, using its enriching nutrients to create &4Mana&0. -botania.page.kekimurus1=&otop kek&r - -# -- GOURMARYLLIS -botania.entry.gourmaryllis=Gourmaryllis -botania.page.gourmaryllis0=The &1Gourmaryllis&0 is one hungry flower. It'll eat up any food in a small area around it, and turn it into &4Mana&0.
    There's a catch, though, it can only digest a single food at any given time, the &4Mana&0 is created when it's done. Any other food it finds, it'll also devour, but not create any mana from it. -botania.page.gourmaryllis1=The amount of time it takes to digest a delicacy depends on its nutritional value, in layman's terms, the amount of food points it restores.
    So, a &1Steak&0 will take four seconds to digest, a &1Carrot&0 will take two, a loaf of &1Bread&0 will take two and a half, so on. -botania.page.gourmaryllis2=The amount of &4Mana&0 created also makes use of this value, but in a way where the more nutritious the food is, the more efficient it is. For example, a single &1Steak&0 will produce more &1Mana&0 than two &1Carrots&0, both absolutely and per second. -botania.page.gourmaryllis3=&oA hot pot for our new residents&r. -botania.page.gourmaryllis4=&oWell, if Men ate themselves after death, one would think of less horror and negative feeling matter. But so you know what your cruelty leads to, think, fishes, that even Men eat themselves alive like you.
    Alive was Job when he said: "Why do you follow me so inhumanely, thou who are eating me alive and getting sick of my flesh?". Do you want to see a Job like this? (...) -botania.page.gourmaryllis5=&oSee a man of those who are followed by claims or accused of crimes, and behold all who are eating them. The bailiff eats him, the jailer eats him, the scribe eats him, the requestor eats him, the lawyer eats him, the inquirer eats him, the witness eats him, the judge eats him and he's not even sentenced he's already eaten. Worse are the Men than the crows. (...) -botania.page.gourmaryllis6=&oThe sad one who was hanged, only eat him the crows past his execution and death, while the one who's being judged, not even executed or sentenced and he's already eaten.
    The true evil are the Man who eat eachother, and those who commit to it are the largest, those who eat the smallest. For that you, Man, vos estis sal terrae. - -# -- NARSLIMMUS -botania.entry.narslimmus=Narslimmus -botania.page.narslimmus0=There's some sort of unbeknownst power in the universe that creates &1Slimes&0 at seemingly random spots. &4Slime Chunks&0, they call it. The &1Narslimmus&0 is a flower that has the ability to tap into that energy. If placed down near a &1Slime&0 created by that power, it'll destroy it, collecting all the &4Mana&0 generated by the entropy. The larger the &1Slime&0, the more &4Mana&0 is created. It also makes a bit of a sticky mess. -botania.page.narslimmus1=&oStick around, would ye&r? - -# -- SPECTROLUS -botania.entry.spectrolus=Spectrolus -botania.page.spectrolus0=The &1Spectrolus&0 is a flower that's particularly fond of the various tones of &1Wool&0. It'll absorb any and all &1Wool&0 blocks dropped nearby and create &4Mana&0 from them.
    There's a caveat though. It's picky as to what colors it wants. Starting at white, after it absorbs one piece of &1Wool&0, it'll rotate to the next color in the spectrum. -botania.page.spectrolus1=While it consumes all &1Wool&0 around, it'll only create any mana if its of the color it wants, so haphazardly tossing &1Wool&0 at it is a wasteful strategy.
    The color it'll absorb properly next can be seen by hovering over the flower with a &1Wand of the Forest&0. -botania.page.spectrolus2=&oTaste the Rainbow&r. - -# - MAGICAL APPARATUS -# -- MANA PYLON -botania.entry.pylon=Mana Pylon -botania.page.pylon0=A &1Mana Pylon&0 is a structure that can pull energies from the earth and use them to power enchanting processes.
    For one, setting one adjusted to an &1Enchanting Table&0 as if it was a &1Bookshelf&0 will drastically increase the power it can convey, just 2 of these are enough for it to reach &4Level 30&0. -botania.page.pylon1=&oYou must construct additional pylons!&r - -# -- MANA ENCHANTING -botania.entry.manaEnchanting=Enchanting with Mana -botania.page.manaEnchanting0=By utilizing the magical power emitted from &1Mana Pylons&0, a structure that can enchant items with books without consuming them can be created, called the &1Mana Enchanter&0.
    Constructing one of these requires a fair amount of space and materials alike. -botania.page.manaEnchanting1=To construct the &1Mana Enchanter&0, one requires, as well as fair amount of space, 17 &1Obsidian&0 blocks, 10 &1Mystical Flowers&0 of any color, 6 &1Mana Pylons&0 and a &1Lapis Lazuli Block&0.
    The instructions on how to assemble this structure are in the following pages. -botania.page.manaEnchanting2=Mana Enchanter -botania.page.manaEnchanting5=After the construct is done, right click the Lapis block with a &1Wand of the Forest&0 and the enchanter should form.
    In order to utilize the enchanter, one would place (via right click) the item to be enchanted in the enchanter itself and drop &1Enchanted Books&0 inside the circle around it. -botania.page.manaEnchanting6=Items that are already enchanted can't be placed in the enchanter.
    To start the enchanting, right click the enchanter with a &1Wand of the Forest&0. It'll scan the books around, and once it's done, a spell circle of sorts will appear around it, indicating the books can be safely picked up again. -botania.page.manaEnchanting7=After the enchanting begins, the enchanter will require &4Mana&0.
    It can be fed via one of two ways, either via &4Mana Bursts&0 or nearby &1Sparks&0, by placing a &1Spark&0 on top of the enchanter. The later being much faster. -botania.page.manaEnchanting8=When enough &4Mana&0 is gathered, the enchanting process will finalize, and the enchantments will be applied to the item.
    The amount of &4Mana&0 required depends on the rarity of the enchantments being applied, their level, and the total amount of enchantments.
    If any book has more than one enchantment, only the first will be accounted for. -botania.page.manaEnchanting9=During the enchanting process, the item can not be removed, but it can after the process has been completed.
    Note that if at any point, any component of the construct is removed, it'll revert to its original &1Lapis Lazuli Block&0 form. - -# -- SPREADER TURNTABLE -botania.entry.turntable=Spreader Turntable -botania.page.turntable0=The &1Spreader Turntable&0, as its name implies, can turn &1Diffuseur de manas&0 around and around. Placing a spreader above the turntable will rotate it, given that a redstone signal isn't applied.
    To change the speed of the turntable, right click with a &1Wand of the Forest&0, shift-right clicking will invert the movement. -botania.page.turntable1=You spin me right round - -# -- ALCHEMISING WITH MANA -botania.entry.manaAlchemy=Alchemie avec le mana -botania.page.manaAlchemy0=Le &4mana&0 est une substance extrèmement volatile, au point que ses propriétés et habilités complètes soient inconnues.
    One of them is known, though, by attaching an &1Alchemy Catalyst&0, created with a mixture of otherworldly materials to the bottom of a &1Mana Pool&0, it enables the pool to perform &4Alchemy&0. -botania.page.manaAlchemy1=Creating the &1Catalyst&0 -botania.page.manaAlchemy2=&1Rotten Flesh&0 to &1Leather&0 -botania.page.manaAlchemy3=Various types of &1Wood&0 -botania.page.manaAlchemy4=Various types of &1Saplings&0 -botania.page.manaAlchemy5=Breaking down &1Glowstone Blocks&0 -botania.page.manaAlchemy6=Breaking down &1Quartz Blocks&0 -botania.page.manaAlchemy7=Creating &1Chiseled Stone Bricks&0 -botania.page.manaAlchemy8=Further freezing &1Snow&0 into &1Ice&0 -botania.page.manaAlchemy9=Converting between &1Vines&0 and &1Lilypads&0 -botania.page.manaAlchemy10=Various breeds of &1Fish&0 -botania.page.manaAlchemy11=Transmuting &1Seeds&0 and &1Crops&0 -botania.page.manaAlchemy12=Purifying &1Poisonous Potatoes&0 -botania.page.manaAlchemy13=Conjuring &1Nether Wart&0 -botania.page.manaAlchemy14=Converting between &1Gunpowder&0 and &1Flint&0 -botania.page.manaAlchemy15=Making &1Name Tags&0 -botania.page.manaAlchemy16=Splitting &1Wool&0 into &1String&0 -botania.page.manaAlchemy17=Converting between &1Slimeballs&0 and &1Cactus&0 -botania.page.manaAlchemy18=Creating &1Ender Pearls&0 -botania.page.manaAlchemy19=Converting between &1Glowstone&0 and &1Redstone&0 -botania.page.manaAlchemy20=Breaking &1Cobblestone&0 into &1Sand&0 -botania.page.manaAlchemy21=Breaking &1Hardened Clay&0 into &1Red Sand&0 -botania.page.manaAlchemy22=Breaking down &1Clay&0 and &1Bricks&0 -botania.page.manaAlchemy23=Making &1Coarse Dirt&0 -botania.page.manaAlchemy24=Transmuting &1Tall Grass&0 types -botania.page.manaAlchemy25=Transmuting mundane flowers - -# -- BOTANICAL BREWERY -botania.entry.brewery=Botanical Brewery -botania.page.brewery0=Given the versatility of &4Mana&0, the fact that it can be used to conjure some sort of &4Potions&0 comes to nobody's surprise. &4Brews&0 are a variant of &4Potions&0, to put it simply. They're created using &4Mana&0 and a set of ingredients.
    Unlike &4Potions&0, &4Brews&0 have defined recipes, and each vial contains multiple doses. -botania.page.brewery1=In order to create &4Brews&0 one would require a &1Botanical Brewery&0, &1Vials&0 and of course, the reagents defined in the recipe.
    The &4Mana&0 functions as the both the solvent and energy source and is given through &4Mana Bursts&0, simply pointing a &1Diffuseur de mana&0 at the &1Brewery&0 will work just fine. -botania.page.brewery2=Crafting the &1Botanical Brewery&0 -botania.page.brewery3=Crafting &1Vials&0 -botania.page.brewery4=Working the &1Botanical Brewery&0 is rather simple. First off, to add an item, right click with it on the block or toss it.
    Start off by adding the &1Vial&0, which will get set on the top of the brewery. Proceed by adding all the required ingredients. Once a &4Brew&0 can be created with the ingredients in the brewery, &4Mana&0 will start flowing, just wait a bit after that. -botania.page.brewery5a=A simple brew, it mimics a &1Potion of Swiftness&0, when taken, it has a similar effect, giving the individual a &4Speed II&0 effect. -botania.page.brewery5b=Gotta go fast -botania.page.brewery6a=A simple brew, it mimics a &1Potion of Strength&0, when taken, it has a similar effect, giving the individual a &4Strength II&0 effect. -botania.page.brewery6b=Hodor -botania.page.brewery7a=A simple brew, it mimics a &1Potion of Haste&0, when taken, it has a similar effect, giving the individual a &4Haste II&0 effect. -botania.page.brewery7b=Full of C9H13NO3 -botania.page.brewery8a=A simple brew, it mimics a &1Potion of Healing&0, when taken, it has a similar effect, giving the individual an &4Instant Health II&0 effect. -botania.page.brewery8b=He pulled a Truesilver, GG -botania.page.brewery9a=A simple brew, it mimics a &1Potion of Leaping&0, when taken, it has a similar effect, giving the individual a &4Jump Boost II&0 effect. -botania.page.brewery9b=I got jumps, isn't that what the kids say? -botania.page.brewery10a=A simple brew, it mimics a &1Potion of Regeneration&0, when taken, it has a similar effect, giving the individual a &4Regeneration II&0 effect. -botania.page.brewery10b=Good reaction to simochi -botania.page.brewery17a=A simple brew, it mimics a &1Potion of Regeneration&0, when taken, it has a similar effect, giving the individual a &4Regeneration&0 effect, albeit for longer than the previous brew. -botania.page.brewery17b=I guess she was just more resilient -botania.page.brewery11a=A simple brew, it mimics a &1Potion of Resistance&0, when taken, it has a similar effect, giving the individual a &4Resistance II&0 effect. -botania.page.brewery11b=Can't touch this -botania.page.brewery12a=A simple brew, it mimics a &1Potion of Fire Resistance&0, when taken, it has a similar effect, giving the individual a &4Fire Resistance&0 effect. -botania.page.brewery12b=He isn't a true dragon, fire can't kill a dragon -botania.page.brewery13a=A simple brew, it mimics a &1Potion of Water Breathing&0, when taken, it has a similar effect, giving the individual a &4Water Breathing&0 effect. -botania.page.brewery13b=Under the sea, under the sea -botania.page.brewery14a=A simple brew, it mimics a &1Potion of Invisibility&0, when taken, it has a similar effect, giving the individual a &4Invisibility&0 effect. -botania.page.brewery14b=Pretend you have Incursio -botania.page.brewery15a=A simple brew, it mimics a &1Potion of Night Vision&0, when taken, it has a similar effect, giving the individual a &4Night Vision&0 effect. -botania.page.brewery15b=Does it come with a silence? -botania.page.brewery16a=A simple brew, it mimics a &1Potion of Absorption&0, when taken, it has a similar effect, giving the individual a &4Absorption IV&0 effect. -botania.page.brewery16b=You're gonna catch a cold - -# -- BREWING FLASKS -botania.entry.flasks=Brewing Flasks -botania.page.flasks0=&1Alfglass&0 seems to be more maleable than the typical &1Managlass&0 used for &1Vials&0. A &1Flask&0, made with &1Alfglass&0 is the typical elfique container for &4Brews&0, and can contain 6 doses of one, rather than the 4 a &1Vial&0 does. -botania.page.flasks1=While the ingredient cost to brew something in a &1Flask&0 is smaller, the &4Mana&0 cost is double that of a regular &1Vial&0.
    Lastly, given that the bottleneck of a &1Flask&0 is larger than that of a &1Vial&0, the contents can be consumed faster. -botania.page.flasks2=Get one under the bridge - -# -- COMPLEX BREWING -botania.entry.complexBrews=Complex Brews -botania.page.complexBrews0=Apart from the standard, run of the mill &1Brews&0 that don't pass from mimics of the &1Potions&0 that can be made in a &1Brewing Stand&0 there's also some more complex brews which apply either a combination of effects or new, beneficial effects altogether. -botania.page.complexBrews1a=A brew that applies both positive and negative effects. Taking it leaves the affected individual in a state of power, but also vulnerability. -botania.page.complexBrews1b=96 Herblore -botania.page.complexBrews2a=An entity affected with this brew's effect will regain HP whenever they slay any other creature. -botania.page.complexBrews2b=killy killy JOKER -botania.page.complexBrews3a=An entity affected with this brew's effect will be completely immune to any fall damage. -botania.page.complexBrews3b=And I call it magic -botania.page.complexBrews4a=This brew casts an aura of emptiness around any entity that has its effect. In a 128 block radius, mobs will not be allowed to spawn naturally. -botania.page.complexBrews4b=50$ for a common!? -botania.page.complexBrews5a=This brew casts an aura of emptiness around any entity that has its effect. In a 64 block radius, mobs will be allowed to spawn regardless of light or other conditions. This won't work with &1Emptiness&0. -botania.page.complexBrews5b=Shall we pray for a miracle? -botania.page.complexBrews6a=A player affected with this brew's effect will have much higher proficiency at fishing and will catch fish and other loot twice as fast. -botania.page.complexBrews6b=Maybe you'll catch a Chris -botania.page.complexBrews7a=When drank, this brew will clear all potion effects on the player, negative or otherwise. -botania.page.complexBrews7b=Absolute sooooooul - -# -- BREW INCENSES -botania.entry.incense=Brew Incenses -botania.page.incense0=&4Brews&0 can provide a great variety of effects when in liquid form. They, however, don't last long, and take up inventory space. Utilizing &1Incense Sticks&0 instead of flasks mitigates that problem, these can be infused with &4Brew&0 effects just like a normal flask would, but take around ten times as much &4Mana&0 to do so. -botania.page.incense1=An &1Incense Stick&0 can be placed on an &1Incense Plate&0 by right clicking on it, a simple click with a &1Flint and Steel&0 will light it up. Once lit, the stick can not be retrieved.
    A single stick of incense will burn for sixty times as long as as the liquid counterpart before needing to be replaced. -botania.page.incense2=&1Incense Plates&0 that are burning &1Incense Sticks&0 will provide the effects of the &4Brew&0 infused in the stick to any players on a 24 block radius of the plate.
    Not all &4Brews&0 can be infused into &1Incense Sticks&0, for example, &4Instant Health&0 or &1Absorption&0 can't, nor can any with more than one effect. -botania.page.incense5=For the incense lovers who are also automation junkies, the &1Incense Plate&0 can receive items through &1Hoppers&0 or other input. It'll output a &1Comparator&0 signal of 1 when it has a stick and 2 when it's burning it.
    Lastly, if a &4Mana Burst&0 with a &1Kindle Lens&0 hits the plate while there's a stick on it, it'll start burning it. -botania.page.incense3=Incense is wincense -botania.page.incense4=I can incense it - -# -- EYE OF THE ANCIENTS -botania.entry.forestEye=Eye of the Ancients -botania.page.forestEye0=As the Ancients who used to watch over the world always looked for the living beings on it, this block, the &1Eye of the Ancients&0, will do just that.
    By attaching a &1Comparator&0 next to it, it'll send out a redstone signal equivalent to the amount of animals it can find. -botania.page.forestEye1=The counting only starts at 2, so, with 2 animals around, it'd output a signal of strength 1, with 3 animals, of strength 2 and so on.
    Lastly, the time has worn down the sight of the Ancients, so this block can only see animals in about 6 blocks in any direction. -botania.page.forestEye2=Now you see me... - -# -- OPEN CRATE -botania.entry.openCrate=Open Crate -botania.page.openCrate0=Sometimes devices like &1Droppers&0 or &1Dispensers&0 aren't precise or fast enough. A simple solution is to make a crate and punch a hole in the bottom.
    Yeah, it's that simple. The &1Open Crate&0 accepts items from &1Hoppers&0 or any other means of inserting items, and obviously, drops them directly below it. -botania.page.openCrate1=A little interesting effect the &1Open Crate&0 can do is that, when given a redstone signal, any items it drops are prevented from being caught by flowers like the &1Hopperhock&0, &1Rannuncarpus&0 or &1Pollidisiac&0 for around ten seconds more than usual. -botania.page.openCrate2=A super crate box - -# -- DRUM OF THE WILD -botania.entry.forestDrum=Drum of the Wild -botania.page.forestDrum0=The &1Drum of the Wild&0 is, in layman's terms, the percussion counterpart of the &1Horn of the Wild&0. It serves the exact same purpose as the handheld horn, but is placed in world.
    To trigger a beat and break nearby foliage, one would fire a &4Mana Burst&0 at the drum. -botania.page.forestDrum1=It's to note that the drum does not store mana, hence, in order to trigger it, a &1Redstone Diffuseur de mana&0 or a &1Mana Blaster&0 is required. -botania.page.forestDrum2=But if you close your eyes... - -# -- ABSTRUSE PLATFORM -botania.entry.platform=Abstruse Platform -botania.page.platform0=By laying &1Livingwood&0 on a very specific format it's possible to create a platform of sorts, that only has a physical body for whoever is on top of it and isn't sneaking. For anyone else, it's like it's not there. &4Mana Bursts&0 will always travel through it without any trouble.
    It's also possible to camouflage this block as any other simple block by simply right clicking it. -botania.page.platform2=Right clicking a platform with a block in it with a &1Wand of the Forest&0 will change all connected platforms with no block set to them to the block on the one clicked. Shift-right clicking removes all blocks. -botania.page.platform1=It would be Ethereal but the name was taken # -- CONJURING WITH MANA botania.entry.manaConjuration=Conjurer avec le mana -botania.page.manaConjuration0=Similaira à la capacité de &4Alchemie avec le mana&0, a catalyst also exists for &4Conjuration&0, the magic of materializing resources from magical energy only. The mechanism works in a similar way to the &1Alchemy Catalyst&0 where one tosses an item into the pool with the catalyst below. +botania.page.manaConjuration0=Similaire à la capacité de &4Alchemie avec le mana&0, a catalyst also exists for &4Conjuration&0, the magic of materializing resources from magical energy only. The mechanism works in a similar way to the &1Alchemy Catalyst&0 where one tosses an item into the pool with the catalyst below. botania.page.manaConjuration1=Creating the catalyst botania.page.manaConjuration2=Conjurer la &1Redstone&0 botania.page.manaConjuration3=Conjurer la &1Glowstone&0 @@ -2202,786 +1333,28 @@ botania.page.manaConjuration8=Conjurer la &1Soul Sand&0 botania.page.manaConjuration9=Conjurer le &1Gravier&0 botania.page.manaConjuration10=Conjurer les &1Feuilles&0 -# -- SPECTRAL PLATFORM -botania.entry.spectralPlatform=Spectral Platform -botania.page.spectralPlatform0=The &1Spectral Platform&0 isn't more than an &1Abstruse Platform&0 with no physical body whatsoever. Whereas the &1Abstruse Platform&0 would have a physical body in some cases, the &1Spectral Platform&0 lets anything go through it, regardless of their position. -botania.page.spectralPlatform1=This reminds me of a Puzzle - -# -- DRUM OF THE GATHERING -botania.entry.gatherDrum=Drum of the Gathering -botania.page.gatherDrum0=The &1Drum of the Gathering&0 is, in short terms, a &1Drum of the Wild&0 for livestock.
    When a &4Mana Burst&0 collides with it, it'll shear any &4Sheep&0 around with grown fleece. Any &4Cows&0, with &1Empty Buckets&0 below them will have their milk transfered to the buckets. -botania.page.gatherDrum1=Tap your lands - -# -- CRAFTY CRATE -botania.entry.craftCrate=Crafty Crate -botania.page.craftCrate0=As the name suggests, the &1Crafty Crate&0 is a counterpart to the &1Open Crate&0 with the ability to assemble items into other items similarly to a &1Crafting Table&0.
    Like a &1Crafting Table&0, it has a 9 slot inventory, which can be filled with items in the pattern of a recipe. -botania.page.craftCrate1=The items go in from left to right and top to bottom (illustration further in this entry), to that, there's a special item, named the &1Crafting Placeholder&0, which, when placed in, counts as an empty slot in the recipe. This is used to allow for recipes with gaps (eg, furnace, chest, pickaxe...) to also be doable. -botania.page.craftCrate2=Creating the placeholder -botania.page.craftCrate3=To finish the recipe, one of two things can be done.
    First off, filling every of the 9 slots with either recipe components or placeholders will instantly eject the result, the placeholders and any leftovers (e.g. buckets when making cake), this is the most straightforward method. -botania.page.craftCrate4=Right clicking the crate with a &1Wand of the Forest&0 (remember: &1Dispensers&0 can do this) will attempt at crafting with whatever is inside the crate and eject it.
    If this fails all the items inside are simply ejected with no crafting procedure done. -botania.page.craftCrate7=Attaching a &1Comparator&0 to the crate will have it emit a signal equal to the amount of items inside the crate, which can be an extremely valuable asset in creating mechanisms with it. -botania.page.craftCrate5=An example of crafting a &1Diamond Pickaxe&0 -botania.page.craftCrate6=Made in Portugal -botania.page.craftCrate8=The &1Crafty Crate&0 can also be augmented with patterns. A pattern locks specific slots in the recipe, disallowing items from going into those slots and making them count as if there were placeholders there.
    There's only a few basic patterns, which can be applied by right clicking on the crate (this doesn't consume them). -botania.page.craftCrate9=9 different patterns - -# -- HOVERING HOURGLASS -botania.entry.hourglass=Hovering Hourglass -botania.page.hourglass0=The ability to count time is an essential one to anyone who wishes to develop any redstonic contraptions. A single timer, however, can take a up both a lot of space and be slow in general. The &1Hovering Hourglass&0 is a simple, accurate, sand based timer. As the name implies, it's a hourglass that hovers and turns by itself. -botania.page.hourglass1=The hourglass contains an inventory, in which up to a stack of &1Sand&0, &1Red Sand&0 or &1Soul Sand&0 can be added via a right click. Right clicking again removes it. The sand will then fall from one of the chambers into another, and when is done, release a single redstone pulse and turn over, starting the process again. -botania.page.hourglass2=The amount of time for each pulse is dependent on how much and what type of sand is in the chamber. &1Sand&0 will count for one second per block, &1Red Sand&0 ten seconds per and &1Soul Sand&0 one minute per. Sand types can't be mixed. The time for each pulse can be seen by hovering over the block with a &1Wand of the Forest&0. -botania.page.hourglass3=Note that the sand is added all at once, so the size of the stack to be added needs to be set in the inventory.
    Sand can't be added to the hourglass after it already has some in, trying to do so will end up removing the sand there instead. The sand in the block can be taken and added by &1Hoppers&0 or other methods. -botania.page.hourglass4=Right clicking the block with a &1Wand of the Forest&0 locks (and unlocks) it. When locked, sand can't be added or removed, just in case someone right clicks it on accident.
    If a &4Mana Burst&0 collides with the block, it'll stop the flow of sand and pause the timer, colliding again continues it. -botania.page.hourglass5=The sands of time - # -- SPECTRAL RAIL botania.entry.ghostRail=Rail spectral botania.page.ghostRail0=Utiliser une &1Plateforme spectral&0 comme un composant de &1Rail&0 donne quelques habilités interressantes au &1Chariot&0 qui passerai à travers lui : lorsqu'il est éjecté de ce rail, le chariot flotte un instant, il sera aussi capable de passer à travers les murs.
    Cet effet s'arrêtera si le chariot atterri sur un rail ou rentre en collision avec n'importe quelle variété de &1Boisrève&0. -botania.page.ghostRail1=Voie de l'esprit, pourriez-vous dire +botania.page.ghostRail1=Voie de l'esprit, vous pourriez dire # -- DRUM OF THE CANOPY botania.entry.canopyDrum=Tambour de la canopée botania.page.canopyDrum0=Le &1Tambour de la canopée&0 est comme le &1Tambour sauvage&0 en celà qu'il est l'équivalent percution de la &1Corne de la canopée&0. Il sert à la même chose que la corne en main, mais placé dans le monde.
    Pour déclencher un rythme et casser les feuilles alentour, quelqu'un doit tirer une *4Explosion de mana*0 sur le tambour. botania.page.canopyDrum1=Émondage avec style -# -- COCOON OF CAPRICE -botania.entry.cocoon=Cocoon of Caprice -botania.page.cocoon0=A cocoon is usually a symbol of change, of evolution.
    Creating a &1Cocoon of Caprice&0 and placing it down will slowly evolve the rudimentary contents inside it into a &1Baby Animal&0. More often than not the animal hatched will be a farm animal, but on rare ocasions, different animals such as &1Wolves&0 or &1Horses&0 may be created. -botania.page.cocoon1=Speculation says that giving the cocoon &1Emeralds&0 influences the outcome towards something a bit different.
    What could come out of such experiment is anyone's guess, really. -botania.page.cocoon2=New World, Perfect World - -# -- MANASTORM CHARGE -botania.entry.manaBomb=Manastorm Charge -botania.page.manaBomb0=Putting together some &1TNT&0 and a &1Gaia Spirit&0 creates a &1Manastorm Charge&0, a type of explosive, per say. Ignited with a &1Mana Burst&0, the charge will create an unstable &1Manastorm Epicenter&0, which will, over time, spawn supercharged &1Mana Bursts&0, that explode on contact with other blocks.
    Needless to say, only a maniac would unleash such a force near anything they care about. -botania.page.manaBomb1=Prepare to face the mighty... - # - MYSTICAL INSTRUMENTS # -- MANA BLASTER botania.entry.manaBlaster=Exploseur de mana -botania.page.manaBlaster0=The &1Exploseur de mana&0 is like a portable &1Diffuseur de mana&0, while shaped like a pistol for easy handling, it's not exactly a firearm, as much as it is just a portable spreader.
    By utilizing &4Mana&0 from &4Mana carrying items&0 in the holder's inventory, it can shoot a mana burst when one is looking at. -botania.page.manaBlaster1=This burst is a bit different from the one fired from speaders, as it's faster, but carries only three quarters of the mana a spreader burst would. There's also a short cooldown period after firing the blaster until another burst can be shot. -botania.page.manaBlaster2=&1Mana Lenses&0 also function with the blaster, to attach one to it, put them side by side on a crafting table, to remove it, simply place the &1Mana Blaster&0 back on the crafting grid. -botania.page.manaBlaster3=We need more dakka -# -- PASTURE SEEDS -botania.entry.grassSeeds=Pasture Seeds -botania.page.grassSeeds0=Watching grass spread is seldom a fun activity. By infusing some &1ViverocheGrass&0 with &4Mana&0, it's possible to create &1Pasture Seeds&0, which will grow grass in any barren area, via a simple right click on dirt.
    Other types of foliage can also be grown, such a &1Podzol&0 or &1Mycellium&0 with alternate seeds. -botania.page.grassSeeds1=&1Pasture Seeds&0 for grass -botania.page.grassSeeds2=&1Boreal Seeds&0 for podzol -botania.page.grassSeeds3=&1Infestation Spores&0 for mycellium - -# -- ROD THE LANDS -botania.entry.dirtRod=Rod of the Lands -botania.page.dirtRod0=The &1Rod of the Lands&0 is a rather simpleton tool, by utilizing &4Mana&0 from the user's inventory (via a &1Mana Tablet&0 or others), it can materialize and place a &1Dirt&0 block down. -botania.page.dirtRod1=That's dirty - -# -- TERRA FIRMA ROD -botania.entry.terraformRod=Rod of the Terra Firma -botania.page.terraformRod0=While digging away at dirt with a shovel is definitely functional, flattening huge tracts of land can get somewhat tortuous at times.
    By utilizing the &1Rod of the Terra Firma&0, it's possible to terraform in a quick and environmental friendly manner. -botania.page.terraformRod1=This rod, will, at the cost of some &4Mana&0 from the user's inventory, flatten the land to the level you are standing. For this to happen, charge it by &4holding right-click&0 and, slowly but surely, the nearby terrain will be flattened to your level, either by placing &1Dirt&0 or by removing blocks. -botania.page.terraformRod2=Note that blocks removed by the rod are non-recuperable. The terrain will adapt to the changes as best as it can, up to a distance limit, to avoid cuts in hills and the like, for this, the flattening will work in the terrain's natural look.
    Lastly, the rod will cease to function whatsoever below sea level. -botania.page.terraformRod3=Quite a justicar - -# --Fleur chatoyante EQUIPMENT -botania.entry.manaGear=Manasteel Equipment -botania.page.manaGear0=&1Manasteel&0, alike other metals, can be shaped into tools and armor alike.
    Tools or armor crafted from this material will share their properties with &1Iron&0, albeit somewhat superior in enchantability and durability. Whenever a &1Manasteel&0 item is to take damage, if there's &4Mana&0 available in the inventory (such as a &1Mana Tablet&0), it'll use that instead. -botania.page.manaGear10=Some pieces of the toolset have an ability when right clicked. The &1Pickaxe&0 will place a torch from the user's inventory, the &1Axe&0 will do the same for a sapling and the &1Shovel&0 will till the earth, similarly to a hoe.
    A detail to keep in mind is that &1Shears&0 made of mana materials will trigger tripwire, unlike iron ones. -botania.page.manaGear1=The &1Manasteel Pickaxe&0 -botania.page.manaGear2=The &1Manasteel Shovel&0 -botania.page.manaGear3=The &1Manasteel Axe&0 -botania.page.manaGear4=The &1Manasteel Shears&0 -botania.page.manaGear5=The &1Manasteel Sword&0 -botania.page.manaGear6=The &1Manasteel Helmet&0 -botania.page.manaGear7=The &1Manasteel Chestplate&0 -botania.page.manaGear8=The &1Manasteel Leggings&0 -botania.page.manaGear9=The &1Manasteel Boots&0 - -# -- HORN OF THE WILD -botania.entry.grassHorn=Horn of the Wild -botania.page.grassHorn0=Clearing out &1ViverocheGrass&0 by hand can definitely be a nuisance.
    Simply blowing the &1Horn of the Wild&0 will quickly cause any nearby vegetation to uproot, leaving behind drops as if it had been broken by hand.
    With some modifications, the horn can be modified to break leaves or snow instead. -botania.page.grassHorn1=Crafting the horn -botania.page.grassHorn2=Modifying to break &1Leaves&0 -botania.page.grassHorn3=Modifying to break &1Snow&0 - -# -- TERRASTEEL ARMOR -botania.entry.terrasteelArmor=Armure en terracier -botania.page.terrasteelArmor0=Armor made out of &1Terrasteel&0, much alike the &1Manasteel&0 counterpart, can utilize &4Mana&0 from the inventory instead of taking damage.
    This armor, however, has properties more alike &1Diamond&0 instead of &1Iron&0. -botania.page.terrasteelArmor1=The &1Terrasteel Helmet&0 -botania.page.terrasteelArmor2=The &1Terrasteel Chestplate&0 -botania.page.terrasteelArmor3=The &1Terrasteel Leggings&0 -botania.page.terrasteelArmor4=The &1Terrasteel Boots&0 - -# -- TERRA BLADE -botania.entry.terraSword=Terra Blade -botania.page.terraSword0=The &1Terra Blade&0, crafted from &1Terrasteel Ingots&0, is a sword infused with natural strength. Not only does it par with a &1Diamond Sword&0 in terms of strength and it uses &4Mana&0 from the inventory like &1Manasteel Tools&0, but when swung, there's a chance for it to create a beam that will deal as much damage as a melee hit. -botania.page.terraSword1=No Broken Hero Sword - -# -- TERRA SHATTERER -botania.entry.terraPick=Terra Shatterer -botania.page.terraPick0=The &1Terra Shatterer&0 is a tool that can amass insane quantities of mana on itself, due to the amount of &1Terrasteel&0 required for its creation.
    The tool functions very much like a &1Mana Tablet&0 by which it can amass &4Mana&0 by being tossed on a &1Mana Pool&0, it can't give the &4Mana&0 back, though, so it doesn't function as a storage method. -botania.page.terraPick1=The amount of &4Mana&0 stored on the tool defines its &4Rank&0. Ranks go as follows: &4D&0, &4C&0, &4B&0, &4A&0, &4S&0, &4SS&0. &4D&0 being the default rank.
    The amount of &4Mana&0 required to advance from rank to rank increases as the rank does. To advance from &4D&0 to &4C&0, for example, it requires just a few seconds of exposition to a &1Mana Pool&0. -botania.page.terraPick2=To advance from rank &4C&0 to rank &4B&0, a full &1Mana Pool&0 is required, and the cost increases by a tenfold per rank from there on in, all the way to &4SS&0.
    The rank of the tool does not change its speed, but instead, it increases the power of its &4Active Ability&0.
    Toggling the tool's ability can be done via right click. -botania.page.terraPick3=While the tool is active, it enables it to break blocks in an extended area. At rank &4C&0 it's a small column, which increases to a square at rank &4B&0, that gets larger through the ranks. It's to note that the rank &4D&0 tool does not have the active ability.
    Having the tool active consumes &4Mana&0 from its storage passively, even if not being used to mine. -botania.page.terraPick4=Lastly, the tool takes damage for every single block broken, so a good supply of &4Mana&0 in the wielder's inventory is a must for the higher ranks, as the tool does function like normal &1Manasteel Tools&0, in which it'll use &4Mana&0 instead of actually taking damage, given it's made of &1Terrasteel&0.
    It also won't despawn like regular dropped items. -botania.page.terraPick5=WE'RE MINING IN THE DATABASE WOW WOW - -# -- ROD OF THE SEAS -botania.entry.waterRod=Bâton des mers -botania.page.waterRod0=Similarly to its land counterpart, the &1Rod of the Seas&0 will, at the cost of some &4Mana&0, place down a &1Water&0 block wherever it's used on. Furthermore, it can also be used to refill a &1Petal Apothecary&0. -botania.page.waterRod1=Keep the Earth clean, it isn't Uranus - -# -- ELEMENTIUM EQUIPMENT -botania.entry.elfGear=Elementium Equipment -botania.page.elfGear0=Similarly to other metals, as expected, &1Elementium&0 can, too, be shaped into tools and armor.
    These pieces of equipment have a decent resistance to damage, about half of that of diamond, as well as the ability to drain &4Mana&0 to prevent damage. -botania.page.elfGear1=Each of the tools come with their own ability or power of sorts which makes them unique. The armor allows the wearer to, when hit, have a chance to spawn a &1Pixie&0 that goes after the attacker, dealing decent damage.
    The more pieces of &1Elementium Armor&0 equipped, the higher the chance. -botania.page.elfGear2=Starting off, the &1Elementium Pickaxe&0 will destroy any &1Cobblestone&0, &1Dirt&0, &1Netherrack&0 and other mundane materials, leaving behind only the ores and fine resources.
    Combining the &1Elementium Pickaxe&0 with a &1Terra Shatterer&0 in a crafting square allows for the latter to also get this power. This can't be undone. -botania.page.elfGear3=I can fit a shower in my pocket, screw cobble -botania.page.elfGear4=The &1Elementium Shovel&0 will, case the block dug is affected by gravity (&1Gravel&0, &1Sand&0, etc), dig all the blocks of that material above and/or below it, no more gravel falling while mining. -botania.page.elfGear5=Putting Things on Top of Other Things -botania.page.elfGear6=The &1Elementium Axe&0 doubles as a weapon, if used to strike the finishing blow to a &4Zombie&0, &4Skeleton&0, &4Creeper&0 or even another &4Player&0, it has a chance to decapitate them, leaving their severed head or skull behind. -botania.page.elfGear7=Off with their heads -botania.page.elfGear8=The &1Elementium Shears&0 hold the ability to, when held back like a bow, shear any nearby sheep with speed within a large area of effect centered on the holder. -botania.page.elfGear9=Nui? She's h-arm-less -botania.page.elfGear10=Lastly, the &1Elementium Sword&0 will increase the chance of a &4Pixie&0 spawning when hit (this holds true when no &1Elementium Armor&0 is worn) and increases the strength of any &4Pixies&0 spawned. -botania.page.elfGear11=The Lambent Light -botania.page.elfGear12=Fortuna on the Sixteenth Night -botania.page.elfGear13=When the Seagulls Cry Breakdown -botania.page.elfGear14=Good People Die -botania.page.elfGear15=The out of Infinity - -# -- EXTRAPOLATED BUCKET -botania.entry.openBucket=Extrapolated Bucket -botania.page.openBucket0=By creating a bucket out of &1Elementium&0 one seems to notice an interesting feature. The liquids acquired by it simply vanish into the ether, never to be seen again. This seems like a great clean up tool. -botania.page.openBucket1=A Souvenir from Lewis - -# -- ROD OF BIFROST +# -- BÂTON DU BIFROST botania.entry.rainbowRod=Bâton du Bifrost -botania.page.rainbowRod0=&4Bifrost&0, the rainbow bridge that reaches between the world and the realm of the gods.
    While this item, the &1Rod of the Bifrost&0 doesn't exactly do that, it allows the holder, via a right click and at the cost of some &4Mana&0, to create a rainbow bridge in the direction he or she is looking at. -botania.page.rainbowRod1=This bridge extends as far as a hundred blocks, and will vanish after about fifteen seconds.
    Only one bridge can be created for any given &1Rod of the Bifrost&0 at a time, as soon as the old bridge vanishes, a new one can be created. -botania.page.rainbowRod2=Going my way!! Cut open a path and go! -# -- ROD OF THE SKIES +# -- BÂTON DES CIEUX botania.entry.tornadoRod=Bâton des cieux -botania.page.tornadoRod0=The &1Rod of the Skies&0 is a magical instrument with the ability to propel one in the air at fast velocity for the cost of some &4Mana&0.
    To do so, one would simply hold it like a bow and watch as their momentum increases.
    The rod takes a small amount of time to recharge, but during that time it'll block any fall damage, keeping the user safe. -botania.page.tornadoRod1=A treasure from Lorule -# -- ROD OF THE HELLS +# -- BÂTON DES ENFERS botania.entry.fireRod=Bâton des enfers -botania.page.fireRod0=The &1Rod of the Hells&0 contains the essence of a burning flame, using it on the ground will create a circle of fire that burns anything inside it, for a decent cost of &4Mana&0.
    The ring has a decent radius, and takes a small amount of time to fully propagate, it's to note that after that time it burns anything living in it, the caster included. -botania.page.fireRod1=Megu Megu Fire Endless Night -# -- VINE BALLS -botania.entry.vineBall=Vine Balls -botania.page.vineBall0=&1Ladders&0 can't stand up on their own, they require something on their back, whereas &1Vines&0 don't. Normally, though, &1Vines&0 aren't strong enough for someone to climb them when they're freestanding.
    By combining a few &1Vines&0, it's possible to create a ball that can be thrown, to create a climbable ladder of strong &1Vines&0 where it hits. -botania.page.vineBall1=It's also possible, by combining some materials such as &1Livingwood&0 or a &1Rune of Air&0 to create a slingshot that lets these &1Vine Balls&0 be shot while completely ignoring the force of gravity. -botania.page.vineBall2=This would be in Vineacraft... -botania.page.vineBall3=...if that actually existed. -botania.page.vineBall4=Oh, and you can make &1Moss Stone&0 too - -# -- SHARD OF LAPUTA -botania.entry.laputaShard=Shard of Laputa -botania.page.laputaShard0=Via a somewhat complex magic activation sequence, combining a few interesting resources, including &1Gaia Spirits&0 would allow one to create a shard that, when used on the ground, will lift an almost spherical area around that point up into the air.
    This process consumes the shard and can take upwards of ten minutes depending on the mass of land. -botania.page.laputaShard2=The radius of the island creates start at 14 blocks, on other words, 28 blocks of diameter. It's possible to increase the size by upgrading the shard with additional &1Gaia Spirits&0, each one adds 1 block to the radius, or 2 to the diameter. -botania.page.laputaShard1=Look Shiro, Laputa exists! -botania.page.laputaShard3=Size does matter - -# -- EQUESTRIAN VIRUS -botania.entry.virus=Equestrian Virus -botania.page.virus0=Through the mixing of some ingredients, a type of virus that can alter the genetic code of equestrian life can be made.
    Using one of these viruses on a &1Horse&0 will alter its genetic code, turning it into either a &1Zombie&0 or &1Skeleton Horse&0. Not only will it do that, but it will vastly increase all the &1Horse&0's genetic attributes. -botania.page.virus1=No ponies here -botania.page.virus2=None here either - -# -- ROD OF THE HIGHLANDS +# -- BÂTON DES HAUTES TERRES botania.entry.skyDirtRod=Bâton des hautes-terres -botania.page.skyDirtRod0=While the &1Rod of the Lands&0 is all well and good, being able to place &1Dirt&0 without something to hold it would be great.
    The &1Rod of the Highlands&0 does just that, while maintaining the original power of the &1Rod of the Lands&0, it can also place &1Dirt&0 in mid air, for an increased &4Mana&0 cost. -botania.page.skyDirtRod1=Dirty Stick mk2 - -# -- VITREOUS PICKAXE -botania.entry.glassPick=Vitreous Pickaxe -botania.page.glassPick0=Placing down &1Glass&0 and having to break it again can be a heartbreaking experience. Luckily, by creating a &1Vitreous Pickaxe&0, one can gather the &1Glass&0 back by mining it with the pick, it's like cheap &4Silk Touch&0 for glass! -botania.page.glassPick1=Trapped inside with food - -# -- ROD OF DIVINING -botania.entry.diviningRod=Rod of the Plentiful Mantle -botania.page.diviningRod0=The &1Rod of the Plentiful Mantle&0 has the ability to divine in a decently large radius around the user to find any ores. These will shine for a little bit, allowing their location.
    This process, obviously, requires a decent amount of &4Mana&0 from the user's inventory. -botania.page.diviningRod1=inb4 ee3 - -# -- ROD OF THE BLACK MESA -botania.entry.gravityRod=Rod of the Shaded Mesa -botania.page.gravityRod0=The &1Rod of the Shaded Mesa&0 is a powerful relic, legend says that the first of these devices was found atop a dark mesa, along with a crowbar.
    To use this device, the user may right click and hold on a monster or item to pick it up. Releasing right click will drop the selected entity, while left click will fire it in a powerful burst. -botania.page.gravityRod1=This power does not come free, of course. It requires significant amounts of &4Mana&0 from the user's inventory. -botania.page.gravityRod2=bun pls - -# -- TIMELESS IVY -botania.entry.regenIvy=Timeless Ivy -botania.page.regenIvy0=While &1Manasteel&0 or &1Elementium&0 tools have the ability to harness &4Mana&0 and use it to protect their bodies, other tools or armor don't have this property.
    A handful of &1Timeless Ivy&0 can be attached on to virtually any item, allowing it to be repaired with &4Mana&0. -botania.page.regenIvy1=To apply it, one'd simply craft the tool in question alongside the ivy and 3 of an item that can be used to repair the tool in an anvil (eg. &1Diamonds&0 for a &1Diamond Pickaxe&0).
    Due to not being in direct contact with the material, the amount of &4Mana&0 used by the ivy in comparison to &1Manasteel&0 is rather high. -botania.page.regenIvy2=Bring your Inferno Adze - -# -- ROD OF THE ARCANE BARRAGE -botania.entry.missileRod=Rod of the Unstable Reservoir -botania.page.missileRod0=The &1Rod of the Unstable Reservoir&0 is a rather powerful weapon against a large crowd of foes. Channeling its power will materialize countless arcane missiles that home in on targets at random, at a pretty hefty cost of &4Mana&0. -botania.page.missileRod1=Zapzapzapzap - -# -- ASSEMBLY HALO -botania.entry.craftingHalo=Assembly Halo -botania.page.craftingHalo0=Carrying a &1Crafting Table&0 around generally can be troublesome. The &1Assembly Halo&0 acts not only as a portable &1Crafting Table&0 but as a quick crafting method. Having the item in hand displays a "halo" of recipes around the holder.
    First off, right clicking on the &1Crafting Table&0 will open up a crafting interface. -botania.page.craftingHalo1=As long as the item is present in the inventory the last crafting recipe done will be stored in it.
    Right clicking an empty slot of the halo will set the last recipe on it. Right clicking a slot with a recipe will try to do it using items from the inventory. Removing a recipe can be done through shift-left click. -botania.page.craftingHalo2=It has no taste if you cook it from the menu - -# -- LENS CLIP -botania.entry.clip=Lens Clip -botania.page.clip0=While a formidable and versatile tool, the &1Mana Blaster&0's greatest downfall is the lack of an ability to store more than one &1Lens&0 at once. Not any more. The &1Lens Clip&0 will attach to a &1Mana Blaster&0 in a crafting grid and allow it to store up to 6 lenses rather than just one.
    As they say, Russian Roulette is not the same without a gun... -botania.page.clip1=Adding and removing &1Lenses&0 works just as it did previously, with one detail. The lens will be added or removed in the slot that the clip is currently on.
    To change this slot, simply shift-right click the &1Mana Blaster&0 in the air. This will also change which lens is selected, case there is one in that slot. -botania.page.clip2=Since we're dubbed by 4Kids we must make do without one - -# -- ROD OF THE DEPTHS -botania.entry.cobbleRod=Rod of the Depths -botania.page.cobbleRod0=The &1Rod of the Depths&0 acts pretty much as a variant to the the &1Rod of the Lands&0. It does exactly the same thing but with &1Cobblestone&0 for a bit of a higher price. -botania.page.cobbleRod1=It's cobbling time - -# -- ROD OF THE MOLTEN CORE -botania.entry.smeltRod=Rod of the Molten Core -botania.page.smeltRod0=The &1Rod of the Molten Core&0 has the ability to expel heat provenient from the world's core. Holding it via right click and pointing at a block in the world that can be smelted into a different type of block will quickly turn it into that.
    For some examples, &1Cobblestone&0 turns into &1Stone&0, &1Sand&0 into &1Glass&0, so on. -botania.page.smeltRod1=Stolen from Efreet - -# -- WORLD SEED -botania.entry.worldSeed=World Seed -botania.page.worldSeed0=The &1World Seed&0 is a piece of elemental energized matter containing the ability to return its user to the world spawn.
    Case the person who is using it is farther than 24 blocks from the world's spawn point, using the seed, via right click, will instantly teleport them there, consuming the seed. -botania.page.worldSeed1=Where the heart is - -# -- SPELLBINDING CLOTH -botania.entry.spellCloth=Spellbinding Cloth -botania.page.spellCloth0=Combining &1Wool&0 with some &4Mana&0 in the form of a &1Mana Pearl&0 allows for one to create a type of cloth that will absorb any &4Enchantments&0 it comes in contact with.
    Combining the &1Spellbinding Cloth&0 with any enchanted item in a crafting table will remove all enchants from that item at the cost of some of the cloth's durability. -botania.page.spellCloth1=Oldest item in the book - -# -- THORN CHAKRAM -botania.entry.thornChakram=Thorn Chakram -botania.page.thornChakram0=The &1Thorn Chakram&0 is a thrown weapon made of &1Terrasteel&0 and plant matter. After thrown it'll pierce through enemies, damaging them and sometimes poisoning them, and bounce on blocks a few times before returning to the thrower, similarly to a boomerang. -botania.page.thornChakram1=Spores and stingers - -# -- OVERGROWTH SEED -botania.entry.overgrowthSeed=Overgrowth Seed -botania.page.overgrowthSeed0=An &1Overgrowth Seed&0 is an elusive item, which can be used to enchant a piece of &1Grass&0, via right clicking on it in the world, creating &1Enchanted Soil&0. Flowers that are rooted on this &1Enchanted Soil&0 will function at double the normal speed.
    There's one problem, though. No known method of creating these exists, but they have been spotted in ancient structures and the like. - -# -- LIVINGWOOD BOW -botania.entry.livingwoodBow=Arc de vifbois -botania.page.livingwoodBow0=The &1Vifbois Bow&0 is, as the name describes, a bow made of &1Livingwood&0 strung with &1Mana Infused String&0. Due to its components, it will last for longer than a normal &1Bow&0. It'll also repair itself using &4Mana&0, similarly to &1Manasteel Tools&0. -botania.page.livingwoodBow1=Does it shoot airplanes? - -# -- CRYSTAL BOW -botania.entry.crystalBow=Arc de cristal -botania.page.crystalBow0=Crafted with &1Dragonstone&0, the &1Crystal Bow&0 is a ranged weapon with the capacity to generate arrows from &4Mana&0. Similarly to the &1Vifbois Bow&0, it'll repair using &4Mana&0 as well, but carrying &1Arrows&0 is not required as they are created through the magical energies.
    Given the lightweight and flexible structure of the bow, it can also fire at a much increased velocity than a conventional wooden one. -botania.page.crystalBow1=The elves are roving - -# -- STONE OF TEMPERANCE -botania.entry.temperanceStone=Stone of Temperance -botania.page.temperanceStone0=The &1Terra Shatterer&0 is able to destroy huge tracts of land when charged to its maximum potential, however, this might not always be the user's intent. A small, 3x3 tunnel might be more fitting in some cases. Having an active &1Stone of Temperance&0 in one's inventory will prevent their shatterer from breaking any more than a 3x3 area. This also affects the &1Terra Truncator&0. The stone can be toggled on and off by shift-right clicking. -botania.page.temperanceStone1=Don't lose it - -# -- TERRA TRUNCATOR -botania.entry.terraAxe=Terra Truncator -botania.page.terraAxe0=The &1Terra Truncator&0 is a greataxe of premium quality achievable only with &1Terrasteel&0. When hitting a tree it'll take the whole thing down with speed, bringing all the logs and leaves along with it. Of course, this comes at a hefty cost of &4Mana&0.
    This effect doesn't happen while sneaking or if the user has a &1Stone of Temperance&0. -botania.page.terraAxe1=It's not a Dead END - -# -- FLORAL OBEDIENCE STICK -botania.entry.obedienceStick=Bâton d'obéissance floral -botania.page.obedienceStick0=Nobody knows why, but attaching some &1Manasteel&0 to &1Livingwood Twigs&0 creates a stick type device that can make nearby flowers all bind towards a single focus point.
    Dubbed the &1Floral Obedience Stick&0, right clicking with it on a &1Mana Spreader&0 or &1Mana Pool&0 in the world will bind all relevant nearby flowers to it. -botania.page.obedienceStick1=This is not a dumb new age hat - -# - ENDER ARTEFACTS -# -- EXTRACTING ENDER AIR -botania.entry.enderAir=Extraction de l'air du néant -botania.page.enderAir0=The air present in the void of the &1End&0 seems to have some mutating properties. Right clicking with an empty &1Glass Bottle&0 while in the &1End&0 will capture some of that air, which can then later be tossed similarly to a splash potion, turning nearby &1Stone&0 on the landing point into &1End Stone&0. - -# -- ENDER OVERSEER -botania.entry.enderEyeBlock=Ender Overseer -botania.page.enderEyeBlock0=The eyes of an &4Enderman&0 have an interesting sensitivity to being watched. A block out of these will simply output a &4redstone signal&0 if a player within a 64 block radius is looking directly at it.
    Of course, wearing a &1Pumpkin&0 negates this effect. -botania.page.enderEyeBlock1=MY BRAND - -# -- FORCE RELAY -botania.entry.pistonRelay=Force Relay -botania.page.pistonRelay0=It seems that infusing &1Pistons&0 with &4Mana&0 results in some interesting adverse effects.
    This block tears the fabric of space, relaying any piston force applied to it to the block it's bound to. -botania.page.pistonRelay1=To bind it to a block, right click it with a &1Wand of the Forest&0, and right click on the block you want to bind it to.
    Furthermore, this block is highly unstable, and may create uncanny effects, care is to be taken, it is also resistant to glue, both in pulling and pushing. This allows for a "frame" like setup. -botania.page.pistonRelay2=Infusing a &1Piston&0 with &4Mana&0. - -# -- HAND OF ENDER -botania.entry.enderHand=Hand of Ender -botania.page.enderHand0=The &1Hand of Ender&0 allows the user to access the interdimensional ender field, on other words, their &1Ender Chest&0 inventory. This can be done anywhere by right clicking with the hand at the cost of some &4Mana&0.
    Using the hand on another player will open up &otheir&r inventory instead, at a lot higher &4Mana&0 cost. -botania.page.enderHand0a=The &1Hand of Ender&0 allows the user to access the interdimensional ender field, on other words, their &1Ender Chest&0 inventory. This can be done anywhere by right clicking with the hand at the cost of some &4Mana&0. -botania.page.enderHand1=Zezima hates him! -botania.page.enderHand1a=It's like the 4G of Ender Chests - -# -- SOULSCRIBE -botania.entry.enderDagger=Soulscribe -botania.page.enderDagger0=Those &4Endermen&0. They're the second more pesky thing since &4Creepers&0. I swear, the person who came up with them must have taken a &onotch&r too much of their drink.
    However, by infusing a standard dagger with some of their energy, one can create the &1Soulscribe&0, a dagger that tears through &1Endermen&0 as if they were butter. -botania.page.enderDagger1=Due of the type of infusion, though, the dagger only lasts for a few kills, and the energy that radiates from it prevents the &1Manasteel&0 from gathering &4Mana&0 to avoid damage, like typical tools would. Still, all in the name of killing those monsters. -botania.page.enderDagger2=Strike my Soul - -# -- LIFE IMBUER -botania.entry.spawnerClaw=Life Imbuer -botania.page.spawnerClaw0=&1Monster Spawners&0 are an interesting bunch. They have the ability to bring out life from thin air, but somehow, this only manifests when there's a player nearby.
    This, of course, tends to be a rather limiting factor in the onslaught of any creatures that they can create. -botania.page.spawnerClaw1=By placing a &1Life Imbuer&0 on top of a &1Monster Spawner&0 and giving it a rather decent chunk of &4Mana&0 through a &1Diffuseur de mana&0, when there aren't any players in the nearby vicinity, the &4Mana&0 will power the spawner, just as if there were players around. -botania.page.spawnerClaw2=Something something shadow dragon - -# -- RED STRING -botania.entry.redString=Red String -botania.page.redString0=Lore says the Gods tie a red string around the ankles of people who are supposed to affect each others lives. This led inventors to come up with a way of connecting blocks over the air, called, of course, &1Red String&0. Blocks created with this exquisite material can face in all 6 basic directions and bind to the first available and compatible block they can find, given a range. -botania.page.redString1=Each &4Red Stringed&0 block has a different criteria to what it'll bind to, but the distance in which they'll bind stays constant between the variations. The string can be viewed, if a block is bound, by holding a &1Wand of the Forest&0.
    Blocks being in the way will not break the connection. Lastly, &1Red String&0 blocks can't be chained. -botania.page.redString2=Are you in a pinch? -botania.page.redString3=Starting off, the &1Red Stringed Container&0 will bind to any inventory (&1Chests&0, &1Furnaces&0, &1Hoppers&0, etc), items can be put into it using &1Hoppers&0 or any other means of insertion. The items will end up in the block it's bound to, and will enter from the same side as they were put on the &1Red Stringed Container&0 itself. -botania.page.redString4=The &1Red Stringed Container&0. -botania.page.redString5=The &1Red Stringed Dispenser&0 can be bound to &1Dispensers&0 or &1Droppers&0, it functions similarly to the &1Red Stringed Container&0 where items can also be placed in the bound block through it. When a redstone signal is given to it, the &1Dispenser&0 or &1Dropper&0 in the end will fire. -botania.page.redString6=The &1Red Stringed Dispenser&0. -botania.page.redString7=The &1Red Stringed Nutrifier&0 can be bound to any block that can be fertilized with &1Bone Meal&0. Using &1Bone Meal&0 on the block will fertilize the bound block instead. -botania.page.redString8=The &1Red Stringed Nutrifier&0. -botania.page.redString9=The &1Red Stringed Comparator&0 can be bound to any block whose status can be read with a &1Container&0, such as &1Chests&0, &1Mana Pools&0, &1Runic Altars&0, etc. Placing a &1Comparator&0 pointing outwards of this block will send the signal equal to the signal a &1Comparator&0 would send on the bound block. -botania.page.redString10=The &1Red Stringed Comparator&0. -botania.page.redString11=Lastly, the &1Red Stringed Spoofer&0 is an interesting one. Any flower with an effect can be placed on it. The block will bind to any flowers or mushrooms. While there's a flower on top of the block, that flower will not do anything, but the bound block will take all of that flower's properties and work as if it was the flower itself. -botania.page.redString12=The &1Red Stringed Spoofer&0. - -# -- FLUGEL TIARA -botania.entry.flightTiara=Flügel Tiara -botania.page.flightTiara0=The &4Flügel&0 were once a dominant species in the lands, now they're but a race past extinct, once created as godslayers, who possessed the ability of flight.
    The usage of &1Gaia Spirits&0 allows for a small replica of their power, in the form of the &1Flügel Tiara&0, which, at the cost of &4Mana&0 allows for flight. -botania.page.flightTiara1=Forty thousand books from another world -botania.page.flightTiara2=Combining the Tiara with a variety of Quartz species allows for it to create various different kinds of aesthetic wings, one for each style of quartz.
    The recipes for the various types of quartz can be found in the &4Decorative Blocks&0 entry under &4Miscellaneous&0, &1elfique Quartz&0 is acquired by trading &1Nether Quartz&0 with the elves. -botania.page.flightTiara3=Adding Wings (they can be swapped any time) - -# -- BASICS OF CORPOREA -botania.entry.corporea=Basics of Corporea -botania.page.corporea0=&4Corporea&0 is a magical system that utilizes the energy of the end and the empty space in the world to transport items from point A to point B instantly and without any connecting parts.
    The system works through a variant of &1Sparks&0, &1Corporea Sparks&0. These share some similarities with normal &1Sparks&0 but also a fair few differences. -botania.page.corporea1=Starting off, they can go on top of any &4Inventory&0, like a &1Chest&0 or a &1Dispenser&0 as opposed to &4Mana Containers&0, secondly, there's two types of &1Corporea Sparks&0, the basic &1Corporea Spark&0 and the &1Master Corporea Spark&0. These sparks work in a network-like system, each &1Master Corporea Spark&0 designates a &4Corporea Network&0, in which any spark can communicate with other sparks present in it. -botania.page.corporea2=When a &1Corporea Spark&0 is placed or polled, each spark will poll any nearby sparks, adding them to the network designated by the single &1Master Corporea Spark&0 and also polling other nearby sparks, in a chain. While each individual spark can only reach a few blocks, combined, the entire network can go for a virtually infinite distance. -botania.page.corporea3=&1Corporea Sparks&0 have a view of the inventory directly below them, but can only access items from the top side. Each &1Corporea Spark&0 has the ability to view every other spark in the network and its contents, and the ability to request them as necessary, depending on the type of block below it. -botania.page.corporea4=It's to note that the &1Master Corporea Spark&0, while being part of the network, can not have the items in its inventory extracted from.
    Futhermore, no requests for items in the network are ever done passively. Corporea does not have the ability to add new items to the network, those should be inserted physically through &1Hoppers&0 or other methods. -botania.page.corporea5=Similarly to normal &1Sparks&0, &1Corporea Sparks&0 have a method of augmentation, that being the ability to color them. While in the world, there's an icon Fleur flottante around the spark that shows which color it has, this can be changed by right clicking on the spark with a piece of &1Floral Powder&0. These colors define networks. A spark may only be in the same network as another spark if the two have the same color. -botania.page.corporea6=The ability to color sparks allows for multiple different &4Corporea Networks&0 to be together in a close area, without interfering with each other.
    Viewing the network and removing the spark works exactly the same as a normal spark. Lastly, having two &1Master Corporea Sparks&0 of the same color nearby, while possible, is a bad idea and will cause conflicts and odd behaviour. -botania.page.corporea7=Creating &1Corporea Sparks&0 -botania.page.corporea8=And &1Master Corporea Sparks&0 - -# -- CORPOREA INDEX -botania.entry.corporeaIndex=Corporea Index -botania.page.corporeaIndex0=The biggest ability of a &4Corporea Network&0 is the ability to vocally request items from it by name. The &1Corporea Index&0 is an ender-crystal like block that can interface with a given &4Corporea Network&0 by having a &1Corporea Spark&0 placed on top of it.
    While in the world, approaching it will cause it to activate and show the radius in which it will stay activated. -botania.page.corporeaIndex1=While activated, the index will intercept any &4Chat Messages&0 sent by nearby players, taking them in as &4requests&0 and preventing them to be broadcasted to chat. From this, it'll request, from the network, items whose name matches the request. For example, writing "iron ingot" will have the index look through the network for a single &1Iron Ingot&0 and transport it towards itself, materializing it in the world. -botania.page.corporeaIndex2=Requests can be more complex than just a single item. For example "10 apples" will request, as described, 10 &1Apples&0. Writing "this" will search for items whose name equals the name of the item in the player's hand. Prepending or appending to a query "...", "~", "+" or "?" will turn it into a "contains" rather than "equals" query. So writing "iron..." will find all items that have "iron" in their name, for example. -botania.page.corporeaIndex3=The plural form of an item's name may only be used case it's a regular noun when it comes to the plural (suffixed by "-s", "-es" or "-ies"), the singular version works just as well for requests of multiple items, such as "10 apple".
    "10 of this" requests 10 items whose name equals the item in the player's hand, as expected. -botania.page.corporeaIndex4=Examples of complex requests include "10 apples", "a stack of apples", "2 stacks of apples", "2 stacks and 20 apples", "half a stack of apples", "a dozen apples", and so on.
    The index will also recognise more or less verbose forms of request, so "2x stacks and 20x of apples" is equal to "2 stack 2 apple" or "2 stacks + 2 apples". -botania.page.corporeaIndex5=Requesting with "all" or "every" will deliver every single item in the network that matches the criteria, so "all apples" will deliver all the apples in the network.
    On the other side, requesting "count", "show", "display" or "tell" won't request any, but will tell the requester how many exist in the network. -botania.page.corporeaIndex6=Lastly, while near a &1Corporea Index&0, writing part of an item's name and pressing TAB in the chat menu will autocomplete the item's name. -botania.page.corporeaIndex7=A certain magical one at that - -# -- CORPOREA FUNNEL -botania.entry.corporeaFunnel=Corporea Funnel -botania.page.corporeaFunnel0=A simpler block that utilizes the prospects of the &4Corporea Network&0 is the &1Corporea Funnel&0, when given access to a network through a &1Corporea Spark&0 on top, it'll pull a single item from the network when given a redstone signal.
    This item is put into an inventory 1 or 2 blocks below it, or case one doesn't exist or is full, tossed into the world right above the funnel. -botania.page.corporeaFunnel1=The &1Corporea Funnel&0 may only pull items that match its filter, similarly to a &1Hopperhock&0, the filter is designated by items contained on &1Item Frames&0 placed on it. The item pulled is one of the various items in the frames at random.
    Rotating the item changes how many will be requested at once, starting at 1, rotating once, twice and three times will pull 16, 32 and 64, respectively. -botania.page.corporeaFunnel2=Energistically applied - -# -- CORPOREA INTERCEPTOR -botania.entry.corporeaInterceptor=Corporea Interceptor -botania.page.corporeaInterceptor0=The &1Corporea Interceptor&0 does exactly as the name suggests, it intercepts corporea requests. First and foremost, &1Item Frames&0 with items need be attached around the block, these define what items will trigger the interceptor.
    Whenever a request is fired to the corporea network, be it from an Index, Funnel, etc, and there's no items in the network that can fulfil it this block will be triggered. -botania.page.corporeaInterceptor1=Of course, the the block is only triggered if the item requested matches one of items in the &1Item Frames&0 about it. When the block is triggered it'll emit a short redstone pulse. This can be used to do all sorts of things, such as craft the required item using &1Crafty Crates&0 or light up a lamp indicating that the inventory for a resource is out. -botania.page.corporeaInterceptor2=So many automation prospects - -# -- CORPOREA CRYSTAL CUBE -botania.entry.corporeaCrystalCube=Corporea Crystal Cube -botania.page.corporeaCrystalCube0=A seer usually looks through a crystal ball to see the future. Well, a corporea handler would look through a crystal cube to see the present. The &1Corporea Crystal Cube&0 acts as a visual medium to interact ith one's &4Corporea Network&0. Placing the block down and giving it a &1Corporea Spark&0 is the obvious first step to hooking it up to the network. -botania.page.corporeaCrystalCube1=When the block is connected, right clicking it with any sort of item will have it monitor that item, allowing someone who's looking at it see how many exist in the network. The display updates about once every second.
    While there's an item selected, left clicking the block will request one of that item from the network. Shift-left clicking requests a whole stack. -botania.page.corporeaCrystalCube2=I can see forever - -# -- DECORATIVE END BLOCKS -botania.entry.endStoneDecor=Decorative End Blocks -botania.page.endStoneDecor0=Similarly to other stone blocks, &1End Stone&0 can be converted into bricks and chiseled bricks, the bricks can be used as stairs or slabs just like normal &1Stone Bricks&0 would. -botania.page.endStoneDecor1=Making &1End Stone Bricks&0 -botania.page.endStoneDecor2=Making &1Chiseled End Stone Bricks&0 -botania.page.endStoneDecor3=Making &1Ender Bricks&0 -botania.page.endStoneDecor4=Making &1Pillar Ender Bricks&0 - -# -- LIFE AGGREGATOR -botania.entry.spawnerMover=Life Aggregator -botania.page.spawnerMover0=By arranging &1Dragonstone&0, &1Elementium&0 and &1Gaia Spirits&0 in a specific pattern, one can create a device that can contain the curious energies of a &1Monster Spawner&0 and materialize it in another point in space.
    It's to note that the device will shatter after being used once. -botania.page.spawnerMover1=We got the spawner, but this isn't a won run yet - -# -- RESOLUTE IVY -botania.entry.keepIvy=Resolute Ivy -botania.page.keepIvy0=Everyone knows that before being ressurected, one's items splatter all over the ground, generally a massive nuisance. The fix for this is rather simple. By attaching a piece of &1Resolute Ivy&0 to an item through a crafting grid, that item will presist on one's inventory through death. The ivy will degenerate after that fact and will need to be applied again if one wishes to have the item survive another downfall. -botania.page.keepIvy1=Because people die when they are killed - -# -- BLACK HOLE TALISMAN -botania.entry.blackHoleTalisman=Black Hole Talisman -botania.page.blackHoleTalisman0=The void is a massive space full of... void, really. There's nothing there. But with some ingenuity, this space can be used to store items to your heart's content.
    The &1Black Hole Talisman&0 utilizes powerful Gaia and Ender magic to allow for a virtually infinite quantity of a single type of block to be stored in this space. -botania.page.blackHoleTalisman1=Right clicking a block in the world will set the talisman to store that type of block. This can only be done if the talisman is empty. Next off, shift-right clicking the talisman in the air will enable or disable it. Whilst enabled and in the user's inventory it'll absorb any blocks of the type into it.
    Placing the item in a crafting grid allows one to extract stacks of the blocks in it. -botania.page.blackHoleTalisman2=While the talisman has any contents in it, the blocks in it can be placed as if they were normal blocks stored in the inventory via a simple right click with it.
    Right clicking an inventory will try to fill it with the blocks stored in the talisman. -botania.page.blackHoleTalisman3=Like a Rageki but twice as fun - -# -- LUMINIZER TRANSPORT -botania.entry.luminizerTransport=Transport de luminiseur -botania.page.luminizerTransport0=&1Luminizers&0 serve as a simple way to transport players and other living things of the sort by having them ride on trails of light.
    &1Luminizers&0 can be placed in the world as blocks. A &1Luminizer&0, in order to work properly needs to be bound to another one. This can be done with the &1Wand of the Forest&0 in bind mode. Right clicking a &1Luminizer&0 will transport the clicker into the &1Luminizer&0 it's bound to. -botania.page.luminizerTransport1=&1Luminizers&0 have a range of twenty blocks each, but can be chained to create longer and more complex paths.
    The connection between two &1Luminizers&0 goes only one way, unless the binding is explicitly done both ways. If the connection does go both ways, an endless loop is created, though.
    Furthermore, multiple &1Luminizers&0 can target the same one as an endpoint. -botania.page.luminizerTransport2=Luminize to the future -botania.page.luminizerTransport3=Adding some redstone to a &1Luminizer&0 creates a &1Detector Luminizer&0. For all intents and purposes, it functions just like a regular &1Luminizer&0, however, it sends out a &4redstone pulse&0 every time something passes through it or reaches it as an endpoint. -botania.page.luminizerTransport4=Are you ready to draw? -botania.page.luminizerTransport5=While players can just right click the &1Luminizers&0, in order to get animals or other beings into the trails, a &1Luminizer Launcher&0 is required.
    This block needs to be placed down adjacent to &1Luminizers&0, and when it receives a &4redstone pulse&0, it'll randomly distribute all living beings on top of it into all of the adjacent &1Luminizers&0, causing them to go on their merry way. -botania.page.luminizerTransport6=Let's believe it, open the flag - -# - BAUBLES AND ACCESSORIES -# -- AN INTRODUCTION TO BAUBLES -botania.entry.bIntro=An Introduction to Baubles -botania.page.bIntro0=&4Baubles&0, also commonly referred to as &4Trinkets&0 or &4Charms&0 are pieces of equipment which offer all sorts of different effects, when worn.
    To equip them, one can press the &4B&0 (configurable) key. There's four slots, one &4Amulet&0 slot, two &4Ring&0 slots and one &4Belt&0 slot. -botania.page.bIntro1=The &4Baubles Screen&0 -botania.page.bIntro2=It's to note that, if &4Thaumcraft&0 or any other mod that uses the baubles system is installed, this inventory will be shared between the various mods. - -# -- COSMETIC BAUBLES -botania.entry.cosmeticBaubles=Cosmetic Baubles -botania.page.cosmeticBaubles0=A large selection of &1Cosmetic Baubles&0 is available to change or add style to any baubles a player has equipped. These can both be worn by themselves, on the amulet slot, or crafted alongside another &4Bauble&0 in a crafting grid to change the look of the bauble to the new &4Cosmetic Override&0. Removing &4Cosmetic Overrides&0 can be done through putting the bauble back in the crafting grid. -botania.page.cosmeticBaubles1=Creating these is done through an interesting method, weaving a specific color of petal around some &1Mana Infused String&0 creates an item. The type of item created doesn't seem to have anything to do with the color.
    How this works really isn't too well known, it's like the person that came up with this didn't bother to use better materials or something, who knows. -botania.page.cosmeticBaubles2=They're cool -botania.page.cosmeticBaubles3=My desires are... unconventional -botania.page.cosmeticBaubles4=How unpleasant -botania.page.cosmeticBaubles5=It's cold in Kalos -botania.page.cosmeticBaubles6=Do they reveal anything? -botania.page.cosmeticBaubles7=Shut up Alexander and the Trajan -botania.page.cosmeticBaubles8=The eye has to be hidden -botania.page.cosmeticBaubles9=Not for bean sprouts -botania.page.cosmeticBaubles10=The best color -botania.page.cosmeticBaubles11=Tilting the umbrella too much -botania.page.cosmeticBaubles12=The Neighbours' Club -botania.page.cosmeticBaubles13=Nyaa -botania.page.cosmeticBaubles14=Don't get too ahead of yourself -botania.page.cosmeticBaubles15=Evil up! -botania.page.cosmeticBaubles16=Nudistoooooooooo -botania.page.cosmeticBaubles17=(insert reference here) -botania.page.cosmeticBaubles18=Lurk moar -botania.page.cosmeticBaubles19=I need your time -botania.page.cosmeticBaubles20=So rare -botania.page.cosmeticBaubles21=Oh hey, Loki -botania.page.cosmeticBaubles22=Challenge up! -botania.page.cosmeticBaubles23=Representing! -botania.page.cosmeticBaubles24=Reminds me of a puzzle -botania.page.cosmeticBaubles25=You've met with a terrible fate, haven't you? -botania.page.cosmeticBaubles26=Thanks for the gold stranger -botania.page.cosmeticBaubles27=Woah, colors -botania.page.cosmeticBaubles28=Who the hell do you think I am? -botania.page.cosmeticBaubles29=Nothing suspicious here, nope -botania.page.cosmeticBaubles30=I can fly with these -botania.page.cosmeticBaubles31=Not actually part of spain -botania.page.cosmeticBaubles32=Now you too can believe -botania.page.cosmeticBaubles33=Get on the treadmill, angbadang - -# -- TINY PLANET -botania.entry.tinyPlanet=Tiny Planet -botania.page.tinyPlanet0=The &1Tiny Planet&0 is a &4Bauble&0 with gravitational proprieties, while equipped, the &1Tiny Planet&0 will pull any nearby &4Mana Bursts&0 towards the wearer, having them orbit around him or her.
    By increasing its mass with some &1Stone&0, it can also be placed in world, for the same effect. -botania.page.tinyPlanet1=Clearly from rebirth -botania.page.tinyPlanet2=More of a planet than Pluto - -# -- BAND OF MANA -botania.entry.manaRing=Band of Mana -botania.page.manaRing0=Combining a &1Mana Tablet&0 with some &1Manasteel&0 creates an easily worn &4Ring&0, that functions exactly similar to the tablet used to make it, but can be worn as a &4Bauble&0.
    Using some &1Terrasteel&0 allows for an upgrade, which lets it store about four times as much &4Mana&0. -botania.page.manaRing1=Creating the ring -botania.page.manaRing2=Upgrading the ring - -# -- BAND OF AURA -botania.entry.auraRing=Band of Aura -botania.page.auraRing0=The &1Band of Aura&0 is a bit of a deviation from the typical &1Band of Mana&0, in which, instead of storing &4Mana&0, it slowly, while equipped, creates it and stores it into &4Mana&0 containing items in the wearer's inventory.
    Using some &1Terrasteel&0 allows for an upgrade, which lets it generate &4Mana&0 at a significantly faster rate. -botania.page.auraRing1=Creating the ring -botania.page.auraRing2=Upgrading the ring - -# -- SOUJOURNER'S SASH -botania.entry.travelBelt=Soujourner's Sash -botania.page.travelBelt0=Traversing terrain sometimes proves to be a hassle. The &1Soujourner's Sash&0 can be equipped in the &4Belt&0 slot, and when worn will increase the movement speed, jump height and resistance to fall damage of the wearer. This power comes at a small &4Mana&0 cost.
    Lastly, if not sneaking, it also allows the wearer to walk over 1 block high gaps without jumping with ease. -botania.page.travelBelt1=...everell - -# -- TECTONIC GIRDLE -botania.entry.knockbackBelt=Tectonic Girdle -botania.page.knockbackBelt0=By harnessing the forces of tectonic movement, the &1Tectonic Girdle&0, when worn, will negate any &4Knockback&0 applied to the wearer by outside attacks. -botania.page.knockbackBelt1=I'm the man who can't be moved - -# -- SNOWFLAKE PENDANT -botania.entry.icePendant=Snowflake Pendant -botania.page.icePendant0=The &1Snowflake Pendant&0 is a &4Bauble&0 that resonates freezing energy, while it's worn, any nearby still &1Water&0 blocks at foot level will be converted into &1Ice&0.
    The &1Ice&0 will melt shortly afterward the wearer leaves the area. Lastly, this charm will not freeze any blocks if the wearer is sneaking or fully submerged. -botania.page.icePendant1=Do you want to build a snowman? - -# -- PYROCLAST PENDANT -botania.entry.lavaPendant=Pyroclast Pendant -botania.page.lavaPendant0=The &1Pyroclast Pendant&0 is a &4Bauble&0 that absorbs low heat, while it's worn, if the wearer is caught on fire and is not directly standing on &1Fire&0, &1Lava&0 or anything else that can induce burning, they'll be extinguished. -botania.page.lavaPendant1=Hanako could have used one of these - -# -- GOLDEN LAUREL CROWN -botania.entry.goldenLaurel=Golden Laurel Crown -botania.page.goldenLaurel0=One of the uses for &1Gaia Spririts&0 is to, grant a layer of immortality to one that uses them, while wearing a &1Golden Laurel Crown&0, if the wearer were to die, the crown will shatter, regenerating all of their health and giving them a short period of invincibility. -botania.page.goldenLaurel1=Given the theme, probably Viridi - -# -- RING OF CHORDATA -botania.entry.waterRing=Ring of Chordata -botania.page.waterRing0=The &1Ring of Chordata&0 allows the wearer to swim like a fish. While it's equipped, the wearer is bestowed with the ability to accelerate to a decent speed while underwater. It also gives the wearer good sight underwater and, if &4Mana&0 is present, at the cost of some of it, the ability to breathe indefinitely. -botania.page.waterRing1=Check out that fish AI - -# -- RING OF THE MANTLE -botania.entry.miningRing=Ring of the Mantle -botania.page.miningRing0=The &1Ring of the Mantle&0 allows one to mine faster, while equipped and &4Mana&0 is present in the inventory, it'll give a &4Haste&0 effect to the wearer. Some &4Mana&0 is used while the wearer swings their arm or equipped item, be it for attacking, mining or just flailing. -botania.page.miningRing1=Diggy diggy hole - -# -- RING OF MAGNETIZATION -botania.entry.magnetRing=Ring of Magnetization -botania.page.magnetRing0=By turning a &1Magnetizing Lens&0 into a wearable ring, one can use it to magnetize nearby items. While equipped, this ring will make any nearby items magnetize towards the wearer if they're not sneaking. A notable feature of this piece is that it'll negate its effect for 5 seconds after the wearer tosses an item so as to not interfere with whatever means it was tossed for. A &1Solegnolia&0 can disrupt this ring's functionality. -botania.page.magnetRing1=How do they work? - -# -- RING OF FAR REACH -botania.entry.reachRing=Ring of Far Reach -botania.page.reachRing0=Through the power of one's Pride, nothing is out of their reach. By wearing the &1Ring of Far Reach&0, the maximum distance the wearer can break, place or interact with blocks, as well as attack or interact with entities is increased by about three blocks. -botania.page.reachRing1=Fire and Blood - -# -- CHARM OF THE DIVA -botania.entry.divaCharm=Charm of the Diva -botania.page.divaCharm0=The &1Charm of the Diva&0 blesses the wearer with the ability to have any attacked mob follow the attacker's will, and, case there are any nearby enemies, go after them instead. This process, of course, requires a bit of &4Mana&0 from the wearer's inventory in order to function. -botania.page.divaCharm1=You shall not disrespect Big Sister - -# -- GREAT FAIRY RING -botania.entry.pixieRing=Great Fairy Ring -botania.page.pixieRing0=This ring works alongside the &1Elementium Armor&0, insight in the powers of it is advised before using this ring. When worn, the &1Great Fairy Ring&0 will increase the chance for a &4Pixie&0 to spawn when the wearer is hit, this still holds true case no &1Elementium Armor&0 is equipped. -botania.page.pixieRing1=We got square heads, big pointy caps - -# -- GLOBETROTTER'S SASH -botania.entry.superTravelBelt=Globetrotter's Sash -botania.page.superTravelBelt0=The &1Globetrotter's Sash&0 is, in layman's terms, an upgrade to then &1Soujourner's Sash&0, by using &1Gaia Spirits&0 and some elfique resources, this new belt allows the wearer to reach incredible speeds to which the &1Soujourner's Sash&0 doesn't stand a chance. -botania.page.superTravelBelt1=No time for guessing, follow my plan instead - -# -- THE SPECTATOR -botania.entry.itemFinder=The Spectator -botania.page.itemFinder0=&1The Spectator&0 is a headband that allows the wearer to have a better perception of the world. While holding an item, any &4containers&0 (chests, minecarts, donkeys with chests, furnaces, etc...) that have an item of that type, &4dropped items&0 of that type, &4mobs&0 who have that item equipped &o(...)&r -botania.page.itemFinder1=&o(...)&r &4players&0 who have the item in their inventory and &4villagers&0 who want to trade either with or for that item will shine with a colorful glow, allowing them to be easily spotted.
    While sneaking, all dropped items around the wearer will shine, regardless of the item. -botania.page.itemFinder2=Do you hear their voices? - -# -- CRIMSON PENDANT -botania.entry.superLavaPendant=Crimson Pendant -botania.page.superLavaPendant0=The &1Crimson Pendant&0 is, in simple terms, an upgraded counterpart to the &1Pyroclast Pendant&0, wearing it provides the wearer immunity to all fire and lava damage, instead of just extinguishing them. -botania.page.superLavaPendant1=Runner-up on Monolith Code - -# -- TAINTED BLOOD PENDANT -botania.entry.bloodPendant=Tainted Blood Pendant -botania.page.bloodPendant0=Messing around with the original source of the &4Potion&0 design, the Nether, seems to work fairly well at harnessing that very power.
    The &1Tainted Blood Pendant&0 allows one to store a &4Brew&0 in a condensed, wearable state. Infusing this pendant with one and wearing it will apply the effect while it's worn, for the cost of &4Mana&0 depending on the power of the &4Brew&0. -botania.page.bloodPendant1=To infuse the pendant with a &4Brew&0 the normal procedure of infusing one on a &1Vial&0 is what's required. The cost increases by a tenfold, though.
    However, the pendant will not accept any and all effects, a few don't seem to behave well, such as &4Instant Health&0 or &4Absorption&0. Lastly, &4Brews&0 with more than one effect will fail as well. -botania.page.bloodPendant2=I'll get Saber for sure - -# -- CLOAKS OF JUDGEMENT -botania.entry.judgementCloaks=Cloaks of Judgement -botania.page.judgementCloaks0=The &1Cloaks of Judgement&0 are a pair of cloaks that can be worn instead of a belt (and thus, they go in the Belt slot). Their strength triggers when their wearer takes damage. After that, they'll go in a ten second recharge period in which their effects won't trigger. -botania.page.judgementCloaks1=The &1Cloak of Virtue&0 will, when active, block the full extent of a piece of damage taken. This does not apply to magic damage.
    The &1Cloak of Sin&0 will damage all nearby hostile mobs for the same amount of damage that was taken. -botania.page.judgementCloaks2=A Holy Mantle -botania.page.judgementCloaks3=Taste Vengeance! - -# -- MANASEER MONOCLE -botania.entry.monocle=Manaseer Monocle -botania.page.monocle0=A handy accessory for one who requires a thorough window into where their &4Mana Bursts&0 are going is the &1Manaseer Monocle&0. Not only is it a rather fancy eyepiece but it also allows the wearer to see all nearby &4Mana Bursts&0, even if their line of sight towards them is blocked by something. More important, perhaps, is that when someone wearing this monocle looks at a flower they'll be able to see its functional radius. -botania.page.monocle1=Why hello there old chap - -# -- RING OF CORRECTION -botania.entry.swapRing=Ring of Correction -botania.page.swapRing0=Switching tools is a pain. People often find themselves shoveling away at dirt with... a pick? Using the &1Ring of Correction&0 is a great way to, well, correct that.
    While this ring is worn, the tool in hand will always be the right one for the block being broken, be it a pick, axe or shovel. This only works with tools that can use &4Mana&0. -botania.page.swapRing1=Use the right tools - -# - ALFHOMANCY -# -- THE PORTAL TO ALFHEIM -botania.entry.aIntro=The Portal to Alfheim -botania.page.aIntro0=It's said that once, &4Elves&0 used to share the world with us &4Minecrafters&0. Due to unknown events, they would've been banished back to their own world, &4Alfheim&0.
    Experimentation has been done in attempt to bridge the gap between the two worlds, and means of creating a portal that does just that have been devised. -botania.page.aIntro1=Creating this portal proves not to be an easy task, as quite a few exquisite resources are necessary. The requirements are as follows: 8 &1Livingwood&0 blocks, 3 &1Glimmering Livingwood&0 blocks, 1 &1Elven Gateway Core&0 (read on), 2 &1Mana Pools&0 and 2 &1Natura Pylons&0 (read on). -botania.page.aIntro2=Creating the &1Elven Gateway Core&0 -botania.page.aIntro3=Creating &1Natura Pylons&0 -botania.page.aIntro4=Alfheim Portal -botania.page.aIntro5=To open up the portal, simply right click the core with a &1Wand of the Forest&0.
    The portal requires a substantial amount of &4Mana&0 deposited in both the pools to open up, after that, it'll slowly drain some to keep itself powered. If it runs out of &4Mana&0, the connection will be broken. -botania.page.aIntro6=The amount of &4Mana&0 required to open up the portal is orders of magnitude higher than that to keep it maintained, thus closing the portal to prevent &4Mana&0 loss is a poor strategy.
    Furthermore, the link isn't strong enough to allow living beings to go through it, but it seems that &4items&0 can. -botania.page.aIntro7=The amount of information about &1Alfheim&0 stored in this lexicon is limited to this entry alone. Perhaps &4letting the&0 &4Elves have a look at it&0 might prove beneficial.
    Perhaps they'd also return a good amount of knowledge of their mystical constructs. - -# -- A MESSAGE FROM elfique GARDE -botania.entry.elfMessage=A Message from elfique Garde -botania.page.elfMessage0= -# ^ This is blank on purpose -botania.page.elfMessage1=&oGreetings. We noticed that our portal was opened via a link from another world. That's rather shocking news indeed. We thank you very much for providing us with a repository of the knowledge from your world, as to keep us up to date to what happened since we left it, it's been a while since then, it's good to see it's doing well. -botania.page.elfMessage2=&oAfter some discussion with the high council of elfique Garde, we have decided to cooperate with you. You see, reading through your "Lexica Botania" has shown us a good amount of resources from your world that we would be extremely keen as to get our hands on, as these are non-existent in our lands. -botania.page.elfMessage3=&oThe link you have managed to establish is rather weak, no living beings will be able to go through, as you already know. However, there's a positive side to this, the link strikes the fabric of time of both our worlds in a way where it doesn't keep them in sync, that's the reason why you received your book back so quickly. -botania.page.elfMessage4=&oWhen it comes to Mana and other magical energies, we are plenty stocked on them, so worry not about the portal closing on our end. Let's put this in prospect, in order for the advance of both our civilizations, we vow to accept a given set of resources from your world we lack in ours in exchange for resources you lack in yours. -botania.page.elfMessage5=&oWe have taken the liberty of assigning our best scribes to put together a great set of knowledge from our world we're willing to share, you can find it in your lexicon just as you'd find knowledge from yours. We hope you find it enlightening and that it encourages you to invest in our materials. -botania.page.elfMessage6=&oLast but not least, do keep in mind that if you decide to send something we have not vouched to trade for, we will assume it as a gift and keep it for ourselves, just as a forewarning. We look forward to exchanging resources with you.
    Best Regards, the High Council of elfique Garde. - -# -- THE RESOURCES OF ALFHEIM -botania.entry.elfResources=The Resources of Alfheim -botania.page.elfResources0=&4Alfheim&0 contains a very varied amount of exquisite resources. Sadly though, most of them are extremely scarce and hard to come by due to competition between the various clans. The elves are interested in trading some materials, such as &1Dreamwood&0, &1Elementium&0, &1Pixie Dust&0 or &1Dragonstone&0, resources native to their lands. -botania.page.elfResources1=Trading for &1Dreamwood&0 -botania.page.elfResources2=&1Dreamwood&0, similarly to &1Livingwood&0 can be turned into various &4Decorative Blocks&0, have a look through the &4Decorative Blocks&0 entry under &4Miscelaneous&0 for the recipes. -botania.page.elfResources10=&1Dreamwood Twigs&0 -botania.page.elfResources3=Trading for &1Elementium&0 -botania.page.elfResources4=Trading for &1Pixie Dust&0 -botania.page.elfResources5=Trading for &1Dragonstone&0 -botania.page.elfResources6=The &1Elves&0 are also quite keen on the white posh block from the &4Nether&0, &1Nether Quartz&0, the ones they have on their world are tinted green. This quartz works just like any other quartz, be it normal &1Nether Quartz&0 or any of the decorative variants you can find on the &4Decorative Blocks&0 entry under &4Miscelaneous&0. -botania.page.elfResources7=Trading for &1elfique Quartz&0 -botania.page.elfResources8=Alfheim also has its own variant of &1Glass&0, in the form of &1Alfglass&0. Its look is rather light and its patterns are randomized depending on where it's placed.
    Trading goes for &1Managlass&0. -botania.page.elfResources9=Trading for &1Alfglass&0 - -# -- RITUAL OF GAIA -botania.entry.gaiaRitual=Ritual of Gaia -botania.page.gaiaRitual0=The &4Ritual of Gaia&0 is a procedure often enacted by the elves, which is the only way to acquire &1Gaia Spirits&0, which are essences of the power of the Goddess of Gaia herself.
    This ritual required an &4Active&0 &1Beacon&0 with some &1Gaia Pylons&0 (read on) one level above the beacon as the altar, as well as a single &1Terrasteel Ingot&0 as a sacrifice. -botania.page.gaiaRitual1=Creating &1Gaia Pylons&0 -botania.page.gaiaRitual2=Place the pylons (1 block above the beacon) -botania.page.gaiaRitual3=To start the ritual, simply shift-right click the &1Beacon&0 block with a &1Terrasteel Ingot&0, take a step back and prepare to fight for your life. Good preparation is required, as the fight with the &4Guardian of Gaia&0 can be even harder than that of the &4Wither&0. Upon defeating the &4Guardian&0, one can collect their prize, a handful of &1Spirits of Gaia&0. -botania.page.gaiaRitual4=The common attire for this ritual is a set of Enchanted &1Elementium Armor&0, a &1Terra Blade&0 and a large assortment of &4Brews&0 and &4Baubles&0.
    The effect of the &1Beacon&0 is nullified during the battle, so that should be taken in mind. Lastly, staying away from the purple might be a good idea. - -# -- RITUAL OF GAIA II -botania.entry.gaiaRitualHardmode=Ritual of Gaia II -botania.page.gaiaRitualHardmode0=One would think that combining two of the most powerful resources known to existance, in the form of &1Terrasteel&0 and &1Gaia Spirits&0 would create an unstoppable material. It seems that the material is very much stoppable, though. In fact, the two forces cancel eachother out when combined into an ingot, creating an utterly useless alloy. -botania.page.gaiaRitualHardmode1=This ingot, though, due to the concentrated energy and power in it, does allow for the summoning of a stronger &1Gaia Guardian&0, with more resistance, strength and speed.
    For all of this, it also drops more &1Gaia Spirits&0 than normal, as well as a handful of goodies and rare treasure, making it a worthwhile foe. -botania.page.gaiaRitualHardmode2=Creating the &1Gaia Spirit Ingot&0. - -# -- THE RELICS OF THE AESIR -botania.entry.relics=The Relics of the Aesir -botania.page.relics0=There's an old tale from the high clans of Alfheim. It says something among the lines of "The one who rolls the Dice of Fate is to be rewarded with the Gifts of the Gods". These so called &1Relics of the Aesir&0 are rumored to be unique and soulbound, by which only one will ever be awarded to any one individual and only they might use it.
    But then again, it's probably just folklore. - -# -- ELVEN LORE - THE SHATTERING -botania.entry.elvenLore=Elven Lore - The Shattering -botania.page.elvenLore0=It seems this section of the lexicon is just a bunch of pieces of paper. By the looks of them, they seem like they were taken from a document from the libraries of elfique Garde.
    Their contents should contain historical knowledge, but doubtfully anything important to the studies of botany itself. -botania.page.elvenLore1=&oA few millennia have passed since The Shattering. The amount of us who actually know about what really happened that day is rather minute. Nidavellir broke down, and while the Dwarves' incredible resistance helped, a great part of their technology and civilization was eradicated. Muspelheim, what was (...) -botania.page.elvenLore2=&opreviously in the very opposite corner of the World Tree herself collided with Midgard, merging the two worlds in an apocalypse, eradicating any life remaining in that world. There's theories that state Hel was also involved in the event, although none were ever confirmed. Fissures in the ground of (...) -botania.page.elvenLore3=&oJotunheim opened all around, massacring a great portion of the Giants who lived there, its current status remains unknown. Niflheim seemed to stay in place, unlike Muspelheim, interestingly enough. Since it contained no known lifeforms, we can admit that damage is irrelevant. Lastly, ourselves, the (...) -botania.page.elvenLore4=&oelves of Alfheim, the damage on our world was somewhat split. The Salamander and Undine clans suffered a massive cut on their population, due to the unstableness of their volcanic and aquatic environments, respectively. Most of the Sylph were completely intact due to their extraordinary flight capabilities, the (...) -botania.page.elvenLore5=&oSpriggan also had fairly small scale consequences. During that time our civilization prospects were fairly weak and our choices of residence were mostly just huts made of Dreamwood, so, luckily, rebuilding was little of a chore. Allewyn, our emissary in Asgard witnessed this happening, everything happened faster (...) -botania.page.elvenLore6=&othan the birth of a Pixie. Thor shattering the Bifrost with Mjolnir, her command to evacuate all of the elfique civilization residing in Midgard, luckily she was here unscathed, or at least that's what records say, regardless, a few millennia later, she's passed off long ago. Right now our major concern is the status of Midgard. (...) -botania.page.elvenLore7=&oThe collapse of the Bifrost broke any interaction between the various worlds, but the sheer quantity of Mana residues we have left behind will surely have lingered and infused the world with life all over again, be it animal, floral or fungal, natural or magical in essence. We hope it's enough to create intelligent life that can properly harness it though. - -# - MISCLANEOUS -# -- UNSTABLE CUBE -botania.entry.unstableBlocks=Unstable Cubes -botania.page.unstableBlocks0=Fiddling with highly powerful &4Mana&0 infused objects has lead to the creation of these strange cubes. They seem to emit some visual radiation in the form of colorful lightning, but it doesn't seem like it has any effects other than visual appeal. -botania.page.unstableBlocks1=They look fancy -botania.page.unstableBlocks2=And they come in all 16 colors -botania.page.unstableBlocks3=There's also a way of creating a different version of these that releases an extremely larger amount of energy, this time in the form of a beam towards the sky that extends into a cloud of sorts. This one also seems to be disableable via a &4Redstone Signal&0, it's called an &1Unstable Beacon&0, as it looks like one somehow. -botania.page.unstableBlocks4=Fireworks? -botania.page.unstableBlocks5=Combined entropy -botania.page.unstableBlocks6=It's also possible, by using the &1Unstable Beacons&0, to turn them into a manageable and portable utility, in the form of the &1Signal Flare&0.
    This gun of sorts shoots a colored round into the sky that lasts a few seconds, it also stuns any nearby enemies for just as long. -botania.page.unstableBlocks7=Shoot in case of titan - -# -- DECORATIVE BLOCKS -botania.entry.decorativeBlocks=Decorative Blocks -botania.page.decorativeBlocks0=Past functionality, quite a few decorative blocks are available to make your builds look better.
    Starting off. It's possible to turn blocks of &1Livingrock&0 and &1Livingwood&0 into decorative blocks. Each of them features 4 different decorative variations. -botania.page.decorativeBlocks1=Viveroche bricks. -botania.page.decorativeBlocks2=Mossing the bricks -botania.page.decorativeBlocks3=Cracking the bricks -botania.page.decorativeBlocks4=Framing the bricks -botania.page.decorativeBlocks5=Turning wood into planks -botania.page.decorativeBlocks6=Mossing the planks -botania.page.decorativeBlocks7=Framing the planks -botania.page.decorativeBlocks8=Pattern planks -botania.page.decorativeBlocks9=Fleur chatoyante livingwood -botania.page.decorativeBlocks10=Carrying on, by combining &1Nether Quartz&0 with all sorts of other substances, it's possible to create a wide array of other decorative &1Quartz&0 blocks.
    As expected, all these items can be crafted into all their decorative block counterparts just like regular &1Quartz&0 blocks are crafted. -botania.page.decorativeBlocks11=Smokey Quartz -botania.page.decorativeBlocks12=Mana Quartz -botania.page.decorativeBlocks13=Blaze Quartz -botania.page.decorativeBlocks14=Lavender Quartz -botania.page.decorativeBlocks15=Redquartz -botania.page.decorativeBlocks23=Sunny Quartz -botania.page.decorativeBlocks16=A few blocks can be organized in methods different than normal to create new building blocks, such as &1Reed Blocks&0, &1Thatch&0, &1Roof Tiles&0 and a few new &1Bricks&0.
    All these also can be crafted into both stairs and slabs. -botania.page.decorativeBlocks17=Crafting &1Reed Blocks&0 -botania.page.decorativeBlocks18=Crafting &1Thatch&0 -botania.page.decorativeBlocks19=Crafting &1Roof Tiles&0 -botania.page.decorativeBlocks20=Crafting &1Hellish Bricks&0 -botania.page.decorativeBlocks21=Crafting &1Soul Bricks&0 -botania.page.decorativeBlocks22=Crafting &1Frosty Bricks&0 - -# -- DISPENSER TWEAKS -botania.entry.dispenserTweaks=Dispenser Tweaks -botania.page.dispenserTweaks0=&1Dispensers&0, among their normal abilities, can also plant all sorts of crops, from &1Seeds&0, &1Potatos&0 or &1Carrots&0 to even &1Nether Wart&0. The crop is planted in the block right in front of the dispenser.
    The &1Dispensers&0 can also use the &1Wand of the Forest&0 for some specific tasks such as triggering a &1Runic Altar&0. - -# -- GLIMMERING FLOWERS -botania.entry.shinyFlowers=Fleur chatoyante -botania.page.shinyFlowers0=En combinant votre &1Fleur mystique&0 typique avec un peu de &1Poudre lumineuse&0, vous pouvez les faire miroiter encore plus brillante, et émettre une lumière physique actuelle, de la même brillance comme un &1Bloc lumineux&0.
    With some &1Dirt&0 and &1Pasture Seeds&0 it's possible to turn them into a miniature Fleur flottante island that will not only emit light, but also look very fancy indeed. -botania.page.shinyFlowers3=Combining any color of &1Fleur flottante Flower&0 with any flower that has an effect (any &4Functional or Generating Flower&0, etc) in a crafting table will join the two, allowing for both the look and properties of a &1Fleur flottante Flower&0 and the effects of the flower chosen in one block. Lastly, right clicking a Fleur flottante flower in the world with any type of &1Pasture Seed&0 or a &1Snowball&0 will change its look. -botania.page.shinyFlowers1=Pretty Pretty Shiny Shiny -botania.page.shinyFlowers2=Like Laputa but (a lot) tinier - -# -- PRISMARINE -botania.entry.prismarine=Prismarine -botania.page.prismarine0=&1Prismarine&0 is an interesting component and building block. Some scholars even go as far as to say it comes from &4the future&0.
    To create it, one requires an &1Alchemy Catalyst&0. Simply tossing some &1Nether Quartz&0 into a &1Mana Pool&0 with the catalyst attached to it will get some of this material. -botania.page.prismarine1=There's various building blocks that can be created using the &1Prismarine Shards&0, to which all but the &1Sea Lantern&0 can be turned into their &1Stair&0 and &1Slab&0 variants. -botania.page.prismarine2=Creating &1Prismarine Shards&0 -botania.page.prismarine3=Crafting &1Prismarine&0 -botania.page.prismarine4=Crafting &1Prismarine Bricks&0 -botania.page.prismarine5=Crafting &1Dark Prismarine&0 -botania.page.prismarine6=Crafting the &1Sea Lantern&0 - -# -- NATURAL SHEDDING -botania.entry.shedding=Natural Shedding -botania.page.shedding0=The living and unliving beings that inhabit our lands don't live in a static state. It's common for pieces of their body to fall out, or for them to drop things, or for them to extrude substances. The following pages list some such items that can come from such entities. - -# -- TINY POTATO -botania.entry.tinyPotato=Tiny Potato -botania.page.tinyPotato0=It's a tiny potato, it believes in you, you can do the thing.
    No really, that's it, by tossing a &1Potato&0 in a &1Mana Pool&0, the potato gains a little lively essence and happy feeling. It's a lively one, giving it a right click will make it even more so!
    It can also be named in an &1Anvil&0. -botania.page.tinyPotato1=Put it on Kickstarter, it'll work - -# -- HEAD CREATION -botania.entry.headCreating=Head Creation -botania.page.headCreating0=A typical incantation of the Elves, combining a few resources and a &1Name Tag&0 allows for the creation of a replica of sorts of the head of the person described in the tag. How it works isn't really known, but it seems to be possible to replicate it with a &1Runic Altar&0. -botania.page.headCreating1=Get your head in the game - -# -- AZULEJO -- http://en.wikipedia.org/wiki/Azulejo -botania.entry.azulejo=Azuléjos -botania.page.azulejo0=&1Azuléjos&0 are a type of decorative block, simply put, they are tileable patterns of blue and white. To create them, one would simply mix a piece of &1Lapis Lazuli&0 with a &1Block of Quartz&0.
    From there, placing it in the crafting grid allows for cycling between the twelve different patterns. -botania.page.azulejo1=The various patterns -botania.page.azulejo2=Crafting a block of &1Azuléjo&0 -botania.page.Lentilles de mana3=Cycling between the patterns - -# -- STARFIELD CREATOR -botania.entry.starfield=Starfield Creator -botania.page.starfield0=The &1Starfield Creator&0 does exactly as it says, by releasing elfique energies into the air, if it's placed in the world, during night time it will create a starry sky that extends for a fair distance. -botania.page.starfield1=Twinkle twinkle - -# -- TRODDEN DIRT -botania.entry.dirtPath=Trodden Dirt -botania.page.dirtPath0=&1Trodden Dirt&0 is a type of soil that works perfectly for the creation of natural looking artificial paths through landscape. Similarly to &1Farmland&0, it's slightly inset into the ground, walking on it also provides a small speed boost. -botania.page.dirtPath1=Follow the yellow dirt road -botania.page.dirtPath2=Also available in slabs - -# -- SHIMMERING MUSHROOMS -botania.entry.mushrooms=Shimmering Mushrooms -botania.page.mushrooms0=Sprinkling some &1Floral Powder&0 on &1Mushrooms&0 seems to have the interesting effect of them mutating into the respective color of powder, gaining a new shape and getting the ability to emit dim light. They don't seem to do anything besides look interesting.
    These can also be seldom found deep underground in isolated patches. -botania.page.mushrooms1=They don't make you bigger - -# -- PHANTOM INK -botania.entry.phantomInk=Encre sympatique -botania.page.phantomInk0=Having your beautiful skin and accessories under a set of metal armor is nobody's dream. It's bulky, flat, and worst of all, not fashionable!
    Luckilly, by tinging this horrendous armor with &1Phantom Ink&0 in a crafting grid, the armor will be completely invisible, while still providing all of its benefits. This will only work with armor sets that can use &4Mana&0. -botania.page.phantomInk1=Who you gonna call? - -# -- STONE ALCHEMY -botania.entry.stoneAlchemy=Stone Alchemy -botania.page.stoneAlchemy0=Using an &1Alchemy Catalyst&0 proves to be a decently functional method of generating new types of &1Stone&0. Simple deal, tossing a piece of &1Stone&0 into the catalized pool will transform it into another in a cyle.
    Similarly to &1Prismarine&0, some scholars admit that this technique came from the future. Stairs and slabs can be made from the rough and brick variants of these. -botania.page.stoneAlchemy1=Creating the stones -botania.page.stoneAlchemy2=Polish -botania.page.stoneAlchemy3=Brickage -botania.page.stoneAlchemy4=Chiseling - -# -- BLAZE LIGHT -botania.entry.blazeBlock=Blaze Light -botania.page.blazeBlock0=Smashing a bunch of &1Blaze Rods&0 together makes a usable decorative light block. A crude one, admittedly, but a source of light non the less.
    Naturally, like a &1Block of Coal&0, the &1Blaze Light&0 can also be used to fuel furnaces and other fuel consumers alike. Putting it next to a &1Pure Daisy&0 converts it into &1Obsidian&0, strangely enough. -botania.page.blazeBlock1=0x1a4 - -# -- CHALLENGES -botania.entry.challenges=Challenges -botania.page.challenges0=&1Challenges&0 are available in the &1Lexica Botania&0 by clicking the icon in the right of the landing page shaped like a cup. These, as the name says, challenge the player to create a mechanism using the features only available in &1Botania&0 and &1Minecraft&0 itself.
    Of course, you can use items from other mods to complete them, but that's no fun. -botania.page.challenges1=All of the challenges are possible, of course. They just require some thinking and knowledge of the ins and outs of redstone and the &1Botania&0 mechanics themselves.
    It's highly recommended that they're done without using features from external mods, as they have been created with that in mind, and aren't really challenges if you put down a block that solves them instantly. -botania.page.challenges2=The challenges aren't obligatory in any way, and do not provide any material reward. They're purely suggestions as to what &1Botania&0 can do, automation wise, and are but scratching the surface of that topic. Challenges need be marked completed manually.
    It should be kept in mind that the boundaries of this world are one's imagination, so don't stop at the ideas in there! - -# -- CACOPHONIUM -botania.entry.cacophonium=Cacophonium -botania.page.cacophonium0=This interesting instrument, the &1Cacophonium&0, has the ability to mimic almost every living being's cries in nature, allowing for the "musician" to play them at will. Right clicking with it on an entity has the instrument learn its sound. It can then be played by holding right click.
    Why anyone would ever want to make this, however, is beyond moral comprehension. -botania.page.cacophonium1=Hibike! Cacophonium - -# -- THAUMCRAFT INTEGRATION -botania.entry.tcIntegration=Thaumcraft Integration -botania.page.tcIntegration0=Often enough, the paths of &4Botany&0 and &4Thaumaturgy&0 cross together. Mixing some of the artifacts mentioned in this book as well as any from the school of &5Thaumcraft&0 can allow for combinations of these to form. -botania.page.tcIntegration1=First and foremost, combining any of the &1Mana Metal&0 helms with a set of &1Goggles of Revealing&0 allows for a combination of both.
    The protection and regenerability of the armor works alongside the Goggles' abilities, but the &4Vis&0 discount is lost. -botania.page.tcIntegration2=Helmets of Revealing (works with any Botania helm) -botania.page.tcIntegration3=Carrying on, &4Mana&0 can also serve as an interesting type of Ink. Infusing a set of black &1Scribing Tools&0 with &4Mana&0 from a &1Mana Pool&0 allows for them to use said &4Mana&0 as their source of color.
    Refilling these tools works similarly to a &1Mana Tablet&0, done by tossing it on top of the pool. It's to note that the tools do not come pre-filled. -botania.page.tcIntegration4=Making the &1Botanurgist's Inkwell -botania.page.tcIntegration5=Next off, there's a few varied resources or constructs that can work as paraphernalia for an &1Infusion Altar&0, to lower its' instability, these come in the form of &1Fleur chatoyante Flowers, Fleur flottante Flowers and any variety of Pylons&0.
    Lastly, a special &4Brew&0 can be put together using typical thaumaturgic resources in order to apply a &4Warp Ward&0 effect. -botania.page.tcIntegration6a=Perhaps insanity might not be the greatest tool in all of occasions. For those cases, a nice bath generally takes care of it. A brew might be a better format for such a task, though... -botania.page.tcIntegration6b=The official frowny face - -# -- BUILDCRAFT INTEGRATION -botania.entry.bcIntegration=Buildcraft Integration -botania.page.bcIntegration0=Recent advances in piping technology have allowed &1Gates&0 to get a feel of the &4Mana&0 around them. A &1Gate&0 can now sense whether a &4Mana&0 container is empty, full or if it contains any mana.
    &1Gates&0 can also use the &1Mana Detector&0 trigger to detect if a mana is passing by the pipe block. In addition, they can also sense when a &1Runic Altar&0 is ready to create runes. diff --git a/src/main/resources/assets/botania/lang/ja_JP.lang b/src/main/resources/assets/botania/lang/ja_JP.lang index c103648a2..bdcab5d5d 100644 --- a/src/main/resources/assets/botania/lang/ja_JP.lang +++ b/src/main/resources/assets/botania/lang/ja_JP.lang @@ -1,11 +1,16 @@ +# Note to translators: DO NOT COPY ENTRIES FROM ENGLISH +# I repeat: do NOT copy entries from English!! +# Any entry in this lang file should be in ja_JP, or *should not be here at all* +# Copying English entries will cause them to become outdated when the main English lang file changes +# Untranslated entries will automatically be inherited from en_US +# +# Once again, don't copy from English, and THANK YOU for your hard work! + # MISC itemGroup.Botania=ボタニア generator.botania-skyblock=ガーデンオブグラス ボタニア・スカイブロック generator.botania-skyblock.info=初心者には非推奨 -# Something that is not localized, translators, do NOT change this line. -botaniamisc.noloc=botaniamisc.noloc - botaniamisc.nextPage=次ページ botaniamisc.prevPage=前ページ botaniamisc.back=戻る @@ -35,11 +40,8 @@ botaniamisc.edition=%s 版 # ^ Leave this empty for no edition display botaniamisc.devEdition=Writer's botaniamisc.lexiconcover0=説明書 by Lizbeth -botaniamisc.lexiconcover1="Vazkii" Whitewood botaniamisc.lexiconcover2=公式ガイドブック botaniamisc.lexiconcover3=ボタニアのすべてがここに! -botaniamisc.lexiconcover4=Edited by BevoLJ -botaniamisc.lexiconcover5=Edited by Saice botaniamisc.shiftinfo=&bSHIFT&7 キーを押して詳しい情報を見る botaniamisc.knowledgeTypesSingular=%s 編の知識が入っている botaniamisc.knowledgeTypesPlural=%s 編の知識が入っている @@ -48,10 +50,7 @@ botaniamisc.clickToSee=クリックで読む botaniamisc.shiftToRemove=シフト+クリックでお気に入りから外す botaniamisc.clickToAdd=お気に入りに追加 botaniamisc.ratio=%sx 拡大(カーソルで拡大解除) -botaniamisc.bottleTooltip=慣れ親しんだ味 -botaniamisc.coarseDirt0=きめの粗い土 -botaniamisc.coarseDirt1=草が伝播しない -botaniamisc.spawnerTip=Tip: スポーンエッグを使うとモブを変えられる +botaniamisc.bottleTooltip=慣れ親しんだ味 botaniamisc.shardLevel=シャードパワー %s botaniamisc.lexiconIndex=索引 botaniamisc.hasIvy=Has Timeless Ivy @@ -60,8 +59,8 @@ botaniamisc.noLexicon=これを読むには、ボタニア植物辞典を手に botaniamisc.cantOpen=ボタニア植物辞典にはこのページはないようです。外部ソース・・・? botaniamisc.clickToShare=共有 botaniamisc.drop=ドロップ -botaniamisc.dropTip0=Tip: %key% キーを押すとドロップ -botaniamisc.dropTip1=CTRL-%key% キーでスタックごとドロップ +botaniamisc.dropTip0=Tip: %s キーを押すとドロップ +botaniamisc.dropTip1=CTRL-%s キーでスタックごとドロップ botaniamisc.wandMode.bind=接続モード botaniamisc.wandMode.function=機能モード botaniamisc.playVideo=動画を再生 @@ -86,7 +85,6 @@ botaniamisc.startTutorial=チュートリアルを始める botaniamisc.tutorialStarted=チュートリアルが始まりました。赤い矢印にしたがって内容を読み進め、ボタニアの基本を学んでください! botaniamisc.tutorialEnded=チュートリアルは終了しました。ボタニアがどのようなものかという、基本的な考えを理解したと思います。興味に従って他のページを読み、ボタニアのさらなる使い方を習得してください! botaniamisc.cosmeticBauble=&o装飾品 -botaniamisc.hasCosmetic=&oHas Cosmetic Override: &r%s botaniamisc.typeToSearch=(入力して検索) botaniamisc.viewOnline=ウェブページで見る botaniamisc.history=履歴 @@ -95,9 +93,7 @@ botaniamisc.historyDesc=直近の検索履歴を見る botaniamisc.lexiconOptions0=オプション botaniamisc.lexiconOptions1=ゲーム内から設定を変更 botaniamisc.lexiconOptions2=ゲーム再起動が必要なオプションもあります -botaniamisc.hasPhantomInk=&b Tinged with Phantom Ink botaniamisc.pinkinatorDesc=ウィザーに直接つかう -botaniamisc.relicUnbound=&6Relic&7, Unbound botaniamisc.relicSoulbound=この&6形見&7は, &f%sに属している botaniamisc.notYourSagittarius=&4この形見はあなたのものじゃないです botaniamisc.diceRoll=ダイスが %s で地面に着地し、なにか別のものに変わっていた。 @@ -147,10 +143,8 @@ botaniamisc.tutorialText=ゲーム内 botaniamisc.tutorialVideo=動画 botaniamisc.shiftToStopSpin=(シフトで停止) botaniamisc.noVideo=&4動画は公開停 止中です。ご めんね(´ρ`) -botaniamisc.adaptativeConfigChanges=Botania's adaptation Config has changed the following config defaults for you: botaniamisc.altarRefill0=何も持ってない状態で右クリックすると botaniamisc.altarRefill1=最後に使ったレシピのアイテムを補充します -botaniamisc.santaweaveInfo=Manaweave, changed up for the &cs&fe&ca&fs&co&fn botaniamisc.enterToView=^ エンターキーで見る ^ # NEI INTEGRATION @@ -242,49 +236,37 @@ death.attack.botania-relic=%s は他人の形見を使ったために処罰さ # ENTITY NAMES entity.Botania.botania:manaBurst.name=マナ放射線 -entity.Botania.botania:signalFlare.name=Signal Flare entity.Botania.botania:pixie.name=ピクシィ -entity.Botania.botania:flameRing.name=Flame Ring entity.Botania.botania:vineBall.name=ツタ玉 entity.Botania.botania:doppleganger.name=ガイアの守護者 -entity.Botania.botania:magicLandmine.name=Gaia Trap entity.Botania.botania:spark.name=スパーク entity.Botania.botania:thrownItem.name=投げ込まれたアイテム -entity.Botania.botania:magicMissile.name=Magic Missile entity.Botania.botania:thornChakram.name=棘のチャクラム entity.Botania.botania:corporeaSpark.name=コーポリアスパーク entity.Botania.botania:enderAirBottle.name=エンダー空気瓶 entity.Botania.botania:poolMinecart.name=マナプールマインカート entity.Botania.botania:pinkWither.name=桃色ウィザー entity.Botania.botania:playerMover.name=ルミナイザ光線 -entity.Botania.botania:manaStorm.name=Manastorm Epicenter entity.Botania.botania:babylonWeapon.name=宝物庫の武器 entity.Botania.botania:fallingStar.name=流星 # ACHIEVEMENT NAMES + DESC -achievement.botania:flowerPickup=Sky of Beginning achievement.botania:flowerPickup.desc=神秘的な花を拾う achievement.botania:lexiconUse=現実的論理主義者 achievement.botania:lexiconUse.desc=レキシカ・ボタニアを開いて目次を見る achievement.botania:daybloomPickup=アカツキアライヴァル achievement.botania:daybloomPickup.desc=花びらの調合所でデイブルームをつくる -achievement.botania:manaPoolPickup=ViViD WAVE achievement.botania:manaPoolPickup.desc=マナを貯蔵するマナプールをクラフトする achievement.botania:endoflamePickup=炉心融解 achievement.botania:endoflamePickup.desc=マナ生成を加速させるエンドフレイムをクラフトする -achievement.botania:tinyPotatoPet=Just Be Friends achievement.botania:tinyPotatoPet.desc=小さなポテトをつくってペットにする -achievement.botania:sparkCraft=LIVEDRIVE achievement.botania:sparkCraft.desc=マナの運搬に役立つスパークをつくる -achievement.botania:baubleWear=Inner Arts achievement.botania:baubleWear.desc=装飾品をつくって装備する achievement.botania:manaCookieEat=腐れ外道とチョコレゐト achievement.botania:manaCookieEat.desc=マナを融合したおいしい"全快ビスケット"を食べる -achievement.botania:runePickup=LILIUM DOLL achievement.botania:runePickup.desc=ルーンの祭壇を使ってルーンを作る achievement.botania:manaBlasterShoot=M'AIDER遭難ガール achievement.botania:manaBlasterShoot.desc=マナブラスターをつくって発射する -achievement.botania:tiaraWings=Heart Shooter achievement.botania:tiaraWings.desc=フリューゲルティアラをフリューゲルウィングとクラフトし、装備する achievement.botania:terrasteelPickup=ダンサーインザダーク achievement.botania:terrasteelPickup.desc=大地集積プレートをつかってテラスチールインゴットを作る @@ -302,19 +284,15 @@ achievement.botania:dirtRodCraft=ロクベル achievement.botania:dirtRodCraft.desc=汚いぼ...じゃなかった、大地の杖をクラフトしよう achievement.botania:spawnerMoverUse=◯◯◯脱げるもん! achievement.botania:spawnerMoverUse.desc=生命集積器をつかってモンスタースポナーを移動させる -achievement.botania:enderAirMake=Imitation Air achievement.botania:enderAirMake.desc=エンダー空気瓶を集める -achievement.botania:corporeaCraft=drop pop candy achievement.botania:corporeaCraft.desc=コーポリア・ネットワークに役立つブロックをクラフトする achievement.botania:cacophoniumCraft=ノイジーラバーソウル achievement.botania:cacophoniumCraft.desc=カコフォニウムをクラフトして、嫌いなアイツを静かに怒らせよう achievement.botania:manaCartCraft=ハウトゥー世界征服 achievement.botania:manaCartCraft.desc=長距離マナ輸送のためにマナプールトロッコをクラフトする -achievement.botania:craftingHaloCraft=Segments Blue achievement.botania:craftingHaloCraft.desc=簡単にクラフトができる組み立ての光輪をクラフトする achievement.botania:manaweaveArmorCraft=想像フォレスト achievement.botania:manaweaveArmorCraft.desc=杖をパワーアップさせるマナウェーブ装備をクラフトする -achievement.botania:enchanterMake=ODDS & ENDS achievement.botania:enchanterMake.desc=エンチャントを制御するための、マナエンチャンターをクラフトする achievement.botania:pollidisiacPickup=ロミオとシンデレラ achievement.botania:pollidisiacPickup.desc=ポリディシエクをクラフトして、動物を繁殖させる @@ -326,7 +304,6 @@ achievement.botania:bubbellPickup=深海少女 achievement.botania:bubbellPickup.desc=バッベルをクラフトして水中拠点を作成できるようにする achievement.botania:luminizerRide=ワールズエンド・ダンスホール achievement.botania:luminizerRide.desc=ルミナイザをクラフトして輸送につかう -achievement.botania:manaBombIgnite=Under of Fragments achievement.botania:manaBombIgnite.desc=マナストーム・チャージをクラフトして、遠くで点火する achievement.botania:dandelifeonPickup=ドーナツホール achievement.botania:dandelifeonPickup.desc=ダンデライフオンをつくって、自分の心を試す @@ -339,9 +316,7 @@ achievement.botania:gaiaGuardianNoArmor=終末のミュートロギア achievement.botania:gaiaGuardianNoArmor.desc=防具を付けずにガイアの守護者を倒す achievement.botania:rankSSPick=六兆年と一夜物語 achievement.botania:rankSSPick.desc=ランクSSのテラシャッテラーをつかう -achievement.botania:superCorporeaRequest=Invader GIRL! achievement.botania:superCorporeaRequest.desc=コーポリアの索引で、50,000個以上の一種類のアイテムのリクエストに成功する -achievement.botania:pinkinator=DECORATOR achievement.botania:pinkinator.desc=ピンキネーターをつかう achievement.botania:infiniteFruit=イノセンティア @@ -603,19 +578,6 @@ tile.botania:dreamwood1Stairs.name=ドリームウッドの木材の階段 tile.botania:dreamwood1Slab.name=ドリームウッドの木材のハーフブロック tile.botania:dreamwood1SlabFull.name=ドリームウッドの木材のハーフブロック tile.botania:conjurationCatalyst.name=魔法の触媒 -tile.botania:prismarine0.name=プリズマリン -tile.botania:prismarine1.name=プリズマリンレンガ -tile.botania:prismarine2.name=ダークプリズマリン -tile.botania:prismarine0Stairs.name=プリズマリンの階段 -tile.botania:prismarine0Slab.name=プリズマリンのハーフブロック -tile.botania:prismarine0SlabFull.name=プリズマリンのハーフブロック -tile.botania:prismarine1Stairs.name=プリズマリンレンガの階段 -tile.botania:prismarine1Slab.name=プリズマリンレンガのハーフブロック -tile.botania:prismarine1SlabFull.name=プリズマリンレンガのハーフブロック -tile.botania:prismarine2Stairs.name=ダークプリズマリンの階段 -tile.botania:prismarine2Slab.name=ダークプリズマリンのハーフブロック -tile.botania:prismarine2SlabFull.name=ダークプリズマリンのハーフブロック -tile.botania:seaLamp.name=シーランタン tile.botania:miniIsland0.name=浮遊する白色の神秘の花 tile.botania:miniIsland1.name=浮遊する橙色の神秘の花 tile.botania:miniIsland2.name=浮遊する赤紫色の神秘の花 @@ -634,14 +596,6 @@ tile.botania:miniIsland14.name=浮遊する赤色の神秘の花 tile.botania:miniIsland15.name=浮遊する黒色の神秘の花 tile.botania:tinyPotato.name=小さなポテト tile.botania:spawnerClaw.name=生命浸透器 -tile.botania:reedBlock.name=サトウキビブロック -tile.botania:reedBlock0Stairs.name=サトウキビの階段 -tile.botania:reedBlock0Slab.name=サトウキビハーフブロック -tile.botania:reedBlock0SlabFull.name=サトウキビハーフブロック -tile.botania:thatch.name=わらぶきブロック -tile.botania:thatch0Stairs.name=わらぶきの階段 -tile.botania:thatch0Slab.name=わらぶきのハーフブロック -tile.botania:thatch0SlabFull.name=わらぶきのハーフブロック tile.botania:customBrick0.name=地獄レンガ tile.botania:customBrick1.name=ソウルレンガ tile.botania:customBrick2.name=雪レンガ @@ -870,46 +824,10 @@ tile.botania:doubleFlower212.name=背の高い茶色の神秘の花 tile.botania:doubleFlower213.name=背の高い緑色の神秘の花 tile.botania:doubleFlower214.name=背の高い赤色の神秘の花 tile.botania:doubleFlower215.name=背の高い黒色の神秘の花 -tile.botania:stone0.name=安山岩 -tile.botania:stone1.name=玄武岩 -tile.botania:stone2.name=閃緑岩 -tile.botania:stone3.name=花崗岩 -tile.botania:stone4.name=磨かれた安山岩 -tile.botania:stone5.name=磨かれた玄武岩 -tile.botania:stone6.name=磨かれた閃緑岩 -tile.botania:stone7.name=磨かれた花崗岩 -tile.botania:stone8.name=安山岩ブロック -tile.botania:stone9.name=玄武岩ブロック -tile.botania:stone10.name=閃緑岩ブロック -tile.botania:stone11.name=花崗岩ブロック tile.botania:stone12.name=模様入り安山岩ブロック tile.botania:stone13.name=模様入り玄武岩ブロック tile.botania:stone14.name=模様入り閃緑岩ブロック tile.botania:stone15.name=模様入り花崗岩ブロック -tile.botania:stone0Stairs.name=安山岩の階段 -tile.botania:stone1Stairs.name=玄武岩の階段 -tile.botania:stone2Stairs.name=閃緑岩の階段 -tile.botania:stone3Stairs.name=花崗岩の階段 -tile.botania:stone8Stairs.name=安山岩レンガの階段 -tile.botania:stone9Stairs.name=玄武岩レンガの階段 -tile.botania:stone10Stairs.name=閃緑岩レンガの階段 -tile.botania:stone11Stairs.name=花崗岩レンガの階段 -tile.botania:stone0Slab.name=安山岩のハーフブロック -tile.botania:stone1Slab.name=玄武岩のハーフブロック -tile.botania:stone2Slab.name=閃緑岩のハーフブロック -tile.botania:stone3Slab.name=花崗岩のハーフブロック -tile.botania:stone8Slab.name=安山岩のハーフブロック -tile.botania:stone9Slab.name=玄武岩のハーフブロック -tile.botania:stone10Slab.name=閃緑岩のハーフブロック -tile.botania:stone11Slab.name=花崗岩のハーフブロック -tile.botania:stone0SlabFull.name=安山岩のハーフブロック -tile.botania:stone1SlabFull.name=玄武岩のハーフブロック -tile.botania:stone2SlabFull.name=閃緑岩のハーフブロック -tile.botania:stone3SlabFull.name=花崗岩のハーフブロック -tile.botania:stone8SlabFull.name=安山岩レンガのハーフブロック -tile.botania:stone9SlabFull.name=玄武岩レンガのハーフブロック -tile.botania:stone10SlabFull.name=閃緑岩レンガのハーフブロック -tile.botania:stone11SlabFull.name=花崗岩レンガのハーフブロック tile.botania:blazeBlock.name=ブレイズランプ tile.botania:corporeaInterceptor.name=コーポリア妨害検出器 tile.botania:corporeaCrystalCube.name=コーポリアクリスタルキューブ @@ -926,8 +844,6 @@ tile.botania:lightLauncher.name=ルミナイザ発射器 tile.botania:livingrock0Wall.name=リビングロックの壁 tile.botania:livingwood0Wall.name=リビングウッドの壁 tile.botania:dreamwood0Wall.name=ドリームウッドの壁 -tile.botania:prismarine0Wall.name=プリズマリンの壁 -tile.botania:reedBlock0Wall.name=サトウキビブロックの壁 tile.botania:biomeStoneA0Wall0.name=森に変質した丸石の壁 tile.botania:biomeStoneA0Wall1.name=平原に変質した丸石の壁 tile.botania:biomeStoneA0Wall2.name=山に変質した丸石の壁 @@ -936,10 +852,6 @@ tile.botania:biomeStoneA0Wall4.name=沼に変質した丸石の壁 tile.botania:biomeStoneA0Wall5.name=砂漠に変質した丸石の壁 tile.botania:biomeStoneA0Wall6.name=タイガに変質した丸石の壁 tile.botania:biomeStoneA0Wall7.name=メサに変質した丸石の壁 -tile.botania:stone0Wall0.name=安山岩の壁 -tile.botania:stone0Wall1.name=玄武岩の壁 -tile.botania:stone0Wall2.name=閃緑岩の壁 -tile.botania:stone0Wall3.name=花崗岩の壁 tile.botania:manaBomb.name=マナストーム・チャージ tile.botania:buriedPetals0=埋もれた白色の花びら tile.botania:buriedPetals0.name=埋もれた白色の花びら @@ -1437,7 +1349,7 @@ item.botania:terraAxe.name=テラトランケーター item.botania:manasteelNugget.name=マナスチールのナゲット item.botania:terrasteelNugget.name=テラスチールのナゲット item.botania:elementiumNugget.name=エレメンチウムのナゲット -item.botania:root.name=リビングルート +item.botania:livingRoot.name=リビングルート item.botania:pebble.name=小石 item.botania:waterBowl.name=水の入ったボウル item.botania:obedienceStick.name=花の指揮棒 diff --git a/src/main/resources/assets/botania/lang/ko_KR.lang b/src/main/resources/assets/botania/lang/ko_KR.lang index 4b8ce02ea..b668775d6 100644 --- a/src/main/resources/assets/botania/lang/ko_KR.lang +++ b/src/main/resources/assets/botania/lang/ko_KR.lang @@ -1,12 +1,17 @@ +# Note to translators: DO NOT COPY ENTRIES FROM ENGLISH +# I repeat: do NOT copy entries from English!! +# Any entry in this lang file should be in ko_KR, or *should not be here at all* +# Copying English entries will cause them to become outdated when the main English lang file changes +# Untranslated entries will automatically be inherited from en_US +# +# Once again, don't copy from English, and THANK YOU for your hard work! + #번역시 주의 점: 현재 꽃이름을 제외한 음역은 대부분 패러디로 무리한 한글화를 진행하지 말아주세요(Ex.Tiny Potato) 한글정발을 제외한 모든 패러디는 발음대로 적어주시길 바랍니다. # MISC itemGroup.Botania=보타니아 [Botania] generator.botania-skyblock=잔디의 정원 generator.botania-skyblock.info=보타니아를 처음하는 분에게는 권장하지 않습니다. -# Something that is not localized, translators, do NOT change this line. -botaniamisc.noloc=botaniamisc.noloc - botaniamisc.nextPage=다음 장 botaniamisc.prevPage=이전 장 botaniamisc.back=뒤로 @@ -49,10 +54,6 @@ botaniamisc.clickToSee=클릭시 해당페이지 이동 botaniamisc.shiftToRemove=쉬프트클릭시 삭제 botaniamisc.clickToAdd=이곳을 누르면 북마크가 추가됩니다. botaniamisc.ratio=확대: %sx -botaniamisc.bottleTooltip=It has an acquired taste -botaniamisc.coarseDirt0=거친 흙과 잔디 위에서는 -botaniamisc.coarseDirt1=아무것도 자랄 수 없습니다 -botaniamisc.spawnerTip=Tip: 스폰알로 몹을 변경 botaniamisc.shardLevel=%s 등급 botaniamisc.lexiconIndex=목차 botaniamisc.hasIvy=시대를 초월한 담쟁이 덩굴 @@ -61,8 +62,8 @@ botaniamisc.noLexicon=보타니아 사전을 읽기 위해서는 당신이 그 botaniamisc.cantOpen=이 페이지는 보타니아 사전의 일부가 아닌 것 같습니다. 다른곳에서 왔을 수 도...? botaniamisc.clickToShare=공유 botaniamisc.drop=떨어뜨림 -botaniamisc.dropTip0=팁: %key% 키를 누름으로써 당신의 아이템을 드롭시킬 수 있습니다 -botaniamisc.dropTip1=컨트롤-%key% 가 한 뭉을 떨어뜨릴 겁니다 +botaniamisc.dropTip0=팁: %s 키를 누름으로써 당신의 아이템을 드롭시킬 수 있습니다 +botaniamisc.dropTip1=컨트롤-%s 가 한 뭉을 떨어뜨릴 겁니다 botaniamisc.wandMode.bind=연결모드 botaniamisc.wandMode.function=기능 모드 botaniamisc.playVideo=비디오 재생 @@ -79,10 +80,6 @@ botaniamisc.hasClip=&6현재 적용된 렌즈클립 : botaniamisc.clipEmpty=(비어있음) botaniamisc.armorset=&b갑옷 설정&r: botaniamisc.craftToAddWill=&a테라스틸 투구와 조합할 경우 생기는 효과: -botaniamisc.requestMsg=Requested %d x "%s" out of %d. %d taken. -botaniamisc.nearIndex0=Corporea Index nearby! -botaniamisc.nearIndex1=Anything you say will be -botaniamisc.nearIndex2=intercepted as a request botaniamisc.startTutorial=튜토리얼 시작! botaniamisc.tutorialStarted=당신은 튜토리얼을 시작했습니다, 빨간화살표를 따라 눌러보며 보타니아에 대해 알아보세요! botaniamisc.tutorialEnded=튜토리얼은 여기까지입니다. 이제 당신은 이 책을 읽어서 보타니아의 사용법에 대해 알아보도록하세요 :D @@ -137,12 +134,6 @@ botaniamisc.showNotes=노트 보이기 botaniamisc.notes=노트 botaniamisc.pay2win=아이템을 마나웅덩이에 빠트려서 업그레이드해보세요 botaniamisc.justDoIt=지금 당장 -botaniamisc.changes0=&aBotania&7 has changed since you last used it in this instance! -botaniamisc.changes1=The last version of &aBotania&7 you used was &b%s&7. -botaniamisc.changes2=Things change, don't panic. If something seems off, read the entry again. -botaniamisc.changes3=&oEveryone is afraid of change, yet change is the force that moves us forward. -botaniamisc.changes4=&fShift-Left Click&7 to read the changes since then -botaniamisc.changes5=&fLeft Click&7 to dismiss this # NEI INTEGRATION botania.nei.brewery=보타니아 양조기 @@ -239,39 +230,6 @@ botania.armorset.will3.shortDesc=치명타 공격시 상대방에게 강한 구 botania.armorset.will4.shortDesc=치명타 공격시 상대방의 방어력을 무시합니다. botania.armorset.will5.shortDesc=치명타 공격시 상대방에게 위더 효과 -# ROMAN NUMERALS -botania.roman0= -botania.roman1=I -botania.roman2=II -botania.roman3=III -botania.roman4=IV -botania.roman5=V -botania.roman6=VI -botania.roman7=VII -botania.roman8=VIII -botania.roman9=IX -botania.roman10=X -botania.roman11=XI -botania.roman12=XII -botania.roman13=XIII -botania.roman14=XIV -botania.roman15=XV -botania.roman16=XVI -botania.roman17=XVII -botania.roman18=XVIII -botania.roman19=XIX -botania.roman20=XX -botania.roman21=XXI -botania.roman22=XXII -botania.roman23=XXIII -botania.roman24=XXIV -botania.roman25=XXV -botania.roman26=XXVI -botania.roman27=XXVII -botania.roman28=XXVIII -botania.roman29=XXIX -botania.roman30=XXX - # KNOWLEDGE botania.knowledge.minecraft=마인크래프트 전문가의 지식 botania.knowledge.alfheim=&a요정&7들의 지식 @@ -308,9 +266,7 @@ matrixMode.enabled=매트릭스 모드 활성화 references.enabled=참고 툴팁 활성화 shaders.enabled=쉐이더사용 활성화 baubleRender.enabled=버블 렌더링 활성화 -spreader.posShift=Spreader Pos Shift versionChecking.enabled=버전 체크 활성화 -wandBeam.static=Enable Static Wand Beam worldgen.flower.density=꽃의 밀도 worldgen.flower.quantity=꽃의 양 worldgen.mushroom.quantity=버섯의 양 @@ -344,7 +300,6 @@ botania.versioning.flavour24=이봐! 이봐요! 여길봐요! 보타니아 업 botania.versioning.flavour25=아주 특별한 선물을 당신에게 선물할게요. 따뜻하니까~ 매일매일 언제까지나 나를 미소짓게 만드네~ 보타니아 신버전이 도착했어요 히힛 botania.versioning.flavour26=보타니아 업데이트를 안하면 가정이 무너지고~ 사회가 무너지고~ botania.versioning.flavour27=어쩌피 원문을 번역하면 한국사람들은 이해하지 못한다구요? 그러니까 제 마음대로 할 수 있다는 이말입니다. 아, 갈때 보타니아 업데이트하고 가세요. -botania.versioning.flavour28=BotaniaWow! You'll say wow every time! As seen on your chat log! botania.versioning.flavour29=그냥 보타니아를 업데이트, 업데이트, 업데이트 , 업데이트 하세요! 구버전따위 원하는 사람은 없습니다! botania.versioning.flavour30=보타니아가 업데이트를 시전했다! 효과가 엄청났다! botania.versioning.flavour31=[리빙포인트]보타니아는 언제나 최신버전으로 업데이트하는게 좋다. @@ -373,13 +328,12 @@ botania.versioning.doneDownloading=%s의 다운로드가 끝났습니다. 당신 botania.versioning.downloadedAlready=당신은 이미 최신 버젼을 다운로드 하셨습니다. 게임을 종료하시고, .minecraft - mods 에서 구버젼을 삭제해주세요, 그리고 게임을 재시작 해주세요! botania.versioning.downloadingAlready=이미 다운로드 중입니다. 조금만 더 시간을 주세요. botania.versioning.error=앗! 보타니아 업데이트 파일 다운로드중 오류가 생긴거 같습니다. botaniamod.net에서 받아주세요 -botania.versioning.disabled=Sorry. This feature is currently disabled due to server host problems, it should be back soon. # BAUBLE TOOLTIPS botania.baubletype.amulet=&a아뮬렛&7 슬릇에 착용 가능 botania.baubletype.ring=&a반지&7 슬릇에 착용 가능 botania.baubletype.belt=&a벨트&7 슬릇에 착용 가능 -botania.baubletooltip=&b%key%&7로 버블즈 인벤토리를 여세요 +botania.baubletooltip=&b%s&7로 버블즈 인벤토리를 여세요 # RELIC POEMS item.dice.poem0=그는 카드를 명상을 하듯 다루지, @@ -412,75 +366,52 @@ entity.보타니아.botania:babylonWeapon.name=보구 entity.보타니아.botania:fallingStar.name=유성 # ACHIEVEMENT NAMES DESC / 업적의 제목들은 모두 보컬로이드(VOCALOID) 노래 제목입니다. 제목은 더 이상 만지지 말아주세요. -achievement.botania:flowerPickup=Sky of Beginning achievement.botania:flowerPickup.desc=신비로운 꽃을 월드에서 얻어보세요! achievement.botania:lexiconUse=현실적 논리 주의자 achievement.botania:lexiconUse.desc=보타니아 사전을 열어서 목차를 확인해보세요! achievement.botania:daybloomPickup=새벽 어라이벌 achievement.botania:daybloomPickup.desc=꽃잎 연금술기로 해맞이 꽃을 만들어보세요! -achievement.botania:manaPoolPickup=ViViD WAVE achievement.botania:manaPoolPickup.desc=희미한 웅덩이를 업그레이드! achievement.botania:endoflamePickup=노심용해 achievement.botania:endoflamePickup.desc=불먹이 꽃으로 마나생산량 업업! -achievement.botania:tinyPotatoPet=Just Be Friends achievement.botania:tinyPotatoPet.desc=타이니 포테이토를 만들어보세요! -achievement.botania:sparkCraft=Live Drive achievement.botania:sparkCraft.desc=스파크를 만들어서 마나를 운송해 보자! -achievement.botania:baubleWear=Inner Arts achievement.botania:baubleWear.desc=버블즈 악세사리를 장착해보세요! achievement.botania:manaCookieEat=썩은 외도와 초콜릿 achievement.botania:manaCookieEat.desc=맛난 마나 쿠키를 만들어서 먹어보자 -achievement.botania:runePickup=Lilium Doll achievement.botania:runePickup.desc=신비로운 제단으로 룬을 만들어보세요! -achievement.botania:manaBlasterShoot=M'aider Stranded Girl achievement.botania:manaBlasterShoot.desc=마나블래스터를 만들어 볼까요? achievement.botania:tiaraWings=하트 슈터 achievement.botania:tiaraWings.desc=플뤼겔의 왕관을 만든 후 장착 achievement.botania:terrasteelPickup=어둠 속에의 댄서 achievement.botania:terrasteelPickup.desc=테라스틸 집적 판을 통해서 테라스틸을 만들어 보세요 -achievement.botania:elfPortalOpen=World Calling achievement.botania:elfPortalOpen.desc=알브헤임의 포탈을 열어보세요! achievement.botania:gaiaGuardianKill=데드 앤드 시크 achievement.botania:gaiaGuardianKill.desc=대지의 의식을 시행해 대지의 수호자를 소환한 후 처치하세요 -achievement.botania:terrasteelWeaponCraft=Remote Paranoia achievement.botania:terrasteelWeaponCraft.desc=테라스틸로 무기를 만들어보세요 achievement.botania:kekimurusPickup=방과후 스트라이드 achievement.botania:kekimurusPickup.desc=케키리마스를 만들어 마나를 대량생산 해보세요! -achievement.botania:heiseiDreamPickup=Heisei Cataclysm achievement.botania:heiseiDreamPickup.desc=길몽초를 만들어 몬스터에게 혼란을 가져다주세요! achievement.botania:dirtRodCraft=록벨 -achievement.botania:dirtRodCraft.desc=Craft a dirty sti- er... Rod of the Lands achievement.botania:spawnerMoverUse=(검열삭제)를 벗을 수 있는 걸 -achievement.botania:spawnerMoverUse.desc=Use a Life Aggregator to transport a Monster Spawner -achievement.botania:enderAirMake=Imitation Air achievement.botania:enderAirMake.desc=엔더의 공기를 병에 넣어보세요 -achievement.botania:corporeaCraft=Drop Pop Candy achievement.botania:corporeaCraft.desc=Corporea Network 블럭을 만들고 사용해보세요 achievement.botania:signalFlareStun=See the Lights -achievement.botania:signalFlareStun.desc=Stun 100 or more mobs at once with a Signal Flare achievement.botania:l20ShardUse=어.긋.나.간.다 -achievement.botania:l20ShardUse.desc=Raise the ground up to the sky with a Power XX Shard of Laputa achievement.botania:gaiaGuardianNoArmor=종말 -achievement.botania:gaiaGuardianNoArmor.desc=Slay a Gaia Guardian without wearing any armor at any point during the fight -achievement.botania:rankSSPick=Talent Shredder achievement.botania:rankSSPick.desc=대지파괴를 SS랭크로 업시켜보세요! -achievement.botania:superCorporeaRequest=Invader Girl achievement.botania:superCorporeaRequest.desc=50,000개 이상의 아이템을을 Corporea Network에서 불러보세요 -achievement.botania:pinkinator=Decorator achievement.botania:pinkinator.desc=핑키네이터를 사용해보세요! achievement.botania:infiniteFruit=이노센티아 achievement.botania:infiniteFruit.desc=영웅적인 위업을 달성해서 금단의 과실을 획득해보세요 -achievement.botania:kingKey=A Fake, Fake Psychotropic achievement.botania:kingKey.desc=영웅적인 위업을 달성해서 왕의 열쇠을 획득해보세요 -achievement.botania:flugelEye=Angel of Death achievement.botania:flugelEye.desc=영웅적인 위업을 달성해서 플뤼겔의 눈을 획득해보세요 achievement.botania:thorRing=원스텝·레이어드 achievement.botania:thorRing.desc=영웅적인 위업을 달성해서 토르의 반지를 획득해보세요 achievement.botania:odinRing=로스트 타임 메모리 achievement.botania:odinRing.desc=영웅적인 위업을 달성해서 오딘의 반지를 획득해보세요 -achievement.botania:lokiRing=Arithmetic achievement.botania:lokiRing.desc=영웅적인 위업을 달성해서 로키의 반지를 획득해보세요 achievement.botania:aesirRing=신이 내린 뜻대로 achievement.botania:aesirRing.desc=아사의 반지를 얻어보세요. @@ -501,44 +432,25 @@ botania.challengelevel.lunatic=마조히스트 botania.challenge.flowerFarm=꽃 농장 botania.challenge.flowerFarm.desc=자동으로 16가지 색상의 신비로운 꽃을 생산하는 농장을 만들어 보세요! 분류까지 한다면 보너스 포인트! botania.challenge.recordFarm=레코드 농장 -botania.challenge.recordFarm.desc=Create a system that produces records through the death of creepers at the hand of skeletons. Bonus points if it doesn't require a player's presence. botania.challenge.reedFarm=사탕수수 농장 botania.challenge.reedFarm.desc=자동으로 사탕수수 농장을 만들어보세요! 피스톤을 사용하지 않았다면 보너스 포인트! botania.challenge.cobbleGen=조약돌 생성기 botania.challenge.cobbleGen.desc=자동으로 조약돌을 생성한뒤 캐주세요. 조약돌을 화로에 굽는 것 까지 완성한다면 보너스 포인트! botania.challenge.pureDaisy=정화의 데이지 자동화 -botania.challenge.pureDaisy.desc=Completely automate the Pure Daisy. Bonus points if only one spreader is used and/or if the wood/stone input is also automated. botania.challenge.battery=마나배터리 -botania.challenge.battery.desc=Create a Mana Battery, a system where mana enters one pool and comes out of another, with a good amount of pools as a buffer. Bonus points if the input or output can be changed. botania.challenge.apothecaryRefill=연금술 ㅈ동화 -botania.challenge.apothecaryRefill.desc=Create a system that automatically refills the 꽃잎 Apothecary if it's empty. Bonus points if the system can also automatically create flowers, given the components. botania.challenge.treeFarm=나무농장 -botania.challenge.treeFarm.desc=Create an automated, self-sustaining tree farm. Bonus points if it can do multiple types of tree. botania.challenge.fullCropFarm=완벽한 농장 -botania.challenge.fullCropFarm.desc=Create a crop farm with all types of crops (wheat, carrot, potato, melon, pumpkin, cocoa and nether wart) that runs at full efficiency. Bonus points if the outputs are sorted. botania.challenge.animalFarm=동물농장 -botania.challenge.animalFarm.desc=Create an automated animal farm with all farmable animal types. Bonus points if the food doesn't need to be put in manually. botania.challenge.boneMealFarm=비료농장 -botania.challenge.boneMealFarm.desc=Create an automated farm that utilizes bone meal to quickly grow crops on demand. Bonus points if the Drum of the Wild isn't used. botania.challenge.orechid=광물난초 자동화 -botania.challenge.orechid.desc=Create a system that allows for the Orechid flower to be fully automated. Bonus points if the output is smelted and sorted. botania.challenge.mobTower=몹타워 -botania.challenge.mobTower.desc=Create a tower style mob farm. Mobs must be sorted and put into specific chambers at the end. Spawners can be used. Bonus points if the farm functions at 100% efficiency without a player's interaction. -botania.challenge.entropinnyumSetup=Entropinnyum Setup -botania.challenge.entropinnyumSetup.desc=Create a system that automatically crafts TNT and safely feeds it to an Entropinnyum flower, creating mana. Bonus points if the sand and gunpowder required for the TNT don't need to be put in manually. -botania.challenge.spectrolusSetup=Spectrolus Setup -botania.challenge.spectrolusSetup.desc=Create a system that feeds a Spectrolus, generating mana. Aside from raw mana, no items may be input from outside the system. Bonus points if it operates at 100% efficiency, never wasting any wool. botania.challenge.potionBrewer=교배 자동화 -botania.challenge.potionBrewer.desc=Create a system that can make all types of brews automatically on demand. Bonus points if it keeps a set of incense always ignited in the player's base. -botania.challenge.kekimurusSetup=Kekimurus Setup -botania.challenge.kekimurusSetup.desc=Fully automate a Kekimurus, every part of the system must be automated and self-sustaining. Bonus points if only one crafty crate is used. botania.challenge.autoQuarry=채굴 자동화 -botania.challenge.autoQuarry.desc=Create a mining quarry that digs for ores and stone underground. It should dig out chunks of land and output all of the mined resources, sorting them. Bonus points if it can relocate automatically after it's done with an area. botania.challenge.runeCrafter=룬 제작기 -botania.challenge.runeCrafter.desc=Create a system that can craft all runes on demand or keep them stocked. Every part of this system must be automated and self-sustaining, including the item inputs. Bonus points if only one Runic Altar block is used. You must be pretty crazy to try this one. # BLOCK NAMES tile.botania:flower0.name=신비로운 하얀색 꽃 @@ -713,16 +625,6 @@ tile.botania:dreamwood0Slab.name=꿈의나무 반블럭 tile.botania:dreamwood1Stairs.name=꿈의나무 목재 계단 tile.botania:dreamwood1Slab.name=꿈의나무 목재 반블럭 tile.botania:conjurationCatalyst.name=마법 촉매 -tile.botania:prismarine0.name=프리스마린 -tile.botania:prismarine1.name=프리스마린 벽돌 -tile.botania:prismarine2.name=검은 프리스마린 -tile.botania:prismarine0Stairs.name=프리스마린 계단 -tile.botania:prismarine0Slab.name=프리스마린 반블럭 -tile.botania:prismarine1Stairs.name=프리스마린 벽돌 계단 -tile.botania:prismarine1Slab.name=프리스마린 벽돌 반블럭 -tile.botania:prismarine2Stairs.name=검은 프리스마린 계단 -tile.botania:prismarine2Slab.name=검은 프리스마린 벽돌 -tile.botania:seaLamp.name=바다 등 tile.botania:miniIsland0.name=부유 하얀색 꽃 tile.botania:miniIsland1.name=부유 주황색 꽃 tile.botania:miniIsland2.name=부유 자홍색 꽃 @@ -741,12 +643,6 @@ tile.botania:miniIsland14.name=부유 빨간색 꽃 tile.botania:miniIsland15.name=부유 검은색 꽃 tile.botania:tinyPotato.name=타이니 포테이토 tile.botania:spawnerClaw.name=생명 침투 -tile.botania:reedBlock.name=수수 블럭 -tile.botania:reedBlock0Stairs.name=수수 계단 -tile.botania:reedBlock0Slab.name=수수 반블럭 -tile.botania:thatch.name=짚 -tile.botania:thatch0Stairs.name=짚 계단 -tile.botania:thatch0Slab.name=짚 반블럭 tile.botania:customBrick0.name=지옥 벽돌 tile.botania:customBrick1.name=영혼 벽돌 tile.botania:customBrick2.name=서리 벽돌 @@ -884,8 +780,6 @@ tile.botania:petalBlock12.name=갈색 꽃잎 블럭 tile.botania:petalBlock13.name=초록색 꽃잎 블럭 tile.botania:petalBlock14.name=빨강색 꽃잎 블럭 tile.botania:petalBlock15.name=검은색 꽃잎 블럭 -tile.botania:corporeaIndex.name=Corporea Index -tile.botania:corporeaFunnel.name=Corporea Funnel tile.botania:endStoneBrick0.name=엔더 석재벽돌 tile.botania:endStoneBrick1.name=조각된 엔더 석재벽돌 tile.botania:endStoneBrick2.name=엔더 벽돌 @@ -943,40 +837,11 @@ tile.botania:doubleFlower212.name=신비로운 갈색 꽃 tile.botania:doubleFlower213.name=신비로운 초록색 꽃 tile.botania:doubleFlower214.name=신비로운 빨강색 꽃 tile.botania:doubleFlower215.name=신비로운 검은색 꽃 -tile.botania:stone0.name=안산암 -tile.botania:stone1.name=현무암 -tile.botania:stone2.name=섬록암 -tile.botania:stone3.name=화강암 -tile.botania:stone4.name=세련된 안산암 -tile.botania:stone5.name=세련된 현무암 -tile.botania:stone6.name=세련된 섬록암 -tile.botania:stone7.name=세련된 화강암 -tile.botania:stone8.name=안산암 벽돌 -tile.botania:stone9.name=현무암 벽돌 -tile.botania:stone10.name=섬록암 벽돌 -tile.botania:stone11.name=화강암 벽돌 tile.botania:stone12.name=조각된 안산암 벽돌 tile.botania:stone13.name=조각된 현무암 벽돌 tile.botania:stone14.name=조각된 섬록암 벽돌 tile.botania:stone15.name=조각된 화강암 벽돌 -tile.botania:stone0Stairs.name=안산암 계단 -tile.botania:stone1Stairs.name=현무암 계단 -tile.botania:stone2Stairs.name=섬록암 계단 -tile.botania:stone3Stairs.name=화강암 계단 -tile.botania:stone8Stairs.name=안산암 벽돌 계단 -tile.botania:stone9Stairs.name=현무암 벽돌 계단 -tile.botania:stone10Stairs.name=섬록암 벽돌 계단 -tile.botania:stone11Stairs.name=화강암 벽돌 계단 -tile.botania:stone0Slab.name=안산암 반블럭 -tile.botania:stone1Slab.name=현무암 반블럭 -tile.botania:stone2Slab.name=섬록암 반블럭 -tile.botania:stone3Slab.name=화강암 반블럭 -tile.botania:stone8Slab.name=안산암 벽돌 반블럭 -tile.botania:stone9Slab.name=현무암 벽돌 반블럭 -tile.botania:stone10Slab.name=섬록암 벽돌 반블럭 -tile.botania:stone11Slab.name=화강암 벽돌 반블럭 tile.botania:blazeBlock.name=블레이즈 램프 -tile.botania:corporeaInterceptor.name=Corporea Interceptor tile.botania:corporeaCrystalCube.name=Corporea 크리스탈 큐브 tile.botania:incensePlate.name=향 받침대 tile.botania:hourglass.name=유영 모래시계 @@ -991,8 +856,6 @@ tile.botania:lightLauncher.name=루미나이저 런처 tile.botania:livingrock0Wall.name=생명의 나무 벽 tile.botania:livingwood0Wall.name=생명의 돌 벽 tile.botania:dreamwood0Wall.name=꿈의나무 벽 -tile.botania:prismarine0Wall.name=프리스마린 벽 -tile.botania:reedBlock0Wall.name=수수블럭 벽 tile.botania:biomeStoneA0Wall0.name=변성산악 조약돌 벽 tile.botania:biomeStoneA0Wall1.name=변성평원 조약돌 벽 tile.botania:biomeStoneA0Wall2.name=변성산악 조약돌 벽 @@ -1001,10 +864,6 @@ tile.botania:biomeStoneA0Wall4.name=변성습지 조약돌 벽 tile.botania:biomeStoneA0Wall5.name=변성황야 조약돌 벽 tile.botania:biomeStoneA0Wall6.name=변성침엽수림 조약돌 벽 tile.botania:biomeStoneA0Wall7.name=변성메사 조약돌 벽 -tile.botania:stone0Wall0.name=안산암 벽 -tile.botania:stone0Wall1.name=현무암 벽 -tile.botania:stone0Wall2.name=섬록암 벽 -tile.botania:stone0Wall3.name=화강암 벽 tile.botania:manaBomb.name=마나폭탄 tile.botania:buriedPetals0=묻혀있는 하얀색 꽃잎 tile.botania:buriedPetals0.name=묻혀있는 하얀색 꽃잎 @@ -1063,7 +922,6 @@ tile.botania:flower.gourmaryllis.reference=후유카이 데스(*역자 : 일본 tile.botania:flower.narslimmus.name=나아슬리머스 tile.botania:flower.narslimmus.reference=뭐야!? 모든게 끈적거리잖아! tile.botania:flower.spectrolus.name=스펙트럴러스 -tile.botania:flower.spectrolus.reference=Profiting off Hate # - FUNCTIONAL tile.botania:flower.bellethorn.name=미인가시꽃 @@ -1114,10 +972,7 @@ tile.botania:flower.daffomill.name=풍차꽃 tile.botania:flower.daffomill.reference=요리사의 조수 tile.botania:flower.vinculotus.name=이동간섭꽃 tile.botania:flower.vinculotus.reference=엑스트라유틸리티를 위한 모드 -tile.botania:flower.spectranthemum.name=Spectranthemum -tile.botania:flower.spectranthemum.reference=In the shell tile.botania:flower.medumone.name=속박의 꽃 -tile.botania:flower.medumone.reference='Twas Hades all along tile.botania:flower.marimorphosis.name=변성초 tile.botania:flower.marimorphosis.reference=믿고 쓰는 변성초 tile.botania:flower.marimorphosisChibi.name=작은 변성초 @@ -1126,7 +981,6 @@ tile.botania:flower.bubbell.name=습기제거초 tile.botania:flower.bubbell.reference=휘파람(BGM. 뇌내혁명걸) tile.botania:flower.bubbellChibi.name=작은 습기제거초 tile.botania:flower.bubbellChibi.reference=휘파람(BGM. 뇌내혁명걸) -tile.botania:flower.solegnolia.name=Solegnolia tile.botania:flower.solegnolia.reference=자석은 이걸로 만들어진다카더라 아님 말고ㅋ # ITEM NAMES @@ -1441,7 +1295,7 @@ item.botania:terraAxe.name=대지 절단 item.botania:manasteelNugget.name=마나합금 조각 item.botania:terrasteelNugget.name=테라스틸 조각 item.botania:elementiumNugget.name=엘레멘티움 조각 -item.botania:root.name=생명의 뿌리 +item.botania:livingRoot.name=생명의 뿌리 item.botania:pebble.name=옥석 item.botania:waterBowl.name=물이 담긴 그릇 item.botania:obedienceStick.name=꽃의 순종막대 @@ -1493,10 +1347,6 @@ botania.potion.clear=면죄 botania.gui.lexicon.header=보타니아 사전, %s 번째 제본판 목차 - 배우길 원하는 카테고리를 클릭하세요. : botania.gui.lexicon.wip=(이 부분은 작성중입니다. 내용이 완전하지 않을수도 있습니다.) -# MUSIC DISCS -item.record.botania:gaia1.desc=Kain Vinosec - Endure Emptiness -item.record.botania:gaia2.desc=Kain Vinosec - Fight For Quiescence - # BANNER NAMES item.banner.botania_flower.black=검은색 신비로운 꽃 item.banner.botania_flower.red=빨간색 신비로운 꽃 @@ -1770,15 +1620,6 @@ botania.category.misc=기타 # - BASIC # -- WELCOME TO BOTANIA botania.entry.welcome=보타니아를 시작하신 것을 진심으로 환영합니다. -botania.page.welcome0=&oWhat is peace? Is it truly just a lack of combat? Is it years of sitting quietly in a garden, surrounded by flowers? Is it watching over a kingdom that you are able to call your own? Is it the completion of almost every task known to man? Is it the ability to watch numbers of resources steadily rise as you watch your collection grow? -botania.page.welcome1=&oIs peace something that can be obtained easily, without work - or is it something difficult to obtain?
    Let's say for a moment - not even a second - that peace is truly just a lack of work; peaceful days surrounded by flowers. -botania.page.welcome2=&oYears spent watching time tick by while you watch your flora perform every single task imaginable, without outside help from polluting machines or computers tangled in cables and pipes.
    Now imagine that everything we just talked about was possible. -botania.page.welcome3=&oImagine that through your hard labor - your cultivation of flowers, your manipulation of mana, your knowledge of the mechanisms of the world and redstone - you could obtain that dreamlike state. Imagine that you could have everything you could ever desire automated with flora. Flora, some magic, and your own ingenuity. -botania.page.welcome4=&oWith the help of this book, your dreams will become a reality.
    The name of this book is deceptive. Despite being called the Lexica 보타니아, this tome focuses on far more than just flowers. It focuses on a variety of devices, both magical and bordering on technological. -botania.page.welcome5=&oIt holds the secrets of the elves, who have long ago fled from this world, as well as possible clues to the origins of the very world itself. For anyone with a basic knowledge of redstone and the creativity to put it to use, this book offers answers to nearly every problem known to man, without the need to use foreign schools of magic or machinery. -botania.page.welcome6=&oThis book contains instructions on how to perform nearly every task that one could ever need, with only the use of what's in it, and available in the world of Minecraft, assuming you're up to the task of putting them together in ingenious ways.
    Try it out, you'll be amazed at what you can do without outside interference. -botania.page.welcome7=&oThe school of botany does not solely apply to those with a knack for complex thought processes.
    Introduction to the art is simple, and the rewards are vast. A wide range of magical accessories and instruments allow for empowering of one who decides to study the various options therein. -botania.page.welcome8=&oDear reader, I welcome you to the realm of 보타니아.&r
    - Written by &nGideon Seymour&r, guest writer. (Adapted for use) botania.entry.tutorial=기본 사용 지침서 botania.page.tutorial0=&4본 모드는 덕질패러디가 넘쳐납니다.&0
    아래의 버튼을 통해서 "가이드 투어"가 가능합니다 :D
    처음 시작하시는 분이라면 아래의 버튼을 한번 눌러보세요!(내용이 100%번역된 항목은 ABCD순서가 나뉘어져 있습니다.) @@ -1787,22 +1628,6 @@ botania.page.tutorial0=&4본 모드는 덕질패러디가 넘쳐납니다.&0
    botania.entry.introVideo=소개 동영상 botania.page.introVideo0=보타니아의 기본적인 내용을 영상으로 보여줍니다.(영문) -# -- GARDEN OF GLASS -botania.entry.gardenOfGlass=Garden of Glass -botania.page.gardenOfGlass0=In the &2Garden of Glass&0 nobody can hear you scream.
    You're alone in space.
    How exciting. -botania.page.gardenOfGlass1=The &2Garden of Glass&0 is a skyblock mode for 보타니아. It's advised only for players who are somewhat experienced in the mod, but if you're new to it, you're more than welcome to try it out anyway.
    Most of the mod functions the same, but some tweaks have been put in place to allow for the skyblock style game. They'll be listed in the following pages. -botania.page.gardenOfGlass2=botania.page.gardenOfGlass2=After spawning in the &1Garden of Glass&0 you'll find &1Living Roots&0 below the landing area. These can be used to create &1Saplings&0 and &1Floral Fertilizer&0. They also work as &1Bone Meal&0. Shift-right clicking a &1Dirt&0 or &1Grass&0 block with an empty hand will have you rummage through the soil, finding some &1Pebbles&0, that can be converted into &1Cobblestone&0. Filling a &1Petal Apothecary&0 can be done with a &1Bowl&0 by clicking on a water block. -botania.page.gardenOfGlass3=Creating &1Saplings&0 -botania.page.gardenOfGlass4=Creating &1Floral Fertilizer&0 -botania.page.gardenOfGlass5=Creating &1Cobblestone&0 -botania.page.gardenOfGlass6=Aside from that, some things in 보타니아 are different to fit the Skyblock play: The &1Orechid&0 is easier to make, faster and much cheaper; &1Mana Spreaders&0 don't need gold; the &1Blaze Lamp&0, which can be used to create &1Obsidian&0, uses powder instead of rods; melon or pumpkin seeds may drop from tall grass; floral fertilizer creates more per craft, and &1Sugar Canes&0 and &1Slimeballs&0 can be crafted. -botania.page.gardenOfGlass7=Creating &1Sugar Canes&0 -botania.page.gardenOfGlass8=Creating &1Slimeballs&0 -botania.page.gardenOfGlass9=It's possible to infuse a &1Pumpkin&0 with the fel spirits of monster slain, creating a &1Fel Pumpkin&0. This can be placed atop two &1Iron Bars&0, in a similar fashion to a &1Snow Golem&0, to spawn a &1Blaze&0.
    &1Blazes&0 spawned with this method drop &1Blaze Powder&0 instead of &1Blaze Rods&0. -botania.page.gardenOfGlass10=Nerfing warlocks again -botania.page.gardenOfGlass11=Aside from providing light, the &1Mana Flash&0 present in the starting area allows a player who has lost their &1Lexica 보타니아&0 to exchange a &1Sapling&0 for it, by right clicking with the &1Sapling&0 on the &1Mana Flame&0.
    This can only be done if the player doesn't have a &1Lexica 보타니아&0 on them. -botania.page.gardenOfGlass12=Lastly, an &1End Portal&0 recipe - # -- LEXICA BOTANIA botania.entry.lexicon=보타니아 사전 botania.page.lexicon0=&1보타니아 사전&0은 모든 지식의 저장고입니다. 보타니아를 제외한 다른 모드들 까지 말이죠!
    사전을 열어 보타니아에 관련된 지식을 얻을 수 있고 심지어 사전을 들고 해당하는 아이템에 커서를 맞춘 후 쉬프트-우클릭하면 위키가 열립니다! @@ -1832,7 +1657,6 @@ botania.page.apothecary1=&1꽃잎 연금술기&0 botania.page.apothecary2=꽃잎 연금술기를 월드에 설치하고 약간의 물을 제공한다면 (&1물 양동이 1개&0 분량) 모든 종류의 &1신비로운 꽃잎&0을 연금술기에 던지면 그들의 에너지를 방출하면서 수용할 것입니다.
    올바른 &1신비로운 꽃잎&0이 들어가고 나면, &1씨앗&0 하나를 던져 완성할 수 있습니다.
    꽉찬 양동이를 뿌리는 것 또한 약제기를 물로 채웁니다. botania.page.apothecary3=대부분의 식물들은 이러한 방법으로 제조할 수 있습니다, 자세한 정보를 원한다면 이 사전에서 &1기능성 식물&0 그리고 &0생산성 식물&1란을 읽도록 하세요.
    쉬프트-우클릭으로 연금술기에 넣은 아이템을 다시 수거할 수 있습니다. botania.page.apothecary4=연금술기에는 &1물&0 대신에 &1용암&0을 둘수 있는데, 용암을 두게 되면 접촉하는 모든 아이템을 파괴하는 소각로 역할을 합니다.(마치 선인장 처럼 말이죠).
    마지막으로, 덩굴을 설치하는 것으로 이끼가 낀 듯한 시각 효과를 만들어 냅니다. -botania.page.apothecary6=A simple tip for those who want to squeeze the biggest efficiency out of every block is as follows, up to twenty seconds after crafting a flower in this block, right clicking it with an empty hand will pull the items from the inventory required for the recipe and put them into it for quick mass crafting. This only works if it has water. botania.page.apothecary5=&1꽃잎 연금술기 제작&0. # -- PURE DAISY @@ -1852,13 +1676,6 @@ botania.page.wand3=꽃잎들은 지팡이의 색깔을 결정하는데에 사용 # -- RUNIC ALTAR botania.entry.runeAltar=신비로운 제단 -botania.page.runeAltar21=Runic creation is a rather important complex in the advancement of the botanical magics. First and foremost, though, this type of crafting requires a decent knowledge of &4Mana Manipulation&0. Before proceeding further, a read through the important entries (those in &oItalics&r) on that section of the &1Lexica 보타니아&0 might prove enlightening. -botania.page.runeAltar0=&1Runes&0 are extremely important components of complex magical devices or flora.
    In order to create these, one would require a &1Runic Altar&0.
    To utilize this &1Runic Altar&0, start by placing, via either a right click or simply tossing, the components to the rune you want to create. -botania.page.runeAltar1=Proceed by linking a &1Mana Spreader&0 to the altar, and right click it with a &1Wand of the Forest&0.
    It should be apparent when the altar has received enough &4Mana&0. When that happens, just drop a piece of &1Livingrock&0 on top of it and use the wand on it again to collect your rune. -botania.page.runeAltar2=Crafting the &1Runic Altar&0. -botania.page.runeAltar3=A total of 16 &1Runes&0 exist.
    The most basic and elementary runes are named after the &4Four Elements&0. The intermediate runes are named after the &4Four Seasons&0, and the most advanced runes are named after the &4Seven Deadly Sins&0. A separate &1Rune of Mana&0 also exists. -botania.page.runeAltar20=Sneaking and right-clicking the &1Runic Altar&0 with an empty hand while it's not accepting mana will remove the last item put into it.
    Last but not least, attaching a &1Comparator&0 to it will emit signal strength &41&0 if the altar is accepting &4Mana&0 and signal strength &42&0 if it's ready to craft the rune. -botania.page.runeAltar21=Similarly to the &1Petal Apothecary&0, right clicking this block with an empty hand after a recipe is complete will place back the items used for the last recipe for faster mass crafting. botania.page.runeAltar4=&1물의 룬&0 제작하기 botania.page.runeAltar5=&1대지의 룬&0 제작하기 botania.page.runeAltar6=&1대기의 룬&0 제작하기 @@ -1874,1456 +1691,4 @@ botania.page.runeAltar15=&1탐욕의 룬&0 제작하기 botania.page.runeAltar16=&1게으름의 룬&0 제작하기 botania.page.runeAltar17=&1격노의 룬&0 제작하기 botania.page.runeAltar18=&1질투의 룬&0 제작하기 -botania.page.runeAltar19=&1교만의 룬&0 제작하기 - -# -- TERRASTEEL -botania.entry.terrasteel=Terrasteel -botania.page.terrasteel0=&1Terrasteel&0 is a complex magical alloy, infused with a great amount of &4Mana&0. Conjuring it proves not to be a small task. For starters, to create it, one would require a &1Terrestrial Agglomeration Plate&0, set on top of a checkerboard pattern of &1Lapis Lazuli Blocks&0 and &1Livingrock&0. &4Mana&0 would need to be provided to this block, &1Sparks&0 would be the most effective way. -botania.page.terrasteel1=Creating the plate -botania.page.terrasteel2=After the plate is set up and ready to receive &4Mana&0, tossing a single &1Manasteel Ingot, Mana Diamond and Mana Pearl&0 on top of it will begin the infusion.
    Picking up any of the items will halt the infusion causing severe &4Mana Loss&0. The infusion uses half a &1Mana Pool&0 total to create a single piece of &4Terrasteel&0, multiple &1Sparks&0 would make it go faster, too. -botania.page.terrasteel3=Creating &1Terrasteel&0 (there's &1Livingrock&0 under the plate) -botania.page.terrasteel4=T.A. Plate - -# -- BLACK LOTUS -botania.entry.blackLotus=Black Lotus -botania.page.blackLotus0=An elusive flower by the name of &1검은색 Lotus&0 is known to exist, however, it does not grow or reproduce. Where they can be found or come from is not known.
    It is known, however, that it contains a strong amount of concentrated &4Mana&0, that can be released by putting it in contact with a &1Mana Pool&0 that already has some in it. Just tossing it would do. - -# -- FLOWER POUCH -botania.entry.flowerBag=Flower Pouch -botania.page.flowerBag0=The laws of physics regarding one's &4Inventory&0 are somewhat skewed in this world. Thanks to that, carrying an array of different colors of flowers turns out to be a major hassle. Luckily, a &1Flower Pouch&0 takes care of all those issues. It can store up to one stack of each color of &1신비로운 꽃&0, not only that but it'll passively catch any that enter the holder's inventory. -botania.page.flowerBag2=Items won't be added automatically to the pouch if that's the item being held.
    Furthermore, shift-right clicking the pouch into a &1Chest&0 or other inventory will store the flowers it contains into said inventory. -botania.page.flowerBag1=Pull a copter out of it (any colors work) - -# -- WRAP -botania.entry.wrap=Wrap -botania.page.wrap0=It seems like the creator of this mod decided to add a weird game mechanic in the form of &1Wrap&0. I don't really know what it does, probably something bad. :/
    What's this "Fourth 벽" you're talking about...? - -# - MANA -# -- AN INTRODUCTION TO MANA -botania.entry.mIntro=An Introduction to Mana -botania.page.mIntro0=&4Mana&0 is an ethereal substance. In layman's terms, it is a form of &4mystical energy&0. Its sensorial existence is inconstant, and its color depends on the environment its put in.
    Mastering &4Mana&0 is one of the most important skills a botanist needs to master. -botania.page.mIntro1=In order to create &4Mana&0, one would require a set of &4Generating Flowers&0 (read the respective section). This &4Mana&0 can be dispersed by utilizing &1Mana Spreaders&0 and stored in &1Mana Pools&0. &4Mana&0 can be used for a myriad of different things. For starters, it can be used for &4Functional Flowers&0 (read the respective section). -botania.page.mIntro2=To get started with mastering the art of &4Mana&0, one would start by learning how to use &1Dayblooms&0, &1Mana Spreaders&0 and &1Mana Pools&0.
    These form a basic infrastructure for mana, which can be used for all sorts of purposes. Have a read at the &4Functional Flora&0 and &4Magical Apparatus&0 sections of this 사전. - -# -- MANA SPREADER -botania.entry.spreader=Mana Spreader -botania.page.spreader0=The &1Mana Spreader&0 is the most important component in manipulating &4Mana&0.
    This is the block that allows &4Mana&0 to travel from point A to point B. When this block is placed on the ground, it'll face one of 6 basic directions. By holding shift-right on it with a &1Wand of the Forest&0, one can orient it to the opposite of where it was clicked. It can be pointed to other blocks with a wand in &4Bind Mode&0. -botania.page.spreader1=Holding a &1Wand of the Forest&0 -botania.page.spreader2=The &1Mana Spreader&0 has a small internal buffer of &4Mana&0, which will get filled by nearby &4Generating Flowers&0. This buffer can be viewed by looking at the &1Spreader&0 with a &1Wand of the Forest&0, as demonstrated in the last page.
    Note that the block needs to be right clicked with a wand to get accurate and adequate values. -botania.page.spreader3=Holding a &1Wand of the Forest&0 displays a beam which shows where the spreader is pointing at. Hovering over it shows the target. The sparkle that's always shown is the point when &4Mana loss&0 starts to happen.
    If the target of the spreader is a block that can contain &4Mana&0, and isn't full, the spreader will fire a &4Mana Burst&0, which will travel to the target, and pass the &4Mana&0 along to it. -botania.page.spreader4=The spreader only fires one burst at once, it'll only fire another one when the last one hits the target.
    Furthermore, the bursts also start suffering &4mana loss&0 after a small amount of time. This can be seen in the beam, which becomes a lot thinner when this happens. There is also a small amount of &4mana loss&0 when a beam enters a spreader. -botania.page.spreader11=Applying a &4빨간색stone Signal&0 to the spreader will have it cease to function. Case better control is required, a &1빨간색stone Mana Spreader&0 is recommended, as it can fire bursts without a target block and works on redstone pulses. -botania.page.spreader5=Crafting the &1Mana Spreader&0 -botania.page.spreader10=Right clicking the spreader with a piece of &1Wool&0 will sleeve it. Aside from making it look fancier, it'll also muffle the sound when a burst is shot, making it much less obnoxious when there's a large amount of spreaders in one area.
    Right clicking with an empty hand will remove the sleeve. - -# -- MANA POOL -botania.entry.pool=Mana Pool -botania.page.pool0=The &1Mana Pool&0 is, simply put, a storage of &4Mana&0.
    Mana can be inserted into it by usage of a &1Mana Spreader&0, and any adjacent &1Mana Spreaders&0 will pull mana from it to increase their internal buffer automatically.
    Any &4Functional Flowers&0 require a nearby &1Mana Pool&0 to draw power from. -botania.page.pool9=&1Mana Pools&0 come in two varieties, a weaker, &1Diluted&0 variety which only stores a very small amount of &4Mana&0 and isn't able to infuse items, and a &1Normal&0 variety, which can store as much as a hundred times more than the dilluted one and can infuse items.
    Whenever "Mana Pool" is refered elsewhere for scale, it refers to a normal one. -botania.page.pool1=Making a &1Dilluted Mana Pool&0. -botania.page.pool10=Infusing a normal &1Mana Pool&0 -botania.page.pool2=Tossing in some resources into a normal &1Mana Pool&0 will cause them to get infused with &4Mana&0, turning them into more powerful forms.
    A few examples are &1Iron Ingots&0 or &1Mystical Petals&0.
    &4Mana&0 reading for this block functions like the &1Mana Spreader&0. A &1빨간색stone Comparator&0 can also output a signal based on the contents. -botania.page.pool8=&1Manasteel&0 Ingots and other ingots based on it, can be converted into both blocks or nuggets through the normal conversion recipes.
    For the artistic types, tossing any color of &1Floral Powder&0 in the pool will have it take its color, all sixteen colors are viable for decoration and/or easy labelling. -botania.page.pool3=Infusing &1Manasteel&0 -botania.page.pool4=Infusing &1Mana Pearls&0 -botania.page.pool5=Infusing &1Mana Diamonds&0 -botania.page.pool6=Infusing &1Mana Petals&0 -botania.page.pool11=Infusing &1Managlass&0, clear seamless glass. -botania.page.pool12=Infusing &1String&0 -botania.page.pool13=Used &1Mana Infused String&0 to make &1Cobwebs&0 -botania.page.pool7=Infusing &1Mana Cookies&0, pretty good food. - -# -- SPARKS -botania.entry.sparks=Sparks -botania.page.sparks0=&1Sparks&0 are interesting entities. Created from a combination of raw energy and &4Mana&0, they have the ability to be placed on top of a few specific &4Mana&0 containing or accepting blocks, mainly, &1Mana Pools&0.
    Some blocks have the ability to harness &4Mana&0 from &1Sparks&0, but the uses for them seem limited to a few blocks right now. -botania.page.sparks1=Placing a &1Spark&0 on top of a &1Mana Pool&0 and another on top of a block that can accept it will allow for the latter to remotely access the reservoirs of the &1Mana Pool&0 when needed, given it's not too far away.
    To remove a &1Spark&0 simply shift-right click it with a &1Wand of the Forest&0. Regular right clicking shows which other &1Sparks&0 it can transfer to. -botania.page.sparks2=&oholds up spork&r - -# -- SPARK AUGMENTATION -botania.entry.sparkUpgrades=Spark Augmentation -botania.page.sparkUpgrades0=As it seems, &1Sparks&0 are a bit more versatile than it was known previously. A variety of &1Augments&0 can be applied to them to enhance their abilities. It's to note that Augments can only be applied to &1Sparks&0 that lie on &1Mana Pools&0.
    A &1Spark&0 can only have a single &1Augment&0 at any given time. -botania.page.sparkUpgrades1=Starting off, the &1Dispersive Augment&0 has the &1Spark&0 use up the &4Mana&0 in the pool below, to charge any nearby players' &4Mana&0 containing items. -botania.page.sparkUpgrades2=The &1Dominant Augment&0 will have the &1Spark&0 pull any &4Mana&0 from nearby non-augmented &1Sparks'&0 pools into its own, until it's completely full. -botania.page.sparkUpgrades3=The &1Recessive Augment&0 will have the &1Spark&0 output all of the &4Mana&0 in its pool into any nearby non-augmented or Dispersive &1Sparks'&0 pools until it's completely empty. -botania.page.sparkUpgrades4=Lastly, the &1Isolated Augment&0 will prevent the &1Spark&0 from interacting with any Dominant or Recessive &1Sparks&0, but still allow it to interact with blocks that can receive their &4Mana&0 through the &1Spark&0 network. -botania.page.sparkUpgrades5=Crafting the Augments - -# -- MANA DISTRIBUTOR -botania.entry.distributor=Mana Distributor -botania.page.distributor0=Any botanist will eventually reach a point where a single &1Mana Pool&0 setup is not enough.
    The &1Mana Distributor&0 will fix all those issues. By placing it adjacently to a few &1Mana Pools&0 on its sides, when it receives &4Mana&0 through &4Mana Bursts&0 it'll equally spread it to the adjacent pools. -botania.page.distributor1=Crafting the distributor - -# -- MANA VOID -botania.entry.manaVoid=Mana Void -botania.page.manaVoid0=The &1Mana Void&0 is, in layman's terms, the grave for &4Mana&0. Any &4Mana&0 shot into this block will simply vanish into the void, never to be seen again.
    Placing one of these under a &1Mana Pool&0 allows the pool to always accept &4Mana&0, but disposing any it can't hold. -botania.page.manaVoid1=Even Chad from accounting? - -# -- MANA FLUXFIELD -botania.entry.rfGenerator=Mana Fluxfield -botania.page.rfGenerator0=By passing &4Mana&0 through a field of redstone energy, its state can change from a natural energy source to &4빨간색stone Flux&0.
    Simply pointing a spreader at this block will have it shoot at it, converting the &4Mana&0 that lands on it into &4RF&0. It can then be pulled out with any &4RF&0 transporter. -botania.page.rfGenerator1=The bullet guys. I bit it. - -# -- MANA LENSES -botania.entry.lens=Mana Lenses -botania.page.lens0=In order to upgrade the potential a &1Mana Spreader&0, one can apply &1Mana Lenses&0. The very basic mana lens does absolutely nothing.
    Lenses can be &4dyed&0, in a workbench, all the 16 colors of the spectrum, or combined with a &1Mana Pearl&0 to create a &1Rainbow Lens&0. These will change the color of the burst. -botania.page.lens1=The basic lens, it doesn't do anything. -botania.page.lens2=&4Dyeing&0 lenses! -botania.page.lens3=&1Rainbow Lens&0 all the way -botania.page.lens4=But lenses are not only for fancy colors. One can upgrade them with all sorts of materials to create new lens which can do all sorts of effects on the &4Mana Bursts&0.
    It's to take in mind that, if using a normal &1Mana Spreader&0, there needs to be a &4Mana&0 receiving block at the end for the burst to fire. A &1빨간색stone Mana Spreader&0 is recommended for some lenses. -botania.page.lens5=Sometimes, though, having a single &1Mana Lens&0 in a spreader just isn't enough sometimes. By combining two lenses with a &1Slimeball&0 in a crafting table, it's possible to unite them into one, and keep the effects of both.
    The first lens used determines the visuals (texture and color). It's to note that some combinations will not work, nor will two lenses of the same type. -botania.page.lens6=The &1Velocity Lens&0 will drastically increase the speed at which a &4Mana Burst&0 travels, but not only does the beam start to lose its &4Mana&0 a lot faster, it can also carry a bit less. -botania.page.lens7=Velocity Lens -botania.page.lens8=The &1Potency Lens&0 will double the amount of &4Mana&0 a &4Mana Burst&0 can carry, however, the beam becomes slower and after it starts to lose mana it does so at a lot faster rate. -botania.page.lens9=Potency Lens -botania.page.lens10=The &1Resistance Lens&0 will significantly increase the amount of time the &4Mana Burst&0 can go without starting to lose &4Mana&0, but it makes it a a bit slower. -botania.page.lens11=Resistance Lens -botania.page.lens12=The &1Efficiency Lens&0 will decrease the amount of time it takes for the &4Mana Burst&0 to start losing its &4Mana&0, but when that happens, it does so at a lot slower rate. -botania.page.lens13=Efficiency Lens -botania.page.lens14=The &1Bounce Lens&0 will allow the &4Mana Burst&0 to bounce off walls, rather than dissipating on a collision. -botania.page.lens15=Bounce Lens -botania.page.lens16=The &1Gravity Lens&0 makes the &4Mana Burst&0 be attracted by the world's gravitational pull, thus moving in an arc. As compensation, it also slightly increases the time before &4Mana&0 loss starts to happen. -botania.page.lens17=Gravity Lens -botania.page.lens18=The &1Bore Lens&0 charges the &4Mana Burst&0 with the ability to break any blocks it comes into contact with, draining its own mana to do so. -botania.page.lens19=Bore Lens -botania.page.lens20=The &1Damaging Lens&0 charges the &4Mana Burst&0 with the power to damage any living beings it comes across, draining its own mana to do so. -botania.page.lens21=Damaging Lens -botania.page.lens22=The &1Phantom Lens&0 is an interesting one. By utilizing the &1Abstruse Platform&0 and its' properties, it's possible to make a lens that'll allow the &4Mana Burst&0 to pass through blocks. In doing so, the time it can stay without losing mana is decreased. -botania.page.lens23=Phantom Lens -botania.page.lens24=The &1Magnetizing Lens&0, as its name states, allows the &4Mana Burst&0 to magnetize, or home in, on any nearby blocks that can receive &4Mana&0. Doing so slightly decreases the speed of the burst. -botania.page.lens25=Magnetizing Lens -botania.page.lens26=The &1Entropic Lens&0 imbues the &4Mana Burst&0 with entropy, causing it to release its energy in the form of an explosion when it collides against something that can't receive &4Mana&0. -botania.page.lens27=Entropic Lens -botania.page.lens28=The &1Influence Lens&0 allows the &4Mana Burst&0 to have influence over any nearby &4dropped items&0, &4experience orbs&0 and even &4falling blocks&0, having them move in the exact same vector of motion as the burst itself. -botania.page.lens29=Influence Lens -botania.page.lens30=The &1Weight Lens&0 carries a strong burden on the &4Mana Burst&0, making any block hit by it, if there doesn't happen to be a block below it, fall, similarly to how &1Sand&0 and &1Gravel&0 do. -botania.page.lens31=Weight Lens -botania.page.lens32=The &1Kindle Lens&0 is infused with a burning spark, when it hits a block it'll set it on fire. It has the ability to both ignite and close &1Nether Portals&0. It doesn't seem to set any living beings on fire, though. -botania.page.lens33=Kindle Lens -botania.page.lens34=The &1Force Lens&0 acts as a &1Piston&0, when it hits a block that a piston can move, it'll do just so. -botania.page.lens35=Force Lens -botania.page.lens36=The &1Flash Lens&0, in contact with a block, creates a flame of the same color as the burst that caused it. The flame provides light and is purely decorative.
    If it hits one of these flames, it puts it out instead. -botania.page.lens37=Flash Lens - -# -- MANA TABLET -botania.entry.manaTablet=Mana Tablet -botania.page.manaTablet0=While using &1Mana Spreaders&0 to transport &4Mana&0 around is all well and good, there is also a way of doing it in a different manner.
    The &1Mana Tablet&0 is a portable object which can carry &4Mana&0 on itself.
    Not only that, but other items can also pull from it as they need it for their uses, making this an essential tool. -botania.page.manaTablet1=Tossing one of these on top of a &1Mana Pool&0 will allow for transport of &4Mana&0 between one and another.
    Shift-right clicking the &1Mana Pool&0 with a &1Wand of the Forest&0 will change in which way the &4Mana&0 flows.
    Lastly, unlike normal items, these will never despawn when dropped on the floor. -botania.page.manaTablet2=Don't put it on your pocket, it might bend - -# -- MANA MIRROR -botania.entry.manaMirror=Mana Mirror -botania.page.manaMirror0=A &1Mana Mirror&0 is an alternative to &4Mana&0 containing items such as a &1Mana Tablet&0. It can be bound to a &1Mana Pool&0 in the world and items will pull out of the pool itself when needing &4Mana&0.
    To bind a mirror to a pool, one would simply &4shift right-click&0 a pool with the mirror. The mirror can't put mana in or take mana out of pools in any other way. -botania.page.manaMirror1=Mirror mirror on the wall... - -# -- MANA DETECTOR -botania.entry.manaDetector=Mana Detector -botania.page.manaDetector0=A device like the &1Mana Detector&0 is capable to detect when a &4Mana Burst&0 starts flowing through it (the burst doesn't dissipate on collision with this block) and provide a redstone signal when that is the case. -botania.page.manaDetector1=Crafting the detector - -# -- REDSTONE MANA SPREADER -botania.entry.redstoneSpreader=빨간색stone Mana Spreader -botania.page.redstoneSpreader0=By combining a &1Mana Spreader&0 with a piece of &1빨간색stone&0, it's possible to create a &1빨간색stone Mana Spreader&0, which fires only when given a &4빨간색stone signal&0, regardless of having a block in the end to put the mana or not.
    It's to keep in note that this doesn't let the spreader shoot a burst until the last one dissipates or is absorbed. -botania.page.redstoneSpreader1=Just add redstone - -# -- MANASTAR -botania.entry.manastar=Manastar -botania.page.manastar0=The imprecise measurements of the &1Wand of the Forest&0 sometimes won't cut it for telling if you're turning a profit or loss in your &1Mana Pools&0.
    Creating a &1Manastar&0 and placing it next to your pools will have it shine red if there's a loss or blue if there's a profit. The measurement happens every few seconds. -botania.page.manastar1=&rI'm a shooting star leaping through the skies&r. - -# -- ELVEN MANA SPREADERS -botania.entry.dreamwoodSpreader=Elven Mana Spreaders -botania.page.dreamwoodSpreader0=Simply put, &1Dreamwood&0 conducts &4Mana&0 better than &1Livingwood&0. Add in some adjustments like &1Elementium&0 or &1Mana Petals&0 and what you get is a &1Mana Spreader&0 that can conduct more &4Mana&0, faster and for more time without &4Mana loss&0.
    On the negative side, it can't be turned into a &1빨간색stone Mana Spreader&0. -botania.page.dreamwoodSpreader1=Better spreaders, that's it -botania.page.dreamwoodSpreader2=By combining this already powerful spreader with a &1Gaia Spirit&0 and a &1Dragonstone&0 gem, one can create an even more potent variant. The &1Gaia Spreader&0 is within the top percentage of Mana Spreaders, with pretty much upgrades all round.
    It's to note that these spreaders fire a larger payload at once and thus, might fire less often. -botania.page.dreamwoodSpreader3=ULTRA_SPREADER - -# -- PAINTSLINGER LENS -botania.entry.paintLens=Paintslinger Lens -botania.page.paintLens0=The &4Elves&0 are one crafty bunch. This lens is somewhat unique in comparison to the other lenses. The &1Paintslinger Lens&0 needs to be dyed one of the 16 colors of the spectrum to function. When it hits a colorable block (&1Wool, Stained Clay or Glass&0...) it'll turn any blocks connected, of the same type and color, into the color of the &4Mana Burst&0 itself. It seems to work with &4Sheep&0 too. -botania.page.paintLens1=A M'AIDER Stranded Girl - -# -- WARP LENS -botania.entry.warpLens=Warp Lens -botania.page.warpLens0=The &1Mana Lens: Warp&0 is an interesting one. A &4Mana Burst&0 with its effect, when colliding with a &1Force Relay&0 will teleport to the end position of said &1Force Relay&0, maintaining its momentum. Furthermore, when it's used as a composite material to a &1Bore Lens&0 (the &1Bore Lens&0 must be visible) it'll make the lens not break &1Force Relays&0 or &1Pistons&0, as well as teleport any blocks to the spot where the burst was fired. -botania.page.warpLens1=Hakase Quarries - -# -- MANA PRISM -botania.entry.prism=Mana Prism -botania.page.prism0=The concept of &1Mana Lens&0 allows for the manipulation of the power convyed through &4Mana Bursts&0, the &1Mana Prism&0 works on that technology to allow a burst to have its lens effect switched on the fly.
    Using a &1Spectral Platform&0 as a component, this block does not have a physical presence, entities and bursts can go through it as if it doesn't exist. -botania.page.prism1=Right clicking it with any variety of &1Mana Lens&0 sets the lens in the prism. Whenever a &4Mana Burst&0 goes through the prism, its color and effect will be set to that of the lens in the prism. Case the lens is not dyed, the burst will turn white.
    Using any of the four basic lenses also increases the time the burst can go before losing &4Mana&0, allowing it to go further. -botania.page.prism2=It can also be turned off by the use of a redstone signal. -botania.page.prism3=Another pixel in the wall - -# -- MANA ON RAILS -botania.entry.poolCart=Mana on Rails -botania.page.poolCart0=What could be an easier way to transport &4Mana&0 over large distances than attaching a &1Mana Pool&0 to a &1Minecart&0 and watch it do the merry-go-round? It's simple. Similarly to other types of carts, one can create a &1Minecart with Mana Pool&0 that can store and transport &4Mana&0 on rails.
    Breaking the cart while there's any &4Mana&0 in it will waste the &4Mana&0, care should be taken with it. -botania.page.poolCart1=Transfering &4Mana&0 between the cart and a pool is done with a &1Mana Pump&0. It can face any of the four cardinal directions and will transfer &4Mana&0 between a pool adjacent to it and a cart with a pool on an rail opposite to the target pool.
    The transfer rate is extremely fast due to the mechanical nature, so fast that overflow is possible, causing &4Mana Loss&0. -botania.page.poolCart2=The side of the pump where the &4Mana&0 will go towards is the pink one, &4Mana&0 is pulled from the blue side.
    The pump can be turned off with redstone, and a &1Comparator&0 on it will output how much &4Mana&0 exists in the cart.
    Lastly, a pool on a cart serves purely for transport, and can not receive, send, transfer or infuse any items with its &4Mana&0. -botania.page.poolCart3=I like trains -botania.page.poolCart4=This is not a pipe - -# -- SPARK TINKERER -botania.entry.sparkChanger=Spark Tinkerer -botania.page.sparkChanger0=The &1Spark Tinkerer&0 is a block with the ability to modify the &1Augments&0 placed on &1Sparks&0. Placing it adjacent to &1Mana Pools&0 or other blocks with a &1Spark&0 attached will connect it to those blocks.
    Right clicking the &1Spark Tinkerer&0 with a &1Spark Augment&0 will put the augment in the block, it can be removed by right clicking again. -botania.page.sparkChanger1=When the &1Spark Tinkerer&0 gets a redstone signal it'll randomly pick a &1Spark&0, between all of those it's connected to that have a different augment from the one stored in it, and swap the augment in that &1Spark&0 with the one stored in the block.
    The stored augment can be withdrawn or deposited with &1Hoppers&0 or other automation methods. -botania.page.sparkChanger2=Hahahaha, water fire... - -# -- MANATIDE BELLOWS -botania.entry.bellows=Manatide Bellows -botania.page.bellows0=&1Manatide Bellows&0 are a simple device with the purpose of increasing the speed &1Mana Pools&0 output transfer rate.
    Placing these bellows next to, and pointing towards, a &1Mana Pool&0 will increase the speed at which the pool outputs its &4Mana&0 into &1Mana Tablets&0 or other items. Multiple bellows will work at increasing further the transfer rate. -botania.page.bellows1=A slightly less interesting ability of the &1Manatide Bellows&0 is to stoke a &1Furnace&0's flames.
    &1Manatide Bellows&0 can be utilized manually via a right click. Pointing the bellows towards an active &1Furnace&0 and manning them will increase the speed and efficiency at which the items in the &1Furnace&0 get smelted. -botania.page.bellows2=It is your duty to be stoked - -# - FUNCTIONAL FLOWERS -# -- AN INTRODUCTION TO FUNCTION -botania.entry.fIntro=An Introduction to Function -botania.page.fIntro0=There are various places in which the &4Mana&0 a botanist generates can be put to use, one of them is an assortment of &4Functional Flowers&0.
    These flowers will drain &4Mana&0 from a nearby &1Mana Pool&0 into themselves, in order to do whatever task they were created for.
    It's to note that these can't receive power directly through &1Mana Spreaders&0. -botania.page.fIntro1=All &4Functional Flowers&0, alike the &4Generating Flowers&0 contain a small buffer of &4Mana&0.
    Standard rules for &4Mana&0 reading apply, right clicking with a &1Wand of the Forest&0 will update the mana readings. -botania.page.fIntro2=It is important to keep in mind that these flowers memorize the &1Mana Pool&0 from which they should pull &4Mana&0 out of. They'll only pull from the nearest pool present at the time of the flower being placed (or the closest placed afterward, if none was present), and none other. It can be bound to another pool with a wand in &4Bind Mode&0. -botania.page.fIntro3=Lastly, some functional flowers utilize a &1빨간색stone Root&0 in their creation. If they do, the flower's effect can be toggled with a redstone signal. -botania.page.fIntro4=&1빨간색stone Root&0 for 빨간색stone Control - -# -- FLOWER SHRINKING -botania.entry.flowerShrinking=Flower Shrinking -botania.page.flowerShrinking0=Some functional flowers have a bit too much reach. Sometimes one might not want that to be the case. Tossing one of those few flowers into a &1Mana Pool&0 with an &1Alchemy Catalyst&0 will, at the cost of some &4Mana&0, shrink it, making its radius smaller. Every other function remains the same. -botania.page.flowerShrinking1=Like a nendoroid - -# -- JADED AMARANTHUS -botania.entry.jadedAmaranthus=Jaded Amaranthus -botania.page.jadedAmaranthus0=Everyone likes flowers right? The &1Jaded Amaranthus&0 is made just for that purpose.
    Feeding it with &4Mana&0 from &1Mana Pools&0 will have it quickly grow new &1신비로운 꽃s&0 around it, in any spots it can. -botania.page.jadedAmaranthus1=&oIt was this or clematis.&r -botania.page.jadedAmaranthus2=&oWait a minute, did you just summon a bunch of flowers in one turn?
    Yeah, so?
    That's against the rules, isn't it?
    Screw the rules, I have Mana! - -# -- BELLETHRONE -botania.entry.bellethorne=Bellethorne -botania.page.bellethorne0=The &1Bellethorne&0 is a malevelous flower. By utilizing &4Mana&0 it slowly inflicts harm in any living beings (save for &4players&0) around it. -botania.page.bellethorne1=&oEvery rose has its thorn&r. - -# -- DREADTHORNE -botania.entry.dreadthorne=Dreadthorne -botania.page.dreadthorne0=The &1Dreadthorne&0 is a slightly more specific counterpart to the &1Bellethrorne&0, by which, instead of all mobs around, it'll only hurt &4adult&0 animals and none else. -botania.page.dreadthorne1=&oNo Mr.Bond, I expect you to die&r. - -# -- HEISEI DREAM -botania.entry.heiseiDream=Heisei Dream -botania.page.heiseiDream0=The &1Heisei Dream&0 will, by utilizing &4Mana&0, awaken feelings of anger and revenge in any nearby &4mobs&0, turning them against eachother. -botania.page.heiseiDream1=&oA pleasant era will murder people&r. -botania.page.heiseiDream2=&oHeisei, was broken, broken. Who was the one who lied about peace? See, it's forgotten, forgotten, even the punishement blamed on the altar. Hey, it's breaking, breaking, at the end, even the meaning of shaking is killed.
    Well, where shall we go? Let's go somewhere, whose ally are you? Whose replacement am I? - -# -- TIGERSEYE -botania.entry.tigerseye=Tigerseye -botania.page.tigerseye0=It's a known fact that &4Creepers&0 are terrified of &4cats&0.
    The &1Tigerseye&0 exploits that very weakness, by emitting a feline aura, petrifying any nearby &4Creepers&0, preventing them from exploding. It also has the effect of making them run away from &4players&0. -botania.page.tigerseye1=&oRisin' up to the challenge of our rivals&r. - -# -- ORECHID -botania.entry.orechid=Orechid -botania.page.orechid0=While going mining is all good, a renewable, sedentary, means of getting ore is due. The &1Orechid&0 will use (a massive amount of) &4Mana&0 to generate &4ores&0 in nearby &1Stone&0 blocks.
    The ores it generates are random, but seem to be biased towards more common ores rather than rarer ones. -botania.page.orechid1=&oNot dragon poop&r. - -# -- ORECHID IGNEM -botania.entry.orechidIgnem=Orechid Ignem -botania.page.orechidIgnem0=The &1Orechid&0 is a great flower. The ability to create raw ores with &4Mana&0 can be a great boon to any sedentary botanist's life. It, however, can't create ores from the &4Nether&0. Getting that sorted out is easy, by switching the petals a bit, it'll create &4Nether&0 ores in &1Netherrack&0 instead. The flower must be in the &4Nether&0 to work. -botania.page.orechidIgnem1=&oGetting hot in here&r. - -# -- FALLEN KANADE -botania.entry.fallenKanade=Fallen Kanade -botania.page.fallenKanade0=The &1Fallen Kanade&0 is a flower with angelic properties, it'll use &4Mana&0 from nearby &4Mana Pools&0 in order to apply a regeneration effect to any &4players&0 nearby. -botania.page.fallenKanade0a=The &1Fallen Kanade&0 is a flower with angelic properties, it'll use &4Mana&0 from nearby &4Mana Pools&0 in order to apply a regeneration effect to any &4players&0 nearby.
    Interestingly enough, &4Blood Mages&0 have been known to place odd hexes on their altars which cause this flower to malfunction, that might be something to keep in mind. -botania.page.fallenKanade1=&oHand Sonic, version four&r. -botania.page.fallenKanade2=&oI'll marry you. No matter what kind of sickness you have, even if you can't walk or stand, or even if you can't have kids, I'll still marry you. No matter where or how I met you, I'll fall in love with you.
    If I can meet you again, against the six billion to one odds, and even if your body can't move, I'll marry you. - -# -- EXOFLAME -botania.entry.exoflame=Exoflame -botania.page.exoflame0=Unlike its generating counterpart, the &1Exoflame&0 utilizes &4Mana&0 with means to generate heat.
    Any &1Furnaces&0 nearby to the &1Exoflame&0 will be fueled, and given a speed boost, for the cost of some &4Mana&0. -botania.page.exoflame1=&oBut we should be going nowhere fast&r. - -# -- AGRICARNATION -botania.entry.agricarnation=Agricarnation -botania.page.agricarnation0=The slow growth of crops is always a problem to feed the masses. The &1Agricarnation&0 is a flower that turns &4Mana&0 into a type of natural fertilizer, causing nearby plantlife to grow at a faster rate. -botania.page.agricarnation1=&oGrandola Vila Morena&r... - -# -- HOPPERHOCK -botania.entry.hopperhock=Hopperhock -botania.page.hopperhock0=The &1Hopperhock&0 will pick up items around it. Giving it &4Mana&0 is optional, but it'll increase its range.
    Items picked up will be put in adjacent inventories (e.g. &1Chests&0). Placing &1Item Frames&0 on any of the inventories will specify which items can or can't go in them. -botania.page.hopperhock1=Any inventory which has no &1Item Frame&0 adjacent to it can accept any items, but labelled inventories will take priority.
    The rule using to sort items can be changed by shift-right clicking the flower with a &1Wand of the Forest&0. -botania.page.hopperhock2=&oI guess I'll be talking my loli and leaving&r. - -# -- TANGLEBERRIE -botania.entry.tangleberrie=Tangleberrie -botania.page.tangleberrie0=The &1Tangleberrie&0 is a flower that, at the cost of a small amount of &4Mana&0, will keep any nearby animals or monsters within a circle ward, preventing them from getting out. -botania.page.tangleberrie1=&oTangled, brave and frozen&r. - -# -- JIYUULIA -botania.entry.jiyuulia=Jiyuulia -botania.page.jiyuulia0=The &1Jiyuulia&0 is a flower that, at the cost of a small amount of &4Mana&0, will keep any nearby animals or monsters at bay, protecting a circular area from them getting in. -botania.page.jiyuulia1=&oHR HD DT Masterpiece&r. - -# -- RANNUNCARPUS -botania.entry.rannuncarpus=Rannuncarpus -botania.page.rannuncarpus0=Quite a handy flower indeed, the &1Rannuncarpus&0 will pick up any nearby blocks in dropped item form and place them in the world nearby. It, however, only places the blocks thrown at it on top of a specific block, to specify this block, place it right below the soil the flower is resting on. -botania.page.rannuncarpus1=Block items, such as &1Sugar Cane&0 will also work, but, much alike any other blocks, will only be placed in a location where they normally would be able to be placed.
    Lastly, giving &4Mana&0 to the flower is optional, but it increases its range. -botania.page.rannuncarpus2=&oThe Sandpit of Yanille&r? - -# -- HYACIDUS -botania.entry.hyacidus=Hyacidus -botania.page.hyacidus0=For some reason, poison does not kill. The &1Hyacidus&0, to that, can be used to poison any nearby mobs, bringing them to their knees for a one hit kill after a bit. -botania.page.hyacidus1=&oSteel is immune&r. - -# -- POLLIDISIAC -botania.entry.pollidisiac=Pollidisiac -botania.page.pollidisiac0=Animals love eating, that's all they seem to do, really. An interesting behaviour they show is that they only seem to want to eat things that are fed to them.
    The &1Pollidisiac&0 will simply do that, at the cost of some mana, any appropriate nearby food items (&1Wheat&0, &1Carrots&0, etc) will be fed to the animals, putting them in a &obetter mood&r. -botania.page.pollidisiac1=&oHell's Kitchen&r. - -# -- CLAYCONIA -botania.entry.clayconia=Clayconia -botania.page.clayconia0=The &1Clayconia&0 is a simple flower, in essence. All it does is moisten nearby &1Sand&0, turning it into &1Clay&0, this process uses a decent amount of &4Mana&0, but nothing too insane. -botania.page.clayconia1=&oWhat a killer joke&r. - -# -- LOONIUM -botania.entry.loonium=Loonium -botania.page.loonium0=Any weary adventurer knows that &4Dungeons&0 can hold valuable goodies. The &1Loonium&0 can, at the use of an extreme amount of &4Mana&0, materialize these items and drop them in the nearby vicinity. -botania.page.loonium1=&oTank Tank Heal Tank&r! - -# -- DAFFOMILL -botania.entry.daffomill=Daffomill -botania.page.daffomill0=The &1Daffomill&0 works as a fan of sorts. It pushes, at the cost of a small amount of &4Mana&0, any items found in front of it.
    Shift-right clicking it with a &1Wand of the Forest&0 changes the orientation. Where it's currently facing can be seen via the subtle wind particles it emits. -botania.page.daffomill1=&oWind Turbines? I'm a big fan&r. - -# -- VINCULOTUS -botania.entry.vinculotus=Vinculotus -botania.page.vinculotus0=The &1Vinculotus&0 has the power to create a disturbance among any &4Enderman&0's teleportation powers within a fairly large radius around it. For a cost of &4Mana&0, whenever an &4Enderman&0 would teleport anywhere, instead, they're teleported to the location of the &1Vinculotus&0. -botania.page.vinculotus1=&oTouch this black lotus with your fingers&r. - -# -- SPECTRANTHEMUM -botania.entry.spectranthemum=Spectranthemum -botania.page.spectranthemum0=Transporting items a long distance can be an arduous task. Water channels and &1Daffomills&0 won't cut it forever. The &1Spectranthemum&0, at the cost of &4Mana&0 wraps the fabric of reality of any dropped items that do not contain &4Mana&0 around it, teleporting them somewhere else in the world. After teleported once, another of these flowers can't be used on the same item. -botania.page.spectranthemum1=In order to specify where the items go, one would use a &1Wand of the Forest&0 in bind mode and bind the flower to a block somewhere, similarly to binding it to a pool. This only works within 12 blocks. In order to view what block the flower is bound to rather than the pool it's pulling &4Mana&0, one would sneak while looking at it with a wand. -botania.page.spectranthemum2=This flower is governed by the &4axiom of chunkloading&0, by which it'll not function on chunks not loaded. This topic is not addressed in full extent this lexicon.
    &oRecommended Reading: "Chunks and Chicken", "Anchors of the World". -botania.page.spectranthemum3=&o(n)spooky(n2)me&r. - -# -- MEDUMONE -botania.entry.medumone=Medumone -botania.page.medumone0=The &1Medumone&0 is a flower with the ability to completely halt a creature's movement.
    While it receives &4Mana&0, it'll halt any nearby entities in their tracks with a powerful slowness effect, provided they are not players. -botania.page.medumone1=&oThose credits look fake&r... - -# -- MARIMORPHOSIS -botania.entry.marimorphosis=Marimorphosis -botania.page.marimorphosis0=The &1Marimorphosis&0 is a flower that executes metamorphic transformations on nearby &1Stone&0 blocks. These blocks get metamorphised into one of 8 different types of &1Metamorphic Stone&0. All 8 types will generate, but the type(s) that generate more often depend on the biome. All of these can be used to make bricks, chiseled bricks, slabs, stairs and even &1Petal Apothecary&0 variants. -botania.page.marimorphosis1=The various flavours of &1Metamorphic Stone&0 -botania.page.marimorphosis3=Colorful like a ClariS song -botania.page.marimorphosis2=&oThis flower is pretty gneiss&r. - -# -- BUBBELL -botania.entry.bubbell=Bubbell -botania.page.bubbell0=Building underwater is a no small task. Clearing air under the sea is incredibly troublesome and time consuming. Placing down a &1Bubbell&0 underwater and providing it with &4Mana&0 (preferably a priori) will have it start to create a dome of air which will keep water at bay. The dome has about twelve blocks of radius. &4Mana&0 is required constantly to keep it up and going. -botania.page.bubbell1=&oLike some casual game&r. - -# -- SOLEGNOLIA -botania.entry.solegnolia=Solegnolia -botania.page.solegnolia0=The &1Ring of Magnetization&0 is a rather handy tool for anyone digging or collecting. It does, however, fall into the problem that it picks up unwanted items near complex systems.
    The &1Solegnolia&0 disrupts the ring and prevents any items around it from being pulled towards a wearer of one. It uses up a small bit of &4Mana&0 for this, but nothing considerate. -botania.page.solegnolia1=On/Off - -# - GENERATING FLOWERS -# -- AN INTRODUCTION TO GENERATION -botania.entry.gIntro=An Introduction to Generation -botania.page.gIntro0=&4Generating Mana&0 should be at the top of the priorities for any botanist. Luckily there's an array of &4Generating Flowers&0 willing to do the job.
    These flowers, as their name shows, generate &4Mana&0, both passively and actively. Unless stated otherwise, all &4Generating Flowers&0 generate &4Mana&0 passively under certain circumstances. -botania.page.gIntro1=All &4Generating Flowers&0, alike the &4Functional Flowers&0 contain a small buffer of &4Mana&0.
    Standard rules for &4Mana&0 reading apply, right clicking with a &1Wand of the Forest&0 will update the mana readings.
    This mana will be stored in the closest &1Mana Spreader&0 around. -botania.page.gIntro2=It is important to keep in mind that these flowers memorize the &1Mana Spreader&0 into which they should put &4Mana&0 into. They'll only store into the nearest spreader present at the time of the flower being placed (or the closest placed afterward, if none was present), and none other. It can be bound to another spreader with a wand in &4Bind Mode&0. - -# -- DAYBLOOM -botania.entry.daybloom=Daybloom -botania.page.daybloom0=The &1Daybloom&0 is the most basic and rudimentary &4Generating Flower&0. Simply put, it performs a modified photosynthesis process, in order to transform sunlight into &4Mana&0.
    The process is rather slow, about ten or a dozen of these should get the job done, for now. -botania.page.daybloom1=These flowers tend to compete among themselves for what sunlight hits an area, thus having any other of the same type adjacent to it on any of the four cardinal directions will result in diminishing returns of &4Mana&0 production. This fact only applies to &1Dayblooms&0 and &1Nightshades&0. They also don't produce much to begin with, so perhaps hastily upgrading to &1Endoflames&0 or others might be a good idea. -botania.page.daybloom1a=Having any other &1Dayblooms&0 adjacent to it on any of the four cardinal directions will result in diminishing returns of &4Mana&0 production. This only applies to &1Dayblooms&0 and &1Nightshades&0.
    &1Dayblooms&0 are not very resistant, and after some time they'll wither and die off. They also don't produce much to begin with, so perhaps hastily upgrading to &1Endoflames&0 or others might be a good idea. -botania.page.daybloom3=Diminishing Returns -botania.page.daybloom2=&oStarting up a brand new day&r. -botania.page.daybloom4=&oHow many of you people out there been hurt in some kind of love affair? And how many times do you swear that you'll never love again? How many lonely, sleepless nights? How many lies? How many fights? And why would you want to put yourself through all that again? "Love is pain," I hear you say. Love has a cruel and bitter way of paying you back for all the faith you ever had in your brain. (...) -botania.page.daybloom5=&oHow could it be that what you need the most can leave you feeling just like a ghost? You never want to feel so sad and lost again. One day you could be looking through an old book in rainy weather. You see a picture of her smiling at you when you were still together. You could be walking down the street and who should you chance to meet. But that same old smile that you've been thinking of all day... - -# -- NIGHTSHADE -botania.entry.nightshade=Nightshade -botania.page.nightshade0=The &1Nightshade&0 is the dark counterpart of the &1Daybloom&0, as it generates &4Mana&0 passively in any situation the &1Daybloom&0 can not, as long as it's nighttime
    Similarly to their shining counterpart, they suffer diminishing returns from having any adjacent. -botania.page.nightshade0a=The &1Nightshade&0 is the dark counterpart of the &1Daybloom&0, as it generates &4Mana&0 passively in any situation the &1Daybloom&0 can not, as long as it's nighttime.
    Alike its shining counterpart, they suffer diminishing returns from having any adjacent and are not very resistant, after some time they'll wither and die off. -botania.page.nightshade1=&oThe shadow of the day&r. - -# -- ENDOFLAME -botania.entry.endoflame=Endoflame -botania.page.endoflame0=While the &1Daybloom&0 is all well and good, a botanist requires more effective means of generating &4Mana&0.
    The &1Endoflame&0 does that exactly, it will absorb any combustible items or blocks dropped on the nearby vicinity (albeit only one at a time) and burn through them to passively generate mana while the fuel lasts. -botania.page.endoflame1=There is a small caveat though, the &1Endoflame&0 will not burn anything that returns a byproduct, an example are &1Lava Buckets&0, that have empty &1Buckets&0 as a byproduct.
    Due to their behaviour, an &1Open Crate&0, which you read about on the &4Magical Apparatus&0 section, might be a good step on getting it to be self-sustainable. -botania.page.endoflame2=&oNot nitor&r. - -# -- HYDROANGEAS -botania.entry.hydroangeas=Hydroangeas -botania.page.hydroangeas0=While passive &4Mana&0 generation can be easily achieved through &1Dayblooms&0, different means of doing so might come in handy. The &1Hydroangeas&0 will suck up any &1Still Water&0 in a 3x3 area around it, on the same height, creating &4Mana&0 from it. They also seem to function faster during &4Rain&0, who'd have thought? -botania.page.hydroangeas0a=The &1Hydroangeas&0 will suck up any &1Still Water&0 in a 3x3 area around it, on the same height, creating &4Mana&0 from it. They also seem to function faster during &4Rain&0, who'd have thought?
    Similarly to the &1Daybloom&0, these flowers are not very resistant, and after some time they'll wither and die off. -botania.page.hydroangeas2=A simple &1Hydroangeas&0 system -botania.page.hydroangeas3=These flowers, similarly to &1Dayblooms&0 or &1Nightshades&0 will receive a portion of diminishing returns if put in too compact of a pattern. Having any two &1Hydroangeas&0 one block away from eachother, including diagonals, will drastically reduce the production rate of both, as the roots get tangled. Having even more in the short space will further weaken their potency. The blue particles between them indicate this. -botania.page.hydroangeas1=&oFrom some Hyperdimension&r? - -# -- THERMALILY -botania.entry.thermalily=Thermalily -botania.page.thermalily0=There comes a point where slow generating power, like the &1Hydroangeas&0 or the &1Endoflame&0 is not enough. An answer to that is the &1Thermalily&0, which works similarly to the &1Hydroangeas&0, except with &1Lava&0, it'll produce a very large amount of &1Mana&0 at a spurt when it consumes &1Lava&0, doing this heats up the flower, and it'll need some time to cool down before it can begin the cycle anew. -botania.page.thermalily1=&o0108 Style&r. - -# -- ROSA ARCANA -botania.entry.arcanerose=Rosa Arcana -botania.page.arcanerose0=&4Experience Points&0 are a form of magic of sorts. The &1Rosa Arcana&0 can tap into it and absorb the experience of players on the ground around it, turning it into &1Mana&0. -botania.page.arcanerose1=&oWhen this card is Summoned, toss a coin&r. - -# -- MUNCHDEW -botania.entry.munchdew=Munchdew -botania.page.munchdew0=Generating the form of natural energy that is &4Mana&0 should be a pretty good process when done via other living materials. By using the &1Munchdew&0, any &1Leaves&0 near the flower will get munched up and converted into &4Mana&0.
    It's to note that, though, no saplings or any other items will be dropped from the leaves. -botania.page.munchdew1=This flower outputs a hefty amount of mana per tree eaten.
    However, after if finishes eating all the available leaves, when left without any, it'll take a break from doing so and will only be able to eat again after a bit over a minute. -botania.page.munchdew2=&oYou pay for dinner, Shibazaki&r. - -# -- ENTROPINNYUM -botania.entry.entropinnyum=Entropinnyum -botania.page.entropinnyum0=In order to generate a blast of &4Mana&0, one might in fact, require a blast nearby. Igniting a block of &1TNT&0 in the near an &1Entropinnyum&0, if it doesn't fall in water, will have the latter absorb all the entropy generated by the blast into itself, creating a large amount of &4Mana&0 and nullifying any possible damage. Lastly, to absorb the explosion, the flower must not have any &4Mana&0 stored in it or the process will fail. -botania.page.entropinnyum1=&oCool guys don't look at explosions&r. - -# -- KEKIMURUS -botania.entry.kekimurus=Kekimurus -botania.page.kekimurus0=&1Cake&0 is delicious, everyone loves it, flowers included.
    The &1Kekimurus&0 is one of these &1Cake&0 aficionados, and will eat any it spots nearby, using its enriching nutrients to create &4Mana&0. -botania.page.kekimurus1=&otop kek&r - -# -- GOURMARYLLIS -botania.entry.gourmaryllis=Gourmaryllis -botania.page.gourmaryllis0=The &1Gourmaryllis&0 is one hungry flower. It'll eat up any food in a small area around it, and turn it into &4Mana&0.
    There's a catch, though, it can only digest a single food at any given time, the &4Mana&0 is created when it's done. Any other food it finds, it'll also devour, but not create any mana from it. -botania.page.gourmaryllis1=The amount of time it takes to digest a delicacy depends on its nutritional value, in layman's terms, the amount of food points it restores.
    So, a &1Steak&0 will take four seconds to digest, a &1Carrot&0 will take two, a loaf of &1Bread&0 will take two and a half, so on. -botania.page.gourmaryllis2=The amount of &4Mana&0 created also makes use of this value, but in a way where the more nutritious the food is, the more efficient it is. For example, a single &1Steak&0 will produce more &1Mana&0 than two &1Carrots&0, both absolutely and per second. -botania.page.gourmaryllis3=&oA hot pot for our new residents&r. -botania.page.gourmaryllis4=&oWell, if Men ate themselves after death, one would think of less horror and negative feeling matter. But so you know what your cruelty leads to, think, fishes, that even Men eat themselves alive like you.
    Alive was Job when he said: "Why do you follow me so inhumanely, thou who are eating me alive and getting sick of my flesh?". Do you want to see a Job like this? (...) -botania.page.gourmaryllis5=&oSee a man of those who are followed by claims or accused of crimes, and behold all who are eating them. The bailiff eats him, the jailer eats him, the scribe eats him, the requestor eats him, the lawyer eats him, the inquirer eats him, the witness eats him, the judge eats him and he's not even sentenced he's already eaten. Worse are the Men than the crows. (...) -botania.page.gourmaryllis6=&oThe sad one who was hanged, only eat him the crows past his execution and death, while the one who's being judged, not even executed or sentenced and he's already eaten.
    The true evil are the Man who eat eachother, and those who commit to it are the largest, those who eat the smallest. For that you, Man, vos estis sal terrae. - -# -- NARSLIMMUS -botania.entry.narslimmus=Narslimmus -botania.page.narslimmus0=There's some sort of unbeknownst power in the universe that creates &1Slimes&0 at seemingly random spots. &4Slime Chunks&0, they call it. The &1Narslimmus&0 is a flower that has the ability to tap into that energy. If placed down near a &1Slime&0 created by that power, it'll destroy it, collecting all the &4Mana&0 generated by the entropy. The larger the &1Slime&0, the more &4Mana&0 is created. It also makes a bit of a sticky mess. -botania.page.narslimmus1=&oStick around, would ye&r? - -# -- SPECTROLUS -botania.entry.spectrolus=Spectrolus -botania.page.spectrolus0=The &1Spectrolus&0 is a flower that's particularly fond of the various tones of &1Wool&0. It'll absorb any and all &1Wool&0 blocks dropped nearby and create &4Mana&0 from them.
    There's a caveat though. It's picky as to what colors it wants. Starting at white, after it absorbs one piece of &1Wool&0, it'll rotate to the next color in the spectrum. -botania.page.spectrolus1=While it consumes all &1Wool&0 around, it'll only create any mana if its of the color it wants, so haphazardly tossing &1Wool&0 at it is a wasteful strategy.
    The color it'll absorb properly next can be seen by hovering over the flower with a &1Wand of the Forest&0. -botania.page.spectrolus2=&oTaste the Rainbow&r. - -# - MAGICAL APPARATUS -# -- MANA PYLON -botania.entry.pylon=Mana Pylon -botania.page.pylon0=A &1Mana Pylon&0 is a structure that can pull energies from the earth and use them to power enchanting processes.
    For one, setting one adjusted to an &1Enchanting Table&0 as if it was a &1Bookshelf&0 will drastically increase the power it can convey, just 2 of these are enough for it to reach &4Level 30&0. -botania.page.pylon1=&oYou must construct additional pylons!&r - -# -- MANA ENCHANTING -botania.entry.manaEnchanting=Enchanting with Mana -botania.page.manaEnchanting0=By utilizing the magical power emitted from &1Mana Pylons&0, a structure that can enchant items with books without consuming them can be created, called the &1Mana Enchanter&0.
    Constructing one of these requires a fair amount of space and materials alike. -botania.page.manaEnchanting1=To construct the &1Mana Enchanter&0, one requires, as well as fair amount of space, 17 &1Obsidian&0 blocks, 10 &1신비로운 꽃s&0 of any color, 6 &1Mana Pylons&0 and a &1Lapis Lazuli Block&0.
    The instructions on how to assemble this structure are in the following pages. -botania.page.manaEnchanting2=Mana Enchanter -botania.page.manaEnchanting5=After the construct is done, right click the Lapis block with a &1Wand of the Forest&0 and the enchanter should form.
    In order to utilize the enchanter, one would place (via right click) the item to be enchanted in the enchanter itself and drop &1Enchanted Books&0 inside the circle around it. -botania.page.manaEnchanting6=Items that are already enchanted can't be placed in the enchanter.
    To start the enchanting, right click the enchanter with a &1Wand of the Forest&0. It'll scan the books around, and once it's done, a spell circle of sorts will appear around it, indicating the books can be safely picked up again. -botania.page.manaEnchanting7=After the enchanting begins, the enchanter will require &4Mana&0.
    It can be fed via one of two ways, either via &4Mana Bursts&0 or nearby &1Sparks&0, by placing a &1Spark&0 on top of the enchanter. The later being much faster. -botania.page.manaEnchanting8=When enough &4Mana&0 is gathered, the enchanting process will finalize, and the enchantments will be applied to the item.
    The amount of &4Mana&0 required depends on the rarity of the enchantments being applied, their level, and the total amount of enchantments.
    If any book has more than one enchantment, only the first will be accounted for. -botania.page.manaEnchanting9=During the enchanting process, the item can not be removed, but it can after the process has been completed.
    Note that if at any point, any component of the construct is removed, it'll revert to its original &1Lapis Lazuli Block&0 form. - -# -- SPREADER TURNTABLE -botania.entry.turntable=Spreader Turntable -botania.page.turntable0=The &1Spreader Turntable&0, as its name implies, can turn &1Mana Spreaders&0 around and around. Placing a spreader above the turntable will rotate it, given that a redstone signal isn't applied.
    To change the speed of the turntable, right click with a &1Wand of the Forest&0, shift-right clicking will invert the movement. -botania.page.turntable1=You spin me right round - -# -- ALCHEMISING WITH MANA -botania.entry.manaAlchemy=Alchemising with Mana -botania.page.manaAlchemy0=&4Mana&0 is an extremely volatile substance, to a point that its complete properties and abilities are unknown.
    One of them is known, though, by attaching an &1Alchemy Catalyst&0, created with a mixture of otherworldly materials to the bottom of a &1Mana Pool&0, it enables the pool to perform &4Alchemy&0. -botania.page.manaAlchemy1=Creating the &1Catalyst&0 -botania.page.manaAlchemy2=&1Rotten Flesh&0 to &1Leather&0 -botania.page.manaAlchemy3=Various types of &1Wood&0 -botania.page.manaAlchemy4=Various types of &1Saplings&0 -botania.page.manaAlchemy5=Breaking down &1Glowstone Blocks&0 -botania.page.manaAlchemy6=Breaking down &1Quartz Blocks&0 -botania.page.manaAlchemy7=Creating &1Chiseled Stone Bricks&0 -botania.page.manaAlchemy8=Further freezing &1Snow&0 into &1Ice&0 -botania.page.manaAlchemy9=Converting between &1Vines&0 and &1Lilypads&0 -botania.page.manaAlchemy10=Various breeds of &1Fish&0 -botania.page.manaAlchemy11=Transmuting &1Seeds&0 and &1Crops&0 -botania.page.manaAlchemy12=Purifying &1Poisonous Potatoes&0 -botania.page.manaAlchemy13=Conjuring &1Nether Wart&0 -botania.page.manaAlchemy14=Converting between &1Gunpowder&0 and &1Flint&0 -botania.page.manaAlchemy15=Making &1Name Tags&0 -botania.page.manaAlchemy16=Splitting &1Wool&0 into &1String&0 -botania.page.manaAlchemy17=Converting between &1Slimeballs&0 and &1Cactus&0 -botania.page.manaAlchemy18=Creating &1Ender Pearls&0 -botania.page.manaAlchemy19=Converting between &1Glowstone&0 and &1빨간색stone&0 -botania.page.manaAlchemy20=Breaking &1Cobblestone&0 into &1Sand&0 -botania.page.manaAlchemy21=Breaking &1Hardened Clay&0 into &1빨간색 Sand&0 -botania.page.manaAlchemy22=Breaking down &1Clay&0 and &1Bricks&0 -botania.page.manaAlchemy23=Making &1Coarse Dirt&0 -botania.page.manaAlchemy24=Transmuting &1Tall Grass&0 types -botania.page.manaAlchemy25=Transmuting mundane flowers - -# -- BOTANICAL BREWERY -botania.entry.brewery=Botanical Brewery -botania.page.brewery0=Given the versatility of &4Mana&0, the fact that it can be used to conjure some sort of &4Potions&0 comes to nobody's surprise. &4Brews&0 are a variant of &4Potions&0, to put it simply. They're created using &4Mana&0 and a set of ingredients.
    Unlike &4Potions&0, &4Brews&0 have defined recipes, and each vial contains multiple doses. -botania.page.brewery1=In order to create &4Brews&0 one would require a &1Botanical Brewery&0, &1Vials&0 and of course, the reagents defined in the recipe.
    The &4Mana&0 functions as the both the solvent and energy source and is given through &4Mana Bursts&0, simply pointing a &1Mana Spreader&0 at the &1Brewery&0 will work just fine. -botania.page.brewery2=Crafting the &1Botanical Brewery&0 -botania.page.brewery3=Crafting &1Vials&0 -botania.page.brewery4=Working the &1Botanical Brewery&0 is rather simple. First off, to add an item, right click with it on the block or toss it.
    Start off by adding the &1Vial&0, which will get set on the top of the brewery. Proceed by adding all the required ingredients. Once a &4Brew&0 can be created with the ingredients in the brewery, &4Mana&0 will start flowing, just wait a bit after that. -botania.page.brewery5a=A simple brew, it mimics a &1Potion of Swiftness&0, when taken, it has a similar effect, giving the individual a &4Speed II&0 effect. -botania.page.brewery5b=Gotta go fast -botania.page.brewery6a=A simple brew, it mimics a &1Potion of Strength&0, when taken, it has a similar effect, giving the individual a &4Strength II&0 effect. -botania.page.brewery6b=Hodor -botania.page.brewery7a=A simple brew, it mimics a &1Potion of Haste&0, when taken, it has a similar effect, giving the individual a &4Haste II&0 effect. -botania.page.brewery7b=Full of C9H13NO3 -botania.page.brewery8a=A simple brew, it mimics a &1Potion of Healing&0, when taken, it has a similar effect, giving the individual an &4Instant Health II&0 effect. -botania.page.brewery8b=He pulled a Truesilver, GG -botania.page.brewery9a=A simple brew, it mimics a &1Potion of Leaping&0, when taken, it has a similar effect, giving the individual a &4Jump Boost II&0 effect. -botania.page.brewery9b=I got jumps, isn't that what the kids say? -botania.page.brewery10a=A simple brew, it mimics a &1Potion of Regeneration&0, when taken, it has a similar effect, giving the individual a &4Regeneration II&0 effect. -botania.page.brewery10b=Good reaction to simochi -botania.page.brewery17a=A simple brew, it mimics a &1Potion of Regeneration&0, when taken, it has a similar effect, giving the individual a &4Regeneration&0 effect, albeit for longer than the previous brew. -botania.page.brewery17b=I guess she was just more resilient -botania.page.brewery11a=A simple brew, it mimics a &1Potion of Resistance&0, when taken, it has a similar effect, giving the individual a &4Resistance II&0 effect. -botania.page.brewery11b=Can't touch this -botania.page.brewery12a=A simple brew, it mimics a &1Potion of Fire Resistance&0, when taken, it has a similar effect, giving the individual a &4Fire Resistance&0 effect. -botania.page.brewery12b=He isn't a true dragon, fire can't kill a dragon -botania.page.brewery13a=A simple brew, it mimics a &1Potion of Water Breathing&0, when taken, it has a similar effect, giving the individual a &4Water Breathing&0 effect. -botania.page.brewery13b=Under the sea, under the sea -botania.page.brewery14a=A simple brew, it mimics a &1Potion of Invisibility&0, when taken, it has a similar effect, giving the individual a &4Invisibility&0 effect. -botania.page.brewery14b=Pretend you have Incursio -botania.page.brewery15a=A simple brew, it mimics a &1Potion of Night Vision&0, when taken, it has a similar effect, giving the individual a &4Night Vision&0 effect. -botania.page.brewery15b=Does it come with a silence? -botania.page.brewery16a=A simple brew, it mimics a &1Potion of Absorption&0, when taken, it has a similar effect, giving the individual a &4Absorption IV&0 effect. -botania.page.brewery16b=You're gonna catch a cold - -# -- BREWING FLASKS -botania.entry.flasks=Brewing Flasks -botania.page.flasks0=&1Alfglass&0 seems to be more maleable than the typical &1Managlass&0 used for &1Vials&0. A &1Flask&0, made with &1Alfglass&0 is the typical elven container for &4Brews&0, and can contain 6 doses of one, rather than the 4 a &1Vial&0 does. -botania.page.flasks1=While the ingredient cost to brew something in a &1Flask&0 is smaller, the &4Mana&0 cost is double that of a regular &1Vial&0.
    Lastly, given that the bottleneck of a &1Flask&0 is larger than that of a &1Vial&0, the contents can be consumed faster. -botania.page.flasks2=Get one under the bridge - -# -- COMPLEX BREWING -botania.entry.complexBrews=Complex Brews -botania.page.complexBrews0=Apart from the standard, run of the mill &1Brews&0 that don't pass from mimics of the &1Potions&0 that can be made in a &1Brewing Stand&0 there's also some more complex brews which apply either a combination of effects or new, beneficial effects altogether. -botania.page.complexBrews1a=A brew that applies both positive and negative effects. Taking it leaves the affected individual in a state of power, but also vulnerability. -botania.page.complexBrews1b=96 Herblore -botania.page.complexBrews2a=An entity affected with this brew's effect will regain HP whenever they slay any other creature. -botania.page.complexBrews2b=It predates the set -botania.page.complexBrews3a=An entity affected with this brew's effect will be completely immune to any fall damage. -botania.page.complexBrews3b=And I call it magic -botania.page.complexBrews4a=This brew casts an aura of emptiness around any entity that has its effect. In a 128 block radius, mobs will not be allowed to spawn naturally. -botania.page.complexBrews4b=Close the floodgates -botania.page.complexBrews5a=This brew casts an aura of emptiness around any entity that has its effect. In a 64 block radius, mobs will be allowed to spawn regardless of light or other conditions. This won't work with &1Emptiness&0. -botania.page.complexBrews5b=Shall we pray for a miracle? -botania.page.complexBrews6a=A player affected with this brew's effect will have much higher proficiency at fishing and will catch fish and other loot twice as fast. -botania.page.complexBrews6b=Maybe you'll catch a Chris -botania.page.complexBrews7a=When drank, this brew will clear all potion effects on the player, negative or otherwise. -botania.page.complexBrews7b=Absolute sooooooul - -# -- BREW INCENSES -botania.entry.incense=Brew Incenses -botania.page.incense0=&4Brews&0 can provide a great variety of effects when in liquid form. They, however, don't last long, and take up inventory space. Utilizing &1Incense Sticks&0 instead of flasks mitigates that problem, these can be infused with &4Brew&0 effects just like a normal flask would, but take around ten times as much &4Mana&0 to do so. -botania.page.incense1=An &1Incense Stick&0 can be placed on an &1Incense Plate&0 by right clicking on it, a simple click with a &1Flint and Steel&0 will light it up. Once lit, the stick can not be retrieved.
    A single stick of incense will burn for sixty times as long as as the liquid counterpart before needing to be replaced. -botania.page.incense2=&1Incense Plates&0 that are burning &1Incense Sticks&0 will provide the effects of the &4Brew&0 infused in the stick to any players on a 24 block radius of the plate.
    Not all &4Brews&0 can be infused into &1Incense Sticks&0, for example, &4Instant Health&0 or &1Absorption&0 can't, nor can any with more than one effect. -botania.page.incense5=For the incense lovers who are also automation junkies, the &1Incense Plate&0 can receive items through &1Hoppers&0 or other input. It'll output a &1Comparator&0 signal of 1 when it has a stick and 2 when it's burning it.
    Lastly, if a &4Mana Burst&0 with a &1Kindle Lens&0 hits the plate while there's a stick on it, it'll start burning it. -botania.page.incense3=Incense is wincense -botania.page.incense4=I can incense it - -# -- EYE OF THE ANCIENTS -botania.entry.forestEye=Eye of the Ancients -botania.page.forestEye0=As the Ancients who used to watch over the world always looked for the living beings on it, this block, the &1Eye of the Ancients&0, will do just that.
    By attaching a &1Comparator&0 next to it, it'll send out a redstone signal equivalent to the amount of animals it can find. -botania.page.forestEye1=The counting only starts at 2, so, with 2 animals around, it'd output a signal of strength 1, with 3 animals, of strength 2 and so on.
    Lastly, the time has worn down the sight of the Ancients, so this block can only see animals in about 6 blocks in any direction. -botania.page.forestEye2=Now you see me... - -# -- OPEN CRATE -botania.entry.openCrate=Open Crate -botania.page.openCrate0=Sometimes devices like &1Droppers&0 or &1Dispensers&0 aren't precise or fast enough. A simple solution is to make a crate and punch a hole in the bottom.
    Yeah, it's that simple. The &1Open Crate&0 accepts items from &1Hoppers&0 or any other means of inserting items, and obviously, drops them directly below it. -botania.page.openCrate1=A little interesting effect the &1Open Crate&0 can do is that, when given a redstone signal, any items it drops are prevented from being caught by flowers like the &1Hopperhock&0, &1Rannuncarpus&0 or &1Pollidisiac&0 for around ten seconds more than usual. -botania.page.openCrate2=A super crate box - -# -- DRUM OF THE WILD -botania.entry.forestDrum=Drum of the Wild -botania.page.forestDrum0=The &1Drum of the Wild&0 is, in layman's terms, the percussion counterpart of the &1Horn of the Wild&0. It serves the exact same purpose as the handheld horn, but is placed in world.
    To trigger a beat and break nearby foliage, one would fire a &4Mana Burst&0 at the drum. -botania.page.forestDrum1=It's to note that the drum does not store mana, hence, in order to trigger it, a &1빨간색stone Mana Spreader&0 or a &1Mana Blaster&0 is required. -botania.page.forestDrum2=But if you close your eyes... - -# -- ABSTRUSE PLATFORM -botania.entry.platform=Abstruse Platform -botania.page.platform0=By laying &1Livingwood&0 on a very specific format it's possible to create a platform of sorts, that only has a physical body for whoever is on top of it and isn't sneaking. For anyone else, it's like it's not there. &4Mana Bursts&0 will always travel through it without any trouble.
    It's also possible to camouflage this block as any other simple block by simply right clicking it. -botania.page.platform2=Right clicking a platform with a block in it with a &1Wand of the Forest&0 will change all connected platforms with no block set to them to the block on the one clicked. Shift-right clicking removes all blocks. -botania.page.platform1=It would be Ethereal but the name was taken - -# -- CONJURING WITH MANA -botania.entry.manaConjuration=Conjuring with Mana -botania.page.manaConjuration0=Similar to the ability to &4Alchemise with Mana&0, a catalyst also exists for &4Conjuration&0, the magic of materializing resources from magical energy only. The mechanism works in a similar way to the &1Alchemy Catalyst&0 where one tosses an item into the pool with the catalyst below. -botania.page.manaConjuration1=Creating the catalyst -botania.page.manaConjuration2=Conjuring &1빨간색stone&0 -botania.page.manaConjuration3=Conjuring &1Glowstone&0 -botania.page.manaConjuration4=Conjuring &1Quartz&0 -botania.page.manaConjuration5=Conjuring &1Coal&0 -botania.page.manaConjuration6=Conjuring &1Snow&0 -botania.page.manaConjuration7=Conjuring &1Netherrack&0 -botania.page.manaConjuration8=Conjuring &1Soul Sand&0 -botania.page.manaConjuration9=Conjuring &1Gravel&0 -botania.page.manaConjuration10=Conjuring &1Leaves&0 -botania.page.manaConjuration11=Conjuring &1Grass&0 - -# -- SPECTRAL PLATFORM -botania.entry.spectralPlatform=Spectral Platform -botania.page.spectralPlatform0=The &1Spectral Platform&0 isn't more than an &1Abstruse Platform&0 with no physical body whatsoever. Whereas the &1Abstruse Platform&0 would have a physical body in some cases, the &1Spectral Platform&0 lets anything go through it, regardless of their position. -botania.page.spectralPlatform1=This reminds me of a Puzzle - -# -- DRUM OF THE GATHERING -botania.entry.gatherDrum=Drum of the Gathering -botania.page.gatherDrum0=The &1Drum of the Gathering&0 is, in short terms, a &1Drum of the Wild&0 for livestock.
    When a &4Mana Burst&0 collides with it, it'll shear any &4Sheep&0 around with grown fleece. Any &4Cows&0, with &1Empty Buckets&0 below them will have their milk transfered to the buckets. -botania.page.gatherDrum1=Tap your lands - -# -- CRAFTY CRATE -botania.entry.craftCrate=Crafty Crate -botania.page.craftCrate0=As the name suggests, the &1Crafty Crate&0 is a counterpart to the &1Open Crate&0 with the ability to assemble items into other items similarly to a &1Crafting Table&0.
    Like a &1Crafting Table&0, it has a 9 slot inventory, which can be filled with items in the pattern of a recipe. -botania.page.craftCrate1=The items go in from left to right and top to bottom (illustration further in this entry), to that, there's a special item, named the &1Crafting Placeholder&0, which, when placed in, counts as an empty slot in the recipe. This is used to allow for recipes with gaps (eg, furnace, chest, pickaxe...) to also be doable. -botania.page.craftCrate2=Creating the placeholder -botania.page.craftCrate3=To finish the recipe, one of two things can be done.
    First off, filling every of the 9 slots with either recipe components or placeholders will instantly eject the result, the placeholders and any leftovers (e.g. buckets when making cake), this is the most straightforward method. -botania.page.craftCrate4=Right clicking the crate with a &1Wand of the Forest&0 (remember: &1Dispensers&0 can do this) will attempt at crafting with whatever is inside the crate and eject it.
    If this fails all the items inside are simply ejected with no crafting procedure done. -botania.page.craftCrate7=Attaching a &1Comparator&0 to the crate will have it emit a signal equal to the amount of items inside the crate, which can be an extremely valuable asset in creating mechanisms with it. -botania.page.craftCrate5=An example of crafting a &1Diamond Pickaxe&0 -botania.page.craftCrate6=Made in Portugal -botania.page.craftCrate8=The &1Crafty Crate&0 can also be augmented with patterns. A pattern locks specific slots in the recipe, disallowing items from going into those slots and making them count as if there were placeholders there.
    There's only a few basic patterns, which can be applied by right clicking on the crate (this doesn't consume them). -botania.page.craftCrate9=9 different patterns - -# -- HOVERING HOURGLASS -botania.entry.hourglass=Hovering Hourglass -botania.page.hourglass0=The ability to count time is an essential one to anyone who wishes to develop any redstonic contraptions. A single timer, however, can take a up both a lot of space and be slow in general. The &1Hovering Hourglass&0 is a simple, accurate, sand based timer. As the name implies, it's a hourglass that hovers and turns by itself. -botania.page.hourglass1=The hourglass contains an inventory, in which up to a stack of &1Sand&0, &1빨간색 Sand&0 or &1Soul Sand&0 can be added via a right click. Right clicking again removes it. The sand will then fall from one of the chambers into another, and when is done, release a single redstone pulse and turn over, starting the process again. -botania.page.hourglass2=The amount of time for each pulse is dependent on how much and what type of sand is in the chamber. &1Sand&0 will count for one second per block, &1빨간색 Sand&0 ten seconds per and &1Soul Sand&0 one minute per. Sand types can't be mixed. The time for each pulse can be seen by hovering over the block with a &1Wand of the Forest&0. -botania.page.hourglass3=Note that the sand is added all at once, so the size of the stack to be added needs to be set in the inventory.
    Sand can't be added to the hourglass after it already has some in, trying to do so will end up removing the sand there instead. The sand in the block can be taken and added by &1Hoppers&0 or other methods. -botania.page.hourglass4=Right clicking the block with a &1Wand of the Forest&0 locks (and unlocks) it. When locked, sand can't be added or removed, just in case someone right clicks it on accident.
    If a &4Mana Burst&0 collides with the block, it'll stop the flow of sand and pause the timer, colliding again continues it. -botania.page.hourglass5=The sands of time - -# -- SPECTRAL RAIL -botania.entry.ghostRail=Spectral Rail -botania.page.ghostRail0=Using a &1Spectral Platform&0 as a &1Rail&0 component gives some interesting abilities to a &1Minecart&0 that passes through it: when launched off the rail, the cart will float for a bit, it'll also be able to pass through walls.
    This effect stops if the cart lands on a rail or collides with any variant of &1Dreamwood&0. -botania.page.ghostRail1=Spirit Tracks, you could say - -# -- DRUM OF THE CANOPY -botania.entry.canopyDrum=Drum of the Canopy -botania.page.canopyDrum0=The &1Drum of the Canopy&0 is like the &1Drum of the Wild&0 in that it is the percussion counterpart of the &1Horn of the Canopy&0. It serves the exact same purpose as the handheld horn, but is placed in world.
    All the functionality is similar to the &1Drum of the Wild&0 -botania.page.canopyDrum1=The 분홍색ing Drum - -# -- COCOON OF CAPRICE -botania.entry.cocoon=Cocoon of Caprice -botania.page.cocoon0=A cocoon is usually a symbol of change, of evolution.
    Creating a &1Cocoon of Carpice&0 and placing it down will slowly evolve the rudimentary contents inside it into a &1Baby Animal&0. More often than not the animal hatched will be a farm animal, but on rare ocasions, different animals such as &1Wolves&0 or &1Horses&0 may be created. -botania.page.cocoon1=Speculation says that giving the cocoon &1Emeralds&0 influences the outcome towards something a bit different.
    What could come out of such experiment is anyone's guess, really. -botania.page.cocoon2=New World, Perfect World - -# -- MANASTORM CHARGE -botania.entry.manaBomb=Manastorm Charge -botania.page.manaBomb0=Putting together some &1TNT&0 and a &1Gaia Spirit&0 creates a &1Manastorm Charge&0, a type of explosive, per say. Ignited with a &1Mana Burst&0, the charge will create an unstable &1Manastorm Epicenter&0, which will, over time, spawn supercharged &1Mana Bursts&0, that explode on contact with other blocks.
    Needless to say, only a maniac would unleash such a force near anything they care about. -botania.page.manaBomb1=Prepare to face the mighty... - -# - MYSTICAL INSTRUMENTS -# -- MANA BLASTER -botania.entry.manaBlaster=Mana Blaster -botania.page.manaBlaster0=The &1Mana Blaster&0 is like a portable &1Mana Spreader&0, while shaped like a pistol for easy handling, it's not exactly a firearm, as much as it is just a portable spreader.
    By utilizing &4Mana&0 from &4Mana carrying items&0 in the holder's inventory, it can shoot a mana burst when one is looking at. -botania.page.manaBlaster1=This burst is a bit different from the one fired from speaders, as it's faster, but carries only three quarters of the mana a spreader burst would. There's also a short cooldown period after firing the blaster until another burst can be shot. -botania.page.manaBlaster2=&1Mana Lenses&0 also function with the blaster, to attach one to it, put them side by side on a crafting table, to remove it, simply place the &1Mana Blaster&0 back on the crafting grid. -botania.page.manaBlaster3=We need more dakka - -# -- PASTURE SEEDS -botania.entry.grassSeeds=Pasture Seeds -botania.page.grassSeeds0=Watching grass spread is seldom a fun activity. By infusing some &1Tall Grass&0 with &4Mana&0, it's possible to create &1Pasture Seeds&0, which will grow grass in any barren area, via a simple right click on dirt.
    Other types of foliage can also be grown, such a &1Podzol&0 or &1Mycellium&0 with alternate seeds. -botania.page.grassSeeds1=&1Pasture Seeds&0 for grass -botania.page.grassSeeds2=&1Boreal Seeds&0 for podzol -botania.page.grassSeeds3=&1Infestation Spores&0 for mycellium - -# -- ROD OF THE LANDS -botania.entry.dirtRod=Rod of the Lands -botania.page.dirtRod0=The &1Rod of the Lands&0 is a rather simpleton tool, by utilizing &4Mana&0 from the user's inventory (via a &1Mana Tablet&0 or others), it can materialize and place a &1Dirt&0 block down.
    For the same &4Mana&0 cost, this item can provide &1Dirt&0 to the &1Rod of the Shifting Crust&0. -botania.page.dirtRod1=That's dirty - -# -- TERRA FIRMA ROD -botania.entry.terraformRod=Rod of the Terra Firma -botania.page.terraformRod0=While digging away at dirt with a shovel is definitely functional, flattening huge tracts of land can get somewhat tortuous at times.
    By utilizing the &1Rod of the Terra Firma&0, it's possible to terraform in a quick and environmental friendly manner. -botania.page.terraformRod1=This rod, will, at the cost of some &4Mana&0 from the user's inventory, flatten the land to the level you are standing. For this to happen, charge it by &4holding right-click&0 and, slowly but surely, the nearby terrain will be flattened to your level, either by placing &1Dirt&0 or by removing blocks. -botania.page.terraformRod2=Note that blocks removed by the rod are non-recuperable. The terrain will adapt to the changes as best as it can, up to a distance limit, to avoid cuts in hills and the like, for this, the flattening will work in the terrain's natural look.
    Lastly, the rod will cease to function whatsoever below sea level. -botania.page.terraformRod3=Quite a justicar - -# -- MANASTEEL EQUIPMENT -botania.entry.manaGear=Manasteel Equipment -botania.page.manaGear0=&1Manasteel&0, alike other metals, can be shaped into tools and armor alike.
    Tools or armor crafted from this material will share their properties with &1Iron&0, albeit somewhat superior in enchantability and durability. Whenever a &1Manasteel&0 item is to take damage, if there's &4Mana&0 available in the inventory (such as a &1Mana Tablet&0), it'll use that instead. -botania.page.manaGear10=Some pieces of the toolset have an ability when right clicked. The &1Pickaxe&0 will place a torch from the user's inventory, the &1Axe&0 will do the same for a sapling and the &1Shovel&0 will till the earth, similarly to a hoe.
    A detail to keep in mind is that &1Shears&0 made of mana materials will trigger tripwire, unlike iron ones. -botania.page.manaGear1=The &1Manasteel Pickaxe&0 -botania.page.manaGear2=The &1Manasteel Shovel&0 -botania.page.manaGear3=The &1Manasteel Axe&0 -botania.page.manaGear4=The &1Manasteel Shears&0 -botania.page.manaGear5=The &1Manasteel Sword&0 -botania.page.manaGear6=The &1Manasteel Helmet&0 -botania.page.manaGear7=The &1Manasteel Chestplate&0 -botania.page.manaGear8=The &1Manasteel Leggings&0 -botania.page.manaGear9=The &1Manasteel Boots&0 - -# -- HORN OF THE WILD -botania.entry.grassHorn=Horn of the Wild -botania.page.grassHorn0=Clearing out &1Tall Grass&0 by hand can definitely be a nuisance.
    Simply blowing the &1Horn of the Wild&0 will quickly cause any nearby vegetation to uproot, leaving behind drops as if it had been broken by hand.
    With some modifications, the horn can be modified to break leaves or snow instead. -botania.page.grassHorn1=Crafting the horn -botania.page.grassHorn2=Modifying to break &1Leaves&0 -botania.page.grassHorn3=Modifying to break &1Snow&0 - -# -- TERRASTEEL ARMOR -botania.entry.terrasteelArmor=Terrasteel Armor -botania.page.terrasteelArmor0=Armor made out of &1Terrasteel&0, much alike the &1Manasteel&0 counterpart, can utilize &4Mana&0 from the inventory instead of taking damage.
    This armor, however, has properties more alike &1Diamond&0 instead of &1Iron&0. -botania.page.terrasteelArmor1=The &1Terrasteel Helmet&0 -botania.page.terrasteelArmor2=The &1Terrasteel Chestplate&0 -botania.page.terrasteelArmor3=The &1Terrasteel Leggings&0 -botania.page.terrasteelArmor4=The &1Terrasteel Boots&0 - -# -- TERRA BLADE -botania.entry.terraSword=Terra Blade -botania.page.terraSword0=The &1Terra Blade&0, crafted from &1Terrasteel Ingots&0, is a sword infused with natural strength. Not only does it par with a &1Diamond Sword&0 in terms of strength and it uses &4Mana&0 from the inventory like &1Manasteel Tools&0, but when swung, there's a chance for it to create a beam that will deal as much damage as a melee hit. -botania.page.terraSword1=No Broken Hero Sword - -# -- TERRA SHATTERER -botania.entry.terraPick=Terra Shatterer -botania.page.terraPick0=The &1Terra Shatterer&0 is a tool that can amass insane quantities of mana on itself, due to the amount of &1Terrasteel&0 required for its creation.
    The tool functions very much like a &1Mana Tablet&0 by which it can amass &4Mana&0 by being tossed on a &1Mana Pool&0, it can't give the &4Mana&0 back, though, so it doesn't function as a storage method. -botania.page.terraPick1=The amount of &4Mana&0 stored on the tool defines its &4Rank&0. Ranks go as follows: &4D&0, &4C&0, &4B&0, &4A&0, &4S&0, &4SS&0. &4D&0 being the default rank.
    The amount of &4Mana&0 required to advance from rank to rank increases as the rank does. To advance from &4D&0 to &4C&0, for example, it requires just a few seconds of exposition to a &1Mana Pool&0. -botania.page.terraPick2=To advance from rank &4C&0 to rank &4B&0, a full &1Mana Pool&0 is required, and the cost increases by a tenfold per rank from there on in, all the way to &4SS&0.
    The rank of the tool does not change its speed, but instead, it increases the power of its &4Active Ability&0.
    Toggling the tool's ability can be done via right click. -botania.page.terraPick3=While the tool is active, it enables it to break blocks in an extended area. At rank &4C&0 it's a small column, which increases to a square at rank &4B&0, that gets larger through the ranks. It's to note that the rank &4D&0 tool does not have the active ability.
    Having the tool active consumes &4Mana&0 from its storage passively, even if not being used to mine. -botania.page.terraPick4=Lastly, the tool takes damage for every single block broken, so a good supply of &4Mana&0 in the wielder's inventory is a must for the higher ranks, as the tool does function like normal &1Manasteel Tools&0, in which it'll use &4Mana&0 instead of actually taking damage, given it's made of &1Terrasteel&0.
    It also won't despawn like regular dropped items. -botania.page.terraPick5=WE'RE MINING IN THE DATABASE WOW WOW - -# -- ROD OF THE SEAS -botania.entry.waterRod=Rod of the Seas -botania.page.waterRod0=Similarly to its land counterpart, the &1Rod of the Seas&0 will, at the cost of some &4Mana&0, place down a &1Water&0 block wherever it's used on. Furthermore, it can also be used to refill a &1Petal Apothecary&0. -botania.page.waterRod1=Keep the Earth clean, it isn't Uranus - -# -- ELEMENTIUM EQUIPMENT -botania.entry.elfGear=Elementium Equipment -botania.page.elfGear0=Similarly to other metals, as expected, &1Elementium&0 can, too, be shaped into tools and armor.
    These pieces of equipment have a decent resistance to damage, about half of that of diamond, as well as the ability to drain &4Mana&0 to prevent damage. -botania.page.elfGear1=Each of the tools come with their own ability or power of sorts which makes them unique. The armor allows the wearer to, when hit, have a chance to spawn a &1Pixie&0 that goes after the attacker, dealing decent damage.
    The more pieces of &1Elementium Armor&0 equipped, the higher the chance. -botania.page.elfGear2=Starting off, the &1Elementium Pickaxe&0 will destroy any &1Cobblestone&0, &1Dirt&0, &1Netherrack&0 and other mundane materials, leaving behind only the ores and fine resources.
    Combining the &1Elementium Pickaxe&0 with a &1Terra Shatterer&0 in a crafting square allows for the latter to also get this power. This can't be undone. -botania.page.elfGear3=I can fit a shower in my pocket, screw cobble -botania.page.elfGear4=The &1Elementium Shovel&0 will, case the block dug is affected by gravity (&1Gravel&0, &1Sand&0, etc), dig all the blocks of that material above and/or below it, no more gravel falling while mining. -botania.page.elfGear5=Putting Things on Top of Other Things -botania.page.elfGear6=The &1Elementium Axe&0 doubles as a weapon, if used to strike the finishing blow to a &4Zombie&0, &4Skeleton&0, &4Creeper&0 or even another &4Player&0, it has a chance to decapitate them, leaving their severed head or skull behind. -botania.page.elfGear7=Off with their heads -botania.page.elfGear8=The &1Elementium Shears&0 hold the ability to, when held back like a bow, shear any nearby sheep with speed within a large area of effect centered on the holder. -botania.page.elfGear9=Nui? She's h-arm-less -botania.page.elfGear10=Lastly, the &1Elementium Sword&0 will increase the chance of a &4Pixie&0 spawning when hit (this holds true when no &1Elementium Armor&0 is worn) and increases the strength of any &4Pixies&0 spawned. -botania.page.elfGear11=The Lambent Light -botania.page.elfGear12=Fortuna on the Sixteenth Night -botania.page.elfGear13=When the Seagulls Cry Breakdown -botania.page.elfGear14=Good People Die -botania.page.elfGear15=The out of Infinity - -# -- EXTRAPOLATED BUCKET -botania.entry.openBucket=Extrapolated Bucket -botania.page.openBucket0=By creating a bucket out of &1Elementium&0 one seems to notice an interesting feature. The liquids acquired by it simply vanish into the ether, never to be seen again. This seems like a great clean up tool. -botania.page.openBucket1=A Souvenir from Lewis - -# -- ROD OF THE BIFROST -botania.entry.rainbowRod=Rod of the Bifrost -botania.page.rainbowRod0=&4Bifrost&0, the rainbow bridge that reaches between the world and the realm of the gods.
    While this item, the &1Rod of the Bifrost&0 doesn't exactly do that, it allows the holder, via a right click and at the cost of some &4Mana&0, to create a rainbow bridge in the direction he or she is looking at. -botania.page.rainbowRod1=This bridge extends as far as a hundred blocks, and will vanish after about fifteen seconds.
    Only one bridge can be created for any given &1Rod of the Bifrost&0 at a time, as soon as the old bridge vanishes, a new one can be created. -botania.page.rainbowRod2=Going my way!! Cut open a path and go! -botania.page.rainbowRod3=&1Bifrost Blocks&0 for decoration - -# -- ROD OF THE SKIES -botania.entry.tornadoRod=Rod of the Skies -botania.page.tornadoRod0=The &1Rod of the Skies&0 is a magical instrument with the ability to propel one in the air at fast velocity for the cost of some &4Mana&0.
    To do so, one would simply hold it like a bow and watch as their momentum increases.
    The rod takes a small amount of time to recharge, but during that time it'll block any fall damage, keeping the user safe. -botania.page.tornadoRod1=A treasure from Lorule - -# -- ROD OF THE HELLS -botania.entry.fireRod=Rod of the Hells -botania.page.fireRod0=The &1Rod of the Hells&0 contains the essence of a burning flame, using it on the ground will create a circle of fire that burns anything inside it, for a decent cost of &4Mana&0.
    The ring has a decent radius, and takes a small amount of time to fully propagate, it's to note that after that time it burns anything living in it, the caster included. -botania.page.fireRod1=Megu Megu Fire Endless Night - -# -- VINE BALLS -botania.entry.vineBall=Vine Balls -botania.page.vineBall0=&1Ladders&0 can't stand up on their own, they require something on their back, whereas &1Vines&0 don't. Normally, though, &1Vines&0 aren't strong enough for someone to climb them when they're freestanding.
    By combining a few &1Vines&0, it's possible to create a ball that can be thrown, to create a climbable ladder of strong &1Vines&0 where it hits. -botania.page.vineBall1=It's also possible, by combining some materials such as &1Livingwood&0 or a &1Rune of Air&0 to create a slingshot that lets these &1Vine Balls&0 be shot while completely ignoring the force of gravity. -botania.page.vineBall2=This would be in Vineacraft... -botania.page.vineBall3=...if that actually existed. -botania.page.vineBall4=Oh, and you can make &1Moss Stone&0 too - -# -- SHARD OF LAPUTA -botania.entry.laputaShard=Shard of Laputa -botania.page.laputaShard0=Via a somewhat complex magic activation sequence, combining a few interesting resources, including &1Gaia Spirits&0 would allow one to create a shard that, when used on the ground, will lift an almost spherical area around that point up into the air.
    This process consumes the shard and can take upwards of ten minutes depending on the mass of land. -botania.page.laputaShard2=The radius of the island creates start at 14 blocks, on other words, 28 blocks of diameter. It's possible to increase the size by upgrading the shard with additional &1Gaia Spirits&0, each one adds 1 block to the radius, or 2 to the diameter. -botania.page.laputaShard1=Look Shiro, Laputa exists! -botania.page.laputaShard3=Size does matter - -# -- EQUESTRIAN VIRUS -botania.entry.virus=Equestrian Virus -botania.page.virus0=Through the mixing of some ingredients, a type of virus that can alter the genetic code of equestrian life can be made.
    Using one of these viruses on a &1Horse&0 will alter its genetic code, turning it into either a &1Zombie&0 or &1Skeleton Horse&0. Not only will it do that, but it will vastly increase all the &1Horse&0's genetic attributes. -botania.page.virus1=No ponies here -botania.page.virus2=None here either - -# -- ROD OF THE HIGHLANDS -botania.entry.skyDirtRod=Rod of the Highlands -botania.page.skyDirtRod0=While the &1Rod of the Lands&0 is all well and good, being able to place &1Dirt&0 without something to hold it would be great.
    The &1Rod of the Highlands&0 does just that, while maintaining the original power of the &1Rod of the Lands&0, it can also place &1Dirt&0 in mid air, for an increased &4Mana&0 cost. -botania.page.skyDirtRod1=Dirty Stick mk2 - -# -- VITREOUS PICKAXE -botania.entry.glassPick=Vitreous Pickaxe -botania.page.glassPick0=Placing down &1Glass&0 and having to break it again can be a heartbreaking experience. Luckily, by creating a &1Vitreous Pickaxe&0, one can gather the &1Glass&0 back by mining it with the pick, it's like cheap &4Silk Touch&0 for glass! -botania.page.glassPick1=Trapped inside with food - -# -- ROD OF DIVINING -botania.entry.diviningRod=Rod of the Plentiful Mantle -botania.page.diviningRod0=The &1Rod of the Plentiful Mantle&0 has the ability to divine in a decently large radius around the user to find any ores. These will shine for a little bit, allowing their location.
    This process, obviously, requires a decent amount of &4Mana&0 from the user's inventory. -botania.page.diviningRod1=inb4 ee3 - -# -- ROD OF THE BLACK MESA -botania.entry.gravityRod=Rod of the Shaded Mesa -botania.page.gravityRod0=The &1Rod of the Shaded Mesa&0 is a powerful relic, legend says that the first of these devices was found atop a dark mesa, along with a crowbar.
    To use this device, the user may right click and hold on a monster or item to pick it up. Releasing right click will drop the selected entity, while left click will fire it in a powerful burst. -botania.page.gravityRod1=This power does not come free, of course. It requires significant amounts of &4Mana&0 from the user's inventory. -botania.page.gravityRod2=bun pls - -# -- TIMELESS IVY -botania.entry.regenIvy=Timeless Ivy -botania.page.regenIvy0=While &1Manasteel&0 or &1Elementium&0 tools have the ability to harness &4Mana&0 and use it to protect their bodies, other tools or armor don't have this property.
    A handful of &1Timeless Ivy&0 can be attached on to virtually any item, allowing it to be repaired with &4Mana&0. -botania.page.regenIvy1=To apply it, one'd simply craft the tool in question alongside the ivy and 3 of an item that can be used to repair the tool in an anvil (eg. &1Diamonds&0 for a &1Diamond Pickaxe&0).
    Due to not being in direct contact with the material, the amount of &4Mana&0 used by the ivy in comparison to &1Manasteel&0 is rather high. -botania.page.regenIvy2=Bring your Inferno Adze - -# -- ROD OF THE ARCANE BARRAGE -botania.entry.missileRod=Rod of the Unstable Reservoir -botania.page.missileRod0=The &1Rod of the Unstable Reservoir&0 is a rather powerful weapon against a large crowd of foes. Channeling its power will materialize countless arcane missiles that home in on targets at random, at a pretty hefty cost of &4Mana&0. -botania.page.missileRod1=Zapzapzapzap - -# -- ASSEMBLY HALO -botania.entry.craftingHalo=Assembly Halo -botania.page.craftingHalo0=Carrying a &1Crafting Table&0 around generally can be troublesome. The &1Assembly Halo&0 acts not only as a portable &1Crafting Table&0 but as a quick crafting method. Having the item in hand displays a "halo" of recipes around the holder.
    First off, right clicking on the &1Crafting Table&0 will open up a crafting interface. -botania.page.craftingHalo1=As long as the item is present in the inventory the last crafting recipe done will be stored in it.
    Right clicking an empty slot of the halo will set the last recipe on it. Right clicking a slot with a recipe will try to do it using items from the inventory. Removing a recipe can be done through shift-left click. -botania.page.craftingHalo2=It has no taste if you cook it from the menu - -# -- LENS CLIP -botania.entry.clip=Lens Clip -botania.page.clip0=While a formidable and versatile tool, the &1Mana Blaster&0's greatest downfall is the lack of an ability to store more than one &1Lens&0 at once. Not any more. The &1Lens Clip&0 will attach to a &1Mana Blaster&0 in a crafting grid and allow it to store up to 6 lenses rather than just one.
    As they say, Russian Roulette is not the same without a gun... -botania.page.clip1=Adding and removing &1Lenses&0 works just as it did previously, with one detail. The lens will be added or removed in the slot that the clip is currently on.
    To change this slot, simply shift-right click the &1Mana Blaster&0 in the air. This will also change which lens is selected, case there is one in that slot. -botania.page.clip2=Since we're dubbed by 4Kids we must make do without one - -# -- ROD OF THE DEPTHS -botania.entry.cobbleRod=Rod of the Depths -botania.page.cobbleRod0=The &1Rod of the Depths&0 acts pretty much as a variant to the the &1Rod of the Lands&0. It does exactly the same thing but with &1Cobblestone&0 for a bit of a higher price.
    For the same &4Mana&0 cost, this item can provide &1Cobblestone&0 to the &1Rod of the Shifting Crust&0. -botania.page.cobbleRod1=It's cobbling time - -# -- ROD OF THE MOLTEN CORE -botania.entry.smeltRod=Rod of the Molten Core -botania.page.smeltRod0=The &1Rod of the Molten Core&0 has the ability to expel heat provenient from the world's core. Holding it via right click and pointing at a block in the world that can be smelted into a different type of block will quickly turn it into that.
    For some examples, &1Cobblestone&0 turns into &1Stone&0, &1Sand&0 into &1Glass&0, so on. -botania.page.smeltRod1=Stolen from Efreet - -# -- WORLD SEED -botania.entry.worldSeed=World Seed -botania.page.worldSeed0=The &1World Seed&0 is a piece of elemental energized matter containing the ability to return its user to the world spawn.
    Case the person who is using it is farther than 24 blocks from the world's spawn point, using the seed, via right click, will instantly teleport them there, consuming the seed. -botania.page.worldSeed1=Where the heart is - -# -- SPELLBINDING CLOTH -botania.entry.spellCloth=Spellbinding Cloth -botania.page.spellCloth0=Combining &1Wool&0 with some &4Mana&0 in the form of a &1Mana Pearl&0 allows for one to create a type of cloth that will absorb any &4Enchantments&0 it comes in contact with.
    Combining the &1Spellbinding Cloth&0 with any enchanted item in a crafting table will remove all enchants from that item at the cost of some of the cloth's durability. -botania.page.spellCloth1=Oldest item in the book - -# -- THORN CHAKRAM -botania.entry.thornChakram=Thorn Chakram -botania.page.thornChakram0=The &1Thorn Chakram&0 is a thrown weapon made of &1Terrasteel&0 and plant matter. After thrown it'll pierce through enemies, damaging them and sometimes poisoning them, and bounce on blocks a few times before returning to the thrower, similarly to a boomerang.
    Up to 6 &1Thorn Chakrams&0 can be stacked together, making them a versatile weapon for closed environments. -botania.page.thornChakram1=Spores and stingers - -# -- FLARE CHAKRAM -botania.entry.fireChakram=Flare Chakram -botania.page.fireChakram0=Some &1Blaze Powder&0 and &1Pixie Dust&0 does wonders when applied to a &1Thorn Chakram&0, this combination turns the already potent weapon into a &1Flame Chakram&0.
    The &1Flame Chakram&0 works exactly the same as the original &1Thorn Chakram&0, the only difference being that it sets any living beings it touches aflame, and after all, you can't make bacon with some just some plants' thorns, can you? -botania.page.fireChakram1=As fire as fenn's mixtape - -# -- OVERGROWTH SEED -botania.entry.overgrowthSeed=Overgrowth Seed -botania.page.overgrowthSeed0=An &1Overgrowth Seed&0 is an elusive item, which can be used to enchant a piece of &1Grass&0, via right clicking on it in the world, creating &1Enchanted Soil&0. Flowers that are rooted on this &1Enchanted Soil&0 will function at double the normal speed.
    There's one problem, though. No known method of creating these exists, but they have been spotted in ancient structures and the like. - -# -- LIVINGWOOD BOW -botania.entry.livingwoodBow=Livingwood Bow -botania.page.livingwoodBow0=The &1Livingwood Bow&0 is, as the name describes, a bow made of &1Livingwood&0 strung with &1Mana Infused String&0. Due to its components, it will last for longer than a normal &1Bow&0. It'll also repair itself using &4Mana&0, similarly to &1Manasteel Tools&0. -botania.page.livingwoodBow1=Does it shoot airplanes? - -# -- CRYSTAL BOW -botania.entry.crystalBow=Crystal Bow -botania.page.crystalBow0=Crafted with &1Dragonstone&0, the &1Crystal Bow&0 is a ranged weapon with the capacity to generate arrows from &4Mana&0. Similarly to the &1Livingwood Bow&0, it'll repair using &4Mana&0 as well, but carrying &1Arrows&0 is not required as they are created through the magical energies.
    Given the lightweight and flexible structure of the bow, it can also fire at a much increased velocity than a conventional wooden one. -botania.page.crystalBow1=The elves are roving - -# -- STONE OF TEMPERANCE -botania.entry.temperanceStone=Stone of Temperance -botania.page.temperanceStone0=The &1Terra Shatterer&0 is able to destroy huge tracts of land when charged to its maximum potential, however, this might not always be the user's intent. A small, 3x3 tunnel might be more fitting in some cases. Having an active &1Stone of Temperance&0 in one's inventory will prevent their shatterer from breaking any more than a 3x3 area. This also affects the &1Terra Truncator&0. The stone can be toggled on and off by shift-right clicking. -botania.page.temperanceStone1=Don't lose it - -# -- TERRA TRUNCATOR -botania.entry.terraAxe=Terra Truncator -botania.page.terraAxe0=The &1Terra Truncator&0 is a greataxe of premium quality achievable only with &1Terrasteel&0. When hitting a tree it'll take the whole thing down with speed, bringing all the logs and leaves along with it. Of course, this comes at a hefty cost of &4Mana&0.
    This effect doesn't happen while sneaking or if the user has a &1Stone of Temperance&0. -botania.page.terraAxe1=It's not a Dead END - -# -- FLORAL OBEDIENCE STICK -botania.entry.obedienceStick=Floral Obedience Stick -botania.page.obedienceStick0=Nobody knows why, but attaching some &1Manasteel&0 to &1Livingwood Twigs&0 creates a stick type device that can make nearby flowers all bind towards a single focus point.
    Dubbed the &1Floral Obedience Stick&0, right clicking with it on a &1Mana Spreader&0 or &1Mana Pool&0 in the world will bind all relevant nearby flowers to it. -botania.page.obedienceStick1=This is not a dumb new age hat - -# -- SLIME IN A BOTTLE -botania.entry.slimeBottle=Slime in a Bottle -botania.page.slimeBottle0=Placing some slime in an &1Elementium Container&0 seems to have an interesting effect on said slime. When in an area where &1Slimes&0 would naturally spawn underground, the inanimate blob of slime starts jumping for some odd reason.
    This can definitely prove useful for harvesting slimeballs or setting up a &1Narslimmus&0 however. -botania.page.slimeBottle1=JUMPYDOLL - -# -- ROD OF THE SHIFTING CRUST -botania.entry.exchangeRod=Rod of the Shifting Crust -botania.page.exchangeRod0=&1Rod of the Shifting Crust&0 is a magical device with the ability to swap blocks in the world at very fast speeds. In order to achieve this, one must first select a block to swap with, this is done by shift-right clicking that block in the world.
    After this block is selected, left clicking any other block in the world will swap it for that block, assuming it's present in the user's inventory. -botania.page.exchangeRod1=Right clicking on a block in the world will start a larger transformation, which will swap all highlighted blocks into the one selected. Obviously, these blocks do come from the user's inventory as well. Only proper, full size blocks can be used for this swap, so no flowers, torches or other shenenigans of the sort. Using this power does, naturally, require &4Mana&0 from the user's inventory. -botania.page.exchangeRod2=Other rods or devices can be used to extend the power of the &1Rod of the Shifting Crust&0.
    For example, having a &1Rod of the Lands&0 in one's inventory provides the &1Rod of the Shifting Crust&0 with an endless supply of &1Dirt&0, assuming the &4Mana&0 cost for the &1Rod of the Lands&0' dirt conjuration is fulfiled. -botania.page.exchangeRod3=Bootlegged equal trade - -# -- MANAWEAVE CLOTH -botania.entry.manaweave=Manaweave Cloth -botania.page.manaweave0=&1Manaweave Cloth&0 is a type of fabric with powerful ties to the primal energies contained in &4Mana&0.
    Armor can be made of this cloth, &1Manaweave Robes&0, while they aren't very strong when it comes to raw resistance and strength, the robes make up for it with a powerful set bonus, making tools and rods cheaper to use, &4Mana&0 wise, and making the latter more powerful. -botania.page.manaweave1=Wearing the full set of &1Manaweave Robes&0 grants the wearer with increased proficiency when operating magical rods, increasing the power or range of them, or just their cost, for some of the more simpleton ones.
    &1Manaweave Robes&0 can use &4Mana&0 from one's inventory to repair themselves, similarly to &1Manasteel Armor&0, but, due to their affinities with the primal energies, at a lower mana cost. -botania.page.manaweave2=Weaving the threads of mana -botania.page.manaweave3=Creating the Cowl -botania.page.manaweave4=Creating the Robe Top -botania.page.manaweave5=Creating the Robe Bottom -botania.page.manaweave6=Creating the Boots - -# - ENDER ARTEFACTS -# -- EXTRACTING ENDER AIR -botania.entry.enderAir=Extracting Ender Air -botania.page.enderAir0=The air present in the void of the &1End&0 seems to have some mutating properties. Right clicking with an empty &1Glass Bottle&0 while in the &1End&0 will capture some of that air, which can then later be tossed similarly to a splash potion, turning nearby &1Stone&0 on the landing point into &1End Stone&0. - -# -- ENDER OVERSEER -botania.entry.enderEyeBlock=Ender Overseer -botania.page.enderEyeBlock0=The eyes of an &4Enderman&0 have an interesting sensitivity to being watched. A block out of these will simply output a &4redstone signal&0 if a player within a 64 block radius is looking directly at it.
    Of course, wearing a &1Pumpkin&0 negates this effect. -botania.page.enderEyeBlock1=MY BRAND - -# -- FORCE RELAY -botania.entry.pistonRelay=Force Relay -botania.page.pistonRelay0=It seems that infusing &1Pistons&0 with &4Mana&0 results in some interesting adverse effects.
    This block tears the fabric of space, relaying any piston force applied to it to the block it's bound to. -botania.page.pistonRelay1=To bind it to a block, right click it with a &1Wand of the Forest&0, and right click on the block you want to bind it to.
    Furthermore, this block is highly unstable, and may create uncanny effects, care is to be taken, it is also resistant to glue, both in pulling and pushing. This allows for a "frame" like setup. -botania.page.pistonRelay2=Infusing a &1Piston&0 with &4Mana&0. - -# -- HAND OF ENDER -botania.entry.enderHand=Hand of Ender -botania.page.enderHand0=The &1Hand of Ender&0 allows the user to access the interdimensional ender field, on other words, their &1Ender Chest&0 inventory. This can be done anywhere by right clicking with the hand at the cost of some &4Mana&0.
    Using the hand on another player will open up &otheir&r inventory instead, at a lot higher &4Mana&0 cost. -botania.page.enderHand0a=The &1Hand of Ender&0 allows the user to access the interdimensional ender field, on other words, their &1Ender Chest&0 inventory. This can be done anywhere by right clicking with the hand at the cost of some &4Mana&0. -botania.page.enderHand2=Furthermore, simply having a &1Hand of Ender&0 present in one's inventory, allows for the &1Rod of the Shifting Crust&0 to be provided with items from that player's &1Ender Chest&0, this comes at an increased &4Mana&0 cost compared to that of the normal use of the rod. -botania.page.enderHand1=Zezima hates him! -botania.page.enderHand1a=It's like the 4G of Ender Chests - -# -- SOULSCRIBE -botania.entry.enderDagger=Soulscribe -botania.page.pistonRelay0=It seems that infusing &1Pistons&0 with &4Mana&0 results in some interesting adverse effects.
    This block tears the fabric of space, relaying any piston force applied to it to the block it's bound to.
    To bind it to a block, right click it with a &1Wand of the Forest&0, and right click on the block you want to bind it to. -botania.page.pistonRelay1=To break the block, shift-right click it with a &1Wand of the Forest&0, any other means will destroy it.
    Furthermore, this block is highly unstable, and may create uncanny effects, care is to be taken. It is also resistant to glue, both in pulling and pushing. This allows for a "frame" like setup. -botania.page.enderDagger2=Strike my Soul - -# -- LIFE IMBUER -botania.entry.spawnerClaw=Life Imbuer -botania.page.spawnerClaw0=&1Monster Spawners&0 are an interesting bunch. They have the ability to bring out life from thin air, but somehow, this only manifests when there's a player nearby.
    This, of course, tends to be a rather limiting factor in the onslaught of any creatures that they can create. -botania.page.spawnerClaw1=By placing a &1Life Imbuer&0 on top of a &1Monster Spawner&0 and giving it a rather decent chunk of &4Mana&0 through a &1Mana Spreader&0, when there aren't any players in the nearby vicinity, the &4Mana&0 will power the spawner, just as if there were players around. -botania.page.spawnerClaw2=Something something shadow dragon - -# -- RED STRING -botania.entry.redString=빨간색 String -botania.page.redString0=Lore says the Gods tie a red string around the ankles of people who are supposed to affect each others lives. This led inventors to come up with a way of connecting blocks over the air, called, of course, &1빨간색 String&0. Blocks created with this exquisite material can face in all 6 basic directions and bind to the first available and compatible block they can find, given a range. -botania.page.redString1=Each &4빨간색 Stringed&0 block has a different criteria to what it'll bind to, but the distance in which they'll bind stays constant between the variations. The string can be viewed, if a block is bound, by holding a &1Wand of the Forest&0.
    Blocks being in the way will not break the connection. Lastly, &1빨간색 String&0 blocks can't be chained. -botania.page.redString2=Are you in a pinch? -botania.page.redString3=Starting off, the &1빨간색 Stringed Container&0 will bind to any inventory (&1Chests&0, &1Furnaces&0, &1Hoppers&0, etc), items can be put into it using &1Hoppers&0 or any other means of insertion. The items will end up in the block it's bound to, and will enter from the same side as they were put on the &1빨간색 Stringed Container&0 itself. -botania.page.redString4=The &1빨간색 Stringed Container&0. -botania.page.redString5=The &1빨간색 Stringed Dispenser&0 can be bound to &1Dispensers&0 or &1Droppers&0, it functions similarly to the &1빨간색 Stringed Container&0 where items can also be placed in the bound block through it. When a redstone signal is given to it, the &1Dispenser&0 or &1Dropper&0 in the end will fire. -botania.page.redString6=The &1빨간색 Stringed Dispenser&0. -botania.page.redString7=The &1빨간색 Stringed Nutrifier&0 can be bound to any block that can be fertilized with &1Bone Meal&0. Using &1Bone Meal&0 on the block will fertilize the bound block instead. -botania.page.redString8=The &1빨간색 Stringed Nutrifier&0. -botania.page.redString9=The &1빨간색 Stringed Comparator&0 can be bound to any block whose status can be read with a &1Container&0, such as &1Chests&0, &1Mana Pools&0, &1Runic Altars&0, etc. Placing a &1Comparator&0 pointing outwards of this block will send the signal equal to the signal a &1Comparator&0 would send on the bound block. -botania.page.redString10=The &1빨간색 Stringed Comparator&0. -botania.page.redString11=Lastly, the &1빨간색 Stringed Spoofer&0 is an interesting one. Any flower with an effect can be placed on it. The block will bind to any flowers or mushrooms. While there's a flower on top of the block, that flower will not do anything, but the bound block will take all of that flower's properties and work as if it was the flower itself. -botania.page.redString12=The &1빨간색 Stringed Spoofer&0. - -# -- FLUGEL TIARA -botania.entry.flightTiara=Flügel Tiara -botania.page.flightTiara0=The &4Flügel&0 were once a dominant species in the lands, now they're but a race past extinct, once created as godslayers, who possessed the ability of flight.
    The usage of &1Gaia Spirits&0 allows for a small replica of their power, in the form of the &1Flügel Tiara&0, which, at the cost of &4Mana&0 allows for flight. -botania.page.flightTiara4=Not all is perfect with reproducing old technology though, the tiara has its flaws, that meaning it can't provide the power of flight constantly. If used for over ten seconds without letting it recharge it'll stop being able to provide the power of flight.
    A "flight bar" is displayed on the HUD to help monitor this. -botania.page.flightTiara5=In addition to simple flight, the tiara grants the wearer the ability to &4dash&0 and &4glide&0. Pressing the sprint key (CTRL by default) while flying, provided one isn't sprinting already, will start a dash, a quick speed boost in the direction the wearer's facing.
    Dashes can only be done every 2 seconds. -botania.page.flightTiara6=Gliding allows one to gently descend to the ground while also covering a decent horizontal distance. It also prevents fall damage. To glide, one would simply sneak while falling.
    Gliding can be executed even with an empty flight bar, but while gliding, the flight bar regenerates slower than normally. -botania.page.flightTiara1=Forty thousand books from another world -botania.page.flightTiara2=Combining the Tiara with a variety of Quartz species allows for it to create various different kinds of aesthetic wings, one for each style of quartz.
    The recipes for the various types of quartz can be found in the &4Decorative Blocks&0 entry under &4Miscellaneous&0, &1Elven Quartz&0 is acquired by trading &1Nether Quartz&0 with the elves. -botania.page.flightTiara3=Adding Wings (they can be swapped any time) - -# -- BASICS OF CORPOREA -botania.entry.corporea=Basics of Corporea -botania.page.corporea0=&4Corporea&0 is a magical system that utilizes the energy of the end and the empty space in the world to transport items from point A to point B instantly and without any connecting parts.
    The system works through a variant of &1Sparks&0, &1Corporea Sparks&0. These share some similarities with normal &1Sparks&0 but also a fair few differences. -botania.page.corporea1=Starting off, they can go on top of any &4Inventory&0, like a &1Chest&0 or a &1Dispenser&0 as opposed to &4Mana Containers&0, secondly, there's two types of &1Corporea Sparks&0, the basic &1Corporea Spark&0 and the &1Master Corporea Spark&0. These sparks work in a network-like system, each &1Master Corporea Spark&0 designates a &4Corporea Network&0, in which any spark can communicate with other sparks present in it. -botania.page.corporea2=When a &1Corporea Spark&0 is placed or polled, each spark will poll any nearby sparks, adding them to the network designated by the single &1Master Corporea Spark&0 and also polling other nearby sparks, in a chain. While each individual spark can only reach a few blocks, combined, the entire network can go for a virtually infinite distance. -botania.page.corporea3=&1Corporea Sparks&0 have a view of the inventory directly below them, but can only access items from the top side. Each &1Corporea Spark&0 has the ability to view every other spark in the network and its contents, and the ability to request them as necessary, depending on the type of block below it. -botania.page.corporea4=It's to note that the &1Master Corporea Spark&0, while being part of the network, can not have the items in its inventory extracted from.
    Futhermore, no requests for items in the network are ever done passively. Corporea does not have the ability to add new items to the network, those should be inserted physically through &1Hoppers&0 or other methods. -botania.page.corporea5=Similarly to normal &1Sparks&0, &1Corporea Sparks&0 have a method of augmentation, that being the ability to color them. While in the world, there's an icon floating around the spark that shows which color it has, this can be changed by right clicking on the spark with a piece of &1Floral Powder&0. These colors define networks. A spark may only be in the same network as another spark if the two have the same color. -botania.page.corporea6=The ability to color sparks allows for multiple different &4Corporea Networks&0 to be together in a close area, without interfering with each other.
    Viewing the network and removing the spark works exactly the same as a normal spark. Lastly, having two &1Master Corporea Sparks&0 of the same color nearby, while possible, is a bad idea and will cause conflicts and odd behaviour. -botania.page.corporea7=Creating &1Corporea Sparks&0 -botania.page.corporea8=And &1Master Corporea Sparks&0 - -# -- CORPOREA INDEX -botania.entry.corporeaIndex=Corporea Index -botania.page.corporeaIndex0=The biggest ability of a &4Corporea Network&0 is the ability to vocally request items from it by name. The &1Corporea Index&0 is an ender-crystal like block that can interface with a given &4Corporea Network&0 by having a &1Corporea Spark&0 placed on top of it.
    While in the world, approaching it will cause it to activate and show the radius in which it will stay activated. -botania.page.corporeaIndex1=While activated, the index will intercept any &4Chat Messages&0 sent by nearby players, taking them in as &4requests&0 and preventing them to be broadcasted to chat. From this, it'll request, from the network, items whose name matches the request. For example, writing "iron ingot" will have the index look through the network for a single &1Iron Ingot&0 and transport it towards itself, materializing it in the world. -botania.page.corporeaIndex2=Requests can be more complex than just a single item. For example "10 apples" will request, as described, 10 &1Apples&0. Writing "this" will search for items whose name equals the name of the item in the player's hand. Prepending or appending to a query "...", "~", "" or "?" will turn it into a "contains" rather than "equals" query. So writing "iron..." will find all items that have "iron" in their name, for example. -botania.page.corporeaIndex3=The plural form of an item's name may only be used case it's a regular noun when it comes to the plural (suffixed by "-s", "-es" or "-ies"), the singular version works just as well for requests of multiple items, such as "10 apple".
    "10 of this" requests 10 items whose name equals the item in the player's hand, as expected. -botania.page.corporeaIndex4=Examples of complex requests include "10 apples", "a stack of apples", "2 stacks of apples", "2 stacks and 20 apples", "half a stack of apples", "a dozen apples", and so on.
    The index will also recognise more or less verbose forms of request, so "2x stacks and 20x of apples" is equal to "2 stack 2 apple" or "2 stacks 2 apples". -botania.page.corporeaIndex5=Requesting with "all" or "every" will deliver every single item in the network that matches the criteria, so "all apples" will deliver all the apples in the network.
    On the other side, requesting "count", "show", "display" or "tell" won't request any, but will tell the requester how many exist in the network. -botania.page.corporeaIndex6=Lastly, while near a &1Corporea Index&0, writing part of an item's name and pressing TAB in the chat menu will autocomplete the item's name. -botania.page.corporeaIndex7=A certain magical one at that - -# -- CORPOREA FUNNEL -botania.entry.corporeaFunnel=Corporea Funnel -botania.page.corporeaFunnel0=A simpler block that utilizes the prospects of the &4Corporea Network&0 is the &1Corporea Funnel&0, when given access to a network through a &1Corporea Spark&0 on top, it'll pull a single item from the network when given a redstone signal.
    This item is put into an inventory 1 or 2 blocks below it, or case one doesn't exist or is full, tossed into the world right above the funnel. -botania.page.corporeaFunnel1=The &1Corporea Funnel&0 may only pull items that match its filter, similarly to a &1Hopperhock&0, the filter is designated by items contained on &1Item Frames&0 placed on it. The item pulled is one of the various items in the frames at random.
    Rotating the item changes how many will be requested at once, starting at 1, rotating once, twice and three times will pull 16, 32 and 64, respectively. -botania.page.corporeaFunnel2=Energistically applied - -# -- CORPOREA INTERCEPTOR -botania.entry.corporeaInterceptor=Corporea Interceptor -botania.page.corporeaInterceptor0=The &1Corporea Interceptor&0 does exactly as the name suggests, it intercepts corporea requests. First and foremost, &1Item Frames&0 with items need be attached around the block, these define what items will trigger the interceptor.
    Whenever a request is fired to the corporea network, be it from an Index, Funnel, etc, and there's no items in the network that can fulfil it this block will be triggered. -botania.page.corporeaInterceptor1=Of course, the the block is only triggered if the item requested matches one of items in the &1Item Frames&0 about it. When the block is triggered it'll emit a short redstone pulse. This can be used to do all sorts of things, such as craft the required item using &1Crafty Crates&0 or light up a lamp indicating that the inventory for a resource is out. -botania.page.corporeaInterceptor2=So many automation prospects - -# -- CORPOREA CRYSTAL CUBE -botania.entry.corporeaCrystalCube=Corporea Crystal Cube -botania.page.corporeaCrystalCube0=A seer usually looks through a crystal ball to see the future. Well, a corporea handler would look through a crystal cube to see the present. The &1Corporea Crystal Cube&0 acts as a visual medium to interact ith one's &4Corporea Network&0. Placing the block down and giving it a &1Corporea Spark&0 is the obvious first step to hooking it up to the network. -botania.page.corporeaCrystalCube1=When the block is connected, right clicking it with any sort of item will have it monitor that item, allowing someone who's looking at it see how many exist in the network. The display updates about once every second.
    While there's an item selected, left clicking the block will request one of that item from the network. Shift-left clicking requests a whole stack. -botania.page.corporeaCrystalCube2=I can see forever - -# -- DECORATIVE END BLOCKS -botania.entry.endStoneDecor=Decorative End Blocks -botania.page.endStoneDecor0=Similarly to other stone blocks, &1End Stone&0 can be converted into bricks and chiseled bricks, the bricks can be used as stairs or slabs just like normal &1Stone Bricks&0 would.
    &1Ender Pearls&0 can be combined with the bricks to create &1Ender Brick&0 blocks, which can also can be used for stairs or slabs. -botania.page.endStoneDecor1=Making &1End Stone Bricks&0 -botania.page.endStoneDecor2=Making &1Chiseled End Stone Bricks&0 -botania.page.endStoneDecor3=Making &1Ender Bricks&0 -botania.page.endStoneDecor4=Making &1Pillar Ender Bricks&0 - -# -- LIFE AGGREGATOR -botania.entry.spawnerMover=Life Aggregator -botania.page.spawnerMover0=By arranging &1Dragonstone&0, &1Elementium&0 and &1Gaia Spirits&0 in a specific pattern, one can create a device that can contain the curious energies of a &1Monster Spawner&0 and materialize it in another point in space.
    It's to note that the device will shatter after being used once. -botania.page.spawnerMover1=We got the spawner, but this isn't a won run yet - -# -- RESOLUTE IVY -botania.entry.keepIvy=Resolute Ivy -botania.page.keepIvy0=Everyone knows that before being ressurected, one's items splatter all over the ground, generally a massive nuisance. The fix for this is rather simple. By attaching a piece of &1Resolute Ivy&0 to an item through a crafting grid, that item will presist on one's inventory through death. The ivy will degenerate after that fact and will need to be applied again if one wishes to have the item survive another downfall. -botania.page.keepIvy2=There is, however, one restriction to the items in which this ivy can be attached to.
    For &otechnical reasons&r, the ivy may not be attached to any item that, upon being used in a crafting table, gives something in return, such as &1Buckets of Water&0 or the &1Mortar and Pestle&0. -botania.page.keepIvy1=Because people die when they are killed - -# -- BLACK HOLE TALISMAN -botania.entry.blackHoleTalisman=검은색 Hole Talisman -botania.page.blackHoleTalisman0=The void is a massive space full of... void, really. There's nothing there. But with some ingenuity, this space can be used to store items to your heart's content.
    The &1검은색 Hole Talisman&0 utilizes powerful Gaia and Ender magic to allow for a virtually infinite quantity of a single type of block to be stored in this space. -botania.page.blackHoleTalisman1=Right clicking a block in the world will set the talisman to store that type of block. This can only be done if the talisman is empty. Next off, shift-right clicking the talisman in the air will enable or disable it. Whilst enabled and in the user's inventory it'll absorb any blocks of the type into it.
    Placing the item in a crafting grid allows one to extract stacks of the blocks in it. -botania.page.blackHoleTalisman2=While the talisman has any contents in it, the blocks in it can be placed as if they were normal blocks stored in the inventory via a simple right click with it.
    Right clicking an inventory will try to fill it with the blocks stored in the talisman. Lastly, the talisman can provide the &1Rod of the Shifting Crust&0 with the blocks it contains. -botania.page.blackHoleTalisman3=Like a Rageki but twice as fun - -# -- LUMINIZER TRANSPORT -botania.entry.luminizerTransport=Luminizer Transport -botania.page.luminizerTransport0=&1Luminizers&0 serve as a simple way to transport players and other living things of the sort by having them ride on trails of light.
    &1Luminizers&0 can be placed in the world as blocks. A &1Luminizer&0, in order to work properly needs to be bound to another one. This can be done with the &1Wand of the Forest&0 in bind mode. Right clicking a &1Luminizer&0 will transport the clicker into the &1Luminizer&0 it's bound to. -botania.page.luminizerTransport1=&1Luminizers&0 have a range of twenty blocks each, but can be chained to create longer and more complex paths.
    The connection between two &1Luminizers&0 goes only one way, unless the binding is explicitly done both ways. If the connection does go both ways, an endless loop is created, though.
    Furthermore, multiple &1Luminizers&0 can target the same one as an endpoint. -botania.page.luminizerTransport2=Luminize to the future -botania.page.luminizerTransport3=Adding some redstone to a &1Luminizer&0 creates a &1Detector Luminizer&0. For all intents and purposes, it functions just like a regular &1Luminizer&0, however, it sends out a &4redstone pulse&0 every time something passes through it or reaches it as an endpoint. -botania.page.luminizerTransport4=Are you ready to draw? -botania.page.luminizerTransport5=While players can just right click the &1Luminizers&0, in order to get animals or other beings into the trails, a &1Luminizer Launcher&0 is required.
    This block needs to be placed down adjacent to &1Luminizers&0, and when it receives a &4redstone pulse&0, it'll randomly distribute all living beings on top of it into all of the adjacent &1Luminizers&0, causing them to go on their merry way. -botania.page.luminizerTransport6=Let's believe it, open the flag - -# -- STARCALLER -botania.entry.starSword=Starcaller -botania.page.starSword0=The &1Starcaller&0 is a blade with the power to call upon the wrath of the stars, when swung, there's a chance for the blade to summon a falling star heading towards where the wielder is looking, this star will deal damage upon impact with any entities. Creating this sword proves to be no easy task, as it requires &1Ender Air&0 and a &1Terra Blade&0. Keep in mind that the process does wipe the enchantments on the sword used. -botania.page.starSword1=Caller, fury, whatever... - -# -- THUNDERCALLER -botania.entry.thunderSword=Thundercaller -botania.page.thunderSword0=The &1Thundercaller&0 is a dual pronged sword with the ability to conjure lightning. Created using a &1Terra Blade&0, &1Ender Air&0 and some other materials, the &1Thundercaller&0 scarifices the power of long range attacks to be able to zap multiple targets.
    Attacks initiated with the &1Thundercaller&0 invoke upon chain lightning that homes on nearby hostile mobs, dealing decreasing damage per hit. -botania.page.thunderSword1=Blessed Blade of the Trade Chat - -# - BAUBLES AND ACCESSORIES -# -- AN INTRODUCTION TO BAUBLES -botania.entry.bIntro=An Introduction to Baubles -botania.page.bIntro0=&4Baubles&0, also commonly referred to as &4Trinkets&0 or &4Charms&0 are pieces of equipment which offer all sorts of different effects, when worn.
    To equip them, one can press the &4B&0 (configurable) key. There's four slots, one &4Amulet&0 slot, two &4Ring&0 slots and one &4Belt&0 slot. -botania.page.bIntro1=The &4Baubles Screen&0 -botania.page.bIntro2=It's to note that, if &4Thaumcraft&0 or any other mod that uses the baubles system is installed, this inventory will be shared between the various mods. - -# -- COSMETIC BAUBLES -botania.entry.cosmeticBaubles=Cosmetic Baubles -botania.page.cosmeticBaubles0=A large selection of &1Cosmetic Baubles&0 is available to change or add style to any baubles a player has equipped. These can both be worn by themselves, on the amulet slot, or crafted alongside another &4Bauble&0 in a crafting grid to change the look of the bauble to the new &4Cosmetic Override&0. Removing &4Cosmetic Overrides&0 can be done through putting the bauble back in the crafting grid. -botania.page.cosmeticBaubles1=Creating these is done through an interesting method, weaving a specific color of petal around some &1Mana Infused String&0 creates an item. The type of item created doesn't seem to have anything to do with the color.
    How this works really isn't too well known, it's like the person that came up with this didn't bother to use better materials or something, who knows. -botania.page.cosmeticBaubles2=They're cool -botania.page.cosmeticBaubles3=My desires are... unconventional -botania.page.cosmeticBaubles4=How unpleasant -botania.page.cosmeticBaubles5=It's cold in Kalos -botania.page.cosmeticBaubles6=Do they reveal anything? -botania.page.cosmeticBaubles7=Shut up Alexander and the Trajan -botania.page.cosmeticBaubles8=The eye has to be hidden -botania.page.cosmeticBaubles9=Not for bean sprouts -botania.page.cosmeticBaubles10=The best color -botania.page.cosmeticBaubles11=Tilting the umbrella too much -botania.page.cosmeticBaubles12=The Neighbours' Club -botania.page.cosmeticBaubles13=Nyaa -botania.page.cosmeticBaubles14=Don't get too ahead of yourself -botania.page.cosmeticBaubles15=Evil up! -botania.page.cosmeticBaubles16=Nudistoooooooooo -botania.page.cosmeticBaubles17=(insert reference here) -botania.page.cosmeticBaubles18=Lurk moar -botania.page.cosmeticBaubles19=I need your time -botania.page.cosmeticBaubles20=So rare -botania.page.cosmeticBaubles21=Oh hey, Loki -botania.page.cosmeticBaubles22=Challenge up! -botania.page.cosmeticBaubles23=Representing! -botania.page.cosmeticBaubles24=Reminds me of a puzzle -botania.page.cosmeticBaubles25=You've met with a terrible fate, haven't you? -botania.page.cosmeticBaubles26=Thanks for the gold stranger -botania.page.cosmeticBaubles27=Woah, colors -botania.page.cosmeticBaubles28=Who the hell do you think I am? -botania.page.cosmeticBaubles29=Nothing suspicious here, nope -botania.page.cosmeticBaubles30=I can fly with these -botania.page.cosmeticBaubles31=Not actually part of spain -botania.page.cosmeticBaubles32=Now you too can believe -botania.page.cosmeticBaubles33=Get on the treadmill, angbadang - -# -- TINY PLANET -botania.entry.tinyPlanet=Tiny Planet -botania.page.tinyPlanet0=The &1Tiny Planet&0 is a &4Bauble&0 with gravitational proprieties, while equipped, the &1Tiny Planet&0 will pull any nearby &4Mana Bursts&0 towards the wearer, having them orbit around him or her.
    By increasing its mass with some &1Stone&0, it can also be placed in world, for the same effect. -botania.page.tinyPlanet1=Clearly from rebirth -botania.page.tinyPlanet2=More of a planet than Pluto - -# -- BAND OF MANA -botania.entry.manaRing=Band of Mana -botania.page.manaRing0=Combining a &1Mana Tablet&0 with some &1Manasteel&0 creates an easily worn &4Ring&0, that functions exactly similar to the tablet used to make it, but can be worn as a &4Bauble&0.
    Using some &1Terrasteel&0 allows for an upgrade, which lets it store about four times as much &4Mana&0. -botania.page.manaRing1=Creating the ring -botania.page.manaRing2=Upgrading the ring - -# -- BAND OF AURA -botania.entry.auraRing=Band of Aura -botania.page.auraRing0=The &1Band of Aura&0 is a bit of a deviation from the typical &1Band of Mana&0, in which, instead of storing &4Mana&0, it slowly, while equipped, creates it and stores it into &4Mana&0 containing items in the wearer's inventory.
    Using some &1Terrasteel&0 allows for an upgrade, which lets it generate &4Mana&0 at a significantly faster rate. -botania.page.auraRing1=Creating the ring -botania.page.auraRing2=Upgrading the ring - -# -- SOUJOURNER'S SASH -botania.entry.travelBelt=Soujourner's Sash -botania.page.travelBelt0=Traversing terrain sometimes proves to be a hassle. The &1Soujourner's Sash&0 can be equipped in the &4Belt&0 slot, and when worn will increase the movement speed, jump height and resistance to fall damage of the wearer. This power comes at a small &4Mana&0 cost.
    Lastly, if not sneaking, it also allows the wearer to walk over 1 block high gaps without jumping with ease. -botania.page.travelBelt1=...everell - -# -- TECTONIC GIRDLE -botania.entry.knockbackBelt=Tectonic Girdle -botania.page.knockbackBelt0=By harnessing the forces of tectonic movement, the &1Tectonic Girdle&0, when worn, will negate any &4Knockback&0 applied to the wearer by outside attacks. -botania.page.knockbackBelt1=I'm the man who can't be moved - -# -- SNOWFLAKE PENDANT -botania.entry.icePendant=Snowflake Pendant -botania.page.icePendant0=The &1Snowflake Pendant&0 is a &4Bauble&0 that resonates freezing energy, while it's worn, any nearby still &1Water&0 blocks at foot level will be converted into &1Ice&0.
    The &1Ice&0 will melt shortly afterward the wearer leaves the area. Lastly, this charm will not freeze any blocks if the wearer is sneaking or fully submerged. -botania.page.icePendant1=Do you want to build a snowman? - -# -- PYROCLAST PENDANT -botania.entry.lavaPendant=Pyroclast Pendant -botania.page.lavaPendant0=The &1Pyroclast Pendant&0 is a &4Bauble&0 that absorbs low heat, while it's worn, if the wearer is caught on fire and is not directly standing on &1Fire&0, &1Lava&0 or anything else that can induce burning, they'll be extinguished. -botania.page.lavaPendant1=Hanako could have used one of these - -# -- GOLDEN LAUREL CROWN -botania.entry.goldenLaurel=Golden Laurel Crown -botania.page.goldenLaurel0=One of the uses for &1Gaia Spririts&0 is to, grant a layer of immortality to one that uses them, while wearing a &1Golden Laurel Crown&0, if the wearer were to die, the crown will shatter, regenerating all of their health and giving them a short period of invincibility. -botania.page.goldenLaurel1=Given the theme, probably Viridi - -# -- RING OF CHORDATA -botania.entry.waterRing=Ring of Chordata -botania.page.waterRing0=The &1Ring of Chordata&0 allows the wearer to swim like a fish. While it's equipped, the wearer is bestowed with the ability to accelerate to a decent speed while underwater. It also gives the wearer good sight underwater and, if &4Mana&0 is present, at the cost of some of it, the ability to breathe indefinitely. -botania.page.waterRing1=Check out that fish AI - -# -- RING OF THE MANTLE -botania.entry.miningRing=Ring of the Mantle -botania.page.miningRing0=The &1Ring of the Mantle&0 allows one to mine faster, while equipped and &4Mana&0 is present in the inventory, it'll give a &4Haste&0 effect to the wearer. Some &4Mana&0 is used while the wearer swings their arm or equipped item, be it for attacking, mining or just flailing. -botania.page.miningRing1=Diggy diggy hole - -# -- RING OF MAGNETIZATION -botania.entry.magnetRing=Ring of Magnetization -botania.page.magnetRing0=By turning a &1Magnetizing Lens&0 into a wearable ring, one can use it to magnetize nearby items. While equipped, this ring will make any nearby items magnetize towards the wearer if they're not sneaking. A notable feature of this piece is that it'll negate its effect for 5 seconds after the wearer tosses an item so as to not interfere with whatever means it was tossed for. A &1Solegnolia&0 can disrupt this ring's functionality. -botania.page.magnetRing1=How do they work? -botania.page.magnetRing2=Upgrading the ring for a larger range - -# -- RING OF FAR REACH -botania.entry.reachRing=Ring of Far Reach -botania.page.reachRing0=Through the power of one's Pride, nothing is out of their reach. By wearing the &1Ring of Far Reach&0, the maximum distance the wearer can break, place or interact with blocks, as well as attack or interact with entities is increased by about three blocks. -botania.page.reachRing1=Fire and Blood - -# -- CHARM OF THE DIVA -botania.entry.divaCharm=Charm of the Diva -botania.page.divaCharm0=The &1Charm of the Diva&0 blesses the wearer with the ability to have any attacked mob follow the attacker's will, and, case there are any nearby enemies, go after them instead. This process, of course, requires a bit of &4Mana&0 from the wearer's inventory in order to function. -botania.page.divaCharm1=You shall not disrespect Big Sister - -# -- GREAT FAIRY RING -botania.entry.pixieRing=Great Fairy Ring -botania.page.pixieRing0=This ring works alongside the &1Elementium Armor&0, insight in the powers of it is advised before using this ring. When worn, the &1Great Fairy Ring&0 will increase the chance for a &4Pixie&0 to spawn when the wearer is hit, this still holds true case no &1Elementium Armor&0 is equipped. -botania.page.pixieRing1=We got square heads, big pointy caps - -# -- GLOBETROTTER'S SASH -botania.entry.superTravelBelt=Globetrotter's Sash -botania.page.superTravelBelt0=The &1Globetrotter's Sash&0 is, in layman's terms, an upgrade to then &1Soujourner's Sash&0, by using &1Gaia Spirits&0 and some Elven resources, this new belt allows the wearer to reach incredible speeds to which the &1Soujourner's Sash&0 doesn't stand a chance. -botania.page.superTravelBelt1=No time for guessing, follow my plan instead - -# -- THE SPECTATOR -botania.entry.itemFinder=The Spectator -botania.page.itemFinder0=&1The Spectator&0 is a headband that allows the wearer to have a better perception of the world. While holding an item, any &4containers&0 (chests, minecarts, donkeys with chests, furnaces, etc...) that have an item of that type, &4dropped items&0 of that type, &4mobs&0 who have that item equipped &o(...)&r -botania.page.itemFinder1=&o(...)&r &4players&0 who have the item in their inventory and &4villagers&0 who want to trade either with or for that item will shine with a colorful glow, allowing them to be easily spotted.
    While sneaking, all dropped items around the wearer will shine, regardless of the item. -botania.page.itemFinder2=Do you hear their voices? - -# -- CRIMSON PENDANT -botania.entry.superLavaPendant=Crimson Pendant -botania.page.superLavaPendant0=The &1Crimson Pendant&0 is, in simple terms, an upgraded counterpart to the &1Pyroclast Pendant&0, wearing it provides the wearer immunity to all fire and lava damage, instead of just extinguishing them. -botania.page.superLavaPendant1=Runner-up on Monolith Code - -# -- TAINTED BLOOD PENDANT -botania.entry.bloodPendant=Tainted Blood Pendant -botania.page.bloodPendant0=Messing around with the original source of the &4Potion&0 design, the Nether, seems to work fairly well at harnessing that very power.
    The &1Tainted Blood Pendant&0 allows one to store a &4Brew&0 in a condensed, wearable state. Infusing this pendant with one and wearing it will apply the effect while it's worn, for the cost of &4Mana&0 depending on the power of the &4Brew&0. -botania.page.bloodPendant1=To infuse the pendant with a &4Brew&0 the normal procedure of infusing one on a &1Vial&0 is what's required. The cost increases by a tenfold, though.
    However, the pendant will not accept any and all effects, a few don't seem to behave well, such as &4Instant Health&0 or &4Absorption&0. Lastly, &4Brews&0 with more than one effect will fail as well. -botania.page.bloodPendant2=I'll get Saber for sure - -# -- CLOAKS OF JUDGEMENT -botania.entry.judgementCloaks=Cloaks of Judgement -botania.page.judgementCloaks0=The &1Cloaks of Judgement&0 are a pair of cloaks that can be worn instead of a belt (and thus, they go in the Belt slot). Their strength triggers when their wearer takes damage. After that, they'll go in a ten second recharge period in which their effects won't trigger. -botania.page.judgementCloaks1=The &1Cloak of Virtue&0 will, when active, block the full extent of a piece of damage taken. This does not apply to magic damage.
    The &1Cloak of Sin&0 will damage all nearby hostile mobs for the same amount of damage that was taken. -botania.page.judgementCloaks2=A Holy Mantle -botania.page.judgementCloaks3=Taste Vengeance! - -# -- MANASEER MONOCLE -botania.entry.monocle=Manaseer Monocle -botania.page.monocle0=A handy accessory for one who requires a thorough window into where their &4Mana Bursts&0 are going is the &1Manaseer Monocle&0. Not only is it a rather fancy eyepiece but it also allows the wearer to see all nearby &4Mana Bursts&0, even if their line of sight towards them is blocked by something. More important, perhaps, is that when someone wearing this monocle looks at a flower they'll be able to see its functional radius. -botania.page.monocle1=Why hello there old chap - -# -- RING OF CORRECTION -botania.entry.swapRing=Ring of Correction -botania.page.swapRing0=Switching tools is a pain. People often find themselves shoveling away at dirt with... a pick? Using the &1Ring of Correction&0 is a great way to, well, correct that.
    While this ring is worn, the tool in hand will always be the right one for the block being broken, be it a pick, axe or shovel. This only works with tools that can use &4Mana&0. -botania.page.swapRing1=Use the right tools - -# - ALFHOMANCY -# -- THE PORTAL TO ALFHEIM -botania.entry.aIntro=The Portal to Alfheim -botania.page.aIntro0=It's said that once, &4Elves&0 used to share the world with us &4Minecrafters&0. Due to unknown events, they would've been banished back to their own world, &4Alfheim&0.
    Experimentation has been done in attempt to bridge the gap between the two worlds, and means of creating a portal that does just that have been devised. -botania.page.aIntro1=Creating this portal proves not to be an easy task, as quite a few exquisite resources are necessary. The requirements are as follows: 8 &1Livingwood&0 blocks, 3 &1Glimmering Livingwood&0 blocks, 1 &1Elven Gateway Core&0 (read on), 2 &1Mana Pools&0 and 2 &1Natura Pylons&0 (read on). -botania.page.aIntro2=Creating the &1Elven Gateway Core&0 -botania.page.aIntro3=Creating &1Natura Pylons&0 -botania.page.aIntro4=Alfheim Portal -botania.page.aIntro5=To open up the portal, simply right click the core with a &1Wand of the Forest&0.
    The portal requires a substantial amount of &4Mana&0 deposited in both the pools to open up, after that, it'll slowly drain some to keep itself powered. If it runs out of &4Mana&0, the connection will be broken. -botania.page.aIntro6=The amount of &4Mana&0 required to open up the portal is orders of magnitude higher than that to keep it maintained, thus closing the portal to prevent &4Mana&0 loss is a poor strategy.
    Furthermore, the link isn't strong enough to allow living beings to go through it, but it seems that &4items&0 can. -botania.page.aIntro7=The amount of information about &1Alfheim&0 stored in this lexicon is limited to this entry alone. Perhaps &4letting the&0 &4Elves have a look at it&0 might prove beneficial.
    Perhaps they'd also return a good amount of knowledge of their mystical constructs. - -# -- A MESSAGE FROM ELVEN GARDE -botania.entry.elfMessage=A Message from Elven Garde -botania.page.elfMessage0= -# ^ This is blank on purpose -botania.page.elfMessage1=&oGreetings. We noticed that our portal was opened via a link from another world. That's rather shocking news indeed. We thank you very much for providing us with a repository of the knowledge from your world, as to keep us up to date to what happened since we left it, it's been a while since then, it's good to see it's doing well. -botania.page.elfMessage2=&oAfter some discussion with the high council of Elven Garde, we have decided to cooperate with you. You see, reading through your "Lexica 보타니아" has shown us a good amount of resources from your world that we would be extremely keen as to get our hands on, as these are non-existent in our lands. -botania.page.elfMessage3=&oThe link you have managed to establish is rather weak, no living beings will be able to go through, as you already know. However, there's a positive side to this, the link strikes the fabric of time of both our worlds in a way where it doesn't keep them in sync, that's the reason why you received your book back so quickly. -botania.page.elfMessage4=&oWhen it comes to Mana and other magical energies, we are plenty stocked on them, so worry not about the portal closing on our end. Let's put this in prospect, in order for the advance of both our civilizations, we vow to accept a given set of resources from your world we lack in ours in exchange for resources you lack in yours. -botania.page.elfMessage5=&oWe have taken the liberty of assigning our best scribes to put together a great set of knowledge from our world we're willing to share, you can find it in your lexicon just as you'd find knowledge from yours. We hope you find it enlightening and that it encourages you to invest in our materials. -botania.page.elfMessage6=&oLast but not least, do keep in mind that if you decide to send something we have not vouched to trade for, we will assume it as a gift and keep it for ourselves, just as a forewarning. We look forward to exchanging resources with you.
    Best Regards, the High Council of Elven Garde. - -# -- THE RESOURCES OF ALFHEIM -botania.entry.elfResources=The Resources of Alfheim -botania.page.elfResources0=&4Alfheim&0 contains a very varied amount of exquisite resources. Sadly though, most of them are extremely scarce and hard to come by due to competition between the various clans. The elves are interested in trading some materials, such as &1Dreamwood&0, &1Elementium&0, &1Pixie Dust&0 or &1Dragonstone&0, resources native to their lands. -botania.page.elfResources1=Trading for &1Dreamwood&0 -botania.page.elfResources2=&1Dreamwood&0, similarly to &1Livingwood&0 can be turned into various &4Decorative Blocks&0, have a look through the &4Decorative Blocks&0 entry under &4Miscelaneous&0 for the recipes. -botania.page.elfResources10=&1Dreamwood Twigs&0 -botania.page.elfResources3=Trading for &1Elementium&0 -botania.page.elfResources4=Trading for &1Pixie Dust&0 -botania.page.elfResources5=Trading for &1Dragonstone&0 -botania.page.elfResources6=The &1Elves&0 are also quite keen on the white posh block from the &4Nether&0, &1Nether Quartz&0, the ones they have on their world are tinted green. This quartz works just like any other quartz, be it normal &1Nether Quartz&0 or any of the decorative variants you can find on the &4Decorative Blocks&0 entry under &4Miscelaneous&0. -botania.page.elfResources7=Trading for &1Elven Quartz&0 -botania.page.elfResources8=Alfheim also has its own variant of &1Glass&0, in the form of &1Alfglass&0. Its look is rather light and its patterns are randomized depending on where it's placed.
    Trading goes for &1Managlass&0. -botania.page.elfResources9=Trading for &1Alfglass&0 - -# -- RITUAL OF GAIA -botania.entry.gaiaRitual=Ritual of Gaia -botania.page.gaiaRitual0=The &4Ritual of Gaia&0 is a procedure often enacted by the elves, which is the only way to acquire &1Gaia Spirits&0, which are essences of the power of the Goddess of Gaia herself.
    This ritual required an &4Active&0 &1Beacon&0 with some &1Gaia Pylons&0 (read on) one level above the beacon as the altar, as well as a single &1Terrasteel Ingot&0 as a sacrifice. -botania.page.gaiaRitual1=Creating &1Gaia Pylons&0 -botania.page.gaiaRitual2=Ritual of Gaia -botania.page.gaiaRitual3=To start the ritual, simply shift-right click the &1Beacon&0 block with a &1Terrasteel Ingot&0, take a step back and prepare to fight for your life. Good preparation is required, as the fight with the &4Guardian of Gaia&0 can be even harder than that of the &4Wither&0. Upon defeating the &4Guardian&0, one can collect their prize, a handful of &1Spirits of Gaia&0. -botania.page.gaiaRitual4=The common attire for this ritual is a set of Enchanted &1Elementium Armor&0, a &1Terra Blade&0 and a large assortment of &4Brews&0 and &4Baubles&0. The effect of the &1Beacon&0 is nullified during the battle, so that should be taken in mind. -botania.page.gaiaRitual5=The difficulty and rewards bestowed by the ritual depend on the amount of people participating. Executing the ritual with over five people might be a recipe for disaster due to the chaos created, so collaborative rituals of that scale shouldn't be attempted.
    Lastly, staying away from the purple might be a good idea. - -# -- RITUAL OF GAIA II -botania.entry.gaiaRitualHardmode=Ritual of Gaia II -botania.page.gaiaRitualHardmode0=One would think that combining two of the most powerful resources known to existance, in the form of &1Terrasteel&0 and &1Gaia Spirits&0 would create an unstoppable material. It seems that the material is very much stoppable, though. In fact, the two forces cancel eachother out when combined into an ingot, creating an utterly useless alloy. -botania.page.gaiaRitualHardmode1=This ingot, though, due to the concentrated energy and power in it, does allow for the summoning of a stronger &1Gaia Guardian&0, with more resistance, strength and speed.
    For all of this, it also drops more &1Gaia Spirits&0 than normal, as well as a handful of goodies and rare treasure, making it a worthwhile foe. -botania.page.gaiaRitualHardmode2=Creating the &1Gaia Spirit Ingot&0. - -# -- THE RELICS OF THE AESIR -botania.entry.relics=The Relics of the Aesir -botania.page.relics0=There's an old tale from the high clans of Alfheim. It says something among the lines of "The one who rolls the Dice of Fate is to be rewarded with the Gifts of the Gods". These so called &1Relics of the Aesir&0 are rumored to be unique and soulbound, by which only one will ever be awarded to any one individual and only they might use it.
    But then again, it's probably just folklore. - -# -- THE RELICS OF THE AESIR II -botania.entry.relicInfo=The Relics of the Aesir II -botania.page.relicInfo0=It appears as if the speculated relics are, in fact, real. These items, materialized from rolls of the &1Dice of Fate&0 possess incredible powers, the fact that the dice is six-sided possibly indicates to the existance of six of these.
    Relics seem to contain knowledge of who earned them, and thus giving someone else a relic that doesn't belong to them might be a poor idea. -botania.page.relicInfo1=According to the original texts, the same relic may not be awarded to any one person twice, so keeping the item safe is a priority. Perhaps something like &1Resolute Ivy&0 would be a good investment.
    Interestingly enough, earning a relic also imparts upon this lexicon the knowledge on how to use it. How useful. - -# -- THE FRUIT OF GRISAIA -botania.entry.infiniteFruit=The Fruit of Grisaia -botania.page.infiniteFruit0=The relic known as &1The Fruit of Grisaia&0 is bestowed with the power to eternally nourish the brave soul who earned it. It can be eaten similarly to any other piece of food, but instead of utilizing matter to feed, it uses &4Mana&0 from one's inventory.
    Hope you like the taste of apple though. - -# -- KEY OF THE KING'S LAW -botania.entry.kingKey=Key of the King's Law -botania.page.kingKey0=The &1Key of the King's Law&0 is a powerful relic with the ability to materialize weapons at command. Holding right click with this key will summon a plenthora of varied weapons from... somewhere. Up to twenty weapons can be created at once. Releasing the grip on the key will launch all the weapons, one at a time, where the summoner is looking at, at high speed. These weapons will create an explosion on contact. - -# -- EYE OF THE FLUGEL -botania.entry.flugelEye=Eye of the Flügel -botania.page.flugelEye0=Unlike the fabricated &1Flügel Tiara&0, the &1Eye of the Flügel&0 contains primordial &4Flügel&0 magic. Magic strong enough, in fact, to harness the &4Flügels&0' ability to recall themselves to a place they've visited.
    Shift-right clicking with this eye somewhere will bind it to that position. After that, holding right click for a while will recall the user back to the aforementioned location. -botania.page.flugelEye1=This teleportation ability not only costs &4Mana&0 but can not be executed across two different dimensions, sadly enough.
    Aside from that, simply being in possession of an &1Eye of the Flügel&0 allows a wearer of the &1Flügel Tiara&0 to fly past the normal limits, at a higher cost, of course. - -# -- RING OF THOR -botania.entry.thorRing=Ring of Thor -botania.page.thorRing0=One of the three mythic rings of the &4Aesir&0, the &1Ring of Thor&0, when worn, bestows upon the wearer the might of the Thunder God &4Thor&0. This power drastically increases the strength of area of effect mining with a &1Terra Shatterer&0.
    This ring can be combined with the other two rings of the &4Aesir&0 in a crafting table to create the ultimate ring. - -# -- RING OF LOKI -botania.entry.lokiRing=Ring of Loki -botania.page.lokiRing0=One of the three mythic rings of the &4Aesir&0, the &1Ring of Loki&0 allows for the wearer to tap upon the Trickster God &4Loki&0 to effectively be in multiple places at once.
    The setup for this ability requires, first and foremost, an empty hand. Shift-right clicking on a block with said empty hand while having the &1Ring of Loki&0 equipped begins the procedure. -botania.page.lokiRing1=Once the source block is selected, shift-right clicking on other blocks in the world will add them to the relative positions affected by this power. In order to finish the procedure, one would shift-right click the original block.
    Shift-right clicking on one of the blocks that has been selected will remove it. To reset a completed selection, shift-right click the ground twice. -botania.page.lokiRing2=After the selection is complete, when looking around, one will notice multiple boxes in relative positions to the selected block. When a block is placed, the placing action is mimicked on all of those positions, allowing for one to place a large amount of blocks at once.
    This ability also extends to destruction using the &1Terra Shatterer&0 or &1Terra Truncator&0. -botania.page.lokiRing3=Such a power does not come for free of course. Utilizing this ability costs &4Mana&0 from the user's inventory per each block placed. It's to note that the more blocks that are selected, the more expensive &4each placed block&0 becomes.
    Lastly, this ring can be combined with the other two rings of the &4Aesir&0 in a crafting table to create the ultimate ring. - -# -- RING OF ODIN -botania.entry.odinRing=Ring of Odin -botania.page.odinRing0=One of the three mythic rings of the &4Aesir&0, the &1Ring of Odin&0 grants its wearer the vitality and resistance of the Elder God &4Odin&0. As well as the addition of ten extra hearts of health, the &1Ring of Odin&0 protects the wearer from various kinds of elemental damage such as drowning, suffocation, fire or starvation. The ring can also be combined with the other two rings of the &4Aesir&0 in a crafting table to create the ultimate ring. - -# -- ELVEN LORE - THE SHATTERING -botania.entry.elvenLore=Elven Lore - The Shattering -botania.page.elvenLore0=It seems this section of the lexicon is just a bunch of pieces of paper. By the looks of them, they seem like they were taken from a document from the libraries of Elven Garde.
    Their contents should contain historical knowledge, but doubtfully anything important to the studies of botany itself. -botania.page.elvenLore1=&oA few millennia have passed since The Shattering. The amount of us who actually know about what really happened that day is rather minute. Nidavellir broke down, and while the Dwarves' incredible resistance helped, a great part of their technology and civilization was eradicated. Muspelheim, what was (...) -botania.page.elvenLore2=&opreviously in the very opposite corner of the World 나무 herself collided with Midgard, merging the two worlds in an apocalypse, eradicating any life remaining in that world. There's theories that state Hel was also involved in the event, although none were ever confirmed. Fissures in the ground of (...) -botania.page.elvenLore3=&oJotunheim opened all around, massacring a great portion of the Giants who lived there, its current status remains unknown. Niflheim seemed to stay in place, unlike Muspelheim, interestingly enough. Since it contained no known lifeforms, we can admit that damage is irrelevant. Lastly, ourselves, the (...) -botania.page.elvenLore4=&oelves of Alfheim, the damage on our world was somewhat split. The Salamander and Undine clans suffered a massive cut on their population, due to the unstableness of their volcanic and aquatic environments, respectively. Most of the Sylph were completely intact due to their extraordinary flight capabilities, the (...) -botania.page.elvenLore5=&oSpriggan also had fairly small scale consequences. During that time our civilization prospects were fairly weak and our choices of residence were mostly just huts made of Dreamwood, so, luckily, rebuilding was little of a chore. Allewyn, our emissary in Asgard witnessed this happening, everything happened faster (...) -botania.page.elvenLore6=&othan the birth of a Pixie. Thor shattering the Bifrost with Mjolnir, her command to evacuate all of the elven civilization residing in Midgard, luckily she was here unscathed, or at least that's what records say, regardless, a few millennia later, she's passed off long ago. Right now our major concern is the status of Midgard. (...) -botania.page.elvenLore7=&oThe collapse of the Bifrost broke any interaction between the various worlds, but the sheer quantity of Mana residues we have left behind will surely have lingered and infused the world with life all over again, be it animal, floral or fungal, natural or magical in essence. We hope it's enough to create intelligent life that can properly harness it though. - -# - MISCLANEOUS -# -- UNSTABLE CUBE -botania.entry.unstableBlocks=Unstable Cubes -botania.page.unstableBlocks0=Fiddling with highly powerful &4Mana&0 infused objects has lead to the creation of these strange cubes. They seem to emit some visual radiation in the form of colorful lightning, but it doesn't seem like it has any effects other than visual appeal. -botania.page.unstableBlocks1=They look fancy -botania.page.unstableBlocks2=And they come in all 16 colors -botania.page.unstableBlocks3=There's also a way of creating a different version of these that releases an extremely larger amount of energy, this time in the form of a beam towards the sky that extends into a cloud of sorts. This one also seems to be disableable via a &4빨간색stone Signal&0, it's called an &1Unstable Beacon&0, as it looks like one somehow. -botania.page.unstableBlocks4=Fireworks? -botania.page.unstableBlocks5=Combined entropy -botania.page.unstableBlocks6=It's also possible, by using the &1Unstable Beacons&0, to turn them into a manageable and portable utility, in the form of the &1Signal Flare&0.
    This gun of sorts shoots a colored round into the sky that lasts a few seconds, it also stuns any nearby enemies for just as long. -botania.page.unstableBlocks7=Shoot in case of titan - -# -- DECORATIVE BLOCKS -botania.entry.decorativeBlocks=Decorative Blocks -botania.page.decorativeBlocks0=Past functionality, quite a few decorative blocks are available to make your builds look better.
    Starting off. It's possible to turn blocks of &1Livingrock&0 and &1Livingwood&0 into decorative blocks. Each of them features 4 different decorative variations. -botania.page.decorativeBlocks1=Livingrock bricks. -botania.page.decorativeBlocks2=Mossing the bricks -botania.page.decorativeBlocks3=Cracking the bricks -botania.page.decorativeBlocks4=Framing the bricks -botania.page.decorativeBlocks5=Turning wood into planks -botania.page.decorativeBlocks6=Mossing the planks -botania.page.decorativeBlocks7=Framing the planks -botania.page.decorativeBlocks8=Pattern planks -botania.page.decorativeBlocks9=Glimmering livingwood -botania.page.decorativeBlocks10=Carrying on, by combining &1Nether Quartz&0 with all sorts of other substances, it's possible to create a wide array of other decorative &1Quartz&0 blocks.
    As expected, all these items can be crafted into all their decorative block counterparts just like regular &1Quartz&0 blocks are crafted. -botania.page.decorativeBlocks11=Smokey Quartz -botania.page.decorativeBlocks12=Mana Quartz -botania.page.decorativeBlocks13=Blaze Quartz -botania.page.decorativeBlocks14=Lavender Quartz -botania.page.decorativeBlocks15=빨간색quartz -botania.page.decorativeBlocks23=Sunny Quartz -botania.page.decorativeBlocks16=A few blocks can be organized in methods different than normal to create new building blocks, such as &1Reed Blocks&0, &1Thatch&0, &1Roof Tiles&0 and a few new &1Bricks&0.
    All these also can be crafted into both stairs and slabs. -botania.page.decorativeBlocks17=Crafting &1Reed Blocks&0 -botania.page.decorativeBlocks18=Crafting &1Thatch&0 -botania.page.decorativeBlocks19=Crafting &1Roof Tiles&0 -botania.page.decorativeBlocks20=Crafting &1Hellish Bricks&0 -botania.page.decorativeBlocks21=Crafting &1Soul Bricks&0 -botania.page.decorativeBlocks22=Crafting &1Frosty Bricks&0 - -# -- DISPENSER TWEAKS -botania.entry.dispenserTweaks=Dispenser Tweaks -botania.page.dispenserTweaks0=&1Dispensers&0, among their normal abilities, can also plant all sorts of crops, from &1Seeds&0, &1Potatos&0 or &1Carrots&0 to even &1Nether Wart&0. The crop is planted in the block right in front of the dispenser.
    The &1Dispensers&0 can also use the &1Wand of the Forest&0 for some specific tasks such as triggering a &1Runic Altar&0. - -# -- GLIMMERING FLOWERS -botania.entry.shinyFlowers=Glimmering Flowers -botania.page.shinyFlowers0=By combining your typical &1신비로운 꽃s&0 with some &1Glowstone Dust&0, you can make them sparkle even brighter, and emit actual physical light, of the same brightness as a &1Glowstone Block&0.
    With some &1Dirt&0 and &1Pasture Seeds&0 it's possible to turn them into a miniature floating island that will not only emit light, but also look very fancy indeed. -botania.page.shinyFlowers3=Combining any color of &1Floating Flower&0 with any flower that has an effect (any &4Functional or Generating Flower&0, etc) in a crafting table will join the two, allowing for both the look and properties of a &1Floating Flower&0 and the effects of the flower chosen in one block. Lastly, right clicking a floating flower in the world with any type of &1Pasture Seed&0 or a &1Snowball&0 will change its look. -botania.page.shinyFlowers1=Pretty Pretty Shiny Shiny -botania.page.shinyFlowers2=Like Laputa but (a lot) tinier - -# -- PRISMARINE -botania.entry.prismarine=Prismarine -botania.page.prismarine0=&1Prismarine&0 is an interesting component and building block. Some scholars even go as far as to say it comes from &4the future&0.
    To create it, one requires an &1Alchemy Catalyst&0. Simply tossing some &1Nether Quartz&0 into a &1Mana Pool&0 with the catalyst attached to it will get some of this material. -botania.page.prismarine1=There's various building blocks that can be created using the &1Prismarine Shards&0, to which all but the &1Sea Lantern&0 can be turned into their &1Stair&0 and &1Slab&0 variants. -botania.page.prismarine2=Creating &1Prismarine Shards&0 -botania.page.prismarine3=Crafting &1Prismarine&0 -botania.page.prismarine4=Crafting &1Prismarine Bricks&0 -botania.page.prismarine5=Crafting &1Dark Prismarine&0 -botania.page.prismarine6=Crafting the &1Sea Lantern&0 - -# -- NATURAL SHEDDING -botania.entry.shedding=Natural Shedding -botania.page.shedding0=The living and unliving beings that inhabit our lands don't live in a static state. It's common for pieces of their body to fall out, or for them to drop things, or for them to extrude substances. The following pages list some such items that can come from such entities. - -# -- TINY POTATO -botania.entry.tinyPotato=Tiny Potato -botania.page.tinyPotato0=It's a tiny potato, it believes in you, you can do the thing.
    No really, that's it, by tossing a &1Potato&0 in a &1Mana Pool&0, the potato gains a little lively essence and happy feeling. It's a lively one, giving it a right click will make it even more so!
    It can also be named in an &1Anvil&0. -botania.page.tinyPotato1=Put it on Kickstarter, it'll work - -# -- HEAD CREATION -botania.entry.headCreating=Head Creation -botania.page.headCreating0=A typical incantation of the Elves, combining a few resources and a &1Name Tag&0 allows for the creation of a replica of sorts of the head of the person described in the tag.
    How it works isn't really known, but it seems to be possible to replicate it with a &1Runic Altar&0. -botania.page.headCreating2=A subset of the community has dedicated themselves to creating heads that serve as all sorts of decorations. Unlike any other page in this lexicon, clicking the &1View Online&0 button on the left of this page will take you to a website with a list of names that can be used for this purpose. Note, however, that this list is not affiliated with 보타니아 in any way and is definitely not the only place to find these types of heads. -botania.page.headCreating1=Get your head in the game - -# -- AZULEJO -- http://en.wikipedia.org/wiki/Azulejo -botania.entry.azulejo=Azulejos -botania.page.azulejo0=&1Azulejos&0 are a type of decorative block, simply put, they are tileable patterns of blue and white. To create them, one would simply mix a piece of &1Lapis Lazuli&0 with a &1Block of Quartz&0.
    From there, placing it in the crafting grid allows for cycling between the twelve different patterns. -botania.page.azulejo1=The various patterns -botania.page.azulejo2=Crafting a block of &1Azulejo&0 -botania.page.azulejo3=Cycling between the patterns - -# -- STARFIELD CREATOR -botania.entry.starfield=Starfield Creator -botania.page.starfield0=The &1Starfield Creator&0 does exactly as it says, by releasing elven energies into the air, if it's placed in the world, during night time it will create a starry sky that extends for a fair distance. -botania.page.starfield1=Twinkle twinkle - -# -- TRODDEN DIRT -botania.entry.dirtPath=Trodden Dirt -botania.page.dirtPath0=&1Trodden Dirt&0 is a type of soil that works perfectly for the creation of natural looking artificial paths through landscape. Similarly to &1Farmland&0, it's slightly inset into the ground, walking on it also provides a small speed boost. -botania.page.dirtPath1=Follow the yellow dirt road -botania.page.dirtPath2=Also available in slabs - -# -- SHIMMERING MUSHROOMS -botania.entry.mushrooms=Shimmering Mushrooms -botania.page.mushrooms0=Sprinkling some &1Floral Powder&0 on &1Mushrooms&0 seems to have the interesting effect of them mutating into the respective color of powder, gaining a new shape and getting the ability to emit dim light. They don't seem to do anything besides look interesting.
    These can also be seldom found deep underground in isolated patches. -botania.page.mushrooms1=They don't make you bigger - -# -- PHANTOM INK -botania.entry.phantomInk=Phantom Ink -botania.page.phantomInk0=Having your beautiful skin and accessories under a set of metal armor is nobody's dream. It's bulky, flat, and worst of all, not fashionable!
    Luckilly, by tinging this horrendous armor with &1Phantom Ink&0 in a crafting grid, the armor will be completely invisible, while still providing all of its benefits. This will only work with armor sets that can use &4Mana&0. -botania.page.phantomInk1=Who you gonna call? - -# -- STONE ALCHEMY -botania.entry.stoneAlchemy=Stone Alchemy -botania.page.stoneAlchemy0=Using an &1Alchemy Catalyst&0 proves to be a decently functional method of generating new types of &1Stone&0. Simple deal, tossing a piece of &1Stone&0 into the catalized pool will transform it into another in a cyle.
    Similarly to &1Prismarine&0, some scholars admit that this technique came from the future. Stairs and slabs can be made from the rough and brick variants of these. -botania.page.stoneAlchemy1=Creating the stones -botania.page.stoneAlchemy2=Polish -botania.page.stoneAlchemy3=Brickage -botania.page.stoneAlchemy4=Chiseling - -# -- BLAZE LIGHT -botania.entry.blazeBlock=Blaze Light -botania.page.blazeBlock0=Smashing a bunch of blazing material together makes a usable decorative light block. A crude one, admittedly, but a source of light non the less.
    Naturally, like a &1Block of Coal&0, the &1Blaze Light&0 can also be used to fuel furnaces and other fuel consumers alike. Putting it next to a &1Pure Daisy&0 converts it into &1Obsidian&0, strangely enough. -botania.page.blazeBlock1=0x1a4 - -# -- CHALLENGES -botania.entry.challenges=Challenges -botania.page.challenges0=&1Challenges&0 are available in the &1Lexica 보타니아&0 by clicking the icon on the left of the landing page shaped like a cup. These, as the name says, challenge the player to create a mechanism using the features only available in &1Botania&0 and &1Minecraft&0 itself.
    Of course, you can use items from other mods to complete them, but that's no fun. -botania.page.challenges1=All of the challenges are possible, of course. They just require some thinking and knowledge of the ins and outs of redstone and the &1Botania&0 mechanics themselves.
    It's highly recommended that they're done without using features from external mods, as they have been created with that in mind, and aren't really challenges if you put down a block that solves them instantly. -botania.page.challenges2=The challenges aren't obligatory in any way, and do not provide any material reward. They're purely suggestions as to what &1Botania&0 can do, automation wise, and are but scratching the surface of that topic. Challenges need be marked completed manually.
    It should be kept in mind that the boundaries of this world are one's imagination, so don't stop at the ideas in there! - -# -- CACOPHONIUM -botania.entry.cacophonium=Cacophonium -botania.page.cacophonium0=This interesting instrument, the &1Cacophonium&0, has the ability to mimic almost every living being's cries in nature, allowing for the "musician" to play them at will. Right clicking with it on an entity has the instrument learn its sound. It can then be played by holding right click.
    Why anyone would ever want to make this, however, is beyond moral comprehension. -botania.page.cacophonium1=Hibike! Cacophoniu -botania.page.cacophonium2=For maximum cacophony, the &1Cacophonium&0 can be shift-right clicked onto a &1Note Block&0, creating the ability to sound off animal or monster sounds on demand.
    You monster. - -# -- THAUMCRAFT INTEGRATION -botania.entry.tcIntegration=Thaumcraft Integration -botania.page.tcIntegration0=Often enough, the paths of &4Botany&0 and &4Thaumaturgy&0 cross together. Mixing some of the artifacts mentioned in this book as well as any from the school of &5Thaumcraft&0 can allow for combinations of these to form. -botania.page.tcIntegration1=First and foremost, combining any of the &1Mana Metal&0 helms with a set of &1Goggles of Revealing&0 allows for a combination of both.
    The protection and regenerability of the armor works alongside the Goggles' abilities, but the &4Vis&0 discount is lost. -botania.page.tcIntegration2=Helmets of Revealing (works with any 보타니아 helm) -botania.page.tcIntegration3=Carrying on, &4Mana&0 can also serve as an interesting type of Ink. Infusing a set of black &1Scribing Tools&0 with &4Mana&0 from a &1Mana Pool&0 allows for them to use said &4Mana&0 as their source of color.
    Refilling these tools works similarly to a &1Mana Tablet&0, done by tossing it on top of the pool. It's to note that the tools do not come pre-filled. -botania.page.tcIntegration4=Making the &1Botanurgist's Inkwell -botania.page.tcIntegration5=Next off, there's a few varied resources or constructs that can work as paraphernalia for an &1Infusion Altar&0, to lower its' instability, these come in the form of &1Glimmering Flowers, Floating Flowers and any variety of Pylons&0.
    Lastly, a special &4Brew&0 can be put together using typical thaumaturgic resources in order to apply a &4Warp Ward&0 effect. -botania.page.tcIntegration6a=Perhaps insanity might not be the greatest tool in all of occasions. For those cases, a nice bath generally takes care of it. A brew might be a better format for such a task, though... -botania.page.tcIntegration6b=The official frowny face - -# -- BUILDCRAFT INTEGRATION -botania.entry.bcIntegration=Buildcraft Integration -botania.page.bcIntegration0=Recent advances in piping technology have allowed &1Gates&0 to get a feel of the &4Mana&0 around them. A &1Gate&0 can now sense whether a &4Mana&0 container is empty, full or if it contains any mana.
    &1Gates&0 can also use the &1Mana Detector&0 trigger to detect if a mana is passing by the pipe block. In addition, they can also sense when a &1Runic Altar&0 is ready to create runes. +botania.page.runeAltar19=&1교만의 룬&0 제작하기 \ No newline at end of file diff --git a/src/main/resources/assets/botania/lang/nl_NL.lang b/src/main/resources/assets/botania/lang/nl_NL.lang index c0fba076b..0b01c62b6 100644 --- a/src/main/resources/assets/botania/lang/nl_NL.lang +++ b/src/main/resources/assets/botania/lang/nl_NL.lang @@ -1,11 +1,16 @@ +# Note to translators: DO NOT COPY ENTRIES FROM ENGLISH +# I repeat: do NOT copy entries from English!! +# Any entry in this lang file should be in nl_NL, or *should not be here at all* +# Copying English entries will cause them to become outdated when the main English lang file changes +# Untranslated entries will automatically be inherited from en_US +# +# Once again, don't copy from English, and THANK YOU for your hard work! + # MISC itemGroup.Botania=Botania generator.botania-skyblock=Glazen Tuin generator.botania-skyblock.info=Niet aanbevolen voor Botania beginners -# Something that is not localized, translators, do NOT change this line. -botaniamisc.noloc=botaniamisc.noloc - botaniamisc.nextPage=Volgende pagina botaniamisc.prevPage=Vorige pagina botaniamisc.back=Terug @@ -51,9 +56,6 @@ botaniamisc.shiftToRemove=Shift-klik om te verwijderen botaniamisc.clickToAdd=Favoriet toevoegen botaniamisc.ratio=Inzoomen: %sx botaniamisc.bottleTooltip=Het heeft een verworven smaak -botaniamisc.coarseDirt0=Grof Vuil, gras -botaniamisc.coarseDirt1=wil er niet op groeien -botaniamisc.spawnerTip=Tip: Gebruik een Spawn ei om de mob te wijzigen botaniamisc.shardLevel=Schervenkracht %s botaniamisc.lexiconIndex=Lexicon Index botaniamisc.hasIvy=Heeft Tijdloze Klimop @@ -62,8 +64,8 @@ botaniamisc.noLexicon=Je moet een Lexica Botania vasthouden om dit te lezen. botaniamisc.cantOpen=Het lijkt erop dat jouw Lexica Botania deze pagina niet heeft. Misschien komt hij ergens anders vandaan...? botaniamisc.clickToShare=Delen botaniamisc.drop=Laten vallen -botaniamisc.dropTip0=Tip: Druk toets %key% in je inventaris om te laten vallen -botaniamisc.dropTip1=CTRL-%key% laat een hele stapel vallen +botaniamisc.dropTip0=Tip: Druk toets %s in je inventaris om te laten vallen +botaniamisc.dropTip1=CTRL-%s laat een hele stapel vallen botaniamisc.wandMode.bind=Verbind Modus botaniamisc.wandMode.function=Functie Modus botaniamisc.playVideo=Video afspelen @@ -182,14 +184,6 @@ botania.color14=Rood botania.color15=Zwart botania.color16=Regenboog -# RANKS -botania.rank0=&cD -botania.rank1=&eC -botania.rank2=&bB -botania.rank3=&aA -botania.rank4=&dS -botania.rank5=&6SS - # ZODIAC SIGNS botania.sign0=Ram botania.sign1=Stier @@ -242,39 +236,6 @@ botania.armorset.will3.shortDesc=Voltreffers geven een sterk traagheid effect botania.armorset.will4.shortDesc=Voltreffers doordringen armor botania.armorset.will5.shortDesc=Voltreffers geven aantastend effect -# ROMAN NUMERALS -botania.roman0= -botania.roman1=I -botania.roman2=II -botania.roman3=III -botania.roman4=IV -botania.roman5=V -botania.roman6=VI -botania.roman7=VII -botania.roman8=VIII -botania.roman9=IX -botania.roman10=X -botania.roman11=XI -botania.roman12=XII -botania.roman13=XIII -botania.roman14=XIV -botania.roman15=XV -botania.roman16=XVI -botania.roman17=XVII -botania.roman18=XVIII -botania.roman19=XIX -botania.roman20=XX -botania.roman21=XXI -botania.roman22=XXII -botania.roman23=XXIII -botania.roman24=XXIV -botania.roman25=XXV -botania.roman26=XXVI -botania.roman27=XXVII -botania.roman28=XXVIII -botania.roman29=XXIX -botania.roman30=XXX - # KNOWLEDGE botania.knowledge.minecraft=Minecraft Wijsheid botania.knowledge.alfheim=&aElven&7 Wijsheid @@ -322,73 +283,8 @@ worldgen.flower.tallChance=Worldgen lange bloemen kans worldgen.mushroom.quantity=Worldgen Paddenstoel hoeveelheid # VERSION CHECKING -botania.versioning.flavour0=Er is een Botania update! -botania.versioning.flavour1=Er is een Botania update! -botania.versioning.flavour2=Er is een Botania update! -botania.versioning.flavour3=Er is een Botania update! -botania.versioning.flavour4=Er is een Botania update! -botania.versioning.flavour5=Er is een Botania update! -botania.versioning.flavour6=Er is een Botania update! -botania.versioning.flavour7=Er is een Botania update! -botania.versioning.flavour8=Er is een Botania update! -botania.versioning.flavour9=Er is een Botania update! -botania.versioning.flavour10=Er is een Botania update! -botania.versioning.flavour11=Er is een Botania update! -botania.versioning.flavour12=Er is een Botania update! -botania.versioning.flavour13=Er is een Botania update! -botania.versioning.flavour14=Er is een Botania update! -botania.versioning.flavour15=Er is een Botania update! -botania.versioning.flavour16=Er is een Botania update! -botania.versioning.flavour17=Er is een Botania update! -botania.versioning.flavour18=Er is een Botania update! -botania.versioning.flavour19=Er is een Botania update! -botania.versioning.flavour20=Er is een Botania update! -botania.versioning.flavour21=Er is een Botania update! -botania.versioning.flavour22=Er is een Botania update! -botania.versioning.flavour23=Er is een Botania update! -botania.versioning.flavour24=Er is een Botania update! -botania.versioning.flavour25=Er is een Botania update! -botania.versioning.flavour26=Er is een Botania update! -botania.versioning.flavour27=Er is een Botania update! -botania.versioning.flavour28=Er is een Botania update! -botania.versioning.flavour29=Er is een Botania update! -botania.versioning.flavour30=Er is een Botania update! -botania.versioning.flavour31=Er is een Botania update! -botania.versioning.flavour32=Er is een Botania update! -botania.versioning.flavour33=Er is een Botania update! -botania.versioning.flavour34=Er is een Botania update! -botania.versioning.flavour35=Er is een Botania update! -botania.versioning.flavour36=Er is een Botania update! -botania.versioning.flavour37=Er is een Botania update! -botania.versioning.flavour38=Er is een Botania update! -botania.versioning.flavour39=Er is een Botania update! -botania.versioning.flavour40=Er is een Botania update! -botania.versioning.flavour41=Er is een Botania update! -botania.versioning.flavour42=Er is een Botania update! -botania.versioning.flavour43=Er is een Botania update! -botania.versioning.flavour44=Er is een Botania update! -botania.versioning.flavour45=Er is een Botania update! -botania.versioning.flavour46=Er is een Botania update! -botania.versioning.flavour47=Er is een Botania update! -botania.versioning.flavour48=Er is een Botania update! -botania.versioning.flavour49=Er is een Botania update! -botania.versioning.flavour50=Er is een Botania update! -botania.versioning.flavour51=Er is een Botania update! -botania.versioning.flavour52=Er is een Botania update! -botania.versioning.flavour53=Er is een Botania update! -botania.versioning.flavour54=Er is een Botania update! -botania.versioning.flavour55=Er is een Botania update! -botania.versioning.flavour56=Er is een Botania update! -botania.versioning.flavour57=Er is een Botania update! -botania.versioning.flavour58=Er is een Botania update! -botania.versioning.flavour59=Er is een Botania update! -botania.versioning.flavour60=Er is een Botania update! -botania.versioning.flavour61=Er is een Botania update! -botania.versioning.flavour62=Er is een Botania update! -botania.versioning.flavour63=Er is een Botania update! -botania.versioning.flavour64=Er is een Botania update! botania.versioning.outdated=Je gebruikt Botania versie %s, de laatste versie is %s. -botania.versioning.updateMessage=["Klik voor... [",{"text":"Download","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Hier klikken om automatisch bij te werken naar de laatste versie","color":"green"}},"clickEvent":{"action":"run_command","value":"/botania-download-latest %version%"}},"] [",{"text":"Website","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Klik hier om naar de website van de mod te gaan","color":"green"}},"clickEvent":{"action":"open_url","value":"http://botaniamod.net/downloads.php"}},"] [",{"text":"Changelog","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Klik hier om de lijst met wijzigingen te zien","color":"green"}},"clickEvent":{"action":"open_url","value":"http://botaniamod.net/changelog.php#%version%"}},"]"] +botania.versioning.updateMessage=["Klik voor... [",{"text":"Download","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Hier klikken om automatisch bij te werken naar de laatste versie","color":"green"}},"clickEvent":{"action":"open_url","value":"http://minecraft.curseforge.com/projects/botania-unofficial/files/latest"}},"] [",{"text":"Website","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Klik hier om naar de website van de mod te gaan","color":"green"}},"clickEvent":{"action":"open_url","value":"http://minecraft.curseforge.com/projects/botania-unofficial"}},"] [",{"text":"Changelog","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Klik hier om de lijst met wijzigingen te zien","color":"green"}},"clickEvent":{"action":"open_url","value":"https://github.com/williewillus/Botania/releases/tag/%s"}},"]"] botania.versioning.startingDownload=[{"text":"Begin met downloaden van %s. Koppel je hardeschijf niet af. Plezier van ","color":"aqua"},{"text":"Botania","color":"green"},{"text":"? Overweeg ","color":"aqua"},{"text":"Vazkii","color":"light_purple"},{"text":" te ondersteunen op [","color":"aqua"},{"text":"Patreon","color":"gold","hoverEvent":{"action":"show_text","value":{"text":"Klik hier om naar Vazkii's Patreon te gaan","color":"light_purple"}},"clickEvent":{"action":"open_url","value":"http://www.patreon.com/Vazkii"}},{"text":"]!","color":"aqua"}] botania.versioning.doneDownloading=Klaar met downloaden van %s. Verwijder de oude Botania .jar en start het spel opnieuw om bij te werken. botania.versioning.downloadedAlready=De laatste versie is al gedownload. Sluit het spel, verwijder de oude versie uit de mods folder en start het spel opnieuw om bij te werken! @@ -400,7 +296,7 @@ botania.versioning.disabled=Sorry. Deze optie is uitgeschakeld wegens server pro botania.baubletype.amulet=Te gebruiken in het &aAmulet&7 slot botania.baubletype.ring=Te gebruiken in het &aRing&7 slot botania.baubletype.belt=Te gebruiken in het &aRiem&7 slot -botania.baubletooltip=Druk &b%key%&7 om het Baubles menu te openen +botania.baubletooltip=Druk &b%s&7 om het Baubles menu te openen # RELIC POEMS item.dice.poem0=Hij deelt de kaarten om het antwoord te vinden @@ -457,7 +353,6 @@ achievement.botania:manaBlasterShoot=Oh Yeah achievement.botania:manaBlasterShoot.desc=Maak en schiet een Mana Blaster achievement.botania:tiaraWings=Hartendief achievement.botania:tiaraWings.desc=Maak en gebruik een Flügel Tiara met Flügel vleugels -achievement.botania:terrasteelPickup=Dancer in the Dark achievement.botania:terrasteelPickup.desc=Roep een staaf Terrastaal op met een Bodemverbindingsplaat achievement.botania:elfPortalOpen=De Wereld Roept achievement.botania:elfPortalOpen.desc=Open een poort naar het Elvenrijk @@ -530,11 +425,8 @@ achievement.botania:lokiRing.desc=Verdien de Ring van Loki voor een heldhaftige achievement.botania:aesirRing=Zoals de Goden zeggen achievement.botania:aesirRing.desc=Vervaardig de Ring van de Aesir door de Ring der Goden te combineren -achievement.botania:nullFlower=Take it Easy achievement.botania:nullFlower.desc=Vindt een bug die je een ongedefinieerde Botania bloem geeft. Niet vergeten te melden! achievement.botania:desuGun=Tweezijdige Liefde -achievement.botania:desuGun.desc=ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN -# ^ Don't localize # CHALLENGE LEVELS botania.challengelevel.easy=Makkelijk @@ -771,19 +663,6 @@ tile.botania:dreamwood1Stairs.name=Droomhout Plank Trap tile.botania:dreamwood1Slab.name=Droomhout Plank Plaat tile.botania:dreamwood1SlabFull.name=Droomhout Plank Plaat tile.botania:conjurationCatalyst.name=Oproepversneller -tile.botania:prismarine0.name=Prismarine -tile.botania:prismarine1.name=Prismarine Baksteen -tile.botania:prismarine2.name=Donker Prismarine -tile.botania:prismarine0Stairs.name=Prismarine Trap -tile.botania:prismarine0Slab.name=Prismarine Plaat -tile.botania:prismarine0SlabFull.name=Prismarine Plaat -tile.botania:prismarine1Stairs.name=Prismarine Baksteen Trap -tile.botania:prismarine1Slab.name=Prismarine Baksteen Plaat -tile.botania:prismarine1SlabFull.name=Prismarine Baksteen Plaat -tile.botania:prismarine2Stairs.name=Donker Prismarine Trap -tile.botania:prismarine2Slab.name=Donker Prismarine Plaat -tile.botania:prismarine2SlabFull.name=Donker Prismarine Plaat -tile.botania:seaLamp.name=Zeelantaarn tile.botania:miniIsland0.name=Drijvende Witte Bloem tile.botania:miniIsland1.name=Drijvende Oranje Bloem tile.botania:miniIsland2.name=Drijvende Magenta Bloem @@ -802,14 +681,6 @@ tile.botania:miniIsland14.name=Drijvende Rode Bloem tile.botania:miniIsland15.name=Drijvende Zwarte Bloem tile.botania:tinyPotato.name=Kleine Aardappel tile.botania:spawnerClaw.name=Levensbrenger -tile.botania:reedBlock.name=Rietblok -tile.botania:reedBlock0Stairs.name=Rieten Trap -tile.botania:reedBlock0Slab.name=Rieten Plaat -tile.botania:reedBlock0SlabFull.name=Rieten Plaat -tile.botania:thatch.name=Rietbedekking -tile.botania:thatch0Stairs.name=Rietbedekking Trap -tile.botania:thatch0Slab.name=Rietbedekking Plaat -tile.botania:thatch0SlabFull.name=Rietbedekking Plaat tile.botania:customBrick0.name=Helse Baksteen tile.botania:customBrick1.name=Zielen Baksteen tile.botania:customBrick2.name=Bevroren Baksteen @@ -1038,46 +909,10 @@ tile.botania:doubleFlower212.name=Lange Mystieke Bruine Bloem tile.botania:doubleFlower213.name=Lange Mystieke Groene Bloem tile.botania:doubleFlower214.name=Lange Mystieke Rode Bloem tile.botania:doubleFlower215.name=Lange Mystieke Zwarte Bloem -tile.botania:stone0.name=Andesiet -tile.botania:stone1.name=Basalt -tile.botania:stone2.name=Diorite -tile.botania:stone3.name=Graniet -tile.botania:stone4.name=Gepolijst Andesiet -tile.botania:stone5.name=Gepolijst Basalt -tile.botania:stone6.name=Gepolijst Diorite -tile.botania:stone7.name=Gepolijst Graniet -tile.botania:stone8.name=Andesieten Bakstenen -tile.botania:stone9.name=Basalten Bakstenen -tile.botania:stone10.name=Dioriten Bakstenen -tile.botania:stone11.name=Granieten Bakstenen tile.botania:stone12.name=Gebeitelde Andesiete Baksteen tile.botania:stone13.name=Gebeitelde Basalte Baksteen tile.botania:stone14.name=Gebeitelde Diorite Baksteen tile.botania:stone15.name=Gebeitelde Graniete Baksteen -tile.botania:stone0Stairs.name=Andesieten Trap -tile.botania:stone1Stairs.name=Basalten Trap -tile.botania:stone2Stairs.name=Dioriten Trap -tile.botania:stone3Stairs.name=Granieten Trap -tile.botania:stone8Stairs.name=Andesieten Baksteen Trap -tile.botania:stone9Stairs.name=Basalten Baksteen Trap -tile.botania:stone10Stairs.name=Dioriten Baksteen Trap -tile.botania:stone11Stairs.name=Granieten Baksteen Trap -tile.botania:stone0Slab.name=Andesiet Plaat -tile.botania:stone1Slab.name=Basalt Plaat -tile.botania:stone2Slab.name=Diorite Plaat -tile.botania:stone3Slab.name=Graniet Plaat -tile.botania:stone8Slab.name=Andesieten Baksteen Plaat -tile.botania:stone9Slab.name=Basalten Baksteen Plaat -tile.botania:stone10Slab.name=Dioriten Baksteen Plaat -tile.botania:stone11Slab.name=Granieten Baksteen Plaat -tile.botania:stone0SlabFull.name=Andesiet Plaat -tile.botania:stone1SlabFull.name=Basalt Plaat -tile.botania:stone2SlabFull.name=Diorite Plaat -tile.botania:stone3SlabFull.name=Graniet Plaat -tile.botania:stone8SlabFull.name=Andesieten Baksteen Plaat -tile.botania:stone9SlabFull.name=Basalten Baksteen Plaat -tile.botania:stone10SlabFull.name=Dioriten Baksteen Plaat -tile.botania:stone11SlabFull.name=Granieten Baksteen Plaat tile.botania:blazeBlock.name=Blazelamp tile.botania:corporeaInterceptor.name=Corporea Onderschepper tile.botania:corporeaCrystalCube.name=Corporea Kristallen Kubus @@ -1094,8 +929,6 @@ tile.botania:lightLauncher.name=Verlichter Lanceerder tile.botania:livingrock0Wall.name=Levensteen Muur tile.botania:livingwood0Wall.name=Levenshout Muur tile.botania:dreamwood0Wall.name=Droomhout Muur -tile.botania:prismarine0Wall.name=Prismarine Muur -tile.botania:reedBlock0Wall.name=Reed Block Muur tile.botania:biomeStoneA0Wall0.name=Veranderlijke Woudkeisteen Muur tile.botania:biomeStoneA0Wall1.name=Veranderlijke Veldkeisteen Muur tile.botania:biomeStoneA0Wall2.name=Veranderlijke Bergkeisteen Muur @@ -1104,10 +937,6 @@ tile.botania:biomeStoneA0Wall4.name=Veranderlijke Moeraskeisteen Muur tile.botania:biomeStoneA0Wall5.name=Veranderlijke Woestijnkeisteen Muur tile.botania:biomeStoneA0Wall6.name=Veranderlijke Winterwoudkeisteen Muur tile.botania:biomeStoneA0Wall7.name=Veranderlijke Hoogvlaktekeisteen Muur -tile.botania:stone0Wall0.name=Andesiet Muur -tile.botania:stone0Wall1.name=Basalt Muur -tile.botania:stone0Wall2.name=Diorite Muur -tile.botania:stone0Wall3.name=Graniet Muur tile.botania:manaBomb.name=Manastorm Lading tile.botania:buriedPetals0=Begraven Witte Bloemblad tile.botania:buriedPetals0.name=Begraven Witte Bloemblad @@ -1599,7 +1428,7 @@ item.botania:terraAxe.name=Terrakapper item.botania:manasteelNugget.name=Klompje Manastaal item.botania:terrasteelNugget.name=Klompje Terrastaal item.botania:elementiumNugget.name=Klompje Elementium -item.botania:root.name=Levenswortel +item.botania:livingRoot.name=Levenswortel item.botania:pebble.name=Kiezel item.botania:waterBowl.name=Kom Water item.botania:obedienceStick.name=Bloemen Gehoorzaamheidsstok @@ -2959,7 +2788,6 @@ botania.page.vineBall0=&1Ladders&0 kunnen niet op zichzelf staan, ze hebben iets botania.page.vineBall1=Het is ook mogelijk, middels combinatie van enkele materialen zoals &1Levenshout&0 of een &1Rune der Lucht&0, om een katapult te maken die de &1Lianenballen&0 kan afschieten zonder last te hebben van de zwaartekracht. botania.page.vineBall2=Dit zou bestaan in Vinecraft... botania.page.vineBall3=...als dat zou bestaan. -botania.page.vineBall4=Oh, en je kunt ook &1Mossige Steen&0 maken # -- SHARD OF LAPUTA botania.entry.laputaShard=Scherf van Laputa diff --git a/src/main/resources/assets/botania/lang/pt_BR.lang b/src/main/resources/assets/botania/lang/pt_BR.lang index 752924ae2..e20467680 100644 --- a/src/main/resources/assets/botania/lang/pt_BR.lang +++ b/src/main/resources/assets/botania/lang/pt_BR.lang @@ -1,11 +1,16 @@ +# Note to translators: DO NOT COPY ENTRIES FROM ENGLISH +# I repeat: do NOT copy entries from English!! +# Any entry in this lang file should be in pt_BR, or *should not be here at all* +# Copying English entries will cause them to become outdated when the main English lang file changes +# Untranslated entries will automatically be inherited from en_US +# +# Once again, don't copy from English, and THANK YOU for your hard work! + # MISC itemGroup.Botania=Botania generator.botania-skyblock=Jardim de Vidro generator.botania-skyblock.info=Não recomendado para iniciantes -# Something that is not localized, translators, do NOT change this line. -botaniamisc.noloc=botaniamisc.noloc - botaniamisc.nextPage=Próxima página botaniamisc.prevPage=Página anterior botaniamisc.back=Voltar @@ -49,9 +54,6 @@ botaniamisc.shiftToRemove=Shiftclique para remover botaniamisc.clickToAdd=Adicionar Favorito botaniamisc.ratio=Zoom: %sx (passe o mouse para ver normal) botaniamisc.bottleTooltip=Desenvolveu um sabor -botaniamisc.coarseDirt0=Terra áspera, a grama -botaniamisc.coarseDirt1=não crescerá. -botaniamisc.spawnerTip=Dica: Use um ovo de Invocar para mudar o mob botaniamisc.shardLevel=Poder Cristalino %s botaniamisc.lexiconIndex=Índice do Léxico botaniamisc.hasIvy=Possui Hera Eterna @@ -60,8 +62,8 @@ botaniamisc.noLexicon=Você precisa do Lexica Botania em mãos para ler isso. botaniamisc.cantOpen=Parece que essa página não existe. Talvez ela seja de uma fonte externa...? botaniamisc.clickToShare=Compartilhar botaniamisc.drop=Derrubar -botaniamisc.dropTip0=Dica: Aperte %key% no inventário para derrubar -botaniamisc.dropTip1=CTRL-%key% derruba uma stack completa +botaniamisc.dropTip0=Dica: Aperte %s no inventário para derrubar +botaniamisc.dropTip1=CTRL-%s derruba uma stack completa botaniamisc.wandMode.bind=Modo de associação botaniamisc.wandMode.function=Mode funcional botaniamisc.playVideo=Mostrar vídeo @@ -416,7 +418,7 @@ botania.versioning.flavour62=Nove entre dez médicos recomendam atualizar o Bota botania.versioning.flavour63=The update bacons at midnight. botania.versioning.flavour64=Uma nova atualização do Botania está disponível. E seu nome é JOHN CENA! DOO DOO DOO DOO botania.versioning.outdated=Você possui a versão %s, a mais recente é %s. -botania.versioning.updateMessage=["Clique para... [",{"text":"Download","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Clicar aqui baixará automaticamente a nova versão","color":"green"}},"clickEvent":{"action":"run_command","value":"/botania-download-latest %version%"}},"] [",{"text":"Website","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Clicar aquie levará ao site do mod","color":"green"}},"clickEvent":{"action":"open_url","value":"http://vazkii.us/mod/Botania/downloads.php"}},"] [",{"text":"Changelog","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Clicar aqui levará ao Changelog","color":"green"}},"clickEvent":{"action":"open_url","value":"http://vazkii.us/mod/Botania/changelog.php#%version%"}},"]"] +botania.versioning.updateMessage=["Clique para... [",{"text":"Download","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Clicar aqui baixará automaticamente a nova versão","color":"green"}},"clickEvent":{"action":"open_url","value":"http://minecraft.curseforge.com/projects/botania-unofficial/files/latest"}},"] [",{"text":"Website","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Clicar aquie levará ao site do mod","color":"green"}},"clickEvent":{"action":"open_url","value":"http://minecraft.curseforge.com/projects/botania-unofficial"}},"] [",{"text":"Changelog","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Clicar aqui levará ao Changelog","color":"green"}},"clickEvent":{"action":"open_url","value":"https://github.com/williewillus/Botania/releases/tag/%s"}},"]"] botania.versioning.startingDownload=[{"text":"Baixando %s. Não remova seu HD. Gosta do ","color":"aqua"},{"text":"Botania","color":"green"},{"text":"? Considere doar para ","color":"aqua"},{"text":"Vazkii","color":"light_purple"},{"text":" no [","color":"aqua"},{"text":"Patreon","color":"gold","hoverEvent":{"action":"show_text","value":{"text":"Patreon de Vazkii","color":"light_purple"}},"clickEvent":{"action":"open_url","value":"http://www.patreon.com/Vazkii"}},{"text":"]!","color":"aqua"}] botania.versioning.doneDownloading=Download de %s concluído. Apague o .jar antigo do Botania e reabra o jogo. botania.versioning.downloadedAlready=Você já baixou a versão recente. Feche o jogo, apague a versão antiga e reabra para poder atualizar. @@ -428,7 +430,7 @@ botania.versioning.disabled=Desculpe. Esse recurso foi desligado por problemas n botania.baubletype.amulet=Equipável no slot de &aAmuletos&7 botania.baubletype.ring=Equipável no slot de &aAnéis&7 botania.baubletype.belt=Equipável no slot de &aCintos&7 -botania.baubletooltip=Aperte &b%key%&7 para abrir o menu do Baubles +botania.baubletooltip=Aperte &b%s&7 para abrir o menu do Baubles # RELIC POEMS item.dice.poem0=Ele oferece as cartas para a resposta, @@ -461,108 +463,57 @@ entity.Botania.botania:babylonWeapon.name=Arma da Tesouraria entity.Botania.botania:fallingStar.name=Estrela Cadente # ACHIEVEMENT NAMES + DESC -achievement.botania:flowerPickup=Sky of Beginning achievement.botania:flowerPickup.desc=Colete uma Flor Mística no mundo -achievement.botania:lexiconUse=A Realistical Logical Ideologist achievement.botania:lexiconUse.desc=Olhe o índice do Lexica Botania -achievement.botania:daybloomPickup=Daybreak Arrival achievement.botania:daybloomPickup.desc=Crie uma Daybloom no Boticário de Pétalas -achievement.botania:manaPoolPickup=Vivid Wave achievement.botania:manaPoolPickup.desc=Melhore um Poço de Mana Diluído para um normal -achievement.botania:endoflamePickup=Meltdown achievement.botania:endoflamePickup.desc=Crie uma Endoflame para uma melhor produção de Mana -achievement.botania:tinyPotatoPet=Just Be Friends achievement.botania:tinyPotatoPet.desc=Domestique uma Batatinha -achievement.botania:sparkCraft=Live Drive achievement.botania:sparkCraft.desc=Crie uma Fagulha para ajudar na transferência de Mana -achievement.botania:baubleWear=Inner Arts achievement.botania:baubleWear.desc=Crie qualquer Bauble e equipe -achievement.botania:manaCookieEat=Rotten Heresy and Chocolate achievement.botania:manaCookieEat.desc=Infunda e coma um Biscoito de Mana -achievement.botania:runePickup=Lilium Doll achievement.botania:runePickup.desc=Use o Altar Rúnico para criar uma Runa -achievement.botania:manaBlasterShoot=M'aider Stranded Girl achievement.botania:manaBlasterShoot.desc=Crie e use um Disparador de Mana -achievement.botania:tiaraWings=Heart Shooter achievement.botania:tiaraWings.desc=Crie e adorne uma Tiara de Flügel com asas -achievement.botania:terrasteelPickup=Dancer in the Dark achievement.botania:terrasteelPickup.desc=Conjure uma Barra de Terrasteel usando a Placa de Aglomeração Terrestre -achievement.botania:elfPortalOpen=World Calling achievement.botania:elfPortalOpen.desc=Abra um portal para o reino de Alfheim -achievement.botania:gaiaGuardianKill=Dead and Seek achievement.botania:gaiaGuardianKill.desc=Invoque e mate um Guardião de Gaia -achievement.botania:terrasteelWeaponCraft=Remote Paranoia achievement.botania:terrasteelWeaponCraft.desc=Arme-se com uma arma feita de Terrasteel -achievement.botania:kekimurusPickup=After-School Stride achievement.botania:kekimurusPickup.desc=Crie uma Kekimurus para produzir grandes quantidades de Mana -achievement.botania:heiseiDreamPickup=Heisei Cataclysm achievement.botania:heiseiDreamPickup.desc=Crie uma Heisei Dream para causar uma rebelião entre os monstros -achievement.botania:dirtRodCraft=Rockbell achievement.botania:dirtRodCraft.desc=Crie um graveto su- er... Cajado das Terras -achievement.botania:spawnerMoverUse=I can take off my (redacted) achievement.botania:spawnerMoverUse.desc=Use um Agregador de Vida para transportar um Invocador de Monstros -achievement.botania:enderAirMake=Imitation Air achievement.botania:enderAirMake.desc=Colete uma Garrafa de ar do Fim -achievement.botania:corporeaCraft=Drop Pop Candy achievement.botania:corporeaCraft.desc=Crie um bloco que faça parte da Rede de Corporea -achievement.botania:cacophoniumCraft=Noisy Lover Soul achievement.botania:cacophoniumCraft.desc=Crie um Cacofônio para irritar seus inimigos -achievement.botania:manaCartCraft=World Domination How-To achievement.botania:manaCartCraft.desc=Crie um Carrinho com Poço de Mana para transporte de mana a longas distâncias -achievement.botania:craftingHaloCraft=Segments Blue achievement.botania:craftingHaloCraft.desc=Crie uma Auréola de Criação para facilitar montagem de items -achievement.botania:manaweaveArmorCraft=Imagination Forest achievement.botania:manaweaveArmorCraft.desc=Faça uma Armadura de Tecido de Mana para melhorar suas varinhas e cajados -achievement.botania:enchanterMake=Odds and Ends achievement.botania:enchanterMake.desc=Crie um Encantador de Mana para ter controle sobre encantamentos -achievement.botania:pollidisiacPickup=Romeo and Cinderella achievement.botania:pollidisiacPickup.desc=Crie uma Pollidisiac, espalhe o amor no ar -achievement.botania:brewPickup=Childhood Blues achievement.botania:brewPickup.desc=Crie um Fermentador Botânico para fazer poções de sua preferência -achievement.botania:terraformRodCraft=World is Mine achievement.botania:terraformRodCraft.desc=Crie um Cajado de Terra Firma e mude o mundo -achievement.botania:bubbellPickup=Deep Sea Girl achievement.botania:bubbellPickup.desc=Crie uma Bubbell para fazer construções sub-aquáticas -achievement.botania:luminizerRide=World's End Dancehall achievement.botania:luminizerRide.desc=Crie alguns Luminizers e os use para transporte -achievement.botania:manaBombIgnite=Under of Fragments achievement.botania:manaBombIgnite.desc=Crie uma Carga de Manastorm, e acenda-a em um lugar distante -achievement.botania:dandelifeonPickup=Donut Hole achievement.botania:dandelifeonPickup.desc=Crie uma Dandelifeon e desafie sua mente -achievement.botania:signalFlareStun=See the Lights achievement.botania:signalFlareStun.desc=Atordoe 100 ou mais monstros com uma única Fagulha Sinalizadora -achievement.botania:l20ShardUse=Out of Step achievement.botania:l20ShardUse.desc=Ergua o solo ao céu com um Fragmento de Laputa Nível XX -achievement.botania:gaiaGuardianNoArmor=Mythologia's End achievement.botania:gaiaGuardianNoArmor.desc=Mate um Guardião de Gaia sem usar armadura em qualquer parte da luta -achievement.botania:rankSSPick=Talent Shredder achievement.botania:rankSSPick.desc=Minere usando um Terra-Destruídor nível SS -achievement.botania:superCorporeaRequest=Invader Girl achievement.botania:superCorporeaRequest.desc=Requisite 50000 ou mais de um único item com o Índice Corporea -achievement.botania:pinkinator=Decorator achievement.botania:pinkinator.desc=Dê um uso ao Pinkinator -achievement.botania:infiniteFruit=Innocentia achievement.botania:infiniteFruit.desc=Seja recompensado com uma Fruta de Grisaia por um ato heróico -achievement.botania:excaliber=Streaming Heart achievement.botania:excaliber.desc=Seja recompensado com a Espada Sagrada Excaliber por um ato heróico -achievement.botania:flugelEye=Angel of Death achievement.botania:flugelEye.desc=Seja recompensado com um Olho dos Flügel por um ato heróico -achievement.botania:thorRing=One Step Layered achievement.botania:thorRing.desc=Seja recompensado com o Anel de Thor por um ato heróico -achievement.botania:odinRing=Lost Time Memory achievement.botania:odinRing.desc=Seja recompensado com o Anel de Odin por um ato heróico -achievement.botania:lokiRing=Arithmetic achievement.botania:lokiRing.desc=Seja recompensado com o Anel de Loki por um ato heróico -achievement.botania:aesirRing=As the Gods Say achievement.botania:aesirRing.desc=Crie um Anel de Aesir com os três anéis dos deuses -achievement.botania:nullFlower=Take it Easy achievement.botania:nullFlower.desc=Encontre algum bug que faça você conseguir uma flor indefinida. Não esqueça de reportá-lo! -achievement.botania:desuGun=Two-Faced Lovers -achievement.botania:desuGun.desc=ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN -# ^ Don't localize # CHALLENGE LEVELS botania.challengelevel.easy=Fácil @@ -571,47 +522,28 @@ botania.challengelevel.hard=Difícl botania.challengelevel.lunatic=Lunático # CHALLENGE TEXT -botania.challenge.flowerFarm=Flower Farm botania.challenge.flowerFarm.desc=Crie uma farm automática das 16 cores de flores básicas do Botania. Pontos extras se elas forem organizadas. -botania.challenge.recordFarm=Record Farm botania.challenge.recordFarm.desc=Crie um sistema que produza discos matando Creepers com Esqueletos. Pontos extras se isso não precisar da presença do jogador. -botania.challenge.reedFarm=Sugar Cane Farm botania.challenge.reedFarm.desc=Crie uma plantação automática de cana. Pontos extras se não usar pistões. -botania.challenge.cobbleGen=Cobble Generator botania.challenge.cobbleGen.desc=Faça uma criação automática de pedregulhos com geração e coleção. Pontos extras se criar pedra normal sem usar fornalhas. -botania.challenge.pureDaisy=Auto Pure Daisy botania.challenge.pureDaisy.desc=Completamente automatize a Margarida Pura. Pontos extras se apenas um Dispersor for usado e/ou se a entrada/saída de pedra/madeira também for automatizada. -botania.challenge.battery=Mana Battery botania.challenge.battery.desc=Crie uma Bateria de Mana, um sistema em que mana entra em um Poço e sái em outro, usando vários Poços como reserva. Pontos extras se ambas entrada e saída podem ser aternadas. -botania.challenge.apothecaryRefill=Apothecary Refiller botania.challenge.apothecaryRefill.desc=Crie um sistema que encha o Boticário de Pétalas com água se estiver vazio. Pontos extras se o sistema também criar plantas, quando dados os componentes. -botania.challenge.treeFarm=Tree Farm botania.challenge.treeFarm.desc=Crie uma plantação auto-suficiente de madeira. Pontos extras se vários tipos de árvores forem usadas. -botania.challenge.fullCropFarm=Full Crop Farm botania.challenge.fullCropFarm.desc=Crie uma plantação de todos tipos de vegetais (trigo, cenoura, batata, melancia, abóbora, cacau e fungo do Nether) que funcione em total eficiência. Pontos extras se os resultados forem organizados. -botania.challenge.animalFarm=Animal Farm botania.challenge.animalFarm.desc=Crie uma fazenda de animais com todos animais reproduzíveis. Pontos extras se a comida for inserida no sistema automaticamente. -botania.challenge.boneMealFarm=Bone Meal-type Farm botania.challenge.boneMealFarm.desc=Crie uma plantação que use farinha de osso para crescer plantas em demanda. Pontos extras se o Tambor da Vida Selvagem não for usado. -botania.challenge.orechid=Automated Orechid botania.challenge.orechid.desc=Crie um sistema que automatize a Orechid. Pontos extras se os minérios forem derretidos e organizados. -botania.challenge.mobTower=Spawning Tower botania.challenge.mobTower.desc=Crie uma mob farm em estilo torre. Mobs precisam ser organizados em câmaras específicas. Invocadores podem ser usados. Pontos extras se isso não precisar do jogador e funcionar em máxima eficiência. -botania.challenge.entropinnyumSetup=Entropinnyum Setup botania.challenge.entropinnyumSetup.desc=Crie um sistema que monte e exploda seguramente Dinamite para uma Entropinnyum, criando mana. Pontos extras se a areia e a pólvora da dinamite são inseridas no sistema automaticamente. -botania.challenge.spectrolusSetup=Spectrolus Setup botania.challenge.spectrolusSetup.desc=Crie um sistema que alimente uma Spectrolus, gerando mana. Exceto mana, nenhum item deve ser inserido de fora do sistema. Pontos extras se operar em máxima eficiênica, sem desperdiçar lã. -botania.challenge.potionBrewer=Automated Brewing botania.challenge.potionBrewer.desc=Crie um sistema que prepare todas poções em demanda. Pontos extras o sistema manter incensos acesos na base do jogador. -botania.challenge.kekimurusSetup=Kekimurus Setup botania.challenge.kekimurusSetup.desc=Completamente automatize uma Kekimurus, todas partes do sistema devem ser automáticas e auto-suficientes. Pontos extras se apenas um Caixote Inteligente for usado. -botania.challenge.autoQuarry=Automated Quarry botania.challenge.autoQuarry.desc=Crie um minerador automático que colete pedra e minérios do subterrâneo. O sistema deve cavar pedaços do mundo e os resultados, organizados. Pontos extras se o sistema se relocar automaticamente depois de terminar uma área. -botania.challenge.runeCrafter=Rune Crafter -botania.challenge.runeCrafter.desc=Crie um sistema que crie em demanda ou que armazene certa quantidade de runas. Todas partes desse sistema devem ser automaticas e auto-suficientes, incluindo a entrada de itens. Pontos extras se apenas um Altar Rúnico for usado. Você não deve ter limites pra tentar isso. +botania.challenge.runeCrafter.desc=Crie umneeds "" sistema que crie em demanda ou que armazene certa quantidade de runas. Todas partes desse sistema devem ser automaticas e auto-suficientes, incluindo a entrada de itens. Pontos extras se apenas um Altar Rúnico for usado. Você não deve ter limites pra tentar isso. # BLOCK NAMES tile.botania:flower0.name=Flor Mística Branca @@ -800,19 +732,6 @@ tile.botania:dreamwood1Stairs.name=Escadas de Tábuas de Madeira dos Sonhos tile.botania:dreamwood1Slab.name=Laje de Tábuas de Madeira dos Sonhos tile.botania:dreamwood1SlabFull.name=Laje de Tábuas de Madeira dos Sonhos tile.botania:conjurationCatalyst.name=Catalizador de Conjurações -tile.botania:prismarine0.name=Prismarinho -tile.botania:prismarine1.name=Tijolos de Prismarinho -tile.botania:prismarine2.name=Prismarinho Escuro -tile.botania:prismarine0Stairs.name=Escadas de Prismarinho -tile.botania:prismarine0Slab.name=Laje de Prismarinho -tile.botania:prismarine0SlabFull.name=Laje de Prismarinho -tile.botania:prismarine1Stairs.name=Escadas de Tijolos de Prismarinho -tile.botania:prismarine1Slab.name=Laje de Tijolos de Prismarinho -tile.botania:prismarine1SlabFull.name=Laje de Tijolos de Prismarinho -tile.botania:prismarine2Stairs.name=Escadas de Prismarinho Escuro -tile.botania:prismarine2Slab.name=Laje de Prismarinho Escuro -tile.botania:prismarine2SlabFull.name=Laje de Prismarinho Escuro -tile.botania:seaLamp.name=Lanterna do Mar tile.botania:miniIsland0.name=Flor Branca Flutuante tile.botania:miniIsland1.name=Flor Laranja Flutuante tile.botania:miniIsland2.name=Flor Magenta Flutuante @@ -831,14 +750,6 @@ tile.botania:miniIsland14.name=Flor Vermelha Flutuante tile.botania:miniIsland15.name=Flor Preta Flutuante tile.botania:tinyPotato.name=Batatinha tile.botania:spawnerClaw.name=Imbuidor de Vida -tile.botania:reedBlock.name=Bloco de Cana-de-açúcar -tile.botania:reedBlock0Stairs.name=Escadas de Cana-de-açúcar -tile.botania:reedBlock0Slab.name=Laje de Cana-de-açúcar -tile.botania:reedBlock0SlabFull.name=Laje de Cana-de-açúcar -tile.botania:thatch.name=Palha -tile.botania:thatch0Stairs.name=Escadas de Palha -tile.botania:thatch0Slab.name=Laje de Palha -tile.botania:thatch0SlabFull.name=Laje de Palha tile.botania:customBrick0.name=Tijolo Infernal tile.botania:customBrick1.name=Tijolo da Alma tile.botania:customBrick2.name=Tijolo Invernal @@ -1067,46 +978,10 @@ tile.botania:doubleFlower212.name=Flor Mística Alta Marrom tile.botania:doubleFlower213.name=Flor Mística Alta Verde tile.botania:doubleFlower214.name=Flor Mística Alta Vermelha tile.botania:doubleFlower215.name=Flor Mística Alta Preta -tile.botania:stone0.name=Andesito -tile.botania:stone1.name=Basalto -tile.botania:stone2.name=Diorito -tile.botania:stone3.name=Granito -tile.botania:stone4.name=Andesito Polido -tile.botania:stone5.name=Basalto Polido -tile.botania:stone6.name=Diorito Polido -tile.botania:stone7.name=Granito Polido -tile.botania:stone8.name=Tijolos de Andesito -tile.botania:stone9.name=Tijolos de Basalto -tile.botania:stone10.name=Tijoloes de Diorito -tile.botania:stone11.name=Tijolos de Granito tile.botania:stone12.name=Tijolos de Andesito Talhados tile.botania:stone13.name=Tijolos de Basalto Talhados tile.botania:stone14.name=Tijolos de Diorito Talhados tile.botania:stone15.name=Tijolos de Granito Talhados -tile.botania:stone0Stairs.name=Escadas de Andesito -tile.botania:stone1Stairs.name=Escadas de Basalto -tile.botania:stone2Stairs.name=Escadas de Diorito -tile.botania:stone3Stairs.name=Escadas de Granito -tile.botania:stone8Stairs.name=Escadas de Tijolos de Andesito -tile.botania:stone9Stairs.name=Escadas de Tijolos de Basalto -tile.botania:stone10Stairs.name=Escadas de Tijolos de Diorito -tile.botania:stone11Stairs.name=Escadas de Tijolos de Granito -tile.botania:stone0Slab.name=Laje de Andesito -tile.botania:stone1Slab.name=Laje de Basalto -tile.botania:stone2Slab.name=Laje de Diorito -tile.botania:stone3Slab.name=Laje de Granito -tile.botania:stone8Slab.name=Laje de Tijolos de Andesito -tile.botania:stone9Slab.name=Laje de Tijolos de Basalto -tile.botania:stone10Slab.name=Laje de Tijolos de Diorito -tile.botania:stone11Slab.name=Laje de Tijolos de Granito -tile.botania:stone0SlabFull.name=Laje de Andesito -tile.botania:stone1SlabFull.name=Laje de Basalto -tile.botania:stone2SlabFull.name=Laje de Diorito -tile.botania:stone3SlabFull.name=Laje de Granito -tile.botania:stone8SlabFull.name=Laje de Tijolos de Andesito -tile.botania:stone9SlabFull.name=Laje de Tijolos de Basalto -tile.botania:stone10SlabFull.name=Laje de Tijolos de Diorito -tile.botania:stone11SlabFull.name=Laje de Tijolos de Granito tile.botania:blazeBlock.name=Lâmpada Infernal tile.botania:corporeaInterceptor.name=Interceptador Corporea tile.botania:corporeaCrystalCube.name=Cubo de Cristal Corporea @@ -1123,8 +998,6 @@ tile.botania:lightLauncher.name=Lançador Luminizer tile.botania:livingrock0Wall.name=Muro de Rocha-viva tile.botania:livingwood0Wall.name=Muro de Madeira-viva tile.botania:dreamwood0Wall.name=Muro de Madeira dos Sonhos -tile.botania:prismarine0Wall.name=Muro de Prismarinho -tile.botania:reedBlock0Wall.name=Muro de Cana-da-açúcar tile.botania:biomeStoneA0Wall0.name=Muro de Pedra Metamórfica - Floresta tile.botania:biomeStoneA0Wall1.name=Muro de Pedra Metamórfica - Planície tile.botania:biomeStoneA0Wall2.name=Muro de Pedra Metamórfica - Montanha @@ -1133,10 +1006,6 @@ tile.botania:biomeStoneA0Wall4.name=Muro de Pedra Metamórfica - Pântano tile.botania:biomeStoneA0Wall5.name=Muro de Pedra Metamórfica - Deserto tile.botania:biomeStoneA0Wall6.name=Muro de Pedra Metamórfica - Taiga tile.botania:biomeStoneA0Wall7.name=Muro de Pedra Metamórfica - Mesa -tile.botania:stone0Wall0.name=Muro de Andesito -tile.botania:stone0Wall1.name=Muro de Basalto -tile.botania:stone0Wall2.name=Muro de Diorito -tile.botania:stone0Wall3.name=Muro de Granito tile.botania:manaBomb.name=Carga de Manastorm tile.botania:buriedPetals0=Pétala Enterrada tile.botania:buriedPetals0.name=Pétala Branca Enterrada @@ -1632,7 +1501,7 @@ item.botania:terraAxe.name=Terra-Truncador item.botania:manasteelNugget.name=Pepita de Manasteel item.botania:terrasteelNugget.name=Pepita de Terrasteel item.botania:elementiumNugget.name=Pepita de Elementium -item.botania:root.name=Raíz-viva +item.botania:livingRoot.name=Raíz-viva item.botania:pebble.name=Seixo item.botania:waterBowl.name=Tigela de água item.botania:obedienceStick.name=Varinha da Obediência Floral @@ -1693,266 +1562,6 @@ botania.potion.clear=Absolução botania.gui.lexicon.header=Lexica Botania, Edição %s - Índice botania.gui.lexicon.wip=(Esse tópico está em progresso. Nem ao menos está na forma final) -# MUSIC DISCS -item.record.botania:gaia1.desc=Kain Vinosec - Endure Emptiness -item.record.botania:gaia2.desc=Kain Vinosec - Fight For Quiescence - -# BANNER NAMES -item.banner.botania_flower.black=Black Mystical Flower -item.banner.botania_flower.red=Red Mystical Flower -item.banner.botania_flower.green=Green Mystical Flower -item.banner.botania_flower.brown=Brown Mystical Flower -item.banner.botania_flower.blue=Blue Mystical Flower -item.banner.botania_flower.purple=Purple Mystical Flower -item.banner.botania_flower.cyan=Cyan Mystical Flower -item.banner.botania_flower.silver=Light Gray Mystical Flower -item.banner.botania_flower.gray=Gray Mystical Flower -item.banner.botania_flower.pink=Pink Mystical Flower -item.banner.botania_flower.lime=Lime Mystical Flower -item.banner.botania_flower.yellow=Yellow Mystical Flower -item.banner.botania_flower.lightBlue=Light Blue Mystical Flower -item.banner.botania_flower.magenta=Magenta Mystical Flower -item.banner.botania_flower.orange=Orange Mystical Flower -item.banner.botania_flower.white=White Mystical Flower - -item.banner.botania_lexicon.black=Black Lexicon -item.banner.botania_lexicon.red=Red Lexicon -item.banner.botania_lexicon.green=Green Lexicon -item.banner.botania_lexicon.brown=Brown Lexicon -item.banner.botania_lexicon.blue=Blue Lexicon -item.banner.botania_lexicon.purple=Purple Lexicon -item.banner.botania_lexicon.cyan=Cyan Lexicon -item.banner.botania_lexicon.silver=Light Gray Lexicon -item.banner.botania_lexicon.gray=Gray Lexicon -item.banner.botania_lexicon.pink=Pink Lexicon -item.banner.botania_lexicon.lime=Lime Lexicon -item.banner.botania_lexicon.yellow=Yellow Lexicon -item.banner.botania_lexicon.lightBlue=Light Blue Lexicon -item.banner.botania_lexicon.magenta=Magenta Lexicon -item.banner.botania_lexicon.orange=Orange Lexicon -item.banner.botania_lexicon.white=White Lexicon - -item.banner.botania_logo.black=Black Botania -item.banner.botania_logo.red=Red Botania -item.banner.botania_logo.green=Green Botania -item.banner.botania_logo.brown=Brown Botania -item.banner.botania_logo.blue=Blue Botania -item.banner.botania_logo.purple=Purple Botania -item.banner.botania_logo.cyan=Cyan Botania -item.banner.botania_logo.silver=Light Gray Botania -item.banner.botania_logo.gray=Gray Botania -item.banner.botania_logo.pink=Pink Botania -item.banner.botania_logo.lime=Lime Botania -item.banner.botania_logo.yellow=Yellow Botania -item.banner.botania_logo.lightBlue=Light Blue Botania -item.banner.botania_logo.magenta=Magenta Botania -item.banner.botania_logo.orange=Orange Botania -item.banner.botania_logo.white=White Botania - -item.banner.botania_sapling.black=Black Tree -item.banner.botania_sapling.red=Red Tree -item.banner.botania_sapling.green=Green Tree -item.banner.botania_sapling.brown=Brown Tree -item.banner.botania_sapling.blue=Blue Tree -item.banner.botania_sapling.purple=Purple Tree -item.banner.botania_sapling.cyan=Cyan Tree -item.banner.botania_sapling.silver=Light Gray Tree -item.banner.botania_sapling.gray=Gray Tree -item.banner.botania_sapling.pink=Pink Tree -item.banner.botania_sapling.lime=Lime Tree -item.banner.botania_sapling.yellow=Yellow Tree -item.banner.botania_sapling.lightBlue=Light Blue Tree -item.banner.botania_sapling.magenta=Magenta Tree -item.banner.botania_sapling.orange=Orange Tree -item.banner.botania_sapling.white=White Tree - -item.banner.botania_tiny_potato.black=Black Potato Face -item.banner.botania_tiny_potato.red=Red Potato Face -item.banner.botania_tiny_potato.green=Green Potato Face -item.banner.botania_tiny_potato.brown=Brown Potato Face -item.banner.botania_tiny_potato.blue=Blue Potato Face -item.banner.botania_tiny_potato.purple=Purple Potato Face -item.banner.botania_tiny_potato.cyan=Cyan Potato Face -item.banner.botania_tiny_potato.silver=Light Gray Potato Face -item.banner.botania_tiny_potato.gray=Gray Potato Face -item.banner.botania_tiny_potato.pink=Pink Potato Face -item.banner.botania_tiny_potato.lime=Lime Potato Face -item.banner.botania_tiny_potato.yellow=Yellow Potato Face -item.banner.botania_tiny_potato.lightBlue=Light Blue Potato Face -item.banner.botania_tiny_potato.magenta=Magenta Potato Face -item.banner.botania_tiny_potato.orange=Orange Potato Face -item.banner.botania_tiny_potato.white=White Potato Face - -item.banner.botania_spark_dispersive.black=Black Dispersive Symbol -item.banner.botania_spark_dispersive.red=Red Dispersive Symbol -item.banner.botania_spark_dispersive.green=Green Dispersive Symbol -item.banner.botania_spark_dispersive.brown=Brown Dispersive Symbol -item.banner.botania_spark_dispersive.blue=Blue Dispersive Symbol -item.banner.botania_spark_dispersive.purple=Purple Dispersive Symbol -item.banner.botania_spark_dispersive.cyan=Cyan Dispersive Symbol -item.banner.botania_spark_dispersive.silver=Light Gray Dispersive Symbol -item.banner.botania_spark_dispersive.gray=Gray Dispersive Symbol -item.banner.botania_spark_dispersive.pink=Pink Dispersive Symbol -item.banner.botania_spark_dispersive.lime=Lime Dispersive Symbol -item.banner.botania_spark_dispersive.yellow=Yellow Dispersive Symbol -item.banner.botania_spark_dispersive.lightBlue=Light Blue Dispersive Symbol -item.banner.botania_spark_dispersive.magenta=Magenta Dispersive Symbol -item.banner.botania_spark_dispersive.orange=Orange Dispersive Symbol -item.banner.botania_spark_dispersive.white=White Dispersive Symbol - -item.banner.botania_spark_dominant.black=Black Dominant Symbol -item.banner.botania_spark_dominant.red=Red Dominant Symbol -item.banner.botania_spark_dominant.green=Green Dominant Symbol -item.banner.botania_spark_dominant.brown=Brown Dominant Symbol -item.banner.botania_spark_dominant.blue=Blue Dominant Symbol -item.banner.botania_spark_dominant.purple=Purple Dominant Symbol -item.banner.botania_spark_dominant.cyan=Cyan Dominant Symbol -item.banner.botania_spark_dominant.silver=Light Gray Dominant Symbol -item.banner.botania_spark_dominant.gray=Gray Dominant Symbol -item.banner.botania_spark_dominant.pink=Pink Dominant Symbol -item.banner.botania_spark_dominant.lime=Lime Dominant Symbol -item.banner.botania_spark_dominant.yellow=Yellow Dominant Symbol -item.banner.botania_spark_dominant.lightBlue=Light Blue Dominant Symbol -item.banner.botania_spark_dominant.magenta=Magenta Dominant Symbol -item.banner.botania_spark_dominant.orange=Orange Dominant Symbol -item.banner.botania_spark_dominant.white=White Dominant Symbol - -item.banner.botania_spark_isolated.black=Black Isolated Symbol -item.banner.botania_spark_isolated.red=Red Isolated Symbol -item.banner.botania_spark_isolated.green=Green Isolated Symbol -item.banner.botania_spark_isolated.brown=Brown Isolated Symbol -item.banner.botania_spark_isolated.blue=Blue Isolated Symbol -item.banner.botania_spark_isolated.purple=Purple Isolated Symbol -item.banner.botania_spark_isolated.cyan=Cyan Isolated Symbol -item.banner.botania_spark_isolated.silver=Light Gray Isolated Symbol -item.banner.botania_spark_isolated.gray=Gray Isolated Symbol -item.banner.botania_spark_isolated.pink=Pink Isolated Symbol -item.banner.botania_spark_isolated.lime=Lime Isolated Symbol -item.banner.botania_spark_isolated.yellow=Yellow Isolated Symbol -item.banner.botania_spark_isolated.lightBlue=Light Blue Isolated Symbol -item.banner.botania_spark_isolated.magenta=Magenta Isolated Symbol -item.banner.botania_spark_isolated.orange=Orange Isolated Symbol -item.banner.botania_spark_isolated.white=White Isolated Symbol - -item.banner.botania_spark_recessive.black=Black Recessive Symbol -item.banner.botania_spark_recessive.red=Red Recessive Symbol -item.banner.botania_spark_recessive.green=Green Recessive Symbol -item.banner.botania_spark_recessive.brown=Brown Recessive Symbol -item.banner.botania_spark_recessive.blue=Blue Recessive Symbol -item.banner.botania_spark_recessive.purple=Purple Recessive Symbol -item.banner.botania_spark_recessive.cyan=Cyan Recessive Symbol -item.banner.botania_spark_recessive.silver=Light Gray Recessive Symbol -item.banner.botania_spark_recessive.gray=Gray Recessive Symbol -item.banner.botania_spark_recessive.pink=Pink Recessive Symbol -item.banner.botania_spark_recessive.lime=Lime Recessive Symbol -item.banner.botania_spark_recessive.yellow=Yellow Recessive Symbol -item.banner.botania_spark_recessive.lightBlue=Light Blue Recessive Symbol -item.banner.botania_spark_recessive.magenta=Magenta Recessive Symbol -item.banner.botania_spark_recessive.orange=Orange Recessive Symbol -item.banner.botania_spark_recessive.white=White Recessive Symbol - -item.banner.botania_fish.black=Black Fish -item.banner.botania_fish.red=Red Fish -item.banner.botania_fish.green=Green Fish -item.banner.botania_fish.brown=Brown Fish -item.banner.botania_fish.blue=Blue Fish -item.banner.botania_fish.purple=Purple Fish -item.banner.botania_fish.cyan=Cyan Fish -item.banner.botania_fish.silver=Light Gray Fish -item.banner.botania_fish.gray=Gray Fish -item.banner.botania_fish.pink=Pink Fish -item.banner.botania_fish.lime=Lime Fish -item.banner.botania_fish.yellow=Yellow Fish -item.banner.botania_fish.lightBlue=Light Blue Fish -item.banner.botania_fish.magenta=Magenta Fish -item.banner.botania_fish.orange=Orange Fish -item.banner.botania_fish.white=White Fish - -item.banner.botania_axe.black=Black Axe -item.banner.botania_axe.red=Red Axe -item.banner.botania_axe.green=Green Axe -item.banner.botania_axe.brown=Brown Axe -item.banner.botania_axe.blue=Blue Axe -item.banner.botania_axe.purple=Purple Axe -item.banner.botania_axe.cyan=Cyan Axe -item.banner.botania_axe.silver=Light Gray Axe -item.banner.botania_axe.gray=Gray Axe -item.banner.botania_axe.pink=Pink Axe -item.banner.botania_axe.lime=Lime Axe -item.banner.botania_axe.yellow=Yellow Axe -item.banner.botania_axe.lightBlue=Light Blue Axe -item.banner.botania_axe.magenta=Magenta Axe -item.banner.botania_axe.orange=Orange Axe -item.banner.botania_axe.white=White Axe - -item.banner.botania_hoe.black=Black Hoe -item.banner.botania_hoe.red=Red Hoe -item.banner.botania_hoe.green=Green Hoe -item.banner.botania_hoe.brown=Brown Hoe -item.banner.botania_hoe.blue=Blue Hoe -item.banner.botania_hoe.purple=Purple Hoe -item.banner.botania_hoe.cyan=Cyan Hoe -item.banner.botania_hoe.silver=Light Gray Hoe -item.banner.botania_hoe.gray=Gray Hoe -item.banner.botania_hoe.pink=Pink Hoe -item.banner.botania_hoe.lime=Lime Hoe -item.banner.botania_hoe.yellow=Yellow Hoe -item.banner.botania_hoe.lightBlue=Light Blue Hoe -item.banner.botania_hoe.magenta=Magenta Hoe -item.banner.botania_hoe.orange=Orange Hoe -item.banner.botania_hoe.white=White Hoe - -item.banner.botania_pickaxe.black=Black Pickaxe -item.banner.botania_pickaxe.red=Red Pickaxe -item.banner.botania_pickaxe.green=Green Pickaxe -item.banner.botania_pickaxe.brown=Brown Pickaxe -item.banner.botania_pickaxe.blue=Blue Pickaxe -item.banner.botania_pickaxe.purple=Purple Pickaxe -item.banner.botania_pickaxe.cyan=Cyan Pickaxe -item.banner.botania_pickaxe.silver=Light Gray Pickaxe -item.banner.botania_pickaxe.gray=Gray Pickaxe -item.banner.botania_pickaxe.pink=Pink Pickaxe -item.banner.botania_pickaxe.lime=Lime Pickaxe -item.banner.botania_pickaxe.yellow=Yellow Pickaxe -item.banner.botania_pickaxe.lightBlue=Light Blue Pickaxe -item.banner.botania_pickaxe.magenta=Magenta Pickaxe -item.banner.botania_pickaxe.orange=Orange Pickaxe -item.banner.botania_pickaxe.white=White Pickaxe - -item.banner.botania_shovel.black=Black Shovel -item.banner.botania_shovel.red=Red Shovel -item.banner.botania_shovel.green=Green Shovel -item.banner.botania_shovel.brown=Brown Shovel -item.banner.botania_shovel.blue=Blue Shovel -item.banner.botania_shovel.purple=Purple Shovel -item.banner.botania_shovel.cyan=Cyan Shovel -item.banner.botania_shovel.silver=Light Gray Shovel -item.banner.botania_shovel.gray=Gray Shovel -item.banner.botania_shovel.pink=Pink Shovel -item.banner.botania_shovel.lime=Lime Shovel -item.banner.botania_shovel.yellow=Yellow Shovel -item.banner.botania_shovel.lightBlue=Light Blue Shovel -item.banner.botania_shovel.magenta=Magenta Shovel -item.banner.botania_shovel.orange=Orange Shovel -item.banner.botania_shovel.white=White Shovel - -item.banner.botania_sword.black=Black Sword -item.banner.botania_sword.red=Red Sword -item.banner.botania_sword.green=Green Sword -item.banner.botania_sword.brown=Brown Sword -item.banner.botania_sword.blue=Blue Sword -item.banner.botania_sword.purple=Purple Sword -item.banner.botania_sword.cyan=Cyan Sword -item.banner.botania_sword.silver=Light Gray Sword -item.banner.botania_sword.gray=Gray Sword -item.banner.botania_sword.pink=Pink Sword -item.banner.botania_sword.lime=Lime Sword -item.banner.botania_sword.yellow=Yellow Sword -item.banner.botania_sword.lightBlue=Light Blue Sword -item.banner.botania_sword.magenta=Magenta Sword -item.banner.botania_sword.orange=Orange Sword -item.banner.botania_sword.white=White Sword - # LEXICON CATEGORIES botania.category.basics=Mecânicas e Informações básicas botania.category.mana=Manipulação de Mana @@ -1969,17 +1578,7 @@ botania.category.misc=Conteúdo Diverso # - BASIC # -- WELCOME TO BOTANIA -botania.entry.welcome=Welcome To Botania botania.tagline.welcome=Bem-vindo ao Hotel Botania -botania.page.welcome0=&oWhat is peace? Is it truly just a lack of combat? Is it years of sitting quietly in a garden, surrounded by flowers? Is it watching over a kingdom that you are able to call your own? Is it the completion of almost every task known to man? Is it the ability to watch numbers of resources steadily rise as you watch your collection grow? -botania.page.welcome1=&oIs peace something that can be obtained easily, without work - or is it something difficult to obtain?
    Let's say for a moment - not even a second - that peace is truly just a lack of work; peaceful days surrounded by flowers. -botania.page.welcome2=&oYears spent watching time tick by while you watch your flora perform every single task imaginable, without outside help from polluting machines or computers tangled in cables and pipes.
    Now imagine that everything we just talked about was possible. -botania.page.welcome3=&oImagine that through your hard labor - your cultivation of flowers, your manipulation of mana, your knowledge of the mechanisms of the world and redstone - you could obtain that dreamlike state. Imagine that you could have everything you could ever desire automated with flora. Flora, some magic, and your own ingenuity. -botania.page.welcome4=&oWith the help of this book, your dreams will become a reality.
    The name of this book is deceptive. Despite being called the Lexica Botania, this tome focuses on far more than just flowers. It focuses on a variety of devices, both magical and bordering on technological. -botania.page.welcome5=&oIt holds the secrets of the elves, who have long ago fled from this world, as well as possible clues to the origins of the very world itself. For anyone with a basic knowledge of redstone and the creativity to put it to use, this book offers answers to nearly every problem known to man, without the need to use foreign schools of magic or machinery. -botania.page.welcome6=&oThis book contains instructions on how to perform nearly every task that one could ever need, with only the use of what's in it, and available in the world of Minecraft, assuming you're up to the task of putting them together in ingenious ways.
    Try it out, you'll be amazed at what you can do without outside interference. -botania.page.welcome7=&oThe school of botany does not solely apply to those with a knack for complex thought processes.
    Introduction to the art is simple, and the rewards are vast. A wide range of magical accessories and instruments allow for empowering of one who decides to study the various options therein. -botania.page.welcome8=&oDear reader, I welcome you to the realm of Botania.&r
    - Written by &nGideon Seymour&r, guest writer. (Adapted for use) # -- TUTORIAL OF THE BASICS botania.entry.tutorial=Tutorial de mecânicas básicas @@ -2106,7 +1705,6 @@ botania.page.flowerBag1=Puxe uma hélice de dentro (qualquer cor funciona) # -- WRAP botania.entry.wrap=Wrap -botania.tagline.wrap=It's a wrap botania.page.wrap0=Parece que o autor do mod decidiu adicionar uma mecânica conhecida como &1Wrap&0. Não se sabe o que significa, mas certamente é algo ruim. :/
    O que é essa 'barreira da realidade' a qual você se refere...? # - MANA @@ -2286,7 +1884,6 @@ botania.tagline.warpLens=Muda os efeitos de um Pulso de Mana na hora botania.page.prism0=O conceito de &1Lentes de Mana&0 permite que tal poder possa ser usado por &4Pulsos de Mana&0, o &1Prisma de Mana&0 permite que Pulsos possam ser modificados no trajeto.
    Usando uma &1Plataforma Espectral&0 como componente, esse bloco não possúi uma presença física, entidades e Pulsos o atravessam como se não existisse. botania.page.prism1=Clicando com uma qualquer &1Lente de Mana&0 coloca a lente no Prisma. Toda vez que um &4Pulso de Mana&0 passa pelo Prisma, sua cor e efeito mudam para aqueles da lente do Prisma. No caso da lente não ser colorida, o Pulso se torna branco.
    Usar qualquer uma das quatro lentes básicas também aumenta o tempo de vida do Pulso, permitindo mais tempo sem perder &4Mana&0. botania.page.prism2=Pode ser desligado com um sinal de redstone. -botania.page.prism3=Another pixel in the wall # -- MANA ON RAILS botania.entry.poolCart=Mana sobre trilhos @@ -2362,7 +1959,6 @@ botania.page.tigerseye1=&oAceitando o desafio de nossos rivais&r. botania.entry.orechid=Orechid botania.tagline.orechid=Cria minérios a partir de pedra botania.page.orechid0=Enquanto minerar é bom, um meio renovável de conseguir minérios é bem vindo. A &1Orechid&0 usa (uma quantidade massiva de) &4Mana&0 para gerar &4minérios&0 em blocs de &1Pedra&0 adjacentes.
    Os minérios gerados são aleatórios, mas parecem tender aos mais comuns do que os mais raros. -botania.page.orechid1=&oNot dragon poop&r. # -- ORECHID IGNEM botania.entry.orechidIgnem=Orechid Ignem @@ -2400,13 +1996,11 @@ botania.page.hopperhock2=&oI guess I'll be talking my loli and leaving&r. botania.entry.tangleberrie=Tangleberrie botania.tagline.tangleberrie=Mantém mobs presos botania.page.tangleberrie0=A &1Tangleberrie&0 é uma flor que, a um pequeno custo de &4Mana&0, mantém animais e monstros dentro de um círculo, os impedindo de sair. -botania.page.tangleberrie1=&oTangled, brave and frozen&r. # -- JIYUULIA botania.entry.jiyuulia=Jiyuulia botania.tagline.jiyuulia=Mantém mobs longe botania.page.jiyuulia0=A &1Jiyuulia&0 é uma flor, que a um pequeno custo de &4Mana&0, afasta animais e monstros, protejendo uma área circular, os impedindo de entrar. -botania.page.jiyuulia1=&oHR HD DT Masterpiece&r. # -- RANNUNCARPUS botania.entry.rannuncarpus=Rannuncarpus @@ -2600,17 +2194,6 @@ botania.page.rafflowsia4=&oUm Novo Amanhecer, assim dizendo&r. botania.entry.dandelifeon=Dandelifeon botania.tagline.dandelifeon=Mana por vida botania.page.dandelifeon_w=Alerta: Essa funcionalidade é experimental.
    Ela pode e deve mudar futuramente. Não se acostume com ela. -// WARNING -// UNSTABLE -// -// -// -// This entry will be localized once the flower reachs it's final form -// -// -// -// This is a placeholder space for convenience sake -// WARNING # - NATURAL APPARATUS # -- MANA PYLON @@ -2735,11 +2318,8 @@ botania.page.incense0=&4Fermentado&0 oferecem uma variedade de efeitos na forma botania.page.incense1=Um &1Incenso&0 pode ser colocado numa &1Bandeja de Incensos&0 ao clicar, e um &1Isqueiro&0 para acender. Uma vez acesa, a vareta não pode ser recuperada.
    Uma única vareta queima por sessenta vezes mais que a forma líquida da poção antes de acabar. botania.page.incense2=&1Bandejas de Incenso&0 com &1Incensos&0 acesos aplicam o efeito do &4Fermentado&0 infuso na vareta para qualquer jogador num raio de 30 blocos.
    Nem todos efeitos são possíveis de aplicar aos &1Incensos&0, por exemplo, &4Cura Instantânea&0 ou &1Absorção&0, ou qualquer fermentado com mais de um efeito. botania.page.incense5=Para os amantes de incensos que também são viciados em automação, a &1Bandeja de Incensos&0 pode receber itens por &1Funis&0 ou outros métodos. Ela emite um sinal de &1Comparador&0 de força 1 quando tem uma vareta, e de 2 quando aceso.
    Finalmente, quando um &4Pulso de Mana&0 com &1Lente de Aquecimento&0 acerta uma bandeja com um incenso, ele se acende. -botania.page.incense3=Incense is wincense -botania.page.incense4=I can incense it # -- FEL PUMPKIN -botania.entry.felPumpkin=Fel Pumpkin botania.tagline.felPumpkin=Uma abóbora que pode invocar Blazes botania.page.felPumpkin0=A &1Abóbora Fel&0 é uma infusão maligna entre uma &1Abóbora&0 com o espírito de monstros mortos. Essa abóbora amaldiçoada pode ser colocada no topo de duas &1Grades de Ferro&0, igual a um &1Golem de Neve&0, para invocar um &1Blaze&0.
    &1Blazes&0 invocados com esse método derrubam uma boa quantidade de &1Pó de Blaze&0 ao invés de &1Varas Incandescentes&0. botania.page.felPumpkin1=Nerfando os warlocks outra vez diff --git a/src/main/resources/assets/botania/lang/ru_RU.lang b/src/main/resources/assets/botania/lang/ru_RU.lang index 423e07fa2..3233b26df 100644 --- a/src/main/resources/assets/botania/lang/ru_RU.lang +++ b/src/main/resources/assets/botania/lang/ru_RU.lang @@ -1,11 +1,15 @@ +# Note to translators: DO NOT COPY ENTRIES FROM ENGLISH +# I repeat: do NOT copy entries from English!! +# Any entry in this lang file should be in ru_RU, or *should not be here at all* +# Copying English entries will cause them to become outdated when the main English lang file changes +# Untranslated entries will automatically be inherited from en_US +# +# Once again, don't copy from English, and THANK YOU for your hard work! + # MISC itemGroup.Botania=Botania -generator.botania-skyblock=Garden of Glass generator.botania-skyblock.info=Не рекомендуется для новичков -# Something that is not localized, translators, do NOT change this line. -botaniamisc.noloc=botaniamisc.noloc - botaniamisc.nextPage=След. страница botaniamisc.prevPage=Пред. страница botaniamisc.back=Назад @@ -49,9 +53,6 @@ botaniamisc.shiftToRemove=Shift+ЛКМ, чтобы удалить botaniamisc.clickToAdd=Добавить закладку botaniamisc.ratio=Соотношение: %sx botaniamisc.bottleTooltip=Вкус на любителя -botaniamisc.coarseDirt0=Грубая земля, трава -botaniamisc.coarseDirt1=не будет расти на ней -botaniamisc.spawnerTip=Подсказка: Используйте яйцо призыва, чтобы сменить моба botaniamisc.shardLevel=Сила осколка %s botaniamisc.lexiconIndex=Оглавление Лексикона botaniamisc.hasIvy=С бессмертным плющом @@ -60,66 +61,14 @@ botaniamisc.noLexicon=Вы должны держать Лексику Botania в botaniamisc.cantOpen=Похоже в Вашей Лексике Botania нет этой страницы. Возможно, она появилась из постороннего источника...? botaniamisc.clickToShare=Поделиться botaniamisc.drop=Бросить -botaniamisc.dropTip0=Совет: Вы можете нажать %key% в Вашем инвентаре, чтобы выбросить -botaniamisc.dropTip1=CTRL+%key% выбросит весь стак +botaniamisc.dropTip0=Совет: Вы можете нажать %s в Вашем инвентаре, чтобы выбросить +botaniamisc.dropTip1=CTRL+%s выбросит весь стак botaniamisc.wandMode.bind=Режим привязки botaniamisc.wandMode.function=Функциональный режим botaniamisc.playVideo=Просмотреть видео botaniamisc.brewOf=Настой %s -botaniamisc.needsCatalysts=No matter how hard you try to push the Ingot into the Beacon, nothing seems to happen, perhaps your configuration of catalyst pylons might be off. -botaniamisc.peacefulNoob=You try to offer the Ingot, but the peaceful vibes of your world prevent you from doing so. Perhaps you should do something about that. -botaniamisc.notInfused=Not Infused -botaniamisc.getALife=Get a Life -botaniamisc.floatingPrefix=Floating %s -botaniamisc.unsetRecipe=[No Recipe] Right click to set: -botaniamisc.cantCraft=Not enough Materials! -botaniamisc.lotusDesc=It emits strong magical vibes -botaniamisc.hasClip=&6Has Lens Clip -botaniamisc.clipEmpty=(Empty) -botaniamisc.armorset=&bArmor Set&r: -botaniamisc.craftToAddWill=&aCraft with a Terrasteel Helmet to add the following effect: -botaniamisc.requestMsg=Requested %d x "%s" out of %d. %d taken. -botaniamisc.nearIndex0=Corporea Index nearby! -botaniamisc.nearIndex1=Anything you say will be -botaniamisc.nearIndex2=intercepted as a request -botaniamisc.startTutorial=Start Tutorial -botaniamisc.tutorialStarted=You have started your tutorial, follow the red arrows and read the contents to be guided through the basics of Botania! -botaniamisc.tutorialEnded=Your tutorial is over, you should now have a basic idea of how Botania works, make sure to read through the other pages at your leisure to learn more ways of using the mod. -botaniamisc.cosmeticBauble=&oCosmetic -botaniamisc.hasCosmetic=&oHas Cosmetic Override: &r%s -botaniamisc.typeToSearch=(type to search) botaniamisc.viewOnline=Смотреть онлайн -botaniamisc.history=History -botaniamisc.historyLong=Lookup History -botaniamisc.historyDesc=See the last entries visited -botaniamisc.lexiconOptions0=Botania Options -botaniamisc.lexiconOptions1=Configure Botania from ingame -botaniamisc.lexiconOptions2=Some options might need a game restart -botaniamisc.hasPhantomInk=&bTinged with Phantom Ink -botaniamisc.pinkinatorDesc=Apply directly to Wither -botaniamisc.relicUnbound=&6Relic&7, Unbound -botaniamisc.relicSoulbound=&6Relic&7, Soulbound to &f%s -botaniamisc.notYourSagittarius=&4This relic is not yours -botaniamisc.diceRoll=The dice lands on a %s, you notice that it transforms into something else. -botaniamisc.dudDiceRoll=The dice lands on a %s, it seemed to vanish into thin air afterward. -botaniamisc.blockAway=1 Block Away -botaniamisc.blocksAway=%s Blocks Away -botaniamisc.clickToTeleport=Right click to Teleport -botaniamisc.clickToRemoveWarp=Shift-left click to Remove -botaniamisc.unboundWarp=Unbound Warp Point -botaniamisc.clickToAddWarp=Right click to bind to this position -botaniamisc.hasKeepIvy=Has Resolute Ivy -botaniamisc.active=&aActive -botaniamisc.inactive=&cInactive botaniamisc.achievements=Достижения Botania -botaniamisc.dropIkea=&bDropping this item will break it down into its components -botaniamisc.hourglassLock=This Hourglass is locked. Right click it with a Wand of the Forest to unlock it. -botaniamisc.locked=Locked -botaniamisc.stopped=Stopped -botaniamisc.lockedStopped=Locked, Stopped -botaniamisc.visualize=Visualize -botaniamisc.unvisualize=Unvisualize -botaniamisc.rightClickToAnchor=Right click any block to anchor this Structure Preview to it botaniamisc.structureComplete=Структура построена! botaniamisc.materialsRequired=Необходимые материалы botaniamisc.challenges=Испытания @@ -129,29 +78,9 @@ botaniamisc.completed=Выполнено botaniamisc.notCompleted=Не выполнено botaniamisc.info=Информация botaniamisc.challengeInfo=Узнать об испытаниях -botaniamisc.skyblockRangeTooLow=Invalid range, must be at least 250. -botaniamisc.skyblockRangeTooHigh=Invalid range, can't be higher than 10000000 (10 million). botaniamisc.hideNotes=Спрятать заметки botaniamisc.showNotes=Показать заметки botaniamisc.notes=Заметки -botaniamisc.pay2win=Upgrade your Mana Pool to infuse this item - -# NEI INTEGRATION -botania.nei.brewery=Botanical Brewery -botania.nei.elvenTrade=Elven Trade -botania.nei.floatingFlowers=Floating Flowers -botania.nei.manaPool=Mana Infusion -botania.nei.petalApothecary=Petal Apothecary -botania.nei.runicAltar=Runic Altar -botania.nei.pureDaisy=Pure Daisy - -# BUILDCRAFT INTEGRATION -botania.triggers.manaDetector=Mana Burst -botania.triggers.manaEmpty=Mana Empty -botania.triggers.manaSpace=Space for Mana -botania.triggers.manaContains=Contains Mana -botania.triggers.manaFull=Mana Full -botania.triggers.runeAltarCanCraft=Altar Can Craft # COLORS botania.color0=Белый @@ -172,28 +101,6 @@ botania.color14=Красный botania.color15=Чёрный botania.color16=Радужный -# RANKS -botania.rank0=&cD -botania.rank1=&eC -botania.rank2=&bB -botania.rank3=&aA -botania.rank4=&dS -botania.rank5=&6SS - -# ZODIAC SIGNS -botania.sign0=Aries -botania.sign1=Taurus -botania.sign2=Gemini -botania.sign3=Cancer -botania.sign4=Leo -botania.sign5=Virgo -botania.sign6=Libra -botania.sign7=Scorpio -botania.sign8=Sagittarius -botania.sign9=Capricorn -botania.sign10=Aquarius -botania.sign11=Pisces - # WINGS botania.wings0=Без крыльев botania.wings1=Крылья: Флигель @@ -206,60 +113,6 @@ botania.wings7=Крылья: Сильф botania.wings8=Крылья: Мега-ультра-курица botania.wings9=Крылья: Тот самый -# ARMOR SETS -botania.armorset.manasteel.name=Mana Affinity -botania.armorset.manasteel.desc=10% less Mana cost on Mana Tools -botania.armorset.elementium.name=Great Fairy's Blessing -botania.armorset.elementium.desc=Chance for pixies to apply potion effects -botania.armorset.terrasteel.name=Will of the Ancients -botania.armorset.terrasteel.desc0=20% less Mana cost on Mana Tools -botania.armorset.terrasteel.desc1=Regen even if hunger isn't topped off -botania.armorset.will0.desc=Critical Hits apply a strong weakness effect (Will of Ahrim) -botania.armorset.will1.desc=Critical Hit damage increases with lower HP (Will of Dharok) -botania.armorset.will2.desc=Critical Hits heal for a portion of damage dealt (Will of Guthan) -botania.armorset.will3.desc=Critical Hits apply a strong slowness effect (Will of Torag) -botania.armorset.will4.desc=Critical Hits pierce through armor (Will of Verac) -botania.armorset.will5.desc=Critical Hits apply a wither effect (Will of Karil) -botania.armorset.will0.shortDesc=Critical Hits apply a strong weakness effect -botania.armorset.will1.shortDesc=Critical Hit damage increases with lower HP -botania.armorset.will2.shortDesc=Critical Hits heal for a portion of damage dealt -botania.armorset.will3.shortDesc=Critical Hits apply a strong slowness effect -botania.armorset.will4.shortDesc=Critical Hits pierce through armor -botania.armorset.will5.shortDesc=Critical Hits apply a wither effect - -# ROMAN NUMERALS -botania.roman0= -botania.roman1=I -botania.roman2=II -botania.roman3=III -botania.roman4=IV -botania.roman5=V -botania.roman6=VI -botania.roman7=VII -botania.roman8=VIII -botania.roman9=IX -botania.roman10=X -botania.roman11=XI -botania.roman12=XII -botania.roman13=XIII -botania.roman14=XIV -botania.roman15=XV -botania.roman16=XVI -botania.roman17=XVII -botania.roman18=XVIII -botania.roman19=XIX -botania.roman20=XX -botania.roman21=XXI -botania.roman22=XXII -botania.roman23=XXIII -botania.roman24=XXIV -botania.roman25=XXV -botania.roman26=XXVI -botania.roman27=XXVII -botania.roman28=XXVIII -botania.roman29=XXIX -botania.roman30=XXX - # KNOWLEDGE botania.knowledge.minecraft=Знание людей botania.knowledge.alfheim=Знание &aЭльфов&7 @@ -340,22 +193,8 @@ botania.versioning.flavour32=Поздравляем! Вы 100,000 игрок Bot botania.versioning.flavour33=Перед обновлением версии Botania, хотели ли бы Вы установить ask toolbar? botania.versioning.flavour34=Возвращаемся на беговую дорожку обновлений Botania. Веселье не требуется. #angbadang botania.versioning.flavour35=Вы станете магической девочкой за обновление Botania? -botania.versioning.flavour36=Why did the Botania Update cross the road? To get to the client side. -botania.versioning.flavour37=Take that old build, watch it burn, sink in the river the updates I learned. -botania.versioning.flavour38=This new Botania Update fits perfectly in the Super Health Space. -botania.versioning.flavour39=Introducing the new Botania Update, now with 0% more numbers and GUIs. -botania.versioning.flavour40=This is my Botania Update. There are many like it but this one is mine. -botania.versioning.flavour41=What is the air-speed velocity of an unladen Botania Update? -botania.versioning.flavour42=If you go look in the lang files, this flavour text is #42. That means you should install this Update. -botania.versioning.flavour43=That's impossible, a Botania Update doesn't break down. It's a portuguese. -botania.versioning.flavour44=Look at the update, now back at me, now back at the update. There's a download button there, moron. -botania.versioning.flavour45=No, you can't have fries with your Botania Update. -botania.versioning.flavour46=You were expecting Botania to be up to date, but it was me, Dio! -botania.versioning.flavour47=Rumour says if you move the truck there's a Botania Update below it. -botania.versioning.flavour48=I wonder when Bevo's updating his pack... -botania.versioning.flavour49=1 Botania Update on the wall, 1 Botania Update on the wall. botania.versioning.outdated=У Вас установлена %s сборка Botania, последняя сборка - %s. -botania.versioning.updateMessage=["Нажмите, чтобы... [",{"text":"загрузить","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Нажмите эту кнопку, чтобы автоматически загрузить последнюю версию","color":"green"}},"clickEvent":{"action":"run_command","value":"/botania-download-latest %version%"}},"] [",{"text":"Веб-сайт","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Нажмите эту кнопку, чтобы перейти на сайт мода","color":"green"}},"clickEvent":{"action":"open_url","value":"http://vazkii.us/mod/Botania/downloads.php"}},"] [",{"text":"Изменения","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Нажмите эту кнопку, чтобы перейти к изменениям версии","color":"green"}},"clickEvent":{"action":"open_url","value":"http://vazkii.us/mod/Botania/changelog.php#%version%"}},"]"] +botania.versioning.updateMessage=["Нажмите, чтобы... [",{"text":"загрузить","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Нажмите эту кнопку, чтобы автоматически загрузить последнюю версию","color":"green"}},"clickEvent":{"action":"open_url","value":"http://minecraft.curseforge.com/projects/botania-unofficial/files/latest"}},"] [",{"text":"Веб-сайт","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Нажмите эту кнопку, чтобы перейти на сайт мода","color":"green"}},"clickEvent":{"action":"open_url","value":"http://minecraft.curseforge.com/projects/botania-unofficial"}},"] [",{"text":"Изменения","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Нажмите эту кнопку, чтобы перейти к изменениям версии","color":"green"}},"clickEvent":{"action":"open_url","value":"https://github.com/williewillus/Botania/releases/tag/%s"}},"]"] botania.versioning.startingDownload=[{"text":"Началась загрузка %s. Пожалуйста не вытаскивайте Ваш жёсткий диск. Наслаждайтесь ","color":"aqua"},{"text":"Botania","color":"green"},{"text":"? Подумайте о поддержке ","color":"aqua"},{"text":"Vazkii","color":"light_purple"},{"text":" на [","color":"aqua"},{"text":"Patreon","color":"gold","hoverEvent":{"action":"show_text","value":{"text":"Нажмите сюда, чтобы перейти на Patreon Vazkii","color":"light_purple"}},"clickEvent":{"action":"open_url","value":"http://www.patreon.com/Vazkii"}},{"text":"]!","color":"aqua"}] botania.versioning.doneDownloading=Загрузка %s закончена. Удалите старый .jar файл Botania и перезапустите игру, чтобы обновиться. botania.versioning.downloadedAlready=Вы уже загрузили последнюю версию. Выключите игру, удалите старую версию из папки "mods" и включите её снова! @@ -367,7 +206,7 @@ botania.versioning.disabled=Извините, но данная функция botania.baubletype.amulet=Можно надеть в слот &aАмулета&7 botania.baubletype.ring=Можно надеть в слот &aКольца&7 botania.baubletype.belt=Можно надеть в слот &aРемня&7 -botania.baubletooltip=Нажмите &b%key%&7, чтобы открыть меню Baubles +botania.baubletooltip=Нажмите &b%s&7, чтобы открыть меню Baubles # RELIC POEMS item.dice.poem0=Он сдает карты , чтобы найти ответ, @@ -390,144 +229,13 @@ entity.Botania.botania:spark.name=Искра entity.Botania.botania:thrownItem.name=Брошенный предмет entity.Botania.botania:magicMissile.name=Магический снаряд entity.Botania.botania:thornChakram.name=Шипастая чакра -entity.Botania.botania:corporeaSpark.name=Corporea Spark entity.Botania.botania:enderAirBottle.name=Бутылка воздуха Края entity.Botania.botania:poolMinecart.name=Вагонетка с бассейном для маны entity.Botania.botania:pinkWither.name=Розовый иссушитель -entity.Botania.botania:playerMover.name=Luminizer Beam entity.Botania.botania:manaStorm.name=Эпицентр манашторма entity.Botania.botania:babylonWeapon.name=Оружие казначейства entity.Botania.botania:fallingStar.name=Падающая звезда -# ACHIEVEMENT NAMES + DESC -achievement.botania:flowerPickup=Sky of Beginning -achievement.botania:flowerPickup.desc=Pick up a Mystical Flower from the world -achievement.botania:lexiconUse=A Realistical Logical Ideologist -achievement.botania:lexiconUse.desc=Open a Lexica Botania and have a look through the index -achievement.botania:daybloomPickup=Daybreak Arrival -achievement.botania:daybloomPickup.desc=Make a Daybloom in a Petal Apothecary -achievement.botania:manaPoolPickup=Vivid Wave -achievement.botania:manaPoolPickup.desc=Upgrade a Diluted Mana Pool to a normal one -achievement.botania:endoflamePickup=Meltdown -achievement.botania:endoflamePickup.desc=Create an Endoflame to boost Mana production -achievement.botania:tinyPotatoPet=Just Be Friends -achievement.botania:tinyPotatoPet.desc=Make a Tiny Potato and pet it -achievement.botania:sparkCraft=Live Drive -achievement.botania:sparkCraft.desc=Make a Spark to help transfer Mana around -achievement.botania:baubleWear=Inner Arts -achievement.botania:baubleWear.desc=Craft any variety of Bauble and wear it -achievement.botania:manaCookieEat=Rotten Heresy and Chocolate -achievement.botania:manaCookieEat.desc=Infuse and eat a delicious Mana Cookie -achievement.botania:runePickup=Lilium Doll -achievement.botania:runePickup.desc=Use a Runic Altar to create a Rune -achievement.botania:manaBlasterShoot=M'aider Stranded Girl -achievement.botania:manaBlasterShoot.desc=Craft and fire a Mana Blaster -achievement.botania:tiaraWings=Heart Shooter -achievement.botania:tiaraWings.desc=Craft and adorn a Flügel Tiara with Flügel Wings -achievement.botania:terrasteelPickup=Dancer in the Dark -achievement.botania:terrasteelPickup.desc=Conjure a Terrasteel Ingot using a Terrestrial Agglomeration Plate -achievement.botania:elfPortalOpen=World Calling -achievement.botania:elfPortalOpen.desc=Open a portal to the realm of Alfheim -achievement.botania:gaiaGuardianKill=Dead and Seek -achievement.botania:gaiaGuardianKill.desc=Summon and slay a Gaia Guardian for a Ritual of Gaia -achievement.botania:terrasteelWeaponCraft=Remote Paranoia -achievement.botania:terrasteelWeaponCraft.desc=Arm yourself with a weapon made of Terrasteel -achievement.botania:kekimurusPickup=After-School Stride -achievement.botania:kekimurusPickup.desc=Create a Kekimurus to help produce large quantities of Mana -achievement.botania:heiseiDreamPickup=Heisei Cataclysm -achievement.botania:heiseiDreamPickup.desc=Create a Heisei Dream to cause havoc on mobs -achievement.botania:dirtRodCraft=Rockbell -achievement.botania:dirtRodCraft.desc=Craft a dirty sti- er... Rod of the Lands -achievement.botania:spawnerMoverUse=I can take off my (redacted) -achievement.botania:spawnerMoverUse.desc=Use a Life Aggregator to transport a Monster Spawner -achievement.botania:enderAirMake=Imitation Air -achievement.botania:enderAirMake.desc=Collect a Bottle of Ender Air -achievement.botania:corporeaCraft=Drop Pop Candy -achievement.botania:corporeaCraft.desc=Craft a block that makes use of the Corporea Network - -achievement.botania:signalFlareStun=See the Lights -achievement.botania:signalFlareStun.desc=Stun 100 or more mobs at once with a Signal Flare -achievement.botania:l20ShardUse=Out of Step -achievement.botania:l20ShardUse.desc=Raise the ground up to the sky with a Power XX Shard of Laputa -achievement.botania:gaiaGuardianNoArmor=Mythologia's End -achievement.botania:gaiaGuardianNoArmor.desc=Slay a Gaia Guardian without wearing any armor at any point during the fight -achievement.botania:rankSSPick=Talent Shredder -achievement.botania:rankSSPick.desc=Dig through the world using a rank SS Terra Shatterer -achievement.botania:superCorporeaRequest=Invader Girl -achievement.botania:superCorporeaRequest.desc=Successfully request 50,000 or more of a single item in a Corporea Index -achievement.botania:pinkinator=Decorator -achievement.botania:pinkinator.desc=Put to use The Pinkinator - -achievement.botania:infiniteFruit=Innocentia -achievement.botania:infiniteFruit.desc=Be rewarded The Fruit of Grisaia for a heroic feat -achievement.botania:kingKey=A Fake, Fake Psychotropic -achievement.botania:kingKey.desc=Be rewarded the Key of the King's Law for a heroic feat -achievement.botania:flugelEye=Angel of Death -achievement.botania:flugelEye.desc=Be rewarded the Eye of the Flügel for a heroic feat -achievement.botania:thorRing=One Step Layered -achievement.botania:thorRing.desc=Be rewarded the Ring of Thor for a heroic feat -achievement.botania:odinRing=Lost Time Memory -achievement.botania:odinRing.desc=Be rewarded the Ring of Odin for a heroic feat -achievement.botania:lokiRing=Arithmetic -achievement.botania:lokiRing.desc=Be rewarded the Ring of Loki for a heroic feat -achievement.botania:aesirRing=As the Gods Say -achievement.botania:aesirRing.desc=Create the Ring of the Aesir by combining the Rings of the Gods - -achievement.botania:nullFlower=Take it Easy -achievement.botania:nullFlower.desc=Find a bug that lets you have an undefined Botania Flower. Don't forget to report it! -achievement.botania:desuGun=Two-Faced Lovers -achievement.botania:desuGun.desc=ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN -# ^ Don't localize - -# CHALLENGE LEVELS -botania.challengelevel.easy=Easy -botania.challengelevel.normal=Normal -botania.challengelevel.hard=Hard -botania.challengelevel.lunatic=Lunatic - -# CHALLENGE TEXT -botania.challenge.flowerFarm=Flower Farm -botania.challenge.flowerFarm.desc=Create an automated farm of all 16 colors of botania flowers. Bonus points if the flowers are sorted. -botania.challenge.recordFarm=Record Farm -botania.challenge.recordFarm.desc=Create a system that produces records through the death of creepers at the hand of skeletons. Bonus points if it doesn't require a player's presence. -botania.challenge.reedFarm=Sugar Cane Farm -botania.challenge.reedFarm.desc=Create an automated sugar cane farm. Bonus points for not using pistons. -botania.challenge.cobbleGen=Cobble Generator -botania.challenge.cobbleGen.desc=Create an automated cobblestone generator and harvester. Bonus points if it also creates smooth stone without a furnace. -botania.challenge.pureDaisy=Auto Pure Daisy -botania.challenge.pureDaisy.desc=Completely automate the Pure Daisy. Bonus points if only one spreader is used and/or if the wood/stone input is also automated. -botania.challenge.battery=Mana Battery -botania.challenge.battery.desc=Create a Mana Battery, a system where mana enters one pool and comes out of another, with a good amount of pools as a buffer. Bonus points if the input or output can be changed. - -botania.challenge.apothecaryRefill=Apothecary Refiller -botania.challenge.apothecaryRefill.desc=Create a system that automatically refills the Petal Apothecary if it's empty. Bonus points if the system can also automatically create flowers, given the components. -botania.challenge.treeFarm=Tree Farm -botania.challenge.treeFarm.desc=Create an automated, self-sustaining tree farm. Bonus points if it can do multiple types of tree. -botania.challenge.fullCropFarm=Full Crop Farm -botania.challenge.fullCropFarm.desc=Create a crop farm with all types of crops (wheat, carrot, potato, melon, pumpkin, cocoa and nether wart) that runs at full efficiency. Bonus points if the outputs are sorted. -botania.challenge.animalFarm=Animal Farm -botania.challenge.animalFarm.desc=Create an automated animal farm with all farmable animal types. Bonus points if the food doesn't need to be put in manually. -botania.challenge.boneMealFarm=Bone Meal-type Farm -botania.challenge.boneMealFarm.desc=Create an automated farm that utilizes bone meal to quickly grow crops on demand. Bonus points if the Drum of the Wild isn't used. -botania.challenge.orechid=Automated Orechid -botania.challenge.orechid.desc=Create a system that allows for the Orechid flower to be fully automated. Bonus points if the output is smelted and sorted. - -botania.challenge.mobTower=Spawning Tower -botania.challenge.mobTower.desc=Create a tower style mob farm. Mobs must be sorted and put into specific chambers at the end. Spawners can be used. Bonus points if the farm functions at 100% efficiency without a player's interaction. -botania.challenge.entropinnyumSetup=Entropinnyum Setup -botania.challenge.entropinnyumSetup.desc=Create a system that automatically crafts TNT and safely feeds it to an Entropinnyum flower, creating mana. Bonus points if the sand and gunpowder required for the TNT don't need to be put in manually. -botania.challenge.spectrolusSetup=Spectrolus Setup -botania.challenge.spectrolusSetup.desc=Create a system that feeds a Spectrolus, generating mana. Aside from raw mana, no items may be input from outside the system. Bonus points if it operates at 100% efficiency, never wasting any wool. -botania.challenge.potionBrewer=Automated Brewing -botania.challenge.potionBrewer.desc=Create a system that can make all types of brews automatically on demand. Bonus points if it keeps a set of incense always ignited in the player's base. - -botania.challenge.kekimurusSetup=Kekimurus Setup -botania.challenge.kekimurusSetup.desc=Fully automate a Kekimurus, every part of the system must be automated and self-sustaining. Bonus points if only one crafty crate is used. -botania.challenge.autoQuarry=Automated Quarry -botania.challenge.autoQuarry.desc=Create a mining quarry that digs for ores and stone underground. It should dig out chunks of land and output all of the mined resources, sorting them. Bonus points if it can relocate automatically after it's done with an area. -botania.challenge.runeCrafter=Rune Crafter -botania.challenge.runeCrafter.desc=Create a system that can craft all runes on demand or keep them stocked. Every part of this system must be automated and self-sustaining, including the item inputs. Bonus points if only one Runic Altar block is used. You must be pretty crazy to try this one. - # BLOCK NAMES tile.botania:flower0.name=Мистический белый цветок tile.botania:flower1.name=Мистический оранжевый цветок @@ -685,16 +393,6 @@ tile.botania:dreamwood0Slab.name=Плита из древесины мечтан tile.botania:dreamwood1Stairs.name=Ступеньки из досок мечтаний tile.botania:dreamwood1Slab.name=Плита из досок мечтаний tile.botania:conjurationCatalyst.name=Колдовской катализатор -tile.botania:prismarine0.name=Призмарин -tile.botania:prismarine1.name=Призмариновые кирпичи -tile.botania:prismarine2.name=Тёмный призмарин -tile.botania:prismarine0Stairs.name=Ступеньки из призмарина -tile.botania:prismarine0Slab.name=Плита из призмарина -tile.botania:prismarine1Stairs.name=Ступеньки из призмаринового кирпича -tile.botania:prismarine1Slab.name=Плита из призмаринового кирпича -tile.botania:prismarine2Stairs.name=Ступеньки из тёмного призмарина -tile.botania:prismarine2Slab.name=Плита из тёмного призмарина -tile.botania:seaLamp.name=Морской светильник tile.botania:miniIsland0.name=Парящий белый цветок tile.botania:miniIsland1.name=Парящий оранжевый цветок tile.botania:miniIsland2.name=Парящий сиреневый цветок @@ -713,12 +411,6 @@ tile.botania:miniIsland14.name=Парящий красный цветок tile.botania:miniIsland15.name=Парящий чёрный цветок tile.botania:tinyPotato.name=Миникартофель tile.botania:spawnerClaw.name=Вдох жизни -tile.botania:reedBlock.name=Тростниковый блок -tile.botania:reedBlock0Stairs.name=Тростниковые ступеньки -tile.botania:reedBlock0Slab.name=Тростниковая плита -tile.botania:thatch.name=Солома -tile.botania:thatch0Stairs.name=Соломенные ступеньки -tile.botania:thatch0Slab.name=Соломенная плита tile.botania:customBrick0.name=Адский кирпич tile.botania:customBrick1.name=Душевный кирпич tile.botania:customBrick2.name=Ледяной кирпич diff --git a/src/main/resources/assets/botania/lang/zh_CN.lang b/src/main/resources/assets/botania/lang/zh_CN.lang index ca11b5754..9c1b7151f 100644 --- a/src/main/resources/assets/botania/lang/zh_CN.lang +++ b/src/main/resources/assets/botania/lang/zh_CN.lang @@ -1,10 +1,19 @@ +# Note to translators: DO NOT COPY ENTRIES FROM ENGLISH +# I repeat: do NOT copy entries from English!! +# Any entry in this lang file should be in zh_CN, or *should not be here at all* +# Copying English entries will cause them to become outdated when the main English lang file changes +# Untranslated entries will automatically be inherited from en_US +# +# Once again, don't copy from English, and THANK YOU for your hard work! + # MISC itemGroup.Botania=植物魔法 generator.botania-skyblock=水晶花园 generator.botania-skyblock.info=不推荐植物魔法新手使用 -#并非本地化条目,请翻译者不要修改此行文本. -botaniamisc.noloc=botaniamisc.noloc +# Something that is not localized, translators, do NOT change this line. +# You do not need to copy this into your lang file 请勿将此条目重新复制到zh_CN.lang中 谢谢合作 +# [EXPUNGED] -> Occupying space so that it looks like zh_CN has same line number as en_US botaniamisc.nextPage=下一页 botaniamisc.prevPage=上一页 @@ -49,9 +58,6 @@ botaniamisc.shiftToRemove=Shift点击移除 botaniamisc.clickToAdd=点击添加书签 botaniamisc.ratio=放大:%s倍 botaniamisc.bottleTooltip=味道如何 -botaniamisc.coarseDirt0=劣质土,草 -botaniamisc.coarseDirt1=无法生长 -botaniamisc.spawnerTip=Tip:使用刷怪蛋改变怪物类型 botaniamisc.shardLevel=碎片能量 %s botaniamisc.lexiconIndex=辞典目录 botaniamisc.hasIvy=有永恒常春藤 @@ -60,8 +66,8 @@ botaniamisc.noLexicon=你需要有植物魔法辞典才能阅读它. botaniamisc.cantOpen=你的书里似乎没有这一页.或许它是从书外而来的...? botaniamisc.clickToShare=分享 botaniamisc.drop=扔出 -botaniamisc.dropTip0=提示:你在物品栏内可以按下%key%键来扔出物品 -botaniamisc.dropTip1=CTRL加%key%键扔出一整组 +botaniamisc.dropTip0=提示:你在物品栏内可以按下%s键来扔出物品 +botaniamisc.dropTip1=CTRL加%s键扔出一整组 botaniamisc.wandMode.bind=绑定模式 botaniamisc.wandMode.function=工作模式 botaniamisc.playVideo=播放视频 @@ -207,13 +213,13 @@ botania.color14=红色 botania.color15=黑色 botania.color16=彩虹色 -# RANKS -botania.rank0=&cD -botania.rank1=&eC -botania.rank2=&bB -botania.rank3=&aA -botania.rank4=&dS -botania.rank5=&6SS +# RANKS - PLEASE DO NOT COPY ENTRIES BACK THANKS - 请勿重新将条目复制到此处,这些行仅供占位用 +# [EXPUNGED] +# [EXPUNGED] +# [EXPUNGED] +# [EXPUNGED] +# [EXPUNGED] +# [EXPUNGED] # ZODIAC SIGNS botania.sign0=白羊 @@ -268,37 +274,37 @@ botania.armorset.will4.shortDesc=暴击伤害穿透护甲 botania.armorset.will5.shortDesc=暴击施加凋零效果 # ROMAN NUMERALS -botania.roman0= -botania.roman1=I -botania.roman2=II -botania.roman3=III -botania.roman4=IV -botania.roman5=V -botania.roman6=VI -botania.roman7=VII -botania.roman8=VIII -botania.roman9=IX -botania.roman10=X -botania.roman11=XI -botania.roman12=XII -botania.roman13=XIII -botania.roman14=XIV -botania.roman15=XV -botania.roman16=XVI -botania.roman17=XVII -botania.roman18=XVIII -botania.roman19=XIX -botania.roman20=XX -botania.roman21=XXI -botania.roman22=XXII -botania.roman23=XXIII -botania.roman24=XXIV -botania.roman25=XXV -botania.roman26=XXVI -botania.roman27=XXVII -botania.roman28=XXVIII -botania.roman29=XXIX -botania.roman30=XXX +# +# PLEASE +# DON'T +# COPY +# THESE +# EXPUNGED +# ENTRIES +# BACK +# HERE +# +# THESE +# EMPTY +# LINES +# ARE +# LEFT +# ON +# PURPOSE +# THANKS +# +# 注: +# 罗马数字不需要翻译 +# 请勿将对应条目重新 +# 复制回此处,这些空 +# 行仅供占位用,谢谢 +# +# +# +# +# +# +# # KNOWLEDGE botania.knowledge.minecraft=原版的知识 @@ -343,6 +349,7 @@ references.enabled=启用工具提示文本 shaders.enabled=启用光影支持 baubleRender.enabled=启用饰品渲染 spreader.posShift=发射器位置移动 +# No translation staticFloaters.enabled=? versionChecking.enabled=启用版本检查 wandBeam.static=启用静态法杖光线 worldgen.flower.density=世界生成花密度 @@ -416,7 +423,7 @@ botania.versioning.flavour62=90%的医生会推荐你更新植物魔法. botania.versioning.flavour63=本次更新承诺在午夜。 botania.versioning.flavour64=本次的植魔更新已经过时. 而他的名字是JOHN CENA! DOO DOO DOO DOO botania.versioning.outdated=你所使用的植物魔法版本为%s,最新版本为%s. -botania.versioning.updateMessage=["点击这里... [",{"text":"下载","color":"green","hoverEvent":{"action":"show_text","value":{"text":"点此自动下载最新版本","color":"green"}},"clickEvent":{"action":"run_command","value":"/botania-download-latest %version%"}},"] [",{"text":"网站","color":"green","hoverEvent":{"action":"show_text","value":{"text":"点此浏览该mod的网站","color":"green"}},"clickEvent":{"action":"open_url","value":"http://vazkii.us/mod/Botania/downloads.php"}},"] [",{"text":"更新日志","color":"green","hoverEvent":{"action":"show_text","value":{"text":"点此查看该版本的更新日志","color":"green"}},"clickEvent":{"action":"open_url","value":"http://vazkii.us/mod/Botania/changelog.php#%version%"}},"]"] +botania.versioning.updateMessage=["点击这里... [",{"text":"下载","color":"green","hoverEvent":{"action":"show_text","value":{"text":"点此自动下载最新版本","color":"green"}},"clickEvent":{"action":"open_url","value":"http://minecraft.curseforge.com/projects/botania-unofficial/files/latest"}},"] [",{"text":"网站","color":"green","hoverEvent":{"action":"show_text","value":{"text":"点此浏览该mod的网站","color":"green"}},"clickEvent":{"action":"open_url","value":"http://minecraft.curseforge.com/projects/botania-unofficial"}},"] [",{"text":"更新日志","color":"green","hoverEvent":{"action":"show_text","value":{"text":"点此查看该版本的更新日志","color":"green"}},"clickEvent":{"action":"open_url","value":"https://github.com/williewillus/Botania/releases/tag/%s"}},"]"] botania.versioning.startingDownload=[{"text":"开始下载%s.请勿移除你的硬盘.祝你玩得开心 ","color":"aqua"},{"text":"植物魔法","color":"green"},{"text":"?是否考虑赞助","color":"aqua"},{"text":"Vazkii","color":"light_purple"},{"text":" on [","color":"aqua"},{"text":"赞助","color":"gold","hoverEvent":{"action":"show_text","value":{"text":"点此进入Vazkii的赞助界面","color":"light_purple"}},"clickEvent":{"action":"open_url","value":"http://www.patreon.com/Vazkii"}},{"text":"]!","color":"aqua"}] botania.versioning.doneDownloading=已完成下载%s.请删除旧的Botania .jar并且重启游戏以加载新版本. botania.versioning.downloadedAlready=你已下载最新版本.关闭你的游戏,从你的mods文件夹中删除就版本的mod文件,并且重启游戏以加载新版本! @@ -428,7 +435,7 @@ botania.versioning.disabled=抱歉,自动升级由于服务器主机的原因已 botania.baubletype.amulet=装备在&a项链&7栏 botania.baubletype.ring=装备在&a戒指&7栏 botania.baubletype.belt=装备在&a腰带&7栏 -botania.baubletooltip=按&b%key%&7键打开饰品菜单 +botania.baubletooltip=按&b%s&7键打开饰品菜单 # RELIC POEMS item.dice.poem0=他发牌,以寻找答案, @@ -460,12 +467,12 @@ entity.Botania.botania:manaStorm.name=魔力风暴中心 entity.Botania.botania:babylonWeapon.name=贮藏库武器 entity.Botania.botania:fallingStar.name=落星 -# ACHIEVEMENT NAMES + DESC (Due to the fact that most achievement names have references to vocaloid song names, please use original name or common name first, thanks.)(以下成就名多为曲名,因此大多使用惯用名) +# ACHIEVEMENT NAMES + DESC achievement.botania:flowerPickup=Sky of Beginning achievement.botania:flowerPickup.desc=拾取一朵神秘花 -achievement.botania:lexiconUse=现実的论理主义者 +achievement.botania:lexiconUse=現実的論理主義者 achievement.botania:lexiconUse.desc=打开一本植物魔法辞典并浏览目录 -achievement.botania:daybloomPickup=拂晓抵达 +achievement.botania:daybloomPickup=アカツキアライヴァル achievement.botania:daybloomPickup.desc=在花药台制作一朵太阳花 achievement.botania:manaPoolPickup=Vivid Wave achievement.botania:manaPoolPickup.desc=将稀释魔力池升级为普通的魔力池 @@ -491,23 +498,23 @@ achievement.botania:elfPortalOpen=World Calling achievement.botania:elfPortalOpen.desc=打开通往精灵王国的传送门 achievement.botania:gaiaGuardianKill=Dead and Seek achievement.botania:gaiaGuardianKill.desc=在盖亚仪式中召唤并击杀一只盖亚守护者 -achievement.botania:terrasteelWeaponCraft=Remote Paranoia +achievement.botania:terrasteelWeaponCraft=絶境パラノイア achievement.botania:terrasteelWeaponCraft.desc=用泰拉锭制作的武器武装你自己 achievement.botania:kekimurusPickup=放課後ストライド achievement.botania:kekimurusPickup.desc=制作一朵贪食花来提供大量魔力 -achievement.botania:heiseiDreamPickup=Heisei Cataclysm +achievement.botania:heiseiDreamPickup=ヘイセイカタクリズム achievement.botania:heiseiDreamPickup.desc=制作一朵平成之梦让怪物们窝里斗 achievement.botania:dirtRodCraft=Rockbell achievement.botania:dirtRodCraft.desc=制作一根泥棍子...哦不,是大地法杖 -achievement.botania:spawnerMoverUse=I can take off my (redacted) +achievement.botania:spawnerMoverUse=I can take off my [redacted] achievement.botania:spawnerMoverUse.desc=用一个生命聚合器来转移刷怪笼 achievement.botania:enderAirMake=Imitation Air achievement.botania:enderAirMake.desc=收集一瓶末地空气 achievement.botania:corporeaCraft=Drop Pop Candy achievement.botania:corporeaCraft.desc=合成一个使用多媒体网络的方块 -achievement.botania:cacophoniumCraft=Noisy Lover Soul +achievement.botania:cacophoniumCraft=ノイジーラバーソウル achievement.botania:cacophoniumCraft.desc=制作一个不和谐之音来激怒你的敌人 -achievement.botania:manaCartCraft=World Domination How-To +achievement.botania:manaCartCraft=ハウトゥー世界征服 achievement.botania:manaCartCraft.desc=制作一个用魔力矿车进行的长距离魔力运输系统。 achievement.botania:craftingHaloCraft=Segments Blue achievement.botania:craftingHaloCraft.desc=制作一个合成环以方便合成 @@ -517,13 +524,13 @@ achievement.botania:enchanterMake=Odds and Ends achievement.botania:enchanterMake.desc=制作一个魔力附魔台来更好的控制附魔 achievement.botania:pollidisiacPickup=Romeo and Cinderella achievement.botania:pollidisiacPickup.desc=做一个畜牧花,在空气中制造爱情立场 -achievement.botania:brewPickup=Childhood Blues +achievement.botania:brewPickup=オサナナブルー achievement.botania:brewPickup.desc=制作一个植物酿造台并用他酿造所有种类的药水 -achievement.botania:terraformRodCraft=World is Mine +achievement.botania:terraformRodCraft=ワールドイズマイン achievement.botania:terraformRodCraft.desc=制作一把泰拉高并用他改变世界地形 achievement.botania:bubbellPickup=深海少女 achievement.botania:bubbellPickup.desc=制作一株气泡铃来方便水下建筑 -achievement.botania:luminizerRide=World's End Dancehall +achievement.botania:luminizerRide=ワールズエンド ダンスホール achievement.botania:luminizerRide.desc=制作一些微光并用它来进行传输 achievement.botania:manaBombIgnite=Under of Fragments achievement.botania:manaBombIgnite.desc=制作一个魔力风暴,并在宽阔的地方点燃它 @@ -545,8 +552,8 @@ achievement.botania:pinkinator.desc=使用粉色手炮 achievement.botania:infiniteFruit=Innocentia achievement.botania:infiniteFruit.desc=获得战利品:禁忌果实 -achievement.botania:excaliber=Streaming Heart -achievement.botania:excaliber.desc=获得战利品:王者圣剑 +achievement.botania:kingKey=A Fake, Fake Psychotropic +achievement.botania:kingKey.desc=获得战利品:王之宝钥 achievement.botania:flugelEye=Angel of Death achievement.botania:flugelEye.desc=获得战利品:天翼族之眼 achievement.botania:thorRing=One Step Layered @@ -800,19 +807,6 @@ tile.botania:dreamwood1Stairs.name=梦之木楼梯 tile.botania:dreamwood1Slab.name=梦之木台阶 tile.botania:dreamwood1SlabFull.name=梦之木台阶 tile.botania:conjurationCatalyst.name=炼造催化器 -tile.botania:prismarine0.name=海晶石 -tile.botania:prismarine1.name=海晶石砖 -tile.botania:prismarine2.name=深色海晶石 -tile.botania:prismarine0Stairs.name=海晶石楼梯 -tile.botania:prismarine0Slab.name=海晶石台阶 -tile.botania:prismarine0SlabFull.name=海晶石台阶 -tile.botania:prismarine1Stairs.name=海晶石砖楼梯 -tile.botania:prismarine1Slab.name=海晶石砖台阶 -tile.botania:prismarine1SlabFull.name=海晶石砖台阶 -tile.botania:prismarine2Stairs.name=深色海晶石楼梯 -tile.botania:prismarine2Slab.name=深色海晶石台阶 -tile.botania:prismarine2SlabFull.name=深色海晶石台阶 -tile.botania:seaLamp.name=海灯笼 tile.botania:miniIsland0.name=白色浮空花 tile.botania:miniIsland1.name=橙色浮空花 tile.botania:miniIsland2.name=品红色浮空花 @@ -831,14 +825,6 @@ tile.botania:miniIsland14.name=红色浮空花 tile.botania:miniIsland15.name=黑色浮空花 tile.botania:tinyPotato.name=小土豆 tile.botania:spawnerClaw.name=生命灌注器 -tile.botania:reedBlock.name=甘蔗块 -tile.botania:reedBlock0Stairs.name=甘蔗楼梯 -tile.botania:reedBlock0Slab.name=甘蔗台阶 -tile.botania:reedBlock0SlabFull.name=甘蔗台阶 -tile.botania:thatch.name=茅草块 -tile.botania:thatch0Stairs.name=茅草楼梯 -tile.botania:thatch0Slab.name=茅草台阶 -tile.botania:thatch0SlabFull.name=茅草台阶 tile.botania:customBrick0.name=炼狱砖块 tile.botania:customBrick1.name=灵魂砖块 tile.botania:customBrick2.name=霜冻砖块 @@ -1067,46 +1053,10 @@ tile.botania:doubleFlower212.name=褐色高神秘花 tile.botania:doubleFlower213.name=绿色高神秘花 tile.botania:doubleFlower214.name=红色高神秘花 tile.botania:doubleFlower215.name=黑色高神秘花 -tile.botania:stone0.name=安山岩 -tile.botania:stone1.name=玄武岩 -tile.botania:stone2.name=闪长岩 -tile.botania:stone3.name=花岗岩 -tile.botania:stone4.name=抛光安山岩 -tile.botania:stone5.name=抛光玄武岩 -tile.botania:stone6.name=抛光闪长岩 -tile.botania:stone7.name=抛光花岗岩 -tile.botania:stone8.name=安山岩砖 -tile.botania:stone9.name=玄武岩砖 -tile.botania:stone10.name=闪长岩砖 -tile.botania:stone11.name=花岗岩砖 tile.botania:stone12.name=錾制安山岩砖 tile.botania:stone13.name=錾制玄武岩砖 tile.botania:stone14.name=錾制闪长岩砖 tile.botania:stone15.name=錾制花岗岩砖 -tile.botania:stone0Stairs.name=安山岩楼梯 -tile.botania:stone1Stairs.name=玄武岩楼梯 -tile.botania:stone2Stairs.name=闪长岩楼梯 -tile.botania:stone3Stairs.name=花岗岩楼梯 -tile.botania:stone8Stairs.name=安山岩砖楼梯 -tile.botania:stone9Stairs.name=玄武岩砖楼梯 -tile.botania:stone10Stairs.name=闪长岩砖楼梯 -tile.botania:stone11Stairs.name=花岗岩砖楼梯 -tile.botania:stone0Slab.name=安山岩台阶 -tile.botania:stone1Slab.name=玄武岩台阶 -tile.botania:stone2Slab.name=闪长岩台阶 -tile.botania:stone3Slab.name=花岗岩台阶 -tile.botania:stone8Slab.name=安山岩砖台阶 -tile.botania:stone9Slab.name=玄武岩砖台阶 -tile.botania:stone10Slab.name=闪长岩砖台阶 -tile.botania:stone11Slab.name=花岗岩砖台阶 -tile.botania:stone0SlabFull.name=安山岩台阶 -tile.botania:stone1SlabFull.name=玄武岩台阶 -tile.botania:stone2SlabFull.name=闪长岩台阶 -tile.botania:stone3SlabFull.name=花岗岩台阶 -tile.botania:stone8SlabFull.name=安山岩砖台阶 -tile.botania:stone9SlabFull.name=玄武岩砖台阶 -tile.botania:stone10SlabFull.name=闪长岩砖台阶 -tile.botania:stone11SlabFull.name=花岗岩砖台阶 tile.botania:blazeBlock.name=烈焰灯 tile.botania:corporeaInterceptor.name=多媒体拦截器 tile.botania:corporeaCrystalCube.name=多媒体水晶魔方 @@ -1124,7 +1074,7 @@ tile.botania:livingrock0Wall.name=活石墙 tile.botania:livingwood0Wall.name=活木墙 tile.botania:dreamwood0Wall.name=梦之木墙 tile.botania:prismarine0Wall.name=海晶石墙 -tile.botania:reedBlock0Wall.name=甘蔗围墙 +tile.botania:reedBlock0Wall.name=甘蔗块墙 tile.botania:biomeStoneA0Wall0.name=变质森林石墙 tile.botania:biomeStoneA0Wall1.name=变质平原石墙 tile.botania:biomeStoneA0Wall2.name=变质高山石墙 @@ -1133,10 +1083,10 @@ tile.botania:biomeStoneA0Wall4.name=变质沼泽石墙 tile.botania:biomeStoneA0Wall5.name=变质沙漠石墙 tile.botania:biomeStoneA0Wall6.name=变质雪原石墙 tile.botania:biomeStoneA0Wall7.name=变质高原石墙 -tile.botania:stone0Wall0.name=安山岩石墙 -tile.botania:stone0Wall1.name=玄武岩石墙 -tile.botania:stone0Wall2.name=闪长岩石墙 -tile.botania:stone0Wall3.name=花岗岩石墙 +tile.botania:stone0Wall0.name=安山岩墙 +tile.botania:stone0Wall1.name=玄武岩墙 +tile.botania:stone0Wall2.name=闪长岩墙 +tile.botania:stone0Wall3.name=花岗岩墙 tile.botania:manaBomb.name=魔力风暴 tile.botania:buriedPetals0=埋藏白色花瓣 tile.botania:buriedPetals0.name=埋藏白色花瓣 @@ -1324,6 +1274,8 @@ tile.botania:flower.solegnolia.name=弱磁兰 tile.botania:flower.solegnolia.reference=你的磁力都归我们了 tile.botania:flower.solegnoliaChibi.name=小弱磁兰 tile.botania:flower.solegnoliaChibi.reference=你的磁力都归我们了 +tile.botania:flower.bergamute.name=消音柑 +tile.botania:flower.bergamute.reference=啊咧嘴被堵上了 # ITEM NAMES item.botania:lexicon.name=植物魔法辞典 @@ -1461,7 +1413,7 @@ item.botania:terrasteelHelm.name=泰拉钢头盔 item.botania:terrasteelChest.name=泰拉钢胸甲 item.botania:terrasteelLegs.name=泰拉钢护腿 item.botania:terrasteelBoots.name=泰拉钢靴子 -item.botania:terra剑.name=泰拉之刃 +item.botania:terraSword.name=泰拉之刃 item.botania:tinyPlanet.name=行星项链 item.botania:manaRing.name=魔力之戒 item.botania:auraRing.name=光环之戒 @@ -1498,9 +1450,9 @@ item.botania:elementiumChest.name=源质钢胸甲 item.botania:elementiumLegs.name=源质钢护腿 item.botania:elementiumBoots.name=源质钢靴子 item.botania:elementiumPick.name=源质钢镐 -item.botania:elementium铲.name=源质钢铲 -item.botania:elementium斧头.name=源质钢斧 -item.botania:elementium剑.name=源质钢剑 +item.botania:elementiumShovel.name=源质钢铲 +item.botania:elementiumAxe.name=源质钢斧 +item.botania:elementiumSword.name=源质钢剑 item.botania:elementiumShears.name=源质钢剪 item.botania:openBucket.name=无底桶 item.botania:spawnerMover.name=生命聚合器 @@ -1554,7 +1506,7 @@ item.botania:cobbleRod.name=深渊法杖 item.botania:smeltRod.name=炽心法杖 item.botania:worldSeed.name=世界之种 item.botania:spellCloth.name=封印之布 -item.botania:thornChakram.name=荆棘飞轮 +item.botania:thornChakram0.name=荆棘飞轮 item.botania:thornChakram1.name=闪耀飞轮 item.botania:overgrowthSeed.name=增生之种 item.botania:craftPattern0.name=合成模板#1: 1x1 @@ -1634,7 +1586,7 @@ item.botania:terraAxe.name=泰拉断裂者 item.botania:manasteelNugget.name=魔钢粒 item.botania:terrasteelNugget.name=泰拉钢粒 item.botania:elementiumNugget.name=源质钢粒 -item.botania:root.name=活根 +item.botania:livingRoot.name=活根 item.botania:pebble.name=卵石 item.botania:waterBowl.name=一碗水 item.botania:obedienceStick.name=植物遵从法杖 @@ -1695,9 +1647,9 @@ botania.potion.clear=赦免 botania.gui.lexicon.header=植物魔法辞典 第%s版 - 目录 botania.gui.lexicon.wip=(本条目的编纂工作仍在进行,其当前内容仍未完全定稿) -# MUSIC DISCS -item.record.botania:gaia1.desc=Kain Vinosec - Endure Emptiness -item.record.botania:gaia2.desc=Kain Vinosec - Fight For Quiescence +# MUSIC DISCS - Unless there is good tranlsation, please left these two as comment - 除非有合适的翻译,否则请不要移除下面两行开头的#注释标记 +# item.record.botania:gaia1.desc=Kain Vinosec - Endure Emptiness +# item.record.botania:gaia2.desc=Kain Vinosec - Fight For Quiescence # BANNER NAMES item.banner.botania_flower.black=黑色神秘花 @@ -1988,7 +1940,6 @@ botania.page.tutorial0=尽管你可以随意浏览本书的 各个章节,我们 # -- GARDEN OF GLASS botania.entry.gardenOfGlass=水晶花园 - botania.tagline.gardenOfGlass=你的新挑战 botania.page.gardenOfGlass0=在&2水晶花园&0里,没有人会听 见你的尖叫声.
    这是一个单独的空间.
    多么令人振奋. botania.page.gardenOfGlass1=&2水晶花园s&0植物魔法的空岛模 式.他只适合那些了解植魔 的抖M们, 但如果你是新 人,我们也很乐意你体验一下.
    MOD中绝大多数的功能不变 ,但我们调整了一部分地方 以适应空岛环境。调整的地 方见下页. @@ -2000,7 +1951,6 @@ botania.page.gardenOfGlass6=除此之外, 有些东西在植 物魔法中调整 botania.page.gardenOfGlass7=制作&1甘蔗&0 botania.page.gardenOfGlass8=制作&1粘液球&0 botania.page.gardenOfGlass9=也许可以给&1南瓜&0注入一些 死去怪物的邪恶思想,来制作 &1恶魔头南瓜&0.通过将南瓜放置 在两个竖直放置的&1铁栅栏&0上 ,这有点像&1雪傀儡&0,但会出 现一个烈焰人&0.
    以这种方式生成的&1烈焰人&0会 掉落&1烈焰粉&0而不是&1烈焰棒&0. -botania.page.gardenOfGlass10=Nerfing warlocks again botania.page.gardenOfGlass11=除了照明, 将&1魔力闪光&0放在 出生点允许那些不慎丢掉 &1植物魔法辞典&0的玩家们用一 个&1树苗&0来重新获得它, 通过 手持&1树苗&0右击&1魔力闪光&0.
    这只会在玩家失去他们的&1植物魔法辞典&0时生效. botania.page.gardenOfGlass12=最后, 制作&1末地传送门&0的配方 @@ -2021,6 +1971,7 @@ botania.page.flowers2=这些花可以采摘用于获取&1神&0 &1秘花瓣&0,可 botania.page.flowers3=摘取花瓣. botania.page.flowers4=合成&1杵和臼&0. botania.page.flowers5=将花瓣磨成粉. +botania.page.flowers5.5=将寻常花磨成粉. botania.page.flowers6=通过将&1花粉&0和一些&1骨粉&0混合, 能做出一个不同种的肥料.那 就是&1花肥&0,会在附近区域催生 出少量&1神秘花&0,如果你没有把 它用完的话. botania.page.flowers7=制作花肥(任意花粉均有效) botania.page.flowers8=用指定的染料同样有效 @@ -2028,6 +1979,7 @@ botania.page.flowers10=&1神秘花&0也存在着高的一种.只 能用&1剪刀& botania.page.flowers12=
    也能通过对&1神秘花&0或者&1地上 的花瓣&0使用&1骨粉&0来人工制造 它.
    如果你发现某种特定颜色的 花瓣不够了,试着将它放在地 上并对它使用&1骨粉&0. botania.page.flowers11=以备不时之需 botania.page.flowers9=花瓣也能做成方块 +botania.page.flowers13=完全相反的方向 # -- PETAL APOTHECARY botania.entry.apothecary=花药台 @@ -2092,7 +2044,7 @@ botania.page.terrasteel0=&1泰拉钢&0是一种复杂的魔法合金 ,需注入 botania.page.terrasteel1=制作泰拉凝聚板 botania.page.terrasteel2=泰拉凝聚板放置好且已做好接 收&4魔力&0的准备之后,将一个&1魔 力钢锭,魔力钻石与魔力珍珠&0 掷于其顶部即可开始注魔.
    此过程中拾起任何物品均会使 注魔骤停,导致严重的 &4魔力流失&0.注魔将会使用一半 &1魔力池&0的魔力以制作一小块 &4泰拉钢&0,多个&1火花&0可加快注魔 速度. botania.page.terrasteel3=制作&1泰拉钢&0的模型 -botania.page.terrasteel4=T.A. Plate +# No translation # botania.page.terrasteel4=T.A. Plate # -- BLACK LOTUS botania.entry.blackLotus=黑莲花 @@ -2149,6 +2101,7 @@ botania.page.pool11=制作&1魔力玻璃&0,透明且无缝的玻璃. botania.page.pool12=制作&1线&0 botania.page.pool13=使用&1蕴魔丝线&0制作&1蜘蛛网&0 botania.page.pool7=注魔&1魔力曲奇&0,味道好极了. +botania.page.pool15=制作&1海晶碎片&0 # -- SPARKS botania.entry.sparks=火花 @@ -2178,13 +2131,13 @@ botania.page.distributor1=合成分配器 botania.entry.manaVoid=魔力销毁器 botania.tagline.manaVoid=销毁一切进来的魔力 botania.page.manaVoid0=&1魔力销毁器&0通俗的说,就是&4魔&0 &4力&0的垃圾桶.所有进入这个方 块的&4魔力&0都会消失在虚空,再 也不会出现.
    将它放在一个&1魔力池&0下方会 让池子总是接收&4魔力&0,但销毁 超出容量的部分. -botania.page.manaVoid1=Even Chad from accounting? +# No translation # botania.page.manaVoid1=Even Chad from accounting? # -- MANA FLUXFIELD botania.entry.rfGenerator=魔力转换器 botania.tagline.rfGenerator=魔力变RF啦! botania.page.rfGenerator0=将&4魔力&0引入红石能量场,就可 以将其从自然能量源形态转 为&4红石流量&0.
    将一魔力发射器对向此方块, 就可把进入其中的&4魔力&0转化 为&4RF&0.之后就能用各种传输&4RF&0 的装置来输出. -botania.page.rfGenerator1=The bullet guys. I bit it. +# No translation # botania.page.rfGenerator1=The bullet guys. I bit it. # -- MANA LENSES botania.entry.lens=魔力透镜 @@ -2247,7 +2200,7 @@ botania.tagline.manaDetector=检测脉冲并发射红石信号 botania.page.manaDetector0=像&1魔力检测器&0这样的设备可 以在&4魔力脉冲&0穿过它时检测 到魔力(脉冲不会因与它的撞 击而损耗)并发出一个红石信 号. botania.page.manaDetector1=合成检测器 -# -- REDSTONE MANA SPREADER +# -- PULSE MANA SPREADER botania.entry.redstoneSpreader=红石魔力发射器 botania.tagline.redstoneSpreader=红石信号控制的魔力发射器 botania.page.redstoneSpreader0=通过组合&1魔力发射器&0与&1红石&0, 就能做出&1红石魔力发射器&0,它 只在收到&4红石信号&0时才会发 射脉冲,不管末端是否有可接 收魔力的方块.
    值得一提的是.只有发出去的 脉冲因魔力流失而消失或被 吸收了才会允许下一波的发 射. @@ -2414,14 +2367,14 @@ botania.page.tangleberrie1=&o纠缠,勇敢和冻结&r. botania.entry.jiyuulia=自由之翼 botania.tagline.jiyuulia=赶走怪物 botania.page.jiyuulia0=&1自由之翼&0是种消耗少量&4魔力&0 而使得所有邻近的动物和怪 物无法进入一个圈内的花. -botania.page.jiyuulia1=&oHR HD DT Masterpiece(osu)&r. +# No translation # botania.page.jiyuulia1=&oHR HD DT Masterpiece&r. # -- RANNUNCARPUS botania.entry.rannuncarpus=手掌花 botania.tagline.rannuncarpus=放置方块 botania.page.rannuncarpus0=真是朵方便的花,&1手掌花&0会拾 取附近任何掉落物品形式的 方块并放置在其他地方.只会 将方块放置在特殊的方块上, 要指定这种特殊方块,只需将 它放在这朵花种植的土方块 下就可以. botania.page.rannuncarpus1=方块式物品,比如&1甘蔗&0也会奏 效的,但,就像这些方块一样, 它们只能被放在平常能放置 的地方.
    最后,提供&4魔力&0不是必需的, 但这会增加工作范围. -botania.page.rannuncarpus2=&oThe Sandpit of Yanille&r? +# No translation # botania.page.rannuncarpus2=&oThe Sandpit of Yanille&r? # -- HYACIDUS botania.entry.hyacidus=毒风信 @@ -2465,7 +2418,7 @@ botania.tagline.spectranthemum=传送物品 botania.page.spectranthemum0=长途运输物品是一个艰巨的 任务.水路和&1扇水仙&0也没法简 单完成这个任务.&1凌空蓟&0会消 耗少量&4魔力&0将周围的掉落物 传送到另一个地点.传送过一 次之后,其他同类的花就不能 用于传送该种物品. botania.page.spectranthemum1=为了指定物品的去向,可以使 用&1森林法杖&0的绑定模式来绑 定这朵花和某个方块,就像绑 到魔力池上一样.仅在12格以 内有效.查看这朵花绑定的方 块就像查看魔力池传输&4魔力&0 那样,潜行时用法杖指向它即 可. botania.page.spectranthemum2=这朵花受&4区块加载机制&0所限, 因此它不会作用于未加载的 区块.这里就不多加叙述了.
    &o推荐查询: "Chunks and Chicken", "Anchors of the World". -botania.page.spectranthemum3=&o(n)spooky(n+2)me&r. +# No translation # botania.page.spectranthemum3=&o(n)spooky(n+2)me&r. # -- MEDUMONE botania.entry.medumone=石化草 @@ -2491,7 +2444,13 @@ botania.page.bubbell1=&o就像一些休闲游戏&r. botania.entry.solegnolia=弱磁兰 botania.tagline.solegnolia=创造一个磁化指环无法工作的地方 botania.page.solegnolia0=&1磁化指环&0对于搜集材料的人 而言十分便利,但这也会让他 们陷入另一个麻烦:总是会捡 起不需要的物品.
    &1弱磁兰&0会抑制指环的能力并 阻止任何物品被吸往佩戴指 环的人.这朵花不会消耗任何 魔力,尽管它有一个魔力缓存 区(也许是bug). -botania.page.solegnolia1=On/Off +botania.page.solegnolia1=开/关 + +# -- BERGAMUTE +botania.entry.bergamute=消音柑 +botania.tagline.bergamute=吸收音波 +botania.page.bergamute0=一个人若是有当牧场主的经历, 他就一定不会忘记动物们发出 的那刺耳的声音 - 那是,痛 苦的回忆。而这&1消音柑&0,则可以 吸收附近的声音,并转化成数 量基本可以无视魔力。吸收声 音的过程不需要消耗&4魔力&0。 +botania.page.bergamute1=もう歌しか聞こえない # - GENERATING FLOWERS # -- AN INTRODUCTION TO GENERATION @@ -2517,18 +2476,13 @@ botania.page.primusLoci1=这些花与&1太阳花&0或&1夜颠茄&0别 无二致, botania.entry.daybloom=太阳花 botania.tagline.daybloom=天空中的魔力 botania.page.daybloom0=&1太阳花&0是最基本的&4产能花&0.简 而言之,它进行着特别的光合 作用,将阳光转化为&4魔力&0.
    这个过程十分缓慢,需要十朵 甚至更多才能有所产出,当下 而言. -botania.page.daybloom1=这些花会相互争夺光照,因此 在邻近的四个面有同类花时 会减少&4魔力&0的产量.
    作为初期的花它们的效率有 限,或许升级为&1火红莲&0或其他 的花是个不错的选择. -botania.page.daybloom1a=若有其他&1太阳花&0相邻则会减 少&4魔力&0的产量.
    这种花的生命力不太顽强,因 此过段时间后就会枯萎死亡.
    作为初期的花它们的效率有 限,或许升级为&1火红莲&0或其他 的花是个不错的选择. -botania.page.daybloom3=产出缩减 +botania.page.daybloom1=这些花会相互争夺光照,因此 在邻近的四个面有同类花时 会减少&4魔力&0的产量.
    &1太阳花&0是一种&4被动产能花&0,这 意味着她们终将枯萎.
    作为初期的花它们的效率有 限,或许升级为&1火红莲&0或其他 的花是个不错的选择. botania.page.daybloom2=&o崭新的一天开始了&r. -botania.page.daybloom4=&o你们中有多少人曾为爱所伤? 又有多少次你发誓不会再爱? 有多少孤独寂寞的不眠之夜? 有过多少谎言?多少斗争?你 又为何每次都要重新卷入其 中?"爱即是痛,"我听见了你 的话语.爱有着残酷而又痛苦 的方法来报复你所遗弃的信 念. (...) -botania.page.daybloom5=&o当你最需要的反而让你变得 存在薄弱,那又是何种感觉? 你再也不想迷失在悲伤之中. 可能会有一天,下着淅淅沥沥 的雨,你打开了一本老书.看 见了一张照片,那是当你们还 在一起的时候她所留下的笑 容.你也可能会在路上漫步, 随着思绪而行.但她的笑脸一 直在脑海中挥之不去... # -- NIGHTSHADE botania.entry.nightshade=夜颠茄 botania.tagline.nightshade=月光中的魔力 -botania.page.nightshade0=&1夜颠茄&0是黑暗版的&1太阳花&0,它 会在&1太阳花&0不能工作的情况 下被动产生&4魔力&0,尽管只有一 半的速度.
    同样它也会因邻近的个体而 降低效率. -botania.page.nightshade0a=&1夜颠茄&0是黑暗版的&1太阳花&0,它 会在&1太阳花&0不能工作的情况 下被动产生&4魔力&0,尽管只有一 半的速度.
    同样它也会因邻近的个体而 降低效率.而且这种花的生命 力不太顽强,过段时间后就会 枯萎死亡. +botania.page.nightshade0=&1夜颠茄&0是黑暗版的&1太阳花&0,它 会在&1太阳花&0不能工作的情况 下被动产生&4魔力&0,尽管只有一 半的速度.
    同样它也会因邻近的个体而 降低效率.
    和太阳花一样,夜颠茄也是&4被 动产能花&0,她们也终将会枯萎. botania.page.nightshade1=&o白日的阴影&r. # -- ENDOFLAME @@ -2536,21 +2490,22 @@ botania.entry.endoflame=火红莲 botania.tagline.endoflame=燃烧产能 botania.page.endoflame0=尽管&1太阳花&0很好,对植物魔法 师而言还需要更有效的生产 &4魔力&0的方法.
    &1火红莲&0恰好是那样的,它会吸 收掉落在附近的任何可燃物 品和方块(每次一个)并在燃 烧期间释放出魔力. botania.page.endoflame1=有个小提示,&1火红莲&0不会燃烧 有燃烧产物的物品,比如&1岩浆&0 &1桶&0,会留下&1空桶&0.
    根据它们的特性,你在书中所 见的&1花格箱&0或许能助你实现 它的补给. +botania.page.endoflame3=由于&1火红莲&0通常是植物魔法师们在自动化&4主动产能花&0的道路上迈出的第一步,这里不建议一直手动管理火红莲.因为火红莲只会燃烧掉落物,使用&1花格箱&0(相关介绍可在&4自然装置&0部分找到)或者其它装置(计时器、压力板等等)进行自动化会是理想的选择. botania.page.endoflame2=&o不是闪耀之光&r. # -- HYDROANGEAS botania.entry.hydroangeas=水绣球 botania.tagline.hydroangeas=水力产魔机 -botania.page.hydroangeas0=尽管被动的&4魔力&0生产可以通 过&1太阳花&0轻松实现,同样便利 的方法也是有的.&1水绣球&0会吸 取以它为中心3x3范围内等 高的&1静水&0,从中产生&4魔力&0.
    似乎&4下雨&0天会更快,但有谁会 想到呢? -botania.page.hydroangeas0a=&1水绣球&0会吸取3x3范围内等高 的&1静水&0,从中产生&4魔力&0.
    似乎&4下雨&0天会更快,但有谁会 想到呢?
    就像&1太阳花&0,这种花的生命力不太顽强 ,因此过段时间后就会枯萎死 亡. +botania.page.hydroangeas0=尽管被动的&4魔力&0生产可以通 过&1太阳花&0轻松实现,同样便利 的方法也是有的.&1水绣球&0会吸 取以它为中心3x3范围内等 高的&1静水&0,从中产生&4魔力&0.
    似乎&4下雨&0天会更快,但有谁会 想到呢?
    &1水绣球&0亦是&4被动产能花&0,她们 也会有凋谢的一天. botania.page.hydroangeas2=一个简单的&1水绣球&0系统 -botania.page.hydroangeas3=这些花,类似&1太阳花&0和&1夜颠茄&0 ,如果种得太紧密则会降低效 率.将两株&1水绣球&0相聚一格或 对角种下都会使得产能效率 缩减,因为根部相互缠绕了. 种得越密缩减的就越厉害.花 之间的蓝色粒子便是缩减的 标志. botania.page.hydroangeas1=&o超次元来物&r? # -- THERMALILY botania.entry.thermalily=炽玫瑰 botania.tagline.thermalily=地热发电植魔版 -botania.page.thermalily0=有时候产能速度太慢了,就像 &1水绣球&0和&1火红莲&0.这个问题的 答案就是&1炽玫瑰&0,原理类似&1水&0 &1绣球&0,但它吸收的是&1岩浆&0.它 会在消耗&1岩浆&0时迅速产生大 量的&1魔力&0,这也会让它过热, 因此它在重新开始产能前还 需要一些时间来冷却. +botania.page.thermalily0=有时候产能速度太慢了,就像 &1水绣球&0和&1火红莲&0.这个问题的 答案就是&1炽玫瑰&0,原理类似&1水&0 &1绣球&0,但它吸收的是&1熔岩&0.它 会在消耗&1熔岩&0时迅速产生大 量的&1魔力&0,这也会让它过热, 因此它在重新开始产能前还 需要一些时间来冷却. +botania.page.thermalily2=在工作阶段时,&1炽玫瑰&0产出的&4魔力&0的量十分之高,十分适合应对短时间内需要大量消耗魔力的情况.
    在它进入“冷却阶段”时,它依旧会消耗熔岩,但不会产出任何&4魔力&0,直到5分钟的冷却期结束后方能继续产出魔力. +botania.page.thermalily3=虽然&1发射器&0可以胜任自动放置&1熔岩&0的工作,但自动收集&4下界&0或地底深处的熔岩并用来自动产出魔力却完全是另外一回事.
    因此,&1炽玫瑰&0被归类为“半自动化产能花”. botania.page.thermalily1=&o0108 Style&r. # -- ROSA ARCANA @@ -2585,15 +2540,12 @@ botania.page.gourmaryllis0=&1彼方兰&0是朵饥饿的花.它会吃 掉它附 botania.page.gourmaryllis1=消化美味的时间取决于它的 营养值,通俗来说,就是食物 所含的饱食度.
    因此,一个&1牛排&0需要4秒来消 化,一个&1胡萝卜&0则需要2秒,一 个&1面包&0就需要2.5秒,以此类 推. botania.page.gourmaryllis2=&4魔力&0的产量也取决于这个值, 食物越有营养它的效率就越 高.举例来说,单个&1牛排&0能比 两根&1胡萝卜&0产生更多的&1魔力&0, 无论是总量还是每秒的. botania.page.gourmaryllis3=&o为我们的新房客准备的火锅&r. -botania.page.gourmaryllis4=&o哇哦.如果人在它们死后吃了 它们,就会想起一些恐怖和负 面的事.但是你知道这是因为 你的残忍导致的结果,想一想, 人们吃的鱼儿像你一样活着.
    Job活着的时候说:"为什么你 总是这么无情地跟着我,活着 吃我,病了也吃我".你希望看 到这样的Job么?(...) -botania.page.gourmaryllis5=&o就像一个犯了罪或被指控为 罪犯的人看着那些要吃他的 人一样.警察吃他,狱卒吃他,记 录员吃他,原告吃他,调查者吃 他,律师吃他,证人吃他,法官吃 他,然后他甚至还没被宣判就 已经被吃了.更糟糕的是人并 不是鸡.(...) -botania.page.gourmaryllis6=&o更令人伤心的是一个要被绞 死的人,执行死刑之后只 有乌鸦来吃他,而被审判的人, 甚至不执行处决就已经被吃 了
    真正的恶魔是吃别人的人,无 论是那些吃得最多的,还是 吃的最少的.因为你们便是地 上的盐,盐若失去了滋味,可 用什么使它再变咸呢.(新约) # -- NARSLIMMUS botania.entry.narslimmus=粘球草 botania.tagline.narslimmus=黏黏魔法 botania.page.narslimmus0=这个世界上一些地方还存在 着未知的能量场,那里能产生 &1史莱姆&0.人们称其&4史莱姆区块&0 .&1粘球草&0就能利用这种能量.如 果它被种在了一只由那种能 量生出的&1史莱姆&0旁边,它就会 将其分解并收集由其产生的 所有&4魔力&0.&1史莱姆&0越大,产生 的&4魔力&0就越多.它也会弄得黏 黏糊糊的. -botania.page.narslimmus1=&oStick around, would ye&r? +# No translation # botania.page.narslimmus1=&oStick around, would ye&r? # -- SPECTROLUS botania.entry.spectrolus=斑斓花 @@ -2627,7 +2579,7 @@ botania.page.dandelifeon7=&1细胞方块&0可由&1仙人掌&0,&1胡萝卜&0 和& botania.page.dandelifeon8=&o细胞工艺^2&r. botania.page.dandelifeon9=制作&1细胞方块&0 -# - MAGICAL APPARATUS +# - NATURAL APPARATUS # -- MANA PYLON botania.entry.pylon=魔法水晶 botania.tagline.pylon=附魔强化者 @@ -2680,7 +2632,7 @@ botania.page.manaAlchemy21=将&1硬化粘土&0变成&1红沙&0 botania.page.manaAlchemy22=粉碎&1粘土&0&1和砖块&0 botania.page.manaAlchemy23=制作&1劣质土&0 botania.page.manaAlchemy24=&1草类&0的转化 -botania.page.manaAlchemy25寻常花之间转化 +botania.page.manaAlchemy25=寻常花的转化 # -- BOTANICAL BREWERY botania.entry.brewery=植物酿造 @@ -2714,7 +2666,7 @@ botania.page.brewery14a=一种简单的魔法药水,它效仿 了&1隐身药水& botania.page.brewery14b=假设你侵犯了我的领地 botania.page.brewery15a=一种简单的魔法药水,它效仿 了&1夜视药水&0,服用后,玩家会 被给予与之相仿的效果,使玩 家获得一个&4夜视&0的效果. botania.page.brewery15b=寂静是否随之而来? -botania.page.brewery16a=botania.page.brewery13a=一种简单的魔法药水,它效仿 了&1伤害吸收药水&0,服用后,玩 家会被给予与之相仿的效果, 使玩家获得一个&4伤害吸收IV&0的 效果. +botania.page.brewery16a=一种简单的魔法药水,它效仿 了&1伤害吸收药水&0,服用后,玩家会 被给予与之相仿的效果,使玩 家伙的一个&4伤害吸收IV&0的效果. botania.page.brewery16b=你准会感冒 # -- BREWING FLASKS @@ -2750,7 +2702,7 @@ botania.page.incense0=&4药剂&0以液态形式存在时可以 提供多样化 botania.page.incense1=&1熏香&0能通过右击放在&1香盘&0上, 这时再用&1打火石&0右击就能将 其点燃.一旦点着,熏香就不 能取下了.
    在需要替换前,一根熏香能燃 烧60倍于对应药水时长的时 间. botania.page.incense2=燃着&1熏香&0的&1香盘&0将会提供注 入&4药剂&0的效果,以香盘为中心 24格以内的所有玩家都会受 到影响.
    但不是所有的&4药剂&0效果都能 注入&1熏香&0,比如&4瞬间治疗&0和&1伤&0 &1害吸收&0就不能注入,熏香也不 能有一个以上的效果. botania.page.incense5=对于喜欢熏香的自动化狂魔 而言,&1熏香&0能通过&1漏斗&0或其他 输入方式接收物品.有熏香时 &1比较器&0会输出强度为1的信号 ,燃烧的时候强度则是2.
    最后,如果一束&1引燃透镜&0发出 的&4魔力脉冲&0击中了有熏香的 香盘,就会将其点着. -botania.page.incense3=Incense is wincense +botania.page.incense3=是熏香赢了 botania.page.incense4=放上熏香 # -- EYE OF THE ANCIENTS @@ -2769,6 +2721,7 @@ botania.page.openCrate2=一个精妙的箱子 # -- DRUM OF THE WILD botania.entry.forestDrum=狂野之鼓 +botania.tagline.forestDrum=用魔力脉冲的力量将植物连根拔起 botania.page.forestDrum0=&1狂野之鼓&0通俗说,就是打击乐 器版的&1狂野号角&0.它与手持的 号角有相同的功能,但是放置 在地上的.
    要击响它破坏附近的花草,需 要向它发射一道&4魔力脉冲&0. botania.page.forestDrum1=注意鼓本身并不存储魔力,然 而,为了触发它,需要&1红石魔&0 &1力发射器&0或是&1魔力脉冲&0. botania.page.forestDrum2=但如果你闭上了眼睛... @@ -2793,6 +2746,8 @@ botania.page.manaConjuration6=炼造&1雪&0 botania.page.manaConjuration7=炼造&1地狱岩&0 botania.page.manaConjuration8=炼造&1灵魂沙&0 botania.page.manaConjuration9=炼造&1砂砾&0 +botania.page.manaConjuration10=炼造&1树叶&0 +botania.page.manaConjuration11=炼造&1草&0 # -- SPECTRAL PLATFORM botania.entry.spectralPlatform=幻影平台 @@ -2841,7 +2796,6 @@ botania.entry.canopyDrum=林冠之鼓 botania.tagline.canopyDrum=用魔力破坏叶子 botania.page.canopyDrum0=&1林冠之鼓&0就像&1狂野之鼓&0一样, 不过它所用的是&1林冠号角&0.它 的功能和手持的号角相同,不 过它需要放置下来.
    若要让它发出振动破坏周围 的树叶,你需要向其发射一道 &4魔力脉冲&0. botania.page.canopyDrum1=鼓本身不会储存魔力,因此激 活它就需要一个&1红石魔力发&0 &1射器&0或&1魔力发射器&0. -botania.page.canopyDrum2=修出我的范儿 # -- COCOON OF CAPRICE botania.entry.cocoon=随想之茧 @@ -2860,7 +2814,7 @@ botania.page.manaBomb1=准备面对伟大的存在... botania.entry.teruTeruBozu=晴天娃娃 botania.tagline.teruTeruBozu=天气控制以及超人的可爱 botania.page.teruTeruBozu0=&1晴天娃娃&0,众所周知,是一种驱 散坏天气的护身符. 简单 地制作一个并将它放在世界 上能够减少&1雨&0或&1雷暴s&0持续的 时间. 坏天气的时候,拿 着&1向日葵&0右击他或朝他投掷 向日葵会让晴天再临.给予 一个&1红石比较器&0能够让他检测 坏天气. -botania.page.teruTeruBozu1=Too spoopy +botania.page.teruTeruBozu1=虽然很吓人但是好萌啊 # -- LIVINGWOOD AVATAR botania.entry.avatar=活木化身 @@ -2894,7 +2848,7 @@ botania.page.grassSeeds3=&1菌丝孢子&0与菌丝 botania.page.grassSeeds4=现在有6种新的&1草地之种&0可 以制作, 所有种类的草地 都有了自己的表述.
    他们会向普通的草地之种那 样蔓延,植物也能在上面生 长. 类似草方块, 他们 只能被&4精准采集&0挖掘. 然而 ,它们不会因为有方块在上方 而变回泥土. botania.page.grassSeeds5=各种各样的&1草地之种&0 -# -- ROD THE LANDS +# -- ROD OF THE LANDS botania.entry.dirtRod=大地法杖 botania.tagline.dirtRod=制造泥土的法杖 botania.page.dirtRod0=&1大地法杖&0就是个傻瓜工具,使 用物品栏里的&4魔力&0(通过&1魔力 石板&0或其他),它能塑造并放 置出&1泥土&0. @@ -2954,7 +2908,7 @@ botania.page.terraPick1=工具里储存的&4魔力&0量决定了 它的&4阶位& botania.page.terraPick2=从&4C&0升至&4B&0,需要一个满的&1魔力&0 &1池&0,每级是上一级的十倍消耗 ,最终到达&4SS&0.
    工具的阶位不会改变它的速 度,但会增强&4激活能力&0.
    可以通过右击开启工具的能 力. botania.page.terraPick3=当工具激活时,它能破坏区域 内的方块.阶位&4C&0还是一小块 ,到了&4B&0就成了一个区域, 随着 阶位升高区域也会增大.注意 阶位&4D&0的工具不能激活.
    激活时会消耗工具储存的&4魔&0 &4力&0,哪怕不是用于挖掘. botania.page.terraPick4=最后,工具每次破坏方块时都 会受到磨损,所以最好物品栏 有与阶位相应的&4魔力&0储存,工 具的功能又像&1魔钢工具&0,因为 它使用&4魔力&0抵消磨损,制作原 料是&1泰拉钢&0.
    它也不会像普通掉落物品那 样消失. -botania.page.terraPick5=WE'RE MINING IN THE DATABASE WOW WOW(ログ ホライズン) +# No translation # botania.page.terraPick5=WE'RE MINING IN THE DATABASE WOW WOW # -- ROD OF THE SEAS botania.entry.waterRod=海洋法杖 @@ -2988,7 +2942,7 @@ botania.tagline.openBucket=摧毁一切进入之物 botania.page.openBucket0=用&1源质钢锭&0似乎能做出一个 有趣的桶.它所获得的液体都 会消失于虚空,再也不会出现 .看起来是个不错的清理工具. botania.page.openBucket1=Lewis的纪念品 -# -- ROD OF BIFROST +# -- ROD OF THE BIFROST botania.entry.rainbowRod=彩虹桥法杖 botania.tagline.rainbowRod=制造彩虹桥,以及梦幻建筑方块的法杖 botania.page.rainbowRod0=&4彩虹桥&0,连接人界与神域的桥 梁.
    尽管这个物品,&1彩虹桥法杖&0不 是用来那么做的,它让持有者 通过消耗一些&4魔力&0右击,向他 所看的方向延伸出一座彩虹 桥. @@ -3013,6 +2967,7 @@ botania.tagline.fireRod=制造火焰圈的法杖 botania.page.fireRod0=&1地狱法杖&0包含着燃烧火焰的 要素,对着地面使用会产生一 个燃烧内部的一切的火焰圈, 消耗相当的&4魔力&0.
    火圈需要一点时间扩散开来, 注意完全扩散开后它会燃烧 内部的一切生物,包括使用者. botania.page.fireRod2=它可以给&1活木化身&0使用.如 果这么做,它会在化身周边 创造一个火焰圈,就像你使 用法杖一样.
    这个过程化身需要&4魔力&0,并 且可以给它一个红石信号以 关闭它. botania.page.fireRod1=MeguMegu无尽之夜的火 + # -- VINE BALLS botania.entry.vineBall=藤蔓球 botania.tagline.vineBall=帮助你如梯子搬攀登的可投掷藤蔓 @@ -3020,10 +2975,10 @@ botania.page.vineBall0=&1梯子&0不能独立存在,它们需要 有依附的东 botania.page.vineBall1=也可以用一些类似&1活木&0和&1风&0 &1之符文&0的材料制作一把能忽 视重力发射&1藤蔓球&0的弹弓. botania.page.vineBall2=这将会在Vineacraft出现.. botania.page.vineBall3=...如果那确实存在的话. -botania.page.vineBall4=哦,你也能制作&1苔石&0 # -- SHARD OF LAPUTA botania.entry.laputaShard=拉普达碎片 +botania.tagline.laputaShard=将大地抬升为浮空岛 botania.page.laputaShard0=通过有些复杂的激活程序,结 合一些有趣的材料包括&1盖亚&0 &1之魂&0就能制作一个特殊的碎 片,当对土地使用时,就能让 附近一个几乎的球形区域升至 空中.
    这个过程可持续10分钟 并且根据土地的质量消耗对 应量的碎片. botania.page.laputaShard2=创建的岛的初始半径为14格 ,换句话说就是直径28格.可 通过添加&1盖亚之魂&0来升级,每 个增加1格半径,即2格直径. botania.page.laputaShard1=看呐白,拉普达真的存在! @@ -3040,7 +2995,7 @@ botania.page.virus2=也不在这儿 botania.entry.skyDirtRod=高原法杖 botania.tagline.skyDirtRod=在天空中制造泥土 botania.page.skyDirtRod0=尽管&1大地法杖&0十分出色,但若能不依靠其他东西而放置&1泥土&0就更好了.
    &1高原法杖&0就是那样的,保有&1大地法杖&0原本的力量同时,它也能在半空中放置&1泥土&0,多消耗一点&4魔力&0. -botania.page.skyDirtRod1=mk2型泥土棍 +botania.page.skyDirtRod1=Mk2型泥土棍 # -- VITREOUS PICKAXE botania.entry.glassPick=玻璃镐 @@ -3050,21 +3005,21 @@ botania.page.glassPick1=请勿与食物放在一起 # -- ROD OF DIVINING botania.entry.diviningRod=占矿法杖 +botania.tagline.diviningRod=追踪矿石的法杖 botania.page.diviningRod0=就如其名所示,&1占矿法杖&0能卜 测使用者周围大范围内的矿 物.它们会闪出亮点来显示位 置.
    这个过程显然会消耗掉玩家 相当量的&4魔力&0. botania.page.diviningRod2=它可以给&1活木化身&0使用.如 果这么做,它会显示周边所 有的矿物,如同玩家使用它 一般,但直到它被移除为止 都会一直显示
    这个过程化身需要&4魔力&0,并 且可以给它一个红石信号以 关闭它. -botania.page.diviningRod1=inb4 ee3 +# No translation # botania.page.diviningRod1=inb4 ee3 # -- ROD OF THE BLACK MESA botania.entry.gravityRod=黑山法杖 botania.tagline.gravityRod=举起,扔出生物 botania.page.gravityRod0=&1黑山法杖&0是个强力的遗物,传说这些最 初和撬棍被发现于一座黑山 的山顶.
    使用时需要对怪物或是物品 右键.松开右键就会扔出选择 的实体,左键时则会让它吃发 强力的爆破. botania.page.gravityRod1=当然这种力量不是免费的,它 会消耗使用者相当大量的&4魔&0 &4力&0. -botania.page.gravityRod2=Why the flax? +# No translation # botania.page.gravityRod2=Why the flax? # -- TIMELESS IVY botania.entry.regenIvy=永恒常春藤 -botania.tagline.regenIvy=Ivy that can be attached to items to have them regenerate durability - +botania.tagline.regenIvy=附着在物品上可恢复耐久的常春藤 botania.page.regenIvy0=尽管&1魔钢&0和&1源质钢&0能用&4魔力&0 保护自身,其他的工具和护甲 却没有这种能力.
    可以给几乎所有物品附上一 些&1永恒常春藤&0,使它们能用&4魔&0 &4力&0修复. botania.page.regenIvy1=使用的话,只需将常春藤和目 标工具,以及3个在铁砧上修 理该工具的材料(比如&1钻石镐 &0用的就是&1钻石&0)
    由于没有直接连接到材料,这样消耗的&4魔力&0比起&1魔钢&0的会多很多. botania.page.regenIvy2=带上你的炼狱扁斧 @@ -3073,9 +3028,8 @@ botania.page.regenIvy2=带上你的炼狱扁斧 botania.entry.missileRod=弹幕法杖 botania.tagline.missileRod=biubiu法杖 botania.page.missileRod0=&1弹幕法杖&0是一种对付大量敌 人用的极其强力的武器.赋予 它能量会产生无数随机追踪 目标的奥术飞弹,但这会消耗 相当巨大的&4魔力&0. -botania.page.missileRod1=死ね死ね死ね死ね死ね botania.page.missileRod2=它可以给&1活木化身&0使用.如 果这么做,它会会产生无数 奥术飞弹并攻击附近怪物, 只要它能够正常使用
    这个过程化身需要&4魔力&0,并 且可以给它一个红石信号以 关闭它. -botania.page.missileRod1=Zapzapzapzap +botania.page.missileRod1=死ね死ね死ね死ね死ね # -- ASSEMBLY HALO botania.entry.craftingHalo=合成环 @@ -3089,7 +3043,7 @@ botania.entry.clip=透镜夹 botania.tagline.clip=魔力脉冲枪的多透镜升级 botania.page.clip0=&1魔力脉冲枪&0作为一个强大而 万能的工具,它的缺陷就在于 每次最多只能储存一个&1透镜&0. 将&1透镜夹&0和&1魔力脉冲枪&0在合 成栏合成后,就能让它储存最 多6个透镜.
    就像他们常说的,没有枪的 俄罗斯轮盘可不算赌博... botania.page.clip1=添加和取出&1透镜&0就像之前做 的那样,要注意的是,只会按 照脉冲枪当前的槽取出或装 入透镜.
    Shift右击&1魔力脉冲枪&0即可切 换槽位.同时也会改变所选的 透镜,前提是槽内装了透镜. -botania.page.clip2=Since we're dubbed by 4Kids we must make do without one +# No translation # botania.page.clip2=Since we're dubbed by 4Kids we must make do without one # -- ROD OF THE DEPTHS botania.entry.cobbleRod=深渊法杖 @@ -3211,7 +3165,7 @@ botania.page.enderAir0=&1末地&0的空气看起来有一些变 异的特性.如 botania.entry.enderEyeBlock=末影监视者 botania.tagline.enderEyeBlock=看着来激活红石信号 botania.page.enderEyeBlock0=&4末影人&0的眼睛被看见时十分 敏感.由此制成的方块在64格 内被玩家直视时就会发出&4红&0 &4石信号&0.
    当然,头戴&1南瓜&0时可以避免. -botania.page.enderEyeBlock1=MY BRAND +# No translation # botania.page.enderEyeBlock1=MY BRAND # -- FORCE RELAY botania.entry.pistonRelay=力量传递器 @@ -3226,7 +3180,7 @@ botania.tagline.enderHand=随时随地的末影箱 botania.page.enderHand0=&1末影之手&0让使用者能跨维度 触及末界,换言之就是&1末影箱&0 的物品栏.无论何地只需用这 个手右击并消耗一些&4魔力&0.
    若对其他玩家使用则会相应 打开&o他们的&r末影物品栏,消耗 更多的&4魔力&0. botania.page.enderHand0a=&1末影之手&0让使用者能跨维度 触及末界,换言之就是&1末影箱&0 的物品栏.无论何地只需用这 个手右击并消耗一些&4魔力&0. botania.page.enderHand2=不仅如此,若玩家的背包中有 &1末影之手&0,那么&1移壳杆&0就能使 用玩家&1末影箱&0里的方块,这比 起平时使用,要消耗更多的&4魔 力&0. -botania.page.enderHand1=Zezima hates him! +# No translation # botania.page.enderHand1=Zezima hates him! botania.page.enderHand1a=就像是4G版的末影箱 # -- SOULSCRIBE @@ -3241,10 +3195,11 @@ botania.entry.spawnerClaw=生命灌注器 botania.tagline.spawnerClaw=用魔力生成怪物,即使你不在身边 botania.page.spawnerClaw0=&1刷怪笼&0是个有趣的东西.它们 能从稀薄的空气中抽取出生 命,但不知何故,只在附近有 玩家时才会运行.
    当然这会在某些程度上限制 它生成生物的速度. botania.page.spawnerClaw1=将一个&1生命灌注器&0放在刷怪 笼的顶端并用&1魔力发射器&0提 供大量的&4魔力&0,当附近无玩家 时,&4魔力&0就会驱动刷怪笼, 就好像有玩家存在一样. -botania.page.spawnerClaw2=Something something shadow dragon +# No translation # botania.page.spawnerClaw2=Something something shadow dragon # -- RED STRING botania.entry.redString=红线 +botania.tagline.redString=遥控物品存储,各种遥控 botania.page.redString0=Lore说过上帝将一条红线系在了 那些命中注定会互相影响各自 生命的人们的脚踝处.这启发 了发明家们想出了一种远程连 接方块的方法,并命名为&1红线&0 .用这种精致的材料制成的方 块可面朝6个基础方向,并且 在一定范围内与它能找到的第 一个有效且可相容的方块绑定. botania.page.redString1=每个&4红线&0方块都有自己不同的 绑定标准,但是每个变体都有 相同的绑定距离要求.如果方 块已建立绑定,则玩家手持 &1森林法杖&0就会看到线.
    中间的 方块不会阻挡方块之间的连接 .最后,&1红线&0方块不能被绑定 botania.page.redString2=你是否正处于紧要关头? @@ -3294,7 +3249,9 @@ botania.page.corporeaIndex2=输入"铁..."将搜索任何名称包 括"铁"的 botania.page.corporeaIndex3=物品名称的复数形式只能在 常规名词涉及到复数(以"-s", "-es"或"-ies"为后缀)时使用, 当前版本同样适用于多个物 品请求,例如"10 苹果".
    "10 of this"搜索10个等同于 玩家手持物品的物品. botania.page.corporeaIndex4=复数请求的例子包括 "10 apples", "a stack of apples", "2 stacks of apples", "2 stacks and 20 apples", "half a stack of apples", "a dozen apples",等等.
    索引可以识别或多或少的搜 索的繁琐形式,所以: "2x stacks and 20x of apples"等同于 "2 stack 2 apple"或 "2 stacks + 2 apples". botania.page.corporeaIndex5=搜索"all"或"every"会提供网络 内符合条件的全部物品,所以 "all 苹果"将提供网络内所有 苹果.
    另外,搜索"count","show","tell" 或"display"不会抽取任何物品, 但会显示物品库存. -botania.page.corporeaIndex6=A certain magical one at that +botania.page.corporeaIndex8=若有人在&1多媒体索引&0附近使用 &4NEI&0,只需对着物品栏中某个物品 按C(NEI面板中亦可)即可请求一 个对应物品.
    按住SHIFT则可请求一组, 按住 CTRL可请求半组,同时按住SHIFT和 CTRL则可请求四分之一组. +botania.page.corporeaIndex6=最后,在&1多媒体索引&0附近,并在聊 天窗口中输入物品名称的一部 分后,可使用TAB键补全物品全名. +botania.page.corporeaIndex7=魔法禁书索引,不对,目录 # -- CORPOREA FUNNEL botania.entry.corporeaFunnel=多媒体漏斗 @@ -3332,6 +3289,8 @@ botania.tagline.endStoneDecor=一些末地风格的装饰 botania.page.endStoneDecor0=类似于其它石质方块,&1末地石&0 也能制成砖块和錾制石砖,砖 块可以跟&1石砖&0一样用于制作 楼梯和台阶. botania.page.endStoneDecor1=制作&1末地石砖&0 botania.page.endStoneDecor2=制作&1錾制末地石砖&0 +botania.page.endStoneDecor3=&1末影砖&0,Purpur并不是什么好名字 +botania.page.endStoneDecor4=制作&1竖纹末影砖&0 # -- LIFE AGGREGATOR botania.entry.spawnerMover=生命聚合器 @@ -3377,9 +3336,10 @@ botania.tagline.thunderSword=一把召唤雷电的剑 botania.page.thunderSword0=&1召雷者&0是一把能召唤雷电的 双刃.制作它需要&1泰拉之刃 &0,&1瓶装末地空气&0以及一些杂七 杂八的材料,&1召雷者&0牺牲了 原本的远距离攻击能力,换取 了能同时攻击多个目标的能力.
    攻击时&1召雷者&0会形成一道可 传递的闪电链,所有被传递的 怪物都会受到伤害,每次传递 都会降低伤害 botania.page.thunderSword1=商业交涉必备利器 -# - BAUBLES +# - BAUBLES AND ACCESSORIES # -- AN INTRODUCTION TO BAUBLES botania.entry.bIntro=饰品介绍 +botania.tagline.bIntro=小小饰品也拥有力量 botania.page.bIntro0=&4饰品(Baubles)&0,平常也指&4小&0 &4饰品&0或者&4护身符&0这样在穿戴 时提供不同效果的装备.
    要装备只需按&4B&0键(可修改). 有四个栏,一个&4项链&0栏,两个 &4戒指&0栏和一个&4腰带&0栏. botania.page.bIntro1=&4饰品栏界面&0 botania.page.bIntro2=注意,如果&4神秘时代&0或其他使 用Baubles的模组也安装了 的话,这个栏会与它们共享. @@ -3398,14 +3358,14 @@ botania.page.cosmeticBaubles7=都给我闭嘴 botania.page.cosmeticBaubles8=这只眼睛必须被封印 botania.page.cosmeticBaubles9=这可不是豆芽 botania.page.cosmeticBaubles10=最佳色彩 -botania.page.cosmeticBaubles11=Tilting the umbrella too much +# No translation # botania.page.cosmeticBaubles11=Tilting the umbrella too much botania.page.cosmeticBaubles12=邻人社 botania.page.cosmeticBaubles13=喵 botania.page.cosmeticBaubles14=别让自己太前卫了 botania.page.cosmeticBaubles15=邪恶吧! -botania.page.cosmeticBaubles16=Nudistoooooooooo +# No translation # botania.page.cosmeticBaubles16=Nudistoooooooooo botania.page.cosmeticBaubles17=谁说我是死鱼眼的 -botania.page.cosmeticBaubles18=Lurk moar +# No translation # botania.page.cosmeticBaubles18=Lurk moar botania.page.cosmeticBaubles19=我需要你的时间 botania.page.cosmeticBaubles20=稀有之物 botania.page.cosmeticBaubles21=嘿, Loki @@ -3447,7 +3407,7 @@ botania.page.auraRing2=升级戒指 botania.entry.travelBelt=旅居者腰带 botania.tagline.travelBelt=更快,更高,更远 botania.page.travelBelt0=穿越各种地形是个麻烦事. &1旅居者腰带&0能装备在&4腰带&0栏 ,装备时增加移动速度,跳跃 高度和摔落伤害减免.
    最后,非潜行时能让装备者自 动走上一格高的坡而不需要 跳跃. -botania.page.travelBelt1=...everell +# No translation # botania.page.travelBelt1=...everell # -- TECTONIC GIRDLE botania.entry.knockbackBelt=抗击腰带 @@ -3487,9 +3447,10 @@ botania.page.miningRing1=挖呀挖洞 # -- RING OF MAGNETIZATION botania.entry.magnetRing=磁化指环 -nia.tagline.magnetRing=把物品拉给你 +botania.tagline.magnetRing=把物品拉给你 botania.page.magnetRing0=通过将&1磁化透镜&0做成可穿戴 的指环,可用它来磁化周围的 物品.装备时,这个指环会将 附近物品吸向穿戴者,前提是 非潜行状态.
    注意它有一个特性,当装备者 扔出一个物品后5秒内它会 停止工作,以免再将扔出去的 东西吸回来. botania.page.magnetRing1=怎么做到的? +botania.page.magnetRing2=升级指环可获得更大作用范围 # -- RING OF FAR REACH botania.entry.reachRing=触物指环 @@ -3528,7 +3489,7 @@ botania.tagline.superLavaPendant=彻底的火免 botania.page.superLavaPendant0=&1绯红项链&0简而言之,就是&1火石&0 &1项链&0的升级版,穿着时能提供 对火和岩浆的免疫力,而不是 单纯的灭火. botania.page.superLavaPendant1=[秘碑解码]亚军 -# -- TAINED BLOOD PENDANT +# -- TAINTED BLOOD PENDANT botania.entry.bloodPendant=污血吊坠 botania.tagline.bloodPendant=酝酿成结晶吊坠 botania.page.bloodPendant0=采用原始的&4药水&0材料制作,下 界,看起来很容易利用这份力 量.
    &1污血吊坠&0允许在饰品栏头饰 槽穿戴的使用者产生浓缩的 &4药剂效果&0.当吊坠被装备时会 吸收使用者的魔力并产生效 果,&4魔力&0消耗取决于&4药剂效果&0 的等级. @@ -3585,7 +3546,6 @@ botania.page.aIntro7=这本书里关于&1艾尔夫海姆&0的 情报也只有这 botania.entry.elfMessage=来自爱尔文·加尔得的消息 botania.tagline.elfMessage=肯定的回复. Yup botania.page.elfMessage0= - # ^ This is blank on purpose botania.page.elfMessage1=&o致以问候.我们注意到我们的 传送门被其他世界的连接打 开了.说起来的确有些震惊. 感谢你向我们提供你所在世 界的知识库,让我们能了解到 在离开那里之后的事,真的过 去很久了呢,我们也很高兴能 看到那里的一切安好. botania.page.elfMessage2=&o经过与爱尔文·加尔德高级议 会的讨论,我们决定与您合作 .你看,你的"植物魔法辞典" 让我们知道了诸多很难入手 的你所在世界的资源,因为这 些资源根本不存在于我们的 土地. @@ -3737,17 +3697,6 @@ botania.page.shinyFlowers3=将任何颜色的&1浮空花朵&0与任何 有效果 botania.page.shinyFlowers1=一闪一闪 botania.page.shinyFlowers2=就像拉普达(天空之城)但小 多了 -# -- PRISMARINE -botania.entry.prismarine=海晶石 -botania.tagline.prismarine=UFO长官:我们来自未来 -botania.page.prismarine0=&1海晶石&0是个有趣的建筑构造 方块.有的人说这是来自&4未来&0 的.
    制作需要&1炼金催化器&0.扔一些 &1下界石英&0就可以得到这种材 料. -botania.page.prismarine1=有多种建筑方块可用&1海晶石&0 &1碎片&0合成,除了&1海灯笼&0以外的 都能做成对应的&1楼梯&0和&1半砖&0. -botania.page.prismarine2=制作&1海晶石碎片&0 -botania.page.prismarine3=合成&1海晶石&0 -botania.page.prismarine4=合成&1海晶石砖&0 -botania.page.prismarine5=合成&1深色海晶石&0 -botania.page.prismarine6=合成&1海灯笼&0 - # -- NATURAL SHEDDING botania.entry.shedding=自然掉落物 botania.tagline.shedding=一物克一物 @@ -3756,7 +3705,6 @@ botania.page.shedding0=这片土地上的生物都以非静 态的形式生存 # -- TINY POTATO botania.entry.tinyPotato=小土豆 botania.tagline.tinyPotato=土豆是我们所有人的朋友 - botania.page.tinyPotato0=这是一个小土豆,它相信你,你 能做到.
    尽管听起来不太真实,但就是 那样,将一个&1马铃薯&0投入&1魔力&0 &1池&0,它就得到了一点活性精华 并且感到愉悦.它很活跃,右击 它还能让它更活跃! botania.page.tinyPotato1=将它放在Kickstarter网站上 就起效了 @@ -3764,6 +3712,7 @@ botania.page.tinyPotato1=将它放在Kickstarter网站上 就起效了 botania.entry.headCreating=头颅制造 botania.tagline.headCreating=制造玩家的头颅 botania.page.headCreating0=一个特别的精灵咒语,配合一 些材料和一个&1命名牌&0就能做 出牌子里所写者头的复制品. 虽然并不知道这是怎样的原 理,但似乎可以用&1符文祭坛&0来 制作. +botania.page.headCreating2=这个社区的一小撮人决意制作 可用作装饰品的头颅。和其 它书页不一样,在这一页点击 左边的&1在线查看&0按钮会打开一 个新网站,这个网站中列出的 名字均可用于制作装饰性头颅。注:该网站提供 的名单和Botania没有任何形 式的关联,亦非寻找此类头颅 的唯一网站。 botania.page.headCreating1=在游戏中获得你的头 # -- AZULEJO -- http://en.wikipedia.org/wiki/Azulejo @@ -3778,7 +3727,7 @@ botania.page.azulejo3=各种样式间循环 botania.entry.starfield=星空制造器 botania.tagline.starfield=制造星空 botania.page.starfield0=&1星空制造器&0就像它的名字一 样,通过将精灵的能量释放到 空中,置于世界上时,会在夜 晚创造出一片距离很远的星 空. -botania.page.starfield=一闪一闪 +botania.page.starfield1=一闪一闪亮晶晶 # -- TRODDEN DIRT botania.entry.dirtPath=沙土 @@ -3806,13 +3755,16 @@ botania.page.stoneAlchemy0=用&1炼金催化器&0就能做出新类型 的&1石 botania.page.stoneAlchemy1=制作不同的石头 botania.page.stoneAlchemy2=磨光 botania.page.stoneAlchemy3=砌砖 -botania.page.stoneAlchemy4=錾制 + +# Not sure why these are not removed but I will remove them in zh_CN at least +# Not sure why these are not removed but I will remove them in zh_CN at least +# Not sure why these are not removed but I will remove them in zh_CN at least # -- BLAZE LIGHT botania.entry.blazeBlock=烈焰灯 botania.tagline.blazeBlock=压缩烈焰棒存储,新的黑曜石获取方式 botania.page.blazeBlock0=将一捆&1烈焰棒&0压实就能得到 一个发光的装饰方块,尽管粗 糙,却是个不错的光源.
    类似&1煤块&0,&1烈焰灯&0也能用作燃 料.将它放在&1白雏菊&0旁边则会 被转化为&1黑曜石&0,真是见鬼了. -botania.page.blazeBlock1=0x1a4 +# No translation # botania.page.blazeBlock1=0x1a4 # -- CHALLENGES botania.entry.challenges=挑战 @@ -3862,23 +3814,44 @@ botania.entry.preventingDecay=阻止凋零 botania.tagline.preventingDecay=阻止被动产能花的枯萎 botania.page.preventingDecay0=绝不 -# -- To translators from future: the following part is only for Archive -- -# -- Fallen Kanade -- -#botania.page.fallenKanade2=&o我会和你结婚.不管你在现实 之中有怎样的障碍,即使无法 走路,无法站立,甚至无法生 育,既便如此我也会和你结婚 .不管在哪里遇到你.我都会 喜欢上你.
    如果在六十亿分之一的概率 下再次相遇,即使那时候你的 身体依旧无法动弹,我也会和 你结婚的.(AngelBeats) - -# -- Hensei Dream -- -#botania.page.heiseiDream2=&o平成壊れちゃって,壊れちゃ って.平和なんて嘘をついた のは谁だ?ほら忘れちゃっ た,忘れちゃった,祭坛に咎 めた罚も.ねえ砕けちゃって ,砕けちゃって,体も心もズ タズタにされて.
    さあどこに行くの,どこに行 くの,君は谁の味方? - -# -- WELCOME TO BOTANIA -#botania.entry.welcome=欢迎来到植物魔法 -#botania.tagline.welcome=欢迎进入植物魔法旅馆 -#botania.page.welcome0=&o什么是和平?是没有斗争?是 年复一年的待在鲜花环绕的 花园里?是看管着你所谓的王 国?是完成已知的所有任务? 是看着自己收集的资源越来 越多? -#botania.page.welcome1=&o和平是不需劳作就能获得之 物-又或是难以获得之物?
    让我们来简单地说说-只需要 一会儿-和平其实就是无需工 作;可以过着被花朵所包围的 和平日子. -#botania.page.welcome2=&o看着你的植物们如预期般的 完成各自的任务,就这样感受 着时间的流逝,没有嘈杂且污 染四布的机器和电脑,也没有 密布的线缆和管道.
    现在想象一下,我们所讨论的 这一切都是可能实现的. -#botania.page.welcome3=&o想象下,经过你的一番努力- 对植物的精心培养,对魔力的 使用,对于这个世界和红石的 知识运用-你就能达到那种梦 寐以求的境界.想象下你所需 求的一切都能通过植物来实 现自动化.植物,加上些魔法, 还有你的智慧. -#botania.page.welcome4=&o有了这本书,你就能梦想成真 了.
    书名只是表面的.尽管称它植 物魔法辞典,但它所涉及的可 不仅仅都是花.其中也涵盖了 各种魔法和近似科技的装置. -#botania.page.welcome5=&o它里面也蕴藏着精灵的秘密, 而精灵们却早已带着世界起 源的线索一同消失在了这个 世界上.对于每一个有着基础 红石知识并能将其投入实践 的人而言,这本书为每一个人 们所知的问题给出了答案,有 了它你就再也不需要学习那 些不明所以的魔法和机械知 识了. -#botania.page.welcome6=&o书的内容也包括了你所要进 行的每一项任务的解释说明, 只需要用上书中的东西,确保 在Minecraft的世界里可行, 然后动用你的聪明才智,难题 就都不是问题了.
    试试看,你会吃惊于自己在没 有外界干扰的情况下竟然可 以做到这么多. -#botania.page.welcome7=&o植物学的知识不仅适用于那 些需要动脑筋的思考的家伙.
    言虽简,报颇丰.各式各样的 魔法饰品和工具想必也能让 其他人自由选择他们想要的. -#botania.page.welcome8=&o亲爱的读者,欢迎来到植物 魔法的世界——&nGideon Seymour&r(来宾作家), (适合新手使用)

    点击“返回”按钮离开本界 面。 -#botania.page.welcome8=&o尊敬的读者,我诚挚地欢迎您 来到植物魔法的世界.&r
    - 特约撰稿人 &nGideon Seymour&r.)

    点击“返回”按钮离开本界面. +botania.subtitle.airRod=天空法杖呼呼作响 +botania.subtitle.agricarnation=田园康乃馨闪光 +botania.subtitle.altarCraft=花药炼制结束 +botania.subtitle.babylonAttack=王之宝钥 封印解除 +botania.subtitle.babylonSpawn=王之宝钥 激活 +botania.subtitle.bellows=魔源风箱嘶嘶作响 +botania.subtitle.bifrostRod=彩虹桥法杖嗡嗡作响 +botania.subtitle.blackLotus=黑莲花溶解 +botania.subtitle.dash=玩家向前猛冲 +botania.subtitle.ding=森林法杖叮当作响 +botania.subtitle.divaCharm=女王项链的回声 +botania.subtitle.divinationRod=占矿法杖嗡嗡作响 +# No translation # botania.subtitle.doit=DO IT!! +botania.subtitle.enchanterForm=魔力附魔台 成型 +botania.subtitle.enchanterFade=魔力附魔台 崩解 +botania.subtitle.enchanterEnchant=魔力附魔结束 +botania.subtitle.endoflame=火红莲燃烧物品 +botania.subtitle.equipBauble=装备首饰 +botania.subtitle.gaiaTrap=盖亚守卫者的符咒 +botania.subtitle.goldenLaurel=黄金桂冠恢复生命 +botania.subtitle.holyCloak=神圣斗篷激活 +botania.subtitle.laputaStart=拉普达碎片 激活 +botania.subtitle.lexiconOpen=植物魔法辞典打开 +botania.subtitle.lexiconPage=植物魔法辞典翻页 +botania.subtitle.lightRelay=微光的嗖嗖声 +botania.subtitle.manaBlaster=魔力脉冲枪发射 +botania.subtitle.manaPoolCraft=魔力灌注 +botania.subtitle.missile=魔法飞弹发射 +botania.subtitle.orechid=石头变成矿石 +botania.subtitle.potionCreate=植物酿造结束 +botania.subtitle.runeAltarCraft=符文祭坛停止工作 +botania.subtitle.runeAltarStart=符文祭坛启动 +botania.subtitle.spreaderFire=魔力发射器发射Mana +botania.subtitle.starcaller=星星从天而降 +botania.subtitle.terraBlade=泰拉之刃 激活 +botania.subtitle.terraformRod=大地被塑形 +botania.subtitle.terraPickMode=泰拉粉碎者升级 +botania.subtitle.terrasteelCraft=泰拉钢制作完成 +botania.subtitle.thermalily=炽玫瑰消耗熔岩 +botania.subtitle.unholyCloak=罪恶斗篷 激活 +botania.subtitle.way=他的名字是 .... 约翰·塞纳!!! diff --git a/src/main/resources/assets/botania/lang/zh_TW.lang b/src/main/resources/assets/botania/lang/zh_TW.lang index 3b4fc329c..0d594d3df 100644 --- a/src/main/resources/assets/botania/lang/zh_TW.lang +++ b/src/main/resources/assets/botania/lang/zh_TW.lang @@ -1,11 +1,16 @@ +# Note to translators: DO NOT COPY ENTRIES FROM ENGLISH +# I repeat: do NOT copy entries from English!! +# Any entry in this lang file should be in zh_TW, or *should not be here at all* +# Copying English entries will cause them to become outdated when the main English lang file changes +# Untranslated entries will automatically be inherited from en_US +# +# Once again, don't copy from English, and THANK YOU for your hard work! + # MISC itemGroup.Botania=植物魔法 generator.botania-skyblock=硝子花園 generator.botania-skyblock.info=不建議植物魔法新手使用 -#並非本地化條目,請翻譯者不要修改此行文本. -botaniamisc.noloc=botaniamisc.noloc - botaniamisc.nextPage=下一頁 botaniamisc.prevPage=上一頁 botaniamisc.back=返回 @@ -49,9 +54,6 @@ botaniamisc.shiftToRemove=Shift點擊移除 botaniamisc.clickToAdd=點擊添加書籤 botaniamisc.ratio=放大:%s倍 botaniamisc.bottleTooltip=味道如何 -botaniamisc.coarseDirt0=劣質土,草 -botaniamisc.coarseDirt1=無法生長 -botaniamisc.spawnerTip=Tip:使用刷怪蛋改變怪物類型 botaniamisc.shardLevel=碎片能量 %s botaniamisc.lexiconIndex=辭典目錄 botaniamisc.hasIvy=有永恆常春籐 @@ -60,8 +62,8 @@ botaniamisc.noLexicon=你需要有植物魔法辭典才能閱讀它. botaniamisc.cantOpen=你的書裡似乎沒有這一頁.或許它是從其他地方來的...? botaniamisc.clickToShare=分享 botaniamisc.drop=扔出 -botaniamisc.dropTip0=提示:你在物品欄內可以按下%key%鍵來扔出物品 -botaniamisc.dropTip1=CTRL加%key%鍵扔出一整組 +botaniamisc.dropTip0=提示:你在物品欄內可以按下%s鍵來扔出物品 +botaniamisc.dropTip1=CTRL加%s鍵扔出一整組 botaniamisc.wandMode.bind=綁定模式 botaniamisc.wandMode.function=工作模式 botaniamisc.playVideo=播放視頻 @@ -267,39 +269,6 @@ botania.armorset.will3.shortDesc=暴擊施加重度緩慢效果 botania.armorset.will4.shortDesc=暴擊傷害穿透護甲 botania.armorset.will5.shortDesc=暴擊施加凋零效果 -# ROMAN NUMERALS -botania.roman0= -botania.roman1=I -botania.roman2=II -botania.roman3=III -botania.roman4=IV -botania.roman5=V -botania.roman6=VI -botania.roman7=VII -botania.roman8=VIII -botania.roman9=IX -botania.roman10=X -botania.roman11=XI -botania.roman12=XII -botania.roman13=XIII -botania.roman14=XIV -botania.roman15=XV -botania.roman16=XVI -botania.roman17=XVII -botania.roman18=XVIII -botania.roman19=XIX -botania.roman20=XX -botania.roman21=XXI -botania.roman22=XXII -botania.roman23=XXIII -botania.roman24=XXIV -botania.roman25=XXV -botania.roman26=XXVI -botania.roman27=XXVII -botania.roman28=XXVIII -botania.roman29=XXIX -botania.roman30=XXX - # KNOWLEDGE botania.knowledge.minecraft=主世界的知識 botania.knowledge.alfheim=&a精靈&7的知識 @@ -416,7 +385,7 @@ botania.versioning.flavour62=90%的醫生會推薦你更新植物魔法. botania.versioning.flavour63=本次更新承諾在午夜。 botania.versioning.flavour64=本次的植魔更新已經過時. 而他的名字是JOHN CENA! DOO DOO DOO DOO botania.versioning.outdated=你所使用的植物魔法版本為%s,最新版本為%s. -botania.versioning.updateMessage=["點擊這裡... [",{"text":"下載","color":"green","hoverEvent":{"action":"show_text","value":{"text":"點此自動下載最新版本","color":"green"}},"clickEvent":{"action":"run_command","value":"/botania-download-latest %version%"}},"] [",{"text":"網站","color":"green","hoverEvent":{"action":"show_text","value":{"text":"點此流覽該mod的網站","color":"green"}},"clickEvent":{"action":"open_url","value":"http://vazkii.us/mod/Botania/downloads.php"}},"] [",{"text":"更新日誌","color":"green","hoverEvent":{"action":"show_text","value":{"text":"點此查看該版本的更新日誌","color":"green"}},"clickEvent":{"action":"open_url","value":"http://vazkii.us/mod/Botania/changelog.php#%version%"}},"]"] +botania.versioning.updateMessage=["點擊這裡... [",{"text":"下載","color":"green","hoverEvent":{"action":"show_text","value":{"text":"點此自動下載最新版本","color":"green"}},"clickEvent":{"action":"open_url","value":"http://minecraft.curseforge.com/projects/botania-unofficial/files/latest"}},"] [",{"text":"網站","color":"green","hoverEvent":{"action":"show_text","value":{"text":"點此流覽該mod的網站","color":"green"}},"clickEvent":{"action":"open_url","value":"http://minecraft.curseforge.com/projects/botania-unofficial"}},"] [",{"text":"更新日誌","color":"green","hoverEvent":{"action":"show_text","value":{"text":"點此查看該版本的更新日誌","color":"green"}},"clickEvent":{"action":"open_url","value":"https://github.com/williewillus/Botania/releases/tag/%s"}},"]"] botania.versioning.startingDownload=[{"text":"開始下載%s.請勿移除你的硬碟.祝你玩得開心 ","color":"aqua"},{"text":"植物魔法","color":"green"},{"text":"?是否考慮贊助","color":"aqua"},{"text":"Vazkii","color":"light_purple"},{"text":" on [","color":"aqua"},{"text":"贊助","color":"gold","hoverEvent":{"action":"show_text","value":{"text":"點此進入Vazkii的贊助界面","color":"light_purple"}},"clickEvent":{"action":"open_url","value":"http://www.patreon.com/Vazkii"}},{"text":"]!","color":"aqua"}] botania.versioning.doneDownloading=已完成下載%s.請刪除舊的Botania .jar並且重啟遊戲以加載新版本. botania.versioning.downloadedAlready=你已下載最新版本.關閉你的遊戲,從你的mods文件夾中刪除舊版本的mod文件,並且重啟遊戲以加載新版本! @@ -428,7 +397,7 @@ botania.versioning.disabled=抱歉,自動升級由於伺服器主機的原因已 botania.baubletype.amulet=裝備在&a項鏈&7欄 botania.baubletype.ring=裝備在&a戒指&7欄 botania.baubletype.belt=裝備在&a腰帶&7欄 -botania.baubletooltip=按&b%key%&7鍵打開飾品菜單 +botania.baubletooltip=按&b%s&7鍵打開飾品菜單 # RELIC POEMS item.dice.poem0=他發牌,以尋找答案, @@ -801,19 +770,6 @@ tile.botania:dreamwood1Stairs.name=夢之木階梯 tile.botania:dreamwood1Slab.name=夢之木半磚 tile.botania:dreamwood1SlabFull.name=夢之木半磚 tile.botania:conjurationCatalyst.name=煉造催化器 -tile.botania:prismarine0.name=海磷石 -tile.botania:prismarine1.name=海磷石磚 -tile.botania:prismarine2.name=暗海磷石 -tile.botania:prismarine0Stairs.name=海磷石階梯 -tile.botania:prismarine0Slab.name=海磷石階梯 -tile.botania:prismarine0SlabFull.name=海磷石半磚 -tile.botania:prismarine1Stairs.name=海磷石磚階梯 -tile.botania:prismarine1Slab.name=海磷石磚半磚 -tile.botania:prismarine1SlabFull.name=海磷石磚半磚 -tile.botania:prismarine2Stairs.name=暗海磷石階梯 -tile.botania:prismarine2Slab.name=暗海磷石半磚 -tile.botania:prismarine2SlabFull.name=暗海磷石半磚 -tile.botania:seaLamp.name=海燈籠 tile.botania:miniIsland0.name=白色浮空花 tile.botania:miniIsland1.name=橘色浮空花 tile.botania:miniIsland2.name=洋紅色浮空花 @@ -832,14 +788,6 @@ tile.botania:miniIsland14.name=紅色浮空花 tile.botania:miniIsland15.name=黑色浮空花 tile.botania:tinyPotato.name=小小馬鈴薯 tile.botania:spawnerClaw.name=生命灌注器 -tile.botania:reedBlock.name=甘蔗塊 -tile.botania:reedBlock0Stairs.name=甘蔗階梯 -tile.botania:reedBlock0Slab.name=甘蔗半磚 -tile.botania:reedBlock0SlabFull.name=甘蔗半磚 -tile.botania:thatch.name=茅草塊 -tile.botania:thatch0Stairs.name=茅草階梯 -tile.botania:thatch0Slab.name=茅草半磚 -tile.botania:thatch0SlabFull.name=茅草半磚 tile.botania:customBrick0.name=煉獄磚塊 tile.botania:customBrick1.name=靈魂磚塊 tile.botania:customBrick2.name=霜凍磚塊 @@ -1068,46 +1016,10 @@ tile.botania:doubleFlower212.name=棕色高神秘花 tile.botania:doubleFlower213.name=綠色高神秘花 tile.botania:doubleFlower214.name=紅色高神秘花 tile.botania:doubleFlower215.name=黑色高神秘花 -tile.botania:stone0.name=安山岩 -tile.botania:stone1.name=玄武岩 -tile.botania:stone2.name=閃長岩 -tile.botania:stone3.name=花崗岩 -tile.botania:stone4.name=拋光安山岩 -tile.botania:stone5.name=拋光玄武岩 -tile.botania:stone6.name=拋光閃長岩 -tile.botania:stone7.name=拋光花崗岩 -tile.botania:stone8.name=安山岩磚 -tile.botania:stone9.name=玄武岩磚 -tile.botania:stone10.name=閃長岩磚 -tile.botania:stone11.name=花崗岩磚 tile.botania:stone12.name=浮雕安山岩磚 tile.botania:stone13.name=浮雕玄武岩磚 tile.botania:stone14.name=浮雕閃長岩磚 tile.botania:stone15.name=浮雕花崗岩磚 -tile.botania:stone0Stairs.name=安山岩階梯 -tile.botania:stone1Stairs.name=玄武岩階梯 -tile.botania:stone2Stairs.name=閃長岩階梯 -tile.botania:stone3Stairs.name=花崗岩階梯 -tile.botania:stone8Stairs.name=安山岩磚階梯 -tile.botania:stone9Stairs.name=玄武岩磚階梯 -tile.botania:stone10Stairs.name=閃長岩磚階梯 -tile.botania:stone11Stairs.name=花崗岩磚階梯 -tile.botania:stone0Slab.name=安山岩半磚 -tile.botania:stone1Slab.name=玄武岩半磚 -tile.botania:stone2Slab.name=閃長岩半磚 -tile.botania:stone3Slab.name=花崗岩半磚 -tile.botania:stone8Slab.name=安山岩磚半磚 -tile.botania:stone9Slab.name=玄武岩磚半磚 -tile.botania:stone10Slab.name=閃長岩磚半磚 -tile.botania:stone11Slab.name=花崗岩磚半磚 -tile.botania:stone0SlabFull.name=安山岩半磚 -tile.botania:stone1SlabFull.name=玄武岩半磚 -tile.botania:stone2SlabFull.name=閃長岩半磚 -tile.botania:stone3SlabFull.name=花崗岩半磚 -tile.botania:stone8SlabFull.name=安山岩磚半磚 -tile.botania:stone9SlabFull.name=玄武岩磚半磚 -tile.botania:stone10SlabFull.name=閃長岩磚半磚 -tile.botania:stone11SlabFull.name=花崗岩磚半磚 tile.botania:blazeBlock.name=烈焰燈 tile.botania:corporeaInterceptor.name=多媒體攔截器 tile.botania:corporeaCrystalCube.name=多媒體水晶魔方 @@ -1124,8 +1036,6 @@ tile.botania:lightLauncher.name=微光發射器 tile.botania:livingrock0Wall.name=活石牆 tile.botania:livingwood0Wall.name=活木牆 tile.botania:dreamwood0Wall.name=夢之木牆 -tile.botania:prismarine0Wall.name=海晶石牆 -tile.botania:reedBlock0Wall.name=甘蔗圍牆 tile.botania:biomeStoneA0Wall0.name=變質森林石牆 tile.botania:biomeStoneA0Wall1.name=變質平原石牆 tile.botania:biomeStoneA0Wall2.name=變質高山石牆 @@ -1134,10 +1044,6 @@ tile.botania:biomeStoneA0Wall4.name=變質沼澤石牆 tile.botania:biomeStoneA0Wall5.name=變質沙漠石牆 tile.botania:biomeStoneA0Wall6.name=變質雪原石牆 tile.botania:biomeStoneA0Wall7.name=變質高原石牆 -tile.botania:stone0Wall0.name=安山岩石牆 -tile.botania:stone0Wall1.name=玄武岩石牆 -tile.botania:stone0Wall2.name=閃長岩石牆 -tile.botania:stone0Wall3.name=花崗岩石牆 tile.botania:manaBomb.name=瑪那風暴 tile.botania:buriedPetals0=埋藏白色花瓣 tile.botania:buriedPetals0.name=埋藏白色花瓣 @@ -1635,7 +1541,7 @@ item.botania:terraAxe.name=泰拉斷裂者 item.botania:manasteelNugget.name=魔鋼粒 item.botania:terrasteelNugget.name=泰拉鋼粒 item.botania:elementiumNugget.name=源質鋼粒 -item.botania:root.name=活根 +item.botania:livingRoot.name=活根 item.botania:pebble.name=卵石 item.botania:waterBowl.name=一碗水 item.botania:obedienceStick.name=植物遵從法杖 @@ -2536,17 +2442,12 @@ botania.page.endoflame2=&o不是閃耀之光&r. # -- HYDROANGEAS botania.entry.hydroangeas=水繡球 botania.tagline.hydroangeas=水力產魔機 -botania.page.hydroangeas0=&1Hydroangeas&0 act as a liquid based passive generator. They will suck up any &1Still Water&0 in a 3x3 area around it, on the same height, creating &4Mana&0 from it. The amount they produce is comparable to that of an &1Endoflame&0. They also seem to function faster during &4Rain&0.
    &1Hydroangeas&0 are classified as &4passive flowers&0 and as such will decay. botania.page.hydroangeas2=一個簡單的&1水繡球&0系統 botania.page.hydroangeas1=&o超次元來物&r? # -- THERMALILY botania.entry.thermalily=熾玫瑰 botania.tagline.thermalily=地熱發電植魔版 -botania.page.thermalily0=The &1Thermalily&0 acts as a &1Lava&0 counterpart to the &1Hydroangeas&0. As expected, the flower will absorb &1Lava&0 around it, in the same height as it, to create &4Mana&0.
    After absorbing the &1Lava&0, the flower will produce &4Mana&0 for around 45 seconds. After it stops, it needs a bit of time, around 5 minutes, to cool down, before it can absorb more &1Lava&0. -botania.page.thermalily2=The amount of &4Mana&0 the &1Thermalily&0 produces during its active period is extremely high, serving as a very functional flower for when a quick boost is needed.
    During the "cooldown" period, if the flower were to absorb any &4Lava&0, it instead consumes it, generating no &4Mana&0 and having to wait 5 minutes from there to start over. -botania.page.thermalily3=While placing &1Lava&0 in the world is definitely possible via &1Dispensers&0, automatically gathering it and carrying it from the &4Nether&0 or deep underground is another story entirely.
    As such, the &1Thermalily&0 is clasified as a "semi-automatable" flower. -botania.page.thermalily1=&o0108 Style&r. # -- ROSA ARCANA botania.entry.arcanerose=阿卡納薔薇 @@ -2585,7 +2486,6 @@ botania.page.gourmaryllis3=&o為我們的新房客準備的火鍋&r. botania.entry.narslimmus=黏球草 botania.tagline.narslimmus=黏黏瑪那 botania.page.narslimmus0=這個世界上一些地方還存在 著未知的能量場,那裡能產生 &1史萊姆&0.人們稱其&4史萊姆區塊&0 .&1黏球草&0就能利用這種能量.如 果它被種在了一隻由那種能 量生出的&1史萊姆&0旁邊,它就會 將其分解並收集由其產生的 所有&4瑪那&0.&1史萊姆&0越大,產生 的&4瑪那&0就越多.它也會弄得黏 黏糊糊的. -botania.page.narslimmus1=&oStick around, would ye&r? # -- SPECTROLUS botania.entry.spectrolus=斑斕花 @@ -2742,7 +2642,6 @@ botania.page.incense0=&4藥劑&0以液態形式存在時可以 提供多樣化 botania.page.incense1=&1熏香&0能通過右擊放在&1香盤&0上, 這時再用&1打火石&0右擊就能將 其點燃.一旦點著,熏香就不 能取下了.
    在需要替換前,一根熏香能燃 燒60倍於對應藥水時長的時 間. botania.page.incense2=燃著&1熏香&0的&1香盤&0將會提供注 入&4藥劑&0的效果,以香盤為中心 24格以內的所有玩家都會受 到影響.
    但不是所有的&4藥劑&0效果都能 注入&1熏香&0,比如&4瞬間治療&0和&1傷&0 &1害吸收&0就不能注入,熏香也不 能有一個以上的效果. botania.page.incense5=對於喜歡熏香的自動化狂魔 而言,&1熏香&0能通過&1漏斗&0或其他 輸入方式接收物品.有熏香時 &1比較器&0會輸出強度為1的信號 ,燃燒的時候強度則是2.
    最後,如果一束&1引燃透鏡&0發出 的&4瑪那脈衝&0擊中了有熏香的 香盤,就會將其點著. -botania.page.incense3=Incense is wincense botania.page.incense4=放上熏香 # -- EYE OF THE ANCIENTS @@ -3015,7 +2914,6 @@ botania.page.vineBall0=&1梯子&0不能獨立存在,它們需要 有依附的東 botania.page.vineBall1=也可以用一些類似&1活木&0和&1風&0 &1之符文&0的材料製作一把能忽 視重力發射&1籐蔓球&0的彈弓. botania.page.vineBall2=這將會在Vineacraft出現.. botania.page.vineBall3=...如果那確實存在的話. -botania.page.vineBall4=哦,你也能製作&1苔石&0 # -- SHARD OF LAPUTA botania.entry.laputaShard=拉普達碎片 @@ -3084,7 +2982,6 @@ botania.entry.clip=透鏡夾 botania.tagline.clip=瑪那脈衝槍的多透鏡升級 botania.page.clip0=&1瑪那脈衝槍&0作為一個強大而 萬能的工具,它的缺陷就在於 每次最多只能儲存一個&1透鏡&0. 將&1透鏡夾&0和&1瑪那脈衝槍&0在合 成欄合成後,就能讓它儲存最 多6個透鏡.
    就像他們常說的,沒有槍的 俄羅斯輪盤可不算賭博... botania.page.clip1=添加和取出&1透鏡&0就像之前做 的那樣,要注意的是,只會按 照脈衝槍當前的槽取出或裝 入透鏡.
    Shift右擊&1瑪那脈衝槍&0即可切 換槽位.同時也會改變所選的 透鏡,前提是槽內裝了透鏡. -botania.page.clip2=Since we're dubbed by 4Kids we must make do without one # -- ROD OF THE DEPTHS botania.entry.cobbleRod=深淵法杖 @@ -3206,7 +3103,6 @@ botania.page.enderAir0=&1終界&0的空氣看起來有一些變 異的特性.如 botania.entry.enderEyeBlock=終界監視者 botania.tagline.enderEyeBlock=看著來啟動紅石信號 botania.page.enderEyeBlock0=&4終界使者&0的眼睛被看見時十分 敏感.由此製成的方塊在64格 內被玩家直視時就會發出&4紅&0 &4石信號&0.
    當然,頭戴&1南瓜&0時可以避免. -botania.page.enderEyeBlock1=MY BRAND # -- FORCE RELAY botania.entry.pistonRelay=力量傳遞器 @@ -3236,7 +3132,6 @@ botania.entry.spawnerClaw=生命灌注器 botania.tagline.spawnerClaw=用瑪那生成怪物,即使你不在身邊 botania.page.spawnerClaw0=&1刷怪籠&0是個有趣的東西.它們 能從稀薄的空氣中抽取出生 命,但不知何故,只在附近有 玩家時才會運行.
    當然這會在某些程度上限制 它生成生物的速度. botania.page.spawnerClaw1=將一個&1生命灌注器&0放在刷怪 籠的頂端並用&1瑪那發射器&0提 供大量的&4瑪那&0,當附近無玩家 時,&4瑪那&0就會驅動刷怪籠, 就好像有玩家存在一樣. -botania.page.spawnerClaw2=Something something shadow dragon # -- RED STRING botania.entry.redString=紅線 @@ -3290,9 +3185,7 @@ botania.page.corporeaIndex2=輸入"鐵..."將搜索任何名稱包 括"鐵"的 botania.page.corporeaIndex3=物品名稱的複數形式只能在 常規名詞涉及到複數(以"-s", "-es"或"-ies"為後綴)時使用, 當前版本同樣適用於多個物 品請求,例如"10 蘋果".
    "10 of this"搜索10個等同於 玩家手持物品的物品. botania.page.corporeaIndex4=複數請求的例子包括 "10 apples", "a stack of apples", "2 stacks of apples", "2 stacks and 20 apples", "half a stack of apples", "a dozen apples",等等.
    索引可以識別或多或少的搜 索的繁瑣形式,所以: "2x stacks and 20x of apples"等同於 "2 stack 2 apple"或 "2 stacks + 2 apples". botania.page.corporeaIndex5=搜索"all"或"every"會提供網絡 內符合條件的全部物品,所以 "all 蘋果"將提供網絡內所有 蘋果.
    另外,搜索"count","show","tell" 或"display"不會抽取任何物品, 但會顯示物品庫存. -botania.page.corporeaIndex8=While near a &1Corporea Index&0, if one is using &4NotEnoughItems&0, pressing C on an item in one's inventory (or NEI panel) will request 1 of said item.
    Using SHIFT will instead request a full stack, CTRL will request half a stack and SHIFT+CTRL a quarter of a stack. botania.page.corporeaIndex6=最後,在靠近&1多媒體索引&0的地方,寫上物品部份的名稱,並在聊天區域按TAB鍵將可以自動拼完物品名稱. -botania.page.corporeaIndex7=A certain magical one at that # -- CORPOREA FUNNEL botania.entry.corporeaFunnel=多媒體漏斗 @@ -3399,7 +3292,6 @@ botania.page.cosmeticBaubles7=都給我閉嘴 botania.page.cosmeticBaubles8=這隻眼睛必須被封印 botania.page.cosmeticBaubles9=這可不是豆芽 botania.page.cosmeticBaubles10=最佳色彩 -botania.page.cosmeticBaubles11=Tilting the umbrella too much botania.page.cosmeticBaubles12=鄰人部 botania.page.cosmeticBaubles13=喵 botania.page.cosmeticBaubles14=別讓自己太前衛了 @@ -3448,7 +3340,6 @@ botania.page.auraRing2=升級戒指 botania.entry.travelBelt=旅居者腰帶 botania.tagline.travelBelt=更快,更高,更遠 botania.page.travelBelt0=穿越各種地形是個麻煩事. &1旅居者腰帶&0能裝備在&4腰帶&0欄 ,裝備時增加移動速度,跳躍 高度和摔落傷害減免.
    最後,非潛行時能讓裝備者自 動走上一格高的坡而不需要 跳躍. -botania.page.travelBelt1=...everell # -- TECTONIC GIRDLE botania.entry.knockbackBelt=抗擊腰帶 @@ -3764,7 +3655,6 @@ botania.page.tinyPotato1=將它放在Kickstarter網站上 就起效了 botania.entry.headCreating=頭顱製造 botania.tagline.headCreating=製造玩家的頭顱 botania.page.headCreating0=一個特別的精靈咒語,配合一 些材料和一個&1命名牌&0就能做 出牌子裡所寫者頭的複製品. 雖然並不知道這是怎樣的原 理,但似乎可以用&1符文祭壇&0來 製作. -botania.page.headCreating2=A subset of the community has dedicated themselves to creating heads that serve as all sorts of decorations. Unlike any other page in this lexicon, clicking the &1View Online&0 button on the left of this page will take you to a website with a list of names that can be used for this purpose. Note, however, that this list is not affiliated with Botania in any way and is definitely not the only place to find these types of heads. botania.page.headCreating1=在遊戲中獲得你的頭 # -- AZULEJO -- http://en.wikipedia.org/wiki/Azulejo diff --git a/src/main/resources/assets/botania/loot_tables/gaia_guardian.json b/src/main/resources/assets/botania/loot_tables/gaia_guardian.json new file mode 100644 index 000000000..cfbe1b6a9 --- /dev/null +++ b/src/main/resources/assets/botania/loot_tables/gaia_guardian.json @@ -0,0 +1,31 @@ +{ + "pools": [ + { + "name": "life_essence", + "conditions": [{ "condition": "killed_by_player" }], + "rolls": 1, + "entries": [{ + "type": "item", + "name": "botania:manaResource", + "functions": [ + { "function": "set_data", "data": 5 }, + { "function": "set_count", "count": 6 }, + { + "function": "set_count", + "count": 8, + "conditions": [{ "condition": "botania:true_guardian_killer" }] + } + ] + }] + }, + { + "name": "music_disc", + "conditions": [ + { "condition": "killed_by_player" }, + { "condition": "random_chance", "chance": 0.2 } + ], + "rolls": 1, + "entries": [{ "type": "item", "name": "botania:recordGaia1" }] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/loot_tables/gaia_guardian_2.json b/src/main/resources/assets/botania/loot_tables/gaia_guardian_2.json new file mode 100644 index 000000000..98e512975 --- /dev/null +++ b/src/main/resources/assets/botania/loot_tables/gaia_guardian_2.json @@ -0,0 +1,185 @@ +{ + "pools": [ + { + "name": "life_essence", + "conditions": [{ "condition": "killed_by_player" }], + "rolls": 1, + "entries": [{ + "type": "item", + "name": "botania:manaResource", + "functions": [ + { "function": "set_data", "data": 5 }, + { "function": "set_count", "count": 10 }, + { + "function": "set_count", + "count": 16, + "conditions": [{ "condition": "botania:true_guardian_killer" }] + } + ] + }] + }, + { + "name": "black_lotuses", + "conditions": [ + { "condition": "killed_by_player" }, + { "condition": "random_chance", "chance": 0.5 } + ], + "rolls": 1, + "entries": [ + { + "type": "item", + "entryName": "superBlackLotus", + "name": "botania:blackLotus", + "weight": 3, + "quality": 1, + "functions": [ + { "function": "set_count", "count": 1 }, + { "function": "set_data", "data": 1 } + ] + }, + { + "type": "item", + "entryName": "normalBlackLotus", + "name": "botania:blackLotus", + "weight": 7, + "functions": [ + { "function": "set_count", "count": { "min": 1, "max": 3 } }, + { "function": "set_data", "data": 0 } + ] + } + ] + }, + { + "name": "ancient_wills", + "conditions": [{ "condition": "killed_by_player" }], + "rolls": 1, + "entries": [{ + "type": "item", + "name": "botania:ancientWill", + "functions": [{ "function": "set_data", "data": { "min": 0, "max": 5 } }] + }] + }, + { + "name": "overgrowth_seeds", + "conditions": [ + { "condition": "killed_by_player" }, + { "condition": "random_chance", "chance": 0.25 } + ], + "rolls": 1, + "entries": [{ + "type": "item", + "name": "botania:overgrowthSeed", + "functions": [{ "function": "set_count", "count": { "min": 1, "max": 3 } }] + }] + }, + { + "name": "manasteel", + "conditions": [ + { "condition": "killed_by_player" }, + { "condition": "random_chance", "chance": 0.9 } + ], + "rolls": 1, + "entries": [{ + "type": "item", + "name": "botania:manaResource", + "functions": [{ "function": "set_count", "count": { "min": 16, "max": 27 } }] + }] + }, + { + "name": "mana_pearl", + "conditions": [ + { "condition": "killed_by_player" }, + { "condition": "random_chance", "chance": 0.7 } + ], + "rolls": 1, + "entries": [{ + "type": "item", + "name": "botania:manaResource", + "functions": [ + { "function": "set_data", "data": 1 }, + { "function": "set_count", "count": { "min": 8, "max": 13 } } + ] + }] + }, + { + "name": "mana_diamond", + "conditions": [ + { "condition": "killed_by_player" }, + { "condition": "random_chance", "chance": 0.5 } + ], + "rolls": 1, + "entries": [{ + "type": "item", + "name": "botania:manaResource", + "functions": [ + { "function": "set_data", "data": 2 }, + { "function": "set_count", "count": { "min": 4, "max": 6 } } + ] + }] + }, + { + "name": "runes", + "conditions": [{ "condition": "killed_by_player" }], + "rolls": { "min": 1, "max": 6 }, + "entries": [{ + "conditions": [{ "condition": "random_chance", "chance": 0.3 }], + "type": "item", + "name": "botania:rune", + "functions": [ + { "function": "set_data", "data": { "min": 0, "max": 15 } }, + { "function": "set_count", "count": { "min": 2, "max": 4 } } + ] + }] + }, + { + "name": "pinkinator", + "conditions": [ + { "condition": "killed_by_player" }, + { "condition": "random_chance", "chance": 0.2 } + ], + "rolls": 1, + "entries": [{ + "type": "item", + "name": "botania:pinkinator" + }] + }, + { + "name": "music_discs", + "conditions": [ + { "condition": "killed_by_player" }, + { "condition": "random_chance", "chance": 0.44 } + ], + "rolls": 1, + "entries": [ + { + "weight": 14, + "type": "item", + "name": "botania:recordGaia2" + }, + { + "weight": 15, + "type": "item", + "name": "minecraft:record_13" + }, + { + "weight": 15, + "type": "item", + "name": "minecraft:record_wait" + } + ] + }, + { + "name": "relics", + "conditions": [ + { "condition": "killed_by_player" }, + { "condition": "botania:enable_relics" } + ], + "rolls": 1, + "entries": [{ + "type": "item", + "name": "botania:dice", + "functions": [{ "function": "botania:bind_uuid" }] + }] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/loot_tables/inject/abandoned_mineshaft.json b/src/main/resources/assets/botania/loot_tables/inject/abandoned_mineshaft.json new file mode 100644 index 000000000..76e33d585 --- /dev/null +++ b/src/main/resources/assets/botania/loot_tables/inject/abandoned_mineshaft.json @@ -0,0 +1,23 @@ +{ + "__comment": "This table is injected as its own pool into minecraft:chests/abandoned_mineshaft", + "pools": [{ + "name": "main", + "rolls": 1, + "entries": [ + { + "type": "item", + "name": "botania:blackLotus", + "weight": 35 + }, + { + "type": "item", + "name": "botania:overgrowthSeed", + "weight": 5 + }, + { + "type": "empty", + "weight": 60 + } + ] + }] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/loot_tables/inject/desert_pyramid.json b/src/main/resources/assets/botania/loot_tables/inject/desert_pyramid.json new file mode 100644 index 000000000..68b7e2f1d --- /dev/null +++ b/src/main/resources/assets/botania/loot_tables/inject/desert_pyramid.json @@ -0,0 +1,23 @@ +{ + "__comment": "This table is injected as its own pool into minecraft:chests/desert_pyramid", + "pools": [{ + "name": "main", + "rolls": 1, + "entries": [ + { + "type": "item", + "name": "botania:blackLotus", + "weight": 35 + }, + { + "type": "item", + "name": "botania:overgrowthSeed", + "weight": 5 + }, + { + "type": "empty", + "weight": 60 + } + ] + }] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/loot_tables/inject/jungle_temple.json b/src/main/resources/assets/botania/loot_tables/inject/jungle_temple.json new file mode 100644 index 000000000..02c18574d --- /dev/null +++ b/src/main/resources/assets/botania/loot_tables/inject/jungle_temple.json @@ -0,0 +1,23 @@ +{ + "__comment": "This table is injected as its own pool into minecraft:chests/jungle_temple", + "pools": [{ + "name": "main", + "rolls": 1, + "entries": [ + { + "type": "item", + "name": "botania:blackLotus", + "weight": 25 + }, + { + "type": "item", + "name": "botania:overgrowthSeed", + "weight": 5 + }, + { + "type": "empty", + "weight": 70 + } + ] + }] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/loot_tables/inject/simple_dungeon.json b/src/main/resources/assets/botania/loot_tables/inject/simple_dungeon.json new file mode 100644 index 000000000..63cc6d111 --- /dev/null +++ b/src/main/resources/assets/botania/loot_tables/inject/simple_dungeon.json @@ -0,0 +1,39 @@ +{ + "__comment": "This table is injected as its own pool into minecraft:chests/simple_dungeon", + "pools": [{ + "name": "main", + "rolls": 1, + "entries": [ + { + "type": "item", + "name": "botania:manaResource", + "weight": 50, + "functions": [{ "function": "set_count", "count": { "min": 1, "max": 5 } }] + }, + { + "type": "item", + "name": "botania:lexicon", + "weight": 20 + }, + { + "type": "item", + "name": "botania:manaBottle", + "weight": 10 + }, + { + "type": "item", + "name": "botania:blackLotus", + "weight": 5 + }, + { + "type": "item", + "name": "botania:overgrowthSeed", + "weight": 2 + }, + { + "type": "empty", + "weight": 13 + } + ] + }] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/loot_tables/inject/spawn_bonus_chest.json b/src/main/resources/assets/botania/loot_tables/inject/spawn_bonus_chest.json new file mode 100644 index 000000000..a06aeb93b --- /dev/null +++ b/src/main/resources/assets/botania/loot_tables/inject/spawn_bonus_chest.json @@ -0,0 +1,23 @@ +{ + "__comment": "This table is injected as its own pool into minecraft:chests/spawn_bonus_chest", + "pools": [{ + "name": "main", + "rolls": 1, + "entries": [ + { + "type": "item", + "name": "botania:lexicon", + "weight": 80 + }, + { + "type": "item", + "name": "botania:blackLotus", + "weight": 10 + }, + { + "type": "empty", + "weight": 10 + } + ] + }] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/loot_tables/inject/stronghold_corridor.json b/src/main/resources/assets/botania/loot_tables/inject/stronghold_corridor.json new file mode 100644 index 000000000..06b7256b4 --- /dev/null +++ b/src/main/resources/assets/botania/loot_tables/inject/stronghold_corridor.json @@ -0,0 +1,29 @@ +{ + "__comment": "This table is injected as its own pool into minecraft:chests/stronghold_corridor", + "pools": [{ + "name": "main", + "rolls": 1, + "entries": [ + { + "type": "item", + "name": "botania:manaResource", + "weight": 45, + "functions": [{ "function": "set_count", "count": { "min": 1, "max": 3 } }] + }, + { + "type": "item", + "name": "botania:blackLotus", + "weight": 10 + }, + { + "type": "item", + "name": "botania:overgrowthSeed", + "weight": 5 + }, + { + "type": "empty", + "weight": 40 + } + ] + }] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/loot_tables/inject/village_blacksmith.json b/src/main/resources/assets/botania/loot_tables/inject/village_blacksmith.json new file mode 100644 index 000000000..02c5198bb --- /dev/null +++ b/src/main/resources/assets/botania/loot_tables/inject/village_blacksmith.json @@ -0,0 +1,18 @@ +{ + "__comment": "This table is injected as its own pool into minecraft:chests/village_blacksmith", + "pools": [{ + "name": "main", + "rolls": 1, + "entries": [ + { + "type": "item", + "name": "botania:blackLotus", + "weight": 10 + }, + { + "type": "empty", + "weight": 90 + } + ] + }] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/abstruse_platform.json b/src/main/resources/assets/botania/models/block/abstruse_platform.json new file mode 100644 index 000000000..f3b6eaa40 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/abstruse_platform.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/platform0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/alchemy_catalyst.json b/src/main/resources/assets/botania/models/block/alchemy_catalyst.json new file mode 100644 index 000000000..0fbe6496b --- /dev/null +++ b/src/main/resources/assets/botania/models/block/alchemy_catalyst.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/cube_bottom_top", + "textures": { + "bottom": "botania:blocks/alchemyCatalyst0", + "top": "botania:blocks/alchemyCatalyst1", + "side": "botania:blocks/alchemyCatalyst2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/alfheim_portal.json b/src/main/resources/assets/botania/models/block/alfheim_portal.json new file mode 100644 index 000000000..c89f3e82d --- /dev/null +++ b/src/main/resources/assets/botania/models/block/alfheim_portal.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/alfheimPortal0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/alfheim_portal_on.json b/src/main/resources/assets/botania/models/block/alfheim_portal_on.json new file mode 100644 index 000000000..ed0629071 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/alfheim_portal_on.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/alfheimPortal1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/apothecaries/default_apothecary.json b/src/main/resources/assets/botania/models/block/apothecaries/default_apothecary.json new file mode 100644 index 000000000..827f9cf07 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/apothecaries/default_apothecary.json @@ -0,0 +1,23 @@ +{ + "parent": "botania:block/shapes/petal_apothecary", + "textures": { + "gobletbaseside": "botania:model/altar/default/gobletBase_sides", + "gobletbasetop": "botania:model/altar/default/gobletBase_top", + "gobletbasebottom": "botania:model/altar/default/gobletBase_bottom", + "gobletbase2side": "botania:model/altar/default/gobletBase2_sides", + "gobletbase2top": "botania:model/altar/default/gobletBase2_top", + "gobletbase2bottom": "botania:model/altar/default/gobletBase2_bottom", + "gobletbase3side": "botania:model/altar/default/gobletBase3_sides", + "gobletbase3top": "botania:model/altar/default/gobletBase3_top", + "gobletbase3bottom": "botania:model/altar/default/gobletBase3_bottom", + "gobletstandside": "botania:model/altar/default/gobletStand_sides", + "gobletstandtopbottom": "botania:model/altar/default/gobletStand_top_bottom", + "kelkbaseside": "botania:model/altar/default/kelkBase_sides", + "kelkbasetopbottom": "botania:model/altar/default/kelkBase_top_bottom", + "kelkbase2side": "botania:model/altar/default/kelkBase2_sides", + "kelkbase2top": "botania:model/altar/default/kelkBase2_top", + "kelkbase2bottom": "botania:model/altar/default/kelkBase2_bottom", + "kelkwall": "botania:model/altar/default/kelkWall", + "particle": "minecraft:blocks/cobblestone" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/apothecaries/desert_apothecary.json b/src/main/resources/assets/botania/models/block/apothecaries/desert_apothecary.json new file mode 100644 index 000000000..64158af35 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/apothecaries/desert_apothecary.json @@ -0,0 +1,23 @@ +{ + "parent": "botania:block/shapes/petal_apothecary", + "textures": { + "gobletbaseside": "botania:model/altar/desert/gobletBase_sides", + "gobletbasetop": "botania:model/altar/desert/gobletBase_top", + "gobletbasebottom": "botania:model/altar/desert/gobletBase_bottom", + "gobletbase2side": "botania:model/altar/desert/gobletBase2_sides", + "gobletbase2top": "botania:model/altar/desert/gobletBase2_top", + "gobletbase2bottom": "botania:model/altar/desert/gobletBase2_bottom", + "gobletbase3side": "botania:model/altar/desert/gobletBase3_sides", + "gobletbase3top": "botania:model/altar/desert/gobletBase3_top", + "gobletbase3bottom": "botania:model/altar/desert/gobletBase3_bottom", + "gobletstandside": "botania:model/altar/desert/gobletStand_sides", + "gobletstandtopbottom": "botania:model/altar/desert/gobletStand_top_bottom", + "kelkbaseside": "botania:model/altar/desert/kelkBase_sides", + "kelkbasetopbottom": "botania:model/altar/desert/kelkBase_top_bottom", + "kelkbase2side": "botania:model/altar/desert/kelkBase2_sides", + "kelkbase2top": "botania:model/altar/desert/kelkBase2_top", + "kelkbase2bottom": "botania:model/altar/desert/kelkBase2_bottom", + "kelkwall": "botania:model/altar/desert/kelkWall", + "particle": "botania:blocks/biomeStone5" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/apothecaries/forest_apothecary.json b/src/main/resources/assets/botania/models/block/apothecaries/forest_apothecary.json new file mode 100644 index 000000000..a9fe8da9f --- /dev/null +++ b/src/main/resources/assets/botania/models/block/apothecaries/forest_apothecary.json @@ -0,0 +1,23 @@ +{ + "parent": "botania:block/shapes/petal_apothecary", + "textures": { + "gobletbaseside": "botania:model/altar/forest/gobletBase_sides", + "gobletbasetop": "botania:model/altar/forest/gobletBase_top", + "gobletbasebottom": "botania:model/altar/forest/gobletBase_bottom", + "gobletbase2side": "botania:model/altar/forest/gobletBase2_sides", + "gobletbase2top": "botania:model/altar/forest/gobletBase2_top", + "gobletbase2bottom": "botania:model/altar/forest/gobletBase2_bottom", + "gobletbase3side": "botania:model/altar/forest/gobletBase3_sides", + "gobletbase3top": "botania:model/altar/forest/gobletBase3_top", + "gobletbase3bottom": "botania:model/altar/forest/gobletBase3_bottom", + "gobletstandside": "botania:model/altar/forest/gobletStand_sides", + "gobletstandtopbottom": "botania:model/altar/forest/gobletStand_top_bottom", + "kelkbaseside": "botania:model/altar/forest/kelkBase_sides", + "kelkbasetopbottom": "botania:model/altar/forest/kelkBase_top_bottom", + "kelkbase2side": "botania:model/altar/forest/kelkBase2_sides", + "kelkbase2top": "botania:model/altar/forest/kelkBase2_top", + "kelkbase2bottom": "botania:model/altar/forest/kelkBase2_bottom", + "kelkwall": "botania:model/altar/forest/kelkWall", + "particle": "botania:blocks/biomeStone0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/apothecaries/fungal_apothecary.json b/src/main/resources/assets/botania/models/block/apothecaries/fungal_apothecary.json new file mode 100644 index 000000000..f96590633 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/apothecaries/fungal_apothecary.json @@ -0,0 +1,23 @@ +{ + "parent": "botania:block/shapes/petal_apothecary", + "textures": { + "gobletbaseside": "botania:model/altar/fungal/gobletBase_sides", + "gobletbasetop": "botania:model/altar/fungal/gobletBase_top", + "gobletbasebottom": "botania:model/altar/fungal/gobletBase_bottom", + "gobletbase2side": "botania:model/altar/fungal/gobletBase2_sides", + "gobletbase2top": "botania:model/altar/fungal/gobletBase2_top", + "gobletbase2bottom": "botania:model/altar/fungal/gobletBase2_bottom", + "gobletbase3side": "botania:model/altar/fungal/gobletBase3_sides", + "gobletbase3top": "botania:model/altar/fungal/gobletBase3_top", + "gobletbase3bottom": "botania:model/altar/fungal/gobletBase3_bottom", + "gobletstandside": "botania:model/altar/fungal/gobletStand_sides", + "gobletstandtopbottom": "botania:model/altar/fungal/gobletStand_top_bottom", + "kelkbaseside": "botania:model/altar/fungal/kelkBase_sides", + "kelkbasetopbottom": "botania:model/altar/fungal/kelkBase_top_bottom", + "kelkbase2side": "botania:model/altar/fungal/kelkBase2_sides", + "kelkbase2top": "botania:model/altar/fungal/kelkBase2_top", + "kelkbase2bottom": "botania:model/altar/fungal/kelkBase2_bottom", + "kelkwall": "botania:model/altar/fungal/kelkWall", + "particle": "botania:blocks/biomeStone3" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/apothecaries/mesa_apothecary.json b/src/main/resources/assets/botania/models/block/apothecaries/mesa_apothecary.json new file mode 100644 index 000000000..70b8e6265 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/apothecaries/mesa_apothecary.json @@ -0,0 +1,23 @@ +{ + "parent": "botania:block/shapes/petal_apothecary", + "textures": { + "gobletbaseside": "botania:model/altar/mesa/gobletBase_sides", + "gobletbasetop": "botania:model/altar/mesa/gobletBase_top", + "gobletbasebottom": "botania:model/altar/mesa/gobletBase_bottom", + "gobletbase2side": "botania:model/altar/mesa/gobletBase2_sides", + "gobletbase2top": "botania:model/altar/mesa/gobletBase2_top", + "gobletbase2bottom": "botania:model/altar/mesa/gobletBase2_bottom", + "gobletbase3side": "botania:model/altar/mesa/gobletBase3_sides", + "gobletbase3top": "botania:model/altar/mesa/gobletBase3_top", + "gobletbase3bottom": "botania:model/altar/mesa/gobletBase3_bottom", + "gobletstandside": "botania:model/altar/mesa/gobletStand_sides", + "gobletstandtopbottom": "botania:model/altar/mesa/gobletStand_top_bottom", + "kelkbaseside": "botania:model/altar/mesa/kelkBase_sides", + "kelkbasetopbottom": "botania:model/altar/mesa/kelkBase_top_bottom", + "kelkbase2side": "botania:model/altar/mesa/kelkBase2_sides", + "kelkbase2top": "botania:model/altar/mesa/kelkBase2_top", + "kelkbase2bottom": "botania:model/altar/mesa/kelkBase2_bottom", + "kelkwall": "botania:model/altar/mesa/kelkWall", + "particle": "botania:blocks/biomeStone7" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/apothecaries/mossy_apothecary.json b/src/main/resources/assets/botania/models/block/apothecaries/mossy_apothecary.json new file mode 100644 index 000000000..aec443fe5 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/apothecaries/mossy_apothecary.json @@ -0,0 +1,23 @@ +{ + "parent": "botania:block/shapes/petal_apothecary", + "textures": { + "gobletbaseside": "botania:model/altar/mossy/gobletBase_sides", + "gobletbasetop": "botania:model/altar/mossy/gobletBase_top", + "gobletbasebottom": "botania:model/altar/mossy/gobletBase_bottom", + "gobletbase2side": "botania:model/altar/mossy/gobletBase2_sides", + "gobletbase2top": "botania:model/altar/mossy/gobletBase2_top", + "gobletbase2bottom": "botania:model/altar/mossy/gobletBase2_bottom", + "gobletbase3side": "botania:model/altar/mossy/gobletBase3_sides", + "gobletbase3top": "botania:model/altar/mossy/gobletBase3_top", + "gobletbase3bottom": "botania:model/altar/mossy/gobletBase3_bottom", + "gobletstandside": "botania:model/altar/mossy/gobletStand_sides", + "gobletstandtopbottom": "botania:model/altar/mossy/gobletStand_top_bottom", + "kelkbaseside": "botania:model/altar/mossy/kelkBase_sides", + "kelkbasetopbottom": "botania:model/altar/mossy/kelkBase_top_bottom", + "kelkbase2side": "botania:model/altar/mossy/kelkBase2_sides", + "kelkbase2top": "botania:model/altar/mossy/kelkBase2_top", + "kelkbase2bottom": "botania:model/altar/mossy/kelkBase2_bottom", + "kelkwall": "botania:model/altar/mossy/kelkWall", + "particle": "minecraft:blocks/cobblestone_mossy" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/apothecaries/mountain_apothecary.json b/src/main/resources/assets/botania/models/block/apothecaries/mountain_apothecary.json new file mode 100644 index 000000000..c97c84b44 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/apothecaries/mountain_apothecary.json @@ -0,0 +1,23 @@ +{ + "parent": "botania:block/shapes/petal_apothecary", + "textures": { + "gobletbaseside": "botania:model/altar/mountain/gobletBase_sides", + "gobletbasetop": "botania:model/altar/mountain/gobletBase_top", + "gobletbasebottom": "botania:model/altar/mountain/gobletBase_bottom", + "gobletbase2side": "botania:model/altar/mountain/gobletBase2_sides", + "gobletbase2top": "botania:model/altar/mountain/gobletBase2_top", + "gobletbase2bottom": "botania:model/altar/mountain/gobletBase2_bottom", + "gobletbase3side": "botania:model/altar/mountain/gobletBase3_sides", + "gobletbase3top": "botania:model/altar/mountain/gobletBase3_top", + "gobletbase3bottom": "botania:model/altar/mountain/gobletBase3_bottom", + "gobletstandside": "botania:model/altar/mountain/gobletStand_sides", + "gobletstandtopbottom": "botania:model/altar/mountain/gobletStand_top_bottom", + "kelkbaseside": "botania:model/altar/mountain/kelkBase_sides", + "kelkbasetopbottom": "botania:model/altar/mountain/kelkBase_top_bottom", + "kelkbase2side": "botania:model/altar/mountain/kelkBase2_sides", + "kelkbase2top": "botania:model/altar/mountain/kelkBase2_top", + "kelkbase2bottom": "botania:model/altar/mountain/kelkBase2_bottom", + "kelkwall": "botania:model/altar/mountain/kelkWall", + "particle": "botania:blocks/biomeStone2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/apothecaries/plains_apothecary.json b/src/main/resources/assets/botania/models/block/apothecaries/plains_apothecary.json new file mode 100644 index 000000000..6db37a5e9 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/apothecaries/plains_apothecary.json @@ -0,0 +1,23 @@ +{ + "parent": "botania:block/shapes/petal_apothecary", + "textures": { + "gobletbaseside": "botania:model/altar/plains/gobletBase_sides", + "gobletbasetop": "botania:model/altar/plains/gobletBase_top", + "gobletbasebottom": "botania:model/altar/plains/gobletBase_bottom", + "gobletbase2side": "botania:model/altar/plains/gobletBase2_sides", + "gobletbase2top": "botania:model/altar/plains/gobletBase2_top", + "gobletbase2bottom": "botania:model/altar/plains/gobletBase2_bottom", + "gobletbase3side": "botania:model/altar/plains/gobletBase3_sides", + "gobletbase3top": "botania:model/altar/plains/gobletBase3_top", + "gobletbase3bottom": "botania:model/altar/plains/gobletBase3_bottom", + "gobletstandside": "botania:model/altar/plains/gobletStand_sides", + "gobletstandtopbottom": "botania:model/altar/plains/gobletStand_top_bottom", + "kelkbaseside": "botania:model/altar/plains/kelkBase_sides", + "kelkbasetopbottom": "botania:model/altar/plains/kelkBase_top_bottom", + "kelkbase2side": "botania:model/altar/plains/kelkBase2_sides", + "kelkbase2top": "botania:model/altar/plains/kelkBase2_top", + "kelkbase2bottom": "botania:model/altar/plains/kelkBase2_bottom", + "kelkwall": "botania:model/altar/plains/kelkWall", + "particle": "botania:blocks/biomeStone1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/apothecaries/swamp_apothecary.json b/src/main/resources/assets/botania/models/block/apothecaries/swamp_apothecary.json new file mode 100644 index 000000000..17a0846eb --- /dev/null +++ b/src/main/resources/assets/botania/models/block/apothecaries/swamp_apothecary.json @@ -0,0 +1,23 @@ +{ + "parent": "botania:block/shapes/petal_apothecary", + "textures": { + "gobletbaseside": "botania:model/altar/swamp/gobletBase_sides", + "gobletbasetop": "botania:model/altar/swamp/gobletBase_top", + "gobletbasebottom": "botania:model/altar/swamp/gobletBase_bottom", + "gobletbase2side": "botania:model/altar/swamp/gobletBase2_sides", + "gobletbase2top": "botania:model/altar/swamp/gobletBase2_top", + "gobletbase2bottom": "botania:model/altar/swamp/gobletBase2_bottom", + "gobletbase3side": "botania:model/altar/swamp/gobletBase3_sides", + "gobletbase3top": "botania:model/altar/swamp/gobletBase3_top", + "gobletbase3bottom": "botania:model/altar/swamp/gobletBase3_bottom", + "gobletstandside": "botania:model/altar/swamp/gobletStand_sides", + "gobletstandtopbottom": "botania:model/altar/swamp/gobletStand_top_bottom", + "kelkbaseside": "botania:model/altar/swamp/kelkBase_sides", + "kelkbasetopbottom": "botania:model/altar/swamp/kelkBase_top_bottom", + "kelkbase2side": "botania:model/altar/swamp/kelkBase2_sides", + "kelkbase2top": "botania:model/altar/swamp/kelkBase2_top", + "kelkbase2bottom": "botania:model/altar/swamp/kelkBase2_bottom", + "kelkwall": "botania:model/altar/swamp/kelkWall", + "particle": "botania:blocks/biomeStone4" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/apothecaries/taiga_apothecary.json b/src/main/resources/assets/botania/models/block/apothecaries/taiga_apothecary.json new file mode 100644 index 000000000..cca3fe4af --- /dev/null +++ b/src/main/resources/assets/botania/models/block/apothecaries/taiga_apothecary.json @@ -0,0 +1,23 @@ +{ + "parent": "botania:block/shapes/petal_apothecary", + "textures": { + "gobletbaseside": "botania:model/altar/taiga/gobletBase_sides", + "gobletbasetop": "botania:model/altar/taiga/gobletBase_top", + "gobletbasebottom": "botania:model/altar/taiga/gobletBase_bottom", + "gobletbase2side": "botania:model/altar/taiga/gobletBase2_sides", + "gobletbase2top": "botania:model/altar/taiga/gobletBase2_top", + "gobletbase2bottom": "botania:model/altar/taiga/gobletBase2_bottom", + "gobletbase3side": "botania:model/altar/taiga/gobletBase3_sides", + "gobletbase3top": "botania:model/altar/taiga/gobletBase3_top", + "gobletbase3bottom": "botania:model/altar/taiga/gobletBase3_bottom", + "gobletstandside": "botania:model/altar/taiga/gobletStand_sides", + "gobletstandtopbottom": "botania:model/altar/taiga/gobletStand_top_bottom", + "kelkbaseside": "botania:model/altar/taiga/kelkBase_sides", + "kelkbasetopbottom": "botania:model/altar/taiga/kelkBase_top_bottom", + "kelkbase2side": "botania:model/altar/taiga/kelkBase2_sides", + "kelkbase2top": "botania:model/altar/taiga/kelkBase2_top", + "kelkbase2bottom": "botania:model/altar/taiga/kelkBase2_bottom", + "kelkwall": "botania:model/altar/taiga/kelkWall", + "particle": "botania:blocks/biomeStone6" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/bifrost.json b/src/main/resources/assets/botania/models/block/bifrost.json new file mode 100644 index 000000000..0b68b4f31 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/bifrost.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/bifrost" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/blaze_block.json b/src/main/resources/assets/botania/models/block/blaze_block.json new file mode 100644 index 000000000..876160d68 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/blaze_block.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/blazeBlock" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/bricks/azulejo_1.json b/src/main/resources/assets/botania/models/block/bricks/azulejo_1.json new file mode 100644 index 000000000..511d0e425 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/bricks/azulejo_1.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/customBrick4" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/bricks/azulejo_10.json b/src/main/resources/assets/botania/models/block/bricks/azulejo_10.json new file mode 100644 index 000000000..439ea85f9 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/bricks/azulejo_10.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/customBrick13" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/bricks/azulejo_11.json b/src/main/resources/assets/botania/models/block/bricks/azulejo_11.json new file mode 100644 index 000000000..f18481bf4 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/bricks/azulejo_11.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/customBrick14" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/bricks/azulejo_12.json b/src/main/resources/assets/botania/models/block/bricks/azulejo_12.json new file mode 100644 index 000000000..2273b3f22 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/bricks/azulejo_12.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/customBrick15" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/bricks/azulejo_2.json b/src/main/resources/assets/botania/models/block/bricks/azulejo_2.json new file mode 100644 index 000000000..fe49ac629 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/bricks/azulejo_2.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/customBrick5" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/bricks/azulejo_3.json b/src/main/resources/assets/botania/models/block/bricks/azulejo_3.json new file mode 100644 index 000000000..5a6c70382 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/bricks/azulejo_3.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/customBrick6" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/bricks/azulejo_4.json b/src/main/resources/assets/botania/models/block/bricks/azulejo_4.json new file mode 100644 index 000000000..1edd62f2b --- /dev/null +++ b/src/main/resources/assets/botania/models/block/bricks/azulejo_4.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/customBrick7" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/bricks/azulejo_5.json b/src/main/resources/assets/botania/models/block/bricks/azulejo_5.json new file mode 100644 index 000000000..6895e3bf1 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/bricks/azulejo_5.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/customBrick8" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/bricks/azulejo_6.json b/src/main/resources/assets/botania/models/block/bricks/azulejo_6.json new file mode 100644 index 000000000..fc3546919 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/bricks/azulejo_6.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/customBrick9" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/bricks/azulejo_7.json b/src/main/resources/assets/botania/models/block/bricks/azulejo_7.json new file mode 100644 index 000000000..ab8f0d42f --- /dev/null +++ b/src/main/resources/assets/botania/models/block/bricks/azulejo_7.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/customBrick10" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/bricks/azulejo_8.json b/src/main/resources/assets/botania/models/block/bricks/azulejo_8.json new file mode 100644 index 000000000..361e8f412 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/bricks/azulejo_8.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/customBrick11" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/bricks/azulejo_9.json b/src/main/resources/assets/botania/models/block/bricks/azulejo_9.json new file mode 100644 index 000000000..bfd2a0fa0 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/bricks/azulejo_9.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/customBrick12" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/bricks/frosty_brick.json b/src/main/resources/assets/botania/models/block/bricks/frosty_brick.json new file mode 100644 index 000000000..077d9da0b --- /dev/null +++ b/src/main/resources/assets/botania/models/block/bricks/frosty_brick.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/customBrick2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/bricks/hellish_brick.json b/src/main/resources/assets/botania/models/block/bricks/hellish_brick.json new file mode 100644 index 000000000..ed252dee1 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/bricks/hellish_brick.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/customBrick0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/bricks/roof_tile.json b/src/main/resources/assets/botania/models/block/bricks/roof_tile.json new file mode 100644 index 000000000..4c6cc77d2 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/bricks/roof_tile.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/customBrick3" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/bricks/soul_brick.json b/src/main/resources/assets/botania/models/block/bricks/soul_brick.json new file mode 100644 index 000000000..84795a8d0 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/bricks/soul_brick.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/customBrick1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/cacophonium_block.json b/src/main/resources/assets/botania/models/block/cacophonium_block.json new file mode 100644 index 000000000..ff56dd5a1 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/cacophonium_block.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/cube_bottom_top", + "textures": { + "bottom": "botania:blocks/cacophoniumBlock1", + "top": "botania:blocks/cacophoniumBlock0", + "side": "botania:blocks/cacophoniumBlock1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/cell_block.json b/src/main/resources/assets/botania/models/block/cell_block.json new file mode 100644 index 000000000..622338265 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/cell_block.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/cellBlock" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/cocoon.json b/src/main/resources/assets/botania/models/block/cocoon.json new file mode 100644 index 000000000..1f13c87b4 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/cocoon.json @@ -0,0 +1,27 @@ +{ + "parent": "minecraft:block/block", + "textures": { + "bottom": "botania:model/cocoon_bottom", + "top": "botania:model/cocoon_top", + "north": "botania:model/cocoon_north", + "south": "botania:model/cocoon_south", + "west": "botania:model/cocoon_west", + "east": "botania:model/cocoon_east", + "particle": "botania:model/cocoon_east" + }, + "elements": [ + { + "name": "Cube", + "from": [ 3.0, 0.0, 3.0 ], + "to": [ 13.0, 14.0, 13.0 ], + "faces": { + "west": { "texture": "#west", "uv": [ 3.0, 1.0, 13.0, 15.0 ] }, + "north": { "texture": "#north", "uv": [ 3.0, 1.0, 13.0, 15.0 ] }, + "south": { "texture": "#south", "uv": [ 3.0, 1.0, 13.0, 15.0 ] }, + "east": { "texture": "#east", "uv": [ 3.0, 1.0, 13.0, 15.0 ] }, + "up": { "texture": "#top", "uv": [ 3.0, 3.0, 13.0, 13.0 ] }, + "down": { "texture": "#bottom", "uv": [ 3.0, 3.0, 13.0, 13.0 ], "cullface": "down" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/conjuration_catalyst.json b/src/main/resources/assets/botania/models/block/conjuration_catalyst.json new file mode 100644 index 000000000..9d25fb9aa --- /dev/null +++ b/src/main/resources/assets/botania/models/block/conjuration_catalyst.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/cube_bottom_top", + "textures": { + "bottom": "botania:blocks/conjurationCatalyst0", + "top": "botania:blocks/conjurationCatalyst1", + "side": "botania:blocks/conjurationCatalyst2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/corporea_funnel.json b/src/main/resources/assets/botania/models/block/corporea_funnel.json new file mode 100644 index 000000000..c9d477349 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/corporea_funnel.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/cube_bottom_top", + "textures": { + "bottom": "botania:blocks/corporeaFunnel0", + "top": "botania:blocks/corporeaFunnel0", + "side": "botania:blocks/corporeaFunnel1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/corporea_interceptor.json b/src/main/resources/assets/botania/models/block/corporea_interceptor.json new file mode 100644 index 000000000..ec405725a --- /dev/null +++ b/src/main/resources/assets/botania/models/block/corporea_interceptor.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/cube_bottom_top", + "textures": { + "bottom": "botania:blocks/corporeaInterceptor0", + "top": "botania:blocks/corporeaInterceptor0", + "side": "botania:blocks/corporeaInterceptor1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/corporea_retainer.json b/src/main/resources/assets/botania/models/block/corporea_retainer.json new file mode 100644 index 000000000..c52158a50 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/corporea_retainer.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/corporeaRetainer" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/creative_pool.json b/src/main/resources/assets/botania/models/block/creative_pool.json new file mode 100644 index 000000000..11fa1c65e --- /dev/null +++ b/src/main/resources/assets/botania/models/block/creative_pool.json @@ -0,0 +1,12 @@ +{ + "parent": "botania:block/shapes/pool", + "textures": { + "all": "botania:model/infinitePool" + }, + "overrides": [{ + "predicate": { + "botania:full": 1 + }, + "model": "botania:block/creative_pool_full" + }] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/creative_pool_full.json b/src/main/resources/assets/botania/models/block/creative_pool_full.json new file mode 100644 index 000000000..148cd08fc --- /dev/null +++ b/src/main/resources/assets/botania/models/block/creative_pool_full.json @@ -0,0 +1,7 @@ +{ + "parent": "botania:block/shapes/pool_full", + "textures": { + "all": "botania:model/infinitePool", + "liquid": "botania:blocks/manaWater" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/crystalcube_base.json b/src/main/resources/assets/botania/models/block/crystalcube_base.json new file mode 100644 index 000000000..e14c4f028 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/crystalcube_base.json @@ -0,0 +1,29 @@ +{ + "elements": [ + { + "name": "Stand", + "from": [ 5.0, 0.0, 5.0 ], + "to": [ 11.0, 1.0, 11.0 ], + "faces": { + "west": { "texture": "#stand", "uv": [ 5.0, 7.0, 11.0, 8.0 ] }, + "north": { "texture": "#stand", "uv": [ 5.0, 9.0, 11.0, 10.0 ] }, + "east": { "texture": "#stand", "uv": [ 5.0, 11.0, 11.0, 12.0 ] }, + "south": { "texture": "#stand", "uv": [ 5.0, 13.0, 11.0, 14.0 ] }, + "down": { "texture": "#stand", "uv": [ 8.0, 0.0, 14.0, 6.0 ] } + } + }, + { + "name": "Base", + "from": [ 3.0, 1.0, 3.0 ], + "to": [ 13.0, 5.0, 13.0 ], + "faces": { + "west": { "texture": "#base_sides", "uv": [ 3.0, 0.0, 13.0, 4.0 ] }, + "north": { "texture": "#base_sides", "uv": [ 3.0, 4.0, 13.0, 8.0 ] }, + "east": { "texture": "#base_sides", "uv": [ 3.0, 8.0, 13.0, 12.0 ] }, + "south": { "texture": "#base_sides", "uv": [ 3.0, 12.0, 13.0, 16.0 ] }, + "up": { "texture": "#base_top", "uv": [ 3.0, 3.0, 13.0, 13.0 ] }, + "down": { "texture": "#base_bottom", "uv": [ 3.0, 3.0, 13.0, 13.0 ] } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/crystalcube_cube.json b/src/main/resources/assets/botania/models/block/crystalcube_cube.json new file mode 100644 index 000000000..2dd79d29d --- /dev/null +++ b/src/main/resources/assets/botania/models/block/crystalcube_cube.json @@ -0,0 +1,20 @@ +{ + "textures": { + "particle": "#cube" + }, + "elements": [ + { + "name": "Cube", + "from": [ 4, 4, 4 ], + "to": [ 12, 12, 12 ], + "faces": { + "down": { "texture": "#cube", "uv": [ 4, 4, 12, 12 ] }, + "up": { "texture": "#cube", "uv": [ 4, 4, 12, 12 ] }, + "north": { "texture": "#cube", "uv": [ 4, 4, 12, 12 ] }, + "south": { "texture": "#cube", "uv": [ 4, 4, 12, 12 ] }, + "west": { "texture": "#cube", "uv": [ 4, 4, 12, 12 ] }, + "east": { "texture": "#cube", "uv": [ 4, 4, 12, 12 ] } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/default_pool.json b/src/main/resources/assets/botania/models/block/default_pool.json new file mode 100644 index 000000000..bbb969142 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/default_pool.json @@ -0,0 +1,12 @@ +{ + "parent": "botania:block/shapes/pool", + "textures": { + "all": "botania:model/pool" + }, + "overrides": [{ + "predicate": { + "botania:full": 1 + }, + "model": "botania:block/default_pool_full" + }] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/default_pool_full.json b/src/main/resources/assets/botania/models/block/default_pool_full.json new file mode 100644 index 000000000..615f4d40a --- /dev/null +++ b/src/main/resources/assets/botania/models/block/default_pool_full.json @@ -0,0 +1,7 @@ +{ + "parent": "botania:block/shapes/pool_full", + "textures": { + "all": "botania:model/pool", + "liquid": "botania:blocks/manaWater" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/diluted_pool.json b/src/main/resources/assets/botania/models/block/diluted_pool.json new file mode 100644 index 000000000..43647054d --- /dev/null +++ b/src/main/resources/assets/botania/models/block/diluted_pool.json @@ -0,0 +1,12 @@ +{ + "parent": "botania:block/shapes/pool", + "textures": { + "all": "botania:model/dilutedPool" + }, + "overrides": [{ + "predicate": { + "botania:full": 1 + }, + "model": "botania:block/diluted_pool_full" + }] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/diluted_pool_full.json b/src/main/resources/assets/botania/models/block/diluted_pool_full.json new file mode 100644 index 000000000..c39b6723c --- /dev/null +++ b/src/main/resources/assets/botania/models/block/diluted_pool_full.json @@ -0,0 +1,7 @@ +{ + "parent": "botania:block/shapes/pool_full", + "textures": { + "all": "botania:model/dilutedPool", + "liquid": "botania:blocks/manaWater" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/dragonstone_block.json b/src/main/resources/assets/botania/models/block/dragonstone_block.json new file mode 100644 index 000000000..7d0c130d0 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/dragonstone_block.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/storage4" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/dreamwood.json b/src/main/resources/assets/botania/models/block/dreamwood.json new file mode 100644 index 000000000..1d25e2f2b --- /dev/null +++ b/src/main/resources/assets/botania/models/block/dreamwood.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/dreamwood0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/dreamwood_framed.json b/src/main/resources/assets/botania/models/block/dreamwood_framed.json new file mode 100644 index 000000000..9bf55e6fa --- /dev/null +++ b/src/main/resources/assets/botania/models/block/dreamwood_framed.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/dreamwood3" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/dreamwood_glimmering.json b/src/main/resources/assets/botania/models/block/dreamwood_glimmering.json new file mode 100644 index 000000000..ef67451a3 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/dreamwood_glimmering.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/dreamwood5" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/dreamwood_mossy_planks.json b/src/main/resources/assets/botania/models/block/dreamwood_mossy_planks.json new file mode 100644 index 000000000..001f16c72 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/dreamwood_mossy_planks.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/dreamwood2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/dreamwood_pattern_framed.json b/src/main/resources/assets/botania/models/block/dreamwood_pattern_framed.json new file mode 100644 index 000000000..58c91a044 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/dreamwood_pattern_framed.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/dreamwood4" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/dreamwood_planks.json b/src/main/resources/assets/botania/models/block/dreamwood_planks.json new file mode 100644 index 000000000..928789553 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/dreamwood_planks.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/dreamwood1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/drum_canopy.json b/src/main/resources/assets/botania/models/block/drum_canopy.json new file mode 100644 index 000000000..24d215ac8 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/drum_canopy.json @@ -0,0 +1,7 @@ +{ + "parent": "botania:block/shapes/drum", + "textures": { + "top": "botania:blocks/forestDrum4", + "side": "botania:blocks/forestDrum5" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/drum_gathering.json b/src/main/resources/assets/botania/models/block/drum_gathering.json new file mode 100644 index 000000000..59c45b760 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/drum_gathering.json @@ -0,0 +1,7 @@ +{ + "parent": "botania:block/shapes/drum", + "textures": { + "top": "botania:blocks/forestDrum2", + "side": "botania:blocks/forestDrum3" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/drum_wild.json b/src/main/resources/assets/botania/models/block/drum_wild.json new file mode 100644 index 000000000..14f676eb8 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/drum_wild.json @@ -0,0 +1,7 @@ +{ + "parent": "botania:block/shapes/drum", + "textures": { + "top": "botania:blocks/forestDrum0", + "side": "botania:blocks/forestDrum1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/dry_grass.json b/src/main/resources/assets/botania/models/block/dry_grass.json new file mode 100644 index 000000000..f61bfde5f --- /dev/null +++ b/src/main/resources/assets/botania/models/block/dry_grass.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/cube_bottom_top", + "textures": { + "bottom": "minecraft:blocks/dirt", + "top": "botania:blocks/altGrass0", + "side": "botania:blocks/altGrass1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/dummy.json b/src/main/resources/assets/botania/models/block/dummy.json new file mode 100644 index 000000000..2a4f56dc6 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/dummy.json @@ -0,0 +1,12 @@ +{ + "__comment": "Dummy for TESRS that still want to set their block break particle without using code", + "elements": [ + { + "from": [0, 0, 0], + "to": [0, 0, 0], + "faces": { + "up": { "uv": [ 0, 0, 0, 0 ], "texture": "dummythatwillnevergetrendered" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/elementium_block.json b/src/main/resources/assets/botania/models/block/elementium_block.json new file mode 100644 index 000000000..a55282f38 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/elementium_block.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/storage2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/elven_spreader.json b/src/main/resources/assets/botania/models/block/elven_spreader.json new file mode 100644 index 000000000..643dfa0c9 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/elven_spreader.json @@ -0,0 +1,8 @@ +{ + "parent": "botania:block/shapes/spreader", + "textures": { + "inside": "botania:model/spreader_item/elven_inside", + "side": "botania:model/spreader_item/elven_side", + "material": "botania:blocks/dreamwood0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/enchanted_soil.json b/src/main/resources/assets/botania/models/block/enchanted_soil.json new file mode 100644 index 000000000..94d0bc551 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/enchanted_soil.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/cube_bottom_top", + "textures": { + "bottom": "minecraft:blocks/dirt", + "top": "botania:blocks/enchantedSoil0", + "side": "botania:blocks/enchantedSoil1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/ender_eye_block.json b/src/main/resources/assets/botania/models/block/ender_eye_block.json new file mode 100644 index 000000000..ece4ad790 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/ender_eye_block.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/enderEyeBlock0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/ender_eye_block_powered.json b/src/main/resources/assets/botania/models/block/ender_eye_block_powered.json new file mode 100644 index 000000000..21db23bae --- /dev/null +++ b/src/main/resources/assets/botania/models/block/ender_eye_block_powered.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/enderEyeBlock1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/eye_of_ancients.json b/src/main/resources/assets/botania/models/block/eye_of_ancients.json new file mode 100644 index 000000000..57b92028c --- /dev/null +++ b/src/main/resources/assets/botania/models/block/eye_of_ancients.json @@ -0,0 +1,11 @@ +{ + "parent": "botania:block/shapes/eightbyeight", + "textures": { + "bottom": "botania:blocks/forestEye0", + "top": "botania:blocks/forestEye1", + "north": "botania:blocks/forestEye2", + "south": "botania:blocks/forestEye3", + "west": "botania:blocks/forestEye4", + "east": "botania:blocks/forestEye5" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/fabulous_pool.json b/src/main/resources/assets/botania/models/block/fabulous_pool.json new file mode 100644 index 000000000..8ae898e5b --- /dev/null +++ b/src/main/resources/assets/botania/models/block/fabulous_pool.json @@ -0,0 +1,12 @@ +{ + "parent": "botania:block/shapes/pool", + "textures": { + "all": "botania:model/pool" + }, + "overrides": [{ + "predicate": { + "botania:full": 1 + }, + "model": "botania:block/fabulous_pool_full" + }] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/fabulous_pool_full.json b/src/main/resources/assets/botania/models/block/fabulous_pool_full.json new file mode 100644 index 000000000..615f4d40a --- /dev/null +++ b/src/main/resources/assets/botania/models/block/fabulous_pool_full.json @@ -0,0 +1,7 @@ +{ + "parent": "botania:block/shapes/pool_full", + "textures": { + "all": "botania:model/pool", + "liquid": "botania:blocks/manaWater" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/fel_pumpkin.json b/src/main/resources/assets/botania/models/block/fel_pumpkin.json new file mode 100644 index 000000000..8d46f4eb2 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/fel_pumpkin.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/orientable", + "textures": { + "top": "minecraft:blocks/pumpkin_top", + "front": "botania:blocks/felPumpkin", + "side": "minecraft:blocks/pumpkin_side" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/force_relay.json b/src/main/resources/assets/botania/models/block/force_relay.json new file mode 100644 index 000000000..e26dd6888 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/force_relay.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/pistonRelay" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/gaia_spreader.json b/src/main/resources/assets/botania/models/block/gaia_spreader.json new file mode 100644 index 000000000..705ca1e5e --- /dev/null +++ b/src/main/resources/assets/botania/models/block/gaia_spreader.json @@ -0,0 +1,8 @@ +{ + "parent": "botania:block/shapes/spreader", + "textures": { + "inside": "botania:model/spreader_item/gaia_inside", + "side": "botania:model/spreader_item/gaia_side", + "material": "botania:blocks/dreamwood0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/golden_grass.json b/src/main/resources/assets/botania/models/block/golden_grass.json new file mode 100644 index 000000000..8cb20c191 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/golden_grass.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/cube_bottom_top", + "textures": { + "bottom": "minecraft:blocks/dirt", + "top": "botania:blocks/altGrass2", + "side": "botania:blocks/altGrass3" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/incense_plate.json b/src/main/resources/assets/botania/models/block/incense_plate.json new file mode 100644 index 000000000..dc050fc94 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/incense_plate.json @@ -0,0 +1,35 @@ +{ + "parent": "minecraft:block/block", + "textures": { + "all": "botania:model/incensePlate", + "particle": "botania:model/incensePlate" + }, + "elements": [ + { + "name": "Plate", + "from": [ 2.0, 0.0, 6.0 ], + "to": [ 14.0, 1.0, 10.0 ], + "faces": { + "west": { "texture": "#all", "uv": [ 0.0, 2.0, 2.0, 2.5 ] }, + "north": { "texture": "#all", "uv": [ 2.0, 2.0, 8.0, 2.5 ] }, + "south": { "texture": "#all", "uv": [ 8.0, 2.0, 14.0, 2.5 ] }, + "east": { "texture": "#all", "uv": [ 14.0, 2.0, 16.0, 2.5 ] }, + "up": { "texture": "#all", "uv": [ 2.0, 0.0, 8.0, 2.0 ] }, + "down": { "texture": "#all", "uv": [ 8.0, 0.0, 14.0, 2.0 ], "cullface": "down" } + } + }, + { + "name": "High", + "from": [ 2.0, 1.0, 6.0 ], + "to": [ 5.0, 2.0, 10.0 ], + "faces": { + "west": { "texture": "#all", "uv": [ 0.0, 5.0, 2.0, 5.5 ] }, + "north": { "texture": "#all", "uv": [ 2.0, 5.0, 3.5, 5.5 ] }, + "south": { "texture": "#all", "uv": [ 3.5, 5.0, 5.0, 5.5 ] }, + "east": { "texture": "#all", "uv": [ 5.0, 5.0, 7.0, 5.5 ] }, + "up": { "texture": "#all", "uv": [ 2.0, 3.0, 3.5, 5.0 ] }, + "down": { "texture": "#all", "uv": [ 3.5, 3.0, 5.0, 5.0 ] } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/infrangible_platform.json b/src/main/resources/assets/botania/models/block/infrangible_platform.json new file mode 100644 index 000000000..090087bbe --- /dev/null +++ b/src/main/resources/assets/botania/models/block/infrangible_platform.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/platform2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/infused_grass.json b/src/main/resources/assets/botania/models/block/infused_grass.json new file mode 100644 index 000000000..07a8c64d4 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/infused_grass.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/cube_bottom_top", + "textures": { + "bottom": "minecraft:blocks/dirt", + "top": "botania:blocks/altGrass8", + "side": "botania:blocks/altGrass9" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/islands/island_dry.json b/src/main/resources/assets/botania/models/block/islands/island_dry.json new file mode 100644 index 000000000..a60bc0c75 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/islands/island_dry.json @@ -0,0 +1,6 @@ +{ + "parent": "botania:block/shapes/miniIsland", + "textures": { + "all": "botania:model/miniIslandDry" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/islands/island_golden.json b/src/main/resources/assets/botania/models/block/islands/island_golden.json new file mode 100644 index 000000000..18cddf27b --- /dev/null +++ b/src/main/resources/assets/botania/models/block/islands/island_golden.json @@ -0,0 +1,6 @@ +{ + "parent": "botania:block/shapes/miniIsland", + "textures": { + "all": "botania:model/miniIslandGolden" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/islands/island_grass.json b/src/main/resources/assets/botania/models/block/islands/island_grass.json new file mode 100644 index 000000000..df50a2333 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/islands/island_grass.json @@ -0,0 +1,6 @@ +{ + "parent": "botania:block/shapes/miniIsland", + "textures": { + "all": "botania:model/miniIsland" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/islands/island_infused.json b/src/main/resources/assets/botania/models/block/islands/island_infused.json new file mode 100644 index 000000000..7af091d6e --- /dev/null +++ b/src/main/resources/assets/botania/models/block/islands/island_infused.json @@ -0,0 +1,6 @@ +{ + "parent": "botania:block/shapes/miniIsland", + "textures": { + "all": "botania:model/miniIslandInfused" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/islands/island_mutated.json b/src/main/resources/assets/botania/models/block/islands/island_mutated.json new file mode 100644 index 000000000..eafb2b9da --- /dev/null +++ b/src/main/resources/assets/botania/models/block/islands/island_mutated.json @@ -0,0 +1,6 @@ +{ + "parent": "botania:block/shapes/miniIsland", + "textures": { + "all": "botania:model/miniIslandMutated" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/islands/island_mycel.json b/src/main/resources/assets/botania/models/block/islands/island_mycel.json new file mode 100644 index 000000000..245c73e6f --- /dev/null +++ b/src/main/resources/assets/botania/models/block/islands/island_mycel.json @@ -0,0 +1,6 @@ +{ + "parent": "botania:block/shapes/miniIsland", + "textures": { + "all": "botania:model/miniIslandMycelium" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/islands/island_podzol.json b/src/main/resources/assets/botania/models/block/islands/island_podzol.json new file mode 100644 index 000000000..34511f2dd --- /dev/null +++ b/src/main/resources/assets/botania/models/block/islands/island_podzol.json @@ -0,0 +1,6 @@ +{ + "parent": "botania:block/shapes/miniIsland", + "textures": { + "all": "botania:model/miniIslandPodzol" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/islands/island_scorched.json b/src/main/resources/assets/botania/models/block/islands/island_scorched.json new file mode 100644 index 000000000..80528be96 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/islands/island_scorched.json @@ -0,0 +1,6 @@ +{ + "parent": "botania:block/shapes/miniIsland", + "textures": { + "all": "botania:model/miniIslandScorched" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/islands/island_snow.json b/src/main/resources/assets/botania/models/block/islands/island_snow.json new file mode 100644 index 000000000..ab71f1390 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/islands/island_snow.json @@ -0,0 +1,6 @@ +{ + "parent": "botania:block/shapes/miniIsland", + "textures": { + "all": "botania:model/miniIslandSnow" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/islands/island_vivid.json b/src/main/resources/assets/botania/models/block/islands/island_vivid.json new file mode 100644 index 000000000..1e1a3f652 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/islands/island_vivid.json @@ -0,0 +1,6 @@ +{ + "parent": "botania:block/shapes/miniIsland", + "textures": { + "all": "botania:model/miniIslandVivid" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/life_imbuer.json b/src/main/resources/assets/botania/models/block/life_imbuer.json new file mode 100644 index 000000000..83a5becdc --- /dev/null +++ b/src/main/resources/assets/botania/models/block/life_imbuer.json @@ -0,0 +1,6 @@ +{ + "parent": "botania:block/shapes/claw", + "textures": { + "all": "botania:model/spawnerClaw" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/livingrock.json b/src/main/resources/assets/botania/models/block/livingrock.json new file mode 100644 index 000000000..9a8786117 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/livingrock.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/livingrock0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/livingrock_brick.json b/src/main/resources/assets/botania/models/block/livingrock_brick.json new file mode 100644 index 000000000..c79412d70 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/livingrock_brick.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/livingrock1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/livingrock_chiseled_brick.json b/src/main/resources/assets/botania/models/block/livingrock_chiseled_brick.json new file mode 100644 index 000000000..07ee851a4 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/livingrock_chiseled_brick.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/livingrock4" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/livingrock_cracked_brick.json b/src/main/resources/assets/botania/models/block/livingrock_cracked_brick.json new file mode 100644 index 000000000..8b4cafa2c --- /dev/null +++ b/src/main/resources/assets/botania/models/block/livingrock_cracked_brick.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/livingrock3" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/livingrock_mossy_brick.json b/src/main/resources/assets/botania/models/block/livingrock_mossy_brick.json new file mode 100644 index 000000000..bd6a802c2 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/livingrock_mossy_brick.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/livingrock2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/livingwood.json b/src/main/resources/assets/botania/models/block/livingwood.json new file mode 100644 index 000000000..0a8062fd9 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/livingwood.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/livingwood0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/livingwood_framed.json b/src/main/resources/assets/botania/models/block/livingwood_framed.json new file mode 100644 index 000000000..67ad48c5f --- /dev/null +++ b/src/main/resources/assets/botania/models/block/livingwood_framed.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/livingwood3" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/livingwood_glimmering.json b/src/main/resources/assets/botania/models/block/livingwood_glimmering.json new file mode 100644 index 000000000..3f76a6831 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/livingwood_glimmering.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/livingwood5" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/livingwood_mossy_planks.json b/src/main/resources/assets/botania/models/block/livingwood_mossy_planks.json new file mode 100644 index 000000000..88b9f8d3e --- /dev/null +++ b/src/main/resources/assets/botania/models/block/livingwood_mossy_planks.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/livingwood2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/livingwood_pattern_framed.json b/src/main/resources/assets/botania/models/block/livingwood_pattern_framed.json new file mode 100644 index 000000000..a3edcc34f --- /dev/null +++ b/src/main/resources/assets/botania/models/block/livingwood_pattern_framed.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/livingwood4" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/livingwood_planks.json b/src/main/resources/assets/botania/models/block/livingwood_planks.json new file mode 100644 index 000000000..ff95b9ae9 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/livingwood_planks.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/livingwood1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/luminizer_launcher.json b/src/main/resources/assets/botania/models/block/luminizer_launcher.json new file mode 100644 index 000000000..9d87e408b --- /dev/null +++ b/src/main/resources/assets/botania/models/block/luminizer_launcher.json @@ -0,0 +1,8 @@ +{ + "parent": "botania:block/shapes/four_high_bottom_top", + "textures": { + "bottom": "botania:blocks/lightLauncher", + "top": "botania:blocks/lightLauncher", + "side": "botania:blocks/lightLauncher" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/mana_detector.json b/src/main/resources/assets/botania/models/block/mana_detector.json new file mode 100644 index 000000000..4ddc0f74a --- /dev/null +++ b/src/main/resources/assets/botania/models/block/mana_detector.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/manaDetector0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/mana_detector_powered.json b/src/main/resources/assets/botania/models/block/mana_detector_powered.json new file mode 100644 index 000000000..3af9228ba --- /dev/null +++ b/src/main/resources/assets/botania/models/block/mana_detector_powered.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/manaDetector1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/mana_diamond_block.json b/src/main/resources/assets/botania/models/block/mana_diamond_block.json new file mode 100644 index 000000000..4a875189b --- /dev/null +++ b/src/main/resources/assets/botania/models/block/mana_diamond_block.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/storage3" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/mana_distributor.json b/src/main/resources/assets/botania/models/block/mana_distributor.json new file mode 100644 index 000000000..49a795162 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/mana_distributor.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/cube_bottom_top", + "textures": { + "top": "botania:blocks/distributor0", + "side": "botania:blocks/distributor1", + "bottom": "botania:blocks/livingrock0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/mana_enchanter.json b/src/main/resources/assets/botania/models/block/mana_enchanter.json new file mode 100644 index 000000000..3c8590ff9 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/mana_enchanter.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/enchanter" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/mana_fluxfield.json b/src/main/resources/assets/botania/models/block/mana_fluxfield.json new file mode 100644 index 000000000..9423529e7 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/mana_fluxfield.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/rfGenerator" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/mana_glass.json b/src/main/resources/assets/botania/models/block/mana_glass.json new file mode 100644 index 000000000..dc3338aa9 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/mana_glass.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/manaGlass" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/mana_spreader.json b/src/main/resources/assets/botania/models/block/mana_spreader.json new file mode 100644 index 000000000..fbbc73c95 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/mana_spreader.json @@ -0,0 +1,8 @@ +{ + "parent": "botania:block/shapes/spreader", + "textures": { + "inside": "botania:model/spreader_item/mana_inside", + "side": "botania:model/spreader_item/mana_side", + "material": "botania:blocks/livingwood0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/mana_void.json b/src/main/resources/assets/botania/models/block/mana_void.json new file mode 100644 index 000000000..402d24915 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/mana_void.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/manaVoid0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/manasteel_block.json b/src/main/resources/assets/botania/models/block/manasteel_block.json new file mode 100644 index 000000000..bdb8f0a68 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/manasteel_block.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/storage0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/manastorm_charge.json b/src/main/resources/assets/botania/models/block/manastorm_charge.json new file mode 100644 index 000000000..3cc4fdce3 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/manastorm_charge.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/manaBomb" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/metamorphic/desert_brick.json b/src/main/resources/assets/botania/models/block/metamorphic/desert_brick.json new file mode 100644 index 000000000..d3f6257f1 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/metamorphic/desert_brick.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/biomeStone21" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/metamorphic/desert_brick_chiseled.json b/src/main/resources/assets/botania/models/block/metamorphic/desert_brick_chiseled.json new file mode 100644 index 000000000..d72dc70c7 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/metamorphic/desert_brick_chiseled.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/biomeStone29" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/metamorphic/desert_cobble_stone.json b/src/main/resources/assets/botania/models/block/metamorphic/desert_cobble_stone.json new file mode 100644 index 000000000..d649c97d1 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/metamorphic/desert_cobble_stone.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/biomeStone13" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/metamorphic/desert_stone.json b/src/main/resources/assets/botania/models/block/metamorphic/desert_stone.json new file mode 100644 index 000000000..d67da6739 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/metamorphic/desert_stone.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/biomeStone5" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/metamorphic/forest_brick.json b/src/main/resources/assets/botania/models/block/metamorphic/forest_brick.json new file mode 100644 index 000000000..7dbbaf74c --- /dev/null +++ b/src/main/resources/assets/botania/models/block/metamorphic/forest_brick.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/biomeStone16" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/metamorphic/forest_brick_chiseled.json b/src/main/resources/assets/botania/models/block/metamorphic/forest_brick_chiseled.json new file mode 100644 index 000000000..23e27a7e2 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/metamorphic/forest_brick_chiseled.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/biomeStone24" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/metamorphic/forest_cobble_stone.json b/src/main/resources/assets/botania/models/block/metamorphic/forest_cobble_stone.json new file mode 100644 index 000000000..8bfba3dd5 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/metamorphic/forest_cobble_stone.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/biomeStone8" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/metamorphic/forest_stone.json b/src/main/resources/assets/botania/models/block/metamorphic/forest_stone.json new file mode 100644 index 000000000..c749b11af --- /dev/null +++ b/src/main/resources/assets/botania/models/block/metamorphic/forest_stone.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/biomeStone0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/metamorphic/fungal_brick.json b/src/main/resources/assets/botania/models/block/metamorphic/fungal_brick.json new file mode 100644 index 000000000..69550fe61 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/metamorphic/fungal_brick.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/biomeStone19" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/metamorphic/fungal_brick_chiseled.json b/src/main/resources/assets/botania/models/block/metamorphic/fungal_brick_chiseled.json new file mode 100644 index 000000000..3cc15bf6f --- /dev/null +++ b/src/main/resources/assets/botania/models/block/metamorphic/fungal_brick_chiseled.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/biomeStone27" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/metamorphic/fungal_cobble_stone.json b/src/main/resources/assets/botania/models/block/metamorphic/fungal_cobble_stone.json new file mode 100644 index 000000000..5cb950824 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/metamorphic/fungal_cobble_stone.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/biomeStone11" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/metamorphic/fungal_stone.json b/src/main/resources/assets/botania/models/block/metamorphic/fungal_stone.json new file mode 100644 index 000000000..68dd2e184 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/metamorphic/fungal_stone.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/biomeStone3" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/metamorphic/mesa_brick.json b/src/main/resources/assets/botania/models/block/metamorphic/mesa_brick.json new file mode 100644 index 000000000..baaa34b53 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/metamorphic/mesa_brick.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/biomeStone23" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/metamorphic/mesa_brick_chiseled.json b/src/main/resources/assets/botania/models/block/metamorphic/mesa_brick_chiseled.json new file mode 100644 index 000000000..4df5848c3 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/metamorphic/mesa_brick_chiseled.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/biomeStone31" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/metamorphic/mesa_cobble_stone.json b/src/main/resources/assets/botania/models/block/metamorphic/mesa_cobble_stone.json new file mode 100644 index 000000000..f97bdd014 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/metamorphic/mesa_cobble_stone.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/biomeStone15" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/metamorphic/mesa_stone.json b/src/main/resources/assets/botania/models/block/metamorphic/mesa_stone.json new file mode 100644 index 000000000..98b5666ab --- /dev/null +++ b/src/main/resources/assets/botania/models/block/metamorphic/mesa_stone.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/biomeStone7" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/metamorphic/mountain_brick.json b/src/main/resources/assets/botania/models/block/metamorphic/mountain_brick.json new file mode 100644 index 000000000..e7ec9c31f --- /dev/null +++ b/src/main/resources/assets/botania/models/block/metamorphic/mountain_brick.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/biomeStone18" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/metamorphic/mountain_brick_chiseled.json b/src/main/resources/assets/botania/models/block/metamorphic/mountain_brick_chiseled.json new file mode 100644 index 000000000..b3b170ce0 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/metamorphic/mountain_brick_chiseled.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/biomeStone26" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/metamorphic/mountain_cobble_stone.json b/src/main/resources/assets/botania/models/block/metamorphic/mountain_cobble_stone.json new file mode 100644 index 000000000..a8af764c3 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/metamorphic/mountain_cobble_stone.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/biomeStone10" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/metamorphic/mountain_stone.json b/src/main/resources/assets/botania/models/block/metamorphic/mountain_stone.json new file mode 100644 index 000000000..3ef66eaea --- /dev/null +++ b/src/main/resources/assets/botania/models/block/metamorphic/mountain_stone.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/biomeStone2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/metamorphic/plains_brick.json b/src/main/resources/assets/botania/models/block/metamorphic/plains_brick.json new file mode 100644 index 000000000..12fb32f4a --- /dev/null +++ b/src/main/resources/assets/botania/models/block/metamorphic/plains_brick.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/biomeStone17" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/metamorphic/plains_brick_chiseled.json b/src/main/resources/assets/botania/models/block/metamorphic/plains_brick_chiseled.json new file mode 100644 index 000000000..664cc97d8 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/metamorphic/plains_brick_chiseled.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/biomeStone25" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/metamorphic/plains_cobble_stone.json b/src/main/resources/assets/botania/models/block/metamorphic/plains_cobble_stone.json new file mode 100644 index 000000000..e102ce939 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/metamorphic/plains_cobble_stone.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/biomeStone9" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/metamorphic/plains_stone.json b/src/main/resources/assets/botania/models/block/metamorphic/plains_stone.json new file mode 100644 index 000000000..2f8758753 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/metamorphic/plains_stone.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/biomeStone1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/metamorphic/swamp_brick.json b/src/main/resources/assets/botania/models/block/metamorphic/swamp_brick.json new file mode 100644 index 000000000..c8a878f5e --- /dev/null +++ b/src/main/resources/assets/botania/models/block/metamorphic/swamp_brick.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/biomeStone20" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/metamorphic/swamp_brick_chiseled.json b/src/main/resources/assets/botania/models/block/metamorphic/swamp_brick_chiseled.json new file mode 100644 index 000000000..6fc624583 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/metamorphic/swamp_brick_chiseled.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/biomeStone28" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/metamorphic/swamp_cobble_stone.json b/src/main/resources/assets/botania/models/block/metamorphic/swamp_cobble_stone.json new file mode 100644 index 000000000..5bf0c567d --- /dev/null +++ b/src/main/resources/assets/botania/models/block/metamorphic/swamp_cobble_stone.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/biomeStone12" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/metamorphic/swamp_stone.json b/src/main/resources/assets/botania/models/block/metamorphic/swamp_stone.json new file mode 100644 index 000000000..67f6676df --- /dev/null +++ b/src/main/resources/assets/botania/models/block/metamorphic/swamp_stone.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/biomeStone4" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/metamorphic/taiga_brick.json b/src/main/resources/assets/botania/models/block/metamorphic/taiga_brick.json new file mode 100644 index 000000000..2e56f6e9b --- /dev/null +++ b/src/main/resources/assets/botania/models/block/metamorphic/taiga_brick.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/biomeStone22" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/metamorphic/taiga_brick_chiseled.json b/src/main/resources/assets/botania/models/block/metamorphic/taiga_brick_chiseled.json new file mode 100644 index 000000000..341449e07 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/metamorphic/taiga_brick_chiseled.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/biomeStone30" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/metamorphic/taiga_cobble_stone.json b/src/main/resources/assets/botania/models/block/metamorphic/taiga_cobble_stone.json new file mode 100644 index 000000000..87d553f31 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/metamorphic/taiga_cobble_stone.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/biomeStone14" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/metamorphic/taiga_stone.json b/src/main/resources/assets/botania/models/block/metamorphic/taiga_stone.json new file mode 100644 index 000000000..b5817f427 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/metamorphic/taiga_stone.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/biomeStone6" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/mutated_grass.json b/src/main/resources/assets/botania/models/block/mutated_grass.json new file mode 100644 index 000000000..fa6af5245 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/mutated_grass.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/cube_bottom_top", + "textures": { + "bottom": "minecraft:blocks/dirt", + "top": "botania:blocks/altGrass10", + "side": "botania:blocks/altGrass11" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/pavement/black_pavement.json b/src/main/resources/assets/botania/models/block/pavement/black_pavement.json new file mode 100644 index 000000000..beaa676a5 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/pavement/black_pavement.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/pavement1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/pavement/blue_pavement.json b/src/main/resources/assets/botania/models/block/pavement/blue_pavement.json new file mode 100644 index 000000000..aa1c83e8e --- /dev/null +++ b/src/main/resources/assets/botania/models/block/pavement/blue_pavement.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/pavement2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/pavement/green_pavement.json b/src/main/resources/assets/botania/models/block/pavement/green_pavement.json new file mode 100644 index 000000000..4d1b4f975 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/pavement/green_pavement.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/pavement5" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/pavement/red_pavement.json b/src/main/resources/assets/botania/models/block/pavement/red_pavement.json new file mode 100644 index 000000000..d96285ecd --- /dev/null +++ b/src/main/resources/assets/botania/models/block/pavement/red_pavement.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/pavement3" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/pavement/white_pavement.json b/src/main/resources/assets/botania/models/block/pavement/white_pavement.json new file mode 100644 index 000000000..f940e09bd --- /dev/null +++ b/src/main/resources/assets/botania/models/block/pavement/white_pavement.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/pavement0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/pavement/yellow_pavement.json b/src/main/resources/assets/botania/models/block/pavement/yellow_pavement.json new file mode 100644 index 000000000..317e9af1c --- /dev/null +++ b/src/main/resources/assets/botania/models/block/pavement/yellow_pavement.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/pavement4" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/petal_block.json b/src/main/resources/assets/botania/models/block/petal_block.json new file mode 100644 index 000000000..6f010e3f9 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/petal_block.json @@ -0,0 +1,6 @@ +{ + "parent": "botania:block/shapes/cube_all_tinted", + "textures": { + "all": "botania:blocks/petalBlock" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/flower_black.json b/src/main/resources/assets/botania/models/block/plants/flower_black.json new file mode 100644 index 000000000..aac7f8f8c --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/flower_black.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/flower15" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/flower_blue.json b/src/main/resources/assets/botania/models/block/plants/flower_blue.json new file mode 100644 index 000000000..f93a12fe1 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/flower_blue.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/flower11" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/flower_brown.json b/src/main/resources/assets/botania/models/block/plants/flower_brown.json new file mode 100644 index 000000000..cb5ca8c28 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/flower_brown.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/flower12" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/flower_cyan.json b/src/main/resources/assets/botania/models/block/plants/flower_cyan.json new file mode 100644 index 000000000..c6d9c7de8 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/flower_cyan.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/flower9" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/flower_gray.json b/src/main/resources/assets/botania/models/block/plants/flower_gray.json new file mode 100644 index 000000000..e5881a183 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/flower_gray.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/flower7" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/flower_green.json b/src/main/resources/assets/botania/models/block/plants/flower_green.json new file mode 100644 index 000000000..ddcaf49c8 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/flower_green.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/flower13" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/flower_light_blue.json b/src/main/resources/assets/botania/models/block/plants/flower_light_blue.json new file mode 100644 index 000000000..b2a7a9141 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/flower_light_blue.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/flower3" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/flower_lime.json b/src/main/resources/assets/botania/models/block/plants/flower_lime.json new file mode 100644 index 000000000..45daff76a --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/flower_lime.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/flower5" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/flower_magenta.json b/src/main/resources/assets/botania/models/block/plants/flower_magenta.json new file mode 100644 index 000000000..10c32215d --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/flower_magenta.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/flower2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/flower_orange.json b/src/main/resources/assets/botania/models/block/plants/flower_orange.json new file mode 100644 index 000000000..794cac4f5 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/flower_orange.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/flower1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/flower_pink.json b/src/main/resources/assets/botania/models/block/plants/flower_pink.json new file mode 100644 index 000000000..312f10937 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/flower_pink.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/flower6" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/flower_purple.json b/src/main/resources/assets/botania/models/block/plants/flower_purple.json new file mode 100644 index 000000000..76fe63787 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/flower_purple.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/flower10" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/flower_red.json b/src/main/resources/assets/botania/models/block/plants/flower_red.json new file mode 100644 index 000000000..48120da38 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/flower_red.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/flower14" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/flower_silver.json b/src/main/resources/assets/botania/models/block/plants/flower_silver.json new file mode 100644 index 000000000..2395dd225 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/flower_silver.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/flower8" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/flower_white.json b/src/main/resources/assets/botania/models/block/plants/flower_white.json new file mode 100644 index 000000000..73c03fdcd --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/flower_white.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/flower0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/flower_yellow.json b/src/main/resources/assets/botania/models/block/plants/flower_yellow.json new file mode 100644 index 000000000..759579f96 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/flower_yellow.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/flower4" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/glimmering_flower_black.json b/src/main/resources/assets/botania/models/block/plants/glimmering_flower_black.json new file mode 100644 index 000000000..3bded4905 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/glimmering_flower_black.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/flowerGlimmering15" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/glimmering_flower_blue.json b/src/main/resources/assets/botania/models/block/plants/glimmering_flower_blue.json new file mode 100644 index 000000000..fdbfff359 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/glimmering_flower_blue.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/flowerGlimmering11" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/glimmering_flower_brown.json b/src/main/resources/assets/botania/models/block/plants/glimmering_flower_brown.json new file mode 100644 index 000000000..3bb133d50 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/glimmering_flower_brown.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/flowerGlimmering12" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/glimmering_flower_cyan.json b/src/main/resources/assets/botania/models/block/plants/glimmering_flower_cyan.json new file mode 100644 index 000000000..77a701a1b --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/glimmering_flower_cyan.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/flowerGlimmering9" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/glimmering_flower_gray.json b/src/main/resources/assets/botania/models/block/plants/glimmering_flower_gray.json new file mode 100644 index 000000000..29fe5c73f --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/glimmering_flower_gray.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/flowerGlimmering7" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/glimmering_flower_green.json b/src/main/resources/assets/botania/models/block/plants/glimmering_flower_green.json new file mode 100644 index 000000000..22d92ffbf --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/glimmering_flower_green.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/flowerGlimmering13" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/glimmering_flower_light_blue.json b/src/main/resources/assets/botania/models/block/plants/glimmering_flower_light_blue.json new file mode 100644 index 000000000..89490999c --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/glimmering_flower_light_blue.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/flowerGlimmering3" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/glimmering_flower_lime.json b/src/main/resources/assets/botania/models/block/plants/glimmering_flower_lime.json new file mode 100644 index 000000000..07862b0a3 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/glimmering_flower_lime.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/flowerGlimmering5" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/glimmering_flower_magenta.json b/src/main/resources/assets/botania/models/block/plants/glimmering_flower_magenta.json new file mode 100644 index 000000000..f20cc0e84 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/glimmering_flower_magenta.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/flowerGlimmering2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/glimmering_flower_orange.json b/src/main/resources/assets/botania/models/block/plants/glimmering_flower_orange.json new file mode 100644 index 000000000..05a56031a --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/glimmering_flower_orange.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/flowerGlimmering1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/glimmering_flower_pink.json b/src/main/resources/assets/botania/models/block/plants/glimmering_flower_pink.json new file mode 100644 index 000000000..d53240004 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/glimmering_flower_pink.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/flowerGlimmering6" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/glimmering_flower_purple.json b/src/main/resources/assets/botania/models/block/plants/glimmering_flower_purple.json new file mode 100644 index 000000000..ddf0b9f9c --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/glimmering_flower_purple.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/flowerGlimmering10" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/glimmering_flower_red.json b/src/main/resources/assets/botania/models/block/plants/glimmering_flower_red.json new file mode 100644 index 000000000..8ea3ea26d --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/glimmering_flower_red.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/flowerGlimmering14" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/glimmering_flower_silver.json b/src/main/resources/assets/botania/models/block/plants/glimmering_flower_silver.json new file mode 100644 index 000000000..367bfbe3b --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/glimmering_flower_silver.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/flowerGlimmering8" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/glimmering_flower_white.json b/src/main/resources/assets/botania/models/block/plants/glimmering_flower_white.json new file mode 100644 index 000000000..0a106deef --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/glimmering_flower_white.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/flowerGlimmering0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/glimmering_flower_yellow.json b/src/main/resources/assets/botania/models/block/plants/glimmering_flower_yellow.json new file mode 100644 index 000000000..0b6d9c508 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/glimmering_flower_yellow.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/flowerGlimmering4" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/mushroom_black.json b/src/main/resources/assets/botania/models/block/plants/mushroom_black.json new file mode 100644 index 000000000..e6c0ef8c5 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/mushroom_black.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/mushroom15" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/mushroom_blue.json b/src/main/resources/assets/botania/models/block/plants/mushroom_blue.json new file mode 100644 index 000000000..30a6d82f2 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/mushroom_blue.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/mushroom11" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/mushroom_brown.json b/src/main/resources/assets/botania/models/block/plants/mushroom_brown.json new file mode 100644 index 000000000..a687be665 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/mushroom_brown.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/mushroom12" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/mushroom_cyan.json b/src/main/resources/assets/botania/models/block/plants/mushroom_cyan.json new file mode 100644 index 000000000..adc3fdf35 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/mushroom_cyan.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/mushroom9" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/mushroom_gray.json b/src/main/resources/assets/botania/models/block/plants/mushroom_gray.json new file mode 100644 index 000000000..8c5f8eae7 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/mushroom_gray.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/mushroom7" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/mushroom_green.json b/src/main/resources/assets/botania/models/block/plants/mushroom_green.json new file mode 100644 index 000000000..cfdeed53d --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/mushroom_green.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/mushroom13" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/mushroom_light_blue.json b/src/main/resources/assets/botania/models/block/plants/mushroom_light_blue.json new file mode 100644 index 000000000..b80a18220 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/mushroom_light_blue.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/mushroom3" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/mushroom_lime.json b/src/main/resources/assets/botania/models/block/plants/mushroom_lime.json new file mode 100644 index 000000000..cb4077df9 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/mushroom_lime.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/mushroom5" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/mushroom_magenta.json b/src/main/resources/assets/botania/models/block/plants/mushroom_magenta.json new file mode 100644 index 000000000..78a96604e --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/mushroom_magenta.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/mushroom2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/mushroom_orange.json b/src/main/resources/assets/botania/models/block/plants/mushroom_orange.json new file mode 100644 index 000000000..7e3b273fb --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/mushroom_orange.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/mushroom1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/mushroom_pink.json b/src/main/resources/assets/botania/models/block/plants/mushroom_pink.json new file mode 100644 index 000000000..75c75823b --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/mushroom_pink.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/mushroom6" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/mushroom_purple.json b/src/main/resources/assets/botania/models/block/plants/mushroom_purple.json new file mode 100644 index 000000000..64334d4fa --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/mushroom_purple.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/mushroom10" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/mushroom_red.json b/src/main/resources/assets/botania/models/block/plants/mushroom_red.json new file mode 100644 index 000000000..488f9c1bd --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/mushroom_red.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/mushroom14" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/mushroom_silver.json b/src/main/resources/assets/botania/models/block/plants/mushroom_silver.json new file mode 100644 index 000000000..853f9915e --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/mushroom_silver.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/mushroom8" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/mushroom_white.json b/src/main/resources/assets/botania/models/block/plants/mushroom_white.json new file mode 100644 index 000000000..66f03c27f --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/mushroom_white.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/mushroom0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/plants/mushroom_yellow.json b/src/main/resources/assets/botania/models/block/plants/mushroom_yellow.json new file mode 100644 index 000000000..50451fe12 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/plants/mushroom_yellow.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "botania:blocks/mushroom4" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/prism.json b/src/main/resources/assets/botania/models/block/prism.json new file mode 100644 index 000000000..02cfd6f5a --- /dev/null +++ b/src/main/resources/assets/botania/models/block/prism.json @@ -0,0 +1,24 @@ +{ + "parent": "minecraft:block/block", + "textures": { + "bottom": "botania:blocks/prism0", + "top": "botania:blocks/prism0", + "side": "botania:blocks/prism1", + "particle": "botania:blocks/prism1" + }, + "elements": [ + { + "name": "Cube", + "from": [ 4, 0, 4 ], + "to": [ 12, 16, 12 ], + "faces": { + "down": { "texture": "#bottom", "uv": [ 4, 4, 12, 12 ], "cullface": "down" }, + "up": { "texture": "#top", "uv": [ 4, 4, 12, 12 ], "cullface": "up" }, + "north": { "texture": "#side", "uv": [ 4, 0, 12, 16 ] }, + "south": { "texture": "#side", "uv": [ 4, 0, 12, 16 ] }, + "west": { "texture": "#side", "uv": [ 4, 0, 12, 16 ] }, + "east": { "texture": "#side", "uv": [ 4, 0, 12, 16 ] } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/pump.json b/src/main/resources/assets/botania/models/block/pump.json new file mode 100644 index 000000000..23dd3429c --- /dev/null +++ b/src/main/resources/assets/botania/models/block/pump.json @@ -0,0 +1,91 @@ +{ + "textures": { + "axle_sides": "botania:model/pump_axle_sides", + "axle_top_bottom": "botania:model/pump_axle_top_bottom", + "end": "botania:model/pump_end", + "sheath": "botania:model/pump_sheath" + }, + "elements": [ + { + "name": "EndNorth", + "from": [ 4.0, 0.0, 0.0 ], + "to": [ 12.0, 8.0, 1.0 ], + "faces": { + "north": { "texture": "#end", "uv": [ 0.0, 0.0, 8.0, 8.0 ] }, + "south": { "texture": "#end", "uv": [ 8.0, 0.0, 16.0, 8.0 ] }, + "east": { "texture": "#end", "uv": [ 2.0, 8.0, 4.0, 16.0 ] }, + "west": { "texture": "#end", "uv": [ 2.0, 8.0, 4.0, 16.0 ] }, + "up": { "texture": "#end", "uv": [ 6.0, 9.0, 14.0, 10.0 ] }, + "down": { "texture": "#end", "uv": [ 6.0, 11.0, 14.0, 12.0 ] } + } + }, + { + "name": "EndSouth", + "from": [ 4.0, 0.0, 15.0 ], + "to": [ 12.0, 8.0, 16.0 ], + "faces": { + "south": { "texture": "#end", "uv": [ 0.0, 0.0, 8.0, 8.0 ] }, + "north": { "texture": "#end", "uv": [ 8.0, 0.0, 16.0, 8.0 ] }, + "east": { "texture": "#end", "uv": [ 2.0, 8.0, 4.0, 16.0 ] }, + "west": { "texture": "#end", "uv": [ 2.0, 8.0, 4.0, 16.0 ] }, + "up": { "texture": "#end", "uv": [ 6.0, 9.0, 14.0, 10.0 ] }, + "down": { "texture": "#end", "uv": [ 6.0, 11.0, 14.0, 12.0 ] } + } + }, + { + "name": "Axle", + "from": [ 6.0, 2.0, 1.0 ], + "to": [ 10.0, 6.0, 15.0 ], + "faces": { + "east": { "texture": "#axle_sides", "uv": [ 1.0, 0.0, 15.0, 4.0 ] }, + "west": { "texture": "#axle_sides", "uv": [ 1.0, 5.0, 15.0, 9.0 ] }, + "down": { "texture": "#axle_top_bottom", "uv": [ 4.0, 1.0, 8.0, 15.0 ] }, + "up": { "texture": "#axle_top_bottom", "uv": [ 8.0, 1.0, 12.0, 15.0 ] } + } + }, + { + "name": "PinkTop", + "from": [ 4.0, 7.0, 11.0 ], + "to": [ 12.0, 8.0, 15.0 ], + "faces": { + "north": { "texture": "#sheath", "uv": [ 1.0, 1.0, 9.0, 2.0 ] }, + "east": { "texture": "#sheath", "uv": [ 6.0, 5.0, 10.0, 6.0 ] }, + "west": { "texture": "#sheath", "uv": [ 6.0, 6.0, 10.0, 7.0 ] }, + "up": { "texture": "#sheath", "uv": [ 1.0, 1.0, 9.0, 5.0 ] }, + "down": { "texture": "#sheath", "uv": [ 7.0, 1.0, 15.0, 5.0 ] } + } + }, + { + "name": "PinkBottom", + "from": [ 4.0, 0.0, 11.0 ], + "to": [ 12.0, 1.0, 15.0 ], + "faces": { + "north": { "texture": "#sheath", "uv": [ 1.0, 1.0, 9.0, 2.0 ] }, + "east": { "texture": "#sheath", "uv": [ 6.0, 7.0, 10.0, 8.0 ] }, + "west": { "texture": "#sheath", "uv": [ 6.0, 8.0, 10.0, 9.0 ] }, + "up": { "texture": "#sheath", "uv": [ 1.0, 1.0, 9.0, 5.0 ] }, + "down": { "texture": "#sheath", "uv": [ 7.0, 1.0, 15.0, 5.0 ] } + } + }, + { + "name": "PinkWest", + "from": [ 4.0, 1.0, 11.0 ], + "to": [ 5.0, 7.0, 15.0 ], + "faces": { + "north": { "texture": "#sheath", "uv": [ 6.0, 1.0, 7.0, 7.0 ] }, + "east": { "texture": "#sheath", "uv": [ 6.0, 1.0, 10.0, 7.0 ] }, + "west": { "texture": "#sheath", "uv": [ 6.0, 1.0, 10.0, 7.0 ] } + } + }, + { + "name": "PinkEast", + "from": [ 11.0, 1.0, 11.0 ], + "to": [ 12.0, 7.0, 15.0 ], + "faces": { + "north": { "texture": "#sheath", "uv": [ 6.0, 1.0, 7.0, 7.0 ] }, + "east": { "texture": "#sheath", "uv": [ 6.0, 1.0, 10.0, 7.0 ] }, + "west": { "texture": "#sheath", "uv": [ 6.0, 1.0, 10.0, 7.0 ] } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/pump_head.json b/src/main/resources/assets/botania/models/block/pump_head.json new file mode 100644 index 000000000..7e2907726 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/pump_head.json @@ -0,0 +1,55 @@ +{ + "textures": { + "all": "botania:model/pump_head" + }, + "elements": [ + { + "name": "BlueTop", + "from": [ 5.0, 6.0, 1.0 ], + "to": [ 11.0, 7.0, 7.0 ], + "faces": { + "north": { "texture": "#all", "uv": [ 3.0, 5.0, 9.0, 6.0 ] }, + "east": { "texture": "#all", "uv": [ 5.0, 8.0, 11.0, 7.0 ] }, + "south": { "texture": "#all", "uv": [ 3.0, 5.0, 9.0, 6.0 ] }, + "west": { "texture": "#all", "uv": [ 5.0, 8.0, 11.0, 7.0 ] }, + "up": { "texture": "#all", "uv": [ 3.0, 0.0, 9.0, 6.0 ] }, + "down": { "texture": "#all", "uv": [ 7.0, 0.0, 13.0, 6.0 ] } + } + }, + { + "name": "BlueBottom", + "from": [ 5.0, 1.0, 1.0 ], + "to": [ 11.0, 2.0, 7.0 ], + "faces": { + "north": { "texture": "#all", "uv": [ 3.0, 5.0, 9.0, 6.0 ] }, + "east": { "texture": "#all", "uv": [ 5.0, 8.0, 11.0, 7.0 ] }, + "south": { "texture": "#all", "uv": [ 3.0, 5.0, 9.0, 6.0 ] }, + "west": { "texture": "#all", "uv": [ 5.0, 8.0, 11.0, 7.0 ] }, + "up": { "texture": "#all", "uv": [ 7.0, 0.0, 13.0, 6.0 ] }, + "down": { "texture": "#all", "uv": [ 3.0, 0.0, 9.0, 6.0 ] } + } + }, + { + "name": "BlueWest", + "from": [ 5.0, 2.0, 1.0 ], + "to": [ 6.0, 6.0, 7.0 ], + "faces": { + "north": { "texture": "#all", "uv": [ 3.0, 0.0, 4.0, 4.0 ] }, + "east": { "texture": "#all", "uv": [ 3.0, 0.0, 9.0, 6.0 ] }, + "south": { "texture": "#all", "uv": [ 3.0, 0.0, 4.0, 4.0 ] }, + "west": { "texture": "#all", "uv": [ 3.0, 0.0, 9.0, 6.0 ] } + } + }, + { + "name": "BlueEast", + "from": [ 10.0, 2.0, 1.0 ], + "to": [ 11.0, 6.0, 7.0 ], + "faces": { + "north": { "texture": "#all", "uv": [ 3.0, 0.0, 4.0, 4.0 ] }, + "east": { "texture": "#all", "uv": [ 3.0, 0.0, 9.0, 6.0 ] }, + "south": { "texture": "#all", "uv": [ 3.0, 0.0, 4.0, 4.0 ] }, + "west": { "texture": "#all", "uv": [ 3.0, 0.0, 9.0, 6.0 ] } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/pylon.mtl b/src/main/resources/assets/botania/models/block/pylon.mtl new file mode 100644 index 000000000..ad5f776b4 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/pylon.mtl @@ -0,0 +1,2 @@ +newmtl pylon +map_Kd botania:model/pylon \ No newline at end of file diff --git a/src/main/resources/assets/botania/model/pylon.obj b/src/main/resources/assets/botania/models/block/pylon.obj similarity index 98% rename from src/main/resources/assets/botania/model/pylon.obj rename to src/main/resources/assets/botania/models/block/pylon.obj index dcf1bbe84..25402aca1 100644 --- a/src/main/resources/assets/botania/model/pylon.obj +++ b/src/main/resources/assets/botania/models/block/pylon.obj @@ -4,7 +4,7 @@ # # object Crystal # - +mtllib pylon.mtl v 0.5000 2.0000 -0.5000 v 0.9174 1.3116 -0.5000 v 0.5000 1.3116 -0.9174 @@ -40,7 +40,7 @@ vt 0.1875 0.3594 0.5000 # 14 texture coords g Crystal -s off +usemtl pylon f 1/1/1 2/2/1 3/3/1 f 1/4/2 3/5/2 4/6/2 f 1/1/3 4/7/3 5/3/3 @@ -100,22 +100,21 @@ vt 0.0234 0.7813 0.5817 # 24 texture coords g Ring_Panel03 -s 2 f 7/15/9 8/16/9 9/17/9 -f 9/17/9 10/18/9 7/15/9 -s 4 +f 9/17/9 10/18/9 7/15/9 + f 11/19/10 12/20/10 13/21/10 f 13/21/10 14/22/10 11/19/10 -s 8 + f 7/23/11 10/24/11 12/25/11 -f 12/25/11 11/26/11 7/23/11 -s 16 +f 12/25/11 11/26/11 7/23/11 + f 10/27/12 9/28/12 13/29/12 f 13/29/12 12/30/12 10/27/12 -s 32 + f 9/31/13 8/32/13 14/33/13 f 14/33/13 13/34/13 9/31/13 -s 64 + f 8/35/14 7/36/14 11/37/14 f 11/37/14 14/38/14 8/35/14 # 12 faces @@ -169,22 +168,22 @@ vt 0.0625 0.5234 0.5741 # 24 texture coords g Ring_Gem03 -s 2 + f 15/39/15 16/40/15 17/41/15 f 17/41/15 18/42/15 15/39/15 -s 4 + f 19/43/16 20/44/16 21/45/16 f 21/45/16 22/46/16 19/43/16 -s 8 + f 15/47/17 18/48/17 20/49/17 f 20/49/17 19/50/17 15/47/17 -s 16 + f 18/51/18 17/52/18 21/53/18 f 21/53/18 20/54/18 18/51/18 -s 32 + f 17/55/19 16/56/19 22/57/19 f 22/57/19 21/58/19 17/55/19 -s 64 + f 16/59/20 15/60/20 19/61/20 f 19/61/20 22/62/20 16/59/20 # 12 faces @@ -238,22 +237,22 @@ vt 0.0625 0.5234 0.5741 # 24 texture coords g Ring_Gem01 -s 2 + f 23/63/21 24/64/21 25/65/21 f 25/65/21 26/66/21 23/63/21 -s 4 + f 27/67/22 28/68/22 29/69/22 f 29/69/22 30/70/22 27/67/22 -s 8 + f 23/71/23 26/72/23 28/73/23 f 28/73/23 27/74/23 23/71/23 -s 16 + f 26/75/24 25/76/24 29/77/24 f 29/77/24 28/78/24 26/75/24 -s 32 + f 25/79/25 24/80/25 30/81/25 f 30/81/25 29/82/25 25/79/25 -s 64 + f 24/83/26 23/84/26 27/85/26 f 27/85/26 30/86/26 24/83/26 # 12 faces @@ -307,22 +306,22 @@ vt 0.0625 0.5234 0.5741 # 24 texture coords g Ring_Gem02 -s 2 + f 31/87/27 32/88/27 33/89/27 f 33/89/27 34/90/27 31/87/27 -s 4 + f 35/91/28 36/92/28 37/93/28 f 37/93/28 38/94/28 35/91/28 -s 8 + f 31/95/29 34/96/29 36/97/29 f 36/97/29 35/98/29 31/95/29 -s 16 + f 34/99/30 33/100/30 37/101/30 f 37/101/30 36/102/30 34/99/30 -s 32 + f 33/103/31 32/104/31 38/105/31 f 38/105/31 37/106/31 33/103/31 -s 64 + f 32/107/32 31/108/32 35/109/32 f 35/109/32 38/110/32 32/107/32 # 12 faces @@ -376,22 +375,22 @@ vt 0.0234 0.7813 0.5817 # 24 texture coords g Ring_Panel02 -s 2 + f 39/111/33 40/112/33 41/113/33 f 41/113/33 42/114/33 39/111/33 -s 4 + f 43/115/34 44/116/34 45/117/34 f 45/117/34 46/118/34 43/115/34 -s 8 + f 39/119/35 42/120/35 44/121/35 f 44/121/35 43/122/35 39/119/35 -s 16 + f 42/123/36 41/124/36 45/125/36 f 45/125/36 44/126/36 42/123/36 -s 32 + f 41/127/37 40/128/37 46/129/37 f 46/129/37 45/130/37 41/127/37 -s 64 + f 40/131/38 39/132/38 43/133/38 f 43/133/38 46/134/38 40/131/38 # 12 faces @@ -445,22 +444,22 @@ vt 0.0234 0.7813 0.5817 # 24 texture coords g Ring_Panel01 -s 2 + f 47/135/39 48/136/39 49/137/39 f 49/137/39 50/138/39 47/135/39 -s 4 + f 51/139/40 52/140/40 53/141/40 f 53/141/40 54/142/40 51/139/40 -s 8 + f 47/143/41 50/144/41 52/145/41 f 52/145/41 51/146/41 47/143/41 -s 16 + f 50/147/42 49/148/42 53/149/42 f 53/149/42 52/150/42 50/147/42 -s 32 + f 49/151/43 48/152/43 54/153/43 f 54/153/43 53/154/43 49/151/43 -s 64 + f 48/155/44 47/156/44 51/157/44 f 51/157/44 54/158/44 48/155/44 # 12 faces @@ -589,7 +588,7 @@ vt 0.2578 0.6250 0.8551 # 68 texture coords g Crystal_Ring -s off + f 55/159/45 56/160/45 57/161/45 f 57/161/45 58/162/45 55/159/45 f 56/163/46 59/164/46 60/165/46 @@ -705,22 +704,22 @@ vt 0.0625 0.5234 0.5741 # 24 texture coords g Ring_Gem04 -s 2 + f 87/227/58 88/228/58 89/229/58 f 89/229/58 90/230/58 87/227/58 -s 4 + f 91/231/59 92/232/59 93/233/59 f 93/233/59 94/234/59 91/231/59 -s 8 + f 87/235/60 90/236/60 92/237/60 f 92/237/60 91/238/60 87/235/60 -s 16 + f 90/239/61 89/240/61 93/241/61 f 93/241/61 92/242/61 90/239/61 -s 32 + f 89/243/62 88/244/62 94/245/62 f 94/245/62 93/246/62 89/243/62 -s 64 + f 88/247/63 87/248/63 91/249/63 f 91/249/63 94/250/63 88/247/63 # 12 faces @@ -774,22 +773,22 @@ vt 0.0234 0.7813 0.5817 # 24 texture coords g Ring_Panel04 -s 2 + f 95/251/64 96/252/64 97/253/64 f 97/253/64 98/254/64 95/251/64 -s 4 + f 99/255/65 100/256/65 101/257/65 f 101/257/65 102/258/65 99/255/65 -s 8 + f 95/259/66 98/260/66 100/261/66 f 100/261/66 99/262/66 95/259/66 -s 16 + f 98/263/67 97/264/67 101/265/67 f 101/265/67 100/266/67 98/263/67 -s 32 + f 97/267/68 96/268/68 102/269/68 f 102/269/68 101/270/68 97/267/68 -s 64 + f 96/271/69 95/272/69 99/273/69 f 99/273/69 102/274/69 96/271/69 # 12 faces diff --git a/src/main/resources/assets/botania/models/block/quartz/blaze_quartz.json b/src/main/resources/assets/botania/models/block/quartz/blaze_quartz.json new file mode 100644 index 000000000..f44a954f6 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/quartz/blaze_quartz.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/cube_bottom_top", + "textures": { + "bottom": "botania:blocks/blockBlazeQuartz0", + "top": "botania:blocks/blockBlazeQuartz1", + "side": "botania:blocks/blockBlazeQuartz2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/quartz/blaze_quartz_chiseled.json b/src/main/resources/assets/botania/models/block/quartz/blaze_quartz_chiseled.json new file mode 100644 index 000000000..1532d2d11 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/quartz/blaze_quartz_chiseled.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/cube_column", + "textures": { + "side": "botania:blocks/chiseledBlazeQuartz0", + "end": "botania:blocks/chiseledBlazeQuartz1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/quartz/blaze_quartz_pillar.json b/src/main/resources/assets/botania/models/block/quartz/blaze_quartz_pillar.json new file mode 100644 index 000000000..eb34dda3a --- /dev/null +++ b/src/main/resources/assets/botania/models/block/quartz/blaze_quartz_pillar.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/cube_column", + "textures": { + "side": "botania:blocks/pillarBlazeQuartz0", + "end": "botania:blocks/pillarBlazeQuartz1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/quartz/dark_quartz.json b/src/main/resources/assets/botania/models/block/quartz/dark_quartz.json new file mode 100644 index 000000000..e48195fab --- /dev/null +++ b/src/main/resources/assets/botania/models/block/quartz/dark_quartz.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/cube_bottom_top", + "textures": { + "bottom": "botania:blocks/blockDarkQuartz0", + "top": "botania:blocks/blockDarkQuartz1", + "side": "botania:blocks/blockDarkQuartz2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/quartz/dark_quartz_chiseled.json b/src/main/resources/assets/botania/models/block/quartz/dark_quartz_chiseled.json new file mode 100644 index 000000000..7c1da5c3a --- /dev/null +++ b/src/main/resources/assets/botania/models/block/quartz/dark_quartz_chiseled.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/cube_column", + "textures": { + "side": "botania:blocks/chiseledDarkQuartz0", + "end": "botania:blocks/chiseledDarkQuartz1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/quartz/dark_quartz_pillar.json b/src/main/resources/assets/botania/models/block/quartz/dark_quartz_pillar.json new file mode 100644 index 000000000..c610d0b25 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/quartz/dark_quartz_pillar.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/cube_column", + "textures": { + "side": "botania:blocks/pillarDarkQuartz0", + "end": "botania:blocks/pillarDarkQuartz1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/quartz/elf_quartz.json b/src/main/resources/assets/botania/models/block/quartz/elf_quartz.json new file mode 100644 index 000000000..d68e10781 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/quartz/elf_quartz.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/cube_bottom_top", + "textures": { + "bottom": "botania:blocks/blockElfQuartz0", + "top": "botania:blocks/blockElfQuartz1", + "side": "botania:blocks/blockElfQuartz2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/quartz/elf_quartz_chiseled.json b/src/main/resources/assets/botania/models/block/quartz/elf_quartz_chiseled.json new file mode 100644 index 000000000..d2ba907cc --- /dev/null +++ b/src/main/resources/assets/botania/models/block/quartz/elf_quartz_chiseled.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/cube_column", + "textures": { + "side": "botania:blocks/chiseledElfQuartz0", + "end": "botania:blocks/chiseledElfQuartz1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/quartz/elf_quartz_pillar.json b/src/main/resources/assets/botania/models/block/quartz/elf_quartz_pillar.json new file mode 100644 index 000000000..49ce41ac7 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/quartz/elf_quartz_pillar.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/cube_column", + "textures": { + "side": "botania:blocks/pillarElfQuartz0", + "end": "botania:blocks/pillarElfQuartz1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/quartz/lavender_quartz.json b/src/main/resources/assets/botania/models/block/quartz/lavender_quartz.json new file mode 100644 index 000000000..a15700d32 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/quartz/lavender_quartz.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/cube_bottom_top", + "textures": { + "bottom": "botania:blocks/blockLavenderQuartz0", + "top": "botania:blocks/blockLavenderQuartz1", + "side": "botania:blocks/blockLavenderQuartz2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/quartz/lavender_quartz_chiseled.json b/src/main/resources/assets/botania/models/block/quartz/lavender_quartz_chiseled.json new file mode 100644 index 000000000..743d29abb --- /dev/null +++ b/src/main/resources/assets/botania/models/block/quartz/lavender_quartz_chiseled.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/cube_column", + "textures": { + "side": "botania:blocks/chiseledLavenderQuartz0", + "end": "botania:blocks/chiseledLavenderQuartz1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/quartz/lavender_quartz_pillar.json b/src/main/resources/assets/botania/models/block/quartz/lavender_quartz_pillar.json new file mode 100644 index 000000000..a6baaf582 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/quartz/lavender_quartz_pillar.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/cube_column", + "textures": { + "side": "botania:blocks/pillarLavenderQuartz0", + "end": "botania:blocks/pillarLavenderQuartz1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/quartz/mana_quartz.json b/src/main/resources/assets/botania/models/block/quartz/mana_quartz.json new file mode 100644 index 000000000..4d7592100 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/quartz/mana_quartz.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/cube_bottom_top", + "textures": { + "bottom": "botania:blocks/blockManaQuartz0", + "top": "botania:blocks/blockManaQuartz1", + "side": "botania:blocks/blockManaQuartz2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/quartz/mana_quartz_chiseled.json b/src/main/resources/assets/botania/models/block/quartz/mana_quartz_chiseled.json new file mode 100644 index 000000000..365192d7d --- /dev/null +++ b/src/main/resources/assets/botania/models/block/quartz/mana_quartz_chiseled.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/cube_column", + "textures": { + "side": "botania:blocks/chiseledManaQuartz0", + "end": "botania:blocks/chiseledManaQuartz1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/quartz/mana_quartz_pillar.json b/src/main/resources/assets/botania/models/block/quartz/mana_quartz_pillar.json new file mode 100644 index 000000000..6ab1a24dc --- /dev/null +++ b/src/main/resources/assets/botania/models/block/quartz/mana_quartz_pillar.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/cube_column", + "textures": { + "side": "botania:blocks/pillarManaQuartz0", + "end": "botania:blocks/pillarManaQuartz1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/quartz/red_quartz.json b/src/main/resources/assets/botania/models/block/quartz/red_quartz.json new file mode 100644 index 000000000..6f8745719 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/quartz/red_quartz.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/cube_bottom_top", + "textures": { + "bottom": "botania:blocks/blockRedQuartz0", + "top": "botania:blocks/blockRedQuartz1", + "side": "botania:blocks/blockRedQuartz2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/quartz/red_quartz_chiseled.json b/src/main/resources/assets/botania/models/block/quartz/red_quartz_chiseled.json new file mode 100644 index 000000000..618377628 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/quartz/red_quartz_chiseled.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/cube_column", + "textures": { + "side": "botania:blocks/chiseledRedQuartz0", + "end": "botania:blocks/chiseledRedQuartz1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/quartz/red_quartz_pillar.json b/src/main/resources/assets/botania/models/block/quartz/red_quartz_pillar.json new file mode 100644 index 000000000..eb722fa5c --- /dev/null +++ b/src/main/resources/assets/botania/models/block/quartz/red_quartz_pillar.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/cube_column", + "textures": { + "side": "botania:blocks/pillarRedQuartz0", + "end": "botania:blocks/pillarRedQuartz1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/quartz/sunny_quartz.json b/src/main/resources/assets/botania/models/block/quartz/sunny_quartz.json new file mode 100644 index 000000000..c4629562c --- /dev/null +++ b/src/main/resources/assets/botania/models/block/quartz/sunny_quartz.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/cube_bottom_top", + "textures": { + "bottom": "botania:blocks/blockSunnyQuartz0", + "top": "botania:blocks/blockSunnyQuartz1", + "side": "botania:blocks/blockSunnyQuartz2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/quartz/sunny_quartz_chiseled.json b/src/main/resources/assets/botania/models/block/quartz/sunny_quartz_chiseled.json new file mode 100644 index 000000000..9dc208c8f --- /dev/null +++ b/src/main/resources/assets/botania/models/block/quartz/sunny_quartz_chiseled.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/cube_column", + "textures": { + "side": "botania:blocks/chiseledSunnyQuartz0", + "end": "botania:blocks/chiseledSunnyQuartz1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/quartz/sunny_quartz_pillar.json b/src/main/resources/assets/botania/models/block/quartz/sunny_quartz_pillar.json new file mode 100644 index 000000000..037c8054b --- /dev/null +++ b/src/main/resources/assets/botania/models/block/quartz/sunny_quartz_pillar.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/cube_column", + "textures": { + "side": "botania:blocks/pillarSunnyQuartz0", + "end": "botania:blocks/pillarSunnyQuartz1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/red_string_comparator.json b/src/main/resources/assets/botania/models/block/red_string_comparator.json new file mode 100644 index 000000000..58070033a --- /dev/null +++ b/src/main/resources/assets/botania/models/block/red_string_comparator.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/orientable", + "textures": { + "top": "botania:blocks/redStringComparator", + "front": "botania:blocks/redStringSender", + "side": "botania:blocks/redStringComparator" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/red_string_container.json b/src/main/resources/assets/botania/models/block/red_string_container.json new file mode 100644 index 000000000..4a8ebe34c --- /dev/null +++ b/src/main/resources/assets/botania/models/block/red_string_container.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/orientable", + "textures": { + "top": "botania:blocks/redStringContainer", + "front": "botania:blocks/redStringSender", + "side": "botania:blocks/redStringContainer" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/red_string_dispenser.json b/src/main/resources/assets/botania/models/block/red_string_dispenser.json new file mode 100644 index 000000000..bbddc9883 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/red_string_dispenser.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/orientable", + "textures": { + "top": "botania:blocks/redStringDispenser", + "front": "botania:blocks/redStringSender", + "side": "botania:blocks/redStringDispenser" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/red_string_fertilizer.json b/src/main/resources/assets/botania/models/block/red_string_fertilizer.json new file mode 100644 index 000000000..10771f70c --- /dev/null +++ b/src/main/resources/assets/botania/models/block/red_string_fertilizer.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/orientable", + "textures": { + "top": "botania:blocks/redStringFertilizer", + "front": "botania:blocks/redStringSender", + "side": "botania:blocks/redStringFertilizer" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/red_string_interceptor.json b/src/main/resources/assets/botania/models/block/red_string_interceptor.json new file mode 100644 index 000000000..6c31f846b --- /dev/null +++ b/src/main/resources/assets/botania/models/block/red_string_interceptor.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/orientable", + "textures": { + "top": "botania:blocks/redStringInterceptor", + "front": "botania:blocks/redStringSender", + "side": "botania:blocks/redStringInterceptor" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/red_string_relay.json b/src/main/resources/assets/botania/models/block/red_string_relay.json new file mode 100644 index 000000000..d62841e01 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/red_string_relay.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/orientable", + "textures": { + "top": "botania:blocks/redStringRelay", + "front": "botania:blocks/redStringSender", + "side": "botania:blocks/redStringRelay" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/redstone_spreader.json b/src/main/resources/assets/botania/models/block/redstone_spreader.json new file mode 100644 index 000000000..15e48655c --- /dev/null +++ b/src/main/resources/assets/botania/models/block/redstone_spreader.json @@ -0,0 +1,8 @@ +{ + "parent": "botania:block/shapes/spreader", + "textures": { + "inside": "botania:model/spreader_item/redstone_inside", + "side": "botania:model/spreader_item/redstone_side", + "material": "botania:model/spreader_item/redstone_material" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/root.json b/src/main/resources/assets/botania/models/block/root.json new file mode 100644 index 000000000..e36906545 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/root.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/root" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/runic_altar.json b/src/main/resources/assets/botania/models/block/runic_altar.json new file mode 100644 index 000000000..bb055b11d --- /dev/null +++ b/src/main/resources/assets/botania/models/block/runic_altar.json @@ -0,0 +1,8 @@ +{ + "parent": "botania:block/shapes/twelve_high_bottom_top", + "textures": { + "top": "botania:blocks/runeAltar1", + "side": "botania:blocks/runeAltar2", + "bottom": "botania:blocks/runeAltar0" + } +} diff --git a/src/main/resources/assets/botania/models/block/scorched_grass.json b/src/main/resources/assets/botania/models/block/scorched_grass.json new file mode 100644 index 000000000..ad5d14643 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/scorched_grass.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/cube_bottom_top", + "textures": { + "bottom": "minecraft:blocks/dirt", + "top": "botania:blocks/altGrass6", + "side": "botania:blocks/altGrass7" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/shapes/claw.json b/src/main/resources/assets/botania/models/block/shapes/claw.json new file mode 100644 index 000000000..e0aedef0d --- /dev/null +++ b/src/main/resources/assets/botania/models/block/shapes/claw.json @@ -0,0 +1,124 @@ +{ + "parent": "minecraft:block/block", + "display": { + "gui": { + "rotation": [ 30, 225, 0 ], + "translation": [ 0, 3, 0], + "scale":[ 0.625, 0.625, 0.625 ] + } + }, + "textures": { + "particle": "#all" + }, + "elements": [ + { + "name": "Plate", + "from": [ 2.0, 0.0, 2.0 ], + "to": [ 14.0, 1.0, 14.0 ], + "faces": { + "west": { "texture": "#all", "uv": [ 0.0, 3.0, 3.0, 3.25 ] }, + "north": { "texture": "#all", "uv": [ 3.0, 3.0, 6.0, 3.25 ] }, + "east": { "texture": "#all", "uv": [ 6.0, 3.0, 9.0, 3.25 ] }, + "south": { "texture": "#all", "uv": [ 9.0, 3.0, 12.0, 3.25 ] }, + "up": { "texture": "#all", "uv": [ 3.0, 0.0, 6.0, 3.0 ] }, + "down": { "texture": "#all", "uv": [ 6.0, 0.0, 9.0, 3.0 ], "cullface": "down" } + } + }, + { + "name": "Limb_West", + "from": [ -1.0, 0.0, 7.0 ], + "to": [ 2.0, 1.0, 9.0 ], + "faces": { + "west": { "texture": "#all", "uv": [ 0.0, 5.25, 0.5, 5.5 ] }, + "north": { "texture": "#all", "uv": [ 0.5, 5.25, 1.25, 5.5 ] }, + "south": { "texture": "#all", "uv": [ 1.25, 5.25, 2.0, 5.5 ] }, + "up": { "texture": "#all", "uv": [ 0.5, 4.75, 1.25, 5.25 ] }, + "down": { "texture": "#all", "uv": [ 1.25, 4.75, 2.0, 5.25 ] } + } + }, + { + "name": "Limb_East", + "from": [ 14.0, 0.0, 7.0 ], + "to": [ 17.0, 1.0, 9.0 ], + "faces": { + "north": { "texture": "#all", "uv": [ 3.25, 5.25, 4.0, 5.5 ] }, + "south": { "texture": "#all", "uv": [ 4.0, 5.25, 4.75, 5.5 ] }, + "east": { "texture": "#all", "uv": [ 4.75, 5.25, 5.25, 5.5 ] }, + "up": { "texture": "#all", "uv": [ 3.25, 4.75, 4.0, 5.25 ] }, + "down": { "texture": "#all", "uv": [ 4.0, 4.75, 4.75, 5.25 ] } + } + }, + { + "name": "Limb_North", + "from": [ 7.0, 0.0, -1.0 ], + "to": [ 9.0, 1.0, 2.0 ], + "faces": { + "west": { "texture": "#all", "uv": [ 0.0, 4.25, 0.75, 4.5 ] }, + "north": { "texture": "#all", "uv": [ 0.75, 4.25, 1.25, 4.5 ] }, + "east": { "texture": "#all", "uv": [ 1.25, 4.25, 1.75, 4.5 ] }, + "up": { "texture": "#all", "uv": [ 0.75, 3.5, 1.25, 4.25 ] }, + "down": { "texture": "#all", "uv": [ 1.25, 3.5, 1.75, 4.25 ] } + } + }, + { + "name": "Limb_South", + "from": [ 7.0, 0.0, 14.0 ], + "to": [ 9.0, 1.0, 17.0 ], + "faces": { + "west": { "texture": "#all", "uv": [ 2.75, 4.25, 3.5, 4.5 ] }, + "east": { "texture": "#all", "uv": [ 4.0, 4.25, 4.5, 4.5 ] }, + "south": { "texture": "#all", "uv": [ 4.5, 4.25, 5.25, 4.5 ] }, + "up": { "texture": "#all", "uv": [ 3.5, 3.5, 4.0, 4.25 ] }, + "down": { "texture": "#all", "uv": [ 4.0, 3.5, 4.5, 4.25 ] } + } + }, + { + "name": "Claw_West", + "from": [ -1.0, -5.0, 7.0 ], + "to": [ 0.0, 0.0, 9.0 ], + "faces": { + "west": { "texture": "#all", "uv": [ 11.0, 4.5, 11.5, 5.75 ] }, + "north": { "texture": "#all", "uv": [ 11.5, 4.5, 11.75, 5.75 ] }, + "east": { "texture": "#all", "uv": [ 11.75, 4.5, 12.0, 5.75 ] }, + "south": { "texture": "#all", "uv": [ 12.0, 4.5, 12.5, 5.75 ] }, + "down": { "texture": "#all", "uv": [ 11.75, 4.0, 12.0, 4.5 ] } + } + }, + { + "name": "Claw_East", + "from": [ 16.0, -5.0, 7.0 ], + "to": [ 17.0, 0.0, 9.0 ], + "faces": { + "west": { "texture": "#all", "uv": [ 7.5, 4.5, 8.0, 5.75 ] }, + "north": { "texture": "#all", "uv": [ 8.0, 4.5, 8.25, 5.75 ] }, + "east": { "texture": "#all", "uv": [ 8.25, 4.5, 8.5, 5.75 ] }, + "south": { "texture": "#all", "uv": [ 8.5, 4.5, 9.0, 5.75 ] }, + "down": { "texture": "#all", "uv": [ 8.25, 4.0, 8.5, 4.5 ] } + } + }, + { + "name": "Claw_North", + "from": [ 7.0, -5.0, -1.0 ], + "to": [ 9.0, 0.0, 0.0 ], + "faces": { + "west": { "texture": "#all", "uv": [ 5.75, 4.25, 6.0, 5.5 ] }, + "north": { "texture": "#all", "uv": [ 6.0, 4.25, 6.5, 5.5 ] }, + "south": { "texture": "#all", "uv": [ 6.5, 4.25, 7.0, 5.5 ] }, + "east": { "texture": "#all", "uv": [ 7.0, 4.25, 7.25, 5.5 ] }, + "down": { "texture": "#all", "uv": [ 6.5, 4.0, 7.0, 4.25 ] } + } + }, + { + "name": "Claw_South", + "from": [ 7.0, -5.0, 16.0 ], + "to": [ 9.0, 0.0, 17.0 ], + "faces": { + "west": { "texture": "#all", "uv": [ 9.25, 4.25, 9.5, 5.5 ] }, + "north": { "texture": "#all", "uv": [ 9.5, 4.25, 10.0, 5.5 ] }, + "south": { "texture": "#all", "uv": [ 10.0, 4.25, 10.5, 5.5 ] }, + "east": { "texture": "#all", "uv": [ 10.5, 4.25, 11.25, 5.5 ] }, + "down": { "texture": "#all", "uv": [ 10.0, 4.0, 10.5, 4.25 ] } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/shapes/cross_tinted.json b/src/main/resources/assets/botania/models/block/shapes/cross_tinted.json new file mode 100644 index 000000000..f5aad893c --- /dev/null +++ b/src/main/resources/assets/botania/models/block/shapes/cross_tinted.json @@ -0,0 +1,28 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#cross" + }, + "elements": [ + { + "from": [ 0.8, 0, 8 ], + "to": [ 15.2, 16, 8 ], + "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true }, + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#cross", "tintindex": 0 }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#cross", "tintindex": 0 } + } + }, + { + "from": [ 8, 0, 0.8 ], + "to": [ 8, 16, 15.2 ], + "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true }, + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#cross", "tintindex": 0 }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#cross", "tintindex": 0 } + } + } + ] +} diff --git a/src/main/resources/assets/botania/models/block/shapes/cube_all_tinted.json b/src/main/resources/assets/botania/models/block/shapes/cube_all_tinted.json new file mode 100644 index 000000000..2f3cc5a33 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/shapes/cube_all_tinted.json @@ -0,0 +1,19 @@ +{ + "parent": "minecraft:block/block", + "textures": { + "particle": "#all" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "down": { "texture": "#all", "cullface": "down", "tintindex": 0 }, + "up": { "texture": "#all", "cullface": "up", "tintindex": 0 }, + "north": { "texture": "#all", "cullface": "north", "tintindex": 0 }, + "south": { "texture": "#all", "cullface": "south", "tintindex": 0 }, + "west": { "texture": "#all", "cullface": "west", "tintindex": 0 }, + "east": { "texture": "#all", "cullface": "east", "tintindex": 0 } + } + } + ] +} diff --git a/src/main/resources/assets/botania/models/block/shapes/drum.json b/src/main/resources/assets/botania/models/block/shapes/drum.json new file mode 100644 index 000000000..7968b80e7 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/shapes/drum.json @@ -0,0 +1,19 @@ +{ + "parent": "minecraft:block/block", + "textures": { + "particle": "#side" + }, + "elements": [{ + "name": "Drum", + "from": [ 3.0, 0.0, 3.0 ], + "to": [ 13.0, 14.0, 13.0 ], + "faces": { + "north": { "texture": "#side", "uv": [ 3, 2, 13, 16 ] }, + "south": { "texture": "#side", "uv": [ 3, 2, 13, 16 ] }, + "west": { "texture": "#side", "uv": [ 3, 2, 13, 16 ] }, + "east": { "texture": "#side", "uv": [ 3, 2, 13, 16 ] }, + "up": { "texture": "#top", "uv": [ 3, 3, 12, 12 ] }, + "down": { "texture": "#top", "uv": [ 3, 3, 12, 12 ], "cullface": "down" } + } + }] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/shapes/eightbyeight.json b/src/main/resources/assets/botania/models/block/shapes/eightbyeight.json new file mode 100644 index 000000000..ca0a08ead --- /dev/null +++ b/src/main/resources/assets/botania/models/block/shapes/eightbyeight.json @@ -0,0 +1,21 @@ +{ + "parent": "minecraft:block/block", + "textures": { + "particle": "#top" + }, + "elements": [ + { + "name": "Cube", + "from": [ 4, 4, 4 ], + "to": [ 12, 12, 12 ], + "faces": { + "down": { "texture": "#top", "uv": [ 4, 4, 12, 12 ] }, + "up": { "texture": "#bottom", "uv": [ 4, 4, 12, 12 ] }, + "north": { "texture": "#north", "uv": [ 4, 4, 12, 12 ] }, + "south": { "texture": "#south", "uv": [ 4, 4, 12, 12 ] }, + "west": { "texture": "#west", "uv": [ 4, 4, 12, 12 ] }, + "east": { "texture": "#east", "uv": [ 4, 4, 12, 12 ] } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/shapes/eightbyeight_all_tinted.json b/src/main/resources/assets/botania/models/block/shapes/eightbyeight_all_tinted.json new file mode 100644 index 000000000..4bd8721fe --- /dev/null +++ b/src/main/resources/assets/botania/models/block/shapes/eightbyeight_all_tinted.json @@ -0,0 +1,21 @@ +{ + "parent": "minecraft:block/block", + "textures": { + "particle": "#all" + }, + "elements": [ + { + "name": "Cube", + "from": [ 4, 4, 4 ], + "to": [ 12, 12, 12 ], + "faces": { + "down": { "texture": "#all", "uv": [ 4, 4, 12, 12 ], "tintindex": 0 }, + "up": { "texture": "#all", "uv": [ 4, 4, 12, 12 ], "tintindex": 0 }, + "north": { "texture": "#all", "uv": [ 4, 4, 12, 12 ], "tintindex": 0 }, + "south": { "texture": "#all", "uv": [ 4, 4, 12, 12 ], "tintindex": 0 }, + "west": { "texture": "#all", "uv": [ 4, 4, 12, 12 ], "tintindex": 0 }, + "east": { "texture": "#all", "uv": [ 4, 4, 12, 12 ], "tintindex": 0 } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/shapes/fifteen_high_all.json b/src/main/resources/assets/botania/models/block/shapes/fifteen_high_all.json new file mode 100644 index 000000000..bcca615cd --- /dev/null +++ b/src/main/resources/assets/botania/models/block/shapes/fifteen_high_all.json @@ -0,0 +1,19 @@ +{ + "parent": "minecraft:block/block", + "textures": { + "particle": "#all" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 15, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#all" }, + "north": { "uv": [ 0, 1, 16, 16 ], "texture": "#all", "cullface": "north" }, + "south": { "uv": [ 0, 1, 16, 16 ], "texture": "#all", "cullface": "south" }, + "west": { "uv": [ 0, 1, 16, 16 ], "texture": "#all", "cullface": "west" }, + "east": { "uv": [ 0, 1, 16, 16 ], "texture": "#all", "cullface": "east" } + } + } + ] +} diff --git a/src/main/resources/assets/botania/models/block/shapes/four_high_bottom_top.json b/src/main/resources/assets/botania/models/block/shapes/four_high_bottom_top.json new file mode 100644 index 000000000..8344c3415 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/shapes/four_high_bottom_top.json @@ -0,0 +1,20 @@ +{ + "parent": "minecraft:block/block", + "textures": { + "particle": "#side" + }, + "elements": [ + { + "from": [ 0, 0, 0 ], + "to": [ 16, 4, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 12, 16, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 12, 16, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 12, 16, 16 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 12, 16, 16 ], "texture": "#side", "cullface": "east" } + } + } + ] +} diff --git a/src/main/resources/assets/botania/models/block/shapes/miniIsland.json b/src/main/resources/assets/botania/models/block/shapes/miniIsland.json new file mode 100644 index 000000000..038eaa71a --- /dev/null +++ b/src/main/resources/assets/botania/models/block/shapes/miniIsland.json @@ -0,0 +1,182 @@ +{ + "__comment": "Author: wiiv", + "parent": "minecraft:block/block", + "display": { + "gui": { + "rotation": [ 30, 225, 0 ], + "translation": [ 0, 0, 0], + "scale":[ 0.75, 0.75, 0.75 ] + } + }, + "elements": [ + { + "name": "Layer1", + "from": [ 3.0, 6.0, 3.0 ], + "to": [ 13.0, 7.0, 13.0 ], + "faces": { + "north": { "texture": "#all", "uv": [ 0.0, 6.0, 5.0, 6.5 ] }, + "south": { "texture": "#all", "uv": [ 6.0, 6.0, 11.0, 6.5 ] }, + "west": { "texture": "#all", "uv": [ 0.0, 9.5, 5.0, 10.0 ] }, + "east": { "texture": "#all", "uv": [ 6.0, 9.5, 11.0, 10.0 ] }, + "up": { "texture": "#all", "uv": [ 0.0, 0.0, 5.0, 5.0 ] }, + "down": { "texture": "#all", "uv": [ 6.0, 0.0, 11.0, 5.0 ] } + } + }, + { + "name": "Layer2North", + "from": [ 5.0, 5.0, 3.0 ], + "to": [ 11.0, 6.0, 5.0 ], + "faces": { + "north": { "texture": "#all", "uv": [ 1.0, 6.5, 4.0, 7.0 ] }, + "east": { "texture": "#all", "uv": [ 10.0, 10.0, 11.0, 10.5 ] }, + "west": { "texture": "#all", "uv": [ 0.0, 10.0, 1.0, 10.5 ] }, + "down": { "texture": "#all", "uv": [ 7.0, 4.0, 10.0, 5.0 ] } + } + }, + { + "name": "Layer2South", + "from": [ 5.0, 5.0, 11.0 ], + "to": [ 11.0, 6.0, 13.0 ], + "faces": { + "east": { "texture": "#all", "uv": [ 6.0, 10.0, 7.0, 10.5 ] }, + "south": { "texture": "#all", "uv": [ 7.0, 6.5, 10.0, 7.0 ] }, + "west": { "texture": "#all", "uv": [ 4.0, 10.0, 5.0, 10.5 ] }, + "down": { "texture": "#all", "uv": [ 7.0, 0.0, 10.0, 1.0 ] } + } + }, + { + "name": "Layer2West", + "from": [ 3.0, 5.0, 5.0 ], + "to": [ 5.0, 6.0, 11.0 ], + "faces": { + "north": { "texture": "#all", "uv": [ 4.0, 6.5, 5.0, 7.0 ] }, + "south": { "texture": "#all", "uv": [ 6.0, 6.5, 7.0, 7.0 ] }, + "west": { "texture": "#all", "uv": [ 1.0, 10.0, 4.0, 10.5 ] }, + "down": { "texture": "#all", "uv": [ 6.0, 1.0, 7.0, 4.0 ] } + } + }, + { + "name": "Layer2East", + "from": [ 11.0, 5.0, 5.0 ], + "to": [ 13.0, 6.0, 11.0 ], + "faces": { + "north": { "texture": "#all", "uv": [ 0.0, 6.5, 1.0, 7.0 ] }, + "east": { "texture": "#all", "uv": [ 7.0, 10.0, 10.0, 10.5 ] }, + "south": { "texture": "#all", "uv": [ 10.0, 6.5, 11.0, 7.0 ] }, + "down": { "texture": "#all", "uv": [ 10.0, 1.0, 11.0, 4.0 ] } + } + }, + { + "name": "Layer3Center", + "from": [ 5.0, 4.0, 5.0 ], + "to": [ 11.0, 5.0, 11.0 ], + "faces": { + "north": { "texture": "#all", "uv": [ 1.0, 7.0, 4.0, 7.5 ] }, + "south": { "texture": "#all", "uv": [ 7.0, 7.0, 10.0, 7.5 ] }, + "west": { "texture": "#all", "uv": [ 1.0, 10.5, 4.0, 11.0 ] }, + "east": { "texture": "#all", "uv": [ 7.0, 10.5, 10.0, 11.0 ] }, + "down": { "texture": "#all", "uv": [ 7.0, 1.0, 10.0, 4.0 ] } + } + }, + { + "name": "Layer3North", + "from": [ 7.0, 4.0, 3.0 ], + "to": [ 9.0, 5.0, 5.0 ], + "faces": { + "north": { "texture": "#all", "uv": [ 2.0, 7.0, 3.0, 7.5 ] }, + "west": { "texture": "#all", "uv": [ 0.0, 10.5, 1.0, 11.0 ] }, + "east": { "texture": "#all", "uv": [ 10.0, 10.5, 11.0, 11.0 ] }, + "down": { "texture": "#all", "uv": [ 8.0, 4.0, 9.0, 5.0 ] } + } + }, + { + "name": "Layer3South", + "from": [ 7.0, 4.0, 11.0 ], + "to": [ 9.0, 5.0, 13.0 ], + "faces": { + "east": { "texture": "#all", "uv": [ 6.0, 10.5, 7.0, 11.0 ] }, + "south": { "texture": "#all", "uv": [ 8.0, 7.0, 9.0, 7.5 ] }, + "west": { "texture": "#all", "uv": [ 4.0, 10.5, 5.0, 11.0 ] }, + "down": { "texture": "#all", "uv": [ 8.0, 0.0, 9.0, 1.0 ] } + } + }, + { + "name": "Layer3West", + "from": [ 3.0, 4.0, 7.0 ], + "to": [ 5.0, 5.0, 9.0 ], + "faces": { + "north": { "texture": "#all", "uv": [ 4.0, 7.0, 5.0, 7.5 ] }, + "south": { "texture": "#all", "uv": [ 0.0, 7.0, 2.0, 7.5 ] }, + "west": { "texture": "#all", "uv": [ 2.0, 10.5, 3.0, 11.0 ] }, + "down": { "texture": "#all", "uv": [ 6.0, 2.0, 7.0, 3.0 ] } + } + }, + { + "name": "Layer3East", + "from": [ 11.0, 4.0, 7.0 ], + "to": [ 13.0, 5.0, 9.0 ], + "faces": { + "north": { "texture": "#all", "uv": [ 0.0, 7.0, 1.0, 7.5 ] }, + "east": { "texture": "#all", "uv": [ 8.0, 10.5, 9.0, 11.0 ] }, + "south": { "texture": "#all", "uv": [ 6.0, 7.0, 7.0, 7.5 ] }, + "down": { "texture": "#all", "uv": [ 10.0, 2.0, 11.0, 3.0 ] } + } + }, + { + "name": "Layer4North", + "from": [ 7.0, 3.0, 5.0 ], + "to": [ 9.0, 4.0, 7.0 ], + "faces": { + "north": { "texture": "#all", "uv": [ 2.0, 7.5, 3.0, 8.0 ] }, + "east": { "texture": "#all", "uv": [ 9.0, 11.0, 10.0, 11.5 ] }, + "west": { "texture": "#all", "uv": [ 1.0, 11.0, 2.0, 11.5 ] }, + "down": { "texture": "#all", "uv": [ 8.0, 3.0, 9.0, 4.0 ] } + } + }, + { + "name": "Layer4South", + "from": [ 7.0, 3.0, 9.0 ], + "to": [ 9.0, 4.0, 11.0 ], + "faces": { + "east": { "texture": "#all", "uv": [ 7.0, 11.0, 8.0, 11.5 ] }, + "south": { "texture": "#all", "uv": [ 8.0, 7.5, 9.0, 8.0 ] }, + "west": { "texture": "#all", "uv": [ 3.0, 11.0, 4.0, 11.5 ] }, + "down": { "texture": "#all", "uv": [ 8.0, 1.0, 9.0, 2.0 ] } + } + }, + { + "name": "Layer4West", + "from": [ 5.0, 3.0, 7.0 ], + "to": [ 7.0, 4.0, 9.0 ], + "faces": { + "north": { "texture": "#all", "uv": [ 3.0, 7.5, 4.0, 8.0 ] }, + "south": { "texture": "#all", "uv": [ 7.0, 7.5, 8.0, 8.0 ] }, + "west": { "texture": "#all", "uv": [ 2.0, 11.0, 3.0, 11.5 ] }, + "down": { "texture": "#all", "uv": [ 7.0, 2.0, 8.0, 3.0 ] } + } + }, + { + "name": "Layer4East", + "from": [ 9.0, 3.0, 7.0 ], + "to": [ 11.0, 4.0, 9.0 ], + "faces": { + "north": { "texture": "#all", "uv": [ 1.0, 7.5, 2.0, 8.0 ] }, + "east": { "texture": "#all", "uv": [ 8.0, 11.0, 9.0, 11.5 ] }, + "south": { "texture": "#all", "uv": [ 9.0, 7.5, 10.0, 8.0 ] }, + "down": { "texture": "#all", "uv": [ 9.0, 2.0, 10.0, 3.0 ] } + } + }, + { + "name": "Layer5", + "from": [ 7.0, 2.0, 7.0 ], + "to": [ 9.0, 3.0, 9.0 ], + "faces": { + "north": { "texture": "#all", "uv": [ 2.0, 8.0, 3.0, 8.5 ] }, + "south": { "texture": "#all", "uv": [ 8.0, 8.0, 9.0, 8.5 ] }, + "west": { "texture": "#all", "uv": [ 2.0, 11.5, 3.0, 12.0 ] }, + "east": { "texture": "#all", "uv": [ 8.0, 11.5, 9.0, 12.0 ] }, + "down": { "texture": "#all", "uv": [ 8.0, 2.0, 9.0, 3.0 ] } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/shapes/petal_apothecary.json b/src/main/resources/assets/botania/models/block/shapes/petal_apothecary.json new file mode 100644 index 000000000..debf7a786 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/shapes/petal_apothecary.json @@ -0,0 +1,138 @@ +{ + "__comment": "The texture is split apart to facilitate efficient use of the atlas. Sorry for the clutter!", + "parent": "minecraft:block/block", + "display": { + "gui": { + "rotation": [ 30, 225, 0 ], + "translation": [ 0, -1, 0], + "scale":[ 0.6, 0.6, 0.6 ] + } + }, + "elements": [ + { + "name": "gobletBase", + "from": [ 0.0, 0.0, 0.0 ], + "to": [ 16.0, 2.0, 16.0 ], + "faces": { + "west": { "texture": "#gobletbaseside", "uv": [ 0.0, 0.0, 16.0, 2.0 ] }, + "south": { "texture": "#gobletbaseside", "uv": [ 0.0, 3.0, 16.0, 5.0 ] }, + "east": { "texture": "#gobletbaseside", "uv": [ 0.0, 6.0, 16.0, 8.0 ] }, + "north": { "texture": "#gobletbaseside", "uv": [ 0.0, 9.0, 16.0, 11.0 ] }, + "up": { "texture": "#gobletbasetop", "uv": [ 0.0, 0.0, 16.0, 16.0 ] }, + "down": { "texture": "#gobletbasebottom", "uv": [ 0.0, 0.0, 16.0, 16.0 ], "cullface": "down" } + } + }, + { + "name": "gobletBase2", + "from": [ 1.0, 2.0, 1.0 ], + "to": [ 15.0, 3.0, 15.0 ], + "faces": { + "west": { "texture": "#gobletbase2side", "uv": [ 1.0, 0.0, 15.0, 1.0 ] }, + "south": { "texture": "#gobletbase2side", "uv": [ 1.0, 2.0, 15.0, 3.0 ] }, + "east": { "texture": "#gobletbase2side", "uv": [ 1.0, 4.0, 15.0, 5.0 ] }, + "north": { "texture": "#gobletbase2side", "uv": [ 1.0, 6.0, 15.0, 7.0 ] }, + "up": { "texture": "#gobletbase2top", "uv": [ 1.0, 1.0, 15.0, 15.0 ] } + } + }, + { + "name": "gobletBase3", + "from": [ 2.0, 3.0, 2.0 ], + "to": [ 14.0, 4.0, 14.0 ], + "faces": { + "west": { "texture": "#gobletbase3side", "uv": [ 2.0, 0.0, 14.0, 1.0 ] }, + "south": { "texture": "#gobletbase3side", "uv": [ 2.0, 2.0, 14.0, 3.0 ] }, + "east": { "texture": "#gobletbase3side", "uv": [ 2.0, 4.0, 14.0, 5.0 ] }, + "north": { "texture": "#gobletbase3side", "uv": [ 2.0, 6.0, 14.0, 7.0 ] }, + "up": { "texture": "#gobletbase3top", "uv": [ 2.0, 2.0, 14.0, 14.0 ] } + } + }, + { + "name": "gobletStand", + "from": [ 5.0, 4.0, 5.0 ], + "to": [ 11.0, 12.0, 11.0 ], + "faces": { + "west": { "texture": "#gobletstandside", "uv": [ 2.0, 0.0, 14.0, 9.0 ] }, + "south": { "texture": "#gobletstandside", "uv": [ 2.0, 0.0, 14.0, 9.0 ] }, + "east": { "texture": "#gobletstandside", "uv": [ 2.0, 9.0, 14.0, 16.0 ] }, + "north": { "texture": "#gobletstandside", "uv": [ 2.0, 9.0, 14.0, 16.0 ] } + } + }, + { + "name": "kelkBase", + "from": [ 4.0, 12.0, 4.0 ], + "to": [ 12.0, 13.0, 12.0 ], + "faces": { + "west": { "texture": "#kelkbaseside", "uv": [ 4.0, 0.0, 12.0, 1.0 ] }, + "south": { "texture": "#kelkbaseside", "uv": [ 4.0, 2.0, 12.0, 3.0 ] }, + "east": { "texture": "#kelkbaseside", "uv": [ 4.0, 4.0, 12.0, 5.0 ] }, + "north": { "texture": "#kelkbaseside", "uv": [ 4.0, 6.0, 12.0, 7.0 ] }, + "down": { "texture": "#kelkbasetopbottom", "uv": [ 9.0, 4.0, 16.0, 12.0 ] } + } + }, + { + "name": "kelkBase2", + "from": [ 3.0, 13.0, 3.0 ], + "to": [ 13.0, 14.0, 13.0 ], + "faces": { + "west": { "texture": "#kelkbase2side", "uv": [ 3.0, 0.0, 13.0, 1.0 ] }, + "south": { "texture": "#kelkbase2side", "uv": [ 3.0, 2.0, 13.0, 3.0 ] }, + "east": { "texture": "#kelkbase2side", "uv": [ 3.0, 4.0, 13.0, 5.0 ] }, + "north": { "texture": "#kelkbase2side", "uv": [ 3.0, 6.0, 13.0, 7.0 ] }, + "up": { "texture": "#kelkbase2top", "uv": [ 3.0, 3.0, 13.0, 13.0 ] }, + "down": { "texture": "#kelkbase2bottom", "uv": [ 3.0, 3.0, 13.0, 13.0 ] } + } + }, + { + "name": "kelkWallNorth", + "from": [ 3.0, 14.0, 2.0 ], + "to": [ 13.0, 20.0, 3.0 ], + "faces": { + "west": { "texture": "#kelkwall", "uv": [ 0.0, 1.0, 1.0, 7.0 ] }, + "north": { "texture": "#kelkwall", "uv": [ 1.0, 1.0, 11.0, 7.0 ] }, + "south": { "texture": "#kelkwall", "uv": [ 1.0, 9.0, 11.0, 15.0 ] }, + "east": { "texture": "#kelkwall", "uv": [ 11.0, 9.0, 12.0, 15.0 ] }, + "up": { "texture": "#kelkwall", "uv": [ 1.0, 0.0, 11.0, 1.0 ] }, + "down": { "texture": "#kelkwall", "uv": [ 1.0, 8.0, 11.0, 9.0 ] } + } + }, + { + "name": "kelkWallSouth", + "from": [ 3.0, 14.0, 13.0 ], + "to": [ 13.0, 20.0, 14.0 ], + "faces": { + "west": { "texture": "#kelkwall", "uv": [ 0.0, 1.0, 1.0, 7.0 ] }, + "north": { "texture": "#kelkwall", "uv": [ 1.0, 1.0, 11.0, 7.0 ] }, + "south": { "texture": "#kelkwall", "uv": [ 1.0, 9.0, 11.0, 15.0 ] }, + "east": { "texture": "#kelkwall", "uv": [ 11.0, 9.0, 12.0, 15.0 ] }, + "up": { "texture": "#kelkwall", "uv": [ 1.0, 0.0, 11.0, 1.0 ] }, + "down": { "texture": "#kelkwall", "uv": [ 1.0, 8.0, 11.0, 9.0 ] } + } + }, + { + "name": "kelkWallWest", + "from": [ 2.0, 14.0, 3.0 ], + "to": [ 3.0, 20.0, 13.0 ], + "faces": { + "north": { "texture": "#kelkwall", "uv": [ 0.0, 1.0, 1.0, 7.0 ] }, + "west": { "texture": "#kelkwall", "uv": [ 1.0, 1.0, 11.0, 7.0 ] }, + "east": { "texture": "#kelkwall", "uv": [ 1.0, 9.0, 11.0, 15.0 ] }, + "south": { "texture": "#kelkwall", "uv": [ 11.0, 9.0, 12.0, 15.0 ] }, + "up": { "texture": "#kelkwall", "uv": [ 13.0, 0.0, 14.0, 11.0 ] }, + "down": { "texture": "#kelkwall", "uv": [ 14.0, 0.0, 15.0, 11.0 ] } + } + }, + { + "name": "kelkWallEast", + "from": [ 13.0, 14.0, 3.0 ], + "to": [ 14.0, 20.0, 13.0 ], + "faces": { + "north": { "texture": "#kelkwall", "uv": [ 0.0, 1.0, 1.0, 7.0 ] }, + "west": { "texture": "#kelkwall", "uv": [ 1.0, 1.0, 11.0, 7.0 ] }, + "east": { "texture": "#kelkwall", "uv": [ 1.0, 9.0, 11.0, 15.0 ] }, + "south": { "texture": "#kelkwall", "uv": [ 11.0, 9.0, 12.0, 15.0 ] }, + "up": { "texture": "#kelkwall", "uv": [ 13.0, 0.0, 14.0, 11.0 ] }, + "down": { "texture": "#kelkwall", "uv": [ 14.0, 0.0, 15.0, 11.0 ] } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/shapes/pool.json b/src/main/resources/assets/botania/models/block/shapes/pool.json new file mode 100644 index 000000000..0a8f0619c --- /dev/null +++ b/src/main/resources/assets/botania/models/block/shapes/pool.json @@ -0,0 +1,69 @@ +{ + "parent": "minecraft:block/block", + "textures": { + "particle": "botania:blocks/livingrock0" + }, + "elements": [ + { + "name": "Base", + "from": [ 0.0, 0.0, 0.0 ], + "to": [ 16.0, 1.0, 16.0 ], + "faces": { + "west": { "texture": "#all", "uv": [ 0.0, 4.0, 4.0, 4.25 ], "tintindex": 0 }, + "north": { "texture": "#all", "uv": [ 4.0, 4.0, 8.0, 4.25 ], "tintindex": 0 }, + "east": { "texture": "#all", "uv": [ 8.0, 4.0, 12.0, 4.25 ], "tintindex": 0 }, + "south": { "texture": "#all", "uv": [ 12.0, 4.0, 16.0, 4.25 ], "tintindex": 0 }, + "up": { "texture": "#all", "uv": [ 4.0, 0.0, 8.0, 4.0 ], "tintindex": 0 }, + "down": { "texture": "#all", "uv": [ 8.0, 0.0, 12.0, 4.0 ], "tintindex": 0, "cullface": "down" } + } + }, + { + "name": "SideSouth", + "from": [ 0.0, 1.0, 15.0 ], + "to": [ 16.0, 8.0, 16.0 ], + "faces": { + "west": { "texture": "#all", "uv": [ 0.0, 0.25, 0.25, 2.0 ], "tintindex": 0, "cullface": "west" }, + "north": { "texture": "#all", "uv": [ 0.25, 0.25, 4.0, 2.0 ], "tintindex": 0 }, + "east": { "texture": "#all", "uv": [ 4.0, 0.25, 4.25, 2.0 ], "tintindex": 0, "cullface": "east" }, + "south": { "texture": "#all", "uv": [ 4.25, 0.25, 8.0, 2.0 ], "tintindex": 0, "cullface": "south" }, + "up": { "texture": "#all", "uv": [ 0.25, 0.0, 4.0, 0.25 ], "tintindex": 0 }, + "down": { "texture": "#all", "uv": [ 4.25, 8.0, 16.0, 0.25 ], "tintindex": 0 } + } + }, + { + "name": "SideNorth", + "from": [ 0.0, 1.0, 0.0 ], + "to": [ 16.0, 8.0, 1.0 ], + "faces": { + "west": { "texture": "#all", "uv": [ 0.0, 0.25, 0.25, 2.0 ], "tintindex": 0, "cullface": "west" }, + "north": { "texture": "#all", "uv": [ 0.25, 0.25, 4.0, 2.0 ], "tintindex": 0, "cullface": "north" }, + "east": { "texture": "#all", "uv": [ 4.0, 0.25, 4.25, 2.0 ], "tintindex": 0, "cullface": "east" }, + "south": { "texture": "#all", "uv": [ 4.25, 0.25, 8.0, 2.0 ], "tintindex": 0 }, + "up": { "texture": "#all", "uv": [ 0.25, 0.0, 4.0, 0.25 ], "tintindex": 0 }, + "down": { "texture": "#all", "uv": [ 4.25, 8.0, 16.0, 0.25 ], "tintindex": 0 } + } + }, + { + "name": "SideWest", + "from": [ 0.0, 1.0, 1.0 ], + "to": [ 1.0, 8.0, 15.0 ], + "faces": { + "west": { "texture": "#all", "uv": [ 0.0, 3.5, 3.5, 5.25 ], "tintindex": 0, "cullface": "west" }, + "east": { "texture": "#all", "uv": [ 3.75, 3.5, 7.25, 5.25 ], "tintindex": 0 }, + "up": { "texture": "#all", "uv": [ 3.5, 1.0, 3.75, 3.5 ], "tintindex": 0 }, + "down": { "texture": "#all", "uv": [ 3.75, 1.0, 4.0, 3.5 ], "tintindex": 0 } + } + }, + { + "name": "SideEast", + "from": [ 15.0, 1.0, 1.0 ], + "to": [ 16.0, 8.0, 15.0 ], + "faces": { + "west": { "texture": "#all", "uv": [ 0.0, 3.5, 3.5, 5.25 ], "tintindex": 0 }, + "east": { "texture": "#all", "uv": [ 3.75, 3.5, 7.25, 5.25 ], "tintindex": 0, "cullface": "east" }, + "up": { "texture": "#all", "uv": [ 3.5, 1.0, 3.75, 3.5 ], "tintindex": 0 }, + "down": { "texture": "#all", "uv": [ 3.75, 1.0, 4.0, 3.5 ], "tintindex": 0 } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/shapes/pool_full.json b/src/main/resources/assets/botania/models/block/shapes/pool_full.json new file mode 100644 index 000000000..6342e2f6d --- /dev/null +++ b/src/main/resources/assets/botania/models/block/shapes/pool_full.json @@ -0,0 +1,77 @@ +{ + "parent": "minecraft:block/block", + "textures": { + "particle": "#all" + }, + "elements": [ + { + "name": "Base", + "from": [ 0.0, 0.0, 0.0 ], + "to": [ 16.0, 1.0, 16.0 ], + "faces": { + "west": { "texture": "#all", "uv": [ 0.0, 4.0, 4.0, 4.25 ], "tintindex": 0 }, + "north": { "texture": "#all", "uv": [ 4.0, 4.0, 8.0, 4.25 ], "tintindex": 0 }, + "east": { "texture": "#all", "uv": [ 8.0, 4.0, 12.0, 4.25 ], "tintindex": 0 }, + "south": { "texture": "#all", "uv": [ 12.0, 4.0, 16.0, 4.25 ], "tintindex": 0 }, + "up": { "texture": "#all", "uv": [ 4.0, 0.0, 8.0, 4.0 ], "tintindex": 0 }, + "down": { "texture": "#all", "uv": [ 8.0, 0.0, 12.0, 4.0 ], "tintindex": 0, "cullface": "down" } + } + }, + { + "name": "SideSouth", + "from": [ 0.0, 1.0, 15.0 ], + "to": [ 16.0, 8.0, 16.0 ], + "faces": { + "west": { "texture": "#all", "uv": [ 0.0, 0.25, 0.25, 2.0 ], "tintindex": 0, "cullface": "west" }, + "north": { "texture": "#all", "uv": [ 0.25, 0.25, 4.0, 2.0 ], "tintindex": 0 }, + "east": { "texture": "#all", "uv": [ 4.0, 0.25, 4.25, 2.0 ], "tintindex": 0, "cullface": "east" }, + "south": { "texture": "#all", "uv": [ 4.25, 0.25, 8.0, 2.0 ], "tintindex": 0, "cullface": "south" }, + "up": { "texture": "#all", "uv": [ 0.25, 0.0, 4.0, 0.25 ], "tintindex": 0 }, + "down": { "texture": "#all", "uv": [ 4.25, 8.0, 16.0, 0.25 ], "tintindex": 0 } + } + }, + { + "name": "SideNorth", + "from": [ 0.0, 1.0, 0.0 ], + "to": [ 16.0, 8.0, 1.0 ], + "faces": { + "west": { "texture": "#all", "uv": [ 0.0, 0.25, 0.25, 2.0 ], "tintindex": 0, "cullface": "west" }, + "north": { "texture": "#all", "uv": [ 0.25, 0.25, 4.0, 2.0 ], "tintindex": 0, "cullface": "north" }, + "east": { "texture": "#all", "uv": [ 4.0, 0.25, 4.25, 2.0 ], "tintindex": 0, "cullface": "east" }, + "south": { "texture": "#all", "uv": [ 4.25, 0.25, 8.0, 2.0 ], "tintindex": 0 }, + "up": { "texture": "#all", "uv": [ 0.25, 0.0, 4.0, 0.25 ], "tintindex": 0 }, + "down": { "texture": "#all", "uv": [ 4.25, 8.0, 16.0, 0.25 ], "tintindex": 0 } + } + }, + { + "name": "SideWest", + "from": [ 0.0, 1.0, 1.0 ], + "to": [ 1.0, 8.0, 15.0 ], + "faces": { + "west": { "texture": "#all", "uv": [ 0.0, 3.5, 3.5, 5.25 ], "tintindex": 0, "cullface": "west" }, + "east": { "texture": "#all", "uv": [ 3.75, 3.5, 7.25, 5.25 ], "tintindex": 0 }, + "up": { "texture": "#all", "uv": [ 3.5, 1.0, 3.75, 3.5 ], "tintindex": 0 }, + "down": { "texture": "#all", "uv": [ 3.75, 1.0, 4.0, 3.5 ], "tintindex": 0 } + } + }, + { + "name": "SideEast", + "from": [ 15.0, 1.0, 1.0 ], + "to": [ 16.0, 8.0, 15.0 ], + "faces": { + "west": { "texture": "#all", "uv": [ 0.0, 3.5, 3.5, 5.25 ], "tintindex": 0 }, + "east": { "texture": "#all", "uv": [ 3.75, 3.5, 7.25, 5.25 ], "tintindex": 0, "cullface": "east" }, + "up": { "texture": "#all", "uv": [ 3.5, 1.0, 3.75, 3.5 ], "tintindex": 0 }, + "down": { "texture": "#all", "uv": [ 3.75, 1.0, 4.0, 3.5 ], "tintindex": 0 } + } + }, + { + "name": "Liquid", + "from": [ 1.0, 7.0, 1.0 ], + "to": [ 15.0, 7.0, 15.0 ], + "faces": { + "up": { "texture": "#liquid", "uv": [ 1.0, 1.0, 15.0, 15.0 ] } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/shapes/spreader.json b/src/main/resources/assets/botania/models/block/shapes/spreader.json new file mode 100644 index 000000000..32ca9a9a0 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/shapes/spreader.json @@ -0,0 +1,120 @@ +{ + "parent": "minecraft:block/block", + "textures": { + "particle": "#material" + }, + "elements": [ + { + "name": "inside", + "from": [ 5.0, 4.0, 5.0 ], + "to": [ 11.0, 10.0, 11.0 ], + "faces": { + "north": { "texture": "#inside", "uv": [ 2.0, 2.0, 14.0, 14.0 ] }, + "east": { "texture": "#inside", "uv": [ 2.0, 2.0, 14.0, 14.0 ] }, + "south": { "texture": "#inside", "uv": [ 2.0, 2.0, 14.0, 14.0 ] }, + "west": { "texture": "#inside", "uv": [ 2.0, 2.0, 14.0, 14.0 ] }, + "up": { "texture": "#inside", "uv": [ 2.0, 2.0, 14.0, 14.0 ] }, + "down": { "texture": "#inside", "uv": [ 2.0, 2.0, 14.0, 14.0 ] } + } + }, + { + "name": "bottom", + "from": [ 1.0, 0.0, 1.0 ], + "to": [ 15.0, 1.0, 15.0 ], + "faces": { + "north": { "texture": "#material", "uv": [ 1.0, 1.0, 15.0, 2.0 ], "tintindex": 0 }, + "east": { "texture": "#material", "uv": [ 1.0, 1.0, 15.0, 2.0 ], "tintindex": 0 }, + "south": { "texture": "#material", "uv": [ 1.0, 1.0, 15.0, 2.0 ], "tintindex": 0 }, + "west": { "texture": "#material", "uv": [ 1.0, 1.0, 15.0, 2.0 ], "tintindex": 0 }, + "up": { "texture": "#material", "uv": [ 1.0, 1.0, 15.0, 15.0 ], "tintindex": 0 }, + "down": { "texture": "#material", "uv": [ 1.0, 1.0, 15.0, 15.0 ], "tintindex": 0 } + } + }, + { + "name": "back", + "from": [ 1.0, 1.0, 14.0 ], + "to": [ 15.0, 13.0, 15.0 ], + "faces": { + "north": { "texture": "#material", "uv": [ 0.0, 0.0, 14.0, 12.0 ], "tintindex": 0 }, + "east": { "texture": "#material", "uv": [ 0.0, 0.0, 1.0, 12.0 ], "tintindex": 0 }, + "south": { "texture": "#material", "uv": [ 0.0, 0.0, 14.0, 12.0 ], "tintindex": 0 }, + "west": { "texture": "#material", "uv": [ 0.0, 0.0, 1.0, 12.0 ], "tintindex": 0 }, + "up": { "texture": "#material", "uv": [ 0.0, 0.0, 14.0, 1.0 ], "tintindex": 0 }, + "down": { "texture": "#material", "uv": [ 0.0, 0.0, 14.0, 1.0 ], "tintindex": 0 } + } + }, + { + "name": "top", + "from": [ 1.0, 13.0, 1.0 ], + "to": [ 15.0, 14.0, 15.0 ], + "faces": { + "north": { "texture": "#material", "uv": [ 0.0, 0.0, 14.0, 1.0 ], "tintindex": 0 }, + "east": { "texture": "#material", "uv": [ 0.0, 0.0, 14.0, 1.0 ], "tintindex": 0 }, + "south": { "texture": "#material", "uv": [ 0.0, 0.0, 14.0, 1.0 ], "tintindex": 0 }, + "west": { "texture": "#material", "uv": [ 0.0, 0.0, 14.0, 1.0 ], "tintindex": 0 }, + "up": { "texture": "#material", "uv": [ 1.0, 1.0, 15.0, 15.0 ], "tintindex": 0 }, + "down": { "texture": "#material", "uv": [ 1.0, 1.0, 15.0, 15.0 ], "tintindex": 0 } + } + }, + { + "name": "west", + "from": [ 1.0, 1.0, 2.0 ], + "to": [ 2.0, 13.0, 14.0 ], + "faces": { + "east": { "texture": "#side", "uv": [ 2.0, 2.0, 14.0, 14.0 ], "tintindex": 0 }, + "west": { "texture": "#side", "uv": [ 2.0, 2.0, 14.0, 14.0 ], "tintindex": 0 } + } + }, + { + "name": "east", + "from": [ 14.0, 1.0, 2.0 ], + "to": [ 15.0, 13.0, 14.0 ], + "faces": { + "east": { "texture": "#side", "uv": [ 2.0, 2.0, 14.0, 14.0 ], "tintindex": 0 }, + "west": { "texture": "#side", "uv": [ 2.0, 2.0, 14.0, 14.0 ], "tintindex": 0 } + } + }, + { + "name": "front_bottom", + "from": [ 6.0, 1.0, 1.0 ], + "to": [ 10.0, 5.0, 2.0 ], + "faces": { + "north": { "texture": "#material", "uv": [ 0.0, 0.0, 4.0, 4.0 ], "tintindex": 0 }, + "south": { "texture": "#material", "uv": [ 0.0, 0.0, 4.0, 4.0 ], "tintindex": 0 }, + "up": { "texture": "#material", "uv": [ 0.0, 0.0, 4.0, 1.0 ], "tintindex": 0 } + } + }, + { + "name": "front_top", + "from": [ 6.0, 9.0, 1.0 ], + "to": [ 10.0, 13.0, 2.0 ], + "faces": { + "north": { "texture": "#material", "uv": [ 0.0, 0.0, 4.0, 4.0 ], "tintindex": 0 }, + "south": { "texture": "#material", "uv": [ 0.0, 0.0, 4.0, 4.0 ], "tintindex": 0 }, + "down": { "texture": "#material", "uv": [ 0.0, 0.0, 4.0, 1.0 ], "tintindex": 0 } + } + }, + { + "name": "front_left", + "from": [ 1.0, 1.0, 1.0 ], + "to": [ 6.0, 13.0, 2.0 ], + "faces": { + "north": { "texture": "#material", "uv": [ 1.0, 1.0, 5.0, 13.0 ], "tintindex": 0 }, + "east": { "texture": "#material", "uv": [ 1.0, 1.0, 2.0, 13.0 ], "tintindex": 0 }, + "south": { "texture": "#material", "uv": [ 1.0, 1.0, 5.0, 13.0 ], "tintindex": 0 }, + "west": { "texture": "#material", "uv": [ 1.0, 1.0, 2.0, 13.0 ], "tintindex": 0 } + } + }, + { + "name": "front_right", + "from": [ 10.0, 1.0, 1.0 ], + "to": [ 15.0, 13.0, 2.0 ], + "faces": { + "north": { "texture": "#material", "uv": [ 12.0, 1.0, 16.0, 13.0 ], "tintindex": 0 }, + "east": { "texture": "#material", "uv": [ 15.0, 1.0, 16.0, 13.0 ], "tintindex": 0 }, + "south": { "texture": "#material", "uv": [ 12.0, 1.0, 16.0, 13.0 ], "tintindex": 0 }, + "west": { "texture": "#material", "uv": [ 15.0, 1.0, 16.0, 13.0 ], "tintindex": 0 } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/shapes/tenbyten_all.json b/src/main/resources/assets/botania/models/block/shapes/tenbyten_all.json new file mode 100644 index 000000000..6691908eb --- /dev/null +++ b/src/main/resources/assets/botania/models/block/shapes/tenbyten_all.json @@ -0,0 +1,21 @@ +{ + "parent": "minecraft:block/block", + "textures": { + "particle": "#all" + }, + "elements": [ + { + "name": "Cube", + "from": [ 3, 3, 3 ], + "to": [ 13, 13, 13 ], + "faces": { + "down": { "texture": "#all", "uv": [ 3, 3, 13, 13 ] }, + "up": { "texture": "#all", "uv": [ 3, 3, 13, 13 ] }, + "north": { "texture": "#all", "uv": [ 3, 3, 13, 13 ] }, + "south": { "texture": "#all", "uv": [ 3, 3, 13, 13 ] }, + "west": { "texture": "#all", "uv": [ 3, 3, 13, 13 ] }, + "east": { "texture": "#all", "uv": [ 3, 3, 13, 13 ] } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/shapes/tenbyten_top_tinted.json b/src/main/resources/assets/botania/models/block/shapes/tenbyten_top_tinted.json new file mode 100644 index 000000000..d77c17bc9 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/shapes/tenbyten_top_tinted.json @@ -0,0 +1,21 @@ +{ + "parent": "minecraft:block/block", + "textures": { + "particle": "#all" + }, + "elements": [ + { + "name": "Cube", + "from": [ 3, 3, 3 ], + "to": [ 13, 13, 13 ], + "faces": { + "down": { "texture": "#all", "uv": [ 3, 3, 13, 13 ], "tintindex": 0 }, + "up": { "texture": "#top", "uv": [ 3, 3, 13, 13 ], "tintindex": 0 }, + "north": { "texture": "#all", "uv": [ 3, 3, 13, 13 ], "tintindex": 0 }, + "south": { "texture": "#all", "uv": [ 3, 3, 13, 13 ], "tintindex": 0 }, + "west": { "texture": "#all", "uv": [ 3, 3, 13, 13 ], "tintindex": 0 }, + "east": { "texture": "#all", "uv": [ 3, 3, 13, 13 ], "tintindex": 0 } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/shapes/three_high_bottom_top.json b/src/main/resources/assets/botania/models/block/shapes/three_high_bottom_top.json new file mode 100644 index 000000000..20f9257d0 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/shapes/three_high_bottom_top.json @@ -0,0 +1,20 @@ +{ + "parent": "minecraft:block/block", + "textures": { + "particle": "#side" + }, + "elements": [ + { + "from": [ 0, 0, 0 ], + "to": [ 16, 3, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 13, 16, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 13, 16, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 13, 16, 16 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 13, 16, 16 ], "texture": "#side", "cullface": "east" } + } + } + ] +} diff --git a/src/main/resources/assets/botania/models/block/shapes/twelve_high_bottom_top.json b/src/main/resources/assets/botania/models/block/shapes/twelve_high_bottom_top.json new file mode 100644 index 000000000..d27a32522 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/shapes/twelve_high_bottom_top.json @@ -0,0 +1,20 @@ +{ + "parent": "minecraft:block/block", + "textures": { + "particle": "#top" + }, + "elements": [ + { + "from": [ 0, 0, 0 ], + "to": [ 16, 12, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 4, 16, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 4, 16, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 4, 16, 16 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 4, 16, 16 ], "texture": "#side", "cullface": "east" } + } + } + ] +} diff --git a/src/main/resources/assets/botania/models/block/shimmerrock.json b/src/main/resources/assets/botania/models/block/shimmerrock.json new file mode 100644 index 000000000..ba5c0fd20 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/shimmerrock.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/shimmerrock" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/shimmerwood_planks.json b/src/main/resources/assets/botania/models/block/shimmerwood_planks.json new file mode 100644 index 000000000..2843c22c4 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/shimmerwood_planks.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/shimmerwoodPlanks" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/spark_tinkerer.json b/src/main/resources/assets/botania/models/block/spark_tinkerer.json new file mode 100644 index 000000000..3466d1c1d --- /dev/null +++ b/src/main/resources/assets/botania/models/block/spark_tinkerer.json @@ -0,0 +1,8 @@ +{ + "parent": "botania:block/shapes/three_high_bottom_top", + "textures": { + "bottom": "botania:blocks/sparkChanger0", + "top": "botania:blocks/sparkChanger1", + "side": "botania:blocks/sparkChanger2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/spectral_platform.json b/src/main/resources/assets/botania/models/block/spectral_platform.json new file mode 100644 index 000000000..feee92618 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/spectral_platform.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/platform1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/starfield_creator.json b/src/main/resources/assets/botania/models/block/starfield_creator.json new file mode 100644 index 000000000..f2e797e20 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/starfield_creator.json @@ -0,0 +1,8 @@ +{ + "parent": "botania:block/shapes/four_high_bottom_top", + "textures": { + "bottom": "botania:blocks/starfield0", + "top": "botania:blocks/starfield1", + "side": "botania:blocks/starfield2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/terra_plate.json b/src/main/resources/assets/botania/models/block/terra_plate.json new file mode 100644 index 000000000..22f023eff --- /dev/null +++ b/src/main/resources/assets/botania/models/block/terra_plate.json @@ -0,0 +1,8 @@ +{ + "parent": "botania:block/shapes/three_high_bottom_top", + "textures": { + "bottom": "botania:blocks/terraPlate0", + "top": "botania:blocks/terraPlate1", + "side": "botania:blocks/terraPlate2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/terrasteel_block.json b/src/main/resources/assets/botania/models/block/terrasteel_block.json new file mode 100644 index 000000000..add746c6d --- /dev/null +++ b/src/main/resources/assets/botania/models/block/terrasteel_block.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "botania:blocks/storage1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/tiny_planet_block.json b/src/main/resources/assets/botania/models/block/tiny_planet_block.json new file mode 100644 index 000000000..62c80768e --- /dev/null +++ b/src/main/resources/assets/botania/models/block/tiny_planet_block.json @@ -0,0 +1,6 @@ +{ + "parent": "botania:block/shapes/tenbyten_all", + "textures": { + "all": "botania:blocks/tinyPlanetBlock" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/tiny_potato.json b/src/main/resources/assets/botania/models/block/tiny_potato.json new file mode 100644 index 000000000..84f06fe5f --- /dev/null +++ b/src/main/resources/assets/botania/models/block/tiny_potato.json @@ -0,0 +1,22 @@ +{ + "parent": "minecraft:block/block", + "textures": { + "all": "botania:model/tinyPotatoCopy", + "particle": "botania:model/tinyPotatoCopy" + }, + "elements": [ + { + "name": "Po Ta To", + "from": [ 6.0, 0.0, 6.0 ], + "to": [ 10.0, 6.0, 10.0 ], + "faces": { + "west": { "texture": "#all", "uv": [ 0.0, 4.0, 4.0, 10.0 ] }, + "north": { "texture": "#all", "uv": [ 4.0, 4.0, 8.0, 10.0 ] }, + "east": { "texture": "#all", "uv": [ 8.0, 4.0, 12.0, 10.0 ] }, + "south": { "texture": "#all", "uv": [ 12.0, 4.0, 16.0, 10.0 ] }, + "up": { "texture": "#all", "uv": [ 4.0, 0.0, 8.0, 4.0 ] }, + "down": { "texture": "#all", "uv": [ 8.0, 0.0, 12.0, 4.0 ], "cullface": "down" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/trodden_dirt.json b/src/main/resources/assets/botania/models/block/trodden_dirt.json new file mode 100644 index 000000000..3547f8951 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/trodden_dirt.json @@ -0,0 +1,6 @@ +{ + "parent": "botania:block/shapes/fifteen_high_all", + "textures": { + "all": "botania:blocks/dirtPath" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/turntable.json b/src/main/resources/assets/botania/models/block/turntable.json new file mode 100644 index 000000000..9fbef02b7 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/turntable.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/cube_bottom_top", + "textures": { + "bottom": "botania:blocks/turntable1", + "top": "botania:blocks/turntable0", + "side": "botania:blocks/turntable1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/unstable_beacon.json b/src/main/resources/assets/botania/models/block/unstable_beacon.json new file mode 100644 index 000000000..2d0e6eb60 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/unstable_beacon.json @@ -0,0 +1,7 @@ +{ + "parent": "botania:block/shapes/tenbyten_top_tinted", + "textures": { + "all": "botania:blocks/manaBeacon0", + "top": "botania:blocks/manaBeacon1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/unstable_cube.json b/src/main/resources/assets/botania/models/block/unstable_cube.json new file mode 100644 index 000000000..9be86d7a0 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/unstable_cube.json @@ -0,0 +1,6 @@ +{ + "parent": "botania:block/shapes/eightbyeight_all_tinted", + "textures": { + "all": "botania:blocks/unstableBlock" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/vivid_grass.json b/src/main/resources/assets/botania/models/block/vivid_grass.json new file mode 100644 index 000000000..a6b3c3112 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/vivid_grass.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/cube_bottom_top", + "textures": { + "bottom": "minecraft:blocks/dirt", + "top": "botania:blocks/altGrass4", + "side": "botania:blocks/altGrass5" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/walls/desert_cobble_wall_post.json b/src/main/resources/assets/botania/models/block/walls/desert_cobble_wall_post.json new file mode 100644 index 000000000..33636683b --- /dev/null +++ b/src/main/resources/assets/botania/models/block/walls/desert_cobble_wall_post.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_post", + "textures": { + "wall": "botania:blocks/biomeStone13" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/walls/desert_cobble_wall_side.json b/src/main/resources/assets/botania/models/block/walls/desert_cobble_wall_side.json new file mode 100644 index 000000000..c8943f49c --- /dev/null +++ b/src/main/resources/assets/botania/models/block/walls/desert_cobble_wall_side.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_side", + "textures": { + "wall": "botania:blocks/biomeStone13" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/walls/dreamwood_wall_post.json b/src/main/resources/assets/botania/models/block/walls/dreamwood_wall_post.json new file mode 100644 index 000000000..451c92071 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/walls/dreamwood_wall_post.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_post", + "textures": { + "wall": "botania:blocks/dreamwood0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/walls/dreamwood_wall_side.json b/src/main/resources/assets/botania/models/block/walls/dreamwood_wall_side.json new file mode 100644 index 000000000..2f5e5ae88 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/walls/dreamwood_wall_side.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_side", + "textures": { + "wall": "botania:blocks/dreamwood0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/walls/forest_cobble_wall_post.json b/src/main/resources/assets/botania/models/block/walls/forest_cobble_wall_post.json new file mode 100644 index 000000000..0a10f6f38 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/walls/forest_cobble_wall_post.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_post", + "textures": { + "wall": "botania:blocks/biomeStone8" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/walls/forest_cobble_wall_side.json b/src/main/resources/assets/botania/models/block/walls/forest_cobble_wall_side.json new file mode 100644 index 000000000..0ca607833 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/walls/forest_cobble_wall_side.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_side", + "textures": { + "wall": "botania:blocks/biomeStone8" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/walls/fungal_cobble_wall_post.json b/src/main/resources/assets/botania/models/block/walls/fungal_cobble_wall_post.json new file mode 100644 index 000000000..ce1756c91 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/walls/fungal_cobble_wall_post.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_post", + "textures": { + "wall": "botania:blocks/biomeStone11" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/walls/fungal_cobble_wall_side.json b/src/main/resources/assets/botania/models/block/walls/fungal_cobble_wall_side.json new file mode 100644 index 000000000..7abed6202 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/walls/fungal_cobble_wall_side.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_side", + "textures": { + "wall": "botania:blocks/biomeStone11" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/walls/livingrock_wall_post.json b/src/main/resources/assets/botania/models/block/walls/livingrock_wall_post.json new file mode 100644 index 000000000..ea11aa2fa --- /dev/null +++ b/src/main/resources/assets/botania/models/block/walls/livingrock_wall_post.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_post", + "textures": { + "wall": "botania:blocks/livingrock0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/walls/livingrock_wall_side.json b/src/main/resources/assets/botania/models/block/walls/livingrock_wall_side.json new file mode 100644 index 000000000..7102bcfdf --- /dev/null +++ b/src/main/resources/assets/botania/models/block/walls/livingrock_wall_side.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_side", + "textures": { + "wall": "botania:blocks/livingrock0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/walls/livingwood_wall_post.json b/src/main/resources/assets/botania/models/block/walls/livingwood_wall_post.json new file mode 100644 index 000000000..ff3d1f95c --- /dev/null +++ b/src/main/resources/assets/botania/models/block/walls/livingwood_wall_post.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_post", + "textures": { + "wall": "botania:blocks/livingwood0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/walls/livingwood_wall_side.json b/src/main/resources/assets/botania/models/block/walls/livingwood_wall_side.json new file mode 100644 index 000000000..50761f621 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/walls/livingwood_wall_side.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_side", + "textures": { + "wall": "botania:blocks/livingwood0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/walls/mesa_cobble_wall_post.json b/src/main/resources/assets/botania/models/block/walls/mesa_cobble_wall_post.json new file mode 100644 index 000000000..8fb930ad8 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/walls/mesa_cobble_wall_post.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_post", + "textures": { + "wall": "botania:blocks/biomeStone15" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/walls/mesa_cobble_wall_side.json b/src/main/resources/assets/botania/models/block/walls/mesa_cobble_wall_side.json new file mode 100644 index 000000000..c968443d8 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/walls/mesa_cobble_wall_side.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_side", + "textures": { + "wall": "botania:blocks/biomeStone15" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/walls/mountain_cobble_wall_post.json b/src/main/resources/assets/botania/models/block/walls/mountain_cobble_wall_post.json new file mode 100644 index 000000000..b00803b65 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/walls/mountain_cobble_wall_post.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_post", + "textures": { + "wall": "botania:blocks/biomeStone10" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/walls/mountain_cobble_wall_side.json b/src/main/resources/assets/botania/models/block/walls/mountain_cobble_wall_side.json new file mode 100644 index 000000000..350481030 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/walls/mountain_cobble_wall_side.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_side", + "textures": { + "wall": "botania:blocks/biomeStone10" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/walls/plains_cobble_wall_post.json b/src/main/resources/assets/botania/models/block/walls/plains_cobble_wall_post.json new file mode 100644 index 000000000..6ea6ee189 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/walls/plains_cobble_wall_post.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_post", + "textures": { + "wall": "botania:blocks/biomeStone9" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/walls/plains_cobble_wall_side.json b/src/main/resources/assets/botania/models/block/walls/plains_cobble_wall_side.json new file mode 100644 index 000000000..7b2077e0a --- /dev/null +++ b/src/main/resources/assets/botania/models/block/walls/plains_cobble_wall_side.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_side", + "textures": { + "wall": "botania:blocks/biomeStone9" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/walls/swamp_cobble_wall_post.json b/src/main/resources/assets/botania/models/block/walls/swamp_cobble_wall_post.json new file mode 100644 index 000000000..67d8fe9fa --- /dev/null +++ b/src/main/resources/assets/botania/models/block/walls/swamp_cobble_wall_post.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_post", + "textures": { + "wall": "botania:blocks/biomeStone12" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/walls/swamp_cobble_wall_side.json b/src/main/resources/assets/botania/models/block/walls/swamp_cobble_wall_side.json new file mode 100644 index 000000000..cbda4914e --- /dev/null +++ b/src/main/resources/assets/botania/models/block/walls/swamp_cobble_wall_side.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_side", + "textures": { + "wall": "botania:blocks/biomeStone12" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/walls/taiga_cobble_wall_post.json b/src/main/resources/assets/botania/models/block/walls/taiga_cobble_wall_post.json new file mode 100644 index 000000000..20ac75792 --- /dev/null +++ b/src/main/resources/assets/botania/models/block/walls/taiga_cobble_wall_post.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_post", + "textures": { + "wall": "botania:blocks/biomeStone14" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/block/walls/taiga_cobble_wall_side.json b/src/main/resources/assets/botania/models/block/walls/taiga_cobble_wall_side.json new file mode 100644 index 000000000..4fa74426f --- /dev/null +++ b/src/main/resources/assets/botania/models/block/walls/taiga_cobble_wall_side.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_side", + "textures": { + "wall": "botania:blocks/biomeStone14" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/aesirRing.json b/src/main/resources/assets/botania/models/item/aesirRing.json new file mode 100644 index 000000000..37830baf7 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/aesirRing.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/aesirRing" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/ancientWill0.json b/src/main/resources/assets/botania/models/item/ancientWill0.json new file mode 100644 index 000000000..8617367b9 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/ancientWill0.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/ancientWill0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/ancientWill1.json b/src/main/resources/assets/botania/models/item/ancientWill1.json new file mode 100644 index 000000000..03d79a318 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/ancientWill1.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/ancientWill1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/ancientWill2.json b/src/main/resources/assets/botania/models/item/ancientWill2.json new file mode 100644 index 000000000..2b671db8b --- /dev/null +++ b/src/main/resources/assets/botania/models/item/ancientWill2.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/ancientWill2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/ancientWill3.json b/src/main/resources/assets/botania/models/item/ancientWill3.json new file mode 100644 index 000000000..7cf9afaaa --- /dev/null +++ b/src/main/resources/assets/botania/models/item/ancientWill3.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/ancientWill3" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/ancientWill4.json b/src/main/resources/assets/botania/models/item/ancientWill4.json new file mode 100644 index 000000000..118f3951f --- /dev/null +++ b/src/main/resources/assets/botania/models/item/ancientWill4.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/ancientWill4" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/ancientWill5.json b/src/main/resources/assets/botania/models/item/ancientWill5.json new file mode 100644 index 000000000..62aef6264 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/ancientWill5.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/ancientWill5" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/auraRing.json b/src/main/resources/assets/botania/models/item/auraRing.json new file mode 100644 index 000000000..2f617e0f8 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/auraRing.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/auraRing" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/auraRingGreater.json b/src/main/resources/assets/botania/models/item/auraRingGreater.json new file mode 100644 index 000000000..0d64d8dcc --- /dev/null +++ b/src/main/resources/assets/botania/models/item/auraRingGreater.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/auraRingGreater" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/autocraftingHalo.json b/src/main/resources/assets/botania/models/item/autocraftingHalo.json new file mode 100644 index 000000000..14b837d15 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/autocraftingHalo.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/autocraftingHalo" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/baubleBox.json b/src/main/resources/assets/botania/models/item/baubleBox.json new file mode 100644 index 000000000..1e3b1ba76 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/baubleBox.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/baubleBox" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/blackHoleTalisman0.json b/src/main/resources/assets/botania/models/item/blackHoleTalisman0.json new file mode 100644 index 000000000..b089c2d16 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/blackHoleTalisman0.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/blackHoleTalisman0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/blackHoleTalisman1.json b/src/main/resources/assets/botania/models/item/blackHoleTalisman1.json new file mode 100644 index 000000000..946207626 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/blackHoleTalisman1.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/blackHoleTalisman1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/blackLotus0.json b/src/main/resources/assets/botania/models/item/blackLotus0.json new file mode 100644 index 000000000..bfab19bc4 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/blackLotus0.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/blackLotus" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/blackLotus1.json b/src/main/resources/assets/botania/models/item/blackLotus1.json new file mode 100644 index 000000000..94c1f6ae9 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/blackLotus1.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/blackLotus" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/bloodPendant.json b/src/main/resources/assets/botania/models/item/bloodPendant.json new file mode 100644 index 000000000..2337a14c1 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/bloodPendant.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/bloodPendant0", + "layer1": "botania:items/bloodPendant1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/brewFlask.json b/src/main/resources/assets/botania/models/item/brewFlask.json new file mode 100644 index 000000000..9cdf4a51d --- /dev/null +++ b/src/main/resources/assets/botania/models/item/brewFlask.json @@ -0,0 +1,39 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/flask0", + "layer1": "botania:items/flask1_0" + }, + "overrides": [ + { + "predicate": { + "botania:swigs_taken": 1 + }, + "model": "botania:item/brewFlask_1" + }, + { + "predicate": { + "botania:swigs_taken": 2 + }, + "model": "botania:item/brewFlask_2" + }, + { + "predicate": { + "botania:swigs_taken": 3 + }, + "model": "botania:item/brewFlask_3" + }, + { + "predicate": { + "botania:swigs_taken": 4 + }, + "model": "botania:item/brewFlask_4" + }, + { + "predicate": { + "botania:swigs_taken": 5 + }, + "model": "botania:item/brewFlask_5" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/brewFlask_1.json b/src/main/resources/assets/botania/models/item/brewFlask_1.json new file mode 100644 index 000000000..28bde93e6 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/brewFlask_1.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/flask0", + "layer1": "botania:items/flask1_1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/brewFlask_2.json b/src/main/resources/assets/botania/models/item/brewFlask_2.json new file mode 100644 index 000000000..f73c37e2b --- /dev/null +++ b/src/main/resources/assets/botania/models/item/brewFlask_2.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/flask0", + "layer1": "botania:items/flask1_2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/brewFlask_3.json b/src/main/resources/assets/botania/models/item/brewFlask_3.json new file mode 100644 index 000000000..89e0e1bbf --- /dev/null +++ b/src/main/resources/assets/botania/models/item/brewFlask_3.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/flask0", + "layer1": "botania:items/flask1_3" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/brewFlask_4.json b/src/main/resources/assets/botania/models/item/brewFlask_4.json new file mode 100644 index 000000000..376f77b3f --- /dev/null +++ b/src/main/resources/assets/botania/models/item/brewFlask_4.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/flask0", + "layer1": "botania:items/flask1_4" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/brewFlask_5.json b/src/main/resources/assets/botania/models/item/brewFlask_5.json new file mode 100644 index 000000000..947e2636e --- /dev/null +++ b/src/main/resources/assets/botania/models/item/brewFlask_5.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/flask0", + "layer1": "botania:items/flask1_5" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/brewVial.json b/src/main/resources/assets/botania/models/item/brewVial.json new file mode 100644 index 000000000..42d0aef20 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/brewVial.json @@ -0,0 +1,27 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/vial0", + "layer1": "botania:items/vial1_0" + }, + "overrides": [ + { + "predicate": { + "botania:swigs_taken": 1 + }, + "model": "botania:item/brewVial_1" + }, + { + "predicate": { + "botania:swigs_taken": 2 + }, + "model": "botania:item/brewVial_2" + }, + { + "predicate": { + "botania:swigs_taken": 3 + }, + "model": "botania:item/brewVial_3" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/brewVial_1.json b/src/main/resources/assets/botania/models/item/brewVial_1.json new file mode 100644 index 000000000..8eff522d0 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/brewVial_1.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/vial0", + "layer1": "botania:items/vial1_1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/brewVial_2.json b/src/main/resources/assets/botania/models/item/brewVial_2.json new file mode 100644 index 000000000..fc3850bca --- /dev/null +++ b/src/main/resources/assets/botania/models/item/brewVial_2.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/vial0", + "layer1": "botania:items/vial1_2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/brewVial_3.json b/src/main/resources/assets/botania/models/item/brewVial_3.json new file mode 100644 index 000000000..fec47a669 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/brewVial_3.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/vial0", + "layer1": "botania:items/vial1_3" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/cacophonium.json b/src/main/resources/assets/botania/models/item/cacophonium.json new file mode 100644 index 000000000..4121bd1a7 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/cacophonium.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "botania:items/cacophonium" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/clip.json b/src/main/resources/assets/botania/models/item/clip.json new file mode 100644 index 000000000..2c3dcb79b --- /dev/null +++ b/src/main/resources/assets/botania/models/item/clip.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/clip" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/cobbleRod.json b/src/main/resources/assets/botania/models/item/cobbleRod.json new file mode 100644 index 000000000..ea5426796 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/cobbleRod.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "botania:items/cobbleRod" + } +} diff --git a/src/main/resources/assets/botania/models/item/corporeaSpark0.json b/src/main/resources/assets/botania/models/item/corporeaSpark0.json new file mode 100644 index 000000000..879f117b2 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/corporeaSpark0.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/corporeaSpark0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/corporeaSpark1.json b/src/main/resources/assets/botania/models/item/corporeaSpark1.json new file mode 100644 index 000000000..609037769 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/corporeaSpark1.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/corporeaSpark2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/cosmetic0.json b/src/main/resources/assets/botania/models/item/cosmetic0.json new file mode 100644 index 000000000..05319e567 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/cosmetic0.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/cosmetic0" + } +} diff --git a/src/main/resources/assets/botania/models/item/cosmetic1.json b/src/main/resources/assets/botania/models/item/cosmetic1.json new file mode 100644 index 000000000..353718385 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/cosmetic1.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/cosmetic1" + } +} diff --git a/src/main/resources/assets/botania/models/item/cosmetic10.json b/src/main/resources/assets/botania/models/item/cosmetic10.json new file mode 100644 index 000000000..8424e5f24 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/cosmetic10.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/cosmetic10" + } +} diff --git a/src/main/resources/assets/botania/models/item/cosmetic11.json b/src/main/resources/assets/botania/models/item/cosmetic11.json new file mode 100644 index 000000000..9baf07d99 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/cosmetic11.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/cosmetic11" + } +} diff --git a/src/main/resources/assets/botania/models/item/cosmetic12.json b/src/main/resources/assets/botania/models/item/cosmetic12.json new file mode 100644 index 000000000..adb31cc16 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/cosmetic12.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/cosmetic12" + } +} diff --git a/src/main/resources/assets/botania/models/item/cosmetic13.json b/src/main/resources/assets/botania/models/item/cosmetic13.json new file mode 100644 index 000000000..6d791a5f1 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/cosmetic13.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/cosmetic13" + } +} diff --git a/src/main/resources/assets/botania/models/item/cosmetic14.json b/src/main/resources/assets/botania/models/item/cosmetic14.json new file mode 100644 index 000000000..848e34ee2 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/cosmetic14.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/cosmetic14" + } +} diff --git a/src/main/resources/assets/botania/models/item/cosmetic15.json b/src/main/resources/assets/botania/models/item/cosmetic15.json new file mode 100644 index 000000000..f78360c75 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/cosmetic15.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/cosmetic15" + } +} diff --git a/src/main/resources/assets/botania/models/item/cosmetic16.json b/src/main/resources/assets/botania/models/item/cosmetic16.json new file mode 100644 index 000000000..3888367d5 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/cosmetic16.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/cosmetic16" + } +} diff --git a/src/main/resources/assets/botania/models/item/cosmetic17.json b/src/main/resources/assets/botania/models/item/cosmetic17.json new file mode 100644 index 000000000..a68202b04 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/cosmetic17.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/cosmetic17" + } +} diff --git a/src/main/resources/assets/botania/models/item/cosmetic18.json b/src/main/resources/assets/botania/models/item/cosmetic18.json new file mode 100644 index 000000000..ee361c66b --- /dev/null +++ b/src/main/resources/assets/botania/models/item/cosmetic18.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/cosmetic18" + } +} diff --git a/src/main/resources/assets/botania/models/item/cosmetic19.json b/src/main/resources/assets/botania/models/item/cosmetic19.json new file mode 100644 index 000000000..2453f46fc --- /dev/null +++ b/src/main/resources/assets/botania/models/item/cosmetic19.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/cosmetic19" + } +} diff --git a/src/main/resources/assets/botania/models/item/cosmetic2.json b/src/main/resources/assets/botania/models/item/cosmetic2.json new file mode 100644 index 000000000..b4b8ed169 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/cosmetic2.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/cosmetic2" + } +} diff --git a/src/main/resources/assets/botania/models/item/cosmetic20.json b/src/main/resources/assets/botania/models/item/cosmetic20.json new file mode 100644 index 000000000..b25f5fef0 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/cosmetic20.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/cosmetic20" + } +} diff --git a/src/main/resources/assets/botania/models/item/cosmetic21.json b/src/main/resources/assets/botania/models/item/cosmetic21.json new file mode 100644 index 000000000..7a9fd9b7b --- /dev/null +++ b/src/main/resources/assets/botania/models/item/cosmetic21.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/cosmetic21" + } +} diff --git a/src/main/resources/assets/botania/models/item/cosmetic22.json b/src/main/resources/assets/botania/models/item/cosmetic22.json new file mode 100644 index 000000000..2c37a5f6b --- /dev/null +++ b/src/main/resources/assets/botania/models/item/cosmetic22.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/cosmetic22" + } +} diff --git a/src/main/resources/assets/botania/models/item/cosmetic23.json b/src/main/resources/assets/botania/models/item/cosmetic23.json new file mode 100644 index 000000000..1457a1004 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/cosmetic23.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/cosmetic23" + } +} diff --git a/src/main/resources/assets/botania/models/item/cosmetic24.json b/src/main/resources/assets/botania/models/item/cosmetic24.json new file mode 100644 index 000000000..d1b40906c --- /dev/null +++ b/src/main/resources/assets/botania/models/item/cosmetic24.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/cosmetic24" + } +} diff --git a/src/main/resources/assets/botania/models/item/cosmetic25.json b/src/main/resources/assets/botania/models/item/cosmetic25.json new file mode 100644 index 000000000..100e5ed66 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/cosmetic25.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/cosmetic25" + } +} diff --git a/src/main/resources/assets/botania/models/item/cosmetic26.json b/src/main/resources/assets/botania/models/item/cosmetic26.json new file mode 100644 index 000000000..df663990d --- /dev/null +++ b/src/main/resources/assets/botania/models/item/cosmetic26.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/cosmetic26" + } +} diff --git a/src/main/resources/assets/botania/models/item/cosmetic27.json b/src/main/resources/assets/botania/models/item/cosmetic27.json new file mode 100644 index 000000000..c8efaf7ea --- /dev/null +++ b/src/main/resources/assets/botania/models/item/cosmetic27.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/cosmetic27" + } +} diff --git a/src/main/resources/assets/botania/models/item/cosmetic28.json b/src/main/resources/assets/botania/models/item/cosmetic28.json new file mode 100644 index 000000000..422c93dc4 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/cosmetic28.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/cosmetic28" + } +} diff --git a/src/main/resources/assets/botania/models/item/cosmetic29.json b/src/main/resources/assets/botania/models/item/cosmetic29.json new file mode 100644 index 000000000..f155bc45c --- /dev/null +++ b/src/main/resources/assets/botania/models/item/cosmetic29.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/cosmetic29" + } +} diff --git a/src/main/resources/assets/botania/models/item/cosmetic3.json b/src/main/resources/assets/botania/models/item/cosmetic3.json new file mode 100644 index 000000000..25ac4b137 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/cosmetic3.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/cosmetic3" + } +} diff --git a/src/main/resources/assets/botania/models/item/cosmetic30.json b/src/main/resources/assets/botania/models/item/cosmetic30.json new file mode 100644 index 000000000..95cc7e0b0 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/cosmetic30.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/cosmetic30" + } +} diff --git a/src/main/resources/assets/botania/models/item/cosmetic31.json b/src/main/resources/assets/botania/models/item/cosmetic31.json new file mode 100644 index 000000000..d49c6cd54 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/cosmetic31.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/cosmetic31" + } +} diff --git a/src/main/resources/assets/botania/models/item/cosmetic4.json b/src/main/resources/assets/botania/models/item/cosmetic4.json new file mode 100644 index 000000000..4db1110ee --- /dev/null +++ b/src/main/resources/assets/botania/models/item/cosmetic4.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/cosmetic4" + } +} diff --git a/src/main/resources/assets/botania/models/item/cosmetic5.json b/src/main/resources/assets/botania/models/item/cosmetic5.json new file mode 100644 index 000000000..d9a9f659e --- /dev/null +++ b/src/main/resources/assets/botania/models/item/cosmetic5.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/cosmetic5" + } +} diff --git a/src/main/resources/assets/botania/models/item/cosmetic6.json b/src/main/resources/assets/botania/models/item/cosmetic6.json new file mode 100644 index 000000000..ccefd13d8 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/cosmetic6.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/cosmetic6" + } +} diff --git a/src/main/resources/assets/botania/models/item/cosmetic7.json b/src/main/resources/assets/botania/models/item/cosmetic7.json new file mode 100644 index 000000000..9ff1bb095 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/cosmetic7.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/cosmetic7" + } +} diff --git a/src/main/resources/assets/botania/models/item/cosmetic8.json b/src/main/resources/assets/botania/models/item/cosmetic8.json new file mode 100644 index 000000000..7a26eab2e --- /dev/null +++ b/src/main/resources/assets/botania/models/item/cosmetic8.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/cosmetic8" + } +} diff --git a/src/main/resources/assets/botania/models/item/cosmetic9.json b/src/main/resources/assets/botania/models/item/cosmetic9.json new file mode 100644 index 000000000..a7219ce06 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/cosmetic9.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/cosmetic9" + } +} diff --git a/src/main/resources/assets/botania/models/item/craftPattern0.json b/src/main/resources/assets/botania/models/item/craftPattern0.json new file mode 100644 index 000000000..d26639414 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/craftPattern0.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/craftPattern0" + } +} diff --git a/src/main/resources/assets/botania/models/item/craftPattern1.json b/src/main/resources/assets/botania/models/item/craftPattern1.json new file mode 100644 index 000000000..1e82f5781 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/craftPattern1.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/craftPattern1" + } +} diff --git a/src/main/resources/assets/botania/models/item/craftPattern2.json b/src/main/resources/assets/botania/models/item/craftPattern2.json new file mode 100644 index 000000000..4481706af --- /dev/null +++ b/src/main/resources/assets/botania/models/item/craftPattern2.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/craftPattern2" + } +} diff --git a/src/main/resources/assets/botania/models/item/craftPattern3.json b/src/main/resources/assets/botania/models/item/craftPattern3.json new file mode 100644 index 000000000..d784cfb24 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/craftPattern3.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/craftPattern3" + } +} diff --git a/src/main/resources/assets/botania/models/item/craftPattern4.json b/src/main/resources/assets/botania/models/item/craftPattern4.json new file mode 100644 index 000000000..ff3d3db91 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/craftPattern4.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/craftPattern4" + } +} diff --git a/src/main/resources/assets/botania/models/item/craftPattern5.json b/src/main/resources/assets/botania/models/item/craftPattern5.json new file mode 100644 index 000000000..ec69319d2 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/craftPattern5.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/craftPattern5" + } +} diff --git a/src/main/resources/assets/botania/models/item/craftPattern6.json b/src/main/resources/assets/botania/models/item/craftPattern6.json new file mode 100644 index 000000000..7ed12fe2c --- /dev/null +++ b/src/main/resources/assets/botania/models/item/craftPattern6.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/craftPattern6" + } +} diff --git a/src/main/resources/assets/botania/models/item/craftPattern7.json b/src/main/resources/assets/botania/models/item/craftPattern7.json new file mode 100644 index 000000000..5b6be2d6f --- /dev/null +++ b/src/main/resources/assets/botania/models/item/craftPattern7.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/craftPattern7" + } +} diff --git a/src/main/resources/assets/botania/models/item/craftPattern8.json b/src/main/resources/assets/botania/models/item/craftPattern8.json new file mode 100644 index 000000000..9561616e3 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/craftPattern8.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/craftPattern8" + } +} diff --git a/src/main/resources/assets/botania/models/item/craftingHalo.json b/src/main/resources/assets/botania/models/item/craftingHalo.json new file mode 100644 index 000000000..967f53d58 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/craftingHalo.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/craftingHalo" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/crystalBow.json b/src/main/resources/assets/botania/models/item/crystalBow.json new file mode 100644 index 000000000..42a50a9a6 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/crystalBow.json @@ -0,0 +1,64 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/crystalBow0" + }, + "display": { + "thirdperson_righthand": { + "rotation": [ -80, 260, -40 ], + "translation": [ -1, -2, 2.5 ], + "scale": [ 0.9, 0.9, 0.9 ] + }, + "thirdperson_lefthand": { + "rotation": [ -80, -280, 40 ], + "translation": [ -1, -2, 2.5 ], + "scale": [ 0.9, 0.9, 0.9 ] + }, + "firstperson_righthand": { + "rotation": [ 0, -90, 25 ], + "translation": [ 1.13, 3.2, 1.13], + "scale": [ 0.68, 0.68, 0.68 ] + }, + "firstperson_lefthand": { + "rotation": [ 0, 90, -25 ], + "translation": [ 1.13, 3.2, 1.13], + "scale": [ 0.68, 0.68, 0.68 ] + } + }, + "overrides": [ + { + "predicate": { + "minecraft:pulling": 1 + }, + "model": "botania:item/crystalBow_pulling_1" + }, + { + "predicate": { + "minecraft:pulling": 1, + "minecraft:pull": 0.35 + }, + "model": "botania:item/crystalBow_pulling_2" + }, + { + "predicate": { + "minecraft:pulling": 1, + "minecraft:pull": 0.65 + }, + "model": "botania:item/crystalBow_pulling_3" + }, + { + "predicate": { + "minecraft:pulling": 1, + "minecraft:pull": 0.8 + }, + "model": "botania:item/crystalBow_pulling_4" + }, + { + "predicate": { + "minecraft:pulling": 1, + "minecraft:pull": 0.9 + }, + "model": "botania:item/crystalBow_pulling_5" + } + ] +} diff --git a/src/main/resources/assets/botania/models/item/crystalBow_pulling_1.json b/src/main/resources/assets/botania/models/item/crystalBow_pulling_1.json new file mode 100644 index 000000000..d907d7b2e --- /dev/null +++ b/src/main/resources/assets/botania/models/item/crystalBow_pulling_1.json @@ -0,0 +1,6 @@ +{ + "parent": "botania:item/crystalBow", + "textures": { + "layer0": "botania:items/crystalBow1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/crystalBow_pulling_2.json b/src/main/resources/assets/botania/models/item/crystalBow_pulling_2.json new file mode 100644 index 000000000..87aa0174f --- /dev/null +++ b/src/main/resources/assets/botania/models/item/crystalBow_pulling_2.json @@ -0,0 +1,6 @@ +{ + "parent": "botania:item/crystalBow", + "textures": { + "layer0": "botania:items/crystalBow2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/crystalBow_pulling_3.json b/src/main/resources/assets/botania/models/item/crystalBow_pulling_3.json new file mode 100644 index 000000000..cbc3df1f5 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/crystalBow_pulling_3.json @@ -0,0 +1,6 @@ +{ + "parent": "botania:item/crystalBow", + "textures": { + "layer0": "botania:items/crystalBow3" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/crystalBow_pulling_4.json b/src/main/resources/assets/botania/models/item/crystalBow_pulling_4.json new file mode 100644 index 000000000..9ffa86873 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/crystalBow_pulling_4.json @@ -0,0 +1,6 @@ +{ + "parent": "botania:item/crystalBow", + "textures": { + "layer0": "botania:items/crystalBow4" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/crystalBow_pulling_5.json b/src/main/resources/assets/botania/models/item/crystalBow_pulling_5.json new file mode 100644 index 000000000..b4d560244 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/crystalBow_pulling_5.json @@ -0,0 +1,6 @@ +{ + "parent": "botania:item/crystalBow", + "textures": { + "layer0": "botania:items/crystalBow5" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/dammitReddit.json b/src/main/resources/assets/botania/models/item/dammitReddit.json new file mode 100644 index 000000000..816e1b861 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/dammitReddit.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "botania:items/dammitReddit" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/desuGun.json b/src/main/resources/assets/botania/models/item/desuGun.json new file mode 100644 index 000000000..91bbace8f --- /dev/null +++ b/src/main/resources/assets/botania/models/item/desuGun.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/desuGun0", + "layer1": "botania:items/desuGun1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/desuGunClip.json b/src/main/resources/assets/botania/models/item/desuGunClip.json new file mode 100644 index 000000000..7574143b7 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/desuGunClip.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/desuGun2", + "layer1": "botania:items/desuGun1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/dice.json b/src/main/resources/assets/botania/models/item/dice.json new file mode 100644 index 000000000..3c615ae98 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/dice.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/dice" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/dirtRod.json b/src/main/resources/assets/botania/models/item/dirtRod.json new file mode 100644 index 000000000..034a169d2 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/dirtRod.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "botania:items/dirtRod" + } +} diff --git a/src/main/resources/assets/botania/models/item/divaCharm.json b/src/main/resources/assets/botania/models/item/divaCharm.json new file mode 100644 index 000000000..e2d73329d --- /dev/null +++ b/src/main/resources/assets/botania/models/item/divaCharm.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/divaCharm" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/diviningRod.json b/src/main/resources/assets/botania/models/item/diviningRod.json new file mode 100644 index 000000000..44661ba77 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/diviningRod.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "botania:items/diviningRod" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/dragonstone.json b/src/main/resources/assets/botania/models/item/dragonstone.json new file mode 100644 index 000000000..0e9f6ca20 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/dragonstone.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": + { + "layer0": "botania:items/dragonstone" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/dreamwoodTwig.json b/src/main/resources/assets/botania/models/item/dreamwoodTwig.json new file mode 100644 index 000000000..6e8f6e582 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/dreamwoodTwig.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": + { + "layer0": "botania:items/dreamwoodTwig" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/dye.json b/src/main/resources/assets/botania/models/item/dye.json new file mode 100644 index 000000000..40752703b --- /dev/null +++ b/src/main/resources/assets/botania/models/item/dye.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/dye" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/elementium.json b/src/main/resources/assets/botania/models/item/elementium.json new file mode 100644 index 000000000..cb7932dd9 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/elementium.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": + { + "layer0": "botania:items/elementium" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/elementiumAxe.json b/src/main/resources/assets/botania/models/item/elementiumAxe.json new file mode 100644 index 000000000..dff087e23 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/elementiumAxe.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/handheld", + "textures": + { + "layer0": "botania:items/elementiumAxe" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/elementiumBoots.json b/src/main/resources/assets/botania/models/item/elementiumBoots.json new file mode 100644 index 000000000..2e191683e --- /dev/null +++ b/src/main/resources/assets/botania/models/item/elementiumBoots.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": + { + "layer0": "botania:items/elementiumBoots" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/elementiumChest.json b/src/main/resources/assets/botania/models/item/elementiumChest.json new file mode 100644 index 000000000..4d9c37adc --- /dev/null +++ b/src/main/resources/assets/botania/models/item/elementiumChest.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": + { + "layer0": "botania:items/elementiumChest" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/elementiumHelm.json b/src/main/resources/assets/botania/models/item/elementiumHelm.json new file mode 100644 index 000000000..85fa4d453 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/elementiumHelm.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": + { + "layer0": "botania:items/elementiumHelm" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/elementiumHelmReveal.json b/src/main/resources/assets/botania/models/item/elementiumHelmReveal.json new file mode 100644 index 000000000..4a9cc954a --- /dev/null +++ b/src/main/resources/assets/botania/models/item/elementiumHelmReveal.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/elementiumHelmReveal" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/elementiumLegs.json b/src/main/resources/assets/botania/models/item/elementiumLegs.json new file mode 100644 index 000000000..40e24a6cf --- /dev/null +++ b/src/main/resources/assets/botania/models/item/elementiumLegs.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": + { + "layer0": "botania:items/elementiumLegs" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/elementiumNugget.json b/src/main/resources/assets/botania/models/item/elementiumNugget.json new file mode 100644 index 000000000..55a651884 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/elementiumNugget.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": + { + "layer0": "botania:items/elementiumNugget" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/elementiumPick.json b/src/main/resources/assets/botania/models/item/elementiumPick.json new file mode 100644 index 000000000..49405a587 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/elementiumPick.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/handheld", + "textures": + { + "layer0": "botania:items/elementiumPick" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/elementiumShears.json b/src/main/resources/assets/botania/models/item/elementiumShears.json new file mode 100644 index 000000000..70b29c93f --- /dev/null +++ b/src/main/resources/assets/botania/models/item/elementiumShears.json @@ -0,0 +1,12 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "botania:items/elementiumShears" + }, + "overrides": [{ + "predicate": { + "botania:reddit": 1 + }, + "model": "botania:item/dammitReddit" + }] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/elementiumShovel.json b/src/main/resources/assets/botania/models/item/elementiumShovel.json new file mode 100644 index 000000000..eca40c561 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/elementiumShovel.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/handheld", + "textures": + { + "layer0": "botania:items/elementiumShovel" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/elementiumSword.json b/src/main/resources/assets/botania/models/item/elementiumSword.json new file mode 100644 index 000000000..117839d5b --- /dev/null +++ b/src/main/resources/assets/botania/models/item/elementiumSword.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/handheld", + "textures": + { + "layer0": "botania:items/elementiumSword" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/elucidator.json b/src/main/resources/assets/botania/models/item/elucidator.json new file mode 100644 index 000000000..5c3f73668 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/elucidator.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "botania:items/elucidator" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/enderAirBottle.json b/src/main/resources/assets/botania/models/item/enderAirBottle.json new file mode 100644 index 000000000..f20925d88 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/enderAirBottle.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": + { + "layer0": "botania:items/enderAirBottle" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/enderDagger.json b/src/main/resources/assets/botania/models/item/enderDagger.json new file mode 100644 index 000000000..013865926 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/enderDagger.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "botania:items/enderDagger0", + "layer1": "botania:items/enderDagger1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/enderHand.json b/src/main/resources/assets/botania/models/item/enderHand.json new file mode 100644 index 000000000..a559e70ca --- /dev/null +++ b/src/main/resources/assets/botania/models/item/enderHand.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/enderHand" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/exchangeRod.json b/src/main/resources/assets/botania/models/item/exchangeRod.json new file mode 100644 index 000000000..e96848b86 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/exchangeRod.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "botania:items/exchangeRod" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/fertilizer.json b/src/main/resources/assets/botania/models/item/fertilizer.json new file mode 100644 index 000000000..7091df8f2 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/fertilizer.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/fertilizer" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/fireRod.json b/src/main/resources/assets/botania/models/item/fireRod.json new file mode 100644 index 000000000..29197907c --- /dev/null +++ b/src/main/resources/assets/botania/models/item/fireRod.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "botania:items/fireRod" + } +} diff --git a/src/main/resources/assets/botania/models/item/flask.json b/src/main/resources/assets/botania/models/item/flask.json new file mode 100644 index 000000000..f0aae6e37 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/flask.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/flask0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/flightTiara.json b/src/main/resources/assets/botania/models/item/flightTiara.json new file mode 100644 index 000000000..bcf6b570f --- /dev/null +++ b/src/main/resources/assets/botania/models/item/flightTiara.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/flightTiara0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/flowerBag.json b/src/main/resources/assets/botania/models/item/flowerBag.json new file mode 100644 index 000000000..1a4958f59 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/flowerBag.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/flowerBag" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/flugelEye.json b/src/main/resources/assets/botania/models/item/flugelEye.json new file mode 100644 index 000000000..5bcb64fdb --- /dev/null +++ b/src/main/resources/assets/botania/models/item/flugelEye.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/flugelEye" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/gaiaHead.json b/src/main/resources/assets/botania/models/item/gaiaHead.json new file mode 100644 index 000000000..b7da3301d --- /dev/null +++ b/src/main/resources/assets/botania/models/item/gaiaHead.json @@ -0,0 +1,35 @@ +{ + "parent": "builtin/entity", + "display": { + "gui": { + "rotation": [ 30, 225, 0 ], + "translation": [ 3, -0.75, 0 ], + "scale": [ 1, 1, 1 ] + }, + "ground": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 3, 0], + "scale":[ 0.25, 0.25, 0.25 ] + }, + "fixed": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 0, 0], + "scale":[ 0.5, 0.5, 0.5 ] + }, + "thirdperson_righthand": { + "rotation": [ 75, 45, 0 ], + "translation": [ 0, 2.5, 0], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "firstperson_righthand": { + "rotation": [ 0, 45, 0 ], + "translation": [ 0, 0, 0 ], + "scale": [ 0.40, 0.40, 0.40 ] + }, + "firstperson_lefthand": { + "rotation": [ 0, 225, 0 ], + "translation": [ 0, 0, 0 ], + "scale": [ 0.40, 0.40, 0.40 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/gaiaIngot.json b/src/main/resources/assets/botania/models/item/gaiaIngot.json new file mode 100644 index 000000000..e472b6ee8 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/gaiaIngot.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": + { + "layer0": "botania:items/gaiaIngot" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/glassPick.json b/src/main/resources/assets/botania/models/item/glassPick.json new file mode 100644 index 000000000..285214c5c --- /dev/null +++ b/src/main/resources/assets/botania/models/item/glassPick.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/handheld", + "textures": + { + "layer0": "botania:items/glassPick" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/goldenLaurel.json b/src/main/resources/assets/botania/models/item/goldenLaurel.json new file mode 100644 index 000000000..8c78ef8f7 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/goldenLaurel.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/goldenLaurel" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/grassHorn0.json b/src/main/resources/assets/botania/models/item/grassHorn0.json new file mode 100644 index 000000000..41fe77a90 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/grassHorn0.json @@ -0,0 +1,12 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/grassHorn0" + }, + "overrides": [{ + "predicate": { + "botania:vuvuzela": 1 + }, + "model": "botania:item/vuvuzela" + }] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/grassHorn1.json b/src/main/resources/assets/botania/models/item/grassHorn1.json new file mode 100644 index 000000000..519d2b035 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/grassHorn1.json @@ -0,0 +1,12 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/grassHorn1" + }, + "overrides": [{ + "predicate": { + "botania:vuvuzela": 1 + }, + "model": "botania:item/vuvuzela" + }] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/grassHorn2.json b/src/main/resources/assets/botania/models/item/grassHorn2.json new file mode 100644 index 000000000..96e0cadc3 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/grassHorn2.json @@ -0,0 +1,12 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/grassHorn2" + }, + "overrides": [{ + "predicate": { + "botania:vuvuzela": 1 + }, + "model": "botania:item/vuvuzela" + }] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/grassSeeds0.json b/src/main/resources/assets/botania/models/item/grassSeeds0.json new file mode 100644 index 000000000..a454907f0 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/grassSeeds0.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/grassSeeds0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/grassSeeds1.json b/src/main/resources/assets/botania/models/item/grassSeeds1.json new file mode 100644 index 000000000..5f76f84ff --- /dev/null +++ b/src/main/resources/assets/botania/models/item/grassSeeds1.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/grassSeeds1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/grassSeeds2.json b/src/main/resources/assets/botania/models/item/grassSeeds2.json new file mode 100644 index 000000000..3e72c6b9d --- /dev/null +++ b/src/main/resources/assets/botania/models/item/grassSeeds2.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/grassSeeds2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/grassSeeds3.json b/src/main/resources/assets/botania/models/item/grassSeeds3.json new file mode 100644 index 000000000..0901fc3be --- /dev/null +++ b/src/main/resources/assets/botania/models/item/grassSeeds3.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/grassSeeds3" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/grassSeeds4.json b/src/main/resources/assets/botania/models/item/grassSeeds4.json new file mode 100644 index 000000000..c693d2a93 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/grassSeeds4.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/grassSeeds4" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/grassSeeds5.json b/src/main/resources/assets/botania/models/item/grassSeeds5.json new file mode 100644 index 000000000..97aeedc91 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/grassSeeds5.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/grassSeeds5" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/grassSeeds6.json b/src/main/resources/assets/botania/models/item/grassSeeds6.json new file mode 100644 index 000000000..4a87d5137 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/grassSeeds6.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/grassSeeds6" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/grassSeeds7.json b/src/main/resources/assets/botania/models/item/grassSeeds7.json new file mode 100644 index 000000000..4dc850cad --- /dev/null +++ b/src/main/resources/assets/botania/models/item/grassSeeds7.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/grassSeeds7" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/grassSeeds8.json b/src/main/resources/assets/botania/models/item/grassSeeds8.json new file mode 100644 index 000000000..30fdcd1e6 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/grassSeeds8.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/grassSeeds8" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/gravityRod.json b/src/main/resources/assets/botania/models/item/gravityRod.json new file mode 100644 index 000000000..26a8afbee --- /dev/null +++ b/src/main/resources/assets/botania/models/item/gravityRod.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "botania:items/gravityRod" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/holyCloak.json b/src/main/resources/assets/botania/models/item/holyCloak.json new file mode 100644 index 000000000..5aa4b4f2b --- /dev/null +++ b/src/main/resources/assets/botania/models/item/holyCloak.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/holyCloak" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/icePendant.json b/src/main/resources/assets/botania/models/item/icePendant.json new file mode 100644 index 000000000..a725f8243 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/icePendant.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/icePendant" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/incenseStick.json b/src/main/resources/assets/botania/models/item/incenseStick.json new file mode 100644 index 000000000..5bcb467d2 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/incenseStick.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/incenseStick0", + "layer1": "botania:items/incenseStick1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/infiniteFruit.json b/src/main/resources/assets/botania/models/item/infiniteFruit.json new file mode 100644 index 000000000..bac332e08 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/infiniteFruit.json @@ -0,0 +1,12 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/infiniteFruit" + }, + "overrides": [{ + "predicate": { + "botania:boot": 1 + }, + "model": "botania:item/infiniteFruitBoot" + }] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/infiniteFruitBoot.json b/src/main/resources/assets/botania/models/item/infiniteFruitBoot.json new file mode 100644 index 000000000..f1d1d4dea --- /dev/null +++ b/src/main/resources/assets/botania/models/item/infiniteFruitBoot.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/dasBoot" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemFinder.json b/src/main/resources/assets/botania/models/item/itemFinder.json new file mode 100644 index 000000000..cd2c87773 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemFinder.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/itemFinder" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/alfglass_pane.json b/src/main/resources/assets/botania/models/item/itemblock/alfglass_pane.json new file mode 100644 index 000000000..421b6da4d --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/alfglass_pane.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/elfGlass" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/avatar.json b/src/main/resources/assets/botania/models/item/itemblock/avatar.json new file mode 100644 index 000000000..4b66e09de --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/avatar.json @@ -0,0 +1,35 @@ +{ + "parent": "builtin/entity", + "display": { + "gui": { + "rotation": [ 30, 45, 0 ], + "translation": [ 0, 0, 0], + "scale":[ 0.625, 0.625, 0.625 ] + }, + "ground": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 3, 0], + "scale":[ 0.25, 0.25, 0.25 ] + }, + "fixed": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 0, 0], + "scale":[ 0.5, 0.5, 0.5 ] + }, + "thirdperson_righthand": { + "rotation": [ 75, 45, 0 ], + "translation": [ 0, 2.5, 0], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "firstperson_righthand": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 0, 0 ], + "scale": [ 0.40, 0.40, 0.40 ] + }, + "firstperson_lefthand": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 0, 0 ], + "scale": [ 0.40, 0.40, 0.40 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/bellows.json b/src/main/resources/assets/botania/models/item/itemblock/bellows.json new file mode 100644 index 000000000..3326413b3 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/bellows.json @@ -0,0 +1,35 @@ +{ + "parent": "builtin/entity", + "display": { + "gui": { + "rotation": [ 30, 225, 0 ], + "translation": [ 0, 0, 0], + "scale":[ 0.625, 0.625, 0.625 ] + }, + "ground": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 3, 0], + "scale":[ 0.25, 0.25, 0.25 ] + }, + "fixed": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 0, 0], + "scale":[ 0.5, 0.5, 0.5 ] + }, + "thirdperson_righthand": { + "rotation": [ 75, 45, 0 ], + "translation": [ 0, 2.5, 0], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "firstperson_righthand": { + "rotation": [ 0, 45, 0 ], + "translation": [ 0, 0, 0 ], + "scale": [ 0.40, 0.40, 0.40 ] + }, + "firstperson_lefthand": { + "rotation": [ 0, 225, 0 ], + "translation": [ 0, 0, 0 ], + "scale": [ 0.40, 0.40, 0.40 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/bifrost_pane.json b/src/main/resources/assets/botania/models/item/itemblock/bifrost_pane.json new file mode 100644 index 000000000..38006dc9d --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/bifrost_pane.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/bifrost" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/brewery.json b/src/main/resources/assets/botania/models/item/itemblock/brewery.json new file mode 100644 index 000000000..3326413b3 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/brewery.json @@ -0,0 +1,35 @@ +{ + "parent": "builtin/entity", + "display": { + "gui": { + "rotation": [ 30, 225, 0 ], + "translation": [ 0, 0, 0], + "scale":[ 0.625, 0.625, 0.625 ] + }, + "ground": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 3, 0], + "scale":[ 0.25, 0.25, 0.25 ] + }, + "fixed": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 0, 0], + "scale":[ 0.5, 0.5, 0.5 ] + }, + "thirdperson_righthand": { + "rotation": [ 75, 45, 0 ], + "translation": [ 0, 2.5, 0], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "firstperson_righthand": { + "rotation": [ 0, 45, 0 ], + "translation": [ 0, 0, 0 ], + "scale": [ 0.40, 0.40, 0.40 ] + }, + "firstperson_lefthand": { + "rotation": [ 0, 225, 0 ], + "translation": [ 0, 0, 0 ], + "scale": [ 0.40, 0.40, 0.40 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/corporea_index.json b/src/main/resources/assets/botania/models/item/itemblock/corporea_index.json new file mode 100644 index 000000000..3326413b3 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/corporea_index.json @@ -0,0 +1,35 @@ +{ + "parent": "builtin/entity", + "display": { + "gui": { + "rotation": [ 30, 225, 0 ], + "translation": [ 0, 0, 0], + "scale":[ 0.625, 0.625, 0.625 ] + }, + "ground": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 3, 0], + "scale":[ 0.25, 0.25, 0.25 ] + }, + "fixed": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 0, 0], + "scale":[ 0.5, 0.5, 0.5 ] + }, + "thirdperson_righthand": { + "rotation": [ 75, 45, 0 ], + "translation": [ 0, 2.5, 0], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "firstperson_righthand": { + "rotation": [ 0, 45, 0 ], + "translation": [ 0, 0, 0 ], + "scale": [ 0.40, 0.40, 0.40 ] + }, + "firstperson_lefthand": { + "rotation": [ 0, 225, 0 ], + "translation": [ 0, 0, 0 ], + "scale": [ 0.40, 0.40, 0.40 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/desert_cobble_wall.json b/src/main/resources/assets/botania/models/item/itemblock/desert_cobble_wall.json new file mode 100644 index 000000000..c3487cd69 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/desert_cobble_wall.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_inventory", + "textures": { + "wall": "botania:blocks/biomeStone13" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/double_flower_black.json b/src/main/resources/assets/botania/models/item/itemblock/double_flower_black.json new file mode 100644 index 000000000..e4a45a6db --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/double_flower_black.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flower15Tall1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/double_flower_blue.json b/src/main/resources/assets/botania/models/item/itemblock/double_flower_blue.json new file mode 100644 index 000000000..9668e1b59 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/double_flower_blue.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flower11Tall1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/double_flower_brown.json b/src/main/resources/assets/botania/models/item/itemblock/double_flower_brown.json new file mode 100644 index 000000000..b3d75c7f6 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/double_flower_brown.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flower12Tall1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/double_flower_cyan.json b/src/main/resources/assets/botania/models/item/itemblock/double_flower_cyan.json new file mode 100644 index 000000000..ef2e30ccb --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/double_flower_cyan.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flower9Tall1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/double_flower_gray.json b/src/main/resources/assets/botania/models/item/itemblock/double_flower_gray.json new file mode 100644 index 000000000..75f4a0808 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/double_flower_gray.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flower7Tall1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/double_flower_green.json b/src/main/resources/assets/botania/models/item/itemblock/double_flower_green.json new file mode 100644 index 000000000..18828e58a --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/double_flower_green.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flower13Tall1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/double_flower_light_blue.json b/src/main/resources/assets/botania/models/item/itemblock/double_flower_light_blue.json new file mode 100644 index 000000000..8320ee8c8 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/double_flower_light_blue.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flower3Tall1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/double_flower_lime.json b/src/main/resources/assets/botania/models/item/itemblock/double_flower_lime.json new file mode 100644 index 000000000..f608684b6 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/double_flower_lime.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flower5Tall1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/double_flower_magenta.json b/src/main/resources/assets/botania/models/item/itemblock/double_flower_magenta.json new file mode 100644 index 000000000..c483545ff --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/double_flower_magenta.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flower2Tall1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/double_flower_orange.json b/src/main/resources/assets/botania/models/item/itemblock/double_flower_orange.json new file mode 100644 index 000000000..3f8539119 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/double_flower_orange.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flower1Tall1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/double_flower_pink.json b/src/main/resources/assets/botania/models/item/itemblock/double_flower_pink.json new file mode 100644 index 000000000..914aaa92f --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/double_flower_pink.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flower6Tall1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/double_flower_purple.json b/src/main/resources/assets/botania/models/item/itemblock/double_flower_purple.json new file mode 100644 index 000000000..d472eb44c --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/double_flower_purple.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flower10Tall1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/double_flower_red.json b/src/main/resources/assets/botania/models/item/itemblock/double_flower_red.json new file mode 100644 index 000000000..b28bc6877 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/double_flower_red.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flower14Tall1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/double_flower_silver.json b/src/main/resources/assets/botania/models/item/itemblock/double_flower_silver.json new file mode 100644 index 000000000..46cfc57db --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/double_flower_silver.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flower8Tall1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/double_flower_white.json b/src/main/resources/assets/botania/models/item/itemblock/double_flower_white.json new file mode 100644 index 000000000..e46bcdf60 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/double_flower_white.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flower0Tall1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/double_flower_yellow.json b/src/main/resources/assets/botania/models/item/itemblock/double_flower_yellow.json new file mode 100644 index 000000000..b0555d4fa --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/double_flower_yellow.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flower4Tall1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/dreamwood_wall.json b/src/main/resources/assets/botania/models/item/itemblock/dreamwood_wall.json new file mode 100644 index 000000000..0bcdda9a9 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/dreamwood_wall.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_inventory", + "textures": { + "wall": "botania:blocks/dreamwood0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/flower_black.json b/src/main/resources/assets/botania/models/item/itemblock/flower_black.json new file mode 100644 index 000000000..7b8759f21 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/flower_black.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flower15" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/flower_blue.json b/src/main/resources/assets/botania/models/item/itemblock/flower_blue.json new file mode 100644 index 000000000..baa6ad215 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/flower_blue.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flower11" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/flower_brown.json b/src/main/resources/assets/botania/models/item/itemblock/flower_brown.json new file mode 100644 index 000000000..9b966692f --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/flower_brown.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flower12" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/flower_cyan.json b/src/main/resources/assets/botania/models/item/itemblock/flower_cyan.json new file mode 100644 index 000000000..8a6db1986 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/flower_cyan.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flower9" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/flower_gray.json b/src/main/resources/assets/botania/models/item/itemblock/flower_gray.json new file mode 100644 index 000000000..f06ff8933 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/flower_gray.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flower7" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/flower_green.json b/src/main/resources/assets/botania/models/item/itemblock/flower_green.json new file mode 100644 index 000000000..09b6686c9 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/flower_green.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flower13" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/flower_light_blue.json b/src/main/resources/assets/botania/models/item/itemblock/flower_light_blue.json new file mode 100644 index 000000000..ebf0200f9 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/flower_light_blue.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flower3" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/flower_lime.json b/src/main/resources/assets/botania/models/item/itemblock/flower_lime.json new file mode 100644 index 000000000..d3cc07a48 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/flower_lime.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flower5" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/flower_magenta.json b/src/main/resources/assets/botania/models/item/itemblock/flower_magenta.json new file mode 100644 index 000000000..e57acc7b5 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/flower_magenta.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flower2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/flower_orange.json b/src/main/resources/assets/botania/models/item/itemblock/flower_orange.json new file mode 100644 index 000000000..9f6758004 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/flower_orange.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flower1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/flower_pink.json b/src/main/resources/assets/botania/models/item/itemblock/flower_pink.json new file mode 100644 index 000000000..e2e3f146d --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/flower_pink.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flower6" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/flower_purple.json b/src/main/resources/assets/botania/models/item/itemblock/flower_purple.json new file mode 100644 index 000000000..e8de2aa22 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/flower_purple.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flower10" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/flower_red.json b/src/main/resources/assets/botania/models/item/itemblock/flower_red.json new file mode 100644 index 000000000..a72be29fd --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/flower_red.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flower14" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/flower_silver.json b/src/main/resources/assets/botania/models/item/itemblock/flower_silver.json new file mode 100644 index 000000000..54e5d9208 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/flower_silver.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flower8" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/flower_white.json b/src/main/resources/assets/botania/models/item/itemblock/flower_white.json new file mode 100644 index 000000000..e719bb6a0 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/flower_white.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flower0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/flower_yellow.json b/src/main/resources/assets/botania/models/item/itemblock/flower_yellow.json new file mode 100644 index 000000000..ce43ba47e --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/flower_yellow.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flower4" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/forest_cobble_wall.json b/src/main/resources/assets/botania/models/item/itemblock/forest_cobble_wall.json new file mode 100644 index 000000000..9cde1a1d5 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/forest_cobble_wall.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_inventory", + "textures": { + "wall": "botania:blocks/biomeStone8" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/fungal_cobble_wall.json b/src/main/resources/assets/botania/models/item/itemblock/fungal_cobble_wall.json new file mode 100644 index 000000000..00845bd40 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/fungal_cobble_wall.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_inventory", + "textures": { + "wall": "botania:blocks/biomeStone11" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/ghost_rail.json b/src/main/resources/assets/botania/models/item/itemblock/ghost_rail.json new file mode 100644 index 000000000..5d7e72edb --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/ghost_rail.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/ghostRail" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_black.json b/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_black.json new file mode 100644 index 000000000..7db03e570 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_black.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flowerGlimmering15" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_blue.json b/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_blue.json new file mode 100644 index 000000000..386070987 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_blue.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flowerGlimmering11" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_brown.json b/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_brown.json new file mode 100644 index 000000000..57785a008 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_brown.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flowerGlimmering12" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_cyan.json b/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_cyan.json new file mode 100644 index 000000000..78c2694ed --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_cyan.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flowerGlimmering9" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_gray.json b/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_gray.json new file mode 100644 index 000000000..a3d4c6d9e --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_gray.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flowerGlimmering7" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_green.json b/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_green.json new file mode 100644 index 000000000..766eaea66 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_green.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flowerGlimmering13" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_light_blue.json b/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_light_blue.json new file mode 100644 index 000000000..d1741a155 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_light_blue.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flowerGlimmering3" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_lime.json b/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_lime.json new file mode 100644 index 000000000..93bd43215 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_lime.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flowerGlimmering5" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_magenta.json b/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_magenta.json new file mode 100644 index 000000000..b97b05c9d --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_magenta.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flowerGlimmering2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_orange.json b/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_orange.json new file mode 100644 index 000000000..cfd163cc3 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_orange.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flowerGlimmering1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_pink.json b/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_pink.json new file mode 100644 index 000000000..12ff0e450 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_pink.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flowerGlimmering6" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_purple.json b/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_purple.json new file mode 100644 index 000000000..308c42aba --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_purple.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flowerGlimmering10" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_red.json b/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_red.json new file mode 100644 index 000000000..c99198612 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_red.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flowerGlimmering14" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_silver.json b/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_silver.json new file mode 100644 index 000000000..e289f2fbd --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_silver.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flowerGlimmering8" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_white.json b/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_white.json new file mode 100644 index 000000000..929d50392 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_white.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flowerGlimmering0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_yellow.json b/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_yellow.json new file mode 100644 index 000000000..38009d69f --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/glimmering_flower_yellow.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/flowerGlimmering4" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/hovering_hourglass.json b/src/main/resources/assets/botania/models/item/itemblock/hovering_hourglass.json new file mode 100644 index 000000000..3326413b3 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/hovering_hourglass.json @@ -0,0 +1,35 @@ +{ + "parent": "builtin/entity", + "display": { + "gui": { + "rotation": [ 30, 225, 0 ], + "translation": [ 0, 0, 0], + "scale":[ 0.625, 0.625, 0.625 ] + }, + "ground": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 3, 0], + "scale":[ 0.25, 0.25, 0.25 ] + }, + "fixed": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 0, 0], + "scale":[ 0.5, 0.5, 0.5 ] + }, + "thirdperson_righthand": { + "rotation": [ 75, 45, 0 ], + "translation": [ 0, 2.5, 0], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "firstperson_righthand": { + "rotation": [ 0, 45, 0 ], + "translation": [ 0, 0, 0 ], + "scale": [ 0.40, 0.40, 0.40 ] + }, + "firstperson_lefthand": { + "rotation": [ 0, 225, 0 ], + "translation": [ 0, 0, 0 ], + "scale": [ 0.40, 0.40, 0.40 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/livingrock_wall.json b/src/main/resources/assets/botania/models/item/itemblock/livingrock_wall.json new file mode 100644 index 000000000..bc8157d2a --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/livingrock_wall.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_inventory", + "textures": { + "wall": "botania:blocks/livingrock0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/livingwood_wall.json b/src/main/resources/assets/botania/models/item/itemblock/livingwood_wall.json new file mode 100644 index 000000000..8f6d35e18 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/livingwood_wall.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_inventory", + "textures": { + "wall": "botania:blocks/livingwood0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/managlass_pane.json b/src/main/resources/assets/botania/models/item/itemblock/managlass_pane.json new file mode 100644 index 000000000..0316bf04a --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/managlass_pane.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/manaGlass" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/mesa_cobble_wall.json b/src/main/resources/assets/botania/models/item/itemblock/mesa_cobble_wall.json new file mode 100644 index 000000000..4b6794cfd --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/mesa_cobble_wall.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_inventory", + "textures": { + "wall": "botania:blocks/biomeStone15" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/mountain_cobble_wall.json b/src/main/resources/assets/botania/models/item/itemblock/mountain_cobble_wall.json new file mode 100644 index 000000000..0c229f43c --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/mountain_cobble_wall.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_inventory", + "textures": { + "wall": "botania:blocks/biomeStone10" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/mushroom_black.json b/src/main/resources/assets/botania/models/item/itemblock/mushroom_black.json new file mode 100644 index 000000000..eeba54dde --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/mushroom_black.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/mushroom15" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/mushroom_blue.json b/src/main/resources/assets/botania/models/item/itemblock/mushroom_blue.json new file mode 100644 index 000000000..64c3ce175 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/mushroom_blue.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/mushroom11" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/mushroom_brown.json b/src/main/resources/assets/botania/models/item/itemblock/mushroom_brown.json new file mode 100644 index 000000000..71239c09a --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/mushroom_brown.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/mushroom12" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/mushroom_cyan.json b/src/main/resources/assets/botania/models/item/itemblock/mushroom_cyan.json new file mode 100644 index 000000000..9ccac0b4a --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/mushroom_cyan.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/mushroom9" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/mushroom_gray.json b/src/main/resources/assets/botania/models/item/itemblock/mushroom_gray.json new file mode 100644 index 000000000..0a3130a28 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/mushroom_gray.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/mushroom7" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/mushroom_green.json b/src/main/resources/assets/botania/models/item/itemblock/mushroom_green.json new file mode 100644 index 000000000..a20206e35 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/mushroom_green.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/mushroom13" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/mushroom_light_blue.json b/src/main/resources/assets/botania/models/item/itemblock/mushroom_light_blue.json new file mode 100644 index 000000000..228222a56 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/mushroom_light_blue.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/mushroom3" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/mushroom_lime.json b/src/main/resources/assets/botania/models/item/itemblock/mushroom_lime.json new file mode 100644 index 000000000..2856a495f --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/mushroom_lime.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/mushroom5" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/mushroom_magenta.json b/src/main/resources/assets/botania/models/item/itemblock/mushroom_magenta.json new file mode 100644 index 000000000..4dc00cbc5 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/mushroom_magenta.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/mushroom2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/mushroom_orange.json b/src/main/resources/assets/botania/models/item/itemblock/mushroom_orange.json new file mode 100644 index 000000000..e6b2b5eac --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/mushroom_orange.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/mushroom1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/mushroom_pink.json b/src/main/resources/assets/botania/models/item/itemblock/mushroom_pink.json new file mode 100644 index 000000000..5eb32af3b --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/mushroom_pink.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/mushroom6" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/mushroom_purple.json b/src/main/resources/assets/botania/models/item/itemblock/mushroom_purple.json new file mode 100644 index 000000000..9e71669b4 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/mushroom_purple.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/mushroom10" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/mushroom_red.json b/src/main/resources/assets/botania/models/item/itemblock/mushroom_red.json new file mode 100644 index 000000000..c3eff9660 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/mushroom_red.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/mushroom14" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/mushroom_silver.json b/src/main/resources/assets/botania/models/item/itemblock/mushroom_silver.json new file mode 100644 index 000000000..a05ee207e --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/mushroom_silver.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/mushroom8" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/mushroom_white.json b/src/main/resources/assets/botania/models/item/itemblock/mushroom_white.json new file mode 100644 index 000000000..93653859a --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/mushroom_white.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/mushroom0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/mushroom_yellow.json b/src/main/resources/assets/botania/models/item/itemblock/mushroom_yellow.json new file mode 100644 index 000000000..c2b9c4ba4 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/mushroom_yellow.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:blocks/mushroom4" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/plains_cobble_wall.json b/src/main/resources/assets/botania/models/item/itemblock/plains_cobble_wall.json new file mode 100644 index 000000000..14a90dc0c --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/plains_cobble_wall.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_inventory", + "textures": { + "wall": "botania:blocks/biomeStone9" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/swamp_cobble_wall.json b/src/main/resources/assets/botania/models/item/itemblock/swamp_cobble_wall.json new file mode 100644 index 000000000..3367852d2 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/swamp_cobble_wall.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_inventory", + "textures": { + "wall": "botania:blocks/biomeStone12" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/taiga_cobble_wall.json b/src/main/resources/assets/botania/models/item/itemblock/taiga_cobble_wall.json new file mode 100644 index 000000000..18efd12a0 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/taiga_cobble_wall.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_inventory", + "textures": { + "wall": "botania:blocks/biomeStone14" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/itemblock/teru_teru_bozu.json b/src/main/resources/assets/botania/models/item/itemblock/teru_teru_bozu.json new file mode 100644 index 000000000..c3fec2d6f --- /dev/null +++ b/src/main/resources/assets/botania/models/item/itemblock/teru_teru_bozu.json @@ -0,0 +1,35 @@ +{ + "parent": "builtin/entity", + "display": { + "gui": { + "rotation": [ 30, 45, 0 ], + "translation": [ 0, 0, 0], + "scale":[ 0.625, 0.625, 0.625 ] + }, + "ground": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 3, 0], + "scale":[ 0.25, 0.25, 0.25 ] + }, + "fixed": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 0, 0], + "scale":[ 0.5, 0.5, 0.5 ] + }, + "thirdperson_righthand": { + "rotation": [ 75, 45, 0 ], + "translation": [ 0, 2.5, 0], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "firstperson_righthand": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 3, 0 ], + "scale": [ 0.40, 0.40, 0.40 ] + }, + "firstperson_lefthand": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 3, 0 ], + "scale": [ 0.40, 0.40, 0.40 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/keepIvy.json b/src/main/resources/assets/botania/models/item/keepIvy.json new file mode 100644 index 000000000..dcd6a0e49 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/keepIvy.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/keepIvy" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/kingKey.json b/src/main/resources/assets/botania/models/item/kingKey.json new file mode 100644 index 000000000..bf3fea763 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/kingKey.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "botania:items/kingKey" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/knockbackBelt.json b/src/main/resources/assets/botania/models/item/knockbackBelt.json new file mode 100644 index 000000000..f40761906 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/knockbackBelt.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/knockbackBelt" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/laputaShard.json b/src/main/resources/assets/botania/models/item/laputaShard.json new file mode 100644 index 000000000..b82a58265 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/laputaShard.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/laputaShard" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/lavaPendant.json b/src/main/resources/assets/botania/models/item/lavaPendant.json new file mode 100644 index 000000000..a07c427fb --- /dev/null +++ b/src/main/resources/assets/botania/models/item/lavaPendant.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/lavaPendant" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/lensBounce.json b/src/main/resources/assets/botania/models/item/lensBounce.json new file mode 100644 index 000000000..64c3af30c --- /dev/null +++ b/src/main/resources/assets/botania/models/item/lensBounce.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/lensInside", + "layer1": "botania:items/lensBounce" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/lensDamage.json b/src/main/resources/assets/botania/models/item/lensDamage.json new file mode 100644 index 000000000..55e010a1a --- /dev/null +++ b/src/main/resources/assets/botania/models/item/lensDamage.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/lensInside", + "layer1": "botania:items/lensDamage" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/lensEfficiency.json b/src/main/resources/assets/botania/models/item/lensEfficiency.json new file mode 100644 index 000000000..b95924877 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/lensEfficiency.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/lensInside", + "layer1": "botania:items/lensEfficiency" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/lensExplosive.json b/src/main/resources/assets/botania/models/item/lensExplosive.json new file mode 100644 index 000000000..82dc3af79 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/lensExplosive.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/lensInside", + "layer1": "botania:items/lensExplosive" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/lensFire.json b/src/main/resources/assets/botania/models/item/lensFire.json new file mode 100644 index 000000000..20a6415bb --- /dev/null +++ b/src/main/resources/assets/botania/models/item/lensFire.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/lensInside", + "layer1": "botania:items/lensFire" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/lensFirework.json b/src/main/resources/assets/botania/models/item/lensFirework.json new file mode 100644 index 000000000..4d6dbb636 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/lensFirework.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/lensInside", + "layer1": "botania:items/lensFirework" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/lensFlare.json b/src/main/resources/assets/botania/models/item/lensFlare.json new file mode 100644 index 000000000..732067903 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/lensFlare.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/lensInside", + "layer1": "botania:items/lensFlare" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/lensGravity.json b/src/main/resources/assets/botania/models/item/lensGravity.json new file mode 100644 index 000000000..1ff6583dd --- /dev/null +++ b/src/main/resources/assets/botania/models/item/lensGravity.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/lensInside", + "layer1": "botania:items/lensGravity" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/lensInfluence.json b/src/main/resources/assets/botania/models/item/lensInfluence.json new file mode 100644 index 000000000..351e65427 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/lensInfluence.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/lensInside", + "layer1": "botania:items/lensInfluence" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/lensLight.json b/src/main/resources/assets/botania/models/item/lensLight.json new file mode 100644 index 000000000..ff4d53799 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/lensLight.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/lensInside", + "layer1": "botania:items/lensLight" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/lensMagnet.json b/src/main/resources/assets/botania/models/item/lensMagnet.json new file mode 100644 index 000000000..481e3b44f --- /dev/null +++ b/src/main/resources/assets/botania/models/item/lensMagnet.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/lensInside", + "layer1": "botania:items/lensMagnet" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/lensMine.json b/src/main/resources/assets/botania/models/item/lensMine.json new file mode 100644 index 000000000..496ee9d37 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/lensMine.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/lensInside", + "layer1": "botania:items/lensMine" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/lensNormal.json b/src/main/resources/assets/botania/models/item/lensNormal.json new file mode 100644 index 000000000..cba49b27e --- /dev/null +++ b/src/main/resources/assets/botania/models/item/lensNormal.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/lensInside", + "layer1": "botania:items/lensNormal" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/lensPaint.json b/src/main/resources/assets/botania/models/item/lensPaint.json new file mode 100644 index 000000000..6555d1415 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/lensPaint.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/lensInside", + "layer1": "botania:items/lensPaint" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/lensPhantom.json b/src/main/resources/assets/botania/models/item/lensPhantom.json new file mode 100644 index 000000000..8338d9f01 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/lensPhantom.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/lensInside", + "layer1": "botania:items/lensPhantom" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/lensPiston.json b/src/main/resources/assets/botania/models/item/lensPiston.json new file mode 100644 index 000000000..e2c8e8cd1 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/lensPiston.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/lensInside", + "layer1": "botania:items/lensPiston" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/lensPower.json b/src/main/resources/assets/botania/models/item/lensPower.json new file mode 100644 index 000000000..19f14c990 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/lensPower.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/lensInside", + "layer1": "botania:items/lensPower" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/lensRedirect.json b/src/main/resources/assets/botania/models/item/lensRedirect.json new file mode 100644 index 000000000..8093c7c14 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/lensRedirect.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/lensInside", + "layer1": "botania:items/lensRedirect" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/lensSpeed.json b/src/main/resources/assets/botania/models/item/lensSpeed.json new file mode 100644 index 000000000..ba122d36a --- /dev/null +++ b/src/main/resources/assets/botania/models/item/lensSpeed.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/lensInside", + "layer1": "botania:items/lensSpeed" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/lensTime.json b/src/main/resources/assets/botania/models/item/lensTime.json new file mode 100644 index 000000000..2dfb1d0a3 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/lensTime.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/lensInside", + "layer1": "botania:items/lensTime" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/lensWarp.json b/src/main/resources/assets/botania/models/item/lensWarp.json new file mode 100644 index 000000000..0cd2f394d --- /dev/null +++ b/src/main/resources/assets/botania/models/item/lensWarp.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/lensInside", + "layer1": "botania:items/lensWarp" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/lensWeight.json b/src/main/resources/assets/botania/models/item/lensWeight.json new file mode 100644 index 000000000..1a3322955 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/lensWeight.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/lensInside", + "layer1": "botania:items/lensWeight" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/lexicon_default.json b/src/main/resources/assets/botania/models/item/lexicon_default.json new file mode 100644 index 000000000..464dc1a78 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/lexicon_default.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/lexicon" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/lifeEssence.json b/src/main/resources/assets/botania/models/item/lifeEssence.json new file mode 100644 index 000000000..3c6b80c69 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/lifeEssence.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": + { + "layer0": "botania:items/lifeEssence" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/livingRoot.json b/src/main/resources/assets/botania/models/item/livingRoot.json new file mode 100644 index 000000000..ebc9bfdbd --- /dev/null +++ b/src/main/resources/assets/botania/models/item/livingRoot.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": + { + "layer0": "botania:items/root" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/livingwoodBow.json b/src/main/resources/assets/botania/models/item/livingwoodBow.json new file mode 100644 index 000000000..179a3ab2b --- /dev/null +++ b/src/main/resources/assets/botania/models/item/livingwoodBow.json @@ -0,0 +1,50 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/livingwoodBow0" + }, + "display": { + "thirdperson_righthand": { + "rotation": [ -80, 260, -40 ], + "translation": [ -1, -2, 2.5 ], + "scale": [ 0.9, 0.9, 0.9 ] + }, + "thirdperson_lefthand": { + "rotation": [ -80, -280, 40 ], + "translation": [ -1, -2, 2.5 ], + "scale": [ 0.9, 0.9, 0.9 ] + }, + "firstperson_righthand": { + "rotation": [ 0, -90, 25 ], + "translation": [ 1.13, 3.2, 1.13], + "scale": [ 0.68, 0.68, 0.68 ] + }, + "firstperson_lefthand": { + "rotation": [ 0, 90, -25 ], + "translation": [ 1.13, 3.2, 1.13], + "scale": [ 0.68, 0.68, 0.68 ] + } + }, + "overrides": [ + { + "predicate": { + "minecraft:pulling": 1 + }, + "model": "botania:item/livingwoodBow_pulling_1" + }, + { + "predicate": { + "minecraft:pulling": 1, + "minecraft:pull": 0.65 + }, + "model": "botania:item/livingwoodBow_pulling_2" + }, + { + "predicate": { + "minecraft:pulling": 1, + "minecraft:pull": 0.9 + }, + "model": "botania:item/livingwoodBow_pulling_3" + } + ] +} diff --git a/src/main/resources/assets/botania/models/item/livingwoodBow_pulling_1.json b/src/main/resources/assets/botania/models/item/livingwoodBow_pulling_1.json new file mode 100644 index 000000000..3dd9b8449 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/livingwoodBow_pulling_1.json @@ -0,0 +1,6 @@ +{ + "parent": "botania:item/livingwoodBow", + "textures": { + "layer0": "botania:items/livingwoodBow1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/livingwoodBow_pulling_2.json b/src/main/resources/assets/botania/models/item/livingwoodBow_pulling_2.json new file mode 100644 index 000000000..9b67919b4 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/livingwoodBow_pulling_2.json @@ -0,0 +1,6 @@ +{ + "parent": "botania:item/livingwoodBow", + "textures": { + "layer0": "botania:items/livingwoodBow2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/livingwoodBow_pulling_3.json b/src/main/resources/assets/botania/models/item/livingwoodBow_pulling_3.json new file mode 100644 index 000000000..ffa377cbb --- /dev/null +++ b/src/main/resources/assets/botania/models/item/livingwoodBow_pulling_3.json @@ -0,0 +1,6 @@ +{ + "parent": "botania:item/livingwoodBow", + "textures": { + "layer0": "botania:items/livingwoodBow3" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/livingwoodTwig.json b/src/main/resources/assets/botania/models/item/livingwoodTwig.json new file mode 100644 index 000000000..871523258 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/livingwoodTwig.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": + { + "layer0": "botania:items/livingwoodTwig" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/lokiRing.json b/src/main/resources/assets/botania/models/item/lokiRing.json new file mode 100644 index 000000000..1181e275c --- /dev/null +++ b/src/main/resources/assets/botania/models/item/lokiRing.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/lokiRing" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/magnetRing.json b/src/main/resources/assets/botania/models/item/magnetRing.json new file mode 100644 index 000000000..273320918 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/magnetRing.json @@ -0,0 +1,12 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/magnetRing1" + }, + "overrides": [{ + "predicate": { + "botania:on": 1 + }, + "model": "botania:item/magnetRingOn" + }] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/magnetRingGreater.json b/src/main/resources/assets/botania/models/item/magnetRingGreater.json new file mode 100644 index 000000000..f84549423 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/magnetRingGreater.json @@ -0,0 +1,12 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/magnetRingGreater1" + }, + "overrides": [{ + "predicate": { + "botania:on": 1 + }, + "model": "botania:item/magnetRingGreaterOn" + }] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/magnetRingGreaterOn.json b/src/main/resources/assets/botania/models/item/magnetRingGreaterOn.json new file mode 100644 index 000000000..996663ee9 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/magnetRingGreaterOn.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/magnetRingGreater0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/magnetRingOn.json b/src/main/resources/assets/botania/models/item/magnetRingOn.json new file mode 100644 index 000000000..306838b7c --- /dev/null +++ b/src/main/resources/assets/botania/models/item/magnetRingOn.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/magnetRing0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manaBottle0.json b/src/main/resources/assets/botania/models/item/manaBottle0.json new file mode 100644 index 000000000..51e07ede8 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manaBottle0.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/manaBottle0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manaBottle1.json b/src/main/resources/assets/botania/models/item/manaBottle1.json new file mode 100644 index 000000000..16a31af33 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manaBottle1.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/manaBottle1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manaBottle2.json b/src/main/resources/assets/botania/models/item/manaBottle2.json new file mode 100644 index 000000000..b0b032bc1 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manaBottle2.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/manaBottle2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manaBottle3.json b/src/main/resources/assets/botania/models/item/manaBottle3.json new file mode 100644 index 000000000..1e495be31 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manaBottle3.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/manaBottle3" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manaBottle4.json b/src/main/resources/assets/botania/models/item/manaBottle4.json new file mode 100644 index 000000000..3ac1bcda8 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manaBottle4.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/manaBottle4" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manaBottle5.json b/src/main/resources/assets/botania/models/item/manaBottle5.json new file mode 100644 index 000000000..c85cb48e1 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manaBottle5.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/manaBottle5" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manaCookie.json b/src/main/resources/assets/botania/models/item/manaCookie.json new file mode 100644 index 000000000..3f825a6c8 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manaCookie.json @@ -0,0 +1,12 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/manaCookie" + }, + "overrides": [{ + "predicate": { + "botania:totalbiscuit": 1 + }, + "model": "botania:item/totalBiscuit" + }] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manaDiamond.json b/src/main/resources/assets/botania/models/item/manaDiamond.json new file mode 100644 index 000000000..9b03388db --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manaDiamond.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": + { + "layer0": "botania:items/manaDiamond" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manaGun.json b/src/main/resources/assets/botania/models/item/manaGun.json new file mode 100644 index 000000000..2173f234e --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manaGun.json @@ -0,0 +1,188 @@ +{ + "__comment": "Author: wiiv", + "textures": { + "layer0": "botania:items/manaBlaster", + "layer1": "botania:items/manaBlasterColor", + "layer2": "botania:items/manaBlasterGlass" + }, + "elements": [ + { + "name": "Barrel1", + "from": [ -10.0, 5.0, 5.5 ], + "to": [ -3.0, 14.0, 10.5 ], + "faces": { + "north": { "texture": "layer0", "uv": [ 0.0, 7.01, 3.5, 11.49 ] }, + "east": { "texture": "layer0", "uv": [ 6.0, 7.0, 8.5, 11.5 ] }, + "south": { "texture": "layer0", "uv": [ 3.5, 7.01, 0.0, 11.49 ] }, + "west": { "texture": "layer0", "uv": [ 3.5, 7.01, 6.0, 11.49 ] }, + "up": { "texture": "layer0", "uv": [ 11.01, 10.5, 13.49, 13.99 ], "rotation": 90 }, + "down": { "texture": "layer0", "uv": [ 13.5, 10.5, 16.0, 14.0 ], "rotation": 90 } + } + }, + { + "name": "Barrel2", + "from": [ -3.0, 5.0, 5.5 ], + "to": [ 7.0, 9.0, 10.5 ], + "faces": { + "north": { "texture": "layer0", "uv": [ 11.01, 14.0, 15.99, 15.99 ] }, + "south": { "texture": "layer0", "uv": [ 16.0, 14.0, 11.0, 16.0 ] }, + "up": { "texture": "layer0", "uv": [ 11.01, 5.0, 13.49, 10.0 ], "rotation": 270 }, + "down": { "texture": "layer0", "uv": [ 13.5, 5.0, 15.99, 10.0 ], "rotation": 270 } + } + }, + { + "name": "Barrel3", + "from": [ 7.0, 5.0, 5.5 ], + "to": [ 10.0, 14.0, 10.5 ], + "faces": { + "north": { "texture": "layer0", "uv": [ 0.0, 11.5, 1.5, 16.0 ] }, + "east": { "texture": "layer0", "uv": [ 1.5, 11.5, 4.0, 16.0 ] }, + "south": { "texture": "layer0", "uv": [ 0.0, 11.5, 1.5, 16.0 ] }, + "west": { "texture": "layer0", "uv": [ 1.5, 11.5, 4.0, 16.0 ] }, + "up": { "texture": "layer0", "uv": [ 11.0, 4.0, 13.5, 5.5 ], "rotation": 90 }, + "down": { "texture": "layer0", "uv": [ 13.5, 4.0, 16.0, 5.5 ], "rotation": 90 } + } + }, + { + "name": "Barrel4", + "from": [ 10.0, 12.0, 5.5 ], + "to": [ 18.0, 14.0, 10.5 ], + "faces": { + "north": { "texture": "layer0", "uv": [ 4.01, 14.5, 8.0, 15.5 ] }, + "east": { "texture": "layer0", "uv": [ 4.0, 14.5, 6.5, 15.5 ] }, + "south": { "texture": "layer0", "uv": [ 8.0, 14.5, 4.0, 15.5 ] }, + "up": { "texture": "layer0", "uv": [ 11.01, 0.01, 13.49, 3.99 ], "rotation": 90 }, + "down": { "texture": "layer0", "uv": [ 11.0, 0.01, 13.5, 4.0 ], "rotation": 90 } + } + }, + { + "name": "Barrel5", + "from": [ 10.0, 9.0, 5.5 ], + "to": [ 18.0, 11.0, 10.5 ], + "faces": { + "north": { "texture": "layer0", "uv": [ 8.0, 14.5, 4.0, 15.5 ] }, + "east": { "texture": "layer0", "uv": [ 6.5, 14.5, 4.0, 15.5 ] }, + "south": { "texture": "layer0", "uv": [ 4.0, 14.5, 8.0, 15.5 ] }, + "up": { "texture": "layer0", "uv": [ 11.01, 0.0, 13.49, 3.99 ], "rotation": 90 }, + "down": { "texture": "layer0", "uv": [ 13.51, 0.01, 15.99, 3.99 ], "rotation": 90 } + } + }, + { + "name": "Strap", + "from": [ 14.0, -5.0, 6.5 ], + "to": [ 19.0, 9.0, 9.5 ], + "rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "z", "angle": 22.5 }, + "faces": { + "north": { "texture": "layer0", "uv": [ 0.0, 0.01, 2.5, 6.99 ] }, + "east": { "texture": "layer0", "uv": [ 4.0, 0.01, 5.5, 6.99 ] }, + "south": { "texture": "layer0", "uv": [ 2.5, 0.01, 0.0, 6.99 ] }, + "west": { "texture": "layer0", "uv": [ 2.5, 0.01, 4.0, 6.99 ] }, + "down": { "texture": "layer0", "uv": [ 5.5, 0.0, 7.0, 2.5 ], "rotation": 90 } + } + }, + { + "name": "Magazine", + "from": [ 12.5, -6.0, 7.0 ], + "to": [ 18.5, -5.0, 9.0 ], + "rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "z", "angle": 22.5 }, + "faces": { + "north": { "texture": "layer0", "uv": [ 7.5, 0.0, 8.0, 3.0 ], "rotation": 90 }, + "east": { "texture": "layer0", "uv": [ 8.0, 0.0, 7.0, 0.5 ] }, + "south": { "texture": "layer0", "uv": [ 8.0, 0.01, 7.5, 3.0 ], "rotation": 90 }, + "west": { "texture": "layer0", "uv": [ 7.0, 0.01, 8.0, 0.5 ] }, + "up": { "texture": "layer0", "uv": [ 7.0, 0.01, 8.0, 3.0 ], "rotation": 90 }, + "down": { "texture": "layer0", "uv": [ 7.01, 0.0, 7.99, 3.0 ], "rotation": 90 } + } + }, + { + "name": "Trigger Guard1", + "from": [ 10.0, 6.0, 7.0 ], + "to": [ 16.0, 7.0, 9.0 ], + "faces": { + "north": { "texture": "layer0", "uv": [ 5.5, 3.01, 8.5, 3.5 ] }, + "south": { "texture": "layer0", "uv": [ 5.5, 3.01, 8.5, 3.49 ] }, + "up": { "texture": "layer0", "uv": [ 5.5, 3.0, 8.5, 4.0 ] }, + "down": { "texture": "layer0", "uv": [ 5.5, 3.0, 8.5, 4.0 ] } + } + }, + { + "name": "Trigger", + "from": [ 13.0, 7.0, 7.5 ], + "to": [ 16.0, 9.0, 8.5 ], + "faces": { + "north": { "texture": "layer0", "uv": [ 5.5, 5.0, 6.5, 6.0 ] }, + "south": { "texture": "layer0", "uv": [ 5.5, 5.0, 6.5, 6.0 ] }, + "west": { "texture": "layer0", "uv": [ 5.5, 5.0, 6.5, 5.5 ] } + } + }, + { + "name": "Trigger Guard2", + "from": [ 10.0, 7.0, 7.0 ], + "to": [ 11.0, 9.0, 9.0 ], + "faces": { + "north": { "texture": "layer0", "uv": [ 5.5, 4.0, 6.0, 5.0 ] }, + "east": { "texture": "layer0", "uv": [ 5.5, 4.0, 6.5, 5.0 ] }, + "south": { "texture": "layer0", "uv": [ 5.5, 4.0, 6.0, 5.0 ] } + } + }, + { + "name": "Colorizer", + "from": [ 9.5, 11.0, 6.0 ], + "to": [ 17.5, 12.0, 10.0 ], + "faces": { + "north": { "texture": "layer1", "uv": [ 0.0, 0.0, 8.0, 5.0 ], "tintindex": 2 }, + "east": { "texture": "layer1", "uv": [ 0.0, 0.0, 5.0, 5.0 ], "tintindex": 2 }, + "south": { "texture": "layer1", "uv": [ 0.0, 0.0, 8.0, 5.0 ], "tintindex": 2 } + } + }, + { + "name": "Glass", + "from": [ -3.5, 9.5, 6.0 ], + "to": [ 7.5, 13.5, 10.0 ], + "faces": { + "north": { "texture": "layer2", "uv": [ 0.01, 7.01, 6.99, 7.99 ] }, + "east": { "texture": "layer2", "uv": [ 7.01, 7.01, 9.49, 7.99 ] }, + "south": { "texture": "layer2", "uv": [ 6.99, 7.01, 0.01, 7.99 ] }, + "up": { "texture": "layer2", "uv": [ 11.01, 0.01, 13.49, 6.99 ] }, + "down": { "texture": "layer2", "uv": [ 8.51, 0.01, 6.99, 9.99 ] } + } + } + ], + "display": { + "gui": { + "rotation": [ 0, -20, -40 ], + "translation": [ 0, 0, 0 ], + "scale": [ 0.4, 0.4, 0.4 ] + }, + "ground": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 0, 0 ], + "scale": [ 0.4, 0.4, 0.4 ] + }, + "fixed": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 0, 0 ], + "scale": [ 0.45, 0.45, 0.45 ] + }, + "thirdperson_lefthand": { + "rotation": [ 0, 90, 0 ], + "translation": [ 0, 2.45, -1.5 ], + "scale": [ 0.4, 0.4, 0.4 ] + }, + "thirdperson_righthand": { + "rotation": [ 0, -90, 0 ], + "translation": [ 0, 2.45, -1.5 ], + "scale": [ 0.4, 0.4, 0.4 ] + }, + "firstperson_lefthand": { + "rotation": [ 10, 80, -5 ], + "translation": [ 0.8, 2.5, 0 ], + "scale": [ 0.45, 0.45, 0.45 ] + }, + "firstperson_righthand": { + "rotation": [ 10, -80, 5 ], + "translation": [ -1.8, 2.5, 0 ], + "scale": [ 0.45, 0.45, 0.45 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manaGunClip.json b/src/main/resources/assets/botania/models/item/manaGunClip.json new file mode 100644 index 000000000..aa7221398 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manaGunClip.json @@ -0,0 +1,202 @@ +{ + "__comment": "Author: wiiv", + "textures": { + "layer0": "botania:items/manaBlaster", + "layer1": "botania:items/manaBlasterColor", + "layer2": "botania:items/manaBlasterGlass", + "layer3": "botania:items/manaBlasterLensClip" + }, + "elements": [ + { + "name": "Barrel1", + "from": [ -10.0, 5.0, 5.5 ], + "to": [ -3.0, 14.0, 10.5 ], + "faces": { + "north": { "texture": "layer0", "uv": [ 0.0, 7.01, 3.5, 11.49 ] }, + "east": { "texture": "layer0", "uv": [ 6.0, 7.0, 8.5, 11.5 ] }, + "south": { "texture": "layer0", "uv": [ 3.5, 7.01, 0.0, 11.49 ] }, + "west": { "texture": "layer0", "uv": [ 3.5, 7.01, 6.0, 11.49 ] }, + "up": { "texture": "layer0", "uv": [ 11.01, 10.5, 13.49, 13.99 ], "rotation": 90 }, + "down": { "texture": "layer0", "uv": [ 13.5, 10.5, 16.0, 14.0 ], "rotation": 90 } + } + }, + { + "name": "Barrel2", + "from": [ -3.0, 5.0, 5.5 ], + "to": [ 7.0, 9.0, 10.5 ], + "faces": { + "north": { "texture": "layer0", "uv": [ 11.01, 14.0, 15.99, 15.99 ] }, + "south": { "texture": "layer0", "uv": [ 16.0, 14.0, 11.0, 16.0 ] }, + "up": { "texture": "layer0", "uv": [ 11.01, 5.0, 13.49, 10.0 ], "rotation": 270 }, + "down": { "texture": "layer0", "uv": [ 13.5, 5.0, 15.99, 10.0 ], "rotation": 270 } + } + }, + { + "name": "Barrel3", + "from": [ 7.0, 5.0, 5.5 ], + "to": [ 10.0, 14.0, 10.5 ], + "faces": { + "north": { "texture": "layer0", "uv": [ 0.0, 11.5, 1.5, 16.0 ] }, + "east": { "texture": "layer0", "uv": [ 1.5, 11.5, 4.0, 16.0 ] }, + "south": { "texture": "layer0", "uv": [ 0.0, 11.5, 1.5, 16.0 ] }, + "west": { "texture": "layer0", "uv": [ 1.5, 11.5, 4.0, 16.0 ] }, + "up": { "texture": "layer0", "uv": [ 11.0, 4.0, 13.5, 5.5 ], "rotation": 90 }, + "down": { "texture": "layer0", "uv": [ 13.5, 4.0, 16.0, 5.5 ], "rotation": 90 } + } + }, + { + "name": "Barrel4", + "from": [ 10.0, 12.0, 5.5 ], + "to": [ 18.0, 14.0, 10.5 ], + "faces": { + "north": { "texture": "layer0", "uv": [ 4.01, 14.5, 8.0, 15.5 ] }, + "east": { "texture": "layer0", "uv": [ 4.0, 14.5, 6.5, 15.5 ] }, + "south": { "texture": "layer0", "uv": [ 8.0, 14.5, 4.0, 15.5 ] }, + "up": { "texture": "layer0", "uv": [ 11.01, 0.01, 13.49, 3.99 ], "rotation": 90 }, + "down": { "texture": "layer0", "uv": [ 11.0, 0.01, 13.5, 4.0 ], "rotation": 90 } + } + }, + { + "name": "Barrel5", + "from": [ 10.0, 9.0, 5.5 ], + "to": [ 18.0, 11.0, 10.5 ], + "faces": { + "north": { "texture": "layer0", "uv": [ 8.0, 14.5, 4.0, 15.5 ] }, + "east": { "texture": "layer0", "uv": [ 6.5, 14.5, 4.0, 15.5 ] }, + "south": { "texture": "layer0", "uv": [ 4.0, 14.5, 8.0, 15.5 ] }, + "up": { "texture": "layer0", "uv": [ 11.01, 0.0, 13.49, 3.99 ], "rotation": 90 }, + "down": { "texture": "layer0", "uv": [ 13.51, 0.01, 15.99, 3.99 ], "rotation": 90 } + } + }, + { + "name": "Strap", + "from": [ 14.0, -5.0, 6.5 ], + "to": [ 19.0, 9.0, 9.5 ], + "rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "z", "angle": 22.5 }, + "faces": { + "north": { "texture": "layer0", "uv": [ 0.0, 0.01, 2.5, 6.99 ] }, + "east": { "texture": "layer0", "uv": [ 4.0, 0.01, 5.5, 6.99 ] }, + "south": { "texture": "layer0", "uv": [ 2.5, 0.01, 0.0, 6.99 ] }, + "west": { "texture": "layer0", "uv": [ 2.5, 0.01, 4.0, 6.99 ] }, + "down": { "texture": "layer0", "uv": [ 5.5, 0.0, 7.0, 2.5 ], "rotation": 90 } + } + }, + { + "name": "Magazine", + "from": [ 12.5, -6.0, 7.0 ], + "to": [ 18.5, -5.0, 9.0 ], + "rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "z", "angle": 22.5 }, + "faces": { + "north": { "texture": "layer0", "uv": [ 7.5, 0.0, 8.0, 3.0 ], "rotation": 90 }, + "east": { "texture": "layer0", "uv": [ 8.0, 0.0, 7.0, 0.5 ] }, + "south": { "texture": "layer0", "uv": [ 8.0, 0.01, 7.5, 3.0 ], "rotation": 90 }, + "west": { "texture": "layer0", "uv": [ 7.0, 0.01, 8.0, 0.5 ] }, + "up": { "texture": "layer0", "uv": [ 7.0, 0.01, 8.0, 3.0 ], "rotation": 90 }, + "down": { "texture": "layer0", "uv": [ 7.01, 0.0, 7.99, 3.0 ], "rotation": 90 } + } + }, + { + "name": "Trigger Guard1", + "from": [ 10.0, 6.0, 7.0 ], + "to": [ 16.0, 7.0, 9.0 ], + "faces": { + "north": { "texture": "layer0", "uv": [ 5.5, 3.01, 8.5, 3.5 ] }, + "south": { "texture": "layer0", "uv": [ 5.5, 3.01, 8.5, 3.49 ] }, + "up": { "texture": "layer0", "uv": [ 5.5, 3.0, 8.5, 4.0 ] }, + "down": { "texture": "layer0", "uv": [ 5.5, 3.0, 8.5, 4.0 ] } + } + }, + { + "name": "Trigger", + "from": [ 13.0, 7.0, 7.5 ], + "to": [ 16.0, 9.0, 8.5 ], + "faces": { + "north": { "texture": "layer0", "uv": [ 5.5, 5.0, 6.5, 6.0 ] }, + "south": { "texture": "layer0", "uv": [ 5.5, 5.0, 6.5, 6.0 ] }, + "west": { "texture": "layer0", "uv": [ 5.5, 5.0, 6.5, 5.5 ] } + } + }, + { + "name": "Trigger Guard2", + "from": [ 10.0, 7.0, 7.0 ], + "to": [ 11.0, 9.0, 9.0 ], + "faces": { + "north": { "texture": "layer0", "uv": [ 5.5, 4.0, 6.0, 5.0 ] }, + "east": { "texture": "layer0", "uv": [ 5.5, 4.0, 6.5, 5.0 ] }, + "south": { "texture": "layer0", "uv": [ 5.5, 4.0, 6.0, 5.0 ] } + } + }, + { + "name": "Colorizer", + "from": [ 9.5, 11.0, 6.0 ], + "to": [ 17.5, 12.0, 10.0 ], + "faces": { + "north": { "texture": "layer1", "uv": [ 0.0, 0.0, 8.0, 5.0 ], "tintindex": 2 }, + "east": { "texture": "layer1", "uv": [ 0.0, 0.0, 5.0, 5.0 ], "tintindex": 2 }, + "south": { "texture": "layer1", "uv": [ 0.0, 0.0, 8.0, 5.0 ], "tintindex": 2 } + } + }, + { + "name": "Glass", + "from": [ -3.5, 9.5, 6.0 ], + "to": [ 7.5, 13.5, 10.0 ], + "faces": { + "north": { "texture": "layer2", "uv": [ 0.01, 7.01, 6.99, 7.99 ] }, + "east": { "texture": "layer2", "uv": [ 7.01, 7.01, 9.49, 7.99 ] }, + "south": { "texture": "layer2", "uv": [ 6.99, 7.01, 0.01, 7.99 ] }, + "up": { "texture": "layer2", "uv": [ 11.01, 0.01, 13.49, 6.99 ] }, + "down": { "texture": "layer2", "uv": [ 8.51, 0.01, 6.99, 9.99 ] } + } + }, + { + "name": "Clip", + "from": [ -4.5, 2.0, 5.0 ], + "to": [ 8.5, 8.0, 11.0 ], + "faces": { + "north": { "texture": "layer3", "uv": [ 0.01, 6.51, 6.5, 9.49 ] }, + "east": { "texture": "layer3", "uv": [ 6.01, 0.0, 9.0, 3.0 ] }, + "south": { "texture": "layer3", "uv": [ 6.5, 6.5, 0.01, 9.5 ] }, + "west": { "texture": "layer3", "uv": [ 6.0, 3.0, 9.0, 6.0 ] }, + "up": { "texture": "layer3", "uv": [ 0.0, 0.01, 3.0, 6.5 ], "rotation": 90 }, + "down": { "texture": "layer3", "uv": [ 3.0, 0.01, 6.0, 6.5 ], "rotation": 90 } + } + } + ], + "display": { + "gui": { + "rotation": [ 0, -20, -40 ], + "translation": [ 0, 0, 0 ], + "scale": [ 0.4, 0.4, 0.4 ] + }, + "ground": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 0, 0 ], + "scale": [ 0.4, 0.4, 0.4 ] + }, + "fixed": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 0, 0 ], + "scale": [ 0.45, 0.45, 0.45 ] + }, + "thirdperson_lefthand": { + "rotation": [ 0, 90, 0 ], + "translation": [ 0, 2.45, -1.5 ], + "scale": [ 0.4, 0.4, 0.4 ] + }, + "thirdperson_righthand": { + "rotation": [ 0, -90, 0 ], + "translation": [ 0, 2.45, -1.5 ], + "scale": [ 0.4, 0.4, 0.4 ] + }, + "firstperson_lefthand": { + "rotation": [ 10, 80, -5 ], + "translation": [ 0.8, 2.5, 0 ], + "scale": [ 0.45, 0.45, 0.45 ] + }, + "firstperson_righthand": { + "rotation": [ 10, -80, 5 ], + "translation": [ -1.8, 2.5, 0 ], + "scale": [ 0.45, 0.45, 0.45 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manaInkwell.json b/src/main/resources/assets/botania/models/item/manaInkwell.json new file mode 100644 index 000000000..6c75018c4 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manaInkwell.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/manaInkwell" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manaMirror.json b/src/main/resources/assets/botania/models/item/manaMirror.json new file mode 100644 index 000000000..71df4d562 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manaMirror.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/manaMirror0", + "layer1": "botania:items/manaMirror1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manaPearl.json b/src/main/resources/assets/botania/models/item/manaPearl.json new file mode 100644 index 000000000..5d231a549 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manaPearl.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": + { + "layer0": "botania:items/manaPearl" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manaPowder.json b/src/main/resources/assets/botania/models/item/manaPowder.json new file mode 100644 index 000000000..d5a884e32 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manaPowder.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": + { + "layer0": "botania:items/manaPowder" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manaRing.json b/src/main/resources/assets/botania/models/item/manaRing.json new file mode 100644 index 000000000..d1351432a --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manaRing.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/manaRing" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manaRingGreater.json b/src/main/resources/assets/botania/models/item/manaRingGreater.json new file mode 100644 index 000000000..906e35a9a --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manaRingGreater.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/manaRingGreater" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manaString.json b/src/main/resources/assets/botania/models/item/manaString.json new file mode 100644 index 000000000..6357d8e4b --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manaString.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": + { + "layer0": "botania:items/manaString" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manaTablet.json b/src/main/resources/assets/botania/models/item/manaTablet.json new file mode 100644 index 000000000..513ff9acb --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manaTablet.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/manaTablet0", + "layer1": "botania:items/manaTablet1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manasteel.json b/src/main/resources/assets/botania/models/item/manasteel.json new file mode 100644 index 000000000..3858eb0d8 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manasteel.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": + { + "layer0": "botania:items/manasteel" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manasteelAxe.json b/src/main/resources/assets/botania/models/item/manasteelAxe.json new file mode 100644 index 000000000..4755fed67 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manasteelAxe.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/handheld", + "textures": + { + "layer0": "botania:items/manasteelAxe" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manasteelBoots.json b/src/main/resources/assets/botania/models/item/manasteelBoots.json new file mode 100644 index 000000000..f1b52078f --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manasteelBoots.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": + { + "layer0": "botania:items/manasteelBoots" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manasteelChest.json b/src/main/resources/assets/botania/models/item/manasteelChest.json new file mode 100644 index 000000000..fe9b46a8a --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manasteelChest.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": + { + "layer0": "botania:items/manasteelChest" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manasteelHelm.json b/src/main/resources/assets/botania/models/item/manasteelHelm.json new file mode 100644 index 000000000..8126b821d --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manasteelHelm.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": + { + "layer0": "botania:items/manasteelHelm" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manasteelHelmReveal.json b/src/main/resources/assets/botania/models/item/manasteelHelmReveal.json new file mode 100644 index 000000000..39aac7ede --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manasteelHelmReveal.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/manasteelHelmReveal" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manasteelLegs.json b/src/main/resources/assets/botania/models/item/manasteelLegs.json new file mode 100644 index 000000000..02ec3aea7 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manasteelLegs.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": + { + "layer0": "botania:items/manasteelLegs" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manasteelNugget.json b/src/main/resources/assets/botania/models/item/manasteelNugget.json new file mode 100644 index 000000000..599cd8ed8 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manasteelNugget.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": + { + "layer0": "botania:items/manasteelNugget" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manasteelPick.json b/src/main/resources/assets/botania/models/item/manasteelPick.json new file mode 100644 index 000000000..2f8fad6ab --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manasteelPick.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/handheld", + "textures": + { + "layer0": "botania:items/manasteelPick" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manasteelShears.json b/src/main/resources/assets/botania/models/item/manasteelShears.json new file mode 100644 index 000000000..e4b8a0cc6 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manasteelShears.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/handheld", + "textures": + { + "layer0": "botania:items/manasteelShears" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manasteelShovel.json b/src/main/resources/assets/botania/models/item/manasteelShovel.json new file mode 100644 index 000000000..0f2ce4744 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manasteelShovel.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/handheld", + "textures": + { + "layer0": "botania:items/manasteelShovel" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manasteelSword.json b/src/main/resources/assets/botania/models/item/manasteelSword.json new file mode 100644 index 000000000..2279051fb --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manasteelSword.json @@ -0,0 +1,13 @@ +{ + "parent": "minecraft:item/handheld", + "textures": + { + "layer0": "botania:items/manasteelSword" + }, + "overrides": [{ + "predicate": { + "botania:elucidator": 1 + }, + "model": "botania:item/elucidator" + }] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manaweaveBoots.json b/src/main/resources/assets/botania/models/item/manaweaveBoots.json new file mode 100644 index 000000000..21f61818a --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manaweaveBoots.json @@ -0,0 +1,12 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/manaweaveBoots" + }, + "overrides": [{ + "predicate": { + "botania:holiday": 1 + }, + "model": "botania:item/manaweaveBootsHoliday" + }] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manaweaveBootsHoliday.json b/src/main/resources/assets/botania/models/item/manaweaveBootsHoliday.json new file mode 100644 index 000000000..dbbcfb782 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manaweaveBootsHoliday.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/manaweaveBootsHoliday" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manaweaveChest.json b/src/main/resources/assets/botania/models/item/manaweaveChest.json new file mode 100644 index 000000000..42f9e20cf --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manaweaveChest.json @@ -0,0 +1,12 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/manaweaveChest" + }, + "overrides": [{ + "predicate": { + "botania:holiday": 1 + }, + "model": "botania:item/manaweaveChestHoliday" + }] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manaweaveChestHoliday.json b/src/main/resources/assets/botania/models/item/manaweaveChestHoliday.json new file mode 100644 index 000000000..96a9d8450 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manaweaveChestHoliday.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/manaweaveChestHoliday" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manaweaveCloth.json b/src/main/resources/assets/botania/models/item/manaweaveCloth.json new file mode 100644 index 000000000..f164e0f2d --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manaweaveCloth.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": + { + "layer0": "botania:items/manaweaveCloth" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manaweaveHelm.json b/src/main/resources/assets/botania/models/item/manaweaveHelm.json new file mode 100644 index 000000000..3f8ecc2ed --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manaweaveHelm.json @@ -0,0 +1,12 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/manaweaveHelm" + }, + "overrides": [{ + "predicate": { + "botania:holiday": 1 + }, + "model": "botania:item/manaweaveHelmHoliday" + }] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manaweaveHelmHoliday.json b/src/main/resources/assets/botania/models/item/manaweaveHelmHoliday.json new file mode 100644 index 000000000..3fad87e44 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manaweaveHelmHoliday.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/manaweaveHelmHoliday" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manaweaveLegs.json b/src/main/resources/assets/botania/models/item/manaweaveLegs.json new file mode 100644 index 000000000..506d1733f --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manaweaveLegs.json @@ -0,0 +1,12 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/manaweaveLegs" + }, + "overrides": [{ + "predicate": { + "botania:holiday": 1 + }, + "model": "botania:item/manaweaveLegsHoliday" + }] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/manaweaveLegsHoliday.json b/src/main/resources/assets/botania/models/item/manaweaveLegsHoliday.json new file mode 100644 index 000000000..e16a174b8 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/manaweaveLegsHoliday.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/manaweaveLegsHoliday" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/miningRing.json b/src/main/resources/assets/botania/models/item/miningRing.json new file mode 100644 index 000000000..09dcc9045 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/miningRing.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/miningRing" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/missileRod.json b/src/main/resources/assets/botania/models/item/missileRod.json new file mode 100644 index 000000000..8ca598a28 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/missileRod.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "botania:items/missileRod" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/monocle.json b/src/main/resources/assets/botania/models/item/monocle.json new file mode 100644 index 000000000..ae2ad5129 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/monocle.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/monocle" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/obedienceStick.json b/src/main/resources/assets/botania/models/item/obedienceStick.json new file mode 100644 index 000000000..af91086e8 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/obedienceStick.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "botania:items/obedienceStick" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/odinRing.json b/src/main/resources/assets/botania/models/item/odinRing.json new file mode 100644 index 000000000..6546b3462 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/odinRing.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/odinRing" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/openBucket.json b/src/main/resources/assets/botania/models/item/openBucket.json new file mode 100644 index 000000000..18bf286ec --- /dev/null +++ b/src/main/resources/assets/botania/models/item/openBucket.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/openBucket" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/overgrowthSeed.json b/src/main/resources/assets/botania/models/item/overgrowthSeed.json new file mode 100644 index 000000000..5662c5e99 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/overgrowthSeed.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/overgrowthSeed" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/pebble.json b/src/main/resources/assets/botania/models/item/pebble.json new file mode 100644 index 000000000..1dbbd6148 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/pebble.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": + { + "layer0": "botania:items/pebble" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/pestleAndMortar.json b/src/main/resources/assets/botania/models/item/pestleAndMortar.json new file mode 100644 index 000000000..e692d812f --- /dev/null +++ b/src/main/resources/assets/botania/models/item/pestleAndMortar.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": + { + "layer0": "botania:items/pestleAndMortar" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/petal.json b/src/main/resources/assets/botania/models/item/petal.json new file mode 100644 index 000000000..904509bdb --- /dev/null +++ b/src/main/resources/assets/botania/models/item/petal.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/petal" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/phantomInk.json b/src/main/resources/assets/botania/models/item/phantomInk.json new file mode 100644 index 000000000..838272c72 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/phantomInk.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/phantomInk" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/pinkinator.json b/src/main/resources/assets/botania/models/item/pinkinator.json new file mode 100644 index 000000000..6356262b1 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/pinkinator.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/pinkinator" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/pixieDust.json b/src/main/resources/assets/botania/models/item/pixieDust.json new file mode 100644 index 000000000..fa6b8aacf --- /dev/null +++ b/src/main/resources/assets/botania/models/item/pixieDust.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": + { + "layer0": "botania:items/pixieDust" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/pixieRing.json b/src/main/resources/assets/botania/models/item/pixieRing.json new file mode 100644 index 000000000..4141216bd --- /dev/null +++ b/src/main/resources/assets/botania/models/item/pixieRing.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/pixieRing" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/placeholder.json b/src/main/resources/assets/botania/models/item/placeholder.json new file mode 100644 index 000000000..ae62a9935 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/placeholder.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": + { + "layer0": "botania:items/placeholder" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/poolMinecart.json b/src/main/resources/assets/botania/models/item/poolMinecart.json new file mode 100644 index 000000000..1907d578b --- /dev/null +++ b/src/main/resources/assets/botania/models/item/poolMinecart.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/poolMinecart" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/prismarineShard.json b/src/main/resources/assets/botania/models/item/prismarineShard.json new file mode 100644 index 000000000..a7126693f --- /dev/null +++ b/src/main/resources/assets/botania/models/item/prismarineShard.json @@ -0,0 +1,3 @@ +{ + "parent": "minecraft:item/prismarine_shard" +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/quartz0.json b/src/main/resources/assets/botania/models/item/quartz0.json new file mode 100644 index 000000000..689b6cdf9 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/quartz0.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/quartz0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/quartz1.json b/src/main/resources/assets/botania/models/item/quartz1.json new file mode 100644 index 000000000..e59a6acca --- /dev/null +++ b/src/main/resources/assets/botania/models/item/quartz1.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/quartz1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/quartz2.json b/src/main/resources/assets/botania/models/item/quartz2.json new file mode 100644 index 000000000..30d9c075a --- /dev/null +++ b/src/main/resources/assets/botania/models/item/quartz2.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/quartz2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/quartz3.json b/src/main/resources/assets/botania/models/item/quartz3.json new file mode 100644 index 000000000..6fbe138e6 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/quartz3.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/quartz3" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/quartz4.json b/src/main/resources/assets/botania/models/item/quartz4.json new file mode 100644 index 000000000..16b58d8df --- /dev/null +++ b/src/main/resources/assets/botania/models/item/quartz4.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/quartz4" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/quartz5.json b/src/main/resources/assets/botania/models/item/quartz5.json new file mode 100644 index 000000000..2d3885d12 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/quartz5.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/quartz5" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/quartz6.json b/src/main/resources/assets/botania/models/item/quartz6.json new file mode 100644 index 000000000..4fbc29335 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/quartz6.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/quartz6" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/rainbowRod.json b/src/main/resources/assets/botania/models/item/rainbowRod.json new file mode 100644 index 000000000..f8a0496d1 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/rainbowRod.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "botania:items/rainbowRod" + } +} diff --git a/src/main/resources/assets/botania/models/item/reachRing.json b/src/main/resources/assets/botania/models/item/reachRing.json new file mode 100644 index 000000000..b8c7b2ed6 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/reachRing.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/reachRing" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/recordGaia1.json b/src/main/resources/assets/botania/models/item/recordGaia1.json new file mode 100644 index 000000000..bb47b70fd --- /dev/null +++ b/src/main/resources/assets/botania/models/item/recordGaia1.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/recordGaia1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/recordGaia2.json b/src/main/resources/assets/botania/models/item/recordGaia2.json new file mode 100644 index 000000000..2da70f384 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/recordGaia2.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/recordGaia2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/redString.json b/src/main/resources/assets/botania/models/item/redString.json new file mode 100644 index 000000000..4bc444d96 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/redString.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": + { + "layer0": "botania:items/redString" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/redstoneRoot.json b/src/main/resources/assets/botania/models/item/redstoneRoot.json new file mode 100644 index 000000000..1175a4924 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/redstoneRoot.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": + { + "layer0": "botania:items/redstoneRoot" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/regenIvy.json b/src/main/resources/assets/botania/models/item/regenIvy.json new file mode 100644 index 000000000..4c7da101e --- /dev/null +++ b/src/main/resources/assets/botania/models/item/regenIvy.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/regenIvy" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/rune_air.json b/src/main/resources/assets/botania/models/item/rune_air.json new file mode 100644 index 000000000..84049de34 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/rune_air.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/rune3" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/rune_autumn.json b/src/main/resources/assets/botania/models/item/rune_autumn.json new file mode 100644 index 000000000..01ee53686 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/rune_autumn.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/rune6" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/rune_earth.json b/src/main/resources/assets/botania/models/item/rune_earth.json new file mode 100644 index 000000000..829284378 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/rune_earth.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/rune2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/rune_envy.json b/src/main/resources/assets/botania/models/item/rune_envy.json new file mode 100644 index 000000000..14f751599 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/rune_envy.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/rune14" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/rune_fire.json b/src/main/resources/assets/botania/models/item/rune_fire.json new file mode 100644 index 000000000..0f17c0315 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/rune_fire.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/rune1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/rune_gluttony.json b/src/main/resources/assets/botania/models/item/rune_gluttony.json new file mode 100644 index 000000000..066d90e9d --- /dev/null +++ b/src/main/resources/assets/botania/models/item/rune_gluttony.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/rune10" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/rune_greed.json b/src/main/resources/assets/botania/models/item/rune_greed.json new file mode 100644 index 000000000..eba98cb79 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/rune_greed.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/rune11" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/rune_lust.json b/src/main/resources/assets/botania/models/item/rune_lust.json new file mode 100644 index 000000000..fb0e11c60 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/rune_lust.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/rune9" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/rune_mana.json b/src/main/resources/assets/botania/models/item/rune_mana.json new file mode 100644 index 000000000..c887f9008 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/rune_mana.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/rune8" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/rune_pride.json b/src/main/resources/assets/botania/models/item/rune_pride.json new file mode 100644 index 000000000..15fabfbb4 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/rune_pride.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/rune15" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/rune_sloth.json b/src/main/resources/assets/botania/models/item/rune_sloth.json new file mode 100644 index 000000000..425cdfe55 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/rune_sloth.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/rune12" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/rune_spring.json b/src/main/resources/assets/botania/models/item/rune_spring.json new file mode 100644 index 000000000..d289ef03b --- /dev/null +++ b/src/main/resources/assets/botania/models/item/rune_spring.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/rune4" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/rune_summer.json b/src/main/resources/assets/botania/models/item/rune_summer.json new file mode 100644 index 000000000..c6ff6952c --- /dev/null +++ b/src/main/resources/assets/botania/models/item/rune_summer.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/rune5" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/rune_water.json b/src/main/resources/assets/botania/models/item/rune_water.json new file mode 100644 index 000000000..de54127f6 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/rune_water.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/rune0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/rune_winter.json b/src/main/resources/assets/botania/models/item/rune_winter.json new file mode 100644 index 000000000..e2ec110a8 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/rune_winter.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/rune7" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/rune_wrath.json b/src/main/resources/assets/botania/models/item/rune_wrath.json new file mode 100644 index 000000000..85d9b7e80 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/rune_wrath.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/rune13" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/sextant.json b/src/main/resources/assets/botania/models/item/sextant.json new file mode 100644 index 000000000..80c3d2644 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/sextant.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/sextant" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/signalFlare.json b/src/main/resources/assets/botania/models/item/signalFlare.json new file mode 100644 index 000000000..3fffde5d5 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/signalFlare.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "botania:items/signalFlare0", + "layer1": "botania:items/signalFlare1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/skyDirtRod.json b/src/main/resources/assets/botania/models/item/skyDirtRod.json new file mode 100644 index 000000000..93d2949b7 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/skyDirtRod.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "botania:items/skyDirtRod" + } +} diff --git a/src/main/resources/assets/botania/models/item/slimeBottle0.json b/src/main/resources/assets/botania/models/item/slimeBottle0.json new file mode 100644 index 000000000..db61916b9 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/slimeBottle0.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/slimeBottle0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/slimeBottle1.json b/src/main/resources/assets/botania/models/item/slimeBottle1.json new file mode 100644 index 000000000..c766d6ad6 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/slimeBottle1.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/slimeBottle1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/slingshot.json b/src/main/resources/assets/botania/models/item/slingshot.json new file mode 100644 index 000000000..144ddf3f8 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/slingshot.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/slingshot" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/smeltRod.json b/src/main/resources/assets/botania/models/item/smeltRod.json new file mode 100644 index 000000000..bf321e92b --- /dev/null +++ b/src/main/resources/assets/botania/models/item/smeltRod.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "botania:items/smeltRod" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/spark.json b/src/main/resources/assets/botania/models/item/spark.json new file mode 100644 index 000000000..677a38a9c --- /dev/null +++ b/src/main/resources/assets/botania/models/item/spark.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/spark0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/sparkUpgrade0.json b/src/main/resources/assets/botania/models/item/sparkUpgrade0.json new file mode 100644 index 000000000..6564ebf2d --- /dev/null +++ b/src/main/resources/assets/botania/models/item/sparkUpgrade0.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/sparkUpgrade0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/sparkUpgrade1.json b/src/main/resources/assets/botania/models/item/sparkUpgrade1.json new file mode 100644 index 000000000..98185bd84 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/sparkUpgrade1.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/sparkUpgrade1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/sparkUpgrade2.json b/src/main/resources/assets/botania/models/item/sparkUpgrade2.json new file mode 100644 index 000000000..7d7a36eb8 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/sparkUpgrade2.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/sparkUpgrade2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/sparkUpgrade3.json b/src/main/resources/assets/botania/models/item/sparkUpgrade3.json new file mode 100644 index 000000000..d7a18e778 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/sparkUpgrade3.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/sparkUpgrade3" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/spawnerMover.json b/src/main/resources/assets/botania/models/item/spawnerMover.json new file mode 100644 index 000000000..daaca965c --- /dev/null +++ b/src/main/resources/assets/botania/models/item/spawnerMover.json @@ -0,0 +1,12 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/spawnerMover0" + }, + "overrides": [{ + "predicate": { + "botania:full": 1 + }, + "model": "botania:item/spawnerMoverFull" + }] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/spawnerMoverFull.json b/src/main/resources/assets/botania/models/item/spawnerMoverFull.json new file mode 100644 index 000000000..8d8221966 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/spawnerMoverFull.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/spawnerMover1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/speedUpBelt.json b/src/main/resources/assets/botania/models/item/speedUpBelt.json new file mode 100644 index 000000000..c8e9e9637 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/speedUpBelt.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/speedUpBelt" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/spellCloth.json b/src/main/resources/assets/botania/models/item/spellCloth.json new file mode 100644 index 000000000..860658c5d --- /dev/null +++ b/src/main/resources/assets/botania/models/item/spellCloth.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/spellCloth" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/starSword.json b/src/main/resources/assets/botania/models/item/starSword.json new file mode 100644 index 000000000..979f81d5f --- /dev/null +++ b/src/main/resources/assets/botania/models/item/starSword.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/handheld", + "textures": + { + "layer0": "botania:items/starSword" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/superLavaPendant.json b/src/main/resources/assets/botania/models/item/superLavaPendant.json new file mode 100644 index 000000000..32e5ab6d5 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/superLavaPendant.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/superLavaPendant" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/superTravelBelt.json b/src/main/resources/assets/botania/models/item/superTravelBelt.json new file mode 100644 index 000000000..afbe1998d --- /dev/null +++ b/src/main/resources/assets/botania/models/item/superTravelBelt.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/superTravelBelt" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/swapRing.json b/src/main/resources/assets/botania/models/item/swapRing.json new file mode 100644 index 000000000..f7d6a66ed --- /dev/null +++ b/src/main/resources/assets/botania/models/item/swapRing.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/swapRing" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/temperanceStone0.json b/src/main/resources/assets/botania/models/item/temperanceStone0.json new file mode 100644 index 000000000..bee4e34c7 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/temperanceStone0.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/temperanceStone0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/temperanceStone1.json b/src/main/resources/assets/botania/models/item/temperanceStone1.json new file mode 100644 index 000000000..6021f8300 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/temperanceStone1.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/temperanceStone1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/terraAxe.json b/src/main/resources/assets/botania/models/item/terraAxe.json new file mode 100644 index 000000000..0c5e50ea7 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/terraAxe.json @@ -0,0 +1,12 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "botania:items/terraAxe1" + }, + "overrides": [{ + "predicate": { + "botania:terraaxe_on": 1 + }, + "model": "botania:item/terraAxeOn" + }] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/terraAxeOn.json b/src/main/resources/assets/botania/models/item/terraAxeOn.json new file mode 100644 index 000000000..e017e1cc0 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/terraAxeOn.json @@ -0,0 +1,6 @@ +{ + "parent": "botania:item/terraAxe", + "textures": { + "layer0": "botania:items/terraAxe0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/terraPick.json b/src/main/resources/assets/botania/models/item/terraPick.json new file mode 100644 index 000000000..ba3f22a7e --- /dev/null +++ b/src/main/resources/assets/botania/models/item/terraPick.json @@ -0,0 +1,27 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "botania:items/terraPick0" + }, + "overrides": [ + { + "predicate": { + "botania:enabled": 1 + }, + "model": "botania:item/terraPickEnabled" + }, + { + "predicate": { + "botania:tipped": 1 + }, + "model": "botania:item/terraPickTipped" + }, + { + "predicate": { + "botania:tipped": 1, + "botania:enabled": 1 + }, + "model": "botania:item/terraPickTippedEnabled" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/terraPickEnabled.json b/src/main/resources/assets/botania/models/item/terraPickEnabled.json new file mode 100644 index 000000000..c93049bb0 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/terraPickEnabled.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "botania:items/terraPick0", + "layer1": "botania:items/terraPick1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/terraPickTipped.json b/src/main/resources/assets/botania/models/item/terraPickTipped.json new file mode 100644 index 000000000..54c6b5284 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/terraPickTipped.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "botania:items/terraPick2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/terraPickTippedEnabled.json b/src/main/resources/assets/botania/models/item/terraPickTippedEnabled.json new file mode 100644 index 000000000..38fcdc28c --- /dev/null +++ b/src/main/resources/assets/botania/models/item/terraPickTippedEnabled.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "botania:items/terraPick2", + "layer1": "botania:items/terraPick1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/terraSword.json b/src/main/resources/assets/botania/models/item/terraSword.json new file mode 100644 index 000000000..fb892a284 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/terraSword.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "botania:items/terraSword" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/terraformRod.json b/src/main/resources/assets/botania/models/item/terraformRod.json new file mode 100644 index 000000000..42f5509c9 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/terraformRod.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "botania:items/terraformRod" + } +} diff --git a/src/main/resources/assets/botania/models/item/terrasteel.json b/src/main/resources/assets/botania/models/item/terrasteel.json new file mode 100644 index 000000000..7612428d5 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/terrasteel.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": + { + "layer0": "botania:items/terrasteel" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/terrasteelBoots.json b/src/main/resources/assets/botania/models/item/terrasteelBoots.json new file mode 100644 index 000000000..b9e2743a7 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/terrasteelBoots.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": + { + "layer0": "botania:items/terrasteelBoots" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/terrasteelChest.json b/src/main/resources/assets/botania/models/item/terrasteelChest.json new file mode 100644 index 000000000..6b959f638 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/terrasteelChest.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": + { + "layer0": "botania:items/terrasteelChest" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/terrasteelHelm.json b/src/main/resources/assets/botania/models/item/terrasteelHelm.json new file mode 100644 index 000000000..97514ddb9 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/terrasteelHelm.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": + { + "layer0": "botania:items/terrasteelHelm" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/terrasteelHelmReveal.json b/src/main/resources/assets/botania/models/item/terrasteelHelmReveal.json new file mode 100644 index 000000000..98f1522f9 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/terrasteelHelmReveal.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/terrasteelHelmReveal" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/terrasteelLegs.json b/src/main/resources/assets/botania/models/item/terrasteelLegs.json new file mode 100644 index 000000000..2f6ea5c2f --- /dev/null +++ b/src/main/resources/assets/botania/models/item/terrasteelLegs.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": + { + "layer0": "botania:items/terrasteelLegs" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/terrasteelNugget.json b/src/main/resources/assets/botania/models/item/terrasteelNugget.json new file mode 100644 index 000000000..e5657aafc --- /dev/null +++ b/src/main/resources/assets/botania/models/item/terrasteelNugget.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": + { + "layer0": "botania:items/terrasteelNugget" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/thorRing.json b/src/main/resources/assets/botania/models/item/thorRing.json new file mode 100644 index 000000000..63da9fbb6 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/thorRing.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/thorRing" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/thornChakram0.json b/src/main/resources/assets/botania/models/item/thornChakram0.json new file mode 100644 index 000000000..d28678238 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/thornChakram0.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/thornChakram0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/thornChakram1.json b/src/main/resources/assets/botania/models/item/thornChakram1.json new file mode 100644 index 000000000..699b33dc0 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/thornChakram1.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/thornChakram1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/thunderSword.json b/src/main/resources/assets/botania/models/item/thunderSword.json new file mode 100644 index 000000000..ea13075e1 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/thunderSword.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/handheld", + "textures": + { + "layer0": "botania:items/thunderSword" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/tinyPlanet.json b/src/main/resources/assets/botania/models/item/tinyPlanet.json new file mode 100644 index 000000000..6816f4f5f --- /dev/null +++ b/src/main/resources/assets/botania/models/item/tinyPlanet.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/tinyPlanet" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/tornadoRod.json b/src/main/resources/assets/botania/models/item/tornadoRod.json new file mode 100644 index 000000000..7c58a9f61 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/tornadoRod.json @@ -0,0 +1,12 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "botania:items/tornadoRod0" + }, + "overrides": [{ + "predicate": { + "botania:flying": 1 + }, + "model": "botania:item/tornadoRod_flying" + }] +} diff --git a/src/main/resources/assets/botania/models/item/tornadoRod_flying.json b/src/main/resources/assets/botania/models/item/tornadoRod_flying.json new file mode 100644 index 000000000..8a2a698de --- /dev/null +++ b/src/main/resources/assets/botania/models/item/tornadoRod_flying.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "botania:items/tornadoRod1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/totalBiscuit.json b/src/main/resources/assets/botania/models/item/totalBiscuit.json new file mode 100644 index 000000000..57428e745 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/totalBiscuit.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/totalBiscuit" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/travelBelt.json b/src/main/resources/assets/botania/models/item/travelBelt.json new file mode 100644 index 000000000..e9e94cf11 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/travelBelt.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/travelBelt" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/twigWand.json b/src/main/resources/assets/botania/models/item/twigWand.json new file mode 100644 index 000000000..ab49ee092 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/twigWand.json @@ -0,0 +1,14 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "botania:items/twigWand0", + "layer1": "botania:items/twigWand1", + "layer2": "botania:items/twigWand2" + }, + "overrides": [{ + "predicate": { + "botania:bindmode": 1 + }, + "model": "botania:item/twigWand_bind" + }] +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/twigWand_bind.json b/src/main/resources/assets/botania/models/item/twigWand_bind.json new file mode 100644 index 000000000..0c1b31567 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/twigWand_bind.json @@ -0,0 +1,9 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "botania:items/twigWand0", + "layer1": "botania:items/twigWand1", + "layer2": "botania:items/twigWand2", + "layer3": "botania:items/twigWand3" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/unholyCloak.json b/src/main/resources/assets/botania/models/item/unholyCloak.json new file mode 100644 index 000000000..3bfd0b2ed --- /dev/null +++ b/src/main/resources/assets/botania/models/item/unholyCloak.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/unholyCloak" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/vial.json b/src/main/resources/assets/botania/models/item/vial.json new file mode 100644 index 000000000..1f7b030a7 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/vial.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/vial0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/vineBall.json b/src/main/resources/assets/botania/models/item/vineBall.json new file mode 100644 index 000000000..744ca6f8c --- /dev/null +++ b/src/main/resources/assets/botania/models/item/vineBall.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/vineBall" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/virus0.json b/src/main/resources/assets/botania/models/item/virus0.json new file mode 100644 index 000000000..039a4e305 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/virus0.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/virus0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/virus1.json b/src/main/resources/assets/botania/models/item/virus1.json new file mode 100644 index 000000000..15359f35e --- /dev/null +++ b/src/main/resources/assets/botania/models/item/virus1.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/virus1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/vuvuzela.json b/src/main/resources/assets/botania/models/item/vuvuzela.json new file mode 100644 index 000000000..20f0310d8 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/vuvuzela.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "botania:items/vuvuzela" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/waterRing.json b/src/main/resources/assets/botania/models/item/waterRing.json new file mode 100644 index 000000000..778f5dc47 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/waterRing.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/waterRing" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/models/item/waterRod.json b/src/main/resources/assets/botania/models/item/waterRod.json new file mode 100644 index 000000000..641897bbe --- /dev/null +++ b/src/main/resources/assets/botania/models/item/waterRod.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "botania:items/waterRod" + } +} diff --git a/src/main/resources/assets/botania/models/item/worldSeed.json b/src/main/resources/assets/botania/models/item/worldSeed.json new file mode 100644 index 000000000..9e64b0c64 --- /dev/null +++ b/src/main/resources/assets/botania/models/item/worldSeed.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "botania:items/worldSeed" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/shader/alpha.frag b/src/main/resources/assets/botania/shader/alpha.frag new file mode 100644 index 000000000..ec9a86279 --- /dev/null +++ b/src/main/resources/assets/botania/shader/alpha.frag @@ -0,0 +1,9 @@ +#version 120 + +uniform float alpha; // Passed in by callback +uniform sampler2D tex; +uniform int time; // Passed in, see ShaderHelper.java + +void main() { + gl_FragColor = texture2D(tex, vec2(gl_TexCoord[0])) * gl_Color * vec4(1.0, 1.0, 1.0, alpha); +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/shader/alpha.vert b/src/main/resources/assets/botania/shader/alpha.vert new file mode 100644 index 000000000..f76947aa8 --- /dev/null +++ b/src/main/resources/assets/botania/shader/alpha.vert @@ -0,0 +1,9 @@ +#version 120 + +uniform int time; // Passed in, see ShaderHelper.java + +void main() { + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + gl_TexCoord[0] = gl_MultiTexCoord0; + gl_FrontColor = gl_Color; +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/sounds.json b/src/main/resources/assets/botania/sounds.json index 3f9bc9775..49e44dff1 100644 --- a/src/main/resources/assets/botania/sounds.json +++ b/src/main/resources/assets/botania/sounds.json @@ -1,45 +1,46 @@ { - "airRod": { "category": "player", "sounds":["airRod"] }, - "agricarnation": { "category": "block", "sounds":["agricarnation"] }, - "altarCraft": { "category": "block", "sounds":["altarCraft"] }, - "babylonAttack": { "category": "player", "sounds":["babylonAttack"] }, - "babylonSpawn": { "category": "player", "sounds":["babylonSpawn"] }, - "bellows": { "category": "block", "sounds":["bellows"] }, - "bifrostRod": { "category": "player", "sounds":["bifrostRod"] }, - "blackLotus": { "category": "block", "sounds":["blackLotus"] }, - "dash": { "category": "player", "sounds":["dash"] }, - "ding": { "category": "block", "sounds":["ding"] }, - "divaCharm": { "category": "player", "sounds":["divaCharm"] }, - "divinationRod": { "category": "player", "sounds":["divinationRod"] }, - "doit": { "category": "block", "sounds":["doit"] }, - "enchanterBlock": { "category": "block", "sounds":["enchanterBlock"] }, - "enchanterEnchant": { "category": "block", "sounds":["enchanterEnchant"] }, - "endoflame": { "category": "block", "sounds":["endoflame"] }, - "equipBauble": { "category": "player", "sounds":["equipBauble"] }, - "gaiaTrap": { "category": "hostile", "sounds":["gaiaTrap"] }, - "goldenLaurel": { "category": "player", "sounds":["goldenLaurel"] }, - "holyCloak": { "category": "player", "sounds":["holyCloak"] }, - "laputaStart": { "category": "player", "sounds":["laputaStart"] }, - "lexiconOpen": { "category": "master", "sounds":["lexiconOpen"] }, - "lexiconPage": { "category": "master", "sounds":["lexiconPage"] }, - "lightRelay": { "category": "block", "sounds":["lightRelay"] }, - "manaBlaster": { "category": "player", "sounds":["manaBlaster"] }, - "manaPoolCraft": { "category": "block", "sounds":["manaPoolCraft"] }, - "missile": { "category": "player", "sounds":["missile"] }, - "orechid": { "category": "block", "sounds":["orechid"] }, - "potionCreate": { "category": "block", "sounds":["potionCreate"] }, - "runeAltarCraft": { "category": "block", "sounds":["runeAltarCraft"] }, - "runeAltarStart": { "category": "block", "sounds":["runeAltarStart"] }, - "spreaderFire": { "category": "block", "sounds":["spreaderFire"] }, - "starcaller": { "category": "player", "sounds":["starcaller"] }, - "terraBlade": { "category": "player", "sounds":["terraBlade"] }, - "terraformRod": { "category": "player", "sounds":["terraformRod"] }, - "terraPickMode": { "category": "player", "sounds":["terraPickMode"] }, - "terrasteelCraft": { "category": "block", "sounds":["terrasteelCraft"] }, - "thermalily": { "category": "block", "sounds":["thermalily"] }, - "unholyCloak": { "category": "player", "sounds":["unholyCloak"] }, - "way": { "category": "master", "sounds":["way"] }, + "airRod": { "sounds":["botania:airRod"], "subtitle": "botania.subtitle.airRod" }, + "agricarnation": { "sounds":["botania:agricarnation"], "subtitle": "botania.subtitle.agricarnation" }, + "altarCraft": { "sounds":["botania:altarCraft"], "subtitle": "botania.subtitle.altarCraft" }, + "babylonAttack": { "sounds":["botania:babylonAttack"], "subtitle": "botania.subtitle.babylonAttack" }, + "babylonSpawn": { "sounds":["botania:babylonSpawn"], "subtitle": "botania.subtitle.babylonSpawn" }, + "bellows": { "sounds":["botania:bellows"], "subtitle": "botania.subtitle.bellows" }, + "bifrostRod": { "sounds":["botania:bifrostRod"], "subtitle": "botania.subtitle.bifrostRod" }, + "blackLotus": { "sounds":["botania:blackLotus"], "subtitle": "botania.subtitle.blackLotus" }, + "dash": { "sounds":["botania:dash"], "subtitle": "botania.subtitle.dash" }, + "ding": { "sounds":["botania:ding"], "subtitle": "botania.subtitle.ding" }, + "divaCharm": { "sounds":["botania:divaCharm"], "subtitle": "botania.subtitle.divaCharm" }, + "divinationRod": { "sounds":["botania:divinationRod"], "subtitle": "botania.subtitle.divinationROd" }, + "doit": { "sounds":["botania:doit"], "subtitle": "botania.subtitle.doit" }, + "enchanterFade": { "sounds":["botania:enchanterBlock"], "subtitle": "botania.subtitle.enchanterForm" }, + "enchanterForm": { "sounds":["botania:enchanterBlock"], "subtitle": "botania.subtitle.enchanterFade" }, + "enchanterEnchant": { "sounds":["botania:enchanterEnchant"], "subtitle": "botania.subtitle.enchanterEnchant" }, + "endoflame": { "sounds":["botania:endoflame"], "subtitle": "botania.subtitle.endoflame" }, + "equipBauble": { "sounds":["botania:equipBauble"], "subtitle": "botania.subtitle.equipBauble" }, + "gaiaTrap": { "sounds":["botania:gaiaTrap"], "subtitle": "botania.subtitle.gaiaTrap" }, + "goldenLaurel": { "sounds":["botania:goldenLaurel"], "subtitle": "botania.subtitle.goldenLaurel" }, + "holyCloak": { "sounds":["botania:holyCloak"], "subtitle": "botania.subtitle.holyCloak" }, + "laputaStart": { "sounds":["botania:laputaStart"], "subtitle": "botania.subtitle.laputaStart" }, + "lexiconOpen": { "sounds":["botania:lexiconOpen"], "subtitle": "botania.subtitle.lexiconOpen" }, + "lexiconPage": { "sounds":["botania:lexiconPage"], "subtitle": "botania.subtitle.lexiconPage" }, + "lightRelay": { "sounds":["botania:lightRelay"], "subtitle": "botania.subtitle.lightRelay" }, + "manaBlaster": { "sounds":["botania:manaBlaster"], "subtitle": "botania.subtitle.manaBlaster" }, + "manaPoolCraft": { "sounds":["botania:manaPoolCraft"], "subtitle": "botania.subtitle.manaPoolCraft" }, + "missile": { "sounds":["botania:missile"], "subtitle": "botania.subtitle.missile" }, + "orechid": { "sounds":["botania:orechid"], "subtitle": "botania.subtitle.orechid" }, + "potionCreate": { "sounds":["botania:potionCreate"], "subtitle": "botania.subtitle.potionCreate" }, + "runeAltarCraft": { "sounds":["botania:runeAltarCraft"], "subtitle": "botania.subtitle.runeAltarCraft" }, + "runeAltarStart": { "sounds":["botania:runeAltarStart"], "subtitle": "botania.subtitle.runeAltarStart" }, + "spreaderFire": { "sounds":["botania:spreaderFire"], "subtitle": "botania.subtitle.spreaderFire" }, + "starcaller": { "sounds":["botania:starcaller"], "subtitle": "botania.subtitle.starcaller" }, + "terraBlade": { "sounds":["botania:terraBlade"], "subtitle": "botania.subtitle.terraBlade" }, + "terraformRod": { "sounds":["botania:terraformRod"], "subtitle": "botania.subtitle.terraformRod" }, + "terraPickMode": { "sounds":["botania:terraPickMode"], "subtitle": "botania.subtitle.terraPickMode" }, + "terrasteelCraft": { "sounds":["botania:terrasteelCraft"], "subtitle": "botania.subtitle.terrasteelCraft" }, + "thermalily": { "sounds":["botania:thermalily"], "subtitle": "botania.subtitle.thermalily" }, + "unholyCloak": { "sounds":["botania:unholyCloak"], "subtitle": "botania.subtitle.unholyCloak" }, + "way": { "sounds":["botania:way"], "subtitle": "botania.subtitle.way" }, - "music.gaia1": { "category": "record", "sounds":[{"name": "music/EndureEmptiness", "stream": true}] }, - "music.gaia2": { "category": "record", "sounds":[{"name": "music/FightForQuiescence", "stream": true}] } + "music.gaia1": { "sounds":[{"name": "botania:music/EndureEmptiness", "stream": true}] }, + "music.gaia2": { "sounds":[{"name": "botania:music/FightForQuiescence", "stream": true}] } } \ No newline at end of file diff --git a/src/main/resources/assets/botania/textures/blocks/bergamute.png b/src/main/resources/assets/botania/textures/blocks/bergamute.png new file mode 100644 index 000000000..04dae2733 Binary files /dev/null and b/src/main/resources/assets/botania/textures/blocks/bergamute.png differ diff --git a/src/main/resources/assets/botania/textures/blocks/endStoneBrick0.png b/src/main/resources/assets/botania/textures/blocks/endStoneBrick0.png deleted file mode 100644 index 667186a33..000000000 Binary files a/src/main/resources/assets/botania/textures/blocks/endStoneBrick0.png and /dev/null differ diff --git a/src/main/resources/assets/botania/textures/blocks/endStoneBrick2.png b/src/main/resources/assets/botania/textures/blocks/endStoneBrick2.png deleted file mode 100644 index 9c657760b..000000000 Binary files a/src/main/resources/assets/botania/textures/blocks/endStoneBrick2.png and /dev/null differ diff --git a/src/main/resources/assets/botania/textures/blocks/endStoneBrick3.png b/src/main/resources/assets/botania/textures/blocks/endStoneBrick3.png deleted file mode 100644 index 5dc57e7cf..000000000 Binary files a/src/main/resources/assets/botania/textures/blocks/endStoneBrick3.png and /dev/null differ diff --git a/src/main/resources/assets/botania/textures/blocks/endStoneBrick4.png b/src/main/resources/assets/botania/textures/blocks/endStoneBrick4.png deleted file mode 100644 index 3269d4508..000000000 Binary files a/src/main/resources/assets/botania/textures/blocks/endStoneBrick4.png and /dev/null differ diff --git a/src/main/resources/assets/botania/textures/blocks/prismarine0.png b/src/main/resources/assets/botania/textures/blocks/prismarine0.png deleted file mode 100644 index fe133e294..000000000 Binary files a/src/main/resources/assets/botania/textures/blocks/prismarine0.png and /dev/null differ diff --git a/src/main/resources/assets/botania/textures/blocks/prismarine0.png.mcmeta b/src/main/resources/assets/botania/textures/blocks/prismarine0.png.mcmeta deleted file mode 100644 index e0b5ef9e3..000000000 --- a/src/main/resources/assets/botania/textures/blocks/prismarine0.png.mcmeta +++ /dev/null @@ -1,30 +0,0 @@ -{ - "animation": { - "frametime": 300, - "interpolate": true, - "frames": [ - 0, - 1, - 0, - 2, - 0, - 3, - 0, - 1, - 2, - 1, - 3, - 1, - 0, - 2, - 1, - 2, - 3, - 2, - 0, - 3, - 1, - 3 - ] - } -} \ No newline at end of file diff --git a/src/main/resources/assets/botania/textures/blocks/prismarine1.png b/src/main/resources/assets/botania/textures/blocks/prismarine1.png deleted file mode 100644 index 58906903c..000000000 Binary files a/src/main/resources/assets/botania/textures/blocks/prismarine1.png and /dev/null differ diff --git a/src/main/resources/assets/botania/textures/blocks/prismarine2.png b/src/main/resources/assets/botania/textures/blocks/prismarine2.png deleted file mode 100644 index 07bed857b..000000000 Binary files a/src/main/resources/assets/botania/textures/blocks/prismarine2.png and /dev/null differ diff --git a/src/main/resources/assets/botania/textures/blocks/reedBlock0.png b/src/main/resources/assets/botania/textures/blocks/reedBlock0.png deleted file mode 100644 index 38b94b50d..000000000 Binary files a/src/main/resources/assets/botania/textures/blocks/reedBlock0.png and /dev/null differ diff --git a/src/main/resources/assets/botania/textures/blocks/reedBlock1.png b/src/main/resources/assets/botania/textures/blocks/reedBlock1.png deleted file mode 100644 index b8282f4e0..000000000 Binary files a/src/main/resources/assets/botania/textures/blocks/reedBlock1.png and /dev/null differ diff --git a/src/main/resources/assets/botania/textures/blocks/seaLamp.png b/src/main/resources/assets/botania/textures/blocks/seaLamp.png deleted file mode 100644 index 4f08fd2dc..000000000 Binary files a/src/main/resources/assets/botania/textures/blocks/seaLamp.png and /dev/null differ diff --git a/src/main/resources/assets/botania/textures/blocks/seaLamp.png.mcmeta b/src/main/resources/assets/botania/textures/blocks/seaLamp.png.mcmeta deleted file mode 100644 index 280d92417..000000000 --- a/src/main/resources/assets/botania/textures/blocks/seaLamp.png.mcmeta +++ /dev/null @@ -1,22 +0,0 @@ -{ - "animation": { - "frames": [ - { - "index": 0, - "time": 5 - }, { - "index": 1, - "time": 5 - }, { - "index": 2, - "time": 5 - }, { - "index": 3, - "time": 5 - }, { - "index": 4, - "time": 5 - } - ] - } -} \ No newline at end of file diff --git a/src/main/resources/assets/botania/textures/blocks/stone0.png b/src/main/resources/assets/botania/textures/blocks/stone0.png deleted file mode 100644 index 680a899f2..000000000 Binary files a/src/main/resources/assets/botania/textures/blocks/stone0.png and /dev/null differ diff --git a/src/main/resources/assets/botania/textures/blocks/stone1.png b/src/main/resources/assets/botania/textures/blocks/stone1.png deleted file mode 100644 index 8a8f460bf..000000000 Binary files a/src/main/resources/assets/botania/textures/blocks/stone1.png and /dev/null differ diff --git a/src/main/resources/assets/botania/textures/blocks/stone11.png b/src/main/resources/assets/botania/textures/blocks/stone11.png deleted file mode 100644 index 531ea8344..000000000 Binary files a/src/main/resources/assets/botania/textures/blocks/stone11.png and /dev/null differ diff --git a/src/main/resources/assets/botania/textures/blocks/stone2.png b/src/main/resources/assets/botania/textures/blocks/stone2.png deleted file mode 100644 index 711c838b3..000000000 Binary files a/src/main/resources/assets/botania/textures/blocks/stone2.png and /dev/null differ diff --git a/src/main/resources/assets/botania/textures/blocks/stone3.png b/src/main/resources/assets/botania/textures/blocks/stone3.png deleted file mode 100644 index 07c7af851..000000000 Binary files a/src/main/resources/assets/botania/textures/blocks/stone3.png and /dev/null differ diff --git a/src/main/resources/assets/botania/textures/blocks/stone4.png b/src/main/resources/assets/botania/textures/blocks/stone4.png deleted file mode 100644 index a77809c04..000000000 Binary files a/src/main/resources/assets/botania/textures/blocks/stone4.png and /dev/null differ diff --git a/src/main/resources/assets/botania/textures/blocks/stone5.png b/src/main/resources/assets/botania/textures/blocks/stone5.png deleted file mode 100644 index aa519396c..000000000 Binary files a/src/main/resources/assets/botania/textures/blocks/stone5.png and /dev/null differ diff --git a/src/main/resources/assets/botania/textures/blocks/stone6.png b/src/main/resources/assets/botania/textures/blocks/stone6.png deleted file mode 100644 index 72c413216..000000000 Binary files a/src/main/resources/assets/botania/textures/blocks/stone6.png and /dev/null differ diff --git a/src/main/resources/assets/botania/textures/blocks/stone7.png b/src/main/resources/assets/botania/textures/blocks/stone7.png deleted file mode 100644 index d5b37f1b4..000000000 Binary files a/src/main/resources/assets/botania/textures/blocks/stone7.png and /dev/null differ diff --git a/src/main/resources/assets/botania/textures/blocks/stone8.png b/src/main/resources/assets/botania/textures/blocks/stone8.png deleted file mode 100644 index ddcfaa394..000000000 Binary files a/src/main/resources/assets/botania/textures/blocks/stone8.png and /dev/null differ diff --git a/src/main/resources/assets/botania/textures/blocks/thatch.png b/src/main/resources/assets/botania/textures/blocks/thatch.png deleted file mode 100644 index f66bf032e..000000000 Binary files a/src/main/resources/assets/botania/textures/blocks/thatch.png and /dev/null differ diff --git a/src/main/resources/assets/botania/textures/blocks/endStoneBrick1.png b/src/main/resources/assets/botania/textures/blocks/unused/endStoneBrick1.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/endStoneBrick1.png rename to src/main/resources/assets/botania/textures/blocks/unused/endStoneBrick1.png diff --git a/src/main/resources/assets/botania/textures/blocks/stone12.png b/src/main/resources/assets/botania/textures/blocks/unused/stone12.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/stone12.png rename to src/main/resources/assets/botania/textures/blocks/unused/stone12.png diff --git a/src/main/resources/assets/botania/textures/blocks/stone13.png b/src/main/resources/assets/botania/textures/blocks/unused/stone13.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/stone13.png rename to src/main/resources/assets/botania/textures/blocks/unused/stone13.png diff --git a/src/main/resources/assets/botania/textures/blocks/stone14.png b/src/main/resources/assets/botania/textures/blocks/unused/stone14.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/stone14.png rename to src/main/resources/assets/botania/textures/blocks/unused/stone14.png diff --git a/src/main/resources/assets/botania/textures/blocks/stone15.png b/src/main/resources/assets/botania/textures/blocks/unused/stone15.png similarity index 100% rename from src/main/resources/assets/botania/textures/blocks/stone15.png rename to src/main/resources/assets/botania/textures/blocks/unused/stone15.png diff --git a/src/main/resources/assets/botania/textures/gui/elvenTradeOverlay.png b/src/main/resources/assets/botania/textures/gui/elvenTradeOverlay.png index c7479f17a..8c89f61d8 100644 Binary files a/src/main/resources/assets/botania/textures/gui/elvenTradeOverlay.png and b/src/main/resources/assets/botania/textures/gui/elvenTradeOverlay.png differ diff --git a/src/main/resources/assets/botania/textures/gui/entries/craftCrate.png b/src/main/resources/assets/botania/textures/gui/entries/craftCrate.png index ecec6e8cf..5ee414d48 100644 Binary files a/src/main/resources/assets/botania/textures/gui/entries/craftCrate.png and b/src/main/resources/assets/botania/textures/gui/entries/craftCrate.png differ diff --git a/src/main/resources/assets/botania/textures/model/pump.png b/src/main/resources/assets/botania/textures/items/manaBlaster.png similarity index 62% rename from src/main/resources/assets/botania/textures/model/pump.png rename to src/main/resources/assets/botania/textures/items/manaBlaster.png index ee73d7d4a..828aace99 100644 Binary files a/src/main/resources/assets/botania/textures/model/pump.png and b/src/main/resources/assets/botania/textures/items/manaBlaster.png differ diff --git a/src/main/resources/assets/botania/textures/blocks/stone10.png b/src/main/resources/assets/botania/textures/items/manaBlasterColor.png similarity index 77% rename from src/main/resources/assets/botania/textures/blocks/stone10.png rename to src/main/resources/assets/botania/textures/items/manaBlasterColor.png index d0110b4b8..fb072d114 100644 Binary files a/src/main/resources/assets/botania/textures/blocks/stone10.png and b/src/main/resources/assets/botania/textures/items/manaBlasterColor.png differ diff --git a/src/main/resources/assets/botania/textures/blocks/stone9.png b/src/main/resources/assets/botania/textures/items/manaBlasterGlass.png similarity index 67% rename from src/main/resources/assets/botania/textures/blocks/stone9.png rename to src/main/resources/assets/botania/textures/items/manaBlasterGlass.png index 468697763..247d3c943 100644 Binary files a/src/main/resources/assets/botania/textures/blocks/stone9.png and b/src/main/resources/assets/botania/textures/items/manaBlasterGlass.png differ diff --git a/src/main/resources/assets/botania/textures/model/cocoon.png b/src/main/resources/assets/botania/textures/items/manaBlasterLensClip.png similarity index 64% rename from src/main/resources/assets/botania/textures/model/cocoon.png rename to src/main/resources/assets/botania/textures/items/manaBlasterLensClip.png index e0ab41ac4..427aa933a 100644 Binary files a/src/main/resources/assets/botania/textures/model/cocoon.png and b/src/main/resources/assets/botania/textures/items/manaBlasterLensClip.png differ diff --git a/src/main/resources/assets/botania/textures/items/prismarineShard.png b/src/main/resources/assets/botania/textures/items/prismarineShard.png deleted file mode 100644 index 4030b4c1b..000000000 Binary files a/src/main/resources/assets/botania/textures/items/prismarineShard.png and /dev/null differ diff --git a/src/main/resources/assets/botania/textures/items/waterBowl_base.png b/src/main/resources/assets/botania/textures/items/waterBowl_base.png new file mode 100644 index 000000000..63d16ad6b Binary files /dev/null and b/src/main/resources/assets/botania/textures/items/waterBowl_base.png differ diff --git a/src/main/resources/assets/botania/textures/items/waterBowl_cover.png b/src/main/resources/assets/botania/textures/items/waterBowl_cover.png new file mode 100644 index 000000000..2bdfc5719 Binary files /dev/null and b/src/main/resources/assets/botania/textures/items/waterBowl_cover.png differ diff --git a/src/main/resources/assets/botania/textures/items/waterBowl_fluid.png b/src/main/resources/assets/botania/textures/items/waterBowl_fluid.png new file mode 100644 index 000000000..524fb39be Binary files /dev/null and b/src/main/resources/assets/botania/textures/items/waterBowl_fluid.png differ diff --git a/src/main/resources/assets/botania/textures/logo.png b/src/main/resources/assets/botania/textures/logo.png index 1fb6ec161..0a426d2de 100644 Binary files a/src/main/resources/assets/botania/textures/logo.png and b/src/main/resources/assets/botania/textures/logo.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar.png b/src/main/resources/assets/botania/textures/model/altar.png deleted file mode 100644 index 45d22bdd6..000000000 Binary files a/src/main/resources/assets/botania/textures/model/altar.png and /dev/null differ diff --git a/src/main/resources/assets/botania/textures/model/altar/default/gobletBase2_bottom.png b/src/main/resources/assets/botania/textures/model/altar/default/gobletBase2_bottom.png new file mode 100644 index 000000000..a3a1d26ad Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/default/gobletBase2_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/default/gobletBase2_sides.png b/src/main/resources/assets/botania/textures/model/altar/default/gobletBase2_sides.png new file mode 100644 index 000000000..e161b8a45 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/default/gobletBase2_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/default/gobletBase2_top.png b/src/main/resources/assets/botania/textures/model/altar/default/gobletBase2_top.png new file mode 100644 index 000000000..a3a1d26ad Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/default/gobletBase2_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/default/gobletBase3_bottom.png b/src/main/resources/assets/botania/textures/model/altar/default/gobletBase3_bottom.png new file mode 100644 index 000000000..781548367 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/default/gobletBase3_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/default/gobletBase3_sides.png b/src/main/resources/assets/botania/textures/model/altar/default/gobletBase3_sides.png new file mode 100644 index 000000000..f12545dff Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/default/gobletBase3_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/default/gobletBase3_top.png b/src/main/resources/assets/botania/textures/model/altar/default/gobletBase3_top.png new file mode 100644 index 000000000..781548367 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/default/gobletBase3_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/default/gobletBase_bottom.png b/src/main/resources/assets/botania/textures/model/altar/default/gobletBase_bottom.png new file mode 100644 index 000000000..f5269c16b Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/default/gobletBase_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/default/gobletBase_sides.png b/src/main/resources/assets/botania/textures/model/altar/default/gobletBase_sides.png new file mode 100644 index 000000000..ac1dd433c Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/default/gobletBase_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/default/gobletBase_top.png b/src/main/resources/assets/botania/textures/model/altar/default/gobletBase_top.png new file mode 100644 index 000000000..f5269c16b Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/default/gobletBase_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/default/gobletStand_sides.png b/src/main/resources/assets/botania/textures/model/altar/default/gobletStand_sides.png new file mode 100644 index 000000000..4bd0ec9be Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/default/gobletStand_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/default/gobletStand_top_bottom.png b/src/main/resources/assets/botania/textures/model/altar/default/gobletStand_top_bottom.png new file mode 100644 index 000000000..21357a3eb Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/default/gobletStand_top_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/default/kelkBase2_bottom.png b/src/main/resources/assets/botania/textures/model/altar/default/kelkBase2_bottom.png new file mode 100644 index 000000000..082cf4c31 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/default/kelkBase2_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/default/kelkBase2_sides.png b/src/main/resources/assets/botania/textures/model/altar/default/kelkBase2_sides.png new file mode 100644 index 000000000..0b1c547a0 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/default/kelkBase2_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/default/kelkBase2_top.png b/src/main/resources/assets/botania/textures/model/altar/default/kelkBase2_top.png new file mode 100644 index 000000000..c1931da93 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/default/kelkBase2_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/default/kelkBase_sides.png b/src/main/resources/assets/botania/textures/model/altar/default/kelkBase_sides.png new file mode 100644 index 000000000..82a9d99a6 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/default/kelkBase_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/default/kelkBase_top_bottom.png b/src/main/resources/assets/botania/textures/model/altar/default/kelkBase_top_bottom.png new file mode 100644 index 000000000..163b2b90a Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/default/kelkBase_top_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/default/kelkWall.png b/src/main/resources/assets/botania/textures/model/altar/default/kelkWall.png new file mode 100644 index 000000000..b87afe102 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/default/kelkWall.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/default/original.png b/src/main/resources/assets/botania/textures/model/altar/default/original.png new file mode 100644 index 000000000..8b5a0a406 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/default/original.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/desert/gobletBase2_bottom.png b/src/main/resources/assets/botania/textures/model/altar/desert/gobletBase2_bottom.png new file mode 100644 index 000000000..0bfb30a21 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/desert/gobletBase2_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/desert/gobletBase2_sides.png b/src/main/resources/assets/botania/textures/model/altar/desert/gobletBase2_sides.png new file mode 100644 index 000000000..bd2a1b41f Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/desert/gobletBase2_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/desert/gobletBase2_top.png b/src/main/resources/assets/botania/textures/model/altar/desert/gobletBase2_top.png new file mode 100644 index 000000000..0bfb30a21 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/desert/gobletBase2_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/desert/gobletBase3_bottom.png b/src/main/resources/assets/botania/textures/model/altar/desert/gobletBase3_bottom.png new file mode 100644 index 000000000..77d979186 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/desert/gobletBase3_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/desert/gobletBase3_sides.png b/src/main/resources/assets/botania/textures/model/altar/desert/gobletBase3_sides.png new file mode 100644 index 000000000..6a82cf041 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/desert/gobletBase3_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/desert/gobletBase3_top.png b/src/main/resources/assets/botania/textures/model/altar/desert/gobletBase3_top.png new file mode 100644 index 000000000..77d979186 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/desert/gobletBase3_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/desert/gobletBase_bottom.png b/src/main/resources/assets/botania/textures/model/altar/desert/gobletBase_bottom.png new file mode 100644 index 000000000..80dc4fb6d Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/desert/gobletBase_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/desert/gobletBase_sides.png b/src/main/resources/assets/botania/textures/model/altar/desert/gobletBase_sides.png new file mode 100644 index 000000000..57c2fab9f Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/desert/gobletBase_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/desert/gobletBase_top.png b/src/main/resources/assets/botania/textures/model/altar/desert/gobletBase_top.png new file mode 100644 index 000000000..80dc4fb6d Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/desert/gobletBase_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/desert/gobletStand_sides.png b/src/main/resources/assets/botania/textures/model/altar/desert/gobletStand_sides.png new file mode 100644 index 000000000..349184a72 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/desert/gobletStand_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/desert/gobletStand_top_bottom.png b/src/main/resources/assets/botania/textures/model/altar/desert/gobletStand_top_bottom.png new file mode 100644 index 000000000..92eacd2f9 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/desert/gobletStand_top_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/desert/kelkBase2_bottom.png b/src/main/resources/assets/botania/textures/model/altar/desert/kelkBase2_bottom.png new file mode 100644 index 000000000..1d5931947 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/desert/kelkBase2_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/desert/kelkBase2_sides.png b/src/main/resources/assets/botania/textures/model/altar/desert/kelkBase2_sides.png new file mode 100644 index 000000000..aec15404f Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/desert/kelkBase2_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/desert/kelkBase2_top.png b/src/main/resources/assets/botania/textures/model/altar/desert/kelkBase2_top.png new file mode 100644 index 000000000..fdd88a496 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/desert/kelkBase2_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/desert/kelkBase_sides.png b/src/main/resources/assets/botania/textures/model/altar/desert/kelkBase_sides.png new file mode 100644 index 000000000..69dbb1739 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/desert/kelkBase_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/desert/kelkBase_top_bottom.png b/src/main/resources/assets/botania/textures/model/altar/desert/kelkBase_top_bottom.png new file mode 100644 index 000000000..6ff2f2b7c Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/desert/kelkBase_top_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/desert/kelkWall.png b/src/main/resources/assets/botania/textures/model/altar/desert/kelkWall.png new file mode 100644 index 000000000..045cde560 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/desert/kelkWall.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/desert/original.png b/src/main/resources/assets/botania/textures/model/altar/desert/original.png new file mode 100644 index 000000000..90b7d6834 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/desert/original.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/forest/gobletBase2_bottom.png b/src/main/resources/assets/botania/textures/model/altar/forest/gobletBase2_bottom.png new file mode 100644 index 000000000..ef040a6e5 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/forest/gobletBase2_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/forest/gobletBase2_sides.png b/src/main/resources/assets/botania/textures/model/altar/forest/gobletBase2_sides.png new file mode 100644 index 000000000..e9f84f761 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/forest/gobletBase2_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/forest/gobletBase2_top.png b/src/main/resources/assets/botania/textures/model/altar/forest/gobletBase2_top.png new file mode 100644 index 000000000..ef040a6e5 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/forest/gobletBase2_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/forest/gobletBase3_bottom.png b/src/main/resources/assets/botania/textures/model/altar/forest/gobletBase3_bottom.png new file mode 100644 index 000000000..63362c09d Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/forest/gobletBase3_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/forest/gobletBase3_sides.png b/src/main/resources/assets/botania/textures/model/altar/forest/gobletBase3_sides.png new file mode 100644 index 000000000..a759253ae Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/forest/gobletBase3_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/forest/gobletBase3_top.png b/src/main/resources/assets/botania/textures/model/altar/forest/gobletBase3_top.png new file mode 100644 index 000000000..63362c09d Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/forest/gobletBase3_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/forest/gobletBase_bottom.png b/src/main/resources/assets/botania/textures/model/altar/forest/gobletBase_bottom.png new file mode 100644 index 000000000..14ee8ecee Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/forest/gobletBase_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/forest/gobletBase_sides.png b/src/main/resources/assets/botania/textures/model/altar/forest/gobletBase_sides.png new file mode 100644 index 000000000..a694d4e6c Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/forest/gobletBase_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/forest/gobletBase_top.png b/src/main/resources/assets/botania/textures/model/altar/forest/gobletBase_top.png new file mode 100644 index 000000000..14ee8ecee Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/forest/gobletBase_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/forest/gobletStand_sides.png b/src/main/resources/assets/botania/textures/model/altar/forest/gobletStand_sides.png new file mode 100644 index 000000000..fea3b0fa1 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/forest/gobletStand_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/forest/gobletStand_top_bottom.png b/src/main/resources/assets/botania/textures/model/altar/forest/gobletStand_top_bottom.png new file mode 100644 index 000000000..e8c563d73 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/forest/gobletStand_top_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/forest/kelkBase2_bottom.png b/src/main/resources/assets/botania/textures/model/altar/forest/kelkBase2_bottom.png new file mode 100644 index 000000000..f518b7cb3 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/forest/kelkBase2_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/forest/kelkBase2_sides.png b/src/main/resources/assets/botania/textures/model/altar/forest/kelkBase2_sides.png new file mode 100644 index 000000000..6a33c2a9b Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/forest/kelkBase2_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/forest/kelkBase2_top.png b/src/main/resources/assets/botania/textures/model/altar/forest/kelkBase2_top.png new file mode 100644 index 000000000..713c72f47 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/forest/kelkBase2_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/forest/kelkBase_sides.png b/src/main/resources/assets/botania/textures/model/altar/forest/kelkBase_sides.png new file mode 100644 index 000000000..3f50ca2e0 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/forest/kelkBase_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/forest/kelkBase_top_bottom.png b/src/main/resources/assets/botania/textures/model/altar/forest/kelkBase_top_bottom.png new file mode 100644 index 000000000..c1515edee Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/forest/kelkBase_top_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/forest/kelkWall.png b/src/main/resources/assets/botania/textures/model/altar/forest/kelkWall.png new file mode 100644 index 000000000..3b5ae72e0 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/forest/kelkWall.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/forest/original.png b/src/main/resources/assets/botania/textures/model/altar/forest/original.png new file mode 100644 index 000000000..03f1bccd4 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/forest/original.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/fungal/gobletBase2_bottom.png b/src/main/resources/assets/botania/textures/model/altar/fungal/gobletBase2_bottom.png new file mode 100644 index 000000000..782cbc3e2 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/fungal/gobletBase2_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/fungal/gobletBase2_sides.png b/src/main/resources/assets/botania/textures/model/altar/fungal/gobletBase2_sides.png new file mode 100644 index 000000000..5b7dbe26b Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/fungal/gobletBase2_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/fungal/gobletBase2_top.png b/src/main/resources/assets/botania/textures/model/altar/fungal/gobletBase2_top.png new file mode 100644 index 000000000..782cbc3e2 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/fungal/gobletBase2_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/fungal/gobletBase3_bottom.png b/src/main/resources/assets/botania/textures/model/altar/fungal/gobletBase3_bottom.png new file mode 100644 index 000000000..38a7c1336 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/fungal/gobletBase3_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/fungal/gobletBase3_sides.png b/src/main/resources/assets/botania/textures/model/altar/fungal/gobletBase3_sides.png new file mode 100644 index 000000000..1f1ab1231 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/fungal/gobletBase3_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/fungal/gobletBase3_top.png b/src/main/resources/assets/botania/textures/model/altar/fungal/gobletBase3_top.png new file mode 100644 index 000000000..38a7c1336 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/fungal/gobletBase3_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/fungal/gobletBase_bottom.png b/src/main/resources/assets/botania/textures/model/altar/fungal/gobletBase_bottom.png new file mode 100644 index 000000000..56df33233 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/fungal/gobletBase_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/fungal/gobletBase_sides.png b/src/main/resources/assets/botania/textures/model/altar/fungal/gobletBase_sides.png new file mode 100644 index 000000000..0f8f20680 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/fungal/gobletBase_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/fungal/gobletBase_top.png b/src/main/resources/assets/botania/textures/model/altar/fungal/gobletBase_top.png new file mode 100644 index 000000000..56df33233 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/fungal/gobletBase_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/fungal/gobletStand_sides.png b/src/main/resources/assets/botania/textures/model/altar/fungal/gobletStand_sides.png new file mode 100644 index 000000000..a22955e82 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/fungal/gobletStand_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/fungal/gobletStand_top_bottom.png b/src/main/resources/assets/botania/textures/model/altar/fungal/gobletStand_top_bottom.png new file mode 100644 index 000000000..5ff259635 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/fungal/gobletStand_top_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/fungal/kelkBase2_bottom.png b/src/main/resources/assets/botania/textures/model/altar/fungal/kelkBase2_bottom.png new file mode 100644 index 000000000..ba056d16b Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/fungal/kelkBase2_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/fungal/kelkBase2_sides.png b/src/main/resources/assets/botania/textures/model/altar/fungal/kelkBase2_sides.png new file mode 100644 index 000000000..5d4e4c119 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/fungal/kelkBase2_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/fungal/kelkBase2_top.png b/src/main/resources/assets/botania/textures/model/altar/fungal/kelkBase2_top.png new file mode 100644 index 000000000..bedad4224 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/fungal/kelkBase2_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/fungal/kelkBase_sides.png b/src/main/resources/assets/botania/textures/model/altar/fungal/kelkBase_sides.png new file mode 100644 index 000000000..f3aa7bd12 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/fungal/kelkBase_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/fungal/kelkBase_top_bottom.png b/src/main/resources/assets/botania/textures/model/altar/fungal/kelkBase_top_bottom.png new file mode 100644 index 000000000..9d6b70707 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/fungal/kelkBase_top_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/fungal/kelkWall.png b/src/main/resources/assets/botania/textures/model/altar/fungal/kelkWall.png new file mode 100644 index 000000000..70068a94b Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/fungal/kelkWall.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/fungal/original.png b/src/main/resources/assets/botania/textures/model/altar/fungal/original.png new file mode 100644 index 000000000..f3abecabe Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/fungal/original.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mesa/gobletBase2_bottom.png b/src/main/resources/assets/botania/textures/model/altar/mesa/gobletBase2_bottom.png new file mode 100644 index 000000000..e2a50fa93 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mesa/gobletBase2_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mesa/gobletBase2_sides.png b/src/main/resources/assets/botania/textures/model/altar/mesa/gobletBase2_sides.png new file mode 100644 index 000000000..1cddba7f4 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mesa/gobletBase2_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mesa/gobletBase2_top.png b/src/main/resources/assets/botania/textures/model/altar/mesa/gobletBase2_top.png new file mode 100644 index 000000000..e2a50fa93 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mesa/gobletBase2_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mesa/gobletBase3_bottom.png b/src/main/resources/assets/botania/textures/model/altar/mesa/gobletBase3_bottom.png new file mode 100644 index 000000000..5d8960887 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mesa/gobletBase3_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mesa/gobletBase3_sides.png b/src/main/resources/assets/botania/textures/model/altar/mesa/gobletBase3_sides.png new file mode 100644 index 000000000..d7b9822bd Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mesa/gobletBase3_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mesa/gobletBase3_top.png b/src/main/resources/assets/botania/textures/model/altar/mesa/gobletBase3_top.png new file mode 100644 index 000000000..5d8960887 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mesa/gobletBase3_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mesa/gobletBase_bottom.png b/src/main/resources/assets/botania/textures/model/altar/mesa/gobletBase_bottom.png new file mode 100644 index 000000000..632a386fd Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mesa/gobletBase_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mesa/gobletBase_sides.png b/src/main/resources/assets/botania/textures/model/altar/mesa/gobletBase_sides.png new file mode 100644 index 000000000..8d00dd9f4 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mesa/gobletBase_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mesa/gobletBase_top.png b/src/main/resources/assets/botania/textures/model/altar/mesa/gobletBase_top.png new file mode 100644 index 000000000..632a386fd Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mesa/gobletBase_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mesa/gobletStand_sides.png b/src/main/resources/assets/botania/textures/model/altar/mesa/gobletStand_sides.png new file mode 100644 index 000000000..dc2f46652 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mesa/gobletStand_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mesa/gobletStand_top_bottom.png b/src/main/resources/assets/botania/textures/model/altar/mesa/gobletStand_top_bottom.png new file mode 100644 index 000000000..64a2337ae Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mesa/gobletStand_top_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mesa/kelkBase2_bottom.png b/src/main/resources/assets/botania/textures/model/altar/mesa/kelkBase2_bottom.png new file mode 100644 index 000000000..c16dd99cd Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mesa/kelkBase2_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mesa/kelkBase2_sides.png b/src/main/resources/assets/botania/textures/model/altar/mesa/kelkBase2_sides.png new file mode 100644 index 000000000..c5ff9eb46 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mesa/kelkBase2_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mesa/kelkBase2_top.png b/src/main/resources/assets/botania/textures/model/altar/mesa/kelkBase2_top.png new file mode 100644 index 000000000..cb81263dd Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mesa/kelkBase2_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mesa/kelkBase_sides.png b/src/main/resources/assets/botania/textures/model/altar/mesa/kelkBase_sides.png new file mode 100644 index 000000000..b76623998 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mesa/kelkBase_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mesa/kelkBase_top_bottom.png b/src/main/resources/assets/botania/textures/model/altar/mesa/kelkBase_top_bottom.png new file mode 100644 index 000000000..8f1a60724 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mesa/kelkBase_top_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mesa/kelkWall.png b/src/main/resources/assets/botania/textures/model/altar/mesa/kelkWall.png new file mode 100644 index 000000000..be853b63b Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mesa/kelkWall.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mesa/original.png b/src/main/resources/assets/botania/textures/model/altar/mesa/original.png new file mode 100644 index 000000000..c00ead7ef Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mesa/original.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mossy/gobletBase2_bottom.png b/src/main/resources/assets/botania/textures/model/altar/mossy/gobletBase2_bottom.png new file mode 100644 index 000000000..a3a1d26ad Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mossy/gobletBase2_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mossy/gobletBase2_sides.png b/src/main/resources/assets/botania/textures/model/altar/mossy/gobletBase2_sides.png new file mode 100644 index 000000000..48b4e40c7 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mossy/gobletBase2_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mossy/gobletBase2_top.png b/src/main/resources/assets/botania/textures/model/altar/mossy/gobletBase2_top.png new file mode 100644 index 000000000..f9c6b8a2c Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mossy/gobletBase2_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mossy/gobletBase3_bottom.png b/src/main/resources/assets/botania/textures/model/altar/mossy/gobletBase3_bottom.png new file mode 100644 index 000000000..781548367 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mossy/gobletBase3_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mossy/gobletBase3_sides.png b/src/main/resources/assets/botania/textures/model/altar/mossy/gobletBase3_sides.png new file mode 100644 index 000000000..933da393b Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mossy/gobletBase3_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mossy/gobletBase3_top.png b/src/main/resources/assets/botania/textures/model/altar/mossy/gobletBase3_top.png new file mode 100644 index 000000000..1c6e8f41b Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mossy/gobletBase3_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mossy/gobletBase_bottom.png b/src/main/resources/assets/botania/textures/model/altar/mossy/gobletBase_bottom.png new file mode 100644 index 000000000..f5269c16b Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mossy/gobletBase_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mossy/gobletBase_sides.png b/src/main/resources/assets/botania/textures/model/altar/mossy/gobletBase_sides.png new file mode 100644 index 000000000..457d7a0b1 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mossy/gobletBase_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mossy/gobletBase_top.png b/src/main/resources/assets/botania/textures/model/altar/mossy/gobletBase_top.png new file mode 100644 index 000000000..e6b90bfcf Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mossy/gobletBase_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mossy/gobletStand_sides.png b/src/main/resources/assets/botania/textures/model/altar/mossy/gobletStand_sides.png new file mode 100644 index 000000000..3af8bd008 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mossy/gobletStand_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mossy/gobletStand_top_bottom.png b/src/main/resources/assets/botania/textures/model/altar/mossy/gobletStand_top_bottom.png new file mode 100644 index 000000000..21357a3eb Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mossy/gobletStand_top_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mossy/kelkBase2_bottom.png b/src/main/resources/assets/botania/textures/model/altar/mossy/kelkBase2_bottom.png new file mode 100644 index 000000000..e639cd0a4 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mossy/kelkBase2_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mossy/kelkBase2_sides.png b/src/main/resources/assets/botania/textures/model/altar/mossy/kelkBase2_sides.png new file mode 100644 index 000000000..876e03e40 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mossy/kelkBase2_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mossy/kelkBase2_top.png b/src/main/resources/assets/botania/textures/model/altar/mossy/kelkBase2_top.png new file mode 100644 index 000000000..c1931da93 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mossy/kelkBase2_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mossy/kelkBase_sides.png b/src/main/resources/assets/botania/textures/model/altar/mossy/kelkBase_sides.png new file mode 100644 index 000000000..82a9d99a6 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mossy/kelkBase_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mossy/kelkBase_top_bottom.png b/src/main/resources/assets/botania/textures/model/altar/mossy/kelkBase_top_bottom.png new file mode 100644 index 000000000..163b2b90a Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mossy/kelkBase_top_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mossy/kelkWall.png b/src/main/resources/assets/botania/textures/model/altar/mossy/kelkWall.png new file mode 100644 index 000000000..37a58cc15 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mossy/kelkWall.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mossy/original.png b/src/main/resources/assets/botania/textures/model/altar/mossy/original.png new file mode 100644 index 000000000..3b77b8d6d Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mossy/original.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mountain/gobletBase2_bottom.png b/src/main/resources/assets/botania/textures/model/altar/mountain/gobletBase2_bottom.png new file mode 100644 index 000000000..d6b1f5dc1 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mountain/gobletBase2_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mountain/gobletBase2_sides.png b/src/main/resources/assets/botania/textures/model/altar/mountain/gobletBase2_sides.png new file mode 100644 index 000000000..08162338d Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mountain/gobletBase2_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mountain/gobletBase2_top.png b/src/main/resources/assets/botania/textures/model/altar/mountain/gobletBase2_top.png new file mode 100644 index 000000000..d6b1f5dc1 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mountain/gobletBase2_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mountain/gobletBase3_bottom.png b/src/main/resources/assets/botania/textures/model/altar/mountain/gobletBase3_bottom.png new file mode 100644 index 000000000..7b9245ee8 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mountain/gobletBase3_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mountain/gobletBase3_sides.png b/src/main/resources/assets/botania/textures/model/altar/mountain/gobletBase3_sides.png new file mode 100644 index 000000000..a360e2bed Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mountain/gobletBase3_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mountain/gobletBase3_top.png b/src/main/resources/assets/botania/textures/model/altar/mountain/gobletBase3_top.png new file mode 100644 index 000000000..7b9245ee8 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mountain/gobletBase3_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mountain/gobletBase_bottom.png b/src/main/resources/assets/botania/textures/model/altar/mountain/gobletBase_bottom.png new file mode 100644 index 000000000..a3b8f27a6 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mountain/gobletBase_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mountain/gobletBase_sides.png b/src/main/resources/assets/botania/textures/model/altar/mountain/gobletBase_sides.png new file mode 100644 index 000000000..803419caa Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mountain/gobletBase_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mountain/gobletBase_top.png b/src/main/resources/assets/botania/textures/model/altar/mountain/gobletBase_top.png new file mode 100644 index 000000000..a3b8f27a6 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mountain/gobletBase_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mountain/gobletStand_sides.png b/src/main/resources/assets/botania/textures/model/altar/mountain/gobletStand_sides.png new file mode 100644 index 000000000..6c5ad7aa7 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mountain/gobletStand_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mountain/gobletStand_top_bottom.png b/src/main/resources/assets/botania/textures/model/altar/mountain/gobletStand_top_bottom.png new file mode 100644 index 000000000..1a139054e Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mountain/gobletStand_top_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mountain/kelkBase2_bottom.png b/src/main/resources/assets/botania/textures/model/altar/mountain/kelkBase2_bottom.png new file mode 100644 index 000000000..c61daae04 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mountain/kelkBase2_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mountain/kelkBase2_sides.png b/src/main/resources/assets/botania/textures/model/altar/mountain/kelkBase2_sides.png new file mode 100644 index 000000000..2e1b92b4c Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mountain/kelkBase2_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mountain/kelkBase2_top.png b/src/main/resources/assets/botania/textures/model/altar/mountain/kelkBase2_top.png new file mode 100644 index 000000000..a975e4968 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mountain/kelkBase2_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mountain/kelkBase_sides.png b/src/main/resources/assets/botania/textures/model/altar/mountain/kelkBase_sides.png new file mode 100644 index 000000000..060fda807 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mountain/kelkBase_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mountain/kelkBase_top_bottom.png b/src/main/resources/assets/botania/textures/model/altar/mountain/kelkBase_top_bottom.png new file mode 100644 index 000000000..46df2612d Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mountain/kelkBase_top_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mountain/kelkWall.png b/src/main/resources/assets/botania/textures/model/altar/mountain/kelkWall.png new file mode 100644 index 000000000..92c118019 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mountain/kelkWall.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/mountain/original.png b/src/main/resources/assets/botania/textures/model/altar/mountain/original.png new file mode 100644 index 000000000..66352777f Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/mountain/original.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/note.txt b/src/main/resources/assets/botania/textures/model/altar/note.txt new file mode 100644 index 000000000..bc8d4722b --- /dev/null +++ b/src/main/resources/assets/botania/textures/model/altar/note.txt @@ -0,0 +1,8 @@ +Texture Artists: + +In all _side textures the sides are laid out in the order west, north, east, south +In all _top_bottom textures the quad on the left is the top, the one on the right is the bottom +In gobletStand_sides, the upper half is the west and north sides, left to right. The east and south sides are the bottom half. +In kelkWall, the two large quads are the large faces, the strips to the left or right are the small faces. + The strips on top of the large quads are the top/bottom textures of the N/S walls of the cup + The vertical strips on the right are the top/bottom textures of W/E walls of the cup diff --git a/src/main/resources/assets/botania/textures/model/altar/plains/gobletBase2_bottom.png b/src/main/resources/assets/botania/textures/model/altar/plains/gobletBase2_bottom.png new file mode 100644 index 000000000..0ddf97b05 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/plains/gobletBase2_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/plains/gobletBase2_sides.png b/src/main/resources/assets/botania/textures/model/altar/plains/gobletBase2_sides.png new file mode 100644 index 000000000..8c7e2c91f Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/plains/gobletBase2_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/plains/gobletBase2_top.png b/src/main/resources/assets/botania/textures/model/altar/plains/gobletBase2_top.png new file mode 100644 index 000000000..0ddf97b05 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/plains/gobletBase2_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/plains/gobletBase3_bottom.png b/src/main/resources/assets/botania/textures/model/altar/plains/gobletBase3_bottom.png new file mode 100644 index 000000000..19d508967 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/plains/gobletBase3_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/plains/gobletBase3_sides.png b/src/main/resources/assets/botania/textures/model/altar/plains/gobletBase3_sides.png new file mode 100644 index 000000000..f9cceb89c Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/plains/gobletBase3_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/plains/gobletBase3_top.png b/src/main/resources/assets/botania/textures/model/altar/plains/gobletBase3_top.png new file mode 100644 index 000000000..19d508967 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/plains/gobletBase3_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/plains/gobletBase_bottom.png b/src/main/resources/assets/botania/textures/model/altar/plains/gobletBase_bottom.png new file mode 100644 index 000000000..7ac6eda60 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/plains/gobletBase_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/plains/gobletBase_sides.png b/src/main/resources/assets/botania/textures/model/altar/plains/gobletBase_sides.png new file mode 100644 index 000000000..af1a49c66 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/plains/gobletBase_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/plains/gobletBase_top.png b/src/main/resources/assets/botania/textures/model/altar/plains/gobletBase_top.png new file mode 100644 index 000000000..7ac6eda60 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/plains/gobletBase_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/plains/gobletStand_sides.png b/src/main/resources/assets/botania/textures/model/altar/plains/gobletStand_sides.png new file mode 100644 index 000000000..baf537d1d Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/plains/gobletStand_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/plains/gobletStand_top_bottom.png b/src/main/resources/assets/botania/textures/model/altar/plains/gobletStand_top_bottom.png new file mode 100644 index 000000000..109da73cd Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/plains/gobletStand_top_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/plains/kelkBase2_bottom.png b/src/main/resources/assets/botania/textures/model/altar/plains/kelkBase2_bottom.png new file mode 100644 index 000000000..ca15df11d Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/plains/kelkBase2_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/plains/kelkBase2_sides.png b/src/main/resources/assets/botania/textures/model/altar/plains/kelkBase2_sides.png new file mode 100644 index 000000000..5d1098856 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/plains/kelkBase2_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/plains/kelkBase2_top.png b/src/main/resources/assets/botania/textures/model/altar/plains/kelkBase2_top.png new file mode 100644 index 000000000..2c08a9f70 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/plains/kelkBase2_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/plains/kelkBase_sides.png b/src/main/resources/assets/botania/textures/model/altar/plains/kelkBase_sides.png new file mode 100644 index 000000000..a9c5384b1 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/plains/kelkBase_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/plains/kelkBase_top_bottom.png b/src/main/resources/assets/botania/textures/model/altar/plains/kelkBase_top_bottom.png new file mode 100644 index 000000000..134ae10ac Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/plains/kelkBase_top_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/plains/kelkWall.png b/src/main/resources/assets/botania/textures/model/altar/plains/kelkWall.png new file mode 100644 index 000000000..b938de383 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/plains/kelkWall.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/plains/original.png b/src/main/resources/assets/botania/textures/model/altar/plains/original.png new file mode 100644 index 000000000..717ef2305 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/plains/original.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/swamp/gobletBase2_bottom.png b/src/main/resources/assets/botania/textures/model/altar/swamp/gobletBase2_bottom.png new file mode 100644 index 000000000..6c346c63d Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/swamp/gobletBase2_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/swamp/gobletBase2_sides.png b/src/main/resources/assets/botania/textures/model/altar/swamp/gobletBase2_sides.png new file mode 100644 index 000000000..ad5dce401 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/swamp/gobletBase2_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/swamp/gobletBase2_top.png b/src/main/resources/assets/botania/textures/model/altar/swamp/gobletBase2_top.png new file mode 100644 index 000000000..6c346c63d Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/swamp/gobletBase2_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/swamp/gobletBase3_bottom.png b/src/main/resources/assets/botania/textures/model/altar/swamp/gobletBase3_bottom.png new file mode 100644 index 000000000..63c74a48e Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/swamp/gobletBase3_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/swamp/gobletBase3_sides.png b/src/main/resources/assets/botania/textures/model/altar/swamp/gobletBase3_sides.png new file mode 100644 index 000000000..1b1a604e3 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/swamp/gobletBase3_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/swamp/gobletBase3_top.png b/src/main/resources/assets/botania/textures/model/altar/swamp/gobletBase3_top.png new file mode 100644 index 000000000..63c74a48e Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/swamp/gobletBase3_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/swamp/gobletBase_bottom.png b/src/main/resources/assets/botania/textures/model/altar/swamp/gobletBase_bottom.png new file mode 100644 index 000000000..bf1499ee1 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/swamp/gobletBase_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/swamp/gobletBase_sides.png b/src/main/resources/assets/botania/textures/model/altar/swamp/gobletBase_sides.png new file mode 100644 index 000000000..367ee59e8 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/swamp/gobletBase_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/swamp/gobletBase_top.png b/src/main/resources/assets/botania/textures/model/altar/swamp/gobletBase_top.png new file mode 100644 index 000000000..bf1499ee1 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/swamp/gobletBase_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/swamp/gobletStand_sides.png b/src/main/resources/assets/botania/textures/model/altar/swamp/gobletStand_sides.png new file mode 100644 index 000000000..26d3997b3 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/swamp/gobletStand_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/swamp/gobletStand_top_bottom.png b/src/main/resources/assets/botania/textures/model/altar/swamp/gobletStand_top_bottom.png new file mode 100644 index 000000000..7d5cf0f1b Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/swamp/gobletStand_top_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/swamp/kelkBase2_bottom.png b/src/main/resources/assets/botania/textures/model/altar/swamp/kelkBase2_bottom.png new file mode 100644 index 000000000..57ccbf1ba Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/swamp/kelkBase2_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/swamp/kelkBase2_sides.png b/src/main/resources/assets/botania/textures/model/altar/swamp/kelkBase2_sides.png new file mode 100644 index 000000000..956e494e2 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/swamp/kelkBase2_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/swamp/kelkBase2_top.png b/src/main/resources/assets/botania/textures/model/altar/swamp/kelkBase2_top.png new file mode 100644 index 000000000..c39731a74 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/swamp/kelkBase2_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/swamp/kelkBase_sides.png b/src/main/resources/assets/botania/textures/model/altar/swamp/kelkBase_sides.png new file mode 100644 index 000000000..db14c3672 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/swamp/kelkBase_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/swamp/kelkBase_top_bottom.png b/src/main/resources/assets/botania/textures/model/altar/swamp/kelkBase_top_bottom.png new file mode 100644 index 000000000..a3de281be Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/swamp/kelkBase_top_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/swamp/kelkWall.png b/src/main/resources/assets/botania/textures/model/altar/swamp/kelkWall.png new file mode 100644 index 000000000..878aa80f9 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/swamp/kelkWall.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/swamp/original.png b/src/main/resources/assets/botania/textures/model/altar/swamp/original.png new file mode 100644 index 000000000..883b2cc57 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/swamp/original.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/taiga/gobletBase2_bottom.png b/src/main/resources/assets/botania/textures/model/altar/taiga/gobletBase2_bottom.png new file mode 100644 index 000000000..9039054eb Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/taiga/gobletBase2_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/taiga/gobletBase2_sides.png b/src/main/resources/assets/botania/textures/model/altar/taiga/gobletBase2_sides.png new file mode 100644 index 000000000..4d2ddcbc9 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/taiga/gobletBase2_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/taiga/gobletBase2_top.png b/src/main/resources/assets/botania/textures/model/altar/taiga/gobletBase2_top.png new file mode 100644 index 000000000..9039054eb Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/taiga/gobletBase2_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/taiga/gobletBase3_bottom.png b/src/main/resources/assets/botania/textures/model/altar/taiga/gobletBase3_bottom.png new file mode 100644 index 000000000..f773377ec Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/taiga/gobletBase3_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/taiga/gobletBase3_sides.png b/src/main/resources/assets/botania/textures/model/altar/taiga/gobletBase3_sides.png new file mode 100644 index 000000000..15bf7e395 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/taiga/gobletBase3_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/taiga/gobletBase3_top.png b/src/main/resources/assets/botania/textures/model/altar/taiga/gobletBase3_top.png new file mode 100644 index 000000000..f773377ec Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/taiga/gobletBase3_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/taiga/gobletBase_bottom.png b/src/main/resources/assets/botania/textures/model/altar/taiga/gobletBase_bottom.png new file mode 100644 index 000000000..b46e1388a Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/taiga/gobletBase_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/taiga/gobletBase_sides.png b/src/main/resources/assets/botania/textures/model/altar/taiga/gobletBase_sides.png new file mode 100644 index 000000000..e6552421c Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/taiga/gobletBase_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/taiga/gobletBase_top.png b/src/main/resources/assets/botania/textures/model/altar/taiga/gobletBase_top.png new file mode 100644 index 000000000..b46e1388a Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/taiga/gobletBase_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/taiga/gobletStand_sides.png b/src/main/resources/assets/botania/textures/model/altar/taiga/gobletStand_sides.png new file mode 100644 index 000000000..d54b52803 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/taiga/gobletStand_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/taiga/gobletStand_top_bottom.png b/src/main/resources/assets/botania/textures/model/altar/taiga/gobletStand_top_bottom.png new file mode 100644 index 000000000..767935f46 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/taiga/gobletStand_top_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/taiga/kelkBase2_bottom.png b/src/main/resources/assets/botania/textures/model/altar/taiga/kelkBase2_bottom.png new file mode 100644 index 000000000..8a71f876b Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/taiga/kelkBase2_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/taiga/kelkBase2_sides.png b/src/main/resources/assets/botania/textures/model/altar/taiga/kelkBase2_sides.png new file mode 100644 index 000000000..44caf5af1 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/taiga/kelkBase2_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/taiga/kelkBase2_top.png b/src/main/resources/assets/botania/textures/model/altar/taiga/kelkBase2_top.png new file mode 100644 index 000000000..fb97e34bf Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/taiga/kelkBase2_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/taiga/kelkBase_sides.png b/src/main/resources/assets/botania/textures/model/altar/taiga/kelkBase_sides.png new file mode 100644 index 000000000..492c908ad Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/taiga/kelkBase_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/taiga/kelkBase_top_bottom.png b/src/main/resources/assets/botania/textures/model/altar/taiga/kelkBase_top_bottom.png new file mode 100644 index 000000000..69588475f Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/taiga/kelkBase_top_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/taiga/kelkWall.png b/src/main/resources/assets/botania/textures/model/altar/taiga/kelkWall.png new file mode 100644 index 000000000..fb6714a58 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/taiga/kelkWall.png differ diff --git a/src/main/resources/assets/botania/textures/model/altar/taiga/original.png b/src/main/resources/assets/botania/textures/model/altar/taiga/original.png new file mode 100644 index 000000000..3d3a9332e Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/altar/taiga/original.png differ diff --git a/src/main/resources/assets/botania/textures/model/altarMeta0.png b/src/main/resources/assets/botania/textures/model/altarMeta0.png deleted file mode 100644 index 1e635f6fc..000000000 Binary files a/src/main/resources/assets/botania/textures/model/altarMeta0.png and /dev/null differ diff --git a/src/main/resources/assets/botania/textures/model/altarMeta1.png b/src/main/resources/assets/botania/textures/model/altarMeta1.png deleted file mode 100644 index bd8f9975d..000000000 Binary files a/src/main/resources/assets/botania/textures/model/altarMeta1.png and /dev/null differ diff --git a/src/main/resources/assets/botania/textures/model/altarMeta2.png b/src/main/resources/assets/botania/textures/model/altarMeta2.png deleted file mode 100644 index 4547abd77..000000000 Binary files a/src/main/resources/assets/botania/textures/model/altarMeta2.png and /dev/null differ diff --git a/src/main/resources/assets/botania/textures/model/altarMeta3.png b/src/main/resources/assets/botania/textures/model/altarMeta3.png deleted file mode 100644 index 4ec0d7760..000000000 Binary files a/src/main/resources/assets/botania/textures/model/altarMeta3.png and /dev/null differ diff --git a/src/main/resources/assets/botania/textures/model/altarMeta4.png b/src/main/resources/assets/botania/textures/model/altarMeta4.png deleted file mode 100644 index c9c53c2ec..000000000 Binary files a/src/main/resources/assets/botania/textures/model/altarMeta4.png and /dev/null differ diff --git a/src/main/resources/assets/botania/textures/model/altarMeta5.png b/src/main/resources/assets/botania/textures/model/altarMeta5.png deleted file mode 100644 index 2a903a8a4..000000000 Binary files a/src/main/resources/assets/botania/textures/model/altarMeta5.png and /dev/null differ diff --git a/src/main/resources/assets/botania/textures/model/altarMeta6.png b/src/main/resources/assets/botania/textures/model/altarMeta6.png deleted file mode 100644 index 1984a217a..000000000 Binary files a/src/main/resources/assets/botania/textures/model/altarMeta6.png and /dev/null differ diff --git a/src/main/resources/assets/botania/textures/model/altarMeta7.png b/src/main/resources/assets/botania/textures/model/altarMeta7.png deleted file mode 100644 index 8bf11260c..000000000 Binary files a/src/main/resources/assets/botania/textures/model/altarMeta7.png and /dev/null differ diff --git a/src/main/resources/assets/botania/textures/model/altarMossy.png b/src/main/resources/assets/botania/textures/model/altarMossy.png deleted file mode 100644 index fa3e649c4..000000000 Binary files a/src/main/resources/assets/botania/textures/model/altarMossy.png and /dev/null differ diff --git a/src/main/resources/assets/botania/textures/model/cocoon_bottom.png b/src/main/resources/assets/botania/textures/model/cocoon_bottom.png new file mode 100644 index 000000000..26c610309 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/cocoon_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/cocoon_east.png b/src/main/resources/assets/botania/textures/model/cocoon_east.png new file mode 100644 index 000000000..cf7d849a7 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/cocoon_east.png differ diff --git a/src/main/resources/assets/botania/textures/model/cocoon_north.png b/src/main/resources/assets/botania/textures/model/cocoon_north.png new file mode 100644 index 000000000..f81aa88bf Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/cocoon_north.png differ diff --git a/src/main/resources/assets/botania/textures/model/cocoon_south.png b/src/main/resources/assets/botania/textures/model/cocoon_south.png new file mode 100644 index 000000000..3ec44e528 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/cocoon_south.png differ diff --git a/src/main/resources/assets/botania/textures/model/cocoon_top.png b/src/main/resources/assets/botania/textures/model/cocoon_top.png new file mode 100644 index 000000000..68d8b97ac Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/cocoon_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/cocoon_west.png b/src/main/resources/assets/botania/textures/model/cocoon_west.png new file mode 100644 index 000000000..06edf85a5 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/cocoon_west.png differ diff --git a/src/main/resources/assets/botania/textures/model/crystalCube_base_bottom.png b/src/main/resources/assets/botania/textures/model/crystalCube_base_bottom.png new file mode 100644 index 000000000..dba1f2d4f Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/crystalCube_base_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/crystalCube_base_sides.png b/src/main/resources/assets/botania/textures/model/crystalCube_base_sides.png new file mode 100644 index 000000000..16e7f03e7 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/crystalCube_base_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/crystalCube_base_top.png b/src/main/resources/assets/botania/textures/model/crystalCube_base_top.png new file mode 100644 index 000000000..a35ddbecf Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/crystalCube_base_top.png differ diff --git a/src/main/resources/assets/botania/textures/model/crystalCube_cube.png b/src/main/resources/assets/botania/textures/model/crystalCube_cube.png new file mode 100644 index 000000000..967fa8b5f Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/crystalCube_cube.png differ diff --git a/src/main/resources/assets/botania/textures/model/crystalCube_stand.png b/src/main/resources/assets/botania/textures/model/crystalCube_stand.png new file mode 100644 index 000000000..7c103b949 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/crystalCube_stand.png differ diff --git a/src/main/resources/assets/botania/textures/model/dilutedPool.png b/src/main/resources/assets/botania/textures/model/dilutedPool.png index 14908d1fa..7eae61d14 100644 Binary files a/src/main/resources/assets/botania/textures/model/dilutedPool.png and b/src/main/resources/assets/botania/textures/model/dilutedPool.png differ diff --git a/src/main/resources/assets/botania/textures/model/dreamwoodChest.png b/src/main/resources/assets/botania/textures/model/dreamwoodChest.png new file mode 100644 index 000000000..e8d2308d5 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/dreamwoodChest.png differ diff --git a/src/main/resources/assets/botania/textures/model/incensePlate.png b/src/main/resources/assets/botania/textures/model/incensePlate.png index 4138b2890..38b78c721 100644 Binary files a/src/main/resources/assets/botania/textures/model/incensePlate.png and b/src/main/resources/assets/botania/textures/model/incensePlate.png differ diff --git a/src/main/resources/assets/botania/textures/model/infinitePool.png b/src/main/resources/assets/botania/textures/model/infinitePool.png index 08bdd9907..7030a3184 100644 Binary files a/src/main/resources/assets/botania/textures/model/infinitePool.png and b/src/main/resources/assets/botania/textures/model/infinitePool.png differ diff --git a/src/main/resources/assets/botania/textures/model/livingwoodChest.png b/src/main/resources/assets/botania/textures/model/livingwoodChest.png new file mode 100644 index 000000000..89752e6fc Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/livingwoodChest.png differ diff --git a/src/main/resources/assets/botania/textures/model/miniIsland.png b/src/main/resources/assets/botania/textures/model/miniIsland.png index efed7f62c..ecd452714 100644 Binary files a/src/main/resources/assets/botania/textures/model/miniIsland.png and b/src/main/resources/assets/botania/textures/model/miniIsland.png differ diff --git a/src/main/resources/assets/botania/textures/model/miniIslandDry.png b/src/main/resources/assets/botania/textures/model/miniIslandDry.png index b75dbde63..87228df74 100644 Binary files a/src/main/resources/assets/botania/textures/model/miniIslandDry.png and b/src/main/resources/assets/botania/textures/model/miniIslandDry.png differ diff --git a/src/main/resources/assets/botania/textures/model/miniIslandGolden.png b/src/main/resources/assets/botania/textures/model/miniIslandGolden.png index 74eb540ae..24481d4d0 100644 Binary files a/src/main/resources/assets/botania/textures/model/miniIslandGolden.png and b/src/main/resources/assets/botania/textures/model/miniIslandGolden.png differ diff --git a/src/main/resources/assets/botania/textures/model/miniIslandInfused.png b/src/main/resources/assets/botania/textures/model/miniIslandInfused.png index 60efcf6be..0ffdedf88 100644 Binary files a/src/main/resources/assets/botania/textures/model/miniIslandInfused.png and b/src/main/resources/assets/botania/textures/model/miniIslandInfused.png differ diff --git a/src/main/resources/assets/botania/textures/model/miniIslandMutated.png b/src/main/resources/assets/botania/textures/model/miniIslandMutated.png index fb243edaa..465bad397 100644 Binary files a/src/main/resources/assets/botania/textures/model/miniIslandMutated.png and b/src/main/resources/assets/botania/textures/model/miniIslandMutated.png differ diff --git a/src/main/resources/assets/botania/textures/model/miniIslandMycelium.png b/src/main/resources/assets/botania/textures/model/miniIslandMycelium.png index dd79e53ed..9f0656bef 100644 Binary files a/src/main/resources/assets/botania/textures/model/miniIslandMycelium.png and b/src/main/resources/assets/botania/textures/model/miniIslandMycelium.png differ diff --git a/src/main/resources/assets/botania/textures/model/miniIslandPodzol.png b/src/main/resources/assets/botania/textures/model/miniIslandPodzol.png index f6da61202..a0d5bc8f0 100644 Binary files a/src/main/resources/assets/botania/textures/model/miniIslandPodzol.png and b/src/main/resources/assets/botania/textures/model/miniIslandPodzol.png differ diff --git a/src/main/resources/assets/botania/textures/model/miniIslandScorched.png b/src/main/resources/assets/botania/textures/model/miniIslandScorched.png index 7d94a7999..0a8752f8e 100644 Binary files a/src/main/resources/assets/botania/textures/model/miniIslandScorched.png and b/src/main/resources/assets/botania/textures/model/miniIslandScorched.png differ diff --git a/src/main/resources/assets/botania/textures/model/miniIslandSnow.png b/src/main/resources/assets/botania/textures/model/miniIslandSnow.png index fdb777599..492b94af6 100644 Binary files a/src/main/resources/assets/botania/textures/model/miniIslandSnow.png and b/src/main/resources/assets/botania/textures/model/miniIslandSnow.png differ diff --git a/src/main/resources/assets/botania/textures/model/miniIslandVivid.png b/src/main/resources/assets/botania/textures/model/miniIslandVivid.png index 569711bc2..90bff2c7d 100644 Binary files a/src/main/resources/assets/botania/textures/model/miniIslandVivid.png and b/src/main/resources/assets/botania/textures/model/miniIslandVivid.png differ diff --git a/src/main/resources/assets/botania/textures/model/pool.png b/src/main/resources/assets/botania/textures/model/pool.png index 96a569fc8..9db5bf16b 100644 Binary files a/src/main/resources/assets/botania/textures/model/pool.png and b/src/main/resources/assets/botania/textures/model/pool.png differ diff --git a/src/main/resources/assets/botania/textures/model/pump_axle_sides.png b/src/main/resources/assets/botania/textures/model/pump_axle_sides.png new file mode 100644 index 000000000..9f7dc4835 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/pump_axle_sides.png differ diff --git a/src/main/resources/assets/botania/textures/model/pump_axle_top_bottom.png b/src/main/resources/assets/botania/textures/model/pump_axle_top_bottom.png new file mode 100644 index 000000000..f0fa8ee5d Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/pump_axle_top_bottom.png differ diff --git a/src/main/resources/assets/botania/textures/model/pump_end.png b/src/main/resources/assets/botania/textures/model/pump_end.png new file mode 100644 index 000000000..772dfb411 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/pump_end.png differ diff --git a/src/main/resources/assets/botania/textures/model/pump_head.png b/src/main/resources/assets/botania/textures/model/pump_head.png new file mode 100644 index 000000000..f25511aea Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/pump_head.png differ diff --git a/src/main/resources/assets/botania/textures/model/pump_sheath.png b/src/main/resources/assets/botania/textures/model/pump_sheath.png new file mode 100644 index 000000000..5edb72600 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/pump_sheath.png differ diff --git a/src/main/resources/assets/botania/textures/model/spawnerClaw.png b/src/main/resources/assets/botania/textures/model/spawnerClaw.png index 44dd720e5..65a89b42a 100644 Binary files a/src/main/resources/assets/botania/textures/model/spawnerClaw.png and b/src/main/resources/assets/botania/textures/model/spawnerClaw.png differ diff --git a/src/main/resources/assets/botania/textures/model/spreader_item/elven_inside.png b/src/main/resources/assets/botania/textures/model/spreader_item/elven_inside.png new file mode 100644 index 000000000..df635c5cc Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/spreader_item/elven_inside.png differ diff --git a/src/main/resources/assets/botania/textures/model/spreader_item/elven_side.png b/src/main/resources/assets/botania/textures/model/spreader_item/elven_side.png new file mode 100644 index 000000000..ea286b623 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/spreader_item/elven_side.png differ diff --git a/src/main/resources/assets/botania/textures/model/spreader_item/gaia_inside.png b/src/main/resources/assets/botania/textures/model/spreader_item/gaia_inside.png new file mode 100644 index 000000000..df635c5cc Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/spreader_item/gaia_inside.png differ diff --git a/src/main/resources/assets/botania/textures/model/spreader_item/gaia_side.png b/src/main/resources/assets/botania/textures/model/spreader_item/gaia_side.png new file mode 100644 index 000000000..ea286b623 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/spreader_item/gaia_side.png differ diff --git a/src/main/resources/assets/botania/textures/model/spreader_item/mana_inside.png b/src/main/resources/assets/botania/textures/model/spreader_item/mana_inside.png new file mode 100644 index 000000000..79dcd775b Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/spreader_item/mana_inside.png differ diff --git a/src/main/resources/assets/botania/textures/model/spreader_item/mana_side.png b/src/main/resources/assets/botania/textures/model/spreader_item/mana_side.png new file mode 100644 index 000000000..a40186110 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/spreader_item/mana_side.png differ diff --git a/src/main/resources/assets/botania/textures/model/spreader_item/redstone_inside.png b/src/main/resources/assets/botania/textures/model/spreader_item/redstone_inside.png new file mode 100644 index 000000000..ea9c2889a Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/spreader_item/redstone_inside.png differ diff --git a/src/main/resources/assets/botania/textures/model/spreader_item/redstone_material.png b/src/main/resources/assets/botania/textures/model/spreader_item/redstone_material.png new file mode 100644 index 000000000..4db4ca424 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/spreader_item/redstone_material.png differ diff --git a/src/main/resources/assets/botania/textures/model/spreader_item/redstone_side.png b/src/main/resources/assets/botania/textures/model/spreader_item/redstone_side.png new file mode 100644 index 000000000..593f1b1c3 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/spreader_item/redstone_side.png differ diff --git a/src/main/resources/assets/botania/textures/model/tinyPotatoCopy.png b/src/main/resources/assets/botania/textures/model/tinyPotatoCopy.png new file mode 100644 index 000000000..d0d0dd3c2 Binary files /dev/null and b/src/main/resources/assets/botania/textures/model/tinyPotatoCopy.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/banner/botania_axe.png b/src/main/resources/assets/minecraft/textures/entity/banner/botania_axe.png index 7e732b971..475dd589f 100644 Binary files a/src/main/resources/assets/minecraft/textures/entity/banner/botania_axe.png and b/src/main/resources/assets/minecraft/textures/entity/banner/botania_axe.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/banner/botania_fish.png b/src/main/resources/assets/minecraft/textures/entity/banner/botania_fish.png index f3ca142d8..daf182419 100644 Binary files a/src/main/resources/assets/minecraft/textures/entity/banner/botania_fish.png and b/src/main/resources/assets/minecraft/textures/entity/banner/botania_fish.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/banner/botania_flower.png b/src/main/resources/assets/minecraft/textures/entity/banner/botania_flower.png index b0f1367df..520220da7 100644 Binary files a/src/main/resources/assets/minecraft/textures/entity/banner/botania_flower.png and b/src/main/resources/assets/minecraft/textures/entity/banner/botania_flower.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/banner/botania_hoe.png b/src/main/resources/assets/minecraft/textures/entity/banner/botania_hoe.png index 201dfa15a..6a06b71e4 100644 Binary files a/src/main/resources/assets/minecraft/textures/entity/banner/botania_hoe.png and b/src/main/resources/assets/minecraft/textures/entity/banner/botania_hoe.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/banner/botania_lexicon.png b/src/main/resources/assets/minecraft/textures/entity/banner/botania_lexicon.png index 50d27b318..ae9c9de5a 100644 Binary files a/src/main/resources/assets/minecraft/textures/entity/banner/botania_lexicon.png and b/src/main/resources/assets/minecraft/textures/entity/banner/botania_lexicon.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/banner/botania_logo.png b/src/main/resources/assets/minecraft/textures/entity/banner/botania_logo.png index 731af471a..a8fe7e900 100644 Binary files a/src/main/resources/assets/minecraft/textures/entity/banner/botania_logo.png and b/src/main/resources/assets/minecraft/textures/entity/banner/botania_logo.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/banner/botania_pickaxe.png b/src/main/resources/assets/minecraft/textures/entity/banner/botania_pickaxe.png index 04e593eb4..77f4412ec 100644 Binary files a/src/main/resources/assets/minecraft/textures/entity/banner/botania_pickaxe.png and b/src/main/resources/assets/minecraft/textures/entity/banner/botania_pickaxe.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/banner/botania_sapling.png b/src/main/resources/assets/minecraft/textures/entity/banner/botania_sapling.png index 7600ce575..74a9acb31 100644 Binary files a/src/main/resources/assets/minecraft/textures/entity/banner/botania_sapling.png and b/src/main/resources/assets/minecraft/textures/entity/banner/botania_sapling.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/banner/botania_shovel.png b/src/main/resources/assets/minecraft/textures/entity/banner/botania_shovel.png index 873dac8c8..591a5c888 100644 Binary files a/src/main/resources/assets/minecraft/textures/entity/banner/botania_shovel.png and b/src/main/resources/assets/minecraft/textures/entity/banner/botania_shovel.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/banner/botania_spark_dispersive.png b/src/main/resources/assets/minecraft/textures/entity/banner/botania_spark_dispersive.png index a14acbb54..4a354ef44 100644 Binary files a/src/main/resources/assets/minecraft/textures/entity/banner/botania_spark_dispersive.png and b/src/main/resources/assets/minecraft/textures/entity/banner/botania_spark_dispersive.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/banner/botania_spark_dominant.png b/src/main/resources/assets/minecraft/textures/entity/banner/botania_spark_dominant.png index 3e6c06383..f15b5abbb 100644 Binary files a/src/main/resources/assets/minecraft/textures/entity/banner/botania_spark_dominant.png and b/src/main/resources/assets/minecraft/textures/entity/banner/botania_spark_dominant.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/banner/botania_spark_isolated.png b/src/main/resources/assets/minecraft/textures/entity/banner/botania_spark_isolated.png index 2dd3d374f..15bd30f0e 100644 Binary files a/src/main/resources/assets/minecraft/textures/entity/banner/botania_spark_isolated.png and b/src/main/resources/assets/minecraft/textures/entity/banner/botania_spark_isolated.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/banner/botania_spark_recessive.png b/src/main/resources/assets/minecraft/textures/entity/banner/botania_spark_recessive.png index 04707fbcb..44a396aec 100644 Binary files a/src/main/resources/assets/minecraft/textures/entity/banner/botania_spark_recessive.png and b/src/main/resources/assets/minecraft/textures/entity/banner/botania_spark_recessive.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/banner/botania_sword.png b/src/main/resources/assets/minecraft/textures/entity/banner/botania_sword.png index af1da9888..e47e0d3b4 100644 Binary files a/src/main/resources/assets/minecraft/textures/entity/banner/botania_sword.png and b/src/main/resources/assets/minecraft/textures/entity/banner/botania_sword.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/banner/botania_tiny_potato.png b/src/main/resources/assets/minecraft/textures/entity/banner/botania_tiny_potato.png index dbc603612..3b430bb68 100644 Binary files a/src/main/resources/assets/minecraft/textures/entity/banner/botania_tiny_potato.png and b/src/main/resources/assets/minecraft/textures/entity/banner/botania_tiny_potato.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/shield/botania_axe.png b/src/main/resources/assets/minecraft/textures/entity/shield/botania_axe.png new file mode 100644 index 000000000..10ce36d8a Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/entity/shield/botania_axe.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/shield/botania_fish.png b/src/main/resources/assets/minecraft/textures/entity/shield/botania_fish.png new file mode 100644 index 000000000..420577488 Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/entity/shield/botania_fish.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/shield/botania_flower.png b/src/main/resources/assets/minecraft/textures/entity/shield/botania_flower.png new file mode 100644 index 000000000..106b5d05d Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/entity/shield/botania_flower.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/shield/botania_hoe.png b/src/main/resources/assets/minecraft/textures/entity/shield/botania_hoe.png new file mode 100644 index 000000000..7c8ecd29b Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/entity/shield/botania_hoe.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/shield/botania_lexicon.png b/src/main/resources/assets/minecraft/textures/entity/shield/botania_lexicon.png new file mode 100644 index 000000000..ec77336f2 Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/entity/shield/botania_lexicon.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/shield/botania_logo.png b/src/main/resources/assets/minecraft/textures/entity/shield/botania_logo.png new file mode 100644 index 000000000..9042661a9 Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/entity/shield/botania_logo.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/shield/botania_pickaxe.png b/src/main/resources/assets/minecraft/textures/entity/shield/botania_pickaxe.png new file mode 100644 index 000000000..3a18fb4f1 Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/entity/shield/botania_pickaxe.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/shield/botania_sapling.png b/src/main/resources/assets/minecraft/textures/entity/shield/botania_sapling.png new file mode 100644 index 000000000..713cc0302 Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/entity/shield/botania_sapling.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/shield/botania_shovel.png b/src/main/resources/assets/minecraft/textures/entity/shield/botania_shovel.png new file mode 100644 index 000000000..d745d54fa Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/entity/shield/botania_shovel.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/shield/botania_spark_dispersive.png b/src/main/resources/assets/minecraft/textures/entity/shield/botania_spark_dispersive.png new file mode 100644 index 000000000..7a0ee77b5 Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/entity/shield/botania_spark_dispersive.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/shield/botania_spark_dominant.png b/src/main/resources/assets/minecraft/textures/entity/shield/botania_spark_dominant.png new file mode 100644 index 000000000..639605b5c Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/entity/shield/botania_spark_dominant.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/shield/botania_spark_isolated.png b/src/main/resources/assets/minecraft/textures/entity/shield/botania_spark_isolated.png new file mode 100644 index 000000000..266e766dd Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/entity/shield/botania_spark_isolated.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/shield/botania_spark_recessive.png b/src/main/resources/assets/minecraft/textures/entity/shield/botania_spark_recessive.png new file mode 100644 index 000000000..99d6024f2 Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/entity/shield/botania_spark_recessive.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/shield/botania_sword.png b/src/main/resources/assets/minecraft/textures/entity/shield/botania_sword.png new file mode 100644 index 000000000..29bed02bc Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/entity/shield/botania_sword.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/shield/botania_tiny_potato.png b/src/main/resources/assets/minecraft/textures/entity/shield/botania_tiny_potato.png new file mode 100644 index 000000000..874fd55d9 Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/entity/shield/botania_tiny_potato.png differ diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 5fbcc2dbb..17476ac27 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -2,14 +2,14 @@ { "modid": "Botania", "name": "Botania", - "description": "Botania is a mod that adds nature magic to Minecraft.", + "description": "Botania is a mod that adds nature magic to Minecraft. This time with a fancy number in front.", "version": "${version}", "mcversion": "${mcversion}", "logoFile": "assets/botania/textures/logo.png", "url": "http://www.botaniamod.net", "updateUrl": "", - "authorList": ["Vazkii"], - "credits": "Azanor, dylan4ever, Flaxbeard, Futureazoo, wiiv, Rorax, Lorc, Adubbz, WTFG33ks, Auric245524, MegaManki, Kain Vinosec, Kihira, mDiyo, Mikeemoo, ChickenBones, PowerCrystals, cpw", + "authorList": ["Vazkii", "williewillus", "wiiv", "dylan4ever"], + "credits": "Azanor, Flaxbeard, Futureazoo, Rorax, Lorc, Adubbz, WTFG33ks, Auric245524, MegaManki, Kain Vinosec, Kihira, mDiyo, Mikeemoo, ChickenBones, PowerCrystals, cpw", "parent": "", "screenshots": [], "dependencies": [] diff --git a/src/main/resources/pack.mcmeta b/src/main/resources/pack.mcmeta index a69b55295..5302a04d4 100644 --- a/src/main/resources/pack.mcmeta +++ b/src/main/resources/pack.mcmeta @@ -1,6 +1,6 @@ { "pack": { - "pack_format": 1, + "pack_format": 2, "description": "Resources used for Botania" } } \ No newline at end of file diff --git a/version/1.10.2.txt b/version/1.10.2.txt new file mode 100644 index 000000000..6eb5df681 --- /dev/null +++ b/version/1.10.2.txt @@ -0,0 +1 @@ +r1.8-320 \ No newline at end of file diff --git a/version/1.10.txt b/version/1.10.txt new file mode 100644 index 000000000..c5e7d9272 --- /dev/null +++ b/version/1.10.txt @@ -0,0 +1 @@ +r1.8-311 \ No newline at end of file diff --git a/version/1.8.9.txt b/version/1.8.9.txt new file mode 100644 index 000000000..3b0c86793 --- /dev/null +++ b/version/1.8.9.txt @@ -0,0 +1 @@ +r1.8-299 \ No newline at end of file diff --git a/version/1.9.4.txt b/version/1.9.4.txt new file mode 100644 index 000000000..6a4e1cdfa --- /dev/null +++ b/version/1.9.4.txt @@ -0,0 +1 @@ +r1.8-313 \ No newline at end of file diff --git a/version/1.9.txt b/version/1.9.txt new file mode 100644 index 000000000..40559f717 --- /dev/null +++ b/version/1.9.txt @@ -0,0 +1 @@ +r1.8-305 \ No newline at end of file diff --git a/web/img/logo.png b/web/img/logo.png index 1fb6ec161..0a426d2de 100644 Binary files a/web/img/logo.png and b/web/img/logo.png differ diff --git a/web/versions.ini b/web/versions.ini index 5929531a4..b3ca6b24d 100644 --- a/web/versions.ini +++ b/web/versions.ini @@ -246,4 +246,30 @@ r1.8-245=1.7.10 r1.8-246=1.7.10 r1.8-247=1.7.10 r1.8-248=1.7.10 -r1.8-249=1.7.10 \ No newline at end of file +r1.8-249=1.7.10 +r1.8-299=1.8.9 +r1.8-299=1.8.9 +r1.8-300=1.9 +r1.8-301=1.9 +r1.8-302=1.9 +r1.8-303=1.9 +r1.8-304=1.9 +r1.8-305=1.9 +r1.8-306=1.9.4 +r1.8-307=1.9.4 +r1.8-308=1.9.4 +r1.8-309=1.9.4 +r1.8-310=1.9.4 +r1.8-311=1.9.4 +r1.8-311=1.10 +r1.8-312=1.9.4 +r1.8-312=1.10.2 +r1.8-313=1.9.4 +r1.8-313=1.10.2 +r1.8-314=1.10.2 +r1.8-315=1.10.2 +r1.8-316=1.10.2 +r1.8-317=1.10.2 +r1.8-318=1.10.2 +r1.8-319=1.10.2 +r1.8-320=1.10.2 \ No newline at end of file