Skip to content

Commit

Permalink
Fixed cage not dropping entities. Fixes #157 #releaseBuild
Browse files Browse the repository at this point in the history
  • Loading branch information
GoryMoon committed Sep 11, 2018
1 parent 25cf2ba commit 42ab575
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ dependencies {
compile ('RebornCore:RebornCore-1.12.2:+:dev'){
transitive = false
}
deobfCompile 'net.industrial-craft:industrialcraft-2:2.8.85-ex112'
deobfCompile 'net.industrial-craft:industrialcraft-2:2.8.99-ex112'
}

processResources{
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
mcversion=1.12.2
forgeversion=1.12.2-14.23.4.2705
forgeversion=1.12.2-14.23.4.2760
mcp_mappings=snapshot_20171003
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package vswe.stevescarts.modules.realtimers;

import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityCreature;
import net.minecraft.entity.EntityFlying;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.boss.EntityDragon;
Expand Down Expand Up @@ -87,7 +88,7 @@ public void drawMouseOver(final GuiMinecart gui, final int x, final int y) {
}

private boolean isCageEmpty() {
return getCart().getRidingEntity() == null;
return getCart().getCartRider() == null;
}

@Override
Expand Down Expand Up @@ -132,7 +133,7 @@ public void update() {

private void manualDrop() {
if (!isCageEmpty()) {
getCart().startRiding((Entity) null);
getCart().removePassengers();
cooldown = 20;
}
}
Expand All @@ -153,7 +154,6 @@ private void pickUpCreature(final int searchDistance) {
target.startRiding(getCart());
return;
}
continue;
}
}
}
Expand Down Expand Up @@ -222,22 +222,22 @@ public void doDeActivate(final int id) {
}
}

private static class EntityNearestTarget implements Comparator {
private static class EntityNearestTarget implements Comparator<EntityLivingBase> {
private Entity entity;

public EntityNearestTarget(final Entity entity) {
public EntityNearestTarget(Entity entity) {
this.entity = entity;
}

public int compareDistanceSq(final Entity entity1, final Entity entity2) {
public int compareDistanceSq(Entity entity1, Entity entity2) {
final double distance1 = entity.getDistanceSq(entity1);
final double distance2 = entity.getDistanceSq(entity2);
return (distance1 < distance2) ? -1 : ((distance1 > distance2) ? 1 : 0);
return Double.compare(distance1, distance2);
}

@Override
public int compare(final Object obj1, final Object obj2) {
return compareDistanceSq((Entity) obj1, (Entity) obj2);
public int compare(EntityLivingBase livingBase, EntityLivingBase livingBase1) {
return compareDistanceSq(livingBase, livingBase1);
}
}
}

0 comments on commit 42ab575

Please sign in to comment.