use of riskyken.armourersWorkshop.api.common.skin.type.ISkinType in project Armourers-Workshop by RiskyKen.
the class ExPropsEntityEquipmentData method setInventorySlotContents.
@Override
public void setInventorySlotContents(IInventory inventory, int slotId, ItemStack stack) {
if (entity.worldObj.isRemote) {
return;
}
if (stack == null) {
ISkinType skinType = getSkinTypeForSlot(slotId);
equipmentData.removeEquipment(skinType, 0);
} else {
SkinPointer skinData = SkinNBTHelper.getSkinPointerFromStack(stack);
equipmentData.addEquipment(skinData.getIdentifier().getSkinType(), 0, skinData);
}
sendEquipmentDataToPlayerToAllPlayersAround();
}
use of riskyken.armourersWorkshop.api.common.skin.type.ISkinType in project Armourers-Workshop by RiskyKen.
the class RenderBlockMiniArmourer method renderTileEntityAt.
public void renderTileEntityAt(TileEntityMiniArmourer tileEntity, double x, double y, double z, float tickTime) {
Minecraft mc = Minecraft.getMinecraft();
mc.mcProfiler.startSection("armourersMiniArmourer");
float scale = 0.0625F;
GL11.glPushMatrix();
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
GL11.glTranslated(x + 0.5D, y + 0.5D, z + 0.5D);
GL11.glScalef(-1, -1, 1);
modelArmourer.render(tileEntity, tickTime, scale);
GL11.glTranslated(0D, -0.5D, 0D);
ISkinType skinType = tileEntity.getSkinType();
if (skinType != null) {
float rotation = (float) ((double) System.currentTimeMillis() / 25 % 360);
GL11.glRotatef(rotation, 0F, 1F, 0F);
bindTexture(Minecraft.getMinecraft().thePlayer.getLocationSkin());
SkinRenderHelper.renderBuildingGuide(skinType, scale, true, false);
// skinType.renderBuildingGrid(scale);
}
GL11.glPopAttrib();
GL11.glPopMatrix();
mc.mcProfiler.endSection();
}
use of riskyken.armourersWorkshop.api.common.skin.type.ISkinType in project Armourers-Workshop by RiskyKen.
the class BlockBoundingBox method setColour.
@Override
public boolean setColour(IBlockAccess world, int x, int y, int z, int colour, int side) {
ForgeDirection sideBlock = ForgeDirection.getOrientation(side);
if (world.getBlock(x + sideBlock.offsetX, y + sideBlock.offsetY, z + sideBlock.offsetZ) == this) {
return false;
}
TileEntity te = world.getTileEntity(x, y, z);
if (te != null && te instanceof TileEntityBoundingBox) {
TileEntityArmourer parent = ((TileEntityBoundingBox) te).getParent();
if (((TileEntityBoundingBox) te).getSkinPart() instanceof ISkinPartTypeTextured) {
if (parent != null) {
ISkinType skinType = parent.getSkinType();
Point texturePoint = SkinTextureHelper.getTextureLocationFromWorldBlock((TileEntityBoundingBox) te, side);
int oldColour = parent.getPaintData(texturePoint.x, texturePoint.y);
int paintType = BitwiseUtils.getUByteFromInt(oldColour, 0);
int newColour = BitwiseUtils.setUByteToInt(colour, 0, paintType);
parent.updatePaintData(texturePoint.x, texturePoint.y, newColour);
return true;
}
}
}
return false;
}
use of riskyken.armourersWorkshop.api.common.skin.type.ISkinType in project Armourers-Workshop by RiskyKen.
the class RecipeSkinArmour method isValidArmourForSkin.
private boolean isValidArmourForSkin(ItemStack armourStack, ItemStack skinStack) {
SkinPointer sp = SkinNBTHelper.getSkinPointerFromStack(skinStack);
ISkinType skinType = sp.getIdentifier().getSkinType();
Item armourItem = armourStack.getItem();
if (armourItem.isValidArmor(armourStack, skinType.getVanillaArmourSlotId(), null)) {
return true;
}
return false;
}
use of riskyken.armourersWorkshop.api.common.skin.type.ISkinType in project Armourers-Workshop by RiskyKen.
the class ExPropsPlayerSkinData method clearAllEquipmentStacks.
public void clearAllEquipmentStacks() {
ArrayList<ISkinType> skinList = SkinTypeRegistry.INSTANCE.getRegisteredSkinTypes();
for (int i = 0; i < skinList.size(); i++) {
ISkinType skinType = skinList.get(i);
WardrobeInventory wi = wardrobeInventoryContainer.getInventoryForSkinType(skinType);
if (wi != null) {
for (int j = 0; j < wi.getSizeInventory(); j++) {
wi.setInventorySlotContents(j, null);
}
}
}
}
Aggregations