MFF

    Minecraft Forge France
    • Récent
    • Mots-clés
    • Populaire
    • Utilisateurs
    • Groupes
    • Forge Events
      • Automatique
      • Foncé
      • Clair
    • S'inscrire
    • Se connecter

    [Chest] Problème TileEntity chest sur serveur forge

    Planifier Épinglé Verrouillé Déplacé Non résolu Sans suite
    1.12.2
    22 Messages 3 Publieurs 1.0k Vues 3 Watching
    Charger plus de messages
    • Du plus ancien au plus récent
    • Du plus récent au plus ancien
    • Les plus votés
    Répondre
    • Répondre à l'aide d'un nouveau sujet
    Se connecter pour répondre
    Ce sujet a été supprimé. Seuls les utilisateurs avec les droits d'administration peuvent le voir.
    • N Hors-ligne
      Nokiyx
      dernière édition par Nokiyx

      Bonjour, je viens ici car je n’est trouver aucune réponse a mes 3h de recherches et ceci et ma dernière solution (j’espère que quelqu’un pourras m’aider.
      Alors mon problèmes est que mon
      ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCopperChest.class, new RenderCopperChest());

      Fait crash mon serveur de test forge et je n’arrive pas a le régler.
      L’erreur que me met le serveur (je ne peut pas l’upload via le site car sa ne veut pas)
      https://image.noelshack.com/fichiers/2020/14/7/1586039710-crashs.png
      La classe blockInit

      public static void init(){
      		kingonium_block = new BlockMod("kingonium_block", Material.IRON).setHardness(3.0f).setCreativeTab(Crown.crowntab);
      		kingonium_ore = new BlockOreMod("kingonium_ore",4,1,2).setCreativeTab(Crown.crowntab).setHardness(5.0f);
      		amethyste_ore = new BlockOreMod("amethyste_ore",3,1,2).setCreativeTab(Crown.crowntab).setHardness(5.0f);
      		corograss =  new BlockModGrass("coro_grass", Material.GROUND).setCreativeTab(Crown.crowntab).setHardness(0.3f);
      		coro_leaves = new BlockLeaves("coro_leaves", Material.LEAVES).setCreativeTab(Crown.crowntab).setHardness(0.05f);
      		coro_logs = new BlockModLog("coro_log", Material.WOOD).setCreativeTab(Crown.crowntab).setHardness(0.9f).setCreativeTab(Crown.crowntab);
      		amethyste_block = new BlockMod("amethyste_block", Material.IRON).setHardness(3.0f).setCreativeTab(Crown.crowntab);
      		coro_planks = new BlockModLog("coro_planks", Material.WOOD).setHardness(0.9f).setCreativeTab(Crown.crowntab);
      		amethyste_stairs = new BlockCustomStairs("amethyste_stairs", amethyste_block.getDefaultState()).setHardness(2.0f);
      	}
      	
      	@SubscribeEvent
      	public static void registerBlocks(RegistryEvent.Register<Block> e){
      		e.getRegistry().registerAll(amethyste_stairs,coro_planks,coro_logs,amethyste_block,coro_leaves,corograss,kingonium_block,kingonium_ore,amethyste_ore);
      		e.getRegistry().registerAll(BlockInit.BLOCKS.toArray(new Block[0]));
      	        TileEntityHandler.registerTileEntities();
      		
      	}
      	
      	@SubscribeEvent
      	public static void registerItemBlocks(RegistryEvent.Register<Item> e){
      		e.getRegistry().registerAll(
      				new ItemBlock(amethyste_stairs).setRegistryName(amethyste_stairs.getRegistryName()),new ItemBlock(coro_planks).setRegistryName(coro_planks.getRegistryName()),new ItemBlock(corograss).setRegistryName(corograss.getRegistryName()),new ItemBlock(coro_logs).setRegistryName(coro_logs.getRegistryName()),new ItemBlock(amethyste_block).setRegistryName(amethyste_block.getRegistryName()),new ItemBlock(coro_leaves).setRegistryName(coro_leaves.getRegistryName()),new ItemBlock(kingonium_block).setRegistryName(kingonium_block.getRegistryName()), new ItemBlock(kingonium_ore).setRegistryName(kingonium_ore.getRegistryName()), new ItemBlock(BlockInit.COPPER_CHEST).setRegistryName(BlockInit.COPPER_CHEST.getRegistryName()), new ItemBlock(amethyste_ore).setRegistryName(amethyste_ore.getRegistryName()));
      	}	
      	@SubscribeEvent
      	public static void registerRenders(ModelRegistryEvent e){
      		registerRender(Item.getItemFromBlock(kingonium_block));
      		registerRender(Item.getItemFromBlock(kingonium_ore));
      		registerRender(Item.getItemFromBlock(amethyste_ore));
      		registerRender(Item.getItemFromBlock(BlockInit.COPPER_CHEST));
      		registerRender(Item.getItemFromBlock(corograss));
      		registerRender(Item.getItemFromBlock(coro_leaves));
      		registerRender(Item.getItemFromBlock(amethyste_block));
      		registerRender(Item.getItemFromBlock(coro_logs));
      		registerRender(Item.getItemFromBlock(coro_planks));
      		registerRender(Item.getItemFromBlock(amethyste_stairs));
      		ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCopperChest.class, new RenderCopperChest());
      	}
      

      Le gui

      	private static final ResourceLocation GUI_CHEST = new ResourceLocation(Crown.MODID + ":textures/gui/copper_chest.png");
      	private final InventoryPlayer playerInventory;
      	private final TileEntityCopperChest te;
      	
      	public GuiCopperChest(InventoryPlayer playerInventory, TileEntityCopperChest chestInventory, EntityPlayer player) 
      	{
      		super(new ContainerCopperChest(playerInventory, chestInventory, player));
      		this.playerInventory = playerInventory;
      		this.te = chestInventory;
      		
      		xSize = 176;
      		ySize = 256;
      	}
      	
      	@Override
      	protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) 
      	{
      		this.fontRenderer.drawString(this.te.getDisplayName().getUnformattedText(), 8, 6, 16086784);
      		this.fontRenderer.drawString(this.playerInventory.getDisplayName().getUnformattedText(), 8, this.ySize - 92, 16086784);
      	}
      	
      	@Override
      	protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
      	{
      		GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f);
      		this.mc.getTextureManager().bindTexture(GUI_CHEST);
      		this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
      	}
      }
      
      
      

      Le gui handler

      public class GuiHandler implements IGuiHandler
      {
      	@Override
      	public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) 
      	{
      		
      		if(ID == Crown.GUI_COPPER_CHEST) return new ContainerCopperChest(player.inventory, (TileEntityCopperChest)world.getTileEntity(new BlockPos(x,y,z)), player);
      		return null;
      	}
      	
      	@Override
      	public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) 
      	{
      		if(ID == Crown.GUI_COPPER_CHEST) return new GuiCopperChest(player.inventory, (TileEntityCopperChest)world.getTileEntity(new BlockPos(x,y,z)), player);
      		return null;
      	}
      }
      
      
      

      Le containerChest

      public class ContainerCopperChest extends Container
      {
      	private final int numRows;
      	private final TileEntityCopperChest chestInventory;
      	
      	public ContainerCopperChest(InventoryPlayer playerInv, TileEntityCopperChest tileEntityCopperChest, EntityPlayer player) 
      	{
      		this.chestInventory = tileEntityCopperChest;
      		this.numRows = tileEntityCopperChest.getSizeInventory() / 9;
      		tileEntityCopperChest.openInventory(player);
      		
      		for(int i = 0; i < this.numRows; ++i)
      		{
      			for(int j = 0; j < 9; ++j)
      			{
      				this.addSlotToContainer(new Slot(tileEntityCopperChest, j + i*9, 8 + j*18, 18 + i*18));
      			}
      		}
      		
      		for(int y = 0; y < 3; y++)
      		{
      			for(int x = 0; x < 9; x++)
      			{
      				this.addSlotToContainer(new Slot(playerInv, x + y*9 + 9, 8 + x*18, 175 + y*18));
      			}
      		}
      		
      		for(int x = 0; x < 9; x++)
      		{
      			this.addSlotToContainer(new Slot(playerInv, x, 8 + x*18, 233));
      		}
      	}
      	
      	@Override
      	public boolean canInteractWith(EntityPlayer playerIn)
      	{
      		return this.chestInventory.isUsableByPlayer(playerIn);
      	}
      	
      	@Override
      	public void onContainerClosed(EntityPlayer playerIn) 
      	{
      		super.onContainerClosed(playerIn);
      		chestInventory.closeInventory(playerIn);
      	}
      	
      	@Override
      	public ItemStack transferStackInSlot(EntityPlayer playerIn, int index)
      	{
      		ItemStack itemstack = ItemStack.EMPTY;
              Slot slot = this.inventorySlots.get(index);
      
              if (slot != null && slot.getHasStack())
              {
                  ItemStack itemstack1 = slot.getStack();
                  itemstack = itemstack1.copy();
      
                  if (index < this.numRows * 9)
                  {
                      if (!this.mergeItemStack(itemstack1, this.numRows * 9, this.inventorySlots.size(), true))
                      {
                          return ItemStack.EMPTY;
                      }
                  }
                  else if (!this.mergeItemStack(itemstack1, 0, this.numRows * 9, false))
                  {
                      return ItemStack.EMPTY;
                  }
      
                  if (itemstack1.isEmpty())
                  {
                      slot.putStack(ItemStack.EMPTY);
                  }
                  else
                  {
                      slot.onSlotChanged();
                  }
              }
      
              return itemstack;
      	}
      	
      	public TileEntityCopperChest getChestInventory()
      	{
      		return this.chestInventory;
      	}
      }
      
      
      

      et le tileEntityCopperChest

      public class TileEntityCopperChest extends TileEntityLockableLoot implements ITickable
      {
      	private NonNullList<ItemStack> chestContents = NonNullList.<ItemStack>withSize(72, ItemStack.EMPTY);
      	public int numPlayersUsing, ticksSinceSync;
      	public float lidAngle, prevLidAngle;
      	
      	@Override
      	public int getSizeInventory()
      	{
      		return 72;
      	}
      	
      	@Override
      	public int getInventoryStackLimit() 
      	{
      		return 64;
      	}
      	
      	@Override
      	public boolean isEmpty()
      	{
      		for(ItemStack stack : this.chestContents)
      		{
      			if(!stack.isEmpty()) return false;
      		}
      		
      		return true;
      	}
      	
      	@Override
      	public String getName() 
      	{
      		return this.hasCustomName() ? this.customName : "container.copper_chest";
      	}
      	
      	@Override
      	public void readFromNBT(NBTTagCompound compound)
      	{
      		super.readFromNBT(compound);
      		this.chestContents = NonNullList.<ItemStack>withSize(this.getSizeInventory(), ItemStack.EMPTY);
      		
      		if(!this.checkLootAndRead(compound)) ItemStackHelper.loadAllItems(compound, chestContents);
      		if(compound.hasKey("CustomName", 8)) this.customName = compound.getString("CustomName");
      	}
      	
      	@Override
      	public NBTTagCompound writeToNBT(NBTTagCompound compound)
      	{
      		super.writeToNBT(compound);
      		
      		if(!this.checkLootAndWrite(compound)) ItemStackHelper.saveAllItems(compound, chestContents);
      		if(compound.hasKey("CustomName", 8)) compound.setString("CustomName", this.customName);
      		
      		return compound;
      	}
      	
      	@Override
      	public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) 
      	{
      		return new ContainerCopperChest(playerInventory, this, playerIn);
      	}
      	
      	@Override
      	public String getGuiID() 
      	{
      		return Crown.MODID + ":copper_chest";
      	}
      	
      	@Override
      	protected NonNullList<ItemStack> getItems() 
      	{
      		return this.chestContents;
      	}
      	
      	@Override
      	public void update()
      	{
      		if (!this.world.isRemote && this.numPlayersUsing != 0 && (this.ticksSinceSync + pos.getX() + pos.getY() + pos.getZ()) % 200 == 0)
              {
                  this.numPlayersUsing = 0;
                  float f = 5.0F;
      
                  for (EntityPlayer entityplayer : this.world.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB((double)((float)pos.getX() - 5.0F), (double)((float)pos.getY() - 5.0F), (double)((float)pos.getZ() - 5.0F), (double)((float)(pos.getX() + 1) + 5.0F), (double)((float)(pos.getY() + 1) + 5.0F), (double)((float)(pos.getZ() + 1) + 5.0F))))
                  {
                      if (entityplayer.openContainer instanceof ContainerCopperChest)
                      {
                          if (((ContainerCopperChest)entityplayer.openContainer).getChestInventory() == this)
                          {
                              ++this.numPlayersUsing;
                          }
                      }
                  }
              }
      		
              this.prevLidAngle = this.lidAngle;
              float f1 = 0.1F;
      
              if (this.numPlayersUsing > 0 && this.lidAngle == 0.0F)
              {
                  double d1 = (double)pos.getX() + 0.5D;
                  double d2 = (double)pos.getZ() + 0.5D;
                  this.world.playSound((EntityPlayer)null, d1, (double)pos.getY() + 0.5D, d2, SoundEvents.BLOCK_IRON_TRAPDOOR_OPEN, SoundCategory.BLOCKS, 0.5F, this.world.rand.nextFloat() * 0.1F + 0.9F);
              }
      
              if (this.numPlayersUsing == 0 && this.lidAngle > 0.0F || this.numPlayersUsing > 0 && this.lidAngle < 1.0F)
              {
                  float f2 = this.lidAngle;
      
                  if (this.numPlayersUsing > 0)
                  {
                      this.lidAngle += 0.1F;
                  }
                  else
                  {
                      this.lidAngle -= 0.1F;
                  }
      
                  if (this.lidAngle > 1.0F)
                  {
                      this.lidAngle = 1.0F;
                  }
      
                  float f3 = 0.5F;
      
                  if (this.lidAngle < 0.5F && f2 >= 0.5F)
                  {
                      double d3 = (double)pos.getX() + 0.5D;
                      double d0 = (double)pos.getZ() + 0.5D;
                      this.world.playSound((EntityPlayer)null, d3, (double)pos.getY() + 0.5D, d0, SoundEvents.BLOCK_IRON_TRAPDOOR_CLOSE, SoundCategory.BLOCKS, 0.5F, this.world.rand.nextFloat() * 0.1F + 0.9F);
                  }
      
                  if (this.lidAngle < 0.0F)
                  {
                      this.lidAngle = 0.0F;
                  }
              }		
      	}
      	
      	@Override
      	public void openInventory(EntityPlayer player)
      	{
      		++this.numPlayersUsing;
      		this.world.addBlockEvent(pos, this.getBlockType(), 1, this.numPlayersUsing);
      		this.world.notifyNeighborsOfStateChange(pos, this.getBlockType(), false);
      	}
      	
      	@Override
      	public void closeInventory(EntityPlayer player) 
      	{
      		--this.numPlayersUsing;
      		this.world.addBlockEvent(pos, this.getBlockType(), 1, this.numPlayersUsing);
      		this.world.notifyNeighborsOfStateChange(pos, this.getBlockType(), false);
      	}	
      }
      
      
      
      1 réponse Dernière réponse Répondre Citer 0
      • plopP Hors-ligne
        plop
        dernière édition par

        Hello !

        Je t’avoue que moi je débute du coup tu dois te dire mais pourquoi te répondre dans ce cas xD ?
        Il y a peu d’activité et de personne qualifier pour répondre sur ce forum, j’attends moi même une réponse à mon problème ^^'.

        Cela dit, même si je comprend pas trop, en faisant une recherche j’ai trouvé un sujet qui traitais d’un cas similaire:
        https://www.minecraftforgefrance.fr/topic/109/rendu-complexe-de-bloc-via-tesr/20?_=1586069805765

        J’ai aucune idée si tu l’as déjà vue ou si ça peut t’aider, mais au cas ou, si tu ne l’as pas vue, peut être que tu y trouvera une réponse,
        désolé de pas pouvoir t’aider plus 😛 !

        1 réponse Dernière réponse Répondre Citer 0
        • robin4002R Hors-ligne
          robin4002 Moddeurs confirmés Rédacteurs Administrateurs
          dernière édition par

          Bonjour,

          @Nokiyx a dit dans [Chest] Problème TileEntity chest sur serveur forge :

          @SubscribeEvent
          public static void registerRenders(ModelRegistryEvent e){

          Ajoutes un @SideOnly(Side.CLIENT) ici et cela devrait régler le problème.

          1 réponse Dernière réponse Répondre Citer 0
          • N Hors-ligne
            Nokiyx
            dernière édition par

            C’est bon sa fonctionne merci robin et merci plop aussi mais enfaite le SideOnly(Side.Client) sert que pour ce qui est côtés client si je comprend bien

            1 réponse Dernière réponse Répondre Citer 0
            • N Hors-ligne
              Nokiyx
              dernière édition par

              Ah j’ai oublié mon autre question est que mon coffre quand je le place ils se met toujours dans le même sens ils ne veut pas faire une rotation voici mon blockstates

              {
                  "variants": {
                      "normal": { "model": "crown:kingonium_block" }
                      "facing=east": { "model": "crown:copper_chest" },
                      "facing=west": { "model": "crown:copper_chest" },
                      "facing=north": { "model": "crown:copper_chest" },
                      "facing=south": { "model": "crown:copper_chest" }
                  }
              
              1 réponse Dernière réponse Répondre Citer 0
              • robin4002R Hors-ligne
                robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                dernière édition par

                @SideOnly sert à indiquer à forge de supprimer la fonction si le runtime n’est pas celui indiqué.
                Donc quand tu mets un @SideOnly(Side.CLIENT) la fonction qui se trouve en dessous est supprimé lors du chargement de mod.

                Pour la rotation, il faut ajouter dans le code de ton TileEntitySpecialRenderer un GlStateManager.rotate en fonction du bloc state.

                1 réponse Dernière réponse Répondre Citer 0
                • N Hors-ligne
                  Nokiyx
                  dernière édition par

                  @SideOnly(Side.CLIENT)
                  public class RenderCopperChest extends TileEntitySpecialRenderer<TileEntityCopperChest>
                  {
                  	private static final ResourceLocation TEXTURE = new ResourceLocation(Crown.MODID + ":textures/block/copper_chest.png");
                  	private final ModelCopperChest MODEL = new ModelCopperChest();
                  	
                  	@Override
                  	public void render(TileEntityCopperChest te, double x, double y, double z, float partialTicks, int destroyStage, float alpha) 
                  	{
                  		GlStateManager.enableDepth();
                          GlStateManager.depthFunc(515);
                          GlStateManager.depthMask(true);
                      	
                      	ModelCopperChest model = MODEL;
                      	
                      	if (destroyStage >= 0)
                          {
                              this.bindTexture(DESTROY_STAGES[destroyStage]);
                              GlStateManager.matrixMode(5890);
                              GlStateManager.pushMatrix();
                              GlStateManager.scale(4.0F, 4.0F, 1.0F);
                              GlStateManager.translate(0.0625F, 0.0625F, 0.0625F);
                              GlStateManager.matrixMode(5888);
                          }
                      	else this.bindTexture(TEXTURE);
                      	
                      	GlStateManager.pushMatrix();
                          GlStateManager.enableRescaleNormal();
                          GlStateManager.translate((float)x, (float)y + 1.0F, (float)z + 1.0F);
                          GlStateManager.scale(1.0F, -1.0F, -1.0F);
                          GlStateManager.translate(0.5F, 0.5F, 0.5F);
                          GlStateManager.translate(-0.5F, -0.5F, -0.5F);
                         
                          float f = te.prevLidAngle + (te.lidAngle - te.prevLidAngle) * partialTicks;
                          f = 1.0F - f;
                          f = 1.0F - f * f * f;
                          model.chestLid.rotateAngleX = -(f * ((float)Math.PI / 2F));
                          model.renderAll();
                          GlStateManager.disableRescaleNormal();
                          GlStateManager.popMatrix();
                          GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
                  
                          if (destroyStage >= 0)
                          {
                              GlStateManager.matrixMode(5890);
                              GlStateManager.popMatrix();
                              GlStateManager.matrixMode(5888);
                          }	
                  	}
                  }
                  

                  J’ai le GlStateManager et normalement ils doit faire la rotation mais ils ne le fait pas

                  1 réponse Dernière réponse Répondre Citer 0
                  • robin4002R Hors-ligne
                    robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                    dernière édition par

                    Hum non, je ne vois aucun GlStateManager.rotate dans ton code.

                    1 réponse Dernière réponse Répondre Citer 0
                    • N Hors-ligne
                      Nokiyx
                      dernière édition par

                      Alors j’ai oublier j’ai une classe model

                      extends ModelBase 
                      {
                      	public ModelRenderer chestKnob;
                          public ModelRenderer chestLid;
                          public ModelRenderer chestBelow;
                      
                          public ModelCopperChest() 
                          {
                              this.textureWidth = 64;
                              this.textureHeight = 64;
                              
                              this.chestBelow = new ModelRenderer(this, 0, 19);
                              this.chestBelow.setRotationPoint(1.0F, 6.0F, 1.0F);
                              this.chestBelow.addBox(0.0F, 0.0F, 0.0F, 14, 10, 14, 0.0F);
                              this.chestKnob = new ModelRenderer(this, 0, 0);
                              this.chestKnob.setRotationPoint(8.0F, 7.0F, 15.0F);
                              this.chestKnob.addBox(-1.0F, -2.0F, -15.0F, 2, 4, 1, 0.0F);
                              this.chestLid = new ModelRenderer(this, 0, 0);
                              this.chestLid.setRotationPoint(1.0F, 7.0F, 15.0F);
                              this.chestLid.addBox(0.0F, -5.0F, -14.0F, 14, 5, 14, 0.0F);
                          }
                      
                          public void renderAll()
                          {
                              this.chestKnob.rotateAngleX = this.chestLid.rotateAngleX;
                              this.chestLid.render(0.0625F);
                              this.chestKnob.render(0.0625F);
                              this.chestBelow.render(0.0625F);
                          }
                      
                      }
                      
                      
                      1 réponse Dernière réponse Répondre Citer 0
                      • plopP Hors-ligne
                        plop
                        dernière édition par plop

                        Pour la rotation moi j’ai ça par exemple pour un block à moi:

                        {
                        	"variants": {
                                "facing=east,half=bottom,shape=straight,hside=left,sneak=false":  { "model": "cubeplus:block/acacia_planks_stairs_4steps" },
                                "facing=west,half=bottom,shape=straight,hside=left,sneak=false":  { "model": "cubeplus:block/acacia_planks_stairs_4steps", "y": 180, "uvlock": true },
                                "facing=south,half=bottom,shape=straight,hside=left,sneak=false": { "model": "cubeplus:block/acacia_planks_stairs_4steps", "y": 90, "uvlock": true },
                                "facing=north,half=bottom,shape=straight,hside=left,sneak=false": { "model": "cubeplus:block/acacia_planks_stairs_4steps", "y": 270, "uvlock": true },
                        

                        Du coup pour toi ça devrais donner un truc du genre:

                        {
                            "variants": {
                                "normal": { "model": "crown:kingonium_block" }
                                "facing=east": { "model": "crown:copper_chest" },
                                "facing=west": { "model": "crown:copper_chest", "y": 180, "uvlock": true },
                                "facing=north": { "model": "crown:copper_chest", "y": 270, "uvlock": true },
                                "facing=south": { "model": "crown:copper_chest", "y": 90, "uvlock": true }
                            }
                        

                        A supposer que le facing=east sois la position de base 😛 !

                        1 réponse Dernière réponse Répondre Citer 0
                        • N Hors-ligne
                          Nokiyx
                          dernière édition par Nokiyx

                          Maintenant j’ai cette erreur je pense que le chest je vais le supprimer si sa continue

                          FML]: Exception loading model for variant crown:copper_chest#normal for blockstate "crown:copper_chest"
                          net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model crown:copper_chest#normal with loader VariantLoader.INSTANCE, skipping
                          	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:161) ~[ModelLoaderRegistry.class:?]
                          	at net.minecraftforge.client.model.ModelLoader.registerVariant(ModelLoader.java:235) ~[ModelLoader.class:?]
                          	at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:153) ~[ModelBakery.class:?]
                          	at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:223) ~[ModelLoader.class:?]
                          	at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:150) ~[ModelLoader.class:?]
                          	at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
                          	at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:121) [SimpleReloadableResourceManager.class:?]
                          	at net.minecraft.client.Minecraft.init(Minecraft.java:560) [Minecraft.class:?]
                          	at net.minecraft.client.Minecraft.run(Minecraft.java:422) [Minecraft.class:?]
                          	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
                          	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_231]
                          	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_231]
                          	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_231]
                          	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_231]
                          	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
                          	at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
                          	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_231]
                          	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_231]
                          	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_231]
                          	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_231]
                          	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
                          	at GradleStart.main(GradleStart.java:25) [start/:?]
                          Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException
                          	at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:83) ~[ModelBlockDefinition.class:?]
                          	at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1175) ~[ModelLoader$VariantLoader.class:?]
                          	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:157) ~[ModelLoaderRegistry.class:?]
                          	... 21 more
                          [18:08:01] [Client thread/ERROR] [FML]: Exception loading blockstate for the variant crown:copper_chest#normal: 
                          java.lang.Exception: Could not load model definition for variant crown:copper_chest
                          	at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:269) ~[ModelLoader.class:?]
                          	at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:121) ~[ModelBakery.class:?]
                          	at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:223) ~[ModelLoader.class:?]
                          	at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:150) ~[ModelLoader.class:?]
                          	at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
                          	at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:121) [SimpleReloadableResourceManager.class:?]
                          	at net.minecraft.client.Minecraft.init(Minecraft.java:560) [Minecraft.class:?]
                          	at net.minecraft.client.Minecraft.run(Minecraft.java:422) [Minecraft.class:?]
                          	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
                          	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_231]
                          	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_231]
                          	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_231]
                          	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_231]
                          	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
                          	at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
                          	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_231]
                          	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_231]
                          	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_231]
                          	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_231]
                          	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
                          	at GradleStart.main(GradleStart.java:25) [start/:?]
                          Caused by: java.lang.RuntimeException: Encountered an exception when loading model definition of 'crown:copper_chest' from: 'crown:blockstates/copper_chest.json' in resourcepack: 'FMLFileResourcePack:Crown Mod'
                          	at net.minecraft.client.renderer.block.model.ModelBakery.loadModelBlockDefinition(ModelBakery.java:246) ~[ModelBakery.class:?]
                          	at net.minecraft.client.renderer.block.model.ModelBakery.loadMultipartMBD(ModelBakery.java:223) ~[ModelBakery.class:?]
                          	at net.minecraft.client.renderer.block.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:208) ~[ModelBakery.class:?]
                          	at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:265) ~[ModelLoader.class:?]
                          	... 20 more
                          Caused by: com.google.gson.JsonSyntaxException: java.io.EOFException: End of input at line 7 column 6 path $.null
                          	at com.google.gson.Gson.fromJson(Gson.java:897) ~[Gson.class:?]
                          	at com.google.gson.Gson.fromJson(Gson.java:852) ~[Gson.class:?]
                          	at com.google.gson.Gson.fromJson(Gson.java:801) ~[Gson.class:?]
                          	at com.google.gson.Gson.fromJson(Gson.java:773) ~[Gson.class:?]
                          	at net.minecraftforge.client.model.BlockStateLoader.load(BlockStateLoader.java:80) ~[BlockStateLoader.class:?]
                          	at net.minecraft.client.renderer.block.model.ModelBlockDefinition.parseFromReader(ModelBlockDefinition.java:42) ~[ModelBlockDefinition.class:?]
                          	at net.minecraft.client.renderer.block.model.ModelBakery.loadModelBlockDefinition(ModelBakery.java:242) ~[ModelBakery.class:?]
                          	at net.minecraft.client.renderer.block.model.ModelBakery.loadMultipartMBD(ModelBakery.java:223) ~[ModelBakery.class:?]
                          	at net.minecraft.client.renderer.block.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:208) ~[ModelBakery.class:?]
                          	at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:265) ~[ModelLoader.class:?]
                          	... 20 more
                          Caused by: java.io.EOFException: End of input at line 7 column 6 path $.null
                          	at com.google.gson.stream.JsonReader.nextNonWhitespace(JsonReader.java:1393) ~[JsonReader.class:?]
                          	at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:482) ~[JsonReader.class:?]
                          	at com.google.gson.stream.JsonReader.hasNext(JsonReader.java:414) ~[JsonReader.class:?]
                          	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:214) ~[ReflectiveTypeAdapterFactory$Adapter.class:?]
                          	at com.google.gson.Gson.fromJson(Gson.java:887) ~[Gson.class:?]
                          	at com.google.gson.Gson.fromJson(Gson.java:852) ~[Gson.class:?]
                          	at com.google.gson.Gson.fromJson(Gson.java:801) ~[Gson.class:?]
                          	at com.google.gson.Gson.fromJson(Gson.java:773) ~[Gson.class:?]
                          	at net.minecraftforge.client.model.BlockStateLoader.load(BlockStateLoader.java:80) ~[BlockStateLoader.class:?]
                          	at net.minecraft.client.renderer.block.model.ModelBlockDefinition.parseFromReader(ModelBlockDefinition.java:42) ~[ModelBlockDefinition.class:?]
                          	at net.minecraft.client.renderer.block.model.ModelBakery.loadModelBlockDefinition(ModelBakery.java:242) ~[ModelBakery.class:?]
                          	at net.minecraft.client.renderer.block.model.ModelBakery.loadMultipartMBD(ModelBakery.java:223) ~[ModelBakery.class:?]
                          	at net.minecraft.client.renderer.block.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:208) ~[ModelBakery.class:?]
                          	at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:265) ~[ModelLoader.class:?]
                          	... 20 more
                          
                          1 réponse Dernière réponse Répondre Citer 0
                          • robin4002R Hors-ligne
                            robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                            dernière édition par

                            Tu peux envoyer le contenu de assets/crown/blockstates/copper_chest.json ?
                            Le contenu json semble invalide.

                            1 réponse Dernière réponse Répondre Citer 0
                            • N Hors-ligne
                              Nokiyx
                              dernière édition par

                              Tien 😃

                              {
                                  "variants": {
                                      "normal": { "model": "crown:copper_chest" }
                                      "facing=east": { "model": "crown:copper_chest" },
                                      "facing=west": { "model": "crown:copper_chest", "y": 180, "uvlock": true },
                                      "facing=north": { "model": "crown:copper_chest", "y": 270, "uvlock": true },
                                      "facing=south": { "model": "crown:copper_chest", "y": 90, "uvlock": true }
                                  }
                              
                              1 réponse Dernière réponse Répondre Citer 0
                              • robin4002R Hors-ligne
                                robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                                dernière édition par robin4002

                                Il manque une dernière accolade de fermeture (tout à la fin) et une virgule à la fin de la ligne 3

                                1 réponse Dernière réponse Répondre Citer 0
                                • N Hors-ligne
                                  Nokiyx
                                  dernière édition par

                                  {
                                      "variants": {
                                          "normal": { "model": "crown:copper_chest" },
                                          "facing=east": { "model": "crown:copper_chest" },
                                          "facing=west": { "model": "crown:copper_chest", "y": 180, "uvlock": true },
                                          "facing=north": { "model": "crown:copper_chest", "y": 270, "uvlock": true },
                                          "facing=south": { "model": "crown:copper_chest", "y": 90, "uvlock": true }
                                      }
                                  }
                                  

                                  Comme ça ?

                                  1 réponse Dernière réponse Répondre Citer 0
                                  • N Hors-ligne
                                    Nokiyx
                                    dernière édition par

                                    Alors j’ai essayer mais quand je met j’ai ça et le bloc na plus de texture

                                    net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model crown:copper_chest#normal with loader VariantLoader.INSTANCE, skipping
                                    	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:161) ~[ModelLoaderRegistry.class:?]
                                    	at net.minecraftforge.client.model.ModelLoader.registerVariant(ModelLoader.java:235) ~[ModelLoader.class:?]
                                    	at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:153) ~[ModelBakery.class:?]
                                    	at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:223) ~[ModelLoader.class:?]
                                    	at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:150) ~[ModelLoader.class:?]
                                    	at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
                                    	at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:121) [SimpleReloadableResourceManager.class:?]
                                    	at net.minecraft.client.Minecraft.init(Minecraft.java:560) [Minecraft.class:?]
                                    	at net.minecraft.client.Minecraft.run(Minecraft.java:422) [Minecraft.class:?]
                                    	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
                                    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_241]
                                    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_241]
                                    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_241]
                                    	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_241]
                                    	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
                                    	at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
                                    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_241]
                                    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_241]
                                    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_241]
                                    	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_241]
                                    	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
                                    	at GradleStart.main(GradleStart.java:25) [start/:?]
                                    Caused by: net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model crown:block/copper_chest with loader VanillaLoader.INSTANCE, skipping
                                    	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:161) ~[ModelLoaderRegistry.class:?]
                                    	at net.minecraftforge.client.model.ModelLoader$WeightedRandomModel.<init>(ModelLoader.java:658) ~[ModelLoader$WeightedRandomModel.class:?]
                                    	at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1176) ~[ModelLoader$VariantLoader.class:?]
                                    	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:157) ~[ModelLoaderRegistry.class:?]
                                    	... 21 more
                                    Caused by: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Expected name at line 5 column 6 path $.textures.texture
                                    	at com.google.gson.internal.Streams.parse(Streams.java:60) ~[Streams.class:?]
                                    	at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:65) ~[TreeTypeAdapter.class:?]
                                    	at net.minecraft.util.JsonUtils.gsonDeserialize(JsonUtils.java:435) ~[JsonUtils.class:?]
                                    	at net.minecraft.client.renderer.block.model.ModelBlock.deserialize(ModelBlock.java:51) ~[ModelBlock.class:?]
                                    	at net.minecraft.client.renderer.block.model.ModelBakery.loadModel(ModelBakery.java:338) ~[ModelBakery.class:?]
                                    	at net.minecraftforge.client.model.ModelLoader.access$1400(ModelLoader.java:115) ~[ModelLoader.class:?]
                                    	at net.minecraftforge.client.model.ModelLoader$VanillaLoader.loadModel(ModelLoader.java:861) ~[ModelLoader$VanillaLoader.class:?]
                                    	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:157) ~[ModelLoaderRegistry.class:?]
                                    	at net.minecraftforge.client.model.ModelLoader$WeightedRandomModel.<init>(ModelLoader.java:658) ~[ModelLoader$WeightedRandomModel.class:?]
                                    	at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1176) ~[ModelLoader$VariantLoader.class:?]
                                    	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:157) ~[ModelLoaderRegistry.class:?]
                                    	... 21 more
                                    Caused by: com.google.gson.stream.MalformedJsonException: Expected name at line 5 column 6 path $.textures.texture
                                    	at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1559) ~[JsonReader.class:?]
                                    	at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:505) ~[JsonReader.class:?]
                                    	at com.google.gson.stream.JsonReader.hasNext(JsonReader.java:414) ~[JsonReader.class:?]
                                    	at com.google.gson.internal.bind.TypeAdapters$29.read(TypeAdapters.java:738) ~[TypeAdapters$29.class:?]
                                    	at com.google.gson.internal.bind.TypeAdapters$29.read(TypeAdapters.java:739) ~[TypeAdapters$29.class:?]
                                    	at com.google.gson.internal.bind.TypeAdapters$29.read(TypeAdapters.java:714) ~[TypeAdapters$29.class:?]
                                    	at com.google.gson.internal.Streams.parse(Streams.java:48) ~[Streams.class:?]
                                    	at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:65) ~[TreeTypeAdapter.class:?]
                                    	at net.minecraft.util.JsonUtils.gsonDeserialize(JsonUtils.java:435) ~[JsonUtils.class:?]
                                    	at net.minecraft.client.renderer.block.model.ModelBlock.deserialize(ModelBlock.java:51) ~[ModelBlock.class:?]
                                    	at net.minecraft.client.renderer.block.model.ModelBakery.loadModel(ModelBakery.java:338) ~[ModelBakery.class:?]
                                    	at net.minecraftforge.client.model.ModelLoader.access$1400(ModelLoader.java:115) ~[ModelLoader.class:?]
                                    	at net.minecraftforge.client.model.ModelLoader$VanillaLoader.loadModel(ModelLoader.java:861) ~[ModelLoader$VanillaLoader.class:?]
                                    	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:157) ~[ModelLoaderRegistry.class:?]
                                    	at net.minecraftforge.client.model.ModelLoader$WeightedRandomModel.<init>(ModelLoader.java:658) ~[ModelLoader$WeightedRandomModel.class:?]
                                    	at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1176) ~[ModelLoader$VariantLoader.class:?]
                                    	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:157) ~[ModelLoaderRegistry.class:?]
                                    	... 21 more
                                    
                                    1 réponse Dernière réponse Répondre Citer 0
                                    • robin4002R Hors-ligne
                                      robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                                      dernière édition par

                                      Ce que tu as envoyé est bien valide (tu peux vérifier ici : https://jsonlint.com/ )
                                      par contre les logs indique toujours que ce n’est pas le cas. Vérifies que le fichier est bien modifié et sauvegardé.

                                      1 réponse Dernière réponse Répondre Citer 0
                                      • N Hors-ligne
                                        Nokiyx
                                        dernière édition par

                                        Il est modifié et sauvegarde mais je n’arrive plus a y comprendre

                                        1 réponse Dernière réponse Répondre Citer 0
                                        • N Hors-ligne
                                          Nokiyx
                                          dernière édition par

                                          Ce message a été supprimé !
                                          1 réponse Dernière réponse Répondre Citer 0
                                          • N Hors-ligne
                                            Nokiyx
                                            dernière édition par

                                            Alors mon bloc ne tourne toujours pas j’ai corriger mon model qui été défectueux et toujours aucun rotation

                                            1 réponse Dernière réponse Répondre Citer 0
                                            • 1
                                            • 2
                                            • 2 / 2
                                            • Premier message
                                              Dernier message
                                            Design by Woryk
                                            ContactMentions Légales

                                            MINECRAFT FORGE FRANCE © 2024

                                            Powered by NodeBB