fix more texturing issues
@@ -1,6 +1,8 @@
|
||||
package storagecraft.item;
|
||||
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -35,10 +37,8 @@ public class ItemWirelessGrid extends ItemBase
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list)
|
||||
{
|
||||
for (int i = 0; i < 2; ++i)
|
||||
{
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
list.add(new ItemStack(item, 1, 0));
|
||||
list.add(new ItemStack(item, 1, 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -106,32 +106,27 @@ public class ItemWirelessGrid extends ItemBase
|
||||
return stack;
|
||||
}
|
||||
|
||||
public boolean isCrafting(ItemStack stack)
|
||||
{
|
||||
return stack.getItemDamage() == 1;
|
||||
}
|
||||
|
||||
public int getX(ItemStack stack)
|
||||
public static int getX(ItemStack stack)
|
||||
{
|
||||
return stack.getTagCompound().getInteger(NBT_WIRELESS_TRANSMITTER_X);
|
||||
}
|
||||
|
||||
public int getY(ItemStack stack)
|
||||
public static int getY(ItemStack stack)
|
||||
{
|
||||
return stack.getTagCompound().getInteger(NBT_WIRELESS_TRANSMITTER_Y);
|
||||
}
|
||||
|
||||
public int getZ(ItemStack stack)
|
||||
public static int getZ(ItemStack stack)
|
||||
{
|
||||
return stack.getTagCompound().getInteger(NBT_WIRELESS_TRANSMITTER_Z);
|
||||
}
|
||||
|
||||
public boolean isInRange(ItemStack stack, EntityPlayer player)
|
||||
public static boolean isInRange(ItemStack stack, EntityPlayer player)
|
||||
{
|
||||
return (int) Math.sqrt(Math.pow(getX(stack) - player.posX, 2) + Math.pow(getY(stack) - player.posY, 2) + Math.pow(getZ(stack) - player.posZ, 2)) < 64;
|
||||
}
|
||||
|
||||
public boolean isValid(ItemStack stack)
|
||||
public static boolean isValid(ItemStack stack)
|
||||
{
|
||||
return stack.hasTagCompound() && stack.getTagCompound().hasKey(NBT_WIRELESS_TRANSMITTER_X) && stack.getTagCompound().hasKey(NBT_WIRELESS_TRANSMITTER_Y) && stack.getTagCompound().hasKey(NBT_WIRELESS_TRANSMITTER_Z);
|
||||
}
|
||||
|
@@ -1,10 +1,12 @@
|
||||
package storagecraft.proxy;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||
import net.minecraft.client.renderer.ItemModelMesher;
|
||||
import net.minecraft.client.resources.model.ModelBakery;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import net.minecraftforge.fml.client.registry.ClientRegistry;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
@@ -14,10 +16,7 @@ import storagecraft.StorageCraftItems;
|
||||
import storagecraft.block.BlockController;
|
||||
import storagecraft.block.EnumControllerType;
|
||||
import storagecraft.block.EnumGridType;
|
||||
import storagecraft.item.ItemCore;
|
||||
import storagecraft.item.ItemProcessor;
|
||||
import storagecraft.item.ItemStorageCell;
|
||||
import storagecraft.item.ItemStoragePart;
|
||||
import storagecraft.item.*;
|
||||
import storagecraft.render.BlockCableRenderer;
|
||||
import storagecraft.render.ItemCableRenderer;
|
||||
import storagecraft.tile.TileCable;
|
||||
@@ -59,6 +58,11 @@ public class ClientProxy extends CommonProxy
|
||||
"storagecraft:destruction_core"
|
||||
);
|
||||
|
||||
ModelBakery.addVariantName(StorageCraftItems.WIRELESS_GRID,
|
||||
"storagecraft:wireless_grid_connected",
|
||||
"storagecraft:wireless_grid_disconnected"
|
||||
);
|
||||
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileCable.class, new BlockCableRenderer());
|
||||
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(StorageCraftBlocks.CABLE), new ItemCableRenderer());
|
||||
@@ -99,6 +103,14 @@ public class ClientProxy extends CommonProxy
|
||||
mesher.register(StorageCraftItems.CORE, ItemCore.TYPE_DESTRUCTION, new ModelResourceLocation("storagecraft:destruction_core", "inventory"));
|
||||
|
||||
mesher.register(StorageCraftItems.WIRELESS_GRID_PLATE, 0, new ModelResourceLocation("storagecraft:wireless_grid_plate", "inventory"));
|
||||
mesher.register(StorageCraftItems.WIRELESS_GRID, new ItemMeshDefinition()
|
||||
{
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation(ItemStack stack)
|
||||
{
|
||||
return new ModelResourceLocation("storagecraft:wireless_grid_" + (ItemWirelessGrid.isValid(stack) ? "connected" : "disconnected"), "inventory");
|
||||
}
|
||||
});
|
||||
|
||||
// Blocks
|
||||
mesher.register(Item.getItemFromBlock(StorageCraftBlocks.GRID), EnumGridType.NORMAL.getId(), new ModelResourceLocation("storagecraft:grid", "inventory"));
|
||||
|
@@ -64,8 +64,8 @@ public class CommonProxy
|
||||
GameRegistry.registerBlock(StorageCraftBlocks.DESTRUCTOR, "destructor");
|
||||
GameRegistry.registerBlock(StorageCraftBlocks.CONSTRUCTOR, "constructor");
|
||||
|
||||
GameRegistry.registerItem(StorageCraftItems.STORAGE_CELL, "storageCell");
|
||||
GameRegistry.registerItem(StorageCraftItems.WIRELESS_GRID, "wirelessGrid");
|
||||
GameRegistry.registerItem(StorageCraftItems.STORAGE_CELL, "storage_cell");
|
||||
GameRegistry.registerItem(StorageCraftItems.WIRELESS_GRID, "wireless_grid");
|
||||
GameRegistry.registerItem(StorageCraftItems.WIRELESS_GRID_PLATE, "wireless_grid_plate");
|
||||
GameRegistry.registerItem(StorageCraftItems.QUARTZ_ENRICHED_IRON, "quartz_enriched_iron");
|
||||
GameRegistry.registerItem(StorageCraftItems.CORE, "core");
|
||||
|
@@ -11,8 +11,8 @@ import storagecraft.tile.TileCable;
|
||||
public class CableModel extends ModelBase
|
||||
{
|
||||
public static final ResourceLocation CABLE_RESOURCE = new ResourceLocation("storagecraft:textures/blocks/cable.png");
|
||||
public static final ResourceLocation CABLE_UNPOWERED_RESOURCE = new ResourceLocation("storagecraft:textures/blocks/cableUnpowered.png");
|
||||
public static final ResourceLocation CABLE_POWERED_RESOURCE = new ResourceLocation("storagecraft:textures/blocks/cablePowered.png");
|
||||
public static final ResourceLocation CABLE_UNPOWERED_RESOURCE = new ResourceLocation("storagecraft:textures/blocks/cable_sensitive_unpowered.png");
|
||||
public static final ResourceLocation CABLE_POWERED_RESOURCE = new ResourceLocation("storagecraft:textures/blocks/cable_sensitive_powered.png");
|
||||
|
||||
private ModelRenderer core;
|
||||
private ModelRenderer up;
|
||||
|
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"parent": "builtin/generated",
|
||||
"textures": {
|
||||
"layer0": "storagecraft:items/wireless_grid_connected"
|
||||
},
|
||||
"display": {
|
||||
"thirdperson": {
|
||||
"rotation": [-90, 0, 0],
|
||||
"translation": [0, 1, -3],
|
||||
"scale": [0.55, 0.55, 0.55]
|
||||
},
|
||||
"firstperson": {
|
||||
"rotation": [0, -135, 25],
|
||||
"translation": [0, 4, 2],
|
||||
"scale": [1.7, 1.7, 1.7]
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"parent": "builtin/generated",
|
||||
"textures": {
|
||||
"layer0": "storagecraft:items/wireless_grid_disconnected"
|
||||
},
|
||||
"display": {
|
||||
"thirdperson": {
|
||||
"rotation": [-90, 0, 0],
|
||||
"translation": [0, 1, -3],
|
||||
"scale": [0.55, 0.55, 0.55]
|
||||
},
|
||||
"firstperson": {
|
||||
"rotation": [0, -135, 25],
|
||||
"translation": [0, 4, 2],
|
||||
"scale": [1.7, 1.7, 1.7]
|
||||
}
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 178 B After Width: | Height: | Size: 178 B |
Before Width: | Height: | Size: 178 B After Width: | Height: | Size: 178 B |
Before Width: | Height: | Size: 261 B After Width: | Height: | Size: 261 B |
Before Width: | Height: | Size: 294 B After Width: | Height: | Size: 294 B |