mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-21 04:22:32 +00:00
Compare commits
75
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a9cc367623 | ||
|
|
7757790b84 | ||
|
|
bcdbec5b89 | ||
|
|
3fcb927201 | ||
|
|
b374f0b23c | ||
|
|
e9c4c416f5 | ||
|
|
1b7d64a7b5 | ||
|
|
7b05cfd2f7 | ||
|
|
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
@@ -2,4 +2,4 @@ mcversion=1.7.10
|
|||||||
forgeversion=10.13.3.1370-1.7.10
|
forgeversion=10.13.3.1370-1.7.10
|
||||||
version_major=3
|
version_major=3
|
||||||
version_minor=6
|
version_minor=6
|
||||||
version_patch=0
|
version_patch=3
|
||||||
+5
-1
@@ -70,6 +70,10 @@ repositories {
|
|||||||
name = "ic2"
|
name = "ic2"
|
||||||
url = "http://maven.ic2.player.to/"
|
url = "http://maven.ic2.player.to/"
|
||||||
}
|
}
|
||||||
|
ivy {
|
||||||
|
name "BuildCraft"
|
||||||
|
artifactPattern "http://www.mod-buildcraft.com/releases/BuildCraft/[revision]/[module]-[revision]-[classifier].[ext]"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
configurations {
|
configurations {
|
||||||
@@ -79,7 +83,7 @@ configurations {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api 'net.industrial-craft:industrialcraft-2:2.2.713-experimental:api'
|
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 {
|
processResources {
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package forestry.apiculture;
|
package forestry.apiculture;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.Stack;
|
import java.util.Stack;
|
||||||
|
|
||||||
@@ -36,7 +37,7 @@ public class BeekeepingLogic implements IBeekeepingLogic {
|
|||||||
|
|
||||||
private static final int MAX_POLLINATION_ATTEMPTS = 20;
|
private static final int MAX_POLLINATION_ATTEMPTS = 20;
|
||||||
private static final int totalBreedingTime = Defaults.APIARY_BREEDING_TIME;
|
private static final int totalBreedingTime = Defaults.APIARY_BREEDING_TIME;
|
||||||
private static final int ticksPerCheckCanWork = 10;
|
private static final int ticksPerCheckQueenCanWork = 10;
|
||||||
|
|
||||||
private final IBeeHousing housing;
|
private final IBeeHousing housing;
|
||||||
private final boolean housingSupportsMultipleErrorStates;
|
private final boolean housingSupportsMultipleErrorStates;
|
||||||
@@ -53,8 +54,8 @@ public class BeekeepingLogic implements IBeekeepingLogic {
|
|||||||
// Cached flowers check
|
// Cached flowers check
|
||||||
private boolean hasFlowersCached = false;
|
private boolean hasFlowersCached = false;
|
||||||
private int hasFlowersCooldown = 0;
|
private int hasFlowersCooldown = 0;
|
||||||
private boolean canWorkCached = false;
|
private Set<IErrorState> queenCanWorkCached = Collections.emptySet();
|
||||||
private int canWorkCooldown = 0;
|
private int queenCanWorkCooldown = 0;
|
||||||
|
|
||||||
public BeekeepingLogic(IBeeHousing housing) {
|
public BeekeepingLogic(IBeeHousing housing) {
|
||||||
this.housing = housing;
|
this.housing = housing;
|
||||||
@@ -128,16 +129,6 @@ public class BeekeepingLogic implements IBeekeepingLogic {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canWork() {
|
public boolean canWork() {
|
||||||
if (canWorkCooldown > 0) {
|
|
||||||
canWorkCooldown--;
|
|
||||||
} else {
|
|
||||||
canWorkCached = checkCanWork();
|
|
||||||
canWorkCooldown = ticksPerCheckCanWork;
|
|
||||||
}
|
|
||||||
return canWorkCached;
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean checkCanWork() {
|
|
||||||
if (housingSupportsMultipleErrorStates) {
|
if (housingSupportsMultipleErrorStates) {
|
||||||
Set<IErrorState> errorStates = housing.getErrorStates();
|
Set<IErrorState> errorStates = housing.getErrorStates();
|
||||||
for (IErrorState errorState : errorStates) {
|
for (IErrorState errorState : errorStates) {
|
||||||
@@ -183,7 +174,7 @@ public class BeekeepingLogic implements IBeekeepingLogic {
|
|||||||
|
|
||||||
if (hasFlowersCooldown <= 0) {
|
if (hasFlowersCooldown <= 0) {
|
||||||
hasFlowersCached = queen.hasFlower(housing);
|
hasFlowersCached = queen.hasFlower(housing);
|
||||||
hasFlowersCooldown = PluginApiculture.ticksPerBeeWorkCycle / ticksPerCheckCanWork;
|
hasFlowersCooldown = PluginApiculture.ticksPerBeeWorkCycle;
|
||||||
|
|
||||||
// check more often if we haven't found flowers
|
// check more often if we haven't found flowers
|
||||||
if (!hasFlowersCached) {
|
if (!hasFlowersCached) {
|
||||||
@@ -318,7 +309,7 @@ public class BeekeepingLogic implements IBeekeepingLogic {
|
|||||||
|
|
||||||
ItemStack queenStack = housing.getQueen();
|
ItemStack queenStack = housing.getQueen();
|
||||||
|
|
||||||
if (queenStack == null || !ForestryItem.beeQueenGE.isItemEqual(housing.getQueen())) {
|
if (queenStack == null || !ForestryItem.beeQueenGE.isItemEqual(queenStack)) {
|
||||||
housingErrorState = EnumErrorCode.NOQUEEN;
|
housingErrorState = EnumErrorCode.NOQUEEN;
|
||||||
hasQueen = false;
|
hasQueen = false;
|
||||||
queen = null;
|
queen = null;
|
||||||
@@ -367,30 +358,46 @@ public class BeekeepingLogic implements IBeekeepingLogic {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean queenCanWork() {
|
private boolean queenCanWork() {
|
||||||
if (queen == null) {
|
if (queenCanWorkCooldown > 0) {
|
||||||
return false;
|
queenCanWorkCooldown--;
|
||||||
|
} else {
|
||||||
|
if (queen == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
queenCanWorkCached = checkQueenCanWork();
|
||||||
|
queenCanWorkCooldown = ticksPerCheckQueenCanWork;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (housingSupportsMultipleErrorStates) {
|
Set<IErrorState> errorStates = queenCanWorkCached;
|
||||||
try {
|
|
||||||
Set<IErrorState> errorStates = queen.getCanWork(housing);
|
if (errorStates.size() > 0) {
|
||||||
|
if (housingSupportsMultipleErrorStates) {
|
||||||
for (IErrorState errorState : errorStates) {
|
for (IErrorState errorState : errorStates) {
|
||||||
housing.setErrorCondition(true, errorState);
|
housing.setErrorCondition(true, errorState);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
return (errorStates.size() == 0);
|
IErrorState state = errorStates.iterator().next();
|
||||||
} catch (Throwable ignored) {
|
housing.setErrorState(state);
|
||||||
// queen might not support getCanWork(housing)
|
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Set<IErrorState> checkQueenCanWork() {
|
||||||
|
try {
|
||||||
|
return queen.getCanWork(housing);
|
||||||
|
} catch (Throwable ignored) {
|
||||||
|
// queen might not support getCanWork
|
||||||
}
|
}
|
||||||
|
|
||||||
IErrorState state = queen.canWork(housing);
|
IErrorState state = queen.canWork(housing);
|
||||||
if (state != EnumErrorCode.OK) {
|
if (state != EnumErrorCode.OK) {
|
||||||
housing.setErrorState(state);
|
return Collections.singleton(state);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return Collections.emptySet();
|
||||||
}
|
}
|
||||||
|
|
||||||
// / BREEDING
|
// / BREEDING
|
||||||
|
|||||||
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
@@ -1,29 +1,29 @@
|
|||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2011-2014 SirSengir.
|
* Copyright (c) 2011-2014 SirSengir.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the GNU Lesser Public License v3
|
* are made available under the terms of the GNU Lesser Public License v3
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||||
*
|
*
|
||||||
* Various Contributors including, but not limited to:
|
* Various Contributors including, but not limited to:
|
||||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package forestry.apiculture.worldgen;
|
package forestry.apiculture.worldgen;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import forestry.api.apiculture.hives.IHiveGen;
|
import forestry.api.apiculture.hives.IHiveGen;
|
||||||
|
|
||||||
public abstract class HiveGen implements IHiveGen {
|
public abstract class HiveGen implements IHiveGen {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canReplace(World world, int x, int y, int z) {
|
public boolean canReplace(World world, int x, int y, int z) {
|
||||||
Block block = world.getBlock(x, y, z);
|
Block block = world.getBlock(x, y, z);
|
||||||
Material material = block.getMaterial();
|
Material material = block.getMaterial();
|
||||||
return (material.isReplaceable() && !material.isLiquid()) ||
|
return (material.isReplaceable() && !material.isLiquid()) ||
|
||||||
material == Material.air ||
|
material == Material.air ||
|
||||||
material == Material.plants;
|
material == Material.plants;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,31 +1,31 @@
|
|||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2011-2014 SirSengir.
|
* Copyright (c) 2011-2014 SirSengir.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the GNU Lesser Public License v3
|
* are made available under the terms of the GNU Lesser Public License v3
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||||
*
|
*
|
||||||
* Various Contributors including, but not limited to:
|
* Various Contributors including, but not limited to:
|
||||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package forestry.apiculture.worldgen;
|
package forestry.apiculture.worldgen;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
|
||||||
import forestry.api.apiculture.hives.IHiveGen;
|
import forestry.api.apiculture.hives.IHiveGen;
|
||||||
import forestry.api.apiculture.hives.IHiveGenHelper;
|
import forestry.api.apiculture.hives.IHiveGenHelper;
|
||||||
|
|
||||||
public class HiveGenHelper implements IHiveGenHelper {
|
public class HiveGenHelper implements IHiveGenHelper {
|
||||||
|
|
||||||
private static final IHiveGen treeGen = new HiveGenTree();
|
private static final IHiveGen treeGen = new HiveGenTree();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IHiveGen ground(Block... validGroundBlocks) {
|
public IHiveGen ground(Block... validGroundBlocks) {
|
||||||
return new HiveGenGround(validGroundBlocks);
|
return new HiveGenGround(validGroundBlocks);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IHiveGen tree() {
|
public IHiveGen tree() {
|
||||||
return treeGen;
|
return treeGen;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* 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.arboriculture;
|
|
||||||
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
|
|
||||||
import net.minecraftforge.event.entity.player.BonemealEvent;
|
|
||||||
|
|
||||||
import cpw.mods.fml.common.eventhandler.Event.Result;
|
|
||||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
|
|
||||||
import forestry.api.genetics.IFruitBearer;
|
|
||||||
import forestry.arboriculture.gadgets.TileFruitPod;
|
|
||||||
import forestry.core.proxy.Proxies;
|
|
||||||
|
|
||||||
public class EventHandlerArboriculture {
|
|
||||||
|
|
||||||
@SubscribeEvent
|
|
||||||
public void handleBonemeal(BonemealEvent event) {
|
|
||||||
|
|
||||||
if (!Proxies.common.isSimulating(event.world)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
TileEntity tile = event.world.getTileEntity(event.x, event.y, event.z);
|
|
||||||
if (tile instanceof TileFruitPod) {
|
|
||||||
if (((TileFruitPod) tile).canMature()) {
|
|
||||||
((TileFruitPod) tile).mature();
|
|
||||||
event.setResult(Result.ALLOW);
|
|
||||||
}
|
|
||||||
} else if (tile instanceof IFruitBearer) {
|
|
||||||
IFruitBearer bearer = (IFruitBearer) tile;
|
|
||||||
if (bearer.getRipeness() < 1.0f) {
|
|
||||||
bearer.addRipeness(1.0f);
|
|
||||||
event.setResult(Result.ALLOW);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -139,4 +139,30 @@ public class BlockFruitPod extends BlockCocoa {
|
|||||||
return PluginArboriculture.modelIdPods;
|
return PluginArboriculture.modelIdPods;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* IGrowable */
|
||||||
|
|
||||||
|
@Override
|
||||||
|
// canFertilize
|
||||||
|
public boolean func_149851_a(World world, int x, int y, int z, boolean isClient) {
|
||||||
|
TileFruitPod podTile = getPodTile(world, x, y, z);
|
||||||
|
if (podTile != null) {
|
||||||
|
return podTile.canMature();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
// shouldFertilize
|
||||||
|
public boolean func_149852_a(World world, Random random, int x, int y, int z) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
// fertilize
|
||||||
|
public void func_149853_b(World world, Random random, int x, int y, int z) {
|
||||||
|
TileFruitPod podTile = getPodTile(world, x, y, z);
|
||||||
|
if (podTile != null) {
|
||||||
|
podTile.mature();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -16,6 +16,7 @@ import java.util.List;
|
|||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import net.minecraft.block.BlockNewLeaf;
|
import net.minecraft.block.BlockNewLeaf;
|
||||||
|
import net.minecraft.block.IGrowable;
|
||||||
import net.minecraft.block.ITileEntityProvider;
|
import net.minecraft.block.ITileEntityProvider;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
@@ -49,7 +50,7 @@ import forestry.core.utils.StackUtils;
|
|||||||
import forestry.plugins.PluginArboriculture;
|
import forestry.plugins.PluginArboriculture;
|
||||||
import forestry.plugins.PluginLepidopterology;
|
import forestry.plugins.PluginLepidopterology;
|
||||||
|
|
||||||
public class ForestryBlockLeaves extends BlockNewLeaf implements ITileEntityProvider {
|
public class ForestryBlockLeaves extends BlockNewLeaf implements ITileEntityProvider, IGrowable {
|
||||||
|
|
||||||
public ForestryBlockLeaves() {
|
public ForestryBlockLeaves() {
|
||||||
this.setCreativeTab(Tabs.tabArboriculture);
|
this.setCreativeTab(Tabs.tabArboriculture);
|
||||||
@@ -328,4 +329,30 @@ public class ForestryBlockLeaves extends BlockNewLeaf implements ITileEntityProv
|
|||||||
return super.onBlockActivated(world, x, y, z, player, par6, par7, par8, par9);
|
return super.onBlockActivated(world, x, y, z, player, par6, par7, par8, par9);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* IGrowable */
|
||||||
|
|
||||||
|
@Override
|
||||||
|
// canFertilize
|
||||||
|
public boolean func_149851_a(World world, int x, int y, int z, boolean isClient) {
|
||||||
|
TileLeaves leafTile = getLeafTile(world, x, y, z);
|
||||||
|
if (leafTile != null) {
|
||||||
|
return leafTile.hasFruit() && leafTile.getRipeness() < 1.0f;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
// shouldFertilize
|
||||||
|
public boolean func_149852_a(World world, Random random, int x, int y, int z) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
// fertilize
|
||||||
|
public void func_149853_b(World world, Random random, int x, int y, int z) {
|
||||||
|
TileLeaves leafTile = getLeafTile(world, x, y, z);
|
||||||
|
if (leafTile != null) {
|
||||||
|
leafTile.addRipeness(1.0f);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -138,6 +138,14 @@ public class TileFruitPod extends TileEntity implements IFruitBearer, IStreamabl
|
|||||||
Proxies.net.sendNetworkPacket(new PacketRipeningUpdate(this));
|
Proxies.net.sendNetworkPacket(new PacketRipeningUpdate(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void fromRipeningPacket(int newMaturity) {
|
||||||
|
if (newMaturity == maturity) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
maturity = (short) newMaturity;
|
||||||
|
worldObj.func_147479_m(xCoord, yCoord, zCoord);
|
||||||
|
}
|
||||||
|
|
||||||
/* IFRUITBEARER */
|
/* IFRUITBEARER */
|
||||||
@Override
|
@Override
|
||||||
public boolean hasFruit() {
|
public boolean hasFruit() {
|
||||||
|
|||||||
@@ -328,7 +328,11 @@ public class TileLeaves extends TileTreeContainer implements IPollinatable, IFru
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getUnlocalizedName() {
|
public String getUnlocalizedName() {
|
||||||
return getTree().getGenome().getPrimary().getUnlocalizedName();
|
ITree tree = getTree();
|
||||||
|
if (tree == null) {
|
||||||
|
return "for.leaves.corrupted";
|
||||||
|
}
|
||||||
|
return tree.getGenome().getPrimary().getUnlocalizedName();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* NETWORK */
|
/* NETWORK */
|
||||||
@@ -417,8 +421,7 @@ public class TileLeaves extends TileTreeContainer implements IPollinatable, IFru
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void fromRipeningPacket(PacketRipeningUpdate packet) {
|
public void fromRipeningPacket(int newColourFruits) {
|
||||||
int newColourFruits = packet.getValue();
|
|
||||||
if (newColourFruits == colourFruits) {
|
if (newColourFruits == colourFruits) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package forestry.arboriculture.items;
|
|||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.StatCollector;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import forestry.arboriculture.gadgets.TileLeaves;
|
import forestry.arboriculture.gadgets.TileLeaves;
|
||||||
@@ -35,7 +36,7 @@ public class ItemLeavesBlock extends ItemForestryBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String grammar = StringUtil.localize("trees.grammar.leaves");
|
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);
|
return grammar.replaceAll("%SPECIES", localizedName).replaceAll("%TYPE", type);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,13 +13,10 @@ package forestry.arboriculture.network;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
|
|
||||||
import forestry.arboriculture.gadgets.TileLeaves;
|
|
||||||
import forestry.core.network.DataInputStreamForestry;
|
import forestry.core.network.DataInputStreamForestry;
|
||||||
import forestry.core.network.IPacketHandler;
|
import forestry.core.network.IPacketHandler;
|
||||||
import forestry.core.network.PacketId;
|
import forestry.core.network.PacketId;
|
||||||
import forestry.core.proxy.Proxies;
|
|
||||||
|
|
||||||
public class PacketHandlerArboriculture implements IPacketHandler {
|
public class PacketHandlerArboriculture implements IPacketHandler {
|
||||||
|
|
||||||
@@ -28,8 +25,7 @@ public class PacketHandlerArboriculture implements IPacketHandler {
|
|||||||
|
|
||||||
switch (packetID) {
|
switch (packetID) {
|
||||||
case RIPENING_UPDATE: {
|
case RIPENING_UPDATE: {
|
||||||
PacketRipeningUpdate packet = new PacketRipeningUpdate(data);
|
PacketRipeningUpdate.onPacketData(data);
|
||||||
onRipeningUpdate(packet);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -37,10 +33,4 @@ public class PacketHandlerArboriculture implements IPacketHandler {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void onRipeningUpdate(PacketRipeningUpdate packet) {
|
|
||||||
TileEntity tile = packet.getTarget(Proxies.common.getRenderWorld());
|
|
||||||
if (tile instanceof TileLeaves) {
|
|
||||||
((TileLeaves) tile).fromRipeningPacket(packet);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -12,17 +12,24 @@ package forestry.arboriculture.network;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
|
||||||
import forestry.arboriculture.gadgets.TileFruitPod;
|
import forestry.arboriculture.gadgets.TileFruitPod;
|
||||||
import forestry.arboriculture.gadgets.TileLeaves;
|
import forestry.arboriculture.gadgets.TileLeaves;
|
||||||
import forestry.core.network.DataInputStreamForestry;
|
import forestry.core.network.DataInputStreamForestry;
|
||||||
import forestry.core.network.DataOutputStreamForestry;
|
import forestry.core.network.DataOutputStreamForestry;
|
||||||
import forestry.core.network.PacketCoordinates;
|
import forestry.core.network.PacketCoordinates;
|
||||||
import forestry.core.network.PacketId;
|
import forestry.core.network.PacketId;
|
||||||
|
import forestry.core.proxy.Proxies;
|
||||||
|
|
||||||
public class PacketRipeningUpdate extends PacketCoordinates {
|
public class PacketRipeningUpdate extends PacketCoordinates {
|
||||||
|
|
||||||
private int value;
|
private int value;
|
||||||
|
|
||||||
|
public static void onPacketData(DataInputStreamForestry data) throws IOException {
|
||||||
|
new PacketRipeningUpdate(data);
|
||||||
|
}
|
||||||
|
|
||||||
public PacketRipeningUpdate(DataInputStreamForestry data) throws IOException {
|
public PacketRipeningUpdate(DataInputStreamForestry data) throws IOException {
|
||||||
super(data);
|
super(data);
|
||||||
}
|
}
|
||||||
@@ -40,13 +47,20 @@ public class PacketRipeningUpdate extends PacketCoordinates {
|
|||||||
@Override
|
@Override
|
||||||
public void writeData(DataOutputStreamForestry data) throws IOException {
|
public void writeData(DataOutputStreamForestry data) throws IOException {
|
||||||
super.writeData(data);
|
super.writeData(data);
|
||||||
data.writeInt(value);
|
data.writeVarInt(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readData(DataInputStreamForestry data) throws IOException {
|
public void readData(DataInputStreamForestry data) throws IOException {
|
||||||
super.readData(data);
|
super.readData(data);
|
||||||
value = data.readInt();
|
value = data.readVarInt();
|
||||||
|
|
||||||
|
TileEntity tile = getTarget(Proxies.common.getRenderWorld());
|
||||||
|
if (tile instanceof TileLeaves) {
|
||||||
|
((TileLeaves) tile).fromRipeningPacket(value);
|
||||||
|
} else if (tile instanceof TileFruitPod) {
|
||||||
|
((TileFruitPod) tile).fromRipeningPacket(value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getValue() {
|
public int getValue() {
|
||||||
|
|||||||
Executable → Regular
+1
-1
@@ -113,7 +113,7 @@ public class Config {
|
|||||||
public static float getBeehivesRate() {
|
public static float getBeehivesRate() {
|
||||||
return generateBeehivesRate;
|
return generateBeehivesRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isExUtilEnderLilyEnabled() {
|
public static boolean isExUtilEnderLilyEnabled() {
|
||||||
return ExUtilEnderLily;
|
return ExUtilEnderLily;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,11 +27,9 @@ import net.minecraftforge.fluids.Fluid;
|
|||||||
import net.minecraftforge.fluids.FluidStack;
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
import net.minecraftforge.fluids.FluidTankInfo;
|
import net.minecraftforge.fluids.FluidTankInfo;
|
||||||
|
|
||||||
import forestry.api.apiculture.BeeManager;
|
|
||||||
import forestry.api.core.ForestryAPI;
|
import forestry.api.core.ForestryAPI;
|
||||||
import forestry.api.core.IErrorState;
|
import forestry.api.core.IErrorState;
|
||||||
import forestry.api.genetics.AlleleManager;
|
import forestry.api.genetics.AlleleManager;
|
||||||
import forestry.api.genetics.IAllele;
|
|
||||||
import forestry.api.genetics.IIndividual;
|
import forestry.api.genetics.IIndividual;
|
||||||
import forestry.core.EnumErrorCode;
|
import forestry.core.EnumErrorCode;
|
||||||
import forestry.core.config.Defaults;
|
import forestry.core.config.Defaults;
|
||||||
@@ -39,6 +37,7 @@ import forestry.core.fluids.FluidHelper;
|
|||||||
import forestry.core.fluids.Fluids;
|
import forestry.core.fluids.Fluids;
|
||||||
import forestry.core.fluids.TankManager;
|
import forestry.core.fluids.TankManager;
|
||||||
import forestry.core.fluids.tanks.FilteredTank;
|
import forestry.core.fluids.tanks.FilteredTank;
|
||||||
|
import forestry.core.interfaces.IItemStackDisplay;
|
||||||
import forestry.core.interfaces.ILiquidTankContainer;
|
import forestry.core.interfaces.ILiquidTankContainer;
|
||||||
import forestry.core.inventory.InvTools;
|
import forestry.core.inventory.InvTools;
|
||||||
import forestry.core.inventory.TileInventoryAdapter;
|
import forestry.core.inventory.TileInventoryAdapter;
|
||||||
@@ -48,10 +47,12 @@ import forestry.core.inventory.wrappers.InventoryMapper;
|
|||||||
import forestry.core.network.DataInputStreamForestry;
|
import forestry.core.network.DataInputStreamForestry;
|
||||||
import forestry.core.network.DataOutputStreamForestry;
|
import forestry.core.network.DataOutputStreamForestry;
|
||||||
import forestry.core.network.GuiId;
|
import forestry.core.network.GuiId;
|
||||||
|
import forestry.core.network.PacketItemStackDisplay;
|
||||||
|
import forestry.core.proxy.Proxies;
|
||||||
import forestry.core.utils.GeneticsUtil;
|
import forestry.core.utils.GeneticsUtil;
|
||||||
import forestry.core.utils.GuiUtil;
|
import forestry.core.utils.GuiUtil;
|
||||||
|
|
||||||
public class TileAnalyzer extends TilePowered implements ISidedInventory, ILiquidTankContainer {
|
public class TileAnalyzer extends TilePowered implements ISidedInventory, ILiquidTankContainer, IItemStackDisplay {
|
||||||
|
|
||||||
/* CONSTANTS */
|
/* CONSTANTS */
|
||||||
public static final int TIME_TO_ANALYZE = 125;
|
public static final int TIME_TO_ANALYZE = 125;
|
||||||
@@ -148,7 +149,8 @@ public class TileAnalyzer extends TilePowered implements ISidedInventory, ILiqui
|
|||||||
|
|
||||||
if (added) {
|
if (added) {
|
||||||
setInventorySlotContents(SLOT_ANALYZE, null);
|
setInventorySlotContents(SLOT_ANALYZE, null);
|
||||||
setNeedsNetworkUpdate();
|
PacketItemStackDisplay packet = new PacketItemStackDisplay(this, getIndividualOnDisplay());
|
||||||
|
Proxies.net.sendNetworkPacket(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
setErrorCondition(!added, EnumErrorCode.NOSPACE);
|
setErrorCondition(!added, EnumErrorCode.NOSPACE);
|
||||||
@@ -183,7 +185,8 @@ public class TileAnalyzer extends TilePowered implements ISidedInventory, ILiqui
|
|||||||
}
|
}
|
||||||
setInventorySlotContents(SLOT_ANALYZE, inputStack);
|
setInventorySlotContents(SLOT_ANALYZE, inputStack);
|
||||||
slot.setStackInSlot(null);
|
slot.setStackInSlot(null);
|
||||||
setNeedsNetworkUpdate();
|
PacketItemStackDisplay packet = new PacketItemStackDisplay(this, getIndividualOnDisplay());
|
||||||
|
Proxies.net.sendNetworkPacket(packet);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -202,39 +205,19 @@ public class TileAnalyzer extends TilePowered implements ISidedInventory, ILiqui
|
|||||||
public void writeData(DataOutputStreamForestry data) throws IOException {
|
public void writeData(DataOutputStreamForestry data) throws IOException {
|
||||||
super.writeData(data);
|
super.writeData(data);
|
||||||
ItemStack displayStack = getIndividualOnDisplay();
|
ItemStack displayStack = getIndividualOnDisplay();
|
||||||
if (displayStack == null) {
|
data.writeItemStack(displayStack);
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readData(DataInputStreamForestry data) throws IOException {
|
public void readData(DataInputStreamForestry data) throws IOException {
|
||||||
super.readData(data);
|
super.readData(data);
|
||||||
|
individualOnDisplayClient = data.readItemStack();
|
||||||
|
}
|
||||||
|
|
||||||
ItemStack newIndividualOnDisplay = null;
|
@Override
|
||||||
if (data.readBoolean()) {
|
public void handleItemStackForDisplay(ItemStack itemStack) {
|
||||||
String individualUID = data.readUTF();
|
if (!ItemStack.areItemStacksEqual(itemStack, individualOnDisplayClient)) {
|
||||||
int type = data.readShort();
|
individualOnDisplayClient = itemStack;
|
||||||
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;
|
|
||||||
worldObj.func_147479_m(xCoord, yCoord, zCoord);
|
worldObj.func_147479_m(xCoord, yCoord, zCoord);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,10 @@ public class ContainerTile<T extends TileForestry> extends ContainerForestry {
|
|||||||
|
|
||||||
protected final T tile;
|
protected final T tile;
|
||||||
|
|
||||||
|
public ContainerTile(T tileForestry) {
|
||||||
|
this.tile = tileForestry;
|
||||||
|
}
|
||||||
|
|
||||||
public ContainerTile(T tileForestry, InventoryPlayer playerInventory, int xInv, int yInv) {
|
public ContainerTile(T tileForestry, InventoryPlayer playerInventory, int xInv, int yInv) {
|
||||||
this.tile = tileForestry;
|
this.tile = tileForestry;
|
||||||
|
|
||||||
|
|||||||
Executable → Regular
File mode changed.
@@ -61,11 +61,11 @@ public class PacketHandler {
|
|||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onPacket(ClientCustomPacketEvent event) {
|
public void onPacket(ClientCustomPacketEvent event) {
|
||||||
onPacketData(event.packet, null);
|
onPacketData(event.packet, Proxies.common.getPlayer());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns true if the packet has been handled */
|
/** Returns true if the packet has been handled */
|
||||||
private static boolean onPacketData(FMLProxyPacket fmlPacket, EntityPlayerMP player) {
|
private static boolean onPacketData(FMLProxyPacket fmlPacket, EntityPlayer player) {
|
||||||
InputStream is = new ByteBufInputStream(fmlPacket.payload());
|
InputStream is = new ByteBufInputStream(fmlPacket.payload());
|
||||||
DataInputStreamForestry data = new DataInputStreamForestry(is);
|
DataInputStreamForestry data = new DataInputStreamForestry(is);
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ public class PacketHandler {
|
|||||||
|
|
||||||
case PIPETTE_CLICK: {
|
case PIPETTE_CLICK: {
|
||||||
PacketSlotClick packet = new PacketSlotClick(data);
|
PacketSlotClick packet = new PacketSlotClick(data);
|
||||||
onPipetteClick(packet, player);
|
onPipetteClick(packet, (EntityPlayerMP) player);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
case SOLDERING_IRON_CLICK: {
|
case SOLDERING_IRON_CLICK: {
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public class BlockUtil {
|
|||||||
if (!(tile instanceof IEnergyReceiver)) {
|
if (!(tile instanceof IEnergyReceiver)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
IEnergyReceiver receptor = (IEnergyReceiver) tile;
|
IEnergyReceiver receptor = (IEnergyReceiver) tile;
|
||||||
return receptor.canConnectEnergy(side);
|
return receptor.canConnectEnergy(side);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,23 +41,23 @@ import forestry.plugins.PluginArboriculture;
|
|||||||
|
|
||||||
public class GeneticsUtil {
|
public class GeneticsUtil {
|
||||||
|
|
||||||
private static Set<Material> ersatzSpecimenMaterials;
|
private static Set<Block> ersatzSpecimenBlocks;
|
||||||
|
|
||||||
private static Set<Material> getErsatzSpecimenMaterials() {
|
private static Set<Block> getErsatzBlocks() {
|
||||||
if (ersatzSpecimenMaterials == null) {
|
if (ersatzSpecimenBlocks == null) {
|
||||||
ersatzSpecimenMaterials = new HashSet<Material>();
|
ersatzSpecimenBlocks = new HashSet<Block>();
|
||||||
for (ItemStack ersatzSpecimen : AlleleManager.ersatzSpecimen.keySet()) {
|
for (ItemStack ersatzSpecimen : AlleleManager.ersatzSpecimen.keySet()) {
|
||||||
Block ersatzBlock = StackUtils.getBlock(ersatzSpecimen);
|
Block ersatzBlock = StackUtils.getBlock(ersatzSpecimen);
|
||||||
if (ersatzBlock != null) {
|
if (ersatzBlock != null) {
|
||||||
ersatzSpecimenMaterials.add(ersatzBlock.getMaterial());
|
ersatzSpecimenBlocks.add(ersatzBlock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ersatzSpecimenMaterials;
|
return ersatzSpecimenBlocks;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isErsatzMaterial(Block block) {
|
private static boolean isErsatzBlock(Block block) {
|
||||||
return block != null && getErsatzSpecimenMaterials().contains(block.getMaterial());
|
return block != null && getErsatzBlocks().contains(block);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean hasNaturalistEye(EntityPlayer player) {
|
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) {
|
public static ITree getErsatzPollen(World world, final int x, final int y, final int z) {
|
||||||
Block block = world.getBlock(x, y, z);
|
Block block = world.getBlock(x, y, z);
|
||||||
if (!isErsatzMaterial(block)) {
|
if (!isErsatzBlock(block)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Executable → Regular
File mode changed.
Executable → Regular
+1
-1
@@ -98,7 +98,7 @@ public class MachineCarpenter extends TilePowered implements ISidedInventory, IL
|
|||||||
craftPreviewInventory = new InventoryCraftResult();
|
craftPreviewInventory = new InventoryCraftResult();
|
||||||
setInternalInventory(new CarpenterInventoryAdapter(this));
|
setInternalInventory(new CarpenterInventoryAdapter(this));
|
||||||
|
|
||||||
InvTools.configureSided(getInternalInventory(), Defaults.FACINGS, SLOT_BOX, 20);
|
InvTools.configureSided(getInternalInventory(), Defaults.FACINGS, SLOT_BOX, 21);
|
||||||
|
|
||||||
tankManager = new TankManager(resourceTank);
|
tankManager = new TankManager(resourceTank);
|
||||||
}
|
}
|
||||||
|
|||||||
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
@@ -76,7 +76,7 @@ public class GuiHandlerMail extends GuiHandlerBase {
|
|||||||
case TraderGUI:
|
case TraderGUI:
|
||||||
return new GuiTrader(player.inventory, getTileForestry(world, x, y, z, player, MachineTrader.class));
|
return new GuiTrader(player.inventory, getTileForestry(world, x, y, z, player, MachineTrader.class));
|
||||||
case TraderNameGUI:
|
case TraderNameGUI:
|
||||||
return new GuiTradeName(player.inventory, getTileForestry(world, x, y, z, player, MachineTrader.class));
|
return new GuiTradeName(getTileForestry(world, x, y, z, player, MachineTrader.class));
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
@@ -122,7 +122,7 @@ public class GuiHandlerMail extends GuiHandlerBase {
|
|||||||
case TraderGUI:
|
case TraderGUI:
|
||||||
return new ContainerTrader(player.inventory, getTileForestry(world, x, y, z, player, MachineTrader.class));
|
return new ContainerTrader(player.inventory, getTileForestry(world, x, y, z, player, MachineTrader.class));
|
||||||
case TraderNameGUI:
|
case TraderNameGUI:
|
||||||
return new ContainerTradeName(player.inventory, getTileForestry(world, x, y, z, player, MachineTrader.class));
|
return new ContainerTradeName(getTileForestry(world, x, y, z, player, MachineTrader.class));
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
|||||||
@@ -14,19 +14,21 @@ import java.io.IOException;
|
|||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.Container;
|
import net.minecraft.inventory.Container;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
|
||||||
import forestry.core.network.DataInputStreamForestry;
|
import forestry.core.network.DataInputStreamForestry;
|
||||||
import forestry.core.network.IPacketHandler;
|
import forestry.core.network.IPacketHandler;
|
||||||
import forestry.core.network.PacketId;
|
import forestry.core.network.PacketId;
|
||||||
import forestry.core.network.PacketString;
|
import forestry.core.network.PacketString;
|
||||||
import forestry.core.proxy.Proxies;
|
import forestry.core.proxy.Proxies;
|
||||||
|
import forestry.mail.gadgets.MachineTrader;
|
||||||
import forestry.mail.gui.ContainerCatalogue;
|
import forestry.mail.gui.ContainerCatalogue;
|
||||||
import forestry.mail.gui.ContainerLetter;
|
import forestry.mail.gui.ContainerLetter;
|
||||||
import forestry.mail.gui.ContainerTradeName;
|
|
||||||
import forestry.mail.gui.GuiMailboxInfo;
|
import forestry.mail.gui.GuiMailboxInfo;
|
||||||
import forestry.mail.network.PacketLetterInfo;
|
import forestry.mail.network.PacketLetterInfo;
|
||||||
import forestry.mail.network.PacketPOBoxInfo;
|
import forestry.mail.network.PacketPOBoxInfo;
|
||||||
import forestry.mail.network.PacketRequestLetterInfo;
|
import forestry.mail.network.PacketRequestLetterInfo;
|
||||||
|
import forestry.mail.network.PacketTraderAddress;
|
||||||
|
|
||||||
public class PacketHandlerMail implements IPacketHandler {
|
public class PacketHandlerMail implements IPacketHandler {
|
||||||
|
|
||||||
@@ -55,8 +57,8 @@ public class PacketHandlerMail implements IPacketHandler {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
case TRADING_ADDRESS_SET: {
|
case TRADING_ADDRESS_SET: {
|
||||||
PacketString packet = new PacketString(data);
|
PacketTraderAddress packet = new PacketTraderAddress(data);
|
||||||
onAddressSet(player, packet);
|
handleTradeAddressSet(player, packet);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
case POBOX_INFO_REQUEST: {
|
case POBOX_INFO_REQUEST: {
|
||||||
@@ -83,12 +85,15 @@ public class PacketHandlerMail implements IPacketHandler {
|
|||||||
GuiMailboxInfo.instance.setPOBoxInfo(packet.poboxInfo);
|
GuiMailboxInfo.instance.setPOBoxInfo(packet.poboxInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void onAddressSet(EntityPlayer player, PacketString packet) {
|
private static void handleTradeAddressSet(EntityPlayer player, PacketTraderAddress packet) {
|
||||||
if (!(player.openContainer instanceof ContainerTradeName)) {
|
TileEntity tile = packet.getTarget(player.worldObj);
|
||||||
|
if (!(tile instanceof MachineTrader)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
((ContainerTradeName) player.openContainer).handleSetAddress(packet);
|
String addressName = packet.getAddressName();
|
||||||
|
|
||||||
|
((MachineTrader) tile).handleSetAddress(addressName);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void onLetterText(EntityPlayer player, PacketString packet) {
|
private static void onLetterText(EntityPlayer player, PacketString packet) {
|
||||||
|
|||||||
@@ -36,9 +36,11 @@ import forestry.core.network.DataInputStreamForestry;
|
|||||||
import forestry.core.network.DataOutputStreamForestry;
|
import forestry.core.network.DataOutputStreamForestry;
|
||||||
import forestry.core.network.GuiId;
|
import forestry.core.network.GuiId;
|
||||||
import forestry.core.proxy.Proxies;
|
import forestry.core.proxy.Proxies;
|
||||||
|
import forestry.core.utils.EnumAccess;
|
||||||
import forestry.core.utils.StackUtils;
|
import forestry.core.utils.StackUtils;
|
||||||
import forestry.mail.MailAddress;
|
import forestry.mail.MailAddress;
|
||||||
import forestry.mail.TradeStation;
|
import forestry.mail.TradeStation;
|
||||||
|
import forestry.mail.network.PacketTraderAddress;
|
||||||
import forestry.mail.triggers.MailTriggers;
|
import forestry.mail.triggers.MailTriggers;
|
||||||
|
|
||||||
import buildcraft.api.statements.ITriggerExternal;
|
import buildcraft.api.statements.ITriggerExternal;
|
||||||
@@ -94,14 +96,23 @@ public class MachineTrader extends TileBase {
|
|||||||
@Override
|
@Override
|
||||||
public void writeData(DataOutputStreamForestry data) throws IOException {
|
public void writeData(DataOutputStreamForestry data) throws IOException {
|
||||||
super.writeData(data);
|
super.writeData(data);
|
||||||
data.writeUTF(address.getName());
|
String name = null;
|
||||||
|
if (address != null) {
|
||||||
|
name = address.getName();
|
||||||
|
}
|
||||||
|
if (name == null) {
|
||||||
|
name = "";
|
||||||
|
}
|
||||||
|
data.writeUTF(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readData(DataInputStreamForestry data) throws IOException {
|
public void readData(DataInputStreamForestry data) throws IOException {
|
||||||
super.readData(data);
|
super.readData(data);
|
||||||
String address = data.readUTF();
|
String address = data.readUTF();
|
||||||
this.address = PostManager.postRegistry.getMailAddress(address);
|
if (address.length() > 0) {
|
||||||
|
this.address = PostManager.postRegistry.getMailAddress(address);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* UPDATING */
|
/* UPDATING */
|
||||||
@@ -240,6 +251,22 @@ public class MachineTrader extends TileBase {
|
|||||||
return address;
|
return address;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void handleSetAddress(String addressName) {
|
||||||
|
IMailAddress address = PostManager.postRegistry.getMailAddress(addressName);
|
||||||
|
setAddress(address);
|
||||||
|
|
||||||
|
if (!worldObj.isRemote) {
|
||||||
|
IMailAddress newAddress = getAddress();
|
||||||
|
if (newAddress != null) {
|
||||||
|
String newAddressName = newAddress.getName();
|
||||||
|
if (newAddressName != null && newAddressName.equals(addressName)) {
|
||||||
|
PacketTraderAddress packetResponse = new PacketTraderAddress(this, addressName);
|
||||||
|
Proxies.net.sendNetworkPacket(packetResponse);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void setAddress(IMailAddress address) {
|
public void setAddress(IMailAddress address) {
|
||||||
if (address == null) {
|
if (address == null) {
|
||||||
throw new NullPointerException("address must not be null");
|
throw new NullPointerException("address must not be null");
|
||||||
@@ -260,6 +287,8 @@ public class MachineTrader extends TileBase {
|
|||||||
this.address = address;
|
this.address = address;
|
||||||
PostManager.postRegistry.getOrCreateTradeStation(worldObj, getOwner(), address);
|
PostManager.postRegistry.getOrCreateTradeStation(worldObj, getOwner(), address);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
this.address = address;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -273,6 +302,15 @@ public class MachineTrader extends TileBase {
|
|||||||
return (TradeStation) PostManager.postRegistry.getOrCreateTradeStation(worldObj, getOwner(), address);
|
return (TradeStation) PostManager.postRegistry.getOrCreateTradeStation(worldObj, getOwner(), address);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumAccess getAccess() {
|
||||||
|
if (isLinked()) {
|
||||||
|
return super.getAccess();
|
||||||
|
} else {
|
||||||
|
return EnumAccess.PRIVATE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* ITRIGGERPROVIDER */
|
/* ITRIGGERPROVIDER */
|
||||||
@Optional.Method(modid = "BuildCraftAPI|statements")
|
@Optional.Method(modid = "BuildCraftAPI|statements")
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -10,52 +10,33 @@
|
|||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package forestry.mail.gui;
|
package forestry.mail.gui;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.entity.player.InventoryPlayer;
|
|
||||||
import net.minecraft.inventory.Container;
|
|
||||||
|
|
||||||
import forestry.api.mail.IMailAddress;
|
import forestry.api.mail.IMailAddress;
|
||||||
import forestry.api.mail.PostManager;
|
import forestry.core.gui.ContainerTile;
|
||||||
import forestry.core.network.PacketId;
|
|
||||||
import forestry.core.network.PacketString;
|
|
||||||
import forestry.core.proxy.Proxies;
|
|
||||||
import forestry.mail.gadgets.MachineTrader;
|
import forestry.mail.gadgets.MachineTrader;
|
||||||
|
|
||||||
public class ContainerTradeName extends Container {
|
public class ContainerTradeName extends ContainerTile<MachineTrader> {
|
||||||
|
|
||||||
protected final MachineTrader machine;
|
public ContainerTradeName(MachineTrader tile) {
|
||||||
|
super(tile);
|
||||||
public ContainerTradeName(InventoryPlayer player, MachineTrader tile) {
|
|
||||||
machine = tile;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public IMailAddress getAddress() {
|
public IMailAddress getAddress() {
|
||||||
return machine.getAddress();
|
return tile.getAddress();
|
||||||
}
|
|
||||||
|
|
||||||
public void setAddress(String addressName) {
|
|
||||||
|
|
||||||
if (StringUtils.isBlank(addressName)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
PacketString packet = new PacketString(PacketId.TRADING_ADDRESS_SET, addressName);
|
|
||||||
Proxies.net.sendToServer(packet);
|
|
||||||
|
|
||||||
IMailAddress address = PostManager.postRegistry.getMailAddress(addressName);
|
|
||||||
machine.setAddress(address);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void handleSetAddress(PacketString packet) {
|
|
||||||
String addressName = packet.getString();
|
|
||||||
IMailAddress address = PostManager.postRegistry.getMailAddress(addressName);
|
|
||||||
machine.setAddress(address);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canInteractWith(EntityPlayer entityPlayer) {
|
public void detectAndSendChanges() {
|
||||||
return machine.isOwner(entityPlayer);
|
super.detectAndSendChanges();
|
||||||
|
|
||||||
|
if (tile.isLinked()) {
|
||||||
|
for (Object crafter : crafters) {
|
||||||
|
if (crafter instanceof EntityPlayer) {
|
||||||
|
EntityPlayer player = (EntityPlayer) crafter;
|
||||||
|
tile.openGui(player, tile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Executable → Regular
File mode changed.
@@ -13,23 +13,22 @@ package forestry.mail.gui;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import net.minecraft.client.gui.GuiTextField;
|
import net.minecraft.client.gui.GuiTextField;
|
||||||
import net.minecraft.entity.player.InventoryPlayer;
|
|
||||||
|
|
||||||
import org.lwjgl.input.Keyboard;
|
import org.lwjgl.input.Keyboard;
|
||||||
|
|
||||||
import forestry.core.config.Defaults;
|
import forestry.core.config.Defaults;
|
||||||
import forestry.core.gui.GuiForestry;
|
import forestry.core.gui.GuiForestry;
|
||||||
|
import forestry.core.proxy.Proxies;
|
||||||
import forestry.core.utils.StringUtil;
|
import forestry.core.utils.StringUtil;
|
||||||
import forestry.mail.gadgets.MachineTrader;
|
import forestry.mail.gadgets.MachineTrader;
|
||||||
|
import forestry.mail.network.PacketTraderAddress;
|
||||||
|
|
||||||
public class GuiTradeName extends GuiForestry<ContainerTradeName, MachineTrader> {
|
public class GuiTradeName extends GuiForestry<ContainerTradeName, MachineTrader> {
|
||||||
|
|
||||||
private GuiTextField addressNameField;
|
private GuiTextField addressNameField;
|
||||||
|
|
||||||
private boolean addressNameFocus;
|
public GuiTradeName(MachineTrader tile) {
|
||||||
|
super(Defaults.TEXTURE_PATH_GUI + "/tradername.png", new ContainerTradeName(tile), tile);
|
||||||
public GuiTradeName(InventoryPlayer inventoryplayer, MachineTrader tile) {
|
|
||||||
super(Defaults.TEXTURE_PATH_GUI + "/tradername.png", new ContainerTradeName(inventoryplayer, tile), tile);
|
|
||||||
this.xSize = 176;
|
this.xSize = 176;
|
||||||
this.ySize = 90;
|
this.ySize = 90;
|
||||||
}
|
}
|
||||||
@@ -51,8 +50,7 @@ public class GuiTradeName extends GuiForestry<ContainerTradeName, MachineTrader>
|
|||||||
// Set focus or enter text into address
|
// Set focus or enter text into address
|
||||||
if (addressNameField.isFocused()) {
|
if (addressNameField.isFocused()) {
|
||||||
if (eventKey == Keyboard.KEY_RETURN) {
|
if (eventKey == Keyboard.KEY_RETURN) {
|
||||||
addressNameFocus = true;
|
setAddress();
|
||||||
addressNameField.setFocused(false);
|
|
||||||
} else {
|
} else {
|
||||||
addressNameField.textboxKeyTyped(eventCharacter, eventKey);
|
addressNameField.textboxKeyTyped(eventCharacter, eventKey);
|
||||||
}
|
}
|
||||||
@@ -70,36 +68,24 @@ public class GuiTradeName extends GuiForestry<ContainerTradeName, MachineTrader>
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) {
|
protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) {
|
||||||
// Close gui screen if we linked up.
|
|
||||||
if (container.machine.isLinked()) {
|
|
||||||
this.mc.thePlayer.closeScreen();
|
|
||||||
this.mc.setIngameFocus();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check for focus changes
|
|
||||||
if (addressNameFocus && !addressNameField.isFocused()) {
|
|
||||||
this.setAddress();
|
|
||||||
}
|
|
||||||
addressNameFocus = addressNameField.isFocused();
|
|
||||||
|
|
||||||
super.drawGuiContainerBackgroundLayer(var1, var2, var3);
|
super.drawGuiContainerBackgroundLayer(var1, var2, var3);
|
||||||
|
|
||||||
String prompt = StringUtil.localize("gui.mail.nametrader");
|
String prompt = StringUtil.localize("gui.mail.nametrader");
|
||||||
fontRendererObj.drawString(prompt, guiLeft + this.getCenteredOffset(prompt), guiTop + 16, fontColor.get("gui.mail.text"));
|
fontRendererObj.drawString(prompt, guiLeft + this.getCenteredOffset(prompt), guiTop + 16, fontColor.get("gui.mail.text"));
|
||||||
addressNameField.drawTextBox();
|
addressNameField.drawTextBox();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onGuiClosed() {
|
public void onGuiClosed() {
|
||||||
setAddress();
|
|
||||||
super.onGuiClosed();
|
super.onGuiClosed();
|
||||||
|
setAddress();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setAddress() {
|
private void setAddress() {
|
||||||
String address = addressNameField.getText();
|
String address = addressNameField.getText();
|
||||||
if (StringUtils.isNotBlank(address)) {
|
if (StringUtils.isNotBlank(address)) {
|
||||||
container.setAddress(address);
|
PacketTraderAddress packet = new PacketTraderAddress(inventory, address);
|
||||||
|
Proxies.net.sendToServer(packet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -111,12 +111,20 @@ public class ItemLetter extends ItemInventoried {
|
|||||||
|
|
||||||
public static LetterState getState(int meta) {
|
public static LetterState getState(int meta) {
|
||||||
int ordinal = meta & 0x0f;
|
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) {
|
public static LetterSize getSize(int meta) {
|
||||||
int ordinal = meta >> 4;
|
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) {
|
public static LetterSize getSize(ILetter letter) {
|
||||||
@@ -167,23 +175,24 @@ public class ItemLetter extends ItemInventoried {
|
|||||||
switch (state) {
|
switch (state) {
|
||||||
case OPENED:
|
case OPENED:
|
||||||
if (letter.countAttachments() <= 0) {
|
if (letter.countAttachments() <= 0) {
|
||||||
int meta = encodeMeta(LetterState.EMPTIED, size);
|
state = LetterState.EMPTIED;
|
||||||
parent.setItemDamage(meta);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case FRESH:
|
case FRESH:
|
||||||
case STAMPED:
|
case STAMPED:
|
||||||
if (letter.isMailable() && letter.isPostPaid()) {
|
if (letter.isMailable() && letter.isPostPaid()) {
|
||||||
int meta = encodeMeta(LetterState.STAMPED, size);
|
state = LetterState.STAMPED;
|
||||||
parent.setItemDamage(meta);
|
|
||||||
} else {
|
} else {
|
||||||
int meta = encodeMeta(LetterState.FRESH, size);
|
state = LetterState.FRESH;
|
||||||
parent.setItemDamage(meta);
|
|
||||||
}
|
}
|
||||||
|
size = getSize(letter);
|
||||||
break;
|
break;
|
||||||
case EMPTIED:
|
case EMPTIED:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int meta = encodeMeta(state, size);
|
||||||
|
parent.setItemDamage(meta);
|
||||||
|
|
||||||
letter.writeToNBT(parent.getTagCompound());
|
letter.writeToNBT(parent.getTagCompound());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
/*******************************************************************************
|
||||||
|
* 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.mail.network;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import forestry.core.network.DataInputStreamForestry;
|
||||||
|
import forestry.core.network.DataOutputStreamForestry;
|
||||||
|
import forestry.core.network.PacketCoordinates;
|
||||||
|
import forestry.core.network.PacketId;
|
||||||
|
import forestry.mail.gadgets.MachineTrader;
|
||||||
|
|
||||||
|
public class PacketTraderAddress extends PacketCoordinates {
|
||||||
|
|
||||||
|
private String addressName;
|
||||||
|
|
||||||
|
public PacketTraderAddress(DataInputStreamForestry data) throws IOException {
|
||||||
|
super(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public PacketTraderAddress(MachineTrader tile, String addressName) {
|
||||||
|
super(PacketId.TRADING_ADDRESS_SET, tile);
|
||||||
|
|
||||||
|
this.addressName = addressName;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void writeData(DataOutputStreamForestry data) throws IOException {
|
||||||
|
super.writeData(data);
|
||||||
|
data.writeUTF(addressName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void readData(DataInputStreamForestry data) throws IOException {
|
||||||
|
super.readData(data);
|
||||||
|
|
||||||
|
addressName = data.readUTF();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAddressName() {
|
||||||
|
return addressName;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -297,6 +297,8 @@ public class PluginApiculture extends ForestryPlugin {
|
|||||||
createAlleles();
|
createAlleles();
|
||||||
BeeDefinition.initBees();
|
BeeDefinition.initBees();
|
||||||
|
|
||||||
|
AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement("forestry.speciesArgrarian", BeeDefinition.AGRARIAN.getGenome().getPrimary());
|
||||||
|
|
||||||
// Hives
|
// Hives
|
||||||
createHives();
|
createHives();
|
||||||
registerBeehiveDrops();
|
registerBeehiveDrops();
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||||||
import net.minecraft.util.WeightedRandomChestContent;
|
import net.minecraft.util.WeightedRandomChestContent;
|
||||||
|
|
||||||
import net.minecraftforge.common.ChestGenHooks;
|
import net.minecraftforge.common.ChestGenHooks;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
|
||||||
import net.minecraftforge.oredict.OreDictionary;
|
import net.minecraftforge.oredict.OreDictionary;
|
||||||
|
|
||||||
import cpw.mods.fml.common.IFuelHandler;
|
import cpw.mods.fml.common.IFuelHandler;
|
||||||
@@ -48,7 +47,6 @@ import forestry.api.genetics.IFruitFamily;
|
|||||||
import forestry.api.recipes.RecipeManagers;
|
import forestry.api.recipes.RecipeManagers;
|
||||||
import forestry.api.storage.ICrateRegistry;
|
import forestry.api.storage.ICrateRegistry;
|
||||||
import forestry.api.storage.StorageManager;
|
import forestry.api.storage.StorageManager;
|
||||||
import forestry.arboriculture.EventHandlerArboriculture;
|
|
||||||
import forestry.arboriculture.FruitProviderNone;
|
import forestry.arboriculture.FruitProviderNone;
|
||||||
import forestry.arboriculture.FruitProviderPod;
|
import forestry.arboriculture.FruitProviderPod;
|
||||||
import forestry.arboriculture.FruitProviderPod.EnumPodType;
|
import forestry.arboriculture.FruitProviderPod.EnumPodType;
|
||||||
@@ -338,8 +336,6 @@ public class PluginArboriculture extends ForestryPlugin {
|
|||||||
GameRegistry.registerTileEntity(TileFruitPod.class, "forestry.Pods");
|
GameRegistry.registerTileEntity(TileFruitPod.class, "forestry.Pods");
|
||||||
definitionChest.register();
|
definitionChest.register();
|
||||||
|
|
||||||
MinecraftForge.EVENT_BUS.register(new EventHandlerArboriculture());
|
|
||||||
|
|
||||||
if (Config.enableVillager) {
|
if (Config.enableVillager) {
|
||||||
VillagerRegistry.instance().registerVillagerId(Defaults.ID_VILLAGER_LUMBERJACK);
|
VillagerRegistry.instance().registerVillagerId(Defaults.ID_VILLAGER_LUMBERJACK);
|
||||||
Proxies.render.registerVillagerSkin(Defaults.ID_VILLAGER_LUMBERJACK, Defaults.TEXTURE_SKIN_LUMBERJACK);
|
Proxies.render.registerVillagerSkin(Defaults.ID_VILLAGER_LUMBERJACK, Defaults.TEXTURE_SKIN_LUMBERJACK);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public class PluginBuildCraftRecipes extends ForestryPlugin {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isAvailable() {
|
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
|
@Override
|
||||||
|
|||||||
@@ -97,6 +97,10 @@ public class PluginManager {
|
|||||||
PLANTMEGAPACK(new PluginPlantMegaPack()),
|
PLANTMEGAPACK(new PluginPlantMegaPack()),
|
||||||
WITCHERY(new PluginWitchery());
|
WITCHERY(new PluginWitchery());
|
||||||
|
|
||||||
|
static {
|
||||||
|
ForestryAPI.enabledPlugins = new HashSet<String>();
|
||||||
|
}
|
||||||
|
|
||||||
private final ForestryPlugin instance;
|
private final ForestryPlugin instance;
|
||||||
private final boolean canBeDisabled;
|
private final boolean canBeDisabled;
|
||||||
|
|
||||||
@@ -220,7 +224,6 @@ public class PluginManager {
|
|||||||
unloadedModules.removeAll(toLoad);
|
unloadedModules.removeAll(toLoad);
|
||||||
loadedModules.addAll(toLoad);
|
loadedModules.addAll(toLoad);
|
||||||
|
|
||||||
ForestryAPI.enabledPlugins = new HashSet<String>();
|
|
||||||
for (Module m : loadedModules) {
|
for (Module m : loadedModules) {
|
||||||
ForestryAPI.enabledPlugins.add(m.toString());
|
ForestryAPI.enabledPlugins.add(m.toString());
|
||||||
}
|
}
|
||||||
|
|||||||
Executable → Regular
File mode changed.
Reference in new issue
Block a user