mirror of
https://github.com/GTNewHorizons/StructureLib.git
synced 2026-11-15 17:44:44 +00:00
Add most of code. Still missing some hint related stuff.
Signed-off-by: Glease <[email protected]>
This commit is contained in:
1 parent
b5166dbd1c
commit
dc12c4a1df
40 files changed
+4085
No files matched your search
@@ -0,0 +1,43 @@
|
||||
package com.gtnewhorizon.structurelib.alignment;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.FakePlayer;
|
||||
|
||||
public class AlignmentUtility {
|
||||
private AlignmentUtility(){
|
||||
}
|
||||
|
||||
public static boolean handle(EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ){
|
||||
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
|
||||
if(tTileEntity==null || aPlayer instanceof FakePlayer) {
|
||||
return aPlayer instanceof EntityPlayerMP;
|
||||
}
|
||||
if (aPlayer instanceof EntityPlayerMP) {
|
||||
/* TODO Make GT tile entity implement this interface and delegate all functionality to MTE
|
||||
if (tTileEntity instanceof IGregTechTileEntity) {
|
||||
IMetaTileEntity metaTE = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity();
|
||||
if (metaTE instanceof IAlignmentProvider) {
|
||||
IAlignment alignment = ((IAlignmentProvider) metaTE).getAlignment();
|
||||
if(aPlayer.isSneaking()){
|
||||
alignment.toolSetFlip(null);
|
||||
}else {
|
||||
alignment.toolSetRotation(null);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
} else */ if (tTileEntity instanceof IAlignmentProvider) {
|
||||
IAlignment alignment = ((IAlignmentProvider) tTileEntity).getAlignment();
|
||||
if(aPlayer.isSneaking()){
|
||||
alignment.toolSetFlip(null);
|
||||
}else {
|
||||
alignment.toolSetRotation(null);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user