use of forestry.greenhouse.api.climate.IClimateSourceOwner in project ForestryMC by ForestryMC.
the class ClimateSourceWorldManager method removeSource.
public void removeSource(IClimateSourceOwner owner) {
BlockPos pos = owner.getCoordinates();
Position2D position = new Position2D(pos);
Map<Integer, IClimateSourceOwner> positionedOwners = owners.computeIfAbsent(position, k -> new HashMap<>());
positionedOwners.remove(pos.getY());
}
use of forestry.greenhouse.api.climate.IClimateSourceOwner in project ForestryMC by ForestryMC.
the class ClimateSourceWorldManager method addSource.
public void addSource(IClimateSourceOwner owner) {
BlockPos pos = owner.getCoordinates();
Position2D position = new Position2D(pos);
Map<Integer, IClimateSourceOwner> positionedOwners = owners.computeIfAbsent(position, k -> new HashMap<>());
positionedOwners.put(pos.getY(), owner);
}
use of forestry.greenhouse.api.climate.IClimateSourceOwner in project ForestryMC by ForestryMC.
the class WallBlock method onCreate.
@Override
public void onCreate() {
IClimateContainer container = provider.getClimateContainer();
for (IClimateSourceOwner sourceOwner : GreenhouseManager.climateManager.getSources(provider.getWorld(), new Position2D(pos))) {
IClimateSource source = sourceOwner.getClimateSource();
sources.add(source);
container.addClimateSource(source);
source.onAdded(container);
}
}
use of forestry.greenhouse.api.climate.IClimateSourceOwner in project ForestryMC by ForestryMC.
the class CircuitClimateSource method onRemoval.
@Override
public void onRemoval(int slot, Object tile) {
IClimateSourceOwner owner = getCircuitable(tile);
if (owner == null) {
return;
}
IClimateSource source = owner.getClimateSource();
if (!(source instanceof IClimateSourceCircuitable)) {
return;
}
((IClimateSourceCircuitable) source).changeSourceConfig(type, -changeChange, -rangeChange, -energyChange);
}
use of forestry.greenhouse.api.climate.IClimateSourceOwner in project ForestryMC by ForestryMC.
the class CircuitClimateSource method onInsertion.
@Override
public void onInsertion(int slot, Object tile) {
IClimateSourceOwner owner = getCircuitable(tile);
if (owner == null) {
return;
}
IClimateSource source = owner.getClimateSource();
if (!(source instanceof IClimateSourceCircuitable)) {
return;
}
((IClimateSourceCircuitable) source).changeSourceConfig(type, changeChange, rangeChange, energyChange);
}
Aggregations