And fix itemblocks being removed, leaving behind a residual block. This
is a legitimate action - use the missing mapping event to let the mod tell us about it
This commit is contained in:
parent
0b8ff5890a
commit
d684a4e066
|
@ -52,7 +52,11 @@ public class FMLMissingMappingsEvent extends FMLEvent {
|
|||
/**
|
||||
* Remap this name to a new name (add a migration mapping)
|
||||
*/
|
||||
REMAP
|
||||
REMAP,
|
||||
/**
|
||||
* Allow a block to exist without itemblock anymore
|
||||
*/
|
||||
BLOCKONLY
|
||||
}
|
||||
public static class MissingMapping {
|
||||
public final GameRegistry.Type type;
|
||||
|
@ -138,6 +142,12 @@ public class FMLMissingMappingsEvent extends FMLEvent {
|
|||
this.target = target;
|
||||
}
|
||||
|
||||
public void skipItemBlock()
|
||||
{
|
||||
if (type != GameRegistry.Type.ITEM) throw new IllegalArgumentException("Cannot skip an item that is a block");
|
||||
if (GameData.getBlockRegistry().getRaw(id) == null) throw new IllegalArgumentException("Cannot skip an ItemBlock that doesn't have a Block");
|
||||
action = Action.BLOCKONLY;
|
||||
}
|
||||
// internal
|
||||
|
||||
public Action getAction()
|
||||
|
|
|
@ -632,6 +632,12 @@ public class GameData {
|
|||
remaps.put(newName, new Integer[] { currId, newId });
|
||||
}
|
||||
}
|
||||
else if (action == FMLMissingMappingsEvent.Action.BLOCKONLY)
|
||||
{
|
||||
// Pulled out specifically so the block doesn't get reassigned a new ID just because it's
|
||||
// Item block has gone away
|
||||
FMLLog.fine("The ItemBlock %s is no longer present in the game. The residual block will remain", remap.name);
|
||||
}
|
||||
else
|
||||
{
|
||||
// block item missing, warn as requested and block the id
|
||||
|
|
Loading…
Reference in New Issue