Compare commits

...

59 Commits

Author SHA1 Message Date
PrototypeTrousers 7ab89a0657 update bogosort compat 2023-02-05 23:03:34 -03:00
PrototypeTrousers dd2f1c6dc7 attempt to fix stacking issues 2023-01-28 23:45:14 -03:00
PrototypeTrousers f14407b87a attempted fixes for spatialIO, security and ShaderTech compat 2023-01-28 14:09:23 -03:00
PrototypeTrousers 04f006695e fix terminals not being usable on servers 2023-01-12 12:55:35 -03:00
PrototypeTrousers 4f36ccf64d bump version 2023-01-09 14:25:24 -03:00
PrototypeTrousers d9b4410c94 attempt to fix #197 2023-01-09 02:26:48 -03:00
PrototypeTrousers 9bbd0ad61b ASM Patch ItemStack packet size setter and getter. code from StackUp 2023-01-09 02:15:45 -03:00
MycroftJr 662a7805dd add ItemStack to/from NBT helpers (#202)
to simplify the "stackSize" NBT tag workaround
2023-01-09 01:10:35 -03:00
PrototypeTrousers c46eadec08 Merge branch 'revert-async-repo' into AE2-Omnifactory 2023-01-09 01:08:47 -03:00
PrototypeTrousers 148207f5c3 Merge branch 'gtceu-fix' into PrototypeTrousers/AE2-Omnifactory 2023-01-09 01:08:39 -03:00
PrototypeTrousers 3ae251f098 Revert "Merge remote-tracking branch 'LasmGratel/async-itemrepo' into AE2-Omnifactory"
This reverts commit 86a42e970f.
2023-01-09 01:03:55 -03:00
PrototypeTrousers 82a906886f Revert "delay repo view sorting to once per tick"
This reverts commit d9588441b0.
2023-01-09 01:03:51 -03:00
PrototypeTrousers 5b2c6658c0 Revert "synchronizedList must be in a synchronized block when iterating"
This reverts commit 1f12fc5e91.
2023-01-09 01:03:51 -03:00
PrototypeTrousers 653557bc65 wip. auto-crafting still broken 2023-01-07 18:25:31 -03:00
PrototypeTrousers dde87448a9 initial patch 2023-01-07 12:37:21 -03:00
TheAirBlow 8c29eeecdc Add support for RecipeStages and ItemStages (#198)
* RecipeStages info in README

* Add support for RecipeStages

* Add support for ItemStages
2022-12-26 09:03:49 -03:00
PrototypeTrousers d852d0c216 bump version 2022-12-10 21:26:55 -03:00
Dane Strandboge f9bb00a7e7 fix patterns not respecting item models and colors... (#193)
when shift key is held and the "output" item in the pattern is rendered instead of the base pattern texture

Consequences:
- The "output" item of the pattern will now be rendered always when shift is held, not just when the TransformType is GUI.
    - This means that you will see the "output" item now for in-world patterns, as well as the rendered model in the player's hand or offhand
    - However, I honestly think this is an improvement from before
2022-12-10 21:17:26 -03:00
PrototypeTrousers 9f7e42ca7d fix lang entry 2022-12-07 20:29:46 -03:00
PrototypeTrousers b76c18fedf fix JEI transfer handler breaking in some instances 2022-12-07 20:29:39 -03:00
PrototypeTrousers 98ce8235bb revert change made to fix nee compat but broke it instead 2022-11-22 20:30:20 -03:00
PrototypeTrousers e1ea4ae22f Revert "restore method name to keep compat with NEE"
This reverts commit c5607bda4e.
2022-11-22 20:29:04 -03:00
PrototypeTrousers 20ba83c529 bump version 2022-11-22 19:11:05 -03:00
PrototypeTrousers 225a4d5ab6 fix items voiding under certain circumstances 2022-11-22 19:04:59 -03:00
PrototypeTrousers bd4f03652e bump version 2022-11-20 14:05:29 -03:00
PrototypeTrousers d6650f9617 Merge remote-tracking branch 'TheAirBlow/AE2-Omnifactory' into AE2-Omnifactory 2022-11-20 14:04:46 -03:00
PrototypeTrousers c5607bda4e restore method name to keep compat with NEE 2022-11-20 14:03:36 -03:00
PrototypeTrousers 11af1f2111 actually sort.. with invTweaks AND bogosort... 2022-11-20 14:00:18 -03:00
TheAirBlow 7748f7c92d Fix #189 + replace curseforge with curse.maven 2022-11-20 19:32:36 +05:00
PrototypeTrousers 801fec3eaa another attempt to fix async item view crashes 2022-11-17 18:22:21 -03:00
PrototypeTrousers de324aad91 rename 9 slot fluid interface texture 2022-11-11 20:51:22 -03:00
PrototypeTrousers 16ccb2ee46 Fix blocks connecting to ME cables. Give boost to chisel facades 2022-11-08 23:05:41 -03:00
PrototypeTrousers bd0d2a1f28 0.54.11 2022-11-08 18:01:39 -03:00
PrototypeTrousers 9abd53a8e8 fix encoded patterns not showing the encoded item in AE GUIs 2022-11-08 18:01:00 -03:00
PrototypeTrousers 1f12fc5e91 synchronizedList must be in a synchronized block when iterating 2022-11-08 18:00:30 -03:00
Yang Xizhi 87fcc6c267 update nbt when accepting result (#180) 2022-11-08 17:46:17 -03:00
PrototypeTrousers e301459dfa bump version 2022-10-29 10:32:16 -03:00
Yang Xizhi bf802f1c6f fix ae fluid inventory fluid exceeding (#174)
* ae fluid inventory fix
2022-10-29 10:31:54 -03:00
Xikaro 7ba4ca6923 External improvements (#166)
* lang

* Update controller_column_lights.png.mcmeta

* energy cell

cells display internal energy storage along the bar

* 3D drive

* drive fix model

* 3D chest

* Update ru_ru.lang

* Update ru_ru.lang

* model fix drive and chest
2022-10-27 20:15:16 -03:00
PrototypeTrousers 53ed861e23 isolate the oversized slots and itemhandlers 2022-10-27 20:13:44 -03:00
PrototypeTrousers 833f8aca2a More damaged item search work. GT tools are so special 2022-10-26 13:29:35 -03:00
PrototypeTrousers 9bcf45b7e2 add a healthy 1 sec delay between JEI transfer updates to avoid horrible
GC pressure
2022-10-25 22:32:53 -03:00
PrototypeTrousers b2847677ed forgot to check the items already in the 3x3 grid 2022-10-24 17:29:25 -03:00
PrototypeTrousers 95845d5a6c 54.4 2022-10-24 17:08:44 -03:00
PrototypeTrousers 286a3631be Merge branch 'mytsag-crystal-fix' into AE2-Omnifactory 2022-10-24 17:08:25 -03:00
PrototypeTrousers 6506301049 fix fluid interfaces / configuration terminal not showing all the slots 2022-10-24 17:05:27 -03:00
PrototypeTrousers 422543f205 check player inv for items that can be used to craft 2022-10-24 16:38:25 -03:00
PrototypeTrousers 1eec160b74 look for damageable items of the same type if substitutions are disabled 2022-10-24 16:09:22 -03:00
PrototypeTrousers de23b62493 some JEI work. missing player inventory check 2022-10-22 00:06:18 -03:00
Yang Xizhi 2b6299f2b0 fix expended pattern terminal can't place item manually (#161) 2022-10-20 16:35:20 -03:00
Yang Xizhi b495c972c4 add dev jar artifacts (#160) 2022-10-20 16:35:11 -03:00
PrototypeTrousers 7722dcc720 bump version. remove dead maven repo 2022-10-19 18:16:44 -03:00
PrototypeTrousers c4d5add5f1 allow part interfaces to be copied 2022-10-19 18:05:04 -03:00
PrototypeTrousers 348e6436b8 fix processing patterns encoding as invalid 2022-10-19 18:00:01 -03:00
PrototypeTrousers 92457ac680 bump version 2022-10-18 23:59:25 -03:00
PrototypeTrousers 9e53737635 Merge branch 'jei-transfer-highlight' into AE2-Omnifactory 2022-10-18 23:58:58 -03:00
PrototypeTrousers 0e0729166f Fix WCT invisible stacksizes, OOB when opening pattern terminal
FIx security station card slot being reaaally off
2022-10-18 23:56:40 -03:00
PrototypeTrousers 15a1e8f150 attempt to fix fluid interfaces capacity desync 2022-10-18 20:51:52 -03:00
PrototypeTrousers b443f1ce57 refactor pattern encoding terminals 2022-10-18 20:48:20 -03:00
112 changed files with 2973 additions and 2603 deletions
+9 -6
View File
@@ -1,17 +1,21 @@
This is a fork of AE2 i made for trying to solve issues for the [Omnifactory](https://www.curseforge.com/minecraft/modpacks/omnifactory) modpack.
See https://github.com/PrototypeTrousers/Applied-Energistics-2/tree/AE2-Omnifactory branch for commits
and
https://github.com/PrototypeTrousers/Applied-Energistics-2/releases for the compiled jars.
See [AE2-Omnifactory](https://github.com/PrototypeTrousers/Applied-Energistics-2/tree/AE2-Omnifactory) branch for commits and [Releases](https://github.com/PrototypeTrousers/Applied-Energistics-2/releases) for the compiled jars.
# Applied Energistics 2 (PrototypeTrousers fork for Omnifactory)
## About
A Mod about Matter, Energy and using them to conquer the world.
A Mod about Matter, Energy and using them to conquer the world..
## RecipeStages
You need to add the following into a CraftTweaker script:
```
mods.recipestages.Recipes.setPackageStage("appeng", allStages);
```
The second argument allows you to customize which stages exactly you want to be craftable with AE2. Idk why would you like to restrict any, but you can.
## License
* Applied Energistics 2 API
- (c) 2013 - 2018 AlgorithmX2 et al
- [![License](https://img.shields.io/badge/License-MIT-red.svg?style=flat-square)](http://opensource.org/licenses/MIT)
@@ -25,7 +29,6 @@ A Mod about Matter, Energy and using them to conquer the world..
- [![License](https://img.shields.io/badge/License-No%20Restriction-green.svg?style=flat-square)](https://creativecommons.org/publicdomain/zero/1.0/)
## Credits
Thanks to
* Notch et al for Minecraft
+3
View File
@@ -21,6 +21,7 @@ buildscript {
mavenLocal()
jcenter()
mavenCentral()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
@@ -65,6 +66,8 @@ archivesBaseName = aebasename
jar {
manifest {
attributes 'FMLAT': 'appeng_at.cfg'
attributes "FMLCorePlugin": "appeng.core.AE2ELCore"
attributes "FMLCorePluginContainsFMLMod": "true"
}
from sourceSets.api.output
+1 -3
View File
@@ -4,7 +4,7 @@ aebuild=7
aegroup=appeng
aebasename=appliedenergistics2
extended=extended_life
extendedversion=v0.54.0
extendedversion=v0.54.20
#########################################################
# Versions #
#########################################################
@@ -24,8 +24,6 @@ ic2_version=2.8.73-ex112
top_version=1.12-1.4.23-16
cofhcore_version=1.12.2-4.5.2.19
crafttweaker_version=4.1.8.9
inventorytweaks_version=1.63
bogosorter_version=1.1.0
ctm_version=MC1.12.2-0.3.1.16
forestry_version=5.8.2.387
#########################################################
+8
View File
@@ -60,8 +60,16 @@ task sourceJar(type: Jar, overwrite: true) {
classifier = 'sources'
}
task devJar(type: Jar, overwrite: true) {
from sourceSets.api.output
from sourceSets.main.output
classifier = 'dev'
}
artifacts {
archives apiJar
archives javadocJar
archives sourceJar
archives devJar
}
+9 -8
View File
@@ -23,10 +23,12 @@ repositories {
url "https://cursemaven.com"
}
/*
maven {
name = "CurseForge"
url = "https://minecraft.curseforge.com/api/maven/"
}
*/
maven {
name "Mobius"
@@ -38,11 +40,6 @@ repositories {
url "http://dvs1.progwml6.com/files/maven"
}
maven {
name = "Tesla repo"
url "https://maven.mcmoddev.com"
}
maven {
name "Ellpeck"
url "https://maven.ellpeck.de"
@@ -88,6 +85,8 @@ dependencies {
// installable runtime dependencies
deobfCompile "curse.maven:gregtechceu-557242:3949406"
compileOnly "curse.maven:chisel-235279:2915375"
//mods "mcp.mobius.waila:Hwyla:${hwyla_version}"
mods "curse.maven:hwyla-253449:2568751"
mods "net.industrial-craft:industrialcraft-2:${ic2_version}:dev"
@@ -100,18 +99,20 @@ dependencies {
//Code chicken lib, GTCE dependency
deobfCompile "curse.maven:CCL-242818:2779848"
compileOnly "curse.maven:recipe-stages-280554:3405072"
compileOnly "curse.maven:item-stages-280316:2696769"
compileOnly "curse.maven:game-stages-268655:2951844"
compileOnly "net.darkhax.tesla:Tesla-1.12.2:${tesla_version}"
compileOnly "net.industrial-craft:industrialcraft-2:${ic2_version}:api"
compileOnly "mcjty.theoneprobe:TheOneProbe-1.12:${top_version}:api"
compileOnly "cofh:CoFHCore:${cofhcore_version}:deobf"
compileOnly "CraftTweaker2:CraftTweaker2-API:${crafttweaker_version}"
compileOnly "inventory-tweaks:InventoryTweaks:${inventorytweaks_version}:api"
compileOnly "inventory-bogo-sorter:bogosorter:${bogosorter_version}"
compileOnly "curse.maven:inventory-tweaks-223094:2482482"
compileOnly "curse.maven:inventory-bogo-sorter-632327:4329854"
compileOnly "team.chisel.ctm:CTM:${ctm_version}"
compileOnly "de.ellpeck.actuallyadditions:ActuallyAdditions:1.12.2-r152.16:api"
deobfCompile "net.sengir.forestry:forestry_${minecraft_version}:$forestry_version"
// at runtime, use the full JEI jar
runtime "mezz.jei:jei_${minecraft_version}:${jei_version}"
@@ -39,7 +39,7 @@ import appeng.api.storage.IStorageChannel;
* - For fluids: AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class).createList()
* - Replace with the corresponding {@link IStorageChannel} type for non native channels
*/
public interface IItemList<T extends IAEStack<T>> extends IItemContainer<T>, Iterable<T>, Cloneable
public interface IItemList<T extends IAEStack<T>> extends IItemContainer<T>, Iterable<T>
{
/**
@@ -85,9 +85,4 @@ public interface IItemList<T extends IAEStack<T>> extends IItemContainer<T>, Ite
* resets stack sizes to 0.
*/
void resetStatus();
/**
* create a copy of this list.
*/
IItemList<T> clone();
}
}
@@ -0,0 +1,11 @@
package com.enderio.core.common.interfaces;
import net.minecraft.item.ItemStack;
import javax.annotation.Nonnull;
public interface IOverlayRenderAware {
public void renderItemOverlayIntoGUI(@Nonnull ItemStack stack, int xPosition, int yPosition);
}
@@ -44,6 +44,7 @@ import appeng.tile.networking.TileCableBusTESR;
import appeng.util.Platform;
import net.minecraft.block.Block;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.BlockFaceShape;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
@@ -413,6 +414,30 @@ public class BlockCableBus extends AEBaseTileBlock implements IAEFacade {
return world.getBlockState(pos);
}
@Override
public BlockFaceShape getBlockFaceShape(IBlockAccess world, IBlockState state, BlockPos pos, EnumFacing side) {
IFacadeContainer container = this.fc(world, pos);
if (container != null) {
IFacadePart facade = container.getFacade(AEPartLocation.fromFacing(side));
if (facade != null) {
return BlockFaceShape.SOLID;
}
}
return BlockFaceShape.UNDEFINED;
}
@Override
public void onEntityWalk(World world, BlockPos pos, Entity entityIn) {
IFacadeContainer container = this.fc(world, pos);
if (container != null) {
IFacadePart facade = container.getFacade(AEPartLocation.fromFacing(EnumFacing.UP));
if (facade != null) {
facade.getBlockState().getBlock().onEntityWalk(world, pos, entityIn);
}
}
super.onEntityWalk(world, pos, entityIn);
}
public static Class<? extends AEBaseTile> getNoTesrTile() {
return noTesrTile;
}
@@ -23,6 +23,7 @@ import appeng.api.parts.CableRenderMode;
import appeng.api.util.AEColor;
import appeng.block.AEBaseBlock;
import appeng.client.gui.AEBaseGui;
import appeng.client.render.crafting.ItemEncodedPatternBakedModel;
import appeng.client.render.effects.*;
import appeng.client.render.model.UVLModelLoader;
import appeng.client.render.tesr.InscriberTESR;
@@ -30,6 +31,7 @@ import appeng.client.render.textures.ParticleTextures;
import appeng.container.interfaces.IJEIGhostIngredients;
import appeng.core.AEConfig;
import appeng.core.AELog;
import appeng.core.Api;
import appeng.core.AppEng;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketAssemblerAnimation;
@@ -96,6 +98,9 @@ public class ClientHelper extends ServerHelper {
ClientRegistry.registerKeyBinding(binding);
this.bindings.put(key, binding);
}
Api.INSTANCE.definitions().items().encodedPattern().maybeItem().ifPresent(pattern ->
Minecraft.getMinecraft().getItemColors().registerItemColorHandler(ItemEncodedPatternBakedModel.PATTERN_ITEM_COLOR_HANDLER, pattern));
}
@SubscribeEvent
+37 -3
View File
@@ -39,6 +39,7 @@ import appeng.core.sync.packets.PacketSwapSlots;
import appeng.fluids.client.render.FluidStackSizeRenderer;
import appeng.fluids.container.slots.IMEFluidSlot;
import appeng.helpers.InventoryAction;
import appeng.items.misc.ItemEncodedPattern;
import appeng.util.Platform;
import appeng.util.item.AEItemStack;
import com.google.common.base.Joiner;
@@ -897,9 +898,42 @@ public abstract class AEBaseGui extends GuiContainer implements IMTModGuiContain
}
}
if (s instanceof SlotPlayerInv || s instanceof SlotPlayerHotBar) {
super.drawSlot(s);
if (!is.isEmpty() && is.getItem() instanceof ItemEncodedPattern) {
final ItemEncodedPattern iep = (ItemEncodedPattern) is.getItem();
final ItemStack out = iep.getOutput(is);
if (!out.isEmpty()) {
AppEngSlot appEngSlot = ((AppEngSlot) s);
appEngSlot.setDisplay(true);
appEngSlot.setReturnAsSingleStack(true);
this.zLevel = 100.0F;
this.itemRender.zLevel = 100.0F;
if (!this.isPowered()) {
drawRect(s.xPos, s.yPos, 16 + s.xPos, 16 + s.yPos, 0x66111111);
}
this.zLevel = 0.0F;
this.itemRender.zLevel = 0.0F;
// Annoying but easier than trying to splice into render item
super.drawSlot(s);
if (isShiftKeyDown()) {
this.stackSizeRenderer.renderStackSize(this.fontRenderer, AEItemStack.fromItemStack(out), s.xPos, s.yPos);
} else {
super.drawSlot(s);
}
return;
}
} else {
super.drawSlot(s);
}
} else if (s instanceof AppEngSlot) {
((AppEngSlot) s).setDisplay(true);
AppEngSlot appEngSlot = ((AppEngSlot) s);
appEngSlot.setDisplay(true);
appEngSlot.setReturnAsSingleStack(true);
this.zLevel = 100.0F;
this.itemRender.zLevel = 100.0F;
@@ -913,7 +947,7 @@ public abstract class AEBaseGui extends GuiContainer implements IMTModGuiContain
// Annoying but easier than trying to splice into render item
super.drawSlot(s);
this.stackSizeRenderer.renderStackSize(this.fontRenderer, AEItemStack.fromItemStack(((AppEngSlot) s).getDisplayStack()), s.xPos, s.yPos);
this.stackSizeRenderer.renderStackSize(this.fontRenderer, AEItemStack.fromItemStack(appEngSlot.getDisplayStack()), s.xPos, s.yPos);
return;
} else {
super.drawSlot(s);
@@ -35,6 +35,7 @@ import appeng.core.localization.GuiText;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketInventoryAction;
import appeng.fluids.client.gui.widgets.GuiFluidTank;
import appeng.fluids.helper.DualityFluidInterface;
import appeng.fluids.util.AEFluidStack;
import appeng.helpers.InventoryAction;
import appeng.parts.reporting.PartFluidInterfaceConfigurationTerminal;
@@ -155,7 +156,7 @@ public class GuiFluidInterfaceConfigurationTerminal extends AEBaseGui implements
int extraLines = numUpgradesMap.get(inv);
for (int row = 0; row < 1 + extraLines && linesDraw < LINES_ON_PAGE; ++row) {
for (int z = 0; z < 5; z++) {
for (int z = 0; z < DualityFluidInterface.NUMBER_OF_TANKS; z++) {
GuiFluidTank tankSlot;
if (!matchedInterfaces.contains(inv) && !this.matchedStacks.contains(inv.getInventory().getFluidInSlot(z + (row * 5)))) {
tankSlot = new GuiFluidTank(inv.getInventory(), z + (row * 5), z + (row * 5), (z * 18 + 22), offset, 16, 16, true);
@@ -243,7 +244,7 @@ public class GuiFluidInterfaceConfigurationTerminal extends AEBaseGui implements
final Object lineObj = this.lines.get(ex + x);
if (lineObj instanceof ClientDCInternalFluidInv) {
GlStateManager.color(1, 1, 1, 1);
final int width = 5 * 18;
final int width = DualityFluidInterface.NUMBER_OF_TANKS * 18;
int extraLines = numUpgradesMap.get(lineObj);
@@ -447,7 +448,7 @@ public class GuiFluidInterfaceConfigurationTerminal extends AEBaseGui implements
ClientDCInternalFluidInv o = this.byId.get(id);
if (o == null) {
this.byId.put(id, o = new ClientDCInternalFluidInv(5, id, sortBy, string, 1000));
this.byId.put(id, o = new ClientDCInternalFluidInv(DualityFluidInterface.NUMBER_OF_TANKS, id, sortBy, string, 1000));
this.refreshList = true;
}
@@ -61,6 +61,7 @@ import java.util.List;
import java.util.*;
import static appeng.client.render.BlockPosHighlighter.hilightBlock;
import static appeng.helpers.ItemStackHelper.stackFromNBT;
public class GuiInterfaceConfigurationTerminal extends AEBaseGui implements IJEIGhostIngredients {
@@ -299,11 +300,7 @@ public class GuiInterfaceConfigurationTerminal extends AEBaseGui implements IJEI
for (int x = 0; x < current.getInventory().getSlots(); x++) {
final String which = Integer.toString(x);
if (invData.hasKey(which)) {
NBTTagCompound tag = invData.getCompoundTag(which);
current.getInventory().setStackInSlot(x, new ItemStack(tag));
if (tag.hasKey("stackSize")) {
current.getInventory().getStackInSlot(x).setCount(tag.getInteger("stackSize"));
}
current.getInventory().setStackInSlot(x, stackFromNBT(invData.getCompoundTag(which)));
}
}
} catch (final NumberFormatException ignored) {
@@ -52,6 +52,7 @@ import java.io.IOException;
import java.util.*;
import static appeng.client.render.BlockPosHighlighter.hilightBlock;
import static appeng.helpers.ItemStackHelper.stackFromNBT;
public class GuiInterfaceTerminal extends AEBaseGui {
@@ -321,7 +322,7 @@ public class GuiInterfaceTerminal extends AEBaseGui {
for (int x = 0; x < current.getInventory().getSlots(); x++) {
final String which = Integer.toString(x);
if (invData.hasKey(which)) {
current.getInventory().setStackInSlot(x, new ItemStack(invData.getCompoundTag(which)));
current.getInventory().setStackInSlot(x, stackFromNBT(invData.getCompoundTag(which)));
}
}
} catch (final NumberFormatException ignored) {
@@ -103,7 +103,6 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
private int currentMouseY = 0;
private boolean delayedUpdate;
private boolean updateView = true;
protected int jeiOffset = Loader.isModLoaded("jei") ? 24 : 0;
public GuiMEMonitorable(final InventoryPlayer inventoryPlayer, final ITerminalHost te) {
@@ -162,7 +161,8 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
}
if (!this.delayedUpdate) {
this.updateView = true;
this.repo.updateView();
this.setScrollBar();
}
}
@@ -319,7 +319,8 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
this.searchField.setText(memoryText);
this.searchField.selectAll();
this.repo.setSearchString(memoryText);
this.updateView = true;
this.repo.updateView();
this.setScrollBar();
}
craftingGridOffsetX = Integer.MAX_VALUE;
@@ -380,7 +381,8 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
if (btn == 1 && this.searchField.isMouseIn(xCoord, yCoord)) {
this.searchField.setText("");
this.repo.setSearchString("");
this.updateView = true;
this.repo.updateView();
this.setScrollBar();
}
super.mouseClicked(xCoord, yCoord, btn);
@@ -474,7 +476,8 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
if (this.searchField.textboxKeyTyped(character, key)) {
this.repo.setSearchString(this.searchField.getText());
this.updateView = true;
this.repo.updateView();
this.setScrollBar();
// tell forge the key event is handled and should not be sent out
this.keyHandled = mouseInGui;
} else {
@@ -501,7 +504,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
this.delayedUpdate = false;
}
}
if (!this.delayedUpdate && updateView) {
if (!this.delayedUpdate) {
this.repo.updateView();
this.setScrollBar();
}
@@ -537,7 +540,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
this.ViewBox.set(this.configSrc.getSetting(Settings.VIEW_MODE));
}
this.updateView = true;
this.repo.updateView();
}
int getReservedSpace() {
@@ -55,8 +55,6 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource {
private GuiImgButton units;
private int tooltip = -1;
private boolean updateView = true;
public GuiNetworkStatus(final InventoryPlayer inventoryPlayer, final INetworkTool te) {
super(new ContainerNetworkStatus(inventoryPlayer, te));
final GuiScrollbar scrollbar = new GuiScrollbar();
@@ -208,17 +206,9 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource {
for (final IAEItemStack is : list) {
this.repo.postUpdate(is);
}
this.updateView = true;
}
@Override
public void updateScreen() {
if (updateView) {
this.repo.updateView();
this.setScrollBar();
updateView = false;
}
super.updateScreen();
this.repo.updateView();
this.setScrollBar();
}
private void setScrollBar() {
+85 -116
View File
@@ -39,20 +39,19 @@ import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.regex.Pattern;
public class ItemRepo {
private final IItemList<IAEItemStack> list = AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class).createList();
private final List<IAEItemStack> view;
private final ArrayList<IAEItemStack> view = new ArrayList<>();
private final IScrollSource src;
private final ISortSource sortSrc;
private int rowSize = 9;
private volatile String searchString = "";
private String searchString = "";
private IPartitionList<IAEItemStack> myPartitionList;
private String innerSearch = "";
private boolean hasPower;
@@ -60,9 +59,6 @@ public class ItemRepo {
public ItemRepo(final IScrollSource src, final ISortSource sortSrc) {
this.src = src;
this.sortSrc = sortSrc;
this.view = Collections.synchronizedList(new ArrayList<>());
list.forEach(this.view::add);
}
public IAEItemStack getReferenceItem(int idx) {
@@ -99,123 +95,111 @@ public class ItemRepo {
this.updateView();
}
private CompletableFuture<Void> searchTask = null;
public void updateView() {
if (searchTask != null) {
return;
this.view.clear();
this.view.ensureCapacity(this.list.size());
final Enum viewMode = this.sortSrc.getSortDisplay();
final Enum searchMode = AEConfig.instance().getConfigManager().getSetting(Settings.SEARCH_MODE);
final boolean needsZeroCopy = viewMode == ViewItems.CRAFTABLE;
if (searchMode == SearchBoxMode.JEI_AUTOSEARCH || searchMode == SearchBoxMode.JEI_MANUAL_SEARCH || searchMode == SearchBoxMode.JEI_AUTOSEARCH_KEEP || searchMode == SearchBoxMode.JEI_MANUAL_SEARCH_KEEP) {
this.updateJEI(this.searchString);
}
// Since sortSrc is final, so we can safely call it inside lambda
searchTask = CompletableFuture.supplyAsync(() -> {
IItemList<IAEItemStack> list = this.list.clone();
List<IAEItemStack> view = new ArrayList<>(list.size());
Enum viewMode = this.sortSrc.getSortDisplay();
final boolean terminalSearchToolTips = AEConfig.instance().getConfigManager().getSetting(Settings.SEARCH_TOOLTIPS) != YesNo.NO;
boolean needsZeroCopy = viewMode == ViewItems.CRAFTABLE;
boolean searchMod = false;
boolean terminalSearchToolTips = AEConfig.instance().getConfigManager().getSetting(Settings.SEARCH_TOOLTIPS) != YesNo.NO;
this.innerSearch = searchString.toLowerCase();
if (this.innerSearch.startsWith("@")) {
searchMod = true;
this.innerSearch = this.innerSearch.substring(1);
}
boolean searchMod = false;
String innerSearch = searchString.toLowerCase();
if (innerSearch.startsWith("@")) {
searchMod = true;
innerSearch = innerSearch.substring(1);
}
Pattern m = null;
Pattern m = null;
try {
m = Pattern.compile(this.innerSearch, Pattern.CASE_INSENSITIVE);
} catch (final Throwable ignore) {
try {
m = Pattern.compile(innerSearch, Pattern.CASE_INSENSITIVE);
} catch (final Throwable ignore) {
try {
m = Pattern.compile(Pattern.quote(innerSearch), Pattern.CASE_INSENSITIVE);
} catch (final Throwable __) {
return Collections.<IAEItemStack>emptyList();
m = Pattern.compile(Pattern.quote(this.innerSearch), Pattern.CASE_INSENSITIVE);
} catch (final Throwable __) {
return;
}
}
boolean notDone = false;
for (IAEItemStack is : this.list) {
if (this.myPartitionList != null) {
if (!this.myPartitionList.isListed(is)) {
continue;
}
}
if (viewMode == ViewItems.CRAFTABLE && !is.isCraftable()) {
continue;
}
for (IAEItemStack is : list) {
if (this.myPartitionList != null) {
if (!this.myPartitionList.isListed(is)) {
continue;
}
}
if (viewMode == ViewItems.STORED && is.getStackSize() == 0) {
continue;
}
if (viewMode == ViewItems.CRAFTABLE && !is.isCraftable()) {
continue;
}
final String dspName = (searchMod ? Platform.getModId(is) : Platform.getItemDisplayName(is)).toLowerCase();
boolean foundMatchingItemStack = true;
if (viewMode == ViewItems.STORED && is.getStackSize() == 0) {
continue;
}
final String dspName = (searchMod ? Platform.getModId(is) : Platform.getItemDisplayName(is)).toLowerCase();
boolean foundMatchingItemStack = true;
for (String term : innerSearch.split(" ")) {
if (term.length() > 1 && (term.startsWith("-") || term.startsWith("!"))) {
term = term.substring(1);
if (dspName.contains(term)) {
foundMatchingItemStack = false;
break;
}
} else if (!dspName.contains(term)) {
for (String term : innerSearch.split(" ")) {
if (term.length() > 1 && (term.startsWith("-") || term.startsWith("!"))) {
term = term.substring(1);
if (dspName.contains(term)) {
foundMatchingItemStack = false;
break;
}
}
if (terminalSearchToolTips && !foundMatchingItemStack) {
final List<String> tooltip = Platform.getTooltip(is);
for (final String line : tooltip) {
if (m.matcher(line).find()) {
foundMatchingItemStack = true;
break;
}
}
}
if (foundMatchingItemStack) {
if (needsZeroCopy) {
is = is.copy();
is.setStackSize(0);
}
view.add(is);
} else if (!dspName.contains(term)) {
foundMatchingItemStack = false;
break;
}
}
final Enum SortBy = this.sortSrc.getSortBy();
final Enum SortDir = this.sortSrc.getSortDir();
ItemSorters.setDirection((appeng.api.config.SortDir) SortDir);
ItemSorters.init();
if (SortBy == SortOrder.MOD) {
view.sort(ItemSorters.CONFIG_BASED_SORT_BY_MOD);
} else if (SortBy == SortOrder.AMOUNT) {
view.sort(ItemSorters.CONFIG_BASED_SORT_BY_SIZE);
} else if (SortBy == SortOrder.INVTWEAKS) {
if (InventoryBogoSortModule.isLoaded()) {
Collections.sort(this.view, InventoryBogoSortModule.COMPARATOR);
} else {
Collections.sort(this.view, ItemSorters.CONFIG_BASED_SORT_BY_INV_TWEAKS);
if (terminalSearchToolTips && !foundMatchingItemStack) {
final List<String> tooltip = Platform.getTooltip(is);
for (final String line : tooltip) {
if (m.matcher(line).find()) {
foundMatchingItemStack = true;
break;
}
}
}
if (foundMatchingItemStack) {
if (needsZeroCopy) {
is = is.copy();
is.setStackSize(0);
}
this.view.add(is);
}
}
final Enum SortBy = this.sortSrc.getSortBy();
final Enum SortDir = this.sortSrc.getSortDir();
ItemSorters.setDirection((appeng.api.config.SortDir) SortDir);
ItemSorters.init();
if (SortBy == SortOrder.MOD) {
Collections.sort(this.view, ItemSorters.CONFIG_BASED_SORT_BY_MOD);
} else if (SortBy == SortOrder.AMOUNT) {
Collections.sort(this.view, ItemSorters.CONFIG_BASED_SORT_BY_SIZE);
} else if (SortBy == SortOrder.INVTWEAKS) {
if (InventoryBogoSortModule.isLoaded()) {
Collections.sort(this.view, InventoryBogoSortModule.COMPARATOR);
} else {
view.sort(ItemSorters.CONFIG_BASED_SORT_BY_NAME);
Collections.sort(this.view, ItemSorters.CONFIG_BASED_SORT_BY_INV_TWEAKS);
}
return view;
}).thenAcceptAsync(view -> {
this.view.clear();
this.view.addAll(view);
}).thenRunAsync(() -> {
this.searchTask = null; // Prevent redundant cancellation
});
} else {
Collections.sort(this.view, ItemSorters.CONFIG_BASED_SORT_BY_NAME);
}
}
private void updateJEI(String filter) {
@@ -227,10 +211,6 @@ public class ItemRepo {
}
public void clear() {
if (searchTask != null) {
searchTask.cancel(true);
searchTask = null;
}
this.list.resetStatus();
}
@@ -256,17 +236,6 @@ public class ItemRepo {
public void setSearchString(@Nonnull final String searchString) {
this.searchString = searchString;
if (searchTask != null) {
searchTask.cancel(true);
searchTask = null;
}
// Passive JEI auto search
final Enum<?> searchMode = AEConfig.instance().getConfigManager().getSetting(Settings.SEARCH_MODE);
if (searchMode == SearchBoxMode.JEI_AUTOSEARCH || searchMode == SearchBoxMode.JEI_MANUAL_SEARCH || searchMode == SearchBoxMode.JEI_AUTOSEARCH_KEEP || searchMode == SearchBoxMode.JEI_MANUAL_SEARCH_KEEP) {
this.updateJEI(this.searchString);
}
}
public IItemList<IAEItemStack> getList() {
@@ -5,11 +5,11 @@ import appeng.items.misc.ItemEncodedPattern;
import com.google.common.collect.ImmutableMap;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.block.model.ItemOverrideList;
import net.minecraft.client.renderer.color.IItemColor;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
@@ -32,13 +32,22 @@ import java.util.List;
* the pattern is being
* rendered in the GUI, and not anywhere else.
*/
class ItemEncodedPatternBakedModel implements IBakedModel {
public class ItemEncodedPatternBakedModel implements IBakedModel {
private final IBakedModel baseModel;
private final ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> transforms;
private final CustomOverrideList overrides;
public static final IItemColor PATTERN_ITEM_COLOR_HANDLER = (stack, tintIndex) -> {
ItemEncodedPattern iep = (ItemEncodedPattern) stack.getItem();
ItemStack output = iep.getOutput(stack);
if (!output.isEmpty() && isShiftKeyDown()) {
return Minecraft.getMinecraft().getItemColors().colorMultiplier(output, tintIndex);
}
return 0xFFFFFF;
};
ItemEncodedPatternBakedModel(IBakedModel baseModel, ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> transforms) {
this.baseModel = baseModel;
this.transforms = transforms;
@@ -90,88 +99,8 @@ class ItemEncodedPatternBakedModel implements IBakedModel {
return PerspectiveMapWrapper.handlePerspective(this, this.transforms, cameraTransformType);
}
/**
* Since the ItemOverrideList handling comes before handling the perspective awareness (which is the first place
* where we
* know how we are being rendered) we need to remember the model of the crafting output, and make the decision on
* which to render later on.
* Sadly, Forge is pretty inconsistent when it will call the handlePerspective method, so some methods are called
* even on this interim-model.
* Usually those methods only matter for rendering on the ground and other cases, where we wouldn't render the
* crafting output model anyway,
* so in those cases we delegate to the model of the encoded pattern.
*/
private class ShiftHoldingModelWrapper implements IBakedModel {
private final IBakedModel outputModel;
private ShiftHoldingModelWrapper(IBakedModel outputModel) {
this.outputModel = outputModel;
}
@Override
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(ItemCameraTransforms.TransformType cameraTransformType) {
final IBakedModel selectedModel;
// No need to re-check for shift being held since this model is only handed out in that case
if (cameraTransformType == ItemCameraTransforms.TransformType.GUI) {
selectedModel = this.outputModel;
} else {
selectedModel = ItemEncodedPatternBakedModel.this.baseModel;
}
// Now retroactively handle the isGui3d call, for which we always return false below
if (selectedModel.isGui3d() != ItemEncodedPatternBakedModel.this.baseModel.isGui3d()) {
GlStateManager.enableLighting();
}
if (selectedModel instanceof IBakedModel) {
return selectedModel.handlePerspective(cameraTransformType);
}
return PerspectiveMapWrapper.handlePerspective(this, ItemEncodedPatternBakedModel.this.transforms, cameraTransformType);
}
@Override
public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, long rand) {
// This may be called for items on the ground, in which case we will always fall back to the pattern
return ItemEncodedPatternBakedModel.this.baseModel.getQuads(state, side, rand);
}
@Override
public boolean isAmbientOcclusion() {
return ItemEncodedPatternBakedModel.this.baseModel.isAmbientOcclusion();
}
@Override
public boolean isGui3d() {
// NOTE: Sadly, Forge will let Minecraft call this method before handling the perspective awareness
return ItemEncodedPatternBakedModel.this.baseModel.isGui3d();
}
@Override
public boolean isBuiltInRenderer() {
// This may be called for items on the ground, in which case we will always fall back to the pattern
return ItemEncodedPatternBakedModel.this.baseModel.isBuiltInRenderer();
}
@Override
public TextureAtlasSprite getParticleTexture() {
// This may be called for items on the ground, in which case we will always fall back to the pattern
return ItemEncodedPatternBakedModel.this.baseModel.getParticleTexture();
}
@Override
public ItemCameraTransforms getItemCameraTransforms() {
// This may be called for items on the ground, in which case we will always fall back to the pattern
return ItemEncodedPatternBakedModel.this.baseModel.getItemCameraTransforms();
}
@Override
public ItemOverrideList getOverrides() {
// This may be called for items on the ground, in which case we will always fall back to the pattern
return ItemEncodedPatternBakedModel.this.baseModel.getOverrides();
}
private static boolean isShiftKeyDown() {
return Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT);
}
/**
@@ -188,15 +117,11 @@ class ItemEncodedPatternBakedModel implements IBakedModel {
@Override
public IBakedModel handleItemState(IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity) {
boolean shiftHeld = Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT);
if (shiftHeld) {
if (isShiftKeyDown()) {
ItemEncodedPattern iep = (ItemEncodedPattern) stack.getItem();
ItemStack output = iep.getOutput(stack);
if (!output.isEmpty()) {
IBakedModel realModel = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getItemModel(output);
// Give the item model a chance to handle the overrides as well
realModel = realModel.getOverrides().handleItemState(realModel, output, world, entity);
return new ShiftHoldingModelWrapper(realModel);
return Minecraft.getMinecraft().getRenderItem().getItemModelWithOverrides(output, world, entity);
}
}
@@ -388,47 +388,8 @@ public abstract class AEBaseContainer extends Container {
if (Platform.itemComparisons().isSameItem(tis, t)) // t.isItemEqual(tis))
{
int maxSize = d.getSlotStackLimit();
int placeAble = maxSize - t.getCount();
if (tis.getCount() < placeAble) {
placeAble = tis.getCount();
}
t.setCount(t.getCount() + placeAble);
tis.setCount(tis.getCount() - placeAble);
d.putStack(t);
if (tis.getCount() <= 0) {
clickSlot.putStack(ItemStack.EMPTY);
d.onSlotChanged();
this.updateSlot(clickSlot);
this.updateSlot(d);
return ItemStack.EMPTY;
} else {
this.updateSlot(d);
}
}
}
}
}
// any match..
for (final Slot d : selectedSlots) {
if (d instanceof SlotDisabled || d instanceof SlotME) {
continue;
}
if (d.isItemValid(tis)) {
if (d.getHasStack()) {
final ItemStack t = d.getStack().copy();
if (Platform.itemComparisons().isSameItem(t, tis)) {
int maxSize = t.getMaxStackSize();
if (d.getSlotStackLimit() < maxSize) {
if (maxSize > d.getSlotStackLimit()) {
maxSize = d.getSlotStackLimit();
}
@@ -447,10 +408,6 @@ public abstract class AEBaseContainer extends Container {
clickSlot.putStack(ItemStack.EMPTY);
d.onSlotChanged();
// if ( worldEntity != null )
// worldEntity.markDirty();
// if ( hasMETiles ) updateClient();
this.updateSlot(clickSlot);
this.updateSlot(d);
return ItemStack.EMPTY;
@@ -458,7 +415,18 @@ public abstract class AEBaseContainer extends Container {
this.updateSlot(d);
}
}
} else {
}
}
}
// any match..
for (final Slot d : selectedSlots) {
if (d instanceof SlotDisabled || d instanceof SlotME) {
continue;
}
if (d.isItemValid(tis)) {
if (!d.getHasStack()) {
int maxSize = tis.getMaxStackSize();
if (maxSize > d.getSlotStackLimit()) {
maxSize = d.getSlotStackLimit();
@@ -476,10 +444,6 @@ public abstract class AEBaseContainer extends Container {
clickSlot.putStack(ItemStack.EMPTY);
d.onSlotChanged();
// if ( worldEntity != null )
// worldEntity.markDirty();
// if ( hasMETiles ) updateClient();
this.updateSlot(clickSlot);
this.updateSlot(d);
return ItemStack.EMPTY;
@@ -1,55 +1,33 @@
package appeng.container.implementations;
import appeng.api.AEApi;
import appeng.api.definitions.IDefinitions;
import appeng.api.storage.ITerminalHost;
import appeng.container.slot.*;
import appeng.helpers.IContainerCraftingPacket;
import appeng.parts.reporting.PartExpandedProcessingPatternTerminal;
import appeng.util.Platform;
import appeng.util.inv.IAEAppEngInventory;
import appeng.util.inv.InvOperation;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import appeng.container.slot.OptionalSlotFake;
import appeng.container.slot.SlotFakeCraftingMatrix;
import appeng.container.slot.SlotPatternOutputs;
import appeng.container.slot.SlotRestrictedInput;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IContainerListener;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.wrapper.PlayerInvWrapper;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import static appeng.helpers.PatternHelper.PROCESSING_INPUT_LIMIT;
import static appeng.helpers.PatternHelper.PROCESSING_OUTPUT_LIMIT;
public class ContainerExpandedProcessingPatternTerm extends ContainerMEMonitorable implements IAEAppEngInventory, IOptionalSlotHost, IContainerCraftingPacket {
private final IItemHandler crafting;
private final SlotFakeCraftingMatrix[] gridSlots = new SlotFakeCraftingMatrix[PROCESSING_INPUT_LIMIT];
private final OptionalSlotFake[] outputSlots = new OptionalSlotFake[PROCESSING_OUTPUT_LIMIT];
private final SlotRestrictedInput patternSlotIN;
private final SlotRestrictedInput patternSlotOUT;
private final PartExpandedProcessingPatternTerminal expandedProcessingPatternTerminal;
public class ContainerExpandedProcessingPatternTerm extends ContainerPatternEncoder {
public ContainerExpandedProcessingPatternTerm(InventoryPlayer ip, ITerminalHost monitorable) {
super(ip, monitorable, false);
this.expandedProcessingPatternTerminal = (PartExpandedProcessingPatternTerminal) monitorable;
this.craftingSlots = new SlotFakeCraftingMatrix[PROCESSING_INPUT_LIMIT];
this.outputSlots = new OptionalSlotFake[PROCESSING_OUTPUT_LIMIT];
final IItemHandler patternInv = this.getExpandedPatternTerminal().getInventoryByName("pattern");
final IItemHandler output = this.getExpandedPatternTerminal().getInventoryByName("output");
final IItemHandler patternInv = this.getPart().getInventoryByName("pattern");
final IItemHandler output = this.getPart().getInventoryByName("output");
this.crafting = this.getExpandedPatternTerminal().getInventoryByName("crafting");
this.crafting = this.getPart().getInventoryByName("crafting");
for (int y = 0; y < 4; y++) {
for (int x = 0; x < 4; x++) {
this.addSlotToContainer(this.gridSlots[x + y * 4] = new SlotFakeCraftingMatrix(this.crafting, x + y * 4, 4 + x * 18, -85 + y * 18));
this.addSlotToContainer(this.craftingSlots[x + y * 4] = new SlotFakeCraftingMatrix(this.crafting, x + y * 4, 4 + x * 18, -85 + y * 18));
}
}
@@ -67,124 +45,7 @@ public class ContainerExpandedProcessingPatternTerm extends ContainerMEMonitorab
this.patternSlotOUT.setStackLimit(1);
this.bindPlayerInventory(ip, 0, 0);
}
@Override
public ItemStack transferStackInSlot(final EntityPlayer p, final int idx) {
if (Platform.isClient()) {
return ItemStack.EMPTY;
}
if (this.inventorySlots.get(idx) instanceof SlotPlayerInv || this.inventorySlots.get(idx) instanceof SlotPlayerHotBar) {
final AppEngSlot clickSlot = (AppEngSlot) this.inventorySlots.get(idx); // require AE SLots!
ItemStack itemStack = clickSlot.getStack();
if (AEApi.instance().definitions().materials().blankPattern().isSameAs(itemStack)) {
IItemHandler patternInv = this.getExpandedPatternTerminal().getInventoryByName("pattern");
ItemStack remainder = patternInv.insertItem(0, itemStack, false);
clickSlot.putStack(remainder);
}
}
return super.transferStackInSlot(p, idx);
}
@Override
public void saveChanges() {
}
@Override
public void onChangeInventory(final IItemHandler inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack) {
}
public void encodeAndMoveToInventory() {
encode();
ItemStack output = this.patternSlotOUT.getStack();
if (!output.isEmpty()) {
if (!getPlayerInv().addItemStackToInventory(output)) {
getPlayerInv().player.dropItem(output, false);
}
this.patternSlotOUT.putStack(ItemStack.EMPTY);
}
}
public void encode() {
ItemStack output = this.patternSlotOUT.getStack();
final ItemStack[] in = this.getInputs();
final ItemStack[] out = this.getOutputs();
// if there is no input, this would be silly.
if (in == null || out == null) {
return;
}
// first check the output slots, should either be null, or a pattern
if (!output.isEmpty() && !this.isPattern(output)) {
return;
} // if nothing is there we should snag a new pattern.
else if (output.isEmpty()) {
output = this.patternSlotIN.getStack();
if (output.isEmpty() || !this.isPattern(output)) {
return; // no blanks.
}
// remove one, and clear the input slot.
output.setCount(output.getCount() - 1);
if (output.getCount() == 0) {
this.patternSlotIN.putStack(ItemStack.EMPTY);
}
// add a new encoded pattern.
Optional<ItemStack> maybePattern = AEApi.instance().definitions().items().encodedPattern().maybeStack(1);
if (maybePattern.isPresent()) {
output = maybePattern.get();
this.patternSlotOUT.putStack(output);
}
}
// encode the slot.
final NBTTagCompound encodedValue = new NBTTagCompound();
final NBTTagList tagIn = new NBTTagList();
final NBTTagList tagOut = new NBTTagList();
for (final ItemStack i : in) {
tagIn.appendTag(this.createItemTag(i));
}
for (final ItemStack i : out) {
tagOut.appendTag(this.createItemTag(i));
}
encodedValue.setTag("in", tagIn);
encodedValue.setTag("out", tagOut);
encodedValue.setBoolean("crafting", false);
encodedValue.setBoolean("substitute", false);
output.setTagCompound(encodedValue);
}
boolean isPattern(final ItemStack output) {
if (output.isEmpty()) {
return false;
}
final IDefinitions definitions = AEApi.instance().definitions();
boolean isPattern = definitions.items().encodedPattern().isSameAs(output);
isPattern |= definitions.materials().blankPattern().isSameAs(output);
return isPattern;
}
NBTBase createItemTag(final ItemStack i) {
final NBTTagCompound c = new NBTTagCompound();
if (!i.isEmpty()) {
i.writeToNBT(c);
}
return c;
}
@Override
@@ -192,261 +53,8 @@ public class ContainerExpandedProcessingPatternTerm extends ContainerMEMonitorab
return true;
}
protected ItemStack[] getInputs() {
final ItemStack[] input = new ItemStack[16];
boolean hasValue = false;
for (int x = 0; x < this.gridSlots.length; x++) {
input[x] = this.gridSlots[x].getStack();
if (!input[x].isEmpty()) {
hasValue = true;
}
}
if (hasValue) {
return input;
}
return null;
}
protected ItemStack[] getOutputs() {
final List<ItemStack> list = new ArrayList<>(3);
boolean hasValue = false;
for (final OptionalSlotFake outputSlot : this.outputSlots) {
final ItemStack out = outputSlot.getStack();
if (!out.isEmpty() && out.getCount() > 0) {
list.add(out);
hasValue = true;
}
}
if (hasValue) {
return list.toArray(new ItemStack[0]);
}
return null;
}
public void clear() {
for (final Slot s : this.gridSlots) {
s.putStack(ItemStack.EMPTY);
}
for (final Slot s : this.outputSlots) {
s.putStack(ItemStack.EMPTY);
}
this.detectAndSendChanges();
}
@Override
public IItemHandler getInventoryByName(final String name) {
if (name.equals("player")) {
return new PlayerInvWrapper(this.getInventoryPlayer());
}
return this.getExpandedPatternTerminal().getInventoryByName(name);
}
@Override
public boolean useRealItems() {
public boolean isCraftingMode() {
return false;
}
public PartExpandedProcessingPatternTerminal getExpandedPatternTerminal() {
return this.expandedProcessingPatternTerminal;
}
public void multiply(int multiple) {
ItemStack[] input = new ItemStack[gridSlots.length];
boolean canMultiplyInputs = true;
boolean canMultiplyOutputs = true;
for (int x = 0; x < this.gridSlots.length; x++) {
input[x] = this.gridSlots[x].getStack();
if (!input[x].isEmpty() && input[x].getCount() * multiple > input[x].getMaxStackSize()) {
canMultiplyInputs = false;
}
}
for (final OptionalSlotFake outputSlot : this.outputSlots) {
final ItemStack out = outputSlot.getStack();
if (!out.isEmpty() && out.getCount() * multiple > out.getMaxStackSize()) {
canMultiplyOutputs = false;
}
}
if (canMultiplyInputs && canMultiplyOutputs) {
for (SlotFakeCraftingMatrix craftingSlot : this.gridSlots) {
ItemStack stack = craftingSlot.getStack();
if (!stack.isEmpty()) {
craftingSlot.getStack().setCount(stack.getCount() * multiple);
}
}
for (OptionalSlotFake outputSlot : this.outputSlots) {
ItemStack stack = outputSlot.getStack();
if (!stack.isEmpty()) {
outputSlot.getStack().setCount(stack.getCount() * multiple);
}
}
}
}
public void divide(int divide) {
ItemStack[] input = new ItemStack[gridSlots.length];
boolean canDivideInputs = true;
boolean canDivideOutputs = true;
for (int x = 0; x < this.gridSlots.length; x++) {
input[x] = this.gridSlots[x].getStack();
if (!input[x].isEmpty() && input[x].getCount() % divide != 0) {
canDivideInputs = false;
}
}
for (final OptionalSlotFake outputSlot : this.outputSlots) {
final ItemStack out = outputSlot.getStack();
if (!out.isEmpty() && out.getCount() % divide != 0) {
canDivideOutputs = false;
}
}
if (canDivideInputs && canDivideOutputs) {
for (SlotFakeCraftingMatrix craftingSlot : this.gridSlots) {
ItemStack stack = craftingSlot.getStack();
if (!stack.isEmpty()) {
craftingSlot.getStack().setCount(stack.getCount() / divide);
}
}
for (OptionalSlotFake outputSlot : this.outputSlots) {
ItemStack stack = outputSlot.getStack();
if (!stack.isEmpty()) {
outputSlot.getStack().setCount(stack.getCount() / divide);
}
}
}
}
public void increase(int increase) {
ItemStack[] input = new ItemStack[gridSlots.length];
boolean canIncreaseInputs = true;
boolean canIncreaseOutputs = true;
for (int x = 0; x < this.gridSlots.length; x++) {
input[x] = this.gridSlots[x].getStack();
if (!input[x].isEmpty() && input[x].getCount() + increase > input[x].getMaxStackSize()) {
canIncreaseInputs = false;
}
}
for (final OptionalSlotFake outputSlot : this.outputSlots) {
final ItemStack out = outputSlot.getStack();
if (!out.isEmpty() && out.getCount() + increase > out.getMaxStackSize()) {
canIncreaseOutputs = false;
}
}
if (canIncreaseInputs && canIncreaseOutputs) {
for (SlotFakeCraftingMatrix craftingSlot : this.gridSlots) {
ItemStack stack = craftingSlot.getStack();
if (!stack.isEmpty()) {
craftingSlot.getStack().setCount(stack.getCount() + increase);
}
}
for (OptionalSlotFake outputSlot : this.outputSlots) {
ItemStack stack = outputSlot.getStack();
if (!stack.isEmpty()) {
outputSlot.getStack().setCount(stack.getCount() + increase);
}
}
}
}
public void decrease(int decrease) {
ItemStack[] input = new ItemStack[gridSlots.length];
boolean canDecreaseInputs = true;
boolean canDecreaseOutputs = true;
for (int x = 0; x < this.gridSlots.length; x++) {
input[x] = this.gridSlots[x].getStack();
if (!input[x].isEmpty() && input[x].getCount() - decrease < 1) {
canDecreaseInputs = false;
}
}
for (final OptionalSlotFake outputSlot : this.outputSlots) {
final ItemStack out = outputSlot.getStack();
if (!out.isEmpty() && out.getCount() - decrease < 1) {
canDecreaseOutputs = false;
}
}
if (canDecreaseInputs && canDecreaseOutputs) {
for (SlotFakeCraftingMatrix craftingSlot : this.gridSlots) {
ItemStack stack = craftingSlot.getStack();
if (!stack.isEmpty()) {
craftingSlot.getStack().setCount(stack.getCount() - decrease);
}
}
for (OptionalSlotFake outputSlot : this.outputSlots) {
ItemStack stack = outputSlot.getStack();
if (!stack.isEmpty()) {
outputSlot.getStack().setCount(stack.getCount() - decrease);
}
}
}
}
public void maximizeCount() {
ItemStack[] input = new ItemStack[gridSlots.length];
boolean canGrowInputs = true;
boolean canGrowOutputs = true;
int maxInputStackGrowth = 0;
int maxOutputStackGrowth = 0;
for (int x = 0; x < this.gridSlots.length; x++) {
input[x] = this.gridSlots[x].getStack();
if (!input[x].isEmpty() && input[x].getMaxStackSize() - input[x].getCount() > maxInputStackGrowth) {
maxInputStackGrowth = input[x].getMaxStackSize() - input[x].getCount();
}
if (!input[x].isEmpty() && input[x].getCount() + maxInputStackGrowth > input[x].getMaxStackSize()) {
canGrowInputs = false;
}
}
for (final OptionalSlotFake outputSlot : this.outputSlots) {
final ItemStack out = outputSlot.getStack();
{
maxOutputStackGrowth = out.getMaxStackSize() - out.getCount();
}
if (!out.isEmpty() && out.getCount() + maxOutputStackGrowth > out.getMaxStackSize()) {
canGrowOutputs = false;
}
}
if (canGrowInputs && canGrowOutputs) {
int maxStackGrowth = Math.min(maxInputStackGrowth, maxOutputStackGrowth);
for (SlotFakeCraftingMatrix craftingSlot : this.gridSlots) {
ItemStack stack = craftingSlot.getStack();
if (!stack.isEmpty()) {
craftingSlot.getStack().setCount(stack.getCount() + maxStackGrowth);
}
}
for (OptionalSlotFake outputSlot : this.outputSlots) {
ItemStack stack = outputSlot.getStack();
if (!stack.isEmpty()) {
outputSlot.getStack().setCount(stack.getCount() + maxStackGrowth);
}
}
}
}
@Override
public void onSlotChange(final Slot s) {
if (s == this.patternSlotOUT && Platform.isServer()) {
for (final IContainerListener listener : this.listeners) {
for (final Slot slot : this.inventorySlots) {
if (slot instanceof OptionalSlotFake || slot instanceof SlotFakeCraftingMatrix) {
listener.sendSlotContents(this, slot.slotNumber, slot.getStack());
}
}
if (listener instanceof EntityPlayerMP) {
((EntityPlayerMP) listener).isChangingQuantityOnly = false;
}
}
this.detectAndSendChanges();
}
}
}
@@ -28,8 +28,13 @@ import appeng.container.guisync.GuiSync;
import appeng.container.slot.*;
import appeng.helpers.DualityInterface;
import appeng.helpers.IInterfaceHost;
import appeng.tile.inventory.AppEngInternalInventory;
import appeng.tile.inventory.AppEngInternalOversizedInventory;
import appeng.util.Platform;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ClickType;
import net.minecraft.item.ItemStack;
public class ContainerInterface extends ContainerUpgradeable implements IOptionalSlotHost {
@@ -62,10 +67,23 @@ public class ContainerInterface extends ContainerUpgradeable implements IOptiona
}
for (int x = 0; x < DualityInterface.NUMBER_OF_STORAGE_SLOTS; x++) {
this.addSlotToContainer(new SlotNormal(this.myDuality.getStorage(), x, 8 + 18 * x, 35 + 18));
this.addSlotToContainer(new SlotOversized(this.myDuality.getStorage(), x, 8 + 18 * x, 35 + 18));
}
}
@Override
public ItemStack slotClick(int slotId, int dragType, ClickType clickTypeIn, EntityPlayer player) {
if (slotId >= 0 && slotId < this.inventorySlots.size()) {
if (this.inventorySlots.get(slotId) instanceof SlotOversized) {
((AppEngInternalOversizedInventory) ((SlotOversized) this.inventorySlots.get(slotId)).getItemHandler()).limitExtraction(true);
ItemStack ret = super.slotClick(slotId, dragType, clickTypeIn, player);
((AppEngInternalOversizedInventory) ((SlotOversized) this.inventorySlots.get(slotId)).getItemHandler()).limitExtraction(false);
return ret;
}
}
return super.slotClick(slotId, dragType, clickTypeIn, player);
}
@Override
protected int getHeight() {
return 256;
@@ -50,6 +50,8 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import static appeng.helpers.ItemStackHelper.stackWriteToNBT;
public final class ContainerInterfaceConfigurationTerminal extends AEBaseContainer {
@@ -310,10 +312,7 @@ public final class ContainerInterfaceConfigurationTerminal extends AEBaseContain
ItemHandlerUtil.setStackInSlot(inv.client, x + offset, is.isEmpty() ? ItemStack.EMPTY : is.copy());
if (!is.isEmpty()) {
is.writeToNBT(itemNBT);
if (is.getCount() > is.getMaxStackSize()) {
itemNBT.setInteger("stackSize", is.getCount());
}
stackWriteToNBT(is, itemNBT);
}
tag.setTag(Integer.toString(x + offset), itemNBT);
@@ -57,6 +57,8 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import static appeng.helpers.ItemStackHelper.stackWriteToNBT;
public final class ContainerInterfaceTerminal extends AEBaseContainer {
@@ -345,7 +347,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer {
ItemHandlerUtil.setStackInSlot(inv.client, x + offset, is.isEmpty() ? ItemStack.EMPTY : is.copy());
if (!is.isEmpty()) {
is.writeToNBT(itemNBT);
stackWriteToNBT(is, itemNBT);
}
tag.setTag(Integer.toString(x + offset), itemNBT);
@@ -0,0 +1,549 @@
package appeng.container.implementations;
import appeng.api.AEApi;
import appeng.api.definitions.IDefinitions;
import appeng.api.storage.ITerminalHost;
import appeng.container.guisync.GuiSync;
import appeng.container.slot.AppEngSlot;
import appeng.container.slot.IOptionalSlotHost;
import appeng.container.slot.OptionalSlotFake;
import appeng.container.slot.SlotFakeCraftingMatrix;
import appeng.container.slot.SlotPatternTerm;
import appeng.container.slot.SlotPlayerHotBar;
import appeng.container.slot.SlotPlayerInv;
import appeng.container.slot.SlotRestrictedInput;
import appeng.helpers.IContainerCraftingPacket;
import appeng.parts.reporting.AbstractPartEncoder;
import appeng.tile.inventory.AppEngInternalInventory;
import appeng.util.Platform;
import appeng.util.inv.IAEAppEngInventory;
import appeng.util.inv.InvOperation;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IContainerListener;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.world.World;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.wrapper.PlayerInvWrapper;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import static appeng.helpers.ItemStackHelper.stackWriteToNBT;
public abstract class ContainerPatternEncoder extends ContainerMEMonitorable implements IAEAppEngInventory, IOptionalSlotHost, IContainerCraftingPacket {
private final AbstractPartEncoder patternTerminal;
final AppEngInternalInventory cOut = new AppEngInternalInventory(null, 1);
protected IItemHandler crafting;
protected SlotPatternTerm craftSlot;
protected SlotRestrictedInput patternSlotIN;
protected SlotRestrictedInput patternSlotOUT;
private IRecipe currentRecipe;
protected SlotFakeCraftingMatrix[] craftingSlots;
protected OptionalSlotFake[] outputSlots;
@GuiSync(97)
public boolean craftingMode = true;
@GuiSync(96)
public boolean substitute = false;
public ContainerPatternEncoder(InventoryPlayer ip, ITerminalHost monitorable) {
super(ip, monitorable);
patternTerminal = (AbstractPartEncoder) monitorable;
}
protected ContainerPatternEncoder(InventoryPlayer ip, ITerminalHost monitorable, boolean bindInventory) {
super(ip, monitorable, bindInventory);
patternTerminal = (AbstractPartEncoder) monitorable;
}
@Override
public ItemStack transferStackInSlot(final EntityPlayer p, final int idx) {
if (Platform.isClient()) {
return ItemStack.EMPTY;
}
if (this.inventorySlots.get(idx) instanceof SlotPlayerInv || this.inventorySlots.get(idx) instanceof SlotPlayerHotBar) {
final AppEngSlot clickSlot = (AppEngSlot) this.inventorySlots.get(idx); // require AE SLots!
ItemStack itemStack = clickSlot.getStack();
if (AEApi.instance().definitions().materials().blankPattern().isSameAs(itemStack)) {
IItemHandler patternInv = this.getPart().getInventoryByName("pattern");
ItemStack remainder = patternInv.insertItem(0, itemStack, false);
clickSlot.putStack(remainder);
}
}
return super.transferStackInSlot(p, idx);
}
public AbstractPartEncoder getPart() {
return this.patternTerminal;
}
@Override
public abstract boolean isSlotEnabled(int idx);
@Override
public IItemHandler getInventoryByName(String name) {
if (name.equals("player")) {
return new PlayerInvWrapper(this.getInventoryPlayer());
}
return this.getPart().getInventoryByName(name);
}
@Override
public boolean useRealItems() {
return false;
}
@Override
public void saveChanges() {
}
@Override
public void onChangeInventory(IItemHandler inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack) {
}
@Override
public void putStackInSlot(int slotID, ItemStack stack) {
super.putStackInSlot(slotID, stack);
this.getAndUpdateOutput();
}
protected void updateOrderOfOutputSlots() {
if (!this.isCraftingMode()) {
if (craftSlot != null) {
this.craftSlot.xPos = -9000;
}
for (int y = 0; y < 3; y++) {
this.outputSlots[y].xPos = this.outputSlots[y].getX();
}
} else {
if (craftSlot != null) {
this.craftSlot.xPos = this.craftSlot.getX();
}
for (int y = 0; y < 3; y++) {
this.outputSlots[y].xPos = -9000;
}
}
}
@Override
public void onSlotChange(final Slot s) {
if (s == this.patternSlotOUT && Platform.isServer()) {
for (final IContainerListener listener : this.listeners) {
for (final Slot slot : this.inventorySlots) {
if (slot instanceof OptionalSlotFake || slot instanceof SlotFakeCraftingMatrix) {
listener.sendSlotContents(this, slot.slotNumber, slot.getStack());
}
}
if (listener instanceof EntityPlayerMP) {
((EntityPlayerMP) listener).isChangingQuantityOnly = false;
}
}
this.detectAndSendChanges();
}
}
public void encodeAndMoveToInventory() {
encode();
ItemStack output = this.patternSlotOUT.getStack();
if (!output.isEmpty()) {
if (!getPlayerInv().addItemStackToInventory(output)) {
getPlayerInv().player.dropItem(output, false);
}
this.patternSlotOUT.putStack(ItemStack.EMPTY);
}
}
public void encode() {
ItemStack output = this.patternSlotOUT.getStack();
final ItemStack[] in = this.getInputs();
final ItemStack[] out = this.getOutputs();
// if there is no input, this would be silly.
if (in == null || out == null) {
return;
}
// first check the output slots, should either be null, or a pattern
if (!output.isEmpty() && !this.isPattern(output)) {
return;
} // if nothing is there we should snag a new pattern.
else if (output.isEmpty()) {
output = this.patternSlotIN.getStack();
if (output.isEmpty() || !this.isPattern(output)) {
return; // no blanks.
}
// remove one, and clear the input slot.
output.setCount(output.getCount() - 1);
if (output.getCount() == 0) {
this.patternSlotIN.putStack(ItemStack.EMPTY);
}
// add a new encoded pattern.
Optional<ItemStack> maybePattern = AEApi.instance().definitions().items().encodedPattern().maybeStack(1);
if (maybePattern.isPresent()) {
output = maybePattern.get();
this.patternSlotOUT.putStack(output);
}
}
// encode the slot.
final NBTTagCompound encodedValue = new NBTTagCompound();
final NBTTagList tagIn = new NBTTagList();
final NBTTagList tagOut = new NBTTagList();
for (final ItemStack i : in) {
tagIn.appendTag(this.createItemTag(i));
}
for (final ItemStack i : out) {
tagOut.appendTag(this.createItemTag(i));
}
encodedValue.setTag("in", tagIn);
encodedValue.setTag("out", tagOut);
encodedValue.setBoolean("crafting", this.isCraftingMode());
encodedValue.setBoolean("substitute", this.isSubstitute());
output.setTagCompound(encodedValue);
}
public void multiply(int multiple) {
ItemStack[] input = new ItemStack[craftingSlots.length];
boolean canMultiplyInputs = true;
boolean canMultiplyOutputs = true;
for (int x = 0; x < this.craftingSlots.length; x++) {
input[x] = this.craftingSlots[x].getStack();
if (!input[x].isEmpty() && input[x].getCount() * multiple < 1) {
canMultiplyInputs = false;
}
}
for (final OptionalSlotFake outputSlot : this.outputSlots) {
final ItemStack out = outputSlot.getStack();
if (!out.isEmpty() && out.getCount() * multiple < 1) {
canMultiplyOutputs = false;
}
}
if (canMultiplyInputs && canMultiplyOutputs) {
for (SlotFakeCraftingMatrix craftingSlot : this.craftingSlots) {
ItemStack stack = craftingSlot.getStack();
if (!stack.isEmpty()) {
craftingSlot.getStack().setCount(stack.getCount() * multiple);
}
}
for (OptionalSlotFake outputSlot : this.outputSlots) {
ItemStack stack = outputSlot.getStack();
if (!stack.isEmpty()) {
outputSlot.getStack().setCount(stack.getCount() * multiple);
}
}
}
}
public void divide(int divide) {
ItemStack[] input = new ItemStack[craftingSlots.length];
boolean canDivideInputs = true;
boolean canDivideOutputs = true;
for (int x = 0; x < this.craftingSlots.length; x++) {
input[x] = this.craftingSlots[x].getStack();
if (!input[x].isEmpty() && input[x].getCount() % divide != 0) {
canDivideInputs = false;
}
}
for (final OptionalSlotFake outputSlot : this.outputSlots) {
final ItemStack out = outputSlot.getStack();
if (!out.isEmpty() && out.getCount() % divide != 0) {
canDivideOutputs = false;
}
}
if (canDivideInputs && canDivideOutputs) {
for (SlotFakeCraftingMatrix craftingSlot : this.craftingSlots) {
ItemStack stack = craftingSlot.getStack();
if (!stack.isEmpty()) {
craftingSlot.getStack().setCount(stack.getCount() / divide);
}
}
for (OptionalSlotFake outputSlot : this.outputSlots) {
ItemStack stack = outputSlot.getStack();
if (!stack.isEmpty()) {
outputSlot.getStack().setCount(stack.getCount() / divide);
}
}
}
}
public void increase(int increase) {
ItemStack[] input = new ItemStack[craftingSlots.length];
boolean canIncreaseInputs = true;
boolean canIncreaseOutputs = true;
for (int x = 0; x < this.craftingSlots.length; x++) {
input[x] = this.craftingSlots[x].getStack();
if (!input[x].isEmpty() && input[x].getCount() + increase < 1) {
canIncreaseInputs = false;
}
}
for (final OptionalSlotFake outputSlot : this.outputSlots) {
final ItemStack out = outputSlot.getStack();
if (!out.isEmpty() && out.getCount() + increase < 1) {
canIncreaseOutputs = false;
}
}
if (canIncreaseInputs && canIncreaseOutputs) {
for (SlotFakeCraftingMatrix craftingSlot : this.craftingSlots) {
ItemStack stack = craftingSlot.getStack();
if (!stack.isEmpty()) {
craftingSlot.getStack().setCount(stack.getCount() + increase);
}
}
for (OptionalSlotFake outputSlot : this.outputSlots) {
ItemStack stack = outputSlot.getStack();
if (!stack.isEmpty()) {
outputSlot.getStack().setCount(stack.getCount() + increase);
}
}
}
}
public void decrease(int decrease) {
ItemStack[] input = new ItemStack[craftingSlots.length];
boolean canDecreaseInputs = true;
boolean canDecreaseOutputs = true;
for (int x = 0; x < this.craftingSlots.length; x++) {
input[x] = this.craftingSlots[x].getStack();
if (!input[x].isEmpty() && input[x].getCount() - decrease < 1) {
canDecreaseInputs = false;
}
}
for (final OptionalSlotFake outputSlot : this.outputSlots) {
final ItemStack out = outputSlot.getStack();
if (!out.isEmpty() && out.getCount() - decrease < 1) {
canDecreaseOutputs = false;
}
}
if (canDecreaseInputs && canDecreaseOutputs) {
for (SlotFakeCraftingMatrix craftingSlot : this.craftingSlots) {
ItemStack stack = craftingSlot.getStack();
if (!stack.isEmpty()) {
craftingSlot.getStack().setCount(stack.getCount() - decrease);
}
}
for (OptionalSlotFake outputSlot : this.outputSlots) {
ItemStack stack = outputSlot.getStack();
if (!stack.isEmpty()) {
outputSlot.getStack().setCount(stack.getCount() - decrease);
}
}
}
}
public void maximizeCount() {
ItemStack[] input = new ItemStack[craftingSlots.length];
boolean canGrowInputs = true;
boolean canGrowOutputs = true;
int maxInputStackGrowth = 0;
int maxOutputStackGrowth = 0;
for (int x = 0; x < this.craftingSlots.length; x++) {
input[x] = this.craftingSlots[x].getStack();
if (!input[x].isEmpty() && input[x].getMaxStackSize() - input[x].getCount() > maxInputStackGrowth) {
maxInputStackGrowth = input[x].getMaxStackSize() - input[x].getCount();
}
if (!input[x].isEmpty() && input[x].getCount() + maxInputStackGrowth > input[x].getMaxStackSize()) {
canGrowInputs = false;
}
}
for (final OptionalSlotFake outputSlot : this.outputSlots) {
final ItemStack out = outputSlot.getStack();
{
maxOutputStackGrowth = out.getMaxStackSize() - out.getCount();
}
if (!out.isEmpty() && out.getCount() + maxOutputStackGrowth > out.getMaxStackSize()) {
canGrowOutputs = false;
}
}
if (canGrowInputs && canGrowOutputs) {
int maxStackGrowth = Math.min(maxInputStackGrowth, maxOutputStackGrowth);
for (SlotFakeCraftingMatrix craftingSlot : this.craftingSlots) {
ItemStack stack = craftingSlot.getStack();
if (!stack.isEmpty()) {
craftingSlot.getStack().setCount(stack.getCount() + maxStackGrowth);
}
}
for (OptionalSlotFake outputSlot : this.outputSlots) {
ItemStack stack = outputSlot.getStack();
if (!stack.isEmpty()) {
outputSlot.getStack().setCount(stack.getCount() + maxStackGrowth);
}
}
}
}
protected ItemStack[] getInputs() {
final ItemStack[] input = new ItemStack[craftingSlots.length];
boolean hasValue = false;
for (int x = 0; x < this.craftingSlots.length; x++) {
input[x] = this.craftingSlots[x].getStack();
if (!input[x].isEmpty()) {
hasValue = true;
}
}
if (hasValue) {
return input;
}
return null;
}
protected ItemStack[] getOutputs() {
if (this.isCraftingMode()) {
final ItemStack out = this.getAndUpdateOutput();
if (!out.isEmpty() && out.getCount() > 0) {
return new ItemStack[]{out};
}
} else {
final List<ItemStack> list = new ArrayList<>(outputSlots.length);
boolean hasValue = false;
for (final OptionalSlotFake outputSlot : this.outputSlots) {
final ItemStack out = outputSlot.getStack();
if (!out.isEmpty() && out.getCount() > 0) {
list.add(out);
hasValue = true;
}
}
if (hasValue) {
return list.toArray(new ItemStack[0]);
}
}
return null;
}
protected ItemStack getAndUpdateOutput() {
final World world = this.getPlayerInv().player.world;
final InventoryCrafting ic = new InventoryCrafting(this, 3, 3);
for (int x = 0; x < ic.getSizeInventory(); x++) {
ic.setInventorySlotContents(x, this.crafting.getStackInSlot(x));
}
if (this.currentRecipe == null || !this.currentRecipe.matches(ic, world)) {
this.currentRecipe = CraftingManager.findMatchingRecipe(ic, world);
}
final ItemStack is;
if (this.currentRecipe == null) {
is = ItemStack.EMPTY;
} else {
is = this.currentRecipe.getCraftingResult(ic);
}
this.cOut.setStackInSlot(0, is);
return is;
}
public boolean isCraftingMode() {
return this.craftingMode;
}
void setCraftingMode(final boolean craftingMode) {
this.craftingMode = craftingMode;
}
boolean isSubstitute() {
return this.substitute;
}
public void setSubstitute(final boolean substitute) {
this.substitute = substitute;
}
@Override
public void detectAndSendChanges() {
super.detectAndSendChanges();
if (Platform.isServer()) {
if (this.isCraftingMode() != this.getPart().isCraftingRecipe()) {
this.setCraftingMode(this.getPart().isCraftingRecipe());
this.updateOrderOfOutputSlots();
}
this.substitute = this.getPart().isSubstitution();
}
}
@Override
public void onUpdate(final String field, final Object oldValue, final Object newValue) {
super.onUpdate(field, oldValue, newValue);
if (field.equals("craftingMode")) {
this.getAndUpdateOutput();
this.updateOrderOfOutputSlots();
}
}
boolean isPattern(final ItemStack output) {
if (output.isEmpty()) {
return false;
}
final IDefinitions definitions = AEApi.instance().definitions();
boolean isPattern = definitions.items().encodedPattern().isSameAs(output);
isPattern |= definitions.materials().blankPattern().isSameAs(output);
return isPattern;
}
NBTBase createItemTag(final ItemStack i) {
final NBTTagCompound c = new NBTTagCompound();
if (!i.isEmpty()) {
stackWriteToNBT(i, c);
}
return c;
}
public void clear() {
for (final Slot s : this.craftingSlots) {
s.putStack(ItemStack.EMPTY);
}
for (final Slot s : this.outputSlots) {
s.putStack(ItemStack.EMPTY);
}
this.detectAndSendChanges();
this.getAndUpdateOutput();
}
}
@@ -21,7 +21,6 @@ package appeng.container.implementations;
import appeng.api.AEApi;
import appeng.api.config.Actionable;
import appeng.api.definitions.IDefinitions;
import appeng.api.storage.IMEMonitor;
import appeng.api.storage.ITerminalHost;
import appeng.api.storage.channels.IItemStorageChannel;
@@ -39,16 +38,11 @@ import appeng.container.slot.SlotPlayerHotBar;
import appeng.container.slot.SlotPlayerInv;
import appeng.container.slot.SlotRestrictedInput;
import appeng.core.sync.packets.PacketPatternSlot;
import appeng.helpers.IContainerCraftingPacket;
import appeng.items.storage.ItemViewCell;
import appeng.me.helpers.MachineSource;
import appeng.parts.reporting.PartPatternTerminal;
import appeng.tile.inventory.AppEngInternalInventory;
import appeng.util.InventoryAdaptor;
import appeng.util.Platform;
import appeng.util.inv.AdaptorItemHandler;
import appeng.util.inv.IAEAppEngInventory;
import appeng.util.inv.InvOperation;
import appeng.util.inv.WrapperCursorItemHandler;
import appeng.util.item.AEItemStack;
import net.minecraft.entity.player.EntityPlayer;
@@ -62,43 +56,22 @@ import net.minecraft.inventory.SlotCrafting;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.world.World;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.wrapper.PlayerInvWrapper;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEAppEngInventory, IOptionalSlotHost, IContainerCraftingPacket {
public class ContainerPatternTerm extends ContainerPatternEncoder {
private final PartPatternTerminal patternTerminal;
private final AppEngInternalInventory cOut = new AppEngInternalInventory(null, 1);
private final IItemHandler crafting;
private final SlotFakeCraftingMatrix[] craftingSlots = new SlotFakeCraftingMatrix[9];
private final OptionalSlotFake[] outputSlots = new OptionalSlotFake[3];
private final SlotPatternTerm craftSlot;
private final SlotRestrictedInput patternSlotIN;
private final SlotRestrictedInput patternSlotOUT;
private IRecipe currentRecipe;
@GuiSync(97)
public boolean craftingMode = true;
@GuiSync(96)
public boolean substitute = false;
public ContainerPatternTerm(final InventoryPlayer ip, final ITerminalHost monitorable) {
super(ip, monitorable, false);
this.patternTerminal = (PartPatternTerminal) monitorable;
final IItemHandler patternInv = this.getPatternTerminal().getInventoryByName("pattern");
final IItemHandler output = this.getPatternTerminal().getInventoryByName("output");
this.craftingSlots = new SlotFakeCraftingMatrix[9];
this.outputSlots = new OptionalSlotFake[3];
this.crafting = this.getPatternTerminal().getInventoryByName("crafting");
final IItemHandler patternInv = this.getPart().getInventoryByName("pattern");
final IItemHandler output = this.getPart().getInventoryByName("output");
this.crafting = this.getPart().getInventoryByName("crafting");
for (int y = 0; y < 3; y++) {
for (int x = 0; x < 3; x++) {
@@ -110,7 +83,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
.getPowerSource(), monitorable, this.crafting, patternInv, this.cOut, 110, -76 + 18, this, 2, this));
this.craftSlot.setIIcon(-1);
for (int y = 0; y < 3; y++) {
for (int y = 0; y < this.outputSlots.length; y++) {
this.addSlotToContainer(this.outputSlots[y] = new SlotPatternOutputs(output, this, y, 110, -76 + y * 18, 0, 0, 1));
this.outputSlots[y].setRenderDisabled(false);
this.outputSlots[y].setIIcon(-1);
@@ -129,391 +102,13 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
this.updateOrderOfOutputSlots();
}
@Override
public ItemStack transferStackInSlot(final EntityPlayer p, final int idx) {
if (Platform.isClient()) {
return ItemStack.EMPTY;
}
if (this.inventorySlots.get(idx) instanceof SlotPlayerInv || this.inventorySlots.get(idx) instanceof SlotPlayerHotBar) {
final AppEngSlot clickSlot = (AppEngSlot) this.inventorySlots.get(idx); // require AE SLots!
ItemStack itemStack = clickSlot.getStack();
if (AEApi.instance().definitions().materials().blankPattern().isSameAs(itemStack)) {
IItemHandler patternInv = this.getPatternTerminal().getInventoryByName("pattern");
ItemStack remainder = patternInv.insertItem(0, itemStack, false);
clickSlot.putStack(remainder);
}
}
return super.transferStackInSlot(p, idx);
}
private void updateOrderOfOutputSlots() {
if (!this.isCraftingMode()) {
this.craftSlot.xPos = -9000;
for (int y = 0; y < 3; y++) {
this.outputSlots[y].xPos = this.outputSlots[y].getX();
}
} else {
this.craftSlot.xPos = this.craftSlot.getX();
for (int y = 0; y < 3; y++) {
this.outputSlots[y].xPos = -9000;
}
}
}
@Override
public void putStackInSlot(int slotID, ItemStack stack) {
super.putStackInSlot(slotID, stack);
this.getAndUpdateOutput();
}
protected ItemStack getAndUpdateOutput() {
final World world = this.getPlayerInv().player.world;
final InventoryCrafting ic = new InventoryCrafting(this, 3, 3);
for (int x = 0; x < ic.getSizeInventory(); x++) {
ic.setInventorySlotContents(x, this.crafting.getStackInSlot(x));
}
if (this.currentRecipe == null || !this.currentRecipe.matches(ic, world)) {
this.currentRecipe = CraftingManager.findMatchingRecipe(ic, world);
}
final ItemStack is;
if (this.currentRecipe == null) {
is = ItemStack.EMPTY;
} else {
is = this.currentRecipe.getCraftingResult(ic);
}
this.cOut.setStackInSlot(0, is);
return is;
}
@Override
public void saveChanges() {
}
@Override
public void onChangeInventory(final IItemHandler inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack) {
}
public void encodeAndMoveToInventory() {
encode();
ItemStack output = this.patternSlotOUT.getStack();
if (!output.isEmpty()) {
if (!getPlayerInv().addItemStackToInventory(output)) {
getPlayerInv().player.dropItem(output, false);
}
this.patternSlotOUT.putStack(ItemStack.EMPTY);
}
}
public void encode() {
ItemStack output = this.patternSlotOUT.getStack();
final ItemStack[] in = this.getInputs();
final ItemStack[] out = this.getOutputs();
// if there is no input, this would be silly.
if (in == null || out == null) {
return;
}
// first check the output slots, should either be null, or a pattern
if (!output.isEmpty() && !this.isPattern(output)) {
return;
} // if nothing is there we should snag a new pattern.
else if (output.isEmpty()) {
output = this.patternSlotIN.getStack();
if (output.isEmpty() || !this.isPattern(output)) {
return; // no blanks.
}
// remove one, and clear the input slot.
output.setCount(output.getCount() - 1);
if (output.getCount() == 0) {
this.patternSlotIN.putStack(ItemStack.EMPTY);
}
// add a new encoded pattern.
Optional<ItemStack> maybePattern = AEApi.instance().definitions().items().encodedPattern().maybeStack(1);
if (maybePattern.isPresent()) {
output = maybePattern.get();
this.patternSlotOUT.putStack(output);
}
}
// encode the slot.
final NBTTagCompound encodedValue = new NBTTagCompound();
final NBTTagList tagIn = new NBTTagList();
final NBTTagList tagOut = new NBTTagList();
for (final ItemStack i : in) {
tagIn.appendTag(this.createItemTag(i));
}
for (final ItemStack i : out) {
tagOut.appendTag(this.createItemTag(i));
}
encodedValue.setTag("in", tagIn);
encodedValue.setTag("out", tagOut);
encodedValue.setBoolean("crafting", this.isCraftingMode());
encodedValue.setBoolean("substitute", this.isSubstitute());
output.setTagCompound(encodedValue);
}
public void multiply(int multiple) {
ItemStack[] input = new ItemStack[9];
boolean canMultiplyInputs = true;
boolean canMultiplyOutputs = true;
for (int x = 0; x < this.craftingSlots.length; x++) {
input[x] = this.craftingSlots[x].getStack();
if (!input[x].isEmpty() && input[x].getCount() * multiple < 0) {
canMultiplyInputs = false;
}
}
for (final OptionalSlotFake outputSlot : this.outputSlots) {
final ItemStack out = outputSlot.getStack();
if (!out.isEmpty() && out.getCount() * multiple < 0) {
canMultiplyOutputs = false;
}
}
if (canMultiplyInputs && canMultiplyOutputs) {
for (SlotFakeCraftingMatrix craftingSlot : this.craftingSlots) {
ItemStack stack = craftingSlot.getStack();
if (!stack.isEmpty())
craftingSlot.getStack().setCount(stack.getCount() * multiple);
}
for (OptionalSlotFake outputSlot : this.outputSlots) {
ItemStack stack = outputSlot.getStack();
if (!stack.isEmpty())
outputSlot.getStack().setCount(stack.getCount() * multiple);
}
}
}
public void divide(int divide) {
ItemStack[] input = new ItemStack[9];
boolean canDivideInputs = true;
boolean canDivideOutputs = true;
for (int x = 0; x < this.craftingSlots.length; x++) {
input[x] = this.craftingSlots[x].getStack();
if (!input[x].isEmpty() && input[x].getCount() % divide != 0) {
canDivideInputs = false;
}
}
for (final OptionalSlotFake outputSlot : this.outputSlots) {
final ItemStack out = outputSlot.getStack();
if (!out.isEmpty() && out.getCount() % divide != 0) {
canDivideOutputs = false;
}
}
if (canDivideInputs && canDivideOutputs) {
for (SlotFakeCraftingMatrix craftingSlot : this.craftingSlots) {
ItemStack stack = craftingSlot.getStack();
if (!stack.isEmpty())
craftingSlot.getStack().setCount(stack.getCount() / divide);
}
for (OptionalSlotFake outputSlot : this.outputSlots) {
ItemStack stack = outputSlot.getStack();
if (!stack.isEmpty())
outputSlot.getStack().setCount(stack.getCount() / divide);
}
}
}
public void increase(int increase) {
ItemStack[] input = new ItemStack[9];
boolean canIncreaseInputs = true;
boolean canIncreaseOutputs = true;
for (int x = 0; x < this.craftingSlots.length; x++) {
input[x] = this.craftingSlots[x].getStack();
if (!input[x].isEmpty() && input[x].getCount() + increase < 0) {
canIncreaseInputs = false;
}
}
for (final OptionalSlotFake outputSlot : this.outputSlots) {
final ItemStack out = outputSlot.getStack();
if (!out.isEmpty() && out.getCount() + increase < 0) {
canIncreaseOutputs = false;
}
}
if (canIncreaseInputs && canIncreaseOutputs) {
for (SlotFakeCraftingMatrix craftingSlot : this.craftingSlots) {
ItemStack stack = craftingSlot.getStack();
if (!stack.isEmpty())
craftingSlot.getStack().setCount(stack.getCount() + increase);
}
for (OptionalSlotFake outputSlot : this.outputSlots) {
ItemStack stack = outputSlot.getStack();
if (!stack.isEmpty())
outputSlot.getStack().setCount(stack.getCount() + increase);
}
}
}
public void decrease(int decrease) {
ItemStack[] input = new ItemStack[9];
boolean canDecreaseInputs = true;
boolean canDecreaseOutputs = true;
for (int x = 0; x < this.craftingSlots.length; x++) {
input[x] = this.craftingSlots[x].getStack();
if (!input[x].isEmpty() && input[x].getCount() - decrease < 1) {
canDecreaseInputs = false;
}
}
for (final OptionalSlotFake outputSlot : this.outputSlots) {
final ItemStack out = outputSlot.getStack();
if (!out.isEmpty() && out.getCount() - decrease < 1) {
canDecreaseOutputs = false;
}
}
if (canDecreaseInputs && canDecreaseOutputs) {
for (SlotFakeCraftingMatrix craftingSlot : this.craftingSlots) {
ItemStack stack = craftingSlot.getStack();
if (!stack.isEmpty())
craftingSlot.getStack().setCount(stack.getCount() - decrease);
}
for (OptionalSlotFake outputSlot : this.outputSlots) {
ItemStack stack = outputSlot.getStack();
if (!stack.isEmpty())
outputSlot.getStack().setCount(stack.getCount() - decrease);
}
}
}
public void maximizeCount() {
ItemStack[] input = new ItemStack[9];
boolean canGrowInputs = true;
boolean canGrowOutputs = true;
int maxInputStackGrowth = 0;
int maxOutputStackGrowth = 0;
for (int x = 0; x < this.craftingSlots.length; x++) {
input[x] = this.craftingSlots[x].getStack();
if (!input[x].isEmpty() && input[x].getMaxStackSize() - input[x].getCount() > maxInputStackGrowth) {
maxInputStackGrowth = input[x].getMaxStackSize() - input[x].getCount();
}
if (!input[x].isEmpty() && input[x].getCount() + maxInputStackGrowth > input[x].getMaxStackSize()) {
canGrowInputs = false;
}
}
for (final OptionalSlotFake outputSlot : this.outputSlots) {
final ItemStack out = outputSlot.getStack();
{
maxOutputStackGrowth = out.getMaxStackSize() - out.getCount();
}
if (!out.isEmpty() && out.getCount() + maxOutputStackGrowth > out.getMaxStackSize()) {
canGrowOutputs = false;
}
}
if (canGrowInputs && canGrowOutputs) {
int maxStackGrowth = Math.min(maxInputStackGrowth, maxOutputStackGrowth);
for (SlotFakeCraftingMatrix craftingSlot : this.craftingSlots) {
ItemStack stack = craftingSlot.getStack();
if (!stack.isEmpty())
craftingSlot.getStack().setCount(stack.getCount() + maxStackGrowth);
}
for (OptionalSlotFake outputSlot : this.outputSlots) {
ItemStack stack = outputSlot.getStack();
if (!stack.isEmpty())
outputSlot.getStack().setCount(stack.getCount() + maxStackGrowth);
}
}
}
protected ItemStack[] getInputs() {
final ItemStack[] input = new ItemStack[9];
boolean hasValue = false;
for (int x = 0; x < this.craftingSlots.length; x++) {
input[x] = this.craftingSlots[x].getStack();
if (!input[x].isEmpty()) {
hasValue = true;
}
}
if (hasValue) {
return input;
}
return null;
}
protected ItemStack[] getOutputs() {
if (this.isCraftingMode()) {
final ItemStack out = this.getAndUpdateOutput();
if (!out.isEmpty() && out.getCount() > 0) {
return new ItemStack[]{out};
}
} else {
final List<ItemStack> list = new ArrayList<>(3);
boolean hasValue = false;
for (final OptionalSlotFake outputSlot : this.outputSlots) {
final ItemStack out = outputSlot.getStack();
if (!out.isEmpty() && out.getCount() > 0) {
list.add(out);
hasValue = true;
}
}
if (hasValue) {
return list.toArray(new ItemStack[list.size()]);
}
}
return null;
}
boolean isPattern(final ItemStack output) {
if (output.isEmpty()) {
return false;
}
final IDefinitions definitions = AEApi.instance().definitions();
boolean isPattern = definitions.items().encodedPattern().isSameAs(output);
isPattern |= definitions.materials().blankPattern().isSameAs(output);
return isPattern;
}
NBTBase createItemTag(final ItemStack i) {
final NBTTagCompound c = new NBTTagCompound();
if (!i.isEmpty()) {
i.writeToNBT(c);
if (i.getCount() > i.getMaxStackSize()) {
c.setInteger("stackSize", i.getCount());
}
}
return c;
}
@Override
public boolean isSlotEnabled(final int idx) {
if (idx == 1) {
return Platform.isServer() ? !this.getPatternTerminal().isCraftingRecipe() : !this.isCraftingMode();
return Platform.isServer() ? !this.getPart().isCraftingRecipe() : !this.isCraftingMode();
} else if (idx == 2) {
return Platform.isServer() ? this.getPatternTerminal().isCraftingRecipe() : this.isCraftingMode();
return Platform.isServer() ? this.getPart().isCraftingRecipe() : this.isCraftingMode();
} else {
return false;
}
@@ -558,7 +153,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
return;
}
final IMEMonitor<IAEItemStack> storage = this.getPatternTerminal()
final IMEMonitor<IAEItemStack> storage = this.getPart()
.getInventory(AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class));
final IItemList<IAEItemStack> all = storage.getStorageList();
@@ -600,107 +195,10 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
if (!failed.isEmpty()) {
this.getCellInventory()
.injectItems(AEItemStack.fromItemStack(failed), Actionable.MODULATE,
new MachineSource(this.getPatternTerminal()));
new MachineSource(this.getPart()));
}
}
}
}
}
@Override
public void detectAndSendChanges() {
super.detectAndSendChanges();
if (Platform.isServer()) {
if (this.isCraftingMode() != this.getPatternTerminal().isCraftingRecipe()) {
this.setCraftingMode(this.getPatternTerminal().isCraftingRecipe());
this.updateOrderOfOutputSlots();
}
this.substitute = this.patternTerminal.isSubstitution();
}
}
@Override
public void onUpdate(final String field, final Object oldValue, final Object newValue) {
super.onUpdate(field, oldValue, newValue);
if (field.equals("craftingMode")) {
this.getAndUpdateOutput();
this.updateOrderOfOutputSlots();
}
}
@Override
public void onSlotChange(final Slot s) {
if (s == this.patternSlotOUT && Platform.isServer()) {
for (final IContainerListener listener : this.listeners) {
for (final Slot slot : this.inventorySlots) {
if (slot instanceof OptionalSlotFake || slot instanceof SlotFakeCraftingMatrix) {
listener.sendSlotContents(this, slot.slotNumber, slot.getStack());
}
}
if (listener instanceof EntityPlayerMP) {
((EntityPlayerMP) listener).isChangingQuantityOnly = false;
}
}
this.detectAndSendChanges();
}
if (s == this.craftSlot && Platform.isClient()) {
this.getAndUpdateOutput();
}
}
public void clear() {
for (final Slot s : this.craftingSlots) {
s.putStack(ItemStack.EMPTY);
}
for (final Slot s : this.outputSlots) {
s.putStack(ItemStack.EMPTY);
}
this.detectAndSendChanges();
this.getAndUpdateOutput();
}
@Override
public IItemHandler getInventoryByName(final String name) {
if (name.equals("player")) {
return new PlayerInvWrapper(this.getInventoryPlayer());
}
return this.getPatternTerminal().getInventoryByName(name);
}
@Override
public boolean useRealItems() {
return false;
}
public void toggleSubstitute() {
this.substitute = !this.substitute;
this.detectAndSendChanges();
this.getAndUpdateOutput();
}
public boolean isCraftingMode() {
return this.craftingMode;
}
private void setCraftingMode(final boolean craftingMode) {
this.craftingMode = craftingMode;
}
public PartPatternTerminal getPatternTerminal() {
return this.patternTerminal;
}
boolean isSubstitute() {
return this.substitute;
}
public void setSubstitute(final boolean substitute) {
this.substitute = substitute;
}
}
@@ -61,7 +61,7 @@ public class ContainerSecurityStation extends ContainerMEMonitorable implements
this.securityBox = (TileSecurityStation) monitorable;
this.addSlotToContainer(this.configSlot = new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.BIOMETRIC_CARD, this.securityBox
.getConfigSlot(), 0, 37, -33 + jeiOffset, ip));
.getConfigSlot(), 0, 37, -33, ip));
this.addSlotToContainer(
this.wirelessIn = new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.ENCODABLE_ITEM, this.wirelessEncoder, 0, 212, 10 + jeiOffset, ip));
@@ -46,6 +46,7 @@ public class AppEngSlot extends Slot {
private int IIcon = -1;
private hasCalculatedValidness isValid;
private boolean isDisplay = false;
private boolean returnAsSingleStack;
public AppEngSlot(final IItemHandler inv, final int idx, final int x, final int y) {
super(emptyInventory, idx, x, y);
@@ -94,16 +95,29 @@ public class AppEngSlot extends Slot {
return ItemStack.EMPTY;
}
if (this.isDisplay()) {
this.setDisplay(false);
ItemStack retStack = this.getDisplayStack().copy();
retStack.setCount(1);
return retStack;
if (this.returnAsSingleStack()) {
setReturnAsSingleStack(false);
ItemStack ret = this.getDisplayStack().copy();
ret.setCount(1);
return ret;
}
return this.getDisplayStack();
}
return this.itemHandler.getStackInSlot(this.index);
}
private boolean returnAsSingleStack() {
return this.returnAsSingleStack;
}
public void setReturnAsSingleStack(boolean returnAsSingleStack) {
this.returnAsSingleStack = returnAsSingleStack;
}
@Override
public void putStack(final ItemStack stack) {
if (this.isSlotEnabled()) {
@@ -122,7 +136,7 @@ public class AppEngSlot extends Slot {
@Override
public void onSlotChanged() {
this.setIsValid(hasCalculatedValidness.NotAvailable);
if (this.isSlotEnabled()) {
if (this.isSlotEnabled() && this.itemHandler != null) {
ItemHandlerUtil.setStackInSlot(this.itemHandler, this.index, this.getStack().copy());
if (this.getContainer() != null) {
@@ -40,6 +40,10 @@ import appeng.util.inv.AdaptorItemHandler;
import appeng.util.inv.WrapperCursorItemHandler;
import appeng.util.inv.WrapperInvItemHandler;
import appeng.util.item.AEItemStack;
import com.blamejared.recipestages.recipes.RecipeStage;
import net.darkhax.gamestages.GameStageHelper;
import net.darkhax.itemstages.ItemStages;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.Item;
@@ -49,6 +53,9 @@ import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.items.IItemHandler;
import java.util.ArrayList;
@@ -90,6 +97,28 @@ public class SlotCraftingTerm extends AppEngCraftingSlot {
return is;
}
// Don't render the item client-side if the item stage for it is not unlocked yet
@Override
public ItemStack getStack() {
if (Platform.isClient() && Loader.isModLoaded("itemstages")) {
return itemstageStack();
}
return super.getStack();
}
@SideOnly(Side.CLIENT)
ItemStack itemstageStack() {
final ItemStack item = super.getStack();
final String itemsStage = ItemStages.getStage(item);
final String enchantStage = ItemStages.getEnchantStage(item);
final EntityPlayer player = Minecraft.getMinecraft().player;
if ((itemsStage != null && !GameStageHelper.hasStage(player, itemsStage))
|| (enchantStage != null && !GameStageHelper.hasStage(player, enchantStage)))
return ItemStack.EMPTY;
return super.getStack();
}
public void doClick(final InventoryAction action, final EntityPlayer who) {
if (this.getStack().isEmpty()) {
return;
@@ -144,17 +173,39 @@ public class SlotCraftingTerm extends AppEngCraftingSlot {
}
// TODO: This is really hacky and NEEDS to be solved with a full container/gui refactoring.
protected IRecipe findRecipe(InventoryCrafting ic, World world) {
protected IRecipe findRecipe(InventoryCrafting ic, World world, EntityPlayer player) {
if (this.container instanceof ContainerCraftingTerm) {
final ContainerCraftingTerm containerTerminal = (ContainerCraftingTerm) this.container;
final IRecipe recipe = containerTerminal.getCurrentRecipe();
if (recipe != null && recipe.matches(ic, world)) {
return containerTerminal.getCurrentRecipe();
return handleRecipe(ic, containerTerminal.getCurrentRecipe(), player);
}
}
return CraftingManager.findMatchingRecipe(ic, world);
return handleRecipe(ic, CraftingManager.findMatchingRecipe(ic, world), player);
}
// Returns null in case this recipe is not yet unlocked
private IRecipe handleRecipe(InventoryCrafting ic, IRecipe recipe, EntityPlayer player) {
if (Loader.isModLoaded("recipestages")) {
if (recipe instanceof RecipeStage) {
final RecipeStage staged = (RecipeStage) recipe;
if (!staged.isGoodForCrafting(ic))
return null;
}
}
if (Loader.isModLoaded("itemstages")) {
final String itemsStage = ItemStages.getStage(recipe.getRecipeOutput());
final String enchantStage = ItemStages.getEnchantStage(recipe.getRecipeOutput());
if ((itemsStage != null && !GameStageHelper.hasStage(player, itemsStage))
|| (enchantStage != null && !GameStageHelper.hasStage(player, enchantStage)))
return null;
}
return recipe;
}
// TODO: This is really hacky and NEEDS to be solved with a full container/gui refactoring.
@@ -192,7 +243,7 @@ public class SlotCraftingTerm extends AppEngCraftingSlot {
ic.setInventorySlotContents(x, this.getPattern().getStackInSlot(x));
}
final IRecipe r = this.findRecipe(ic, p.world);
final IRecipe r = this.findRecipe(ic, p.world, p);
if (r == null) {
final Item target = request.getItem();
@@ -0,0 +1,9 @@
package appeng.container.slot;
import net.minecraftforge.items.IItemHandler;
public class SlotOversized extends SlotNormal {
public SlotOversized(IItemHandler inv, int slot, int xPos, int yPos) {
super(inv, slot, xPos, yPos);
}
}
+58
View File
@@ -0,0 +1,58 @@
/*
* Copyright (c) 2018, 2020 Adrian Siekierka
*
* This file is part of StackUp.
*
* StackUp is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* StackUp is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with StackUp. If not, see <http://www.gnu.org/licenses/>.
*/
package appeng.core;
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;
import javax.annotation.Nullable;
import java.util.Map;
@IFMLLoadingPlugin.Name("AE2ELCore")
@IFMLLoadingPlugin.MCVersion("1.12.2")
@IFMLLoadingPlugin.SortingIndex(1001)
@IFMLLoadingPlugin.TransformerExclusions("appeng.core.transformer")
public class AE2ELCore implements IFMLLoadingPlugin {
@Override
public String[] getASMTransformerClass() {
return new String[]{
"appeng.core.transformer.AE2ELTransformer"
};
}
@Override
public String getModContainerClass() {
return null;
}
@Nullable
@Override
public String getSetupClass() {
return null;
}
@Override
public void injectData(Map<String, Object> data) {
}
@Override
public String getAccessTransformerClass() {
return null;
}
}
+5 -1
View File
@@ -72,7 +72,11 @@ public final class AppEng {
private static final String FORGE_CURRENT_VERSION = ForgeVersion.majorVersion + "." + ForgeVersion.minorVersion + "." + ForgeVersion.revisionVersion + "." + ForgeVersion.buildVersion;
private static final String FORGE_MAX_VERSION = (ForgeVersion.majorVersion + 1) + ".0.0.0";
public static final String MOD_DEPENDENCIES = "required-after:forge@[" + FORGE_CURRENT_VERSION + "," + FORGE_MAX_VERSION + ");after:ctm@[" + CTM.VERSION + ",);";
public static final String MOD_DEPENDENCIES = "required-after:forge@[" + FORGE_CURRENT_VERSION + "," + FORGE_MAX_VERSION + ");" +
"after:ctm@[" + CTM.VERSION + ",);" +
"after:itemstages;" +
"after:recipestages;" +
"before:bogosorter@[1.2.2,);";
@Nonnull
private static final AppEng INSTANCE = new AppEng();
@@ -28,6 +28,7 @@ package appeng.core.api.imc;
import appeng.api.AEApi;
import appeng.core.AELog;
import appeng.core.api.IIMCProcessor;
import net.minecraft.launchwrapper.Launch;
import net.minecraftforge.fml.common.event.FMLInterModComms.IMCMessage;
@@ -37,7 +38,7 @@ public class IMCSpatial implements IIMCProcessor {
public void process(final IMCMessage m) {
try {
final Class classInstance = Class.forName(m.getStringValue());
final Class classInstance = Class.forName(m.getStringValue(), false, Launch.classLoader);
AEApi.instance().registries().movable().whiteListTileEntity(classInstance);
} catch (final ClassNotFoundException e) {
AELog.info("Bad Class Registered: " + m.getStringValue() + " by " + m.getSender());
@@ -63,6 +63,8 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import static appeng.helpers.ItemStackHelper.stackFromNBT;
public class PacketJEIRecipe extends AppEngPacket {
@@ -85,7 +87,7 @@ public class PacketJEIRecipe extends AppEngPacket {
if (list.tagCount() > 0) {
this.recipe.add(new ItemStack[list.tagCount()]);
for (int y = 0; y < list.tagCount(); y++) {
this.recipe.get(x)[y] = new ItemStack(list.getCompoundTagAt(y));
this.recipe.get(x)[y] = stackFromNBT(list.getCompoundTagAt(y));
}
} else {
this.recipe.add(emptyArray);
@@ -97,7 +99,7 @@ public class PacketJEIRecipe extends AppEngPacket {
final NBTTagList outputList = comp.getTagList("outputs", 10);
this.output = new ArrayList<>();
for (int z = 0; z < outputList.tagCount(); z++) {
this.output.add(new ItemStack(outputList.getCompoundTagAt(z)));
this.output.add(stackFromNBT(outputList.getCompoundTagAt(z)));
}
}
}
@@ -197,9 +199,12 @@ public class PacketJEIRecipe extends AppEngPacket {
if (request.getItem().isDamageable() || Platform.isGTDamageableItem(request.getItem())) {
Collection<IAEItemStack> outList = inv.getInventory(AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class)).getStorageList().findFuzzy(request, FuzzyMode.IGNORE_ALL);
for (IAEItemStack is : outList) {
if (is.getDefinition().getMetadata() == request.getDefinition().getMetadata()) {
out = Platform.poweredExtraction(energy, storage, is.copy().setStackSize(1), cct.getActionSource());
if (Platform.isGTDamageableItem(request.getItem())) {
if (!(is.getDefinition().getMetadata() == request.getDefinition().getMetadata())) {
continue;
}
}
out = Platform.poweredExtraction(energy, storage, is.copy().setStackSize(1), cct.getActionSource());
if (out != null) {
break;
}
@@ -133,7 +133,7 @@ public class PacketValueConfig extends AppEngPacket {
if (c instanceof ContainerPatternTerm) {
final ContainerPatternTerm cpt = (ContainerPatternTerm) c;
if (this.Name.equals("PatternTerminal.CraftMode")) {
cpt.getPatternTerminal().setCraftingRecipe(this.Value.equals("1"));
cpt.getPart().setCraftingRecipe(this.Value.equals("1"));
} else if (this.Name.equals("PatternTerminal.Encode")) {
if (this.Value.equals("2")) {
cpt.encodeAndMoveToInventory();
@@ -157,7 +157,7 @@ public class PacketValueConfig extends AppEngPacket {
} else if (this.Name.equals("PatternTerminal.MaximizeCount")) {
cpt.maximizeCount();
} else if (this.Name.equals("PatternTerminal.Substitute")) {
cpt.getPatternTerminal().setSubstitution(this.Value.equals("1"));
cpt.getPart().setSubstitution(this.Value.equals("1"));
}
} else if (c instanceof ContainerExpandedProcessingPatternTerm) {
final ContainerExpandedProcessingPatternTerm cept = (ContainerExpandedProcessingPatternTerm) c;
@@ -0,0 +1,61 @@
/*
* Copyright (c) 2018, 2020 Adrian Siekierka
*
* This file is part of StackUp.
*
* StackUp is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* StackUp is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with StackUp. If not, see <http://www.gnu.org/licenses/>.
*/
package appeng.core.transformer;
import net.minecraft.launchwrapper.IClassTransformer;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.tree.ClassNode;
import java.util.function.Consumer;
public class AE2ELTransformer implements IClassTransformer {
@Override
public byte[] transform(String name, String transformedName, byte[] basicClass) {
transformedName = transformedName.replace('/', '.');
byte[] data = basicClass;
Consumer<ClassNode> consumer = (n) -> {
};
Consumer<ClassNode> emptyConsumer = consumer;
if ("net.minecraft.item.ItemStack".equals(transformedName)) {
consumer = consumer.andThen(ItemStackPatch::patchCountGetSet);
}
if (consumer != emptyConsumer) {
return processNode(basicClass, consumer);
} else {
return data;
}
}
public static byte[] processNode(byte[] data, Consumer<ClassNode> classNodeConsumer) {
ClassReader reader = new ClassReader(data);
ClassNode nodeOrig = new ClassNode();
reader.accept(nodeOrig, 0);
classNodeConsumer.accept(nodeOrig);
ClassWriter writer = new ClassWriter(0);
nodeOrig.accept(writer);
return writer.toByteArray();
}
}
@@ -0,0 +1,98 @@
/*
* Copyright (c) 2018, 2020 Adrian Siekierka
*
* This file is part of StackUp.
*
* StackUp is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* StackUp is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with StackUp. If not, see <http://www.gnu.org/licenses/>.
*/
package appeng.core.transformer;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.LdcInsnNode;
import org.objectweb.asm.tree.MethodInsnNode;
import org.objectweb.asm.tree.MethodNode;
import java.util.ListIterator;
public final class ItemStackPatch {
private ItemStackPatch() {
}
public static void patchCountGetSet(ClassNode node) {
for (MethodNode mn : node.methods) {
if ("<init>".equals(mn.name)) {
ListIterator<AbstractInsnNode> it = mn.instructions.iterator();
while (it.hasNext()) {
AbstractInsnNode in = it.next();
if (in instanceof LdcInsnNode && "Count".equals(((LdcInsnNode) in).cst)) {
AbstractInsnNode in2 = it.next();
if (in2.getOpcode() == Opcodes.INVOKEVIRTUAL) {
// :thinking:
boolean patched = false;
MethodInsnNode min2 = (MethodInsnNode) in2;
if (min2.name.equals("getByte")) {
min2.name = "getInteger";
patched = true;
} else if (min2.name.equals("func_74771_c")) {
min2.name = "func_74762_e";
patched = true;
}
if (patched) {
min2.desc = "(Ljava/lang/String;)I";
System.out.println("Patched ItemStack Count getter!");
}
}
}
}
} else if ("func_77955_b".equals(mn.name) || "writeToNBT".equals(mn.name)) {
ListIterator<AbstractInsnNode> it = mn.instructions.iterator();
while (it.hasNext()) {
AbstractInsnNode in = it.next();
if (in instanceof LdcInsnNode && "Count".equals(((LdcInsnNode) in).cst)) {
it.next();
it.next();
it.next();
AbstractInsnNode in2 = it.next();
if (in2.getOpcode() == Opcodes.INVOKEVIRTUAL) {
// :thinking:
boolean patched = false;
MethodInsnNode min2 = (MethodInsnNode) in2;
if (min2.name.equals("setByte")) {
min2.name = "setInteger";
patched = true;
} else if (min2.name.equals("func_74774_a")) {
min2.name = "func_74768_a";
patched = true;
}
if (patched) {
min2.desc = "(Ljava/lang/String;I)V";
System.out.println("Patched ItemStack Count setter!");
// Remove I2B cast
it.previous();
it.previous();
it.remove();
}
}
}
}
}
}
}
}
@@ -41,7 +41,6 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@Optional.Interface(iface = "gregtech.api.items.IToolItem", modid = "gregtech")
public class CraftingTreeNode {
// what slot!
@@ -50,6 +50,7 @@ public class GuiFluidInterface extends GuiUpgradeable implements IConfigManagerH
public GuiFluidInterface(final InventoryPlayer ip, final IFluidInterfaceHost te) {
super(new ContainerFluidInterface(ip, te));
this.ySize = 231;
this.xSize = 245;
this.host = te;
(this.container = (ContainerFluidInterface) this.inventorySlots).setGui(this);
@@ -85,7 +86,7 @@ public class GuiFluidInterface extends GuiUpgradeable implements IConfigManagerH
@Override
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) {
this.bindTexture("guis/interfacefluid.png");
this.bindTexture("guis/interfacefluidextendedlife.png");
this.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize);
}
@@ -266,7 +266,7 @@ public class DualityFluidInterface implements IGridTickable, IStorageMonitorable
final Block directedBlock = directedBlockState.getBlock();
ItemStack what = new ItemStack(directedBlock, 1, directedBlock.getMetaFromState(directedBlockState));
if (Loader.isModLoaded("gregtech") && directedBlock instanceof BlockMachine) {
if (Platform.GTLoaded && directedBlock instanceof BlockMachine) {
MetaTileEntity metaTileEntity = Platform.getMetaTileEntity(directedTile.getWorld(), directedTile.getPos());
if (metaTileEntity != null) {
return metaTileEntity.getMetaFullName();
@@ -528,6 +528,7 @@ public class DualityFluidInterface implements IGridTickable, IStorageMonitorable
this.tanks.readFromNBT(data, "storage");
this.priority = data.getInteger("priority");
this.upgrades.readFromNBT(data, "upgrades");
this.tanks.setCapacity((int) (Math.pow(4, this.getInstalledUpgrades(Upgrades.CAPACITY) + 1) * Fluid.BUCKET_VOLUME));
this.readConfig();
}
@@ -104,7 +104,7 @@ public class AEFluidInventory implements IAEFluidTank {
if (doFill) {
if (fluid == null) {
this.setFluidInSlot(slot, AEFluidStack.fromFluidStack(resource));
this.setFluidInSlot(slot, AEFluidStack.fromFluidStack(resource).setStackSize(amountToStore));
} else {
fluid.setStackSize(fluid.getStackSize() + amountToStore);
this.onContentChanged(slot);
@@ -161,13 +161,6 @@ public final class FluidList implements IItemList<IAEFluidStack> {
}
}
@Override
public FluidList clone() {
FluidList list = new FluidList();
list.records.putAll(records);
return list;
}
private IAEFluidStack getFluidRecord(final IAEFluidStack fluid) {
return this.records.get(fluid);
}
@@ -65,6 +65,7 @@ import appeng.parts.automation.UpgradeInventory;
import appeng.parts.misc.PartInterface;
import appeng.tile.inventory.AppEngInternalAEInventory;
import appeng.tile.inventory.AppEngInternalInventory;
import appeng.tile.inventory.AppEngInternalOversizedInventory;
import appeng.tile.networking.TileCableBus;
import appeng.util.ConfigManager;
import appeng.util.IConfigManagerHost;
@@ -100,6 +101,8 @@ import net.minecraftforge.items.wrapper.RangedWrapper;
import javax.annotation.Nullable;
import java.util.*;
import static appeng.helpers.ItemStackHelper.*;
public class DualityInterface implements IGridTickable, IStorageMonitorable, IInventoryDestination, IAEAppEngInventory, IConfigManagerHost, ICraftingProvider, IUpgradeableHost {
public static final int NUMBER_OF_STORAGE_SLOTS = 9;
@@ -115,7 +118,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
private final IActionSource interfaceRequestSource;
private final ConfigManager cm = new ConfigManager(this);
private final AppEngInternalAEInventory config = new AppEngInternalAEInventory(this, NUMBER_OF_CONFIG_SLOTS, 512);
private final AppEngInternalInventory storage = new AppEngInternalInventory(this, NUMBER_OF_STORAGE_SLOTS, 512);
private final AppEngInternalInventory storage = new AppEngInternalOversizedInventory(this, NUMBER_OF_STORAGE_SLOTS, 512);
private final AppEngInternalInventory patterns = new AppEngInternalInventory(this, NUMBER_OF_PATTERN_SLOTS);
private final MEMonitorPassThrough<IAEItemStack> items = new MEMonitorPassThrough<>(new NullInventory<IAEItemStack>(), AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class));
private final MEMonitorPassThrough<IAEFluidStack> fluids = new MEMonitorPassThrough<>(new NullInventory<IAEFluidStack>(), AEApi.instance().storage().getStorageChannel(IFluidStorageChannel.class));
@@ -207,9 +210,8 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
final NBTTagList waitingToSend = new NBTTagList();
if (this.waitingToSend != null) {
for (final ItemStack is : this.waitingToSend) {
final NBTTagCompound item = new NBTTagCompound();
is.writeToNBT(item);
waitingToSend.appendTag(item);
final NBTTagCompound itemNBT = stackToNBT(is);
waitingToSend.appendTag(itemNBT);
}
}
data.setTag("waitingToSend", waitingToSend);
@@ -221,9 +223,8 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
NBTTagList waitingListSided = new NBTTagList();
if (this.waitingToSendFacing.containsKey(s)) {
for (final ItemStack is : this.waitingToSendFacing.get(s)) {
final NBTTagCompound item = new NBTTagCompound();
is.writeToNBT(item);
waitingListSided.appendTag(item);
final NBTTagCompound itemNBT = stackToNBT(is);
waitingListSided.appendTag(itemNBT);
}
sidedWaitList.setTag(s.name(), waitingListSided);
}
@@ -239,7 +240,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
for (int x = 0; x < waitingList.tagCount(); x++) {
final NBTTagCompound c = waitingList.getCompoundTagAt(x);
if (c != null) {
final ItemStack is = new ItemStack(c);
final ItemStack is = stackFromNBT(c);
this.addToSendList(is);
}
}
@@ -254,7 +255,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
for (int x = 0; x < w.tagCount(); x++) {
final NBTTagCompound c = w.getCompoundTagAt(x);
if (c != null) {
final ItemStack is = new ItemStack(c);
final ItemStack is = stackFromNBT(c);
this.addToSendListFacing(is, EnumFacing.getFront(s.getIndex()));
}
}
@@ -626,7 +627,8 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
if (result.isEmpty()) {
whatToSend = ItemStack.EMPTY;
} else {
whatToSend.setCount(whatToSend.getCount() - (whatToSend.getCount() - result.getCount()));
whatToSend.setCount(result.getCount());
whatToSend.setTagCompound(result.getTagCompound());
}
if (whatToSend.isEmpty()) {
@@ -680,6 +682,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
final IAEItemStack result = inv.injectItems(AEItemStack.fromItemStack(whatToSend), Actionable.MODULATE, this.mySource);
if (result != null) {
whatToSend.setCount((int) result.getStackSize());
whatToSend.setTagCompound(result.getDefinition().getTagCompound());
} else {
i.remove();
}
@@ -708,6 +711,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
final ItemStack result = ad.addItems(whatToSend);
if (!result.isEmpty()) {
whatToSend.setCount(result.getCount());
whatToSend.setTagCompound(result.getTagCompound());
} else {
i.remove();
}
@@ -1105,7 +1109,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
final InventoryAdaptor ad = InventoryAdaptor.getAdaptor(te, s.getOpposite());
if (ad != null) {
if (Loader.isModLoaded("actuallyadditions") && Loader.isModLoaded("gregtech") && te instanceof IPhantomTile) {
if (Loader.isModLoaded("actuallyadditions") && Platform.GTLoaded && te instanceof IPhantomTile) {
IPhantomTile phantomTE = ((IPhantomTile) te);
if (phantomTE.hasBoundPosition()) {
TileEntity phantom = w.getTileEntity(phantomTE.getBoundPosition());
@@ -1287,7 +1291,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
final Block directedBlock = directedBlockState.getBlock();
ItemStack what = new ItemStack(directedBlock, 1, directedBlock.getMetaFromState(directedBlockState));
if (Loader.isModLoaded("gregtech") && directedBlock instanceof BlockMachine) {
if (Platform.GTLoaded && directedBlock instanceof BlockMachine) {
MetaTileEntity metaTileEntity = Platform.getMetaTileEntity(directedTile.getWorld(), directedTile.getPos());
if (metaTileEntity != null) {
return metaTileEntity.getMetaFullName();
@@ -28,6 +28,8 @@ import net.minecraft.util.text.TextFormatting;
import java.util.ArrayList;
import java.util.List;
import static appeng.helpers.ItemStackHelper.stackFromNBT;
public class InvalidPatternHelper {
@@ -89,11 +91,14 @@ public class InvalidPatternHelper {
private final ItemStack stack;
public PatternIngredient(NBTTagCompound tag) {
this.stack = new ItemStack(tag);
this.stack = stackFromNBT(tag);
if (this.stack.isEmpty()) {
this.id = tag.getString("id");
this.count = tag.getByte("Count");
if (tag.hasKey("stackSize")) {
this.count = tag.getInteger("stackSize");
}
this.damage = Math.max(0, tag.getShort("Damage"));
}
}
@@ -0,0 +1,30 @@
package appeng.helpers;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
/**
* Methods to help with the added "stackSize" NBT tag to get around "Count" being written and read as a byte.
*/
public class ItemStackHelper {
public static ItemStack stackFromNBT(NBTTagCompound itemNBT) {
ItemStack is = new ItemStack(itemNBT);
if (itemNBT.hasKey("stackSize")) {
is.setCount(itemNBT.getInteger("stackSize"));
}
return is;
}
public static void stackWriteToNBT(ItemStack is, NBTTagCompound itemNBT) {
is.writeToNBT(itemNBT);
if (is.getCount() > Byte.MAX_VALUE) {
itemNBT.setInteger("stackSize", is.getCount());
}
}
public static NBTTagCompound stackToNBT(ItemStack is) {
NBTTagCompound itemNBT = new NBTTagCompound();
stackWriteToNBT(is, itemNBT);
return itemNBT;
}
}
@@ -42,7 +42,7 @@ public class NonBlockingItems {
continue;
}
if (ModItemMeta[0].equals("gregtech") && Platform.isModLoaded("gregtech")) {
if (ModItemMeta[0].equals("gregtech") && Platform.GTLoaded) {
boolean found = false;
for (MetaItem<?> metaItem : MetaItem.getMetaItems()) {
MetaItem<?>.MetaValueItem metaItem2 = metaItem.getItem(ModItemMeta[1]);
@@ -40,15 +40,17 @@ import net.minecraftforge.common.crafting.IShapedRecipe;
import java.util.*;
import static appeng.helpers.ItemStackHelper.stackFromNBT;
public class PatternHelper implements ICraftingPatternDetails, Comparable<PatternHelper> {
private static final int CRAFTING_GRID_DIMENSION = 3;
public static final int CRAFTING_GRID_DIMENSION = 3;
private static final int CRAFTING_INPUT_LIMIT = CRAFTING_GRID_DIMENSION * CRAFTING_GRID_DIMENSION;
public static final int PROCESSING_INPUT_HEIGHT = 4;
public static final int PROCESSING_INPUT_WIDTH = 4;
public static final int PROCESSING_INPUT_LIMIT = PROCESSING_INPUT_HEIGHT * PROCESSING_INPUT_WIDTH;
private static final int CRAFTING_OUTPUT_LIMIT = 1;
public static final int CRAFTING_OUTPUT_LIMIT = 1;
public static final int PROCESSING_OUTPUT_LIMIT = 6;
private final ItemStack patternItem;
@@ -91,11 +93,7 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable<Patter
for (int x = 0; x < inTag.tagCount(); x++) {
NBTTagCompound ingredient = inTag.getCompoundTagAt(x);
final ItemStack gs = new ItemStack(ingredient);
if (ingredient.hasKey("stackSize")) {
gs.setCount(ingredient.getInteger("stackSize"));
}
final ItemStack gs = stackFromNBT(ingredient);
if (!ingredient.hasNoTags() && gs.isEmpty()) {
throw new IllegalArgumentException("No pattern here!");
@@ -126,11 +124,7 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable<Patter
for (int x = 0; x < outTag.tagCount(); x++) {
NBTTagCompound resultItemTag = outTag.getCompoundTagAt(x);
final ItemStack gs = new ItemStack(resultItemTag);
if (resultItemTag.hasKey("stackSize")) {
gs.setCount(resultItemTag.getInteger("stackSize"));
}
final ItemStack gs = stackFromNBT(resultItemTag);
if (!resultItemTag.hasNoTags() && gs.isEmpty()) {
throw new IllegalArgumentException("No pattern here!");
@@ -9,7 +9,7 @@ import java.util.Comparator;
public class InventoryBogoSortModule {
private static final boolean loaded = Loader.isModLoaded("bogosorter");
public static final Comparator<IAEItemStack> COMPARATOR = (o1, o2) -> SortHandler.ITEM_COMPARATOR.compare(o1.getDefinition(), o2.getDefinition());
public static final Comparator<IAEItemStack> COMPARATOR = (o1, o2) -> SortHandler.getClientItemComparator().compare(o1.getDefinition(), o2.getDefinition());
public static boolean isLoaded() {
@@ -0,0 +1,49 @@
package appeng.integration.modules.chisel;
import appeng.block.networking.BlockCableBus;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.MovementInput;
import net.minecraft.util.MovementInputFromOptions;
import net.minecraft.util.math.BlockPos;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Optional;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import team.chisel.common.config.Configurations;
import static team.chisel.client.handler.BlockSpeedHandler.speedupBlocks;
@Mod.EventBusSubscriber(Side.CLIENT)
public class ChiselBlockSpeedHandler {
@SideOnly(Side.CLIENT)
private static MovementInput manualInputCheck;
@Optional.Method(modid = "chisel")
@SubscribeEvent
@SideOnly(Side.CLIENT)
public static void speedupPlayer(TickEvent.PlayerTickEvent event) {
if (event.phase == TickEvent.Phase.START && event.side.isClient() && event.player.onGround && event.player instanceof EntityPlayerSP) {
if (manualInputCheck == null) {
manualInputCheck = new MovementInputFromOptions(Minecraft.getMinecraft().gameSettings);
}
EntityPlayerSP player = (EntityPlayerSP) event.player;
BlockPos blockPosBelow = new BlockPos(player.posX, player.posY - (1 / 16D), player.posZ);
IBlockState below = player.getEntityWorld().getBlockState(blockPosBelow);
if (below.getBlock() instanceof BlockCableBus) {
IBlockState f = ((BlockCableBus) below.getBlock()).getFacadeState(Minecraft.getMinecraft().world, blockPosBelow, EnumFacing.UP);
if (speedupBlocks.contains(f.getBlock())) {
manualInputCheck.updatePlayerMoveState();
if ((manualInputCheck.moveForward != 0 || manualInputCheck.moveStrafe != 0) && !player.isInWater()) {
player.motionX *= Configurations.concreteVelocityMult;
player.motionZ *= Configurations.concreteVelocityMult;
}
}
}
}
}
}
@@ -0,0 +1,74 @@
package appeng.integration.modules.gregtech;
import net.minecraft.item.ItemStack;
import net.minecraft.launchwrapper.Launch;
import net.minecraftforge.fml.relauncher.ReflectionHelper;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
public class ToolClass {
private static Class<?> GTToolClass;
private static Method getMaxItemDamage = null;
private static Method getItemDamage = null;
static {
try {
GTToolClass = Class.forName("gregtech.api.items.IToolItem", false, Launch.classLoader);
getItemDamage = ReflectionHelper.findMethod(GTToolClass, "getItemDamage", null, ItemStack.class);
getMaxItemDamage = ReflectionHelper.findMethod(GTToolClass, "getMaxItemDamage", null, ItemStack.class);
} catch (ClassNotFoundException ignored) {
try {
GTToolClass = Class.forName("gregtech.api.items.toolitem.IGTTool", false, Launch.classLoader);
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
}
}
private static final Enum<Interfaces> GTToolInterface = getGTToolInterface();
public static Class<?> getGTToolClass() {
if (GTToolClass == null) {
System.out.printf("TToolClass == null");
}
return GTToolClass;
}
public static Enum<Interfaces> getGTToolInterface() {
if (GTToolClass.getName().equals("IToolItem")) {
return Interfaces.ITOOLITEM;
} else {
return Interfaces.IGTTOOL;
}
}
public static int getGTMaxDamage(ItemStack itemStack) {
if (GTToolInterface == Interfaces.ITOOLITEM) {
try {
return (int) getMaxItemDamage.invoke(itemStack.getItem(), itemStack);
} catch (IllegalAccessException | InvocationTargetException e) {
throw new RuntimeException(e);
}
} else {
return itemStack.getMaxDamage();
}
}
public static int getGTitemDamage(ItemStack itemStack) {
if (GTToolInterface == Interfaces.ITOOLITEM) {
try {
return (int) getItemDamage.invoke(itemStack.getItem(), itemStack);
} catch (IllegalAccessException | InvocationTargetException e) {
throw new RuntimeException(e);
}
} else {
return itemStack.getItemDamage();
}
}
enum Interfaces {
ITOOLITEM,
IGTTOOL
}
}
@@ -1,23 +1,35 @@
package appeng.integration.modules.jei;
import appeng.api.AEApi;
import appeng.api.config.FuzzyMode;
import appeng.api.storage.channels.IItemStorageChannel;
import appeng.api.storage.data.IAEItemStack;
import appeng.api.storage.data.IItemList;
import appeng.container.AEBaseContainer;
import appeng.container.implementations.ContainerCraftingTerm;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketInventoryAction;
import appeng.helpers.InventoryAction;
import appeng.util.Platform;
import appeng.util.item.AEItemStack;
import com.google.common.base.Stopwatch;
import mezz.jei.api.gui.ITooltipCallback;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.translation.I18n;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.wrapper.PlayerMainInvWrapper;
import org.lwjgl.input.Mouse;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.TimeUnit;
public class CraftableCallBack implements ITooltipCallback<ItemStack> {
private final IItemList<IAEItemStack> list;
private final Container container;
private final Stopwatch lastClicked = Stopwatch.createStarted();
public CraftableCallBack(Container container, IItemList<IAEItemStack> ir) {
this.list = ir;
@@ -26,19 +38,83 @@ public class CraftableCallBack implements ITooltipCallback<ItemStack> {
@Override
public void onTooltip(int slotIndex, boolean input, ItemStack ingredient, List<String> tooltip) {
if (!input) return;
if (list != null) {
AEItemStack stack = AEItemStack.fromItemStack(ingredient);
if (list.findPrecise(stack) != null) {
tooltip.add(I18n.translateToLocalFormatted("gui.appliedenergistics2.Missing"));
tooltip.add(I18n.translateToLocalFormatted("gui.tooltips.appliedenergistics2.Craftable"));
if (Mouse.isButtonDown(2)) {
((AEBaseContainer) container).setTargetStack(stack);
final PacketInventoryAction p = new PacketInventoryAction(InventoryAction.AUTO_CRAFT, container.getInventory().size(), 0);
NetworkHandler.instance().sendToServer(p);
IItemList<IAEItemStack> available = mergeInventories(list, (ContainerCraftingTerm) container);
IAEItemStack search = AEItemStack.fromItemStack(ingredient);
if (ingredient.getItem().isDamageable() || Platform.isGTDamageableItem(ingredient.getItem())) {
Collection<IAEItemStack> fuzzy = available.findFuzzy(search, FuzzyMode.IGNORE_ALL);
if (fuzzy.size() > 0) {
for (IAEItemStack itemStack : fuzzy) {
if (itemStack.getStackSize() > 0) {
if (Platform.isGTDamageableItem(ingredient.getItem())) {
if (!(ingredient.getMetadata() == itemStack.getDefinition().getMetadata())) {
continue;
}
}
break;
} else {
String line = "§c[" + I18n.translateToLocalFormatted("gui.appliedenergistics2.Missing") + "]";
tooltip.add(line);
if (itemStack.isCraftable()) {
line = "§1[" + I18n.translateToLocalFormatted("gui.tooltips.appliedenergistics2.Craftable") + "]";
tooltip.add(line);
if (Mouse.isButtonDown(2) && this.lastClicked.elapsed(TimeUnit.MILLISECONDS) > 200) {
this.lastClicked.reset().start();
((AEBaseContainer) container).setTargetStack(itemStack);
final PacketInventoryAction p = new PacketInventoryAction(InventoryAction.AUTO_CRAFT, container.getInventory().size(), 0);
NetworkHandler.instance().sendToServer(p);
}
}
}
}
} else {
String line = "§c[" + I18n.translateToLocalFormatted("gui.appliedenergistics2.Missing") + "]";
tooltip.add(line);
}
} else {
tooltip.add(I18n.translateToLocalFormatted("gui.appliedenergistics2.Missing"));
IAEItemStack found = available.findPrecise(search);
if (found != null) {
if (found.getStackSize() == 0) {
String line = "§c[" + I18n.translateToLocalFormatted("gui.appliedenergistics2.Missing") + "]";
tooltip.add(line);
}
if (found.isCraftable()) {
String line = "§1[" + I18n.translateToLocalFormatted("gui.tooltips.appliedenergistics2.Craftable") + "]";
tooltip.add(line);
if (Mouse.isButtonDown(2) && this.lastClicked.elapsed(TimeUnit.MILLISECONDS) > 200) {
this.lastClicked.reset().start();
((AEBaseContainer) container).setTargetStack(found);
final PacketInventoryAction p = new PacketInventoryAction(InventoryAction.AUTO_CRAFT, container.getInventory().size(), 0);
NetworkHandler.instance().sendToServer(p);
}
}
} else {
String line = "§c[" + I18n.translateToLocalFormatted("gui.appliedenergistics2.Missing") + "]";
tooltip.add(line);
}
}
}
}
IItemList<IAEItemStack> mergeInventories(IItemList<IAEItemStack> repo, ContainerCraftingTerm containerCraftingTerm) {
IItemList<IAEItemStack> itemList = AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class).createList();
for (IAEItemStack i : repo) {
itemList.addStorage(i);
}
PlayerMainInvWrapper invWrapper = new PlayerMainInvWrapper(containerCraftingTerm.getPlayerInv());
for (int i = 0; i < invWrapper.getSlots(); i++) {
itemList.addStorage(AEItemStack.fromItemStack(invWrapper.getStackInSlot(i)));
}
IItemHandler itemHandler = containerCraftingTerm.getInventoryByName("crafting");
for (int i = 0; i < itemHandler.getSlots(); i++) {
itemList.addStorage(AEItemStack.fromItemStack(itemHandler.getStackInSlot(i)));
}
return itemList;
}
}
@@ -1,6 +1,8 @@
package appeng.integration.modules.jei;
import appeng.api.AEApi;
import appeng.api.config.FuzzyMode;
import appeng.api.storage.channels.IItemStorageChannel;
import appeng.api.storage.data.IAEItemStack;
import appeng.api.storage.data.IItemList;
import appeng.client.gui.implementations.GuiCraftingTerm;
@@ -14,16 +16,27 @@ import mezz.jei.gui.recipes.RecipeLayout;
import net.minecraft.client.Minecraft;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.wrapper.PlayerMainInvWrapper;
import javax.annotation.Nonnull;
import java.awt.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import static mezz.jei.api.recipe.transfer.IRecipeTransferError.Type.USER_FACING;
public class JEIMissingItem implements IRecipeTransferError {
private boolean errored;
public long lastUpdate;
private final List<Integer> craftableSlots = new ArrayList<>();
private final List<Integer> foundSlots = new ArrayList<>();
IItemList<IAEItemStack> available = AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class).createList();
IItemList<IAEItemStack> used = AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class).createList();
JEIMissingItem(Container container, @Nonnull IRecipeLayout recipeLayout) {
if (container instanceof ContainerCraftingTerm) {
@@ -31,44 +44,56 @@ public class JEIMissingItem implements IRecipeTransferError {
GuiCraftingTerm g = (GuiCraftingTerm) craftingTerm.getGui();
IItemList<IAEItemStack> ir = g.getRepo().getList();
IItemList<IAEItemStack> available = mergeInventories(ir, (ContainerCraftingTerm) container);
boolean found;
this.errored = false;
recipeLayout.getItemStacks().addTooltipCallback(new CraftableCallBack(container, available));
recipeLayout.getItemStacks().addTooltipCallback(new CraftableCallBack(container, ir));
IItemList<IAEItemStack> used = AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class).createList();
for (IGuiIngredient<?> i : recipeLayout.getItemStacks().getGuiIngredients().values()) {
found = false;
if (i.isInput() && i.getAllIngredients().size() > 0) {
for (Object o : i.getAllIngredients()) {
if (o instanceof ItemStack) {
ItemStack stack = (ItemStack) o;
List<?> allIngredients = i.getAllIngredients();
for (Object allIngredient : allIngredients) {
if (allIngredient instanceof ItemStack) {
ItemStack stack = (ItemStack) allIngredient;
if (!stack.isEmpty()) {
IAEItemStack search = AEItemStack.fromItemStack(stack);
if (stack.getItem().isDamageable() || Platform.isGTDamageableItem(stack.getItem())) {
Collection<IAEItemStack> fuzzy = ir.findFuzzy(AEItemStack.fromItemStack(stack), FuzzyMode.IGNORE_ALL);
Collection<IAEItemStack> fuzzy = available.findFuzzy(search, FuzzyMode.IGNORE_ALL);
if (fuzzy.size() > 0) {
for (IAEItemStack itemStack : fuzzy) {
if (itemStack.getStackSize() > 0) {
if (itemStack.fuzzyComparison(AEItemStack.fromItemStack(stack), FuzzyMode.IGNORE_ALL)) {
found = true;
break;
if (Platform.isGTDamageableItem(stack.getItem())) {
if (!(stack.getMetadata() == itemStack.getDefinition().getMetadata())) {
continue;
}
}
found = true;
used.add(itemStack.copy().setStackSize(1));
}
}
}
} else {
IAEItemStack ext = ir.findPrecise(AEItemStack.fromItemStack(stack));
IAEItemStack ext = available.findPrecise(search);
if (ext != null) {
if (ext.getStackSize() > 0) {
IAEItemStack usedStack = used.findPrecise(ext);
if (ext.getStackSize() > 0 && (usedStack == null || ext.getStackSize() > usedStack.getStackSize())) {
used.add(ext.copy().setStackSize(1));
found = true;
break;
}
}
}
} else {
found = true;
}
}
}
if (!found) {
this.errored = true;
break;
}
}
}
@@ -91,25 +116,55 @@ public class JEIMissingItem implements IRecipeTransferError {
IItemList<IAEItemStack> ir = g.getRepo().getList();
boolean found;
boolean craftable;
int currentSlot = 0;
this.errored = false;
if (System.currentTimeMillis() - lastUpdate > 1000) {
lastUpdate = System.currentTimeMillis();
available = mergeInventories(ir, (ContainerCraftingTerm) minecraft.player.openContainer);
this.foundSlots.clear();
this.craftableSlots.clear();
} else {
for (IGuiIngredient<?> i : recipeLayout.getItemStacks().getGuiIngredients().values()) {
if (i.isInput()) {
if (!foundSlots.contains(currentSlot)) {
if (craftableSlots.contains(currentSlot)) {
i.drawHighlight(minecraft, new Color(0.0f, 0.0f, 1.0f, 0.4f), recipeX, recipeY);
} else {
i.drawHighlight(minecraft, new Color(1.0f, 0.0f, 0.0f, 0.4f), recipeX, recipeY);
}
}
}
currentSlot++;
}
return;
}
this.used.resetStatus();
for (IGuiIngredient<?> i : recipeLayout.getItemStacks().getGuiIngredients().values()) {
found = false;
craftable = false;
if (i.isInput() && i.getAllIngredients().size() > 0) {
for (Object o : i.getAllIngredients()) {
if (o instanceof ItemStack) {
ItemStack stack = (ItemStack) o;
ArrayList<ItemStack> valid = new ArrayList<>();
if (i.isInput()) {
List<?> allIngredients = i.getAllIngredients();
for (Object allIngredient : allIngredients) {
if (allIngredient instanceof ItemStack) {
ItemStack stack = (ItemStack) allIngredient;
if (!stack.isEmpty()) {
IAEItemStack search = AEItemStack.fromItemStack(stack);
if (stack.getItem().isDamageable() || Platform.isGTDamageableItem(stack.getItem())) {
Collection<IAEItemStack> fuzzy = ir.findFuzzy(AEItemStack.fromItemStack(stack), FuzzyMode.IGNORE_ALL);
Collection<IAEItemStack> fuzzy = available.findFuzzy(search, FuzzyMode.IGNORE_ALL);
if (fuzzy.size() > 0) {
for (IAEItemStack itemStack : fuzzy) {
if (itemStack.getStackSize() > 0) {
if (itemStack.fuzzyComparison(AEItemStack.fromItemStack(stack), FuzzyMode.IGNORE_ALL)) {
found = true;
break;
if (Platform.isGTDamageableItem(stack.getItem())) {
if (!(stack.getMetadata() == itemStack.getDefinition().getMetadata())) {
continue;
}
}
found = true;
used.add(itemStack.copy().setStackSize(1));
valid.add(itemStack.copy().setStackSize(1).createItemStack());
} else {
if (itemStack.isCraftable()) {
craftable = true;
@@ -118,31 +173,45 @@ public class JEIMissingItem implements IRecipeTransferError {
}
}
} else {
IAEItemStack ext = ir.findPrecise(AEItemStack.fromItemStack(stack));
IAEItemStack ext = available.findPrecise(search);
if (ext != null) {
if (ext.getStackSize() > 0) {
break;
} else {
if (ext.isCraftable()) {
craftable = true;
IAEItemStack usedStack = used.findPrecise(ext);
if (ext.getStackSize() > 0 && (usedStack == null || usedStack.getStackSize() < ext.getStackSize())) {
used.add(ext.copy().setStackSize(1));
if (craftable) {
valid.clear();
}
valid.add(ext.copy().setStackSize(1).createItemStack());
found = true;
} else if (ext.isCraftable()) {
valid.add(ext.copy().setStackSize(1).createItemStack());
craftable = true;
}
}
}
}
}
if (!found) {
if (craftable) {
i.drawHighlight(minecraft, new Color(0.0f, 0.0f, 1.0f, 0.4f), recipeX, recipeY);
} else {
i.drawHighlight(minecraft, new Color(1.0f, 0.0f, 0.0f, 0.4f), recipeX, recipeY);
found = true;
}
this.errored = true;
} else {
this.errored = false;
}
}
if (i.getAllIngredients().size() == 0) {
found = true;
}
if (!found) {
if (craftable) {
i.drawHighlight(minecraft, new Color(0.0f, 0.0f, 1.0f, 0.4f), recipeX, recipeY);
this.craftableSlots.add(currentSlot);
recipeLayout.getItemStacks().set(currentSlot, valid);
} else {
i.drawHighlight(minecraft, new Color(1.0f, 0.0f, 0.0f, 0.4f), recipeX, recipeY);
}
this.errored = true;
} else {
this.foundSlots.add(currentSlot);
recipeLayout.getItemStacks().set(currentSlot, valid);
}
}
currentSlot++;
}
if (!this.errored) {
((RecipeLayout) recipeLayout).getRecipeTransferButton().init(Minecraft.getMinecraft().player.openContainer, Minecraft.getMinecraft().player);
@@ -150,7 +219,25 @@ public class JEIMissingItem implements IRecipeTransferError {
}
}
IItemList<IAEItemStack> mergeInventories(IItemList<IAEItemStack> repo, ContainerCraftingTerm containerCraftingTerm) {
IItemList<IAEItemStack> itemList = AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class).createList();
for (IAEItemStack i : repo) {
itemList.addStorage(i);
}
PlayerMainInvWrapper invWrapper = new PlayerMainInvWrapper(containerCraftingTerm.getPlayerInv());
for (int i = 0; i < invWrapper.getSlots(); i++) {
itemList.addStorage(AEItemStack.fromItemStack(invWrapper.getStackInSlot(i)));
}
IItemHandler itemHandler = containerCraftingTerm.getInventoryByName("crafting");
for (int i = 0; i < itemHandler.getSlots(); i++) {
itemList.addStorage(AEItemStack.fromItemStack(itemHandler.getStackInSlot(i)));
}
return itemList;
}
public boolean errored() {
return this.errored;
return errored;
}
}
@@ -48,6 +48,8 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import static appeng.helpers.ItemStackHelper.stackToNBT;
class RecipeTransferHandler<T extends Container> implements IRecipeTransferHandler<T> {
@@ -108,8 +110,7 @@ class RecipeTransferHandler<T extends Container> implements IRecipeTransferHandl
if (!ingredient.isInput()) {
ItemStack output = ingredient.getDisplayedIngredient();
if (output != null) {
final NBTTagCompound tag = new NBTTagCompound();
output.writeToNBT(tag);
final NBTTagCompound tag = stackToNBT(output);
outputs.appendTag(tag);
}
continue;
@@ -140,8 +141,7 @@ class RecipeTransferHandler<T extends Container> implements IRecipeTransferHandl
}
for (final ItemStack is : list) {
final NBTTagCompound tag = new NBTTagCompound();
is.writeToNBT(tag);
final NBTTagCompound tag = stackToNBT(is);
tags.appendTag(tag);
}
+4 -6
View File
@@ -138,16 +138,14 @@ public class SecurityCache implements ISecurityGrid {
@Override
public boolean hasPermission(final int playerID, final SecurityPermissions perm) {
if (playerID == -1) {
return true;
}
if (this.isAvailable()) {
final EnumSet<SecurityPermissions> perms = this.playerPerms.get(playerID);
if (perms == null) {
if (playerID == -1) // no default?
{
return false;
} else {
return this.hasPermission(-1, perm);
}
return this.hasPermission(-1, perm);
}
return perms.contains(perm);
@@ -639,9 +639,10 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU {
itemList = new ArrayList<>(1);
final IAEItemStack item = this.inventory.getItemList().findPrecise(input[x]);
if (item != null) {
itemList.add(item);
} else if (input[x].getDefinition().getItem().isDamageable() || Platform.isGTDamageableItem(input[x].getDefinition().getItem())) {
itemList.addAll(this.inventory.getItemList().findFuzzy(input[x], FuzzyMode.IGNORE_ALL));
}
}
+3 -3
View File
@@ -309,7 +309,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
* @param from source of settings
* @param compound compound of source
*/
private void uploadSettings(final SettingsFrom from, final NBTTagCompound compound) {
public void uploadSettings(final SettingsFrom from, final NBTTagCompound compound, EntityPlayer player) {
if (compound != null) {
final IConfigManager cm = this.getConfigManager();
if (cm != null) {
@@ -359,7 +359,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
* @param from source of settings
* @return compound of source
*/
private NBTTagCompound downloadSettings(final SettingsFrom from) {
protected NBTTagCompound downloadSettings(final SettingsFrom from) {
final NBTTagCompound output = new NBTTagCompound();
final IConfigManager cm = this.getConfigManager();
@@ -428,7 +428,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
final String storedName = memoryCard.getSettingsName(memCardIS);
final NBTTagCompound data = memoryCard.getData(memCardIS);
if (name.equals(storedName)) {
this.uploadSettings(SettingsFrom.MEMORY_CARD, data);
this.uploadSettings(SettingsFrom.MEMORY_CARD, data, player);
memoryCard.notifyUser(player, MemoryCardMessages.SETTINGS_LOADED);
} else {
memoryCard.notifyUser(player, MemoryCardMessages.INVALID_MACHINE);
@@ -113,4 +113,5 @@ public abstract class PartBasicState extends AEBasePart implements IPowerChannel
private void setClientFlags(final int clientFlags) {
this.clientFlags = clientFlags;
}
}
@@ -22,6 +22,7 @@ package appeng.parts.misc;
import appeng.api.AEApi;
import appeng.api.config.Actionable;
import appeng.api.config.Upgrades;
import appeng.api.definitions.IMaterials;
import appeng.api.networking.IGridNode;
import appeng.api.networking.crafting.ICraftingLink;
import appeng.api.networking.crafting.ICraftingPatternDetails;
@@ -42,15 +43,19 @@ import appeng.api.storage.data.IAEStack;
import appeng.api.util.AECableType;
import appeng.api.util.IConfigManager;
import appeng.core.AppEng;
import appeng.core.localization.PlayerMessages;
import appeng.core.sync.GuiBridge;
import appeng.helpers.DualityInterface;
import appeng.helpers.IInterfaceHost;
import appeng.helpers.IPriorityHost;
import appeng.helpers.Reflected;
import appeng.items.misc.ItemEncodedPattern;
import appeng.items.parts.PartModels;
import appeng.parts.PartBasicState;
import appeng.parts.PartModel;
import appeng.tile.inventory.AppEngInternalInventory;
import appeng.util.Platform;
import appeng.util.SettingsFrom;
import appeng.util.inv.IAEAppEngInventory;
import appeng.util.inv.IInventoryDestination;
import appeng.util.inv.InvOperation;
@@ -66,6 +71,7 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.Vec3d;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.wrapper.PlayerMainInvWrapper;
import java.util.EnumSet;
import java.util.List;
@@ -275,4 +281,60 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
public GuiBridge getGuiBridge() {
return GuiBridge.GUI_INTERFACE;
}
@Override
public NBTTagCompound downloadSettings(SettingsFrom from) {
NBTTagCompound output = super.downloadSettings(from);
if (from == SettingsFrom.MEMORY_CARD) {
final IItemHandler inv = this.getInventoryByName("patterns");
if (inv instanceof AppEngInternalInventory) {
((AppEngInternalInventory) inv).writeToNBT(output, "patterns");
}
}
return output;
}
@Override
public void uploadSettings(SettingsFrom from, NBTTagCompound compound, EntityPlayer player) {
super.uploadSettings(from, compound, player);
final IItemHandler inv = this.getInventoryByName("patterns");
if (inv instanceof AppEngInternalInventory) {
final AppEngInternalInventory target = (AppEngInternalInventory) inv;
AppEngInternalInventory tmp = new AppEngInternalInventory(null, target.getSlots());
tmp.readFromNBT(compound, "patterns");
PlayerMainInvWrapper playerInv = new PlayerMainInvWrapper(player.inventory);
final IMaterials materials = AEApi.instance().definitions().materials();
int missingPatternsToEncode = 0;
for (int i = 0; i < inv.getSlots(); i++) {
if (target.getStackInSlot(i).getItem() instanceof ItemEncodedPattern) {
ItemStack blank = materials.blankPattern().maybeStack(target.getStackInSlot(i).getCount()).get();
if (!player.addItemStackToInventory(blank)) {
player.dropItem(blank, true);
}
target.setStackInSlot(i, ItemStack.EMPTY);
}
}
for (int x = 0; x < tmp.getSlots(); x++) {
if (!tmp.getStackInSlot(x).isEmpty()) {
boolean found = false;
for (int i = 0; i < playerInv.getSlots(); i++) {
if (materials.blankPattern().isSameAs(playerInv.getStackInSlot(i))) {
target.setStackInSlot(x, tmp.getStackInSlot(x));
playerInv.getStackInSlot(i).shrink(1);
found = true;
break;
}
}
if (!found) {
missingPatternsToEncode++;
}
}
}
if (Platform.isServer() && missingPatternsToEncode > 0) {
player.sendMessage(PlayerMessages.MissingPatternsToEncode.get());
}
}
}
}
@@ -0,0 +1,152 @@
package appeng.parts.reporting;
import appeng.api.implementations.ICraftingPatternItem;
import appeng.api.networking.crafting.ICraftingPatternDetails;
import appeng.api.parts.IPartModel;
import appeng.api.storage.data.IAEItemStack;
import appeng.core.sync.GuiBridge;
import appeng.tile.inventory.AppEngInternalInventory;
import appeng.util.inv.InvOperation;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.items.IItemHandler;
import javax.annotation.Nonnull;
import java.util.List;
public abstract class AbstractPartEncoder extends AbstractPartTerminal {
protected AppEngInternalInventory crafting;
protected AppEngInternalInventory output;
protected AppEngInternalInventory pattern;
protected boolean craftingMode = true;
protected boolean substitute = false;
public AbstractPartEncoder(ItemStack is) {
super(is);
}
@Override
public void getDrops(final List<ItemStack> drops, final boolean wrenched) {
for (final ItemStack is : this.pattern) {
if (!is.isEmpty()) {
drops.add(is);
}
}
}
@Override
public void readFromNBT(final NBTTagCompound data) {
super.readFromNBT(data);
this.pattern.readFromNBT(data, "pattern");
this.output.readFromNBT(data, "outputList");
this.crafting.readFromNBT(data, "crafting");
}
@Override
public void writeToNBT(final NBTTagCompound data) {
super.writeToNBT(data);
this.pattern.writeToNBT(data, "pattern");
this.output.writeToNBT(data, "outputList");
this.crafting.writeToNBT(data, "crafting");
}
@Override
public void onChangeInventory(final IItemHandler inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack) {
if (inv == this.pattern && slot == 1) {
final ItemStack is = this.pattern.getStackInSlot(1);
if (!is.isEmpty() && is.getItem() instanceof ICraftingPatternItem) {
final ICraftingPatternItem pattern = (ICraftingPatternItem) is.getItem();
final ICraftingPatternDetails details = pattern.getPatternForItem(is, this.getHost().getTile().getWorld());
if (details != null) {
this.setCraftingRecipe(details.isCraftable());
this.setSubstitution(details.canSubstitute());
for (int x = 0; x < this.crafting.getSlots() && x < details.getInputs().length; x++) {
final IAEItemStack item = details.getInputs()[x];
this.crafting.setStackInSlot(x, item == null ? ItemStack.EMPTY : item.createItemStack());
}
for (int x = 0; x < this.output.getSlots() && x < details.getOutputs().length; x++) {
final IAEItemStack item = details.getOutputs()[x];
this.output.setStackInSlot(x, item == null ? ItemStack.EMPTY : item.createItemStack());
}
}
}
} else if (inv == this.crafting) {
this.fixCraftingRecipes();
}
this.getHost().markForSave();
}
private void fixCraftingRecipes() {
if (this.isCraftingRecipe()) {
for (int x = 0; x < this.crafting.getSlots(); x++) {
final ItemStack is = this.crafting.getStackInSlot(x);
if (!is.isEmpty()) {
is.setCount(1);
}
}
}
}
public boolean isCraftingRecipe() {
return this.craftingMode;
}
public void setCraftingRecipe(final boolean craftingMode) {
this.craftingMode = craftingMode;
this.fixCraftingRecipes();
}
public boolean isSubstitution() {
return this.substitute;
}
public void setSubstitution(final boolean canSubstitute) {
this.substitute = canSubstitute;
}
@Override
public IItemHandler getInventoryByName(final String name) {
if (name.equals("crafting")) {
return this.crafting;
}
if (name.equals("output")) {
return this.output;
}
if (name.equals("pattern")) {
return this.pattern;
}
return super.getInventoryByName(name);
}
@Override
public GuiBridge getGui(final EntityPlayer p) {
int x = (int) p.posX;
int y = (int) p.posY;
int z = (int) p.posZ;
if (this.getHost().getTile() != null) {
x = this.getTile().getPos().getX();
y = this.getTile().getPos().getY();
z = this.getTile().getPos().getZ();
}
if (getGuiBridge().hasPermissions(this.getHost().getTile(), x, y, z, this.getSide(), p)) {
return getGuiBridge();
}
return GuiBridge.GUI_ME;
}
abstract public GuiBridge getGuiBridge();
@Nonnull
@Override
abstract public IPartModel getStaticModels();
}
@@ -1,29 +1,22 @@
package appeng.parts.reporting;
import appeng.api.implementations.ICraftingPatternItem;
import appeng.api.networking.crafting.ICraftingPatternDetails;
import appeng.api.parts.IPartModel;
import appeng.api.storage.data.IAEItemStack;
import appeng.core.AppEng;
import appeng.core.sync.GuiBridge;
import appeng.helpers.Reflected;
import appeng.items.parts.PartModels;
import appeng.parts.PartModel;
import appeng.tile.inventory.AppEngInternalInventory;
import appeng.util.inv.InvOperation;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.items.IItemHandler;
import java.util.List;
import javax.annotation.Nonnull;
import static appeng.helpers.PatternHelper.PROCESSING_INPUT_LIMIT;
import static appeng.helpers.PatternHelper.PROCESSING_OUTPUT_LIMIT;
public class PartExpandedProcessingPatternTerminal extends AbstractPartTerminal {
public class PartExpandedProcessingPatternTerminal extends AbstractPartEncoder {
@PartModels
public static final ResourceLocation MODEL_OFF = new ResourceLocation(AppEng.MOD_ID, "part/expanded_processing_pattern_terminal_off");
@PartModels
@@ -33,96 +26,31 @@ public class PartExpandedProcessingPatternTerminal extends AbstractPartTerminal
public static final IPartModel MODELS_ON = new PartModel(MODEL_BASE, MODEL_ON, MODEL_STATUS_ON);
public static final IPartModel MODELS_HAS_CHANNEL = new PartModel(MODEL_BASE, MODEL_ON, MODEL_STATUS_HAS_CHANNEL);
private final AppEngInternalInventory crafting = new AppEngInternalInventory(this, PROCESSING_INPUT_LIMIT);
private final AppEngInternalInventory output = new AppEngInternalInventory(this, PROCESSING_OUTPUT_LIMIT);
private final AppEngInternalInventory pattern = new AppEngInternalInventory(this, 2);
@Reflected
public PartExpandedProcessingPatternTerminal(final ItemStack is) {
super(is);
this.crafting = new AppEngInternalInventory(this, PROCESSING_INPUT_LIMIT);
this.output = new AppEngInternalInventory(this, PROCESSING_OUTPUT_LIMIT);
this.pattern = new AppEngInternalInventory(this, 2);
this.craftingMode = false;
}
@Override
public void getDrops(final List<ItemStack> drops, final boolean wrenched) {
for (final ItemStack is : this.pattern) {
if (!is.isEmpty()) {
drops.add(is);
}
}
public boolean isCraftingRecipe() {
return false;
}
@Override
public void readFromNBT(NBTTagCompound data) {
super.readFromNBT(data);
this.crafting.readFromNBT(data, "processingGrid");
this.pattern.readFromNBT(data, "pattern");
this.output.readFromNBT(data, "outputList");
public void setCraftingRecipe(final boolean craftingMode) {
// NO-OP
}
@Override
public void writeToNBT(NBTTagCompound data) {
super.writeToNBT(data);
this.crafting.writeToNBT(data, "processingGrid");
this.pattern.writeToNBT(data, "pattern");
this.output.writeToNBT(data, "outputList");
}
@Override
public GuiBridge getGui(final EntityPlayer p) {
int x = (int) p.posX;
int y = (int) p.posY;
int z = (int) p.posZ;
if (this.getHost().getTile() != null) {
x = this.getTile().getPos().getX();
y = this.getTile().getPos().getY();
z = this.getTile().getPos().getZ();
}
if (GuiBridge.GUI_EXPANDED_PROCESSING_PATTERN_TERMINAL.hasPermissions(this.getHost().getTile(), x, y, z, this.getSide(), p)) {
return GuiBridge.GUI_EXPANDED_PROCESSING_PATTERN_TERMINAL;
}
return GuiBridge.GUI_ME;
}
@Override
public void onChangeInventory(final IItemHandler inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack) {
if (inv == this.pattern && slot == 1) {
final ItemStack is = this.pattern.getStackInSlot(1);
if (!is.isEmpty() && is.getItem() instanceof ICraftingPatternItem) {
final ICraftingPatternItem pattern = (ICraftingPatternItem) is.getItem();
final ICraftingPatternDetails details = pattern.getPatternForItem(is, this.getHost().getTile().getWorld());
if (details != null) {
for (int x = 0; x < this.crafting.getSlots() && x < details.getInputs().length; x++) {
final IAEItemStack item = details.getInputs()[x];
this.crafting.setStackInSlot(x, item == null ? ItemStack.EMPTY : item.createItemStack());
}
for (int x = 0; x < this.output.getSlots() && x < details.getOutputs().length; x++) {
final IAEItemStack item = details.getOutputs()[x];
this.output.setStackInSlot(x, item == null ? ItemStack.EMPTY : item.createItemStack());
}
}
}
}
this.getHost().markForSave();
}
@Override
public IItemHandler getInventoryByName(final String name) {
if (name.equals("crafting")) {
return this.crafting;
}
if (name.equals("output")) {
return this.output;
}
if (name.equals("pattern")) {
return this.pattern;
}
return super.getInventoryByName(name);
public GuiBridge getGuiBridge() {
return GuiBridge.GUI_EXPANDED_PROCESSING_PATTERN_TERMINAL;
}
@Nonnull
@Override
public IPartModel getStaticModels() {
return this.selectModel(MODELS_OFF, MODELS_ON, MODELS_HAS_CHANNEL);
@@ -19,27 +19,24 @@
package appeng.parts.reporting;
import appeng.api.implementations.ICraftingPatternItem;
import appeng.api.networking.crafting.ICraftingPatternDetails;
import appeng.api.parts.IPartModel;
import appeng.api.storage.data.IAEItemStack;
import appeng.core.AppEng;
import appeng.core.sync.GuiBridge;
import appeng.helpers.Reflected;
import appeng.items.parts.PartModels;
import appeng.parts.PartModel;
import appeng.tile.inventory.AppEngInternalInventory;
import appeng.util.inv.InvOperation;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.items.IItemHandler;
import java.util.List;
import javax.annotation.Nonnull;
import static appeng.helpers.PatternHelper.CRAFTING_GRID_DIMENSION;
import static appeng.helpers.PatternHelper.CRAFTING_OUTPUT_LIMIT;
public class PartPatternTerminal extends AbstractPartTerminal {
public class PartPatternTerminal extends AbstractPartEncoder {
@PartModels
public static final ResourceLocation MODEL_OFF = new ResourceLocation(AppEng.MOD_ID, "part/pattern_terminal_off");
@@ -50,25 +47,12 @@ public class PartPatternTerminal extends AbstractPartTerminal {
public static final IPartModel MODELS_ON = new PartModel(MODEL_BASE, MODEL_ON, MODEL_STATUS_ON);
public static final IPartModel MODELS_HAS_CHANNEL = new PartModel(MODEL_BASE, MODEL_ON, MODEL_STATUS_HAS_CHANNEL);
private final AppEngInternalInventory crafting = new AppEngInternalInventory(this, 9);
private final AppEngInternalInventory output = new AppEngInternalInventory(this, 3);
private final AppEngInternalInventory pattern = new AppEngInternalInventory(this, 2);
private boolean craftingMode = true;
private boolean substitute = false;
@Reflected
public PartPatternTerminal(final ItemStack is) {
super(is);
}
@Override
public void getDrops(final List<ItemStack> drops, final boolean wrenched) {
for (final ItemStack is : this.pattern) {
if (!is.isEmpty()) {
drops.add(is);
}
}
this.crafting = new AppEngInternalInventory(this, CRAFTING_GRID_DIMENSION * CRAFTING_GRID_DIMENSION);
this.output = new AppEngInternalInventory(this, 3);
this.pattern = new AppEngInternalInventory(this, 2);
}
@Override
@@ -76,9 +60,6 @@ public class PartPatternTerminal extends AbstractPartTerminal {
super.readFromNBT(data);
this.setCraftingRecipe(data.getBoolean("craftingMode"));
this.setSubstitution(data.getBoolean("substitute"));
this.pattern.readFromNBT(data, "pattern");
this.output.readFromNBT(data, "outputList");
this.crafting.readFromNBT(data, "craftingGrid");
}
@Override
@@ -86,102 +67,14 @@ public class PartPatternTerminal extends AbstractPartTerminal {
super.writeToNBT(data);
data.setBoolean("craftingMode", this.craftingMode);
data.setBoolean("substitute", this.substitute);
this.pattern.writeToNBT(data, "pattern");
this.output.writeToNBT(data, "outputList");
this.crafting.writeToNBT(data, "craftingGrid");
}
@Override
public GuiBridge getGui(final EntityPlayer p) {
int x = (int) p.posX;
int y = (int) p.posY;
int z = (int) p.posZ;
if (this.getHost().getTile() != null) {
x = this.getTile().getPos().getX();
y = this.getTile().getPos().getY();
z = this.getTile().getPos().getZ();
}
if (GuiBridge.GUI_PATTERN_TERMINAL.hasPermissions(this.getHost().getTile(), x, y, z, this.getSide(), p)) {
return GuiBridge.GUI_PATTERN_TERMINAL;
}
return GuiBridge.GUI_ME;
}
@Override
public void onChangeInventory(final IItemHandler inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack) {
if (inv == this.pattern && slot == 1) {
final ItemStack is = this.pattern.getStackInSlot(1);
if (!is.isEmpty() && is.getItem() instanceof ICraftingPatternItem) {
final ICraftingPatternItem pattern = (ICraftingPatternItem) is.getItem();
final ICraftingPatternDetails details = pattern.getPatternForItem(is, this.getHost().getTile().getWorld());
if (details != null) {
this.setCraftingRecipe(details.isCraftable());
this.setSubstitution(details.canSubstitute());
for (int x = 0; x < this.crafting.getSlots() && x < details.getInputs().length; x++) {
final IAEItemStack item = details.getInputs()[x];
this.crafting.setStackInSlot(x, item == null ? ItemStack.EMPTY : item.createItemStack());
}
for (int x = 0; x < this.output.getSlots() && x < details.getOutputs().length; x++) {
final IAEItemStack item = details.getOutputs()[x];
this.output.setStackInSlot(x, item == null ? ItemStack.EMPTY : item.createItemStack());
}
}
}
} else if (inv == this.crafting) {
this.fixCraftingRecipes();
}
this.getHost().markForSave();
}
private void fixCraftingRecipes() {
if (this.craftingMode) {
for (int x = 0; x < this.crafting.getSlots(); x++) {
final ItemStack is = this.crafting.getStackInSlot(x);
if (!is.isEmpty()) {
is.setCount(1);
}
}
}
}
public boolean isCraftingRecipe() {
return this.craftingMode;
}
public void setCraftingRecipe(final boolean craftingMode) {
this.craftingMode = craftingMode;
this.fixCraftingRecipes();
}
public boolean isSubstitution() {
return this.substitute;
}
public void setSubstitution(final boolean canSubstitute) {
this.substitute = canSubstitute;
}
@Override
public IItemHandler getInventoryByName(final String name) {
if (name.equals("crafting")) {
return this.crafting;
}
if (name.equals("output")) {
return this.output;
}
if (name.equals("pattern")) {
return this.pattern;
}
return super.getInventoryByName(name);
public GuiBridge getGuiBridge() {
return GuiBridge.GUI_PATTERN_TERMINAL;
}
@Nonnull
@Override
public IPartModel getStaticModels() {
return this.selectModel(MODELS_OFF, MODELS_ON, MODELS_HAS_CHANNEL);
@@ -138,18 +138,12 @@ public final class CompassService {
public void kill() {
this.executor.shutdown();
try {
this.executor.awaitTermination(6, TimeUnit.MINUTES);
this.jobSize = 0;
for (final CompassReader cr : this.worldSet.values()) {
cr.close();
}
this.worldSet.clear();
} catch (final InterruptedException e) {
// wrap this up..
this.jobSize = 0;
for (final CompassReader cr : this.worldSet.values()) {
cr.close();
}
this.worldSet.clear();
}
private CompassReader getReader(final World w) {
+7 -4
View File
@@ -39,6 +39,9 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.List;
import static appeng.helpers.ItemStackHelper.stackFromNBT;
import static appeng.helpers.ItemStackHelper.stackWriteToNBT;
public abstract class AEBaseInvTile extends AEBaseTile implements IAEAppEngInventory {
@@ -50,7 +53,7 @@ public abstract class AEBaseInvTile extends AEBaseTile implements IAEAppEngInven
final NBTTagCompound opt = data.getCompoundTag("inv");
for (int x = 0; x < inv.getSlots(); x++) {
final NBTTagCompound item = opt.getCompoundTag("item" + x);
ItemHandlerUtil.setStackInSlot(inv, x, new ItemStack(item));
ItemHandlerUtil.setStackInSlot(inv, x, stackFromNBT(item));
}
}
}
@@ -65,12 +68,12 @@ public abstract class AEBaseInvTile extends AEBaseTile implements IAEAppEngInven
if (inv != EmptyHandler.INSTANCE) {
final NBTTagCompound opt = new NBTTagCompound();
for (int x = 0; x < inv.getSlots(); x++) {
final NBTTagCompound item = new NBTTagCompound();
final NBTTagCompound itemNBT = new NBTTagCompound();
final ItemStack is = inv.getStackInSlot(x);
if (!is.isEmpty()) {
is.writeToNBT(item);
stackWriteToNBT(is, itemNBT);
}
opt.setTag("item" + x, item);
opt.setTag("item" + x, itemNBT);
}
data.setTag("inv", opt);
}
@@ -80,6 +80,9 @@ import java.util.EnumMap;
import java.util.List;
import java.util.Map;
import static appeng.helpers.ItemStackHelper.stackFromNBT;
import static appeng.helpers.ItemStackHelper.stackWriteToNBT;
public class TileMolecularAssembler extends AENetworkInvTile implements IUpgradeableHost, IConfigManagerHost, IGridTickable, ICraftingMachine, IPowerChannelState {
private final InventoryCrafting craftingInv;
@@ -288,7 +291,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade
final ItemStack pattern = this.myPlan.getPattern();
if (!pattern.isEmpty()) {
final NBTTagCompound compound = new NBTTagCompound();
pattern.writeToNBT(compound);
stackWriteToNBT(pattern, compound);
data.setTag("myPlan", compound);
data.setInteger("pushDirection", this.pushDirection.ordinal());
}
@@ -303,7 +306,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade
public void readFromNBT(final NBTTagCompound data) {
super.readFromNBT(data);
if (data.hasKey("myPlan")) {
final ItemStack myPat = new ItemStack(data.getCompoundTag("myPlan"));
final ItemStack myPat = stackFromNBT(data.getCompoundTag("myPlan"));
if (!myPat.isEmpty() && myPat.getItem() instanceof ItemEncodedPattern) {
final World w = this.getWorld();
@@ -35,14 +35,18 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import static appeng.helpers.ItemStackHelper.stackFromNBT;
import static appeng.helpers.ItemStackHelper.stackToNBT;
public class AppEngInternalInventory extends ItemStackHandler implements Iterable<ItemStack> {
private boolean enableClientEvents = false;
private IAEAppEngInventory te;
private final int[] maxStack;
private ItemStack previousStack = ItemStack.EMPTY;
private IAEItemFilter filter;
private boolean dirtyFlag = false;
protected boolean enableClientEvents = false;
protected IAEAppEngInventory te;
protected final int[] maxStack;
protected ItemStack previousStack = ItemStack.EMPTY;
protected IAEItemFilter filter;
protected boolean dirtyFlag = false;
protected boolean limitExtraction;
public AppEngInternalInventory(final IAEAppEngInventory inventory, final int size, final int maxStack, IAEItemFilter filter) {
super(size);
@@ -87,38 +91,7 @@ public class AppEngInternalInventory extends ItemStackHandler implements Iterabl
if (!simulate) {
this.previousStack = this.getStackInSlot(slot).copy();
}
if (stack.isEmpty())
return ItemStack.EMPTY;
validateSlotIndex(slot);
ItemStack existing = this.stacks.get(slot);
int limit = maxStack[slot];
if (!existing.isEmpty()) {
if (!ItemHandlerHelper.canItemStacksStack(stack, existing))
return stack;
limit -= existing.getCount();
}
if (limit <= 0)
return stack;
boolean reachedLimit = stack.getCount() > limit;
if (!simulate) {
if (existing.isEmpty()) {
this.stacks.set(slot, reachedLimit ? ItemHandlerHelper.copyStackWithSize(stack, limit) : stack);
} else {
existing.grow(reachedLimit ? limit : stack.getCount());
}
onContentsChanged(slot);
}
return reachedLimit ? ItemHandlerHelper.copyStackWithSize(stack, stack.getCount() - limit) : ItemStack.EMPTY;
return super.insertItem(slot, stack, simulate);
}
@Override
@@ -131,30 +104,7 @@ public class AppEngInternalInventory extends ItemStackHandler implements Iterabl
if (!simulate) {
this.previousStack = this.getStackInSlot(slot).copy();
}
if (amount == 0)
return ItemStack.EMPTY;
validateSlotIndex(slot);
ItemStack existing = this.stacks.get(slot);
if (existing.isEmpty())
return ItemStack.EMPTY;
if (existing.getCount() <= amount) {
if (!simulate) {
this.stacks.set(slot, ItemStack.EMPTY);
onContentsChanged(slot);
}
return existing;
} else {
if (!simulate) {
this.stacks.set(slot, ItemHandlerHelper.copyStackWithSize(existing, existing.getCount() - amount));
onContentsChanged(slot);
}
return ItemHandlerHelper.copyStackWithSize(existing, amount);
}
return super.extractItem(slot, amount, simulate);
}
@Override
@@ -215,12 +165,8 @@ public class AppEngInternalInventory extends ItemStackHandler implements Iterabl
for (int i = 0; i < stacks.size(); i++) {
ItemStack is = stacks.get(i);
if (!is.isEmpty()) {
NBTTagCompound itemTag = new NBTTagCompound();
NBTTagCompound itemTag = stackToNBT(is);
itemTag.setInteger("Slot", i);
if (is.getCount() > is.getMaxStackSize()) {
itemTag.setInteger("stackSize", stacks.get(i).getCount());
}
stacks.get(i).writeToNBT(itemTag);
nbtTagList.appendTag(itemTag);
}
}
@@ -249,11 +195,7 @@ public class AppEngInternalInventory extends ItemStackHandler implements Iterabl
NBTTagCompound itemTags = tagList.getCompoundTagAt(i);
int slot = itemTags.getInteger("Slot");
if (slot >= 0 && slot < stacks.size()) {
stacks.set(slot, new ItemStack(itemTags));
if (itemTags.hasKey("stackSize")) {
int stackSize = itemTags.getInteger("stackSize");
stacks.get(slot).setCount(stackSize);
}
stacks.set(slot, stackFromNBT(itemTags));
}
}
onLoad();
@@ -279,4 +221,8 @@ public class AppEngInternalInventory extends ItemStackHandler implements Iterabl
public void setTileEntity(final IAEAppEngInventory te) {
this.te = te;
}
public void limitExtraction(boolean limitExtraction) {
this.limitExtraction = limitExtraction;
}
}
@@ -0,0 +1,117 @@
package appeng.tile.inventory;
import appeng.util.inv.IAEAppEngInventory;
import appeng.util.inv.filter.IAEItemFilter;
import net.minecraft.item.ItemStack;
import net.minecraftforge.items.ItemHandlerHelper;
import javax.annotation.Nonnull;
import java.util.Spliterator;
import java.util.function.Consumer;
public class AppEngInternalOversizedInventory extends AppEngInternalInventory {
public AppEngInternalOversizedInventory(IAEAppEngInventory inventory, int size, int maxStack, IAEItemFilter filter) {
super(inventory, size, maxStack, filter);
}
public AppEngInternalOversizedInventory(IAEAppEngInventory inventory, int size, int maxStack) {
super(inventory, size, maxStack);
}
public AppEngInternalOversizedInventory(IAEAppEngInventory inventory, int size) {
super(inventory, size);
}
@Override
@Nonnull
public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) {
if (this.filter != null && !this.filter.allowInsert(this, slot, stack)) {
return stack;
}
if (!simulate) {
this.previousStack = this.getStackInSlot(slot).copy();
}
if (stack.isEmpty())
return ItemStack.EMPTY;
validateSlotIndex(slot);
ItemStack existing = this.stacks.get(slot);
int limit = maxStack[slot];
if (!existing.isEmpty()) {
if (!ItemHandlerHelper.canItemStacksStack(stack, existing))
return stack;
limit -= existing.getCount();
}
if (limit <= 0)
return stack;
boolean reachedLimit = stack.getCount() > limit;
if (!simulate) {
if (existing.isEmpty()) {
this.stacks.set(slot, reachedLimit ? ItemHandlerHelper.copyStackWithSize(stack, limit) : stack);
} else {
existing.grow(reachedLimit ? limit : stack.getCount());
}
onContentsChanged(slot);
}
return reachedLimit ? ItemHandlerHelper.copyStackWithSize(stack, stack.getCount() - limit) : ItemStack.EMPTY;
}
@Override
@Nonnull
public ItemStack extractItem(int slot, int amount, boolean simulate) {
if (this.filter != null && !this.filter.allowExtract(this, slot, amount)) {
return ItemStack.EMPTY;
}
if (!simulate) {
this.previousStack = this.getStackInSlot(slot).copy();
}
if (limitExtraction)
return super.extractItem(slot, amount, simulate);
if (amount == 0)
return ItemStack.EMPTY;
validateSlotIndex(slot);
ItemStack existing = this.stacks.get(slot);
if (existing.isEmpty())
return ItemStack.EMPTY;
if (existing.getCount() <= amount) {
if (!simulate) {
this.stacks.set(slot, ItemStack.EMPTY);
onContentsChanged(slot);
}
return existing;
} else {
if (!simulate) {
this.stacks.set(slot, ItemHandlerHelper.copyStackWithSize(existing, existing.getCount() - amount));
onContentsChanged(slot);
}
return ItemHandlerHelper.copyStackWithSize(existing, amount);
}
}
@Override
public void forEach(Consumer<? super ItemStack> consumer) {
super.forEach(consumer);
}
@Override
public Spliterator<ItemStack> spliterator() {
return super.spliterator();
}
}
@@ -71,6 +71,8 @@ import java.util.EnumSet;
import java.util.List;
import java.util.Map;
import static appeng.helpers.ItemStackHelper.stackFromNBT;
public class TileSecurityStation extends AENetworkTile implements ITerminalHost, IAEAppEngInventory, ILocatable, IConfigManagerHost, ISecurityProvider, IColorableTile {
@@ -175,7 +177,7 @@ public class TileSecurityStation extends AENetworkTile implements ITerminalHost,
for (final Object key : storedItems.getKeySet()) {
final NBTBase obj = storedItems.getTag((String) key);
if (obj instanceof NBTTagCompound) {
this.inventory.getStoredItems().add(AEItemStack.fromItemStack(new ItemStack((NBTTagCompound) obj)));
this.inventory.getStoredItems().add(AEItemStack.fromItemStack(stackFromNBT((NBTTagCompound) obj)));
}
}
}
+3 -3
View File
@@ -56,6 +56,7 @@ import appeng.fluids.util.AEFluidStack;
import appeng.hooks.TickHandler;
import appeng.integration.Integrations;
import appeng.integration.modules.bogosorter.InventoryBogoSortModule;
import appeng.integration.modules.gregtech.ToolClass;
import appeng.me.GridAccessException;
import appeng.me.GridNode;
import appeng.me.helpers.AENetworkProxy;
@@ -67,7 +68,6 @@ import com.google.common.base.Preconditions;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import gregtech.api.block.machines.BlockMachine;
import gregtech.api.items.IToolItem;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.util.GTUtility;
import ic2.api.item.ICustomDamageItem;
@@ -126,7 +126,6 @@ import java.util.*;
* @version rv2
* @since rv0
*/
@Optional.Interface(iface = "gregtech.api.items.IToolItem", modid = "gregtech")
@Optional.Interface(iface = "ic2.api.item.ICustomDamageItem", modid = "IC2")
public class Platform {
@@ -146,6 +145,7 @@ public class Platform {
private static final ItemComparisonHelper ITEM_COMPARISON_HELPER = new ItemComparisonHelper();
private static final P2PHelper P2P_HELPER = new P2PHelper();
private static Method reflectGTgetMTE;
public static final boolean GTLoaded = isModLoaded("gregtech");
public static ItemComparisonHelper itemComparisons() {
return ITEM_COMPARISON_HELPER;
@@ -1416,7 +1416,7 @@ public class Platform {
//consider methods below moving to a compability class
public static boolean isGTDamageableItem(Item item) {
return (isModLoaded("gregtech") && item instanceof IToolItem);
return ((GTLoaded) && ToolClass.getGTToolClass().isAssignableFrom(item.getClass()));
}
public static MetaTileEntity getMetaTileEntity(IBlockAccess world, BlockPos pos) {
@@ -94,9 +94,4 @@ public class ItemListIgnoreCrafting<T extends IAEStack<T>> implements IItemList<
public void resetStatus() {
this.target.resetStatus();
}
@Override
public ItemListIgnoreCrafting<T> clone() {
return new ItemListIgnoreCrafting<>(target);
}
}
@@ -23,9 +23,9 @@ import appeng.api.storage.IStorageChannel;
import appeng.api.storage.channels.IItemStorageChannel;
import appeng.api.storage.data.IAEItemStack;
import appeng.core.Api;
import appeng.integration.modules.gregtech.ToolClass;
import appeng.util.Platform;
import com.google.common.primitives.Ints;
import gregtech.api.items.IToolItem;
import ic2.api.item.ICustomDamageItem;
import io.netty.buffer.ByteBuf;
import net.minecraft.item.Item;
@@ -326,7 +326,7 @@ public class AEItemStack extends AEStack<IAEItemStack> implements IAEItemStack {
} else if (a.getItem().isDamageable()) {
return a.getItemDamage() > 1 == b.getItemDamage() > 1;
} else if (Platform.isGTDamageableItem(a.getItem())) {
return ((IToolItem) a.getItem()).getItemDamage(a) > 1 == ((IToolItem) b.getItem()).getItemDamage(b) > 1;
return (ToolClass.getGTitemDamage(a) > 1 == ToolClass.getGTitemDamage(b) > 1);
}
} else {
float percentDamageOfA = 0;
@@ -338,8 +338,8 @@ public class AEItemStack extends AEStack<IAEItemStack> implements IAEItemStack {
percentDamageOfA = (float) a.getItemDamage() / a.getMaxDamage();
percentDamageOfB = (float) b.getItemDamage() / b.getMaxDamage();
} else if (Platform.isGTDamageableItem(a.getItem())) {
percentDamageOfA = (float) ((IToolItem) a.getItem()).getItemDamage(a) / ((IToolItem) a.getItem()).getMaxItemDamage(a);
percentDamageOfB = (float) ((IToolItem) b.getItem()).getItemDamage(b) / ((IToolItem) b.getItem()).getMaxItemDamage(b);
percentDamageOfA = (float) ToolClass.getGTitemDamage(a) / ToolClass.getGTMaxDamage(a);
percentDamageOfB = (float) ToolClass.getGTitemDamage(b) / ToolClass.getGTMaxDamage(b);
}
return percentDamageOfA > mode.breakPoint == percentDamageOfB > mode.breakPoint;
@@ -20,9 +20,9 @@ package appeng.util.item;
import appeng.api.config.FuzzyMode;
import appeng.api.storage.data.IAEItemStack;
import appeng.integration.modules.gregtech.ToolClass;
import appeng.util.Platform;
import com.google.common.base.Preconditions;
import gregtech.api.items.IToolItem;
import ic2.api.item.ICustomDamageItem;
import it.unimi.dsi.fastutil.objects.Object2ObjectAVLTreeMap;
import it.unimi.dsi.fastutil.objects.Object2ObjectSortedMap;
@@ -154,8 +154,8 @@ class FuzzyItemVariantList extends ItemVariantList {
maxDamage = ((ICustomDamageItem) stack.getItem()).getMaxCustomDamage(stack);
damage = ((ICustomDamageItem) stack.getItem()).getCustomDamage(stack);
} else if (Platform.isGTDamageableItem(stack.getItem())) {
maxDamage = ((IToolItem) stack.getItem()).getMaxItemDamage(stack);
damage = ((IToolItem) stack.getItem()).getItemDamage(stack);
maxDamage = ToolClass.getGTMaxDamage(stack);
damage = ToolClass.getGTitemDamage(stack);
} else {
maxDamage = stack.getMaxDamage();
damage = stack.getItemDamage();
@@ -189,8 +189,8 @@ class FuzzyItemVariantList extends ItemVariantList {
maxDamage = ((ICustomDamageItem) stack.getItem()).getMaxCustomDamage(stack);
damage = ((ICustomDamageItem) stack.getItem()).getCustomDamage(stack);
} else if (Platform.isGTDamageableItem(stack.getItem())) {
maxDamage = ((IToolItem) stack.getItem()).getMaxItemDamage(stack);
damage = ((IToolItem) stack.getItem()).getItemDamage(stack);
maxDamage = ToolClass.getGTMaxDamage(stack);
damage = ToolClass.getGTitemDamage(stack);
} else {
maxDamage = stack.getMaxDamage();
damage = stack.getItemDamage();
@@ -140,14 +140,6 @@ public final class ItemList implements IItemList<IAEItemStack> {
}
}
@Override
public ItemList clone() {
ItemList list = new ItemList();
list.records.putAll(records);
list.version.set(version.get());
return list;
}
private ItemVariantList getOrCreateRecord(Item item) {
return this.records.computeIfAbsent(item, this::makeRecordMap);
}
@@ -263,10 +263,10 @@ gui.tooltips.appliedenergistics2.SubstitutionsOff=Substitutions Disabled
gui.tooltips.appliedenergistics2.Encode=Encode Pattern
gui.tooltips.appliedenergistics2.EncodeDescription=Write the entered pattern to the current encoded pattern, or to available blank pattern. Hold Shift to transfer directly to your inventory
gui.tooltips.appliedenergistics2.FuzzyMode=Fuzzy Comparison
gui.tooltips.appliedenergistics2.FZPercent_25=Split Damage at 25%
gui.tooltips.appliedenergistics2.FZPercent_50=Split Damage at 50%
gui.tooltips.appliedenergistics2.FZPercent_75=Split Damage at 75%
gui.tooltips.appliedenergistics2.FZPercent_99=Split Damage at 99%
gui.tooltips.appliedenergistics2.FZPercent_25=Split Damage at §a25%§r
gui.tooltips.appliedenergistics2.FZPercent_50=Split Damage at §e50%§r
gui.tooltips.appliedenergistics2.FZPercent_75=Split Damage at §675%§r
gui.tooltips.appliedenergistics2.FZPercent_99=Split Damage at §499%§r
gui.tooltips.appliedenergistics2.SortOrder=Sort Order
gui.tooltips.appliedenergistics2.SortBy=Sort By
gui.tooltips.appliedenergistics2.FZIgnoreAll=Match Any
@@ -290,8 +290,8 @@ gui.tooltips.appliedenergistics2.TrashController=Deletion via Shift / Space Clic
gui.tooltips.appliedenergistics2.InterfaceBlockingMode=Blocking Mode
gui.tooltips.appliedenergistics2.InterfaceCraftingMode=Crafting Mode
gui.tooltips.appliedenergistics2.Trash=Destroy Items
gui.tooltips.appliedenergistics2.MatterBalls=Condense Into Matter Balls\n%s per item
gui.tooltips.appliedenergistics2.Singularity=Condense Into Singularities\n%s per item
gui.tooltips.appliedenergistics2.MatterBalls=Condense Into Matter Balls\n§a%s§r per item
gui.tooltips.appliedenergistics2.Singularity=Condense Into Singularities\n§a%s§r per item
gui.tooltips.appliedenergistics2.Read=Extract Only
gui.tooltips.appliedenergistics2.Write=Insert Only
gui.tooltips.appliedenergistics2.ReadWrite=Bi-Directional
@@ -410,16 +410,16 @@ waila.appliedenergistics2.Locked=Locked
waila.appliedenergistics2.Unlocked=Unlocked
waila.appliedenergistics2.Showing=Showing
waila.appliedenergistics2.Contains=Contains
waila.appliedenergistics2.Channels=%1$d of %2$d Channels
waila.appliedenergistics2.Channels=§2%1$d§r of §4%2$d§r Channels
waila.appliedenergistics2.P2PUnlinked=Unlinked
waila.appliedenergistics2.p2p_input_one_output=Linked (Input Side) - 1 Output
waila.appliedenergistics2.p2p_input_many_outputs=Linked (Input Side) - %d Outputs
waila.appliedenergistics2.p2p_input_many_outputs=Linked (Input Side) - §4%d§r Outputs
waila.appliedenergistics2.p2p_output_one_input=Linked (Output Side) - 1 Input
waila.appliedenergistics2.p2p_output_many_inputs=Linked (Output Side) - %d Inputs
waila.appliedenergistics2.p2p_output_many_inputs=Linked (Output Side) - §2%d§r Inputs
waila.appliedenergistics2.P2POutput=Linked (Output Side)
// TheOneProbe
theoneprobe.appliedenergistics2.crafting=Crafting: %1$s
theoneprobe.appliedenergistics2.crafting=Crafting: §2%1$s§r
theoneprobe.appliedenergistics2.device_online=Device Online
theoneprobe.appliedenergistics2.device_offline=Device Offline
theoneprobe.appliedenergistics2.device_missing_channel=Device Missing Channel
@@ -427,15 +427,15 @@ theoneprobe.appliedenergistics2.locked=Locked
theoneprobe.appliedenergistics2.unlocked=Unlocked
theoneprobe.appliedenergistics2.showing=Showing
theoneprobe.appliedenergistics2.contains=Contains
theoneprobe.appliedenergistics2.channels=%1$d of %2$d Channels
theoneprobe.appliedenergistics2.channels=§2%1$d§r of §4%2$d§r Channels
theoneprobe.appliedenergistics2.p2p_unlinked=Unlinked
theoneprobe.appliedenergistics2.p2p_input_one_output=Linked (Input Side) - 1 Output
theoneprobe.appliedenergistics2.p2p_input_many_outputs=Linked (Input Side) - %d Outputs
theoneprobe.appliedenergistics2.p2p_input_many_outputs=Linked (Input Side) - §4%d§r Outputs
theoneprobe.appliedenergistics2.p2p_output_one_input=Linked (Output Side) - 1 Input
theoneprobe.appliedenergistics2.p2p_output_many_inputs=Linked (Output Side) - %d Inputs
theoneprobe.appliedenergistics2.p2p_output_many_inputs=Linked (Output Side) - §2%d§r Inputs
theoneprobe.appliedenergistics2.p2p_output=Linked (Output Side)
theoneprobe.appliedenergistics2.p2p_frequency=Frequency: %1$s
theoneprobe.appliedenergistics2.stored_energy=%1$d / %2$d
theoneprobe.appliedenergistics2.p2p_frequency=Frequency: §5%1$s§r
theoneprobe.appliedenergistics2.stored_energy=§2%1$d§к / §4%2$d§r
// Items
item.appliedenergistics2.storage_cell_1k.name=§61k§r ME Storage Cell
@@ -552,8 +552,8 @@ item.appliedenergistics2.multi_part.inverted_toggle_bus.name=ME Inverted Toggle
item.appliedenergistics2.multi_part.toggle_bus.name=ME Toggle Bus
item.appliedenergistics2.multi_part.crafting_monitor.name=ME Crafting Monitor
item.appliedenergistics2.multi_part.interface_terminal.name=ME Interface Terminal
item.appliedenergistics2.multi_part.interface_configuration_terminal.name=ME Configuration Interface Terminal
item.appliedenergistics2.multi_part.fluid_interface_configuration_terminal.name=ME Configuration Fluid Interface Terminal
item.appliedenergistics2.multi_part.interface_configuration_terminal.name=ME Interface Configuration Terminal
item.appliedenergistics2.multi_part.fluid_interface_configuration_terminal.name=ME Fluid Interface Configuration Terminal
item.appliedenergistics2.multi_part.fluid_terminal.name=ME Fluid Terminal
item.appliedenergistics2.multi_part.invalid_type.name=Disabled Item
@@ -2,23 +2,23 @@
tile.appliedenergistics2.cable_bus.name=AE2 кабель и/или шина
tile.appliedenergistics2.cell_workbench.name=Верстак для ячеек
tile.appliedenergistics2.charger.name=Зарядник
tile.appliedenergistics2.chest.name=МЭ сундук
tile.appliedenergistics2.chest.name=МЭ Сундук
tile.appliedenergistics2.condenser.name=Конденсатор материи
tile.appliedenergistics2.controller.name=МЭ контроллер
tile.appliedenergistics2.controller.name=МЭ Контроллер
tile.appliedenergistics2.crank.name=Деревянная рукоятка
tile.appliedenergistics2.creative_energy_cell.name=Творческая энергетическая ячейка
tile.appliedenergistics2.dense_energy_cell.name=Плотная энергетическая ячейка
tile.appliedenergistics2.energy_cell.name=Энергетическая ячейка
tile.appliedenergistics2.drive.name=МЭ накопитель
tile.appliedenergistics2.drive.name=МЭ Накопитель
tile.appliedenergistics2.energy_acceptor.name=Приёмщик энергии
tile.appliedenergistics2.grindstone.name=Кварцевый дробитель
tile.appliedenergistics2.matrix_frame.name=Каркас матрицы
tile.appliedenergistics2.io_port.name=МЭ порт ввода\вывода
tile.appliedenergistics2.io_port.name=МЭ Порт ввода\вывода
tile.appliedenergistics2.inscriber.name=Высекатель
tile.appliedenergistics2.interface.name=МЭ интерфейс
tile.appliedenergistics2.fluid_interface.name=МЭ жидкостный интерфейс
tile.appliedenergistics2.quantum_link.name=МЭ камера квантовой связи
tile.appliedenergistics2.quantum_ring.name=МЭ квантовое кольцо
tile.appliedenergistics2.interface.name=МЭ Интерфейс
tile.appliedenergistics2.fluid_interface.name=МЭ Жидкостный интерфейс
tile.appliedenergistics2.quantum_link.name=МЭ Камера квантовой связи
tile.appliedenergistics2.quantum_ring.name=МЭ Квантовое кольцо
tile.appliedenergistics2.fluix_block.name=Изменчивый блок
tile.appliedenergistics2.quartz_block.name=Блок истинного кварца
tile.appliedenergistics2.chiseled_quartz_block.name=Резной блок истинного кварца
@@ -31,10 +31,10 @@ tile.appliedenergistics2.spatial_io_port.name=Пространственный
tile.appliedenergistics2.spatial_pylon.name=Пространственный пилон
tile.appliedenergistics2.tiny_tnt.name=Маленький динамит
tile.appliedenergistics2.vibration_chamber.name=Вибрационная камера
tile.appliedenergistics2.wireless_access_point.name=МЭ беспроводная точка доступа
tile.appliedenergistics2.wireless_access_point.name=МЭ Беспроводная точка доступа
tile.appliedenergistics2.quartz_ore.name=Руда истинного кварца
tile.appliedenergistics2.charged_quartz_ore.name=Заряженная руда истинного кварца
tile.appliedenergistics2.security_station.name=МЭ терминал безопасности
tile.appliedenergistics2.security_station.name=МЭ Терминал безопасности
tile.appliedenergistics2.quartz_growth_accelerator.name=Ускоритель роста кристаллов
tile.appliedenergistics2.sky_stone_block.name=Небесный камень
tile.appliedenergistics2.smooth_sky_stone_block.name=Блок небесного камня
@@ -73,8 +73,9 @@ tile.appliedenergistics2.sky_stone_small_brick_slab.name=Плита из мал
tile.appliedenergistics2.sky_stone_slab.name=Плита из небесного камня
// Chat Messages
chat.appliedenergistics2.ChestCannotReadStorageCell=МЭ сундук не может прочитать ячейку хранения.
chat.appliedenergistics2.ChestCannotReadStorageCell=МЭ Сундук не может прочитать ячейку хранения.
chat.appliedenergistics2.SettingCleared=Карта памяти очищена.
chat.appliedenergistics2.MissingPatternsToEncode=Недостаточно шаблонов для завершения копирования.
chat.appliedenergistics2.OutOfRange=Беспроводная сеть вне зоны действия.
chat.appliedenergistics2.InvalidMachine=Неподходящий механизм.
chat.appliedenergistics2.LoadedSettings=Настройки успешно загружены.
@@ -168,6 +169,8 @@ gui.appliedenergistics2.StoredFluids=Хранящиеся жидкости
gui.appliedenergistics2.Terminal=Терминал
gui.appliedenergistics2.InterfaceTerminal=Терминал интерфейсов
gui.appliedenergistics2.InterfaceTerminalHint=Показать или спрятать в терминале интерфейсов.
gui.appliedenergistics2.InterfaceConfigurationTerminal=Терминал конфигурации интерфейса
gui.appliedenergistics2.FluidInterfaceConfigurationTerminal=Терминал жидкостной конфигурации интерфейсов
gui.appliedenergistics2.FormationPlane=Плоскость формирования
gui.appliedenergistics2.FluidFormationPlane=Плоскость формирования жидкости
gui.appliedenergistics2.VibrationChamber=Вибрационная камера
@@ -175,7 +178,6 @@ gui.appliedenergistics2.NetworkDetails=Подробности сети
gui.appliedenergistics2.StorageCells=МЭ Ячейки хранения
gui.appliedenergistics2.IOBuses=МЭ Шина импорта\экспорта
gui.appliedenergistics2.IOBusesFluids=МЭ Жидкостная шина импорта\экспорта
gui.appliedenergistics2.IOBusesFluids=МЭ Шина импорта/экспорта жидкости
gui.appliedenergistics2.Stores=Хранит
gui.appliedenergistics2.BytesUsed=Байт использовано
gui.appliedenergistics2.Types=Типов
@@ -220,7 +222,7 @@ gui.appliedenergistics2.Crafting=Крафт
gui.appliedenergistics2.Scheduled=Запланировано
gui.appliedenergistics2.CraftingStatus=Статус крафта
gui.appliedenergistics2.FromStorage=Доступно
gui.appliedenergistics2.ToCraft=Необходимо скрафтить
gui.appliedenergistics2.ToCraft=Нужно еще
gui.appliedenergistics2.CraftingPlan=План крафта
gui.appliedenergistics2.Automatic=Автоматически
gui.appliedenergistics2.Start=Старт
@@ -261,10 +263,10 @@ gui.tooltips.appliedenergistics2.SubstitutionsOff=Замещения выклю
gui.tooltips.appliedenergistics2.Encode=Закодировать шаблон
gui.tooltips.appliedenergistics2.EncodeDescription=Запишите введённый шаблон на текущий закодированный шаблон, или на доступный чистый шаблон.
gui.tooltips.appliedenergistics2.FuzzyMode=Нечёткое сравнение
gui.tooltips.appliedenergistics2.FZPercent_25=Разделять урон с 25%
gui.tooltips.appliedenergistics2.FZPercent_50=Разделять урон с 50%
gui.tooltips.appliedenergistics2.FZPercent_75=Разделять урон с 75%
gui.tooltips.appliedenergistics2.FZPercent_99=Разделять урон с 99%
gui.tooltips.appliedenergistics2.FZPercent_25=Разделять урон с §a25%§r
gui.tooltips.appliedenergistics2.FZPercent_50=Разделять урон с §e50%§r
gui.tooltips.appliedenergistics2.FZPercent_75=Разделять урон с §675%§r
gui.tooltips.appliedenergistics2.FZPercent_99=Разделять урон с §499%§r
gui.tooltips.appliedenergistics2.SortOrder=Порядок сортировки
gui.tooltips.appliedenergistics2.SortBy=Сортировать по
gui.tooltips.appliedenergistics2.FZIgnoreAll=Любое соответствие
@@ -288,8 +290,8 @@ gui.tooltips.appliedenergistics2.TrashController=Удаление по нажа
gui.tooltips.appliedenergistics2.InterfaceBlockingMode=Блокирующий режим
gui.tooltips.appliedenergistics2.InterfaceCraftingMode=Режим крафта
gui.tooltips.appliedenergistics2.Trash=Уничтожить предметы
gui.tooltips.appliedenergistics2.MatterBalls=Конденсировать в шары материи\n%s за предмет
gui.tooltips.appliedenergistics2.Singularity=Конденсировать в сингулярности\n%s за предмет
gui.tooltips.appliedenergistics2.MatterBalls=Конденсировать в шары материи\n§a%s§r за предмет
gui.tooltips.appliedenergistics2.Singularity=Конденсировать в сингулярности\n§a%s§r за предмет
gui.tooltips.appliedenergistics2.Read=Только извлекать
gui.tooltips.appliedenergistics2.Write=Только вкладывать
gui.tooltips.appliedenergistics2.ReadWrite=Двухсторонний
@@ -408,16 +410,16 @@ waila.appliedenergistics2.Locked=Заблокировано
waila.appliedenergistics2.Unlocked=Разблокировано
waila.appliedenergistics2.Showing=Показывает
waila.appliedenergistics2.Contains=Содержит
waila.appliedenergistics2.Channels=Каналы: %1$d из %2$d
waila.appliedenergistics2.Channels=Каналы: §2%1$d§r из §4%2$d§r
waila.appliedenergistics2.P2PUnlinked=Не связанный
waila.appliedenergistics2.p2p_input_one_output=Связанный (Сторона ввода)
waila.appliedenergistics2.p2p_input_many_outputs=Связанный (Сторона ввода) - %d выводов
waila.appliedenergistics2.p2p_output_one_input=Связанный (Сторона вывода)
waila.appliedenergistics2.p2p_output_many_inputs=Связанный (Сторона вывода) - %d выводов
waila.appliedenergistics2.P2POutput=Связанный (Сторона вывода)
waila.appliedenergistics2.p2p_input_one_output=Связанный (Сторона входа) - 1 Выход
waila.appliedenergistics2.p2p_input_many_outputs=Связанный (Сторона входа) - §4%d§r Выходов
waila.appliedenergistics2.p2p_output_one_input=Связанный (Сторона выхода) - 1 Вход
waila.appliedenergistics2.p2p_output_many_inputs=Связанный (Сторона выхода) - §2%d§r Входов
waila.appliedenergistics2.P2POutput=Связанный (Сторона выхода)
// TheOneProbe
theoneprobe.appliedenergistics2.crafting=Создается: %1$s
theoneprobe.appliedenergistics2.crafting=Создается: §2%1$s§r
theoneprobe.appliedenergistics2.device_online=Устройство включено
theoneprobe.appliedenergistics2.device_offline=Устройство выключено
theoneprobe.appliedenergistics2.device_missing_channel=У устройства нет канала.
@@ -425,15 +427,15 @@ theoneprobe.appliedenergistics2.locked=Заблокировано
theoneprobe.appliedenergistics2.unlocked=Разблокировано
theoneprobe.appliedenergistics2.showing=Показывает
theoneprobe.appliedenergistics2.contains=Содержит
theoneprobe.appliedenergistics2.channels=Каналы: %1$d из %2$d
theoneprobe.appliedenergistics2.channels=Каналы: §2%1$d§r из §4%2$d§r
theoneprobe.appliedenergistics2.p2p_unlinked=Не связанный
theoneprobe.appliedenergistics2.p2p_input_one_output=Связанный (сторона ввода)
theoneprobe.appliedenergistics2.p2p_input_many_outputs=Связанный (сторона ввода) - %d выводов
theoneprobe.appliedenergistics2.p2p_output_one_input=Связанный (Сторона вывода)
theoneprobe.appliedenergistics2.p2p_output_many_inputs=Связанный (Сторона вывода) - %d выводов
theoneprobe.appliedenergistics2.p2p_output=Связанный (Сторона вывода)
theoneprobe.appliedenergistics2.p2p_frequency=Частота: %1$s
theoneprobe.appliedenergistics2.stored_energy=%1$d / %2$d
theoneprobe.appliedenergistics2.p2p_input_one_output=Связанный (Сторона входа) - 1 Выход
theoneprobe.appliedenergistics2.p2p_input_many_outputs=Связанный (Сторона входа) - §4%d§r Выходов
theoneprobe.appliedenergistics2.p2p_output_one_input=Связанный (Сторона выхода) - 1 Вход
theoneprobe.appliedenergistics2.p2p_output_many_inputs=Связанный (Сторона выхода) - §2%d§r Входов
theoneprobe.appliedenergistics2.p2p_output=Связанный (Сторона выхода)
theoneprobe.appliedenergistics2.p2p_frequency=Частота: §5%1$s§r
theoneprobe.appliedenergistics2.stored_energy=§2%1$d§к / §4%2$d§r
// Items
item.appliedenergistics2.storage_cell_1k.name=§61k§r МЭ Ячейка хранения
@@ -444,7 +446,7 @@ item.appliedenergistics2.fluid_storage_cell_1k.name=§61k§r МЭ Жидкост
item.appliedenergistics2.fluid_storage_cell_4k.name=§e4k§r МЭ Жидкостная ячейка хранения
item.appliedenergistics2.fluid_storage_cell_16k.name=§a16k§r МЭ Жидкостная ячейка хранения
item.appliedenergistics2.fluid_storage_cell_64k.name=§b64k§r МЭ Жидкостная ячейка хранения
item.appliedenergistics2.creative_storage_cell.name=Творческая МЭ ячейка хранения
item.appliedenergistics2.creative_storage_cell.name=Творческая МЭ Ячейка хранения
item.appliedenergistics2.encoded_pattern.name=Кодированный шаблон
item.appliedenergistics2.view_cell.name=Ячейка представления
item.appliedenergistics2.facade.name=Кабельный фасад
@@ -535,12 +537,12 @@ item.appliedenergistics2.multi_part.fluid_formation_plane.name=МЭ Жидкос
item.appliedenergistics2.multi_part.import_bus.name=МЭ Шина импорта
item.appliedenergistics2.multi_part.fluid_import_bus.name=МЭ Жидкостная шина импорта
item.appliedenergistics2.multi_part.interface.name=МЭ Интерфейс
item.appliedenergistics2.multi_part.fluid_interface.name=МЭ Интерфейс жидкостей
item.appliedenergistics2.multi_part.fluid_interface.name=МЭ Жидкостый нтерфейс
item.appliedenergistics2.multi_part.level_emitter.name=МЭ Излучатель уровня
item.appliedenergistics2.multi_part.fluid_level_emitter.name=МЭ Излучатель уровня
item.appliedenergistics2.multi_part.p2p_tunnel.name=Туннель точка-точка
item.appliedenergistics2.multi_part.pattern_terminal.name=МЭ Терминал шаблонов
item.appliedenergistics2.multi_part.expanded_processing_pattern_terminal.name=ME терминал расширенной схемы обработки
item.appliedenergistics2.multi_part.expanded_processing_pattern_terminal.name=ME Терминал расширенных шаблонов
item.appliedenergistics2.multi_part.quartz_fiber.name=Кварцевое оптическое волокно
item.appliedenergistics2.multi_part.storage_bus.name=МЭ Шина хранения
item.appliedenergistics2.multi_part.oredict_storage_bus.name=МЭ Шина хранения по словарю руд
@@ -550,6 +552,8 @@ item.appliedenergistics2.multi_part.inverted_toggle_bus.name=МЭ Инверти
item.appliedenergistics2.multi_part.toggle_bus.name=МЭ Шина переключения
item.appliedenergistics2.multi_part.crafting_monitor.name=МЭ Монитор крафта
item.appliedenergistics2.multi_part.interface_terminal.name=МЭ Терминал интерфейсов
item.appliedenergistics2.multi_part.interface_configuration_terminal.name=МЭ Терминал конфигурации интерфейсов
item.appliedenergistics2.multi_part.fluid_interface_configuration_terminal.name=МЭ Терминал жидкостной конфигурации интерфейсов
item.appliedenergistics2.multi_part.fluid_terminal.name=МЭ Жидкостный терминал
item.appliedenergistics2.multi_part.invalid_type.name=Отключенный предмет
@@ -623,7 +627,7 @@ achievement.ae2.Charger.desc=Сделайте зарядник!
achievement.ae2.CrystalGrowthAccelerator=Ускоритель - ещё мягко сказано!
achievement.ae2.CrystalGrowthAccelerator.desc=Сделайте ускоритель роста кристаллов!
achievement.ae2.GlassCable=Изменчивое энергетическое соединение!
achievement.ae2.GlassCable.desc=Сделайте МЭ стеклянный кабель!
achievement.ae2.GlassCable.desc=Сделайте МЭ Стеклянный кабель!
achievement.ae2.Networking1=Сетевое подмастерье!
achievement.ae2.Networking1.desc=Достигните 8 каналов, подключая устройства к сети!
achievement.ae2.Controller=Коммутатор сети!
@@ -650,8 +654,8 @@ achievement.ae2.QNB=Квантовое туннелирование!
achievement.ae2.QNB.desc=Сделайте квантовое соединение!
// Stats
stat.ae2.ItemsInserted=Предметов добавлено в МЭ хранилище
stat.ae2.ItemsExtracted=Предметов извлечено из МЭ хранилища
stat.ae2.ItemsInserted=Предметов добавлено в МЭ Хранилище
stat.ae2.ItemsExtracted=Предметов извлечено из МЭ Хранилища
stat.ae2.TurnedCranks=Сломано рукояток
//Keys
@@ -1,12 +1,122 @@
{
"parent": "block/cube",
"textures": {
"particle": "appliedenergistics2:blocks/chest/side",
"up": "appliedenergistics2:blocks/chest/top",
"down": "appliedenergistics2:blocks/chest/bottom",
"north": "appliedenergistics2:blocks/chest/front",
"east": "appliedenergistics2:blocks/chest/side",
"south": "appliedenergistics2:blocks/chest/side",
"west": "appliedenergistics2:blocks/chest/side"
}
}
"credit": "Made with Blockbench",
"textures": {
"up": "appliedenergistics2:blocks/chest/top",
"down": "appliedenergistics2:blocks/chest/bottom",
"north": "appliedenergistics2:blocks/chest/front",
"particle": "appliedenergistics2:blocks/chest/side",
"east": "appliedenergistics2:blocks/chest/side"
},
"elements": [
{
"name": "inside_border_right",
"from": [4, 3, 0],
"to": [5, 8, 1],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 13, 1]},
"faces": {
"east": {"uv": [0, 6, 1, 11], "rotation": 180, "texture": "#down"}
}
},
{
"name": "inside_right",
"from": [2, 1, 1],
"to": [5, 12, 11],
"rotation": {"angle": 0, "axis": "y", "origin": [9, 11, 3]},
"faces": {
"east": {"uv": [5, 2, 14, 13], "texture": "#down"}
}
},
{
"from": [0, 0, 0],
"to": [16, 16, 16],
"faces": {
"north": {"uv": [0, 0, 16, 16], "texture": "#north"},
"east": {"uv": [0, 0, 16, 16], "texture": "#east"},
"south": {"uv": [0, 0, 16, 16], "texture": "#east"},
"west": {"uv": [0, 0, 16, 16], "texture": "#east"},
"up": {"uv": [0, 0, 16, 16], "texture": "#up"},
"down": {"uv": [0, 0, 16, 16], "texture": "#down"}
}
},
{
"name": "inside_back",
"from": [5, 4, 7],
"to": [11, 7, 10],
"rotation": {"angle": 0, "axis": "y", "origin": [19, 11, 8]},
"faces": {
"north": {"uv": [3, 2, 14, 14], "texture": "#down"}
}
},
{
"name": "inside_left",
"from": [11, 1, 1],
"to": [14, 12, 11],
"rotation": {"angle": 0, "axis": "y", "origin": [18, 11, 3]},
"faces": {
"north": {"uv": [2, 5, 2, 5], "texture": "#down"},
"west": {"uv": [5, 2, 14, 13], "texture": "#down"}
}
},
{
"name": "inside_top",
"from": [5, 6, 1],
"to": [11, 9, 11],
"rotation": {"angle": 0, "axis": "y", "origin": [15, 16, 3]},
"faces": {
"north": {"uv": [14, 12, 14, 12], "texture": "#down"},
"down": {"uv": [12, 15, 12, 15], "texture": "#down"}
}
},
{
"name": "inside_bottom",
"from": [5, 1, 1],
"to": [11, 4, 11],
"rotation": {"angle": 0, "axis": "y", "origin": [15, 11, 3]},
"faces": {
"north": {"uv": [1, 6, 1, 6], "texture": "#down"},
"up": {"uv": [6, 1, 6, 1], "texture": "#down"}
}
},
{
"name": "inside_border_bottom",
"from": [4, 0, 0],
"to": [12, 3, 9],
"rotation": {"angle": 0, "axis": "y", "origin": [15, 10, 1]},
"faces": {
"up": {"uv": [0, 4, 9, 13], "rotation": 90, "texture": "#missing"}
}
},
{
"name": "inside_border_top",
"from": [5, 7, 0],
"to": [12, 10, 9],
"rotation": {"angle": 0, "axis": "y", "origin": [15, 17, 1]},
"faces": {
"down": {"uv": [0, 4, 9, 13], "rotation": 270, "texture": "#down"}
}
},
{
"name": "inside_border_left",
"from": [11, 3, 0],
"to": [12, 8, 1],
"rotation": {"angle": 0, "axis": "y", "origin": [15, 13, 1]},
"faces": {
"west": {"uv": [0, 8, 1, 13], "texture": "#down"}
}
}
],
"groups": [
{
"name": "chest",
"origin": [8, 8, 8],
"color": 0,
"children": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
},
{
"name": "cells",
"origin": [8, 8, 8],
"color": 0,
"children": []
}
]
}
@@ -1,24 +1,4 @@
{
"textures": {
"state": "appliedenergistics2:blocks/chest/cell_state_empty"
},
"elements": [
{
"from": [
0,
0,
0
],
"to": [
16,
16,
16
],
"faces": {
"north": {
"texture": "#state"
}
}
}
]
}
"textures": {},
"elements": []
}
@@ -1,47 +1,38 @@
{
"ae2_uvl_marker": true,
"textures": {
"backdrop": "appliedenergistics2:blocks/chest/cell_state_backdrop",
"state": "appliedenergistics2:blocks/chest/cell_state_full"
},
"elements": [
{
"from": [
0,
0,
0
],
"to": [
16,
16,
16
],
"faces": {
"north": {
"texture": "#backdrop"
}
}
},
{
"from": [
0,
0,
0
],
"to": [
16,
16,
16
],
"faces": {
"north": {
"texture": "#state",
"uvlightmap": {
"block": 0.007,
"sky": 0.007
}
}
}
}
]
}
"credit": "Made with Blockbench",
"textures": {
"front": "appliedenergistics2:blocks/chest/cell_state_backdrop",
"state": "appliedenergistics2:blocks/chest/cell_state_full",
"top_front": "appliedenergistics2:blocks/drive_cell_states_emissive"
},
"elements": [
{
"name": "Cell Backdrop",
"from": [5, 4, 0],
"to": [11, 6, 1],
"shade": false,
"faces": {
"north": {"uv": [5, 10, 11, 12], "texture": "#front"},
"up": {"uv": [5, 10, 11, 11], "texture": "#front"}
}
},
{
"name": "Cell Light",
"from": [9, 4, 0],
"to": [10, 5, 0],
"shade": false,
"faces": {
"north": {"uv": [6, 11, 7, 12], "texture": "#state"}
}
},
{
"name": "Cell Light",
"from": [9, 4, 0],
"to": [10, 5, 0],
"shade": false,
"faces": {
"north": {"uv": [1, 7, 2, 8], "texture": "#top_front"}
}
}
]
}
@@ -1,24 +1,17 @@
{
"textures": {
"state": "appliedenergistics2:blocks/chest/cell_state_offline"
},
"elements": [
{
"from": [
0,
0,
0
],
"to": [
16,
16,
16
],
"faces": {
"north": {
"texture": "#state"
}
}
}
]
}
"credit": "Made with Blockbench",
"textures": {
"front": "appliedenergistics2:blocks/chest/cell_state_offline"
},
"elements": [
{
"from": [5, 4, 0],
"to": [11, 6, 1],
"shade": false,
"faces": {
"north": {"uv": [5, 10, 11, 12], "texture": "#front"},
"up": {"uv": [5, 10, 11, 11], "texture": "#front"}
}
}
]
}
@@ -1,47 +1,38 @@
{
"ae2_uvl_marker": true,
"textures": {
"backdrop": "appliedenergistics2:blocks/chest/cell_state_backdrop",
"state": "appliedenergistics2:blocks/chest/cell_state_online"
},
"elements": [
{
"from": [
0,
0,
0
],
"to": [
16,
16,
16
],
"faces": {
"north": {
"texture": "#backdrop"
}
}
},
{
"from": [
0,
0,
0
],
"to": [
16,
16,
16
],
"faces": {
"north": {
"texture": "#state",
"uvlightmap": {
"block": 0.007,
"sky": 0.007
}
}
}
}
]
}
"ae2_uvl_marker": true,
"parent": "block/block",
"textures": {
"front": "appliedenergistics2:blocks/chest/cell_state_backdrop",
"state": "appliedenergistics2:blocks/chest/cell_state_online",
"top_front": "appliedenergistics2:blocks/drive_cell_states_emissive"
},
"elements": [
{
"name": "Cell Backdrop",
"from": [5, 4, 0],
"to": [11, 6, 1],
"shade": false,
"faces": {
"north": {"uv": [5, 10, 11, 12], "texture": "#front"},
"up": {"uv": [5, 10, 11, 11], "texture": "#front"}
}
},
{
"name": "Cell Light",
"from": [9, 4, 0],
"to": [10, 5, 0],
"shade": false,
"faces": {
"north": {"uv": [6, 11, 7, 12], "texture": "#state"}
}
},
{
"name": "Cell Light",
"from": [9, 4, 0],
"to": [10, 5, 0],
"faces": {
"north": {"uv": [1, 3, 2, 4], "texture": "#top_front"}
}
}
]
}
@@ -1,47 +1,38 @@
{
"ae2_uvl_marker": true,
"textures": {
"backdrop": "appliedenergistics2:blocks/chest/cell_state_backdrop",
"state": "appliedenergistics2:blocks/chest/cell_state_types_full"
},
"elements": [
{
"from": [
0,
0,
0
],
"to": [
16,
16,
16
],
"faces": {
"north": {
"texture": "#backdrop"
}
}
},
{
"from": [
0,
0,
0
],
"to": [
16,
16,
16
],
"faces": {
"north": {
"texture": "#state",
"uvlightmap": {
"block": 0.007,
"sky": 0.007
}
}
}
}
]
}
"credit": "Made with Blockbench",
"textures": {
"front": "appliedenergistics2:blocks/chest/cell_state_backdrop",
"state": "appliedenergistics2:blocks/chest/cell_state_types_full",
"top_front": "appliedenergistics2:blocks/drive_cell_states_emissive"
},
"elements": [
{
"name": "Cell Backdrop",
"from": [5, 4, 0],
"to": [11, 6, 1],
"shade": false,
"faces": {
"north": {"uv": [5, 10, 11, 12], "texture": "#front"},
"up": {"uv": [5, 10, 11, 11], "texture": "#front"}
}
},
{
"name": "Cell Light",
"from": [9, 4, 0],
"to": [10, 5, 0],
"shade": false,
"faces": {
"north": {"uv": [6, 11, 7, 12], "texture": "#state"}
}
},
{
"name": "Cell Light",
"from": [9, 4, 0],
"to": [10, 5, 0],
"shade": false,
"faces": {
"north": {"uv": [1, 5, 2, 6], "texture": "#top_front"}
}
}
]
}
@@ -22,4 +22,4 @@
}
}
]
}
}
@@ -21,9 +21,10 @@
"up": {
"texture": "#lights_bright",
"tintindex": 3,
"unlit": true,
"uvlightmap": {
"block": 0.007,
"sky": 0.007
"block": 15,
"sky": 15
}
}
}
@@ -43,9 +44,10 @@
"up": {
"texture": "#lights_medium",
"tintindex": 2,
"unlit": true,
"uvlightmap": {
"block": 0.007,
"sky": 0.007
"block": 15,
"sky": 15
}
}
}
@@ -65,12 +67,13 @@
"up": {
"texture": "#lights_dark",
"tintindex": 1,
"unlit": true,
"uvlightmap": {
"block": 0.007,
"sky": 0.007
"block": 15,
"sky": 15
}
}
}
}
]
}
}
@@ -1,172 +1,284 @@
{
"parent": "block/block",
"textures": {
"particle": "appliedenergistics2:blocks/drive_side",
"side": "appliedenergistics2:blocks/drive_side",
"bottom": "appliedenergistics2:blocks/drive_bottom",
"top": "appliedenergistics2:blocks/drive_top",
"front": "appliedenergistics2:blocks/drive_front",
"inner": "appliedenergistics2:blocks/drive_bottom"
},
"elements": [
{
"name": "Right Side Panel",
"from": [
0.0,
1.0,
0.0
],
"to": [
2.0,
15.0,
16.0
],
"faces": {
"north": {
"texture": "#front"
},
"east": {
"texture": "#inner"
},
"south": {
"texture": "#side"
},
"west": {
"texture": "#side"
}
}
},
{
"name": "Left Side Panel",
"from": [
14.0,
1.0,
0.0
],
"to": [
16.0,
15.0,
16.0
],
"faces": {
"north": {
"texture": "#front"
},
"east": {
"texture": "#side"
},
"south": {
"texture": "#side"
},
"west": {
"texture": "#inner"
}
}
},
{
"name": "Back Panel",
"from": [
2.0,
1.0,
8.0
],
"to": [
14.0,
15.0,
16.0
],
"faces": {
"north": {
"texture": "#inner"
},
"south": {
"texture": "#side"
}
}
},
{
"name": "Bottom Panel",
"from": [
0.0,
0.0,
0.0
],
"to": [
16.0,
1.0,
16.0
],
"faces": {
"north": {
"texture": "#front"
},
"east": {
"texture": "#side"
},
"south": {
"texture": "#side"
},
"west": {
"texture": "#side"
},
"up": {
"texture": "#inner"
},
"down": {
"texture": "#bottom"
}
}
},
{
"name": "Top Panel",
"from": [
0.0,
15.0,
0.0
],
"to": [
16.0,
16.0,
16.0
],
"faces": {
"north": {
"texture": "#front"
},
"east": {
"texture": "#side"
},
"south": {
"texture": "#side"
},
"west": {
"texture": "#side"
},
"up": {
"texture": "#top"
},
"down": {
"texture": "#inner"
}
}
},
{
"name": "Front Panel",
"from": [
2.0,
1.0,
0.0
],
"to": [
14.0,
15.0,
8.0
],
"faces": {
"north": {
"texture": "#front"
}
}
}
]
"parent": "block/block",
"ambientocclusion": false,
"textures": {
"particle": "appliedenergistics2:blocks/drive_side",
"side": "appliedenergistics2:blocks/drive_side",
"bottom": "appliedenergistics2:blocks/drive_bottom",
"top": "appliedenergistics2:blocks/drive_top",
"front": "appliedenergistics2:blocks/drive_front"
},
"elements": [
{
"name": "Right Side Panel",
"from": [0, 1, 0],
"to": [2, 15, 16],
"faces": {
"north": {
"uv": [15, 1, 16, 15],
"texture": "#front",
"cullface": "north"
},
"east": {
"uv": [0, 2, 16, 14],
"rotation": 180,
"texture": "#bottom",
"cullface": "north"
},
"south": {
"uv": [0, 1, 1, 15],
"texture": "#side",
"cullface": "south"
},
"west": {
"uv": [0, 1, 16, 15],
"texture": "#side",
"cullface": "west"
}
}
},
{
"name": "Left Side Panel",
"from": [14, 1, 0],
"to": [16, 15, 16],
"faces": {
"north": {
"uv": [0, 1, 1, 15],
"texture": "#front",
"cullface": "north"
},
"east": {
"uv": [0, 1, 16, 15],
"texture": "#side",
"cullface": "east"
},
"south": {
"uv": [15, 1, 16, 15],
"texture": "#side",
"cullface": "south"
},
"west": {
"uv": [0, 2, 16, 14],
"texture": "#bottom",
"cullface": "north"
}
}
},
{
"name": "Back Panel",
"from": [2, 1, 7],
"to": [14, 15, 16],
"rotation": {
"angle": 0,
"axis": "y",
"origin": [8, 8, 9]
},
"faces": {
"north": {
"uv": [13, 2, 14, 13],
"texture": "#bottom"
},
"south": {
"uv": [1, 1, 15, 15],
"texture": "#side",
"cullface": "south"
}
}
},
{
"name": "Bottom Panel",
"from": [0, 0, 0],
"to": [16, 1, 16],
"faces": {
"north": {
"uv": [0, 15, 16, 16],
"texture": "#front",
"cullface": "north"
},
"east": {
"uv": [0, 15, 16, 16],
"texture": "#side",
"cullface": "east"
},
"south": {
"uv": [0, 15, 16, 16],
"texture": "#side",
"cullface": "south"
},
"west": {
"uv": [0, 15, 16, 16],
"texture": "#side",
"cullface": "west"
},
"up": {
"uv": [0, 2, 16, 14],
"rotation": 90,
"texture": "#bottom",
"cullface": "north"
},
"down": {
"uv": [0, 0, 16, 16],
"texture": "#bottom",
"cullface": "down"
}
}
},
{
"name": "Top Panel",
"from": [0, 15, 0],
"to": [16, 16, 16],
"faces": {
"north": {
"uv": [0, 0, 16, 1],
"texture": "#front",
"cullface": "north"
},
"east": {
"uv": [0, 0, 16, 1],
"texture": "#side",
"cullface": "east"
},
"south": {
"uv": [0, 0, 16, 1],
"texture": "#side",
"cullface": "south"
},
"west": {
"uv": [0, 0, 16, 1],
"texture": "#side",
"cullface": "west"
},
"up": {
"uv": [0, 0, 16, 16],
"texture": "#top",
"cullface": "up"
},
"down": {
"uv": [0, 2, 16, 14],
"rotation": 270,
"texture": "#bottom",
"cullface": "north"
}
}
},
{
"name": "Front Panel",
"from": [7, 1, 1],
"to": [9, 15, 7],
"faces": {
"north": {
"uv": [7, 1, 9, 15],
"texture": "#front",
"cullface": "north"
},
"east": {
"uv": [1, 2, 7, 14],
"rotation": 180,
"texture": "#bottom",
"cullface": "north"
},
"west": {
"uv": [1, 2, 7, 14],
"texture": "#bottom",
"cullface": "north"
}
}
},
{
"name": "Separator",
"from": [1, 3, 2],
"to": [15, 4, 7],
"faces": {
"north": {
"uv": [1, 12, 15, 13],
"texture": "#front",
"cullface": "north"
},
"up": {
"uv": [1, 2, 6, 14],
"rotation": 90,
"texture": "#bottom",
"cullface": "north"
},
"down": {
"uv": [1, 2, 6, 14],
"rotation": 270,
"texture": "#bottom",
"cullface": "north"
}
}
},
{
"name": "Separator",
"from": [1, 6, 2],
"to": [15, 7, 7],
"faces": {
"north": {
"uv": [1, 9, 15, 10],
"texture": "#front",
"cullface": "north"
},
"up": {
"uv": [1, 2, 6, 14],
"rotation": 90,
"texture": "#bottom",
"cullface": "north"
},
"down": {
"uv": [1, 2, 6, 14],
"rotation": 270,
"texture": "#bottom",
"cullface": "north"
}
}
},
{
"name": "Separator",
"from": [1, 9, 2],
"to": [15, 10, 7],
"faces": {
"north": {
"uv": [1, 6, 15, 7],
"texture": "#front",
"cullface": "north"
},
"up": {
"uv": [1, 2, 6, 14],
"rotation": 90,
"texture": "#bottom",
"cullface": "north"
},
"down": {
"uv": [1, 2, 6, 14],
"rotation": 270,
"texture": "#bottom",
"cullface": "north"
}
}
},
{
"name": "Separator",
"from": [1, 12, 2],
"to": [15, 13, 7],
"faces": {
"north": {
"uv": [1, 3, 15, 4],
"texture": "#front",
"cullface": "north"
},
"up": {
"uv": [1, 2, 6, 14],
"rotation": 90,
"texture": "#bottom",
"cullface": "north"
},
"down": {
"uv": [1, 2, 6, 14],
"rotation": 270,
"texture": "#bottom",
"cullface": "north"
}
}
}
]
}
@@ -1,273 +1,284 @@
{
"parent": "block/block",
"textures": {
"side": "appliedenergistics2:blocks/drive_side",
"bottom": "appliedenergistics2:blocks/drive_bottom",
"top": "appliedenergistics2:blocks/drive_top",
"front": "appliedenergistics2:blocks/drive_front",
"inner": "appliedenergistics2:blocks/drive_bottom"
},
"elements": [
{
"name": "Right Side Panel",
"from": [
0.0,
1.0,
0.0
],
"to": [
2.0,
15.0,
16.0
],
"faces": {
"north": {
"texture": "#front"
},
"east": {
"texture": "#inner"
},
"south": {
"texture": "#side"
},
"west": {
"texture": "#side"
}
}
"parent": "block/block",
"ambientocclusion": false,
"textures": {
"particle": "appliedenergistics2:blocks/drive_side",
"side": "appliedenergistics2:blocks/drive_side",
"bottom": "appliedenergistics2:blocks/drive_bottom",
"top": "appliedenergistics2:blocks/drive_top",
"front": "appliedenergistics2:blocks/drive_front"
},
"elements": [
{
"name": "Right Side Panel",
"from": [0, 1, 0],
"to": [2, 15, 16],
"faces": {
"north": {
"uv": [15, 1, 16, 15],
"texture": "#front",
"cullface": "north"
},
{
"name": "Left Side Panel",
"from": [
14.0,
1.0,
0.0
],
"to": [
16.0,
15.0,
16.0
],
"faces": {
"north": {
"texture": "#front"
},
"east": {
"texture": "#side"
},
"south": {
"texture": "#side"
},
"west": {
"texture": "#inner"
}
}
"east": {
"uv": [0, 2, 16, 14],
"rotation": 180,
"texture": "#bottom",
"cullface": "north"
},
{
"name": "Back Panel",
"from": [
2.0,
1.0,
8.0
],
"to": [
14.0,
15.0,
16.0
],
"faces": {
"north": {
"texture": "#inner"
},
"south": {
"texture": "#side"
}
}
"south": {
"uv": [0, 1, 1, 15],
"texture": "#side",
"cullface": "south"
},
{
"name": "Bottom Panel",
"from": [
0.0,
0.0,
0.0
],
"to": [
16.0,
1.0,
16.0
],
"faces": {
"north": {
"texture": "#front"
},
"east": {
"texture": "#side"
},
"south": {
"texture": "#side"
},
"west": {
"texture": "#side"
},
"up": {
"texture": "#inner"
},
"down": {
"texture": "#bottom"
}
}
},
{
"name": "Top Panel",
"from": [
0.0,
15.0,
0.0
],
"to": [
16.0,
16.0,
16.0
],
"faces": {
"north": {
"texture": "#front"
},
"east": {
"texture": "#side"
},
"south": {
"texture": "#side"
},
"west": {
"texture": "#side"
},
"up": {
"texture": "#top"
},
"down": {
"texture": "#inner"
}
}
},
{
"name": "Middle Strut",
"from": [
7.0,
1.0,
0.0
],
"to": [
9.0,
15.0,
8.0
],
"faces": {
"north": {
"texture": "#front"
},
"east": {
"texture": "#inner"
},
"west": {
"texture": "#inner"
}
}
},
{
"name": "Separator",
"from": [
2.0,
3.0,
1.0
],
"to": [
14.0,
4.0,
8.0
],
"faces": {
"north": {
"texture": "#front"
},
"up": {
"texture": "#inner"
},
"down": {
"texture": "#inner"
}
}
},
{
"name": "Separator",
"from": [
2.0,
6.0,
1.0
],
"to": [
14.0,
7.0,
8.0
],
"faces": {
"north": {
"texture": "#front"
},
"up": {
"texture": "#inner"
},
"down": {
"texture": "#inner"
}
}
},
{
"name": "Separator",
"from": [
2.0,
9.0,
1.0
],
"to": [
14.0,
10.0,
8.0
],
"faces": {
"north": {
"texture": "#front"
},
"up": {
"texture": "#inner"
},
"down": {
"texture": "#inner"
}
}
},
{
"name": "Separator",
"from": [
2.0,
12.0,
1.0
],
"to": [
14.0,
13.0,
8.0
],
"faces": {
"north": {
"texture": "#front"
},
"up": {
"texture": "#inner"
},
"down": {
"texture": "#inner"
}
}
"west": {
"uv": [0, 1, 16, 15],
"texture": "#side",
"cullface": "west"
}
]
}
},
{
"name": "Left Side Panel",
"from": [14, 1, 0],
"to": [16, 15, 16],
"faces": {
"north": {
"uv": [0, 1, 1, 15],
"texture": "#front",
"cullface": "north"
},
"east": {
"uv": [0, 1, 16, 15],
"texture": "#side",
"cullface": "east"
},
"south": {
"uv": [15, 1, 16, 15],
"texture": "#side",
"cullface": "south"
},
"west": {
"uv": [0, 2, 16, 14],
"texture": "#bottom",
"cullface": "north"
}
}
},
{
"name": "Back Panel",
"from": [2, 1, 7],
"to": [14, 15, 16],
"rotation": {
"angle": 0,
"axis": "y",
"origin": [8, 8, 9]
},
"faces": {
"north": {
"uv": [13, 2, 14, 13],
"texture": "#bottom"
},
"south": {
"uv": [1, 1, 15, 15],
"texture": "#side",
"cullface": "south"
}
}
},
{
"name": "Bottom Panel",
"from": [0, 0, 0],
"to": [16, 1, 16],
"faces": {
"north": {
"uv": [0, 15, 16, 16],
"texture": "#front",
"cullface": "north"
},
"east": {
"uv": [0, 15, 16, 16],
"texture": "#side",
"cullface": "east"
},
"south": {
"uv": [0, 15, 16, 16],
"texture": "#side",
"cullface": "south"
},
"west": {
"uv": [0, 15, 16, 16],
"texture": "#side",
"cullface": "west"
},
"up": {
"uv": [0, 2, 16, 14],
"rotation": 90,
"texture": "#bottom",
"cullface": "north"
},
"down": {
"uv": [0, 0, 16, 16],
"texture": "#bottom",
"cullface": "down"
}
}
},
{
"name": "Top Panel",
"from": [0, 15, 0],
"to": [16, 16, 16],
"faces": {
"north": {
"uv": [0, 0, 16, 1],
"texture": "#front",
"cullface": "north"
},
"east": {
"uv": [0, 0, 16, 1],
"texture": "#side",
"cullface": "east"
},
"south": {
"uv": [0, 0, 16, 1],
"texture": "#side",
"cullface": "south"
},
"west": {
"uv": [0, 0, 16, 1],
"texture": "#side",
"cullface": "west"
},
"up": {
"uv": [0, 0, 16, 16],
"texture": "#top",
"cullface": "up"
},
"down": {
"uv": [0, 2, 16, 14],
"rotation": 270,
"texture": "#bottom",
"cullface": "north"
}
}
},
{
"name": "Front Panel",
"from": [7, 1, 1],
"to": [9, 15, 7],
"faces": {
"north": {
"uv": [7, 1, 9, 15],
"texture": "#front",
"cullface": "north"
},
"east": {
"uv": [1, 2, 7, 14],
"rotation": 180,
"texture": "#bottom",
"cullface": "north"
},
"west": {
"uv": [1, 2, 7, 14],
"texture": "#bottom",
"cullface": "north"
}
}
},
{
"name": "Separator",
"from": [1, 3, 2],
"to": [15, 4, 7],
"faces": {
"north": {
"uv": [1, 12, 15, 13],
"texture": "#front",
"cullface": "north"
},
"up": {
"uv": [1, 2, 6, 14],
"rotation": 90,
"texture": "#bottom",
"cullface": "north"
},
"down": {
"uv": [1, 2, 6, 14],
"rotation": 270,
"texture": "#bottom",
"cullface": "north"
}
}
},
{
"name": "Separator",
"from": [1, 6, 2],
"to": [15, 7, 7],
"faces": {
"north": {
"uv": [1, 9, 15, 10],
"texture": "#front",
"cullface": "north"
},
"up": {
"uv": [1, 2, 6, 14],
"rotation": 90,
"texture": "#bottom",
"cullface": "north"
},
"down": {
"uv": [1, 2, 6, 14],
"rotation": 270,
"texture": "#bottom",
"cullface": "north"
}
}
},
{
"name": "Separator",
"from": [1, 9, 2],
"to": [15, 10, 7],
"faces": {
"north": {
"uv": [1, 6, 15, 7],
"texture": "#front",
"cullface": "north"
},
"up": {
"uv": [1, 2, 6, 14],
"rotation": 90,
"texture": "#bottom",
"cullface": "north"
},
"down": {
"uv": [1, 2, 6, 14],
"rotation": 270,
"texture": "#bottom",
"cullface": "north"
}
}
},
{
"name": "Separator",
"from": [1, 12, 2],
"to": [15, 13, 7],
"faces": {
"north": {
"uv": [1, 3, 15, 4],
"texture": "#front",
"cullface": "north"
},
"up": {
"uv": [1, 2, 6, 14],
"rotation": 90,
"texture": "#bottom",
"cullface": "north"
},
"down": {
"uv": [1, 2, 6, 14],
"rotation": 270,
"texture": "#bottom",
"cullface": "north"
}
}
}
]
}
@@ -1,32 +1,4 @@
{
"ae2_uvl_marker": true,
"textures": {
"front": "appliedenergistics2:blocks/drive_cell_states"
},
"elements": [
{
"name": "Cell Backdrop",
"from": [
9.0,
13.0,
0.0
],
"to": [
14.0,
15.0,
1.0
],
"faces": {
"north": {
"texture": "#front",
"uv": [
0,
10,
5,
12
]
}
}
}
]
"textures": {},
"elements": []
}
@@ -1,60 +1,29 @@
{
"ae2_uvl_marker": true,
"textures": {
"front": "appliedenergistics2:blocks/drive_cell_states"
},
"elements": [
{
"name": "Cell Backdrop",
"from": [
9.0,
13.0,
0.0
],
"to": [
14.0,
15.0,
1.0
],
"faces": {
"north": {
"texture": "#front",
"uv": [
0,
8,
5,
10
]
}
}
},
{
"name": "Cell Light",
"from": [
9.0,
13.0,
0.0
],
"to": [
14.0,
15.0,
1.0
],
"faces": {
"north": {
"texture": "#front",
"uv": [
0,
6,
5,
8
],
"uvlightmap": {
"sky": 0.007,
"block": 0.007
}
}
}
}
]
}
"textures": {
"front": "appliedenergistics2:blocks/drive_cell_states",
"top_front": "appliedenergistics2:blocks/drive_cell_states_emissive"
},
"elements": [
{
"name": "Cell Backdrop",
"from": [9, 13, 1],
"to": [14, 15, 2],
"shade": false,
"faces": {
"north": {"uv": [0, 8, 5, 10], "texture": "#front"},
"up": {"uv": [0, 8, 5, 9], "texture": "#front"},
"down": {"uv": [5, 10, 0, 9], "texture": "#front"}
}
},
{
"name": "Cell Light",
"from": [9, 13, 1],
"to": [14, 15, 2],
"shade": false,
"faces": {
"north": {"uv": [0, 6, 5, 8], "texture": "#top_front"},
"down": {"uv": [5, 8, 0, 7], "texture": "#top_front"}
}
}
]
}
@@ -1,31 +1,18 @@
{
"textures": {
"front": "appliedenergistics2:blocks/drive_cell_states"
},
"elements": [
{
"name": "Cell",
"from": [
9.0,
13.0,
0.0
],
"to": [
14.0,
15.0,
1.0
],
"faces": {
"north": {
"texture": "#front",
"uv": [
0,
0,
5,
2
]
}
}
}
]
}
"ambientocclusion": false,
"textures": {
"front": "appliedenergistics2:blocks/drive_cell_states"
},
"elements": [
{
"name": "Cell Backdrop",
"from": [9, 13, 1],
"to": [14, 15, 2],
"faces": {
"north": {"uv": [0, 0, 5, 2], "texture": "#front"},
"up": {"uv": [0, 0, 5, 1], "texture": "#front"},
"down": {"uv": [5, 2, 0, 1], "texture": "#front"}
}
}
]
}
@@ -1,60 +1,29 @@
{
"ae2_uvl_marker": true,
"textures": {
"front": "appliedenergistics2:blocks/drive_cell_states"
},
"elements": [
{
"name": "Cell Backdrop",
"from": [
9.0,
13.0,
0.0
],
"to": [
14.0,
15.0,
1.0
],
"faces": {
"north": {
"texture": "#front",
"uv": [
0,
8,
5,
10
]
}
}
},
{
"name": "Cell Light",
"from": [
9.0,
13.0,
0.0
],
"to": [
14.0,
15.0,
1.0
],
"faces": {
"north": {
"texture": "#front",
"uv": [
0,
2,
5,
4
],
"uvlightmap": {
"sky": 0.007,
"block": 0.007
}
}
}
}
]
}
"textures": {
"front": "appliedenergistics2:blocks/drive_cell_states",
"top_front": "appliedenergistics2:blocks/drive_cell_states_emissive"
},
"elements": [
{
"name": "Cell Backdrop",
"from": [9, 13, 1],
"to": [14, 15, 2],
"shade": false,
"faces": {
"north": {"uv": [0, 8, 5, 10], "texture": "#front"},
"up": {"uv": [0, 8, 5, 9], "texture": "#front"},
"down": {"uv": [5, 10, 0, 9], "texture": "#front"}
}
},
{
"name": "Cell Light",
"from": [9, 13, 1],
"to": [14, 15, 2],
"shade": false,
"faces": {
"north": {"uv": [0, 2, 5, 4], "texture": "#top_front"},
"down": {"uv": [5, 4, 0, 3], "texture": "#top_front"}
}
}
]
}
@@ -1,60 +1,29 @@
{
"ae2_uvl_marker": true,
"textures": {
"front": "appliedenergistics2:blocks/drive_cell_states"
},
"elements": [
{
"name": "Cell Backdrop",
"from": [
9.0,
13.0,
0.0
],
"to": [
14.0,
15.0,
1.0
],
"faces": {
"north": {
"texture": "#front",
"uv": [
0,
8,
5,
10
]
}
}
},
{
"name": "Cell Light",
"from": [
9.0,
13.0,
0.0
],
"to": [
14.0,
15.0,
1.0
],
"faces": {
"north": {
"texture": "#front",
"uv": [
0,
4,
5,
6
],
"uvlightmap": {
"sky": 0.007,
"block": 0.007
}
}
}
}
]
}
"textures": {
"front": "appliedenergistics2:blocks/drive_cell_states",
"top_front": "appliedenergistics2:blocks/drive_cell_states_emissive"
},
"elements": [
{
"name": "Cell Backdrop",
"from": [9, 13, 1],
"to": [14, 15, 2],
"shade": false,
"faces": {
"north": {"uv": [0, 8, 5, 10], "texture": "#front"},
"up": {"uv": [0, 8, 5, 9], "texture": "#front"},
"down": {"uv": [5, 10, 0, 9], "texture": "#front"}
}
},
{
"name": "Cell Light",
"from": [9, 13, 1],
"to": [14, 15, 2],
"shade": false,
"faces": {
"north": {"uv": [0, 4, 5, 6], "texture": "#top_front"},
"down": {"uv": [5, 6, 0, 5], "texture": "#top_front"}
}
}
]
}
@@ -1,6 +1,6 @@
{
"parent": "appliedenergistics2:part/p2p/p2p_tunnel_base",
"textures": {
"type": "blocks/redstone_block"
"type": "appliedenergistics2:blocks/redstone_p2p"
}
}
@@ -2,6 +2,7 @@
"animation": {
"frametime": 3,
"frames": [
0,
1,
2,
3,
@@ -12,8 +13,7 @@
8,
9,
10,
11,
0
11
]
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 341 B

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 405 B

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 402 B

After

Width:  |  Height:  |  Size: 286 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 401 B

After

Width:  |  Height:  |  Size: 300 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 403 B

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 405 B

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 403 B

After

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 404 B

After

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 405 B

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 404 B

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 B

Some files were not shown because too many files have changed in this diff Show More