mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-17 02:55:13 +00:00
Remove useless item Encyclopedia
This commit is contained in:
1 parent
ecbb1cb8e4
commit
f1fd19df99
7 files changed
+12
-87
No files matched your search
@@ -22,7 +22,6 @@ import binnie.botany.gardening.ItemSoilMeter;
|
||||
import binnie.botany.gardening.ItemTrowel;
|
||||
import binnie.botany.gardening.ModuleGardening;
|
||||
import binnie.botany.genetics.ItemDictionary;
|
||||
import binnie.botany.genetics.ItemEncyclopedia;
|
||||
import binnie.botany.genetics.ModuleGenetics;
|
||||
import binnie.botany.items.ItemClay;
|
||||
import binnie.botany.items.ItemPigment;
|
||||
@@ -88,8 +87,6 @@ public class Botany extends AbstractMod {
|
||||
public static ItemInsulatedTube insulatedTube;
|
||||
public static ItemSoilMeter soilMeter;
|
||||
public static ItemMisc misc;
|
||||
public static ItemEncyclopedia encyclopedia;
|
||||
public static ItemEncyclopedia encyclopediaIron;
|
||||
public static ItemFlower flowerItem;
|
||||
public static ItemPigment pigment;
|
||||
public static ItemClay clay;
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
package binnie.botany.genetics;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public class ItemEncyclopedia extends Item {
|
||||
boolean reinforced;
|
||||
|
||||
public ItemEncyclopedia(boolean reinforced) {
|
||||
this.reinforced = false;
|
||||
this.reinforced = reinforced;
|
||||
setCreativeTab(CreativeTabBotany.instance);
|
||||
setUnlocalizedName("encylopedia" + (reinforced ? "Iron" : ""));
|
||||
setMaxStackSize(1);
|
||||
setMaxDamage(reinforced ? 480 : 120);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister register) {
|
||||
itemIcon = Botany.proxy.getIcon(register, "encylopedia" + (reinforced ? "Iron" : ""));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int par1) {
|
||||
return itemIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack i) {
|
||||
return (reinforced ? "Reinforced " : "") + "Florist's Encyclopaedia";
|
||||
}
|
||||
}
|
||||
@@ -20,8 +20,6 @@ import forestry.api.recipes.RecipeManagers;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
|
||||
public class ModuleGenetics implements IInitializable {
|
||||
static AlleleEffectNone alleleEffectNone;
|
||||
@@ -42,8 +40,6 @@ public class ModuleGenetics implements IInitializable {
|
||||
GameRegistry.registerBlock(Botany.flower, "flower");
|
||||
BinnieCore.proxy.registerTileEntity(TileEntityFlower.class, "botany.tile.flower", null);
|
||||
Botany.database = new ItemDictionary();
|
||||
Botany.encyclopedia = new ItemEncyclopedia(false);
|
||||
Botany.encyclopediaIron = new ItemEncyclopedia(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -65,37 +61,6 @@ public class ModuleGenetics implements IInitializable {
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
new ItemStack(Botany.encyclopedia),
|
||||
new Object[]{
|
||||
"fff", "fbf", "fff",
|
||||
'f', new ItemStack(Blocks.red_flower, 1, 32767),
|
||||
'b', Items.book
|
||||
}
|
||||
));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
new ItemStack(Botany.encyclopedia),
|
||||
new Object[]{
|
||||
"fff", "fbf", "fff",
|
||||
'f', new ItemStack(Blocks.yellow_flower, 1, 32767),
|
||||
'b', Items.book
|
||||
}
|
||||
));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
new ItemStack(Botany.encyclopedia),
|
||||
new Object[]{
|
||||
"fff", "fbf", "fff",
|
||||
'f', new ItemStack(Botany.flower, 1, 32767),
|
||||
'b', Items.book
|
||||
}
|
||||
));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(
|
||||
new ItemStack(Botany.encyclopediaIron),
|
||||
new Object[]{
|
||||
new ItemStack(Botany.encyclopedia),
|
||||
"ingotIron"
|
||||
}
|
||||
));
|
||||
FlowerManager.flowerRegistry.registerAcceptableFlower(Botany.flower, "flowersVanilla");
|
||||
RecipeManagers.carpenterManager.addRecipe(
|
||||
100,
|
||||
|
||||
@@ -17,13 +17,13 @@ import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
|
||||
public enum PacketID implements IPacketID {
|
||||
Encylopedia,
|
||||
FieldKit,
|
||||
FlowerUpdate;
|
||||
|
||||
@Override
|
||||
public void onMessage(MessageBinnie message, MessageContext context) {
|
||||
if (this == PacketID.Encylopedia && context.side == Side.CLIENT) {
|
||||
onEnciclopediaPacket(message);
|
||||
if (this == PacketID.FieldKit && context.side == Side.CLIENT) {
|
||||
onFieldKitPacket(message);
|
||||
} else if (this == PacketID.FlowerUpdate) {
|
||||
onFlowerUpdatePacket(message);
|
||||
}
|
||||
@@ -37,7 +37,7 @@ public enum PacketID implements IPacketID {
|
||||
}
|
||||
}
|
||||
|
||||
private void onEnciclopediaPacket(MessageBinnie message) {
|
||||
private void onFieldKitPacket(MessageBinnie message) {
|
||||
MessageNBT packet = new MessageNBT(message);
|
||||
NBTTagCompound data = packet.getTagCompound();
|
||||
EntityPlayer player = BinnieCore.proxy.getPlayer();
|
||||
|
||||
@@ -9,6 +9,7 @@ import binnie.core.IInitializable;
|
||||
import binnie.core.network.packet.MessageNBT;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -45,10 +46,12 @@ public class ModuleItems implements IInitializable {
|
||||
if (!BinnieCore.isBotanyActive() || event.action != PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) {
|
||||
return;
|
||||
}
|
||||
if (event.entityPlayer != null
|
||||
&& event.entityPlayer.getHeldItem() != null
|
||||
&& event.entityPlayer.getHeldItem().getItem() == BinnieCore.fieldKit
|
||||
&& event.entityPlayer.isSneaking()) {
|
||||
|
||||
EntityPlayer player = event.entityPlayer;
|
||||
if (player != null
|
||||
&& player.getHeldItem() != null
|
||||
&& player.getHeldItem().getItem() == BinnieCore.fieldKit
|
||||
&& player.isSneaking()) {
|
||||
TileEntity tile = event.world.getTileEntity(event.x, event.y, event.z);
|
||||
if (!(tile instanceof TileEntityFlower)) {
|
||||
return;
|
||||
@@ -68,7 +71,7 @@ public class ModuleItems implements IInitializable {
|
||||
info.setShort("Colour2", (short) flower.getGenome().getSecondaryColor().getID());
|
||||
info.setBoolean("Wilting", flower.isWilted());
|
||||
info.setBoolean("Flowered", flower.hasFlowered());
|
||||
Botany.proxy.sendToPlayer(new MessageNBT(PacketID.Encylopedia.ordinal(), info), event.entityPlayer);
|
||||
Botany.proxy.sendToPlayer(new MessageNBT(PacketID.FieldKit.ordinal(), info), event.entityPlayer);
|
||||
event.entityPlayer.getHeldItem().damageItem(1, event.entityPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user