use of riskyken.armourersWorkshop.common.skin.data.Skin in project Armourers-Workshop by RiskyKen.
the class BlockSkinnable method addCollisionBoxesToList.
@Override
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB mask, List list, Entity entity) {
if (entity instanceof Seat) {
return;
}
if (entity != null && entity instanceof EntityPlayer) {
if (((EntityPlayer) entity).isPlayerSleeping()) {
Skin skin = getSkin(world, x, y, z);
if (skin != null) {
Point3D point = null;
if (skin.getParts().get(0).getMarkerCount() > 0) {
point = skin.getParts().get(0).getMarker(0);
} else {
point = new Point3D(0, 0, 16);
}
float scale = 1F / 16F;
// list.add(AxisAlignedBB.getBoundingBox(x, y, z, x + 1F, y + 0.5F + -point.getY() * scale, z + 1F));
// ModLogger.log(-point.getY() * scale);
} else {
// list.add(AxisAlignedBB.getBoundingBox(x, y, z, x + 1F, y + 0.5F, z + 1F));
}
list.add(AxisAlignedBB.getBoundingBox(x, y, z, x + 1F, y + 0.5F, z + 1F));
return;
}
}
super.addCollisionBoxesToList(world, x, y, z, mask, list, entity);
}
use of riskyken.armourersWorkshop.common.skin.data.Skin in project Armourers-Workshop by RiskyKen.
the class BlockSkinnable method isBedFoot.
@Override
public boolean isBedFoot(IBlockAccess world, int x, int y, int z) {
Skin skin = getSkin(world, x, y, z);
if (skin != null) {
for (int i = 0; i < skin.getPartCount(); i++) {
SkinPart part = skin.getParts().get(i);
part.getMarkerCount();
}
}
return false;
}
use of riskyken.armourersWorkshop.common.skin.data.Skin in project Armourers-Workshop by RiskyKen.
the class BlockSkinnable method rotateBlock.
@Override
public boolean rotateBlock(World world, int x, int y, int z, ForgeDirection axis) {
if (world.isRemote) {
return false;
}
Skin skin = getSkin(world, x, y, z);
if (skin == null) {
return false;
}
if (SkinProperties.PROP_BLOCK_MULTIBLOCK.getValue(skin.getProperties())) {
return false;
}
int rotation = world.getBlockMetadata(x, y, z);
rotation++;
if (rotation > 3) {
rotation = 0;
}
world.setBlockMetadataWithNotify(x, y, z, rotation, 2);
return true;
}
use of riskyken.armourersWorkshop.common.skin.data.Skin in project Armourers-Workshop by RiskyKen.
the class ContainerArmourLibrary method updateSkinName.
@SideOnly(Side.CLIENT)
public void updateSkinName(int slotId) {
Minecraft mc = Minecraft.getMinecraft();
GuiScreen screen = mc.currentScreen;
if (screen != null && screen instanceof GuiSkinLibrary) {
GuiSkinLibrary libScreen = (GuiSkinLibrary) screen;
ItemStack stack = getSlot(36).getStack();
if (stack == null) {
libScreen.setFileName("");
} else {
SkinPointer skinPointer = SkinNBTHelper.getSkinPointerFromStack(stack);
if (skinPointer != null) {
if (ClientSkinCache.INSTANCE.isSkinInCache(skinPointer)) {
Skin skin = ClientSkinCache.INSTANCE.getSkin(skinPointer);
String skinName = skin.getCustomName();
if (!StringUtils.isNullOrEmpty(skinName)) {
libScreen.setFileName(skinName);
}
}
}
}
}
}
use of riskyken.armourersWorkshop.common.skin.data.Skin in project Armourers-Workshop by RiskyKen.
the class ContainerGlobalSkinLibrary method buttonPressed.
@Override
public void buttonPressed(byte buttonId) {
if (buttonId == 0) {
if (!tileEntity.getWorldObj().isRemote) {
if (!getSlot(37).getHasStack()) {
ItemStack itemStack = getSlot(36).getStack();
SkinPointer skinPointer = SkinNBTHelper.getSkinPointerFromStack(itemStack);
if (skinPointer != null) {
Skin skin = CommonSkinCache.INSTANCE.getSkin(skinPointer);
if (skin != null) {
onSkinUploaded();
MessageServerLibrarySendSkin message = new MessageServerLibrarySendSkin(null, null, skin, SendType.GLOBAL_UPLOAD);
PacketHandler.networkWrapper.sendTo(message, (EntityPlayerMP) player);
}
}
}
}
}
}
Aggregations