Compare commits
46 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 653557bc65 | |||
| dde87448a9 | |||
| 8c29eeecdc | |||
| d852d0c216 | |||
| f9bb00a7e7 | |||
| 9f7e42ca7d | |||
| b76c18fedf | |||
| 98ce8235bb | |||
| e1ea4ae22f | |||
| 20ba83c529 | |||
| 225a4d5ab6 | |||
| bd4f03652e | |||
| d6650f9617 | |||
| c5607bda4e | |||
| 11af1f2111 | |||
| 7748f7c92d | |||
| 801fec3eaa | |||
| de324aad91 | |||
| 16ccb2ee46 | |||
| bd0d2a1f28 | |||
| 9abd53a8e8 | |||
| 1f12fc5e91 | |||
| 87fcc6c267 | |||
| e301459dfa | |||
| bf802f1c6f | |||
| 7ba4ca6923 | |||
| 53ed861e23 | |||
| 833f8aca2a | |||
| 9bcf45b7e2 | |||
| b2847677ed | |||
| 95845d5a6c | |||
| 286a3631be | |||
| 6506301049 | |||
| 422543f205 | |||
| 1eec160b74 | |||
| de23b62493 | |||
| 2b6299f2b0 | |||
| b495c972c4 | |||
| 7722dcc720 | |||
| c4d5add5f1 | |||
| 348e6436b8 | |||
| 92457ac680 | |||
| 9e53737635 | |||
| 0e0729166f | |||
| 15a1e8f150 | |||
| b443f1ce57 |
@@ -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
|
||||
- [](http://opensource.org/licenses/MIT)
|
||||
@@ -25,7 +29,6 @@ A Mod about Matter, Energy and using them to conquer the world..
|
||||
- [](https://creativecommons.org/publicdomain/zero/1.0/)
|
||||
|
||||
## Credits
|
||||
|
||||
Thanks to
|
||||
|
||||
* Notch et al for Minecraft
|
||||
|
||||
@@ -21,6 +21,7 @@ buildscript {
|
||||
mavenLocal()
|
||||
jcenter()
|
||||
mavenCentral()
|
||||
|
||||
maven {
|
||||
name = "forge"
|
||||
url = "http://files.minecraftforge.net/maven"
|
||||
|
||||
@@ -4,7 +4,7 @@ aebuild=7
|
||||
aegroup=appeng
|
||||
aebasename=appliedenergistics2
|
||||
extended=extended_life
|
||||
extendedversion=v0.54.0
|
||||
extendedversion=v0.54.16
|
||||
#########################################################
|
||||
# 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
|
||||
#########################################################
|
||||
|
||||
@@ -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
|
||||
}
|
||||
@@ -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"
|
||||
@@ -86,7 +83,11 @@ configurations {
|
||||
dependencies {
|
||||
// deobfCompile "gregtechce:gregtech:1.12.2:1.15.1.735"
|
||||
// installable runtime dependencies
|
||||
deobfCompile "curse.maven:gregtechceu-557242:3949406"
|
||||
//deobfCompile "curse.maven:gregtechceu-557242:3949406"
|
||||
|
||||
compileOnly(files("etc/gregtech-1.12.2-2.4.4-beta.jar"))
|
||||
|
||||
compileOnly "curse.maven:chisel-235279:2915375"
|
||||
|
||||
//mods "mcp.mobius.waila:Hwyla:${hwyla_version}"
|
||||
mods "curse.maven:hwyla-253449:2568751"
|
||||
@@ -100,18 +101,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:3975184"
|
||||
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}"
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,6 +47,8 @@ public class ItemRepo {
|
||||
|
||||
private final IItemList<IAEItemStack> list = AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class).createList();
|
||||
private final List<IAEItemStack> view;
|
||||
private List<IAEItemStack> asyncUpdatedView;
|
||||
private boolean updated;
|
||||
private final IScrollSource src;
|
||||
private final ISortSource sortSrc;
|
||||
|
||||
@@ -62,12 +64,12 @@ public class ItemRepo {
|
||||
this.sortSrc = sortSrc;
|
||||
|
||||
this.view = Collections.synchronizedList(new ArrayList<>());
|
||||
this.asyncUpdatedView = Collections.synchronizedList(new ArrayList<>());
|
||||
list.forEach(this.view::add);
|
||||
}
|
||||
|
||||
public IAEItemStack getReferenceItem(int idx) {
|
||||
idx += this.src.getCurrentScroll() * this.rowSize;
|
||||
|
||||
if (idx >= this.view.size()) {
|
||||
return null;
|
||||
}
|
||||
@@ -106,6 +108,13 @@ public class ItemRepo {
|
||||
return;
|
||||
}
|
||||
|
||||
if (updated) {
|
||||
this.view.clear();
|
||||
this.view.addAll(asyncUpdatedView);
|
||||
this.asyncUpdatedView.clear();
|
||||
this.updated = false;
|
||||
}
|
||||
|
||||
// Since sortSrc is final, so we can safely call it inside lambda
|
||||
searchTask = CompletableFuture.supplyAsync(() -> {
|
||||
IItemList<IAEItemStack> list = this.list.clone();
|
||||
@@ -199,9 +208,9 @@ public class ItemRepo {
|
||||
view.sort(ItemSorters.CONFIG_BASED_SORT_BY_SIZE);
|
||||
} else if (SortBy == SortOrder.INVTWEAKS) {
|
||||
if (InventoryBogoSortModule.isLoaded()) {
|
||||
Collections.sort(this.view, InventoryBogoSortModule.COMPARATOR);
|
||||
view.sort(InventoryBogoSortModule.COMPARATOR);
|
||||
} else {
|
||||
Collections.sort(this.view, ItemSorters.CONFIG_BASED_SORT_BY_INV_TWEAKS);
|
||||
view.sort(ItemSorters.CONFIG_BASED_SORT_BY_INV_TWEAKS);
|
||||
}
|
||||
} else {
|
||||
view.sort(ItemSorters.CONFIG_BASED_SORT_BY_NAME);
|
||||
@@ -209,13 +218,11 @@ public class ItemRepo {
|
||||
|
||||
return view;
|
||||
}).thenAcceptAsync(view -> {
|
||||
this.view.clear();
|
||||
this.view.addAll(view);
|
||||
this.updated = true;
|
||||
this.asyncUpdatedView.addAll(view);
|
||||
}).thenRunAsync(() -> {
|
||||
this.searchTask = null; // Prevent redundant cancellation
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void updateJEI(String filter) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -404,7 +404,7 @@ public abstract class AEBaseContainer extends Container {
|
||||
if (tis.getCount() <= 0) {
|
||||
clickSlot.putStack(ItemStack.EMPTY);
|
||||
d.onSlotChanged();
|
||||
|
||||
|
||||
this.updateSlot(clickSlot);
|
||||
this.updateSlot(d);
|
||||
return ItemStack.EMPTY;
|
||||
@@ -423,42 +423,7 @@ public abstract class AEBaseContainer extends Container {
|
||||
}
|
||||
|
||||
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) {
|
||||
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();
|
||||
|
||||
// if ( worldEntity != null )
|
||||
// worldEntity.markDirty();
|
||||
// if ( hasMETiles ) updateClient();
|
||||
|
||||
this.updateSlot(clickSlot);
|
||||
this.updateSlot(d);
|
||||
return ItemStack.EMPTY;
|
||||
} else {
|
||||
this.updateSlot(d);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!d.getHasStack()) {
|
||||
int maxSize = tis.getMaxStackSize();
|
||||
if (maxSize > d.getSlotStackLimit()) {
|
||||
maxSize = d.getSlotStackLimit();
|
||||
@@ -476,10 +441,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;
|
||||
|
||||
@@ -311,7 +311,7 @@ public final class ContainerInterfaceConfigurationTerminal extends AEBaseContain
|
||||
|
||||
if (!is.isEmpty()) {
|
||||
is.writeToNBT(itemNBT);
|
||||
if (is.getCount() > is.getMaxStackSize()) {
|
||||
if (is.getCount() > Byte.MAX_VALUE) {
|
||||
itemNBT.setInteger("stackSize", is.getCount());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,550 @@
|
||||
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;
|
||||
|
||||
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()) {
|
||||
i.writeToNBT(c);
|
||||
if (i.getCount() > Byte.MAX_VALUE) {
|
||||
c.setInteger("stackSize", i.getCount());
|
||||
}
|
||||
}
|
||||
|
||||
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,11 @@ import appeng.util.inv.AdaptorItemHandler;
|
||||
import appeng.util.inv.WrapperCursorItemHandler;
|
||||
import appeng.util.inv.WrapperInvItemHandler;
|
||||
import appeng.util.item.AEItemStack;
|
||||
import com.blamejared.recipestages.RecipeStages;
|
||||
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,8 +54,10 @@ 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.items.IItemHandler;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
@@ -90,6 +97,23 @@ 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")) {
|
||||
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 +168,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 +238,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);
|
||||
}
|
||||
}
|
||||
@@ -72,7 +72,7 @@ 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";
|
||||
|
||||
@Nonnull
|
||||
private static final AppEng INSTANCE = new AppEng();
|
||||
|
||||
@@ -197,9 +197,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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
@@ -115,7 +116,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));
|
||||
@@ -209,6 +210,9 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
|
||||
for (final ItemStack is : this.waitingToSend) {
|
||||
final NBTTagCompound item = new NBTTagCompound();
|
||||
is.writeToNBT(item);
|
||||
if (is.getCount() > Byte.MAX_VALUE) {
|
||||
item.setInteger("stackSize", is.getCount());
|
||||
}
|
||||
waitingToSend.appendTag(item);
|
||||
}
|
||||
}
|
||||
@@ -223,6 +227,9 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
|
||||
for (final ItemStack is : this.waitingToSendFacing.get(s)) {
|
||||
final NBTTagCompound item = new NBTTagCompound();
|
||||
is.writeToNBT(item);
|
||||
if (is.getCount() > Byte.MAX_VALUE) {
|
||||
item.setInteger("stackSize", is.getCount());
|
||||
}
|
||||
waitingListSided.appendTag(item);
|
||||
}
|
||||
sidedWaitList.setTag(s.name(), waitingListSided);
|
||||
@@ -240,6 +247,9 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
|
||||
final NBTTagCompound c = waitingList.getCompoundTagAt(x);
|
||||
if (c != null) {
|
||||
final ItemStack is = new ItemStack(c);
|
||||
if (c.hasKey("stackSize")) {
|
||||
is.setCount(c.getInteger("stackSize"));
|
||||
}
|
||||
this.addToSendList(is);
|
||||
}
|
||||
}
|
||||
@@ -255,6 +265,9 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
|
||||
final NBTTagCompound c = w.getCompoundTagAt(x);
|
||||
if (c != null) {
|
||||
final ItemStack is = new ItemStack(c);
|
||||
if (c.hasKey("stackSize")) {
|
||||
is.setCount(c.getInteger("stackSize"));
|
||||
}
|
||||
this.addToSendListFacing(is, EnumFacing.getFront(s.getIndex()));
|
||||
}
|
||||
}
|
||||
@@ -626,7 +639,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 +694,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 +723,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 +1121,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 +1303,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();
|
||||
|
||||
@@ -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]);
|
||||
|
||||
@@ -43,12 +43,12 @@ import java.util.*;
|
||||
|
||||
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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -37,12 +37,13 @@ import java.util.Iterator;
|
||||
|
||||
|
||||
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 +88,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 +101,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
|
||||
@@ -217,7 +164,7 @@ public class AppEngInternalInventory extends ItemStackHandler implements Iterabl
|
||||
if (!is.isEmpty()) {
|
||||
NBTTagCompound itemTag = new NBTTagCompound();
|
||||
itemTag.setInteger("Slot", i);
|
||||
if (is.getCount() > is.getMaxStackSize()) {
|
||||
if (is.getCount() > Byte.MAX_VALUE) {
|
||||
itemTag.setInteger("stackSize", stacks.get(i).getCount());
|
||||
}
|
||||
stacks.get(i).writeToNBT(itemTag);
|
||||
@@ -279,4 +226,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();
|
||||
}
|
||||
}
|
||||
@@ -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) {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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"}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
"animation": {
|
||||
"frametime": 3,
|
||||
"frames": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
@@ -12,8 +13,7 @@
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
0
|
||||
11
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 341 B After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 405 B After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 402 B After Width: | Height: | Size: 286 B |
|
Before Width: | Height: | Size: 401 B After Width: | Height: | Size: 300 B |
|
Before Width: | Height: | Size: 403 B After Width: | Height: | Size: 296 B |
|
Before Width: | Height: | Size: 405 B After Width: | Height: | Size: 296 B |
|
Before Width: | Height: | Size: 403 B After Width: | Height: | Size: 295 B |
|
Before Width: | Height: | Size: 404 B After Width: | Height: | Size: 295 B |
|
Before Width: | Height: | Size: 405 B After Width: | Height: | Size: 305 B |
|
Before Width: | Height: | Size: 404 B After Width: | Height: | Size: 305 B |
|
After Width: | Height: | Size: 121 B |
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"ctm": {
|
||||
"ctm_version": 1,
|
||||
"layer": "BLOOM",
|
||||
"gregtech": true,
|
||||
"extra": {
|
||||
"light": 15
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 382 B After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 350 B After Width: | Height: | Size: 250 B |
|
Before Width: | Height: | Size: 353 B After Width: | Height: | Size: 249 B |
|
Before Width: | Height: | Size: 351 B After Width: | Height: | Size: 267 B |
|
Before Width: | Height: | Size: 382 B After Width: | Height: | Size: 267 B |
|
Before Width: | Height: | Size: 381 B After Width: | Height: | Size: 266 B |
|
Before Width: | Height: | Size: 382 B After Width: | Height: | Size: 266 B |
|
Before Width: | Height: | Size: 385 B After Width: | Height: | Size: 267 B |
|
Before Width: | Height: | Size: 384 B After Width: | Height: | Size: 267 B |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |