mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-20 03:59:45 +00:00
Add Minecart with Apiary
This commit is contained in:
1 parent
571bdd9b80
commit
bd8dbbeaf8
23 files changed
+908
-477
No files matched your search
@@ -0,0 +1,28 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.apiculture;
|
||||
|
||||
import forestry.api.apiculture.DefaultBeeListener;
|
||||
import forestry.apiculture.inventory.IApiaryInventory;
|
||||
|
||||
public class ApiaryBeeListener extends DefaultBeeListener {
|
||||
private final IApiary apiary;
|
||||
|
||||
public ApiaryBeeListener(IApiary apiary) {
|
||||
this.apiary = apiary;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wearOutEquipment(int amount) {
|
||||
IApiaryInventory apiaryInventory = apiary.getApiaryInventory();
|
||||
apiaryInventory.wearOutFrames(apiary, amount);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.apiculture;
|
||||
|
||||
import forestry.api.apiculture.DefaultBeeModifier;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
|
||||
public class ApiaryBeeModifier extends DefaultBeeModifier {
|
||||
@Override
|
||||
public float getProductionModifier(IBeeGenome genome, float currentModifier) {
|
||||
return 0.1f;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.apiculture;
|
||||
|
||||
import forestry.api.apiculture.DefaultBeeModifier;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
|
||||
public class BeehouseBeeModifier extends DefaultBeeModifier {
|
||||
@Override
|
||||
public float getTerritoryModifier(IBeeGenome genome, float currentModifier) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(IBeeGenome genome, float currentModifier) {
|
||||
return 0.25f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
return 3.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloweringModifier(IBeeGenome genome, float currentModifier) {
|
||||
return 3.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getGeneticDecay(IBeeGenome genome, float currentModifier) {
|
||||
return 0.0f;
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
import forestry.apiculture.entities.EntityMinecartApiary;
|
||||
import forestry.apiculture.entities.EntityMinecartBeehouse;
|
||||
import forestry.apiculture.gui.ContainerAlveary;
|
||||
import forestry.apiculture.gui.ContainerAlvearyHygroregulator;
|
||||
@@ -106,6 +107,17 @@ public class GuiHandlerApiculture extends GuiHandlerBase {
|
||||
return new GuiBeeHousing<>(beeCart, container, GuiBeeHousing.Icon.BEE_HOUSE);
|
||||
}
|
||||
|
||||
case MinecartApiaryGUI: {
|
||||
Entity entity = world.getEntityByID(x);
|
||||
if (!(entity instanceof EntityMinecartApiary)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
EntityMinecartApiary beeCart = (EntityMinecartApiary) entity;
|
||||
ContainerMinecartBeehouse container = new ContainerMinecartBeehouse(player.inventory, beeCart, true);
|
||||
return new GuiBeeHousing<>(beeCart, container, GuiBeeHousing.Icon.APIARY);
|
||||
}
|
||||
|
||||
case HabitatLocatorGUI:
|
||||
equipped = player.getCurrentEquippedItem();
|
||||
if (equipped == null) {
|
||||
@@ -182,6 +194,16 @@ public class GuiHandlerApiculture extends GuiHandlerBase {
|
||||
return new ContainerMinecartBeehouse(player.inventory, (EntityMinecartBeehouse) entity, false);
|
||||
}
|
||||
|
||||
case MinecartApiaryGUI: {
|
||||
Entity entity = world.getEntityByID(x);
|
||||
if (!(entity instanceof EntityMinecartApiary)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
synchApiaristTracker(world, player);
|
||||
return new ContainerMinecartBeehouse(player.inventory, (EntityMinecartApiary) entity, true);
|
||||
}
|
||||
|
||||
case HabitatLocatorGUI:
|
||||
equipped = player.getCurrentEquippedItem();
|
||||
if (equipped == null) {
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.apiculture;
|
||||
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.apiculture.inventory.IApiaryInventory;
|
||||
|
||||
public interface IApiary extends IBeeHousing {
|
||||
IApiaryInventory getApiaryInventory();
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.entities;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.apiculture.IBeeHousingInventory;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.apiculture.IHiveFrame;
|
||||
import forestry.apiculture.ApiaryBeeListener;
|
||||
import forestry.apiculture.ApiaryBeeModifier;
|
||||
import forestry.apiculture.IApiary;
|
||||
import forestry.apiculture.inventory.IApiaryInventory;
|
||||
import forestry.apiculture.inventory.InventoryApiary;
|
||||
import forestry.core.config.Config;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.config.ForestryBlock;
|
||||
import forestry.core.config.ForestryItem;
|
||||
import forestry.core.inventory.IInventoryAdapter;
|
||||
import forestry.core.network.GuiId;
|
||||
|
||||
public class EntityMinecartApiary extends EntityMinecartBeeHousingBase implements IApiary {
|
||||
private static final IBeeModifier beeModifier = new ApiaryBeeModifier();
|
||||
private final IBeeListener beeListener = new ApiaryBeeListener(this);
|
||||
private final InventoryApiary inventory = new InventoryApiary(getAccessHandler());
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public EntityMinecartApiary(World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
public EntityMinecartApiary(World world, double posX, double posY, double posZ) {
|
||||
super(world, posX, posY, posZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected GuiId getGuiId() {
|
||||
return GuiId.MinecartApiaryGUI;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getHints() {
|
||||
return Config.hints.get("apiary");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IInventoryAdapter getInternalInventory() {
|
||||
return inventory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IApiaryInventory getApiaryInventory() {
|
||||
return inventory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBeeHousingInventory getBeeInventory() {
|
||||
return inventory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block func_145820_n() {
|
||||
return ForestryBlock.apiculture.block();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDisplayTileData() {
|
||||
return Constants.DEFINITION_APIARY_META;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCartItem() {
|
||||
return ForestryItem.minecartBeehouse.getItemStack(1, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<IBeeModifier> getBeeModifiers() {
|
||||
List<IBeeModifier> beeModifiers = new ArrayList<>();
|
||||
|
||||
beeModifiers.add(beeModifier);
|
||||
|
||||
for (IHiveFrame frame : inventory.getFrames()) {
|
||||
beeModifiers.add(frame.getBeeModifier());
|
||||
}
|
||||
|
||||
return beeModifiers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<IBeeListener> getBeeListeners() {
|
||||
return Collections.singleton(beeListener);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.entities;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.apiculture.IBeekeepingLogic;
|
||||
import forestry.api.core.EnumHumidity;
|
||||
import forestry.api.core.EnumTemperature;
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.core.IErrorLogic;
|
||||
import forestry.apiculture.gui.IGuiBeeHousingInventory;
|
||||
import forestry.apiculture.network.PacketBeeLogicEntityRequest;
|
||||
import forestry.apiculture.tiles.TileBeeHousingBase;
|
||||
import forestry.core.entities.EntityMinecartContainerForestry;
|
||||
import forestry.core.network.DataInputStreamForestry;
|
||||
import forestry.core.network.DataOutputStreamForestry;
|
||||
import forestry.core.network.IForestryPacketServer;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.tiles.IClimatised;
|
||||
|
||||
public abstract class EntityMinecartBeeHousingBase extends EntityMinecartContainerForestry implements IBeeHousing, IGuiBeeHousingInventory, IClimatised {
|
||||
private static final Random random = new Random();
|
||||
private static final int beeFXInterval = 4;
|
||||
private static final int pollenFXInterval = 50;
|
||||
|
||||
private final int beeFXTime = random.nextInt(beeFXInterval);
|
||||
private final int pollenFXTime = random.nextInt(pollenFXInterval);
|
||||
|
||||
private final IBeekeepingLogic beeLogic = BeeManager.beeRoot.createBeekeepingLogic(this);
|
||||
private final IErrorLogic errorLogic = ForestryAPI.errorStateRegistry.createErrorLogic();
|
||||
|
||||
// CLIENT
|
||||
private int breedingProgressPercent = 0;
|
||||
private boolean needsActiveUpdate = true;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public EntityMinecartBeeHousingBase(World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
public EntityMinecartBeeHousingBase(World world, double posX, double posY, double posZ) {
|
||||
super(world, posX, posY, posZ);
|
||||
}
|
||||
|
||||
/* IBeeHousing */
|
||||
@Override
|
||||
public IBeekeepingLogic getBeekeepingLogic() {
|
||||
return beeLogic;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumTemperature getTemperature() {
|
||||
return EnumTemperature.getFromBiome(getBiome(), (int) posX, (int) posY, (int) posZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumHumidity getHumidity() {
|
||||
return EnumHumidity.getFromValue(getBiome().rainfall);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getExactTemperature() {
|
||||
return getBiome().temperature;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getExactHumidity() {
|
||||
return getBiome().rainfall;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBlockLightValue() {
|
||||
return worldObj.getBlockLightValue((int) posX, (int) posY + 1, (int) posZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBlockSeeTheSky() {
|
||||
return worldObj.canBlockSeeTheSky((int) posX, (int) posY + 1, (int) posZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public World getWorld() {
|
||||
return worldObj;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BiomeGenBase getBiome() {
|
||||
return worldObj.getBiomeGenForCoords((int) posX, (int) posZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameProfile getOwner() {
|
||||
return getAccessHandler().getOwner();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IErrorLogic getErrorLogic() {
|
||||
return errorLogic;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChunkCoordinates getCoordinates() {
|
||||
return new ChunkCoordinates((int) posX, (int) posY, (int) posZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vec3 getBeeFXCoordinates() {
|
||||
return Vec3.createVectorHelper(posX, posY + 0.25, posZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeGuiData(DataOutputStreamForestry data) throws IOException {
|
||||
data.writeVarInt(beeLogic.getBeeProgressPercent());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readGuiData(DataInputStreamForestry data) throws IOException {
|
||||
breedingProgressPercent = data.readVarInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHealthScaled(int i) {
|
||||
return (breedingProgressPercent * i) / 100;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
if (!worldObj.isRemote) {
|
||||
if (beeLogic.canWork()) {
|
||||
beeLogic.doWork();
|
||||
}
|
||||
} else {
|
||||
if (needsActiveUpdate) {
|
||||
IForestryPacketServer packet = new PacketBeeLogicEntityRequest(this);
|
||||
Proxies.net.sendToServer(packet);
|
||||
needsActiveUpdate = false;
|
||||
}
|
||||
|
||||
if (beeLogic.canDoBeeFX()) {
|
||||
if (worldObj.getTotalWorldTime() % beeFXInterval == beeFXTime) {
|
||||
beeLogic.doBeeFX();
|
||||
}
|
||||
|
||||
if (worldObj.getTotalWorldTime() % pollenFXInterval == pollenFXTime) {
|
||||
TileBeeHousingBase.doPollenFX(worldObj, posX - 0.5, posY - 0.1, posZ - 0.5);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound nbtTagCompound) {
|
||||
super.readEntityFromNBT(nbtTagCompound);
|
||||
beeLogic.readFromNBT(nbtTagCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeEntityToNBT(NBTTagCompound nbtTagCompound) {
|
||||
super.writeEntityToNBT(nbtTagCompound);
|
||||
beeLogic.writeToNBT(nbtTagCompound);
|
||||
}
|
||||
}
|
||||
@@ -10,289 +10,50 @@
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.entities;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.item.EntityMinecartContainer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.minecart.MinecartInteractEvent;
|
||||
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
import forestry.api.apiculture.DefaultBeeListener;
|
||||
import forestry.api.apiculture.EnumBeeType;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.apiculture.IBeeHousingInventory;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.apiculture.IBeekeepingLogic;
|
||||
import forestry.api.core.EnumHumidity;
|
||||
import forestry.api.core.EnumTemperature;
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.core.IErrorLogic;
|
||||
import forestry.apiculture.gui.IGuiBeeHousingInventory;
|
||||
import forestry.apiculture.network.PacketBeeLogicEntityRequest;
|
||||
import forestry.apiculture.tiles.TileAbstractBeeHousing;
|
||||
import forestry.apiculture.tiles.TileBeehouse;
|
||||
import forestry.core.access.AccessHandler;
|
||||
import forestry.core.access.EnumAccess;
|
||||
import forestry.core.access.IAccessHandler;
|
||||
import forestry.core.access.IRestrictedAccess;
|
||||
import forestry.apiculture.BeehouseBeeModifier;
|
||||
import forestry.apiculture.InventoryBeeHousing;
|
||||
import forestry.core.config.Config;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.config.ForestryBlock;
|
||||
import forestry.core.config.ForestryItem;
|
||||
import forestry.core.gui.IHintSource;
|
||||
import forestry.core.network.DataInputStreamForestry;
|
||||
import forestry.core.network.DataOutputStreamForestry;
|
||||
import forestry.core.inventory.IInventoryAdapter;
|
||||
import forestry.core.network.GuiId;
|
||||
import forestry.core.network.IForestryPacketServer;
|
||||
import forestry.core.network.IStreamableGui;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.tiles.IClimatised;
|
||||
import forestry.core.tiles.IFilterSlotDelegate;
|
||||
import forestry.core.utils.InventoryUtil;
|
||||
|
||||
public class EntityMinecartBeehouse extends EntityMinecartContainer implements IBeeHousing, IFilterSlotDelegate, IGuiBeeHousingInventory, IStreamableGui, IRestrictedAccess, IClimatised, IHintSource {
|
||||
private static final Random random = new Random();
|
||||
private static final int beeFXInterval = 4;
|
||||
private static final int pollenFXInterval = 50;
|
||||
|
||||
private final int beeFXTime = random.nextInt(beeFXInterval);
|
||||
private final int pollenFXTime = random.nextInt(pollenFXInterval);
|
||||
|
||||
private static final Iterable<IBeeModifier> beeModifiers = ImmutableList.<IBeeModifier>of(new TileBeehouse.BeehouseBeeModifier());
|
||||
private static final Iterable<IBeeListener> beeListeners = ImmutableList.<IBeeListener>of(new DefaultBeeListener());
|
||||
|
||||
private final IBeekeepingLogic beeLogic = BeeManager.beeRoot.createBeekeepingLogic(this);
|
||||
private final IErrorLogic errorLogic = ForestryAPI.errorStateRegistry.createErrorLogic();
|
||||
private final BeeCartInventory beeInventory = new BeeCartInventory(this);
|
||||
private final AccessHandler accessHandler = new AccessHandler(this);
|
||||
|
||||
// CLIENT
|
||||
private int breedingProgressPercent = 0;
|
||||
private boolean needsActiveUpdate = true;
|
||||
public class EntityMinecartBeehouse extends EntityMinecartBeeHousingBase {
|
||||
private static final IBeeModifier beeModifier = new BeehouseBeeModifier();
|
||||
private static final IBeeListener beeListener = new DefaultBeeListener();
|
||||
private final InventoryBeeHousing beeInventory = new InventoryBeeHousing(9, "Items", getAccessHandler());
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public EntityMinecartBeehouse(World world) {
|
||||
super(world);
|
||||
setHasDisplayTile(true);
|
||||
beeInventory.disableAutomation();
|
||||
}
|
||||
|
||||
public EntityMinecartBeehouse(World world, double posX, double posY, double posZ) {
|
||||
super(world, posX, posY, posZ);
|
||||
setHasDisplayTile(true);
|
||||
beeInventory.disableAutomation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean interactFirst(EntityPlayer player) {
|
||||
if (MinecraftForge.EVENT_BUS.post(new MinecartInteractEvent(this, player))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!worldObj.isRemote) {
|
||||
player.openGui(ForestryAPI.instance, GuiId.MinecartBeehouseGUI.ordinal(), worldObj, getEntityId(), -1, 0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void setOwner(GameProfile owner) {
|
||||
accessHandler.setOwner(owner);
|
||||
protected GuiId getGuiId() {
|
||||
return GuiId.MinecartBeehouseGUI;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMinecartType() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return 9;
|
||||
}
|
||||
|
||||
/* IBeeHousing */
|
||||
@Override
|
||||
public Iterable<IBeeModifier> getBeeModifiers() {
|
||||
return beeModifiers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<IBeeListener> getBeeListeners() {
|
||||
return beeListeners;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BeeCartInventory getBeeInventory() {
|
||||
return beeInventory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBeekeepingLogic getBeekeepingLogic() {
|
||||
return beeLogic;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumTemperature getTemperature() {
|
||||
return EnumTemperature.getFromBiome(getBiome(), (int) posX, (int) posY, (int) posZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumHumidity getHumidity() {
|
||||
return EnumHumidity.getFromValue(getBiome().rainfall);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getExactTemperature() {
|
||||
return getBiome().temperature;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getExactHumidity() {
|
||||
return getBiome().rainfall;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBlockLightValue() {
|
||||
return worldObj.getBlockLightValue((int) posX, (int) posY, (int) posZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBlockSeeTheSky() {
|
||||
return worldObj.canBlockSeeTheSky((int) posX, (int) posY, (int) posZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public World getWorld() {
|
||||
return worldObj;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BiomeGenBase getBiome() {
|
||||
return worldObj.getBiomeGenForCoords((int) posX, (int) posZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameProfile getOwner() {
|
||||
return accessHandler.getOwner();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IErrorLogic getErrorLogic() {
|
||||
return errorLogic;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChunkCoordinates getCoordinates() {
|
||||
return new ChunkCoordinates((int) posX, (int) posY, (int) posZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vec3 getBeeFXCoordinates() {
|
||||
return Vec3.createVectorHelper(posX, posY + 0.25, posZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeGuiData(DataOutputStreamForestry data) throws IOException {
|
||||
data.writeVarInt(beeLogic.getBeeProgressPercent());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readGuiData(DataInputStreamForestry data) throws IOException {
|
||||
breedingProgressPercent = data.readVarInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHealthScaled(int i) {
|
||||
return (breedingProgressPercent * i) / 100;
|
||||
}
|
||||
|
||||
// fix cart contents rendering as black in the End dimension
|
||||
@Override
|
||||
public float getBrightness(float p_70013_1_) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
if (!worldObj.isRemote) {
|
||||
if (beeLogic.canWork()) {
|
||||
beeLogic.doWork();
|
||||
}
|
||||
} else {
|
||||
if (needsActiveUpdate) {
|
||||
IForestryPacketServer packet = new PacketBeeLogicEntityRequest(this);
|
||||
Proxies.net.sendToServer(packet);
|
||||
needsActiveUpdate = false;
|
||||
}
|
||||
|
||||
if (beeLogic.canDoBeeFX()) {
|
||||
if (worldObj.getTotalWorldTime() % beeFXInterval == beeFXTime) {
|
||||
beeLogic.doBeeFX();
|
||||
}
|
||||
|
||||
if (worldObj.getTotalWorldTime() % pollenFXInterval == pollenFXTime) {
|
||||
TileAbstractBeeHousing.doPollenFX(worldObj, posX - 0.5, posY - 0.1, posZ - 0.5);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound nbtTagCompound) {
|
||||
super.readEntityFromNBT(nbtTagCompound);
|
||||
beeLogic.readFromNBT(nbtTagCompound);
|
||||
accessHandler.readFromNBT(nbtTagCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeEntityToNBT(NBTTagCompound nbtTagCompound) {
|
||||
super.writeEntityToNBT(nbtTagCompound);
|
||||
beeLogic.writeToNBT(nbtTagCompound);
|
||||
accessHandler.writeToNBT(nbtTagCompound);
|
||||
}
|
||||
|
||||
/* IFilterSlotDelegate */
|
||||
@Override
|
||||
public boolean canSlotAccept(int slotIndex, ItemStack itemStack) {
|
||||
EnumBeeType beeType = BeeManager.beeRoot.getType(itemStack);
|
||||
|
||||
if (slotIndex == BeeCartInventory.SLOT_QUEEN) {
|
||||
return beeType == EnumBeeType.QUEEN || beeType == EnumBeeType.PRINCESS;
|
||||
} else if (slotIndex == BeeCartInventory.SLOT_DRONE) {
|
||||
return beeType == EnumBeeType.DRONE;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLocked(int slotIndex) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* ITitled */
|
||||
@Override
|
||||
public String getUnlocalizedTitle() {
|
||||
return "entity." + getEntityString() + ".name";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeRidden() {
|
||||
return false;
|
||||
public List<String> getHints() {
|
||||
return Config.hints.get("bee.house");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -305,87 +66,29 @@ public class EntityMinecartBeehouse extends EntityMinecartContainer implements I
|
||||
return Constants.DEFINITION_BEEHOUSE_META;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void killMinecart(DamageSource damageSource) {
|
||||
super.killMinecart(damageSource);
|
||||
|
||||
if (!damageSource.isExplosion()) {
|
||||
entityDropItem(new ItemStack(func_145820_n(), 1, getDisplayTileData()), 0.0F);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDead() {
|
||||
// stop ghost items from dropping client side
|
||||
if (worldObj.isRemote) {
|
||||
for (int slot = 0; slot < getSizeInventory(); slot++) {
|
||||
setInventorySlotContents(slot, null);
|
||||
}
|
||||
}
|
||||
super.setDead();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCartItem() {
|
||||
return ForestryItem.minecartBeehouse.getItemStack();
|
||||
return ForestryItem.minecartBeehouse.getItemStack(1, 0);
|
||||
}
|
||||
|
||||
/* IBeeHousing */
|
||||
@Override
|
||||
public Iterable<IBeeModifier> getBeeModifiers() {
|
||||
return Collections.singleton(beeModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int slot, ItemStack itemStack) {
|
||||
return canSlotAccept(slot, itemStack);
|
||||
public Iterable<IBeeListener> getBeeListeners() {
|
||||
return Collections.singleton(beeListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAccessHandler getAccessHandler() {
|
||||
return accessHandler;
|
||||
public IBeeHousingInventory getBeeInventory() {
|
||||
return beeInventory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSwitchAccess(EnumAccess oldAccess, EnumAccess newAccess) {
|
||||
|
||||
protected IInventoryAdapter getInternalInventory() {
|
||||
return beeInventory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getHints() {
|
||||
return Config.hints.get("bee.house");
|
||||
}
|
||||
|
||||
private static class BeeCartInventory implements IBeeHousingInventory {
|
||||
public static final int SLOT_QUEEN = 0;
|
||||
public static final int SLOT_DRONE = 1;
|
||||
public static final int SLOT_PRODUCT_1 = 2;
|
||||
public static final int SLOT_PRODUCT_COUNT = 7;
|
||||
|
||||
private final EntityMinecartBeehouse cart;
|
||||
|
||||
public BeeCartInventory(EntityMinecartBeehouse cart) {
|
||||
this.cart = cart;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final ItemStack getQueen() {
|
||||
return cart.getStackInSlot(SLOT_QUEEN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final ItemStack getDrone() {
|
||||
return cart.getStackInSlot(SLOT_DRONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void setQueen(ItemStack itemstack) {
|
||||
cart.setInventorySlotContents(SLOT_QUEEN, itemstack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void setDrone(ItemStack itemstack) {
|
||||
cart.setInventorySlotContents(SLOT_DRONE, itemstack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean addProduct(ItemStack product, boolean all) {
|
||||
return InventoryUtil.tryAddStack(cart, product, SLOT_PRODUCT_1, SLOT_PRODUCT_COUNT, all, true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,14 +12,14 @@ package forestry.apiculture.gui;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import forestry.apiculture.tiles.TileAbstractBeeHousing;
|
||||
import forestry.apiculture.tiles.TileBeeHousingBase;
|
||||
import forestry.core.gui.ContainerTile;
|
||||
import forestry.core.network.IForestryPacketClient;
|
||||
import forestry.core.network.PacketGuiUpdate;
|
||||
|
||||
public class ContainerBeeHousing extends ContainerTile<TileAbstractBeeHousing> implements IContainerBeeHousing {
|
||||
public class ContainerBeeHousing extends ContainerTile<TileBeeHousingBase> implements IContainerBeeHousing {
|
||||
|
||||
public ContainerBeeHousing(InventoryPlayer player, TileAbstractBeeHousing tile, boolean hasFrames) {
|
||||
public ContainerBeeHousing(InventoryPlayer player, TileBeeHousingBase tile, boolean hasFrames) {
|
||||
super(tile, player, 8, 108);
|
||||
ContainerBeeHelper.addSlots(this, tile, hasFrames);
|
||||
}
|
||||
|
||||
@@ -12,13 +12,13 @@ package forestry.apiculture.gui;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import forestry.apiculture.entities.EntityMinecartBeehouse;
|
||||
import forestry.apiculture.entities.EntityMinecartBeeHousingBase;
|
||||
import forestry.core.gui.ContainerEntity;
|
||||
import forestry.core.network.IForestryPacketClient;
|
||||
import forestry.core.network.PacketGuiUpdateEntity;
|
||||
|
||||
public class ContainerMinecartBeehouse extends ContainerEntity<EntityMinecartBeehouse> implements IContainerBeeHousing {
|
||||
public ContainerMinecartBeehouse(InventoryPlayer player, EntityMinecartBeehouse entity, boolean hasFrames) {
|
||||
public class ContainerMinecartBeehouse extends ContainerEntity<EntityMinecartBeeHousingBase> implements IContainerBeeHousing {
|
||||
public ContainerMinecartBeehouse(InventoryPlayer player, EntityMinecartBeeHousingBase entity, boolean hasFrames) {
|
||||
super(entity, player, 8, 108);
|
||||
ContainerBeeHelper.addSlots(this, entity, hasFrames);
|
||||
}
|
||||
|
||||
+4
-15
@@ -10,20 +10,9 @@
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.inventory;
|
||||
|
||||
import forestry.apiculture.InventoryBeeHousing;
|
||||
import forestry.apiculture.tiles.TileAbstractBeeHousing;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.apiculture.IBeeHousingInventory;
|
||||
|
||||
public class InventoryTileBeeHousing extends InventoryBeeHousing {
|
||||
private final TileAbstractBeeHousing tile;
|
||||
|
||||
public InventoryTileBeeHousing(TileAbstractBeeHousing tile, int size, String name) {
|
||||
super(size, name, tile.getAccessHandler());
|
||||
this.tile = tile;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markDirty() {
|
||||
super.markDirty();
|
||||
tile.markDirty();
|
||||
}
|
||||
public interface IApiaryInventory extends IBeeHousingInventory {
|
||||
void wearOutFrames(IBeeHousing beeHousing, int amount);
|
||||
}
|
||||
@@ -13,21 +13,24 @@ package forestry.apiculture.inventory;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.apiculture.IBeekeepingMode;
|
||||
import forestry.api.apiculture.IHiveFrame;
|
||||
import forestry.apiculture.tiles.TileApiary;
|
||||
import forestry.core.inventory.wrappers.InventoryMapper;
|
||||
import forestry.apiculture.InventoryBeeHousing;
|
||||
import forestry.core.access.IAccessHandler;
|
||||
import forestry.core.utils.SlotUtil;
|
||||
|
||||
public class InventoryApiary extends InventoryTileBeeHousing {
|
||||
public class InventoryApiary extends InventoryBeeHousing implements IApiaryInventory {
|
||||
public static final int SLOT_FRAMES_1 = 9;
|
||||
public static final int SLOT_FRAMES_COUNT = 3;
|
||||
|
||||
public InventoryApiary(TileApiary tile) {
|
||||
super(tile, 12, "Items");
|
||||
public InventoryApiary(IAccessHandler accessHandler) {
|
||||
super(12, "Items", accessHandler);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -48,10 +51,6 @@ public class InventoryApiary extends InventoryTileBeeHousing {
|
||||
return super.isItemValidForSlot(slotIndex, itemStack);
|
||||
}
|
||||
|
||||
public IInventory getFrameInventory() {
|
||||
return new InventoryMapper(this, SLOT_FRAMES_1, SLOT_FRAMES_COUNT);
|
||||
}
|
||||
|
||||
public Collection<IHiveFrame> getFrames() {
|
||||
Collection<IHiveFrame> hiveFrames = new ArrayList<>(SLOT_FRAMES_COUNT);
|
||||
|
||||
@@ -69,4 +68,29 @@ public class InventoryApiary extends InventoryTileBeeHousing {
|
||||
|
||||
return hiveFrames;
|
||||
}
|
||||
|
||||
public void wearOutFrames(IBeeHousing beeHousing, int amount) {
|
||||
IBeekeepingMode beekeepingMode = BeeManager.beeRoot.getBeekeepingMode(beeHousing.getWorld());
|
||||
int wear = Math.round(amount * beekeepingMode.getWearModifier());
|
||||
|
||||
for (int i = SLOT_FRAMES_1; i < SLOT_FRAMES_1 + SLOT_FRAMES_COUNT; i++) {
|
||||
ItemStack hiveFrameStack = getStackInSlot(i);
|
||||
if (hiveFrameStack == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Item hiveFrameItem = hiveFrameStack.getItem();
|
||||
if (!(hiveFrameItem instanceof IHiveFrame)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
IHiveFrame hiveFrame = (IHiveFrame) hiveFrameItem;
|
||||
|
||||
ItemStack queenStack = getQueen();
|
||||
IBee queen = BeeManager.beeRoot.getMember(queenStack);
|
||||
ItemStack usedFrame = hiveFrame.frameUsed(beeHousing, hiveFrameStack, queen, wear);
|
||||
|
||||
setInventorySlotContents(i, usedFrame);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,33 +10,38 @@
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.BlockDispenser;
|
||||
import net.minecraft.block.BlockRailBase;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemMinecart;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.apiculture.entities.EntityMinecartBeehouse;
|
||||
import forestry.core.render.TextureManager;
|
||||
import forestry.core.utils.StringUtil;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemMinecartBeehouse extends ItemMinecart {
|
||||
import forestry.apiculture.entities.EntityMinecartApiary;
|
||||
import forestry.apiculture.entities.EntityMinecartBeeHousingBase;
|
||||
import forestry.apiculture.entities.EntityMinecartBeehouse;
|
||||
import forestry.core.items.ItemForestry;
|
||||
import forestry.core.render.TextureManager;
|
||||
|
||||
public class ItemMinecartBeehouse extends ItemForestry {
|
||||
private final String[] definition = new String[]{"cart.beehouse", "cart.apiary"};
|
||||
|
||||
public ItemMinecartBeehouse() {
|
||||
super(0);
|
||||
maxStackSize = 1;
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(false);
|
||||
setHasSubtypes(true);
|
||||
setNoRepair();
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(this, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister register) {
|
||||
itemIcon = TextureManager.registerTex(register, StringUtil.cleanItemName(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float facingX, float facingY, float facingZ) {
|
||||
if (!BlockRailBase.func_150051_a(world.getBlock(x, y, z))) {
|
||||
@@ -44,7 +49,12 @@ public class ItemMinecartBeehouse extends ItemMinecart {
|
||||
}
|
||||
|
||||
if (!world.isRemote) {
|
||||
EntityMinecartBeehouse entityMinecart = new EntityMinecartBeehouse(world, (double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F));
|
||||
EntityMinecartBeeHousingBase entityMinecart;
|
||||
if (itemStack.getItemDamage() == 0) {
|
||||
entityMinecart = new EntityMinecartBeehouse(world, (double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F));
|
||||
} else {
|
||||
entityMinecart = new EntityMinecartApiary(world, (double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F));
|
||||
}
|
||||
entityMinecart.setOwner(player.getGameProfile());
|
||||
|
||||
if (itemStack.hasDisplayName()) {
|
||||
@@ -57,4 +67,43 @@ public class ItemMinecartBeehouse extends ItemMinecart {
|
||||
--itemStack.stackSize;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
if (stack.getItemDamage() >= definition.length || stack.getItemDamage() < 0) {
|
||||
return "item.forestry.unknown";
|
||||
} else {
|
||||
return "item.for." + definition[stack.getItemDamage()];
|
||||
}
|
||||
}
|
||||
|
||||
/* ICONS */
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[] icons;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister register) {
|
||||
icons = new IIcon[definition.length];
|
||||
for (int i = 0; i < definition.length; i++) {
|
||||
icons[i] = TextureManager.registerTex(register, definition[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIconFromDamage(int damage) {
|
||||
if (damage >= definition.length || damage < 0) {
|
||||
return icons[0];
|
||||
} else {
|
||||
return icons[damage];
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
for (int i = 0; i < definition.length; i++) {
|
||||
itemList.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,44 +16,34 @@ import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cpw.mods.fml.common.Optional;
|
||||
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
import forestry.api.apiculture.DefaultBeeListener;
|
||||
import forestry.api.apiculture.DefaultBeeModifier;
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousingInventory;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.apiculture.IBeekeepingMode;
|
||||
import forestry.api.apiculture.IHiveFrame;
|
||||
import forestry.apiculture.ApiaryBeeListener;
|
||||
import forestry.apiculture.ApiaryBeeModifier;
|
||||
import forestry.apiculture.IApiary;
|
||||
import forestry.apiculture.inventory.IApiaryInventory;
|
||||
import forestry.apiculture.inventory.InventoryApiary;
|
||||
import forestry.apiculture.trigger.ApicultureTriggers;
|
||||
import forestry.core.network.GuiId;
|
||||
|
||||
import buildcraft.api.statements.ITriggerExternal;
|
||||
|
||||
public class TileApiary extends TileAbstractBeeHousing {
|
||||
private static final IBeeModifier beeModifier = new ApiaryBeeModifier();
|
||||
|
||||
private final IBeeListener beeListener;
|
||||
private final InventoryApiary inventory;
|
||||
public class TileApiary extends TileBeeHousingBase implements IApiary {
|
||||
private final IBeeModifier beeModifier = new ApiaryBeeModifier();
|
||||
private final IBeeListener beeListener = new ApiaryBeeListener(this);
|
||||
private final InventoryApiary inventory = new InventoryApiary(getAccessHandler());
|
||||
|
||||
public TileApiary() {
|
||||
super(GuiId.ApiaryGUI, "apiary");
|
||||
this.beeListener = new ApiaryBeeListener(this);
|
||||
|
||||
InventoryApiary apiaryInventory = new InventoryApiary(this);
|
||||
this.inventory = apiaryInventory;
|
||||
setInternalInventory(apiaryInventory);
|
||||
setInternalInventory(inventory);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -61,6 +51,11 @@ public class TileApiary extends TileAbstractBeeHousing {
|
||||
return inventory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IApiaryInventory getApiaryInventory() {
|
||||
return inventory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<IBeeModifier> getBeeModifiers() {
|
||||
List<IBeeModifier> beeModifiers = new ArrayList<>();
|
||||
@@ -79,48 +74,6 @@ public class TileApiary extends TileAbstractBeeHousing {
|
||||
return Collections.singleton(beeListener);
|
||||
}
|
||||
|
||||
private static class ApiaryBeeModifier extends DefaultBeeModifier {
|
||||
@Override
|
||||
public float getProductionModifier(IBeeGenome genome, float currentModifier) {
|
||||
return 0.1f;
|
||||
}
|
||||
}
|
||||
|
||||
private static class ApiaryBeeListener extends DefaultBeeListener {
|
||||
private final TileApiary apiary;
|
||||
|
||||
public ApiaryBeeListener(TileApiary apiary) {
|
||||
this.apiary = apiary;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wearOutEquipment(int amount) {
|
||||
IBeekeepingMode beekeepingMode = BeeManager.beeRoot.getBeekeepingMode(apiary.getWorldObj());
|
||||
int wear = Math.round(amount * beekeepingMode.getWearModifier());
|
||||
|
||||
IInventory framesInventory = apiary.inventory.getFrameInventory();
|
||||
for (int i = 0; i < framesInventory.getSizeInventory(); i++) {
|
||||
ItemStack hiveFrameStack = framesInventory.getStackInSlot(i);
|
||||
if (hiveFrameStack == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Item hiveFrameItem = hiveFrameStack.getItem();
|
||||
if (!(hiveFrameItem instanceof IHiveFrame)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
IHiveFrame hiveFrame = (IHiveFrame) hiveFrameItem;
|
||||
|
||||
ItemStack queenStack = apiary.getBeeInventory().getQueen();
|
||||
IBee queen = BeeManager.beeRoot.getMember(queenStack);
|
||||
ItemStack usedFrame = hiveFrame.frameUsed(apiary, hiveFrameStack, queen, wear);
|
||||
|
||||
framesInventory.setInventorySlotContents(i, usedFrame);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ITRIGGERPROVIDER */
|
||||
@Optional.Method(modid = "BuildCraftAPI|statements")
|
||||
@Override
|
||||
|
||||
+2
-2
@@ -34,14 +34,14 @@ import forestry.core.proxy.Proxies;
|
||||
import forestry.core.tiles.IClimatised;
|
||||
import forestry.core.tiles.TileBase;
|
||||
|
||||
public abstract class TileAbstractBeeHousing extends TileBase implements IBeeHousing, IClimatised, IGuiBeeHousingInventory, IStreamableGui {
|
||||
public abstract class TileBeeHousingBase extends TileBase implements IBeeHousing, IClimatised, IGuiBeeHousingInventory, IStreamableGui {
|
||||
private final IBeekeepingLogic beeLogic;
|
||||
private BiomeGenBase cachedBiome;
|
||||
|
||||
// CLIENT
|
||||
private int breedingProgressPercent = 0;
|
||||
|
||||
protected TileAbstractBeeHousing(GuiId guiId, String hintKey) {
|
||||
protected TileBeeHousingBase(GuiId guiId, String hintKey) {
|
||||
super(guiId, hintKey);
|
||||
this.beeLogic = BeeManager.beeRoot.createBeekeepingLogic(this);
|
||||
}
|
||||
@@ -13,29 +13,26 @@ package forestry.apiculture.tiles;
|
||||
import java.util.Collections;
|
||||
|
||||
import forestry.api.apiculture.DefaultBeeListener;
|
||||
import forestry.api.apiculture.DefaultBeeModifier;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousingInventory;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.apiculture.inventory.InventoryTileBeeHousing;
|
||||
import forestry.apiculture.BeehouseBeeModifier;
|
||||
import forestry.apiculture.InventoryBeeHousing;
|
||||
import forestry.core.network.GuiId;
|
||||
|
||||
public class TileBeehouse extends TileAbstractBeeHousing {
|
||||
public class TileBeehouse extends TileBeeHousingBase {
|
||||
private static final IBeeModifier beeModifier = new BeehouseBeeModifier();
|
||||
|
||||
private final IBeeListener beeListener;
|
||||
private final IBeeHousingInventory beeInventory;
|
||||
private final InventoryBeeHousing beeInventory;
|
||||
|
||||
public TileBeehouse() {
|
||||
super(GuiId.BeehouseGUI, "bee.house");
|
||||
this.beeListener = new DefaultBeeListener();
|
||||
|
||||
InventoryTileBeeHousing beeHousingInventory = new InventoryTileBeeHousing(this, 12, "Items");
|
||||
beeHousingInventory.disableAutomation();
|
||||
|
||||
this.beeInventory = beeHousingInventory;
|
||||
setInternalInventory(beeHousingInventory);
|
||||
beeInventory = new InventoryBeeHousing(12, "Items", getAccessHandler());
|
||||
beeInventory.disableAutomation();
|
||||
setInternalInventory(beeInventory);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -52,36 +49,4 @@ public class TileBeehouse extends TileAbstractBeeHousing {
|
||||
public Iterable<IBeeListener> getBeeListeners() {
|
||||
return Collections.singleton(beeListener);
|
||||
}
|
||||
|
||||
public static class BeehouseBeeModifier extends DefaultBeeModifier {
|
||||
@Override
|
||||
public float getTerritoryModifier(IBeeGenome genome, float currentModifier) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(IBeeGenome genome, float currentModifier) {
|
||||
return 0.25f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
return 3.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloweringModifier(IBeeGenome genome, float currentModifier) {
|
||||
return 3.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getGeneticDecay(IBeeGenome genome, float currentModifier) {
|
||||
return 0.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,167 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.core.entities;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.core.inventory.IInventoryAdapter;
|
||||
import forestry.core.tiles.IFilterSlotDelegate;
|
||||
import forestry.core.utils.InventoryUtil;
|
||||
|
||||
public abstract class EntityMinecartContainerForestry extends EntityMinecartForestry implements ISidedInventory, IFilterSlotDelegate {
|
||||
/**
|
||||
* When set to true, the minecart will drop all items when setDead() is called. When false (such as when travelling
|
||||
* dimensions) it preserves its contents.
|
||||
*/
|
||||
private boolean dropContentsWhenDead = true;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public EntityMinecartContainerForestry(World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
public EntityMinecartContainerForestry(World world, double posX, double posY, double posZ) {
|
||||
super(world, posX, posY, posZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound nbtTagCompound) {
|
||||
super.readEntityFromNBT(nbtTagCompound);
|
||||
getInternalInventory().readFromNBT(nbtTagCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeEntityToNBT(NBTTagCompound nbtTagCompound) {
|
||||
super.writeEntityToNBT(nbtTagCompound);
|
||||
getInternalInventory().writeToNBT(nbtTagCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDead() {
|
||||
if (dropContentsWhenDead && !worldObj.isRemote) {
|
||||
InventoryUtil.dropInventory(getInternalInventory(), worldObj, posX, posY, posZ);
|
||||
}
|
||||
super.setDead();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applyDrag() {
|
||||
int redstoneLevel = 15 - Container.calcRedstoneFromInventory(this);
|
||||
double drag = 0.98F + (float) redstoneLevel * 0.001F;
|
||||
this.motionX *= drag;
|
||||
this.motionY *= 0.0D;
|
||||
this.motionZ *= drag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void travelToDimension(int dimensionId) {
|
||||
dropContentsWhenDead = false;
|
||||
super.travelToDimension(dimensionId);
|
||||
}
|
||||
|
||||
/* IInventory */
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer player) {
|
||||
return !isDead && player.getDistanceSqToEntity(this) <= 64.0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return getInternalInventory().getSizeInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final ItemStack getStackInSlot(int slotIndex) {
|
||||
return getInternalInventory().getStackInSlot(slotIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int slotIndex, int amount) {
|
||||
return getInternalInventory().decrStackSize(slotIndex, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final ItemStack getStackInSlotOnClosing(int slotIndex) {
|
||||
return getInternalInventory().getStackInSlotOnClosing(slotIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int slotIndex, ItemStack itemstack) {
|
||||
getInternalInventory().setInventorySlotContents(slotIndex, itemstack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int getInventoryStackLimit() {
|
||||
return getInternalInventory().getInventoryStackLimit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void openInventory() {
|
||||
getInternalInventory().openInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void closeInventory() {
|
||||
getInternalInventory().closeInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final String getInventoryName() {
|
||||
return getInternalInventory().getInventoryName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean hasCustomInventoryName() {
|
||||
return getInternalInventory().hasCustomInventoryName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean isItemValidForSlot(int slotIndex, ItemStack itemStack) {
|
||||
return getInternalInventory().isItemValidForSlot(slotIndex, itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean canSlotAccept(int slotIndex, ItemStack itemStack) {
|
||||
return getInternalInventory().canSlotAccept(slotIndex, itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLocked(int slotIndex) {
|
||||
return getInternalInventory().isLocked(slotIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int side) {
|
||||
return getInternalInventory().getAccessibleSlotsFromSide(side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int slot, ItemStack stack, int side) {
|
||||
return getInternalInventory().canInsertItem(slot, stack, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slot, ItemStack stack, int side) {
|
||||
return getInternalInventory().canExtractItem(slot, stack, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markDirty() {
|
||||
|
||||
}
|
||||
|
||||
protected abstract IInventoryAdapter getInternalInventory();
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.core.entities;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.item.EntityMinecart;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.minecart.MinecartInteractEvent;
|
||||
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.core.access.AccessHandler;
|
||||
import forestry.core.access.EnumAccess;
|
||||
import forestry.core.access.IAccessHandler;
|
||||
import forestry.core.access.IRestrictedAccess;
|
||||
import forestry.core.gui.IHintSource;
|
||||
import forestry.core.network.DataInputStreamForestry;
|
||||
import forestry.core.network.DataOutputStreamForestry;
|
||||
import forestry.core.network.GuiId;
|
||||
import forestry.core.network.IStreamableGui;
|
||||
import forestry.core.tiles.ITitled;
|
||||
|
||||
public abstract class EntityMinecartForestry extends EntityMinecart implements IStreamableGui, ITitled, IRestrictedAccess, IHintSource {
|
||||
private final AccessHandler accessHandler = new AccessHandler(this);
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public EntityMinecartForestry(World world) {
|
||||
super(world);
|
||||
setHasDisplayTile(true);
|
||||
}
|
||||
|
||||
public EntityMinecartForestry(World world, double posX, double posY, double posZ) {
|
||||
super(world, posX, posY, posZ);
|
||||
setHasDisplayTile(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean interactFirst(EntityPlayer player) {
|
||||
if (MinecraftForge.EVENT_BUS.post(new MinecartInteractEvent(this, player))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!worldObj.isRemote) {
|
||||
player.openGui(ForestryAPI.instance, getGuiId().ordinal(), worldObj, getEntityId(), -1, 0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
protected abstract GuiId getGuiId();
|
||||
|
||||
public void setOwner(GameProfile owner) {
|
||||
accessHandler.setOwner(owner);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMinecartType() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeGuiData(DataOutputStreamForestry data) throws IOException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readGuiData(DataInputStreamForestry data) throws IOException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound nbtTagCompound) {
|
||||
super.readEntityFromNBT(nbtTagCompound);
|
||||
accessHandler.readFromNBT(nbtTagCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeEntityToNBT(NBTTagCompound nbtTagCompound) {
|
||||
super.writeEntityToNBT(nbtTagCompound);
|
||||
accessHandler.writeToNBT(nbtTagCompound);
|
||||
}
|
||||
|
||||
/* EntityMinecart */
|
||||
@Override
|
||||
public boolean canBeRidden() {
|
||||
return false;
|
||||
}
|
||||
|
||||
// cart contents
|
||||
@Override
|
||||
public abstract Block func_145820_n();
|
||||
|
||||
// cart contents meta
|
||||
@Override
|
||||
public abstract int getDisplayTileData();
|
||||
|
||||
// cart contents itemStack
|
||||
@Override
|
||||
public abstract ItemStack getCartItem();
|
||||
|
||||
@Override
|
||||
public void killMinecart(DamageSource damageSource) {
|
||||
super.killMinecart(damageSource);
|
||||
entityDropItem(new ItemStack(func_145820_n(), 1, getDisplayTileData()), 0.0F);
|
||||
}
|
||||
|
||||
// fix cart contents rendering as black in the End dimension
|
||||
@Override
|
||||
public float getBrightness(float p_70013_1_) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
/* ITitled */
|
||||
@Override
|
||||
public String getUnlocalizedTitle() {
|
||||
return "entity." + getEntityString() + ".name";
|
||||
}
|
||||
|
||||
/* IRestrictedAccess */
|
||||
@Override
|
||||
public IAccessHandler getAccessHandler() {
|
||||
return accessHandler;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSwitchAccess(EnumAccess oldAccess, EnumAccess newAccess) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -36,8 +36,6 @@ public enum GuiId {
|
||||
BeealyzerGUI,
|
||||
|
||||
BeehouseGUI,
|
||||
|
||||
MinecartBeehouseGUI,
|
||||
|
||||
BottlerGUI,
|
||||
|
||||
@@ -81,6 +79,10 @@ public enum GuiId {
|
||||
|
||||
MailboxGUI,
|
||||
|
||||
MinecartBeehouseGUI,
|
||||
|
||||
MinecartApiaryGUI,
|
||||
|
||||
MoistenerGUI,
|
||||
|
||||
MushroomFarmGUI,
|
||||
|
||||
@@ -75,6 +75,7 @@ import forestry.apiculture.blocks.BlockBeehives;
|
||||
import forestry.apiculture.blocks.BlockCandle;
|
||||
import forestry.apiculture.blocks.BlockStump;
|
||||
import forestry.apiculture.commands.CommandBee;
|
||||
import forestry.apiculture.entities.EntityMinecartApiary;
|
||||
import forestry.apiculture.entities.EntityMinecartBeehouse;
|
||||
import forestry.apiculture.flowers.FlowerRegistry;
|
||||
import forestry.apiculture.genetics.BeeBranchDefinition;
|
||||
@@ -420,6 +421,7 @@ public class PluginApiculture extends ForestryPlugin {
|
||||
GameRegistry.registerTileEntity(TileCandle.class, "forestry.Candle");
|
||||
|
||||
EntityUtil.registerEntity(EntityMinecartBeehouse.class, "cart.beehouse", 1, 0x000000, 0xffffff, 256, 3, true);
|
||||
EntityUtil.registerEntity(EntityMinecartApiary.class, "cart.apiary", 2, 0x000000, 0xffffff, 256, 3, true);
|
||||
|
||||
BeeManager.villageBees[0].add(BeeDefinition.FOREST.getGenome());
|
||||
BeeManager.villageBees[0].add(BeeDefinition.MEADOWS.getGenome());
|
||||
@@ -601,11 +603,16 @@ public class PluginApiculture extends ForestryPlugin {
|
||||
"###", "#S#", "###",
|
||||
'#', ForestryItem.stickImpregnated,
|
||||
'S', Items.string);
|
||||
RecipeUtil.addRecipe(ForestryItem.minecartBeehouse.getItemStack(),
|
||||
RecipeUtil.addRecipe(ForestryItem.minecartBeehouse.getItemStack(1, 0),
|
||||
"B",
|
||||
"C",
|
||||
'B', ForestryBlock.apiculture.getItemStack(1, Constants.DEFINITION_BEEHOUSE_META),
|
||||
'C', Items.minecart);
|
||||
RecipeUtil.addRecipe(ForestryItem.minecartBeehouse.getItemStack(1, 1),
|
||||
"B",
|
||||
"C",
|
||||
'B', ForestryBlock.apiculture.getItemStack(1, Constants.DEFINITION_APIARY_META),
|
||||
'C', Items.minecart);
|
||||
|
||||
// FOOD STUFF
|
||||
if (ForestryItem.honeyedSlice.item() != null) {
|
||||
|
||||
Reference in new issue
Block a user