Compare commits

..
9 Commits
31 changed files with 138 additions and 107 deletions

No files matched your search

-1
View File
@@ -161,7 +161,6 @@ curseforge {
changelog = file('changelog.html')
changelogType = 'html'
releaseType = 'beta'
addGameVersion '1.12'
}
}
+7 -7
View File
@@ -1,14 +1,14 @@
mcversion=1.12.1
forgeversion=14.22.0.2474
mcp_mappings=snapshot_20170904
mcversion=1.12.2
forgeversion=14.23.0.2501
mcp_mappings=snapshot_20170918
curse_project_id=59751
tesla_version=1.0.60
tesla_mcversion=1.12
jei_version=4.7.8.92
jei_mcversion=1.12.1
jei_version=4.8.0.103
jei_mcversion=1.12.2
ic2_version=2.8.24-ex112
version_major=5
version_minor=5
version_patch=5
version_minor=6
version_patch=0
+5 -2
View File
@@ -32,6 +32,7 @@ import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.registry.GameRegistry;
import forestry.api.core.ForestryAPI;
import forestry.api.core.ForestryEvent;
import forestry.core.EventHandlerCore;
import forestry.core.climate.ClimateStates;
import forestry.core.config.Config;
@@ -58,8 +59,8 @@ import forestry.plugins.compat.PluginNatura;
name = Constants.MOD_NAME,
version = Constants.VERSION,
guiFactory = "forestry.core.config.ForestryGuiConfigFactory",
acceptedMinecraftVersions = "[1.12, 1.12.1]",
dependencies = "required-after:forge@[14.21.1.2395,);"
acceptedMinecraftVersions = "[1.12.2,1.13.0)",
dependencies = "required-after:forge@[14.23.0.2500,);"
+ "after:jei@[4.7.8.91,);"
+ "after:" + PluginIC2.modId + ";"
+ "after:" + PluginNatura.modId + ";"
@@ -104,6 +105,8 @@ public class Forestry {
configFolder = new File(event.getModConfigurationDirectory(), Constants.MOD_ID);
Config.load(event.getSide());
MinecraftForge.EVENT_BUS.post(new ForestryEvent.PreInit(this, event));
PluginManager.runSetup(event);
String gameMode = Config.gameMode;
@@ -14,6 +14,7 @@ public interface IBeeFactory {
* Automatically registered with AlleleManager.alleleRegistry.registerAllele()
* See IAlleleBeeSpeciesBuilder and IAlleleSpeciesBuilder for adding additional properties to the returned species.
*
* @param modId The modId of the mod that is creating the species
* @param uid Unique Identifier for this species
* @param dominant Whether this species is genetically dominant (false means it is recessive)
* @param authority Authority for the binomial name, e.g. "Sengir" on species of base Forestry.
@@ -24,8 +25,9 @@ public interface IBeeFactory {
* @param primaryColor The outline color of this species
* @param secondaryColor The body color of this species
* @return a new bee species allele.
* @since Forestry 5.6.0.
*/
IAlleleBeeSpeciesBuilder createSpecies(String uid, boolean dominant, String authority, String unlocalizedName, String unlocalizedDescription, IClassification branch, String binomial, int primaryColor, int secondaryColor);
IAlleleBeeSpeciesBuilder createSpecies(String modId, String uid, boolean dominant, String authority, String unlocalizedName, String unlocalizedDescription, IClassification branch, String binomial, int primaryColor, int secondaryColor);
/**
* Creates a new bee branch.
@@ -36,4 +38,10 @@ public interface IBeeFactory {
* @return a new bee branch
*/
IClassification createBranch(String uid, String scientific);
/**
* @deprecated since Forestry 5.6.0. use {@link #createSpecies(String, String, boolean, String, String, String, IClassification, String, int, int)}
*/
@Deprecated
IAlleleBeeSpeciesBuilder createSpecies(String uid, boolean dominant, String authority, String unlocalizedName, String unlocalizedDescription, IClassification branch, String binomial, int primaryColor, int secondaryColor);
}
@@ -5,32 +5,12 @@
******************************************************************************/
package forestry.api.arboriculture;
import javax.annotation.Nullable;
import java.awt.Color;
import forestry.api.genetics.IClassification;
public interface ITreeFactory {
/**
* Creates a new tree species.
* Automatically registered with AlleleManager.alleleRegistry.registerAllele()
* See IAlleleTreeSpeciesBuilder and IAlleleSpeciesBuilder for adding additional properties to the returned species.
*
* @param uid Unique Identifier for this species
* @param unlocalizedName Unlocalized name for this species
* @param authority Authority for the binomial name, e.g. "Sengir" on species of base Forestry.
* @param unlocalizedDescription Unlocalized description for this species
* @param dominant Whether this species is genetically dominant (false means it is recessive)
* @param branch Classification of this species
* @param binomial Binomial name of the species sans genus. "humboldti" will have the bee species flavour name be "Apis humboldti". Feel free to use fun names or null.
* @param modID The modID from the mod of the species
* @param leafSpriteProvider The leaf sprite provider for this species
* @param germlingModelProvider The germling model provider for this species
* @param woodProvider The wood texture provider. It is used to get wood textures for the charcoal pile.
* @param generator The tree generator
* @return a new tree species allele.
*/
IAlleleTreeSpeciesBuilder createSpecies(String uid, String unlocalizedName, String authority, String unlocalizedDescription, boolean dominant, IClassification branch, String binomial, String modID, ILeafSpriteProvider leafSpriteProvider, IGermlingModelProvider germlingModelProvider, IWoodProvider woodProvider, ITreeGenerator generator);
/**
* Creates a new tree species.
* Automatically registered with AlleleManager.alleleRegistry.registerAllele()
@@ -48,10 +28,18 @@ public interface ITreeFactory {
* @param germlingModelProvider The germling model provider for this species
* @param woodProvider The wood texture provider. It is used to get wood textures for the charcoal pile.
* @param generator The tree generator
* @param leafProvider The leaf provider
* @return a new tree species allele.
*/
IAlleleTreeSpeciesBuilder createSpecies(String uid, String unlocalizedName, String authority, String unlocalizedDescription, boolean dominant, IClassification branch, String binomial, String modID, ILeafSpriteProvider leafSpriteProvider, IGermlingModelProvider germlingModelProvider, IWoodProvider woodProvider, ITreeGenerator generator, ILeafProvider leafProvider);
IAlleleTreeSpeciesBuilder createSpecies(String uid, String unlocalizedName, String authority, String unlocalizedDescription, boolean dominant, IClassification branch, String binomial, String modID, ILeafSpriteProvider leafSpriteProvider, IGermlingModelProvider germlingModelProvider, IWoodProvider woodProvider, ITreeGenerator generator, @Nullable ILeafProvider leafProvider);
/**
* @deprecated since Forestry 5.6.0. use {@link #createSpecies(String, String, String, String, boolean, IClassification, String, String, ILeafSpriteProvider, IGermlingModelProvider, IWoodProvider, ITreeGenerator, ILeafProvider)}
*/
@Deprecated
IAlleleTreeSpeciesBuilder createSpecies(String uid, String unlocalizedName, String authority, String unlocalizedDescription, boolean dominant, IClassification branch, String binomial, String modID, ILeafSpriteProvider leafSpriteProvider, IGermlingModelProvider germlingModelProvider, IWoodProvider woodProvider, ITreeGenerator generator);
/**
* Get one of the built-in Forestry leaf types. Default type is deciduous.
*/
@@ -5,13 +5,17 @@
******************************************************************************/
package forestry.api.core;
import net.minecraft.entity.player.EntityPlayer;
import com.mojang.authlib.GameProfile;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.eventhandler.Event;
import forestry.api.genetics.IAlleleSpecies;
import forestry.api.genetics.IBreedingTracker;
import forestry.api.genetics.IMutation;
import forestry.api.genetics.ISpeciesRoot;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.fml.common.eventhandler.Event;
public abstract class ForestryEvent extends Event {
@@ -53,6 +57,21 @@ public abstract class ForestryEvent extends Event {
this.tracker = tracker;
this.player = player;
}
}
/**
* Posted before forestry registers all items and blocks.
*/
public static class PreInit extends ForestryEvent{
/**
* The main mod instance for Forestry.
*/
public Object instance;
public final FMLPreInitializationEvent event;
public PreInit(Object instance, FMLPreInitializationEvent event) {
this.instance = instance;
this.event = event;
}
}
}
@@ -5,10 +5,11 @@
******************************************************************************/
@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
@API(apiVersion = "5.1.0", owner = "Forestry", provides = "ForestryAPI|core")
@API(apiVersion = "5.2.0", owner = "Forestry", provides = "ForestryAPI|core")
package forestry.api.core;
import javax.annotation.ParametersAreNonnullByDefault;
import mcp.MethodsReturnNonnullByDefault;
import net.minecraftforge.fml.common.API;
import mcp.MethodsReturnNonnullByDefault;
@@ -21,6 +21,14 @@ public interface IAllele {
*/
String getUID();
/**
* @return modId of the mod that created this allele
* @since Forestry 5.6.0
*/
default String getModID() {
return "forestry";
}
/**
* @return true if the allele is dominant, false otherwise.
*/
@@ -994,12 +994,13 @@ public enum BeeDefinition implements IBeeDefinition {
String lowercaseName = this.toString().toLowerCase(Locale.ENGLISH);
String species = "species" + WordUtils.capitalize(lowercaseName);
String uid = Constants.MOD_ID + '.' + species;
String modId = Constants.MOD_ID;
String uid = modId + '.' + species;
String description = "for.description." + species;
String name = "for.bees.species." + lowercaseName;
this.branch = branch;
IAlleleBeeSpeciesBuilder speciesBuilder = BeeManager.beeFactory.createSpecies(uid, dominant, "Sengir", name, description, branch.getBranch(), binomial, primary.getRGB(), secondary.getRGB());
IAlleleBeeSpeciesBuilder speciesBuilder = BeeManager.beeFactory.createSpecies(modId, uid, dominant, "Sengir", name, description, branch.getBranch(), binomial, primary.getRGB(), secondary.getRGB());
if (isSecret()) {
speciesBuilder.setIsSecret();
}
@@ -17,8 +17,10 @@ import forestry.api.genetics.IClassification;
import forestry.apiculture.genetics.alleles.AlleleBeeSpecies;
public class BeeFactory implements IBeeFactory {
@Override
public IAlleleBeeSpeciesBuilder createSpecies(
String modId,
String uid,
boolean dominant,
String authority,
@@ -35,11 +37,17 @@ public class BeeFactory implements IBeeFactory {
Preconditions.checkNotNull(branch);
Preconditions.checkNotNull(binomial);
return new AlleleBeeSpecies(uid, unlocalizedName, authority, unlocalizedDescription, dominant, branch, binomial, primaryColor, secondaryColor);
return new AlleleBeeSpecies(modId, uid, unlocalizedName, authority, unlocalizedDescription, dominant, branch, binomial, primaryColor, secondaryColor);
}
@Override
public IClassification createBranch(String uid, String scientific) {
return new BranchBees(uid, scientific);
}
@Override
@Deprecated
public IAlleleBeeSpeciesBuilder createSpecies(String uid, boolean dominant, String authority, String unlocalizedName, String unlocalizedDescription, IClassification branch, String binomial, int primaryColor, int secondaryColor) {
return createSpecies("forestry", uid, dominant, authority, unlocalizedName, unlocalizedDescription, branch, binomial, primaryColor, secondaryColor);
}
}
@@ -51,8 +51,8 @@ public class AlleleBeeSpecies extends AlleleSpecies implements IAlleleBeeSpecies
private IJubilanceProvider jubilanceProvider;
private boolean nocturnal = false;
public AlleleBeeSpecies(String uid, String unlocalizedName, String authority, String unlocalizedDescription, boolean dominant, IClassification branch, String binomial, int primaryColor, int secondaryColor) {
super(uid, unlocalizedName, authority, unlocalizedDescription, dominant, branch, binomial);
public AlleleBeeSpecies(String modId, String uid, String unlocalizedName, String authority, String unlocalizedDescription, boolean dominant, IClassification branch, String binomial, int primaryColor, int secondaryColor) {
super(modId, uid, unlocalizedName, authority, unlocalizedDescription, dominant, branch, binomial);
beeModelProvider = DefaultBeeModelProvider.instance;
beeSpriteColourProvider = new DefaultBeeSpriteColourProvider(primaryColor, secondaryColor);
@@ -26,8 +26,9 @@ import forestry.arboriculture.models.SpriteProviderLeaves;
public class TreeFactory implements ITreeFactory {
@Override
@Deprecated
public IAlleleTreeSpeciesBuilder createSpecies(String uid, String unlocalizedName, String authority, String unlocalizedDescription, boolean dominant, IClassification branch, String binomial, String modID, ILeafSpriteProvider leafSpriteProvider, IGermlingModelProvider germlingModelProvider, IWoodProvider woodProvider, ITreeGenerator generator) {
return new AlleleTreeSpecies(uid, unlocalizedName, authority, unlocalizedDescription, dominant, branch, binomial, modID, leafSpriteProvider, germlingModelProvider, woodProvider, generator);
return new AlleleTreeSpecies(uid, unlocalizedName, authority, unlocalizedDescription, dominant, branch, binomial, modID, leafSpriteProvider, germlingModelProvider, woodProvider, generator, null);
}
@Override
@@ -35,7 +36,6 @@ public class TreeFactory implements ITreeFactory {
return new AlleleTreeSpecies(uid, unlocalizedName, authority, unlocalizedDescription, dominant, branch, binomial, modID, leafSpriteProvider, germlingModelProvider, woodProvider, generator, leafProvider);
}
@Override
public ILeafSpriteProvider getLeafIconProvider(EnumLeafType enumLeafType, Color color, Color colorPollinated) {
return new SpriteProviderLeaves(enumLeafType, color, colorPollinated);
@@ -10,6 +10,7 @@
******************************************************************************/
package forestry.arboriculture.genetics.alleles;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@@ -51,28 +52,11 @@ public class AlleleTreeSpecies extends AlleleSpecies implements IAlleleTreeSpeci
private final IGermlingModelProvider germlingModelProvider;
private final ILeafSpriteProvider leafSpriteProvider;
private final List<IFruitFamily> fruits = new ArrayList<>();
private final String modID;
private EnumPlantType nativeType = EnumPlantType.Plains;
private final ILeafProvider leafProvider;
private IGrowthProvider growthProvider = new ClimateGrowthProvider();
private float rarity = 0.0F;
public AlleleTreeSpecies(
String uid,
String unlocalizedName,
String authority,
String unlocalizedDescription,
boolean isDominant,
IClassification branch,
String binomial,
String modID,
ILeafSpriteProvider leafSpriteProvider,
IGermlingModelProvider germlingModelProvider,
IWoodProvider woodProvider,
ITreeGenerator generator) {
this(uid, unlocalizedName, authority, unlocalizedDescription, isDominant, branch, binomial, modID, leafSpriteProvider, germlingModelProvider, woodProvider, generator, new LeafProvider());
}
public AlleleTreeSpecies(
String uid,
String unlocalizedName,
@@ -86,16 +70,18 @@ public class AlleleTreeSpecies extends AlleleSpecies implements IAlleleTreeSpeci
IGermlingModelProvider germlingModelProvider,
IWoodProvider woodProvider,
ITreeGenerator generator,
ILeafProvider leafProvider) {
super(uid, unlocalizedName, authority, unlocalizedDescription, isDominant, branch, binomial);
@Nullable ILeafProvider leafProvider) {
super(modID, uid, unlocalizedName, authority, unlocalizedDescription, isDominant, branch, binomial);
this.generator = generator;
this.germlingModelProvider = germlingModelProvider;
this.woodProvider = woodProvider;
this.leafSpriteProvider = leafIconProvider;
this.leafProvider = leafProvider;
this.modID = modID;
if (leafProvider == null) {
this.leafProvider = new LeafProvider();
} else {
this.leafProvider = leafProvider;
}
}
@Override
@@ -197,11 +183,6 @@ public class AlleleTreeSpecies extends AlleleSpecies implements IAlleleTreeSpeci
public ILeafProvider getLeafProvider() {
return leafProvider;
}
@Override
public String getModID() {
return modID;
}
@Override
public float getResearchSuitability(ItemStack itemstack) {
@@ -117,7 +117,8 @@ public class EventHandlerCore {
@SubscribeEvent
public void lootLoad(LootTableLoadEvent event) {
if (!event.getName().getResourceDomain().equals("minecraft")) {
if (!event.getName().getResourceDomain().equals("minecraft")
&& !event.getName().equals(Constants.VILLAGE_NATURALIST_LOOT_KEY)) {
return;
}
@@ -43,10 +43,12 @@ public class ClimateWorldManager{
IClimateState cacheState = stateCache.getIfPresent(pos);
if(cacheState == null){
IGreenhouseClimateManager climateSourceManager = GreenhouseManager.climateManager;
IClimateContainer container = climateSourceManager.getContainer(world, pos);
if(climateSourceManager != null) {
IClimateContainer container = climateSourceManager.getContainer(world, pos);
if (container != null) {
cacheState = container.getState();
if (container != null) {
cacheState = container.getState();
}
}
if(cacheState == null){
cacheState = parent.getBiomeState(world, pos);
@@ -82,4 +82,11 @@ public abstract class ItemGE extends ItemForestry {
list.add("<" + Translator.translateToLocal("for.gui.unknown") + ">");
}
}
@Nullable
@Override
public String getCreatorModId(ItemStack itemStack) {
IAlleleSpecies species = getSpecies(itemStack);
return species.getModID();
}
}
@@ -14,12 +14,13 @@ import forestry.api.genetics.IAllele;
import forestry.core.utils.Translator;
public abstract class Allele implements IAllele {
private final String modId;
private final String uid;
private final boolean isDominant;
private final String unlocalizedName;
protected Allele(String uid, String unlocalizedName, boolean isDominant) {
protected Allele(String modId, String uid, String unlocalizedName, boolean isDominant) {
this.modId = modId;
this.uid = uid;
this.isDominant = isDominant;
this.unlocalizedName = unlocalizedName;
@@ -30,12 +31,18 @@ public abstract class Allele implements IAllele {
return uid;
}
@Override
public String getModID() {
return modId;
}
@Override
public boolean isDominant() {
return isDominant;
}
@Override
@Deprecated
public String getName() {
return Translator.translateToLocal(getUnlocalizedName());
}
@@ -14,7 +14,7 @@ import org.apache.commons.lang3.text.WordUtils;
*/
public abstract class AlleleCategorized extends Allele {
protected AlleleCategorized(String modId, String category, String valueName, boolean isDominant) {
super(getUid(modId, category, valueName), getUnlocalizedName(modId, category, valueName), isDominant);
super(modId, getUid(modId, category, valueName), getUnlocalizedName(modId, category, valueName), isDominant);
}
private static String getUid(String modId, String category, String valueName) {
@@ -51,14 +51,15 @@ public abstract class AlleleSpecies extends Allele implements IAlleleSpeciesBuil
@Nullable
private Integer complexityOverride = null;
protected AlleleSpecies(String uid,
protected AlleleSpecies(String modId,
String uid,
String unlocalizedName,
String authority,
String unlocalizedDescription,
boolean isDominant,
IClassification branch,
String binomial) {
super(uid, unlocalizedName, isDominant);
super(modId, uid, unlocalizedName, isDominant);
this.branch = branch;
this.binomial = binomial;
@@ -99,7 +99,7 @@ public class ItemCrated extends ItemForestry implements IColoredItem {
if (contained.isEmpty() || renderPass == 100) {
return -1;
}
int color = colors.getColorFromItemstack(contained, renderPass);
int color = colors.colorMultiplier(contained, renderPass);
if (color != -1) {
return color;
}
@@ -60,7 +60,7 @@ public class ItemForestryTool extends ItemForestry {
}
@Override
public float getStrVsBlock(ItemStack itemstack, IBlockState state) {
public float getDestroySpeed(ItemStack itemstack, IBlockState state) {
for (String type : getToolClasses(itemstack)) {
if (state.getBlock().isToolEffective(type, state)) {
return efficiencyOnProperMaterial;
@@ -68,9 +68,9 @@ public class ItemForestryTool extends ItemForestry {
}
if (this == PluginCore.getItems().bronzePickaxe) {
Material material = state.getMaterial();
return material != Material.IRON && material != Material.ANVIL && material != Material.ROCK ? super.getStrVsBlock(itemstack, state) : this.efficiencyOnProperMaterial;
return material != Material.IRON && material != Material.ANVIL && material != Material.ROCK ? super.getDestroySpeed(itemstack, state) : this.efficiencyOnProperMaterial;
}
return super.getStrVsBlock(itemstack, state);
return super.getDestroySpeed(itemstack, state);
}
@Override
@@ -220,7 +220,7 @@ public class ModelManager implements IModelManager {
}
@Override
public int getColorFromItemstack(ItemStack stack, int tintIndex) {
public int colorMultiplier(ItemStack stack, int tintIndex) {
Item item = stack.getItem();
if (item instanceof IColoredItem) {
return ((IColoredItem) item).getColorFromItemstack(stack, tintIndex);
@@ -77,7 +77,7 @@ public class RenderAnalyzer extends TileEntitySpecialRenderer<TileAnalyzer> {
}
RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager();
rendermanager.doRenderEntity(dummyEntityItem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F, false);
rendermanager.renderEntity(dummyEntityItem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F, false);
GlStateManager.popMatrix();
}
@@ -103,7 +103,7 @@ public class RenderEscritoire extends TileEntitySpecialRenderer<TileEscritoire>
}
RenderManager rendermanager = minecraft.getRenderManager();
rendermanager.doRenderEntity(dummyEntityItem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F, false);
rendermanager.renderEntity(dummyEntityItem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F, false);
}
GlStateManager.popMatrix();
@@ -43,7 +43,7 @@ public interface IClimateSource extends INbtWritable, INbtReadable {
IClimateState work(IClimateState previousState, IClimateState targetState, IClimateState currentState, final double sizeModifier, final boolean canWork);
/**
* @return true if source has changed the climate at the last work cicle.
* @return true if source has changed the climate at the last work circle.
*/
boolean isActive();
@@ -157,13 +157,15 @@ public abstract class ClimateSource<O extends IClimateSourceOwner> implements IC
} else if (ClimateStates.isNearTarget(currentState, targetState)) {
return change;
}
//If the state is not already zero, remove one change state from the state.
change = getChange(oppositeType, defaultState, currentState);
change = ClimateStates.INSTANCE.create(-change.getTemperature(), -change.getHumidity(), ClimateStateType.EXTENDED);
if(oppositeType != null) {
//If the state is not already zero, remove one change state from the state.
change = getChange(oppositeType, defaultState, currentState);
change = ClimateStates.INSTANCE.create(-change.getTemperature(), -change.getHumidity(), ClimateStateType.EXTENDED);
}
} else if (validType == null && oppositeType != null) {
//Remove the resources if the owner has enough resources and the state is not the default state.
removeResources(state, oppositeType);
} else {
} else if(validType != null){
change = getChange(validType, targetState, previousState);
IClimateState changedState = state.add(change.scale(1 / sizeModifier));
boolean couldWork = canWork(changedState, oppositeType);
@@ -83,8 +83,8 @@ public class ClimateSourceClimatiser<O extends TileClimatiser> extends ClimateSo
}
protected float getEnergyModifier(IClimateState currentState, ClimateSourceType oppositeType) {
float change = oppositeType.canChangeTemperature() ? currentState.getTemperature() : oppositeType.canChangeHumidity() ? currentState.getHumidity() : 0.0F;
return 1.0F + change * Config.climateSourceEnergyModifier * energyChange;
float change = oppositeType == null ? 0.0F : oppositeType.canChangeTemperature() ? currentState.getTemperature() : oppositeType.canChangeHumidity() ? currentState.getHumidity() : 0.0F;
return (1.0F + change) * Config.climateSourceEnergyModifier * energyChange;
}
@Override
@@ -34,7 +34,7 @@ public class ChunkEvents {
return;
}
if (GreenhouseBlockManager.getThread() == null || !GreenhouseBlockManager.getThread().isAlive()) {
if (GreenhouseBlockManager.getThread() == null) {
Thread climateThread = new Thread(new ChunkThread(false), "Forestry Greenhouse");
GreenhouseBlockManager.setThread(climateThread, false);
climateThread.start();
@@ -47,7 +47,7 @@ public class ChunkEvents {
return;
}
if (GreenhouseBlockManager.getClientThread() == null || !GreenhouseBlockManager.getClientThread().isAlive()) {
if (GreenhouseBlockManager.getClientThread() == null) {
Thread climateThread = new Thread(new ChunkThread(true), "Forestry Greenhouse Client");
GreenhouseBlockManager.setThread(climateThread, true);
climateThread.start();
@@ -50,8 +50,8 @@ import forestry.greenhouse.network.packets.PacketGreenhouseData;
public class GreenhouseProviderServer extends GreenhouseProvider {
private static final List<IGreenhouseBlockHandler> HANDLERS = new ArrayList<>();
private static final int TIME_BETWEEN_UPDATES = 25;
private static final int UPDATE_DELAY = 50;
private static final int TIME_BETWEEN_UPDATES = 75;
private static final int UPDATE_DELAY = 150;
private final Set<Long> unloadedChunks;
@@ -231,6 +231,7 @@ public class GreenhouseProviderServer extends GreenhouseProvider {
IErrorState errorState = handler.checkNeighborBlocks(storage, blockToCheck, newBlocksToCheck);
if (errorState != null) {
errorLogic.setCondition(true, errorState);
break;
}
blocksToCheck.addAll(newBlocksToCheck);
if (blockToCheck instanceof IBlankBlock) {
@@ -239,6 +240,7 @@ public class GreenhouseProviderServer extends GreenhouseProvider {
if (positionHeight == -1) {
errorLogic.setCondition(true, EnumErrorCode.NOT_CLOSED);
//throw new GreenhouseException(Translator.translateToLocalFormatted("for.multiblock.greenhouse.error.roof.notclosed", position.getX(), position.getY(), position.getZ())).setPos(position);
break;
}
if (positionHeight > greenhouseHeight) {
greenhouseHeight = positionHeight;
@@ -46,7 +46,6 @@ import forestry.core.genetics.alleles.AlleleSpecies;
public class AlleleButterflySpecies extends AlleleSpecies
implements IAlleleButterflySpecies, IAlleleButterflySpeciesBuilder {
private final String texture;
private final String modID;
private final Color serumColour;
private float rarity = 0.1f;
private float flightDistance = 5.0f;
@@ -60,10 +59,9 @@ public class AlleleButterflySpecies extends AlleleSpecies
public AlleleButterflySpecies(String uid, String unlocalizedName, String authority, String unlocalizedDescription,
String modID, String texturePath, boolean isDominant, IClassification branch, String binomial,
Color serumColour) {
super(uid, unlocalizedName, authority, unlocalizedDescription, isDominant, branch, binomial);
super(modID, uid, unlocalizedName, authority, unlocalizedDescription, isDominant, branch, binomial);
this.serumColour = serumColour;
this.modID = modID;
this.texture = texturePath;
}
@@ -211,9 +209,4 @@ public class AlleleButterflySpecies extends AlleleSpecies
TextureMap textureMap = Minecraft.getMinecraft().getTextureMapBlocks();
textureMap.registerSprite(new ResourceLocation(spriteName));
}
@Override
public String getModID() {
return modID;
}
}