Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
50bed12f66 | ||
|
|
0d6d7ff9aa | ||
|
|
0b7ae46d2e | ||
|
|
a0cfcc9da6 | ||
|
|
171c5b29f6 | ||
|
|
b5ad490947 | ||
|
|
00051c4594 | ||
|
|
d913e245ed | ||
|
|
f253dfc5dc | ||
|
|
6582ea3e56 | ||
|
|
bb96e7deae | ||
|
|
7643d11e14 | ||
|
|
4eb26e9d77 | ||
|
|
2b1843b74d | ||
|
|
0b312261db | ||
|
|
bd0746583a | ||
|
|
b4143fb0ef | ||
|
|
77c47e9071 | ||
|
|
f27b66c53f | ||
|
|
ad16588e3b | ||
|
|
5acbd0b977 | ||
|
|
7e22128279 | ||
|
|
65e11fa564 | ||
|
|
355c85598e |
No files matched your search
@@ -32,6 +32,7 @@
|
||||
*.[dD][lL][lL] binary
|
||||
*.[dD][yY][lL][iI][bB] binary
|
||||
*.[pP][sS][dD] binary
|
||||
*.[pP][dD][nN] binary
|
||||
*.[tT][tT][fF] binary
|
||||
*.[oO][tT][fF] binary
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 231 B After Width: | Height: | Size: 231 B |
|
Before Width: | Height: | Size: 204 B After Width: | Height: | Size: 204 B |
|
Before Width: | Height: | Size: 220 B After Width: | Height: | Size: 220 B |
|
Before Width: | Height: | Size: 220 B After Width: | Height: | Size: 220 B |
|
Before Width: | Height: | Size: 200 B After Width: | Height: | Size: 200 B |
|
Before Width: | Height: | Size: 222 B After Width: | Height: | Size: 222 B |
|
Before Width: | Height: | Size: 219 B After Width: | Height: | Size: 219 B |
@@ -1,12 +1,12 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
api('com.github.GTNewHorizons:ForestryMC:4.11.7:dev')
|
||||
implementation('com.github.GTNewHorizons:GTNHLib:0.9.13:dev')
|
||||
api('com.github.GTNewHorizons:ForestryMC:4.11.32:dev')
|
||||
implementation('com.github.GTNewHorizons:GTNHLib:0.11.35:dev')
|
||||
|
||||
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.8.63-GTNH:dev')
|
||||
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.8.118-GTNH:dev')
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.55:api')
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.63:api')
|
||||
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev')
|
||||
compileOnly("curse.maven:extrabiomesxl-60041:2273301")
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
#This file is generated by updateDaemonJvm
|
||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c5ee947fbfb70bc347d8d531e3a578c4/redirect
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/5ee463876563a46fff651cce1bc53a4c/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c5ee947fbfb70bc347d8d531e3a578c4/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/5ee463876563a46fff651cce1bc53a4c/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/e1118b4c7c2858d28154d086dbff010e/redirect
|
||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/59a9771cad43219260d9aac9a8ec4d6a/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c5ee947fbfb70bc347d8d531e3a578c4/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/5ee463876563a46fff651cce1bc53a4c/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/832229f0f6f0be60ed817c5a5e5848eb/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/b96cb7670c095245220e7d01d5927b58/redirect
|
||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/97d46b5ff4df0bf61e95652a190a5567/redirect
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/9ef54a08e06b0754cee9fc95ed3a3134/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/97d46b5ff4df0bf61e95652a190a5567/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/9ef54a08e06b0754cee9fc95ed3a3134/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1df82b76031285ef2e6a4f59ffe9299d/redirect
|
||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/c7d5be6a02945ac2e045048ee54a7d32/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/97d46b5ff4df0bf61e95652a190a5567/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/9ef54a08e06b0754cee9fc95ed3a3134/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/643f404f769811f5f265fd66f7af5d89/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/38256085a73e137cb4937ea9c4807fec/redirect
|
||||
toolchainVersion=25
|
||||
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/b631911858264c0b6e4d6603d677ff5218766cee/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
|
||||
@@ -17,5 +17,5 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.19'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.27'
|
||||
}
|
||||
@@ -130,7 +130,7 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return getType(meta).getIcon(MultipassBlockRenderer.getLayer());
|
||||
return TileType.get(meta >>> 16 & 0xFF).icons[MultipassBlockRenderer.getLayer()];
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -167,6 +167,9 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderColor(int meta) {
|
||||
if (!MultipassBlockRenderer.isRendering()) {
|
||||
return EnumFlowerColor.get(meta & 0xFF).getColor(false);
|
||||
}
|
||||
return colorMultiplier(meta);
|
||||
}
|
||||
|
||||
@@ -177,14 +180,14 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
|
||||
|
||||
@Override
|
||||
public int colorMultiplier(int meta) {
|
||||
BlockType type = getType(meta);
|
||||
if (MultipassBlockRenderer.getLayer() == 0) {
|
||||
int layer = MultipassBlockRenderer.getLayer();
|
||||
if (layer == 0) {
|
||||
return 0xffffff;
|
||||
}
|
||||
if (MultipassBlockRenderer.getLayer() == 1) {
|
||||
return type.color1.getColor(false);
|
||||
if (layer == 1) {
|
||||
return EnumFlowerColor.get(meta & 0xFF).getColor(false);
|
||||
}
|
||||
return type.color2.getColor(false);
|
||||
return EnumFlowerColor.get(meta >>> 8 & 0xFF).getColor(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -38,8 +38,8 @@ public class ItemInsulatedTube extends Item {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List<ItemStack> list) {
|
||||
for (Material mat : Material.values()) {
|
||||
for (Insulate ins : Insulate.values()) {
|
||||
for (Material mat : Material.VALUES) {
|
||||
for (Insulate ins : Insulate.VALUES) {
|
||||
list.add(new ItemStack(this, 1, mat.ordinal() + ins.ordinal() * 128));
|
||||
}
|
||||
}
|
||||
@@ -97,6 +97,8 @@ public class ItemInsulatedTube extends Item {
|
||||
Bronze(0xddc276, "bronze"),
|
||||
Iron(0xd8d8d8, "iron");
|
||||
|
||||
public static final Material[] VALUES = values();
|
||||
|
||||
private final int color;
|
||||
private final String name;
|
||||
|
||||
@@ -106,7 +108,7 @@ public class ItemInsulatedTube extends Item {
|
||||
}
|
||||
|
||||
public static Material get(int i) {
|
||||
return values()[i % values().length];
|
||||
return VALUES[i % VALUES.length];
|
||||
}
|
||||
|
||||
public int getColor() {
|
||||
@@ -127,6 +129,8 @@ public class ItemInsulatedTube extends Item {
|
||||
Stone(0x6d6d6d, "smoothStone"),
|
||||
Sandstone(0xc1b989, "sandstone");
|
||||
|
||||
public static final Insulate[] VALUES = values();
|
||||
|
||||
private final int color;
|
||||
private final String name;
|
||||
|
||||
@@ -136,7 +140,7 @@ public class ItemInsulatedTube extends Item {
|
||||
}
|
||||
|
||||
public static Insulate get(int i) {
|
||||
return values()[i / 128 % values().length];
|
||||
return values()[i / 128 % VALUES.length];
|
||||
}
|
||||
|
||||
public int getColor() {
|
||||
|
||||
@@ -48,7 +48,7 @@ public class BlockPlant extends BlockBush {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
for (Type t : Type.values()) {
|
||||
for (Type t : Type.VALUES) {
|
||||
t.icon = Botany.proxy.getIcon(register, t.name().toLowerCase());
|
||||
}
|
||||
}
|
||||
@@ -61,7 +61,7 @@ public class BlockPlant extends BlockBush {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return Type.values()[meta % Type.values().length].icon;
|
||||
return Type.VALUES[meta % Type.VALUES.length].icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -72,7 +72,7 @@ public class BlockPlant extends BlockBush {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List<ItemStack> list) {
|
||||
for (Type type : Type.values()) {
|
||||
for (Type type : Type.VALUES) {
|
||||
list.add(type.get());
|
||||
}
|
||||
}
|
||||
@@ -135,6 +135,7 @@ public class BlockPlant extends BlockBush {
|
||||
DeadFlower("deadFlower"),
|
||||
DecayingFlower("decayingFlower");
|
||||
|
||||
public static final Type[] VALUES = values();
|
||||
public IIcon icon;
|
||||
|
||||
private final String name;
|
||||
@@ -144,7 +145,7 @@ public class BlockPlant extends BlockBush {
|
||||
}
|
||||
|
||||
public static Type get(int id) {
|
||||
return values()[id % values().length];
|
||||
return VALUES[id % VALUES.length];
|
||||
}
|
||||
|
||||
public ItemStack get() {
|
||||
|
||||
@@ -18,7 +18,7 @@ public class ItemWeed extends ItemBlock {
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
return BlockPlant.Type.values()[stack.getItemDamage()].getName();
|
||||
return BlockPlant.Type.VALUES[stack.getItemDamage()].getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,6 +12,7 @@ import net.minecraftforge.common.MinecraftForge;
|
||||
import binnie.Binnie;
|
||||
import binnie.core.block.MultipassBlockRenderer;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.core.config.BCConfig;
|
||||
import binnie.core.craftgui.minecraft.ModuleCraftGUI;
|
||||
import binnie.core.gui.BinnieCoreGUI;
|
||||
import binnie.core.gui.BinnieGUIHandler;
|
||||
@@ -78,7 +79,9 @@ public class BinnieCore extends AbstractMod {
|
||||
}
|
||||
|
||||
addModule(new ModuleCraftGUI());
|
||||
addModule(new ModuleStorage());
|
||||
if (!BCConfig.disableCompartments) {
|
||||
addModule(new ModuleStorage());
|
||||
}
|
||||
addModule(new ModuleItems());
|
||||
if (Loader.isModLoaded("BuildCraft|Silicon")) {
|
||||
addModule(new ModuleTrigger());
|
||||
|
||||
@@ -17,6 +17,8 @@ public class ItemMetadata extends ItemBlock {
|
||||
|
||||
public ItemMetadata(Block block) {
|
||||
super(block);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -14,6 +14,7 @@ public class MultipassBlockRenderer implements ISimpleBlockRenderingHandler {
|
||||
|
||||
public static MultipassBlockRenderer instance;
|
||||
private static int layer = 0;
|
||||
private static boolean rendering = false;
|
||||
|
||||
public MultipassBlockRenderer() {
|
||||
MultipassBlockRenderer.instance = this;
|
||||
@@ -23,31 +24,49 @@ public class MultipassBlockRenderer implements ISimpleBlockRenderingHandler {
|
||||
return MultipassBlockRenderer.layer;
|
||||
}
|
||||
|
||||
public static boolean isRendering() {
|
||||
return MultipassBlockRenderer.rendering;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer) {
|
||||
IMultipassBlock multipassBlock = (IMultipassBlock) block;
|
||||
int passes = multipassBlock.getNumberOfPasses();
|
||||
|
||||
block.setBlockBoundsForItemRender();
|
||||
renderer.setRenderBoundsFromBlock(block);
|
||||
GL11.glTranslatef(-0.5f, -0.5f, -0.5f);
|
||||
|
||||
MultipassBlockRenderer.layer = 0;
|
||||
while (MultipassBlockRenderer.layer < ((IMultipassBlock) block).getNumberOfPasses()) {
|
||||
renderItem(block, renderer, meta);
|
||||
MultipassBlockRenderer.layer++;
|
||||
MultipassBlockRenderer.rendering = true;
|
||||
try {
|
||||
for (int pass = 0; pass < passes; ++pass) {
|
||||
MultipassBlockRenderer.layer = pass;
|
||||
renderItem(block, multipassBlock, renderer, meta);
|
||||
}
|
||||
} finally {
|
||||
MultipassBlockRenderer.layer = 0;
|
||||
MultipassBlockRenderer.rendering = false;
|
||||
}
|
||||
MultipassBlockRenderer.layer = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
||||
RenderBlocks renderer) {
|
||||
boolean r = true;
|
||||
MultipassBlockRenderer.layer = 0;
|
||||
while (MultipassBlockRenderer.layer < ((IMultipassBlock) block).getNumberOfPasses()) {
|
||||
r = renderer.renderStandardBlock(block, x, y, z);
|
||||
MultipassBlockRenderer.layer++;
|
||||
IMultipassBlock multipassBlock = (IMultipassBlock) block;
|
||||
int passes = multipassBlock.getNumberOfPasses();
|
||||
boolean rendered = true;
|
||||
|
||||
MultipassBlockRenderer.rendering = true;
|
||||
try {
|
||||
for (int pass = 0; pass < passes; ++pass) {
|
||||
MultipassBlockRenderer.layer = pass;
|
||||
rendered = renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
return rendered;
|
||||
} finally {
|
||||
MultipassBlockRenderer.layer = 0;
|
||||
MultipassBlockRenderer.rendering = false;
|
||||
}
|
||||
MultipassBlockRenderer.layer = 0;
|
||||
return r;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -60,8 +79,8 @@ public class MultipassBlockRenderer implements ISimpleBlockRenderingHandler {
|
||||
return BinnieCore.multipassRenderID;
|
||||
}
|
||||
|
||||
public void renderItem(Block block, RenderBlocks renderer, int meta) {
|
||||
setColor(((IMultipassBlock) block).colorMultiplier(meta));
|
||||
private void renderItem(Block block, IMultipassBlock multipassBlock, RenderBlocks renderer, int meta) {
|
||||
setColor(multipassBlock.colorMultiplier(meta));
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0f, -1.0f, 0.0f);
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package binnie.core.config;
|
||||
|
||||
import com.gtnewhorizon.gtnhlib.config.Config;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
|
||||
@Config(modid = BinnieCore.CORE_MODID)
|
||||
public class BCConfig {
|
||||
|
||||
@Config.Comment("If true, disables all compartment storage machines (no blocks/recipes will be registered).")
|
||||
@Config.DefaultBoolean(false)
|
||||
@Config.RequiresMcRestart
|
||||
public static boolean disableCompartments;
|
||||
}
|
||||
@@ -1,10 +1,7 @@
|
||||
package binnie.core.craftgui;
|
||||
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Deque;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.lwjgl.input.Mouse;
|
||||
@@ -168,17 +165,14 @@ public abstract class TopLevelWidget extends Widget implements ITopLevelWidget {
|
||||
}
|
||||
|
||||
public Deque<IWidget> calculateMousedOverWidgets() {
|
||||
Deque<IWidget> list = new ArrayDeque<>();
|
||||
for (IWidget widget : getQueuedWidgets(this)) {
|
||||
if (widget.calculateIsMouseOver()) {
|
||||
list.addLast(widget);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
Deque<IWidget> widgets = new ArrayDeque<>();
|
||||
addMousedOverWidgets(this, widgets);
|
||||
return widgets;
|
||||
}
|
||||
|
||||
private Collection<IWidget> getQueuedWidgets(IWidget widget) {
|
||||
List<IWidget> widgets = new ArrayList<>();
|
||||
private void addMousedOverWidgets(IWidget widget, Deque<IWidget> widgets) {
|
||||
if (!widget.isVisible()) return;
|
||||
|
||||
boolean addChildren = true;
|
||||
if (widget.isCroppedWidget()) {
|
||||
addChildren = widget.getCroppedZone().contains(widget.getCropWidget().getRelativeMousePosition());
|
||||
@@ -188,11 +182,12 @@ public abstract class TopLevelWidget extends Widget implements ITopLevelWidget {
|
||||
ListIterator<IWidget> li = widget.getWidgets().listIterator(widget.getWidgets().size());
|
||||
while (li.hasPrevious()) {
|
||||
IWidget child = li.previous();
|
||||
widgets.addAll(getQueuedWidgets(child));
|
||||
addMousedOverWidgets(child, widgets);
|
||||
}
|
||||
}
|
||||
widgets.add(widget);
|
||||
return widgets;
|
||||
if (widget.calculateIsMouseOver()) {
|
||||
widgets.addLast(widget);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -306,17 +306,22 @@ public class Widget implements IWidget {
|
||||
}
|
||||
|
||||
onUpdateClient();
|
||||
List<IWidget> deletedWidgets = new ArrayList<>();
|
||||
List<IWidget> deletedWidgets = null;
|
||||
for (IWidget widget : getWidgets()) {
|
||||
if (widget.hasAttribute(WidgetAttribute.NEEDS_DELETION)) {
|
||||
if (deletedWidgets == null) {
|
||||
deletedWidgets = new ArrayList<>();
|
||||
}
|
||||
deletedWidgets.add(widget);
|
||||
} else {
|
||||
widget.updateClient();
|
||||
}
|
||||
}
|
||||
|
||||
for (IWidget widget : deletedWidgets) {
|
||||
deleteChild(widget);
|
||||
if (deletedWidgets != null) {
|
||||
for (IWidget widget : deletedWidgets) {
|
||||
deleteChild(widget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -188,7 +188,9 @@ public class WindowFieldKit extends Window {
|
||||
glassOffsetX *= 1.0f - analyseProgress;
|
||||
glassOffsetY += glassVY;
|
||||
glassOffsetY *= 1.0f - analyseProgress;
|
||||
GlassControl.setOffset(new IPoint(glassOffsetX, glassOffsetY));
|
||||
if (GlassControl != null) {
|
||||
GlassControl.setOffset(new IPoint(glassOffsetX, glassOffsetY));
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshSpecies() {
|
||||
|
||||
@@ -201,22 +201,22 @@ public class ContainerCraftGUI extends Container {
|
||||
Slot shiftClickedSlot = inventorySlots.get(index);
|
||||
ItemStack itemstack = null;
|
||||
if (shiftClickedSlot.getHasStack()) {
|
||||
itemstack = shiftClickedSlot.getStack().copy();
|
||||
itemstack = shiftClickedSlot.getStack();
|
||||
}
|
||||
|
||||
IInventory playerInventory = player.inventory;
|
||||
IInventory entityInventory = window.getInventory();
|
||||
IInventory windowInventory = window.getWindowInventory();
|
||||
IInventory fromPlayer = (entityInventory == null) ? windowInventory : entityInventory;
|
||||
int[] target = new int[36];
|
||||
for (int i = 0; i < target.length; ++i) {
|
||||
target[i] = i;
|
||||
}
|
||||
|
||||
TransferRequest request;
|
||||
if (shiftClickedSlot.inventory == playerInventory) {
|
||||
request = new TransferRequest(itemstack, fromPlayer).setOrigin(shiftClickedSlot.inventory);
|
||||
} else {
|
||||
int[] target = new int[36];
|
||||
for (int i = 0; i < target.length; ++i) {
|
||||
target[i] = i;
|
||||
}
|
||||
request = new TransferRequest(itemstack, playerInventory).setOrigin(shiftClickedSlot.inventory)
|
||||
.setTargetSlots(target);
|
||||
}
|
||||
@@ -234,7 +234,7 @@ public class ContainerCraftGUI extends Container {
|
||||
ItemStack heldItem = player.inventory.getItemStack().copy();
|
||||
IInventory entityInventory = window.getInventory();
|
||||
heldItem = new TransferRequest(heldItem, entityInventory).setOrigin(player.inventory).setTargetSlots(new int[0])
|
||||
.setTargetTanks(new int[] { slotID }).transfer(true);
|
||||
.setTargetTanks(new int[] { slotID }).dropOverflow(player).transfer(true);
|
||||
|
||||
player.inventory.setItemStack(heldItem);
|
||||
|
||||
@@ -246,7 +246,14 @@ public class ContainerCraftGUI extends Container {
|
||||
}
|
||||
|
||||
public void handleNBT(Side side, EntityPlayer player, NBTTagCompound action) {
|
||||
if (handleNBTAction(side, player, action)) {
|
||||
sendContainerContents();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean handleNBTAction(Side side, EntityPlayer player, NBTTagCompound action) {
|
||||
final String actionType = action.getString(ACTION_TYPE);
|
||||
boolean slotRegistered = false;
|
||||
|
||||
if (side == Side.SERVER) {
|
||||
switch (actionType) {
|
||||
@@ -256,11 +263,7 @@ public class ContainerCraftGUI extends Container {
|
||||
final int slotIndex = action.getShort(SLOT_INDEX);
|
||||
final int slotNumber = action.getShort(SLOT_NUMBER);
|
||||
|
||||
createSlot(InventoryType.values()[slotType % 4], slotIndex, slotNumber);
|
||||
|
||||
for (ICrafting crafterObject : crafters) {
|
||||
crafterObject.sendContainerAndContentsToPlayer(this, getInventory());
|
||||
}
|
||||
slotRegistered = createSlot(InventoryType.values()[slotType % 4], slotIndex, slotNumber);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -275,6 +278,7 @@ public class ContainerCraftGUI extends Container {
|
||||
if (actionType.contains(TANK_UPDATE)) onTankUpdate(action);
|
||||
}
|
||||
}
|
||||
return slotRegistered;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -307,8 +311,7 @@ public class ContainerCraftGUI extends Container {
|
||||
|
||||
if (machineSync != null) machineSync.sendGuiNBT(syncedNBT);
|
||||
|
||||
Map<String, NBTTagCompound> sentThisTime = new HashMap<>();
|
||||
NBTTagList actions = new NBTTagList();
|
||||
NBTTagList actions = null;
|
||||
|
||||
for (Map.Entry<String, NBTTagCompound> entry : syncedNBT.entrySet()) {
|
||||
final String actionType = entry.getKey();
|
||||
@@ -319,10 +322,16 @@ public class ContainerCraftGUI extends Container {
|
||||
|
||||
if (action.equals(actionPrev)) continue;
|
||||
|
||||
if (actions == null) {
|
||||
actions = new NBTTagList();
|
||||
}
|
||||
actions.appendTag(action);
|
||||
sentThisTime.put(actionType, action);
|
||||
sentNBT.put(actionType, action);
|
||||
}
|
||||
|
||||
syncedNBT.clear();
|
||||
if (actions == null) return;
|
||||
|
||||
NBTTagCompound actionsBatch = new NBTTagCompound();
|
||||
actionsBatch.setString(ACTION_TYPE, ACTION_BATCH);
|
||||
actionsBatch.setTag(ACTIONS, actions);
|
||||
@@ -333,9 +342,6 @@ public class ContainerCraftGUI extends Container {
|
||||
BinnieCore.proxy.sendToPlayer(packet, playerMP);
|
||||
}
|
||||
}
|
||||
|
||||
sentNBT.putAll(sentThisTime);
|
||||
syncedNBT.clear();
|
||||
}
|
||||
|
||||
private NBTTagCompound createErrorNBT(IErrorStateSource error) {
|
||||
@@ -486,19 +492,34 @@ public class ContainerCraftGUI extends Container {
|
||||
}
|
||||
|
||||
public void receiveNBT(Side side, EntityPlayer player, NBTTagCompound action) {
|
||||
if (receiveNBTAction(side, player, action)) {
|
||||
sendContainerContents();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean receiveNBTAction(Side side, EntityPlayer player, NBTTagCompound action) {
|
||||
String actionType = action.getString(ACTION_TYPE);
|
||||
if (actionType.equals(ACTION_BATCH)) {
|
||||
boolean slotRegistered = false;
|
||||
NBTTagList actionsBatch = action.getTagList(ACTIONS, TAG_COMPOUND);
|
||||
for (int i = 0; i < actionsBatch.tagCount(); i++) {
|
||||
receiveNBT(side, player, actionsBatch.getCompoundTagAt(i));
|
||||
slotRegistered |= receiveNBTAction(side, player, actionsBatch.getCompoundTagAt(i));
|
||||
}
|
||||
return;
|
||||
return slotRegistered;
|
||||
}
|
||||
handleNBT(side, player, action);
|
||||
boolean slotRegistered = handleNBTAction(side, player, action);
|
||||
window.receiveGuiNBT(getSide(), player, actionType, action);
|
||||
INetwork.ReceiveGuiNBT machine = Machine.getInterface(INetwork.ReceiveGuiNBT.class, window.getInventory());
|
||||
if (machine == null) return;
|
||||
machine.receiveGuiNBT(getSide(), player, actionType, action);
|
||||
if (machine != null) {
|
||||
machine.receiveGuiNBT(getSide(), player, actionType, action);
|
||||
}
|
||||
return slotRegistered;
|
||||
}
|
||||
|
||||
private void sendContainerContents() {
|
||||
for (ICrafting crafter : crafters) {
|
||||
crafter.sendContainerAndContentsToPlayer(this, getInventory());
|
||||
}
|
||||
}
|
||||
|
||||
public Slot getOrCreateSlot(InventoryType inventoryType, int slotIndex) {
|
||||
@@ -522,13 +543,15 @@ public class ContainerCraftGUI extends Container {
|
||||
};
|
||||
}
|
||||
|
||||
private void createSlot(InventoryType type, int index, int slotNumber) {
|
||||
if (inventorySlots.get(slotNumber) != null) return;
|
||||
private boolean createSlot(InventoryType type, int index, int slotNumber) {
|
||||
if (inventorySlots.get(slotNumber) != null) return false;
|
||||
|
||||
IInventory inventory = getInventory(type);
|
||||
Slot slot = new CustomSlot(inventory, index);
|
||||
slot.slotNumber = slotNumber;
|
||||
inventorySlots.add(slotNumber, slot);
|
||||
inventoryItemStacks.add(slotNumber, null);
|
||||
ItemStack stack = slot.getStack();
|
||||
inventoryItemStacks.add(slotNumber, stack == null ? null : stack.copy());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -90,6 +90,7 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
zLevel = 10.0f;
|
||||
GuiScreen.itemRender.zLevel = zLevel;
|
||||
|
||||
GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
|
||||
window.render();
|
||||
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
@@ -102,7 +103,7 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
InventoryPlayer playerInventory = mc.thePlayer.inventory;
|
||||
draggedItem = playerInventory.getItemStack();
|
||||
if (draggedItem != null) {
|
||||
renderItem(new IPoint(mouseX - 8, mouseY - 8), draggedItem, false);
|
||||
GL11.glTranslatef(0.0f, 0.0f, 200.0f);
|
||||
renderItem(new IPoint(mouseX - 8, mouseY - 8), draggedItem, false);
|
||||
}
|
||||
GL11.glDisable(32826); // GL_RESCALE_NORMAL_EXT
|
||||
@@ -116,7 +117,6 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
} else {
|
||||
tooltip.setType(Tooltip.Type.STANDARD);
|
||||
window.getTooltip(tooltip);
|
||||
NEIHook.renderToolTips(mouseX, mouseY);
|
||||
}
|
||||
|
||||
if (tooltip.exists()) {
|
||||
@@ -240,12 +240,16 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
|
||||
@Override
|
||||
protected void keyTyped(char c, int key) {
|
||||
NEIHook.lastKeyTyped(key, c);
|
||||
boolean noFocusedWidget = window.getFocusedWidget() == null;
|
||||
|
||||
if (key == 1 || (key == mc.gameSettings.keyBindInventory.getKeyCode() && window.getFocusedWidget() == null)) {
|
||||
if (noFocusedWidget) {
|
||||
NEIHook.lastKeyTyped(key, c);
|
||||
}
|
||||
|
||||
if (key == 1 || (key == mc.gameSettings.keyBindInventory.getKeyCode() && noFocusedWidget)) {
|
||||
mc.thePlayer.closeScreen();
|
||||
}
|
||||
IWidget origin = (window.getFocusedWidget() == null) ? window : window.getFocusedWidget();
|
||||
IWidget origin = noFocusedWidget ? window : window.getFocusedWidget();
|
||||
window.callEvent(new EventKey.Down(origin, c, key));
|
||||
}
|
||||
|
||||
@@ -444,7 +448,6 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
}
|
||||
|
||||
GuiScreen.itemRender.renderItemOverlayIntoGUI(font, mc.renderEngine, item, (int) pos.x(), (int) pos.y(), null);
|
||||
GL11.glClear(256);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glPopAttrib();
|
||||
}
|
||||
|
||||