From a34d480f3e08be8dd7d53ea2e8c1329eff1a9570 Mon Sep 17 00:00:00 2001 From: Alex Barter Date: Sun, 4 Oct 2020 21:17:30 +0100 Subject: [PATCH] Clean up --- .../render/world/BedFinderRenderer.java | 2 +- .../doggytalents/common/entity/DogEntity.java | 20 ++----------------- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/src/main/java/doggytalents/client/entity/render/world/BedFinderRenderer.java b/src/main/java/doggytalents/client/entity/render/world/BedFinderRenderer.java index 026e39ae..e2e62230 100644 --- a/src/main/java/doggytalents/client/entity/render/world/BedFinderRenderer.java +++ b/src/main/java/doggytalents/client/entity/render/world/BedFinderRenderer.java @@ -64,7 +64,7 @@ public static void drawSelectionBox(MatrixStack stack, AxisAlignedBB boundingBox BufferBuilder buf = Tessellator.getInstance().getBuffer(); buf.begin(GL11.GL_LINES, DefaultVertexFormats.POSITION_COLOR); - WorldRenderer.drawBoundingBox(stack, buf, boundingBox.offset(-d0, -d1, -d2), 1F, 1F, 0, 1F); // 1.14 drawSelectionBoundingBox + WorldRenderer.drawBoundingBox(stack, buf, boundingBox.offset(-d0, -d1, -d2), 1F, 1F, 0, 1F); Tessellator.getInstance().draw(); RenderSystem.color4f(0.0F, 0.0F, 0.0F, 0.3F); RenderSystem.enableDepthTest(); //Make the line see thought blocks diff --git a/src/main/java/doggytalents/common/entity/DogEntity.java b/src/main/java/doggytalents/common/entity/DogEntity.java index 1584e691..88ec2b51 100644 --- a/src/main/java/doggytalents/common/entity/DogEntity.java +++ b/src/main/java/doggytalents/common/entity/DogEntity.java @@ -1037,11 +1037,8 @@ public LazyOptional getCapability(@Nonnull Capability cap, @Nullable D return super.getCapability(cap, side); } - private boolean changingDimension = false; - @Override public Entity changeDimension(ServerWorld worldIn) { - this.changingDimension = true; Entity transportedEntity = super.changeDimension(worldIn); if (transportedEntity instanceof DogEntity) { DogLocationStorage.get(this.world).getOrCreateData(this).update((DogEntity) transportedEntity); @@ -1051,7 +1048,7 @@ public Entity changeDimension(ServerWorld worldIn) { @Override public void onAddedToWorld() { - super.onAddedToWorld(); // When the entity is added to tracking list# + super.onAddedToWorld(); // When the entity is added to tracking list if (this.world != null && !this.world.isRemote) { //DogLocationData locationData = DogLocationStorage.get(this.world).getOrCreateData(this); //locationData.update(this); @@ -1123,18 +1120,6 @@ public void remove(boolean keepData) { if (!keepData) { this.alterations.forEach((alter) -> alter.invalidateCapabilities(this)); } - - if (this.world != null && !this.world.isRemote) { - - // Dog did not die, just changed dimension - if (this.changingDimension) { -// DogRespawnStorage.get(this.world).putData(this); -// DoggyTalents.LOGGER.debug("Saved dog as they died {}", this); -// -// DogLocationStorage.get(this.world).remove(this); -// DoggyTalents.LOGGER.debug("Removed dog location as they were removed from the world {}", this); - } - } } @Override @@ -1748,8 +1733,7 @@ public void markAccessoriesDirty() { @Override public int getLevel(Talent talentIn) { - Map map = this.getTalentMap(); - return map.getOrDefault(talentIn, 0); + return this.getTalentMap().getOrDefault(talentIn, 0); } @Override