Jump to content

LostCoder

Members
  • Posts

    5
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

LostCoder's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Add a sentinel for Item constructor which will prevent item from been registered into Item.itemsList, but still create an instance of an Item. It will be very helpful in creating metadata based items. Like: [spoiler=Item constructor]public Item(int par1) { this.itemID = 256 + par1; if (this.itemID < 0 || this.itemID >= itemsList.length) return; if (itemsList[256 + par1] != null) { System.out.println("CONFLICT @ " + par1 + " item slot already occupied by " + itemsList[256 + par1] + " while adding " + this); } itemsList[256 + par1] = this; GameData.newItemAdded(this); } [spoiler=MetaItem example]public class MetaItem extends Item { // int metadata ->Item item public Set<Integer,Item> metaItems = new HashSet<Integer,Item>(); public MetaItem(int itemID) { super(itemID); setNoRepair(); setMaxDamage(0); setHasSubTypes(true); } public void put(int metadata, Item item) { item.setNoRepair(); item.setMaxDamage(0); item.setHasSubTypes(true); metaItems.put(metadata, item); } // do hooks to desired functions, like this: @Override @SideOnly(Side.CLIENT) public void registerIcons(IconRegister iconRegister) { for (Item i : metaItems.values()) { i.icon = iconRegister.registerIcon(i.iconName); } } @Override public Icon getIconFromDamage(int metadata) { Item i = metaItems.get(metadata); return (i != null) ? i.icon : null; } // ... } [spoiler=MetaItem usage example] public static final int METAID = -257 MetaItem mi = new MetaItem(metaItemID); mi.metaItems.put(0, new ItemGeneric(METAID, ...)); mi.metaItems.put(20, new ItemFood(METAID, ...)); // own subclass from ItemFood mi.metaItems.put(40, new ItemArmor(METAID, ...)); // own subclass from ItemArmor, possibly will work only for non damageable armor, e.g. damage handling need to be moved to nbt by mod developer mi.metaItems.put(60, new ItemTool(METAID, ...)); // own subclass from ItemTool, possibly will work only for non damageable tools, e.g. damage handling need to be moved to nbt by mod developer mi.metaItems.put(100, new ItemDust(METAID, ...)); mi.metaItems.put(200, new ItemIngot(METAID , ...)); mi.metaItems.put(300, new ItemPlate(METAID, ...));
  2. You may do a workaround with render passes, like this: @Override @SideOnly(Side.CLIENT) public boolean requiresMultipleRenderPasses() { return true; } @Override public int getRenderPasses(int metadata) { return 1; } @Override public Icon getIcon(ItemStack stack, int pass) { return ...; }
  3. Hello everyone. Sorry for my English. I have found this bug while coding chunk loading addon for IC2. It happens when removing addon and there is chunk loader blocks left in the world. Steps I used to reproduce bug: 1. Install Forge, IC2, own addon; 2. Start game and create a blank superflat world; 3. Place chunk loader blank in the world; 4. Save and exit game; 5. Removed own addon; 6. Start game and tried to load world; 7. Game stuck on "World Loading" screen; It happens only when I use requestPlayerTicket(), but when replace it with requestTicket() and try the same steps world successfully loading and chunk loader block disappearing. [spoiler=ForgeModLoader-0.log] ... 2013-02-04 18:14:42 [iNFO] [ForgeModLoader] Forge Mod Loader has successfully loaded 4 mods 2013-02-04 18:15:24 [FINER] [ForgeModLoader] Sending event FMLServerAboutToStartEvent to mod mcp 2013-02-04 18:15:24 [FINER] [ForgeModLoader] Sent event FMLServerAboutToStartEvent to mod mcp 2013-02-04 18:15:24 [FINER] [ForgeModLoader] Sending event FMLServerAboutToStartEvent to mod FML 2013-02-04 18:15:24 [FINER] [ForgeModLoader] Sent event FMLServerAboutToStartEvent to mod FML 2013-02-04 18:15:24 [FINER] [ForgeModLoader] Sending event FMLServerAboutToStartEvent to mod Forge 2013-02-04 18:15:24 [FINER] [ForgeModLoader] Sent event FMLServerAboutToStartEvent to mod Forge 2013-02-04 18:15:24 [FINER] [ForgeModLoader] Sending event FMLServerAboutToStartEvent to mod IC2 2013-02-04 18:15:24 [FINER] [ForgeModLoader] Sent event FMLServerAboutToStartEvent to mod IC2 2013-02-04 18:15:24 [sEVERE] [ForgeModLoader] This world was saved with mod NetworkAnchor which appears to be missing, things may not work well 2013-02-04 18:15:24 [FINE] [ForgeModLoader] The difference set is not equal: only on left={777=Item 777, Type lostcoder.ic2.networkanchor.BlockNetworkAnchor, owned by NetworkAnchor, ordinal 0, name BlockNetworkAnchor, claimedModId null} 2013-02-04 18:15:24 [sEVERE] [ForgeModLoader] FML has detected item discrepancies 2013-02-04 18:15:24 [sEVERE] [ForgeModLoader] Missing items : {777=Item 777, Type lostcoder.ic2.networkanchor.BlockNetworkAnchor, owned by NetworkAnchor, ordinal 0, name BlockNetworkAnchor, claimedModId null} 2013-02-04 18:15:24 [sEVERE] [ForgeModLoader] Mismatched items : {} 2013-02-04 18:15:29 [iNFO] [ForgeModLoader] Loading dimension 0 (Test World) (bdz@65adfb84) 2013-02-04 18:15:29 [iNFO] [ForgeModLoader] Loading dimension 1 (Test World) (bdz@65adfb84) 2013-02-04 18:15:29 [iNFO] [ForgeModLoader] Loading dimension -1 (Test World) (bdz@65adfb84) 2013-02-04 18:15:29 [iNFO] [sTDERR] java.lang.NullPointerException 2013-02-04 18:15:29 [iNFO] [sTDERR] at net.minecraftforge.common.ForgeChunkManager.loadWorld(ForgeChunkManager.java:527) 2013-02-04 18:15:29 [iNFO] [sTDERR] at net.minecraftforge.common.ForgeInternalHandler.onDimensionLoad(ForgeInternalHandler.java:71) 2013-02-04 18:15:29 [iNFO] [sTDERR] at net.minecraftforge.event.ASMEventHandler_2_ForgeInternalHandler_onDimensionLoad_Load.invoke(.dynamic) 2013-02-04 18:15:29 [iNFO] [sTDERR] at net.minecraftforge.event.ASMEventHandler.invoke(ASMEventHandler.java:35) 2013-02-04 18:15:29 [iNFO] [sTDERR] at net.minecraftforge.event.EventBus.post(EventBus.java:103) 2013-02-04 18:15:29 [iNFO] [sTDERR] at bdz.a(IntegratedServer.java:79) 2013-02-04 18:15:29 [iNFO] [sTDERR] at bdz.c(IntegratedServer.java:101) 2013-02-04 18:15:29 [iNFO] [sTDERR] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:458) 2013-02-04 18:15:29 [iNFO] [sTDERR] at fy.run(SourceFile:849) 2013-02-04 18:15:29 [iNFO] [ForgeModLoader] Unloading dimension 0 2013-02-04 18:15:29 [iNFO] [ForgeModLoader] Unloading dimension -1 2013-02-04 18:15:29 [iNFO] [ForgeModLoader] Unloading dimension 1 2013-02-04 18:15:29 [FINER] [ForgeModLoader] Sending event FMLServerStoppedEvent to mod mcp 2013-02-04 18:15:29 [FINER] [ForgeModLoader] Sent event FMLServerStoppedEvent to mod mcp 2013-02-04 18:15:29 [FINER] [ForgeModLoader] Sending event FMLServerStoppedEvent to mod FML 2013-02-04 18:15:29 [FINER] [ForgeModLoader] Sent event FMLServerStoppedEvent to mod FML 2013-02-04 18:15:29 [FINER] [ForgeModLoader] Sending event FMLServerStoppedEvent to mod Forge 2013-02-04 18:15:29 [FINER] [ForgeModLoader] Sent event FMLServerStoppedEvent to mod Forge 2013-02-04 18:15:29 [FINER] [ForgeModLoader] Sending event FMLServerStoppedEvent to mod IC2 2013-02-04 18:15:29 [FINER] [ForgeModLoader] Sent event FMLServerStoppedEvent to mod IC2 2013-02-04 18:15:29 [sEVERE] [ForgeModLoader] Fatal errors were detected during the transition from SERVER_ABOUT_TO_START to SERVER_STOPPED. Loading cannot continue 2013-02-04 18:15:29 [sEVERE] [ForgeModLoader] mcp [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available FML [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available Forge [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available IC2 [industrialCraft 2] (industrialcraft-2_1.115.207-lf.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available 2013-02-04 18:15:29 [sEVERE] [ForgeModLoader] The following problems were captured during this phase 2013-02-04 18:15:29 [iNFO] [sTDERR] Exception in thread "Server thread" cpw.mods.fml.common.LoaderException 2013-02-04 18:15:29 [iNFO] [sTDERR] at cpw.mods.fml.common.LoadController.transition(LoadController.java:117) 2013-02-04 18:15:29 [iNFO] [sTDERR] at cpw.mods.fml.common.Loader.serverStopped(Loader.java:761) 2013-02-04 18:15:29 [iNFO] [sTDERR] at cpw.mods.fml.common.FMLCommonHandler.handleServerStopped(FMLCommonHandler.java:464) 2013-02-04 18:15:29 [iNFO] [sTDERR] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:559) 2013-02-04 18:15:29 [iNFO] [sTDERR] at fy.run(SourceFile:849)
×
×
  • Create New...

Important Information

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