Jump to content

winnetrie

Members
  • Posts

    408
  • Joined

  • Last visited

Everything posted by winnetrie

  1. I doesn't matter how you call your methods, just give it logical names or whatever you like. Also you don't need to this public void preInit(FMLPreInitializationEvent e) again in your proxies. That's already done in your main file. Yes i haven't made a creative tab, but that has nothing to do with it. I use the command to get the item, it only has no texture. If i render it directly in the main file, wich should never be done ofc i know, it works. So i'm wondering why it has no texture when i call the proxy? EDITOmg .....i just found the problem......this is such a stupid mistake...really The problem is at this line: @SidedProxy(serverSide = References.CLIENT_PROXY_CLASS, clientSide = References.SERVER_PROXY_CLASS) public static CommonProxy proxy; I'm searching the problem the whole day....
  2. alright here is the reference class: public class References { public static final String MOD_ID = "tem"; public static final String NAME = "Tim's Expansion Mod"; public static final String VERSION = "1.0.0"; public static final String ACCEPTED_VERSIONS = "[1.10]"; public static final String CLIENT_PROXY_CLASS = "winnetrie.tem.proxy.ClientProxy"; public static final String SERVER_PROXY_CLASS = "winnetrie.tem.proxy.ServerProxy"; public static enum temItems { CHEESE("cheese", "cheese"); private String unlocalizedName; private String registryName; temItems(String unlocalizedName, String registryName){ this.unlocalizedName = unlocalizedName; this.registryName = registryName; } public String getUnlocalizedName(){ return unlocalizedName; } public String getRegistryName(){ return registryName; } } }
  3. Well then i apologize for being rude and hijacking, wich was not my intention after all. Still i think you could have said/asked this nice without giving a warning. I'm trying to be nice to other people and i expect the same from others too. But i apologized now, let's get over this now and stick to the real problem. the ModItems class: public class ModItems { public static Item cheese; public static void init(){ cheese = new ItemCheese(); } public static void register(){ GameRegistry.register(cheese); } public static void registerRenders(){ registerRender(cheese); } private static void registerRender(Item item){ ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(),"inventory")); //Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(item.getRegistryName(),"inventory")); } } By testing i mean this: public class ClientProxy implements CommonProxy{ @Override public void init() { ModItems.registerRenders(); System.out.println("renders have been registered"); } } i don't see that message so i guess the method init is not working/ being called! But and just for testing purpose, i moved ModItems.registerRenders(); over to the main class in the preInit to see if the problem is something else. This however does work like it should. So that means something is not right with the proxies, at least i think that is. I did a tutorial from MrCrayFish on youtube, because he explains all the things too so people understands it and it isn't just copy paste. I did exactly what he did (i think) and it works for him but not for me. I did a small change with the ModelLoader,but even when i use the old way it doesn't work. I watched the tutorial over and over again to see what i missed or did wrong, but i can't see the problem. Here is the tutorial if you want to see for yourself:
  4. Since the Moderator Diesieben gave me a warning: I think that's a bit rude because i didn't wanted to make a double thread. There are forums that give you a warning for that! So i started my own thread even when it's the same problem! So to start: I have everything set up fine for an item but when i start the game my item has no texture. The console doesn't show any error. I figured already out that there is something wrong with my proxy. Somehow the method in the proxy is not being called even when i do call it. Client proxy: public class ClientProxy implements CommonProxy{ @Override public void init() { ModItems.registerRenders(); System.out.println("renders have been registered"); } } my main class:
  5. So i tested something else. I did call the rendering right in the main class just to test it, i know it should not be done! That seems to work. So that means everything is good and something is wrong with the proxy. I really don't know why i do call it but it doesn't fire for some reason
  6. Am i not doing that here?: the proxy.init() ?
  7. I checked something and it appears that this is never been called: public class ClientProxy implements CommonProxy{ @Override public void init() { ModItems.registerRenders(); System.out.println("renders have been registered"); } } I added the System.out.println("renders have been registered"); to check, but i can't see the message. So i guess it isn't called but why? Also if i name the method init or preInit or whatever name you can imagine, it's just a name. Does it really matter how i name it? Like i said before i watch the tutorial video (wich is a working example) and checked every step again and again.
  8. I'm really confused now. I don't understand what you mean! Maybe take a look at this tutorial: I did exactly like this and it works for him, why not for me?
  9. i changed it, but still no textures and no error: @Mod (modid = References.MOD_ID, name = References.NAME, version = References.VERSION, acceptedMinecraftVersions = References.ACCEPTED_VERSIONS) public class Tem { @SidedProxy(serverSide= References.CLIENT_PROXY_CLASS, clientSide = References.SERVER_PROXY_CLASS) public static CommonProxy proxy; @Instance public static Tem instance; @EventHandler public void preInit (FMLPreInitializationEvent event) { proxy.init(); ModItems.init(); ModItems.register(); } @EventHandler public void init (FMLInitializationEvent event){ } @EventHandler public void postInit(FMLPostInitializationEvent event){ } } I also did it exactly as in the tutorial. In the tutorial they do it in the Init and not preInit
  10. i have a ClientProxy.class: public class ClientProxy implements CommonProxy{ @Override public void init() { ModItems.registerRenders(); }
  11. I watched a video tutorial where the person use capital letters in his resources. The example worked fine. But hey i tried it out and changed everything lower case and guess what? No errors and still no textures. I also saw a little mistake done by me. I did put proxy.init(); in the postinit instead of the init method. That didn't fixed it either, so must be something else...
  12. I have the same problem : No texture and no error for my item: the main class: the references class: the ModItems class: the ItemCheese class: the item model ItemCheese.json: and the texture is called ItemCheese.png
  13. I "fixed" it by making my own enchanting table that does the same as the vanilla 1 with only 1 difference: i let it check instanceof BlockBookshelf. I also removed the enchanting table from the crafting recipes and created a new recipe for my enchanting table.
  14. well, it does do something for sure, but not the thing i want. Let's say it doesn't work then. So i ran a small test to know why that doesn't work. So when i do it like this: public class TemExtraBOPDrops { @SubscribeEvent public void TemBOPloot(BreakEvent event) { //System.out.println("event has occured"); Block block = event.block; World world = event.world; int x = event.x; int y = event.y; int z = event.z; if (block==BOPCBlocks.leaves3 ){ //int meta = block.getDamageValue(world, x, y, z); int meta = world.getBlockMetadata(x, y, z); System.out.println(meta); if (meta ==1 || meta ==3){ int random = randomWithRange(0,10); if (random == 1){ ItemStack stack = new ItemStack(TemItems.cherry); EntityItem item = new EntityItem(world,x,y,z, stack); world.spawnEntityInWorld(item); } } } } public static int randomWithRange(int min, int max){ Random rand= new Random(); int randomNum = rand.nextInt((max-min)+1)+min; return randomNum; } } then depending wich of the 2 leaves i "break" the variable meta returns 11 or 9. (sometimes it returns 1 or 3 too, but very rare) Because i need to check if it's 1 or 3 , the if statement will never return true. I don't know why it returns 11 and 9, maybe my code is wrong or maybe i really need to use block.getDamageValue(world, x, y, z) And i'm pretty sure the metadata of those block are 1 and 3. You have more experience in this, so maybe you know why it is returning 11 and 9. EDIT:i'm completely confused now. I did the /give command to see what happens if i enter 9 or 11 as value. I found out that /give playername biomesoplenty:leaves3 10 9 give me the right leaves I also found out when replacing meta 9 with 1, 5, 9, 13, 17, 21, and so on gives the same block (they do not stack).
  15. Yeah you're right i should check the block first then meta. I tried world.getBlockMetadata before (that was my first idea too) but that doesn't do anything. That's why i looked into the breakevent class i and found the block.getDamageValue.
  16. Ok i made it work with the breakevent. It works fine now, but now i also want to check for a specific block. BOPCBlocks.leaves3 has 4 types and i only want to check for 1 and 3. How do i get them? I tried this: public class TemExtraBOPDrops { @SubscribeEvent public void TemBOPloot(BreakEvent event) { System.out.println("event has occured"); Block block = event.block; World world = event.world; int x = event.x; int y = event.y; int z = event.z; //int meta = world.getBlockMetadata(x, y, z); //if (meta ==1 || meta ==3){ //System.out.println("meta found"); if (block==BOPCBlocks.leaves3 ){ System.out.println("condition met"); int random = randomWithRange(0,10); if (random == 1){ ItemStack stack = new ItemStack(TemItems.cherry); EntityItem item = new EntityItem(world,x,y,z, stack); world.spawnEntityInWorld(item); } } //} } public static int randomWithRange(int min, int max){ Random rand= new Random(); int randomNum = rand.nextInt((max-min)+1)+min; return randomNum; } } nevermind, found it: @SubscribeEvent public void TemBOPloot(BreakEvent event) { System.out.println("event has occured"); Block block = event.block; World world = event.world; int x = event.x; int y = event.y; int z = event.z; int meta = block.getDamageValue(world, x, y, z); if (meta ==1 || meta ==3){ System.out.println("meta found"); if (block==BOPCBlocks.leaves3 ){ System.out.println("condition met"); int random = randomWithRange(0,10); if (random == 1){ ItemStack stack = new ItemStack(TemItems.cherry); EntityItem item = new EntityItem(world,x,y,z, stack); world.spawnEntityInWorld(item); } } } } public static int randomWithRange(int min, int max){ Random rand= new Random(); int randomNum = rand.nextInt((max-min)+1)+min; return randomNum; } } I looked into the breakevent class and found -block.getDamageValue(world, x, y, z)- I think my problem is now solved. The leaveblocks from bop do not have a harvestdropsevent, so instead i used the breakevent and this works. Thank you!
  17. Jup that's right, it's from the API. Ok i did a few more test with this: public class TemExtraBOPDrops { @SubscribeEvent public void TemBOPloot(HarvestDropsEvent event) { System.out.println("event has occured"); Block block = event.block; int random = randomWithRange(0,2); //if (block == Blocks.leaves){ if (block == BOPCBlocks.leaves3){ System.out.println("leaves!!"); if (random == 1){ event.drops.add(new ItemStack(TemItems.cherry)); } } } public static int randomWithRange(int min, int max){ Random rand= new Random(); int randomNum = rand.nextInt((max-min)+1)+min; return randomNum; } } Like it is now it doesn't work. whenever i break a block that is a biomesoplenty leaves block, the "event has occured" does not show up in the console. If i do break an other block it does shows up. So the event does work on whatever block as long as it isn't a leaves block from BOP. That's weird i think. Why would it not trigger that event on those leaveblocks? And because the harvestdropsevent does not occur on those leaveblocks the whole thing does nothing. When i switch it to Blocks.leaves ( just to test it) , everything works fine and i get the "leaves!!" message too in the console. So let's say i would not check the right leaves like diesieben07 mentioned (it could be, but it's not), then the event still triggers and should show me the message "event has occured". I really hope someone can help me with this. I do not understand why this isn't working. It should work, but it doesn't...... EDIT:I took a look into the BlockBOPLeaves.class and i saw it doesn't have a -harvestBlock- method. Not sure if this is causing the problem.
  18. Oh i see. You have any idea why it doesn't work with the harvestdropsevent?
  19. i tried this now: public class TemExtraBOPDrops { @SubscribeEvent public void TemBOPloot(BreakEvent event) { System.out.println("event has occured"); Block block = event.block; World world = event.world; int x = event.x; int y = event.y; int z = event.z; ItemStack stack = new ItemStack(TemItems.cherry); EntityItem item = new EntityItem(world,x,y,z, stack); if (block == BOPCBlocks.leaves3){ if (event.blockMetadata==1){ world.spawnEntityInWorld(item); } } //ItemStack stack = new ItemStack(block); //int random = randomWithRange(0,2); //if (stack.getItemDamage() == 1 || stack.getItemDamage() == 3 ){ //if (block ==BOPCBlocks.leaves3){ //System.out.println("De juiste bladeren!!"); //if (random == 1){ //event.drops.add(new ItemStack(TemItems.cherry)); //} //} } public static int randomWithRange(int min, int max){ Random rand= new Random(); int randomNum = rand.nextInt((max-min)+1)+min; return randomNum; } } This seems to work somehow a bit. The cherries do spawn but the spawnrate is randomly. I was expecting dropping it every time since i did not provide a spawnrate! weird...
  20. i have put a System.out.println("event has occured"); It seems the HarvestDropsEvent is not fired for the biomesoplenty leaves. Maybe i should use here breakevent
  21. i am pretty sure and i tried out all the others too, just in case.
  22. I'm trying to add cherries as drop to the cherry trees from Biomesoplenty. But it doesn't work and i don't know why. If i do this: public class TemExtraBOPDrops { @SubscribeEvent public void TemBOPloot(HarvestDropsEvent event) { Block block = event.block; int random = randomWithRange(0,2); if (block ==Blocks.leaves){ if (random == 1){ event.drops.add(new ItemStack(TemItems.cherry)); } } } public static int randomWithRange(int min, int max){ Random rand= new Random(); int randomNum = rand.nextInt((max-min)+1)+min; return randomNum; } } then the cherry drops. But when i change it to this: public class TemExtraBOPDrops { @SubscribeEvent public void TemBOPloot(HarvestDropsEvent event) { Block block = event.block; //ItemStack stack = new ItemStack(block); int random = randomWithRange(0,2); //if (stack.getItemDamage() == 1 || stack.getItemDamage() == 3 ){ if (block ==BOPCBlocks.leaves3){ if (random == 1){ event.drops.add(new ItemStack(TemItems.cherry)); } } } public static int randomWithRange(int min, int max){ Random rand= new Random(); int randomNum = rand.nextInt((max-min)+1)+min; return randomNum; } } then it doesn't drop.
  23. OK thank you very much
  24. Just tested it with buildcraft and it seems not to work. OreDictionary.registerOre("workbench", new ItemStack(TemBlocks.workbench_wood_oak)); OreDictionary.registerOre("workbench", new ItemStack(TemBlocks.workbench_wood_spruce)); OreDictionary.registerOre("workbench", new ItemStack(TemBlocks.workbench_wood_birch)); OreDictionary.registerOre("workbench", new ItemStack(TemBlocks.workbench_wood_jungle)); OreDictionary.registerOre("workbench", new ItemStack(TemBlocks.workbench_wood_acacia)); OreDictionary.registerOre("workbench", new ItemStack(TemBlocks.workbench_wood_darkoak));
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.