J’ai suivi le tuto sur les containers et GUI en 1.7.X (ça)et j’ai un petit problème.
Voici ma classe du container
| package com.mod.mod2bk.init; |
| |
| import java.util.List; |
| |
| import Blocks.TileEntityGeneticMachine; |
| import net.minecraft.entity.player.EntityPlayer; |
| import net.minecraft.entity.player.InventoryPlayer; |
| import net.minecraft.inventory.Container; |
| import net.minecraft.inventory.Slot; |
| import net.minecraft.world.World; |
| |
| public class ContainerGeneticMachine extends Container |
| { |
| |
| private final TileEntityGeneticMachine tileGM; |
| |
| public ContainerGeneticMachine(TileEntityGeneticMachine tile, InventoryPlayer inventory) |
| |
| { |
| |
| this.tileGM = tile; |
| |
| tile.openInventory(); |
| |
| for(int i = 0; i < 3; ++i) |
| |
| { |
| |
| for(int j = 0; j < 9; ++j) |
| |
| { |
| |
| this.addSlotToContainer(new Slot(tile, j + i * 9, 8 + j * 18, 18 + i * 18)); |
| |
| } |
| |
| } |
| |
| this.bindPlayerInventory(inventory); |
| |
| } |
| |
| @Override |
| public boolean canInteractWith(EntityPlayer playerIn) |
| { |
| return false; |
| } |
| |
| } |
Ps : GeneticMachine est mon bloc avec TileEntity et bah j’essaie de lui mettre un container pour pouvoir en faire une machine avec ce tuto: Créer un bloc de type four(machine)