Compare commits

..
Author SHA1 Message Date
Martin Robertz e2b41a49c3 Merge pull request #25 from GTNewHorizons/forestry_compat
Added forestry sapling support to farm station
2020-11-08 09:22:35 +01:00
bdew 7f89eba8b5 Added forestry sapling support to farm station
Cherry picked & backported from 1b242dc2d786b8c1fb545845768faa1f6c15818a
2020-11-07 12:50:04 -08:00
Martin Robertz 76dabdf493 Merge pull request #24 from GTNewHorizons/fix-dupe-mob
Ignore dead entities when capturing mobs with soul vial
2020-11-01 10:24:47 +01:00
Glease 41c51754bb Ignore dead entities 2020-10-29 18:07:20 +08:00
Martin Robertz 472b3649e1 Merge pull request #22 from Prometheus0000/fused-quartz-nerf
Change fused quartz blast resistance 2000 -> 20
2020-10-24 22:34:24 +02:00
Prometheus0000 806d162b19 Change fused quartz blast resistance 2000 -> 20 2020-10-21 15:40:46 -04:00
Martin Robertz ad1f98b03e Merge pull request #21 from glowredman/master
Hide tile.blockLightNode.name in NEI
2020-10-11 12:16:43 +02:00
glowredman f9bc80ef91 Hide tile.blockLightNode.name in NEI 2020-10-11 00:02:35 +02:00
Martin Robertz 8807be5887 Merge pull request #20 from TataTawa/patch-2
Update TileConduitBundle.java
2020-08-31 13:17:05 +02:00
TataTawa 026a36d51d Update TileConduitBundle.java 2020-08-31 17:12:00 +08:00
TataTawa c6c539ea13 Update TileConduitBundle.java 2020-08-31 06:51:28 +00:00
TataTawa 983a76dd1d Update TileConduitBundle.java
Greatly increase Client Side ItemConduit performance. (20% fps increase if have 100 - 200 item conduit in render area, these are lag-spikes.)

EnderIO Conduits are very laggy, partly because Redstone/fluid/gas Conduits causing RenderChunks re-render back and forth. But if there is only one ItemConduit in the bundle, it is pretty sure that we only need to re-render ItemConduit near the player , because only player's behavior range (5) can change the shape of ItemConduit. 
But if there is another conduit in the bundle, the re-render is not sure because Redstone conduit in the bundle might needs to re-render in any time. So in this case I left to default.
2020-08-28 17:59:14 +08:00
Martin Robertz f492c45f50 Merge pull request #19 from TataTawa/patch-1
Update TooltipHandlerBurnTime.java
2020-08-01 16:37:34 +02:00
TataTawa 3093ea6180 Update TooltipHandlerBurnTime.java
After performance profiling I found 
TileEntityFurnace.getItemBurnTime(item); 
is computationaly expensive. It occupied almost a cpu core forever, because NEI starts a task thread every few seconds and this line of code keep iteraing through all the furnance recipe in GTNH. Besides, usually the result of this computation is not useful.

Add thread name check will help performance and will not influence the player.
if (!Thread.currentThread().getName().startsWith("Client Thread")) return false;
2020-07-29 09:34:08 +00:00
bartimaeusnek ea5786c266 Fixed Fuckup
+ renamed constructor params for easier access
+ reduced log-spam
+ version increase
2020-05-27 13:24:21 +02:00
11 changed files with 101 additions and 61 deletions

No files matched your search

