diff --git a/src/main/java/de/ellpeck/naturesaura/events/ClientEvents.java b/src/main/java/de/ellpeck/naturesaura/events/ClientEvents.java index e62a6ed3..d5669668 100644 --- a/src/main/java/de/ellpeck/naturesaura/events/ClientEvents.java +++ b/src/main/java/de/ellpeck/naturesaura/events/ClientEvents.java @@ -119,11 +119,6 @@ public class ClientEvents { } } - @SubscribeEvent - public void onRenderLast(RenderWorldLastEvent event) { - ParticleHandler.renderParticles(event.getMatrixStack(), Minecraft.getInstance().getRenderPartialTicks()); - } - @SubscribeEvent public void onClientTick(TickEvent.ClientTickEvent event) { if (event.phase != TickEvent.Phase.END) { @@ -203,6 +198,8 @@ public class ClientEvents { @SubscribeEvent public void onWorldRender(RenderWorldLastEvent event) { Minecraft mc = Minecraft.getInstance(); + ParticleHandler.renderParticles(event.getMatrixStack(), mc.getRenderPartialTicks()); + RenderSystem.pushMatrix(); RenderSystem.multMatrix(event.getMatrixStack().getLast().getPositionMatrix()); diff --git a/src/main/java/de/ellpeck/naturesaura/items/ItemCrimsonMeal.java b/src/main/java/de/ellpeck/naturesaura/items/ItemCrimsonMeal.java index 3a9dc195..ed5908ce 100644 --- a/src/main/java/de/ellpeck/naturesaura/items/ItemCrimsonMeal.java +++ b/src/main/java/de/ellpeck/naturesaura/items/ItemCrimsonMeal.java @@ -7,6 +7,7 @@ import net.minecraft.block.NetherWartBlock; import net.minecraft.item.ItemUseContext; import net.minecraft.util.ActionResultType; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; import net.minecraft.world.gen.feature.IFeatureConfig; import net.minecraft.world.server.ServerWorld; @@ -35,6 +36,18 @@ public class ItemCrimsonMeal extends ItemImpl { context.getItem().shrink(1); } return ActionResultType.SUCCESS; + } else if (world.getBlockState(pos.up()).isAir(world, pos.up()) && world.getBlockState(pos).getBlock() == Blocks.SOUL_SAND) { + if (!world.isRemote) { + for (int i = world.rand.nextInt(5); i >= 0; i--) { + BlockPos offset = pos.add(MathHelper.nextInt(world.rand, -3, 3), 1, MathHelper.nextInt(world.rand, -3, 3)); + if (world.getBlockState(offset.down()).getBlock() == Blocks.SOUL_SAND && world.getBlockState(offset).isAir(world, offset)) { + world.setBlockState(offset, Blocks.NETHER_WART.getDefaultState()); + } + } + world.playEvent(2005, pos, 0); + context.getItem().shrink(1); + } + return ActionResultType.SUCCESS; } return ActionResultType.FAIL; } diff --git a/src/main/resources/data/naturesaura/recipes/crimson_meal.json b/src/main/resources/data/naturesaura/recipes/crimson_meal.json new file mode 100644 index 00000000..8a5510eb --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/crimson_meal.json @@ -0,0 +1,24 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "OOO", + "OEO", + "OOO" + ], + "key": { + "E": { + "type": "forge:nbt", + "item": "naturesaura:aura_bottle", + "nbt": { + "stored_type": "naturesaura:nether" + } + }, + "O": { + "item": "minecraft:bone_meal" + } + }, + "result": { + "item": "naturesaura:crimson_meal", + "count": 8 + } +} \ No newline at end of file