mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-20 12:19:47 +00:00
Add Lumbermill JEI recipes
This commit is contained in:
1 parent
88ad994a8c
commit
b6f91fe870
23 files changed
+634
-366
No files matched your search
@@ -4,7 +4,7 @@ import binnie.Binnie;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.util.UniqueItemStackSet;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.machines.Lumbermill;
|
||||
import binnie.extratrees.machines.lumbermill.LumbermillRecipes;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import forestry.api.arboriculture.EnumGermlingType;
|
||||
import forestry.api.arboriculture.EnumTreeChromosome;
|
||||
@@ -221,7 +221,7 @@ public class TreeBreedingSystem extends BreedingSystem {
|
||||
ITreeGenome genome = TreeManager.treeRoot.templateAsGenome(TreeManager.treeRoot.getTemplate(tSpecies.getUID()));
|
||||
IAlleleTreeSpecies treeSpecies = genome.getPrimary();
|
||||
final ItemStack woodStack = treeSpecies.getWoodProvider().getWoodStack();
|
||||
if (Lumbermill.getPlankProduct(woodStack) != null && fruit.isItemEqual(Lumbermill.getPlankProduct(woodStack))) {
|
||||
if (LumbermillRecipes.getPlankProduct(woodStack) != null && fruit.isItemEqual(LumbermillRecipes.getPlankProduct(woodStack))) {
|
||||
found.add(species);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
package binnie.core.util;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.profiler.Profiler;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.DimensionType;
|
||||
import net.minecraft.world.GameType;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldProvider;
|
||||
import net.minecraft.world.WorldSettings;
|
||||
import net.minecraft.world.WorldType;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraft.world.chunk.EmptyChunk;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.storage.ISaveHandler;
|
||||
import net.minecraft.world.storage.SaveDataMemoryStorage;
|
||||
import net.minecraft.world.storage.SaveHandlerMP;
|
||||
import net.minecraft.world.storage.WorldInfo;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class FakeCraftingWorld extends World {
|
||||
private static final WorldSettings worldSettings = new WorldSettings(0, GameType.SURVIVAL, false, false, WorldType.DEFAULT);
|
||||
private static final WorldInfo worldInfo = new WorldInfo(worldSettings, "fake");
|
||||
private static final ISaveHandler saveHandler = new SaveHandlerMP();
|
||||
private static final WorldProvider worldProvider = new WorldProvider() {
|
||||
@Override
|
||||
public DimensionType getDimensionType() {
|
||||
return DimensionType.OVERWORLD;
|
||||
}
|
||||
};
|
||||
@Nullable
|
||||
private static FakeCraftingWorld INSTANCE;
|
||||
|
||||
public static FakeCraftingWorld getInstance() {
|
||||
if (INSTANCE == null) {
|
||||
INSTANCE = new FakeCraftingWorld();
|
||||
}
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
private FakeCraftingWorld() {
|
||||
super(saveHandler, worldInfo, worldProvider, new Profiler(), true);
|
||||
this.provider.registerWorld(this);
|
||||
this.mapStorage = new SaveDataMemoryStorage();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public BlockPos getSpawnPoint() {
|
||||
return new BlockPos(0, 0, 0);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState getBlockState(BlockPos pos) {
|
||||
return Blocks.AIR.getDefaultState();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
protected IChunkProvider createChunkProvider() {
|
||||
return new IChunkProvider() {
|
||||
@Nullable
|
||||
@Override
|
||||
public Chunk getLoadedChunk(int x, int z) {
|
||||
return new EmptyChunk(FakeCraftingWorld.this, x, z);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Chunk provideChunk(int x, int z) {
|
||||
return new EmptyChunk(FakeCraftingWorld.this, x, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean unloadQueuedChunks() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String makeString() {
|
||||
return "";
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isChunkLoaded(int x, int z, boolean allowEmpty) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user