Jump to content

pfgforge

Members
  • Posts

    21
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

pfgforge's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. The blocks I need this for are already tileentitites How can I then render them facing their direction with submodels for the different types? Or does the getActualState allow more than the 15 bits Edit: I'm stupid
  2. I have a custom block which has a facing direction and a type. A facing direction already uses up most of the metadata that a block can store, and I need to have at least more than 8 variants of a block along with its facing direction. How can I render by both its facing direction and its type without passing the metadata limit, or get more metadata I can have on my block? This block does have a tileentity associated with it, so if there is any way to move the block rotation rendering into the tileentity, that would work fine public static final PropertyDirection FACING = PropertyDirection.create("facing"); public static final PropertyInteger TYPE = PropertyInteger.create("type", 0, 31); @Override public int getMetaFromState(IBlockState state) { int i = 0; i = i | ((EnumFacing)state.getValue(FACING)).getIndex(); { i |= 8; } i = i | ((Integer)state.getValue(TYPE)) << 3; return i; } java.lang.ArrayIndexOutOfBoundsException: 24 { "forge_marker": 1, "defaults": { "some defaults...": 0 }, "variants": { "facing": { "north": { "y":0 }, "south": { "y":180 }, "west": { "y":270 }, "east": { "y":90 }, "up": { "x":270 }, "down": { "x":90 } }, "type": { 0: { "nothing changed here" }, 1: { "some submodels..." }, 2: { "some more submodels..." }, 3: { "even more submodels..." }, 4: { "lots of submodels..." } "I need more submodels than this": 0 } } }
  3. By post update I mean postinit You could do it in preInit if you wanted to. I don't think all oredict entries would be registered by preinit
  4. Tried in both OreRegisterEventhandler and in the main mod file. @Mod.EventBusSubscriber public class OreRegisterEventhandler { @SubscribeEvent public static void OreRegisterEvent(OreDictionary.OreRegisterEvent e) { String name = e.getName(); System.out.println("This doesn't get printed ever "+name); @Mod(modid = modname.MODID, version = modname.VERSION) @Mod.EventBusSubscriber public class modname { // init functions and stuff... @SubscribeEvent public static void OreRegisterEvent(OreDictionary.OreRegisterEvent e) { String name = e.getName(); System.out.println("This also doesn't get printed "+name); The problem now that I am looking at this class is that the method that registers vanilla is called as soon as a static{} gets called. So... should I loop over all the oredict entries postinit?
  5. Tried in both OreRegisterEventhandler and in the main mod file. @Mod.EventBusSubscriber public class OreRegisterEventhandler { @SubscribeEvent public static void OreRegisterEvent(OreDictionary.OreRegisterEvent e) { String name = e.getName(); System.out.println("This doesn't get printed ever "+name); @Mod(modid = modname.MODID, version = modname.VERSION) @Mod.EventBusSubscriber public class modname { // init functions and stuff... @SubscribeEvent public static void OreRegisterEvent(OreDictionary.OreRegisterEvent e) { String name = e.getName(); System.out.println("This also doesn't get printed "+name);
  6. I switched it to a static void, but it still doesn't work @EventHandler public void preInit(FMLPreInitializationEvent event){ System.out.println("This is printed, showing that the preinit is running"); MinecraftForge.EVENT_BUS.register(OreRegisterEventhandler.class); public class OreRegisterEventhandler { @SubscribeEvent public static void OreRegisterEvent(OreDictionary.OreRegisterEvent e) { String name = e.getName(); System.out.println("This never gets called, and is never printed. It should get called because forge registers some ores by default"+name);
  7. Sorry, pasted the code wrong. The subscribe event is over the method Did you re paste the code or just fix that one error? And also are you registering something into the ore dictionary after registering the event? I went back to my post to edit it and add the class part, but accidentally put the subscribe event before the class. My actual code never had that. I am trying to register something into the oredict when the event is called (it won't loop infinitely, I have it set up right), but the event doesn't get called yet The event is fired when something is registered to the OreDictionary it is not used to register something to the OreDictionary specifically. I know. Forge by default registers some ores, and when they are registered I want this method to be called so I can register my own based on them.
  8. Sorry, pasted the code wrong. The subscribe event is over the method Did you re paste the code or just fix that one error? And also are you registering something into the ore dictionary after registering the event? I went back to my post to edit it and add the class part, but accidentally put the subscribe event before the class. My actual code never had that. I am trying to register something into the oredict when the event is called (it won't loop infinitely, I have it set up right), but the event doesn't get called yet
  9. Sorry, pasted the code wrong. The subscribe event is over the method
  10. What are you trying to do? If you're trying to just draw pipes you can do it with the blockstates and vanilla model system. Look into vanilla fence code and blockstates to see how to do that/
  11. It never seems to get called Main mod file: @EventHandler public void preInit(FMLPreInitializationEvent event){ System.out.println("Preinit Was Called"); // Prints MinecraftForge.EVENT_BUS.register(new OreRegisterEventHandler()); } OreRegisterEventHandler: public class OreRegisterEventhandler { @SubscribeEvent public void OreRegisterEvent(OreDictionary.OreRegisterEvent e) { String name = e.getName(); System.out.println("An ore is being registered "+name); // Never prints } }
  12. OreRegisterEvent cannot be resolved to a type
  13. Still not fully sure how to handle the event. I @SubscribeEvent, but what's it called and what are it's arguments? @SubscribeEvent public void OreRegisterEvent(OreDictionary.OreRegisterEvent e) {
  14. I've been looking for a while, but I don't know how to subscribe to events
×
×
  • Create New...

Important Information

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