mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-20 03:59:45 +00:00
First steps porting to 1.9
This commit is contained in:
1 parent
c47acd803c
commit
73c2608848
635 files changed
+2309
-10906
No files matched your search
@@ -7,7 +7,7 @@ package forestry.api.apiculture;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.apiculture;
|
||||
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
|
||||
@@ -54,5 +54,5 @@ public interface IBeeHousing extends IHousing, IErrorLogicSource {
|
||||
* @since Forestry 4.2
|
||||
* @return exact coordinates where bee FX should spawn from
|
||||
*/
|
||||
Vec3 getBeeFXCoordinates();
|
||||
Vec3d getBeeFXCoordinates();
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.apiculture;
|
||||
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
@@ -7,7 +7,7 @@ package forestry.api.apiculture;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IBeekeepingMode {
|
||||
|
||||
@@ -8,7 +8,7 @@ package forestry.api.apiculture;
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package forestry.api.apiculture;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IHiveTile {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
package forestry.api.apiculture.hives;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.apiculture.hives;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IHiveGen {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IFruitFamily;
|
||||
@@ -37,12 +37,12 @@ public enum EnumFruitFamily implements IFruitFamily {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return StatCollector.translateToLocal("for.family." + uid);
|
||||
return I18n.translateToLocal("for.family." + uid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return StatCollector.translateToLocal("for.family." + uid + ".description");
|
||||
return I18n.translateToLocal("for.family." + uid + ".description");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.genetics.IAlleleEffect;
|
||||
|
||||
@@ -8,7 +8,7 @@ package forestry.api.arboriculture;
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import net.minecraftforge.common.EnumPlantType;
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ package forestry.api.arboriculture;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import forestry.api.core.IModelManager;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IGrowthProvider {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface ILeafTickHandler {
|
||||
|
||||
@@ -7,7 +7,7 @@ package forestry.api.arboriculture;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IToolGrafter {
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.genetics.IMutation;
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.util.Collection;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
package forestry.api.core;
|
||||
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.core;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface ICamouflageHandler{
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.core;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface ICamouflagedBlock {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.core;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IClimateManager {
|
||||
|
||||
@@ -9,9 +9,10 @@ import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.resources.model.IBakedModel;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -33,17 +34,7 @@ public interface IModelBaker {
|
||||
|
||||
void addBakedModel(@Nonnull IBakedModel model);
|
||||
|
||||
void addFaceXNeg(@Nonnull TextureAtlasSprite sprite);
|
||||
|
||||
void addFaceYNeg(@Nonnull TextureAtlasSprite sprite);
|
||||
|
||||
void addFaceZNeg(@Nonnull TextureAtlasSprite sprite);
|
||||
|
||||
void addFaceYPos(@Nonnull TextureAtlasSprite sprite);
|
||||
|
||||
void addFaceZPos(@Nonnull TextureAtlasSprite sprite);
|
||||
|
||||
void addFaceXPos(@Nonnull TextureAtlasSprite sprite);
|
||||
void addFace(@Nonnull EnumFacing facing, @Nonnull TextureAtlasSprite sprite);
|
||||
|
||||
void setParticleSprite(@Nullable TextureAtlasSprite particleSprite);
|
||||
|
||||
|
||||
@@ -5,14 +5,15 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.core;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraftforge.client.model.IFlexibleBakedModel;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public interface IModelBakerModel extends IFlexibleBakedModel {
|
||||
public interface IModelBakerModel extends IBakedModel {
|
||||
|
||||
void setGui3d(boolean gui3d);
|
||||
|
||||
@@ -20,7 +21,7 @@ public interface IModelBakerModel extends IFlexibleBakedModel {
|
||||
|
||||
void setParticleSprite(TextureAtlasSprite particleSprite);
|
||||
|
||||
void setFormat(VertexFormat formate);
|
||||
// void setFormat(VertexFormat formate);
|
||||
|
||||
void setRotation(float[] rotation);
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
package forestry.api.core;
|
||||
|
||||
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ package forestry.api.farming;
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
/**
|
||||
* Easily extendable default farmListener.
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.farming;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
@@ -8,7 +8,7 @@ package forestry.api.farming;
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
public interface IFarmListener {
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ package forestry.api.farming;
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
@@ -7,7 +7,7 @@ package forestry.api.farming;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.genetics;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IFlowerAcceptableRule {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.genetics;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IFlowerGrowthHelper {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.genetics;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
package forestry.api.genetics;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IFlowerProvider {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
package forestry.api.genetics;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.apiculture.IBee;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.genetics;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
/**
|
||||
* Any housing, hatchery or nest with a location in the world.
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.genetics;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IMutationCondition {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.greenhouse;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IGreenhouseHelper {
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.util.Collection;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IInternalBlock {
|
||||
|
||||
@@ -7,7 +7,7 @@ package forestry.api.greenhouse;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
public interface IInternalBlockFace {
|
||||
|
||||
@@ -13,7 +13,7 @@ package forestry.api.lepidopterology;
|
||||
import java.util.Map;
|
||||
|
||||
import forestry.api.genetics.IAlleleProperty;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IAlleleButterflyCocoon extends IAlleleProperty<IAlleleButterflyCocoon> {
|
||||
|
||||
@@ -7,7 +7,7 @@ package forestry.api.mail;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
|
||||
public enum EnumTradeStationState implements IPostalState {
|
||||
OK("for.chat.mail.ok"),
|
||||
@@ -30,6 +30,6 @@ public enum EnumTradeStationState implements IPostalState {
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return StatCollector.translateToLocal(unlocalizedDescription);
|
||||
return I18n.translateToLocal(unlocalizedDescription);
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.multiblock;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@ package forestry.api.multiblock;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
/**
|
||||
* Base logic class for Multiblock-connected tile entities.
|
||||
@@ -77,11 +77,11 @@ public abstract class MultiblockTileEntityBase<T extends IMultiblockLogic> exten
|
||||
NBTTagCompound packetData = new NBTTagCompound();
|
||||
multiblockLogic.encodeDescriptionPacket(packetData);
|
||||
this.encodeDescriptionPacket(packetData);
|
||||
return new S35PacketUpdateTileEntity(getPos(), 0, packetData);
|
||||
return new SPacketUpdateTileEntity(getPos(), 0, packetData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void onDataPacket(NetworkManager network, S35PacketUpdateTileEntity packet) {
|
||||
public final void onDataPacket(NetworkManager network, SPacketUpdateTileEntity packet) {
|
||||
NBTTagCompound nbtData = packet.getNbtCompound();
|
||||
multiblockLogic.decodeDescriptionPacket(nbtData);
|
||||
this.decodeDescriptionPacket(nbtData);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.world;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ package forestry.apiculture;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
|
||||
@@ -26,17 +26,15 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.WeightedRandomChestContent;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.chunk.IChunkGenerator;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
import net.minecraftforge.common.ChestGenHooks;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
@@ -51,7 +49,6 @@ import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import forestry.Forestry;
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
import forestry.api.apiculture.EnumBeeType;
|
||||
import forestry.api.apiculture.FlowerManager;
|
||||
import forestry.api.apiculture.IBeekeepingMode;
|
||||
import forestry.api.apiculture.hives.HiveManager;
|
||||
@@ -245,7 +242,7 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
defaultAccepted = Constants.EMPTY_STRINGS;
|
||||
}
|
||||
Property property = config.get("beekeeping.flowers." + flowerType, "accepted", defaultAccepted);
|
||||
property.comment = acceptedFlowerMessage;
|
||||
property.setComment(acceptedFlowerMessage);
|
||||
parseAcceptedFlowers(property.getStringList(), flowerType);
|
||||
|
||||
String[] defaultPlantable = defaultPlantableFlowers.get(flowerType);
|
||||
@@ -253,7 +250,7 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
defaultPlantable = Constants.EMPTY_STRINGS;
|
||||
}
|
||||
property = config.get("beekeeping.flowers." + flowerType, "plantable", defaultPlantable);
|
||||
property.comment = plantableFlowerMessage;
|
||||
property.setComment(plantableFlowerMessage);
|
||||
parsePlantableFlowers(property, flowerType);
|
||||
|
||||
Set<Flower> acceptableFlowers = flowerRegistry.getAcceptableFlowers(flowerType);
|
||||
@@ -330,29 +327,29 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
flowerRegistry.registerAcceptableFlowerRule(new EndFlowerAcceptableRule(), FlowerManager.FlowerTypeEnd);
|
||||
|
||||
// Register acceptable plants
|
||||
flowerRegistry.registerAcceptableFlower(Blocks.dragon_egg, FlowerManager.FlowerTypeEnd);
|
||||
flowerRegistry.registerAcceptableFlower(Blocks.vine, FlowerManager.FlowerTypeJungle);
|
||||
flowerRegistry.registerAcceptableFlower(Blocks.tallgrass, FlowerManager.FlowerTypeJungle);
|
||||
flowerRegistry.registerAcceptableFlower(Blocks.wheat, FlowerManager.FlowerTypeWheat);
|
||||
flowerRegistry.registerAcceptableFlower(Blocks.pumpkin_stem, FlowerManager.FlowerTypeGourd);
|
||||
flowerRegistry.registerAcceptableFlower(Blocks.melon_stem, FlowerManager.FlowerTypeGourd);
|
||||
flowerRegistry.registerAcceptableFlower(Blocks.nether_wart, FlowerManager.FlowerTypeNether);
|
||||
flowerRegistry.registerAcceptableFlower(Blocks.cactus, FlowerManager.FlowerTypeCacti);
|
||||
flowerRegistry.registerAcceptableFlower(Blocks.DRAGON_EGG, FlowerManager.FlowerTypeEnd);
|
||||
flowerRegistry.registerAcceptableFlower(Blocks.VINE, FlowerManager.FlowerTypeJungle);
|
||||
flowerRegistry.registerAcceptableFlower(Blocks.TALLGRASS, FlowerManager.FlowerTypeJungle);
|
||||
flowerRegistry.registerAcceptableFlower(Blocks.WHEAT, FlowerManager.FlowerTypeWheat);
|
||||
flowerRegistry.registerAcceptableFlower(Blocks.PUMPKIN_STEM, FlowerManager.FlowerTypeGourd);
|
||||
flowerRegistry.registerAcceptableFlower(Blocks.MELON_STEM, FlowerManager.FlowerTypeGourd);
|
||||
flowerRegistry.registerAcceptableFlower(Blocks.NETHER_WART, FlowerManager.FlowerTypeNether);
|
||||
flowerRegistry.registerAcceptableFlower(Blocks.CACTUS, FlowerManager.FlowerTypeCacti);
|
||||
|
||||
flowerRegistry.registerAcceptableFlower(Blocks.double_plant, 0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow);
|
||||
flowerRegistry.registerAcceptableFlower(Blocks.double_plant, 1, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow);
|
||||
flowerRegistry.registerAcceptableFlower(Blocks.double_plant, 4, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow);
|
||||
flowerRegistry.registerAcceptableFlower(Blocks.double_plant, 5, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow);
|
||||
flowerRegistry.registerAcceptableFlower(Blocks.DOUBLE_PLANT, 0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow);
|
||||
flowerRegistry.registerAcceptableFlower(Blocks.DOUBLE_PLANT, 1, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow);
|
||||
flowerRegistry.registerAcceptableFlower(Blocks.DOUBLE_PLANT, 4, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow);
|
||||
flowerRegistry.registerAcceptableFlower(Blocks.DOUBLE_PLANT, 5, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow);
|
||||
|
||||
// Register plantable plants
|
||||
for (int meta = 0; meta <= 8; meta++) {
|
||||
flowerRegistry.registerPlantableFlower(Blocks.red_flower, meta, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow);
|
||||
flowerRegistry.registerPlantableFlower(Blocks.RED_FLOWER, meta, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow);
|
||||
}
|
||||
|
||||
flowerRegistry.registerPlantableFlower(Blocks.yellow_flower, 0, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow);
|
||||
flowerRegistry.registerPlantableFlower(Blocks.brown_mushroom, 0, 1.0, FlowerManager.FlowerTypeMushrooms);
|
||||
flowerRegistry.registerPlantableFlower(Blocks.red_mushroom, 0, 1.0, FlowerManager.FlowerTypeMushrooms);
|
||||
flowerRegistry.registerPlantableFlower(Blocks.cactus, 0, 1.0, FlowerManager.FlowerTypeCacti);
|
||||
flowerRegistry.registerPlantableFlower(Blocks.YELLOW_FLOWER, 0, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow);
|
||||
flowerRegistry.registerPlantableFlower(Blocks.BROWN_MUSHROOM, 0, 1.0, FlowerManager.FlowerTypeMushrooms);
|
||||
flowerRegistry.registerPlantableFlower(Blocks.RED_MUSHROOM, 0, 1.0, FlowerManager.FlowerTypeMushrooms);
|
||||
flowerRegistry.registerPlantableFlower(Blocks.CACTUS, 0, 1.0, FlowerManager.FlowerTypeCacti);
|
||||
|
||||
for (String flowerType : flowerRegistry.getFlowerTypes()) {
|
||||
Set<Flower> flowers = flowerRegistry.getAcceptableFlowers(flowerType);
|
||||
@@ -448,39 +445,39 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
RecipeUtil.addRecipe(items.scoop,
|
||||
"#X#", "###", " # ",
|
||||
'#', "stickWood",
|
||||
'X', Blocks.wool);
|
||||
'X', Blocks.WOOL);
|
||||
RecipeUtil.addRecipe(items.smoker,
|
||||
"LS#",
|
||||
"LF#",
|
||||
"###",
|
||||
'#', "ingotTin", 'S', "stickWood", 'F', Items.flint_and_steel, 'L', "leather");
|
||||
RecipeUtil.addRecipe(new ItemStack(Items.slime_ball),
|
||||
'#', "ingotTin", 'S', "stickWood", 'F', Items.FLINT_AND_STEEL, 'L', "leather");
|
||||
RecipeUtil.addRecipe(new ItemStack(Items.SLIME_BALL),
|
||||
"#X#", "#X#", "#X#",
|
||||
'#', items.propolis,
|
||||
'X', items.pollenCluster.get(EnumPollenCluster.NORMAL, 1));
|
||||
RecipeUtil.addRecipe(new ItemStack(Items.speckled_melon),
|
||||
RecipeUtil.addRecipe(new ItemStack(Items.SPECKLED_MELON),
|
||||
"#X#", "#Y#", "#X#",
|
||||
'#', items.honeyDrop,
|
||||
'X', items.honeydew,
|
||||
'Y', Items.melon);
|
||||
'Y', Items.MELON);
|
||||
RecipeUtil.addRecipe(items.frameUntreated,
|
||||
"###", "#S#", "###",
|
||||
'#', "stickWood",
|
||||
'S', Items.string);
|
||||
'S', Items.STRING);
|
||||
RecipeUtil.addRecipe(items.frameImpregnated,
|
||||
"###", "#S#", "###",
|
||||
'#', PluginCore.items.stickImpregnated,
|
||||
'S', Items.string);
|
||||
'S', Items.STRING);
|
||||
RecipeUtil.addRecipe(items.minecartBeehouse.getBeeHouseMinecart(),
|
||||
"B",
|
||||
"C",
|
||||
'B', blocks.apiculture.get(BlockTypeApiculture.BEE_HOUSE),
|
||||
'C', Items.minecart);
|
||||
'C', Items.MINECART);
|
||||
RecipeUtil.addRecipe(items.minecartBeehouse.getApiaryMinecart(),
|
||||
"B",
|
||||
"C",
|
||||
'B', blocks.apiculture.get(BlockTypeApiculture.APIARY),
|
||||
'C', Items.minecart);
|
||||
'C', Items.MINECART);
|
||||
|
||||
// FOOD STUFF
|
||||
ItemRegistryFood foodItems = PluginFood.items;
|
||||
@@ -488,7 +485,7 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
RecipeUtil.addRecipe(new ItemStack(foodItems.honeyedSlice, 4),
|
||||
"###", "#X#", "###",
|
||||
'#', items.honeyDrop,
|
||||
'X', Items.bread);
|
||||
'X', Items.BREAD);
|
||||
|
||||
RecipeUtil.addRecipe(foodItems.honeyPot,
|
||||
"# #", " X ", "# #",
|
||||
@@ -523,7 +520,7 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
'Y', items.propolis);
|
||||
|
||||
// / TORCHES
|
||||
RecipeUtil.addRecipe(new ItemStack(Blocks.torch, 3),
|
||||
RecipeUtil.addRecipe(new ItemStack(Blocks.TORCH, 3),
|
||||
" # ", " # ", " Y ",
|
||||
'#', PluginCore.items.beeswax,
|
||||
'Y', "stickWood");
|
||||
@@ -601,9 +598,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)}, 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));
|
||||
|
||||
// / CARPENTER
|
||||
RecipeManagers.carpenterManager.addRecipe(100, Fluids.WATER.getFluid(2000), null, items.beealyzer.getItemStack(),
|
||||
@@ -624,7 +621,7 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
"###",
|
||||
"###",
|
||||
'#', PluginCore.items.beeswax,
|
||||
'X', Items.string);
|
||||
'X', Items.STRING);
|
||||
RecipeManagers.carpenterManager.addRecipe(10, Fluids.WATER.getFluid(200), null, blocks.candle.getUnlitCandle(6),
|
||||
"#X#",
|
||||
'#', PluginCore.items.beeswax,
|
||||
@@ -642,7 +639,7 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
// Cocoa combs
|
||||
RecipeManagers.centrifugeManager.addRecipe(20, items.beeComb.get(EnumHoneyComb.COCOA, 1), ImmutableMap.of(
|
||||
PluginCore.items.beeswax.getItemStack(), 1.0f,
|
||||
new ItemStack(Items.dye, 1, 3), 0.5f
|
||||
new ItemStack(Items.DYE, 1, 3), 0.5f
|
||||
));
|
||||
|
||||
// Simmering combs
|
||||
@@ -667,7 +664,7 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
RecipeManagers.centrifugeManager.addRecipe(20, items.beeComb.get(EnumHoneyComb.FROZEN, 1), ImmutableMap.of(
|
||||
PluginCore.items.beeswax.getItemStack(), 0.8f,
|
||||
items.honeyDrop.getItemStack(), 0.7f,
|
||||
new ItemStack(Items.snowball), 0.4f,
|
||||
new ItemStack(Items.SNOWBALL), 0.4f,
|
||||
items.pollenCluster.get(EnumPollenCluster.CRYSTALLINE, 1), 0.2f
|
||||
));
|
||||
|
||||
@@ -697,14 +694,14 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
RecipeManagers.centrifugeManager.addRecipe(20, items.beeComb.get(EnumHoneyComb.POWDERY, 1), ImmutableMap.of(
|
||||
items.honeyDrop.getItemStack(), 0.2f,
|
||||
PluginCore.items.beeswax.getItemStack(), 0.2f,
|
||||
new ItemStack(Items.gunpowder), 0.9f
|
||||
new ItemStack(Items.GUNPOWDER), 0.9f
|
||||
));
|
||||
|
||||
// Wheaten Combs
|
||||
RecipeManagers.centrifugeManager.addRecipe(20, items.beeComb.get(EnumHoneyComb.WHEATEN, 1), ImmutableMap.of(
|
||||
items.honeyDrop.getItemStack(), 0.2f,
|
||||
PluginCore.items.beeswax.getItemStack(), 0.2f,
|
||||
new ItemStack(Items.wheat), 0.8f
|
||||
new ItemStack(Items.WHEAT), 0.8f
|
||||
));
|
||||
|
||||
// Mossy Combs
|
||||
@@ -717,7 +714,7 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
RecipeManagers.centrifugeManager.addRecipe(20, items.beeComb.get(EnumHoneyComb.MELLOW, 1), ImmutableMap.of(
|
||||
items.honeydew.getItemStack(), 0.6f,
|
||||
PluginCore.items.beeswax.getItemStack(), 0.2f,
|
||||
new ItemStack(Items.quartz), 0.3f
|
||||
new ItemStack(Items.QUARTZ), 0.3f
|
||||
));
|
||||
|
||||
// Silky Propolis
|
||||
@@ -815,6 +812,8 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
rarity = 10;
|
||||
}
|
||||
|
||||
//TODO: Chest Loot
|
||||
/*
|
||||
ChestGenHooks.addItem(ChestGenHooks.DUNGEON_CHEST, new WeightedRandomChestContent(BeeDefinition.STEADFAST.getMemberStack(EnumBeeType.DRONE), 1, 1, rarity));
|
||||
|
||||
ItemStack stack = blocks.candle.getUnlitCandle(1);
|
||||
@@ -833,6 +832,7 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
ChestGenHooks.addItem(Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(BeeDefinition.FOREST.getRainResist().getMemberStack(EnumBeeType.PRINCESS), 1, 1, 5));
|
||||
ChestGenHooks.addItem(Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(BeeDefinition.COMMON.getMemberStack(EnumBeeType.DRONE), 1, 2, 8));
|
||||
ChestGenHooks.addItem(Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(BeeDefinition.MEADOWS.getMemberStack(EnumBeeType.PRINCESS), 1, 1, 5));
|
||||
*/
|
||||
}
|
||||
|
||||
private static void createHives() {
|
||||
@@ -911,7 +911,7 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void populateChunk(IChunkProvider chunkProvider, World world, Random rand, int chunkX, int chunkZ, boolean hasVillageGenerated) {
|
||||
public void populateChunk(IChunkGenerator chunkProvider, World world, Random rand, int chunkX, int chunkZ, boolean hasVillageGenerated) {
|
||||
if (Config.getBeehivesAmount() > 0.0) {
|
||||
HiveDecorator.decorateHives(chunkProvider, world, rand, chunkX, chunkZ, hasVillageGenerated);
|
||||
}
|
||||
@@ -948,9 +948,9 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
public void textureHook(TextureStitchEvent.Pre event) {
|
||||
EntityFXSnow.sprites = new TextureAtlasSprite[3];
|
||||
for (int i = 0; i < EntityFXSnow.sprites.length; i++) {
|
||||
EntityFXSnow.sprites[i] = event.map.registerSprite(new ResourceLocation("forestry:entity/particles/snow." + (i + 1)));
|
||||
EntityFXSnow.sprites[i] = event.getMap().registerSprite(new ResourceLocation("forestry:entity/particles/snow." + (i + 1)));
|
||||
}
|
||||
EntityFXBee.beeSprite = event.map.registerSprite(new ResourceLocation("forestry:entity/particles/swarm_bee"));
|
||||
EntityFXBee.beeSprite = event.getMap().registerSprite(new ResourceLocation("forestry:entity/particles/swarm_bee"));
|
||||
}
|
||||
|
||||
private static class EndFlowerAcceptableRule implements IFlowerAcceptableRule {
|
||||
|
||||
@@ -17,16 +17,17 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.statemap.StateMapperBase;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -105,19 +106,14 @@ public abstract class BlockAlveary extends BlockStructure implements IStateMappe
|
||||
setHardness(1.0f);
|
||||
setCreativeTab(Tabs.tabApiculture);
|
||||
setHarvestLevel("axe", 0);
|
||||
setStepSound(soundTypeWood);
|
||||
setSoundType(SoundType.WOOD);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public abstract BlockAlvearyType getAlvearyType();
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isNormalCube() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube() {
|
||||
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -156,15 +152,15 @@ public abstract class BlockAlveary extends BlockStructure implements IStateMappe
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState() {
|
||||
protected BlockStateContainer createBlockState() {
|
||||
BlockAlvearyType alvearyType = getAlvearyType();
|
||||
|
||||
if (alvearyType == BlockAlvearyType.PLAIN) {
|
||||
return new BlockState(this, PLAIN_TYPE);
|
||||
return new BlockStateContainer(this, PLAIN_TYPE);
|
||||
} else if (alvearyType.activatable) {
|
||||
return new BlockState(this, STATE);
|
||||
return new BlockStateContainer(this, STATE);
|
||||
} else {
|
||||
return new BlockState(this);
|
||||
return new BlockStateContainer(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,9 +181,9 @@ public abstract class BlockAlveary extends BlockStructure implements IStateMappe
|
||||
if (!tile.getMultiblockLogic().getController().isAssembled()) {
|
||||
state = state.withProperty(PLAIN_TYPE, AlvearyPlainType.NORMAL);
|
||||
} else {
|
||||
IBlockState blockStateAbove = world.getBlockState(pos.add(0, 1, 0));
|
||||
IBlockState blockStateAbove = world.getBlockState(pos.up());
|
||||
Block blockAbove = blockStateAbove.getBlock();
|
||||
if (BlockUtil.isWoodSlabBlock(blockAbove, world, pos)) {
|
||||
if (BlockUtil.isWoodSlabBlock(blockStateAbove, blockAbove, world, pos)) {
|
||||
List<EnumFacing> blocksTouching = getBlocksTouching(world, pos);
|
||||
switch (blocksTouching.size()) {
|
||||
case 3:
|
||||
@@ -243,7 +239,7 @@ public abstract class BlockAlveary extends BlockStructure implements IStateMappe
|
||||
|
||||
@Override
|
||||
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
|
||||
String resourceDomain = Block.blockRegistry.getNameForObject(state.getBlock()).getResourceDomain();
|
||||
String resourceDomain = Block.REGISTRY.getNameForObject(state.getBlock()).getResourceDomain();
|
||||
String resourceLocation = "apiculture/alveary_" + type;
|
||||
String propertyString = getPropertyString(state.getProperties());
|
||||
return new ModelResourceLocation(resourceDomain + ':' + resourceLocation, propertyString);
|
||||
|
||||
@@ -17,15 +17,15 @@ import java.util.Random;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumBlockRenderType;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -56,8 +56,8 @@ public class BlockBeeHives extends BlockContainer implements IItemModelRegister,
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState() {
|
||||
return new BlockState(this, HIVE_TYPES);
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, HIVE_TYPES);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -75,11 +75,6 @@ public class BlockBeeHives extends BlockContainer implements IItemModelRegister,
|
||||
return new TileHive();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canEntityDestroy(IBlockAccess world, BlockPos pos, Entity entity) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockClicked(World world, BlockPos pos, EntityPlayer player) {
|
||||
super.onBlockClicked(world, pos, player);
|
||||
@@ -190,12 +185,12 @@ public class BlockBeeHives extends BlockContainer implements IItemModelRegister,
|
||||
manager.registerItemModel(item, hiveType.getMeta(), "beehives/" + hiveType.getName());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 3;
|
||||
public EnumBlockRenderType getRenderType(IBlockState state) {
|
||||
return EnumBlockRenderType.MODEL;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getNameFromMeta(int meta) {
|
||||
return HiveType.VALUES[meta].getName();
|
||||
|
||||
@@ -23,8 +23,9 @@ import java.util.Set;
|
||||
|
||||
import net.minecraft.block.BlockTorch;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -35,10 +36,11 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -50,6 +52,7 @@ import forestry.api.core.IItemModelRegister;
|
||||
import forestry.api.core.IModelManager;
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.apiculture.tiles.TileCandle;
|
||||
import forestry.core.tiles.TileUtil;
|
||||
import forestry.core.utils.ItemStackUtil;
|
||||
|
||||
public class BlockCandle extends BlockTorch implements IItemModelRegister, ITileEntityProvider {
|
||||
@@ -90,22 +93,22 @@ public class BlockCandle extends BlockTorch implements IItemModelRegister, ITile
|
||||
.build();
|
||||
|
||||
lightingItems = new HashSet<>(Arrays.asList(
|
||||
Items.flint_and_steel,
|
||||
Items.flint,
|
||||
Item.getItemFromBlock(Blocks.torch)
|
||||
Items.FLINT_AND_STEEL,
|
||||
Items.FLINT,
|
||||
Item.getItemFromBlock(Blocks.TORCH)
|
||||
));
|
||||
}
|
||||
|
||||
public BlockCandle() {
|
||||
this.setHardness(0.0F);
|
||||
this.setStepSound(soundTypeWood);
|
||||
this.setSoundType(SoundType.WOOD);
|
||||
setCreativeTab(Tabs.tabApiculture);
|
||||
setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.UP).withProperty(STATE, State.OFF));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState() {
|
||||
return new BlockState(this, FACING, STATE);
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, FACING, STATE);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -129,18 +132,13 @@ public class BlockCandle extends BlockTorch implements IItemModelRegister, ITile
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLightValue(IBlockAccess world, BlockPos pos) {
|
||||
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
TileEntity tileEntity = world.getTileEntity(pos);
|
||||
if (tileEntity instanceof TileCandle && ((TileCandle) tileEntity).isLit()) {
|
||||
return 14;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int colorMultiplier(IBlockAccess worldIn, BlockPos pos, int renderPass) {
|
||||
return ((TileCandle) worldIn.getTileEntity(pos)).getColour();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> itemList) {
|
||||
@@ -148,8 +146,8 @@ public class BlockCandle extends BlockTorch implements IItemModelRegister, ITile
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
TileEntity tileEntity = world.getTileEntity(pos);
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
TileEntity tileEntity = worldIn.getTileEntity(pos);
|
||||
if (!(tileEntity instanceof TileCandle)) {
|
||||
return false;
|
||||
}
|
||||
@@ -159,7 +157,6 @@ public class BlockCandle extends BlockTorch implements IItemModelRegister, ITile
|
||||
|
||||
boolean flag = false;
|
||||
boolean toggleLitState = true;
|
||||
ItemStack heldItem = player.getCurrentEquippedItem();
|
||||
|
||||
if (!isLit) {
|
||||
if (heldItem == null || !lightingItems.contains(heldItem.getItem())) {
|
||||
@@ -186,7 +183,7 @@ public class BlockCandle extends BlockTorch implements IItemModelRegister, ITile
|
||||
} else {
|
||||
boolean dyed = tryDye(heldItem, isLit, tileCandle);
|
||||
if (dyed) {
|
||||
world.markBlockForUpdate(pos);
|
||||
worldIn.markBlockRangeForRenderUpdate(pos, pos);
|
||||
toggleLitState = false;
|
||||
flag = true;
|
||||
}
|
||||
@@ -195,10 +192,10 @@ public class BlockCandle extends BlockTorch implements IItemModelRegister, ITile
|
||||
|
||||
if (toggleLitState) {
|
||||
tileCandle.setLit(!isLit);
|
||||
world.markBlockForUpdate(pos);
|
||||
world.theProfiler.startSection("checkLight");
|
||||
world.checkLight(pos);
|
||||
world.theProfiler.endSection();
|
||||
worldIn.markBlockRangeForRenderUpdate(pos, pos);
|
||||
worldIn.theProfiler.startSection("checkLight");
|
||||
worldIn.checkLight(pos);
|
||||
worldIn.theProfiler.endSection();
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
@@ -252,7 +249,7 @@ public class BlockCandle extends BlockTorch implements IItemModelRegister, ITile
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, BlockPos pos, EntityPlayer player) {
|
||||
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
|
||||
return getCandleDrop(world, pos);
|
||||
}
|
||||
|
||||
@@ -285,11 +282,10 @@ public class BlockCandle extends BlockTorch implements IItemModelRegister, ITile
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World world, BlockPos pos, IBlockState state, Random rand) {
|
||||
TileEntity tileEntity = world.getTileEntity(pos);
|
||||
if (tileEntity instanceof TileCandle && ((TileCandle) tileEntity).isLit()) {
|
||||
super.randomDisplayTick(world, pos, state, rand);
|
||||
public void randomDisplayTick(IBlockState stateIn, World worldIn, BlockPos pos, Random rand) {
|
||||
TileCandle tileCandle = TileUtil.getTile(worldIn, pos, TileCandle.class);
|
||||
if (tileCandle != null && tileCandle.isLit()) {
|
||||
super.randomDisplayTick(stateIn, worldIn, pos, rand);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,13 +14,15 @@ import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.BlockTorch;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
@@ -38,7 +40,7 @@ public class BlockStump extends BlockTorch implements IItemModelRegister {
|
||||
|
||||
public BlockStump() {
|
||||
this.setHardness(0.0F);
|
||||
this.setStepSound(soundTypeWood);
|
||||
this.setSoundType(SoundType.WOOD);
|
||||
setCreativeTab(Tabs.tabApiculture);
|
||||
}
|
||||
|
||||
@@ -54,14 +56,12 @@ public class BlockStump extends BlockTorch implements IItemModelRegister {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
|
||||
ItemStack held = player.getCurrentEquippedItem();
|
||||
if (held != null && BlockCandle.lightingItems.contains(held.getItem())) {
|
||||
world.setBlockState(pos, PluginApiculture.blocks.candle.getStateFromMeta(BlockUtil.getBlockMetadata(world, pos) | 0x08), Constants.FLAG_BLOCK_SYNCH);
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
if (heldItem != null && BlockCandle.lightingItems.contains(heldItem.getItem())) {
|
||||
worldIn.setBlockState(pos, PluginApiculture.blocks.candle.getStateFromMeta(BlockUtil.getBlockMetadata(worldIn, pos) | 0x08), Constants.FLAG_BLOCK_SYNCH);
|
||||
TileCandle tc = new TileCandle();
|
||||
tc.setColour(0); // default to white
|
||||
world.setTileEntity(pos, tc);
|
||||
worldIn.setTileEntity(pos, tc);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -69,12 +69,6 @@ public class BlockStump extends BlockTorch implements IItemModelRegister {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderColor(IBlockState state) {
|
||||
return 0xee0000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(World world, BlockPos pos, IBlockState state, Random rand) {
|
||||
public void randomDisplayTick(IBlockState stateIn, World worldIn, BlockPos pos, Random rand) {
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
|
||||
import forestry.apiculture.tiles.TileApiaristChest;
|
||||
import forestry.core.blocks.IBlockTypeTesr;
|
||||
|
||||
@@ -15,11 +15,13 @@ import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.command.PlayerNotFoundException;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
import forestry.api.apiculture.EnumBeeType;
|
||||
@@ -63,27 +65,27 @@ public class CommandBeeGive extends SubCommand {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processSubCommand(ICommandSender sender, String[] arguments) throws SpeciesNotFoundException, TemplateNotFoundException, PlayerNotFoundException {
|
||||
if (arguments.length < 2) {
|
||||
printHelp(sender);
|
||||
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws SpeciesNotFoundException, TemplateNotFoundException, PlayerNotFoundException {
|
||||
if (args.length < 2) {
|
||||
printHelp(, sender);
|
||||
return;
|
||||
}
|
||||
|
||||
IBeeGenome beeGenome = getBeeGenome(arguments[0]);
|
||||
EnumBeeType beeType = getBeeType(arguments[1]);
|
||||
IBeeGenome beeGenome = getBeeGenome(args[0]);
|
||||
EnumBeeType beeType = getBeeType(args[1]);
|
||||
if (beeType == null) {
|
||||
printHelp(sender);
|
||||
printHelp(, sender);
|
||||
return;
|
||||
}
|
||||
|
||||
EntityPlayer player;
|
||||
if (arguments.length == 3) {
|
||||
player = CommandHelpers.getPlayer(sender, arguments[2]);
|
||||
if (args.length == 3) {
|
||||
player = CommandBase.getPlayer(server, sender, args[2]);
|
||||
} else {
|
||||
player = CommandHelpers.getPlayer(sender, sender.getName());
|
||||
player = CommandBase.getPlayer(server, sender, sender.getName());
|
||||
}
|
||||
if (player == null) {
|
||||
printHelp(sender);
|
||||
printHelp(, sender);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -94,7 +96,7 @@ public class CommandBeeGive extends SubCommand {
|
||||
}
|
||||
|
||||
ItemStack beeStack = BeeManager.beeRoot.getMemberStack(bee, beeType);
|
||||
player.dropPlayerItemWithRandomChoice(beeStack, true);
|
||||
player.dropItem(beeStack, false, true);
|
||||
|
||||
CommandHelpers.sendLocalizedChatMessage(sender, "for.chat.command.forestry.bee.give.given", player.getName(), bee.getGenome().getPrimary().getName(), beeType.getName());
|
||||
}
|
||||
@@ -137,15 +139,15 @@ public class CommandBeeGive extends SubCommand {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> addTabCompletionOptions(ICommandSender sender, String[] parameters, BlockPos pos) {
|
||||
if (parameters.length == 1) {
|
||||
List<String> tabCompletion = CommandHelpers.getListOfStringsMatchingLastWord(parameters, getSpecies());
|
||||
public List<String> getTabCompletionOptions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos) {
|
||||
if (args.length == 1) {
|
||||
List<String> tabCompletion = CommandHelpers.getListOfStringsMatchingLastWord(args, getSpecies());
|
||||
tabCompletion.add("help");
|
||||
return tabCompletion;
|
||||
} else if (parameters.length == 2) {
|
||||
return CommandHelpers.getListOfStringsMatchingLastWord(parameters, beeTypeArr);
|
||||
} else if (parameters.length == 3) {
|
||||
return CommandHelpers.getListOfStringsMatchingLastWord(parameters, CommandHelpers.getPlayers());
|
||||
} else if (args.length == 2) {
|
||||
return CommandHelpers.getListOfStringsMatchingLastWord(args, beeTypeArr);
|
||||
} else if (args.length == 3) {
|
||||
return CommandHelpers.getListOfStringsMatchingLastWord(args, server.getPlayerList().getAllUsernames());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ import net.minecraft.entity.ai.RandomPositionGenerator;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.pathfinding.PathEntity;
|
||||
import net.minecraft.pathfinding.PathNavigate;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
public class AIAvoidPlayers extends EntityAIBase {
|
||||
|
||||
@@ -54,8 +54,8 @@ public class AIAvoidPlayers extends EntityAIBase {
|
||||
return false;
|
||||
}
|
||||
|
||||
Vec3 randomTarget = RandomPositionGenerator.findRandomTargetBlockAwayFrom(mob, 16, 7,
|
||||
new Vec3(player.posX, player.posY, player.posZ));
|
||||
Vec3d randomTarget = RandomPositionGenerator.findRandomTargetBlockAwayFrom(mob, 16, 7,
|
||||
new Vec3d(player.posX, player.posY, player.posZ));
|
||||
|
||||
if (randomTarget == null) {
|
||||
return false;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
package forestry.apiculture.entities;
|
||||
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.client.renderer.WorldRenderer;
|
||||
import net.minecraft.client.renderer.VertexBuffer;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.world.World;
|
||||
@@ -24,7 +24,7 @@ public class EntityFXBee extends EntityFX {
|
||||
|
||||
public EntityFXBee(World world, double x, double y, double z, int color) {
|
||||
super(world, x, y, z, 0.0D, 0.0D, 0.0D);
|
||||
setParticleIcon(beeSprite);
|
||||
setParticleTexture(beeSprite);
|
||||
this.originX = x;
|
||||
this.originZ = z;
|
||||
|
||||
@@ -35,11 +35,10 @@ public class EntityFXBee extends EntityFX {
|
||||
this.setSize(0.1F, 0.1F);
|
||||
this.particleScale *= 0.2F;
|
||||
this.particleMaxAge = (int) (80.0D / (Math.random() * 0.8D + 0.2D));
|
||||
this.noClip = true;
|
||||
|
||||
this.motionX *= 0.9D;
|
||||
this.motionY *= 0.015D;
|
||||
this.motionZ *= 0.9D;
|
||||
this.xSpeed *= 0.9D;
|
||||
this.ySpeed *= 0.015D;
|
||||
this.zSpeed *= 0.9D;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -50,54 +49,54 @@ public class EntityFXBee extends EntityFX {
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||
this.moveEntity(this.xSpeed, this.ySpeed, this.zSpeed);
|
||||
|
||||
if (this.particleAge == this.particleMaxAge / 2) {
|
||||
this.motionX = (this.originX - this.posX) * 0.04;
|
||||
this.motionZ = (this.originZ - this.posZ) * 0.04;
|
||||
this.xSpeed = (this.originX - this.posX) * 0.04;
|
||||
this.zSpeed = (this.originZ - this.posZ) * 0.04;
|
||||
}
|
||||
|
||||
if (this.particleAge < this.particleMaxAge / 4 || this.particleAge > this.particleMaxAge * 3 / 4) {
|
||||
this.motionX *= 0.92 + 0.2D * rand.nextFloat();
|
||||
this.motionY = (this.motionY + 0.2 * (-0.5 + rand.nextFloat())) / 2;
|
||||
this.motionZ *= 0.92 + 0.2D * rand.nextFloat();
|
||||
this.xSpeed *= 0.92 + 0.2D * rand.nextFloat();
|
||||
this.ySpeed = (this.ySpeed + 0.2 * (-0.5 + rand.nextFloat())) / 2;
|
||||
this.zSpeed *= 0.92 + 0.2D * rand.nextFloat();
|
||||
} else {
|
||||
this.motionX *= 0.95;
|
||||
this.motionY = (this.motionY + 0.2 * (-0.5 + rand.nextFloat())) / 2;
|
||||
this.motionZ *= 0.95;
|
||||
this.xSpeed *= 0.95;
|
||||
this.ySpeed = (this.ySpeed + 0.2 * (-0.5 + rand.nextFloat())) / 2;
|
||||
this.zSpeed *= 0.95;
|
||||
}
|
||||
|
||||
if (this.particleAge++ >= this.particleMaxAge) {
|
||||
this.setDead();
|
||||
this.setExpired();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle(WorldRenderer wR, Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
public void renderParticle(VertexBuffer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) {
|
||||
float minU = 0;
|
||||
float maxU = 1;
|
||||
float minV = 0;
|
||||
float maxV = 1;
|
||||
|
||||
if (this.particleIcon != null) {
|
||||
minU = particleIcon.getMinU();
|
||||
maxU = particleIcon.getMaxU();
|
||||
minV = particleIcon.getMinV();
|
||||
maxV = particleIcon.getMaxV();
|
||||
if (this.particleTexture != null) {
|
||||
minU = particleTexture.getMinU();
|
||||
maxU = particleTexture.getMaxU();
|
||||
minV = particleTexture.getMinV();
|
||||
maxV = particleTexture.getMaxV();
|
||||
}
|
||||
|
||||
float f10 = 0.1F * particleScale;
|
||||
float f11 = (float) (prevPosX + (posX - prevPosX) * f - interpPosX);
|
||||
float f12 = (float) (prevPosY + (posY - prevPosY) * f - interpPosY);
|
||||
float f13 = (float) (prevPosZ + (posZ - prevPosZ) * f - interpPosZ);
|
||||
float f11 = (float) (prevPosX + (posX - prevPosX) * partialTicks - interpPosX);
|
||||
float f12 = (float) (prevPosY + (posY - prevPosY) * partialTicks - interpPosY);
|
||||
float f13 = (float) (prevPosZ + (posZ - prevPosZ) * partialTicks - interpPosZ);
|
||||
|
||||
int i = this.getBrightnessForRender(f);
|
||||
int i = this.getBrightnessForRender(partialTicks);
|
||||
int j = i >> 16 & 65535;
|
||||
int k = i & 65535;
|
||||
wR.pos(f11 - f1 * f10 - f4 * f10, f12 - f2 * f10, f13 - f3 * f10 - f5 * f10).tex(maxU, maxV).color(particleRed, particleGreen, particleBlue, 1.0F).lightmap(j, k).endVertex();
|
||||
wR.pos(f11 - f1 * f10 + f4 * f10, f12 + f2 * f10, f13 - f3 * f10 + f5 * f10).tex(maxU, minV).color(particleRed, particleGreen, particleBlue, 1.0F).lightmap(j, k).endVertex();
|
||||
wR.pos(f11 + f1 * f10 + f4 * f10, f12 + f2 * f10, f13 + f3 * f10 + f5 * f10).tex(minU, minV).color(particleRed, particleGreen, particleBlue, 1.0F).lightmap(j, k).endVertex();
|
||||
wR.pos(f11 + f1 * f10 - f4 * f10, f12 - f2 * f10, f13 + f3 * f10 - f5 * f10).tex(minU, maxV).color(particleRed, particleGreen, particleBlue, 1.0F).lightmap(j, k).endVertex();
|
||||
worldRendererIn.pos(f11 - rotationX * f10 - rotationXY * f10, f12 - rotationZ * f10, f13 - rotationYZ * f10 - rotationXZ * f10).tex(maxU, maxV).color(particleRed, particleGreen, particleBlue, 1.0F).lightmap(j, k).endVertex();
|
||||
worldRendererIn.pos(f11 - rotationX * f10 + rotationXY * f10, f12 + rotationZ * f10, f13 - rotationYZ * f10 + rotationXZ * f10).tex(maxU, minV).color(particleRed, particleGreen, particleBlue, 1.0F).lightmap(j, k).endVertex();
|
||||
worldRendererIn.pos(f11 + rotationX * f10 + rotationXY * f10, f12 + rotationZ * f10, f13 + rotationYZ * f10 + rotationXZ * f10).tex(minU, minV).color(particleRed, particleGreen, particleBlue, 1.0F).lightmap(j, k).endVertex();
|
||||
worldRendererIn.pos(f11 + rotationX * f10 - rotationXY * f10, f12 - rotationZ * f10, f13 + rotationYZ * f10 - rotationXZ * f10).tex(minU, maxV).color(particleRed, particleGreen, particleBlue, 1.0F).lightmap(j, k).endVertex();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -14,8 +14,8 @@ import java.io.IOException;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
|
||||
@@ -125,8 +125,8 @@ public abstract class EntityMinecartBeeHousingBase extends EntityMinecartContain
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vec3 getBeeFXCoordinates() {
|
||||
return new Vec3(posX, posY + 0.25, posZ);
|
||||
public Vec3d getBeeFXCoordinates() {
|
||||
return new Vec3d(posX, posY + 0.25, posZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -13,7 +13,7 @@ package forestry.apiculture.flowers;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.common.EnumPlantType;
|
||||
|
||||
@@ -29,7 +29,7 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityFlowerPot;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
@@ -12,7 +12,7 @@ package forestry.apiculture.flowers;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.genetics.IFlowerGrowthHelper;
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.genetics.IFlowerGrowthHelper;
|
||||
|
||||
@@ -14,7 +14,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFlowerPot;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityFlowerPot;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.apiculture.FlowerManager;
|
||||
|
||||
@@ -12,7 +12,7 @@ package forestry.apiculture.flowers;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.genetics.IFlowerGrowthHelper;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.flowers;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.genetics.IFlowerGrowthHelper;
|
||||
|
||||
@@ -12,7 +12,7 @@ package forestry.apiculture.flowers;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.genetics.IFlowerGrowthHelper;
|
||||
|
||||
@@ -23,8 +23,8 @@ import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
|
||||
@@ -342,7 +342,7 @@ public class Bee extends IndividualLiving implements IBee {
|
||||
}
|
||||
|
||||
EnumTemperature temperature = EnumTemperature.getFromBiome(biome);
|
||||
EnumHumidity humidity = EnumHumidity.getFromValue(biome.rainfall);
|
||||
EnumHumidity humidity = EnumHumidity.getFromValue(biome.getRainfall());
|
||||
return isSuitableClimate(temperature, humidity);
|
||||
}
|
||||
|
||||
@@ -355,7 +355,7 @@ public class Bee extends IndividualLiving implements IBee {
|
||||
@Override
|
||||
public ArrayList<BiomeGenBase> getSuitableBiomes() {
|
||||
ArrayList<BiomeGenBase> suitableBiomes = new ArrayList<>();
|
||||
for (BiomeGenBase biome : BiomeGenBase.getBiomeGenArray()) {
|
||||
for (BiomeGenBase biome : BiomeGenBase.REGISTRY) {
|
||||
if (isSuitableBiome(biome)) {
|
||||
suitableBiomes.add(biome);
|
||||
}
|
||||
@@ -377,7 +377,7 @@ public class Bee extends IndividualLiving implements IBee {
|
||||
IAlleleBeeSpecies primary = genome.getPrimary();
|
||||
IAlleleBeeSpecies secondary = genome.getSecondary();
|
||||
if (!isPureBred(EnumBeeChromosome.SPECIES)) {
|
||||
list.add(EnumChatFormatting.BLUE + Translator.translateToLocal("for.bees.hybrid").replaceAll("%PRIMARY", primary.getName()).replaceAll("%SECONDARY", secondary.getName()));
|
||||
list.add(TextFormatting.BLUE + Translator.translateToLocal("for.bees.hybrid").replaceAll("%PRIMARY", primary.getName()).replaceAll("%SECONDARY", secondary.getName()));
|
||||
}
|
||||
|
||||
if (generation > 0) {
|
||||
@@ -409,8 +409,8 @@ public class Bee extends IndividualLiving implements IBee {
|
||||
}
|
||||
|
||||
String lifespan = genome.getActiveAllele(EnumBeeChromosome.LIFESPAN).getName() + ' ' + Translator.translateToLocal("for.gui.life");
|
||||
String tempTolerance = EnumChatFormatting.GREEN + "T: " + AlleleManager.climateHelper.toDisplay(genome.getPrimary().getTemperature()) + " / " + tempToleranceAllele.getName();
|
||||
String humidTolerance = EnumChatFormatting.GREEN + "H: " + AlleleManager.climateHelper.toDisplay(genome.getPrimary().getHumidity()) + " / " + humidToleranceAllele.getName();
|
||||
String tempTolerance = TextFormatting.GREEN + "T: " + AlleleManager.climateHelper.toDisplay(genome.getPrimary().getTemperature()) + " / " + tempToleranceAllele.getName();
|
||||
String humidTolerance = TextFormatting.GREEN + "H: " + AlleleManager.climateHelper.toDisplay(genome.getPrimary().getHumidity()) + " / " + humidToleranceAllele.getName();
|
||||
String flowers = genome.getFlowerProvider().getDescription();
|
||||
|
||||
list.add(lifespan);
|
||||
@@ -420,11 +420,11 @@ public class Bee extends IndividualLiving implements IBee {
|
||||
list.add(flowers);
|
||||
|
||||
if (genome.getNeverSleeps()) {
|
||||
list.add(EnumChatFormatting.RED + GenericRatings.rateActivityTime(genome.getNeverSleeps(), false));
|
||||
list.add(TextFormatting.RED + GenericRatings.rateActivityTime(genome.getNeverSleeps(), false));
|
||||
}
|
||||
|
||||
if (genome.getToleratesRain()) {
|
||||
list.add(EnumChatFormatting.WHITE + Translator.translateToLocal("for.gui.flyer.tooltip"));
|
||||
list.add(TextFormatting.WHITE + Translator.translateToLocal("for.gui.flyer.tooltip"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.genetics;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.util.ArrayList;
|
||||
import java.util.Locale;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
|
||||
@@ -12,7 +12,7 @@ package forestry.apiculture.genetics;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import forestry.api.apiculture.IBee;
|
||||
|
||||
@@ -13,7 +13,7 @@ package forestry.apiculture.genetics;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -14,9 +14,9 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.init.MobEffects;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
import forestry.api.apiculture.EnumBeeChromosome;
|
||||
@@ -59,8 +59,8 @@ public abstract class AlleleEffect extends AlleleCategorized implements IAlleleB
|
||||
effectNone = new AlleleEffectNone("none", true),
|
||||
effectAggressive = new AlleleEffectAggressive(),
|
||||
effectHeroic = new AlleleEffectHeroic(),
|
||||
effectBeatific = new AlleleEffectPotion("beatific", false, Potion.regeneration, 100),
|
||||
effectMiasmic = new AlleleEffectPotion("miasmic", false, Potion.poison, 600, 100, 0.1f),
|
||||
effectBeatific = new AlleleEffectPotion("beatific", false, MobEffects.REGENERATION, 100),
|
||||
effectMiasmic = new AlleleEffectPotion("miasmic", false, MobEffects.POISON, 600, 100, 0.1f),
|
||||
effectMisanthrope = new AlleleEffectMisanthrope(),
|
||||
effectGlacial = new AlleleEffectGlacial(),
|
||||
effectRadioactive = new AlleleEffectRadioactive(),
|
||||
@@ -69,7 +69,7 @@ public abstract class AlleleEffect extends AlleleCategorized implements IAlleleB
|
||||
effectExploration = new AlleleEffectExploration(),
|
||||
effectFestiveEaster = new AlleleEffectNone("festiveEaster", true),
|
||||
effectSnowing = new AlleleEffectSnowing(),
|
||||
effectDrunkard = new AlleleEffectPotion("drunkard", false, Potion.confusion, 100),
|
||||
effectDrunkard = new AlleleEffectPotion("drunkard", false, MobEffects.NAUSEA, 100),
|
||||
effectReanimation = new AlleleEffectResurrection("reanimation", AlleleEffectResurrection.getReanimationList()),
|
||||
effectResurrection = new AlleleEffectResurrection("resurrection", AlleleEffectResurrection.getResurrectionList()),
|
||||
effectRepulsion = new AlleleEffectRepulsion(),
|
||||
@@ -103,7 +103,7 @@ public abstract class AlleleEffect extends AlleleCategorized implements IAlleleB
|
||||
|
||||
@Override
|
||||
public IEffectData doFX(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
|
||||
Vec3 beeFXCoordinates = housing.getBeeFXCoordinates();
|
||||
Vec3d beeFXCoordinates = housing.getBeeFXCoordinates();
|
||||
Proxies.render.addBeeHiveFX(housing.getWorld(), beeFXCoordinates.xCoord, beeFXCoordinates.yCoord, beeFXCoordinates.zCoord, genome.getPrimary().getSpriteColour(0));
|
||||
return storedData;
|
||||
}
|
||||
@@ -139,7 +139,7 @@ public abstract class AlleleEffect extends AlleleCategorized implements IAlleleB
|
||||
Vect min = new Vect(housing.getCoordinates()).add(offset);
|
||||
Vect max = min.add(area);
|
||||
|
||||
return AxisAlignedBB.fromBounds(min.getX(), min.getY(), min.getZ(), max.getX(), max.getY(), max.getZ());
|
||||
return new AxisAlignedBB(min.getX(), min.getY(), min.getZ(), max.getX(), max.getY(), max.getZ());
|
||||
}
|
||||
|
||||
public static <T extends Entity> List<T> getEntitiesInRange(IBeeGenome genome, IBeeHousing housing, Class<T> entityClass) {
|
||||
|
||||
@@ -13,7 +13,7 @@ package forestry.apiculture.genetics.alleles;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.IGrowable;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.common.IPlantable;
|
||||
|
||||
@@ -7,8 +7,8 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.passive.EntityCow;
|
||||
import net.minecraft.entity.passive.EntityMooshroom;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenBigMushroom;
|
||||
|
||||
@@ -66,7 +66,7 @@ public class AlleleEffectFungification extends AlleleEffectThrottled {
|
||||
BlockPos pos = new BlockPos(blockX, blockY, blockZ);
|
||||
Block block = world.getBlockState(pos).getBlock();
|
||||
if (isSuitableForMycelium(world, block, pos)) {
|
||||
world.setBlockState(pos, Blocks.mycelium.getStateFromMeta(0));
|
||||
world.setBlockState(pos, Blocks.MYCELIUM.getDefaultState());
|
||||
break;
|
||||
} else if (isSuitableForGrowth(block)) {
|
||||
doMushroomGrowth(block, world, pos);
|
||||
@@ -91,11 +91,11 @@ public class AlleleEffectFungification extends AlleleEffectThrottled {
|
||||
}
|
||||
|
||||
private static boolean isSuitableForMycelium(World world, Block block, BlockPos pos) {
|
||||
return block == Blocks.grass || block == Blocks.dirt && world.canBlockSeeSky(pos);
|
||||
return block == Blocks.GRASS || block == Blocks.DIRT && world.canBlockSeeSky(pos);
|
||||
}
|
||||
|
||||
private static boolean isSuitableForGrowth(Block block) {
|
||||
return block == Blocks.red_mushroom || block == Blocks.brown_mushroom;
|
||||
return block == Blocks.RED_MUSHROOM || block == Blocks.BROWN_MUSHROOM;
|
||||
}
|
||||
|
||||
private static void convertCowToMooshroom(EntityCow cow) {
|
||||
|
||||
@@ -12,7 +12,7 @@ package forestry.apiculture.genetics.alleles;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
@@ -54,7 +54,7 @@ public class AlleleEffectGlacial extends AlleleEffectThrottled {
|
||||
|
||||
// Freeze water
|
||||
Block block = world.getBlockState(posBlock).getBlock();
|
||||
if (block != Blocks.water) {
|
||||
if (block != Blocks.WATER) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public class AlleleEffectGlacial extends AlleleEffectThrottled {
|
||||
continue;
|
||||
}
|
||||
|
||||
world.setBlockState(posBlock, Blocks.ice.getStateFromMeta(0), Constants.FLAG_BLOCK_SYNCH_AND_UPDATE);
|
||||
world.setBlockState(posBlock, Blocks.ice.getDefaultState(), Constants.FLAG_BLOCK_SYNCH_AND_UPDATE);
|
||||
}
|
||||
|
||||
return storedData;
|
||||
|
||||
@@ -13,7 +13,7 @@ package forestry.apiculture.genetics.alleles;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
@@ -68,7 +68,7 @@ public class AlleleEffectIgnition extends AlleleEffectThrottled {
|
||||
if (housing.getWorld().rand.nextInt(2) != 0) {
|
||||
super.doFX(genome, storedData, housing);
|
||||
} else {
|
||||
Vec3 beeFXCoordinates = housing.getBeeFXCoordinates();
|
||||
Vec3d beeFXCoordinates = housing.getBeeFXCoordinates();
|
||||
Proxies.render.addEntityIgnitionFX(housing.getWorld(), beeFXCoordinates.xCoord, beeFXCoordinates.yCoord + 0.5, beeFXCoordinates.zCoord);
|
||||
}
|
||||
return storedData;
|
||||
|
||||
@@ -18,8 +18,8 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.monster.IMob;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.potion.PotionHelper;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.potion.PotionUtils;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
@@ -41,8 +41,8 @@ public class AlleleEffectPotion extends AlleleEffectThrottled {
|
||||
this.duration = duration;
|
||||
this.chance = chance;
|
||||
|
||||
Collection<PotionEffect> potionEffects = Collections.singleton(new PotionEffect(potion.getId(), 1, 0));
|
||||
this.potionFXColor = PotionHelper.calcPotionLiquidColor(potionEffects);
|
||||
Collection<PotionEffect> potionEffects = Collections.singleton(new PotionEffect(potion, 1, 0));
|
||||
this.potionFXColor = PotionUtils.getPotionColorFromEffectList(potionEffects);
|
||||
}
|
||||
|
||||
public AlleleEffectPotion(String name, boolean isDominant, Potion potion, int duration) {
|
||||
@@ -78,7 +78,7 @@ public class AlleleEffectPotion extends AlleleEffectThrottled {
|
||||
}
|
||||
}
|
||||
|
||||
entity.addPotionEffect(new PotionEffect(potion.getId(), dur, 0));
|
||||
entity.addPotionEffect(new PotionEffect(potion, dur, 0));
|
||||
}
|
||||
|
||||
return storedData;
|
||||
@@ -89,7 +89,7 @@ public class AlleleEffectPotion extends AlleleEffectThrottled {
|
||||
if (housing.getWorld().rand.nextBoolean()) {
|
||||
super.doFX(genome, storedData, housing);
|
||||
} else {
|
||||
Vec3 beeFXCoordinates = housing.getBeeFXCoordinates();
|
||||
Vec3d beeFXCoordinates = housing.getBeeFXCoordinates();
|
||||
Proxies.render.addEntityPotionFX(housing.getWorld(), beeFXCoordinates.xCoord, beeFXCoordinates.yCoord + 0.5, beeFXCoordinates.zCoord, potionFXColor);
|
||||
}
|
||||
return storedData;
|
||||
|
||||
@@ -13,7 +13,7 @@ package forestry.apiculture.genetics.alleles;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -70,7 +70,7 @@ public class AlleleEffectSnowing extends AlleleEffectThrottled {
|
||||
world.setBlockState(posBlock, block.getStateFromMeta(meta + 1), Constants.FLAG_BLOCK_SYNCH_AND_UPDATE);
|
||||
}
|
||||
} else if (block.isReplaceable(world, posBlock)) {
|
||||
world.setBlockState(posBlock, Blocks.snow_layer.getStateFromMeta(0), Constants.FLAG_BLOCK_SYNCH_AND_UPDATE);
|
||||
world.setBlockState(posBlock, Blocks.snow_layer.getDefaultState(), Constants.FLAG_BLOCK_SYNCH_AND_UPDATE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ public class HabitatSlot extends Widget {
|
||||
GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
}
|
||||
|
||||
Proxies.render.bindTexture(TextureMap.locationBlocksTexture);
|
||||
Proxies.render.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
|
||||
manager.gui.drawTexturedModalRect(startX + xPos, startY + yPos, getIcon(), 16, 16);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ import java.util.Set;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
|
||||
|
||||
@@ -12,13 +12,16 @@ package forestry.apiculture.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.color.IItemColor;
|
||||
import net.minecraft.client.renderer.color.ItemColors;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
@@ -87,9 +90,9 @@ public class ItemBeeGE extends ItemGE {
|
||||
if (type != EnumBeeType.DRONE) {
|
||||
IBee individual = BeeManager.beeRoot.getMember(itemstack);
|
||||
if (individual.isNatural()) {
|
||||
list.add(EnumChatFormatting.YELLOW + EnumChatFormatting.ITALIC.toString() + Translator.translateToLocal("for.bees.stock.pristine"));
|
||||
list.add(TextFormatting.YELLOW + TextFormatting.ITALIC.toString() + Translator.translateToLocal("for.bees.stock.pristine"));
|
||||
} else {
|
||||
list.add(EnumChatFormatting.YELLOW + Translator.translateToLocal("for.bees.stock.ignoble"));
|
||||
list.add(TextFormatting.YELLOW + Translator.translateToLocal("for.bees.stock.ignoble"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,21 +118,12 @@ public class ItemBeeGE extends ItemGE {
|
||||
}
|
||||
}
|
||||
|
||||
/* MODELS */
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public int getColorFromItemStack(ItemStack itemstack, int renderPass) {
|
||||
if (!itemstack.hasTagCompound()) {
|
||||
if (renderPass == 1) {
|
||||
return 0xffdc16;
|
||||
} else {
|
||||
return 0xffffff;
|
||||
}
|
||||
}
|
||||
public void registerItemColors() {
|
||||
|
||||
return getColourFromSpecies(BeeGenome.getSpecies(itemstack), renderPass);
|
||||
}
|
||||
|
||||
/* MODELS */
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public int getColourFromSpecies(IAlleleSpecies species, int renderPass) {
|
||||
|
||||
@@ -21,7 +21,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemMinecart;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.apiculture.IArmorApiarist;
|
||||
@@ -43,10 +43,10 @@ public class ItemSmoker extends ItemForestry implements IArmorApiarist {
|
||||
}
|
||||
|
||||
private static void addSmoke(World worldObj, Entity entity, int distance) {
|
||||
Vec3 look = entity.getLookVec();
|
||||
Vec3 handOffset = look.crossProduct(new Vec3(0, 1, 0));
|
||||
Vec3 lookDistance = new Vec3(look.xCoord * distance, look.yCoord * distance, look.zCoord * distance);
|
||||
Vec3 smokePos = lookDistance.add(entity.getPositionVector()).add(handOffset);
|
||||
Vec3d look = entity.getLookVec();
|
||||
Vec3d handOffset = look.crossProduct(new Vec3d(0, 1, 0));
|
||||
Vec3d lookDistance = new Vec3d(look.xCoord * distance, look.yCoord * distance, look.zCoord * distance);
|
||||
Vec3d smokePos = lookDistance.add(entity.getPositionVector()).add(handOffset);
|
||||
Proxies.render.addEntitySmokeFX(worldObj, smokePos.xCoord, smokePos.yCoord + 1, smokePos.zCoord);
|
||||
BlockPos blockPos = new BlockPos(smokePos.xCoord, smokePos.yCoord + 1, smokePos.zCoord);
|
||||
TileEntity tileEntity = worldObj.getTileEntity(blockPos);
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.multiblock;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.io.IOException;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
@@ -18,8 +19,8 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
|
||||
@@ -86,6 +87,7 @@ public class AlvearyController extends RectangularMultiblockControllerBase imple
|
||||
return beekeepingLogic;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IInventoryAdapter getInternalInventory() {
|
||||
if (isAssembled()) {
|
||||
@@ -330,9 +332,9 @@ public class AlvearyController extends RectangularMultiblockControllerBase imple
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vec3 getBeeFXCoordinates() {
|
||||
public Vec3d getBeeFXCoordinates() {
|
||||
BlockPos coord = getCenterCoord();
|
||||
return new Vec3(coord.getX() + 0.5, coord.getY() + 1.5, coord.getZ() + 0.5);
|
||||
return new Vec3d(coord.getX() + 0.5, coord.getY() + 1.5, coord.getZ() + 0.5);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,8 +12,8 @@ package forestry.apiculture.multiblock;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
@@ -76,7 +76,7 @@ public class FakeAlvearyController extends FakeMultiblockController implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vec3 getBeeFXCoordinates() {
|
||||
public Vec3d getBeeFXCoordinates() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ import java.util.List;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
|
||||
@@ -62,7 +62,7 @@ public abstract class TileAlveary extends MultiblockTileEntityForestry<Multibloc
|
||||
public void onMachineAssembled(IMultiblockController multiblockController, BlockPos minCoord, BlockPos maxCoord) {
|
||||
// Re-render this block on the client
|
||||
if (worldObj.isRemote) {
|
||||
this.worldObj.markBlockForUpdate(getPos());
|
||||
this.worldObj.markBlockRangeForRenderUpdate(getPos(), getPos());
|
||||
}
|
||||
worldObj.notifyBlockOfStateChange(getPos(), getBlockType());
|
||||
}
|
||||
@@ -76,7 +76,7 @@ public abstract class TileAlveary extends MultiblockTileEntityForestry<Multibloc
|
||||
public void onMachineBroken() {
|
||||
// Re-render this block on the client
|
||||
if (worldObj.isRemote) {
|
||||
this.worldObj.markBlockForUpdate(getPos());
|
||||
this.worldObj.markBlockRangeForRenderUpdate(getPos(), getPos());
|
||||
}
|
||||
worldObj.notifyBlockOfStateChange(getPos(), getBlockType());
|
||||
markDirty();
|
||||
@@ -110,7 +110,7 @@ public abstract class TileAlveary extends MultiblockTileEntityForestry<Multibloc
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vec3 getBeeFXCoordinates() {
|
||||
public Vec3d getBeeFXCoordinates() {
|
||||
return getMultiblockLogic().getController().getBeeFXCoordinates();
|
||||
}
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ public abstract class TileAlvearyClimatiser extends TileAlveary implements IEner
|
||||
|
||||
if (worldObj != null) {
|
||||
if (worldObj.isRemote) {
|
||||
worldObj.markBlockForUpdate(getPos());
|
||||
worldObj.markBlockRangeForRenderUpdate(getPos(), getPos());
|
||||
} else {
|
||||
Proxies.net.sendNetworkPacket(new PacketActiveUpdate(this), worldObj);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ package forestry.apiculture.network.packets;
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
import forestry.core.network.DataInputStreamForestry;
|
||||
import forestry.core.network.IForestryPacketClient;
|
||||
|
||||
@@ -10,6 +10,22 @@
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.proxy;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.color.BlockColors;
|
||||
import net.minecraft.client.renderer.color.IBlockColor;
|
||||
import net.minecraft.client.renderer.color.IItemColor;
|
||||
import net.minecraft.client.renderer.color.ItemColors;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import forestry.apiculture.PluginApiculture;
|
||||
import forestry.apiculture.genetics.BeeGenome;
|
||||
import forestry.apiculture.tiles.TileCandle;
|
||||
import forestry.core.tiles.TileUtil;
|
||||
|
||||
public class ProxyApicultureClient extends ProxyApiculture {
|
||||
|
||||
@Override
|
||||
@@ -21,6 +37,51 @@ public class ProxyApicultureClient extends ProxyApiculture {
|
||||
MinecraftForgeClient.registerItemRenderer(PluginApiculture.items.beePrincessGE, new RenderBeeItem());
|
||||
MinecraftForgeClient.registerItemRenderer(PluginApiculture.items.beeQueenGE, new RenderBeeItem());
|
||||
}*/
|
||||
|
||||
Minecraft minecraft = Minecraft.getMinecraft();
|
||||
ItemColors itemColors = minecraft.getItemColors();
|
||||
itemColors.registerItemColorHandler(new BeeItemColor(),
|
||||
PluginApiculture.items.beeQueenGE,
|
||||
PluginApiculture.items.beeDroneGE,
|
||||
PluginApiculture.items.beeLarvaeGE,
|
||||
PluginApiculture.items.beePrincessGE
|
||||
);
|
||||
|
||||
BlockColors blockColors = minecraft.getBlockColors();
|
||||
blockColors.registerBlockColorHandler(new CandleBlockColor(),
|
||||
PluginApiculture.blocks.candle,
|
||||
PluginApiculture.blocks.stump
|
||||
);
|
||||
}
|
||||
|
||||
private static class BeeItemColor implements IItemColor {
|
||||
@Override
|
||||
public int getColorFromItemstack(ItemStack itemstack, int tintIndex) {
|
||||
if (!itemstack.hasTagCompound()) {
|
||||
if (tintIndex == 1) {
|
||||
return 0xffdc16;
|
||||
} else {
|
||||
return 0xffffff;
|
||||
}
|
||||
}
|
||||
|
||||
IAlleleBeeSpecies species = BeeGenome.getSpecies(itemstack);
|
||||
if (species instanceof IAlleleBeeSpecies) {
|
||||
return species.getSpriteColour(tintIndex);
|
||||
} else {
|
||||
return 0xffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class CandleBlockColor implements IBlockColor {
|
||||
@Override
|
||||
public int colorMultiplier(IBlockState state, IBlockAccess worldIn, BlockPos pos, int tintIndex) {
|
||||
TileCandle tileCandle = TileUtil.getTile(worldIn, pos, TileCandle.class);
|
||||
if (tileCandle != null) {
|
||||
return tileCandle.getColour();
|
||||
}
|
||||
return 0xffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
|
||||
import forestry.api.apiculture.EnumBeeType;
|
||||
|
||||
|
||||
@@ -19,10 +19,12 @@ import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.client.renderer.ActiveRenderInfo;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.WorldRenderer;
|
||||
import net.minecraft.client.renderer.VertexBuffer;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
@@ -36,6 +38,8 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import forestry.core.proxy.Proxies;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ParticleRenderer {
|
||||
private static final String name = "forestry-particles";
|
||||
@@ -68,7 +72,8 @@ public class ParticleRenderer {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onRenderWorldLast(RenderWorldLastEvent event) {
|
||||
render(event.partialTicks);
|
||||
EntityPlayer thePlayer = Proxies.common.getPlayer();
|
||||
render(thePlayer, event.getPartialTicks());
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@@ -103,7 +108,7 @@ public class ParticleRenderer {
|
||||
|
||||
particle.onUpdate();
|
||||
|
||||
if (particle.isDead) {
|
||||
if (!particle.isAlive()) {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
@@ -115,7 +120,7 @@ public class ParticleRenderer {
|
||||
Minecraft.getMinecraft().mcProfiler.endSection();
|
||||
}
|
||||
|
||||
private synchronized void render(float partialTicks) {
|
||||
private synchronized void render(Entity entityIn, float partialTicks) {
|
||||
Minecraft.getMinecraft().mcProfiler.startSection(name + "-render");
|
||||
|
||||
float rotationX = ActiveRenderInfo.getRotationX();
|
||||
@@ -130,7 +135,7 @@ public class ParticleRenderer {
|
||||
EntityFX.interpPosZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * partialTicks;
|
||||
|
||||
// bind the texture
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
|
||||
|
||||
// gl states/settings for drawing
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
@@ -140,11 +145,11 @@ public class ParticleRenderer {
|
||||
GlStateManager.alphaFunc(GL11.GL_GREATER, 0.003921569F);
|
||||
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
WorldRenderer worldRenderer = tessellator.getWorldRenderer();
|
||||
worldRenderer.begin(7, DefaultVertexFormats.PARTICLE_POSITION_TEX_COLOR_LMAP);
|
||||
VertexBuffer vertexBuffer = tessellator.getBuffer();
|
||||
vertexBuffer.begin(7, DefaultVertexFormats.PARTICLE_POSITION_TEX_COLOR_LMAP);
|
||||
|
||||
for (EntityFX particle : particles) {
|
||||
particle.renderParticle(worldRenderer, particle, partialTicks, rotationX, rotationXZ, rotationZ, rotationYZ, rotationXY);
|
||||
particle.renderParticle(vertexBuffer, entityIn, partialTicks, rotationX, rotationXZ, rotationZ, rotationYZ, rotationXY);
|
||||
}
|
||||
|
||||
tessellator.draw();
|
||||
|
||||
@@ -13,7 +13,7 @@ package forestry.apiculture.render;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureUtil;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TextureHabitatLocator extends TextureAtlasSprite {
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.io.IOException;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
|
||||
@@ -165,8 +165,8 @@ public abstract class TileBeeHousingBase extends TileBase implements IBeeHousing
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vec3 getBeeFXCoordinates() {
|
||||
return new Vec3(getPos().getX() + 0.5, getPos().getY() + 0.5, getPos().getZ() + 0.5);
|
||||
public Vec3d getBeeFXCoordinates() {
|
||||
return new Vec3d(getPos().getX() + 0.5, getPos().getY() + 0.5, getPos().getZ() + 0.5);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -22,11 +22,11 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.ITickable;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.EnumSkyBlock;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
@@ -305,9 +305,9 @@ public class TileHive extends TileEntity implements ITickable, IHiveTile, IActiv
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vec3 getBeeFXCoordinates() {
|
||||
public Vec3d getBeeFXCoordinates() {
|
||||
BlockPos pos = getPos();
|
||||
return new Vec3(pos.getX() + 0.5, pos.getY() + 0.25, pos.getZ() + 0.5);
|
||||
return new Vec3d(pos.getX() + 0.5, pos.getY() + 0.25, pos.getZ() + 0.5);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -15,19 +15,18 @@ import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockStairs;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.gen.structure.StructureBoundingBox;
|
||||
import net.minecraft.world.gen.structure.StructureComponent;
|
||||
import net.minecraft.world.gen.structure.StructureVillagePieces;
|
||||
|
||||
import net.minecraftforge.common.ChestGenHooks;
|
||||
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
import forestry.api.apiculture.EnumBeeType;
|
||||
import forestry.api.apiculture.FlowerManager;
|
||||
@@ -98,10 +97,10 @@ public class ComponentVillageBeeHouse extends StructureVillagePieces.House1 {
|
||||
} else {
|
||||
int roofMeta = random.nextInt(16);
|
||||
|
||||
logs = new BlockType(Blocks.log, random.nextInt(4));
|
||||
planks = new BlockType(Blocks.planks, roofMeta);
|
||||
logs = new BlockType(Blocks.LOG, random.nextInt(4));
|
||||
planks = new BlockType(Blocks.PLANKS, roofMeta);
|
||||
stairs = new BlockTypeVanillaStairs(roofMeta);
|
||||
fence = new BlockType(Blocks.oak_fence, 0);
|
||||
fence = new BlockType(Blocks.OAK_FENCE, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,8 +125,8 @@ public class ComponentVillageBeeHouse extends StructureVillagePieces.House1 {
|
||||
boundingBox.offset(0, averageGroundLevel - boundingBox.maxY + 8 - 1, 0);
|
||||
}
|
||||
|
||||
fillWithBlocks(world, structBoundingBox, 1, 1, 1, 7, 4, 4, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false);
|
||||
fillWithBlocks(world, structBoundingBox, 2, 1, 6, 8, 4, 10, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false);
|
||||
fillWithBlocks(world, structBoundingBox, 1, 1, 1, 7, 4, 4, Blocks.AIR.getDefaultState(), Blocks.AIR.getDefaultState(), false);
|
||||
fillWithBlocks(world, structBoundingBox, 2, 1, 6, 8, 4, 10, Blocks.AIR.getDefaultState(), Blocks.AIR.getDefaultState(), false);
|
||||
|
||||
// Garden
|
||||
buildGarden(world, structBoundingBox);
|
||||
@@ -144,12 +143,13 @@ public class ComponentVillageBeeHouse extends StructureVillagePieces.House1 {
|
||||
buildApiaries(world, structBoundingBox);
|
||||
|
||||
// Floor
|
||||
fillWithBlocks(world, structBoundingBox, 1, 0, 1, 7, 0, 4, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false);
|
||||
fillWithBlocks(world, structBoundingBox, 1, 0, 1, 7, 0, 4, Blocks.PLANKS.getDefaultState(), Blocks.PLANKS.getDefaultState(), false);
|
||||
|
||||
fillWithBlocks(world, structBoundingBox, 0, 0, 0, 0, 3, 5, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false);
|
||||
fillWithBlocks(world, structBoundingBox, 8, 0, 0, 8, 3, 5, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false);
|
||||
fillWithBlocks(world, structBoundingBox, 1, 0, 0, 7, 1, 0, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false);
|
||||
fillWithBlocks(world, structBoundingBox, 1, 0, 5, 7, 1, 5, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false);
|
||||
IBlockState cobblestoneState = Blocks.COBBLESTONE.getDefaultState();
|
||||
fillWithBlocks(world, structBoundingBox, 0, 0, 0, 0, 3, 5, cobblestoneState, cobblestoneState, false);
|
||||
fillWithBlocks(world, structBoundingBox, 8, 0, 0, 8, 3, 5, cobblestoneState, cobblestoneState, false);
|
||||
fillWithBlocks(world, structBoundingBox, 1, 0, 0, 7, 1, 0, cobblestoneState, cobblestoneState, false);
|
||||
fillWithBlocks(world, structBoundingBox, 1, 0, 5, 7, 1, 5, cobblestoneState, cobblestoneState, false);
|
||||
|
||||
fillBoxWith(world, structBoundingBox, 1, 2, 0, 7, 3, 0, planks, false);
|
||||
fillBoxWith(world, structBoundingBox, 1, 2, 5, 7, 3, 5, planks, false);
|
||||
@@ -169,56 +169,61 @@ public class ComponentVillageBeeHouse extends StructureVillagePieces.House1 {
|
||||
placeBlockAtCurrentPosition(world, logs, 8, 2, 1, structBoundingBox);
|
||||
placeBlockAtCurrentPosition(world, logs, 8, 2, 4, structBoundingBox);
|
||||
|
||||
setBlockState(world, Blocks.glass_pane.getStateFromMeta(0), 0, 2, 2, structBoundingBox);
|
||||
setBlockState(world, Blocks.glass_pane.getStateFromMeta(0), 0, 2, 3, structBoundingBox);
|
||||
IBlockState glassPaneState = Blocks.GLASS_PANE.getDefaultState();
|
||||
setBlockState(world, glassPaneState, 0, 2, 2, structBoundingBox);
|
||||
setBlockState(world, glassPaneState, 0, 2, 3, structBoundingBox);
|
||||
|
||||
setBlockState(world, Blocks.glass_pane.getStateFromMeta(0), 8, 2, 2, structBoundingBox);
|
||||
setBlockState(world, Blocks.glass_pane.getStateFromMeta(0), 8, 2, 3, structBoundingBox);
|
||||
setBlockState(world, glassPaneState, 8, 2, 2, structBoundingBox);
|
||||
setBlockState(world, glassPaneState, 8, 2, 3, structBoundingBox);
|
||||
|
||||
// Windows garden side
|
||||
setBlockState(world, Blocks.glass_pane.getStateFromMeta(0), 2, 2, 5, structBoundingBox);
|
||||
setBlockState(world, Blocks.glass_pane.getStateFromMeta(0), 3, 2, 5, structBoundingBox);
|
||||
setBlockState(world, Blocks.glass_pane.getStateFromMeta(0), 4, 2, 5, structBoundingBox);
|
||||
setBlockState(world, glassPaneState, 2, 2, 5, structBoundingBox);
|
||||
setBlockState(world, glassPaneState, 3, 2, 5, structBoundingBox);
|
||||
setBlockState(world, glassPaneState, 4, 2, 5, structBoundingBox);
|
||||
|
||||
setBlockState(world, Blocks.glass_pane.getStateFromMeta(0), 5, 2, 0, structBoundingBox);
|
||||
setBlockState(world, Blocks.glass_pane.getStateFromMeta(0), 6, 2, 5, structBoundingBox);
|
||||
setBlockState(world, glassPaneState, 5, 2, 0, structBoundingBox);
|
||||
setBlockState(world, glassPaneState, 6, 2, 5, structBoundingBox);
|
||||
|
||||
// Escritoire
|
||||
if (random.nextInt(2) == 0) {
|
||||
IBlockType escritoireBlock = new BlockTypeTileForestry(PluginCore.blocks.core, BlockTypeCoreTesr.ESCRITOIRE.ordinal());
|
||||
escritoireBlock.setDirection(getRotatedDirection(EnumFacing.EAST));
|
||||
escritoireBlock.setDirection(EnumFacing.EAST);
|
||||
placeBlockAtCurrentPosition(world, escritoireBlock, 1, 1, 3, structBoundingBox);
|
||||
}
|
||||
|
||||
setBlockState(world, Blocks.air.getStateFromMeta(0), 2, 1, 0, structBoundingBox);
|
||||
setBlockState(world, Blocks.air.getStateFromMeta(0), 2, 2, 0, structBoundingBox);
|
||||
placeDoorCurrentPosition(world, structBoundingBox, random, 2, 1, 0, coordBaseMode);
|
||||
IBlockState airState = Blocks.AIR.getDefaultState();
|
||||
setBlockState(world, airState, 2, 1, 0, structBoundingBox);
|
||||
setBlockState(world, airState, 2, 2, 0, structBoundingBox);
|
||||
placeDoorCurrentPosition(world, structBoundingBox, random, 2, 1, 0, getCoordBaseMode());
|
||||
|
||||
if (isAirBlockAtCurrentPosition(world, new BlockPos(2, 0, -1), structBoundingBox) && !isAirBlockAtCurrentPosition(world, new BlockPos(2, -1, -1), structBoundingBox)) {
|
||||
setBlockState(world, Blocks.stone_stairs.getStateFromMeta(getMetadataWithOffset(Blocks.stone_stairs, 3)), 2, 0, -1, structBoundingBox);
|
||||
setBlockState(world, Blocks.STONE_STAIRS.getDefaultState().withProperty(BlockStairs.FACING, EnumFacing.NORTH), 2, 0, -1, structBoundingBox);
|
||||
}
|
||||
|
||||
setBlockState(world, Blocks.air.getStateFromMeta(0), 6, 1, 5, structBoundingBox);
|
||||
setBlockState(world, Blocks.air.getStateFromMeta(0), 6, 2, 5, structBoundingBox);
|
||||
setBlockState(world, airState, 6, 1, 5, structBoundingBox);
|
||||
setBlockState(world, airState, 6, 2, 5, structBoundingBox);
|
||||
|
||||
// Candles / Lighting
|
||||
setBlockState(world, Blocks.torch.getStateFromMeta(0), 2, 3, 4, structBoundingBox);
|
||||
setBlockState(world, Blocks.torch.getStateFromMeta(0), 6, 3, 4, structBoundingBox);
|
||||
setBlockState(world, Blocks.torch.getStateFromMeta(0), 2, 3, 1, structBoundingBox);
|
||||
setBlockState(world, Blocks.torch.getStateFromMeta(0), 6, 3, 1, structBoundingBox);
|
||||
|
||||
placeDoorCurrentPosition(world, structBoundingBox, random, 6, 1, 5, coordBaseMode);
|
||||
IBlockState torchState = Blocks.TORCH.getDefaultState();
|
||||
setBlockState(world, torchState, 2, 3, 4, structBoundingBox);
|
||||
setBlockState(world, torchState, 6, 3, 4, structBoundingBox);
|
||||
setBlockState(world, torchState, 2, 3, 1, structBoundingBox);
|
||||
setBlockState(world, torchState, 6, 3, 1, structBoundingBox);
|
||||
|
||||
placeDoorCurrentPosition(world, structBoundingBox, random, 6, 1, 5, getCoordBaseMode());
|
||||
|
||||
for (int i = 0; i < 5; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
clearCurrentPositionBlocksUpwards(world, j, 7, i, structBoundingBox);
|
||||
replaceAirAndLiquidDownwards(world, Blocks.cobblestone.getStateFromMeta(0), j, -1, i, structBoundingBox);
|
||||
replaceAirAndLiquidDownwards(world, Blocks.COBBLESTONE.getDefaultState(), j, -1, i, structBoundingBox);
|
||||
}
|
||||
}
|
||||
|
||||
generateChestContents(world, structBoundingBox, random, 7, 1, 4,
|
||||
ChestGenHooks.getItems(Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, random),
|
||||
random.nextInt(4) + random.nextInt(4) + 5);
|
||||
// TODO: Chest loot
|
||||
// generateChestContents(world, structBoundingBox, random, 7, 1, 4,
|
||||
// ChestGenHooks.getItems(Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, random),
|
||||
// random.nextInt(4) + random.nextInt(4) + 5);
|
||||
|
||||
spawnVillagers(world, boundingBox, 7, 1, 1, 2);
|
||||
|
||||
@@ -228,10 +233,10 @@ public class ComponentVillageBeeHouse extends StructureVillagePieces.House1 {
|
||||
private void buildRoof(World world, StructureBoundingBox structBoundingBox) {
|
||||
for (int i = -1; i <= 2; ++i) {
|
||||
for (int j = 0; j <= 8; ++j) {
|
||||
stairs.setDirection(getRotatedDirection(EnumFacing.NORTH));
|
||||
stairs.setDirection(EnumFacing.NORTH);
|
||||
placeBlockAtCurrentPosition(world, stairs, j, 4 + i, i, structBoundingBox);
|
||||
|
||||
stairs.setDirection(getRotatedDirection(EnumFacing.SOUTH));
|
||||
stairs.setDirection(EnumFacing.SOUTH);
|
||||
placeBlockAtCurrentPosition(world, stairs, j, 4 + i, 5 - i, structBoundingBox);
|
||||
}
|
||||
}
|
||||
@@ -239,14 +244,14 @@ public class ComponentVillageBeeHouse extends StructureVillagePieces.House1 {
|
||||
|
||||
private void buildGarden(World world, StructureBoundingBox box) {
|
||||
|
||||
Block ground = Blocks.dirt;
|
||||
Block ground = Blocks.DIRT;
|
||||
if (isInDesert) {
|
||||
ground = Blocks.sand;
|
||||
ground = Blocks.SAND;
|
||||
}
|
||||
|
||||
for (int i = 1; i <= 8; i++) {
|
||||
for (int j = 6; j <= 10; j++) {
|
||||
replaceAirAndLiquidDownwards(world, ground.getStateFromMeta(0), i, 0, j, box);
|
||||
replaceAirAndLiquidDownwards(world, ground.getDefaultState(), i, 0, j, box);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -254,7 +259,7 @@ public class ComponentVillageBeeHouse extends StructureVillagePieces.House1 {
|
||||
private void plantFlowerGarden(World world, StructureBoundingBox box, int minX, int minY, int minZ, int maxX, int maxY, int maxZ) {
|
||||
|
||||
if (isInDesert) {
|
||||
setBlockState(world, Blocks.cactus.getStateFromMeta(0), 4, 1, 7, box);
|
||||
setBlockState(world, Blocks.CACTUS.getDefaultState(), 4, 1, 7, box);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -266,7 +271,9 @@ public class ComponentVillageBeeHouse extends StructureVillagePieces.House1 {
|
||||
int yCoord = getYWithOffset(i);
|
||||
int zCoord = getZWithOffset(j, k);
|
||||
|
||||
if (!Blocks.red_flower.canBlockStay(world, new BlockPos(xCoord, yCoord, zCoord), world.getBlockState(new BlockPos(xCoord, yCoord, zCoord)))) {
|
||||
BlockPos pos = new BlockPos(xCoord, yCoord, zCoord);
|
||||
IBlockState blockState = world.getBlockState(pos);
|
||||
if (!Blocks.RED_FLOWER.canBlockStay(world, pos, blockState)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -350,7 +357,7 @@ public class ComponentVillageBeeHouse extends StructureVillagePieces.House1 {
|
||||
}
|
||||
|
||||
EnumTemperature biomeTemperature = EnumTemperature.getFromBiome(biome, world, pos);
|
||||
EnumHumidity biomeHumidity = EnumHumidity.getFromValue(biome.rainfall);
|
||||
EnumHumidity biomeHumidity = EnumHumidity.getFromValue(biome.getRainfall());
|
||||
|
||||
// Add bees that can live in this environment
|
||||
List<IBeeGenome> valid = new ArrayList<>();
|
||||
@@ -402,7 +409,7 @@ public class ComponentVillageBeeHouse extends StructureVillagePieces.House1 {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int func_180779_c(int villagerCount, int p_180779_2_) {
|
||||
protected int chooseProfession(int villagerCount, int currentVillagerProfession) {
|
||||
if (villagerCount <= 0) {
|
||||
return Constants.ID_VILLAGER_BEEKEEPER;
|
||||
} else {
|
||||
@@ -411,14 +418,7 @@ public class ComponentVillageBeeHouse extends StructureVillagePieces.House1 {
|
||||
}
|
||||
|
||||
private boolean isAirBlockAtCurrentPosition(World world, BlockPos pos, StructureBoundingBox box) {
|
||||
return getBlockStateFromPos(world, pos.getX(), pos.getY(), pos.getZ(), box).getBlock().isAir(world, pos);
|
||||
IBlockState blockStateFromPos = getBlockStateFromPos(world, pos.getX(), pos.getY(), pos.getZ(), box);
|
||||
return blockStateFromPos.getBlock().isAir(blockStateFromPos, world, pos);
|
||||
}
|
||||
|
||||
/** rotates a direction according to the way the structure is facing **/
|
||||
private EnumFacing getRotatedDirection(EnumFacing direction) {
|
||||
int stairDirection = 5 - direction.ordinal();
|
||||
int meta = getMetadataWithOffset(Blocks.oak_stairs, stairDirection);
|
||||
return EnumFacing.values()[5 - meta];
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,7 +14,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
|
||||
|
||||
@@ -16,9 +16,10 @@ import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.chunk.IChunkGenerator;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
@@ -35,7 +36,7 @@ public abstract class HiveDecorator {
|
||||
|
||||
private static final EventType EVENT_TYPE = EnumHelper.addEnum(EventType.class, "FORESTRY_HIVES", new Class[0], new Object[0]);
|
||||
|
||||
public static void decorateHives(IChunkProvider chunkProvider, World world, Random rand, int chunkX, int chunkZ, boolean hasVillageGenerated) {
|
||||
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)) {
|
||||
return;
|
||||
}
|
||||
@@ -68,7 +69,7 @@ public abstract class HiveDecorator {
|
||||
int worldZ = chunkZ * 16;
|
||||
|
||||
BiomeGenBase biome = world.getBiomeGenForCoords(new BlockPos(worldX, 0, worldZ));
|
||||
EnumHumidity humidity = EnumHumidity.getFromValue(biome.rainfall);
|
||||
EnumHumidity humidity = EnumHumidity.getFromValue(biome.getRainfall());
|
||||
|
||||
if (!hive.isGoodBiome(biome) || !hive.isGoodHumidity(humidity)) {
|
||||
return false;
|
||||
@@ -90,7 +91,7 @@ public abstract class HiveDecorator {
|
||||
int worldX = chunkX * 16;
|
||||
int worldZ = chunkZ * 16;
|
||||
BiomeGenBase biome = world.getBiomeGenForCoords(new BlockPos(chunkX, 0, chunkZ));
|
||||
EnumHumidity humidity = EnumHumidity.getFromValue(biome.rainfall);
|
||||
EnumHumidity humidity = EnumHumidity.getFromValue(biome.getRainfall());
|
||||
|
||||
for (int x = 0; x < 16; x++) {
|
||||
for (int z = 0; z < 16; z++) {
|
||||
@@ -145,7 +146,6 @@ public abstract class HiveDecorator {
|
||||
}
|
||||
|
||||
hiveBlock.onBlockAdded(world, pos, state);
|
||||
world.markBlockForUpdate(pos);
|
||||
|
||||
if (!Config.generateBeehivesDebug) {
|
||||
hive.postGen(world, pos);
|
||||
|
||||
Loaded 100 of 635 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user