From ea54997ae5eb52b0ca5dac06c340726f10f30513 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 9 Feb 2019 19:58:07 +0100 Subject: [PATCH] finish the time changer --- .../naturesaura/blocks/BlockTimeChanger.java | 6 +-- .../blocks/tiles/TileEntityTimeChanger.java | 38 +++++++----------- .../naturesaura/recipes/ModRecipes.java | 4 ++ .../naturesaura/blockstates/time_changer.json | 20 +++++++++ .../assets/naturesaura/lang/en_US.lang | 2 + .../naturesaura/models/item/clock_hand.json | 6 +++ .../en_us/entries/using/time_changer.json | 26 ++++++++++++ .../naturesaura/recipes/time_changer.json | 33 +++++++++++++++ .../textures/blocks/time_changer.png | Bin 0 -> 625 bytes .../textures/blocks/time_changer_bottom.png | Bin 0 -> 764 bytes .../textures/blocks/time_changer_top.png | Bin 0 -> 701 bytes .../naturesaura/textures/items/clock_hand.png | Bin 0 -> 283 bytes 12 files changed, 109 insertions(+), 26 deletions(-) create mode 100644 src/main/resources/assets/naturesaura/blockstates/time_changer.json create mode 100644 src/main/resources/assets/naturesaura/models/item/clock_hand.json create mode 100644 src/main/resources/assets/naturesaura/patchouli_books/book/en_us/entries/using/time_changer.json create mode 100644 src/main/resources/assets/naturesaura/recipes/time_changer.json create mode 100644 src/main/resources/assets/naturesaura/textures/blocks/time_changer.png create mode 100644 src/main/resources/assets/naturesaura/textures/blocks/time_changer_bottom.png create mode 100644 src/main/resources/assets/naturesaura/textures/blocks/time_changer_top.png create mode 100644 src/main/resources/assets/naturesaura/textures/items/clock_hand.png diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockTimeChanger.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockTimeChanger.java index 914c754a..68eece4e 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockTimeChanger.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockTimeChanger.java @@ -6,8 +6,8 @@ import net.minecraft.block.material.Material; public class BlockTimeChanger extends BlockContainerImpl { public BlockTimeChanger() { - super(Material.WOOD, "time_changer", TileEntityTimeChanger.class, "time_changer"); - this.setSoundType(SoundType.WOOD); - this.setHardness(2); + super(Material.ROCK, "time_changer", TileEntityTimeChanger.class, "time_changer"); + this.setSoundType(SoundType.STONE); + this.setHardness(2.5F); } } diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityTimeChanger.java b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityTimeChanger.java index f907c9f7..42942d4e 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityTimeChanger.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityTimeChanger.java @@ -87,29 +87,21 @@ public class TileEntityTimeChanger extends TileEntityImpl implements ITickable { this.goalTime = 0; this.sendToClients(); } - } else if (this.goalTime > 0) { - if (this.world.getTotalWorldTime() % 5 == 0) - NaturesAuraAPI.instance().spawnParticleStream( - this.pos.getX() + (float) this.world.rand.nextGaussian() * 5F, - this.pos.getY() + 1 + this.world.rand.nextFloat() * 5F, - this.pos.getZ() + (float) this.world.rand.nextGaussian() * 5F, - this.pos.getX() + this.world.rand.nextFloat(), - this.pos.getY() + this.world.rand.nextFloat(), - this.pos.getZ() + this.world.rand.nextFloat(), - this.world.rand.nextFloat() * 0.07F + 0.07F, IAuraType.forWorld(this.world).getColor(), this.world.rand.nextFloat() + 0.5F); - - if (this.world.rand.nextFloat() >= 0.25F) { - int color = this.goalTime % 24000 > 12000 ? 0xe2e2e2 : 0xffe926; - NaturesAuraAPI.instance().spawnMagicParticle( - this.pos.getX() + this.world.rand.nextFloat(), - this.pos.getY() + 1, - this.pos.getZ() + this.world.rand.nextFloat(), - -0.05F - this.world.rand.nextFloat() * 0.02F, - this.world.rand.nextFloat() * 0.25F, - this.world.rand.nextGaussian() * 0.02F, - color, 1F + this.world.rand.nextFloat() * 2F, - this.world.rand.nextInt(100) + 100, 0, true, true); - } + } else if (this.goalTime > 0 && this.world.rand.nextFloat() >= 0.25F) { + double angle = Math.toRadians(this.world.getTotalWorldTime() * 5F % 360); + double x = this.pos.getX() + 0.5 + Math.sin(angle) * 3F; + double z = this.pos.getZ() + 0.5 + Math.cos(angle) * 3F; + int color = this.goalTime % 24000 > 12000 ? 0xe2e2e2 : 0xffe926; + NaturesAuraAPI.instance().spawnMagicParticle( + x, this.pos.getY() + 0.1F, z, + 0F, 0.12F, 0F, + color, 1F + this.world.rand.nextFloat() * 2F, + this.world.rand.nextInt(100) + 100, 0, false, true); + NaturesAuraAPI.instance().spawnMagicParticle( + x, this.pos.getY() + 0.1F, z, + 0F, 0F, 0F, + IAuraType.forWorld(this.world).getColor(), 1F + this.world.rand.nextFloat(), + 150, 0, false, true); } } diff --git a/src/main/java/de/ellpeck/naturesaura/recipes/ModRecipes.java b/src/main/java/de/ellpeck/naturesaura/recipes/ModRecipes.java index fad9abcd..c254cd82 100644 --- a/src/main/java/de/ellpeck/naturesaura/recipes/ModRecipes.java +++ b/src/main/java/de/ellpeck/naturesaura/recipes/ModRecipes.java @@ -160,6 +160,10 @@ public final class ModRecipes { new AmountIngredient(new ItemStack(ModItems.INFUSED_IRON, 3)), Ingredient.fromItem(ModItems.CALLING_SPIRIT), new ItemStack(ModItems.SKY_INGOT)).register(); + new OfferingRecipe(new ResourceLocation(NaturesAura.MOD_ID, "clock_hand"), + Ingredient.fromItem(Items.NETHER_STAR), + Ingredient.fromItem(ModItems.CALLING_SPIRIT), + new ItemStack(ModItems.CLOCK_HAND)).register(); NaturesAuraAPI.BOTANIST_PICKAXE_CONVERSIONS.put( Blocks.COBBLESTONE.getDefaultState(), diff --git a/src/main/resources/assets/naturesaura/blockstates/time_changer.json b/src/main/resources/assets/naturesaura/blockstates/time_changer.json new file mode 100644 index 00000000..ea887ca4 --- /dev/null +++ b/src/main/resources/assets/naturesaura/blockstates/time_changer.json @@ -0,0 +1,20 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube", + "textures": { + "particle": "naturesaura:blocks/time_changer", + "up": "naturesaura:blocks/time_changer_top", + "down": "naturesaura:blocks/time_changer_bottom", + "north": "#particle", + "east": "#particle", + "south": "#particle", + "west": "#particle" + }, + "transform": "forge:default-block" + }, + "variants": { + "normal": [{}], + "inventory": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/naturesaura/lang/en_US.lang b/src/main/resources/assets/naturesaura/lang/en_US.lang index 6e0ce6d4..f3d631a9 100644 --- a/src/main/resources/assets/naturesaura/lang/en_US.lang +++ b/src/main/resources/assets/naturesaura/lang/en_US.lang @@ -43,6 +43,7 @@ tile.naturesaura.auto_crafter.name=Automatic Constructor tile.naturesaura.gold_brick.name=Golden Stone Bricks tile.naturesaura.rf_converter.name=Energetic Aura Forge tile.naturesaura.moss_generator.name=Swamp Homi +tile.naturesaura.time_changer.name=Shifting Sundial item.naturesaura.eye.name=Environmental Eye item.naturesaura.eye_improved.name=Environmental Ocular @@ -78,6 +79,7 @@ item.naturesaura.effect_powder.naturesaura:cache_recharge.name=Powder of no Stor item.naturesaura.effect_powder.naturesaura:animal.name=Powder of Chastity item.naturesaura.mover_cart.name=Aura Attraction Cart item.naturesaura.range_visualizer.name=Mystical Magnifier +item.naturesaura.clock_hand.name=Hand of Time container.naturesaura.tree_ritual.name=Ritual of the Forest container.naturesaura.altar.name=Natural Altar Infusion diff --git a/src/main/resources/assets/naturesaura/models/item/clock_hand.json b/src/main/resources/assets/naturesaura/models/item/clock_hand.json new file mode 100644 index 00000000..e149aca2 --- /dev/null +++ b/src/main/resources/assets/naturesaura/models/item/clock_hand.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "naturesaura:items/clock_hand" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/naturesaura/patchouli_books/book/en_us/entries/using/time_changer.json b/src/main/resources/assets/naturesaura/patchouli_books/book/en_us/entries/using/time_changer.json new file mode 100644 index 00000000..e8f39151 --- /dev/null +++ b/src/main/resources/assets/naturesaura/patchouli_books/book/en_us/entries/using/time_changer.json @@ -0,0 +1,26 @@ +{ + "name": "Shifting Sundial", + "icon": "naturesaura:time_changer", + "category": "using", + "advancement": "naturesaura:aura_bottle_end", + "pages": [ + { + "type": "text", + "text": "Certain activities, especially building and hunting for monsters, can only easily be done at certain times. Over the years, magical botanists have tried to find a way to manipulate $(thing)time$() itself for personal gain. The $(item)Shifting Sundial$() has the ability to do exactly that. While quite expensive to set up, it has the ability to fast forward to $(thing)any time of day or night$() with ease." + }, + { + "type": "text", + "text": "To set it up, all that is required is for the $(item)Shifting Sundial$() to have an $(item)Item Frame$() on it containg a $(item)Hand of Time$(). The $(thing)rotation$() of the hand in the frame will then determine the time that will be skipped to, with the hand pointing to the top corresponding to midnight. To activate a time skip, a regular $(item)Clock$() has to be dropped very close to the sundial.$(br)This, of course, comes at the cost of a large amount of $(aura) - the more time skipped, the more will be consumed." + }, + { + "type": "crafting", + "text": "Creating the $(item)Shifting Sundial$()", + "recipe": "naturesaura:time_changer" + }, + { + "type": "naturesaura:offering", + "text": "Requesting the $(item)Hand of Time$() with the $(l:practices/offering)Offering to the Gods$()", + "recipe": "naturesaura:clock_hand" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/naturesaura/recipes/time_changer.json b/src/main/resources/assets/naturesaura/recipes/time_changer.json new file mode 100644 index 00000000..b822d6fe --- /dev/null +++ b/src/main/resources/assets/naturesaura/recipes/time_changer.json @@ -0,0 +1,33 @@ +{ + "type": "forge:ore_shaped", + "pattern": [ + " O ", + "BCB", + " N " + ], + "key": { + "C": { + "item": "minecraft:clock" + }, + "B": { + "item": "naturesaura:infused_brick" + }, + "N": { + "type": "minecraft:item_nbt", + "item": "naturesaura:aura_bottle", + "nbt": { + "stored_type": "naturesaura:nether" + } + }, + "O": { + "type": "minecraft:item_nbt", + "item": "naturesaura:aura_bottle", + "nbt": { + "stored_type": "naturesaura:overworld" + } + } + }, + "result": { + "item": "naturesaura:time_changer" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/naturesaura/textures/blocks/time_changer.png b/src/main/resources/assets/naturesaura/textures/blocks/time_changer.png new file mode 100644 index 0000000000000000000000000000000000000000..482428462a767d40b6bc2ff9aee25fb227d80121 GIT binary patch literal 625 zcmV-%0*?KOP)N2bZe?^J zG%hhNHDpIvQUCw}?@2^KR5(wKli6HYodOb0jM zreJEz#906Lgkylhc^_aJG5Vqd*1vFJaKTZ)zTIty% zf6@2)V5TvHS~+~ebH_safB{d*|Kx#Lg9SuBudJ5J z0IR=%GhBkj_BF)11DT2`Jv>DUC0%Lwc`0xG2Z(};j*!=aT6WPokFt5MN2bZe?^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(EMN2bZe?^J zG%hhNHDpIvQUCw~J4r-AR5(vofU=@K&$njRJtf!v~c;YjBKij(v^y4!DOzI(aON-6t&kpGm_ic){s`#27itt&p)qEvxgUW_^~<0 zV{gshxx40?daeV%Geb|GLC|lJDyy6GZIk-BPdk|t*Xr&<%lDn$XpROcjP`yWdOS!z|ls`ecC%?(7K-26LF)} zXRe%SL&T29$!ULc&baxth^vkediNN2R~+lnwFT>*&IU1C5HoF zn{Xm@BU3x`9T8f~6$?}EaYtZyyMRzCE{^uoOwjek&>Ajt1gT_j6PZau#JzuWgj`yJ zpm9{I9+OTxOm-kc!lvI6;>1s;*b z3=Dj`K$uZo-U3d z7XHaU{{Of4n-gdMvA!nKdO~NcT+2qTLmv)EPl&l|e1I*+X7gWrp2epR8iYAY?Avkk z#s8hb(FY}_D@rgK@LZ}%p3W&T-)