mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-14 09:04:42 +00:00
Compare commits
67
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
66fc9fbc9f | ||
|
|
aa1ecd8c13 | ||
|
|
c3453981c3 | ||
|
|
870eaf8725 | ||
|
|
2d07fea3ad | ||
|
|
95be941803 | ||
|
|
be16bf4491 | ||
|
|
ce6aa27f44 | ||
|
|
bf179c91d9 | ||
|
|
5fc1b10298 | ||
|
|
23b8f8b892 | ||
|
|
1598946632 | ||
|
|
aad6dbaa3f | ||
|
|
ca6cc89015 | ||
|
|
7a22f1d939 | ||
|
|
feda84fbc6 | ||
|
|
f7b36e11d1 | ||
|
|
cfbab6b988 | ||
|
|
3978a068d1 | ||
|
|
9d2d0af432 | ||
|
|
d451309170 | ||
|
|
c82dd0fbfb | ||
|
|
803911e10a | ||
|
|
29eedf9011 | ||
|
|
882848a00f | ||
|
|
4d253e1dd6 | ||
|
|
4d7988ee0f | ||
|
|
fcad67a1c2 | ||
|
|
1bd3b61df9 | ||
|
|
060ca1eb80 | ||
|
|
98a2d9c65e | ||
|
|
eb010094ca | ||
|
|
e6cbced8a2 | ||
|
|
d300078227 | ||
|
|
65c7f0242c | ||
|
|
c4140ef9c3 | ||
|
|
389e5e01e7 | ||
|
|
a55b2645b7 | ||
|
|
9a36381ce0 | ||
|
|
2565eea5ba | ||
|
|
13ae9ece47 | ||
|
|
d3e87b1aaf | ||
|
|
990d4990db | ||
|
|
ce232e808e | ||
|
|
31574a9c6e | ||
|
|
cd9a4110ee | ||
|
|
6b35ff2ba1 | ||
|
|
5133e721cc | ||
|
|
09ced92f5b | ||
|
|
12477a7711 | ||
|
|
b7dc4d9144 | ||
|
|
da48d317ff | ||
|
|
5bfb11e952 | ||
|
|
4dffb9f352 | ||
|
|
beadb47539 | ||
|
|
6301d3c193 | ||
|
|
883863e047 | ||
|
|
2c14f02151 | ||
|
|
00771b1a42 | ||
|
|
46ec2f2740 | ||
|
|
ac653d46c1 | ||
|
|
63d9935d01 | ||
|
|
ba695b977d | ||
|
|
6b1dfb1596 | ||
|
|
fff02be71d | ||
|
|
0e5b9e4957 | ||
|
|
3415030fbf |
No files matched your search
+5
-1
@@ -70,6 +70,10 @@ repositories {
|
||||
name = "ic2"
|
||||
url = "http://maven.ic2.player.to/"
|
||||
}
|
||||
ivy {
|
||||
name "BuildCraft"
|
||||
artifactPattern "http://www.mod-buildcraft.com/releases/BuildCraft/[revision]/[module]-[revision]-[classifier].[ext]"
|
||||
}
|
||||
}
|
||||
|
||||
configurations {
|
||||
@@ -79,7 +83,7 @@ configurations {
|
||||
|
||||
dependencies {
|
||||
api 'net.industrial-craft:industrialcraft-2:2.2.713-experimental:api'
|
||||
api 'com.mod-buildcraft:buildcraft:6.4.10:dev'
|
||||
api name: "buildcraft", version: "6.4.10", classifier: "dev"
|
||||
}
|
||||
|
||||
processResources {
|
||||
|
||||
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
@@ -1,29 +1,29 @@
|
||||
/*******************************************************************************
|
||||
* 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.worldgen;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.apiculture.hives.IHiveGen;
|
||||
|
||||
public abstract class HiveGen implements IHiveGen {
|
||||
|
||||
@Override
|
||||
public boolean canReplace(World world, int x, int y, int z) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
Material material = block.getMaterial();
|
||||
return (material.isReplaceable() && !material.isLiquid()) ||
|
||||
material == Material.air ||
|
||||
material == Material.plants;
|
||||
}
|
||||
}
|
||||
/*******************************************************************************
|
||||
* 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.worldgen;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.apiculture.hives.IHiveGen;
|
||||
|
||||
public abstract class HiveGen implements IHiveGen {
|
||||
|
||||
@Override
|
||||
public boolean canReplace(World world, int x, int y, int z) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
Material material = block.getMaterial();
|
||||
return (material.isReplaceable() && !material.isLiquid()) ||
|
||||
material == Material.air ||
|
||||
material == Material.plants;
|
||||
}
|
||||
}
|
||||
@@ -1,31 +1,31 @@
|
||||
/*******************************************************************************
|
||||
* 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.worldgen;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
import forestry.api.apiculture.hives.IHiveGen;
|
||||
import forestry.api.apiculture.hives.IHiveGenHelper;
|
||||
|
||||
public class HiveGenHelper implements IHiveGenHelper {
|
||||
|
||||
private static final IHiveGen treeGen = new HiveGenTree();
|
||||
|
||||
@Override
|
||||
public IHiveGen ground(Block... validGroundBlocks) {
|
||||
return new HiveGenGround(validGroundBlocks);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IHiveGen tree() {
|
||||
return treeGen;
|
||||
}
|
||||
}
|
||||
/*******************************************************************************
|
||||
* 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.worldgen;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
import forestry.api.apiculture.hives.IHiveGen;
|
||||
import forestry.api.apiculture.hives.IHiveGenHelper;
|
||||
|
||||
public class HiveGenHelper implements IHiveGenHelper {
|
||||
|
||||
private static final IHiveGen treeGen = new HiveGenTree();
|
||||
|
||||
@Override
|
||||
public IHiveGen ground(Block... validGroundBlocks) {
|
||||
return new HiveGenGround(validGroundBlocks);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IHiveGen tree() {
|
||||
return treeGen;
|
||||
}
|
||||
}
|
||||
@@ -328,7 +328,11 @@ public class TileLeaves extends TileTreeContainer implements IPollinatable, IFru
|
||||
}
|
||||
|
||||
public String getUnlocalizedName() {
|
||||
return getTree().getGenome().getPrimary().getUnlocalizedName();
|
||||
ITree tree = getTree();
|
||||
if (tree == null) {
|
||||
return "for.leaves.corrupted";
|
||||
}
|
||||
return tree.getGenome().getPrimary().getUnlocalizedName();
|
||||
}
|
||||
|
||||
/* NETWORK */
|
||||
|
||||
@@ -3,6 +3,7 @@ package forestry.arboriculture.items;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.arboriculture.gadgets.TileLeaves;
|
||||
@@ -35,7 +36,7 @@ public class ItemLeavesBlock extends ItemForestryBlock {
|
||||
}
|
||||
|
||||
String grammar = StringUtil.localize("trees.grammar.leaves");
|
||||
String localizedName = StringUtil.localize(unlocalizedName);
|
||||
String localizedName = StatCollector.translateToLocal(unlocalizedName);
|
||||
|
||||
return grammar.replaceAll("%SPECIES", localizedName).replaceAll("%TYPE", type);
|
||||
}
|
||||
|
||||
Executable → Regular
+1
-1
@@ -113,7 +113,7 @@ public class Config {
|
||||
public static float getBeehivesRate() {
|
||||
return generateBeehivesRate;
|
||||
}
|
||||
|
||||
|
||||
public static boolean isExUtilEnderLilyEnabled() {
|
||||
return ExUtilEnderLily;
|
||||
}
|
||||
|
||||
@@ -27,11 +27,9 @@ import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.core.IErrorState;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.core.EnumErrorCode;
|
||||
import forestry.core.config.Defaults;
|
||||
@@ -39,6 +37,7 @@ import forestry.core.fluids.FluidHelper;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.fluids.TankManager;
|
||||
import forestry.core.fluids.tanks.FilteredTank;
|
||||
import forestry.core.interfaces.IItemStackDisplay;
|
||||
import forestry.core.interfaces.ILiquidTankContainer;
|
||||
import forestry.core.inventory.InvTools;
|
||||
import forestry.core.inventory.TileInventoryAdapter;
|
||||
@@ -48,10 +47,12 @@ import forestry.core.inventory.wrappers.InventoryMapper;
|
||||
import forestry.core.network.DataInputStreamForestry;
|
||||
import forestry.core.network.DataOutputStreamForestry;
|
||||
import forestry.core.network.GuiId;
|
||||
import forestry.core.network.PacketItemStackDisplay;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.utils.GeneticsUtil;
|
||||
import forestry.core.utils.GuiUtil;
|
||||
|
||||
public class TileAnalyzer extends TilePowered implements ISidedInventory, ILiquidTankContainer {
|
||||
public class TileAnalyzer extends TilePowered implements ISidedInventory, ILiquidTankContainer, IItemStackDisplay {
|
||||
|
||||
/* CONSTANTS */
|
||||
public static final int TIME_TO_ANALYZE = 125;
|
||||
@@ -148,7 +149,8 @@ public class TileAnalyzer extends TilePowered implements ISidedInventory, ILiqui
|
||||
|
||||
if (added) {
|
||||
setInventorySlotContents(SLOT_ANALYZE, null);
|
||||
setNeedsNetworkUpdate();
|
||||
PacketItemStackDisplay packet = new PacketItemStackDisplay(this, getIndividualOnDisplay());
|
||||
Proxies.net.sendNetworkPacket(packet);
|
||||
}
|
||||
|
||||
setErrorCondition(!added, EnumErrorCode.NOSPACE);
|
||||
@@ -183,7 +185,8 @@ public class TileAnalyzer extends TilePowered implements ISidedInventory, ILiqui
|
||||
}
|
||||
setInventorySlotContents(SLOT_ANALYZE, inputStack);
|
||||
slot.setStackInSlot(null);
|
||||
setNeedsNetworkUpdate();
|
||||
PacketItemStackDisplay packet = new PacketItemStackDisplay(this, getIndividualOnDisplay());
|
||||
Proxies.net.sendNetworkPacket(packet);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -202,39 +205,19 @@ public class TileAnalyzer extends TilePowered implements ISidedInventory, ILiqui
|
||||
public void writeData(DataOutputStreamForestry data) throws IOException {
|
||||
super.writeData(data);
|
||||
ItemStack displayStack = getIndividualOnDisplay();
|
||||
if (displayStack == null) {
|
||||
data.writeBoolean(false);
|
||||
} else {
|
||||
data.writeBoolean(true);
|
||||
|
||||
IIndividual displayIndividual = AlleleManager.alleleRegistry.getIndividual(displayStack);
|
||||
int type = BeeManager.beeRoot.getType(displayStack).ordinal();
|
||||
|
||||
data.writeUTF(displayIndividual.getIdent());
|
||||
data.writeShort(type);
|
||||
data.writeShort(displayStack.stackSize);
|
||||
}
|
||||
data.writeItemStack(displayStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readData(DataInputStreamForestry data) throws IOException {
|
||||
super.readData(data);
|
||||
individualOnDisplayClient = data.readItemStack();
|
||||
}
|
||||
|
||||
ItemStack newIndividualOnDisplay = null;
|
||||
if (data.readBoolean()) {
|
||||
String individualUID = data.readUTF();
|
||||
int type = data.readShort();
|
||||
int stackSize = data.readShort();
|
||||
|
||||
IAllele[] template = BeeManager.beeRoot.getTemplate(individualUID);
|
||||
IIndividual individual = BeeManager.beeRoot.templateAsIndividual(template);
|
||||
|
||||
newIndividualOnDisplay = BeeManager.beeRoot.getMemberStack(individual, type);
|
||||
newIndividualOnDisplay.stackSize = stackSize;
|
||||
}
|
||||
|
||||
if (!ItemStack.areItemStacksEqual(newIndividualOnDisplay, individualOnDisplayClient)) {
|
||||
individualOnDisplayClient = newIndividualOnDisplay;
|
||||
@Override
|
||||
public void handleItemStackForDisplay(ItemStack itemStack) {
|
||||
if (!ItemStack.areItemStacksEqual(itemStack, individualOnDisplayClient)) {
|
||||
individualOnDisplayClient = itemStack;
|
||||
worldObj.func_147479_m(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
Executable → Regular
File mode changed.
@@ -42,7 +42,7 @@ public class BlockUtil {
|
||||
if (!(tile instanceof IEnergyReceiver)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
IEnergyReceiver receptor = (IEnergyReceiver) tile;
|
||||
return receptor.canConnectEnergy(side);
|
||||
}
|
||||
|
||||
@@ -41,23 +41,23 @@ import forestry.plugins.PluginArboriculture;
|
||||
|
||||
public class GeneticsUtil {
|
||||
|
||||
private static Set<Material> ersatzSpecimenMaterials;
|
||||
private static Set<Block> ersatzSpecimenBlocks;
|
||||
|
||||
private static Set<Material> getErsatzSpecimenMaterials() {
|
||||
if (ersatzSpecimenMaterials == null) {
|
||||
ersatzSpecimenMaterials = new HashSet<Material>();
|
||||
private static Set<Block> getErsatzBlocks() {
|
||||
if (ersatzSpecimenBlocks == null) {
|
||||
ersatzSpecimenBlocks = new HashSet<Block>();
|
||||
for (ItemStack ersatzSpecimen : AlleleManager.ersatzSpecimen.keySet()) {
|
||||
Block ersatzBlock = StackUtils.getBlock(ersatzSpecimen);
|
||||
if (ersatzBlock != null) {
|
||||
ersatzSpecimenMaterials.add(ersatzBlock.getMaterial());
|
||||
ersatzSpecimenBlocks.add(ersatzBlock);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ersatzSpecimenMaterials;
|
||||
return ersatzSpecimenBlocks;
|
||||
}
|
||||
|
||||
private static boolean isErsatzMaterial(Block block) {
|
||||
return block != null && getErsatzSpecimenMaterials().contains(block.getMaterial());
|
||||
private static boolean isErsatzBlock(Block block) {
|
||||
return block != null && getErsatzBlocks().contains(block);
|
||||
}
|
||||
|
||||
public static boolean hasNaturalistEye(EntityPlayer player) {
|
||||
@@ -127,7 +127,7 @@ public class GeneticsUtil {
|
||||
|
||||
public static ITree getErsatzPollen(World world, final int x, final int y, final int z) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
if (!isErsatzMaterial(block)) {
|
||||
if (!isErsatzBlock(block)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
@@ -111,12 +111,20 @@ public class ItemLetter extends ItemInventoried {
|
||||
|
||||
public static LetterState getState(int meta) {
|
||||
int ordinal = meta & 0x0f;
|
||||
return LetterState.values()[ordinal];
|
||||
LetterState[] values = LetterState.values();
|
||||
if (ordinal >= values.length) {
|
||||
ordinal = 0;
|
||||
}
|
||||
return values[ordinal];
|
||||
}
|
||||
|
||||
public static LetterSize getSize(int meta) {
|
||||
int ordinal = meta >> 4;
|
||||
return LetterSize.values()[ordinal];
|
||||
LetterSize[] values = LetterSize.values();
|
||||
if (ordinal >= values.length) {
|
||||
ordinal = 0;
|
||||
}
|
||||
return values[ordinal];
|
||||
}
|
||||
|
||||
public static LetterSize getSize(ILetter letter) {
|
||||
@@ -167,23 +175,24 @@ public class ItemLetter extends ItemInventoried {
|
||||
switch (state) {
|
||||
case OPENED:
|
||||
if (letter.countAttachments() <= 0) {
|
||||
int meta = encodeMeta(LetterState.EMPTIED, size);
|
||||
parent.setItemDamage(meta);
|
||||
state = LetterState.EMPTIED;
|
||||
}
|
||||
break;
|
||||
case FRESH:
|
||||
case STAMPED:
|
||||
if (letter.isMailable() && letter.isPostPaid()) {
|
||||
int meta = encodeMeta(LetterState.STAMPED, size);
|
||||
parent.setItemDamage(meta);
|
||||
state = LetterState.STAMPED;
|
||||
} else {
|
||||
int meta = encodeMeta(LetterState.FRESH, size);
|
||||
parent.setItemDamage(meta);
|
||||
state = LetterState.FRESH;
|
||||
}
|
||||
size = getSize(letter);
|
||||
break;
|
||||
case EMPTIED:
|
||||
}
|
||||
|
||||
int meta = encodeMeta(state, size);
|
||||
parent.setItemDamage(meta);
|
||||
|
||||
letter.writeToNBT(parent.getTagCompound());
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ public class PluginBuildCraftRecipes extends ForestryPlugin {
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
return Proxies.common.isAPILoaded("buildcraft.api.recipes", "[2.0, 3.0)");
|
||||
return Proxies.common.isAPILoaded("buildcraft.api.recipes", "[2.0, 4.0)");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Executable → Regular
File mode changed.
Reference in new issue
Block a user