Revert greenhouse climate changes. Close #1319

This commit is contained in:
mezz committed 2016-06-13 15:27:19 -07:00
1 parent 8639148f20
commit f400241ff4
47 files changed
+515 -952

No files matched your search

@@ -10,7 +10,7 @@ import forestry.api.multiblock.IGreenhouseController;
public class DefaultGreenhouseListener implements IGreenhouseListener {
@Override
public boolean canWork(IGreenhouseController greenhouse, boolean canWork) {
public <G extends IGreenhouseController & IGreenhouseHousing> boolean canWork(G greenhouse, boolean canWork) {
return true;
}
@@ -18,15 +18,14 @@ import net.minecraftforge.fml.common.eventhandler.Event;
import forestry.api.core.EnumCamouflageType;
import forestry.api.core.ICamouflageHandler;
import forestry.api.core.ICamouflagedTile;
import forestry.api.multiblock.IGreenhouseController;
public class GreenhouseEvents extends Event {
@Nullable
public final IGreenhouseController controller;
public final IGreenhouseState state;
public GreenhouseEvents(@Nullable IGreenhouseController state) {
this.controller = state;
public GreenhouseEvents(@Nullable IGreenhouseState state) {
this.state = state;
}
public static class CamouflageChangeEvent extends GreenhouseEvents{
@@ -38,8 +37,8 @@ public class GreenhouseEvents extends Event {
@Nonnull
public final EnumCamouflageType camouflageType;
public CamouflageChangeEvent(IGreenhouseController controller, @Nullable ICamouflagedTile camouflagedBlock, @Nonnull ICamouflageHandler camouflageHandler, @Nonnull EnumCamouflageType camouflageType) {
super(controller);
public CamouflageChangeEvent(IGreenhouseState state, @Nullable ICamouflagedTile camouflagedBlock, @Nonnull ICamouflageHandler camouflageHandler, @Nonnull EnumCamouflageType camouflageType) {
super(state);
this.camouflagedBlock = camouflagedBlock;
this.camouflageHandler = camouflageHandler;
@@ -52,8 +51,8 @@ public class GreenhouseEvents extends Event {
@Nonnull
public IInternalBlock internalBlock;
public InternalBlockEvent(IGreenhouseController controller, @Nonnull IInternalBlock internalBlock) {
super(controller);
public InternalBlockEvent(IGreenhouseState state, @Nonnull IInternalBlock internalBlock) {
super(state);
this.internalBlock = internalBlock;
}
@@ -61,8 +60,8 @@ public class GreenhouseEvents extends Event {
public static class CreateInternalBlockEvent extends InternalBlockEvent{
public CreateInternalBlockEvent(IGreenhouseController controller, IInternalBlock internalBlock) {
super(controller, internalBlock);
public CreateInternalBlockEvent(IGreenhouseState state, IInternalBlock internalBlock) {
super(state, internalBlock);
}
}
@@ -71,8 +70,8 @@ public class GreenhouseEvents extends Event {
@Nonnull
public final IInternalBlockFace face;
public CheckInternalBlockFaceEvent(IGreenhouseController controller, IInternalBlock internalBlock, @Nonnull IInternalBlockFace face) {
super(controller, internalBlock);
public CheckInternalBlockFaceEvent(IGreenhouseState state, IInternalBlock internalBlock, @Nonnull IInternalBlockFace face) {
super(state, internalBlock);
this.face = face;
}
@@ -5,15 +5,14 @@
******************************************************************************/
package forestry.api.greenhouse;
import forestry.api.multiblock.IGreenhouseController;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
public interface IGreenhouseHelper {
/**
* @return A {@link IGreenhouseController} of a greenhouse, when the pos is a greenhouse
* @return A {@link IGreenhouseState} of a greenhouse, when the pos is a greenhouse
*/
IGreenhouseController getGreenhouseController(World world, BlockPos pos);
IGreenhouseState getGreenhouseState(World world, BlockPos pos);
}
@@ -10,12 +10,12 @@ import forestry.api.multiblock.IGreenhouseController;
public interface IGreenhouseListener {
/**
* Called before the greenhouse update the climate system.
* Called before the greenhouse work.
*
* @param greenhouse The greenhouse of the listener.
* @param greenhouse The greenhouse multiblock.
* @param canWork The actual {@link Boolean} value.
* @return True if the greenhouse can update the climate.
* @return True if the greenhouse can work.
*/
boolean canWork(IGreenhouseController greenhouse, boolean canWork);
<G extends IGreenhouseController & IGreenhouseHousing> boolean canWork(G greenhouse, boolean canWork);
}
@@ -0,0 +1,29 @@
/*******************************************************************************
* Copyright 2011-2014 SirSengir
*
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
******************************************************************************/
package forestry.api.greenhouse;
import java.util.Collection;
import java.util.Set;
import forestry.api.core.EnumHumidity;
import forestry.api.core.EnumTemperature;
import forestry.api.multiblock.IMultiblockComponent;
public interface IGreenhouseState {
EnumTemperature getTemperature();
EnumHumidity getHumidity();
float getExactTemperature();
float getExactHumidity();
Set<IInternalBlock> getInternalBlocks();
Collection<IMultiblockComponent> getGreenhouseComponents();
}
@@ -7,7 +7,6 @@ package forestry.api.greenhouse;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Collection;
import net.minecraft.util.math.BlockPos;