mirror of
https://github.com/GTNewHorizons/Postea.git
synced 2026-11-21 04:32:19 +00:00
Rename to lower case
This commit is contained in:
1 parent
7b885b8eda
commit
4d247eb701
11 files changed
+20
-20
No files matched your search
@@ -0,0 +1,32 @@
|
||||
package com.colen.postea.utility;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import com.colen.postea.api.ItemStackReplacementManager;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public abstract class ItemFixerUtility {
|
||||
|
||||
public static void fixItemStack(NBTTagCompound tag) {
|
||||
|
||||
if (tag.hasNoTags()) return;
|
||||
|
||||
if (tag.hasKey("id")) {
|
||||
short id = tag.getShort("id");
|
||||
Item item = Item.getItemById(id);
|
||||
String itemNameInternal = GameRegistry.findUniqueIdentifierFor(item).modId + ":"
|
||||
+ GameRegistry.findUniqueIdentifierFor(item).name;
|
||||
|
||||
Function<NBTTagCompound, NBTTagCompound> transformer = ItemStackReplacementManager
|
||||
.getItemReplacement(itemNameInternal);
|
||||
|
||||
if (transformer != null) {
|
||||
transformer.apply(tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user