From bb2763028c20abe51df0fa7853748eac868e87ba Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 24 Oct 2020 17:14:09 +0200 Subject: [PATCH] finished the weather changer --- .../blockstates/weather_changer.json | 7 ++++ .../models/block/weather_changer.json | 8 +++++ .../models/item/weather_changer.json | 3 ++ .../loot_tables/blocks/weather_changer.json | 19 +++++++++++ .../blocks/BlockWeatherChanger.java | 12 ++++++- .../tiles/TileEntityWeatherChanger.java | 2 +- .../assets/naturesaura/lang/en_us.json | 1 + .../textures/block/weather_changer.png | Bin 0 -> 704 bytes .../textures/block/weather_changer_bottom.png | Bin 0 -> 764 bytes .../textures/block/weather_changer_top.png | Bin 0 -> 662 bytes .../en_us/entries/using/weather_changer.json | 21 ++++++++++++ .../naturesaura/recipes/weather_changer.json | 31 ++++++++++++++++++ 12 files changed, 102 insertions(+), 2 deletions(-) create mode 100644 src/generated/resources/assets/naturesaura/blockstates/weather_changer.json create mode 100644 src/generated/resources/assets/naturesaura/models/block/weather_changer.json create mode 100644 src/generated/resources/assets/naturesaura/models/item/weather_changer.json create mode 100644 src/generated/resources/data/naturesaura/loot_tables/blocks/weather_changer.json create mode 100644 src/main/resources/assets/naturesaura/textures/block/weather_changer.png create mode 100644 src/main/resources/assets/naturesaura/textures/block/weather_changer_bottom.png create mode 100644 src/main/resources/assets/naturesaura/textures/block/weather_changer_top.png create mode 100644 src/main/resources/data/naturesaura/patchouli_books/book/en_us/entries/using/weather_changer.json create mode 100644 src/main/resources/data/naturesaura/recipes/weather_changer.json diff --git a/src/generated/resources/assets/naturesaura/blockstates/weather_changer.json b/src/generated/resources/assets/naturesaura/blockstates/weather_changer.json new file mode 100644 index 00000000..9f090397 --- /dev/null +++ b/src/generated/resources/assets/naturesaura/blockstates/weather_changer.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "naturesaura:block/weather_changer" + } + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/naturesaura/models/block/weather_changer.json b/src/generated/resources/assets/naturesaura/models/block/weather_changer.json new file mode 100644 index 00000000..76583e2f --- /dev/null +++ b/src/generated/resources/assets/naturesaura/models/block/weather_changer.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/cube_bottom_top", + "textures": { + "side": "naturesaura:block/weather_changer", + "bottom": "naturesaura:block/weather_changer_bottom", + "top": "naturesaura:block/weather_changer_top" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/naturesaura/models/item/weather_changer.json b/src/generated/resources/assets/naturesaura/models/item/weather_changer.json new file mode 100644 index 00000000..e48a3c71 --- /dev/null +++ b/src/generated/resources/assets/naturesaura/models/item/weather_changer.json @@ -0,0 +1,3 @@ +{ + "parent": "naturesaura:block/weather_changer" +} \ No newline at end of file diff --git a/src/generated/resources/data/naturesaura/loot_tables/blocks/weather_changer.json b/src/generated/resources/data/naturesaura/loot_tables/blocks/weather_changer.json new file mode 100644 index 00000000..d471f96d --- /dev/null +++ b/src/generated/resources/data/naturesaura/loot_tables/blocks/weather_changer.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "naturesaura:weather_changer" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockWeatherChanger.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockWeatherChanger.java index 8e8feb0d..a5008d4e 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockWeatherChanger.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockWeatherChanger.java @@ -1,13 +1,23 @@ package de.ellpeck.naturesaura.blocks; import de.ellpeck.naturesaura.blocks.tiles.TileEntityWeatherChanger; +import de.ellpeck.naturesaura.data.BlockStateGenerator; +import de.ellpeck.naturesaura.reg.ICustomBlockState; import net.minecraft.block.Blocks; import net.minecraft.tileentity.TileEntity; import java.util.function.Supplier; -public class BlockWeatherChanger extends BlockContainerImpl { +public class BlockWeatherChanger extends BlockContainerImpl implements ICustomBlockState { public BlockWeatherChanger() { super("weather_changer", TileEntityWeatherChanger::new, Properties.from(Blocks.STONE_BRICKS)); } + + @Override + public void generateCustomBlockState(BlockStateGenerator generator) { + generator.simpleBlock(this, generator.models().cubeBottomTop(this.getBaseName(), + generator.modLoc("block/" + this.getBaseName()), + generator.modLoc("block/" + this.getBaseName() + "_bottom"), + generator.modLoc("block/" + this.getBaseName() + "_top"))); + } } diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityWeatherChanger.java b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityWeatherChanger.java index 057e447c..32cb05dd 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityWeatherChanger.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityWeatherChanger.java @@ -59,7 +59,7 @@ public class TileEntityWeatherChanger extends TileEntityImpl implements ITickabl if (this.processTime > 0) { if (this.processTime % 20 == 0) { BlockPos spot = IAuraChunk.getHighestSpot(this.world, this.pos, 35, this.pos); - IAuraChunk.getAuraChunk(this.world, spot).drainAura(spot, 30000); + IAuraChunk.getAuraChunk(this.world, spot).drainAura(spot, 30000 * this.itemAmount); } this.processTime--; diff --git a/src/main/resources/assets/naturesaura/lang/en_us.json b/src/main/resources/assets/naturesaura/lang/en_us.json index 211e8ca3..f5d740d2 100644 --- a/src/main/resources/assets/naturesaura/lang/en_us.json +++ b/src/main/resources/assets/naturesaura/lang/en_us.json @@ -70,6 +70,7 @@ "block.naturesaura.aura_timer": "Redstone Aura Vaporizer", "block.naturesaura.slime_split_generator": "Offshoot Observer", "block.naturesaura.spring": "Everlasting Spring", + "block.naturesaura.weather_changer": "Cloudshifter", "item.naturesaura.eye": "Environmental Eye", "item.naturesaura.eye_improved": "Environmental Ocular", "item.naturesaura.gold_fiber": "Brilliant Fiber", diff --git a/src/main/resources/assets/naturesaura/textures/block/weather_changer.png b/src/main/resources/assets/naturesaura/textures/block/weather_changer.png new file mode 100644 index 0000000000000000000000000000000000000000..65c3e06d990d68267274d1fff66e06e356286584 GIT binary patch literal 704 zcmV;x0zdtUP)k!+JK@dFCIULU6 zJKz6{sfp=`{|F7Reqazonu2eGUeUd5y0RS-fD(p+xC;}?^Bb3cnqu?NHXJ8G7={FaPqW!XN{N`7n2svd zGTGwnUrlF5cHs00090)?e&8X5!1KHo!PbqLj)B|LlN{Q$f2DT%#0u5+u`#p_Yvele z#cwSKhGj6E8ewwg37dyEapA}~nGIVQ-7-qHINLG2?B(g}2W^S-^Ya9rkLS7s)Cnpz z#_wIhbzOiCH_M`T@7&v#SoM7Xj_x^3@%uagp6ik;-@M3~gD3dqx-Ek4u5O|zLYpR@>!PFr(PaGAWoq>r zKYsk=^!0ND^#(yB1R(Cj+XRVNoU&gfH84P<9^wZ+QcBL>xx%Rf$I)7$BSC~f8=8gE mBJr4oTdlMf{PhR@L;MEj>N2bZe?^J zG%hhNHDpIvQUCw~dPzhpRuJE$Lcr6<`?Q{g#OdR zpw8&x6H0$X6&$5_=RZN24VHHy%8=tDG#-nq@^4Dxu~z#bMdj~NI6ainQSu(U{1rJp zXRATpyLtk5mO|rh({DBwH@=LA>4EcX|Wr>7~ z1DP9}iQ^hWau)@S7{Q$vFs6}ggCX%@U=C?#yR(fsmkV*sdn}+O?go}@AVp%eNGPeM zQ5jO7J(EM=R!Ts%^dy*-A}scZi8SD(amU3I1sxL zL_)Gcs4fyJL6j>$U_w)8^k&gC`rhs4flS!l*dp<$Ua}h$2 zOJ&*rxzDdZzsaSt_|V3Y!NrR4Qd&6<_ma`&~0aCXsG=rm9^%(**#?rLyPG2w--bEn)k_ z!#?p&=jNpz1|qShgTl@lt(=?%|J9TAIm(vB==D2|CF*(`0FGk=@c#Q0L&FMHyLu{c zxa%Vsp9Y{_uOoy&*Y!pOP16uU&>rX@zqLv-KF!{?$No2s!(HDgT-aH|FoGzGLT514 zj8JnOR8{5Wr#zWNnph;tXk-zkO+k}XG+o2<>STbY%d?CmZ=3Fms;^WD;ox zW0z56g^BqG*e6vgZiVrMM>uwcNN