Refactored CableBus to pass the direction directly.
This commit is contained in:
@@ -158,11 +158,12 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
|
|||||||
@Override
|
@Override
|
||||||
public boolean canConnectRedstone(final BlockState state, final IBlockReader w, final BlockPos pos,
|
public boolean canConnectRedstone(final BlockState state, final IBlockReader w, final BlockPos pos,
|
||||||
Direction side) {
|
Direction side) {
|
||||||
|
// TODO: Verify this.
|
||||||
if (side == null) {
|
if (side == null) {
|
||||||
side = Direction.UP;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.cb(w, pos).canConnectRedstone(EnumSet.of(side));
|
return this.cb(w, pos).canConnectRedstone(side.getOpposite());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -623,14 +623,9 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canConnectRedstone(final EnumSet<Direction> enumSet) {
|
public boolean canConnectRedstone(final Direction opposite) {
|
||||||
for (final Direction dir : enumSet) {
|
final IPart part = this.getPart(opposite);
|
||||||
final IPart part = this.getPart(dir);
|
return part != null && part.canConnectRedstone();
|
||||||
if (part != null && part.canConnectRedstone()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
|
|
||||||
package appeng.parts;
|
package appeng.parts;
|
||||||
|
|
||||||
import java.util.EnumSet;
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
@@ -43,7 +42,7 @@ public interface ICableBusContainer {
|
|||||||
|
|
||||||
int isProvidingWeakPower(Direction opposite);
|
int isProvidingWeakPower(Direction opposite);
|
||||||
|
|
||||||
boolean canConnectRedstone(EnumSet<Direction> of);
|
boolean canConnectRedstone(Direction opposite);
|
||||||
|
|
||||||
void onEntityCollision(Entity e);
|
void onEntityCollision(Entity e);
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
|
|
||||||
package appeng.parts;
|
package appeng.parts;
|
||||||
|
|
||||||
import java.util.EnumSet;
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
@@ -48,7 +47,7 @@ public class NullCableBusContainer implements ICableBusContainer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canConnectRedstone(final EnumSet<Direction> of) {
|
public boolean canConnectRedstone(final Direction opposite) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user