From 6266d54abaa467001e92a4d645564c3bc9393cba Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 5 Dec 2018 01:12:53 +0100 Subject: [PATCH] removed a lot of machine caps and fixed a graphical issue --- .../blocks/tiles/TileEntityAuraDetector.java | 2 +- .../tiles/TileEntityFlowerGenerator.java | 2 +- .../tiles/TileEntityPotionGenerator.java | 17 +++++-------- .../naturesaura/events/ClientEvents.java | 4 +--- .../naturesaura/packet/PacketParticles.java | 24 +++++++++---------- .../entries/creating/potion_generator.json | 2 +- 6 files changed, 21 insertions(+), 30 deletions(-) diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityAuraDetector.java b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityAuraDetector.java index 85c10119..c9572ef9 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityAuraDetector.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityAuraDetector.java @@ -11,7 +11,7 @@ public class TileEntityAuraDetector extends TileEntityImpl implements ITickable @Override public void update() { - if (!this.world.isRemote && this.world.getTotalWorldTime() % 80 == 0) { + if (!this.world.isRemote && this.world.getTotalWorldTime() % 20 == 0) { MutableFloat totalAmount = new MutableFloat(IAuraChunk.DEFAULT_AURA); IAuraChunk.getSpotsInArea(this.world, this.pos, 25, (pos, spot) -> { float percentage = 1F - (float) this.pos.getDistance(pos.getX(), pos.getY(), pos.getZ()) / 25F; diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityFlowerGenerator.java b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityFlowerGenerator.java index 2175573d..3c70e037 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityFlowerGenerator.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityFlowerGenerator.java @@ -51,7 +51,7 @@ public class TileEntityFlowerGenerator extends TileEntityImpl implements ITickab int addAmount = 200; int toAdd = Math.max(0, addAmount - curr.getValue()); if (toAdd > 0) { - if (NaturesAuraAPI.TYPE_OVERWORLD.isPresentInWorld(this.world) && IAuraChunk.getAuraInArea(this.world, this.pos, 35) < 20000) { + if (NaturesAuraAPI.TYPE_OVERWORLD.isPresentInWorld(this.world)) { int remain = toAdd; while (remain > 0) { BlockPos spot = IAuraChunk.getLowestSpot(this.world, this.pos, 30, this.pos); diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityPotionGenerator.java b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityPotionGenerator.java index d47bec0b..be9585c2 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityPotionGenerator.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityPotionGenerator.java @@ -40,20 +40,15 @@ public class TileEntityPotionGenerator extends TileEntityImpl implements ITickab continue; } - boolean disperseParticles; - if (IAuraChunk.getAuraInArea(this.world, this.pos, 35) < 20000) { - int toAdd = ((effect.getAmplifier() * 6 + 1) * (effect.getDuration() / 30)); - while (toAdd > 0) { - BlockPos spot = IAuraChunk.getLowestSpot(this.world, this.pos, 30, this.pos); - toAdd -= IAuraChunk.getAuraChunk(this.world, spot).storeAura(spot, toAdd); - } - disperseParticles = true; - } else - disperseParticles = false; + int toAdd = ((effect.getAmplifier() * 6 + 1) * (effect.getDuration() / 30)); + while (toAdd > 0) { + BlockPos spot = IAuraChunk.getLowestSpot(this.world, this.pos, 30, this.pos); + toAdd -= IAuraChunk.getAuraChunk(this.world, spot).storeAura(spot, toAdd); + } PacketHandler.sendToAllAround(this.world, this.pos, 32, new PacketParticles( this.pos.getX(), this.pos.getY(), this.pos.getZ(), 5, - PotionUtils.getPotionColor(type), disperseParticles ? 1 : 0)); + PotionUtils.getPotionColor(type))); addedOne = true; break; diff --git a/src/main/java/de/ellpeck/naturesaura/events/ClientEvents.java b/src/main/java/de/ellpeck/naturesaura/events/ClientEvents.java index d7f09bde..3789e24b 100644 --- a/src/main/java/de/ellpeck/naturesaura/events/ClientEvents.java +++ b/src/main/java/de/ellpeck/naturesaura/events/ClientEvents.java @@ -104,7 +104,6 @@ public class ClientEvents { if (mc.gameSettings.showDebugInfo && mc.player.capabilities.isCreativeMode && ModConfig.client.debugWorld) { GL11.glPushMatrix(); GL11.glDisable(GL11.GL_DEPTH_TEST); - GL11.glDisable(GL11.GL_LIGHTING); float partial = event.getPartialTicks(); GL11.glTranslated( -mc.player.prevPosX - (mc.player.posX - mc.player.prevPosX) * partial, @@ -121,7 +120,7 @@ public class ClientEvents { IAuraChunk.getSpotsInArea(mc.world, mc.player.getPosition(), 64, (pos, spot) -> { spots.put(pos, spot); - GlStateManager.color(spot > 0 ? 0F : 1F, spot > 0 ? 1F : 0F, 0F, 0.5F); + GlStateManager.color(spot > 0 ? 0F : 1F, spot > 0 ? 1F : 0F, 0F, 0.35F); int x = pos.getX(); int y = pos.getY(); int z = pos.getZ(); @@ -169,7 +168,6 @@ public class ClientEvents { GL11.glPopMatrix(); GL11.glEnable(GL11.GL_DEPTH_TEST); - GL11.glEnable(GL11.GL_LIGHTING); GL11.glPopMatrix(); } mc.profiler.endSection(); diff --git a/src/main/java/de/ellpeck/naturesaura/packet/PacketParticles.java b/src/main/java/de/ellpeck/naturesaura/packet/PacketParticles.java index ccfe5e74..5b8dc08f 100644 --- a/src/main/java/de/ellpeck/naturesaura/packet/PacketParticles.java +++ b/src/main/java/de/ellpeck/naturesaura/packet/PacketParticles.java @@ -123,7 +123,6 @@ public class PacketParticles implements IMessage { break; case 5: // Potion generator int color = message.data[0]; - boolean disperse = message.data[1] > 0; for (int i = world.rand.nextInt(5) + 5; i >= 0; i--) { NaturesAuraAPI.instance().spawnMagicParticle( message.posX + world.rand.nextFloat(), @@ -132,18 +131,17 @@ public class PacketParticles implements IMessage { world.rand.nextGaussian() * 0.01F, world.rand.nextFloat() * 0.1F, world.rand.nextGaussian() * 0.01F, color, 2F + world.rand.nextFloat(), 40, 0F, true, true); - if (disperse) - for (int x = -1; x <= 1; x += 2) - for (int z = -1; z <= 1; z += 2) { - NaturesAuraAPI.instance().spawnMagicParticle( - message.posX + x * 3 + 0.5F, - message.posY + 2.5, - message.posZ + z * 3 + 0.5F, - world.rand.nextGaussian() * 0.02F, - world.rand.nextFloat() * 0.04F, - world.rand.nextGaussian() * 0.02F, - 0xd6340c, 1F + world.rand.nextFloat() * 2F, 75, 0F, true, true); - } + for (int x = -1; x <= 1; x += 2) + for (int z = -1; z <= 1; z += 2) { + NaturesAuraAPI.instance().spawnMagicParticle( + message.posX + x * 3 + 0.5F, + message.posY + 2.5, + message.posZ + z * 3 + 0.5F, + world.rand.nextGaussian() * 0.02F, + world.rand.nextFloat() * 0.04F, + world.rand.nextGaussian() * 0.02F, + 0xd6340c, 1F + world.rand.nextFloat() * 2F, 75, 0F, true, true); + } } break; case 6: // Plant boost effect diff --git a/src/main/resources/assets/naturesaura/patchouli_books/book/en_us/entries/creating/potion_generator.json b/src/main/resources/assets/naturesaura/patchouli_books/book/en_us/entries/creating/potion_generator.json index 92b8a7ee..ea44b710 100644 --- a/src/main/resources/assets/naturesaura/patchouli_books/book/en_us/entries/creating/potion_generator.json +++ b/src/main/resources/assets/naturesaura/patchouli_books/book/en_us/entries/creating/potion_generator.json @@ -10,7 +10,7 @@ }, { "type": "text", - "text": "Then, throwing any kind of positive, lasting $(item)Lingering Potion$() down in its vicinity will cause the effect to be consumed and turned into $(aura). Needless to say, the longer and higher the effect, the more $(aura) gets created.$(br)Notice that, however, only one effect can be converted at one time, and throwing multiple potions at the ritual will cause their powers to go to waste. Additionally, once there is enough $(aura) in the area, additional potion effects will similarly go to waste." + "text": "Then, throwing any kind of positive, lasting $(item)Lingering Potion$() down in its vicinity will cause the effect to be consumed and turned into $(aura). Needless to say, the longer and higher the effect, the more $(aura) gets created.$(br)Notice that, however, only one effect can be converted at one time, and throwing multiple potions at the ritual will cause their powers to go to waste." }, { "type": "multiblock",