Move around some NBT related stuff
This commit is contained in:
parent
b04b88f4d4
commit
f8e79bbcba
13 changed files with 32 additions and 12 deletions
|
@ -7,10 +7,10 @@ import net.minecraft.util.StatCollector;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import com.pahimar.ee3.core.util.NBTHelper;
|
|
||||||
import com.pahimar.ee3.inventory.ContainerAlchemicalBag;
|
import com.pahimar.ee3.inventory.ContainerAlchemicalBag;
|
||||||
import com.pahimar.ee3.lib.Strings;
|
import com.pahimar.ee3.lib.Strings;
|
||||||
import com.pahimar.ee3.lib.Textures;
|
import com.pahimar.ee3.lib.Textures;
|
||||||
|
import com.pahimar.ee3.nbt.NBTHelper;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
|
@ -8,10 +8,10 @@ import net.minecraft.world.World;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import com.pahimar.ee3.core.util.NBTHelper;
|
|
||||||
import com.pahimar.ee3.inventory.ContainerPortableCrafting;
|
import com.pahimar.ee3.inventory.ContainerPortableCrafting;
|
||||||
import com.pahimar.ee3.lib.Strings;
|
import com.pahimar.ee3.lib.Strings;
|
||||||
import com.pahimar.ee3.lib.Textures;
|
import com.pahimar.ee3.lib.Textures;
|
||||||
|
import com.pahimar.ee3.nbt.NBTHelper;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
|
@ -6,9 +6,9 @@ import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import com.pahimar.ee3.core.util.NBTHelper;
|
|
||||||
import com.pahimar.ee3.lib.Strings;
|
import com.pahimar.ee3.lib.Strings;
|
||||||
import com.pahimar.ee3.lib.Textures;
|
import com.pahimar.ee3.lib.Textures;
|
||||||
|
import com.pahimar.ee3.nbt.NBTHelper;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
|
@ -5,8 +5,8 @@ import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
import com.pahimar.ee3.configuration.ConfigurationSettings;
|
import com.pahimar.ee3.configuration.ConfigurationSettings;
|
||||||
import com.pahimar.ee3.core.util.NBTHelper;
|
|
||||||
import com.pahimar.ee3.lib.Strings;
|
import com.pahimar.ee3.lib.Strings;
|
||||||
|
import com.pahimar.ee3.nbt.NBTHelper;
|
||||||
|
|
||||||
import cpw.mods.fml.common.ICraftingHandler;
|
import cpw.mods.fml.common.ICraftingHandler;
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,24 @@ import cpw.mods.fml.common.event.FMLInterModComms.IMCEvent;
|
||||||
|
|
||||||
public class InterModCommsHandler {
|
public class InterModCommsHandler {
|
||||||
|
|
||||||
|
// TODO Method to encode a given "crafting relationship" as NBT data
|
||||||
|
|
||||||
|
/*
|
||||||
|
* NBTTagCompound
|
||||||
|
* - NBTTagList (recipeOutput)
|
||||||
|
* - NBTTagList (recipeInputs)
|
||||||
|
* - NBTTagList (recipeInput-1)
|
||||||
|
* - NBTTagList (recipeInput-2)
|
||||||
|
* - ...
|
||||||
|
* - NBTTagList (recipeInput-n)
|
||||||
|
*
|
||||||
|
* Method to encode stacks as NBTTagLists should:
|
||||||
|
* - track the "type" of the stack
|
||||||
|
* - track the size of the stack
|
||||||
|
* - track type specific data of the stack
|
||||||
|
* - e.g. id/meta/NBTTagCompound for ItemStacks
|
||||||
|
*/
|
||||||
|
|
||||||
public static void processIMCMessages(IMCEvent event) {
|
public static void processIMCMessages(IMCEvent event) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,8 @@ import net.minecraftforge.event.entity.item.ItemTossEvent;
|
||||||
import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
|
import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
|
||||||
import net.minecraftforge.event.entity.player.PlayerDropsEvent;
|
import net.minecraftforge.event.entity.player.PlayerDropsEvent;
|
||||||
|
|
||||||
import com.pahimar.ee3.core.util.NBTHelper;
|
|
||||||
import com.pahimar.ee3.lib.Strings;
|
import com.pahimar.ee3.lib.Strings;
|
||||||
|
import com.pahimar.ee3.nbt.NBTHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Equivalent-Exchange-3
|
* Equivalent-Exchange-3
|
||||||
|
|
|
@ -6,8 +6,8 @@ import net.minecraft.inventory.Container;
|
||||||
import net.minecraft.inventory.Slot;
|
import net.minecraft.inventory.Slot;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
import com.pahimar.ee3.core.util.NBTHelper;
|
|
||||||
import com.pahimar.ee3.lib.Strings;
|
import com.pahimar.ee3.lib.Strings;
|
||||||
|
import com.pahimar.ee3.nbt.NBTHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Equivalent-Exchange-3
|
* Equivalent-Exchange-3
|
||||||
|
|
|
@ -6,8 +6,8 @@ import net.minecraft.inventory.ContainerWorkbench;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import com.pahimar.ee3.core.util.NBTHelper;
|
|
||||||
import com.pahimar.ee3.lib.Strings;
|
import com.pahimar.ee3.lib.Strings;
|
||||||
|
import com.pahimar.ee3.nbt.NBTHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Equivalent-Exchange-3
|
* Equivalent-Exchange-3
|
||||||
|
|
|
@ -5,8 +5,8 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||||
import net.minecraft.inventory.Container;
|
import net.minecraft.inventory.Container;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
import com.pahimar.ee3.core.util.NBTHelper;
|
|
||||||
import com.pahimar.ee3.lib.Strings;
|
import com.pahimar.ee3.lib.Strings;
|
||||||
|
import com.pahimar.ee3.nbt.NBTHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Equivalent-Exchange-3
|
* Equivalent-Exchange-3
|
||||||
|
|
|
@ -9,11 +9,11 @@ import net.minecraft.world.World;
|
||||||
|
|
||||||
import com.pahimar.ee3.EquivalentExchange3;
|
import com.pahimar.ee3.EquivalentExchange3;
|
||||||
import com.pahimar.ee3.core.util.ItemUtil;
|
import com.pahimar.ee3.core.util.ItemUtil;
|
||||||
import com.pahimar.ee3.core.util.NBTHelper;
|
|
||||||
import com.pahimar.ee3.lib.Colours;
|
import com.pahimar.ee3.lib.Colours;
|
||||||
import com.pahimar.ee3.lib.GuiIds;
|
import com.pahimar.ee3.lib.GuiIds;
|
||||||
import com.pahimar.ee3.lib.Reference;
|
import com.pahimar.ee3.lib.Reference;
|
||||||
import com.pahimar.ee3.lib.Strings;
|
import com.pahimar.ee3.lib.Strings;
|
||||||
|
import com.pahimar.ee3.nbt.NBTHelper;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
|
@ -7,10 +7,10 @@ import net.minecraft.world.World;
|
||||||
|
|
||||||
import com.pahimar.ee3.EquivalentExchange3;
|
import com.pahimar.ee3.EquivalentExchange3;
|
||||||
import com.pahimar.ee3.configuration.ConfigurationSettings;
|
import com.pahimar.ee3.configuration.ConfigurationSettings;
|
||||||
import com.pahimar.ee3.core.util.NBTHelper;
|
|
||||||
import com.pahimar.ee3.core.util.TransmutationHelper;
|
import com.pahimar.ee3.core.util.TransmutationHelper;
|
||||||
import com.pahimar.ee3.lib.GuiIds;
|
import com.pahimar.ee3.lib.GuiIds;
|
||||||
import com.pahimar.ee3.lib.Strings;
|
import com.pahimar.ee3.lib.Strings;
|
||||||
|
import com.pahimar.ee3.nbt.NBTHelper;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
|
@ -7,11 +7,11 @@ import net.minecraft.world.World;
|
||||||
|
|
||||||
import com.pahimar.ee3.EquivalentExchange3;
|
import com.pahimar.ee3.EquivalentExchange3;
|
||||||
import com.pahimar.ee3.configuration.ConfigurationSettings;
|
import com.pahimar.ee3.configuration.ConfigurationSettings;
|
||||||
import com.pahimar.ee3.core.util.NBTHelper;
|
|
||||||
import com.pahimar.ee3.core.util.TransmutationHelper;
|
import com.pahimar.ee3.core.util.TransmutationHelper;
|
||||||
import com.pahimar.ee3.lib.GuiIds;
|
import com.pahimar.ee3.lib.GuiIds;
|
||||||
import com.pahimar.ee3.lib.Sounds;
|
import com.pahimar.ee3.lib.Sounds;
|
||||||
import com.pahimar.ee3.lib.Strings;
|
import com.pahimar.ee3.lib.Strings;
|
||||||
|
import com.pahimar.ee3.nbt.NBTHelper;
|
||||||
import com.pahimar.ee3.network.PacketTypeHandler;
|
import com.pahimar.ee3.network.PacketTypeHandler;
|
||||||
import com.pahimar.ee3.network.packet.PacketSoundEvent;
|
import com.pahimar.ee3.network.packet.PacketSoundEvent;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package com.pahimar.ee3.core.util;
|
package com.pahimar.ee3.nbt;
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
@ -14,6 +14,8 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||||
*/
|
*/
|
||||||
public class NBTHelper {
|
public class NBTHelper {
|
||||||
|
|
||||||
|
// TODO Write a method to encode a given stack (ItemStack | OreStack | EnergyStack) as a NBTTagList
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the NBT Tag Compound for the given ItemStack if it is null
|
* Initializes the NBT Tag Compound for the given ItemStack if it is null
|
||||||
*
|
*
|
Loading…
Reference in a new issue