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 00000000..65c3e06d Binary files /dev/null and b/src/main/resources/assets/naturesaura/textures/block/weather_changer.png differ diff --git a/src/main/resources/assets/naturesaura/textures/block/weather_changer_bottom.png b/src/main/resources/assets/naturesaura/textures/block/weather_changer_bottom.png new file mode 100644 index 00000000..7325c66c Binary files /dev/null and b/src/main/resources/assets/naturesaura/textures/block/weather_changer_bottom.png differ diff --git a/src/main/resources/assets/naturesaura/textures/block/weather_changer_top.png b/src/main/resources/assets/naturesaura/textures/block/weather_changer_top.png new file mode 100644 index 00000000..78237530 Binary files /dev/null and b/src/main/resources/assets/naturesaura/textures/block/weather_changer_top.png differ diff --git a/src/main/resources/data/naturesaura/patchouli_books/book/en_us/entries/using/weather_changer.json b/src/main/resources/data/naturesaura/patchouli_books/book/en_us/entries/using/weather_changer.json new file mode 100644 index 00000000..379fbc83 --- /dev/null +++ b/src/main/resources/data/naturesaura/patchouli_books/book/en_us/entries/using/weather_changer.json @@ -0,0 +1,21 @@ +{ + "name": "Cloudshifter", + "icon": "naturesaura:weather_changer", + "category": "using", + "advancement": "naturesaura:offering", + "pages": [ + { + "type": "text", + "text": "Occasionally, it may be desirable for a magical botanist to change one of the many things that drives our daily actions and dictates when we can go outside: $(thing)the weather$(). With the $(item)Cloudshifter$(), this wish becomes truly possible. Accepting certain items that were thrown on the ground for activation, this device will $(thing)change the weather$() into whichever kind is desired, using $(aura) in the process." + }, + { + "type": "text", + "text": "The following items can be used, and will shift the weather as follows: $(item)Sunflowers$() will make it sunny, $(item)Dark Prismarine$() will make it rain, and lastly, $(item)Fire Charges$() will invoke a thunderstorm. Throwing more items also increases the amount of time that the desired weather will most likely remain for, but also increases the $(aura) usage of the shift.$(br)Additionally, when the weather is already the desired type, the $(item)Cloudshifter$() will not cease to do its work." + }, + { + "type": "crafting", + "text": "Creating the $(item)Cloudshifter$()", + "recipe": "naturesaura:weather_changer" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/weather_changer.json b/src/main/resources/data/naturesaura/recipes/weather_changer.json new file mode 100644 index 00000000..861ebaa6 --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/weather_changer.json @@ -0,0 +1,31 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "BFB", + "PES", + "BTB" + ], + "key": { + "F": { + "item": "minecraft:fire_charge" + }, + "P": { + "item": "minecraft:dark_prismarine" + }, + "S": { + "item": "minecraft:sunflower" + }, + "B": { + "item": "naturesaura:infused_brick" + }, + "E": { + "item": "naturesaura:token_euphoria" + }, + "T": { + "item": "naturesaura:token_terror" + } + }, + "result": { + "item": "naturesaura:weather_changer" + } +} \ No newline at end of file