mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-18 19:39:37 +00:00
Clean Up Butterflies
This commit is contained in:
1 parent
1626b6ec03
commit
11b8fce668
29 files changed
+202
-290
No files matched your search
@@ -29,6 +29,7 @@ import com.google.common.base.Preconditions;
|
||||
import forestry.api.arboriculture.ITreeRoot;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.AlleleSpeciesRegisterEvent;
|
||||
import forestry.api.lepidopterology.IButterflyRoot;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraftforge.client.event.ModelBakeEvent;
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
@@ -165,6 +166,17 @@ public class ExtraTrees extends AbstractMod {
|
||||
public String getModID() {
|
||||
return Constants.EXTRA_TREES_MOD_ID;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void speciesRegister(AlleleSpeciesRegisterEvent event) {
|
||||
if (event.getRoot() instanceof ITreeRoot) {
|
||||
ETTreeDefinition.preInitTrees();
|
||||
PlankType.ExtraTreePlanks.initWoodTypes();
|
||||
}else if(event.getRoot() instanceof IButterflyRoot && BinnieCore.isLepidopteryActive()) {
|
||||
ButterflySpecies.preInit();
|
||||
getClass();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<? extends BinniePacketHandler> getPacketHandler() {
|
||||
@@ -176,20 +188,6 @@ public class ExtraTrees extends AbstractMod {
|
||||
return BinnieCore.isExtraTreesActive();
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void speciesRegister(AlleleSpeciesRegisterEvent event) {
|
||||
if (event.getRoot() instanceof ITreeRoot) {
|
||||
ETTreeDefinition.preInitTrees();
|
||||
PlankType.ExtraTreePlanks.initWoodTypes();
|
||||
|
||||
if (BinnieCore.isLepidopteryActive()) {
|
||||
for (final ButterflySpecies species : ButterflySpecies.values()) {
|
||||
AlleleManager.alleleRegistry.registerAllele(species);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class PacketHandler extends BinniePacketHandler {
|
||||
public PacketHandler() {
|
||||
super(ExtraBees.instance);
|
||||
|
||||
@@ -48,27 +48,27 @@ public enum EnumShrubLog implements IWoodType {
|
||||
|
||||
@Override
|
||||
public String getPlankTexture() {
|
||||
return Constants.EXTRA_TREES_MOD_ID + ":null";
|
||||
return "tetxures/planks_oak";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHeartTexture() {
|
||||
return Constants.EXTRA_TREES_MOD_ID + ":null";
|
||||
return "tetxures/log_oak_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDoorLowerTexture() {
|
||||
return Constants.EXTRA_TREES_MOD_ID + ":null";
|
||||
return "tetxures/door_wood_lower";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDoorUpperTexture() {
|
||||
return Constants.EXTRA_TREES_MOD_ID + ":null";
|
||||
return "tetxures/door_wood_upper";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBarkTexture() {
|
||||
return Constants.EXTRA_TREES_MOD_ID + ":null";
|
||||
return "tetxures/log_oak";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -13,10 +13,25 @@ import forestry.api.core.EnumTemperature;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IClassification;
|
||||
import forestry.api.genetics.IGenome;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.lepidopterology.ButterflyManager;
|
||||
import forestry.api.lepidopterology.EnumButterflyChromosome;
|
||||
import forestry.api.lepidopterology.EnumFlutterType;
|
||||
import forestry.api.lepidopterology.IAlleleButterflySpecies;
|
||||
import forestry.api.lepidopterology.IAlleleButterflySpeciesBuilder;
|
||||
import forestry.api.lepidopterology.IButterfly;
|
||||
import forestry.api.lepidopterology.IButterflyGenome;
|
||||
import forestry.api.lepidopterology.IButterflyMutationBuilder;
|
||||
import forestry.api.lepidopterology.IButterflyRoot;
|
||||
import forestry.apiculture.genetics.IBeeDefinition;
|
||||
import forestry.core.genetics.alleles.AlleleHelper;
|
||||
import forestry.core.utils.StringUtil;
|
||||
import forestry.lepidopterology.genetics.Butterfly;
|
||||
import forestry.lepidopterology.genetics.ButterflyBranchDefinition;
|
||||
import forestry.lepidopterology.genetics.ButterflyDefinition;
|
||||
import forestry.lepidopterology.genetics.IButterflyDefinition;
|
||||
import forestry.lepidopterology.genetics.MothDefinition;
|
||||
import forestry.lepidopterology.genetics.alleles.AlleleButterflySpecies;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
@@ -27,12 +42,15 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public enum ButterflySpecies implements IAlleleButterflySpecies {
|
||||
public enum ButterflySpecies implements IButterflyDefinition {
|
||||
White_Admiral("White Admiral", "Limenitis camilla", 16448250),
|
||||
Purple_Emperor("Purple Emperor", "Apatura iris", 4338374),
|
||||
Red_Admiral("Red Admiral", "Vanessa atalanta", 15101764),
|
||||
@@ -56,238 +74,119 @@ public enum ButterflySpecies implements IAlleleButterflySpecies {
|
||||
Monarch("Monarch", "Danaus plexippus", 16757254),
|
||||
Marbled_White("Marbled White", "Melanargia galathea", 15527148);
|
||||
|
||||
private String name;
|
||||
private String branchName;
|
||||
private String scientific;
|
||||
private BinnieResource texture;
|
||||
private IClassification branch;
|
||||
private int colour;
|
||||
private Map<ItemStack, Float> butterflyLoot;
|
||||
private Map<ItemStack, Float> caterpillarLoot;
|
||||
public static final ButterflySpecies[] VALUES = values();
|
||||
|
||||
private final IAlleleButterflySpecies species;
|
||||
private final IClassification branch;
|
||||
private IAllele[] template;
|
||||
private IButterflyGenome genome;
|
||||
|
||||
ButterflySpecies(String name, String scientific, int colour) {
|
||||
String branchName = scientific.split(" ")[0].toLowerCase();
|
||||
String binomial = scientific.split(" ")[1];
|
||||
|
||||
ButterflySpecies(final String name, final String scientific, final int colour) {
|
||||
this.butterflyLoot = new HashMap<>();
|
||||
this.caterpillarLoot = new HashMap<>();
|
||||
this.name = name;
|
||||
this.branchName = scientific.split(" ")[0].toLowerCase();
|
||||
this.scientific = scientific.split(" ")[1];
|
||||
this.texture = Binnie.RESOURCE.getPNG(ExtraTrees.instance, ResourceType.Entity, this.toString());
|
||||
this.colour = colour;
|
||||
|
||||
final String uid = "trees." + branchName.toLowerCase();
|
||||
IClassification branch = AlleleManager.alleleRegistry.getClassification("genus." + uid);
|
||||
final String branchUid = "trees." + branchName.toLowerCase();
|
||||
IClassification branch = AlleleManager.alleleRegistry.getClassification("genus." + branchUid);
|
||||
if (branch == null) {
|
||||
branch = AlleleManager.alleleRegistry.createAndRegisterClassification(IClassification.EnumClassLevel.GENUS, uid, scientific);
|
||||
branch = AlleleManager.alleleRegistry.createAndRegisterClassification(IClassification.EnumClassLevel.GENUS, branchUid, scientific);
|
||||
}
|
||||
this.branch = branch;
|
||||
|
||||
// final String scientific = species2.branchName.substring(0, 1).toUpperCase() + species2.branchName.substring(1).toLowerCase();
|
||||
// final String uid = "trees." + species2.branchName.toLowerCase();
|
||||
// IClassification branch = AlleleManager.alleleRegistry.getClassification("genus." + uid);
|
||||
// if (branch == null) {
|
||||
// branch = AlleleManager.alleleRegistry.createAndRegisterClassification(IClassification.EnumClassLevel.GENUS, uid, scientific);
|
||||
// }
|
||||
// (species2.branch = branch).addMemberSpecies(species2);
|
||||
String uid = "extrabutterflies.species." + this.toString().toLowerCase().replace("_", "");
|
||||
IClassification parent = branch.getParent();
|
||||
String unlocalizedDescription = "for.description." + uid;
|
||||
String texture = "butterflies/" + toString().toLowerCase();
|
||||
|
||||
IAlleleButterflySpeciesBuilder speciesBuilder = ButterflyManager.butterflyFactory.createSpecies(uid, uid, "Binnie", unlocalizedDescription, Constants.EXTRA_TREES_MOD_ID, texture, true, branch, binomial, new Color(colour));
|
||||
speciesBuilder.setRarity(0.5F);
|
||||
setSpeciesProperties(speciesBuilder);
|
||||
species = speciesBuilder.build();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumTemperature getTemperature() {
|
||||
return EnumTemperature.NORMAL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumHumidity getHumidity() {
|
||||
return EnumHumidity.NORMAL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasEffect() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSecret() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCounted() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBinomial() {
|
||||
return this.scientific;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAuthority() {
|
||||
return "Binnie";
|
||||
}
|
||||
|
||||
@Override
|
||||
public IClassification getBranch() {
|
||||
Preconditions.checkState(this.branch != null, "branch has not been initialized yet");
|
||||
return this.branch;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// public IIconProvider getIconProvider() {
|
||||
// return null;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public int getSpriteColour(int renderPass) {
|
||||
return (renderPass == 0) ? 0xFFFFFF : this.colour;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemTexture() {
|
||||
return getModID() + ":items/butterflies/" + toString().toLowerCase();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerSprites() {
|
||||
String spriteName = getItemTexture();
|
||||
TextureMap textureMap = Minecraft.getMinecraft().getTextureMapBlocks();
|
||||
textureMap.registerSprite(new ResourceLocation(spriteName));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModID() {
|
||||
return Constants.EXTRA_TREES_MOD_ID;
|
||||
}
|
||||
|
||||
|
||||
/////////
|
||||
|
||||
@Override
|
||||
public String getUID() {
|
||||
return "extrabutterflies.species." + this.toString().toLowerCase().replace("_", "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDominant() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEntityTexture() {
|
||||
return this.texture.getResourceLocation().toString();
|
||||
}
|
||||
|
||||
public IAllele[] getTemplate() {
|
||||
final IAllele[] def = this.getRoot().getDefaultTemplate().clone();
|
||||
def[0] = this;
|
||||
return def;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IButterflyRoot getRoot() {
|
||||
return Binnie.GENETICS.getButterflyRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getRarity() {
|
||||
return 0.5f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNocturnal() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<ItemStack, Float> getButterflyLoot() {
|
||||
return new HashMap<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<ItemStack, Float> getCaterpillarLoot() {
|
||||
return new HashMap<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComplexity() {
|
||||
return 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getResearchSuitability(final ItemStack itemstack) {
|
||||
if (itemstack.isEmpty()) {
|
||||
return 0.0f;
|
||||
public static void initButterflies() {
|
||||
for (ButterflySpecies butterfly : VALUES) {
|
||||
butterfly.init();
|
||||
}
|
||||
if (itemstack.getItem() == Items.GLASS_BOTTLE) {
|
||||
return 0.9f;
|
||||
for (ButterflySpecies butterfly : VALUES) {
|
||||
butterfly.registerMutations();
|
||||
}
|
||||
for (final ItemStack stack : this.butterflyLoot.keySet()) {
|
||||
if (stack.isItemEqual(itemstack)) {
|
||||
return 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
private void init() {
|
||||
template = ButterflyManager.butterflyRoot.getDefaultTemplate();
|
||||
AlleleHelper.getInstance().set(template, EnumButterflyChromosome.SPECIES, species);
|
||||
setAlleles(template);
|
||||
|
||||
genome = ButterflyManager.butterflyRoot.templateAsGenome(template);
|
||||
|
||||
ButterflyManager.butterflyRoot.registerTemplate(template);
|
||||
}
|
||||
|
||||
protected void setSpeciesProperties(IAlleleButterflySpeciesBuilder species) {
|
||||
|
||||
}
|
||||
|
||||
protected void setAlleles(IAllele[] alleles) {
|
||||
|
||||
}
|
||||
|
||||
protected void registerMutations() {
|
||||
|
||||
}
|
||||
|
||||
protected final IButterflyMutationBuilder registerMutation(IButterflyDefinition parent1, IButterflyDefinition parent2, int chance) {
|
||||
IAlleleButterflySpecies species1;
|
||||
IAlleleButterflySpecies species2;
|
||||
|
||||
if (parent1 instanceof ButterflySpecies) {
|
||||
species1 = ((ButterflySpecies) parent1).species;
|
||||
} else if (parent1 instanceof ButterflyDefinition) {
|
||||
species1 = ((ButterflyDefinition) parent1).getSpecies();
|
||||
} else if (parent1 instanceof MothDefinition) {
|
||||
species1 = ((MothDefinition) parent1).getSpecies();
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unknown parent1: " + parent1);
|
||||
}
|
||||
for (final ItemStack stack : this.caterpillarLoot.keySet()) {
|
||||
if (stack.isItemEqual(itemstack)) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
if (parent2 instanceof ButterflySpecies) {
|
||||
species2 = ((ButterflySpecies) parent2).species;
|
||||
} else if (parent2 instanceof ButterflySpecies) {
|
||||
species2 = ((ButterflyDefinition) parent2).getSpecies();
|
||||
} else if (parent2 instanceof MothDefinition) {
|
||||
species2 = ((MothDefinition) parent2).getSpecies();
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unknown parent2: " + parent2);
|
||||
}
|
||||
if (itemstack.getItem() == Mods.Forestry.item("honey_drop")) {
|
||||
return 0.5f;
|
||||
}
|
||||
if (itemstack.getItem() == Mods.Forestry.item("honeydew")) {
|
||||
return 0.7f;
|
||||
}
|
||||
if (itemstack.getItem() == Mods.Forestry.item("bee_combs")) {
|
||||
return 0.4f;
|
||||
}
|
||||
if (AlleleManager.alleleRegistry.isIndividual(itemstack)) {
|
||||
return 1.0f;
|
||||
}
|
||||
for (final Map.Entry<ItemStack, Float> entry : this.getRoot().getResearchCatalysts().entrySet()) {
|
||||
if (entry.getKey().isItemEqual(itemstack)) {
|
||||
return entry.getValue();
|
||||
}
|
||||
}
|
||||
return 0.0f;
|
||||
|
||||
return ButterflyManager.butterflyMutationFactory.createMutation(species1, species2, getTemplate(), chance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NonNullList<ItemStack> getResearchBounty(final World world, final GameProfile researcher, final IIndividual individual, final int bountyLevel) {
|
||||
NonNullList<ItemStack> bounty = NonNullList.create();
|
||||
ItemStack serum = this.getRoot().getMemberStack(individual.copy(), EnumFlutterType.SERUM);
|
||||
bounty.add(serum);
|
||||
return bounty;
|
||||
public final IAllele[] getTemplate() {
|
||||
return Arrays.copyOf(template, template.length);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<BiomeDictionary.Type> getSpawnBiomes() {
|
||||
return Collections.emptySet();
|
||||
public final IButterflyGenome getGenome() {
|
||||
return genome;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean strictSpawnMatch() {
|
||||
return false;
|
||||
public final IButterfly getIndividual() {
|
||||
return new Butterfly(genome);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFlightDistance() {
|
||||
return 5.0f;
|
||||
public final ItemStack getMemberStack(EnumFlutterType flutterType) {
|
||||
IButterfly butterfly = getIndividual();
|
||||
return ButterflyManager.butterflyRoot.getMemberStack(butterfly, flutterType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName() {
|
||||
return this.getUID();
|
||||
public IAlleleButterflySpecies getSpecies() {
|
||||
return species;
|
||||
}
|
||||
|
||||
public static void preInit() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,12 @@ package binnie.extratrees.genetics;
|
||||
import binnie.Binnie;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.IInitializable;
|
||||
import binnie.extratrees.block.PlankType;
|
||||
import forestry.api.arboriculture.IAlleleFruit;
|
||||
import forestry.api.arboriculture.ITreeRoot;
|
||||
import forestry.api.genetics.AlleleRegisterEvent;
|
||||
import forestry.api.genetics.AlleleSpeciesRegisterEvent;
|
||||
import forestry.api.lepidopterology.IButterflyRoot;
|
||||
import forestry.arboriculture.genetics.alleles.AlleleFruits;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
@@ -22,7 +26,6 @@ public class ModuleGenetics implements IInitializable {
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -31,17 +34,13 @@ public class ModuleGenetics implements IInitializable {
|
||||
AlleleETFruit.init();
|
||||
ETTreeDefinition.initTrees();
|
||||
ExtraTreeMutation.init();
|
||||
if(BinnieCore.isLepidopteryActive()){
|
||||
ButterflySpecies.initButterflies();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
if (BinnieCore.isLepidopteryActive()) {
|
||||
for (final ButterflySpecies species2 : ButterflySpecies.values()) {
|
||||
//AlleleManager.alleleRegistry.registerAllele(species2);
|
||||
Binnie.GENETICS.getButterflyRoot().registerTemplate(species2.getTemplate());
|
||||
species2.getBranch().addMemberSpecies(species2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
||||
@@ -2,38 +2,35 @@ package binnie.extratrees.village;
|
||||
|
||||
public class ComponentVillageGrove //extends StructureVillagePieces.Village
|
||||
{
|
||||
// public ComponentVillageGrove() {
|
||||
// }
|
||||
//
|
||||
// public ComponentVillageGrove(final StructureVillagePieces.Start start, final int p_i2097_2_, final Random p_i2097_3_, final StructureBoundingBox boundingBox, final int coordBaseMode) {
|
||||
// super(start, p_i2097_2_);
|
||||
// this.coordBaseMode = coordBaseMode;
|
||||
// this.boundingBox = boundingBox;
|
||||
// }
|
||||
//
|
||||
// public static StructureBoundingBox func_74904_a(final StructureVillagePieces.Start p_74904_0_, final List p_74904_1_, final Random p_74904_2_, final int p_74904_3_, final int p_74904_4_, final int p_74904_5_, final int p_74904_6_) {
|
||||
// final StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_74904_3_, p_74904_4_, p_74904_5_, 0, 0, 0, 3, 3, 3, p_74904_6_);
|
||||
// return (StructureComponent.findIntersecting(p_74904_1_, structureboundingbox) != null) ? null : structureboundingbox;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean addComponentParts(final World p_74875_1_, final Random p_74875_2_, final StructureBoundingBox p_74875_3_) {
|
||||
// if (this.field_143015_k < 0) {
|
||||
// this.field_143015_k = this.getAverageGroundLevel(p_74875_1_, p_74875_3_);
|
||||
// if (this.field_143015_k < 0) {
|
||||
// return true;
|
||||
// }
|
||||
// this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 4 - 1, 0);
|
||||
// }
|
||||
// System.out.println("GROVE2");
|
||||
// this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 3, 3, 3, Blocks.air, Blocks.air, false);
|
||||
// this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 3, 3, 3, Blocks.stone, Blocks.stone, true);
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// public static ComponentVillageBeeHouse buildComponent(final StructureVillagePieces.Start startPiece, final List par1List, final Random random, final int par3, final int par4, final int par5, final int par6, final int par7) {
|
||||
// System.out.println("GROVE1");
|
||||
// final StructureBoundingBox bbox = StructureBoundingBox.getComponentToAddBoundingBox(par3, par4, par5, 0, 0, 0, 9, 9, 10, par6);
|
||||
// return (canVillageGoDeeper(bbox) && StructureComponent.findIntersecting(par1List, bbox) == null) ? new ComponentVillageBeeHouse(startPiece, par7, random, bbox, par6) : null;
|
||||
// }
|
||||
/*public ComponentVillageGrove() {
|
||||
}
|
||||
|
||||
public ComponentVillageGrove(StructureVillagePieces.Start start, int type, Random rand, StructureBoundingBox boundingBox, EnumFacing facing) {
|
||||
super(start, type);
|
||||
this.setCoordBaseMode(facing);
|
||||
this.boundingBox = boundingBox;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addComponentParts(World world, final Random p_74875_2_, final StructureBoundingBox structureBoundingBox) {
|
||||
if (this.averageGroundLvl < 0) {
|
||||
this.averageGroundLvl = this.getAverageGroundLevel(world, structureBoundingBox);
|
||||
|
||||
if (this.averageGroundLvl < 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
this.boundingBox.offset(0, this.averageGroundLvl - this.boundingBox.maxY + 4 - 1, 0);
|
||||
}
|
||||
System.out.println("GROVE2");
|
||||
this.fillWithBlocks(world, structureBoundingBox, 0, 0, 0, 3, 3, 3, Blocks.AIR.getDefaultState(), Blocks.AIR.getDefaultState(), false);
|
||||
this.fillWithBlocks(world, structureBoundingBox, 0, 0, 0, 3, 3, 3, Blocks.STONE.getDefaultState(), Blocks.STONE.getDefaultState(), true);
|
||||
return true;
|
||||
}
|
||||
|
||||
public static ComponentVillageGrove createComponent(StructureVillagePieces.Start start, List<StructureComponent> p_175851_1_, Random rand, int p_175851_3_, int p_175851_4_, int p_175851_5_, EnumFacing facing, int p_175851_7_)
|
||||
{
|
||||
StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175851_3_, p_175851_4_, p_175851_5_, 0, 0, 0, 3, 3, 3, facing);
|
||||
return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_175851_1_, structureboundingbox) == null ? new ComponentVillageGrove(start, p_175851_7_, rand, structureboundingbox, facing) : null;
|
||||
}*/
|
||||
}
|
||||
@@ -2,25 +2,22 @@ package binnie.extratrees.village;
|
||||
|
||||
public class VillageHandlerExtraTrees //implements VillagerRegistry.IVillageCreationHandler
|
||||
{
|
||||
// public static void registerVillageComponents() {
|
||||
// try {
|
||||
// MapGenStructureIO.func_143031_a(ComponentVillageGrove.class, "ExtraTrees:Grove");
|
||||
// } catch (Throwable t) {
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public StructureVillagePieces.PieceWeight getVillagePieceWeight(final Random random, final int size) {
|
||||
// return new StructureVillagePieces.PieceWeight(ComponentVillageGrove.class, 505, MathHelper.getRandomIntegerInRange(random, size, 1 + size));
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public Class<?> getComponentClass() {
|
||||
// return ComponentVillageGrove.class;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public Object buildComponent(final StructureVillagePieces.PieceWeight villagePiece, final StructureVillagePieces.Start startPiece, final List pieces, final Random random, final int p1, final int p2, final int p3, final int p4, final int p5) {
|
||||
// return ComponentVillageGrove.buildComponent(startPiece, pieces, random, p1, p2, p3, p4, p5);
|
||||
// }
|
||||
/*public static void registerVillageComponents() {
|
||||
MapGenStructureIO.registerStructureComponent(ComponentVillageGrove.class, "ExtraTrees:Grove");
|
||||
}
|
||||
|
||||
@Override
|
||||
public StructureVillagePieces.PieceWeight getVillagePieceWeight(final Random random, final int size) {
|
||||
return new StructureVillagePieces.PieceWeight(ComponentVillageGrove.class, 505, MathHelper.getRandomIntegerInRange(random, size, 1 + size));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getComponentClass() {
|
||||
return ComponentVillageGrove.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object buildComponent(final StructureVillagePieces.PieceWeight villagePiece, final StructureVillagePieces.Start startPiece, final List pieces, final Random random, final int p1, final int p2, final int p3, final int p4, final int p5) {
|
||||
return ComponentVillageGrove.createComponent(startPiece, pieces, random, p1, p2, p3, p4, p5);
|
||||
}*/
|
||||
}
|
||||
Reference in new issue
Block a user