+1 -1
View File
@@ -2,7 +2,7 @@ minecraft_version=1.7.10
forge_version=10.13.4.1614-1.7.10
forgeDep_version=10.13.4.1614
mod_version=2.3.1.12_beta
mod_version=2.3.1.14_beta
#Comment out this line to get rid of the appendix
#mod_appendix=beta
@@ -19,6 +19,8 @@ import mods.immibis.microblocks.api.IMicroblockSystem;
import mods.immibis.microblocks.api.MicroblockAPIUtils;
import mods.immibis.microblocks.api.Part;
import mods.immibis.microblocks.api.PartType;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -162,7 +164,19 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
facadeMeta = nbtRoot.getInteger("facadeMeta");
if(worldObj != null && worldObj.isRemote) {
clientUpdated = true;
if (conduits.size() == 1 && conduits.get(0) instanceof IItemConduit) {
boolean itemConduitClientUpdated = false;
for (Object o : Minecraft.getMinecraft().theWorld.playerEntities) {
Entity e = ((Entity) o);
if (e.getDistanceSq(this.xCoord, yCoord, zCoord) < 36) {
itemConduitClientUpdated = true;
break;
}
}
if (itemConduitClientUpdated) clientUpdated = true;
} else {
clientUpdated = true;
}
}
if (MicroblocksUtil.supportMicroblocks()) {
@@ -51,6 +51,7 @@ public class TooltipHandlerBurnTime implements ITooltipCallback {
@Override
public boolean shouldHandleItem(ItemStack item) {
if (!Thread.currentThread().getName().startsWith("Client Thread")) return false;
int time = TileEntityFurnace.getItemBurnTime(item);
return time > 0 || isStirlingGen(item);
}
@@ -185,6 +185,9 @@ public class ItemSoulVessel extends Item implements IResourceTooltipProvider {
if(entity instanceof EntityPlayer) {
return false;
}
if(entity.isDead) {
return false;
}
String entityId = EntityList.getEntityString(entity);
if(isBlackListed(entityId)) {
@@ -217,9 +217,9 @@ public abstract class AbstractPoweredMachineEntity extends AbstractMachineEntity
NBTTagCompound cap = nbtRoot.getCompoundTag(CAPACITOR_TAG_STRING);
setCapacitor(new BasicCapacitor(
cap.getInteger("Tier"),
cap.getInteger("MaxEnergyExtracted"),
cap.getInteger("MaxEnergyReceived"),
cap.getInteger("MaxEnergyStored"),
cap.getInteger("MaxEnergyReceived")
cap.getInteger("MaxEnergyExtracted")
));
}
@@ -24,6 +24,7 @@ import crazypants.enderio.machine.farm.farmers.PlantableFarmer;
import crazypants.enderio.machine.farm.farmers.RubberTreeFarmerIC2;
import crazypants.enderio.machine.farm.farmers.StemFarmer;
import crazypants.enderio.machine.farm.farmers.TreeFarmer;
import crazypants.enderio.machine.farm.farmers.ForestryFarmer;
public final class FarmersRegistry {
@@ -34,13 +35,10 @@ public final class FarmersRegistry {
addExtraUtilities();
addNatura();
addTiC();
addStillHungry();
addIC2();
addMFR();
addThaumcraft();
addFlowers();
addGrowableOres();
addImmersiveEngineering();
ForestryFarmer.init();
FarmersCommune.joinCommune(new StemFarmer(Blocks.reeds, new ItemStack(Items.reeds)));
FarmersCommune.joinCommune(new StemFarmer(Blocks.cactus, new ItemStack(Blocks.cactus)));
@@ -178,16 +176,6 @@ public final class FarmersRegistry {
}
}
private static void addMFR() {
String mod = "MineFactoryReloaded";
String blockName = "rubberwood.sapling";
Block saplingBlock = GameRegistry.findBlock(mod, blockName);
if(saplingBlock != null) {
FarmersCommune.joinCommune(new TreeFarmer(saplingBlock, GameRegistry.findBlock(mod, "rubberwood.log")));
}
}
private static void addIC2() {
RubberTreeFarmerIC2 rtf = new RubberTreeFarmerIC2();
if(rtf.isValid()) {
@@ -195,11 +183,6 @@ public final class FarmersRegistry {
}
}
private static void addStillHungry() {
String mod = "stillhungry";
addPickable(mod, "grapeBlock", "StillHungry_grapeSeed");
}
private static void addExtraUtilities() {
String mod = "ExtraUtilities";
String name = "plant/ender_lilly";
@@ -219,36 +202,6 @@ public final class FarmersRegistry {
GameRegistry.findBlock("Botany", "flower"),
GameRegistry.findBlock("Botania", "flower") ) );
}
@SuppressWarnings("unchecked")
private static void addGrowableOres() {
String mod = "B0bGrowsOre";
if (!Loader.isModLoaded(mod)) {
return;
}
Pattern[] growableOres = { Pattern.compile("(.+)Reed"), Pattern.compile("oreGrowable(.+)") };
Iterator<Block> blockIter = Block.blockRegistry.iterator();
while (blockIter.hasNext()) {
Block block = blockIter.next();
String name = Block.blockRegistry.getNameForObject(block);
if (name != null && name.startsWith(mod)) {
for (Pattern blockPattern : growableOres) {
if (blockPattern.matcher(name).find()) {
FarmersCommune.joinCommune(new StemFarmer(block, new ItemStack(block)));
}
}
}
}
}
private static void addImmersiveEngineering() {
Block hemp = GameRegistry.findBlock("ImmersiveEngineering", "hemp");
Item hempSeed = GameRegistry.findItem("ImmersiveEngineering", "hemp");
if (hemp != null && hempSeed != null) {
FarmersCommune.joinCommune(new StemFarmer(hemp, new ItemStack(hempSeed)));
}
}
private FarmersRegistry() {
}
@@ -0,0 +1,68 @@
package crazypants.enderio.machine.farm.farmers;
import com.enderio.core.common.util.BlockCoord;
import cpw.mods.fml.common.registry.GameRegistry;
import crazypants.enderio.Log;
import crazypants.enderio.machine.farm.TileFarmStation;
import forestry.api.arboriculture.EnumGermlingType;
import forestry.api.arboriculture.ITree;
import forestry.api.arboriculture.ITreeRoot;
import forestry.api.genetics.AlleleManager;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public class ForestryFarmer implements IFarmerJoe {
private ITreeRoot root;
private Item forestrySapling;
private ForestryFarmer(ITreeRoot root, Item forestrySapling) {
this.root = root;
this.forestrySapling = forestrySapling;
}
public static void init() {
ITreeRoot root = (ITreeRoot) AlleleManager.alleleRegistry.getSpeciesRoot("rootTrees");
Item forestrySapling = GameRegistry.findItem("Forestry", "sapling");
if (root != null && forestrySapling != null) {
FarmersCommune.joinCommune(new ForestryFarmer(root, forestrySapling));
Log.info("ForestryFarmer engaged.");
} else {
Log.info("ForestryFarmer borked.");
}
}
@Override
public boolean canPlant(ItemStack stack) {
return stack != null && stack.getItem() == forestrySapling && root.getType(stack) == EnumGermlingType.SAPLING;
}
@Override
public boolean prepareBlock(TileFarmStation farm, BlockCoord bc, Block block, int meta) {
ItemStack sapling = farm.getSeedTypeInSuppliesFor(bc);
ITree tree = root.getMember(sapling);
if (tree != null && tree.canStay(farm.getWorldObj(), bc.x, bc.y, bc.z)) {
farm.takeSeedFromSupplies(sapling, bc, false);
root.plantSapling(farm.getWorldObj(), tree, farm.getFakePlayer().getGameProfile(), bc.x, bc.y, bc.z);
return true;
}
return false;
}
@Override
public boolean canHarvest(TileFarmStation farm, BlockCoord bc, Block block, int meta) {
return false;
}
@Override
public IHarvestResult harvestBlock(TileFarmStation farm, BlockCoord bc, Block block, int meta) {
return null;
}
}
@@ -128,25 +128,25 @@ public class RecipeConfig {
for (RecipeGroup group : userConfig.getRecipeGroups().values()) {
if(!group.enabled) {
if(recipeGroups.remove(group.name) != null) {
Log.info("Disabled core recipe group " + group.name + " due to user config.");
Log.debug("Disabled core recipe group " + group.name + " due to user config.");
}
} else {
RecipeGroup modifyGroup = recipeGroups.get(group.name);
if(modifyGroup == null) {
Log.info("Added user defined recipe group " + group.name);
Log.debug("Added user defined recipe group " + group.name);
modifyGroup = new RecipeGroup(group.name);
recipeGroups.put(group.name, modifyGroup);
}
for (RecipeElement recipe : group.recipes.values()) {
if(recipe.isValid()) {
if(modifyGroup.recipes.containsKey(recipe.name)) {
Log.info("Replacing core recipe " + recipe.name + " with user defined recipe.");
Log.debug("Replacing core recipe " + recipe.name + " with user defined recipe.");
} else {
Log.info("Added user defined recipe " + recipe.name);
Log.debug("Added user defined recipe " + recipe.name);
}
modifyGroup.addRecipe(recipe);
} else {
Log.info("Removed recipe " + recipe.name + " due to user config.");
Log.debug("Removed recipe " + recipe.name + " due to user config.");
modifyGroup.recipes.remove(recipe.name);
}
}
@@ -118,7 +118,7 @@ public class BlockFusedQuartz extends BlockEio {
int meta = world.getBlockMetadata(x, y, z);
Type type = Type.byMeta(meta);
if (type.blastResistance) {
return 2000;
return 20;
} else {
return super.getExplosionResistance(par1Entity);
}
@@ -36,6 +36,7 @@ public class NEIEnderIOConfig implements IConfigureNEI {
API.registerGuiOverlayHandler(GuiInventoryPanel.class, new InventoryPanelNEIOverlayHandler(), "crafting");
API.hideItem(new ItemStack(EnderIO.blockConduitFacade));
API.hideItem(new ItemStack(EnderIO.blockLightNode));
API.hideItem(new ItemStack(EnderIO.itemEnderface));
API.hideItem(PainterUtil.applyDefaultPaintedState(new ItemStack(EnderIO.blockPaintedCarpet)));
API.hideItem(PainterUtil.applyDefaultPaintedState(new ItemStack(EnderIO.blockPaintedSlab)));
@@ -22,8 +22,8 @@ public class BasicCapacitor implements ICapacitor {
this(tier, maxEnergyIO, maxEnergyStored, maxEnergyIO);
}
public BasicCapacitor(int tier, int maxEnergyIn, int maxEnergyStored, int maxEnergyOut) {
configure(tier, maxEnergyIn, maxEnergyStored, maxEnergyOut);
public BasicCapacitor(int tier, int maxEnergyReceived, int maxEnergyStored, int maxEnergyExtracted) {
configure(tier, maxEnergyReceived, maxEnergyStored, maxEnergyExtracted);
}