SHARE
TWEET

Proxyclient

0mega_z3ll Feb 19th, 2018 28 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package fr.omega_zell.minecraftplus;
  2.  
  3. import java.io.File;
  4.  
  5. import fr.omega_zell.minecraftplus.Block.Mpblocks;
  6. import net.minecraft.block.Block;
  7. import net.minecraft.client.Minecraft;
  8. import net.minecraft.client.renderer.ItemModelMesher;
  9. import net.minecraft.client.resources.model.ModelResourceLocation;
  10. import net.minecraft.item.Item;
  11.  
  12. public class ProxyClient extends ProxyCommon
  13. {
  14.     @Override
  15.     public void preInit(File configFile)
  16.     {
  17.  
  18.         super.preInit(configFile);
  19.  
  20.         System.out.println("pre init côté client");
  21.         Mpblocks.registerBlocksModels();
  22.     }
  23.  
  24.     @Override
  25.     public void init()
  26.     {
  27.  
  28.         super.init();
  29.  
  30.     }
  31.     @Override
  32.     public void registerItemTexture(Item item, int metadata, String name)
  33.     {
  34.         ItemModelMesher mesher = Minecraft.getMinecraft().getRenderItem().getItemModelMesher();
  35.         mesher.register(item, metadata, new ModelResourceLocation("minecraftplus:" + name, "inventory"));
  36.     }
  37.    
  38.     @Override
  39.     public void registerItemTexture(Item item, String name)
  40.     {
  41.         registerItemTexture(item, 0, name);
  42.     }
  43.    
  44.     @Override
  45.     public void registerBlockTexture(Block block, int metadata, String name)
  46.     {
  47.         registerItemTexture(Item.getItemFromBlock(block), metadata, name);
  48.     }
  49.    
  50.     @Override
  51.     public void registerBlockTexture(Block block, String name)
  52.     {
  53.         registerBlockTexture(block, 0, name);
  54.     }
  55. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top