mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-17 10:55:06 +00:00
First 1.8.9 Version
This commit is contained in:
1 parent
d35cc1df09
commit
5a3850c264
1657 files changed
+26844
-13269
No files matched your search
@@ -27,7 +27,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
@@ -171,8 +171,8 @@ public class FarmController extends RectangularMultiblockControllerBase implemen
|
||||
|
||||
private BiomeGenBase getBiome() {
|
||||
if (cachedBiome == null) {
|
||||
ChunkCoordinates coords = getReferenceCoord();
|
||||
cachedBiome = worldObj.getBiomeGenForCoords(coords.posX, coords.posZ);
|
||||
BlockPos coords = getReferenceCoord();
|
||||
cachedBiome = worldObj.getBiomeGenForCoords(coords);
|
||||
}
|
||||
return cachedBiome;
|
||||
}
|
||||
@@ -337,9 +337,9 @@ public class FarmController extends RectangularMultiblockControllerBase implemen
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChunkCoordinates getCoordinates() {
|
||||
ChunkCoordinates coord = getReferenceCoord();
|
||||
return new ChunkCoordinates(coord);
|
||||
public BlockPos getCoordinates() {
|
||||
BlockPos coord = getReferenceCoord();
|
||||
return new BlockPos(coord);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -349,7 +349,7 @@ public class FarmController extends RectangularMultiblockControllerBase implemen
|
||||
for (IMultiblockComponent part : connectedParts) {
|
||||
if (part instanceof TileEntity) {
|
||||
TileEntity tile = (TileEntity) part;
|
||||
tile.getWorldObj().notifyBlocksOfNeighborChange(tile.xCoord, tile.yCoord, tile.zCoord, tile.getBlockType());
|
||||
tile.getWorld().notifyBlockOfStateChange(tile.getPos(), tile.getBlockType());
|
||||
}
|
||||
}
|
||||
markDirty();
|
||||
@@ -387,8 +387,8 @@ public class FarmController extends RectangularMultiblockControllerBase implemen
|
||||
|
||||
@Override
|
||||
public EnumTemperature getTemperature() {
|
||||
ChunkCoordinates coords = getReferenceCoord();
|
||||
return EnumTemperature.getFromBiome(getBiome(), coords.posX, coords.posY, coords.posZ);
|
||||
BlockPos coords = getReferenceCoord();
|
||||
return EnumTemperature.getFromBiome(getBiome(), coords);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -398,8 +398,8 @@ public class FarmController extends RectangularMultiblockControllerBase implemen
|
||||
|
||||
@Override
|
||||
public float getExactTemperature() {
|
||||
ChunkCoordinates coords = getReferenceCoord();
|
||||
return getBiome().getFloatTemperature(coords.posX, coords.posY, coords.posZ);
|
||||
BlockPos coords = getReferenceCoord();
|
||||
return getBiome().getFloatTemperature(coords);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -414,8 +414,8 @@ public class FarmController extends RectangularMultiblockControllerBase implemen
|
||||
@Override
|
||||
public int[] getCoords() {
|
||||
if (coords == null) {
|
||||
ChunkCoordinates centerCoord = getCenterCoord();
|
||||
coords = new int[]{centerCoord.posX, centerCoord.posY, centerCoord.posZ};
|
||||
BlockPos centerCoord = getCenterCoord();
|
||||
coords = new int[]{centerCoord.getX(), centerCoord.getY(), centerCoord.getZ()};
|
||||
}
|
||||
return coords;
|
||||
}
|
||||
@@ -524,11 +524,11 @@ public class FarmController extends RectangularMultiblockControllerBase implemen
|
||||
private void setUpFarmlandTargets() {
|
||||
Vect targetStart = new Vect(getCoords());
|
||||
|
||||
ChunkCoordinates max = getMaximumCoord();
|
||||
ChunkCoordinates min = getMinimumCoord();
|
||||
BlockPos max = getMaximumCoord();
|
||||
BlockPos min = getMinimumCoord();
|
||||
|
||||
int sizeNorthSouth = Math.abs(max.posZ - min.posZ) + 1;
|
||||
int sizeEastWest = Math.abs(max.posX - min.posX) + 1;
|
||||
int sizeNorthSouth = Math.abs(max.getZ() - min.getZ()) + 1;
|
||||
int sizeEastWest = Math.abs(max.getX() - min.getX()) + 1;
|
||||
|
||||
// Set the maximum allowed extent.
|
||||
allowedExtent = Math.max(sizeNorthSouth, sizeEastWest) * Config.farmSize + 1;
|
||||
@@ -665,9 +665,9 @@ public class FarmController extends RectangularMultiblockControllerBase implemen
|
||||
|
||||
private static boolean cultivateTarget(FarmTarget target, IFarmLogic logic, Iterable<IFarmListener> farmListeners) {
|
||||
Vect targetPosition = target.getStart().add(0, target.getYOffset(), 0);
|
||||
if (logic.cultivate(targetPosition.x, targetPosition.y, targetPosition.z, target.getDirection(), target.getExtent())) {
|
||||
if (logic.cultivate(targetPosition, target.getDirection(), target.getExtent())) {
|
||||
for (IFarmListener listener : farmListeners) {
|
||||
listener.hasCultivated(logic, targetPosition.x, targetPosition.y, targetPosition.z, target.getDirection(), target.getExtent());
|
||||
listener.hasCultivated(logic, targetPosition, target.getDirection(), target.getExtent());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -689,14 +689,15 @@ public class FarmController extends RectangularMultiblockControllerBase implemen
|
||||
}
|
||||
|
||||
private static Collection<ICrop> harvestTarget(FarmTarget target, IFarmLogic logic, Iterable<IFarmListener> farmListeners) {
|
||||
Collection<ICrop> harvested = logic.harvest(target.getStart().x, target.getStart().y + target.getYOffset(), target.getStart().z, target.getDirection(), target.getExtent());
|
||||
BlockPos pos = new BlockPos(target.getStart().getX(), target.getStart().getX() + target.getYOffset(), target.getStart().getZ());
|
||||
Collection<ICrop> harvested = logic.harvest(pos, target.getDirection(), target.getExtent());
|
||||
if (harvested == null || harvested.size() == 0) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
// Let event handlers know.
|
||||
for (IFarmListener listener : farmListeners) {
|
||||
listener.hasScheduledHarvest(harvested, logic, target.getStart().x, target.getStart().y + target.getYOffset(), target.getStart().z, target.getDirection(), target.getExtent());
|
||||
listener.hasScheduledHarvest(harvested, logic, pos, target.getDirection(), target.getExtent());
|
||||
}
|
||||
|
||||
return harvested;
|
||||
@@ -787,9 +788,9 @@ public class FarmController extends RectangularMultiblockControllerBase implemen
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean plantGermling(IFarmable germling, World world, int x, int y, int z) {
|
||||
public boolean plantGermling(IFarmable germling, World world, BlockPos pos) {
|
||||
EntityPlayer player = PlayerUtil.getPlayer(world, getAccessHandler().getOwner());
|
||||
return inventory.plantGermling(germling, player, x, y, z);
|
||||
return inventory.plantGermling(germling, player, pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user