Skip to content
This repository has been archived by the owner on Dec 16, 2023. It is now read-only.

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
percivalalb committed Oct 4, 2020
1 parent 8d6ae92 commit a34d480
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
Expand Up @@ -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
Expand Down
20 changes: 2 additions & 18 deletions src/main/java/doggytalents/common/entity/DogEntity.java
Expand Up @@ -1037,11 +1037,8 @@ public <T> LazyOptional<T> getCapability(@Nonnull Capability<T> 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);
Expand All @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1748,8 +1733,7 @@ public void markAccessoriesDirty() {

@Override
public int getLevel(Talent talentIn) {
Map<Talent, Integer> map = this.getTalentMap();
return map.getOrDefault(talentIn, 0);
return this.getTalentMap().getOrDefault(talentIn, 0);
}

@Override
Expand Down

0 comments on commit a34d480

Please sign in to comment.