-
Posts
157 -
Joined
-
Last visited
Posts posted by Dragonisser
-
-
It is for items but the method should be the same ^^
@Override public String getUnlocalizedName(ItemStack is) { int i = MathHelper.clamp_int(is.getItemDamage(), 0, 1); return super.getUnlocalizedName() + "_" + itemMetaNames[i]; }
-
Its not correct. He has a folder structure that wont work. It needs to be resources/assets/[mod]/textures/blocks/block.png
but he is using resources/assets.[mod]/textures.blocks/block.png
and this is wrong.
-
How about providing the crash log? We don't have diesieben07's magical code reading mind
-
Your path you want, is this: samplemod:textures/blocks/testBlock.png
but you got it ressources/assets.samplemod/textures.block/testBlock.png
your file structure needs to be ressources/assets/samplemod/blocks/testBlock.png
-
-
You need for this packets:
http://www.minecraftforge.net/wiki/Packet_Handling
It's a bit hard too understand, so just ask again if you cant get any further with you code.
-
-
Try this:
Its for my custom furnace and i had the same problem ^^
-
Try using.
this.setLightOpacity(0);
Tell me if it works 1.8 too, because this is in 1.7.10 and i can't test it right now ^^
-
Well i did it the other way
https://bitbucket.org/Dragonisser/cobaltmod/commits/283795b0c366596dc22362f56cb558f9d8ff04ab
And it seems to work 100% =3
-
Gonna take a look at it ^^
I guess i need this:
public void onPickupFromSlot(EntityPlayer p_82870_1_, ItemStack p_82870_2_)
{
this.onSlotChanged();
}
-
But i doesnt put the backpack in any custom slot, that's why i dont understand why i should need this.
-
-
I think i found another way :3
It seems to work perfectly except i cant pickup item/blocks and move them, it only works with shiftclick ._.
I know where the problem is:
@Override public ItemStack slotClick(int slot, int button, int flag, EntityPlayer player) { // this will prevent the player from interacting with the item that opened the inventory: if (slot >= 0 && getSlot(slot) != null && getSlot(slot).getStack() == player.getHeldItem()) { return null; } return super.slotClick(slot, button, flag, player); }
-
It print this in the console:
player not holding in armor slot armoritem in slot right item armor slot/Server player not holding in armor slot armoritem in slot right item armor slot/Client
-
Changed it to: ItemStack[] armor = player.inventory.armorInventory;
I hope that was it, what you meant but still nothing happends ._.
-
Already doing that:
@SubscribeEvent public void onKeyInput(KeyInputEvent event) { if (mc.inGameHasFocus) { if (key.getIsKeyPressed()) { CobaltPacketDispatcher.sendToServer(new CobaltOpenGuiMessage(5)); } } }
The problem is i need the itemstack or the gui/container doesnt open. And yes it is copy&paste from a tutorial about packets.
-
How am i going to send a packet containing the right itemstack in the armorslot?
-
My Keyhandler works but the problem is, how do i access the backpack when it is in a armorslot? I tried it with checking and that stuff. It goes through all the if's and print out:
player
not holding
in armor slot
armoritem in slot
right item
armor slot/Client
but in the end it doesnt open ._.
public class GuiHandler implements IGuiHandler
{
private Minecraft mc;
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
{
TileEntity tileEntity = world.getTileEntity(x, y, z);
mc = Minecraft.getMinecraft();
switch(ID)
{
case 0: return ID == 0 ? new ContainerAltar(player.inventory, (TileEntityAltar) tileEntity) : null;
case 2: return ID == 2 ? new ContainerCobaltFurnace(player.inventory, (TileEntityCobaltFurnace) tileEntity) : null;
case 3: return ID == 3 ? new ContainerRitualStone(player.inventory, (TileEntityRitualStone) tileEntity) : null;
case 4: return ID == 4 && world.getBlock(x, y, z) == CMStuff.cobexworkbench ? new ContainerBlueWoodWorkBench(player.inventory, world, x, y, z) : null;
case 5:
ItemStack[] armor = mc.thePlayer.inventory.armorInventory;
if (player != null) {
System.out.println("player");
if (player.getHeldItem() != null) {
System.out.println("hold in hands");
if (player.getHeldItem().getItem() == CMStuff.cobaltbackpack) {
System.out.println("right item in Hands");
System.out.println("hands/Server");
return ID == 5 ? new ContainerBackpack(player, player.inventory, new InventoryBackpack(player.getHeldItem())) : null;
}
}
else if(armor[2] != null)
{
System.out.println("not holding");
System.out.println("in armor slot");
Item item = armor[2].getItem();
if(item instanceof ItemArmor)
{
System.out.println("armoritem in slot");
ItemArmor itemA = (ItemArmor) item;
if(itemA.getArmorMaterial() == CMStuff.WoolArmor)
{
ItemStack backpack = armor[2];
System.out.println("right item");
System.out.println("armor slot/Server");
return ID == 5 ? new ContainerBackpack(player, player.inventory, new InventoryBackpack(backpack)) : null;
}
}
}
}
}
return null;
}
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
{
TileEntity tileEntity = world.getTileEntity(x, y, z);
switch(ID)
{
case 0: return ID == 0 ? new GuiAltar(player.inventory, (TileEntityAltar) tileEntity) : null;
case 1: return ID == 1 ? new GuiRecipeBook(player) : null;
case 2: return ID == 2 ? new GuiCobaltFurnace(player.inventory, (TileEntityCobaltFurnace) tileEntity) : null;
case 3: return ID == 3 ? new GuiRitualStone(player.inventory, (TileEntityRitualStone) tileEntity) : null;
case 4: return ID == 4 && world.getBlock(x, y, z) == CMStuff.cobexworkbench ? new GuiBlueWoodWorkBench(player.inventory, world, x, y, z) : null;
case 5:
ItemStack[] armor = mc.thePlayer.inventory.armorInventory;
if (player != null) {
System.out.println("player");
if (player.getHeldItem() != null) {
System.out.println("hold in hands");
if (player.getHeldItem().getItem() == CMStuff.cobaltbackpack) {
System.out.println("right item in Hands");
System.out.println("hands/Client");
return ID == 5 ? new GuiBackpack((ContainerBackpack) new ContainerBackpack(player, player.inventory, new InventoryBackpack(player.getHeldItem()))) : null;
}
}
else if(armor[2] != null)
{
System.out.println("not holding");
System.out.println("in armor slot");
Item item = armor[2].getItem();
if(item instanceof ItemArmor)
{
System.out.println("armoritem in slot");
ItemArmor itemA = (ItemArmor) item;
if(itemA.getArmorMaterial() == CMStuff.WoolArmor)
{
ItemStack backpack = armor[2];
System.out.println("right item");
System.out.println("armor slot/Client");
return ID == 5 ? new GuiBackpack((ContainerBackpack) new ContainerBackpack(player, player.inventory, new InventoryBackpack(backpack))) : null;
}
}
}
}
}
return null;
}
}
If the spoiler doesnt seem to work:
i also tried it with armor[2] instead of backpack, but it still not work. When i have it in my hands and press rightclick it works perfectly, its simply the key + slot problem Hope someone can help me ^^
I know the problem is the itemstack im using for the "new InventoryBackpack())) : null;", but i cant figure out how i get the one i have in the slot stored.
-
-
Good to know. I think he means like a fridge. After a time of amount the porkchop gets bad
-
You dont have you ClientProxy where you declared it:
com.phyyrus.ds.proxy.ClientProxy
@SidedProxy(clientSide = "cobaltmod.main.ClientProxyCobalt", serverSide = "cobaltmod.main.CommonProxyCobalt")
package cobaltmod.main;
So your ClientProxy needs to be in package com.phyyrus.ds.proxy;
-
I've this:
ClientProxy
RenderingRegistry.registerBlockHandler(RenderAltar.altarRenderId, new RenderAltar());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAltar.class, new RenderAltar());
And in the block.class (would be good if you show us that too ^^)
@SideOnly(Side.CLIENT)
public int getRenderType() {
return RenderAltar.altarRenderId;
}
-
I'm going to say that to him ^^ Thanks diesiebe07 (und Gute Nacht)
My New Door Won't Render good.
in Modder Support
Posted
Thats because you need an Item ^^
https://bitbucket.org/Dragonisser/cobaltmod/src/178c28c1f444b11466696e40bcbfb0f8978acf76/cobaltmod/items/ItemCobexDoor.java?at=master
When you place a normal door, do you have the block or the item in your hands