Code cleanup
This commit is contained in:
parent
68f050235e
commit
64d66e5e5c
2 changed files with 1 additions and 38 deletions
|
@ -4,7 +4,7 @@ import net.minecraft.block.Block;
|
|||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
|
||||
import cr0s.warpdrive.api.IBlockTransformer;
|
||||
import cr0s.warpdrive.api.ITransformation;
|
||||
import cr0s.warpdrive.config.WarpDriveConfig;
|
||||
|
@ -33,14 +33,12 @@ public class CompatIndustrialCraft2 implements IBlockTransformer {
|
|||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "IC2")
|
||||
public NBTBase saveExternals(final TileEntity tileEntity) {
|
||||
// nothing to do
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "IC2")
|
||||
public void remove(TileEntity tileEntity) {
|
||||
// nothing to do
|
||||
}
|
||||
|
@ -69,7 +67,6 @@ public class CompatIndustrialCraft2 implements IBlockTransformer {
|
|||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "IC2")
|
||||
public void restoreExternals(TileEntity tileEntity, ITransformation transformation, NBTBase nbtBase) {
|
||||
// nothing to do
|
||||
}
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
package cr0s.warpdrive.data;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
public class BlockMetaRotation {
|
||||
public final Block block;
|
||||
public final int[] metaRotation;
|
||||
private int bitMask;
|
||||
|
||||
protected BlockMetaRotation(Block block, int[] metarotation, int bitmask) {
|
||||
if (metarotation.length != 4) {
|
||||
throw new IllegalArgumentException("MetaRotation int array must have length 4");
|
||||
} else {
|
||||
this.block = block;
|
||||
this.metaRotation = metarotation;
|
||||
this.bitMask = bitmask;
|
||||
}
|
||||
}
|
||||
|
||||
public int getRotatedMeta(int currentmeta, int rotate) {
|
||||
for (int i = 0; i < this.metaRotation.length; ++i) {
|
||||
if (this.metaRotation[i] == (currentmeta & this.bitMask)) {
|
||||
int mr = currentmeta & ~this.bitMask | this.metaRotation[wrapRotationIndex(i + rotate)] & this.bitMask;
|
||||
return mr;
|
||||
}
|
||||
}
|
||||
|
||||
return currentmeta;
|
||||
}
|
||||
|
||||
public static int wrapRotationIndex(int i) {
|
||||
return i & 3;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue