mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-15 09:34:57 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e90771e38a | ||
|
|
9c98a6a00b | ||
|
|
75a3a7b935 | ||
|
|
99020cde7f | ||
|
|
98e13299d6 | ||
|
|
010fe4662a | ||
|
|
92ee6dbc0d | ||
|
|
96cc1b869c | ||
|
|
1941690330 | ||
|
|
53f4107ee3 | ||
|
|
22258c2dac | ||
|
|
dd21d83ea3 | ||
|
|
d11034e4aa | ||
|
|
f0099b728f | ||
|
|
c875e8ed5d | ||
|
|
4228ef73d7 | ||
|
|
d8bcab07ba | ||
|
|
2368f05778 | ||
|
|
9c532dd076 | ||
|
|
3de8bac1ad | ||
|
|
abca8b13f3 |
No files matched your search
+1
-1
@@ -2,4 +2,4 @@ mcversion=1.7.10
|
||||
forgeversion=10.13.4.1566-1.7.10
|
||||
version_major=4
|
||||
version_minor=2
|
||||
version_patch=9
|
||||
version_patch=10
|
||||
Executable → Regular
-1
@@ -148,7 +148,6 @@ public abstract class SpeciesRoot implements ISpeciesRoot {
|
||||
return chromosomes;
|
||||
}
|
||||
|
||||
/* BREEDING TRACKER */
|
||||
@Override
|
||||
public void syncBreedingTrackerToPlayer(EntityPlayer player) {
|
||||
getBreedingTracker(player.worldObj, player.getGameProfile()).synchToPlayer(player);
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.energy.gui;
|
||||
|
||||
import forestry.core.network.packets.PacketGuiUpdate;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
|
||||
@@ -36,13 +37,9 @@ public class ContainerEngineElectric extends ContainerSocketed<TileEngineElectri
|
||||
@Override
|
||||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
|
||||
if (tile == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (Object crafter : crafters) {
|
||||
tile.sendGUINetworkData(this, (ICrafting) crafter);
|
||||
if (tile != null) {
|
||||
PacketGuiUpdate packet = new PacketGuiUpdate(tile);
|
||||
sendPacketToCrafters(packet);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,13 +10,6 @@
|
||||
******************************************************************************/
|
||||
package forestry.energy.tiles;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import forestry.api.circuits.ChipsetManager;
|
||||
import forestry.api.circuits.CircuitSocketType;
|
||||
import forestry.api.circuits.ICircuitBoard;
|
||||
@@ -26,15 +19,25 @@ import forestry.core.circuits.ISocketable;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.errors.EnumErrorCode;
|
||||
import forestry.core.inventory.InventoryAdapter;
|
||||
import forestry.core.network.DataInputStreamForestry;
|
||||
import forestry.core.network.DataOutputStreamForestry;
|
||||
import forestry.core.network.IStreamableGui;
|
||||
import forestry.core.tiles.TemperatureState;
|
||||
import forestry.core.tiles.TileEngine;
|
||||
import forestry.energy.gui.ContainerEngineElectric;
|
||||
import forestry.energy.gui.GuiEngineElectric;
|
||||
import forestry.plugins.compat.PluginIC2;
|
||||
|
||||
import ic2.api.energy.prefab.BasicSink;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class TileEngineElectric extends TileEngine implements ISocketable, IInventory {
|
||||
import java.io.IOException;
|
||||
|
||||
public class TileEngineElectric extends TileEngine implements ISocketable, IInventory, IStreamableGui {
|
||||
protected static class EuConfig {
|
||||
|
||||
public int euForCycle;
|
||||
@@ -92,6 +95,32 @@ public class TileEngineElectric extends TileEngine implements ISocketable, IInve
|
||||
sockets.writeToNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeGuiData(DataOutputStreamForestry data) throws IOException {
|
||||
data.writeVarInt(currentOutput);
|
||||
data.writeVarInt(heat);
|
||||
sockets.writeData(data);
|
||||
energyManager.writeData(data);
|
||||
final boolean hasIc2EnergySink = (ic2EnergySink != null);
|
||||
data.writeBoolean(hasIc2EnergySink);
|
||||
if (hasIc2EnergySink) {
|
||||
data.writeVarInt((int) ic2EnergySink.getEnergyStored());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readGuiData(DataInputStreamForestry data) throws IOException {
|
||||
currentOutput = data.readVarInt();
|
||||
heat = data.readVarInt();
|
||||
sockets.readData(data);
|
||||
energyManager.readData(data);
|
||||
final boolean hasIc2EnergySink = data.readBoolean();
|
||||
if (hasIc2EnergySink) {
|
||||
final int energyStored = data.readVarInt();
|
||||
ic2EnergySink.setEnergyStored(energyStored);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
if (ic2EnergySink != null) {
|
||||
@@ -219,35 +248,12 @@ public class TileEngineElectric extends TileEngine implements ISocketable, IInve
|
||||
// / SMP GUI
|
||||
@Override
|
||||
public void getGUINetworkData(int i, int j) {
|
||||
|
||||
switch (i) {
|
||||
|
||||
case 0:
|
||||
currentOutput = j;
|
||||
break;
|
||||
case 1:
|
||||
energyManager.fromGuiInt(j);
|
||||
break;
|
||||
case 2:
|
||||
heat = j;
|
||||
break;
|
||||
case 3:
|
||||
if (ic2EnergySink != null) {
|
||||
ic2EnergySink.setEnergyStored(j);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// handled by IStreamableGui
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendGUINetworkData(Container containerEngine, ICrafting iCrafting) {
|
||||
iCrafting.sendProgressBarUpdate(containerEngine, 0, currentOutput);
|
||||
iCrafting.sendProgressBarUpdate(containerEngine, 1, energyManager.toGuiInt());
|
||||
iCrafting.sendProgressBarUpdate(containerEngine, 2, heat);
|
||||
if (ic2EnergySink != null) {
|
||||
iCrafting.sendProgressBarUpdate(containerEngine, 3, (short) ic2EnergySink.getEnergyStored());
|
||||
}
|
||||
// handled by IStreamableGui
|
||||
}
|
||||
|
||||
// / ENERGY CONFIG CHANGE
|
||||
|
||||
@@ -70,17 +70,21 @@ public class SqueezerRecipeManager implements ISqueezerManager {
|
||||
}
|
||||
}
|
||||
|
||||
// First try to match a specific recipe (without OreDictionary)
|
||||
for (ISqueezerRecipe recipe : recipes) {
|
||||
if (ItemStackUtil.containsSets(recipe.getResources(), items, false, false) > 0) {
|
||||
return recipe;
|
||||
}
|
||||
}
|
||||
|
||||
// If that fails - try again with OreDictionary support enabled
|
||||
return null;
|
||||
}
|
||||
|
||||
public static ISqueezerRecipe findRecipeWithIngredient(ItemStack ingredient) {
|
||||
for (ISqueezerRecipe recipe : recipes) {
|
||||
if (ItemStackUtil.containsSets(recipe.getResources(), items, true, false) > 0) {
|
||||
return recipe;
|
||||
for (ItemStack recipeIngredient : recipe.getResources()) {
|
||||
if (ItemStackUtil.isCraftingEquivalent(recipeIngredient, ingredient, false, false)) {
|
||||
return recipe;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -246,11 +246,9 @@ public class NEIHandlerSqueezer extends RecipeHandlerBase {
|
||||
return;
|
||||
}
|
||||
|
||||
ISqueezerRecipe recipe = SqueezerRecipeManager.findMatchingRecipe(new ItemStack[]{ingred});
|
||||
ISqueezerRecipe recipe = SqueezerRecipeManager.findRecipeWithIngredient(ingred);
|
||||
if (recipe != null) {
|
||||
CachedSqueezerRecipe crecipe = new CachedSqueezerRecipe(recipe);
|
||||
// Override recipe to show the right input in case it's OD
|
||||
crecipe.setIngredients(new ItemStack[]{ingred});
|
||||
this.arecipes.add(crecipe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -175,6 +176,11 @@ public class PluginFluids extends ForestryPlugin {
|
||||
public static class FillBucketHook {
|
||||
@SubscribeEvent
|
||||
public void fillBucket(FillBucketEvent event) {
|
||||
ItemStack bucket = event.current;
|
||||
if (bucket == null || bucket.getItem() != Items.bucket) {
|
||||
return;
|
||||
}
|
||||
|
||||
MovingObjectPosition movingObjectPosition = event.target;
|
||||
int x = movingObjectPosition.blockX;
|
||||
int y = movingObjectPosition.blockY;
|
||||
|
||||
Reference in new issue
Block a user