mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-25 06:24:26 +00:00
Some reformat code for 1.11.2 source (#84)
* Optimized imports * Some code reformat * Some refactoring and code reformat * Some code reformat
This commit is contained in:
1 parent
886c36a308
commit
c3809fbc27
508 files changed
+6677
-6238
No files matched your search
@@ -82,7 +82,7 @@ public class ExtraBees {
|
||||
Method m = GuiIdRegistry.class.getDeclaredMethod("registerGuiHandlers", GuiType.class, List.class);
|
||||
m.setAccessible(true);
|
||||
m.invoke(null, new Object[]{GuiType.Tile, Lists.newArrayList(TileEntityExtraBeesAlvearyPart.class)});
|
||||
} catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
Proxies.render.registerModels();
|
||||
@@ -115,5 +115,4 @@ public class ExtraBees {
|
||||
AlvearyMutationHandler.addMutationItem(new ItemStack(Items.ENDER_PEARL), 2.0f);
|
||||
AlvearyMutationHandler.addMutationItem(new ItemStack(Items.ENDER_EYE), 4.0f);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -17,9 +17,6 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 13-5-2017.
|
||||
*/
|
||||
public abstract class AbstractAlvearyLogic implements IBeeModifier, IBeeListener, ICapabilityProvider {
|
||||
|
||||
@Override
|
||||
@@ -87,11 +84,11 @@ public abstract class AbstractAlvearyLogic implements IBeeModifier, IBeeListener
|
||||
return false;
|
||||
}
|
||||
|
||||
public void updateClient(TileEntityExtraBeesAlvearyPart tile){
|
||||
public void updateClient(TileEntityExtraBeesAlvearyPart tile) {
|
||||
|
||||
}
|
||||
|
||||
public void updateServer(TileEntityExtraBeesAlvearyPart tile){
|
||||
public void updateServer(TileEntityExtraBeesAlvearyPart tile) {
|
||||
|
||||
}
|
||||
|
||||
@@ -117,12 +114,11 @@ public abstract class AbstractAlvearyLogic implements IBeeModifier, IBeeListener
|
||||
return null;
|
||||
}
|
||||
|
||||
public IEnergyStorage getEnergyStorage(){
|
||||
public IEnergyStorage getEnergyStorage() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean hasGui(){
|
||||
public boolean hasGui() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -21,30 +21,26 @@ import net.minecraftforge.items.ItemStackHandler;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 13-5-2017.
|
||||
*/
|
||||
public class AlvearyLogicFrameHousing extends AbstractAlvearyLogic {
|
||||
|
||||
public AlvearyLogicFrameHousing(TileEntityExtraBeesAlvearyPart tile){
|
||||
private final IItemHandlerModifiable inv;
|
||||
private TileEntityExtraBeesAlvearyPart tile;
|
||||
|
||||
public AlvearyLogicFrameHousing(TileEntityExtraBeesAlvearyPart tile) {
|
||||
this.tile = tile;
|
||||
inv = new ItemStackHandler(1){
|
||||
inv = new ItemStackHandler(1) {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) {
|
||||
if (!(stack.getItem() instanceof IHiveFrame)){
|
||||
if (!(stack.getItem() instanceof IHiveFrame)) {
|
||||
return stack;
|
||||
}
|
||||
return super.insertItem(slot, stack, simulate);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
private TileEntityExtraBeesAlvearyPart tile;
|
||||
private final IItemHandlerModifiable inv;
|
||||
|
||||
public IItemHandlerModifiable getInventory() {
|
||||
return inv;
|
||||
}
|
||||
@@ -118,5 +114,4 @@ public class AlvearyLogicFrameHousing extends AbstractAlvearyLogic {
|
||||
public boolean hasGui() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -19,28 +19,24 @@ import net.minecraftforge.items.ItemStackHandler;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 13-5-2017.
|
||||
*/
|
||||
public class AlvearyLogicHatchery extends AbstractAlvearyLogic {
|
||||
|
||||
public AlvearyLogicHatchery(){
|
||||
inv = new ItemStackHandler(5){
|
||||
private final IItemHandlerModifiable inv;
|
||||
|
||||
public AlvearyLogicHatchery() {
|
||||
inv = new ItemStackHandler(5) {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) {
|
||||
if (!stack.isEmpty() && Utils.getBeeRoot().getType(stack) != EnumBeeType.LARVAE){
|
||||
if (!stack.isEmpty() && Utils.getBeeRoot().getType(stack) != EnumBeeType.LARVAE) {
|
||||
return stack;
|
||||
}
|
||||
return super.insertItem(slot, stack, simulate);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
private final IItemHandlerModifiable inv;
|
||||
|
||||
public IItemHandlerModifiable getInventory() {
|
||||
return inv;
|
||||
}
|
||||
@@ -56,7 +52,7 @@ public class AlvearyLogicHatchery extends AbstractAlvearyLogic {
|
||||
if (queen != null) {
|
||||
ItemStack larvae = beeRoot.getMemberStack(beeRoot.getBee(queen.getGenome()), EnumBeeType.LARVAE);
|
||||
for (int i = 0; i < 5; i++) {
|
||||
if (inv.insertItem(i, larvae, false).isEmpty()){
|
||||
if (inv.insertItem(i, larvae, false).isEmpty()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -82,5 +78,4 @@ public class AlvearyLogicHatchery extends AbstractAlvearyLogic {
|
||||
public boolean hasGui() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,18 +3,15 @@ package binnie.extrabees.alveary;
|
||||
import net.minecraftforge.energy.EnergyStorage;
|
||||
import net.minecraftforge.energy.IEnergyStorage;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 13-5-2017.
|
||||
*/
|
||||
public class AlvearyLogicLighting extends AbstractAlvearyLogic {
|
||||
|
||||
public AlvearyLogicLighting(){
|
||||
this.energyStorage = new EnergyStorage(2000);
|
||||
}
|
||||
|
||||
private final IEnergyStorage energyStorage;
|
||||
private boolean lighted;
|
||||
|
||||
public AlvearyLogicLighting() {
|
||||
this.energyStorage = new EnergyStorage(2000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateServer(TileEntityExtraBeesAlvearyPart tile) {
|
||||
lighted = energyStorage.extractEnergy(10, false) >= 10;
|
||||
@@ -24,5 +21,4 @@ public class AlvearyLogicLighting extends AbstractAlvearyLogic {
|
||||
public boolean isSelfLighted() {
|
||||
return lighted;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -16,28 +16,24 @@ import net.minecraftforge.items.ItemStackHandler;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 13-5-2017.
|
||||
*/
|
||||
public class AlvearyLogicMutator extends AbstractAlvearyLogic {
|
||||
|
||||
public AlvearyLogicMutator(){
|
||||
this.inv = new ItemStackHandler(1){
|
||||
private final IItemHandlerModifiable inv;
|
||||
|
||||
public AlvearyLogicMutator() {
|
||||
this.inv = new ItemStackHandler(1) {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) {
|
||||
if (!AlvearyMutationHandler.isMutationItem(stack)){
|
||||
if (!AlvearyMutationHandler.isMutationItem(stack)) {
|
||||
return stack;
|
||||
}
|
||||
return super.insertItem(slot, stack, simulate);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
private final IItemHandlerModifiable inv;
|
||||
|
||||
public IItemHandlerModifiable getInventory() {
|
||||
return inv;
|
||||
}
|
||||
@@ -71,5 +67,4 @@ public class AlvearyLogicMutator extends AbstractAlvearyLogic {
|
||||
public boolean hasGui() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,13 +1,9 @@
|
||||
package binnie.extrabees.alveary;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 13-5-2017.
|
||||
*/
|
||||
public class AlvearyLogicRainShield extends AbstractAlvearyLogic {
|
||||
|
||||
@Override
|
||||
public boolean isSealed() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -22,37 +22,33 @@ import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 13-5-2017.
|
||||
*/
|
||||
public class AlvearyLogicStimulator extends AbstractAlvearyLogic {
|
||||
|
||||
private final IEnergyStorage energyStorage;
|
||||
private final IItemHandlerModifiable inv;
|
||||
private final List<ContainerStimulator> containers = Lists.newArrayList();
|
||||
private int powerUsage;
|
||||
private boolean powered;
|
||||
private StimulatorCircuit[] modifiers;
|
||||
|
||||
public AlvearyLogicStimulator() {
|
||||
this.powerUsage = 0;
|
||||
this.powered = false;
|
||||
this.modifiers = new StimulatorCircuit[0];
|
||||
this.energyStorage = new EnergyStorage(10000);
|
||||
this.inv = new ItemStackHandler(1){
|
||||
this.inv = new ItemStackHandler(1) {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) {
|
||||
if (!ChipsetManager.circuitRegistry.isChipset(stack)){
|
||||
if (!ChipsetManager.circuitRegistry.isChipset(stack)) {
|
||||
return stack;
|
||||
}
|
||||
return super.insertItem(slot, stack, simulate);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
private int powerUsage;
|
||||
private boolean powered;
|
||||
private StimulatorCircuit[] modifiers;
|
||||
private final IEnergyStorage energyStorage;
|
||||
private final IItemHandlerModifiable inv;
|
||||
private final List<ContainerStimulator> containers = Lists.newArrayList();
|
||||
|
||||
public IItemHandlerModifiable getInventory() {
|
||||
return inv;
|
||||
}
|
||||
@@ -65,16 +61,16 @@ public class AlvearyLogicStimulator extends AbstractAlvearyLogic {
|
||||
this.powerUsage += beeMod.getPowerUsage();
|
||||
}
|
||||
this.powered = energyStorage.extractEnergy(powerUsage, true) >= powerUsage;
|
||||
for (ContainerStimulator c : containers){
|
||||
for (ContainerStimulator c : containers) {
|
||||
c.checkPower();
|
||||
}
|
||||
}
|
||||
|
||||
public void onContainerOpened(ContainerStimulator container){
|
||||
public void onContainerOpened(ContainerStimulator container) {
|
||||
containers.add(container);
|
||||
}
|
||||
|
||||
public void onGuiClosed(ContainerStimulator container){
|
||||
public void onGuiClosed(ContainerStimulator container) {
|
||||
containers.remove(container);
|
||||
}
|
||||
|
||||
@@ -251,5 +247,4 @@ public class AlvearyLogicStimulator extends AbstractAlvearyLogic {
|
||||
public boolean hasGui() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,29 +11,26 @@ import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 13-5-2017.
|
||||
*/
|
||||
public class AlvearyLogicTransmitter extends AbstractAlvearyLogic implements IEnergyStorage {
|
||||
|
||||
public AlvearyLogicTransmitter(){
|
||||
internalStorage = new EnergyStorage(2000);
|
||||
}
|
||||
|
||||
private IEnergyStorage internalStorage;
|
||||
|
||||
public AlvearyLogicTransmitter() {
|
||||
internalStorage = new EnergyStorage(2000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateServer(TileEntityExtraBeesAlvearyPart tile) {
|
||||
if (internalStorage.getEnergyStored() < 2){
|
||||
if (internalStorage.getEnergyStored() < 2) {
|
||||
return;
|
||||
}
|
||||
List<IEnergyStorage> esL = Lists.newArrayList();
|
||||
for (TileEntityExtraBeesAlvearyPart part : tile.getExtraBeesParts()){
|
||||
if (part.getAlvearyLogic().getEnergyStorage() != null){
|
||||
for (TileEntityExtraBeesAlvearyPart part : tile.getExtraBeesParts()) {
|
||||
if (part.getAlvearyLogic().getEnergyStorage() != null) {
|
||||
esL.add(part.getAlvearyLogic().getEnergyStorage());
|
||||
}
|
||||
}
|
||||
if (esL.isEmpty()){
|
||||
if (esL.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
int div = esL.size();
|
||||
@@ -95,5 +92,4 @@ public class AlvearyLogicTransmitter extends AbstractAlvearyLogic implements IEn
|
||||
public <T> T getCapability(@Nonnull Capability<T> capability, @Nullable EnumFacing facing) {
|
||||
return capability == CapabilityEnergy.ENERGY ? (T) this : null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -22,23 +22,20 @@ import net.minecraft.world.World;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 13-5-2017.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public class BlockAlveary extends Block implements ITileEntityProvider {
|
||||
|
||||
private static final PropertyEnum<EnumAlvearyLogicType> TYPE = PropertyEnum.create("type", EnumAlvearyLogicType.class);
|
||||
|
||||
public BlockAlveary() {
|
||||
super(new MaterialBeehive(false));
|
||||
setRegistryName("alveary");
|
||||
}
|
||||
|
||||
private static final PropertyEnum<EnumAlvearyLogicType> TYPE = PropertyEnum.create("type", EnumAlvearyLogicType.class);
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
|
||||
TileEntityExtraBeesAlvearyPart tile = TileUtil.getTile(worldIn, pos, TileEntityExtraBeesAlvearyPart.class);
|
||||
if (tile != null && tile.hasGui()){
|
||||
if (tile != null && tile.hasGui()) {
|
||||
GuiHandler.openGui(playerIn, tile);
|
||||
}
|
||||
return true;
|
||||
@@ -50,7 +47,7 @@ public class BlockAlveary extends Block implements ITileEntityProvider {
|
||||
return new TileEntityExtraBeesAlvearyPart(getType(meta));
|
||||
}
|
||||
|
||||
private EnumAlvearyLogicType getType(int meta){
|
||||
private EnumAlvearyLogicType getType(int meta) {
|
||||
IBlockState state = getStateFromMeta(meta);
|
||||
return state.getValue(TYPE);
|
||||
}
|
||||
@@ -76,7 +73,7 @@ public class BlockAlveary extends Block implements ITileEntityProvider {
|
||||
|
||||
@Nonnull
|
||||
public String getUnlocalizedName(int meta) {
|
||||
return "extrabees.machine.alveay."+getType(meta).getName();
|
||||
return "extrabees.machine.alveay." + getType(meta).getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -90,5 +87,4 @@ public class BlockAlveary extends Block implements ITileEntityProvider {
|
||||
meta = meta >= 0 && meta < EnumAlvearyLogicType.VALUES.length ? meta : 0;
|
||||
return getDefaultState().withProperty(TYPE, EnumAlvearyLogicType.VALUES[meta]);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,75 +4,58 @@ import net.minecraft.util.IStringSerializable;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 13-5-2017.
|
||||
*/
|
||||
public enum EnumAlvearyLogicType implements IStringSerializable {
|
||||
|
||||
FRAME {
|
||||
|
||||
@Override
|
||||
public AbstractAlvearyLogic createLogic(TileEntityExtraBeesAlvearyPart tile) {
|
||||
return new AlvearyLogicFrameHousing(tile);
|
||||
}
|
||||
|
||||
},
|
||||
HATCHERY {
|
||||
|
||||
@Override
|
||||
public AbstractAlvearyLogic createLogic(TileEntityExtraBeesAlvearyPart tile) {
|
||||
return new AlvearyLogicHatchery();
|
||||
}
|
||||
|
||||
},
|
||||
LIGHTING {
|
||||
|
||||
@Override
|
||||
public AbstractAlvearyLogic createLogic(TileEntityExtraBeesAlvearyPart tile) {
|
||||
return new AlvearyLogicLighting();
|
||||
}
|
||||
|
||||
},
|
||||
MUTATOR {
|
||||
|
||||
@Override
|
||||
public AbstractAlvearyLogic createLogic(TileEntityExtraBeesAlvearyPart tile) {
|
||||
return new AlvearyLogicMutator();
|
||||
}
|
||||
|
||||
},
|
||||
RAINSHIELD {
|
||||
|
||||
@Override
|
||||
public AbstractAlvearyLogic createLogic(TileEntityExtraBeesAlvearyPart tile) {
|
||||
return new AlvearyLogicRainShield();
|
||||
}
|
||||
|
||||
},
|
||||
STIMULATOR {
|
||||
|
||||
@Override
|
||||
public AbstractAlvearyLogic createLogic(TileEntityExtraBeesAlvearyPart tile) {
|
||||
return new AlvearyLogicStimulator();
|
||||
}
|
||||
|
||||
},
|
||||
TRANSMISSION {
|
||||
|
||||
@Override
|
||||
public AbstractAlvearyLogic createLogic(TileEntityExtraBeesAlvearyPart tile) {
|
||||
return new AlvearyLogicTransmitter();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
public static EnumAlvearyLogicType[] VALUES = values();
|
||||
|
||||
public abstract AbstractAlvearyLogic createLogic(TileEntityExtraBeesAlvearyPart tile);
|
||||
|
||||
@Nonnull
|
||||
public String getName(){
|
||||
public String getName() {
|
||||
return toString().toLowerCase();
|
||||
}
|
||||
|
||||
public static EnumAlvearyLogicType[] VALUES = values();
|
||||
|
||||
}
|
||||
@@ -25,12 +25,16 @@ import java.util.Collection;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 13-5-2017.
|
||||
*/
|
||||
public class TileEntityExtraBeesAlvearyPart extends MultiblockTileEntityForestry<MultiblockLogicAlveary> implements IAlvearyComponent.Active, IAlvearyComponent.BeeModifier, IAlvearyComponent.BeeListener {
|
||||
public class TileEntityExtraBeesAlvearyPart extends MultiblockTileEntityForestry<MultiblockLogicAlveary> implements
|
||||
IAlvearyComponent.Active,
|
||||
IAlvearyComponent.BeeModifier,
|
||||
IAlvearyComponent.BeeListener {
|
||||
|
||||
public TileEntityExtraBeesAlvearyPart(){
|
||||
private String unlocalizedTitle;
|
||||
private EnumAlvearyLogicType type;
|
||||
private AbstractAlvearyLogic alvearyLogic;
|
||||
|
||||
public TileEntityExtraBeesAlvearyPart() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
@@ -42,18 +46,14 @@ public class TileEntityExtraBeesAlvearyPart extends MultiblockTileEntityForestry
|
||||
}
|
||||
}
|
||||
|
||||
private void initFromType(){
|
||||
if (alvearyLogic == null){
|
||||
private void initFromType() {
|
||||
if (alvearyLogic == null) {
|
||||
this.unlocalizedTitle = "tile.for.alveary." + type.getName() + ".name";
|
||||
this.alvearyLogic = type.createLogic(this);
|
||||
}
|
||||
}
|
||||
|
||||
private String unlocalizedTitle;
|
||||
private EnumAlvearyLogicType type;
|
||||
private AbstractAlvearyLogic alvearyLogic;
|
||||
|
||||
public boolean hasGui(){
|
||||
public boolean hasGui() {
|
||||
return alvearyLogic.hasGui();
|
||||
}
|
||||
|
||||
@@ -146,12 +146,11 @@ public class TileEntityExtraBeesAlvearyPart extends MultiblockTileEntityForestry
|
||||
return alvearyLogic.hasCapability(capability, facing) ? alvearyLogic.getCapability(capability, facing) : super.getCapability(capability, facing);
|
||||
}
|
||||
|
||||
public Collection<IMultiblockComponent> getConnectedComponents(){
|
||||
public Collection<IMultiblockComponent> getConnectedComponents() {
|
||||
return getMultiblockLogic().getController().getComponents();
|
||||
}
|
||||
|
||||
public Set<TileEntityExtraBeesAlvearyPart> getExtraBeesParts(){
|
||||
public Set<TileEntityExtraBeesAlvearyPart> getExtraBeesParts() {
|
||||
return getConnectedComponents().stream().filter(p -> p instanceof TileEntityExtraBeesAlvearyPart).map(p -> (TileEntityExtraBeesAlvearyPart) p).collect(Collectors.toSet());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -29,5 +29,4 @@ public class BlockEctoplasm extends BlockWeb {
|
||||
public String getUnlocalizedName() {
|
||||
return "extrabees.block.ectoplasm";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -22,6 +22,8 @@ import java.util.List;
|
||||
|
||||
public class BlockExtraBeeHive extends Block {
|
||||
|
||||
public static final PropertyEnum<EnumHiveType> hiveType = PropertyEnum.create("type", EnumHiveType.class);
|
||||
|
||||
public BlockExtraBeeHive() {
|
||||
super(ExtraBees.materialBeehive);
|
||||
this.setLightLevel(0.2f);
|
||||
@@ -31,8 +33,6 @@ public class BlockExtraBeeHive extends Block {
|
||||
this.setCreativeTab(Tabs.tabApiculture);
|
||||
}
|
||||
|
||||
public static final PropertyEnum<EnumHiveType> hiveType = PropertyEnum.create("type", EnumHiveType.class);
|
||||
|
||||
public String getUnlocalizedName(final ItemStack itemStack) {
|
||||
return "extrabees.block.hive." + itemStack.getItemDamage();
|
||||
}
|
||||
@@ -70,28 +70,27 @@ public class BlockExtraBeeHive extends Block {
|
||||
Collections.shuffle(dropList);
|
||||
int tries = 0;
|
||||
//TODO HIVE DROP
|
||||
// for (boolean hasPrincess = false; tries <= 10 && !hasPrincess; hasPrincess = true) {
|
||||
// ++tries;
|
||||
// for (final IHiveDrop drop : dropList) {
|
||||
// if (world.rand.nextInt(100) < drop.getChance(world, x, y, z)) {
|
||||
// ret.add(drop.getPrincess(world, x, y, z, fortune));
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// for (final IHiveDrop drop : dropList) {
|
||||
// if (world.rand.nextInt(100) < drop.getChance(world, x, y, z)) {
|
||||
// ret.addAll(drop.getDrones(world, x, y, z, fortune));
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// for (final IHiveDrop drop : dropList) {
|
||||
// if (world.rand.nextInt(100) < drop.getChance(world, x, y, z)) {
|
||||
// ret.addAll(drop.getAdditional(world, x, y, z, fortune));
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
/*for (boolean hasPrincess = false; tries <= 10 && !hasPrincess; hasPrincess = true) {
|
||||
++tries;
|
||||
for (final IHiveDrop drop : dropList) {
|
||||
if (world.rand.nextInt(100) < drop.getChance(world, x, y, z)) {
|
||||
ret.add(drop.getPrincess(world, x, y, z, fortune));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (final IHiveDrop drop : dropList) {
|
||||
if (world.rand.nextInt(100) < drop.getChance(world, x, y, z)) {
|
||||
ret.addAll(drop.getDrones(world, x, y, z, fortune));
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (final IHiveDrop drop : dropList) {
|
||||
if (world.rand.nextInt(100) < drop.getChance(world, x, y, z)) {
|
||||
ret.addAll(drop.getAdditional(world, x, y, z, fortune));
|
||||
break;
|
||||
}
|
||||
}*/
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,9 +10,6 @@ import forestry.api.circuits.ICircuitLayout;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 13-5-2017.
|
||||
*/
|
||||
public enum AlvearySimulatorCircuitType implements IBeeModifier {
|
||||
|
||||
LowVoltage(3, 10),
|
||||
@@ -25,6 +22,22 @@ public enum AlvearySimulatorCircuitType implements IBeeModifier {
|
||||
Inhibitor(1, 10),
|
||||
Territory(2, 10);
|
||||
|
||||
static {
|
||||
LowVoltage.logic.setModifier(EnumBeeModifier.Production, 1.5f, 5.0f);
|
||||
HighVoltage.logic.setModifier(EnumBeeModifier.Production, 2.5f, 10.0f);
|
||||
Plant.logic.setModifier(EnumBeeModifier.Flowering, 1.5f, 5.0f);
|
||||
Death.logic.setModifier(EnumBeeModifier.Lifespan, 0.8f, 0.2f);
|
||||
Life.logic.setModifier(EnumBeeModifier.Lifespan, 1.5f, 5.0f);
|
||||
Nether.logic.setModifier(EnumBeeBooleanModifier.Hellish);
|
||||
Mutation.logic.setModifier(EnumBeeModifier.Mutation, 1.5f, 5.0f);
|
||||
Inhibitor.logic.setModifier(EnumBeeModifier.Territory, 0.4f, 0.1f);
|
||||
Inhibitor.logic.setModifier(EnumBeeModifier.Production, 0.9f, 0.5f);
|
||||
Territory.logic.setModifier(EnumBeeModifier.Territory, 1.5f, 5.0f);
|
||||
for (final AlvearySimulatorCircuitType type : values()) {
|
||||
type.logic.setModifier(EnumBeeModifier.GeneticDecay, 1.5f, 10.0f);
|
||||
}
|
||||
}
|
||||
|
||||
public int recipe;
|
||||
public int power;
|
||||
BeeModifierLogic logic;
|
||||
@@ -100,20 +113,4 @@ public enum AlvearySimulatorCircuitType implements IBeeModifier {
|
||||
public boolean isHellish() {
|
||||
return this.logic.getModifier(EnumBeeBooleanModifier.Hellish);
|
||||
}
|
||||
|
||||
static {
|
||||
LowVoltage.logic.setModifier(EnumBeeModifier.Production, 1.5f, 5.0f);
|
||||
HighVoltage.logic.setModifier(EnumBeeModifier.Production, 2.5f, 10.0f);
|
||||
Plant.logic.setModifier(EnumBeeModifier.Flowering, 1.5f, 5.0f);
|
||||
Death.logic.setModifier(EnumBeeModifier.Lifespan, 0.8f, 0.2f);
|
||||
Life.logic.setModifier(EnumBeeModifier.Lifespan, 1.5f, 5.0f);
|
||||
Nether.logic.setModifier(EnumBeeBooleanModifier.Hellish);
|
||||
Mutation.logic.setModifier(EnumBeeModifier.Mutation, 1.5f, 5.0f);
|
||||
Inhibitor.logic.setModifier(EnumBeeModifier.Territory, 0.4f, 0.1f);
|
||||
Inhibitor.logic.setModifier(EnumBeeModifier.Production, 0.9f, 0.5f);
|
||||
Territory.logic.setModifier(EnumBeeModifier.Territory, 1.5f, 5.0f);
|
||||
for (final AlvearySimulatorCircuitType type : values()) {
|
||||
type.logic.setModifier(EnumBeeModifier.GeneticDecay, 1.5f, 10.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,15 +7,15 @@ import net.minecraft.util.text.translation.I18n;
|
||||
|
||||
public class BinnieCircuitLayout implements ICircuitLayout {
|
||||
|
||||
private final String uid;
|
||||
private final ICircuitSocketType socketType;
|
||||
|
||||
public BinnieCircuitLayout(final String uid, final ICircuitSocketType socketType) {
|
||||
this.uid = uid;
|
||||
this.socketType = socketType;
|
||||
ChipsetManager.circuitRegistry.registerLayout(this);
|
||||
}
|
||||
|
||||
private final String uid;
|
||||
private final ICircuitSocketType socketType;
|
||||
|
||||
@Override
|
||||
public String getUID() {
|
||||
return "binnie.circuitLayout" + this.uid;
|
||||
@@ -35,5 +35,4 @@ public class BinnieCircuitLayout implements ICircuitLayout {
|
||||
public ICircuitSocketType getSocketType() {
|
||||
return this.socketType;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,11 +13,12 @@ import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 13-5-2017.
|
||||
*/
|
||||
public class StimulatorCircuit implements ICircuit, IBeeModifier {
|
||||
|
||||
private final AlvearySimulatorCircuitType type;
|
||||
private final String uid;
|
||||
private final List<String> tooltip;
|
||||
|
||||
public StimulatorCircuit(final AlvearySimulatorCircuitType type, final ICircuitLayout layout) {
|
||||
uid = "binnie.circuit.stimulator." + type.toString().toLowerCase();
|
||||
this.type = type;
|
||||
@@ -27,15 +28,11 @@ public class StimulatorCircuit implements ICircuit, IBeeModifier {
|
||||
tooltip = Lists.newArrayList();
|
||||
}
|
||||
|
||||
private final AlvearySimulatorCircuitType type;
|
||||
private final String uid;
|
||||
private final List<String> tooltip;
|
||||
|
||||
public int getPowerUsage() {
|
||||
return this.type.power;
|
||||
}
|
||||
|
||||
public void addTooltip(String tt){
|
||||
public void addTooltip(String tt) {
|
||||
this.tooltip.add(tt);
|
||||
}
|
||||
|
||||
@@ -103,7 +100,7 @@ public class StimulatorCircuit implements ICircuit, IBeeModifier {
|
||||
|
||||
@Override
|
||||
public boolean isCircuitable(@Nonnull Object tile) {
|
||||
System.out.println("isCircuitable: "+tile);
|
||||
System.out.println("isCircuitable: " + tile);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -131,5 +128,4 @@ public class StimulatorCircuit implements ICircuit, IBeeModifier {
|
||||
public void addTooltip(@Nonnull List<String> list) {
|
||||
list.addAll(tooltip);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -17,7 +17,6 @@ import java.util.Locale;
|
||||
public class BeeModelProvider implements IBeeModelProvider {
|
||||
public static final BeeModelProvider instance = new BeeModelProvider();
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private static ModelResourceLocation[] models = new ModelResourceLocation[EnumBeeType.values().length];
|
||||
|
||||
@@ -40,7 +39,6 @@ public class BeeModelProvider implements IBeeModelProvider {
|
||||
return models[type.ordinal()];
|
||||
}
|
||||
|
||||
|
||||
public ModelResourceLocation getModelLocation(String modID, String identifier) {
|
||||
return new ModelResourceLocation(modID + ":" + identifier, "inventory");
|
||||
}
|
||||
|
||||
@@ -10,24 +10,10 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.items.IItemHandlerModifiable;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.awt.*;
|
||||
import java.awt.Dimension;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 13-5-2017.
|
||||
*/
|
||||
public abstract class AbstractAlvearyContainer extends Container {
|
||||
|
||||
public AbstractAlvearyContainer(EntityPlayer player, IItemHandlerModifiable inv, EnumAlvearyLogicType type, Dimension dimension){
|
||||
this.player = player;
|
||||
this.inv = inv;
|
||||
this.dimension = dimension;
|
||||
String base = "extrabees.machine.alveay."+type.getName();
|
||||
title = ExtraBees.proxy.localise(base+".name");
|
||||
tooltip = ExtraBees.proxy.localise(base+".info");
|
||||
background = new ExtraBeesResourceLocation("textures/gui/gui"+ type.getName()+".png");
|
||||
setupContainer();
|
||||
}
|
||||
|
||||
protected static final Dimension DEFAULT_DIMENSION = new Dimension(176, 144);
|
||||
public final Dimension dimension;
|
||||
protected final EntityPlayer player;
|
||||
@@ -36,9 +22,20 @@ public abstract class AbstractAlvearyContainer extends Container {
|
||||
protected int offset = 0;
|
||||
protected String tooltip, title;
|
||||
|
||||
public AbstractAlvearyContainer(EntityPlayer player, IItemHandlerModifiable inv, EnumAlvearyLogicType type, Dimension dimension) {
|
||||
this.player = player;
|
||||
this.inv = inv;
|
||||
this.dimension = dimension;
|
||||
String base = "extrabees.machine.alveay." + type.getName();
|
||||
title = ExtraBees.proxy.localise(base + ".name");
|
||||
tooltip = ExtraBees.proxy.localise(base + ".info");
|
||||
background = new ExtraBeesResourceLocation("textures/gui/gui" + type.getName() + ".png");
|
||||
setupContainer();
|
||||
}
|
||||
|
||||
protected abstract void setupContainer();
|
||||
|
||||
protected final void addPlayerInventory(){
|
||||
protected final void addPlayerInventory() {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int j = 0; j < 9; j++) {
|
||||
addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, (84 + this.offset) + i * 18));
|
||||
@@ -54,5 +51,4 @@ public abstract class AbstractAlvearyContainer extends Container {
|
||||
public boolean canInteractWith(@Nonnull EntityPlayer playerIn) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,9 +5,6 @@ import binnie.extrabees.alveary.EnumAlvearyLogicType;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraftforge.items.SlotItemHandler;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 13-5-2017.
|
||||
*/
|
||||
public class ContainerFrameHousing extends AbstractAlvearyContainer {
|
||||
|
||||
public ContainerFrameHousing(EntityPlayer player, AlvearyLogicFrameHousing logic) {
|
||||
@@ -20,5 +17,4 @@ public class ContainerFrameHousing extends AbstractAlvearyContainer {
|
||||
addPlayerInventory();
|
||||
addSlotToContainer(new SlotItemHandler(inv, 0, 80, 37));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,9 +5,6 @@ import binnie.extrabees.alveary.EnumAlvearyLogicType;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraftforge.items.SlotItemHandler;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 13-5-2017.
|
||||
*/
|
||||
public class ContainerHatchery extends AbstractAlvearyContainer {
|
||||
|
||||
public ContainerHatchery(EntityPlayer player, AlvearyLogicHatchery logic) {
|
||||
@@ -22,5 +19,4 @@ public class ContainerHatchery extends AbstractAlvearyContainer {
|
||||
addSlotToContainer(new SlotItemHandler(inv, i, 44 + i * 18, 37));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,11 +5,8 @@ import binnie.extrabees.alveary.EnumAlvearyLogicType;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraftforge.items.SlotItemHandler;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.Dimension;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 13-5-2017.
|
||||
*/
|
||||
public class ContainerMutator extends AbstractAlvearyContainer {
|
||||
|
||||
public ContainerMutator(EntityPlayer player, AlvearyLogicMutator logic) {
|
||||
@@ -21,5 +18,4 @@ public class ContainerMutator extends AbstractAlvearyContainer {
|
||||
addPlayerInventory();
|
||||
addSlotToContainer(new SlotItemHandler(inv, 0, 81, 29));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,25 +7,22 @@ import net.minecraft.inventory.IContainerListener;
|
||||
import net.minecraftforge.energy.IEnergyStorage;
|
||||
import net.minecraftforge.items.SlotItemHandler;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 13-5-2017.
|
||||
*/
|
||||
public class ContainerStimulator extends AbstractAlvearyContainer {
|
||||
|
||||
private final AlvearyLogicStimulator logic;
|
||||
private final IEnergyStorage storage;
|
||||
protected int power, maxPower;
|
||||
|
||||
public ContainerStimulator(EntityPlayer player, AlvearyLogicStimulator logic) {
|
||||
super(player, logic.getInventory(), EnumAlvearyLogicType.STIMULATOR, DEFAULT_DIMENSION);
|
||||
this.storage = logic.getEnergyStorage();
|
||||
this.logic = logic;
|
||||
this.maxPower = storage.getMaxEnergyStored();
|
||||
if (!player.world.isRemote){
|
||||
if (!player.world.isRemote) {
|
||||
logic.onContainerOpened(this);
|
||||
}
|
||||
}
|
||||
|
||||
private final AlvearyLogicStimulator logic;
|
||||
private final IEnergyStorage storage;
|
||||
protected int power, maxPower;
|
||||
|
||||
@Override
|
||||
protected void setupContainer() {
|
||||
offset = -21;
|
||||
@@ -34,9 +31,9 @@ public class ContainerStimulator extends AbstractAlvearyContainer {
|
||||
addSlotToContainer(new SlotItemHandler(inv, 0, 44, 37));
|
||||
}
|
||||
|
||||
public void checkPower(){
|
||||
if (power != storage.getEnergyStored()){
|
||||
for (IContainerListener listener : listeners){
|
||||
public void checkPower() {
|
||||
if (power != storage.getEnergyStored()) {
|
||||
for (IContainerListener listener : listeners) {
|
||||
listener.sendProgressBarUpdate(this, 9, power = storage.getEnergyStored());
|
||||
}
|
||||
}
|
||||
@@ -50,9 +47,8 @@ public class ContainerStimulator extends AbstractAlvearyContainer {
|
||||
|
||||
@Override
|
||||
public void updateProgressBar(int id, int data) {
|
||||
if (id == 9){
|
||||
if (id == 9) {
|
||||
power = data;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,40 +8,35 @@ import net.minecraftforge.fml.client.config.GuiUtils;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.Color;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 13-5-2017.
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiContainerAlvearyPart extends GuiContainer {
|
||||
|
||||
@SuppressWarnings("all")
|
||||
protected FontRenderer font;
|
||||
protected AbstractAlvearyContainer container;
|
||||
private int titleS = -1;
|
||||
|
||||
public GuiContainerAlvearyPart(AbstractAlvearyContainer container) {
|
||||
super(container);
|
||||
this.container = container;
|
||||
font = Minecraft.getMinecraft().fontRendererObj;
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
protected FontRenderer font;
|
||||
protected AbstractAlvearyContainer container;
|
||||
private int titleS = -1;
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
|
||||
int i = (this.width - this.xSize) / 2;
|
||||
int j = (this.height - this.ySize) / 2;
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(container.background);
|
||||
if (titleS == -1){
|
||||
if (titleS == -1) {
|
||||
titleS = (i + (xSize / 2)) - (font.getStringWidth(container.title) / 2);
|
||||
}
|
||||
|
||||
drawTexturedModalRect(i, j, 0, 0, container.dimension.width, container.dimension.height);
|
||||
font.drawString(container.title, titleS, j + 8, Color.DARK_GRAY.getRGB());
|
||||
if (mouseX > i + 6 && mouseX < i + 23 && mouseY > j + 5 && mouseY < j + 22){
|
||||
if (mouseX > i + 6 && mouseX < i + 23 && mouseY > j + 5 && mouseY < j + 22) {
|
||||
GuiUtils.drawHoveringText(Lists.newArrayList(container.tooltip), mouseX, mouseY, width, height, 150, font);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,28 +5,25 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.Color;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 13-5-2017.
|
||||
*/
|
||||
public class GuiContainerMutator extends GuiContainerAlvearyPart {
|
||||
|
||||
private String mutagens;
|
||||
private int titleS = -1;
|
||||
|
||||
public GuiContainerMutator(AbstractAlvearyContainer container) {
|
||||
super(container);
|
||||
mutagens = "Possible Mutagens:";
|
||||
}
|
||||
|
||||
private String mutagens;
|
||||
private int titleS = -1;
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
|
||||
super.drawGuiContainerBackgroundLayer(partialTicks, mouseX, mouseY);
|
||||
int i = (this.width - this.xSize) / 2;
|
||||
int j = (this.height - this.ySize) / 2;
|
||||
int mid = i + (xSize / 2);
|
||||
if (titleS == -1){
|
||||
if (titleS == -1) {
|
||||
titleS = mid - (font.getStringWidth(mutagens) / 2);
|
||||
}
|
||||
font.drawString(mutagens, titleS, j + 50, Color.DARK_GRAY.getRGB());
|
||||
@@ -39,5 +36,4 @@ public class GuiContainerMutator extends GuiContainerAlvearyPart {
|
||||
q++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,18 +3,15 @@ package binnie.extrabees.client.gui;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 13-5-2017.
|
||||
*/
|
||||
public class GuiContainerStimulator extends GuiContainerAlvearyPart {
|
||||
|
||||
private ContainerStimulator container;
|
||||
|
||||
public GuiContainerStimulator(ContainerStimulator container) {
|
||||
super(container);
|
||||
this.container = container;
|
||||
}
|
||||
|
||||
private ContainerStimulator container;
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
|
||||
super.drawGuiContainerBackgroundLayer(partialTicks, mouseX, mouseY);
|
||||
@@ -27,5 +24,4 @@ public class GuiContainerStimulator extends GuiContainerAlvearyPart {
|
||||
drawTexturedModalRect(i + 71, j + 38, 0, 185, (int) bar, 14);
|
||||
drawTexturedModalRect(i + 71, j + 38, 0, 165, 70, 14);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,7 +15,36 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
|
||||
import static forestry.apiculture.genetics.BeeDefinition.*;
|
||||
import static forestry.apiculture.genetics.BeeDefinition.AUSTERE;
|
||||
import static forestry.apiculture.genetics.BeeDefinition.BOGGY;
|
||||
import static forestry.apiculture.genetics.BeeDefinition.COMMON;
|
||||
import static forestry.apiculture.genetics.BeeDefinition.CULTIVATED;
|
||||
import static forestry.apiculture.genetics.BeeDefinition.DEMONIC;
|
||||
import static forestry.apiculture.genetics.BeeDefinition.DILIGENT;
|
||||
import static forestry.apiculture.genetics.BeeDefinition.ENDED;
|
||||
import static forestry.apiculture.genetics.BeeDefinition.EXOTIC;
|
||||
import static forestry.apiculture.genetics.BeeDefinition.FARMERLY;
|
||||
import static forestry.apiculture.genetics.BeeDefinition.FIENDISH;
|
||||
import static forestry.apiculture.genetics.BeeDefinition.FOREST;
|
||||
import static forestry.apiculture.genetics.BeeDefinition.FRUGAL;
|
||||
import static forestry.apiculture.genetics.BeeDefinition.HERMITIC;
|
||||
import static forestry.apiculture.genetics.BeeDefinition.IMPERIAL;
|
||||
import static forestry.apiculture.genetics.BeeDefinition.INDUSTRIOUS;
|
||||
import static forestry.apiculture.genetics.BeeDefinition.MAJESTIC;
|
||||
import static forestry.apiculture.genetics.BeeDefinition.MARSHY;
|
||||
import static forestry.apiculture.genetics.BeeDefinition.MEADOWS;
|
||||
import static forestry.apiculture.genetics.BeeDefinition.MIRY;
|
||||
import static forestry.apiculture.genetics.BeeDefinition.MODEST;
|
||||
import static forestry.apiculture.genetics.BeeDefinition.MONASTIC;
|
||||
import static forestry.apiculture.genetics.BeeDefinition.NOBLE;
|
||||
import static forestry.apiculture.genetics.BeeDefinition.RURAL;
|
||||
import static forestry.apiculture.genetics.BeeDefinition.SECLUDED;
|
||||
import static forestry.apiculture.genetics.BeeDefinition.SINISTER;
|
||||
import static forestry.apiculture.genetics.BeeDefinition.SPECTRAL;
|
||||
import static forestry.apiculture.genetics.BeeDefinition.TROPICAL;
|
||||
import static forestry.apiculture.genetics.BeeDefinition.UNWEARY;
|
||||
import static forestry.apiculture.genetics.BeeDefinition.VALIANT;
|
||||
import static forestry.apiculture.genetics.BeeDefinition.WINTRY;
|
||||
|
||||
public class ExtraBeeMutation {
|
||||
|
||||
@@ -199,29 +228,27 @@ public class ExtraBeeMutation {
|
||||
|
||||
static class ConditionPerson implements IMutationCondition {
|
||||
|
||||
String name;
|
||||
|
||||
public ConditionPerson(final String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
String name;
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "Can only be bred by " + this.name;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public float getChance(World world, BlockPos pos, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1, IClimateProvider climate) {
|
||||
TileEntity tileEnity = world.getTileEntity(pos);
|
||||
if(tileEnity instanceof IBeeHousing){
|
||||
if (tileEnity instanceof IBeeHousing) {
|
||||
IBeeHousing housing = (IBeeHousing) tileEnity;
|
||||
if(housing.getOwner() != null && housing.getOwner().getName() != null && housing.getOwner().getName().equals(this.name)){
|
||||
if (housing.getOwner() != null && housing.getOwner().getName() != null && housing.getOwner().getName().equals(this.name)) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -42,30 +42,10 @@ public enum ExtraBeesBranch implements IClassification {
|
||||
QUANTUM("Quantapis"),
|
||||
BOTANIA("Botaniapis"); //TODO There is 1 bee in here, that produces the petal of the flowers around, move to MagicBEes?
|
||||
|
||||
IClassification parent;
|
||||
private String uid;
|
||||
private String scientific;
|
||||
private Set<IAlleleBeeSpecies> speciesSet;
|
||||
IClassification parent;
|
||||
|
||||
@Override
|
||||
public String getUID() {
|
||||
return "extrabees.genus." + this.uid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return ExtraBees.proxy.localise("branch." + this.toString().toLowerCase() + ".name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getScientific() {
|
||||
return this.scientific;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return ExtraBees.proxy.localise("branch." + this.toString().toLowerCase() + ".desc");
|
||||
}
|
||||
|
||||
ExtraBeesBranch(final String scientific) {
|
||||
this.uid = "";
|
||||
@@ -75,17 +55,6 @@ public enum ExtraBeesBranch implements IClassification {
|
||||
this.uid = this.toString().toLowerCase();
|
||||
}
|
||||
|
||||
public void register() {
|
||||
if (!this.speciesSet.isEmpty()) {
|
||||
AlleleManager.alleleRegistry.registerClassification(this);
|
||||
final IClassification parent = AlleleManager.alleleRegistry.getClassification("family.apidae");
|
||||
if (parent != null) {
|
||||
parent.addMemberGroup(this);
|
||||
this.setParent(parent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void setSpeciesBranches() {
|
||||
final IClassification frozenBranch = AlleleManager.alleleRegistry.getClassification("genus.bees.frozen");
|
||||
if (frozenBranch != null) {
|
||||
@@ -267,6 +236,37 @@ public enum ExtraBeesBranch implements IClassification {
|
||||
ExtraBeesBranch.BOTANIA.register();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUID() {
|
||||
return "extrabees.genus." + this.uid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return ExtraBees.proxy.localise("branch." + this.toString().toLowerCase() + ".name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getScientific() {
|
||||
return this.scientific;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return ExtraBees.proxy.localise("branch." + this.toString().toLowerCase() + ".desc");
|
||||
}
|
||||
|
||||
public void register() {
|
||||
if (!this.speciesSet.isEmpty()) {
|
||||
AlleleManager.alleleRegistry.registerClassification(this);
|
||||
final IClassification parent = AlleleManager.alleleRegistry.getClassification("family.apidae");
|
||||
if (parent != null) {
|
||||
parent.addMemberGroup(this);
|
||||
this.setParent(parent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IClassification.EnumClassLevel getLevel() {
|
||||
return IClassification.EnumClassLevel.GENUS;
|
||||
|
||||
@@ -3,7 +3,15 @@ package binnie.extrabees.genetics;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.extrabees.utils.Utils;
|
||||
import forestry.api.apiculture.FlowerManager;
|
||||
import forestry.api.genetics.*;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IAlleleFlowers;
|
||||
import forestry.api.genetics.ICheckPollinatable;
|
||||
import forestry.api.genetics.IChromosomeType;
|
||||
import forestry.api.genetics.IFlowerProvider;
|
||||
import forestry.api.genetics.IFruitBearer;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.init.Blocks;
|
||||
@@ -36,6 +44,12 @@ public enum ExtraBeesFlowers implements IFlowerProvider, IAlleleFlowers, IChromo
|
||||
this.dominant = true;
|
||||
}
|
||||
|
||||
public static void doInit() {
|
||||
for (final ExtraBeesFlowers effect : values()) {
|
||||
effect.register();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUID() {
|
||||
return "extrabees.flower." + this.toString().toLowerCase();
|
||||
@@ -66,12 +80,6 @@ public enum ExtraBeesFlowers implements IFlowerProvider, IAlleleFlowers, IChromo
|
||||
AlleleManager.alleleRegistry.registerAllele(this, this);
|
||||
}
|
||||
|
||||
public static void doInit() {
|
||||
for (final ExtraBeesFlowers effect : values()) {
|
||||
effect.register();
|
||||
}
|
||||
}
|
||||
|
||||
public List<Block> getAcceptableBlocks() {
|
||||
switch (this) {
|
||||
case WATER: {
|
||||
@@ -152,21 +160,20 @@ public enum ExtraBeesFlowers implements IFlowerProvider, IAlleleFlowers, IChromo
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// @Override
|
||||
// public boolean growFlower(final World world, final IIndividual individual, final BlockPos pos) {
|
||||
// switch (this) {
|
||||
// case WATER: {
|
||||
// return world.isAirBlock(x, y, z) && world.getBlock(x, y - 1, z) == Blocks.water && world.setBlock(x, y, z, Blocks.waterlily, 0, 2);
|
||||
// }
|
||||
// case SUGAR: {
|
||||
// return world.getBlock(x, y - 1, z) == Blocks.reeds && world.isAirBlock(x, y, z) && world.setBlock(x, y, z, Blocks.reeds, 0, 0);
|
||||
// }
|
||||
// default: {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
/*@Override
|
||||
public boolean growFlower(final World world, final IIndividual individual, final BlockPos pos) {
|
||||
switch (this) {
|
||||
case WATER: {
|
||||
return world.isAirBlock(x, y, z) && world.getBlock(x, y - 1, z) == Blocks.water && world.setBlock(x, y, z, Blocks.waterlily, 0, 2);
|
||||
}
|
||||
case SUGAR: {
|
||||
return world.getBlock(x, y - 1, z) == Blocks.reeds && world.isAirBlock(x, y, z) && world.setBlock(x, y, z, Blocks.reeds, 0, 0);
|
||||
}
|
||||
default: {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
@@ -183,10 +190,10 @@ public enum ExtraBeesFlowers implements IFlowerProvider, IAlleleFlowers, IChromo
|
||||
return this.getUID();
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public Set<IFlower> getFlowers() {
|
||||
// return new HashSet<IFlower>();
|
||||
// }
|
||||
/*@Override
|
||||
public Set<IFlower> getFlowers() {
|
||||
return new HashSet<IFlower>();
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public Class<? extends IAllele> getAlleleClass() {
|
||||
|
||||
@@ -9,11 +9,23 @@ import binnie.extrabees.items.types.IEBEnumItem;
|
||||
import binnie.extrabees.utils.Utils;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import forestry.api.apiculture.*;
|
||||
import forestry.api.apiculture.EnumBeeChromosome;
|
||||
import forestry.api.apiculture.EnumBeeType;
|
||||
import forestry.api.apiculture.IAlleleBeeEffect;
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.apiculture.IBeeRoot;
|
||||
import forestry.api.core.EnumHumidity;
|
||||
import forestry.api.core.EnumTemperature;
|
||||
import forestry.api.core.IModelManager;
|
||||
import forestry.api.genetics.*;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IAlleleFlowers;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import forestry.api.genetics.IClassification;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.IMutation;
|
||||
import forestry.apiculture.PluginApiculture;
|
||||
import forestry.apiculture.genetics.BeeDefinition;
|
||||
import forestry.core.genetics.alleles.AlleleHelper;
|
||||
@@ -163,28 +175,28 @@ public enum ExtraBeesSpecies implements IAlleleBeeSpecies {
|
||||
BLUTONIUM("caruthus", 1769702),
|
||||
MYSTICAL("mystica", 4630306);
|
||||
|
||||
public final Map<ItemStack, Float> allProducts;
|
||||
public final Map<ItemStack, Float> allSpecialties;
|
||||
private final int primaryColor;
|
||||
private final String binomial;
|
||||
private final Map<ItemStack, Float> products;
|
||||
private final Map<ItemStack, Float> specialties;
|
||||
public State state;
|
||||
boolean nocturnal;
|
||||
private int secondaryColor;
|
||||
private EnumTemperature temperature;
|
||||
private EnumHumidity humidity;
|
||||
private boolean hasEffect;
|
||||
private boolean isSecret;
|
||||
private boolean isCounted;
|
||||
private final String binomial;
|
||||
@Nullable
|
||||
private IClassification branch;
|
||||
private String uid;
|
||||
@Nullable
|
||||
private Achievement achievement;
|
||||
private boolean dominant;
|
||||
private final Map<ItemStack, Float> products;
|
||||
private final Map<ItemStack, Float> specialties;
|
||||
public final Map<ItemStack, Float> allProducts;
|
||||
public final Map<ItemStack, Float> allSpecialties;
|
||||
@Nullable
|
||||
private IAllele[] template;
|
||||
public State state;
|
||||
boolean nocturnal;
|
||||
|
||||
ExtraBeesSpecies(final String binomial, final int colour) {
|
||||
this.primaryColor = 16777215;
|
||||
@@ -212,172 +224,10 @@ public enum ExtraBeesSpecies implements IAlleleBeeSpecies {
|
||||
this("", 16777215);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return ExtraBees.proxy.localise(getUnlocalizedName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return ExtraBees.proxy.localise(getUID() + ".desc");
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumTemperature getTemperature() {
|
||||
return this.temperature;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumHumidity getHumidity() {
|
||||
return this.humidity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasEffect() {
|
||||
return this.hasEffect;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSecret() {
|
||||
return this.isSecret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCounted() {
|
||||
return this.isCounted;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBinomial() {
|
||||
return this.binomial;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAuthority() {
|
||||
return "Binnie";
|
||||
}
|
||||
|
||||
@Override
|
||||
public IClassification getBranch() {
|
||||
return this.branch;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUID() {
|
||||
return "extrabees.species." + this.uid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDominant() {
|
||||
return this.dominant;
|
||||
}
|
||||
|
||||
public Map<ItemStack, Float> getProducts() {
|
||||
return this.products;
|
||||
}
|
||||
|
||||
public Map<ItemStack, Float> getSpecialty() {
|
||||
return this.specialties;
|
||||
}
|
||||
|
||||
private void setState(final State state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public void registerTemplate() {
|
||||
Utils.getBeeRoot().registerTemplate(this.getTemplate());
|
||||
if (this.state != State.Active) {
|
||||
AlleleManager.alleleRegistry.blacklistAllele(this.getUID());
|
||||
}
|
||||
}
|
||||
|
||||
public void addProduct(final ItemStack product, final Float chance) {
|
||||
if (product.isEmpty()) {
|
||||
this.setState(State.Inactive);
|
||||
} else {
|
||||
this.products.put(product, chance);
|
||||
this.allProducts.put(product, chance);
|
||||
}
|
||||
}
|
||||
|
||||
public void addProduct(final IEBEnumItem product, final Float chance) {
|
||||
if (product.isActive()) {
|
||||
this.addProduct(product.get(1), chance);
|
||||
} else {
|
||||
this.allProducts.put(product.get(1), chance);
|
||||
this.setState(State.Inactive);
|
||||
}
|
||||
}
|
||||
|
||||
public void addSpecialty(final ItemStack product, final Float chance) {
|
||||
if (product.isEmpty()) {
|
||||
this.setState(State.Inactive);
|
||||
} else {
|
||||
this.specialties.put(product, chance);
|
||||
this.allSpecialties.put(product, chance);
|
||||
}
|
||||
}
|
||||
|
||||
private void addSpecialty(final IEBEnumItem product, final Float chance) {
|
||||
if (product.isActive()) {
|
||||
this.addSpecialty(product.get(1), chance);
|
||||
} else {
|
||||
this.setState(State.Inactive);
|
||||
this.allSpecialties.put(product.get(1), chance);
|
||||
}
|
||||
}
|
||||
|
||||
private void setHumidity(final EnumHumidity humidity) {
|
||||
this.humidity = humidity;
|
||||
}
|
||||
|
||||
private void setTemperature(final EnumTemperature temperature) {
|
||||
this.temperature = temperature;
|
||||
}
|
||||
|
||||
public static IAllele[] getDefaultTemplate() {
|
||||
return Utils.getBeeRoot().getDefaultTemplate();
|
||||
}
|
||||
|
||||
public IAllele[] getTemplate() {
|
||||
Preconditions.checkState(this.template != null, "Species Template has not been set: %s", name());
|
||||
this.template[EnumBeeChromosome.SPECIES.ordinal()] = this;
|
||||
return this.template;
|
||||
}
|
||||
|
||||
public void importTemplate(final BeeDefinition species) {
|
||||
this.importTemplate(species.getTemplate());
|
||||
}
|
||||
|
||||
public void importTemplate(final ExtraBeesSpecies species) {
|
||||
this.importTemplate(species.getTemplate());
|
||||
}
|
||||
|
||||
public void importTemplate(final IAllele[] template) {
|
||||
IAllele[] templateCopy = template.clone();
|
||||
this.setHumidity(((IAlleleSpecies) template[0]).getHumidity());
|
||||
this.setTemperature(((IAlleleSpecies) template[0]).getTemperature());
|
||||
this.setSecondaryColor(((IAlleleSpecies) template[0]).getSpriteColour(1));
|
||||
templateCopy[EnumBeeChromosome.SPECIES.ordinal()] = this;
|
||||
this.template = templateCopy;
|
||||
}
|
||||
|
||||
public void setRecessive() {
|
||||
this.dominant = false;
|
||||
}
|
||||
|
||||
public void setIsSecret(final boolean secret) {
|
||||
this.isSecret = secret;
|
||||
}
|
||||
|
||||
public void setHasEffect() {
|
||||
this.hasEffect = true;
|
||||
}
|
||||
|
||||
public void setSecondaryColor(final int colour) {
|
||||
this.secondaryColor = colour;
|
||||
}
|
||||
|
||||
public static void doInit() {
|
||||
final int aridBody = 13362036;
|
||||
final int rockBody = 10066329;
|
||||
@@ -915,13 +765,174 @@ public enum ExtraBeesSpecies implements IAlleleBeeSpecies {
|
||||
species2.registerTemplate();
|
||||
ExtraBees.proxy.registerBeeModel(species2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return ExtraBees.proxy.localise(getUnlocalizedName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return ExtraBees.proxy.localise(getUID() + ".desc");
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumTemperature getTemperature() {
|
||||
return this.temperature;
|
||||
}
|
||||
|
||||
private void setTemperature(final EnumTemperature temperature) {
|
||||
this.temperature = temperature;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumHumidity getHumidity() {
|
||||
return this.humidity;
|
||||
}
|
||||
|
||||
private void setHumidity(final EnumHumidity humidity) {
|
||||
this.humidity = humidity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasEffect() {
|
||||
return this.hasEffect;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSecret() {
|
||||
return this.isSecret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCounted() {
|
||||
return this.isCounted;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBinomial() {
|
||||
return this.binomial;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAuthority() {
|
||||
return "Binnie";
|
||||
}
|
||||
|
||||
@Override
|
||||
public IClassification getBranch() {
|
||||
return this.branch;
|
||||
}
|
||||
|
||||
void setBranch(final IClassification branch) {
|
||||
this.branch = branch;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUID() {
|
||||
return "extrabees.species." + this.uid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDominant() {
|
||||
return this.dominant;
|
||||
}
|
||||
|
||||
public Map<ItemStack, Float> getProducts() {
|
||||
return this.products;
|
||||
}
|
||||
|
||||
public Map<ItemStack, Float> getSpecialty() {
|
||||
return this.specialties;
|
||||
}
|
||||
|
||||
private void setState(final State state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public void registerTemplate() {
|
||||
Utils.getBeeRoot().registerTemplate(this.getTemplate());
|
||||
if (this.state != State.Active) {
|
||||
AlleleManager.alleleRegistry.blacklistAllele(this.getUID());
|
||||
}
|
||||
}
|
||||
|
||||
public void addProduct(final ItemStack product, final Float chance) {
|
||||
if (product.isEmpty()) {
|
||||
this.setState(State.Inactive);
|
||||
} else {
|
||||
this.products.put(product, chance);
|
||||
this.allProducts.put(product, chance);
|
||||
}
|
||||
}
|
||||
|
||||
public void addProduct(final IEBEnumItem product, final Float chance) {
|
||||
if (product.isActive()) {
|
||||
this.addProduct(product.get(1), chance);
|
||||
} else {
|
||||
this.allProducts.put(product.get(1), chance);
|
||||
this.setState(State.Inactive);
|
||||
}
|
||||
}
|
||||
|
||||
public void addSpecialty(final ItemStack product, final Float chance) {
|
||||
if (product.isEmpty()) {
|
||||
this.setState(State.Inactive);
|
||||
} else {
|
||||
this.specialties.put(product, chance);
|
||||
this.allSpecialties.put(product, chance);
|
||||
}
|
||||
}
|
||||
|
||||
private void addSpecialty(final IEBEnumItem product, final Float chance) {
|
||||
if (product.isActive()) {
|
||||
this.addSpecialty(product.get(1), chance);
|
||||
} else {
|
||||
this.setState(State.Inactive);
|
||||
this.allSpecialties.put(product.get(1), chance);
|
||||
}
|
||||
}
|
||||
|
||||
public IAllele[] getTemplate() {
|
||||
Preconditions.checkState(this.template != null, "Species Template has not been set: %s", name());
|
||||
this.template[EnumBeeChromosome.SPECIES.ordinal()] = this;
|
||||
return this.template;
|
||||
}
|
||||
|
||||
public void importTemplate(final BeeDefinition species) {
|
||||
this.importTemplate(species.getTemplate());
|
||||
}
|
||||
|
||||
public void importTemplate(final ExtraBeesSpecies species) {
|
||||
this.importTemplate(species.getTemplate());
|
||||
}
|
||||
|
||||
public void importTemplate(final IAllele[] template) {
|
||||
IAllele[] templateCopy = template.clone();
|
||||
this.setHumidity(((IAlleleSpecies) template[0]).getHumidity());
|
||||
this.setTemperature(((IAlleleSpecies) template[0]).getTemperature());
|
||||
this.setSecondaryColor(((IAlleleSpecies) template[0]).getSpriteColour(1));
|
||||
templateCopy[EnumBeeChromosome.SPECIES.ordinal()] = this;
|
||||
this.template = templateCopy;
|
||||
}
|
||||
|
||||
public void setRecessive() {
|
||||
this.dominant = false;
|
||||
}
|
||||
|
||||
public void setIsSecret(final boolean secret) {
|
||||
this.isSecret = secret;
|
||||
}
|
||||
|
||||
public void setHasEffect() {
|
||||
this.hasEffect = true;
|
||||
}
|
||||
|
||||
public void setSecondaryColor(final int colour) {
|
||||
this.secondaryColor = colour;
|
||||
}
|
||||
|
||||
public boolean isJubilant(final World world, final int biomeid, final int x, final int y, final int z) {
|
||||
return true;
|
||||
}
|
||||
@@ -931,49 +942,49 @@ public enum ExtraBeesSpecies implements IAlleleBeeSpecies {
|
||||
return true;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public int getIconColour(final int renderPass) {
|
||||
// return (renderPass == 0) ? this.primaryColor : ((renderPass == 1) ? this.secondaryColor : 16777215);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public IIconProvider getIconProvider() {
|
||||
// return this;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public IIcon getIcon(final short texUID) {
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// public void registerIcons(final IIconRegister register) {
|
||||
// String iconType = "default";
|
||||
// String mod = "forestry";
|
||||
// if (this == ExtraBeesSpecies.JADED) {
|
||||
// iconType = "jaded";
|
||||
// mod = "extrabees";
|
||||
// }
|
||||
// this.icons = new IIcon[EnumBeeType.values().length][3];
|
||||
// final IIcon body1 = BinnieCore.proxy.getIcon(register, mod, "bees/" + iconType + "/body1");
|
||||
// for (int i = 0; i < EnumBeeType.values().length; ++i) {
|
||||
// if (EnumBeeType.values()[i] != EnumBeeType.NONE) {
|
||||
// this.icons[i][0] = BinnieCore.proxy.getIcon(register, mod, "bees/" + iconType + "/" + EnumBeeType.values()[i].toString().toLowerCase(Locale.ENGLISH) + ".outline");
|
||||
// this.icons[i][1] = ((EnumBeeType.values()[i] != EnumBeeType.LARVAE) ? body1 : BinnieCore.proxy.getIcon(register, mod, "bees/" + iconType + "/" + EnumBeeType.values()[i].toString().toLowerCase(Locale.ENGLISH) + ".body"));
|
||||
// this.icons[i][2] = BinnieCore.proxy.getIcon(register, mod, "bees/" + iconType + "/" + EnumBeeType.values()[i].toString().toLowerCase(Locale.ENGLISH) + ".body2");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// public IIcon getIcon(final EnumBeeType type, final int renderPass) {
|
||||
// if (this.icons == null) {
|
||||
// return ExtraBeesSpecies.ARID.getIcon(type, renderPass);
|
||||
// }
|
||||
// return this.icons[type.ordinal()][renderPass];
|
||||
// }
|
||||
/*@Override
|
||||
public int getIconColour(final int renderPass) {
|
||||
return (renderPass == 0) ? this.primaryColor : ((renderPass == 1) ? this.secondaryColor : 16777215);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIconProvider getIconProvider() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(final short texUID) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(final IIconRegister register) {
|
||||
String iconType = "default";
|
||||
String mod = "forestry";
|
||||
if (this == ExtraBeesSpecies.JADED) {
|
||||
iconType = "jaded";
|
||||
mod = "extrabees";
|
||||
}
|
||||
this.icons = new IIcon[EnumBeeType.values().length][3];
|
||||
final IIcon body1 = BinnieCore.proxy.getIcon(register, mod, "bees/" + iconType + "/body1");
|
||||
for (int i = 0; i < EnumBeeType.values().length; ++i) {
|
||||
if (EnumBeeType.values()[i] != EnumBeeType.NONE) {
|
||||
this.icons[i][0] = BinnieCore.proxy.getIcon(register, mod, "bees/" + iconType + "/" + EnumBeeType.values()[i].toString().toLowerCase(Locale.ENGLISH) + ".outline");
|
||||
this.icons[i][1] = ((EnumBeeType.values()[i] != EnumBeeType.LARVAE) ? body1 : BinnieCore.proxy.getIcon(register, mod, "bees/" + iconType + "/" + EnumBeeType.values()[i].toString().toLowerCase(Locale.ENGLISH) + ".body"));
|
||||
this.icons[i][2] = BinnieCore.proxy.getIcon(register, mod, "bees/" + iconType + "/" + EnumBeeType.values()[i].toString().toLowerCase(Locale.ENGLISH) + ".body2");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(final EnumBeeType type, final int renderPass) {
|
||||
if (this.icons == null) {
|
||||
return ExtraBeesSpecies.ARID.getIcon(type, renderPass);
|
||||
}
|
||||
return this.icons[type.ordinal()][renderPass];
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public IBeeRoot getRoot() {
|
||||
@@ -1118,7 +1129,6 @@ public enum ExtraBeesSpecies implements IAlleleBeeSpecies {
|
||||
return bounty;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getComplexity() {
|
||||
return 1 + this.getGeneticAdvancement(this, new ArrayList<>());
|
||||
@@ -1161,12 +1171,6 @@ public enum ExtraBeesSpecies implements IAlleleBeeSpecies {
|
||||
return this.getSpecialty();
|
||||
}
|
||||
|
||||
public enum State {
|
||||
Active,
|
||||
Inactive,
|
||||
Deprecated;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSpriteColour(int renderPass) {
|
||||
return (renderPass == 0) ? this.primaryColor : ((renderPass == 1) ? this.secondaryColor : 16777215);
|
||||
@@ -1184,4 +1188,9 @@ public enum ExtraBeesSpecies implements IAlleleBeeSpecies {
|
||||
BeeModelProvider.instance.registerModels(item, manager);
|
||||
}
|
||||
|
||||
public enum State {
|
||||
Active,
|
||||
Inactive,
|
||||
Deprecated,
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,8 @@ import java.util.List;
|
||||
|
||||
public class EntityBeeLightning extends EntityLightningBolt {
|
||||
|
||||
private int lightningState;
|
||||
private int boltLivingTime;
|
||||
|
||||
public EntityBeeLightning(final World world) {
|
||||
super(world, 0, 0, 0, true);
|
||||
@@ -23,9 +25,6 @@ public class EntityBeeLightning extends EntityLightningBolt {
|
||||
this.boltLivingTime = this.rand.nextInt(3) + 1;
|
||||
}
|
||||
|
||||
private int lightningState;
|
||||
private int boltLivingTime;
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
this.onEntityUpdate();
|
||||
@@ -60,5 +59,4 @@ public class EntityBeeLightning extends EntityLightningBolt {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,7 +3,11 @@ package binnie.extrabees.genetics.effect;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.extrabees.genetics.ExtraBeesFlowers;
|
||||
import binnie.extrabees.utils.Utils;
|
||||
import forestry.api.apiculture.*;
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
import forestry.api.apiculture.IAlleleBeeEffect;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.apiculture.IBeekeepingLogic;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
import forestry.core.render.ParticleRender;
|
||||
@@ -72,17 +76,18 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
||||
BonemealMushroom,
|
||||
Power;
|
||||
|
||||
private String fx;
|
||||
private boolean combinable;
|
||||
private boolean dominant;
|
||||
private int id;
|
||||
private String uid;
|
||||
private static final List<Birthday> birthdays = new ArrayList<>();
|
||||
|
||||
static {
|
||||
birthdays.add(new Birthday(3, 10, "Binnie"));
|
||||
}
|
||||
|
||||
private String fx;
|
||||
private boolean combinable;
|
||||
private boolean dominant;
|
||||
private int id;
|
||||
private String uid;
|
||||
|
||||
ExtraBeesEffect() {
|
||||
this.fx = "";
|
||||
this.uid = this.toString().toLowerCase();
|
||||
@@ -106,8 +111,18 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
||||
}
|
||||
}
|
||||
|
||||
private void setFX(final String string) {
|
||||
this.fx = "particles/" + string;
|
||||
public static void doAcid(final World world, final BlockPos pos) {
|
||||
final IBlockState blockState = world.getBlockState(pos);
|
||||
final Block block = blockState.getBlock();
|
||||
if (block == Blocks.COBBLESTONE || block == Blocks.STONE) {
|
||||
world.setBlockState(pos, Blocks.GRAVEL.getDefaultState());
|
||||
} else if (block == Blocks.DIRT | block == Blocks.GRASS) {
|
||||
world.setBlockState(pos, Blocks.SAND.getDefaultState());
|
||||
}
|
||||
}
|
||||
|
||||
public static int wearsItems(final EntityPlayer player) {
|
||||
return BeeManager.armorApiaristHelper.wearsItems(player, "", false);
|
||||
}
|
||||
|
||||
public void register() {
|
||||
@@ -163,16 +178,6 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
||||
return world.getClosestPlayer(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, distance, false) != null;
|
||||
}
|
||||
|
||||
public static void doAcid(final World world, final BlockPos pos) {
|
||||
final IBlockState blockState = world.getBlockState(pos);
|
||||
final Block block = blockState.getBlock();
|
||||
if (block == Blocks.COBBLESTONE || block == Blocks.STONE) {
|
||||
world.setBlockState(pos, Blocks.GRAVEL.getDefaultState());
|
||||
} else if (block == Blocks.DIRT | block == Blocks.GRASS) {
|
||||
world.setBlockState(pos, Blocks.SAND.getDefaultState());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUID() {
|
||||
return "extrabees.effect." + this.uid;
|
||||
@@ -472,9 +477,9 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
||||
protected Vec3i getModifiedArea(final IBeeGenome genome, final IBeeHousing housing) {
|
||||
Vec3i territory = genome.getTerritory();
|
||||
territory = new Vec3i(
|
||||
territory.getX() * (int) (BeeManager.beeRoot.createBeeHousingModifier(housing).getTerritoryModifier(genome, 1.0f) * 3.0f),
|
||||
territory.getY() * (int) (BeeManager.beeRoot.createBeeHousingModifier(housing).getTerritoryModifier(genome, 1.0f) * 3.0f),
|
||||
territory.getZ() * (int) (BeeManager.beeRoot.createBeeHousingModifier(housing).getTerritoryModifier(genome, 1.0f) * 3.0f)
|
||||
territory.getX() * (int) (BeeManager.beeRoot.createBeeHousingModifier(housing).getTerritoryModifier(genome, 1.0f) * 3.0f),
|
||||
territory.getY() * (int) (BeeManager.beeRoot.createBeeHousingModifier(housing).getTerritoryModifier(genome, 1.0f) * 3.0f),
|
||||
territory.getZ() * (int) (BeeManager.beeRoot.createBeeHousingModifier(housing).getTerritoryModifier(genome, 1.0f) * 3.0f)
|
||||
);
|
||||
if (territory.getX() < 1) {
|
||||
territory = new Vec3i(1, territory.getY(), territory.getZ());
|
||||
@@ -501,6 +506,10 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
||||
return this.fx;
|
||||
}
|
||||
|
||||
private void setFX(final String string) {
|
||||
this.fx = "particles/" + string;
|
||||
}
|
||||
|
||||
public <T extends Entity> List<T> getEntities(final Class<T> eClass, final IBeeGenome genome, final IBeeHousing housing) {
|
||||
final Vec3i area = genome.getTerritory();
|
||||
final int[] offset = {-Math.round(area.getX() / 2), -Math.round(area.getY() / 2), -Math.round(area.getZ() / 2)};
|
||||
@@ -510,10 +519,6 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
||||
return housing.getWorldObj().getEntitiesWithinAABB(eClass, box);
|
||||
}
|
||||
|
||||
public static int wearsItems(final EntityPlayer player) {
|
||||
return BeeManager.armorApiaristHelper.wearsItems(player, "", false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName() {
|
||||
return this.getUID();
|
||||
@@ -521,16 +526,16 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
||||
|
||||
public static class Birthday {
|
||||
|
||||
private final int month;
|
||||
private final int date;
|
||||
private final String name;
|
||||
|
||||
private Birthday(final int month, final int date, final String name) {
|
||||
this.month = month;
|
||||
this.date = date + 1;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
private final int month;
|
||||
private final int date;
|
||||
private final String name;
|
||||
|
||||
public boolean isToday() {
|
||||
return Calendar.getInstance().get(Calendar.DATE) == this.date && Calendar.getInstance().get(Calendar.MONTH) == this.month;
|
||||
}
|
||||
@@ -538,6 +543,5 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,11 @@ public class FireworkCreator {
|
||||
|
||||
public static class Firework {
|
||||
|
||||
boolean flicker;
|
||||
boolean trail;
|
||||
ArrayList<Integer> colors;
|
||||
byte shape;
|
||||
|
||||
public Firework() {
|
||||
this.flicker = false;
|
||||
this.trail = false;
|
||||
@@ -26,11 +31,6 @@ public class FireworkCreator {
|
||||
this.shape = 0;
|
||||
}
|
||||
|
||||
boolean flicker;
|
||||
boolean trail;
|
||||
ArrayList<Integer> colors;
|
||||
byte shape;
|
||||
|
||||
public void setFlicker() {
|
||||
this.flicker = true;
|
||||
}
|
||||
@@ -79,7 +79,5 @@ public class FireworkCreator {
|
||||
item.setTagCompound(var15);
|
||||
return item;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,32 +14,29 @@ import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import forestry.apiculture.genetics.BeeDefinition;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 12-5-2017.
|
||||
*/
|
||||
public final class BlockRegister {
|
||||
|
||||
public static void preInitBlocks(){
|
||||
public static void preInitBlocks() {
|
||||
registerHives();
|
||||
registerMisc();
|
||||
ExtraBees.alveary = ExtraBees.proxy.registerBlock(new BlockAlveary());
|
||||
GameRegistry.registerTileEntity(TileEntityExtraBeesAlvearyPart.class, "TileEntityExtraBeesAlvearyPart");
|
||||
}
|
||||
|
||||
public static void postInitBlocks(){
|
||||
public static void postInitBlocks() {
|
||||
registerHiveDrops();
|
||||
}
|
||||
|
||||
private static void registerMisc(){
|
||||
private static void registerMisc() {
|
||||
GameRegistry.register(ExtraBees.ectoplasm = new BlockEctoplasm());
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
private static void registerHives(){
|
||||
private static void registerHives() {
|
||||
GameRegistry.register(ExtraBees.hive = new BlockExtraBeeHive());
|
||||
}
|
||||
|
||||
private static void registerHiveDrops(){
|
||||
private static void registerHiveDrops() {
|
||||
IAlleleBeeSpecies valiantSpecies = Utils.getSpecies(BeeDefinition.VALIANT);
|
||||
EnumHiveType.Water.drops.add(new HiveDrop(ExtraBeesSpecies.WATER, 80));
|
||||
EnumHiveType.Water.drops.add(new HiveDrop(valiantSpecies, 3));
|
||||
@@ -55,5 +52,4 @@ public final class BlockRegister {
|
||||
//BuildCraftAPI.softBlocks.add(ExtraBees.hive);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,30 +4,26 @@ import binnie.extrabees.utils.ExtraBeesResourceLocation;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 12-5-2017.
|
||||
*/
|
||||
public final class FluidRegister {
|
||||
|
||||
//Fluids seem unused,
|
||||
//TODO: find out what they were used for
|
||||
public static Fluid acid, poison, liquid_nitrogen;
|
||||
|
||||
public static void preInitFluids(){
|
||||
public static void preInitFluids() {
|
||||
acid = createFluid("acid");
|
||||
poison = createFluid("poison");
|
||||
liquid_nitrogen = createFluid("liquidnitrogen");
|
||||
}
|
||||
|
||||
private static Fluid createFluid(String name){
|
||||
private static Fluid createFluid(String name) {
|
||||
name = name.toLowerCase();
|
||||
Fluid ret = new Fluid(name, new ExtraBeesResourceLocation("blocks/liquids/" + name), new ExtraBeesResourceLocation("blocks/liquids/" + name)){
|
||||
Fluid ret = new Fluid(name, new ExtraBeesResourceLocation("blocks/liquids/" + name), new ExtraBeesResourceLocation("blocks/liquids/" + name)) {
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return 16777215;
|
||||
}
|
||||
|
||||
};
|
||||
FluidRegistry.registerFluid(ret);
|
||||
return ret;
|
||||
@@ -97,6 +93,4 @@ public enum ExtraBeeLiquid implements ILiquidType {
|
||||
return this.colour;
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
}
|
||||
@@ -4,7 +4,13 @@ import binnie.extrabees.ExtraBees;
|
||||
import binnie.extrabees.alveary.BlockAlveary;
|
||||
import binnie.extrabees.alveary.EnumAlvearyLogicType;
|
||||
import binnie.extrabees.blocks.type.EnumHiveType;
|
||||
import binnie.extrabees.items.*;
|
||||
import binnie.extrabees.items.ItemBeehive;
|
||||
import binnie.extrabees.items.ItemHoneyComb;
|
||||
import binnie.extrabees.items.ItemHoneyCrystal;
|
||||
import binnie.extrabees.items.ItemHoneyCrystalEmpty;
|
||||
import binnie.extrabees.items.ItemHoneyDrop;
|
||||
import binnie.extrabees.items.ItemMiscProduct;
|
||||
import binnie.extrabees.items.ItemPropolis;
|
||||
import binnie.extrabees.items.types.EnumHiveFrame;
|
||||
import binnie.extrabees.items.types.EnumHoneyComb;
|
||||
import binnie.extrabees.items.types.ExtraBeeItems;
|
||||
@@ -16,20 +22,17 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 12-5-2017.
|
||||
*/
|
||||
public final class ItemRegister {
|
||||
|
||||
public static void preInitItems(){
|
||||
public static void preInitItems() {
|
||||
registerProducts();
|
||||
registerMisc();
|
||||
registerOreDict();
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
private static void registerMisc(){
|
||||
Item i = GameRegistry.register(new ItemBlock(ExtraBees.alveary){
|
||||
private static void registerMisc() {
|
||||
Item i = GameRegistry.register(new ItemBlock(ExtraBees.alveary) {
|
||||
|
||||
@Override
|
||||
public int getMetadata(int damage) {
|
||||
@@ -45,7 +48,6 @@ public final class ItemRegister {
|
||||
public boolean getHasSubtypes() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}.setRegistryName(ExtraBees.alveary.getRegistryName()));
|
||||
for (int j = 0; j < EnumAlvearyLogicType.VALUES.length; j++) {
|
||||
ExtraBees.proxy.registerModel(i, j);
|
||||
@@ -61,7 +63,7 @@ public final class ItemRegister {
|
||||
}
|
||||
}
|
||||
|
||||
private static void registerProducts(){
|
||||
private static void registerProducts() {
|
||||
ExtraBees.honeyCrystal = new ItemHoneyCrystal("honey_crystal");
|
||||
ExtraBees.honeyCrystalEmpty = new ItemHoneyCrystalEmpty("honey_crystal_empty");
|
||||
ExtraBees.honeyDrop = new ItemHoneyDrop();
|
||||
@@ -82,7 +84,7 @@ public final class ItemRegister {
|
||||
}
|
||||
}
|
||||
|
||||
private static void registerOreDict(){
|
||||
private static void registerOreDict() {
|
||||
OreDictionary.registerOre("ingotIron", Items.IRON_INGOT);
|
||||
OreDictionary.registerOre("ingotGold", Items.GOLD_INGOT);
|
||||
OreDictionary.registerOre("gemDiamond", Items.DIAMOND);
|
||||
@@ -97,5 +99,4 @@ public final class ItemRegister {
|
||||
|
||||
OreDictionary.registerOre("gearWood", ExtraBeeItems.ScentedGear.get(1));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,7 +5,11 @@ import binnie.extrabees.alveary.EnumAlvearyLogicType;
|
||||
import binnie.extrabees.circuit.AlvearySimulatorCircuitType;
|
||||
import binnie.extrabees.circuit.BinnieCircuitLayout;
|
||||
import binnie.extrabees.circuit.BinnieCircuitSocketType;
|
||||
import binnie.extrabees.items.types.*;
|
||||
import binnie.extrabees.items.types.EnumHiveFrame;
|
||||
import binnie.extrabees.items.types.EnumHoneyComb;
|
||||
import binnie.extrabees.items.types.EnumHoneyDrop;
|
||||
import binnie.extrabees.items.types.EnumPropolis;
|
||||
import binnie.extrabees.items.types.ExtraBeeItems;
|
||||
import binnie.extrabees.utils.Utils;
|
||||
import forestry.api.circuits.ICircuitLayout;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
@@ -21,12 +25,9 @@ import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 12-5-2017.
|
||||
*/
|
||||
public final class RecipeRegister {
|
||||
|
||||
public static void postInitRecipes(){
|
||||
public static void postInitRecipes() {
|
||||
GameRegistry.addRecipe(new ItemStack(ExtraBees.honeyCrystalEmpty), "#@#", "@#@", "#@#", '@', PluginApiculture.getItems().honeyDrop, '#', EnumHoneyDrop.ENERGY.get(1));
|
||||
for (final EnumHoneyComb info : EnumHoneyComb.values()) {
|
||||
info.addRecipe();
|
||||
@@ -43,7 +44,7 @@ public final class RecipeRegister {
|
||||
addAlvearyRecipes();
|
||||
}
|
||||
|
||||
private static void addAlvearyRecipes(){
|
||||
private static void addAlvearyRecipes() {
|
||||
ItemStack alveary = PluginApiculture.getBlocks().getAlvearyBlock(BlockAlvearyType.PLAIN);
|
||||
Item thermionicTubes = PluginCore.getItems().tubes;
|
||||
Item chipsets = PluginCore.getItems().circuitboards;
|
||||
@@ -61,15 +62,15 @@ public final class RecipeRegister {
|
||||
}
|
||||
}
|
||||
|
||||
private static ItemStack getAlvearyPart(EnumAlvearyLogicType type){
|
||||
private static ItemStack getAlvearyPart(EnumAlvearyLogicType type) {
|
||||
return new ItemStack(ExtraBees.alveary, 1, type.ordinal());
|
||||
}
|
||||
|
||||
private static void addForestryRecipes(){
|
||||
private static void addForestryRecipes() {
|
||||
RecipeManagers.carpenterManager.addRecipe(100, Utils.getFluidFromName("water", 2000), ItemStack.EMPTY, new ItemStack(ExtraBees.dictionary), "X#X", "YEY", "RDR", '#', Blocks.GLASS_PANE, 'X', Items.GOLD_INGOT, 'Y', "ingotTin", 'R', Items.REDSTONE, 'D', Items.DIAMOND, 'E', Items.EMERALD);
|
||||
}
|
||||
|
||||
private static void addMiscItemRecipes(){
|
||||
private static void addMiscItemRecipes() {
|
||||
final ItemStack lapisShard = ExtraBeeItems.LapisShard.get(1);
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Items.DYE, 1, 4), lapisShard, lapisShard, lapisShard, lapisShard);
|
||||
for (final ExtraBeeItems item : ExtraBeeItems.values()) {
|
||||
@@ -111,7 +112,5 @@ public final class RecipeRegister {
|
||||
gear = new ItemStack(woodGear, 1);
|
||||
}
|
||||
RecipeManagers.carpenterManager.addRecipe(100, Fluids.FOR_HONEY.getFluid(500), ItemStack.EMPTY, ExtraBeeItems.ScentedGear.get(1), " j ", "bgb", " p ", 'j', PluginApiculture.getItems().royalJelly, 'b', PluginCore.getItems().beeswax, 'p', PluginApiculture.getItems().pollenCluster, 'g', gear);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -37,5 +37,4 @@ public class ItemBeehive extends ItemBlock {
|
||||
public String getItemStackDisplayName(final ItemStack itemStack) {
|
||||
return EnumHiveType.values()[itemStack.getItemDamage()].toString() + " Hive";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,7 +2,11 @@ package binnie.extrabees.items;
|
||||
|
||||
import binnie.extrabees.items.types.EnumHiveFrame;
|
||||
import binnie.extrabees.utils.ExtraBeesResourceLocation;
|
||||
import forestry.api.apiculture.*;
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.apiculture.IHiveFrame;
|
||||
import forestry.api.core.IItemModelRegister;
|
||||
import forestry.api.core.IModelManager;
|
||||
import forestry.api.core.Tabs;
|
||||
@@ -20,6 +24,8 @@ import java.util.List;
|
||||
|
||||
public class ItemHiveFrame extends Item implements IHiveFrame, IBeeModifier, IItemModelRegister {
|
||||
|
||||
private final EnumHiveFrame frame;
|
||||
|
||||
public ItemHiveFrame(final EnumHiveFrame frame) {
|
||||
this.frame = frame;
|
||||
this.setMaxDamage(frame.getMaxDamage());
|
||||
@@ -28,8 +34,6 @@ public class ItemHiveFrame extends Item implements IHiveFrame, IBeeModifier, IIt
|
||||
this.setUnlocalizedName("hive_frame");
|
||||
}
|
||||
|
||||
private final EnumHiveFrame frame;
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(final ItemStack itemStack) {
|
||||
return this.frame.getName();
|
||||
@@ -115,5 +119,4 @@ public class ItemHiveFrame extends Item implements IHiveFrame, IBeeModifier, IIt
|
||||
public IBeeModifier getBeeModifier() {
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -264,5 +264,4 @@ public class ItemHoneyComb extends ItemProduct implements IColoredItem {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,6 +7,11 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemHoneyCrystal extends Item {
|
||||
|
||||
//TODO: Usage??
|
||||
private int maxCharge;
|
||||
private int transferLimit;
|
||||
private int tier;
|
||||
|
||||
public ItemHoneyCrystal(String name) {
|
||||
this.maxCharge = 8000;
|
||||
this.transferLimit = 500;
|
||||
@@ -19,14 +24,8 @@ public class ItemHoneyCrystal extends Item {
|
||||
ExtraBees.proxy.registerModel(this, 0);
|
||||
}
|
||||
|
||||
//TODO: Usage??
|
||||
private int maxCharge;
|
||||
private int transferLimit;
|
||||
private int tier;
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(final ItemStack i) {
|
||||
return ExtraBees.proxy.localise("item.honeycrystal");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -16,5 +16,4 @@ public class ItemHoneyCrystalEmpty extends ItemHoneyCrystal {
|
||||
public String getItemStackDisplayName(final ItemStack i) {
|
||||
return ExtraBees.proxy.localise("item.honeycrystal.empty");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,7 +5,6 @@ import forestry.api.core.Tabs;
|
||||
import forestry.core.items.IColoredItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
|
||||
public class ItemHoneyDrop extends ItemProduct implements IColoredItem {
|
||||
|
||||
public ItemHoneyDrop() {
|
||||
@@ -13,7 +12,6 @@ public class ItemHoneyDrop extends ItemProduct implements IColoredItem {
|
||||
this.setCreativeTab(Tabs.tabApiculture);
|
||||
this.setUnlocalizedName("honey_drop");
|
||||
setRegistryName("honey_drop");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -23,5 +21,4 @@ public class ItemHoneyDrop extends ItemProduct implements IColoredItem {
|
||||
}
|
||||
return EnumHoneyDrop.get(itemStack).getColour()[1];
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,6 +15,22 @@ import java.util.List;
|
||||
|
||||
public class ItemIndustrialFrame extends Item {
|
||||
|
||||
public ItemIndustrialFrame() {
|
||||
this.setCreativeTab(CreativeTabs.MISC);
|
||||
this.setMaxDamage(400);
|
||||
this.setMaxStackSize(1);
|
||||
this.setUnlocalizedName("industrialFrame");
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static IndustrialFrame getFrame(final ItemStack stack) {
|
||||
NBTTagCompound tagCompound = stack.getTagCompound();
|
||||
if (tagCompound == null || !tagCompound.hasKey("frame")) {
|
||||
return null;
|
||||
}
|
||||
return IndustrialFrame.values()[tagCompound.getInteger("frame")];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(final Item itemIn, final CreativeTabs tab, final NonNullList<ItemStack> subItems) {
|
||||
@@ -43,21 +59,4 @@ public class ItemIndustrialFrame extends Item {
|
||||
public String getItemStackDisplayName(final ItemStack itemStack) {
|
||||
return "Industrial Frame";
|
||||
}
|
||||
|
||||
public ItemIndustrialFrame() {
|
||||
this.setCreativeTab(CreativeTabs.MISC);
|
||||
this.setMaxDamage(400);
|
||||
this.setMaxStackSize(1);
|
||||
this.setUnlocalizedName("industrialFrame");
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static IndustrialFrame getFrame(final ItemStack stack) {
|
||||
NBTTagCompound tagCompound = stack.getTagCompound();
|
||||
if (tagCompound == null || !tagCompound.hasKey("frame")) {
|
||||
return null;
|
||||
}
|
||||
return IndustrialFrame.values()[tagCompound.getInteger("frame")];
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,9 +15,6 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 13-5-2017.
|
||||
*/
|
||||
public class ItemMiscProduct extends ItemProduct {
|
||||
|
||||
public ItemMiscProduct(CreativeTabs tab, IEBItemMiscProvider[] types) {
|
||||
@@ -41,5 +38,4 @@ public class ItemMiscProduct extends ItemProduct {
|
||||
ModelLoader.setCustomModelResourceLocation(item, type.ordinal(), new ModelResourceLocation(new ExtraBeesResourceLocation("misc/" + ((IEBItemMiscProvider) type).getModelPath()), "inventory"));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,6 +14,8 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemProduct extends Item implements IItemModelRegister {
|
||||
|
||||
protected IEBEnumItem[] types;
|
||||
|
||||
public ItemProduct(final IEBEnumItem[] types) {
|
||||
this.setMaxStackSize(64);
|
||||
this.setMaxDamage(0);
|
||||
@@ -21,8 +23,6 @@ public class ItemProduct extends Item implements IItemModelRegister {
|
||||
this.types = types;
|
||||
}
|
||||
|
||||
protected IEBEnumItem[] types;
|
||||
|
||||
public IEBEnumItem get(final ItemStack stack) {
|
||||
final int i = stack.getItemDamage();
|
||||
if (i >= 0 && i < this.types.length) {
|
||||
@@ -53,5 +53,4 @@ public class ItemProduct extends Item implements IItemModelRegister {
|
||||
ModelLoader.setCustomModelResourceLocation(item, type.ordinal(), new ModelResourceLocation(getRegistryName(), "inventory"));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -21,5 +21,4 @@ public class ItemPropolis extends ItemProduct implements IColoredItem {
|
||||
}
|
||||
return EnumPropolis.get(itemStack).colour[1];
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,7 +5,11 @@ import binnie.extrabees.items.ItemHiveFrame;
|
||||
import binnie.extrabees.utils.BeeModifierLogic;
|
||||
import binnie.extrabees.utils.EnumBeeBooleanModifier;
|
||||
import binnie.extrabees.utils.EnumBeeModifier;
|
||||
import forestry.api.apiculture.*;
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.apiculture.IHiveFrame;
|
||||
import forestry.apiculture.PluginApiculture;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
@@ -27,6 +31,20 @@ public enum EnumHiveFrame implements IHiveFrame, IBeeModifier {
|
||||
Clay,
|
||||
Debug;
|
||||
|
||||
private final Item item;
|
||||
private final int maxDamage;
|
||||
private final BeeModifierLogic logic;
|
||||
|
||||
EnumHiveFrame() {
|
||||
this(240);
|
||||
}
|
||||
|
||||
EnumHiveFrame(int maxDamage) {
|
||||
this.maxDamage = maxDamage;
|
||||
this.logic = new BeeModifierLogic();
|
||||
this.item = new ItemHiveFrame(this).setRegistryName("hive_frame." + name().toLowerCase());
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
EnumHiveFrame.Cocoa.logic.setModifier(EnumBeeModifier.Lifespan, 0.75f, 0.25f);
|
||||
EnumHiveFrame.Cocoa.logic.setModifier(EnumBeeModifier.Production, 1.5f, 5.0f);
|
||||
@@ -47,20 +65,6 @@ public enum EnumHiveFrame implements IHiveFrame, IBeeModifier {
|
||||
GameRegistry.addRecipe(new ItemStack(EnumHiveFrame.Clay.item), " c ", "cFc", " c ", 'F', impregnatedFrame, 'c', Items.CLAY_BALL);
|
||||
}
|
||||
|
||||
EnumHiveFrame() {
|
||||
this(240);
|
||||
}
|
||||
|
||||
EnumHiveFrame(int maxDamage) {
|
||||
this.maxDamage = maxDamage;
|
||||
this.logic = new BeeModifierLogic();
|
||||
this.item = new ItemHiveFrame(this).setRegistryName("hive_frame." + name().toLowerCase());
|
||||
}
|
||||
|
||||
private final Item item;
|
||||
private final int maxDamage;
|
||||
private final BeeModifierLogic logic;
|
||||
|
||||
public int getIconIndex() {
|
||||
return 55 + this.ordinal();
|
||||
}
|
||||
|
||||
@@ -101,6 +101,11 @@ public enum EnumHoneyComb implements IEBEnumItem {
|
||||
CYANITE(2564173, 34541),
|
||||
BLUTONIUM(2564173, 1769702);
|
||||
|
||||
public int[] colour;
|
||||
public Map<ItemStack, Float> products;
|
||||
public boolean active;
|
||||
public boolean deprecated;
|
||||
|
||||
EnumHoneyComb() {
|
||||
this(16777215, 16777215);
|
||||
this.active = false;
|
||||
@@ -115,10 +120,13 @@ public enum EnumHoneyComb implements IEBEnumItem {
|
||||
this.colour = new int[]{colour, colour2};
|
||||
}
|
||||
|
||||
public int[] colour;
|
||||
public Map<ItemStack, Float> products;
|
||||
public boolean active;
|
||||
public boolean deprecated;
|
||||
public static EnumHoneyComb get(final ItemStack itemStack) {
|
||||
final int i = itemStack.getItemDamage();
|
||||
if (i >= 0 && i < values().length) {
|
||||
return values()[i];
|
||||
}
|
||||
return values()[0];
|
||||
}
|
||||
|
||||
public void addRecipe() {
|
||||
RecipeManagers.centrifugeManager.addRecipe(20, this.get(1), this.products);
|
||||
@@ -129,14 +137,6 @@ public enum EnumHoneyComb implements IEBEnumItem {
|
||||
return this.active;
|
||||
}
|
||||
|
||||
public static EnumHoneyComb get(final ItemStack itemStack) {
|
||||
final int i = itemStack.getItemDamage();
|
||||
if (i >= 0 && i < values().length) {
|
||||
return values()[i];
|
||||
}
|
||||
return values()[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack get(final int size) {
|
||||
return new ItemStack(ExtraBees.comb, size, this.ordinal());
|
||||
@@ -147,7 +147,7 @@ public enum EnumHoneyComb implements IEBEnumItem {
|
||||
return ExtraBees.proxy.localise("item.comb." + this.name().toLowerCase());
|
||||
}
|
||||
|
||||
public boolean addProduct(@Nullable Item item, final Float chance){
|
||||
public boolean addProduct(@Nullable Item item, final Float chance) {
|
||||
return addProduct(new ItemStack(Objects.firstNonNull(item, Item.getItemFromBlock(Blocks.AIR))), chance);
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,10 @@ public enum EnumHoneyDrop implements IEBEnumItem {
|
||||
MAGENTA(15040472, 16711884, "for.honey"),
|
||||
LIGHTGRAY(10066329, 13224393, "for.honey");
|
||||
|
||||
private int[] colour;
|
||||
private String liquidName;
|
||||
private ItemStack remnant;
|
||||
|
||||
EnumHoneyDrop() {
|
||||
this(16777215, 16777215, "");
|
||||
}
|
||||
@@ -49,9 +53,13 @@ public enum EnumHoneyDrop implements IEBEnumItem {
|
||||
this.liquidName = liquid;
|
||||
}
|
||||
|
||||
private int[] colour;
|
||||
private String liquidName;
|
||||
private ItemStack remnant;
|
||||
public static EnumHoneyDrop get(final ItemStack itemStack) {
|
||||
final int i = itemStack.getItemDamage();
|
||||
if (i >= 0 && i < values().length) {
|
||||
return values()[i];
|
||||
}
|
||||
return values()[0];
|
||||
}
|
||||
|
||||
public void addRemnant(final ItemStack stack) {
|
||||
this.remnant = stack;
|
||||
@@ -69,14 +77,6 @@ public enum EnumHoneyDrop implements IEBEnumItem {
|
||||
return !this.remnant.isEmpty() && FluidRegistry.isFluidRegistered(this.getLiquidName());
|
||||
}
|
||||
|
||||
public static EnumHoneyDrop get(final ItemStack itemStack) {
|
||||
final int i = itemStack.getItemDamage();
|
||||
if (i >= 0 && i < values().length) {
|
||||
return values()[i];
|
||||
}
|
||||
return values()[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack get(final int size) {
|
||||
return new ItemStack(ExtraBees.honeyDrop, size, this.ordinal());
|
||||
|
||||
@@ -18,6 +18,10 @@ public enum EnumPropolis implements IEBEnumItem {
|
||||
GLACIAL,
|
||||
PEAT;
|
||||
|
||||
public int[] colour;
|
||||
public String liquidName;
|
||||
public boolean active;
|
||||
|
||||
EnumPropolis() {
|
||||
this(16777215, 16777215, "");
|
||||
this.active = false;
|
||||
@@ -30,9 +34,13 @@ public enum EnumPropolis implements IEBEnumItem {
|
||||
this.liquidName = liquid;
|
||||
}
|
||||
|
||||
public int[] colour;
|
||||
public String liquidName;
|
||||
public boolean active;
|
||||
public static EnumPropolis get(final ItemStack itemStack) {
|
||||
final int i = itemStack.getItemDamage();
|
||||
if (i >= 0 && i < values().length) {
|
||||
return values()[i];
|
||||
}
|
||||
return values()[0];
|
||||
}
|
||||
|
||||
public void addRecipe() {
|
||||
final FluidStack liquid = Utils.getFluidFromName(this.liquidName, 500);
|
||||
@@ -46,14 +54,6 @@ public enum EnumPropolis implements IEBEnumItem {
|
||||
return this.active && Utils.getFluidFromName(this.liquidName, 100) != null;
|
||||
}
|
||||
|
||||
public static EnumPropolis get(final ItemStack itemStack) {
|
||||
final int i = itemStack.getItemDamage();
|
||||
if (i >= 0 && i < values().length) {
|
||||
return values()[i];
|
||||
}
|
||||
return values()[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack get(final int size) {
|
||||
return new ItemStack(ExtraBees.propolis, size, this.ordinal());
|
||||
|
||||
@@ -40,11 +40,26 @@ public enum ExtraBeeItems implements IEBItemMiscProvider {
|
||||
BlutoniumDust("Blutonium Grains", "blutonium_dust"),
|
||||
CyaniteDust("Cyanite Grains", "cyanite_dust");
|
||||
|
||||
ExtraBeeItems(String name, String modelPath) {
|
||||
this.metalString = null;
|
||||
this.gemString = null;
|
||||
this.name = name;
|
||||
this.modelPath = modelPath;
|
||||
static {
|
||||
ExtraBeeItems.TinDust.setMetal("Tin");
|
||||
ExtraBeeItems.ZincDust.setMetal("Zinc");
|
||||
ExtraBeeItems.CopperDust.setMetal("Copper");
|
||||
ExtraBeeItems.IronDust.setMetal("Iron");
|
||||
ExtraBeeItems.NickelDust.setMetal("Nickel");
|
||||
ExtraBeeItems.LeadDust.setMetal("Lead");
|
||||
ExtraBeeItems.SilverDust.setMetal("Silver");
|
||||
ExtraBeeItems.GoldDust.setMetal("Gold");
|
||||
ExtraBeeItems.PlatinumDust.setMetal("Platinum");
|
||||
ExtraBeeItems.TungstenDust.setMetal("Tungsten");
|
||||
ExtraBeeItems.TitaniumDust.setMetal("Titanium");
|
||||
ExtraBeeItems.CoalDust.setMetal("Coal");
|
||||
ExtraBeeItems.YelloriumDust.setMetal("Yellorium");
|
||||
ExtraBeeItems.BlutoniumDust.setMetal("Blutonium");
|
||||
ExtraBeeItems.CyaniteDust.setMetal("Cyanite");
|
||||
ExtraBeeItems.DiamondShard.setGem("Diamond");
|
||||
ExtraBeeItems.EmeraldShard.setGem("Emerald");
|
||||
ExtraBeeItems.RubyShard.setGem("Ruby");
|
||||
ExtraBeeItems.SapphireShard.setGem("Sapphire");
|
||||
}
|
||||
|
||||
public final String name;
|
||||
@@ -54,6 +69,13 @@ public enum ExtraBeeItems implements IEBItemMiscProvider {
|
||||
@Nullable
|
||||
public String gemString;
|
||||
|
||||
ExtraBeeItems(String name, String modelPath) {
|
||||
this.metalString = null;
|
||||
this.gemString = null;
|
||||
this.name = name;
|
||||
this.modelPath = modelPath;
|
||||
}
|
||||
|
||||
private void setGem(final String string) {
|
||||
this.gemString = string;
|
||||
}
|
||||
@@ -89,26 +111,4 @@ public enum ExtraBeeItems implements IEBItemMiscProvider {
|
||||
return modelPath;
|
||||
}
|
||||
|
||||
static {
|
||||
ExtraBeeItems.TinDust.setMetal("Tin");
|
||||
ExtraBeeItems.ZincDust.setMetal("Zinc");
|
||||
ExtraBeeItems.CopperDust.setMetal("Copper");
|
||||
ExtraBeeItems.IronDust.setMetal("Iron");
|
||||
ExtraBeeItems.NickelDust.setMetal("Nickel");
|
||||
ExtraBeeItems.LeadDust.setMetal("Lead");
|
||||
ExtraBeeItems.SilverDust.setMetal("Silver");
|
||||
ExtraBeeItems.GoldDust.setMetal("Gold");
|
||||
ExtraBeeItems.PlatinumDust.setMetal("Platinum");
|
||||
ExtraBeeItems.TungstenDust.setMetal("Tungsten");
|
||||
ExtraBeeItems.TitaniumDust.setMetal("Titanium");
|
||||
ExtraBeeItems.CoalDust.setMetal("Coal");
|
||||
ExtraBeeItems.YelloriumDust.setMetal("Yellorium");
|
||||
ExtraBeeItems.BlutoniumDust.setMetal("Blutonium");
|
||||
ExtraBeeItems.CyaniteDust.setMetal("Cyanite");
|
||||
ExtraBeeItems.DiamondShard.setGem("Diamond");
|
||||
ExtraBeeItems.EmeraldShard.setGem("Emerald");
|
||||
ExtraBeeItems.RubyShard.setGem("Ruby");
|
||||
ExtraBeeItems.SapphireShard.setGem("Sapphire");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,9 +2,6 @@ package binnie.extrabees.items.types;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 12-5-2017.
|
||||
*/
|
||||
public interface IEBEnumItem {
|
||||
|
||||
boolean isActive();
|
||||
@@ -16,5 +13,4 @@ public interface IEBEnumItem {
|
||||
ItemStack get(final int p0);
|
||||
|
||||
String name();
|
||||
|
||||
}
|
||||
@@ -2,13 +2,9 @@ package binnie.extrabees.items.types;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 13-5-2017.
|
||||
*/
|
||||
public interface IEBItemMiscProvider extends IEBEnumItem {
|
||||
|
||||
void addInformation(List<String> tooltip);
|
||||
|
||||
String getModelPath();
|
||||
|
||||
}
|
||||
@@ -27,6 +27,25 @@ public enum IndustrialFrame implements IBeeModifier {
|
||||
NetherStar("Immortality Gate", 12, 50),
|
||||
Poison("Mortality Inhibitor", 8, 18);
|
||||
|
||||
static {
|
||||
IndustrialFrame.Light.lighted = true;
|
||||
IndustrialFrame.Rain.rain = true;
|
||||
IndustrialFrame.Sunlight.lighted = true;
|
||||
IndustrialFrame.Sunlight.sunlight = true;
|
||||
IndustrialFrame.Soul.mutationMod = 1.3f;
|
||||
IndustrialFrame.Uranium.mutationMod = 2.0f;
|
||||
IndustrialFrame.Cage.territoryMod = 0.4f;
|
||||
IndustrialFrame.Freedom.territoryMod = 1.4f;
|
||||
IndustrialFrame.Honey.productionMod = 1.4f;
|
||||
IndustrialFrame.Jelly.productionMod = 1.8f;
|
||||
IndustrialFrame.Leaf.floweringMod = 1.4f;
|
||||
IndustrialFrame.Pollen.floweringMod = 2.0f;
|
||||
IndustrialFrame.Clay.lifespanMod = 1.4f;
|
||||
IndustrialFrame.Emerald.lifespanMod = 2.0f;
|
||||
IndustrialFrame.NetherStar.lifespanMod = 20.0f;
|
||||
IndustrialFrame.Poison.lifespanMod = 0.5f;
|
||||
}
|
||||
|
||||
String name;
|
||||
float territoryMod;
|
||||
float mutationMod;
|
||||
@@ -123,23 +142,4 @@ public enum IndustrialFrame implements IBeeModifier {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
static {
|
||||
IndustrialFrame.Light.lighted = true;
|
||||
IndustrialFrame.Rain.rain = true;
|
||||
IndustrialFrame.Sunlight.lighted = true;
|
||||
IndustrialFrame.Sunlight.sunlight = true;
|
||||
IndustrialFrame.Soul.mutationMod = 1.3f;
|
||||
IndustrialFrame.Uranium.mutationMod = 2.0f;
|
||||
IndustrialFrame.Cage.territoryMod = 0.4f;
|
||||
IndustrialFrame.Freedom.territoryMod = 1.4f;
|
||||
IndustrialFrame.Honey.productionMod = 1.4f;
|
||||
IndustrialFrame.Jelly.productionMod = 1.8f;
|
||||
IndustrialFrame.Leaf.floweringMod = 1.4f;
|
||||
IndustrialFrame.Pollen.floweringMod = 2.0f;
|
||||
IndustrialFrame.Clay.lifespanMod = 1.4f;
|
||||
IndustrialFrame.Emerald.lifespanMod = 2.0f;
|
||||
IndustrialFrame.NetherStar.lifespanMod = 20.0f;
|
||||
IndustrialFrame.Poison.lifespanMod = 0.5f;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -23,13 +23,27 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 12-5-2017.
|
||||
*/
|
||||
public class ExtraBeesClientProxy extends ExtraBeesCommonProxy {
|
||||
|
||||
private static final ModelManager modelManager = ModelManager.getInstance();
|
||||
|
||||
private static IBakedModel bakeModelFor(Block block) {
|
||||
return new BlankModel() {
|
||||
|
||||
@Override
|
||||
protected ItemOverrideList createOverrides() {
|
||||
return new ItemOverrideList(ImmutableList.of()) {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public IBakedModel handleItemState(IBakedModel originalModel, ItemStack stack, @Nullable World world, @Nullable EntityLivingBase entity) {
|
||||
return Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelForState(block.getStateFromMeta(stack.getMetadata()));
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block registerBlock(Block block) {
|
||||
modelManager.registerBlockClient(block);
|
||||
@@ -49,34 +63,14 @@ public class ExtraBeesClientProxy extends ExtraBeesCommonProxy {
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onModelsBaked(ModelBakeEvent event){
|
||||
public void onModelsBaked(ModelBakeEvent event) {
|
||||
IRegistry<ModelResourceLocation, IBakedModel> registry = event.getModelRegistry();
|
||||
registerItemBlockLink(new ExtraBeesResourceLocation("alveary"), ExtraBees.alveary, registry);
|
||||
registerItemBlockLink(new ExtraBeesResourceLocation("ectoplasm"), ExtraBees.ectoplasm, registry);
|
||||
registerItemBlockLink(new ExtraBeesResourceLocation("hive"), ExtraBees.hive, registry);
|
||||
}
|
||||
|
||||
private void registerItemBlockLink(ResourceLocation item, Block block, IRegistry<ModelResourceLocation, IBakedModel> registry){
|
||||
private void registerItemBlockLink(ResourceLocation item, Block block, IRegistry<ModelResourceLocation, IBakedModel> registry) {
|
||||
registry.putObject(new ModelResourceLocation(item, "inventory"), bakeModelFor(block));
|
||||
}
|
||||
|
||||
private static IBakedModel bakeModelFor(Block block){
|
||||
return new BlankModel() {
|
||||
|
||||
@Override
|
||||
protected ItemOverrideList createOverrides() {
|
||||
return new ItemOverrideList(ImmutableList.of()){
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public IBakedModel handleItemState(IBakedModel originalModel, ItemStack stack, @Nullable World world, @Nullable EntityLivingBase entity) {
|
||||
return Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelForState(block.getStateFromMeta(stack.getMetadata()));
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,28 +6,24 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 12-5-2017.
|
||||
*/
|
||||
public class ExtraBeesCommonProxy {
|
||||
|
||||
public void registerBeeModel(ExtraBeesSpecies type) {
|
||||
}
|
||||
|
||||
public Block registerBlock(Block block){
|
||||
public Block registerBlock(Block block) {
|
||||
return GameRegistry.register(block);
|
||||
}
|
||||
|
||||
public Item registerItem(Item item){
|
||||
public Item registerItem(Item item) {
|
||||
return GameRegistry.register(item);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public String localise(String s){
|
||||
public String localise(String s) {
|
||||
return I18n.translateToLocal(s);
|
||||
}
|
||||
|
||||
public void registerModel(Item item, int meta) {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,9 +13,6 @@ import java.util.List;
|
||||
|
||||
import static org.apache.commons.lang3.ObjectUtils.firstNonNull;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 13-5-2017.
|
||||
*/
|
||||
public class AlvearyMutationHandler {
|
||||
|
||||
private static final List<Pair<ItemStack, Float>> MUTATIONS = new ArrayList<>();
|
||||
@@ -36,7 +33,7 @@ public class AlvearyMutationHandler {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
public static void addMutationItem(@Nullable Item item, float chance){
|
||||
public static void addMutationItem(@Nullable Item item, float chance) {
|
||||
addMutationItem(new ItemStack(firstNonNull(item, Item.getItemFromBlock(Blocks.AIR))), chance);
|
||||
}
|
||||
|
||||
@@ -51,5 +48,4 @@ public class AlvearyMutationHandler {
|
||||
public static List<Pair<ItemStack, Float>> getMutagens() {
|
||||
return Collections.unmodifiableList(MUTATIONS);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,14 +13,14 @@ import java.util.Map;
|
||||
|
||||
public class BeeModifierLogic {
|
||||
|
||||
private Map<EnumBeeModifier, Float[]> modifiers;
|
||||
private List<EnumBeeBooleanModifier> booleanModifiers;
|
||||
|
||||
public BeeModifierLogic() {
|
||||
this.modifiers = new HashMap<>();
|
||||
this.booleanModifiers = new ArrayList<>();
|
||||
}
|
||||
|
||||
private Map<EnumBeeModifier, Float[]> modifiers;
|
||||
private List<EnumBeeBooleanModifier> booleanModifiers;
|
||||
|
||||
public float getModifier(final EnumBeeModifier modifier, final float currentModifier) {
|
||||
if (!this.modifiers.containsKey(modifier)) {
|
||||
return 1.0f;
|
||||
@@ -71,5 +71,4 @@ public class BeeModifierLogic {
|
||||
tooltip.add(modifierName + ": " + valueString);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,13 +3,9 @@ package binnie.extrabees.utils;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 12-5-2017.
|
||||
*/
|
||||
public class ExtraBeesResourceLocation extends ResourceLocation {
|
||||
|
||||
public ExtraBeesResourceLocation(String resourceName) {
|
||||
super(ExtraBees.MODID, resourceName);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,9 +6,6 @@ import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 14-5-2017.
|
||||
*/
|
||||
@Nonnull
|
||||
@TypeQualifierDefault(ElementType.FIELD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
|
||||
@@ -11,6 +11,10 @@ import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class HiveDrop implements IHiveDrop {
|
||||
|
||||
private IAllele[] template;
|
||||
private NonNullList<ItemStack> extra;
|
||||
private int chance;
|
||||
|
||||
public HiveDrop(final IAlleleBeeSpecies species, final int chance) {
|
||||
this(Utils.getBeeRoot().getTemplate(species), NonNullList.create(), chance);
|
||||
}
|
||||
@@ -21,10 +25,6 @@ public class HiveDrop implements IHiveDrop {
|
||||
this.chance = chance;
|
||||
}
|
||||
|
||||
private IAllele[] template;
|
||||
private NonNullList<ItemStack> extra;
|
||||
private int chance;
|
||||
|
||||
@Override
|
||||
public NonNullList<ItemStack> getExtraItems(IBlockAccess world, BlockPos pos, int fortune) {
|
||||
final NonNullList<ItemStack> ret = NonNullList.create();
|
||||
@@ -48,5 +48,4 @@ public class HiveDrop implements IHiveDrop {
|
||||
public IBee getBeeType(IBlockAccess world, BlockPos pos) {
|
||||
return Utils.getBeeRoot().getBee(Utils.getBeeRoot().templateAsGenome(this.template));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,5 +15,4 @@ public class MaterialBeehive extends Material {
|
||||
public boolean isOpaque() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -19,36 +19,33 @@ import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 12-5-2017.
|
||||
*/
|
||||
public class Utils {
|
||||
|
||||
public static IBeeRoot getBeeRoot() {
|
||||
return BeeManager.beeRoot;
|
||||
}
|
||||
|
||||
public static IAlleleBeeSpecies getSpecies(BeeDefinition species){
|
||||
public static IAlleleBeeSpecies getSpecies(BeeDefinition species) {
|
||||
return species.getGenome().getPrimary();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static Item getIC2Item(String name){
|
||||
public static Item getIC2Item(String name) {
|
||||
return getModItem("ic2", name);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static Item getBotaniaItem(String name){
|
||||
public static Item getBotaniaItem(String name) {
|
||||
return getModItem("botania", name);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static Block getBotaniaBlock(String name){
|
||||
public static Block getBotaniaBlock(String name) {
|
||||
ResourceLocation key = new ResourceLocation("botania", name);
|
||||
return ForgeRegistries.BLOCKS.containsKey(key) ? ForgeRegistries.BLOCKS.getValue(key) : null;
|
||||
}
|
||||
|
||||
private static Item getModItem(String mod, String name){
|
||||
private static Item getModItem(String mod, String name) {
|
||||
ResourceLocation key = new ResourceLocation(mod, name);
|
||||
return ForgeRegistries.ITEMS.containsKey(key) ? ForgeRegistries.ITEMS.getValue(key) : null;
|
||||
}
|
||||
@@ -72,8 +69,7 @@ public class Utils {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static FluidStack getFluidFromName(String name, int amount){
|
||||
public static FluidStack getFluidFromName(String name, int amount) {
|
||||
return FluidRegistry.getFluidStack(name.toLowerCase(), amount);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,33 +7,29 @@ import net.minecraftforge.common.config.Configuration;
|
||||
import java.io.File;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 12-5-2017.
|
||||
*/
|
||||
public class ConfigHandler {
|
||||
|
||||
public ConfigHandler(File location){
|
||||
config = new Configuration(location);
|
||||
configurables = Sets.newHashSet();
|
||||
}
|
||||
|
||||
public boolean addConfigurable(IConfigurable configurable){
|
||||
return configurables.add(Preconditions.checkNotNull(configurable));
|
||||
}
|
||||
|
||||
public void reload(boolean load){
|
||||
if (load){
|
||||
config.load();
|
||||
}
|
||||
for (IConfigurable configurable : configurables){
|
||||
configurable.configure(config);
|
||||
}
|
||||
if (config.hasChanged()){
|
||||
config.save();
|
||||
}
|
||||
}
|
||||
|
||||
private final Configuration config;
|
||||
private final Set<IConfigurable> configurables;
|
||||
|
||||
public ConfigHandler(File location) {
|
||||
config = new Configuration(location);
|
||||
configurables = Sets.newHashSet();
|
||||
}
|
||||
|
||||
public boolean addConfigurable(IConfigurable configurable) {
|
||||
return configurables.add(Preconditions.checkNotNull(configurable));
|
||||
}
|
||||
|
||||
public void reload(boolean load) {
|
||||
if (load) {
|
||||
config.load();
|
||||
}
|
||||
for (IConfigurable configurable : configurables) {
|
||||
configurable.configure(config);
|
||||
}
|
||||
if (config.hasChanged()) {
|
||||
config.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,19 +2,13 @@ package binnie.extrabees.utils.config;
|
||||
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 12-5-2017.
|
||||
*/
|
||||
public class ConfigurationMain implements IConfigurable {
|
||||
|
||||
private static final String WORLDGEN = "World-Gen";
|
||||
public static boolean canQuarryMineHives = true;
|
||||
|
||||
public static int waterHiveRate = 1;
|
||||
|
||||
public static int rockHiveRate = 2;
|
||||
|
||||
public static int netherHiveRate = 2;
|
||||
|
||||
public static int marbleHiveRate = 2;
|
||||
|
||||
@Override
|
||||
@@ -27,7 +21,4 @@ public class ConfigurationMain implements IConfigurable {
|
||||
netherHiveRate = config.getInt("netherHiveRate", WORLDGEN, 2, 0, 10, "Sets the worldgen spawn chance for nether hives.");
|
||||
marbleHiveRate = config.getInt("marbleHiveRate", WORLDGEN, 2, 0, 10, "Sets the worldgen spawn chance for marble hives.");
|
||||
}
|
||||
|
||||
private static final String WORLDGEN = "World-Gen";
|
||||
|
||||
}
|
||||
@@ -2,11 +2,7 @@ package binnie.extrabees.utils.config;
|
||||
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 12-5-2017.
|
||||
*/
|
||||
public interface IConfigurable {
|
||||
|
||||
public void configure(Configuration config);
|
||||
|
||||
void configure(Configuration config);
|
||||
}
|
||||
@@ -9,9 +9,6 @@ import net.minecraftforge.fml.common.IWorldGenerator;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 12-5-2017.
|
||||
*/
|
||||
public class ExtraBeesWorldGenerator implements IWorldGenerator {
|
||||
|
||||
@Override
|
||||
@@ -36,7 +33,5 @@ public class ExtraBeesWorldGenerator implements IWorldGenerator {
|
||||
final int randPosZ = chunkZ + rand.nextInt(16);
|
||||
new WorldGenHiveNether().generate(world, rand, new BlockPos(randPosX, randPosY, randPosZ));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -29,18 +29,17 @@ public class WorldGenHiveNether extends WorldGenerator {
|
||||
}
|
||||
|
||||
public boolean embedInWall(final World world, final Block blockID, final BlockPos pos) {
|
||||
if (world.getBlockState(pos).getBlock() != blockID){
|
||||
if (world.getBlockState(pos).getBlock() != blockID) {
|
||||
return false;
|
||||
}
|
||||
for (EnumFacing facing : EnumFacing.VALUES){
|
||||
if (facing.getAxis() == EnumFacing.Axis.Y && world.getBlockState(pos.up()).getBlock() != blockID){
|
||||
for (EnumFacing facing : EnumFacing.VALUES) {
|
||||
if (facing.getAxis() == EnumFacing.Axis.Y && world.getBlockState(pos.up()).getBlock() != blockID) {
|
||||
return false;
|
||||
}
|
||||
if (world.isAirBlock(pos.offset(facing))){
|
||||
if (world.isAirBlock(pos.offset(facing))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package binnie.extrabees.worldgen;
|
||||
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.extrabees.blocks.BlockExtraBeeHive;
|
||||
import binnie.extrabees.blocks.type.EnumHiveType;
|
||||
@@ -26,5 +25,4 @@ public class WorldGenHiveRock extends WorldGenerator {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -27,5 +27,4 @@ public class WorldGenHiveWater extends WorldGenerator {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user