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 00000000..48242846 Binary files /dev/null and b/src/main/resources/assets/naturesaura/textures/blocks/time_changer.png differ diff --git a/src/main/resources/assets/naturesaura/textures/blocks/time_changer_bottom.png b/src/main/resources/assets/naturesaura/textures/blocks/time_changer_bottom.png new file mode 100644 index 00000000..7325c66c Binary files /dev/null and b/src/main/resources/assets/naturesaura/textures/blocks/time_changer_bottom.png differ diff --git a/src/main/resources/assets/naturesaura/textures/blocks/time_changer_top.png b/src/main/resources/assets/naturesaura/textures/blocks/time_changer_top.png new file mode 100644 index 00000000..e7627679 Binary files /dev/null and b/src/main/resources/assets/naturesaura/textures/blocks/time_changer_top.png differ diff --git a/src/main/resources/assets/naturesaura/textures/items/clock_hand.png b/src/main/resources/assets/naturesaura/textures/items/clock_hand.png new file mode 100644 index 00000000..f95dbc97 Binary files /dev/null and b/src/main/resources/assets/naturesaura/textures/items/clock_hand.png differ