mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-15 09:34:57 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
05c6f4effa | ||
|
|
b9c36df910 | ||
|
|
d2fe7ac8a4 | ||
|
|
2bdca1266a | ||
|
|
dd3cc6aef9 | ||
|
|
41c20ea97a | ||
|
|
2dbc507486 | ||
|
|
a56200228f | ||
|
|
951d38abfa | ||
|
|
542cbab826 | ||
|
|
17237e41f8 | ||
|
|
c7f268f200 | ||
|
|
645dba903d | ||
|
|
1ac4acdb47 | ||
|
|
74aa33e80c | ||
|
|
6f6b45abcf | ||
|
|
7297a6a5d3 | ||
|
|
5ef76cffca | ||
|
|
9284f84645 | ||
|
|
85ba33e1ff | ||
|
|
9f5f5e7812 | ||
|
|
8617c4a79f | ||
|
|
e9809238de | ||
|
|
c0a22f4a28 | ||
|
|
41c6fb15b3 | ||
|
|
b5d65e83f0 | ||
|
|
1a7c148a7e | ||
|
|
ead630aa51 | ||
|
|
85b71c785a | ||
|
|
04cb58dfa2 | ||
|
|
3822e90ada | ||
|
|
af5cb93689 | ||
|
|
6a62024dd4 | ||
|
|
bedb7ffe85 | ||
|
|
4a21641bcd | ||
|
|
21d0b832b9 | ||
|
|
ce9081249f | ||
|
|
f6786cd44a | ||
|
|
a045c18a89 | ||
|
|
d6af85ad77 | ||
|
|
af55bd86a2 | ||
|
|
7aa840282f | ||
|
|
a5d57c4788 | ||
|
|
4d0c2d1ea2 | ||
|
|
840331b7d5 | ||
|
|
df91b47b35 | ||
|
|
f400241ff4 | ||
|
|
8639148f20 | ||
|
|
28e7b561ea | ||
|
|
ba7ef4228c | ||
|
|
fcd3ee6feb | ||
|
|
6ddc9f3079 | ||
|
|
cc53894473 | ||
|
|
2cd76bdad7 | ||
|
|
92eab8d47a | ||
|
|
12f5d7be6c | ||
|
|
ab88e7d57c | ||
|
|
725d85181d | ||
|
|
23c9b2071b | ||
|
|
ae025a92fc | ||
|
|
fbf30b1a73 | ||
|
|
4ba3370fc9 | ||
|
|
c1a590961d | ||
|
|
a1f7a678c1 | ||
|
|
1117b820f1 | ||
|
|
4681bf4cfb | ||
|
|
b9dd19a556 | ||
|
|
f97a737185 | ||
|
|
68fb27410e | ||
|
|
b8be42548e | ||
|
|
eb9ef642cd | ||
|
|
ed658301fd | ||
|
|
d55d86a3c5 | ||
|
|
b2d5706bbd | ||
|
|
ba6bd8fd10 | ||
|
|
b998e2ac49 | ||
|
|
817540d996 | ||
|
|
9d8866e4fd | ||
|
|
7575b9c6ce | ||
|
|
6700c511a5 | ||
|
|
acc55d4f41 | ||
|
|
7bd5bb120d | ||
|
|
dbbb727576 | ||
|
|
dcf0fc83ad | ||
|
|
6ef91590cf | ||
|
|
856322b208 | ||
|
|
42425e3500 | ||
|
|
cde076e702 | ||
|
|
b5f60d73e3 | ||
|
|
f82d123b7f | ||
|
|
ca17801c86 | ||
|
|
33d1685713 | ||
|
|
69c024811f | ||
|
|
4dd95625e1 | ||
|
|
6adcde4a75 | ||
|
|
2f06c777b2 | ||
|
|
32f295b16c |
No files matched your search
+1
-2
@@ -67,8 +67,7 @@ repositories {
|
||||
|
||||
dependencies {
|
||||
deobfCompile "mezz.jei:jei_${mcversion}:${jei_version}"
|
||||
// deobfCompile "net.industrial-craft:industrialcraft-2:${ic2_version}:api"
|
||||
// runtime "net.industrial-craft:industrialcraft-2:${ic2_version}:dev"
|
||||
deobfCompile "net.industrial-craft:industrialcraft-2:${ic2_version}:api"
|
||||
}
|
||||
|
||||
configurations {
|
||||
|
||||
+4
-3
@@ -1,9 +1,10 @@
|
||||
mcversion=1.9.4
|
||||
forgeversion=12.17.0.1940
|
||||
forgeversion=12.17.0.1968
|
||||
mcp_mappings=snapshot_20160525
|
||||
|
||||
jei_version=3.4.0.+
|
||||
jei_version=3.6.4.+
|
||||
ic2_version=2.5.5-ex19
|
||||
|
||||
version_major=5
|
||||
version_minor=0
|
||||
version_patch=4
|
||||
version_patch=24
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
#Mon Sep 14 12:28:28 PDT 2015
|
||||
#Tue Jun 21 15:23:47 PDT 2016
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-all.zip
|
||||
+1
-1
Submodule lang updated: 0e7f1e47f1...a8bbc7bd1c.
@@ -49,7 +49,7 @@ import forestry.plugins.PluginManager;
|
||||
name = "Forestry",
|
||||
version = Constants.VERSION,
|
||||
guiFactory = "forestry.core.config.ForestryGuiConfigFactory",
|
||||
dependencies = "required-after:Forge@[12.17.0.1932,);"
|
||||
dependencies = "required-after:Forge@[12.17.0.1963,);"
|
||||
+ "after:Buildcraft|Core@[7.2,);"
|
||||
+ "after:BuildCraft|Energy@[7.2,);"
|
||||
+ "after:ExtrabiomesXL;"
|
||||
@@ -57,6 +57,7 @@ import forestry.plugins.PluginManager;
|
||||
+ "after:IC2@[2.3.235,);"
|
||||
+ "after:Natura@[2.2.0,);"
|
||||
+ "after:HardcoreEnderExpansion;"
|
||||
+ "after:JEI@[3.6.4,);"
|
||||
+ "after:basemetals;")
|
||||
public class Forestry {
|
||||
|
||||
|
||||
@@ -50,12 +50,4 @@ public interface IAlleleBeeSpecies extends IAlleleSpecies {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
void registerModels(Item item, IModelManager manager);
|
||||
|
||||
/**
|
||||
* @deprecated since Forestry 3.6.
|
||||
* @return Path of the texture to use for entity rendering.
|
||||
*/
|
||||
@Deprecated
|
||||
String getEntityTexture();
|
||||
|
||||
}
|
||||
@@ -5,6 +5,8 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.apiculture;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
@@ -32,6 +34,7 @@ public interface IBeeHousing extends IHousing, IErrorLogicSource {
|
||||
*/
|
||||
Iterable<IBeeListener> getBeeListeners();
|
||||
|
||||
@Nonnull
|
||||
IBeeHousingInventory getBeeInventory();
|
||||
|
||||
IBeekeepingLogic getBeekeepingLogic();
|
||||
|
||||
+4
-3
@@ -5,8 +5,9 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.apiculture;
|
||||
|
||||
import forestry.api.genetics.IMutationCustom;
|
||||
|
||||
public interface IBeeMutationCustom extends IBeeMutation, IMutationCustom {
|
||||
import forestry.api.genetics.IMutationBuilder;
|
||||
|
||||
public interface IBeeMutationBuilder extends IMutationBuilder {
|
||||
@Override
|
||||
IBeeMutation build();
|
||||
}
|
||||
@@ -11,7 +11,7 @@ public interface IBeeMutationFactory {
|
||||
/**
|
||||
* Creates a new bee mutation.
|
||||
* Automatically registered with BeeManager.beeRoot.registerMutation()
|
||||
* See IBeeMutationCustom and IMutationCustom for adding additional properties to the returned mutation.
|
||||
* See IBeeMutationBuilder and IMutationBuilder for adding additional properties to the returned mutation.
|
||||
*
|
||||
* @param parentBee0 A parent bee for this mutation
|
||||
* @param parentBee1 A parent bee for this mutation
|
||||
@@ -19,5 +19,5 @@ public interface IBeeMutationFactory {
|
||||
* @param chance The chance that breeding the two parent bees will result in this mutation
|
||||
* @return a new bee mutation.
|
||||
*/
|
||||
IBeeMutationCustom createMutation(IAlleleBeeSpecies parentBee0, IAlleleBeeSpecies parentBee1, IAllele[] result, int chance);
|
||||
IBeeMutationBuilder createMutation(IAlleleBeeSpecies parentBee0, IAlleleBeeSpecies parentBee1, IAllele[] result, int chance);
|
||||
}
|
||||
@@ -36,6 +36,12 @@ public interface IBeekeepingLogic extends INbtWritable, INbtReadable {
|
||||
*/
|
||||
void doWork();
|
||||
|
||||
/**
|
||||
* Force the logic to refresh any cached values and error states.
|
||||
* Call this when a player opens the gui so that all errors are up to date.
|
||||
*/
|
||||
void clearCachedValues();
|
||||
|
||||
|
||||
/* CLIENT */
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.apiculture.hives;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
@@ -46,5 +48,5 @@ public interface IHiveDescription {
|
||||
* Called after successful hive generation.
|
||||
* world, x, y, z give the location of the new hive.
|
||||
**/
|
||||
void postGen(World world, BlockPos pos);
|
||||
void postGen(World world, Random rand, BlockPos pos);
|
||||
}
|
||||
@@ -10,6 +10,9 @@ import javax.annotation.Nonnull;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.core.IModelManager;
|
||||
|
||||
/**
|
||||
@@ -18,6 +21,7 @@ import forestry.api.core.IModelManager;
|
||||
* There is no default implementation because every sapling has a unique icon.
|
||||
*/
|
||||
public interface IGermlingModelProvider {
|
||||
@SideOnly(Side.CLIENT)
|
||||
void registerModels(Item item, IModelManager manager, EnumGermlingType type);
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -84,7 +84,7 @@ public interface ITree extends IIndividual, ITreeGenData {
|
||||
* @return Integer denoting the size of the tree trunk.
|
||||
*/
|
||||
@Override
|
||||
int getGirth(World world, BlockPos pos);
|
||||
int getGirth();
|
||||
|
||||
/**
|
||||
* @return Growth conditions at the given position.
|
||||
|
||||
+4
-3
@@ -5,8 +5,9 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import forestry.api.genetics.IMutationCustom;
|
||||
|
||||
public interface ITreeMutationCustom extends ITreeMutation, IMutationCustom {
|
||||
import forestry.api.genetics.IMutationBuilder;
|
||||
|
||||
public interface ITreeMutationBuilder extends IMutationBuilder {
|
||||
@Override
|
||||
ITreeMutation build();
|
||||
}
|
||||
@@ -11,7 +11,7 @@ public interface ITreeMutationFactory {
|
||||
/**
|
||||
* Creates a new tree mutation.
|
||||
* Automatically registered with TreeManager.treeRoot.registerMutation()
|
||||
* See ITreeMutationCustom and IMutationCustom for adding additional properties to the returned mutation.
|
||||
* See ITreeMutationBuilder and IMutationBuilder for adding additional properties to the returned mutation.
|
||||
*
|
||||
* @param parentTree0 A parent tree for this mutation
|
||||
* @param parentTree1 A parent tree for this mutation
|
||||
@@ -19,5 +19,5 @@ public interface ITreeMutationFactory {
|
||||
* @param chance The chance that breeding the two parent trees will result in this mutation
|
||||
* @return a new tree mutation.
|
||||
*/
|
||||
ITreeMutationCustom createMutation(IAlleleTreeSpecies parentTree0, IAlleleTreeSpecies parentTree1, IAllele[] result, int chance);
|
||||
ITreeMutationBuilder createMutation(IAlleleTreeSpecies parentTree0, IAlleleTreeSpecies parentTree1, IAllele[] result, int chance);
|
||||
}
|
||||
@@ -30,6 +30,4 @@ public interface IModelManager {
|
||||
|
||||
void registerItemModel(Item item, ItemMeshDefinition definition);
|
||||
|
||||
void registerVariant(Item item, ResourceLocation... resources);
|
||||
|
||||
}
|
||||
@@ -38,6 +38,8 @@ public interface IFarmLogic {
|
||||
|
||||
String getName();
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
ItemStack getStack();
|
||||
/**
|
||||
* @return the itemStack that represents this farm logic. Used as an icon for the farm logic.
|
||||
*/
|
||||
ItemStack getIconItemStack();
|
||||
}
|
||||
@@ -21,10 +21,10 @@ import net.minecraft.util.math.Vec3i;
|
||||
*
|
||||
* For example:
|
||||
* en_US
|
||||
* Forestry.allele.smallest=Smallest
|
||||
* forestry.allele.smallest=Smallest
|
||||
* ru_RU
|
||||
* Forestry.allele.smallest=????? ?????????
|
||||
* Forestry.allele.height.smallest=????? ??????
|
||||
* forestry.allele.smallest=????? ?????????
|
||||
* forestry.allele.height.smallest=????? ??????
|
||||
*/
|
||||
public interface IAlleleFactory {
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package forestry.api.genetics;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -20,5 +21,7 @@ public interface IAlyzerPlugin {
|
||||
@SideOnly(Side.CLIENT)
|
||||
void drawAnalyticsPage3(GuiAlyzer gui, ItemStack itemStack);
|
||||
|
||||
Map<String, ItemStack> getIconStacks();
|
||||
|
||||
List<String> getHints();
|
||||
}
|
||||
+16
-13
@@ -6,6 +6,7 @@
|
||||
package forestry.api.genetics;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
|
||||
@@ -13,40 +14,42 @@ import forestry.api.core.EnumHumidity;
|
||||
import forestry.api.core.EnumTemperature;
|
||||
|
||||
/** Set custom mutation requirements */
|
||||
public interface IMutationCustom extends IMutation {
|
||||
public interface IMutationBuilder {
|
||||
|
||||
IMutation build();
|
||||
|
||||
/** Prevent this mutation from being shown in the analyzers */
|
||||
IMutationCustom setIsSecret();
|
||||
IMutationBuilder setIsSecret();
|
||||
|
||||
/** Require a specific temperature for this mutation to occur */
|
||||
IMutationCustom restrictTemperature(EnumTemperature temperature);
|
||||
IMutationBuilder restrictTemperature(EnumTemperature temperature);
|
||||
|
||||
IMutationCustom restrictTemperature(EnumTemperature minTemperature, EnumTemperature maxTemperature);
|
||||
IMutationBuilder restrictTemperature(EnumTemperature minTemperature, EnumTemperature maxTemperature);
|
||||
|
||||
/** Require a specific humidity for this mutation to occur */
|
||||
IMutationCustom restrictHumidity(EnumHumidity humidity);
|
||||
IMutationBuilder restrictHumidity(EnumHumidity humidity);
|
||||
|
||||
IMutationCustom restrictHumidity(EnumHumidity minHumidity, EnumHumidity maxHumidity);
|
||||
IMutationBuilder restrictHumidity(EnumHumidity minHumidity, EnumHumidity maxHumidity);
|
||||
|
||||
/**
|
||||
* Restrict this mutation to certain types of biomes.
|
||||
* @param types The types of biomes this mutation can occur.
|
||||
*/
|
||||
IMutationCustom restrictBiomeType(BiomeDictionary.Type... types);
|
||||
IMutationBuilder restrictBiomeType(BiomeDictionary.Type... types);
|
||||
|
||||
/** Restrict the days of the year that this mutation can occur */
|
||||
IMutationCustom restrictDateRange(int startMonth, int startDay, int endMonth, int endDay);
|
||||
IMutationBuilder restrictDateRange(int startMonth, int startDay, int endMonth, int endDay);
|
||||
|
||||
/** Restrict the time of day that this mutation can occur */
|
||||
IMutationCustom requireDay();
|
||||
IMutationBuilder requireDay();
|
||||
|
||||
IMutationCustom requireNight();
|
||||
IMutationBuilder requireNight();
|
||||
|
||||
/** Require a specific resource to be under the location of the mutation */
|
||||
IMutationCustom requireResource(Block block, int meta);
|
||||
IMutationBuilder requireResource(IBlockState requiredBlockState);
|
||||
|
||||
IMutationCustom requireResource(String oreDictName);
|
||||
IMutationBuilder requireResource(String oreDictName);
|
||||
|
||||
/** Require some other custom mutation condition */
|
||||
IMutationCustom addMutationCondition(IMutationCondition mutationCondition);
|
||||
IMutationBuilder addMutationCondition(IMutationCondition mutationCondition);
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
package forestry.api.greenhouse;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import forestry.api.core.EnumHumidity;
|
||||
import forestry.api.core.EnumTemperature;
|
||||
@@ -22,7 +22,7 @@ public interface IGreenhouseState {
|
||||
|
||||
float getExactHumidity();
|
||||
|
||||
List<IInternalBlock> getInternalBlocks();
|
||||
Set<IInternalBlock> getInternalBlocks();
|
||||
|
||||
Collection<IMultiblockComponent> getGreenhouseComponents();
|
||||
|
||||
|
||||
+4
-3
@@ -5,8 +5,9 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.lepidopterology;
|
||||
|
||||
import forestry.api.genetics.IMutationCustom;
|
||||
|
||||
public interface IButterflyMutationCustom extends IButterflyMutation, IMutationCustom {
|
||||
import forestry.api.genetics.IMutationBuilder;
|
||||
|
||||
public interface IButterflyMutationBuilder extends IMutationBuilder {
|
||||
@Override
|
||||
IButterflyMutation build();
|
||||
}
|
||||
@@ -11,7 +11,7 @@ public interface IButterflyMutationFactory {
|
||||
/**
|
||||
* Creates a new butterfly mutation.
|
||||
* Automatically registered with ButterflyManager.butterflyRoot.registerMutation()
|
||||
* See IButterflyMutationCustom and IMutationCustom for adding additional properties to the returned mutation.
|
||||
* See IButterflyMutationBuilder and IMutationBuilder for adding additional properties to the returned mutation.
|
||||
*
|
||||
* @param parentButterfly0 A parent butterfly for this mutation
|
||||
* @param parentButterfly1 A parent butterfly for this mutation
|
||||
@@ -19,5 +19,5 @@ public interface IButterflyMutationFactory {
|
||||
* @param chance The chance that breeding the two parent butterfly's will result in this mutation
|
||||
* @return a new butterfly mutation.
|
||||
*/
|
||||
IButterflyMutationCustom createMutation(IAlleleButterflySpecies parentButterfly0, IAlleleButterflySpecies parentButterfly1, IAllele[] result, int chance);
|
||||
IButterflyMutationBuilder createMutation(IAlleleButterflySpecies parentButterfly0, IAlleleButterflySpecies parentButterfly1, IAllele[] result, int chance);
|
||||
}
|
||||
@@ -17,9 +17,5 @@ public interface IMailAddress extends INbtWritable {
|
||||
|
||||
boolean isValid();
|
||||
|
||||
boolean isPlayer();
|
||||
|
||||
boolean isTrader();
|
||||
|
||||
GameProfile getPlayerProfile();
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.mail;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -18,9 +19,10 @@ public interface IPostRegistry {
|
||||
IPostOffice getPostOffice(World world);
|
||||
|
||||
/* MAIL ADDRESSES */
|
||||
IMailAddress getMailAddress(GameProfile gameProfile);
|
||||
|
||||
IMailAddress getMailAddress(String traderName);
|
||||
@Nonnull
|
||||
IMailAddress getMailAddress(@Nonnull GameProfile gameProfile);
|
||||
|
||||
IMailAddress getMailAddress(@Nonnull String traderName);
|
||||
|
||||
/* LETTERS */
|
||||
boolean isLetter(ItemStack itemstack);
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.recipes;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
@@ -24,6 +26,7 @@ public interface ISqueezerRecipe extends IForestryRecipe {
|
||||
/**
|
||||
* @return Item stack representing the possible remnants from this recipe. (i.e. tin left over from tin cans)
|
||||
*/
|
||||
@Nullable
|
||||
ItemStack getRemnants();
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,7 +18,7 @@ import forestry.api.arboriculture.ITreeGenome;
|
||||
|
||||
public interface ITreeGenData {
|
||||
|
||||
int getGirth(World world, BlockPos pos);
|
||||
int getGirth();
|
||||
|
||||
float getHeightModifier();
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
package forestry.apiculture;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
@@ -197,6 +198,8 @@ public class BeekeepingLogic implements IBeekeepingLogic, IStreamable {
|
||||
if (!ItemStack.areItemStacksEqual(this.queenStack, queenStack)) {
|
||||
this.queen = BeeManager.beeRoot.getMember(queenStack);
|
||||
this.queenStack = queenStack;
|
||||
hasFlowersCache.clear();
|
||||
queenCanWorkCache.clear();
|
||||
}
|
||||
|
||||
if (errorLogic.setCondition(queen == null, EnumErrorCode.NO_QUEEN)) {
|
||||
@@ -231,11 +234,20 @@ public class BeekeepingLogic implements IBeekeepingLogic, IStreamable {
|
||||
if (beeType == EnumBeeType.PRINCESS) {
|
||||
tickBreed();
|
||||
} else if (beeType == EnumBeeType.QUEEN) {
|
||||
queenWorkTick(queen);
|
||||
queenWorkTick(queen, queenStack);
|
||||
}
|
||||
}
|
||||
|
||||
private void queenWorkTick(IBee queen) {
|
||||
@Override
|
||||
public void clearCachedValues() {
|
||||
if (!housing.getWorldObj().isRemote) {
|
||||
hasFlowersCache.clear();
|
||||
queenCanWorkCache.clear();
|
||||
canWork();
|
||||
}
|
||||
}
|
||||
|
||||
private void queenWorkTick(@Nullable IBee queen, @Nonnull ItemStack queenStack) {
|
||||
if (queen == null) {
|
||||
beeProgress = 0;
|
||||
beeProgressMax = 0;
|
||||
@@ -261,7 +273,8 @@ public class BeekeepingLogic implements IBeekeepingLogic, IStreamable {
|
||||
// Write the changed queen back into the item stack.
|
||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||
queen.writeToNBT(nbttagcompound);
|
||||
housing.getBeeInventory().getQueen().setTagCompound(nbttagcompound);
|
||||
queenStack.setTagCompound(nbttagcompound);
|
||||
housing.getBeeInventory().setQueen(queenStack);
|
||||
}
|
||||
|
||||
beeProgress = queen.getHealth();
|
||||
@@ -505,6 +518,11 @@ public class BeekeepingLogic implements IBeekeepingLogic, IStreamable {
|
||||
|
||||
return queenCanWorkCached;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
queenCanWorkCached.clear();
|
||||
queenCanWorkCooldown = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private static class PollenHandler {
|
||||
|
||||
@@ -37,6 +37,11 @@ public class FakeBeekeepingLogic implements IBeekeepingLogic {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearCachedValues() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void syncToClient() {
|
||||
|
||||
|
||||
@@ -97,6 +97,11 @@ public class HasFlowersCache implements INbtWritable, INbtReadable, IStreamable
|
||||
return returnVal;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
flowerCoords.clear();
|
||||
cooldown = 0;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public List<BlockPos> getFlowerCoords() {
|
||||
return Collections.unmodifiableList(flowerCoords);
|
||||
|
||||
@@ -14,9 +14,7 @@ import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
@@ -38,6 +36,7 @@ import net.minecraft.world.storage.loot.LootTableList;
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.common.SidedProxy;
|
||||
@@ -92,6 +91,7 @@ import forestry.apiculture.multiblock.TileAlvearyStabiliser;
|
||||
import forestry.apiculture.multiblock.TileAlvearySwarmer;
|
||||
import forestry.apiculture.network.PacketRegistryApiculture;
|
||||
import forestry.apiculture.proxy.ProxyApiculture;
|
||||
import forestry.apiculture.proxy.ProxyApicultureClient;
|
||||
import forestry.apiculture.tiles.TileCandle;
|
||||
import forestry.apiculture.tiles.TileHive;
|
||||
import forestry.apiculture.worldgen.HiveDecorator;
|
||||
@@ -127,19 +127,14 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
public static ProxyApiculture proxy;
|
||||
private static final String CONFIG_CATEGORY = "apiculture";
|
||||
public static String beekeepingMode = "NORMAL";
|
||||
public static TextureAtlasSprite beeSprite;
|
||||
private static float secondPrincessChance = 0;
|
||||
public static final int ticksPerBeeWorkCycle = 550;
|
||||
public static boolean fancyRenderedBees = false;
|
||||
|
||||
public static ItemRegistryApiculture items;
|
||||
public static BlockRegistryApiculture blocks;
|
||||
|
||||
public static HiveRegistry hiveRegistry;
|
||||
|
||||
private final Map<String, String[]> defaultAcceptedFlowers = new HashMap<>();
|
||||
private final Map<String, String[]> defaultPlantableFlowers = new HashMap<>();
|
||||
|
||||
public static VillagerRegistry.VillagerProfession villagerApiarist;
|
||||
|
||||
@Override
|
||||
@@ -275,9 +270,12 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
villagerRegistry.register(villagerApiarist);
|
||||
|
||||
ItemStack wildcardPrincess = new ItemStack(items.beePrincessGE, 1);
|
||||
ItemStack wildcardDrone = new ItemStack(items.beeDroneGE, 1);
|
||||
ItemStack apiary = new ItemStack(blocks.apiary);
|
||||
ItemStack provenFrames = items.frameProven.getItemStack();
|
||||
ItemStack monasticDrone = BeeDefinition.MONASTIC.getMemberStack(EnumBeeType.DRONE);
|
||||
ItemStack endDrone = BeeDefinition.ENDED.getMemberStack(EnumBeeType.DRONE);
|
||||
ItemStack propolis = new ItemStack(PluginApiculture.items.propolis,1);
|
||||
|
||||
VillagerRegistry.VillagerCareer apiaristCareer = new VillagerRegistry.VillagerCareer(villagerApiarist, "apiarist");
|
||||
apiaristCareer.addTrade(1,
|
||||
@@ -287,19 +285,19 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
);
|
||||
apiaristCareer.addTrade(2,
|
||||
new VillagerTradeLists.GiveItemForEmeralds(new EntityVillager.PriceInfo(1, 4), new ItemStack(items.smoker), null),
|
||||
new VillagerTradeLists.GiveItemForLogsAndEmeralds(apiary, new EntityVillager.PriceInfo(1, 1), new EntityVillager.PriceInfo(16, 32), new EntityVillager.PriceInfo(1, 2))
|
||||
new VillagerTradeLists.GiveItemForLogsAndEmeralds(apiary, new EntityVillager.PriceInfo(1, 1), new EntityVillager.PriceInfo(16, 32), new EntityVillager.PriceInfo(1, 2)),
|
||||
new VillagerApiaristTrades.GiveRandomHiveDroneForItems(propolis, null, wildcardDrone, new EntityVillager.PriceInfo(2, 4))
|
||||
);
|
||||
apiaristCareer.addTrade(3,
|
||||
new VillagerTradeLists.GiveEmeraldForItems(wildcardPrincess, null),
|
||||
new VillagerTradeLists.GiveItemForEmeralds(new EntityVillager.PriceInfo(1, 2), provenFrames, new EntityVillager.PriceInfo(1, 6))
|
||||
);
|
||||
apiaristCareer.addTrade(4,
|
||||
new VillagerTradeLists.GiveItemForItemAndEmerald(wildcardPrincess, null, new EntityVillager.PriceInfo(10, 64), monasticDrone, null)
|
||||
new VillagerTradeLists.GiveItemForItemAndEmerald(wildcardPrincess, null, new EntityVillager.PriceInfo(10, 64), monasticDrone, null),
|
||||
new VillagerTradeLists.GiveItemForTwoItems(wildcardPrincess, null,new ItemStack(Items.ENDER_EYE),new EntityVillager.PriceInfo(12, 16),endDrone, null)
|
||||
);
|
||||
}
|
||||
|
||||
proxy.initializeRendering();
|
||||
|
||||
blocks.apiary.init();
|
||||
blocks.beeHouse.init();
|
||||
blocks.beeChest.init();
|
||||
@@ -561,9 +559,9 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{items.honeydew.getItemStack()}, honeyDropFluid);
|
||||
|
||||
ItemStack phosphor = PluginCore.items.phosphor.getItemStack(2);
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{phosphor, new ItemStack(Blocks.SAND)}, Fluids.LAVA.getFluid(2000));
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{phosphor, new ItemStack(Blocks.SAND, 1, 1)}, Fluids.LAVA.getFluid(2000));
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{phosphor, new ItemStack(Blocks.DIRT)}, Fluids.LAVA.getFluid(1600));
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{phosphor, new ItemStack(Blocks.SAND)}, new FluidStack(FluidRegistry.WATER, 2000));
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{phosphor, new ItemStack(Blocks.SAND, 1, 1)}, new FluidStack(FluidRegistry.LAVA, 2000));
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{phosphor, new ItemStack(Blocks.DIRT)}, new FluidStack(FluidRegistry.LAVA, 1600));
|
||||
|
||||
// / CARPENTER
|
||||
RecipeManagers.carpenterManager.addRecipe(50, Fluids.FOR_HONEY.getFluid(500), null, PluginCore.items.craftingMaterial.getScentedPaneling(),
|
||||
@@ -572,14 +570,14 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
'J', items.royalJelly,
|
||||
'W', PluginCore.items.beeswax,
|
||||
'P', items.pollenCluster.get(EnumPollenCluster.NORMAL, 1));
|
||||
|
||||
RecipeManagers.carpenterManager.addRecipe(30, Fluids.WATER.getFluid(600), null, blocks.candle.getUnlitCandle(24),
|
||||
|
||||
RecipeManagers.carpenterManager.addRecipe(30, new FluidStack(FluidRegistry.WATER, 600), null, blocks.candle.getUnlitCandle(24),
|
||||
" X ",
|
||||
"###",
|
||||
"###",
|
||||
'#', PluginCore.items.beeswax,
|
||||
'X', Items.STRING);
|
||||
RecipeManagers.carpenterManager.addRecipe(10, Fluids.WATER.getFluid(200), null, blocks.candle.getUnlitCandle(6),
|
||||
RecipeManagers.carpenterManager.addRecipe(10, new FluidStack(FluidRegistry.WATER, 200), null, blocks.candle.getUnlitCandle(6),
|
||||
"#X#",
|
||||
'#', PluginCore.items.beeswax,
|
||||
'X', PluginCore.items.craftingMaterial.getSilkWisp());
|
||||
@@ -848,7 +846,7 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
for (int i = 0; i < ParticleSnow.sprites.length; i++) {
|
||||
ParticleSnow.sprites[i] = event.getMap().registerSprite(new ResourceLocation("forestry:entity/particles/snow." + (i + 1)));
|
||||
}
|
||||
beeSprite = event.getMap().registerSprite(new ResourceLocation("forestry:entity/particles/swarm_bee"));
|
||||
ProxyApicultureClient.beeSprite = event.getMap().registerSprite(new ResourceLocation("forestry:entity/particles/swarm_bee"));
|
||||
}
|
||||
|
||||
private static class EndFlowerAcceptableRule implements IFlowerAcceptableRule {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package forestry.apiculture;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Random;
|
||||
|
||||
@@ -8,6 +9,9 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.village.MerchantRecipe;
|
||||
import net.minecraft.village.MerchantRecipeList;
|
||||
|
||||
import forestry.api.apiculture.EnumBeeType;
|
||||
import forestry.apiculture.genetics.BeeDefinition;
|
||||
|
||||
public class VillagerApiaristTrades {
|
||||
|
||||
public static class GiveRandomCombsForItems implements EntityVillager.ITradeList {
|
||||
@@ -24,7 +28,7 @@ public class VillagerApiaristTrades {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void modifyMerchantRecipeList(MerchantRecipeList recipeList, Random random) {
|
||||
public void modifyMerchantRecipeList(@Nonnull MerchantRecipeList recipeList, @Nonnull Random random) {
|
||||
int sellAmount = 1;
|
||||
if (this.priceInfo != null) {
|
||||
sellAmount = this.priceInfo.getPrice(random);
|
||||
@@ -41,5 +45,46 @@ public class VillagerApiaristTrades {
|
||||
recipeList.add(new MerchantRecipe(itemToBuy, randomComb));
|
||||
}
|
||||
}
|
||||
public static class GiveRandomHiveDroneForItems implements EntityVillager.ITradeList {
|
||||
@Nonnull
|
||||
public ItemStack buyingItemStack;
|
||||
@Nullable
|
||||
public EntityVillager.PriceInfo buyingPriceInfo;
|
||||
@Nonnull
|
||||
public ItemStack buyingItemStackTwo;
|
||||
@Nullable
|
||||
public EntityVillager.PriceInfo buyingPriceItemTwoInfo;
|
||||
|
||||
public GiveRandomHiveDroneForItems(
|
||||
@Nonnull ItemStack buyingItemStack,
|
||||
@Nullable EntityVillager.PriceInfo buyingPriceInfo,
|
||||
@Nonnull ItemStack buyingItemStackTwo,
|
||||
@Nullable EntityVillager.PriceInfo buyingPriceItemTwoInfo) {
|
||||
this.buyingItemStack = buyingItemStack;
|
||||
this.buyingPriceInfo = buyingPriceInfo;
|
||||
this.buyingItemStackTwo = buyingItemStackTwo;
|
||||
this.buyingPriceItemTwoInfo = buyingPriceItemTwoInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void modifyMerchantRecipeList(@Nonnull MerchantRecipeList recipeList, @Nonnull Random random) {
|
||||
|
||||
int buyAmount = 1;
|
||||
if (this.buyingPriceInfo != null) {
|
||||
buyAmount = this.buyingPriceInfo.getPrice(random);
|
||||
}
|
||||
|
||||
int buyTwoAmount = 1;
|
||||
if (this.buyingPriceItemTwoInfo != null) {
|
||||
buyTwoAmount = this.buyingPriceItemTwoInfo.getPrice(random);
|
||||
}
|
||||
BeeDefinition [] forestryMundane = new BeeDefinition[] { BeeDefinition.FOREST, BeeDefinition.MEADOWS, BeeDefinition.MODEST, BeeDefinition.WINTRY, BeeDefinition.TROPICAL, BeeDefinition.MARSHY };
|
||||
ItemStack randomHiveDrone = forestryMundane[random.nextInt(forestryMundane.length)].getMemberStack(EnumBeeType.DRONE);
|
||||
ItemStack buyItemStack = this.buyingItemStack.copy();
|
||||
buyItemStack.stackSize = buyAmount;
|
||||
ItemStack buyItemStackTwo = this.buyingItemStackTwo.copy();
|
||||
buyItemStackTwo.stackSize = buyTwoAmount;
|
||||
recipeList.add(new MerchantRecipe(buyItemStack, buyItemStackTwo, randomHiveDrone));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -33,12 +33,8 @@ public enum BlockTypeApicultureTesr implements IBlockTypeTesr {
|
||||
@Nonnull
|
||||
private final IMachinePropertiesTesr<?> machineProperties;
|
||||
|
||||
<T extends TileForestry> BlockTypeApicultureTesr(@Nonnull Class<T> teClass, @Nonnull String name, @Nullable TileEntitySpecialRenderer<? super T> renderer, @Nullable AxisAlignedBB boundingBox) {
|
||||
if (boundingBox != null) {
|
||||
this.machineProperties = new MachinePropertiesTesr<>(teClass, name, renderer, boundingBox, Constants.MOD_ID + ":blocks/" + name + ".0");
|
||||
} else {
|
||||
this.machineProperties = new MachinePropertiesTesr<>(teClass, name, renderer, Constants.MOD_ID + ":blocks/" + name + ".0");
|
||||
}
|
||||
<T extends TileForestry> BlockTypeApicultureTesr(@Nonnull Class<T> teClass, @Nonnull String name, @Nullable TileEntitySpecialRenderer<? super T> renderer, AxisAlignedBB boundingBox) {
|
||||
this.machineProperties = new MachinePropertiesTesr<>(teClass, name, renderer, boundingBox, Constants.MOD_ID + ":blocks/" + name + ".0");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
package forestry.apiculture.compat;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import forestry.apiculture.PluginApiculture;
|
||||
import forestry.apiculture.genetics.BeeGenome;
|
||||
|
||||
import mezz.jei.api.BlankModPlugin;
|
||||
import mezz.jei.api.IModRegistry;
|
||||
import mezz.jei.api.ISubtypeRegistry;
|
||||
import mezz.jei.api.JEIPlugin;
|
||||
|
||||
@JEIPlugin
|
||||
@@ -34,5 +38,21 @@ public class ApicultureJeiPlugin extends BlankModPlugin {
|
||||
registry.addDescription(new ItemStack(PluginApiculture.items.habitatLocator), "for.jei.description.habitat.locator");
|
||||
|
||||
registry.addDescription(new ItemStack(PluginApiculture.items.scoop), "for.jei.description.scoop");
|
||||
|
||||
ISubtypeRegistry subtypeRegistry = registry.getJeiHelpers().getSubtypeRegistry();
|
||||
subtypeRegistry.registerNbtInterpreter(PluginApiculture.items.beeDroneGE, BeeSubtypeInterpreter.INSTANCE);
|
||||
subtypeRegistry.registerNbtInterpreter(PluginApiculture.items.beePrincessGE, BeeSubtypeInterpreter.INSTANCE);
|
||||
subtypeRegistry.registerNbtInterpreter(PluginApiculture.items.beeQueenGE, BeeSubtypeInterpreter.INSTANCE);
|
||||
}
|
||||
|
||||
private static class BeeSubtypeInterpreter implements ISubtypeRegistry.ISubtypeInterpreter {
|
||||
public static BeeSubtypeInterpreter INSTANCE = new BeeSubtypeInterpreter();
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public String getSubtypeInfo(@Nonnull ItemStack itemStack) {
|
||||
IAlleleSpecies species = BeeGenome.getSpeciesDirectly(itemStack);
|
||||
return species == null ? null : species.getUID();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,94 +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.apiculture.entities;
|
||||
|
||||
import net.minecraft.entity.EntityCreature;
|
||||
import net.minecraft.entity.passive.IAnimals;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
import forestry.api.apiculture.EnumBeeType;
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.render.ForestryResource;
|
||||
|
||||
public class EntityBee extends EntityCreature implements IAnimals {
|
||||
|
||||
private static final String DEFAULT_TEXTURE = Constants.TEXTURE_PATH_ENTITIES + "/bees/honeyBee.png";
|
||||
|
||||
private IBee contained;
|
||||
private IAlleleBeeSpecies species;
|
||||
private EnumBeeType type = EnumBeeType.DRONE;
|
||||
|
||||
private String beeTexture = DEFAULT_TEXTURE;
|
||||
private long lastUpdate;
|
||||
|
||||
public EntityBee(World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
private void resetAppearance() {
|
||||
beeTexture = species.getEntityTexture();
|
||||
}
|
||||
|
||||
public EntityBee setIndividual(IBee bee) {
|
||||
if (bee != null) {
|
||||
contained = bee;
|
||||
} else {
|
||||
contained = BeeManager.beeRoot.templateAsIndividual(BeeManager.beeRoot.getDefaultTemplate());
|
||||
}
|
||||
|
||||
//isImmuneToFire = contained.getGenome().getFireResist();
|
||||
setSpecies(contained.getGenome().getPrimary());
|
||||
//dataWatcher.updateObject(DATAWATCHER_ID_SPECIES, species.getUID());
|
||||
//dataWatcher.updateObject(DATAWATCHER_ID_SCALE, (int)(contained.getSize() * 100));
|
||||
return this;
|
||||
}
|
||||
|
||||
public IBee getBee() {
|
||||
return contained;
|
||||
}
|
||||
|
||||
public EntityBee setType(EnumBeeType type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
public EnumBeeType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public EntityBee setSpecies(IAlleleBeeSpecies species) {
|
||||
this.species = species;
|
||||
resetAppearance();
|
||||
lastUpdate = worldObj.getTotalWorldTime();
|
||||
return this;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private ResourceLocation textureResource;
|
||||
private long lastTextureUpdate;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ResourceLocation getTexture() {
|
||||
if (textureResource == null || lastTextureUpdate != lastUpdate) {
|
||||
textureResource = new ForestryResource(beeTexture);
|
||||
}
|
||||
|
||||
return textureResource;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,6 +10,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.entities;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
@@ -36,8 +37,11 @@ import forestry.core.config.Config;
|
||||
import forestry.core.inventory.IInventoryAdapter;
|
||||
|
||||
public class EntityMinecartApiary extends EntityMinecartBeeHousingBase implements IApiary {
|
||||
@Nonnull
|
||||
private static final IBeeModifier beeModifier = new ApiaryBeeModifier();
|
||||
@Nonnull
|
||||
private final IBeeListener beeListener = new ApiaryBeeListener(this);
|
||||
@Nonnull
|
||||
private final InventoryApiary inventory = new InventoryApiary(getAccessHandler());
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@@ -64,6 +68,7 @@ public class EntityMinecartApiary extends EntityMinecartBeeHousingBase implement
|
||||
return inventory;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBeeHousingInventory getBeeInventory() {
|
||||
return inventory;
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.entities;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@@ -72,6 +73,7 @@ public class EntityMinecartBeehouse extends EntityMinecartBeeHousingBase {
|
||||
return Collections.singleton(beeListener);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBeeHousingInventory getBeeInventory() {
|
||||
return beeInventory;
|
||||
|
||||
@@ -12,20 +12,19 @@ package forestry.apiculture.entities;
|
||||
|
||||
import net.minecraft.client.particle.Particle;
|
||||
import net.minecraft.client.renderer.VertexBuffer;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.apiculture.PluginApiculture;
|
||||
import forestry.apiculture.proxy.ProxyApicultureClient;
|
||||
|
||||
public class ParticleBeeExplore extends Particle {
|
||||
private final Vec3d origin;
|
||||
|
||||
public ParticleBeeExplore(World world, Vec3d origin, BlockPos destination, int color) {
|
||||
super(world, origin.xCoord, origin.yCoord, origin.zCoord, 0.0D, 0.0D, 0.0D);
|
||||
setParticleTexture(PluginApiculture.beeSprite);
|
||||
setParticleTexture(ProxyApicultureClient.beeSprite);
|
||||
this.origin = origin;
|
||||
|
||||
this.motionX = (destination.getX() + 0.5 - this.posX) * 0.015;
|
||||
@@ -124,6 +123,13 @@ public class ParticleBeeExplore extends Particle {
|
||||
return 15728880;
|
||||
}
|
||||
|
||||
// avoid calculating collisions
|
||||
@Override
|
||||
public void moveEntity(double x, double y, double z) {
|
||||
this.setEntityBoundingBox(this.getEntityBoundingBox().offset(x, y, z));
|
||||
this.resetPositionToBB();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFXLayer() {
|
||||
return 1;
|
||||
|
||||
@@ -17,7 +17,7 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.apiculture.PluginApiculture;
|
||||
import forestry.apiculture.proxy.ProxyApicultureClient;
|
||||
|
||||
public class ParticleBeeRoundTrip extends Particle {
|
||||
private final Vec3d origin;
|
||||
@@ -25,7 +25,7 @@ public class ParticleBeeRoundTrip extends Particle {
|
||||
|
||||
public ParticleBeeRoundTrip(World world, Vec3d origin, BlockPos destination, int color) {
|
||||
super(world, origin.xCoord, origin.yCoord, origin.zCoord, 0.0D, 0.0D, 0.0D);
|
||||
setParticleTexture(PluginApiculture.beeSprite);
|
||||
setParticleTexture(ProxyApicultureClient.beeSprite);
|
||||
this.origin = origin;
|
||||
|
||||
this.destination = destination;
|
||||
@@ -126,6 +126,13 @@ public class ParticleBeeRoundTrip extends Particle {
|
||||
return 15728880;
|
||||
}
|
||||
|
||||
// avoid calculating collisions
|
||||
@Override
|
||||
public void moveEntity(double x, double y, double z) {
|
||||
this.setEntityBoundingBox(this.getEntityBoundingBox().offset(x, y, z));
|
||||
this.resetPositionToBB();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFXLayer() {
|
||||
return 1;
|
||||
|
||||
@@ -13,11 +13,10 @@ package forestry.apiculture.entities;
|
||||
import net.minecraft.client.particle.Particle;
|
||||
import net.minecraft.client.renderer.VertexBuffer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.apiculture.PluginApiculture;
|
||||
import forestry.apiculture.proxy.ProxyApicultureClient;
|
||||
|
||||
public class ParticleBeeTargetEntity extends Particle {
|
||||
private final Vec3d origin;
|
||||
@@ -25,7 +24,7 @@ public class ParticleBeeTargetEntity extends Particle {
|
||||
|
||||
public ParticleBeeTargetEntity(World world, Vec3d origin, Entity entity, int color) {
|
||||
super(world, origin.xCoord, origin.yCoord, origin.zCoord, 0.0D, 0.0D, 0.0D);
|
||||
setParticleTexture(PluginApiculture.beeSprite);
|
||||
setParticleTexture(ProxyApicultureClient.beeSprite);
|
||||
|
||||
this.origin = origin;
|
||||
this.entity = entity;
|
||||
|
||||
@@ -251,6 +251,11 @@ public class BeeAlyzerPlugin implements IAlyzerPlugin {
|
||||
textLayout.endPage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, ItemStack> getIconStacks() {
|
||||
return iconStacks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getHints() {
|
||||
return Config.hints.get("beealyzer");
|
||||
|
||||
@@ -29,7 +29,7 @@ import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import forestry.api.apiculture.IAlleleBeeSpeciesBuilder;
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeMutationCustom;
|
||||
import forestry.api.apiculture.IBeeMutationBuilder;
|
||||
import forestry.api.core.EnumHumidity;
|
||||
import forestry.api.core.EnumTemperature;
|
||||
import forestry.api.genetics.IAllele;
|
||||
@@ -1035,7 +1035,7 @@ public enum BeeDefinition implements IBeeDefinition {
|
||||
BeeManager.beeRoot.registerTemplate(template);
|
||||
}
|
||||
|
||||
protected final IBeeMutationCustom registerMutation(BeeDefinition parent1, BeeDefinition parent2, int chance) {
|
||||
protected final IBeeMutationBuilder registerMutation(BeeDefinition parent1, BeeDefinition parent2, int chance) {
|
||||
return BeeManager.beeMutationFactory.createMutation(parent1.species, parent2.species, getTemplate(), chance);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,17 +18,23 @@ import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.apiculture.IBeeMutationCustom;
|
||||
import forestry.api.apiculture.IBeeMutation;
|
||||
import forestry.api.apiculture.IBeeMutationBuilder;
|
||||
import forestry.api.apiculture.IBeeRoot;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.core.genetics.mutations.Mutation;
|
||||
|
||||
public class BeeMutation extends Mutation implements IBeeMutationCustom {
|
||||
public class BeeMutation extends Mutation implements IBeeMutation, IBeeMutationBuilder {
|
||||
|
||||
public BeeMutation(IAlleleBeeSpecies bee0, IAlleleBeeSpecies bee1, IAllele[] result, int chance) {
|
||||
super(bee0, bee1, result, chance);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IBeeMutation build() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBeeRoot getRoot() {
|
||||
return BeeManager.beeRoot;
|
||||
|
||||
@@ -12,16 +12,16 @@ package forestry.apiculture.genetics;
|
||||
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import forestry.api.apiculture.IBeeMutationCustom;
|
||||
import forestry.api.apiculture.IBeeMutationBuilder;
|
||||
import forestry.api.apiculture.IBeeMutationFactory;
|
||||
import forestry.api.genetics.IAllele;
|
||||
|
||||
public class BeeMutationFactory implements IBeeMutationFactory {
|
||||
|
||||
@Override
|
||||
public IBeeMutationCustom createMutation(IAlleleBeeSpecies parentBee0, IAlleleBeeSpecies parentBee1, IAllele[] result, int chance) {
|
||||
IBeeMutationCustom mutation = new BeeMutation(parentBee0, parentBee1, result, chance);
|
||||
BeeManager.beeRoot.registerMutation(mutation);
|
||||
return mutation;
|
||||
public IBeeMutationBuilder createMutation(IAlleleBeeSpecies parentBee0, IAlleleBeeSpecies parentBee1, IAllele[] result, int chance) {
|
||||
BeeMutation beeMutation = new BeeMutation(parentBee0, parentBee1, result, chance);
|
||||
BeeManager.beeRoot.registerMutation(beeMutation);
|
||||
return beeMutation;
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ package forestry.apiculture.genetics;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
@@ -47,7 +48,7 @@ public class DefaultBeeModelProvider implements IBeeModelProvider {
|
||||
}
|
||||
|
||||
models[beeType.ordinal()] = manager.getModelLocation(beeTypeNameBase);
|
||||
manager.registerVariant(item, new ResourceLocation("forestry:" + beeTypeNameBase));
|
||||
ModelBakery.registerItemVariants(item, new ResourceLocation("forestry:" + beeTypeNameBase));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -195,9 +195,4 @@ public class AlleleBeeSpecies extends AlleleSpecies implements IAlleleBeeSpecies
|
||||
public int getSpriteColour(int renderPass) {
|
||||
return beeSpriteColourProvider.getSpriteColour(renderPass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEntityTexture() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -85,7 +85,7 @@ public class AlleleEffectCreeper extends AlleleEffectThrottled {
|
||||
}
|
||||
|
||||
float pitch = (1.0F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F) * 0.7F;
|
||||
world.playSound((EntityPlayer)null, housingCoords.getX(), housingCoords.getY(), housingCoords.getZ(), SoundEvents.ENTITY_GENERIC_EXPLODE, SoundCategory.BLOCKS, 4.0F, pitch);
|
||||
world.playSound(null, housingCoords.getX(), housingCoords.getY(), housingCoords.getZ(), SoundEvents.ENTITY_GENERIC_EXPLODE, SoundCategory.BLOCKS, 4.0F, pitch);
|
||||
storedData.setInteger(indexExplosionTimer, 2); // Set explosion timer
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@ public class ContainerAlveary extends ContainerTile<TileAlveary> {
|
||||
public ContainerAlveary(InventoryPlayer player, TileAlveary tile) {
|
||||
super(tile, player, 8, 108);
|
||||
ContainerBeeHelper.addSlots(this, tile, false);
|
||||
|
||||
tile.getBeekeepingLogic().clearCachedValues();
|
||||
}
|
||||
|
||||
private int beeProgress = -1;
|
||||
|
||||
@@ -22,6 +22,8 @@ public class ContainerBeeHousing extends ContainerTile<TileBeeHousingBase> imple
|
||||
public ContainerBeeHousing(InventoryPlayer player, TileBeeHousingBase tile, boolean hasFrames) {
|
||||
super(tile, player, 8, 108);
|
||||
ContainerBeeHelper.addSlots(this, tile, hasFrames);
|
||||
|
||||
tile.getBeekeepingLogic().clearCachedValues();
|
||||
}
|
||||
|
||||
private int beeProgress = -1;
|
||||
|
||||
@@ -21,6 +21,8 @@ public class ContainerMinecartBeehouse extends ContainerEntity<EntityMinecartBee
|
||||
public ContainerMinecartBeehouse(InventoryPlayer player, EntityMinecartBeeHousingBase entity, boolean hasFrames) {
|
||||
super(entity, player, 8, 108);
|
||||
ContainerBeeHelper.addSlots(this, entity, hasFrames);
|
||||
|
||||
entity.getBeekeepingLogic().clearCachedValues();
|
||||
}
|
||||
|
||||
private int beeProgress = -1;
|
||||
|
||||
@@ -12,10 +12,10 @@ package forestry.apiculture.inventory;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidUtil;
|
||||
|
||||
import forestry.apiculture.multiblock.TileAlvearyHygroregulator;
|
||||
import forestry.core.fluids.FluidHelper;
|
||||
import forestry.core.inventory.InventoryAdapterTile;
|
||||
|
||||
public class InventoryHygroregulator extends InventoryAdapterTile<TileAlvearyHygroregulator> {
|
||||
@@ -28,8 +28,8 @@ public class InventoryHygroregulator extends InventoryAdapterTile<TileAlvearyHyg
|
||||
@Override
|
||||
public boolean canSlotAccept(int slotIndex, ItemStack itemStack) {
|
||||
if (slotIndex == SLOT_INPUT) {
|
||||
Fluid fluid = FluidHelper.getFluidInContainer(itemStack);
|
||||
return tile.getTankManager().accepts(fluid);
|
||||
FluidStack fluid = FluidUtil.getFluidContained(itemStack);
|
||||
return tile.getTankManager().canFillFluidType(fluid);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ import forestry.core.utils.Translator;
|
||||
|
||||
public class AlvearyController extends RectangularMultiblockControllerBase implements IAlvearyControllerInternal, IClimateControlled {
|
||||
|
||||
@Nonnull
|
||||
private final InventoryBeeHousing inventory;
|
||||
private final IBeekeepingLogic beekeepingLogic;
|
||||
|
||||
@@ -77,6 +78,7 @@ public class AlvearyController extends RectangularMultiblockControllerBase imple
|
||||
this.beeModifiers.add(new AlvearyBeeModifier());
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBeeHousingInventory getBeeInventory() {
|
||||
return inventory;
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.multiblock;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Collections;
|
||||
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -45,6 +46,7 @@ public class FakeAlvearyController extends FakeMultiblockController implements I
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBeeHousingInventory getBeeInventory() {
|
||||
return FakeBeeHousingInventory.instance;
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.multiblock;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
@@ -99,6 +100,7 @@ public abstract class TileAlveary extends MultiblockTileEntityForestry<Multibloc
|
||||
return getMultiblockLogic().getController().getBeeListeners();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBeeHousingInventory getBeeInventory() {
|
||||
return getMultiblockLogic().getController().getBeeInventory();
|
||||
|
||||
@@ -17,10 +17,11 @@ import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
|
||||
import forestry.api.core.IClimateControlled;
|
||||
import forestry.api.multiblock.IAlvearyComponent;
|
||||
@@ -36,7 +37,7 @@ import forestry.core.fluids.tanks.FilteredTank;
|
||||
import forestry.core.inventory.IInventoryAdapter;
|
||||
import forestry.core.tiles.ILiquidTankTile;
|
||||
|
||||
public class TileAlvearyHygroregulator extends TileAlveary implements IInventory, ILiquidTankTile, IFluidHandler, IAlvearyComponent.Climatiser {
|
||||
public class TileAlvearyHygroregulator extends TileAlveary implements IInventory, ILiquidTankTile, IAlvearyComponent.Climatiser {
|
||||
private final HygroregulatorRecipe[] recipes;
|
||||
|
||||
private final TankManager tankManager;
|
||||
@@ -50,12 +51,13 @@ public class TileAlvearyHygroregulator extends TileAlveary implements IInventory
|
||||
super(BlockAlvearyType.HYGRO);
|
||||
|
||||
this.inventory = new InventoryHygroregulator(this);
|
||||
|
||||
Fluid water = Fluids.WATER.getFluid();
|
||||
Fluid lava = Fluids.LAVA.getFluid();
|
||||
|
||||
Fluid water = FluidRegistry.WATER;
|
||||
Fluid lava = FluidRegistry.LAVA;
|
||||
Fluid liquidIce = Fluids.ICE.getFluid();
|
||||
|
||||
this.liquidTank = new FilteredTank(Constants.PROCESSOR_TANK_CAPACITY, water, lava, liquidIce);
|
||||
this.liquidTank = new FilteredTank(Constants.PROCESSOR_TANK_CAPACITY).setFilters(water, lava, liquidIce);
|
||||
|
||||
this.tankManager = new TankManager(this, liquidTank);
|
||||
|
||||
this.recipes = new HygroregulatorRecipe[]{new HygroregulatorRecipe(new FluidStack(water, 1), 1, 0.01f, -0.005f),
|
||||
@@ -91,7 +93,7 @@ public class TileAlvearyHygroregulator extends TileAlveary implements IInventory
|
||||
currentRecipe = getRecipe(liquidTank.getFluid());
|
||||
|
||||
if (currentRecipe != null) {
|
||||
liquidTank.drain(currentRecipe.liquid.amount, true);
|
||||
liquidTank.drainInternal(currentRecipe.liquid.amount, true);
|
||||
transferTime = currentRecipe.transferTime;
|
||||
}
|
||||
}
|
||||
@@ -150,33 +152,22 @@ public class TileAlvearyHygroregulator extends TileAlveary implements IInventory
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fill(EnumFacing from, FluidStack resource, boolean doFill) {
|
||||
return tankManager.fill(from, resource, doFill);
|
||||
public boolean hasCapability(Capability<?> capability, EnumFacing facing) {
|
||||
if (super.hasCapability(capability, facing)) {
|
||||
return true;
|
||||
}
|
||||
return capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(EnumFacing from, FluidStack resource, boolean doDrain) {
|
||||
return tankManager.drain(from, resource, doDrain);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(EnumFacing from, int maxDrain, boolean doDrain) {
|
||||
return tankManager.drain(from, maxDrain, doDrain);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFill(EnumFacing from, Fluid fluid) {
|
||||
return tankManager.canFill(from, fluid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrain(EnumFacing from, Fluid fluid) {
|
||||
return tankManager.canDrain(from, fluid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo(EnumFacing from) {
|
||||
return tankManager.getTankInfo(from);
|
||||
public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
|
||||
if (super.hasCapability(capability, facing)) {
|
||||
return super.getCapability(capability, facing);
|
||||
}
|
||||
if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY) {
|
||||
return CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY.cast(tankManager);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -137,7 +137,7 @@ public class TileAlvearySwarmer extends TileAlveary implements ISidedInventory,
|
||||
int x = getPos().getX() + worldObj.rand.nextInt(40 * 2) - 40;
|
||||
int z = getPos().getZ() + worldObj.rand.nextInt(40 * 2) - 40;
|
||||
|
||||
if (HiveDecorator.tryGenHive(worldObj, x, z, hive)) {
|
||||
if (HiveDecorator.tryGenHive(worldObj, worldObj.rand, x, z, hive)) {
|
||||
pendingSpawns.pop();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,4 @@ package forestry.apiculture.proxy;
|
||||
|
||||
public class ProxyApiculture {
|
||||
|
||||
public void initializeRendering() {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,10 +10,10 @@
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.proxy;
|
||||
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
|
||||
public class ProxyApicultureClient extends ProxyApiculture {
|
||||
|
||||
@Override
|
||||
public void initializeRendering() {
|
||||
// TODO: remove unused bee entity model completely
|
||||
}
|
||||
public static TextureAtlasSprite beeSprite;
|
||||
|
||||
}
|
||||
@@ -160,9 +160,4 @@ public class ModelBee extends ModelBase {
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) {
|
||||
super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,44 +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.apiculture.render;
|
||||
|
||||
import net.minecraft.client.renderer.entity.RenderLiving;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import forestry.apiculture.entities.EntityBee;
|
||||
import forestry.core.proxy.Proxies;
|
||||
|
||||
public class RenderBeeEntity extends RenderLiving {
|
||||
|
||||
private final ModelBee beeModel;
|
||||
|
||||
public RenderBeeEntity() {
|
||||
super(Proxies.common.getClientInstance().getRenderManager(), new ModelBee(), 0.15f);
|
||||
beeModel = (ModelBee) mainModel;
|
||||
}
|
||||
|
||||
private void renderBee(EntityBee entity, double posX, double posY, double posZ, float par8, float par9) {
|
||||
beeModel.setType(entity.getType());
|
||||
this.doRender(entity, posX, posY, posZ, par8, par9);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRender(EntityLiving entity, double x, double y, double z, float entityYaw, float partialTicks) {
|
||||
renderBee((EntityBee) entity, x, y, z, entityYaw, partialTicks);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(Entity entity) {
|
||||
return ((EntityBee) entity).getTexture();
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,13 @@
|
||||
package forestry.apiculture.tiles;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.api.apiculture.IBeeHousingInventory;
|
||||
|
||||
public class FakeBeeHousingInventory implements IBeeHousingInventory {
|
||||
@Nonnull
|
||||
public static final FakeBeeHousingInventory instance = new FakeBeeHousingInventory();
|
||||
|
||||
private FakeBeeHousingInventory() {
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.tiles;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
@@ -30,8 +31,11 @@ import forestry.apiculture.inventory.IApiaryInventory;
|
||||
import forestry.apiculture.inventory.InventoryApiary;
|
||||
|
||||
public class TileApiary extends TileBeeHousingBase implements IApiary {
|
||||
@Nonnull
|
||||
private final IBeeModifier beeModifier = new ApiaryBeeModifier();
|
||||
@Nonnull
|
||||
private final IBeeListener beeListener = new ApiaryBeeListener(this);
|
||||
@Nonnull
|
||||
private final InventoryApiary inventory = new InventoryApiary(getAccessHandler());
|
||||
|
||||
public TileApiary() {
|
||||
@@ -39,6 +43,7 @@ public class TileApiary extends TileBeeHousingBase implements IApiary {
|
||||
setInternalInventory(inventory);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBeeHousingInventory getBeeInventory() {
|
||||
return inventory;
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.tiles;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Collections;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -24,9 +25,12 @@ import forestry.apiculture.gui.ContainerBeeHousing;
|
||||
import forestry.apiculture.gui.GuiBeeHousing;
|
||||
|
||||
public class TileBeeHouse extends TileBeeHousingBase {
|
||||
@Nonnull
|
||||
private static final IBeeModifier beeModifier = new BeehouseBeeModifier();
|
||||
|
||||
@Nonnull
|
||||
private final IBeeListener beeListener;
|
||||
@Nonnull
|
||||
private final InventoryBeeHousing beeInventory;
|
||||
|
||||
public TileBeeHouse() {
|
||||
@@ -38,6 +42,7 @@ public class TileBeeHouse extends TileBeeHousingBase {
|
||||
setInternalInventory(beeInventory);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBeeHousingInventory getBeeInventory() {
|
||||
return beeInventory;
|
||||
|
||||
@@ -231,8 +231,7 @@ public class TileHive extends TileEntity implements ITickable, IHiveTile, IActiv
|
||||
if (damage > 0) {
|
||||
// Entities are not attacked if they wear a full set of apiarist's armor.
|
||||
int count = BeeManager.armorApiaristHelper.wearsItems(entity, damageSourceBeeHive.damageType, true);
|
||||
damage -= damage / 4.0f * count;
|
||||
if (damage > 0) {
|
||||
if (entity.worldObj.rand.nextInt(4) >= count) {
|
||||
entity.attackEntityFrom(damageSourceBeeHive, damage);
|
||||
}
|
||||
}
|
||||
@@ -294,6 +293,7 @@ public class TileHive extends TileEntity implements ITickable, IHiveTile, IActiv
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBeeHousingInventory getBeeInventory() {
|
||||
return inventory;
|
||||
|
||||
@@ -13,6 +13,7 @@ package forestry.apiculture.worldgen;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -52,8 +53,8 @@ public final class Hive {
|
||||
return hiveDescription.getGenChance();
|
||||
}
|
||||
|
||||
public void postGen(World world, BlockPos pos) {
|
||||
hiveDescription.postGen(world, pos);
|
||||
public void postGen(World world, Random rand, BlockPos pos) {
|
||||
hiveDescription.postGen(world, rand, pos);
|
||||
}
|
||||
|
||||
public boolean isGoodBiome(Biome biome) {
|
||||
|
||||
@@ -34,7 +34,7 @@ import forestry.core.utils.Log;
|
||||
|
||||
public abstract class HiveDecorator {
|
||||
|
||||
private static final EventType EVENT_TYPE = EnumHelper.addEnum(EventType.class, "FORESTRY_HIVES", new Class[0], new Object[0]);
|
||||
private static final EventType EVENT_TYPE = EnumHelper.addEnum(EventType.class, "FORESTRY_HIVES", new Class[0]);
|
||||
|
||||
public static void decorateHives(IChunkGenerator chunkProvider, World world, Random rand, int chunkX, int chunkZ, boolean hasVillageGenerated) {
|
||||
if (!TerrainGen.populate(chunkProvider, world, rand, chunkX, chunkZ, hasVillageGenerated, EVENT_TYPE)) {
|
||||
@@ -48,7 +48,7 @@ public abstract class HiveDecorator {
|
||||
List<Hive> hives = PluginApiculture.hiveRegistry.getHives();
|
||||
|
||||
if (Config.generateBeehivesDebug) {
|
||||
decorateHivesDebug(world, chunkX, chunkZ, hives);
|
||||
decorateHivesDebug(world, rand, chunkX, chunkZ, hives);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public abstract class HiveDecorator {
|
||||
for (Hive hive : hives) {
|
||||
if (hive.genChance() * Config.getBeehivesAmount() >= rand.nextFloat() * 100.0f) {
|
||||
if (hive.isGoodBiome(biome) && hive.isGoodHumidity(humidity)) {
|
||||
if (tryGenHive(world, x, z, hive)) {
|
||||
if (tryGenHive(world, rand, x, z, hive)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -81,7 +81,7 @@ public abstract class HiveDecorator {
|
||||
}
|
||||
}
|
||||
|
||||
private static void decorateHivesDebug(World world, int chunkX, int chunkZ, List<Hive> hives) {
|
||||
private static void decorateHivesDebug(World world, Random rand, int chunkX, int chunkZ, List<Hive> hives) {
|
||||
int worldX = (chunkX << 4) + 8;
|
||||
int worldZ = (chunkZ << 4) + 8;
|
||||
Biome biome = world.getBiome(new BlockPos(chunkX, 0, chunkZ));
|
||||
@@ -95,13 +95,13 @@ public abstract class HiveDecorator {
|
||||
continue;
|
||||
}
|
||||
|
||||
tryGenHive(world, worldX + x, worldZ + z, hive);
|
||||
tryGenHive(world, rand, worldX + x, worldZ + z, hive);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean tryGenHive(World world, int x, int z, Hive hive) {
|
||||
public static boolean tryGenHive(World world, Random rand, int x, int z, Hive hive) {
|
||||
|
||||
final BlockPos hivePos = hive.getPosForHive(world, x, z);
|
||||
|
||||
@@ -123,10 +123,10 @@ public abstract class HiveDecorator {
|
||||
return false;
|
||||
}
|
||||
|
||||
return setHive(world, hivePos, hive);
|
||||
return setHive(world, rand, hivePos, hive);
|
||||
}
|
||||
|
||||
private static boolean setHive(World world, BlockPos pos, Hive hive) {
|
||||
private static boolean setHive(World world, Random rand, BlockPos pos, Hive hive) {
|
||||
IBlockState hiveState = hive.getHiveBlockState();
|
||||
Block hiveBlock = hiveState.getBlock();
|
||||
boolean placed = world.setBlockState(pos, hiveState, Constants.FLAG_BLOCK_SYNC);
|
||||
@@ -143,7 +143,7 @@ public abstract class HiveDecorator {
|
||||
hiveBlock.onBlockAdded(world, pos, state);
|
||||
|
||||
if (!Config.generateBeehivesDebug) {
|
||||
hive.postGen(world, pos);
|
||||
hive.postGen(world, rand, pos);
|
||||
}
|
||||
|
||||
if (Config.logHivePlacement) {
|
||||
|
||||
@@ -13,6 +13,7 @@ package forestry.apiculture.worldgen;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -41,23 +42,23 @@ public enum HiveDescription implements IHiveDescription {
|
||||
|
||||
FOREST(IHiveRegistry.HiveType.FOREST, 3.0f, BeeDefinition.FOREST, HiveManager.genHelper.tree()) {
|
||||
@Override
|
||||
public void postGen(World world, BlockPos pos) {
|
||||
super.postGen(world, pos);
|
||||
postGenFlowers(world, pos, flowerStates);
|
||||
public void postGen(World world, Random rand, BlockPos pos) {
|
||||
super.postGen(world, rand, pos);
|
||||
postGenFlowers(world, rand, pos, flowerStates);
|
||||
}
|
||||
},
|
||||
MEADOWS(IHiveRegistry.HiveType.MEADOWS, 1.0f, BeeDefinition.MEADOWS, HiveManager.genHelper.ground(Blocks.DIRT, Blocks.GRASS)) {
|
||||
@Override
|
||||
public void postGen(World world, BlockPos pos) {
|
||||
super.postGen(world, pos);
|
||||
postGenFlowers(world, pos, flowerStates);
|
||||
public void postGen(World world, Random rand, BlockPos pos) {
|
||||
super.postGen(world, rand, pos);
|
||||
postGenFlowers(world, rand, pos, flowerStates);
|
||||
}
|
||||
},
|
||||
DESERT(IHiveRegistry.HiveType.DESERT, 1.0f, BeeDefinition.MODEST, HiveManager.genHelper.ground(Blocks.DIRT, Blocks.GRASS, Blocks.SAND, Blocks.SANDSTONE)) {
|
||||
@Override
|
||||
public void postGen(World world, BlockPos pos) {
|
||||
super.postGen(world, pos);
|
||||
postGenFlowers(world, pos, cactusStates);
|
||||
public void postGen(World world, Random rand, BlockPos pos) {
|
||||
super.postGen(world, rand, pos);
|
||||
postGenFlowers(world, rand, pos, cactusStates);
|
||||
}
|
||||
},
|
||||
JUNGLE(IHiveRegistry.HiveType.JUNGLE, 6.0f, BeeDefinition.TROPICAL, HiveManager.genHelper.tree()),
|
||||
@@ -69,21 +70,21 @@ public enum HiveDescription implements IHiveDescription {
|
||||
},
|
||||
SNOW(IHiveRegistry.HiveType.SNOW, 2.0f, BeeDefinition.WINTRY, HiveManager.genHelper.ground(Blocks.DIRT, Blocks.GRASS, Blocks.SNOW)) {
|
||||
@Override
|
||||
public void postGen(World world, BlockPos pos) {
|
||||
public void postGen(World world, Random rand, BlockPos pos) {
|
||||
BlockPos posAbove = pos.up();
|
||||
if (world.isAirBlock(posAbove)) {
|
||||
world.setBlockState(posAbove, Blocks.SNOW_LAYER.getDefaultState(), Constants.FLAG_BLOCK_SYNC);
|
||||
}
|
||||
|
||||
postGenFlowers(world, pos, flowerStates);
|
||||
postGenFlowers(world, rand, pos, flowerStates);
|
||||
}
|
||||
},
|
||||
SWAMP(IHiveRegistry.HiveType.SWAMP, 2.0f, BeeDefinition.MARSHY, HiveManager.genHelper.ground(Blocks.DIRT, Blocks.GRASS)) {
|
||||
@Override
|
||||
public void postGen(World world, BlockPos pos) {
|
||||
super.postGen(world, pos);
|
||||
public void postGen(World world, Random rand, BlockPos pos) {
|
||||
super.postGen(world, rand, pos);
|
||||
|
||||
postGenFlowers(world, pos, mushroomStates);
|
||||
postGenFlowers(world, rand, pos, mushroomStates);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -146,15 +147,15 @@ public enum HiveDescription implements IHiveDescription {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postGen(World world, BlockPos pos) {
|
||||
public void postGen(World world, Random rand, BlockPos pos) {
|
||||
|
||||
}
|
||||
|
||||
protected static void postGenFlowers(World world, BlockPos hivePos, List<IBlockState> flowerStates) {
|
||||
protected static void postGenFlowers(World world, Random rand, BlockPos hivePos, List<IBlockState> flowerStates) {
|
||||
int plantedCount = 0;
|
||||
for (int i = 0; i < 10; i++) {
|
||||
int xOffset = world.rand.nextInt(8) - 4;
|
||||
int zOffset = world.rand.nextInt(8) - 4;
|
||||
int xOffset = rand.nextInt(8) - 4;
|
||||
int zOffset = rand.nextInt(8) - 4;
|
||||
BlockPos blockPos = hivePos.add(xOffset, 0, zOffset);
|
||||
if ((xOffset == 0 && zOffset == 0) || !world.isBlockLoaded(blockPos)) {
|
||||
continue;
|
||||
@@ -165,7 +166,7 @@ public enum HiveDescription implements IHiveDescription {
|
||||
continue;
|
||||
}
|
||||
|
||||
IBlockState state = flowerStates.get(world.rand.nextInt(flowerStates.size()));
|
||||
IBlockState state = flowerStates.get(rand.nextInt(flowerStates.size()));
|
||||
Block block = state.getBlock();
|
||||
if (!block.canPlaceBlockAt(world, blockPos)) {
|
||||
continue;
|
||||
|
||||
@@ -12,6 +12,7 @@ package forestry.apiculture.worldgen;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.init.Blocks;
|
||||
@@ -68,7 +69,7 @@ public class HiveDescriptionSwarmer implements IHiveDescription {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postGen(World world, BlockPos pos) {
|
||||
public void postGen(World world, Random rand, BlockPos pos) {
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
if (tile instanceof TileHive) {
|
||||
((TileHive) tile).setContained(bees);
|
||||
|
||||
@@ -112,7 +112,7 @@ public class VillageApiaristHouse extends StructureVillagePieces.House1 {
|
||||
}
|
||||
|
||||
public static VillageApiaristHouse buildComponent(StructureVillagePieces.Start startPiece, List<StructureComponent> par1List, Random random, int structureMinX, int structureMinY, int structureMinZ, EnumFacing facing, int componentType) {
|
||||
StructureBoundingBox bbox = StructureBoundingBox.getComponentToAddBoundingBox(structureMinX, structureMinY, structureMinZ, 0, 0, 0, 10, 9, 11, facing);
|
||||
StructureBoundingBox bbox = StructureBoundingBox.getComponentToAddBoundingBox(structureMinX, structureMinY, structureMinZ, -4, 0, 0, 12, 9, 12, facing);
|
||||
if (!canVillageGoDeeper(bbox) || StructureComponent.findIntersecting(par1List, bbox) != null) {
|
||||
return null;
|
||||
}
|
||||
@@ -129,7 +129,7 @@ public class VillageApiaristHouse extends StructureVillagePieces.House1 {
|
||||
return true;
|
||||
}
|
||||
|
||||
boundingBox.offset(0, averageGroundLevel - boundingBox.maxY + 8 - 1, 0);
|
||||
boundingBox.offset(0, averageGroundLevel - boundingBox.maxY + 9 - 1, 0);
|
||||
}
|
||||
|
||||
fillWithBlocks(world, structBoundingBox, 1, 1, 1, 7, 4, 4, Blocks.AIR.getDefaultState(), Blocks.AIR.getDefaultState(), false);
|
||||
|
||||
@@ -71,7 +71,6 @@ import forestry.arboriculture.genetics.alleles.AlleleFruit;
|
||||
import forestry.arboriculture.genetics.alleles.AlleleGrowth;
|
||||
import forestry.arboriculture.genetics.alleles.AlleleLeafEffect;
|
||||
import forestry.arboriculture.items.ItemCharcoal;
|
||||
import forestry.arboriculture.items.ItemGermlingGE;
|
||||
import forestry.arboriculture.items.ItemRegistryArboriculture;
|
||||
import forestry.arboriculture.models.TextureLeaves;
|
||||
import forestry.arboriculture.network.PacketRegistryArboriculture;
|
||||
|
||||
@@ -16,7 +16,9 @@ import java.util.Collections;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.BlockDoor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -40,7 +42,7 @@ public class BlockArbDoor extends BlockDoor implements IWoodTyped, IItemModelReg
|
||||
private final EnumForestryWoodType woodType;
|
||||
|
||||
public BlockArbDoor(EnumForestryWoodType woodType) {
|
||||
super(MaterialArbWood.ARB_WOOD);
|
||||
super(Material.WOOD);
|
||||
this.woodType = woodType;
|
||||
|
||||
setHarvestLevel("axe", 0);
|
||||
@@ -50,7 +52,7 @@ public class BlockArbDoor extends BlockDoor implements IWoodTyped, IItemModelReg
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
manager.registerVariant(item, WoodHelper.getResourceLocations(this));
|
||||
ModelBakery.registerItemVariants(item, WoodHelper.getResourceLocations(this));
|
||||
manager.registerItemModel(item, new WoodHelper.WoodMeshDefinition(this));
|
||||
}
|
||||
|
||||
@@ -99,7 +101,6 @@ public class BlockArbDoor extends BlockDoor implements IWoodTyped, IItemModelReg
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ItemStack getItem(World worldIn, BlockPos pos, IBlockState state) {
|
||||
return new ItemStack(getItem());
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import net.minecraft.block.BlockPlanks.EnumType;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -59,11 +60,6 @@ public class BlockForestryFenceGate<T extends Enum<T> & IWoodType> extends Block
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Material getMaterial(IBlockState state) {
|
||||
return MaterialArbWood.ARB_WOOD;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFireproof() {
|
||||
return fireproof;
|
||||
@@ -124,7 +120,7 @@ public class BlockForestryFenceGate<T extends Enum<T> & IWoodType> extends Block
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
manager.registerVariant(item, WoodHelper.getResourceLocations(this));
|
||||
ModelBakery.registerItemVariants(item, WoodHelper.getResourceLocations(this));
|
||||
manager.registerItemModel(item, new WoodMeshDefinition(this));
|
||||
}
|
||||
}
|
||||
@@ -214,17 +214,16 @@ public class BlockForestryLeaves extends BlockLeaves implements ITileEntityProvi
|
||||
|
||||
@Override
|
||||
public List<ItemStack> onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune) {
|
||||
String speciesUid = TreeDefinition.Oak.getUID();
|
||||
|
||||
TileLeaves leaves = TileUtil.getTile(world, pos, TileLeaves.class);
|
||||
if (leaves == null) {
|
||||
return null;
|
||||
if (leaves != null) {
|
||||
ITree tree = leaves.getTree();
|
||||
if (tree != null) {
|
||||
speciesUid = tree.getGenome().getPrimary().getUID();
|
||||
}
|
||||
}
|
||||
|
||||
ITree tree = leaves.getTree();
|
||||
if (tree == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String speciesUid = tree.getGenome().getPrimary().getUID();
|
||||
|
||||
return Collections.singletonList(PluginArboriculture.blocks.getDecorativeLeaves(speciesUid));
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import java.util.Collections;
|
||||
import net.minecraft.block.BlockStairs;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -38,16 +39,11 @@ public class BlockForestryStairs<T extends Enum<T> & IWoodType> extends BlockSta
|
||||
setHarvestLevel("axe", 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Material getMaterial(IBlockState state) {
|
||||
return MaterialArbWood.ARB_WOOD;
|
||||
}
|
||||
|
||||
/* MODELS */
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
manager.registerVariant(item, WoodHelper.getResourceLocations(this));
|
||||
ModelBakery.registerItemVariants(item, WoodHelper.getResourceLocations(this));
|
||||
manager.registerItemModel(item, new WoodHelper.WoodMeshDefinition(this));
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,6 @@ import net.minecraftforge.common.property.IUnlistedProperty;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.arboriculture.EnumGermlingType;
|
||||
import forestry.api.arboriculture.EnumPileType;
|
||||
import forestry.api.arboriculture.IAlleleTreeSpecies;
|
||||
import forestry.api.arboriculture.ITree;
|
||||
@@ -192,7 +191,7 @@ public abstract class BlockPile extends BlockStructure implements ITileEntityPro
|
||||
|
||||
@Override
|
||||
public RayTraceResult collisionRayTrace(IBlockState blockState, World worldIn, BlockPos pos, Vec3d start, Vec3d end){
|
||||
List<RayTraceResult> list = Lists.<RayTraceResult>newArrayList();
|
||||
List<RayTraceResult> list = Lists.newArrayList();
|
||||
|
||||
for (AxisAlignedBB axisalignedbb : getCollisionBoxList(this.getActualState(blockState, worldIn, pos)))
|
||||
{
|
||||
@@ -229,7 +228,7 @@ public abstract class BlockPile extends BlockStructure implements ITileEntityPro
|
||||
}
|
||||
|
||||
private static List<AxisAlignedBB> getCollisionBoxList(IBlockState state){
|
||||
List<AxisAlignedBB> list = Lists.<AxisAlignedBB>newArrayList();
|
||||
List<AxisAlignedBB> list = Lists.newArrayList();
|
||||
EnumPilePosition position = state.getValue(PILE_POSITION);
|
||||
|
||||
if(position != EnumPilePosition.INTERIOR){
|
||||
@@ -312,15 +311,15 @@ public abstract class BlockPile extends BlockStructure implements ITileEntityPro
|
||||
float f2 = pos.getZ() + 0.5F;
|
||||
float f3 = 0.52F;
|
||||
float f4 = rand.nextFloat() * 0.6F - 0.3F;
|
||||
world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, f + f3 - 0.5, f1 + 0.5, f2 + f4, 0.0D, 0.0D, 0.0D, new int[0]);
|
||||
world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, f + f3 - 0.5, f1 + 0.5, f2 + f4, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List subItems) {
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List<ItemStack> subItems) {
|
||||
if(getPileType() == EnumPileType.WOOD){
|
||||
List<ItemStack> woodPiles = new ArrayList();
|
||||
List<ItemStack> woodPiles = new ArrayList<>();
|
||||
for(ITree tree : TreeManager.treeRoot.getIndividualTemplates()) {
|
||||
woodPiles.add(createWoodPile(tree));
|
||||
}
|
||||
@@ -407,7 +406,7 @@ public abstract class BlockPile extends BlockStructure implements ITileEntityPro
|
||||
|
||||
@Nonnull
|
||||
private List<ItemStack> getPileDrop(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
||||
ArrayList<ItemStack> list = new ArrayList<ItemStack>();
|
||||
List<ItemStack> list = new ArrayList<>();
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
if (tile instanceof ICharcoalPileComponent) {
|
||||
ICharcoalPileComponent pile = (ICharcoalPileComponent) tile;
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
package forestry.arboriculture.blocks;
|
||||
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
public class MaterialArbWood extends Material {
|
||||
|
||||
public static final Material ARB_WOOD = new MaterialArbWood();
|
||||
|
||||
private MaterialArbWood() {
|
||||
super(MapColor.WOOD);
|
||||
setBurning();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.init.Blocks;
|
||||
@@ -35,7 +36,6 @@ import forestry.api.core.Tabs;
|
||||
import forestry.arboriculture.IWoodTyped;
|
||||
import forestry.arboriculture.PluginArboriculture;
|
||||
import forestry.arboriculture.WoodHelper;
|
||||
import forestry.arboriculture.blocks.MaterialArbWood;
|
||||
import forestry.arboriculture.blocks.WoodTypeStateMapper;
|
||||
import forestry.arboriculture.blocks.property.PropertyWoodType;
|
||||
import forestry.core.proxy.Proxies;
|
||||
@@ -48,7 +48,7 @@ public abstract class BlockForestryFence<T extends Enum<T> & IWoodType> extends
|
||||
private final int blockNumber;
|
||||
|
||||
protected BlockForestryFence(boolean fireproof, int blockNumber) {
|
||||
super(MaterialArbWood.ARB_WOOD, BlockPlanks.EnumType.OAK.getMapColor());
|
||||
super(Material.WOOD, BlockPlanks.EnumType.OAK.getMapColor());
|
||||
this.fireproof = fireproof;
|
||||
this.blockNumber = blockNumber;
|
||||
|
||||
@@ -104,7 +104,7 @@ public abstract class BlockForestryFence<T extends Enum<T> & IWoodType> extends
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
manager.registerVariant(item, WoodHelper.getResourceLocations(this));
|
||||
ModelBakery.registerItemVariants(item, WoodHelper.getResourceLocations(this));
|
||||
manager.registerItemModel(item, new WoodHelper.WoodMeshDefinition(this));
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import net.minecraft.block.BlockLog;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -29,7 +30,6 @@ import forestry.api.core.IStateMapperRegister;
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.arboriculture.IWoodTyped;
|
||||
import forestry.arboriculture.WoodHelper;
|
||||
import forestry.arboriculture.blocks.MaterialArbWood;
|
||||
import forestry.arboriculture.blocks.WoodTypeStateMapper;
|
||||
import forestry.arboriculture.blocks.property.PropertyWoodType;
|
||||
import forestry.core.proxy.Proxies;
|
||||
@@ -67,11 +67,6 @@ public abstract class BlockForestryLog<T extends Enum<T> & IWoodType> extends Bl
|
||||
return blockNumber;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final Material getMaterial(IBlockState state) {
|
||||
return MaterialArbWood.ARB_WOOD;
|
||||
}
|
||||
|
||||
private static EnumAxis getAxis(int meta) {
|
||||
switch (meta & 12) {
|
||||
case 0:
|
||||
@@ -187,7 +182,7 @@ public abstract class BlockForestryLog<T extends Enum<T> & IWoodType> extends Bl
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public final void registerModel(Item item, IModelManager manager) {
|
||||
manager.registerVariant(item, WoodHelper.getResourceLocations(this));
|
||||
ModelBakery.registerItemVariants(item, WoodHelper.getResourceLocations(this));
|
||||
manager.registerItemModel(item, new WoodHelper.WoodMeshDefinition(this));
|
||||
}
|
||||
|
||||
|
||||
@@ -6,8 +6,10 @@ import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -29,7 +31,6 @@ import forestry.api.core.IStateMapperRegister;
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.arboriculture.IWoodTyped;
|
||||
import forestry.arboriculture.WoodHelper;
|
||||
import forestry.arboriculture.blocks.MaterialArbWood;
|
||||
import forestry.arboriculture.blocks.WoodTypeStateMapper;
|
||||
import forestry.arboriculture.blocks.property.PropertyWoodType;
|
||||
import forestry.core.proxy.Proxies;
|
||||
@@ -42,7 +43,7 @@ public abstract class BlockForestryPlanks<T extends Enum<T> & IWoodType> extends
|
||||
private final int blockNumber;
|
||||
|
||||
protected BlockForestryPlanks(boolean fireproof, int blockNumber) {
|
||||
super(MaterialArbWood.ARB_WOOD);
|
||||
super(Material.WOOD);
|
||||
this.fireproof = fireproof;
|
||||
this.blockNumber = blockNumber;
|
||||
|
||||
@@ -120,7 +121,7 @@ public abstract class BlockForestryPlanks<T extends Enum<T> & IWoodType> extends
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
manager.registerVariant(item, WoodHelper.getResourceLocations(this));
|
||||
ModelBakery.registerItemVariants(item, WoodHelper.getResourceLocations(this));
|
||||
manager.registerItemModel(item, new WoodHelper.WoodMeshDefinition(this));
|
||||
}
|
||||
|
||||
|
||||
@@ -7,9 +7,11 @@ import java.util.Random;
|
||||
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -30,7 +32,6 @@ import forestry.api.core.IStateMapperRegister;
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.arboriculture.IWoodTyped;
|
||||
import forestry.arboriculture.WoodHelper;
|
||||
import forestry.arboriculture.blocks.MaterialArbWood;
|
||||
import forestry.arboriculture.blocks.WoodTypeStateMapper;
|
||||
import forestry.arboriculture.blocks.property.PropertyWoodType;
|
||||
import forestry.core.proxy.Proxies;
|
||||
@@ -43,7 +44,7 @@ public abstract class BlockForestrySlab<T extends Enum<T> & IWoodType> extends B
|
||||
private final int blockNumber;
|
||||
|
||||
protected BlockForestrySlab(boolean fireproof, int blockNumber) {
|
||||
super(MaterialArbWood.ARB_WOOD);
|
||||
super(Material.WOOD);
|
||||
this.fireproof = fireproof;
|
||||
this.blockNumber = blockNumber;
|
||||
|
||||
@@ -132,7 +133,7 @@ public abstract class BlockForestrySlab<T extends Enum<T> & IWoodType> extends B
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
manager.registerVariant(item, WoodHelper.getResourceLocations(this));
|
||||
ModelBakery.registerItemVariants(item, WoodHelper.getResourceLocations(this));
|
||||
manager.registerItemModel(item, new WoodHelper.WoodMeshDefinition(this));
|
||||
}
|
||||
|
||||
|
||||
@@ -203,7 +203,7 @@ public class Tree extends Individual implements ITree, IPlantable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getGirth(World world, BlockPos pos) {
|
||||
public int getGirth() {
|
||||
return genome.getGirth();
|
||||
}
|
||||
|
||||
|
||||
@@ -291,6 +291,11 @@ public class TreeAlyzerPlugin implements IAlyzerPlugin {
|
||||
textLayout.endPage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, ItemStack> getIconStacks() {
|
||||
return iconStacks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getHints() {
|
||||
return Config.hints.get("treealyzer");
|
||||
|
||||
@@ -39,7 +39,7 @@ import forestry.api.arboriculture.ILeafSpriteProvider;
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.arboriculture.ITreeGenerator;
|
||||
import forestry.api.arboriculture.ITreeGenome;
|
||||
import forestry.api.arboriculture.ITreeMutationCustom;
|
||||
import forestry.api.arboriculture.ITreeMutationBuilder;
|
||||
import forestry.api.arboriculture.IWoodProvider;
|
||||
import forestry.api.arboriculture.IWoodType;
|
||||
import forestry.api.arboriculture.TreeManager;
|
||||
@@ -1056,7 +1056,7 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator, IStringSe
|
||||
TreeManager.treeRoot.registerTemplate(template);
|
||||
}
|
||||
|
||||
protected final ITreeMutationCustom registerMutation(TreeDefinition parent1, TreeDefinition parent2, int chance) {
|
||||
protected final ITreeMutationBuilder registerMutation(TreeDefinition parent1, TreeDefinition parent2, int chance) {
|
||||
return TreeManager.treeMutationFactory.createMutation(parent1.species, parent2.species, getTemplate(), chance);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,18 +15,24 @@ import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.arboriculture.IAlleleTreeSpecies;
|
||||
import forestry.api.arboriculture.ITreeGenome;
|
||||
import forestry.api.arboriculture.ITreeMutationCustom;
|
||||
import forestry.api.arboriculture.ITreeMutation;
|
||||
import forestry.api.arboriculture.ITreeMutationBuilder;
|
||||
import forestry.api.arboriculture.ITreeRoot;
|
||||
import forestry.api.arboriculture.TreeManager;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.core.genetics.mutations.Mutation;
|
||||
|
||||
public class TreeMutation extends Mutation implements ITreeMutationCustom {
|
||||
public class TreeMutation extends Mutation implements ITreeMutation, ITreeMutationBuilder {
|
||||
|
||||
public TreeMutation(IAlleleTreeSpecies allele0, IAlleleTreeSpecies allele1, IAllele[] template, int chance) {
|
||||
super(allele0, allele1, template, chance);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ITreeMutation build() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ITreeRoot getRoot() {
|
||||
return TreeManager.treeRoot;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
package forestry.arboriculture.genetics;
|
||||
|
||||
import forestry.api.arboriculture.IAlleleTreeSpecies;
|
||||
import forestry.api.arboriculture.ITreeMutationCustom;
|
||||
import forestry.api.arboriculture.ITreeMutationBuilder;
|
||||
import forestry.api.arboriculture.ITreeMutationFactory;
|
||||
import forestry.api.arboriculture.TreeManager;
|
||||
import forestry.api.genetics.IAllele;
|
||||
@@ -19,9 +19,9 @@ import forestry.api.genetics.IAllele;
|
||||
public class TreeMutationFactory implements ITreeMutationFactory {
|
||||
|
||||
@Override
|
||||
public ITreeMutationCustom createMutation(IAlleleTreeSpecies parent0, IAlleleTreeSpecies parent1, IAllele[] result, int chance) {
|
||||
ITreeMutationCustom mutation = new TreeMutation(parent0, parent1, result, chance);
|
||||
TreeManager.treeRoot.registerMutation(mutation);
|
||||
return mutation;
|
||||
public ITreeMutationBuilder createMutation(IAlleleTreeSpecies parent0, IAlleleTreeSpecies parent1, IAllele[] result, int chance) {
|
||||
TreeMutation treeMutation = new TreeMutation(parent0, parent1, result, chance);
|
||||
TreeManager.treeRoot.registerMutation(treeMutation);
|
||||
return treeMutation;
|
||||
}
|
||||
}
|
||||
@@ -73,14 +73,16 @@ public class ItemBlockPile<B extends Block> extends ItemBlockForestry<Block> {
|
||||
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, IBlockState newState) {
|
||||
boolean placed = super.placeBlockAt(stack, player, world, pos, side, hitX, hitY, hitZ, newState);
|
||||
|
||||
if(block == PluginArboriculture.blocks.piles.get(EnumPileType.WOOD)){
|
||||
if (block.hasTileEntity(newState)) {
|
||||
if (stack.hasTagCompound()) {
|
||||
TilePile tile = TileUtil.getTile(world, pos, TilePile.class);
|
||||
if (tile != null) {
|
||||
tile.readFromNBT(stack.getTagCompound());
|
||||
tile.setPos(pos);
|
||||
tile.markDirty();
|
||||
if (placed) {
|
||||
if (block == PluginArboriculture.blocks.piles.get(EnumPileType.WOOD)) {
|
||||
if (block.hasTileEntity(newState)) {
|
||||
if (stack.hasTagCompound()) {
|
||||
TilePile tile = TileUtil.getTile(world, pos, TilePile.class);
|
||||
if (tile != null) {
|
||||
tile.readFromNBT(stack.getTagCompound());
|
||||
tile.setPos(pos);
|
||||
tile.markDirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,11 +2,8 @@ package forestry.arboriculture.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.arboriculture.TreeManager;
|
||||
import forestry.api.core.IModelManager;
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.core.genetics.alleles.AlleleHelper;
|
||||
import forestry.core.items.ItemForestry;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
@@ -92,14 +92,14 @@ public class ModelLeaves extends ModelBlockDefault<BlockForestryLeaves> {
|
||||
TextureAtlasSprite leafSprite = map.getAtlasSprite(leafSpriteLocation.toString());
|
||||
|
||||
// Render the plain leaf block.
|
||||
baker.addBlockModel(block, Block.FULL_BLOCK_AABB, pos, leafSprite, 0);
|
||||
baker.addBlockModel(block, Block.FULL_BLOCK_AABB, null, leafSprite, 0);
|
||||
|
||||
// Render overlay for fruit leaves.
|
||||
ResourceLocation fruitSpriteLocation = tile.getFruitSprite();
|
||||
|
||||
if (fruitSpriteLocation != null) {
|
||||
TextureAtlasSprite fruitSprite = map.getAtlasSprite(fruitSpriteLocation.toString());
|
||||
baker.addBlockModel(block, Block.FULL_BLOCK_AABB, pos, fruitSprite, 1);
|
||||
baker.addBlockModel(block, Block.FULL_BLOCK_AABB, null, fruitSprite, 1);
|
||||
}
|
||||
|
||||
// Set the particle sprite
|
||||
|
||||
@@ -12,10 +12,14 @@ package forestry.arboriculture.models;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.arboriculture.EnumGermlingType;
|
||||
import forestry.api.arboriculture.IGermlingModelProvider;
|
||||
import forestry.api.core.IModelManager;
|
||||
@@ -31,14 +35,15 @@ public class ModelProviderGermling implements IGermlingModelProvider {
|
||||
this.name = modelUid.substring("forestry.".length());
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerModels(Item item, IModelManager manager, EnumGermlingType type) {
|
||||
if(type == EnumGermlingType.SAPLING){
|
||||
germlingModel = manager.getModelLocation("germlings/sapling." + name);
|
||||
manager.registerVariant(item, new ResourceLocation("forestry:germlings/sapling." + name));
|
||||
ModelBakery.registerItemVariants(item, new ResourceLocation("forestry:germlings/sapling." + name));
|
||||
}else if(type == EnumGermlingType.POLLEN){
|
||||
pollenModel = manager.getModelLocation("pollen");
|
||||
manager.registerVariant(item, new ResourceLocation("forestry:pollen"));
|
||||
ModelBakery.registerItemVariants(item, new ResourceLocation("forestry:pollen"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
******************************************************************************/
|
||||
package forestry.arboriculture.render;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import static forestry.arboriculture.multiblock.EnumPilePosition.BACK;
|
||||
import static forestry.arboriculture.multiblock.EnumPilePosition.CORNER_BACK_LEFT;
|
||||
import static forestry.arboriculture.multiblock.EnumPilePosition.CORNER_BACK_RIGHT;
|
||||
@@ -46,8 +48,12 @@ public class CharcoalPileRenderer extends TileEntitySpecialRenderer<TilePile> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TilePile pile, double x, double y, double z, float p_147500_8_, int destroyStage) {
|
||||
public void renderTileEntityAt(@Nonnull TilePile pile, double x, double y, double z, float p_147500_8_, int destroyStage) {
|
||||
IBlockState state = pile.getWorld().getBlockState(pile.getPos());
|
||||
if (!(state.getBlock() instanceof BlockPile)) {
|
||||
return;
|
||||
}
|
||||
|
||||
EnumPilePosition pilePosition = state.getValue(BlockPile.PILE_POSITION);
|
||||
MultiblockLogic<ICharcoalPileControllerInternal> logic = pile.getMultiblockLogic();
|
||||
if (pilePosition != EnumPilePosition.INTERIOR && logic.isConnected() && logic.getController() != null) {
|
||||
|
||||
@@ -130,7 +130,7 @@ public abstract class TileTreeContainer extends TileEntity implements IStreamabl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOwner(@Nullable GameProfile owner) {
|
||||
public void setOwner(@Nonnull GameProfile owner) {
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
|
||||
import forestry.arboriculture.blocks.BlockSapling;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -61,6 +62,7 @@ public abstract class WorldGenArboriculture extends WorldGenBase {
|
||||
}
|
||||
|
||||
if (genPos != null) {
|
||||
clearSaplings(world, genPos);
|
||||
List<BlockPos> branchEnds = new ArrayList<>(generateTrunk(world, rand, wood, genPos));
|
||||
Collections.sort(branchEnds, TopDownBlockPosComparator.INSTANCE);
|
||||
generateLeaves(world, rand, leaf, branchEnds, genPos);
|
||||
@@ -96,6 +98,18 @@ public abstract class WorldGenArboriculture extends WorldGenBase {
|
||||
@Nullable
|
||||
public abstract BlockPos getValidGrowthPos(World world, BlockPos pos);
|
||||
|
||||
public void clearSaplings(World world, BlockPos genPos) {
|
||||
int treeGirth = tree.getGirth();
|
||||
for (int x = 0; x < treeGirth; x++) {
|
||||
for (int z = 0; z < treeGirth; z++) {
|
||||
BlockPos saplingPos = genPos.add(x, 0, z);
|
||||
if (world.getBlockState(saplingPos).getBlock() instanceof BlockSapling) {
|
||||
world.setBlockToAir(saplingPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasPods() {
|
||||
return tree.allowsFruitBlocks();
|
||||
}
|
||||
|
||||
@@ -29,13 +29,6 @@ public class WorldGenBalsa extends WorldGenTree {
|
||||
super(tree, 6, 6);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Set<BlockPos> generateTrunk(World world, Random rand, TreeBlockTypeLog wood, BlockPos startPos) {
|
||||
WorldGenHelper.generateTreeTrunk(world, rand, wood, startPos, height, girth, 0, 0, null, 0);
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void generateLeaves(World world, Random rand, TreeBlockTypeLeaf leaf, List<BlockPos> branchEnds, BlockPos startPos) {
|
||||
BlockPos.MutableBlockPos leafCenter = new BlockPos.MutableBlockPos(startPos.add(0, height, 0));
|
||||
|
||||
@@ -47,12 +47,13 @@ public class WorldGenCherry extends WorldGenTree {
|
||||
|
||||
@Override
|
||||
protected void generateLeaves(World world, Random rand, TreeBlockTypeLeaf leaf, List<BlockPos> branchEnds, BlockPos startPos) {
|
||||
int leafSpawn = height + 1;
|
||||
int leafSpawn = height + 2;
|
||||
WorldGenHelper.generateCylinderFromTreeStartPos(world, leaf, startPos.add(0, leafSpawn--, 0), girth, girth, 1, WorldGenHelper.EnumReplaceMode.SOFT);
|
||||
WorldGenHelper.generateCylinderFromTreeStartPos(world, leaf, startPos.add(0, leafSpawn, 0), girth, (float) 1 + girth, 1, WorldGenHelper.EnumReplaceMode.SOFT);
|
||||
WorldGenHelper.generateCylinderFromTreeStartPos(world, leaf, startPos.add(0, leafSpawn, 0), girth, 1 + girth, 1, WorldGenHelper.EnumReplaceMode.SOFT);
|
||||
|
||||
for (BlockPos branchEnd : branchEnds) {
|
||||
WorldGenHelper.generateCircle(world, rand, branchEnd, 4, 3, 2, leaf, 1.0f, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
WorldGenHelper.generateCircle(world, rand, branchEnd.up(), 3, 3, 1, leaf, 1.0f, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
WorldGenHelper.generateCircle(world, rand, branchEnd, 4, 3, 1, leaf, 1.0f, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,13 +28,6 @@ public class WorldGenDate extends WorldGenTree {
|
||||
super(tree, 6, 2);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Set<BlockPos> generateTrunk(World world, Random rand, TreeBlockTypeLog wood, BlockPos startPos) {
|
||||
WorldGenHelper.generateTreeTrunk(world, rand, wood, startPos, height, girth, 0, 0, null, 0);
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void generateLeaves(World world, Random rand, TreeBlockTypeLeaf leaf, List<BlockPos> branchEnds, BlockPos startPos) {
|
||||
int leafSpawn = height + 1;
|
||||
|
||||
@@ -31,11 +31,10 @@ public class WorldGenEbony extends WorldGenTree {
|
||||
@Nonnull
|
||||
@Override
|
||||
public Set<BlockPos> generateTrunk(World world, Random rand, TreeBlockTypeLog wood, BlockPos startPos) {
|
||||
int offset = (girth - 1) / 2;
|
||||
int trunksGenerated = 0;
|
||||
|
||||
for (int x = -offset; x < -offset + girth; x++) {
|
||||
for (int z = -offset; z < -offset + girth; z++) {
|
||||
for (int x = 0; x < girth; x++) {
|
||||
for (int z = 0; z < girth; z++) {
|
||||
if (rand.nextFloat() < 0.6f) {
|
||||
for (int y = 0; y < height; y++) {
|
||||
WorldGenHelper.addBlock(world, startPos.add(x, y, z), wood, WorldGenHelper.EnumReplaceMode.ALL);
|
||||
@@ -68,8 +67,8 @@ public class WorldGenEbony extends WorldGenTree {
|
||||
h = height / 2 + rand.nextInt(height / 2);
|
||||
}
|
||||
|
||||
int x_off = -girth + rand.nextInt(2 * girth);
|
||||
int y_off = -girth + rand.nextInt(2 * girth);
|
||||
int x_off = rand.nextInt(girth);
|
||||
int y_off = rand.nextInt(girth);
|
||||
|
||||
BlockPos center = startPos.add(x_off, h, y_off);
|
||||
int radius = 1 + rand.nextInt(girth);
|
||||
|
||||
@@ -28,13 +28,6 @@ public class WorldGenLarch extends WorldGenTree {
|
||||
super(tree, 6, 5);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Set<BlockPos> generateTrunk(World world, Random rand, TreeBlockTypeLog wood, BlockPos startPos) {
|
||||
WorldGenHelper.generateTreeTrunk(world, rand, wood, startPos, height, girth, 0, 0, null, 0);
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void generateLeaves(World world, Random rand, TreeBlockTypeLeaf leaf, List<BlockPos> branchEnds, BlockPos startPos) {
|
||||
int leafSpawn = height + 1;
|
||||
|
||||
@@ -28,13 +28,6 @@ public class WorldGenLemon extends WorldGenTree {
|
||||
super(tree, 6, 3);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Set<BlockPos> generateTrunk(World world, Random rand, TreeBlockTypeLog wood, BlockPos startPos) {
|
||||
WorldGenHelper.generateTreeTrunk(world, rand, wood, startPos, height, girth, 0, 0, null, 0);
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void generateLeaves(World world, Random rand, TreeBlockTypeLeaf leaf, List<BlockPos> branchEnds, BlockPos startPos) {
|
||||
int yCenter = height - girth;
|
||||
|
||||
@@ -28,13 +28,6 @@ public class WorldGenPlum extends WorldGenTree {
|
||||
super(tree, 6, 3);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Set<BlockPos> generateTrunk(World world, Random rand, TreeBlockTypeLog wood, BlockPos startPos) {
|
||||
WorldGenHelper.generateTreeTrunk(world, rand, wood, startPos, height, girth, 0, 0, null, 0);
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void generateLeaves(World world, Random rand, TreeBlockTypeLeaf leaf, List<BlockPos> branchEnds, BlockPos startPos) {
|
||||
int yCenter = height - girth;
|
||||
|
||||
@@ -28,13 +28,6 @@ public class WorldGenPoplar extends WorldGenTree {
|
||||
super(tree, 8, 3);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Set<BlockPos> generateTrunk(World world, Random rand, TreeBlockTypeLog wood, BlockPos startPos) {
|
||||
WorldGenHelper.generateTreeTrunk(world, rand, wood, startPos, height, girth, 0, 0, null, 0);
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void generateLeaves(World world, Random rand, TreeBlockTypeLeaf leaf, List<BlockPos> branchEnds, BlockPos startPos) {
|
||||
int leafSpawn = height + 1;
|
||||
|
||||
Loaded 100 of 310 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user