Merge remote-tracking branch 'origin/master' into fabric-1.16

# Conflicts:
#	src/main/java/appeng/block/crafting/AbstractCraftingUnitBlock.java
#	src/main/java/appeng/block/qnb/QnbFormedBakedModel.java
#	src/main/java/appeng/client/gui/AEBaseScreen.java
#	src/main/java/appeng/client/gui/implementations/CraftAmountScreen.java
#	src/main/java/appeng/client/gui/implementations/LevelEmitterScreen.java
#	src/main/java/appeng/client/gui/implementations/PriorityScreen.java
#	src/main/java/appeng/client/gui/widgets/NumberBox.java
#	src/main/java/appeng/client/render/cablebus/P2PTunnelFrequencyModel.java
#	src/main/java/appeng/client/render/cablebus/SmartCableTextures.java
#	src/main/java/appeng/container/implementations/CraftingCPUContainer.java
#	src/main/java/appeng/container/implementations/LevelEmitterContainer.java
#	src/main/java/appeng/container/implementations/PriorityContainer.java
#	src/main/java/appeng/core/AEConfig.java
#	src/main/java/appeng/fluids/client/gui/FluidLevelEmitterScreen.java
#	src/main/java/appeng/fluids/container/FluidLevelEmitterContainer.java
#	src/main/java/appeng/me/cluster/MBCalculator.java
#	src/main/java/appeng/me/cluster/implementations/CraftingCPUCalculator.java
#	src/main/java/appeng/me/cluster/implementations/QuantumCalculator.java
#	src/main/java/appeng/me/cluster/implementations/QuantumCluster.java
#	src/main/java/appeng/me/cluster/implementations/SpatialPylonCalculator.java
#	src/main/java/appeng/tile/crafting/CraftingBlockEntity.java
#	src/main/java/appeng/tile/qnb/QuantumBridgeBlockEntity.java
#	src/main/java/appeng/tile/spatial/SpatialPylonBlockEntity.java
This commit is contained in:
Sebastian Hartte
2020-07-20 20:19:42 +02:00
555 changed files with 1144 additions and 2294 deletions
@@ -27,6 +27,7 @@ import javax.annotation.Nonnull;
import appeng.api.config.AccessRestriction; import appeng.api.config.AccessRestriction;
import appeng.api.config.Actionable; import appeng.api.config.Actionable;
import appeng.api.networking.IGrid;
/** /**
* Used to access information about AE's various power accepting blocks for * Used to access information about AE's various power accepting blocks for
@@ -78,6 +79,10 @@ public interface IAEPowerStorage extends IEnergySource {
* A higher value means it is more likely to be extracted from first, and less * A higher value means it is more likely to be extracted from first, and less
* likely to be inserted into first. * likely to be inserted into first.
* *
* The value needs to be constant once added to a {@link IGrid}. Should it ever
* need to be changed, it has to be removed from the grid, then update the
* value, and finally added back to the grid.
*
* This should never use {@link Integer#MIN_VALUE} or {@link Integer#MAX_VALUE}. * This should never use {@link Integer#MIN_VALUE} or {@link Integer#MAX_VALUE}.
* *
* @return the priority for this storage * @return the priority for this storage
@@ -23,10 +23,13 @@ import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.state.property.BooleanProperty; import net.minecraft.state.property.BooleanProperty;
import net.minecraft.state.StateManager; import net.minecraft.state.StateManager;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ActionResult; import net.minecraft.util.ActionResult;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.world.IWorld;
import net.minecraft.world.World; import net.minecraft.world.World;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseTileBlock;
@@ -54,6 +57,16 @@ public abstract class AbstractCraftingUnitBlock<T extends CraftingBlockEntity> e
builder.add(FORMED); builder.add(FORMED);
} }
@Override
public BlockState updatePostPlacement(BlockState stateIn, Direction facing, BlockState facingState, IWorld worldIn,
BlockPos currentPos, BlockPos facingPos) {
TileEntity te = worldIn.getTileEntity(currentPos);
if (te != null) {
te.requestModelDataUpdate();
}
return super.updatePostPlacement(stateIn, facing, facingState, worldIn, currentPos, facingPos);
}
@Override @Override
public void neighborUpdate(final BlockState state, final World worldIn, final BlockPos pos, final Block blockIn, public void neighborUpdate(final BlockState state, final World worldIn, final BlockPos pos, final Block blockIn,
final BlockPos fromPos, boolean isMoving) { final BlockPos fromPos, boolean isMoving) {
@@ -43,9 +43,9 @@ class QnbFormedBakedModel implements BakedModel, FabricBakedModel {
private static final SpriteIdentifier TEXTURE_RING_LIGHT_CORNER = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEX, private static final SpriteIdentifier TEXTURE_RING_LIGHT_CORNER = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
new Identifier(AppEng.MOD_ID, "block/quantum_ring_light_corner")); new Identifier(AppEng.MOD_ID, "block/quantum_ring_light_corner"));
private static final SpriteIdentifier TEXTURE_CABLE_GLASS = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEX, private static final SpriteIdentifier TEXTURE_CABLE_GLASS = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
new Identifier(AppEng.MOD_ID, "parts/cable/glass/transparent")); new Identifier(AppEng.MOD_ID, "part/cable/glass/transparent"));
private static final SpriteIdentifier TEXTURE_COVERED_CABLE = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEX, private static final SpriteIdentifier TEXTURE_COVERED_CABLE = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
new Identifier(AppEng.MOD_ID, "parts/cable/covered/transparent")); new Identifier(AppEng.MOD_ID, "part/cable/covered/transparent"));
private static final float DEFAULT_RENDER_MIN = 2.0f; private static final float DEFAULT_RENDER_MIN = 2.0f;
private static final float DEFAULT_RENDER_MAX = 14.0f; private static final float DEFAULT_RENDER_MAX = 14.0f;
@@ -58,6 +58,7 @@ import net.minecraft.text.Text;
import appeng.api.storage.data.IAEFluidStack; import appeng.api.storage.data.IAEFluidStack;
import appeng.api.storage.data.IAEItemStack; import appeng.api.storage.data.IAEItemStack;
import appeng.client.gui.widgets.CustomSlotWidget; import appeng.client.gui.widgets.CustomSlotWidget;
import appeng.client.gui.widgets.ITickingWidget;
import appeng.client.gui.widgets.ITooltip; import appeng.client.gui.widgets.ITooltip;
import appeng.client.gui.widgets.Scrollbar; import appeng.client.gui.widgets.Scrollbar;
import appeng.client.me.InternalSlotME; import appeng.client.me.InternalSlotME;
@@ -86,6 +87,8 @@ import appeng.fluids.container.slots.IMEFluidSlot;
import appeng.helpers.InventoryAction; import appeng.helpers.InventoryAction;
public abstract class AEBaseScreen<T extends AEBaseContainer> extends HandledScreen<T> { public abstract class AEBaseScreen<T extends AEBaseContainer> extends HandledScreen<T> {
public static final int COLOR_DARK_GRAY = 4210752;
private final List<InternalSlotME> meSlots = new ArrayList<>(); private final List<InternalSlotME> meSlots = new ArrayList<>();
// drag y // drag y
private final Set<Slot> drag_click = new HashSet<>(); private final Set<Slot> drag_click = new HashSet<>();
@@ -186,7 +189,7 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends HandledScr
} }
final Text msg = tooltip.getMessage(); final Text msg = tooltip.getMessage();
if (msg != null) { if (msg != null && !msg.isEmpty()) {
this.drawTooltip(matrices, x + 11, y + 4, msg); this.drawTooltip(matrices, x + 11, y + 4, msg);
} }
} }
@@ -780,4 +783,14 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends HandledScr
protected List<InternalSlotME> getMeSlots() { protected List<InternalSlotME> getMeSlots() {
return this.meSlots; return this.meSlots;
} }
public void tick() {
super.tick();
for (IGuiEventListener child : children) {
if (child instanceof ITickingWidget) {
((ITickingWidget) child).tick();
}
}
}
} }
@@ -0,0 +1,16 @@
package appeng.client.gui;
public enum NumberEntryType {
CRAFT_ITEM_COUNT(Long.class), PRIORITY(Long.class), LEVEL_ITEM_COUNT(Long.class), LEVEL_FLUID_VOLUME(Long.class);
private final Class<? extends Number> inputType;
NumberEntryType(Class<? extends Number> inputType) {
this.inputType = inputType;
}
public Class<? extends Number> getInputType() {
return inputType;
}
}
@@ -20,15 +20,15 @@ package appeng.client.gui.implementations;
import net.minecraft.client.gui.widget.ButtonWidget; import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.util.math.MatrixStack; import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.client.gui.widget.button.Button;
import net.minecraft.entity.player.PlayerInventory; import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.text.LiteralText; import net.minecraft.text.LiteralText;
import net.minecraft.text.Text; import net.minecraft.text.Text;
import appeng.client.gui.AEBaseScreen; import appeng.client.gui.AEBaseScreen;
import appeng.client.gui.widgets.NumberBox; import appeng.client.gui.NumberEntryType;
import appeng.container.implementations.CraftAmountContainer; import appeng.container.implementations.CraftAmountContainer;
import appeng.core.AEConfig;
import appeng.core.localization.GuiText; import appeng.core.localization.GuiText;
import appeng.core.sync.network.NetworkHandler; import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.CraftRequestPacket; import appeng.core.sync.packets.CraftRequestPacket;
@@ -36,7 +36,7 @@ import appeng.core.sync.packets.CraftRequestPacket;
public class CraftAmountScreen extends AEBaseScreen<CraftAmountContainer> { public class CraftAmountScreen extends AEBaseScreen<CraftAmountContainer> {
private final AESubScreen subGui; private final AESubScreen subGui;
private NumberBox amountToCraft; private NumberEntryWidget amountToCraft;
private ButtonWidget next; private ButtonWidget next;
@@ -49,39 +49,22 @@ public class CraftAmountScreen extends AEBaseScreen<CraftAmountContainer> {
public void init() { public void init() {
super.init(); super.init();
final int a = AEConfig.instance().craftItemsByStackAmounts(0); this.amountToCraft = new NumberEntryWidget(this, 20, 30, 138, 62, NumberEntryType.CRAFT_ITEM_COUNT, value -> {
final int b = AEConfig.instance().craftItemsByStackAmounts(1); });
final int c = AEConfig.instance().craftItemsByStackAmounts(2); this.amountToCraft.setValue(1);
final int d = AEConfig.instance().craftItemsByStackAmounts(3); this.amountToCraft.setTextFieldBounds(62, 57, 50);
this.amountToCraft.setMinValue(1);
this.addButton(new ButtonWidget(this.x + 20, this.y + 26, 22, 20, new LiteralText("+" + a), btn -> addQty(a))); this.amountToCraft.addButtons(children::add, this::addButton);
this.addButton(new ButtonWidget(this.x + 48, this.y + 26, 28, 20, new LiteralText("+" + b), btn -> addQty(b)));
this.addButton(new ButtonWidget(this.x + 82, this.y + 26, 32, 20, new LiteralText("+" + c), btn -> addQty(c)));
this.addButton(new ButtonWidget(this.x + 120, this.y + 26, 38, 20, new LiteralText("+" + d), btn -> addQty(d)));
this.addButton(new ButtonWidget(this.x + 20, this.y + 75, 22, 20, new LiteralText("-" + a), btn -> addQty(-a)));
this.addButton(new ButtonWidget(this.x + 48, this.y + 75, 28, 20, new LiteralText("-" + b), btn -> addQty(-b)));
this.addButton(new ButtonWidget(this.x + 82, this.y + 75, 32, 20, new LiteralText("-" + c), btn -> addQty(-c)));
this.addButton(new ButtonWidget(this.x + 120, this.y + 75, 38, 20, new LiteralText("-" + d), btn -> addQty(-d)));
this.next = this.addButton( this.next = this.addButton(
new ButtonWidget(this.x + 128, this.y + 51, 38, 20, GuiText.Next.text(), this::confirm)); new ButtonWidget(this.x + 128, this.y + 51, 38, 20, GuiText.Next.text(), this::confirm));
subGui.addBackButton(this::addButton, 154, 0); subGui.addBackButton(this::addButton, 154, 0);
this.amountToCraft = new NumberBox(this.textRenderer, this.x + 62, this.y + 57, 59, this.textRenderer.fontHeight,
Integer.class);
this.amountToCraft.setHasBorder(false);
this.amountToCraft.setMaxLength(16);
this.amountToCraft.setEditableColor(0xFFFFFF);
this.amountToCraft.setVisible(true);
this.amountToCraft.setFocused(true);
this.amountToCraft.setText("1");
} }
private void confirm(ButtonWidget button) { private void confirm(ButtonWidget button) {
NetworkHandler.instance() NetworkHandler.instance()
.sendToServer(new CraftRequestPacket(Integer.parseInt(this.amountToCraft.getText()), hasShiftDown())); .sendToServer(new CraftRequestPacket((int) this.amountToCraft.getValue(), hasShiftDown()));
} }
@Override @Override
@@ -96,99 +79,23 @@ public class CraftAmountScreen extends AEBaseScreen<CraftAmountContainer> {
this.bindTexture("guis/craft_amt.png"); this.bindTexture("guis/craft_amt.png");
drawTexture(matrices, offsetX, offsetY, 0, 0, this.backgroundWidth, this.backgroundHeight); drawTexture(matrices, offsetX, offsetY, 0, 0, this.backgroundWidth, this.backgroundHeight);
try { this.next.active = this.amountToCraft.getValue() > 0;
Long.parseLong(this.amountToCraft.getText());
this.next.active = !this.amountToCraft.getText().isEmpty();
} catch (final NumberFormatException e) {
this.next.active = false;
}
this.amountToCraft.render(matrices, offsetX, offsetY, partialTicks); this.amountToCraft.render(matrices, offsetX, offsetY, partialTicks);
} }
@Override
public boolean charTyped(char ch, int p_charTyped_2_) {
// Forward entered text to the craft amount text-field
return this.amountToCraft.charTyped(ch, p_charTyped_2_);
}
@Override @Override
public boolean keyPressed(int keyCode, int scanCode, int p_keyPressed_3_) { public boolean keyPressed(int keyCode, int scanCode, int p_keyPressed_3_) {
if (!this.checkHotbarKeys(keyCode, scanCode)) { if (keyCode == 28) {
if (keyCode == 28) { this.next.onPress();
this.next.onPress(); return true;
} } else {
if ((keyCode == 211 || keyCode == 205 || keyCode == 203 || keyCode == 14) return super.keyPressed(keyCode, scanCode, p_keyPressed_3_);
&& this.amountToCraft.keyPressed(keyCode, scanCode, p_keyPressed_3_)) {
try {
String out = this.amountToCraft.getText();
boolean fixed = false;
while (out.startsWith("0") && out.length() > 1) {
out = out.substring(1);
fixed = true;
}
if (fixed) {
this.amountToCraft.setText(out);
}
if (out.isEmpty()) {
out = "0";
}
final long result = Long.parseLong(out);
if (result < 0) {
this.amountToCraft.setText("1");
}
} catch (final NumberFormatException e) {
// :P
}
return true;
}
}
return super.keyPressed(keyCode, scanCode, p_keyPressed_3_);
}
private void addQty(final int i) {
try {
String out = this.amountToCraft.getText();
boolean fixed = false;
while (out.startsWith("0") && out.length() > 1) {
out = out.substring(1);
fixed = true;
}
if (fixed) {
this.amountToCraft.setText(out);
}
if (out.isEmpty()) {
out = "0";
}
long result = Integer.parseInt(out);
if (result == 1 && i > 1) {
result = 0;
}
result += i;
if (result < 1) {
result = 1;
}
out = Long.toString(result);
Integer.parseInt(out);
this.amountToCraft.setText(out);
} catch (final NumberFormatException e) {
// :P
} }
} }
protected String getBackground() { protected String getBackground() {
return "guis/craftAmt.png"; return "guis/craftAmt.png";
} }
} }
@@ -26,32 +26,22 @@ import net.minecraft.text.Text;
import appeng.api.config.FuzzyMode; import appeng.api.config.FuzzyMode;
import appeng.api.config.LevelType; import appeng.api.config.LevelType;
import appeng.api.config.PowerUnits;
import appeng.api.config.RedstoneMode; import appeng.api.config.RedstoneMode;
import appeng.api.config.Settings; import appeng.api.config.Settings;
import appeng.api.config.Upgrades; import appeng.api.config.Upgrades;
import appeng.api.config.YesNo; import appeng.api.config.YesNo;
import appeng.client.gui.widgets.NumberBox; import appeng.client.gui.NumberEntryType;
import appeng.client.gui.widgets.ServerSettingToggleButton; import appeng.client.gui.widgets.ServerSettingToggleButton;
import appeng.client.gui.widgets.SettingToggleButton; import appeng.client.gui.widgets.SettingToggleButton;
import appeng.container.implementations.LevelEmitterContainer; import appeng.container.implementations.LevelEmitterContainer;
import appeng.core.AEConfig;
import appeng.core.localization.GuiText; import appeng.core.localization.GuiText;
import appeng.core.sync.network.NetworkHandler; import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.ConfigValuePacket; import appeng.core.sync.packets.ConfigValuePacket;
public class LevelEmitterScreen extends UpgradeableScreen<LevelEmitterContainer> { public class LevelEmitterScreen extends UpgradeableScreen<LevelEmitterContainer> {
private NumberBox level; private NumberEntryWidget level;
private ButtonWidget plus1;
private ButtonWidget plus10;
private ButtonWidget plus100;
private ButtonWidget plus1000;
private ButtonWidget minus1;
private ButtonWidget minus10;
private ButtonWidget minus100;
private ButtonWidget minus1000;
private SettingToggleButton<LevelType> levelMode; private SettingToggleButton<LevelType> levelMode;
private SettingToggleButton<YesNo> craftingMode; private SettingToggleButton<YesNo> craftingMode;
@@ -63,14 +53,15 @@ public class LevelEmitterScreen extends UpgradeableScreen<LevelEmitterContainer>
public void init() { public void init() {
super.init(); super.init();
this.level = new NumberBox(this.textRenderer, this.x + 24, this.y + 43, 79, this.textRenderer.fontHeight, this.level = new NumberEntryWidget(this, 20, 17, 138, 62, NumberEntryType.LEVEL_ITEM_COUNT,
Long.class); this::onLevelChange);
this.level.setHasBorder(false); this.level.setTextFieldBounds(25, 44, 75);
this.level.setMaxLength(16); this.level.addButtons(children::add, this::addButton);
this.level.setEditableColor(0xFFFFFF); container.setTextField(this.level);
this.level.setVisible(true); }
this.level.setFocused(true);
handler.setTextField(this.level); private void onLevelChange(long level) {
NetworkHandler.instance().sendToServer(new ConfigValuePacket("LevelEmitter.Value", String.valueOf(level)));
} }
@Override @Override
@@ -83,29 +74,6 @@ public class LevelEmitterScreen extends UpgradeableScreen<LevelEmitterContainer>
FuzzyMode.IGNORE_ALL); FuzzyMode.IGNORE_ALL);
this.craftingMode = new ServerSettingToggleButton<>(this.x - 18, this.y + 48, this.craftingMode = new ServerSettingToggleButton<>(this.x - 18, this.y + 48,
Settings.CRAFT_VIA_REDSTONE, YesNo.NO); Settings.CRAFT_VIA_REDSTONE, YesNo.NO);
final int a = AEConfig.instance().levelByStackAmounts(0);
final int b = AEConfig.instance().levelByStackAmounts(1);
final int c = AEConfig.instance().levelByStackAmounts(2);
final int d = AEConfig.instance().levelByStackAmounts(3);
this.addButton(this.plus1 = new ButtonWidget(this.x + 20, this.y + 17, 22, 20, new LiteralText("+" + a), btn -> addQty(a)));
this.addButton(
this.plus10 = new ButtonWidget(this.x + 48, this.y + 17, 28, 20, new LiteralText("+" + b), btn -> addQty(b)));
this.addButton(
this.plus100 = new ButtonWidget(this.x + 82, this.y + 17, 32, 20, new LiteralText("+" + c), btn -> addQty(c)));
this.addButton(
this.plus1000 = new ButtonWidget(this.x + 120, this.y + 17, 38, 20, new LiteralText("+" + d), btn -> addQty(d)));
this.addButton(
this.minus1 = new ButtonWidget(this.x + 20, this.y + 59, 22, 20, new LiteralText("-" + a), btn -> addQty(-a)));
this.addButton(
this.minus10 = new ButtonWidget(this.x + 48, this.y + 59, 28, 20, new LiteralText("-" + b), btn -> addQty(-b)));
this.addButton(
this.minus100 = new ButtonWidget(this.x + 82, this.y + 59, 32, 20, new LiteralText("-" + c), btn -> addQty(-c)));
this.addButton(
this.minus1000 = new ButtonWidget(this.x + 120, this.y + 59, 38, 20, new LiteralText("-" + d), btn -> addQty(-d)));
this.addButton(this.levelMode); this.addButton(this.levelMode);
this.addButton(this.redstoneMode); this.addButton(this.redstoneMode);
this.addButton(this.craftingMode); this.addButton(this.craftingMode);
@@ -116,15 +84,7 @@ public class LevelEmitterScreen extends UpgradeableScreen<LevelEmitterContainer>
final boolean notCraftingMode = this.bc.getInstalledUpgrades(Upgrades.CRAFTING) == 0; final boolean notCraftingMode = this.bc.getInstalledUpgrades(Upgrades.CRAFTING) == 0;
// configure enabled status... // configure enabled status...
this.level.active = notCraftingMode; this.level.setActive(notCraftingMode);
this.plus1.active = notCraftingMode;
this.plus10.active = notCraftingMode;
this.plus100.active = notCraftingMode;
this.plus1000.active = notCraftingMode;
this.minus1.active = notCraftingMode;
this.minus10.active = notCraftingMode;
this.minus100.active = notCraftingMode;
this.minus1000.active = notCraftingMode;
this.levelMode.active = notCraftingMode; this.levelMode.active = notCraftingMode;
this.redstoneMode.active = notCraftingMode; this.redstoneMode.active = notCraftingMode;
@@ -135,7 +95,14 @@ public class LevelEmitterScreen extends UpgradeableScreen<LevelEmitterContainer>
} }
if (this.levelMode != null) { if (this.levelMode != null) {
this.levelMode.set(((LevelEmitterContainer) this.cvb).getLevelMode()); LevelType currentLevelMode = ((LevelEmitterContainer) this.cvb).getLevelMode();
this.levelMode.set(currentLevelMode);
if (notCraftingMode) {
if (currentLevelMode == LevelType.ENERGY_LEVEL) {
this.font.drawString(PowerUnits.AE.textComponent().getString(), 110, 44, COLOR_DARK_GRAY);
}
}
} }
} }
@@ -161,70 +128,4 @@ public class LevelEmitterScreen extends UpgradeableScreen<LevelEmitterContainer>
return GuiText.LevelEmitter; return GuiText.LevelEmitter;
} }
private void addQty(final long i) {
try {
String Out = this.level.getText();
boolean Fixed = false;
while (Out.startsWith("0") && Out.length() > 1) {
Out = Out.substring(1);
Fixed = true;
}
if (Fixed) {
this.level.setText(Out);
}
if (Out.isEmpty()) {
Out = "0";
}
long result = Long.parseLong(Out);
result += i;
if (result < 0) {
result = 0;
}
this.level.setText(Out = Long.toString(result));
NetworkHandler.instance().sendToServer(new ConfigValuePacket("LevelEmitter.Value", Out));
} catch (final NumberFormatException e) {
// nope..
this.level.setText("0");
}
}
@Override
public boolean charTyped(char character, int key) {
// Forward entered characters to the number-text-field
return level.charTyped(character, key);
}
@Override
public boolean keyPressed(int keyCode, int scanCode, int p_keyPressed_3_) {
if (!this.checkHotbarKeys(keyCode, scanCode)) {
if (keyCode == 211 || keyCode == 205 || keyCode == 203 || keyCode == 14) {
String Out = this.level.getText();
boolean Fixed = false;
while (Out.startsWith("0") && Out.length() > 1) {
Out = Out.substring(1);
Fixed = true;
}
if (Fixed) {
this.level.setText(Out);
}
if (Out.isEmpty()) {
Out = "0";
}
NetworkHandler.instance().sendToServer(new ConfigValuePacket("LevelEmitter.Value", Out));
return true;
}
}
return super.keyPressed(keyCode, scanCode, p_keyPressed_3_);
}
} }
@@ -0,0 +1,130 @@
package appeng.client.gui.implementations;
import java.util.function.Consumer;
import java.util.function.LongConsumer;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.IGuiEventListener;
import net.minecraft.client.gui.widget.button.Button;
import appeng.client.gui.AEBaseScreen;
import appeng.client.gui.NumberEntryType;
import appeng.client.gui.widgets.ITickingWidget;
import appeng.client.gui.widgets.NumberBox;
import appeng.core.AEConfig;
/**
* A utility widget that consists of a text-field to enter a number with
* attached buttons to increment/decrement the number in fixed intervals.
*/
public class NumberEntryWidget implements ITickingWidget {
private final AEBaseScreen<?> parent;
private final int x;
private final int y;
private final NumberBox level;
private final NumberEntryType type;
private Button plus1;
private Button plus10;
private Button plus100;
private Button plus1000;
private Button minus1;
private Button minus10;
private Button minus100;
private Button minus1000;
public NumberEntryWidget(AEBaseScreen<?> parent, int x, int y, int width, int height, NumberEntryType type,
LongConsumer changeListener) {
this.parent = parent;
this.x = x;
this.y = y;
this.type = type;
FontRenderer font = parent.getMinecraft().fontRenderer;
int inputX = parent.getGuiLeft() + x;
int inputY = parent.getGuiTop() + y;
this.level = new NumberBox(font, inputX, inputY, width, font.FONT_HEIGHT, type.getInputType(), changeListener);
this.level.setEnableBackgroundDrawing(false);
this.level.setMaxStringLength(16);
this.level.setTextColor(0xFFFFFF);
this.level.setVisible(true);
this.level.setFocused2(true);
parent.setFocusedDefault(this.level);
}
public void setActive(boolean active) {
this.level.setEnabled(active);
this.plus1.active = active;
this.plus10.active = active;
this.plus100.active = active;
this.plus1000.active = active;
this.minus1.active = active;
this.minus10.active = active;
this.minus100.active = active;
this.minus1000.active = active;
}
public void setTextFieldBounds(int x, int y, int width) {
this.level.x = parent.getGuiLeft() + x;
this.level.y = parent.getGuiTop() + y;
this.level.setWidth(width);
}
public void setMinValue(long minValue) {
this.level.setMinValue(minValue);
}
public void addButtons(Consumer<IGuiEventListener> addChildren, Consumer<Button> addButton) {
final int[] steps = AEConfig.instance().getNumberEntrySteps(type);
int a = steps[0];
int b = steps[1];
int c = steps[2];
int d = steps[3];
int left = parent.getGuiLeft() + x;
int top = parent.getGuiTop() + y;
addButton.accept(this.plus1 = new Button(left, top, 22, 20, "+" + a, btn -> addQty(a)));
addButton.accept(this.plus10 = new Button(left + 28, top, 28, 20, "+" + b, btn -> addQty(b)));
addButton.accept(this.plus100 = new Button(left + 62, top, 32, 20, "+" + c, btn -> addQty(c)));
addButton.accept(this.plus1000 = new Button(left + 100, top, 38, 20, "+" + d, btn -> addQty(d)));
// Placing this here will give a sensible tab order
addChildren.accept(this.level);
addButton.accept(this.minus1 = new Button(left, top + 42, 22, 20, "-" + a, btn -> addQty(-a)));
addButton.accept(this.minus10 = new Button(left + 28, top + 42, 28, 20, "-" + b, btn -> addQty(-b)));
addButton.accept(this.minus100 = new Button(left + 62, top + 42, 32, 20, "-" + c, btn -> addQty(-c)));
addButton.accept(this.minus1000 = new Button(left + 100, top + 42, 38, 20, "-" + d, btn -> addQty(-d)));
}
private void addQty(final long i) {
long currentValue = this.level.getValue();
long minValue = this.level.getMinValue();
this.level.setText(String.valueOf(Math.max(minValue, currentValue + i)));
}
public void render(int mouseX, int mouseY, float partialTicks) {
this.level.render(mouseX, mouseY, partialTicks);
}
public void setValue(long value, boolean skipNotify) {
this.level.setValue(value, skipNotify);
}
public void setValue(long value) {
setValue(value, false);
}
public long getValue() {
return level.getValue();
}
@Override
public void tick() {
this.level.tick();
}
}
@@ -25,9 +25,8 @@ import net.minecraft.text.LiteralText;
import net.minecraft.text.Text; import net.minecraft.text.Text;
import appeng.client.gui.AEBaseScreen; import appeng.client.gui.AEBaseScreen;
import appeng.client.gui.widgets.NumberBox; import appeng.client.gui.NumberEntryType;
import appeng.container.implementations.PriorityContainer; import appeng.container.implementations.PriorityContainer;
import appeng.core.AEConfig;
import appeng.core.localization.GuiText; import appeng.core.localization.GuiText;
import appeng.core.sync.network.NetworkHandler; import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.ConfigValuePacket; import appeng.core.sync.packets.ConfigValuePacket;
@@ -36,7 +35,7 @@ public class PriorityScreen extends AEBaseScreen<PriorityContainer> {
private final AESubScreen subGui; private final AESubScreen subGui;
private NumberBox priority; private NumberEntryWidget priority;
public PriorityScreen(PriorityContainer container, PlayerInventory playerInventory, Text title) { public PriorityScreen(PriorityContainer container, PlayerInventory playerInventory, Text title) {
super(container, playerInventory, title); super(container, playerInventory, title);
@@ -47,31 +46,18 @@ public class PriorityScreen extends AEBaseScreen<PriorityContainer> {
public void init() { public void init() {
super.init(); super.init();
final int a = AEConfig.instance().priorityByStacksAmounts(0); this.priority = new NumberEntryWidget(this, 20, 30, 138, 62, NumberEntryType.PRIORITY, this::onPriorityChange);
final int b = AEConfig.instance().priorityByStacksAmounts(1); this.priority.setTextFieldBounds(62, 57, 50);
final int c = AEConfig.instance().priorityByStacksAmounts(2); this.priority.setMinValue(Integer.MIN_VALUE);
final int d = AEConfig.instance().priorityByStacksAmounts(3); container.setTextField(this.priority);
this.priority.addButtons(children::add, this::addButton);
this.addButton(new ButtonWidget(this.x + 20, this.y + 32, 22, 20, new LiteralText("+" + a), btn -> addQty(a)));
this.addButton(new ButtonWidget(this.x + 48, this.y + 32, 28, 20, new LiteralText("+" + b), btn -> addQty(b)));
this.addButton(new ButtonWidget(this.x + 82, this.y + 32, 32, 20, new LiteralText("+" + c), btn -> addQty(c)));
this.addButton(new ButtonWidget(this.x + 120, this.y + 32, 38, 20, new LiteralText("+" + d), btn -> addQty(d)));
this.addButton(new ButtonWidget(this.x + 20, this.y + 69, 22, 20, new LiteralText("-" + a), btn -> addQty(-a)));
this.addButton(new ButtonWidget(this.x + 48, this.y + 69, 28, 20, new LiteralText("-" + b), btn -> addQty(-b)));
this.addButton(new ButtonWidget(this.x + 82, this.y + 69, 32, 20, new LiteralText("-" + c), btn -> addQty(-c)));
this.addButton(new ButtonWidget(this.x + 120, this.y + 69, 38, 20, new LiteralText("-" + d), btn -> addQty(-d)));
this.subGui.addBackButton(this::addButton, 154, 0); this.subGui.addBackButton(this::addButton, 154, 0);
}
this.priority = new NumberBox(this.textRenderer, this.x + 62, this.y + 57, 59, this.textRenderer.fontHeight, private void onPriorityChange(long priority) {
Long.class); NetworkHandler.instance()
this.priority.setHasBorder(false); .sendToServer(new ConfigValuePacket("PriorityHost.Priority", String.valueOf(priority)));
this.priority.setMaxLength(16);
this.priority.setEditableColor(0xFFFFFF);
this.priority.setVisible(true);
this.priority.setFocused(true);
handler.setTextField(this.priority);
} }
@Override @Override
@@ -87,90 +73,6 @@ public class PriorityScreen extends AEBaseScreen<PriorityContainer> {
this.priority.render(matrices, mouseX, mouseY, partialTicks); this.priority.render(matrices, mouseX, mouseY, partialTicks);
} }
private void addQty(final int i) {
try {
String out = this.priority.getText();
boolean fixed = false;
while (out.startsWith("0") && out.length() > 1) {
out = out.substring(1);
fixed = true;
}
if (fixed) {
this.priority.setText(out);
}
if (out.isEmpty()) {
out = "0";
}
long result = Long.parseLong(out);
result += i;
this.priority.setText(out = Long.toString(result));
NetworkHandler.instance().sendToServer(new ConfigValuePacket("PriorityHost.Priority", out));
} catch (final NumberFormatException e) {
// nope..
this.priority.setText("0");
}
}
@Override
public boolean charTyped(char character, int key) {
if (priority.charTyped(character, key)) {
String out = this.priority.getText();
boolean fixed = false;
while (out.startsWith("0") && out.length() > 1) {
out = out.substring(1);
fixed = true;
}
if (fixed) {
this.priority.setText(out);
}
if (out.isEmpty()) {
out = "0";
}
NetworkHandler.instance().sendToServer(new ConfigValuePacket("PriorityHost.Priority", out));
return true;
}
return false;
}
@Override
public boolean keyPressed(int keyCode, int scanCode, int p_keyPressed_3_) {
if (!this.checkHotbarKeys(keyCode, scanCode)) {
if ((keyCode == 211 || keyCode == 205 || keyCode == 203 || keyCode == 14)
&& this.priority.keyPressed(keyCode, scanCode, p_keyPressed_3_)) {
String out = this.priority.getText();
boolean fixed = false;
while (out.startsWith("0") && out.length() > 1) {
out = out.substring(1);
fixed = true;
}
if (fixed) {
this.priority.setText(out);
}
if (out.isEmpty()) {
out = "0";
}
NetworkHandler.instance().sendToServer(new ConfigValuePacket("PriorityHost.Priority", out));
return true;
}
}
return super.keyPressed(keyCode, scanCode, p_keyPressed_3_);
}
protected String getBackground() { protected String getBackground() {
return "guis/priority.png"; return "guis/priority.png";
} }
@@ -0,0 +1,13 @@
package appeng.client.gui.widgets;
import net.minecraft.client.gui.screen.Screen;
/**
* Indicates that a widget (anything that is in the {@link Screen#children()}
* list) should receive callbacks every tick.
*/
public interface ITickingWidget {
void tick();
}
@@ -18,42 +18,132 @@
package appeng.client.gui.widgets; package appeng.client.gui.widgets;
import java.util.function.LongConsumer;
import net.minecraft.client.font.TextRenderer; import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.widget.TextFieldWidget; import net.minecraft.client.gui.widget.TextFieldWidget;
import net.minecraft.text.LiteralText; import net.minecraft.text.LiteralText;
// FIXME: Fix this piece of crap (i.e. onChange listener)
public class NumberBox extends TextFieldWidget { public class NumberBox extends TextFieldWidget {
private final Class<?> type; private final LongConsumer changeListener;
private long lastValue;
private long minValue = 0;
private long maxValue;
public NumberBox(final TextRenderer fontRenderer, final int x, final int y, final int width, final int height, public NumberBox(final TextRenderer fontRenderer, final int x, final int y, final int width, final int height,
final Class<?> type) { final Class<?> type, LongConsumer changeListener) {
super(fontRenderer, x, y, width, height, new LiteralText("0")); super(fontRenderer, x, y, width, height, new LiteralText("0"));
this.type = type; this.setText("0");
} setResponder(this::onTextChanged);
this.lastValue = 0;
@Override this.changeListener = changeListener;
public void write(final String selectedText) { if (type == int.class || type == Integer.class) {
final String original = this.getText(); maxValue = Integer.MAX_VALUE;
super.write(selectedText); } else {
maxValue = Long.MAX_VALUE;
try {
if (this.type == int.class || this.type == Integer.class) {
Integer.parseInt(this.getText());
} else if (this.type == long.class || this.type == Long.class) {
Long.parseLong(this.getText());
} else if (this.type == double.class || this.type == Double.class) {
Double.parseDouble(this.getText());
}
} catch (final NumberFormatException e) {
this.setText(original);
} }
} }
private void onTextChanged(String text) {
if (text.isEmpty()) {
setText("0"); // Will call onTextChanged recursively
return;
}
boolean canBeNegative = canBeNegative();
if (canBeNegative && text.equals("-")) {
// Allow this as a special case to make typing in a negative number easier
return;
}
StringBuilder sanitized = new StringBuilder(text);
boolean encounteredNonZero = false;
for (int i = 0; i < sanitized.length(); i++) {
char ch = sanitized.charAt(i);
if (canBeNegative && i == 0 && ch == '-') {
continue; // Allow leading minus sign
}
if (ch >= '1' && ch <= '9') {
encounteredNonZero = true;
continue;
}
if (ch != '0' || !encounteredNonZero) {
sanitized.deleteCharAt(i--);
}
}
if (sanitized.length() == 0) {
sanitized.append('0');
}
String sanitizedStr = sanitized.toString();
if (!sanitizedStr.equals(text)) {
setText(sanitizedStr); // Will call onTextChanged recursively
return;
}
if (getValue() < minValue) {
setText(String.valueOf(minValue)); // Will call onTextChanged recursively
return;
}
if (getValue() > maxValue) {
setText(String.valueOf(maxValue)); // Will call onTextChanged recursively
return;
}
reportChange();
}
private void reportChange() {
long value = getValue();
if (value != lastValue) {
lastValue = value;
changeListener.accept(value);
}
}
public void setValue(long value, boolean skipNotify) {
// This check avoid changing the cursor position needlessly
if (value == this.getValue()) {
return;
}
if (skipNotify) {
lastValue = value;
}
setText(String.valueOf(value));
}
public long getValue() {
if (getText().equals("-") && canBeNegative()) {
return lastValue; // Allow this as a special case to type in a negative number more easily
}
return Long.parseLong(getText());
}
@Override @Override
public void setFocused(boolean focused) { public boolean keyPressed(int p_keyPressed_1_, int p_keyPressed_2_, int p_keyPressed_3_) {
super.setFocused(focused); if (super.keyPressed(p_keyPressed_1_, p_keyPressed_2_, p_keyPressed_3_)) {
return true;
}
// Swallow key presses for numbers because they would otherwise trigger the
// hotbar swapping unintentionally
return isFocused() && p_keyPressed_1_ >= '0' && p_keyPressed_1_ <= '9';
}
public void setMinValue(long minValue) {
this.minValue = minValue;
}
public long getMinValue() {
return minValue;
}
private boolean canBeNegative() {
return minValue < 0;
} }
} }
@@ -315,7 +315,7 @@ public class SettingToggleButton<T extends Enum<T>> extends IconButton {
return new LiteralText(name + '\n' + sb); return new LiteralText(name + '\n' + sb);
} }
return null; return "";
} }
public String getFillVar() { public String getFillVar() {
@@ -93,7 +93,7 @@ public class ToggleButton extends ButtonWidget implements ITooltip {
return new LiteralText(name + '\n' + sb); return new LiteralText(name + '\n' + sb);
} }
return null; return "";
} }
@Override @Override
@@ -85,19 +85,19 @@ class CableBuilder {
String textureFolder; String textureFolder;
switch (cableType) { switch (cableType) {
case GLASS: case GLASS:
textureFolder = "parts/cable/glass/"; textureFolder = "part/cable/glass/";
break; break;
case COVERED: case COVERED:
textureFolder = "parts/cable/covered/"; textureFolder = "part/cable/covered/";
break; break;
case SMART: case SMART:
textureFolder = "parts/cable/smart/"; textureFolder = "part/cable/smart/";
break; break;
case DENSE_COVERED: case DENSE_COVERED:
textureFolder = "parts/cable/dense_covered/"; textureFolder = "part/cable/dense_covered/";
break; break;
case DENSE_SMART: case DENSE_SMART:
textureFolder = "parts/cable/dense_smart/"; textureFolder = "part/cable/dense_smart/";
break; break;
default: default:
throw new IllegalStateException("Cable type " + cableType + " does not support connections."); throw new IllegalStateException("Cable type " + cableType + " does not support connections.");
@@ -37,7 +37,7 @@ import appeng.core.AppEng;
* Covered (also used by the Smart Cable) - Dense * Covered (also used by the Smart Cable) - Dense
*/ */
public enum CableCoreType { public enum CableCoreType {
GLASS("parts/cable/core/glass"), COVERED("parts/cable/core/covered"), DENSE("parts/cable/core/dense_smart"); GLASS("part/cable/core/glass"), COVERED("part/cable/core/covered"), DENSE("part/cable/core/dense_smart");
private static final Map<AECableType, CableCoreType> cableMapping = generateCableMapping(); private static final Map<AECableType, CableCoreType> cableMapping = generateCableMapping();
@@ -37,16 +37,16 @@ import appeng.core.AppEng;
public class SmartCableTextures { public class SmartCableTextures {
public static final SpriteIdentifier[] SMART_CHANNELS_TEXTURES = Arrays public static final SpriteIdentifier[] SMART_CHANNELS_TEXTURES = Arrays
.stream(new Identifier[] { new Identifier(AppEng.MOD_ID, "parts/cable/smart/channels_00"), // .stream(new Identifier[] { new Identifier(AppEng.MOD_ID, "part/cable/smart/channels_00"), //
new Identifier(AppEng.MOD_ID, "parts/cable/smart/channels_01"), // new Identifier(AppEng.MOD_ID, "part/cable/smart/channels_01"), //
new Identifier(AppEng.MOD_ID, "parts/cable/smart/channels_02"), // new Identifier(AppEng.MOD_ID, "part/cable/smart/channels_02"), //
new Identifier(AppEng.MOD_ID, "parts/cable/smart/channels_03"), // new Identifier(AppEng.MOD_ID, "part/cable/smart/channels_03"), //
new Identifier(AppEng.MOD_ID, "parts/cable/smart/channels_04"), // new Identifier(AppEng.MOD_ID, "part/cable/smart/channels_04"), //
new Identifier(AppEng.MOD_ID, "parts/cable/smart/channels_10"), // new Identifier(AppEng.MOD_ID, "part/cable/smart/channels_10"), //
new Identifier(AppEng.MOD_ID, "parts/cable/smart/channels_11"), // new Identifier(AppEng.MOD_ID, "part/cable/smart/channels_11"), //
new Identifier(AppEng.MOD_ID, "parts/cable/smart/channels_12"), // new Identifier(AppEng.MOD_ID, "part/cable/smart/channels_12"), //
new Identifier(AppEng.MOD_ID, "parts/cable/smart/channels_13"), // new Identifier(AppEng.MOD_ID, "part/cable/smart/channels_13"), //
new Identifier(AppEng.MOD_ID, "parts/cable/smart/channels_14")// new Identifier(AppEng.MOD_ID, "part/cable/smart/channels_14")//
}).map(e -> new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEX, e)).toArray(SpriteIdentifier[]::new); }).map(e -> new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEX, e)).toArray(SpriteIdentifier[]::new);
// Textures used to display channels on smart cables. There's two sets of 5 // Textures used to display channels on smart cables. There's two sets of 5
@@ -47,7 +47,6 @@ import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.ConfigValuePacket; import appeng.core.sync.packets.ConfigValuePacket;
import appeng.core.sync.packets.MEInventoryUpdatePacket; import appeng.core.sync.packets.MEInventoryUpdatePacket;
import appeng.helpers.ICustomNameObject; import appeng.helpers.ICustomNameObject;
import appeng.me.cluster.IAEMultiBlock;
import appeng.me.cluster.implementations.CraftingCPUCluster; import appeng.me.cluster.implementations.CraftingCPUCluster;
import appeng.tile.crafting.CraftingBlockEntity; import appeng.tile.crafting.CraftingBlockEntity;
import appeng.util.Platform; import appeng.util.Platform;
@@ -82,7 +81,7 @@ public class CraftingCPUContainer extends AEBaseContainer
} }
if (te instanceof CraftingBlockEntity) { if (te instanceof CraftingBlockEntity) {
this.setCPU((ICraftingCPU) ((IAEMultiBlock) te).getCluster()); this.setCPU(((CraftingTileEntity) te).getCluster());
} }
if (this.getNetwork() == null && Platform.isServer()) { if (this.getNetwork() == null && Platform.isServer()) {
@@ -33,6 +33,7 @@ import appeng.api.config.RedstoneMode;
import appeng.api.config.SecurityPermissions; import appeng.api.config.SecurityPermissions;
import appeng.api.config.Settings; import appeng.api.config.Settings;
import appeng.api.config.YesNo; import appeng.api.config.YesNo;
import appeng.client.gui.implementations.NumberEntryWidget;
import appeng.container.ContainerLocator; import appeng.container.ContainerLocator;
import appeng.container.guisync.GuiSync; import appeng.container.guisync.GuiSync;
import appeng.container.slot.FakeTypeOnlySlot; import appeng.container.slot.FakeTypeOnlySlot;
@@ -58,7 +59,7 @@ public class LevelEmitterContainer extends UpgradeableContainer {
private final LevelEmitterPart lvlEmitter; private final LevelEmitterPart lvlEmitter;
@Environment(EnvType.CLIENT) @Environment(EnvType.CLIENT)
private TextFieldWidget textField; private NumberEntryWidget textField;
@GuiSync(2) @GuiSync(2)
public LevelType lvType; public LevelType lvType;
@GuiSync(3) @GuiSync(3)
@@ -72,9 +73,9 @@ public class LevelEmitterContainer extends UpgradeableContainer {
} }
@Environment(EnvType.CLIENT) @Environment(EnvType.CLIENT)
public void setTextField(final TextFieldWidget level) { public void setTextField(final NumberEntryWidget level) {
this.textField = level; this.textField = level;
this.textField.setText(String.valueOf(this.EmitterValue)); this.textField.setValue(this.EmitterValue);
} }
public void setLevel(final long l, final PlayerEntity player) { public void setLevel(final long l, final PlayerEntity player) {
@@ -104,7 +105,7 @@ public class LevelEmitterContainer extends UpgradeableContainer {
final FixedItemInv inv = this.getUpgradeable().getInventoryByName("config"); final FixedItemInv inv = this.getUpgradeable().getInventoryByName("config");
final int y = 40; final int y = 40;
final int x = 80 + 44; final int x = 80 + 57;
this.addSlot(new FakeTypeOnlySlot(inv, 0, x, y)); this.addSlot(new FakeTypeOnlySlot(inv, 0, x, y));
} }
@@ -140,7 +141,7 @@ public class LevelEmitterContainer extends UpgradeableContainer {
public void onUpdate(final String field, final Object oldValue, final Object newValue) { public void onUpdate(final String field, final Object oldValue, final Object newValue) {
if (field.equals("EmitterValue")) { if (field.equals("EmitterValue")) {
if (this.textField != null) { if (this.textField != null) {
this.textField.setText(String.valueOf(this.EmitterValue)); this.textField.setValue(this.EmitterValue);
} }
} }
} }
@@ -29,6 +29,7 @@ import net.fabricmc.api.Environment;
import appeng.api.config.SecurityPermissions; import appeng.api.config.SecurityPermissions;
import appeng.api.parts.IPart; import appeng.api.parts.IPart;
import appeng.client.gui.implementations.NumberEntryWidget;
import appeng.container.AEBaseContainer; import appeng.container.AEBaseContainer;
import appeng.container.ContainerLocator; import appeng.container.ContainerLocator;
import appeng.container.guisync.GuiSync; import appeng.container.guisync.GuiSync;
@@ -53,7 +54,7 @@ public class PriorityContainer extends AEBaseContainer {
private final IPriorityHost priHost; private final IPriorityHost priHost;
@Environment(EnvType.CLIENT) @Environment(EnvType.CLIENT)
private TextFieldWidget textField; private NumberEntryWidget textField;
@GuiSync(2) @GuiSync(2)
public long PriorityValue = -1; public long PriorityValue = -1;
@@ -64,9 +65,9 @@ public class PriorityContainer extends AEBaseContainer {
} }
@Environment(EnvType.CLIENT) @Environment(EnvType.CLIENT)
public void setTextField(final TextFieldWidget level) { public void setTextField(final NumberEntryWidget level) {
this.textField = level; this.textField = level;
this.textField.setText(String.valueOf(this.PriorityValue)); this.textField.setValue(this.PriorityValue, true);
} }
public void setPriority(final int newValue, final PlayerEntity player) { public void setPriority(final int newValue, final PlayerEntity player) {
@@ -88,7 +89,7 @@ public class PriorityContainer extends AEBaseContainer {
public void onUpdate(final String field, final Object oldValue, final Object newValue) { public void onUpdate(final String field, final Object oldValue, final Object newValue) {
if (field.equals("PriorityValue")) { if (field.equals("PriorityValue")) {
if (this.textField != null) { if (this.textField != null) {
this.textField.setText(String.valueOf(this.PriorityValue)); this.textField.setValue(this.PriorityValue, true);
} }
} }
+18 -14
View File
@@ -21,6 +21,7 @@ package appeng.core;
import appeng.api.config.*; import appeng.api.config.*;
import appeng.api.features.AEFeature; import appeng.api.features.AEFeature;
import appeng.core.config.*; import appeng.core.config.*;
import appeng.client.gui.NumberEntryType;
import appeng.core.settings.TickRates; import appeng.core.settings.TickRates;
import appeng.util.EnumCycler; import appeng.util.EnumCycler;
import net.minecraft.world.dimension.DimensionType; import net.minecraft.world.dimension.DimensionType;
@@ -249,20 +250,23 @@ public final class AEConfig {
clientConfig.selectedPowerUnit.set(this.selectedPowerUnit); clientConfig.selectedPowerUnit.set(this.selectedPowerUnit);
} }
public int craftItemsByStackAmounts(final int i) { /**
return this.craftByStacks[i]; * Returns an array with the quantity-steps for the +/- buttons in number entry
} * dialogs of the given type. Guaranteed to have 4 entries.
*/
public int priorityByStacksAmounts(final int i) { public int[] getNumberEntrySteps(NumberEntryType type) {
return this.priorityByStacks[i]; switch (type) {
} case CRAFT_ITEM_COUNT:
return craftByStacks;
public int levelByStackAmounts(final int i) { case PRIORITY:
return this.levelByStacks[i]; return priorityByStacks;
} case LEVEL_ITEM_COUNT:
return levelByStacks;
public int levelByMillyBuckets(final int i) { case LEVEL_FLUID_VOLUME:
return this.levelByMillibuckets[i]; return levelByMillibuckets;
default:
throw new IllegalArgumentException("Unknown number entry: " + type);
}
} }
public PowerUnits getSelectedPowerUnit() { public PowerUnits getSelectedPowerUnit() {
@@ -27,7 +27,7 @@ public enum GuiText {
Chest, StoredEnergy, Of, Condenser, Drive, GrindStone, SkyChest, Chest, StoredEnergy, Of, Condenser, Drive, GrindStone, SkyChest,
VibrationChamber, SpatialIOPort, LevelEmitter, FluidLevelEmitter, Terminal, VibrationChamber, SpatialIOPort, LevelEmitter, FluidLevelEmitter, FluidLevelEmitterUnit, Terminal,
Interface, FluidInterface, Config, StoredItems, StoredFluids, Patterns, ImportBus, ImportBusFluids, ExportBus, Interface, FluidInterface, Config, StoredItems, StoredFluids, Patterns, ImportBus, ImportBusFluids, ExportBus,
ExportBusFluids, ExportBusFluids,
@@ -9,10 +9,10 @@ import net.minecraft.text.Text;
import appeng.api.config.RedstoneMode; import appeng.api.config.RedstoneMode;
import appeng.api.config.Settings; import appeng.api.config.Settings;
import appeng.client.gui.NumberEntryType;
import appeng.client.gui.implementations.NumberEntryWidget;
import appeng.client.gui.implementations.UpgradeableScreen; import appeng.client.gui.implementations.UpgradeableScreen;
import appeng.client.gui.widgets.NumberBox;
import appeng.client.gui.widgets.ServerSettingToggleButton; import appeng.client.gui.widgets.ServerSettingToggleButton;
import appeng.core.AEConfig;
import appeng.core.localization.GuiText; import appeng.core.localization.GuiText;
import appeng.core.sync.network.NetworkHandler; import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.ConfigValuePacket; import appeng.core.sync.packets.ConfigValuePacket;
@@ -20,7 +20,8 @@ import appeng.fluids.client.gui.widgets.FluidSlotWidget;
import appeng.fluids.container.FluidLevelEmitterContainer; import appeng.fluids.container.FluidLevelEmitterContainer;
public class FluidLevelEmitterScreen extends UpgradeableScreen<FluidLevelEmitterContainer> { public class FluidLevelEmitterScreen extends UpgradeableScreen<FluidLevelEmitterContainer> {
private NumberBox level;
private NumberEntryWidget level;
public FluidLevelEmitterScreen(FluidLevelEmitterContainer container, PlayerInventory playerInventory, public FluidLevelEmitterScreen(FluidLevelEmitterContainer container, PlayerInventory playerInventory,
Text title) { Text title) {
@@ -31,40 +32,21 @@ public class FluidLevelEmitterScreen extends UpgradeableScreen<FluidLevelEmitter
public void init() { public void init() {
super.init(); super.init();
this.level = new NumberBox(this.textRenderer, this.x + 24, this.y + 43, 79, this.textRenderer.fontHeight, this.level = new NumberEntryWidget(this, 20, 17, 138, 62, NumberEntryType.LEVEL_FLUID_VOLUME,
Long.class); this::onLevelChange);
this.level.setHasBorder(false); this.level.setTextFieldBounds(25, 44, 75);
this.level.setMaxLength(16); container.setTextField(this.level);
this.level.setEditableColor(0xFFFFFF); this.level.addButtons(children::add, this::addButton);
this.level.setVisible(true);
this.level.changeFocus(true);
handler.setTextField(this.level);
final int y = 40; final int y = 40;
final int x = 80 + 44; final int x = 80 + 57;
this.guiSlots.add(new FluidSlotWidget(this.handler.getFluidConfigInventory(), 0, 0, x, y)); this.guiSlots.add(new FluidSlotWidget(this.container.getFluidConfigInventory(), 0, 0, x, y));
} }
@Override @Override
protected void addButtons() { protected void addButtons() {
this.redstoneMode = new ServerSettingToggleButton<>(this.x - 18, this.y + 28, this.redstoneMode = new ServerSettingToggleButton<>(this.x - 18, this.y + 28,
Settings.REDSTONE_EMITTER, RedstoneMode.LOW_SIGNAL); Settings.REDSTONE_EMITTER, RedstoneMode.LOW_SIGNAL);
final int a = AEConfig.instance().levelByMillyBuckets(0);
final int b = AEConfig.instance().levelByMillyBuckets(1);
final int c = AEConfig.instance().levelByMillyBuckets(2);
final int d = AEConfig.instance().levelByMillyBuckets(3);
this.addButton(new ButtonWidget(this.x + 20, this.y + 17, 22, 20, new LiteralText("+" + a), btn -> addQty(a)));
this.addButton(new ButtonWidget(this.x + 48, this.y + 17, 28, 20, new LiteralText("+" + b), btn -> addQty(b)));
this.addButton(new ButtonWidget(this.x + 82, this.y + 17, 32, 20, new LiteralText("+" + c), btn -> addQty(c)));
this.addButton(new ButtonWidget(this.x + 120, this.y + 17, 38, 20, new LiteralText("+" + d), btn -> addQty(d)));
this.addButton(new ButtonWidget(this.x + 20, this.y + 59, 22, 20, new LiteralText("-" + a), btn -> addQty(-a)));
this.addButton(new ButtonWidget(this.x + 48, this.y + 59, 28, 20, new LiteralText("-" + b), btn -> addQty(-b)));
this.addButton(new ButtonWidget(this.x + 82, this.y + 59, 32, 20, new LiteralText("-" + c), btn -> addQty(-c)));
this.addButton(new ButtonWidget(this.x + 120, this.y + 59, 38, 20, new LiteralText("-" + d), btn -> addQty(-d)));
this.addButton(this.redstoneMode); this.addButton(this.redstoneMode);
} }
@@ -74,6 +56,13 @@ public class FluidLevelEmitterScreen extends UpgradeableScreen<FluidLevelEmitter
this.level.render(matrices, mouseX, mouseY, partialTicks); this.level.render(matrices, mouseX, mouseY, partialTicks);
} }
@Override
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) {
super.drawFG(offsetX, offsetY, mouseX, mouseY);
this.font.drawString(GuiText.FluidLevelEmitterUnit.getLocal(), 110, 44, COLOR_DARK_GRAY);
}
@Override @Override
protected boolean drawUpgrades() { protected boolean drawUpgrades() {
return false; return false;
@@ -93,89 +82,8 @@ public class FluidLevelEmitterScreen extends UpgradeableScreen<FluidLevelEmitter
protected void handleButtonVisibility() { protected void handleButtonVisibility() {
} }
private void addQty(final long i) { private void onLevelChange(long level) {
try { NetworkHandler.instance().sendToServer(new ConfigValuePacket("FluidLevelEmitter.Value", String.valueOf(level)));
String Out = this.level.getText();
boolean Fixed = false;
while (Out.startsWith("0") && Out.length() > 1) {
Out = Out.substring(1);
Fixed = true;
}
if (Fixed) {
this.level.setText(Out);
}
if (Out.isEmpty()) {
Out = "0";
}
long result = Long.parseLong(Out);
result += i;
if (result < 0) {
result = 0;
}
this.level.setText(Out = Long.toString(result));
NetworkHandler.instance().sendToServer(new ConfigValuePacket("FluidLevelEmitter.Value", Out));
} catch (final NumberFormatException e) {
// nope..
this.level.setText("0");
}
} }
@Override
public boolean charTyped(char character, int keyCode) {
if (level.charTyped(character, keyCode)) {
String Out = this.level.getText();
boolean Fixed = false;
while (Out.startsWith("0") && Out.length() > 1) {
Out = Out.substring(1);
Fixed = true;
}
if (Fixed) {
this.level.setText(Out);
}
if (Out.isEmpty()) {
Out = "0";
}
NetworkHandler.instance().sendToServer(new ConfigValuePacket("FluidLevelEmitter.Value", Out));
return true;
}
return super.charTyped(character, keyCode);
}
@Override
public boolean keyPressed(int keyCode, int scanCode, int p_keyPressed_3_) {
if (!this.checkHotbarKeys(keyCode, scanCode)) {
if ((keyCode == 211 || keyCode == 205 || keyCode == 203 || keyCode == 14)
&& this.level.keyPressed(keyCode, scanCode, p_keyPressed_3_)) {
String Out = this.level.getText();
boolean Fixed = false;
while (Out.startsWith("0") && Out.length() > 1) {
Out = Out.substring(1);
Fixed = true;
}
if (Fixed) {
this.level.setText(Out);
}
if (Out.isEmpty()) {
Out = "0";
}
NetworkHandler.instance().sendToServer(new ConfigValuePacket("FluidLevelEmitter.Value", Out));
return true;
}
}
return super.keyPressed(keyCode, scanCode, p_keyPressed_3_);
}
} }
@@ -88,7 +88,7 @@ public class FluidTankWidget extends AbstractButtonWidget implements ITooltip {
return desc.copy().append("\n").append(amountToText); return desc.copy().append("\n").append(amountToText);
} }
return null; return "";
} }
@Override @Override
@@ -1,6 +1,5 @@
package appeng.fluids.container; package appeng.fluids.container;
import net.minecraft.client.gui.widget.TextFieldWidget;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory; import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.screen.ScreenHandlerType; import net.minecraft.screen.ScreenHandlerType;
@@ -11,6 +10,7 @@ import net.fabricmc.api.Environment;
import appeng.api.config.RedstoneMode; import appeng.api.config.RedstoneMode;
import appeng.api.config.SecurityPermissions; import appeng.api.config.SecurityPermissions;
import appeng.api.config.Settings; import appeng.api.config.Settings;
import appeng.client.gui.implementations.NumberEntryWidget;
import appeng.container.ContainerLocator; import appeng.container.ContainerLocator;
import appeng.container.guisync.GuiSync; import appeng.container.guisync.GuiSync;
import appeng.container.implementations.ContainerHelper; import appeng.container.implementations.ContainerHelper;
@@ -35,7 +35,7 @@ public class FluidLevelEmitterContainer extends FluidConfigurableContainer {
private final FluidLevelEmitterPart lvlEmitter; private final FluidLevelEmitterPart lvlEmitter;
@Environment(EnvType.CLIENT) @Environment(EnvType.CLIENT)
private TextFieldWidget textField; private NumberEntryWidget textField;
@GuiSync(3) @GuiSync(3)
public long EmitterValue = -1; public long EmitterValue = -1;
@@ -45,9 +45,9 @@ public class FluidLevelEmitterContainer extends FluidConfigurableContainer {
} }
@Environment(EnvType.CLIENT) @Environment(EnvType.CLIENT)
public void setTextField(final TextFieldWidget level) { public void setTextField(final NumberEntryWidget level) {
this.textField = level; this.textField = level;
this.textField.setText(String.valueOf(this.EmitterValue)); this.textField.setValue(this.EmitterValue);
} }
public void setLevel(final long l, final PlayerEntity player) { public void setLevel(final long l, final PlayerEntity player) {
@@ -87,7 +87,7 @@ public class FluidLevelEmitterContainer extends FluidConfigurableContainer {
public void onUpdate(final String field, final Object oldValue, final Object newValue) { public void onUpdate(final String field, final Object oldValue, final Object newValue) {
if (field.equals("EmitterValue")) { if (field.equals("EmitterValue")) {
if (this.textField != null) { if (this.textField != null) {
this.textField.setText(String.valueOf(this.EmitterValue)); this.textField.setValue(this.EmitterValue);
} }
} }
} }
+75 -22
View File
@@ -29,6 +29,7 @@ import java.util.Queue;
import java.util.Set; import java.util.Set;
import java.util.SortedSet; import java.util.SortedSet;
import com.google.common.base.Preconditions;
import com.google.common.collect.HashMultiset; import com.google.common.collect.HashMultiset;
import com.google.common.collect.Multiset; import com.google.common.collect.Multiset;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
@@ -74,15 +75,33 @@ public class EnergyGridCache implements IEnergyGrid {
return Double.compare(percent1, percent2); return Double.compare(percent1, percent2);
}; };
private static final Comparator<IAEPowerStorage> COMPARATOR_HIGHEST_PRIORITY_FIRST = (o1, o2) -> Integer private static final Comparator<IAEPowerStorage> COMPARATOR_HIGHEST_PRIORITY_FIRST = (o1, o2) -> {
.compare(o2.getPriority(), o1.getPriority()); final int cmp = Integer.compare(o2.getPriority(), o1.getPriority());
private static final Comparator<IAEPowerStorage> COMPARATOR_LOWEST_PRIORITY_FIRST = (o1, o2) -> Integer return cmp != 0 ? cmp : Integer.compare(System.identityHashCode(o2), System.identityHashCode(o1));
.compare(o1.getPriority(), o2.getPriority()); };
private static final Comparator<IAEPowerStorage> COMPARATOR_LOWEST_PRIORITY_FIRST = (o1,
o2) -> -COMPARATOR_HIGHEST_PRIORITY_FIRST.compare(o1, o2);
private final NavigableSet<EnergyThreshold> interests = Sets.newTreeSet(); private final NavigableSet<EnergyThreshold> interests = Sets.newTreeSet();
private final double averageLength = 40.0; private final double averageLength = 40.0;
// Should only be modified from the add/remove methods below to guard against
// concurrent modifications
private final SortedSet<IAEPowerStorage> providers = new ObjectRBTreeSet<>(COMPARATOR_HIGHEST_PRIORITY_FIRST); private final SortedSet<IAEPowerStorage> providers = new ObjectRBTreeSet<>(COMPARATOR_HIGHEST_PRIORITY_FIRST);
// Used to track whether an extraction is currently in progress, to fail fast
// when something externally
// modifies the energy grid.
private boolean ongoingExtractOperation = false;
// Should only be modified from the add/remove methods below to guard against
// concurrent modifications
private final SortedSet<IAEPowerStorage> requesters = new ObjectRBTreeSet<>(COMPARATOR_LOWEST_PRIORITY_FIRST); private final SortedSet<IAEPowerStorage> requesters = new ObjectRBTreeSet<>(COMPARATOR_LOWEST_PRIORITY_FIRST);
// Used to track whether an injection is currently in progress, to fail fast
// when something externally
// modifies the energy grid.
private boolean ongoingInjectOperation = false;
private final Multiset<IEnergyGridProvider> energyGridProviders = HashMultiset.create(); private final Multiset<IEnergyGridProvider> energyGridProviders = HashMultiset.create();
private final IGrid myGrid; private final IGrid myGrid;
private final HashMap<IGridNode, IEnergyWatcher> watchers = new HashMap<>(); private final HashMap<IGridNode, IEnergyWatcher> watchers = new HashMap<>();
@@ -145,12 +164,12 @@ public class EnergyGridCache implements IEnergyGrid {
switch (ev.type) { switch (ev.type) {
case PROVIDE_POWER: case PROVIDE_POWER:
if (ev.storage.getPowerFlow() != AccessRestriction.WRITE) { if (ev.storage.getPowerFlow() != AccessRestriction.WRITE) {
this.providers.add(ev.storage); addProvider(ev.storage);
} }
break; break;
case REQUEST_POWER: case REQUEST_POWER:
if (ev.storage.getPowerFlow() != AccessRestriction.READ) { if (ev.storage.getPowerFlow() != AccessRestriction.READ) {
this.requesters.add(ev.storage); addRequester(ev.storage);
} }
break; break;
} }
@@ -278,16 +297,21 @@ public class EnergyGridCache implements IEnergyGrid {
final Iterator<IAEPowerStorage> it = this.providers.iterator(); final Iterator<IAEPowerStorage> it = this.providers.iterator();
while (extractedPower < amt && it.hasNext()) { ongoingExtractOperation = true;
final IAEPowerStorage node = it.next(); try {
while (extractedPower < amt && it.hasNext()) {
final IAEPowerStorage node = it.next();
final double req = amt - extractedPower; final double req = amt - extractedPower;
final double newPower = node.extractAEPower(req, mode, PowerMultiplier.ONE); final double newPower = node.extractAEPower(req, mode, PowerMultiplier.ONE);
extractedPower += newPower; extractedPower += newPower;
if (newPower < req && mode == Actionable.MODULATE) { if (newPower < req && mode == Actionable.MODULATE) {
it.remove(); it.remove();
}
} }
} finally {
ongoingExtractOperation = false;
} }
final double result = Math.min(extractedPower, amt); final double result = Math.min(extractedPower, amt);
@@ -310,13 +334,18 @@ public class EnergyGridCache implements IEnergyGrid {
final Iterator<IAEPowerStorage> it = this.requesters.iterator(); final Iterator<IAEPowerStorage> it = this.requesters.iterator();
while (amt > 0 && it.hasNext()) { ongoingInjectOperation = true;
final IAEPowerStorage node = it.next(); try {
amt = node.injectAEPower(amt, mode); while (amt > 0 && it.hasNext()) {
final IAEPowerStorage node = it.next();
amt = node.injectAEPower(amt, mode);
if (amt > 0 && mode == Actionable.MODULATE) { if (amt > 0 && mode == Actionable.MODULATE) {
it.remove(); it.remove();
}
} }
} finally {
ongoingInjectOperation = false;
} }
final double overflow = Math.max(0.0, amt); final double overflow = Math.max(0.0, amt);
@@ -449,8 +478,8 @@ public class EnergyGridCache implements IEnergyGrid {
this.globalAvailablePower -= ps.getAECurrentPower(); this.globalAvailablePower -= ps.getAECurrentPower();
} }
this.providers.remove(ps); removeProvider(ps);
this.requesters.remove(ps); removeRequester(ps);
} }
} }
@@ -464,6 +493,30 @@ public class EnergyGridCache implements IEnergyGrid {
} }
} }
private void addRequester(IAEPowerStorage requester) {
Preconditions.checkState(!ongoingInjectOperation,
"Cannot modify energy requesters while energy is being injected.");
this.requesters.add(requester);
}
private void removeRequester(IAEPowerStorage requester) {
Preconditions.checkState(!ongoingInjectOperation,
"Cannot modify energy requesters while energy is being injected.");
this.requesters.add(requester);
}
private void addProvider(IAEPowerStorage provider) {
Preconditions.checkState(!ongoingExtractOperation,
"Cannot modify energy providers while energy is being extracted.");
this.providers.add(provider);
}
private void removeProvider(IAEPowerStorage provider) {
Preconditions.checkState(!ongoingExtractOperation,
"Cannot modify energy providers while energy is being extracted.");
this.providers.remove(provider);
}
@Override @Override
public void addNode(final IGridNode node, final IGridHost machine) { public void addNode(final IGridNode node, final IGridHost machine) {
if (machine instanceof IEnergyGridProvider) { if (machine instanceof IEnergyGridProvider) {
@@ -489,11 +542,11 @@ public class EnergyGridCache implements IEnergyGrid {
if (current > 0 && ps.getPowerFlow() != AccessRestriction.WRITE) { if (current > 0 && ps.getPowerFlow() != AccessRestriction.WRITE) {
this.globalAvailablePower += current; this.globalAvailablePower += current;
this.providers.add(ps); addProvider(ps);
} }
if (current < max && ps.getPowerFlow() != AccessRestriction.READ) { if (current < max && ps.getPowerFlow() != AccessRestriction.READ) {
this.requesters.add(ps); addRequester(ps);
} }
} }
} }
@@ -46,5 +46,5 @@ public interface IAECluster {
*/ */
boolean isDestroyed(); boolean isDestroyed();
Iterator<IGridHost> getTiles(); Iterator<? extends IGridHost> getTiles();
} }
@@ -18,11 +18,11 @@
package appeng.me.cluster; package appeng.me.cluster;
public interface IAEMultiBlock { public interface IAEMultiBlock<Cluster extends IAECluster> {
void disconnect(boolean b); void disconnect(boolean b);
IAECluster getCluster(); Cluster getCluster();
boolean isValid(); boolean isValid();
} }
@@ -25,17 +25,21 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import appeng.api.util.AEPartLocation; import appeng.api.util.AEPartLocation;
import appeng.api.util.WorldCoord;
import appeng.core.AELog; import appeng.core.AELog;
import appeng.util.Platform; import appeng.util.Platform;
public abstract class MBCalculator { public abstract class MBCalculator<TTile extends IAEMultiBlock<TCluster>, TCluster extends IAECluster> {
/**
* To avoid recursive cluster rebuilds, we use a global field to prevent this
* from happening. This is set to the cluster that is currently causing a
* Multiblock modification.
*/
private static WeakReference<IAECluster> modificationInProgress = new WeakReference<>(null); private static WeakReference<IAECluster> modificationInProgress = new WeakReference<>(null);
private final IAEMultiBlock target; protected final TTile target;
public MBCalculator(final IAEMultiBlock t) { public MBCalculator(final TTile t) {
this.target = t; this.target = t;
} }
@@ -54,10 +58,10 @@ public abstract class MBCalculator {
return modificationInProgress.get() != null; return modificationInProgress.get() != null;
} }
public void updateMultiblockAfterNeighborUpdate(final World world, final WorldCoord loc, BlockPos changedPos) { public void updateMultiblockAfterNeighborUpdate(final World world, final BlockPos loc, BlockPos changedPos) {
boolean recheck; boolean recheck;
IAECluster cluster = target.getCluster(); TCluster cluster = target.getCluster();
if (cluster != null) { if (cluster != null) {
if (isWithinBounds(changedPos, cluster.getBoundsMin(), cluster.getBoundsMax())) { if (isWithinBounds(changedPos, cluster.getBoundsMin(), cluster.getBoundsMax())) {
// If the location is part of the current multiblock, always re-check // If the location is part of the current multiblock, always re-check
@@ -69,9 +73,8 @@ public abstract class MBCalculator {
} }
} else { } else {
// Always recheck if the tile is not part of a cluster, because the adjacent // Always recheck if the tile is not part of a cluster, because the adjacent
// block could have // block could have previously been a valid tile, but in a wrong placement,
// previously been a valid tile, but in a wrong placement, or the other way // or the other way around.
// around.
recheck = true; recheck = true;
} }
@@ -80,7 +83,7 @@ public abstract class MBCalculator {
} }
} }
public void calculateMultiblock(final World world, final WorldCoord loc) { public void calculateMultiblock(final World world, final BlockPos loc) {
if (Platform.isClient() || isModificationInProgress()) { if (Platform.isClient() || isModificationInProgress()) {
return; return;
} }
@@ -92,34 +95,31 @@ public abstract class MBCalculator {
} }
try { try {
final WorldCoord min = loc.copy(); final BlockPos.Mutable min = new BlockPos.Mutable(loc);
final WorldCoord max = loc.copy(); final BlockPos.Mutable max = new BlockPos.Mutable(loc);
// find size of MB structure... // find size of MB structure...
while (this.isValidTileAt(world, min.x - 1, min.y, min.z)) { while (this.isValidTileAt(world, min.getX() - 1, min.getY(), min.getZ())) {
min.x--; min.setX(min.getX() - 1);
} }
while (this.isValidTileAt(world, min.x, min.y - 1, min.z)) { while (this.isValidTileAt(world, min.getX(), min.getY() - 1, min.getZ())) {
min.y--; min.setY(min.getY() - 1);
} }
while (this.isValidTileAt(world, min.x, min.y, min.z - 1)) { while (this.isValidTileAt(world, min.getX(), min.getY(), min.getZ() - 1)) {
min.z--; min.setZ(min.getZ() - 1);
} }
while (this.isValidTileAt(world, max.x + 1, max.y, max.z)) { while (this.isValidTileAt(world, max.getX() + 1, max.getY(), max.getZ())) {
max.x++; max.setX(max.getX() + 1);
} }
while (this.isValidTileAt(world, max.x, max.y + 1, max.z)) { while (this.isValidTileAt(world, max.getX(), max.getY() + 1, max.getZ())) {
max.y++; max.setY(max.getY() + 1);
} }
while (this.isValidTileAt(world, max.x, max.y, max.z + 1)) { while (this.isValidTileAt(world, max.getX(), max.getY(), max.getZ() + 1)) {
max.z++; max.setZ(max.getZ() + 1);
} }
if (this.checkMultiblockScale(min, max)) { if (this.checkMultiblockScale(min, max)) {
if (this.verifyUnownedRegion(world, min, max)) { if (this.verifyUnownedRegion(world, min, max)) {
IAECluster c = this.createCluster(world, min, max);
setModificationInProgress(c);
try { try {
if (!this.verifyInternalStructure(world, min, max)) { if (!this.verifyInternalStructure(world, min, max)) {
this.disconnect(); this.disconnect();
@@ -131,16 +131,19 @@ public abstract class MBCalculator {
} }
boolean updateGrid = false; boolean updateGrid = false;
final IAECluster cluster = this.target.getCluster(); TCluster cluster = this.target.getCluster();
if (cluster == null) { if (cluster == null || !cluster.getBoundsMin().equals(min) || !cluster.getBoundsMax().equals(max)) {
this.updateTiles(c, world, min, max); cluster = this.createCluster(world, min, max);
setModificationInProgress(cluster);
// NOTE: The following will break existing clusters within the bounds
this.updateTiles(cluster, world, min, max);
updateGrid = true; updateGrid = true;
} else { } else {
c = cluster; setModificationInProgress(cluster);
} }
c.updateStatus(updateGrid); cluster.updateStatus(updateGrid);
return; return;
} }
} }
@@ -173,11 +176,12 @@ public abstract class MBCalculator {
* *
* @return true if structure has correct dimensions or size * @return true if structure has correct dimensions or size
*/ */
public abstract boolean checkMultiblockScale(WorldCoord min, WorldCoord max); public abstract boolean checkMultiblockScale(BlockPos min, BlockPos max);
private boolean verifyUnownedRegion(final World w, final WorldCoord min, final WorldCoord max) { private boolean verifyUnownedRegion(final World w, final BlockPos min, final BlockPos max) {
for (final AEPartLocation side : AEPartLocation.SIDE_LOCATIONS) { for (final AEPartLocation side : AEPartLocation.SIDE_LOCATIONS) {
if (this.verifyUnownedRegionInner(w, min.x, min.y, min.z, max.x, max.y, max.z, side)) { if (this.verifyUnownedRegionInner(w, min.getX(), min.getY(), min.getZ(), max.getX(), max.getY(), max.getZ(),
side)) {
return false; return false;
} }
} }
@@ -194,14 +198,16 @@ public abstract class MBCalculator {
* *
* @return created cluster * @return created cluster
*/ */
public abstract IAECluster createCluster(World w, WorldCoord min, WorldCoord max); public abstract TCluster createCluster(World w, BlockPos min, BlockPos max);
public abstract boolean verifyInternalStructure(World world, WorldCoord min, WorldCoord max); public abstract boolean verifyInternalStructure(World world, BlockPos min, BlockPos max);
/** /**
* disassembles the multi-block. * disassembles the multi-block.
*/ */
public abstract void disconnect(); public void disconnect() {
this.target.disconnect(true);
}
/** /**
* configure the multi-block tiles, most of the important stuff is in here. * configure the multi-block tiles, most of the important stuff is in here.
@@ -211,7 +217,7 @@ public abstract class MBCalculator {
* @param min min world coord * @param min min world coord
* @param max max world coord * @param max max world coord
*/ */
public abstract void updateTiles(IAECluster c, World w, WorldCoord min, WorldCoord max); public abstract void updateTiles(TCluster c, World w, BlockPos min, BlockPos max);
/** /**
* check if the block entities are correct for the structure. * check if the block entities are correct for the structure.
@@ -253,14 +259,10 @@ public abstract class MBCalculator {
return false; return false;
} }
for (int x = minX; x <= maxX; x++) { for (BlockPos p : BlockPos.getAllInBoxMutable(minX, minY, minZ, maxX, maxY, maxZ)) {
for (int y = minY; y <= maxY; y++) { final BlockEntity te = w.getBlockEntity(p);
for (int z = minZ; z <= maxZ; z++) { if (this.isValidTile(te)) {
final BlockEntity te = w.getBlockEntity(new BlockPos(x, y, z)); return true;
if (this.isValidTile(te)) {
return true;
}
}
} }
} }
@@ -29,32 +29,27 @@ import appeng.api.networking.IGridHost;
import appeng.api.networking.IGridNode; import appeng.api.networking.IGridNode;
import appeng.api.networking.events.MENetworkCraftingCpuChange; import appeng.api.networking.events.MENetworkCraftingCpuChange;
import appeng.api.util.AEPartLocation; import appeng.api.util.AEPartLocation;
import appeng.api.util.WorldCoord;
import appeng.me.cluster.IAECluster;
import appeng.me.cluster.IAEMultiBlock; import appeng.me.cluster.IAEMultiBlock;
import appeng.me.cluster.MBCalculator; import appeng.me.cluster.MBCalculator;
import appeng.tile.crafting.CraftingBlockEntity; import appeng.tile.crafting.CraftingBlockEntity;
public class CraftingCPUCalculator extends MBCalculator { public class CraftingCPUCalculator extends MBCalculator<CraftingTileEntity, CraftingCPUCluster> {
private final CraftingBlockEntity tqb; public CraftingCPUCalculator(final CraftingTileEntity t) {
public CraftingCPUCalculator(final IAEMultiBlock t) {
super(t); super(t);
this.tqb = (CraftingBlockEntity) t;
} }
@Override @Override
public boolean checkMultiblockScale(final WorldCoord min, final WorldCoord max) { public boolean checkMultiblockScale(final BlockPos min, final BlockPos max) {
if (max.x - min.x > 16) { if (max.getX() - min.getX() > 16) {
return false; return false;
} }
if (max.y - min.y > 16) { if (max.getY() - min.getY() > 16) {
return false; return false;
} }
if (max.z - min.z > 16) { if (max.getZ() - min.getZ() > 16) {
return false; return false;
} }
@@ -62,27 +57,23 @@ public class CraftingCPUCalculator extends MBCalculator {
} }
@Override @Override
public IAECluster createCluster(final World w, final WorldCoord min, final WorldCoord max) { public CraftingCPUCluster createCluster(final World w, final BlockPos min, final BlockPos max) {
return new CraftingCPUCluster(min, max); return new CraftingCPUCluster(min, max);
} }
@Override @Override
public boolean verifyInternalStructure(final World w, final WorldCoord min, final WorldCoord max) { public boolean verifyInternalStructure(final World w, final BlockPos min, final BlockPos max) {
boolean storage = false; boolean storage = false;
for (int x = min.x; x <= max.x; x++) { for (BlockPos blockPos : BlockPos.getAllInBoxMutable(min, max)) {
for (int y = min.y; y <= max.y; y++) { final IAEMultiBlock<?> te = (IAEMultiBlock<?>) w.getBlockEntity(blockPos);
for (int z = min.z; z <= max.z; z++) {
final IAEMultiBlock te = (IAEMultiBlock) w.getBlockEntity(new BlockPos(x, y, z));
if (!te.isValid()) { if (te == null || !te.isValid()) {
return false; return false;
} }
if (!storage && te instanceof CraftingBlockEntity) { if (!storage && te instanceof CraftingBlockEntity) {
storage = ((CraftingBlockEntity) te).getStorageBytes() > 0; storage = ((CraftingBlockEntity) te).getStorageBytes() > 0;
}
}
} }
} }
@@ -90,27 +81,16 @@ public class CraftingCPUCalculator extends MBCalculator {
} }
@Override @Override
public void disconnect() { public void updateTiles(final CraftingCPUCluster c, final World w, final BlockPos min, final BlockPos max) {
this.tqb.disconnect(true); for (BlockPos blockPos : BlockPos.getAllInBoxMutable(min, max)) {
} final CraftingBlockEntity te = (CraftingBlockEntity) w.getBlockEntity(blockPos);
te.updateStatus(c);
@Override c.addTile(te);
public void updateTiles(final IAECluster cl, final World w, final WorldCoord min, final WorldCoord max) {
final CraftingCPUCluster c = (CraftingCPUCluster) cl;
for (int x = min.x; x <= max.x; x++) {
for (int y = min.y; y <= max.y; y++) {
for (int z = min.z; z <= max.z; z++) {
final CraftingBlockEntity te = (CraftingBlockEntity) w.getBlockEntity(new BlockPos(x, y, z));
te.updateStatus(c);
c.addTile(te);
}
}
} }
c.done(); c.done();
final Iterator<IGridHost> i = c.getTiles(); final Iterator<CraftingTileEntity> i = c.getTiles();
while (i.hasNext()) { while (i.hasNext()) {
final IGridHost gh = i.next(); final IGridHost gh = i.next();
final IGridNode n = gh.getGridNode(AEPartLocation.INTERNAL); final IGridNode n = gh.getGridNode(AEPartLocation.INTERNAL);
@@ -18,12 +18,7 @@
package appeng.me.cluster.implementations; package appeng.me.cluster.implementations;
import java.util.ArrayList; import java.util.*;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
@@ -43,14 +38,7 @@ import appeng.api.crafting.ICraftingHelper;
import appeng.api.networking.IGrid; import appeng.api.networking.IGrid;
import appeng.api.networking.IGridHost; import appeng.api.networking.IGridHost;
import appeng.api.networking.IGridNode; import appeng.api.networking.IGridNode;
import appeng.api.networking.crafting.CraftingItemList; import appeng.api.networking.crafting.*;
import appeng.api.networking.crafting.ICraftingCPU;
import appeng.api.networking.crafting.ICraftingGrid;
import appeng.api.networking.crafting.ICraftingJob;
import appeng.api.networking.crafting.ICraftingLink;
import appeng.api.networking.crafting.ICraftingMedium;
import appeng.api.networking.crafting.ICraftingPatternDetails;
import appeng.api.networking.crafting.ICraftingRequester;
import appeng.api.networking.energy.IEnergyGrid; import appeng.api.networking.energy.IEnergyGrid;
import appeng.api.networking.events.MENetworkCraftingCpuChange; import appeng.api.networking.events.MENetworkCraftingCpuChange;
import appeng.api.networking.security.IActionSource; import appeng.api.networking.security.IActionSource;
@@ -60,15 +48,10 @@ import appeng.api.storage.IMEMonitorHandlerReceiver;
import appeng.api.storage.channels.IItemStorageChannel; import appeng.api.storage.channels.IItemStorageChannel;
import appeng.api.storage.data.IAEItemStack; import appeng.api.storage.data.IAEItemStack;
import appeng.api.storage.data.IItemList; import appeng.api.storage.data.IItemList;
import appeng.api.util.WorldCoord;
import appeng.container.ContainerNull; import appeng.container.ContainerNull;
import appeng.core.AELog; import appeng.core.AELog;
import appeng.core.Api; import appeng.core.Api;
import appeng.crafting.CraftBranchFailure; import appeng.crafting.*;
import appeng.crafting.CraftingJob;
import appeng.crafting.CraftingLink;
import appeng.crafting.CraftingWatcher;
import appeng.crafting.MECraftingInventory;
import appeng.me.cache.CraftingGridCache; import appeng.me.cache.CraftingGridCache;
import appeng.me.cluster.IAECluster; import appeng.me.cluster.IAECluster;
import appeng.me.cluster.MBCalculator; import appeng.me.cluster.MBCalculator;
@@ -114,9 +97,9 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU {
private long startItemCount; private long startItemCount;
private long remainingItemCount; private long remainingItemCount;
public CraftingCPUCluster(final WorldCoord boundsMin, final WorldCoord boundsMax) { public CraftingCPUCluster(final BlockPos boundsMin, final BlockPos boundsMax) {
this.boundsMin = boundsMin.getBlockPos(); this.boundsMin = boundsMin.toImmutable();
this.boundsMax = boundsMax.getBlockPos(); this.boundsMax = boundsMax.toImmutable();
} }
@Override @Override
@@ -173,7 +156,10 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU {
} }
this.isDestroyed = true; this.isDestroyed = true;
MBCalculator.setModificationInProgress(this); boolean ownsModification = !MBCalculator.isModificationInProgress();
if (ownsModification) {
MBCalculator.setModificationInProgress(this);
}
try { try {
boolean posted = false; boolean posted = false;
@@ -190,13 +176,15 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU {
r.updateStatus(null); r.updateStatus(null);
} }
} finally { } finally {
MBCalculator.setModificationInProgress(null); if (ownsModification) {
MBCalculator.setModificationInProgress(null);
}
} }
} }
@Override @Override
public Iterator<IGridHost> getTiles() { public Iterator<CraftingTileEntity> getTiles() {
return (Iterator) this.tiles.iterator(); return this.tiles.iterator();
} }
void addTile(final CraftingBlockEntity te) { void addTile(final CraftingBlockEntity te) {
@@ -25,31 +25,25 @@ import net.minecraft.world.World;
import appeng.api.definitions.IBlockDefinition; import appeng.api.definitions.IBlockDefinition;
import appeng.api.definitions.IBlocks; import appeng.api.definitions.IBlocks;
import appeng.api.util.WorldCoord;
import appeng.core.Api; import appeng.core.Api;
import appeng.me.cluster.IAECluster;
import appeng.me.cluster.IAEMultiBlock; import appeng.me.cluster.IAEMultiBlock;
import appeng.me.cluster.MBCalculator; import appeng.me.cluster.MBCalculator;
import appeng.tile.qnb.QuantumBridgeBlockEntity; import appeng.tile.qnb.QuantumBridgeBlockEntity;
public class QuantumCalculator extends MBCalculator { public class QuantumCalculator extends MBCalculator<QuantumBridgeTileEntity, QuantumCluster> {
private final QuantumBridgeBlockEntity tqb; public QuantumCalculator(final QuantumBridgeTileEntity t) {
public QuantumCalculator(final IAEMultiBlock t) {
super(t); super(t);
this.tqb = (QuantumBridgeBlockEntity) t;
} }
@Override @Override
public boolean checkMultiblockScale(final WorldCoord min, final WorldCoord max) { public boolean checkMultiblockScale(final BlockPos min, final BlockPos max) {
if ((max.getX() - min.getX() + 1) * (max.getY() - min.getY() + 1) * (max.getZ() - min.getZ() + 1) == 9) {
final int ones = ((max.getX() - min.getX()) == 0 ? 1 : 0) + ((max.getY() - min.getY()) == 0 ? 1 : 0)
+ ((max.getZ() - min.getZ()) == 0 ? 1 : 0);
if ((max.x - min.x + 1) * (max.y - min.y + 1) * (max.z - min.z + 1) == 9) { final int threes = ((max.getX() - min.getX()) == 2 ? 1 : 0) + ((max.getY() - min.getY()) == 2 ? 1 : 0)
final int ones = ((max.x - min.x) == 0 ? 1 : 0) + ((max.y - min.y) == 0 ? 1 : 0) + ((max.getZ() - min.getZ()) == 2 ? 1 : 0);
+ ((max.z - min.z) == 0 ? 1 : 0);
final int threes = ((max.x - min.x) == 2 ? 1 : 0) + ((max.y - min.y) == 2 ? 1 : 0)
+ ((max.z - min.z) == 2 ? 1 : 0);
return ones == 1 && threes == 2; return ones == 1 && threes == 2;
} }
@@ -57,36 +51,31 @@ public class QuantumCalculator extends MBCalculator {
} }
@Override @Override
public IAECluster createCluster(final World w, final WorldCoord min, final WorldCoord max) { public QuantumCluster createCluster(final World w, final BlockPos min, final BlockPos max) {
return new QuantumCluster(min, max); return new QuantumCluster(min, max);
} }
@Override @Override
public boolean verifyInternalStructure(final World w, final WorldCoord min, final WorldCoord max) { public boolean verifyInternalStructure(final World w, final BlockPos min, final BlockPos max) {
byte num = 0; byte num = 0;
for (int x = min.x; x <= max.x; x++) { for (BlockPos p : BlockPos.getAllInBoxMutable(min, max)) {
for (int y = min.y; y <= max.y; y++) { final IAEMultiBlock<?> te = (IAEMultiBlock<?>) w.getTileEntity(p);
for (int z = min.z; z <= max.z; z++) {
final BlockPos p = new BlockPos(x, y, z);
final IAEMultiBlock te = (IAEMultiBlock) w.getBlockEntity(p);
if (!te.isValid()) { if (te == null || !te.isValid()) {
return false; return false;
} }
num++; num++;
final IBlocks blocks = Api.instance().definitions().blocks(); final IBlocks blocks = Api.instance().definitions().blocks();
if (num == 5) { if (num == 5) {
if (!this.isBlockAtLocation(w, p, blocks.quantumLink())) { if (!this.isBlockAtLocation(w, p, blocks.quantumLink())) {
return false; return false;
} }
} else { } else {
if (!this.isBlockAtLocation(w, p, blocks.quantumRing())) { if (!this.isBlockAtLocation(w, p, blocks.quantumRing())) {
return false; return false;
}
}
} }
} }
} }
@@ -94,39 +83,29 @@ public class QuantumCalculator extends MBCalculator {
} }
@Override @Override
public void disconnect() { public void updateTiles(final QuantumCluster c, final World w, final BlockPos min, final BlockPos max) {
this.tqb.disconnect(true);
}
@Override
public void updateTiles(final IAECluster cl, final World w, final WorldCoord min, final WorldCoord max) {
byte num = 0; byte num = 0;
byte ringNum = 0; byte ringNum = 0;
final QuantumCluster c = (QuantumCluster) cl;
for (int x = min.x; x <= max.x; x++) { for (BlockPos p : BlockPos.getAllInBoxMutable(min, max)) {
for (int y = min.y; y <= max.y; y++) { final QuantumBridgeBlockEntity te = (QuantumBridgeBlockEntity) w.getBlockEntity(p);
for (int z = min.z; z <= max.z; z++) {
final QuantumBridgeBlockEntity te = (QuantumBridgeBlockEntity) w.getBlockEntity(new BlockPos(x, y, z));
num++; num++;
final byte flags; final byte flags;
if (num == 5) { if (num == 5) {
flags = num; flags = num;
c.setCenter(te); c.setCenter(te);
} else { } else {
if (num == 1 || num == 3 || num == 7 || num == 9) { if (num == 1 || num == 3 || num == 7 || num == 9) {
flags = (byte) (this.tqb.getCorner() | num); flags = (byte) (this.target.getCorner() | num);
} else { } else {
flags = num; flags = num;
}
c.getRing()[ringNum] = te;
ringNum++;
}
te.updateStatus(c, flags, true);
} }
c.getRing()[ringNum] = te;
ringNum++;
} }
te.updateStatus(c, flags, true);
} }
} }
@@ -29,10 +29,8 @@ import appeng.api.events.LocatableEventAnnounce;
import appeng.api.events.LocatableEventAnnounce.LocatableEvent; import appeng.api.events.LocatableEventAnnounce.LocatableEvent;
import appeng.api.exceptions.FailedConnectionException; import appeng.api.exceptions.FailedConnectionException;
import appeng.api.features.ILocatable; import appeng.api.features.ILocatable;
import appeng.api.networking.IGridHost;
import appeng.api.networking.IGridNode; import appeng.api.networking.IGridNode;
import appeng.api.util.AEPartLocation; import appeng.api.util.AEPartLocation;
import appeng.api.util.WorldCoord;
import appeng.core.AELog; import appeng.core.AELog;
import appeng.core.Api; import appeng.core.Api;
import appeng.me.cache.helpers.ConnectionWrapper; import appeng.me.cache.helpers.ConnectionWrapper;
@@ -54,9 +52,9 @@ public class QuantumCluster implements ILocatable, IAECluster {
private long otherSide; private long otherSide;
private QuantumBridgeBlockEntity center; private QuantumBridgeBlockEntity center;
public QuantumCluster(final WorldCoord min, final WorldCoord max) { public QuantumCluster(final BlockPos min, final BlockPos max) {
this.boundsMin = min.getBlockPos(); this.boundsMin = min.toImmutable();
this.boundsMax = max.getBlockPos(); this.boundsMax = max.toImmutable();
this.setRing(new QuantumBridgeBlockEntity[8]); this.setRing(new QuantumBridgeBlockEntity[8]);
} }
@@ -236,7 +234,7 @@ public class QuantumCluster implements ILocatable, IAECluster {
} }
@Override @Override
public Iterator<IGridHost> getTiles() { public Iterator<QuantumBridgeTileEntity> getTiles() {
return new ChainedIterator<>(this.getRing()[0], this.getRing()[1], this.getRing()[2], this.getRing()[3], return new ChainedIterator<>(this.getRing()[0], this.getRing()[1], this.getRing()[2], this.getRing()[3],
this.getRing()[4], this.getRing()[5], this.getRing()[6], this.getRing()[7], this.center); this.getRing()[4], this.getRing()[5], this.getRing()[6], this.getRing()[7], this.center);
} }
@@ -22,45 +22,36 @@ import net.minecraft.block.entity.BlockEntity;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import appeng.api.util.WorldCoord;
import appeng.me.cluster.IAECluster;
import appeng.me.cluster.IAEMultiBlock; import appeng.me.cluster.IAEMultiBlock;
import appeng.me.cluster.MBCalculator; import appeng.me.cluster.MBCalculator;
import appeng.tile.spatial.SpatialPylonBlockEntity; import appeng.tile.spatial.SpatialPylonBlockEntity;
public class SpatialPylonCalculator extends MBCalculator { public class SpatialPylonCalculator extends MBCalculator<SpatialPylonTileEntity, SpatialPylonCluster> {
private final SpatialPylonBlockEntity tqb; public SpatialPylonCalculator(final SpatialPylonTileEntity t) {
public SpatialPylonCalculator(final IAEMultiBlock t) {
super(t); super(t);
this.tqb = (SpatialPylonBlockEntity) t;
} }
@Override @Override
public boolean checkMultiblockScale(final WorldCoord min, final WorldCoord max) { public boolean checkMultiblockScale(final BlockPos min, final BlockPos max) {
return (min.x == max.x && min.y == max.y && min.z != max.z) return (min.getX() == max.getX() && min.getY() == max.getY() && min.getZ() != max.getZ())
|| (min.x == max.x && min.y != max.y && min.z == max.z) || (min.getX() == max.getX() && min.getY() != max.getY() && min.getZ() == max.getZ())
|| (min.x != max.x && min.y == max.y && min.z == max.z); || (min.getX() != max.getX() && min.getY() == max.getY() && min.getZ() == max.getZ());
} }
@Override @Override
public IAECluster createCluster(final World w, final WorldCoord min, final WorldCoord max) { public SpatialPylonCluster createCluster(final World w, final BlockPos min, final BlockPos max) {
return new SpatialPylonCluster(w, min.getBlockPos(), max.getBlockPos()); return new SpatialPylonCluster(w, min, max);
} }
@Override @Override
public boolean verifyInternalStructure(final World w, final WorldCoord min, final WorldCoord max) { public boolean verifyInternalStructure(final World w, final BlockPos min, final BlockPos max) {
for (int x = min.x; x <= max.x; x++) { for (BlockPos p : BlockPos.getAllInBoxMutable(min, max)) {
for (int y = min.y; y <= max.y; y++) { final IAEMultiBlock<?> te = (IAEMultiBlock<?>) w.getTileEntity(p);
for (int z = min.z; z <= max.z; z++) {
final IAEMultiBlock te = (IAEMultiBlock) w.getBlockEntity(new BlockPos(x, y, z));
if (!te.isValid()) { if (te == null || !te.isValid()) {
return false; return false;
}
}
} }
} }
@@ -68,22 +59,11 @@ public class SpatialPylonCalculator extends MBCalculator {
} }
@Override @Override
public void disconnect() { public void updateTiles(final SpatialPylonCluster c, final World w, final BlockPos min, final BlockPos max) {
this.tqb.disconnect(true); for (BlockPos p : BlockPos.getAllInBoxMutable(min, max)) {
} final SpatialPylonTileEntity te = (SpatialPylonTileEntity) w.getTileEntity(p);
te.updateStatus(c);
@Override c.getLine().add(te);
public void updateTiles(final IAECluster cl, final World w, final WorldCoord min, final WorldCoord max) {
final SpatialPylonCluster c = (SpatialPylonCluster) cl;
for (int x = min.x; x <= max.x; x++) {
for (int y = min.y; y <= max.y; y++) {
for (int z = min.z; z <= max.z; z++) {
final SpatialPylonBlockEntity te = (SpatialPylonBlockEntity) w.getBlockEntity(new BlockPos(x, y, z));
te.updateStatus(c);
c.getLine().add((te));
}
}
} }
} }
@@ -25,7 +25,6 @@ import java.util.List;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import appeng.api.networking.IGridHost;
import appeng.me.cluster.IAECluster; import appeng.me.cluster.IAECluster;
import appeng.me.cluster.MBCalculator; import appeng.me.cluster.MBCalculator;
import appeng.tile.spatial.SpatialPylonBlockEntity; import appeng.tile.spatial.SpatialPylonBlockEntity;
@@ -88,8 +87,8 @@ public class SpatialPylonCluster implements IAECluster {
} }
@Override @Override
public Iterator<IGridHost> getTiles() { public Iterator<SpatialPylonTileEntity> getTiles() {
return (Iterator) this.getLine().iterator(); return this.getLine().iterator();
} }
public int tileCount() { public int tileCount() {
@@ -41,11 +41,10 @@ public class AENetworkProxyMultiblock extends AENetworkProxy implements IGridMul
if (this.getCluster() == null) { if (this.getCluster() == null) {
return new ChainedIterator<>(); return new ChainedIterator<>();
} }
return new ProxyNodeIterator(this.getCluster().getTiles()); return new ProxyNodeIterator(this.getCluster().getTiles());
} }
private IAECluster getCluster() { private IAECluster getCluster() {
return ((IAEMultiBlock) this.getMachine()).getCluster(); return ((IAEMultiBlock<?>) this.getMachine()).getCluster();
} }
} }
@@ -37,19 +37,15 @@ import net.minecraft.world.BlockView;
import appeng.api.config.Actionable; import appeng.api.config.Actionable;
import appeng.api.implementations.IPowerChannelState; import appeng.api.implementations.IPowerChannelState;
import appeng.api.networking.GridFlags; import appeng.api.networking.GridFlags;
import appeng.api.networking.IGridHost;
import appeng.api.networking.events.MENetworkChannelsChanged; import appeng.api.networking.events.MENetworkChannelsChanged;
import appeng.api.networking.events.MENetworkEventSubscribe; import appeng.api.networking.events.MENetworkEventSubscribe;
import appeng.api.networking.events.MENetworkPowerStatusChange; import appeng.api.networking.events.MENetworkPowerStatusChange;
import appeng.api.storage.IMEInventory; import appeng.api.storage.IMEInventory;
import appeng.api.storage.channels.IItemStorageChannel; import appeng.api.storage.channels.IItemStorageChannel;
import appeng.api.storage.data.IAEItemStack; import appeng.api.storage.data.IAEItemStack;
import appeng.api.util.AEPartLocation;
import appeng.api.util.WorldCoord;
import appeng.block.crafting.AbstractCraftingUnitBlock; import appeng.block.crafting.AbstractCraftingUnitBlock;
import appeng.block.crafting.AbstractCraftingUnitBlock.CraftingUnitType; import appeng.block.crafting.AbstractCraftingUnitBlock.CraftingUnitType;
import appeng.core.Api; import appeng.core.Api;
import appeng.me.cluster.IAECluster;
import appeng.me.cluster.IAEMultiBlock; import appeng.me.cluster.IAEMultiBlock;
import appeng.me.cluster.implementations.CraftingCPUCalculator; import appeng.me.cluster.implementations.CraftingCPUCalculator;
import appeng.me.cluster.implementations.CraftingCPUCluster; import appeng.me.cluster.implementations.CraftingCPUCluster;
@@ -58,7 +54,8 @@ import appeng.me.helpers.AENetworkProxyMultiblock;
import appeng.tile.grid.AENetworkBlockEntity; import appeng.tile.grid.AENetworkBlockEntity;
import appeng.util.Platform; import appeng.util.Platform;
public class CraftingBlockEntity extends AENetworkBlockEntity implements IAEMultiBlock, IPowerChannelState { public class CraftingBlockEntity extends AENetworkBlockEntity
implements IAEMultiBlock<CraftingCPUCluster>, IPowerChannelState {
private final CraftingCPUCalculator calc = new CraftingCPUCalculator(this); private final CraftingCPUCalculator calc = new CraftingCPUCalculator(this);
private CompoundTag previousState = null; private CompoundTag previousState = null;
@@ -92,7 +89,7 @@ public class CraftingBlockEntity extends AENetworkBlockEntity implements IAEMult
@Override @Override
public boolean canBeRotated() { public boolean canBeRotated() {
return true;// return BlockCraftingUnit.checkType( world.getBlockMetadata( xCoord, yCoord, return true;// return BlockCraftingUnit.checkType( world.getBlockMetadata( xCoord, yCoord,
// zCoord ), // zCoord ),
// BlockCraftingUnit.BASE_MONITOR ); // BlockCraftingUnit.BASE_MONITOR );
} }
@@ -109,7 +106,7 @@ public class CraftingBlockEntity extends AENetworkBlockEntity implements IAEMult
return false; return false;
} }
final AbstractCraftingUnitBlock unit = (AbstractCraftingUnitBlock) this.world.getBlockState(this.pos) final AbstractCraftingUnitBlock<?> unit = (AbstractCraftingUnitBlock<?>) this.world.getBlockState(this.pos)
.getBlock(); .getBlock();
return unit.type == CraftingUnitType.ACCELERATOR; return unit.type == CraftingUnitType.ACCELERATOR;
} }
@@ -118,11 +115,11 @@ public class CraftingBlockEntity extends AENetworkBlockEntity implements IAEMult
public void onReady() { public void onReady() {
super.onReady(); super.onReady();
this.getProxy().setVisualRepresentation(this.getItemFromTile(this)); this.getProxy().setVisualRepresentation(this.getItemFromTile(this));
this.calc.calculateMultiblock(world, getLocation()); this.calc.calculateMultiblock(world, pos);
} }
public void updateMultiBlock(BlockPos changedPos) { public void updateMultiBlock(BlockPos changedPos) {
this.calc.updateMultiblockAfterNeighborUpdate(this.world, this.getLocation(), changedPos); this.calc.updateMultiblockAfterNeighborUpdate(this.world, pos, changedPos);
} }
public void updateStatus(final CraftingCPUCluster c) { public void updateStatus(final CraftingCPUCluster c) {
@@ -157,7 +154,7 @@ public class CraftingBlockEntity extends AENetworkBlockEntity implements IAEMult
// Not using flag 2 here (only send to clients, prevent block update) will cause // Not using flag 2 here (only send to clients, prevent block update) will cause
// infinite loops // infinite loops
// In case there is an inconsistency in the crafting clusters. // In case there is an inconsistency in the crafting clusters.
this.world.setBlockState(this.pos, newState, BlockUpdateFlag.BLOCK_UPDATE); this.world.setBlockState(this.pos, newState, 2);
} }
} }
@@ -211,7 +208,7 @@ public class CraftingBlockEntity extends AENetworkBlockEntity implements IAEMult
} }
@Override @Override
public IAECluster getCluster() { public CraftingCPUCluster getCluster() {
return this.cluster; return this.cluster;
} }
@@ -252,21 +249,18 @@ public class CraftingBlockEntity extends AENetworkBlockEntity implements IAEMult
this.cluster.cancel(); this.cluster.cancel();
final IMEInventory<IAEItemStack> inv = this.cluster.getInventory(); final IMEInventory<IAEItemStack> inv = this.cluster.getInventory();
final LinkedList<WorldCoord> places = new LinkedList<>(); final LinkedList<BlockPos> places = new LinkedList<>();
final Iterator<IGridHost> i = this.cluster.getTiles(); final Iterator<CraftingTileEntity> i = this.cluster.getTiles();
while (i.hasNext()) { while (i.hasNext()) {
final IGridHost h = i.next(); final CraftingTileEntity h = i.next();
if (h == this) { if (h == this) {
places.add(new WorldCoord(this)); places.add(pos);
} else { } else {
final BlockEntity te = (BlockEntity) h; for (Direction d : Direction.values()) {
BlockPos p = h.pos.offset(d);
for (final AEPartLocation d : AEPartLocation.SIDE_LOCATIONS) { if (this.world.isAirBlock(p)) {
final WorldCoord wc = new WorldCoord(te); places.add(p);
wc.add(d, 1);
if (this.world.isAir(wc.getPos())) {
places.add(wc);
} }
} }
} }
@@ -290,10 +284,10 @@ public class CraftingBlockEntity extends AENetworkBlockEntity implements IAEMult
break; break;
} }
final WorldCoord wc = places.poll(); final BlockPos pos = places.poll();
places.add(wc); places.add(pos);
Platform.spawnDrops(this.world, wc.getPos(), Collections.singletonList(g.createItemStack())); Platform.spawnDrops(this.world, pos, Collections.singletonList(g.createItemStack()));
} }
} }
@@ -45,7 +45,6 @@ import appeng.api.util.DimensionalCoord;
import appeng.block.qnb.QnbFormedState; import appeng.block.qnb.QnbFormedState;
import appeng.core.Api; import appeng.core.Api;
import appeng.me.GridAccessException; import appeng.me.GridAccessException;
import appeng.me.cluster.IAECluster;
import appeng.me.cluster.IAEMultiBlock; import appeng.me.cluster.IAEMultiBlock;
import appeng.me.cluster.implementations.QuantumCalculator; import appeng.me.cluster.implementations.QuantumCalculator;
import appeng.me.cluster.implementations.QuantumCluster; import appeng.me.cluster.implementations.QuantumCluster;
@@ -53,7 +52,8 @@ import appeng.tile.grid.AENetworkInvBlockEntity;
import appeng.tile.inventory.AppEngInternalInventory; import appeng.tile.inventory.AppEngInternalInventory;
import appeng.util.inv.InvOperation; import appeng.util.inv.InvOperation;
public class QuantumBridgeBlockEntity extends AENetworkInvBlockEntity implements IAEMultiBlock, Tickable { public class QuantumBridgeBlockEntity extends AENetworkInvBlockEntity
implements IAEMultiBlock<QuantumCluster>, Tickable {
private final byte corner = 16; private final byte corner = 16;
private final AppEngInternalInventory internalInventory = new AppEngInternalInventory(this, 1, 1); private final AppEngInternalInventory internalInventory = new AppEngInternalInventory(this, 1, 1);
@@ -185,7 +185,7 @@ public class QuantumBridgeBlockEntity extends AENetworkInvBlockEntity implements
} }
@Override @Override
public IAECluster getCluster() { public QuantumCluster getCluster() {
return this.cluster; return this.cluster;
} }
@@ -204,11 +204,7 @@ public class QuantumBridgeBlockEntity extends AENetworkInvBlockEntity implements
} }
if (this.isCorner() || this.isCenter()) { if (this.isCorner() || this.isCenter()) {
final EnumSet<Direction> sides = EnumSet.noneOf(Direction.class); EnumSet<Direction> sides = EnumSet.copyOf(this.getAdjacentQuantumBridges());
for (final Direction dir : this.getAdjacentQuantumBridges()) {
sides.add(dir);
}
this.getProxy().setValidSides(sides); this.getProxy().setValidSides(sides);
} else { } else {
this.getProxy().setValidSides(EnumSet.allOf(Direction.class)); this.getProxy().setValidSides(EnumSet.allOf(Direction.class));
@@ -268,7 +264,7 @@ public class QuantumBridgeBlockEntity extends AENetworkInvBlockEntity implements
} }
public void neighborUpdate(BlockPos fromPos) { public void neighborUpdate(BlockPos fromPos) {
this.calc.updateMultiblockAfterNeighborUpdate(this.world, this.getLocation(), fromPos); this.calc.updateMultiblockAfterNeighborUpdate(this.world, this.pos, fromPos);
} }
@Override @Override
@@ -39,7 +39,7 @@ import appeng.me.helpers.AENetworkProxy;
import appeng.me.helpers.AENetworkProxyMultiblock; import appeng.me.helpers.AENetworkProxyMultiblock;
import appeng.tile.grid.AENetworkBlockEntity; import appeng.tile.grid.AENetworkBlockEntity;
public class SpatialPylonBlockEntity extends AENetworkBlockEntity implements IAEMultiBlock { public class SpatialPylonBlockEntity extends AENetworkBlockEntity implements IAEMultiBlock<SpatialPylonCluster> {
public static final int DISPLAY_END_MIN = 0x01; public static final int DISPLAY_END_MIN = 0x01;
public static final int DISPLAY_END_MAX = 0x02; public static final int DISPLAY_END_MAX = 0x02;
@@ -79,7 +79,7 @@ public class SpatialPylonBlockEntity extends AENetworkBlockEntity implements IAE
@Override @Override
public void onReady() { public void onReady() {
super.onReady(); super.onReady();
this.calc.calculateMultiblock(world, getLocation()); this.calc.calculateMultiblock(world, pos);
} }
@Override @Override
@@ -89,7 +89,7 @@ public class SpatialPylonBlockEntity extends AENetworkBlockEntity implements IAE
} }
public void neighborUpdate(BlockPos changedPos) { public void neighborUpdate(BlockPos changedPos) {
this.calc.updateMultiblockAfterNeighborUpdate(this.world, this.getLocation(), changedPos); this.calc.updateMultiblockAfterNeighborUpdate(this.world, pos, changedPos);
} }
@Override @Override
@@ -122,9 +122,9 @@ public class SpatialPylonBlockEntity extends AENetworkBlockEntity implements IAE
this.displayBits = 0; this.displayBits = 0;
if (this.cluster != null) { if (this.cluster != null) {
if (this.cluster.getBoundsMin().equals(this.getLocation())) { if (this.cluster.getBoundsMin().equals(this.pos)) {
this.displayBits = DISPLAY_END_MIN; this.displayBits = DISPLAY_END_MIN;
} else if (this.cluster.getBoundsMax().equals(this.getLocation())) { } else if (this.cluster.getBoundsMax().equals(this.pos)) {
this.displayBits = DISPLAY_END_MAX; this.displayBits = DISPLAY_END_MAX;
} else { } else {
this.displayBits = DISPLAY_MIDDLE; this.displayBits = DISPLAY_MIDDLE;
+14 -12
View File
@@ -794,34 +794,36 @@ public class Platform {
Preconditions.checkNotNull(src); Preconditions.checkNotNull(src);
Preconditions.checkNotNull(mode); Preconditions.checkNotNull(mode);
final T possible = cell.injectItems(input.copy(), Actionable.SIMULATE, src); final T overflow = cell.injectItems(input.copy(), Actionable.SIMULATE, src);
long stored = input.getStackSize(); long transferAmount = input.getStackSize();
if (possible != null) { if (overflow != null) {
stored -= possible.getStackSize(); transferAmount -= overflow.getStackSize();
} }
final double energyFactor = Math.max(1.0, cell.getChannel().transferFactor()); final double energyFactor = Math.max(1.0, cell.getChannel().transferFactor());
final double availablePower = energy.extractAEPower(stored / energyFactor, Actionable.SIMULATE, final double availablePower = energy.extractAEPower(transferAmount / energyFactor, Actionable.SIMULATE,
PowerMultiplier.CONFIG); PowerMultiplier.CONFIG);
final long itemToAdd = Math.min((long) ((availablePower * energyFactor) + 0.9), stored); final long itemToAdd = Math.min((long) ((availablePower * energyFactor) + 0.9), transferAmount);
if (itemToAdd > 0) { if (itemToAdd > 0) {
if (mode == Actionable.MODULATE) { if (mode == Actionable.MODULATE) {
energy.extractAEPower(stored / energyFactor, Actionable.MODULATE, PowerMultiplier.CONFIG); energy.extractAEPower(transferAmount / energyFactor, Actionable.MODULATE, PowerMultiplier.CONFIG);
if (itemToAdd < input.getStackSize()) { if (itemToAdd < input.getStackSize()) {
final long original = input.getStackSize(); final long original = input.getStackSize();
final T leftover = input.copy();
final T split = input.copy(); final T split = input.copy();
split.decStackSize(itemToAdd);
input.setStackSize(itemToAdd); leftover.decStackSize(itemToAdd);
split.add(cell.injectItems(input, Actionable.MODULATE, src)); split.setStackSize(itemToAdd);
leftover.add(cell.injectItems(split, Actionable.MODULATE, src));
src.player().ifPresent(player -> { src.player().ifPresent(player -> {
final long diff = original - split.getStackSize(); final long diff = original - leftover.getStackSize();
AeStats.ItemsInserted.addToPlayer(player, (int) diff); AeStats.ItemsInserted.addToPlayer(player, (int) diff);
}); });
return split; return leftover;
} }
final T ret = cell.injectItems(input, Actionable.MODULATE, src); final T ret = cell.injectItems(input, Actionable.MODULATE, src);
@@ -25,9 +25,9 @@ import appeng.api.networking.IGridNode;
import appeng.api.util.AEPartLocation; import appeng.api.util.AEPartLocation;
public final class ProxyNodeIterator implements Iterator<IGridNode> { public final class ProxyNodeIterator implements Iterator<IGridNode> {
private final Iterator<IGridHost> hosts; private final Iterator<? extends IGridHost> hosts;
public ProxyNodeIterator(final Iterator<IGridHost> hosts) { public ProxyNodeIterator(final Iterator<? extends IGridHost> hosts) {
this.hosts = hosts; this.hosts = hosts;
} }
@@ -190,6 +190,7 @@
"gui.appliedenergistics2.FluidFormationPlane": "Fluid Formation Plane", "gui.appliedenergistics2.FluidFormationPlane": "Fluid Formation Plane",
"gui.appliedenergistics2.FluidInterface": "ME Fluid Interface", "gui.appliedenergistics2.FluidInterface": "ME Fluid Interface",
"gui.appliedenergistics2.FluidLevelEmitter": "ME Fluid Level Emitter", "gui.appliedenergistics2.FluidLevelEmitter": "ME Fluid Level Emitter",
"gui.appliedenergistics2.FluidLevelEmitterUnit": "mB",
"gui.appliedenergistics2.Fluix": "Fluix", "gui.appliedenergistics2.Fluix": "Fluix",
"gui.appliedenergistics2.FormationPlane": "Formation Plane", "gui.appliedenergistics2.FormationPlane": "Formation Plane",
"gui.appliedenergistics2.FromStorage": "Available", "gui.appliedenergistics2.FromStorage": "Available",
@@ -4,8 +4,8 @@
"particle": "appliedenergistics2:block/wireless_access_point_inside", "particle": "appliedenergistics2:block/wireless_access_point_inside",
"inside": "appliedenergistics2:block/wireless_access_point_inside", "inside": "appliedenergistics2:block/wireless_access_point_inside",
"1": "appliedenergistics2:block/wireless_access_point", "1": "appliedenergistics2:block/wireless_access_point",
"sides": "appliedenergistics2:parts/monitor_sides", "sides": "appliedenergistics2:part/monitor_sides",
"sidesStatus": "appliedenergistics2:parts/monitor_sides_status" "sidesStatus": "appliedenergistics2:part/monitor_sides_status"
}, },
"elements": [ "elements": [
{ {
@@ -1,6 +1,6 @@
{ {
"textures": { "textures": {
"indicator": "appliedenergistics2:parts/monitor_sides_status_has_channel" "indicator": "appliedenergistics2:part/monitor_sides_status_has_channel"
}, },
"elements": [ "elements": [
{ {
@@ -1,6 +1,6 @@
{ {
"textures": { "textures": {
"indicator": "appliedenergistics2:parts/monitor_sides_status_off" "indicator": "appliedenergistics2:part/monitor_sides_status_off"
}, },
"elements": [ "elements": [
{ {
@@ -1,6 +1,6 @@
{ {
"textures": { "textures": {
"indicator": "appliedenergistics2:parts/monitor_sides_status_on" "indicator": "appliedenergistics2:part/monitor_sides_status_on"
}, },
"elements": [ "elements": [
{ {
@@ -1,8 +1,8 @@
{ {
"parent": "appliedenergistics2:item/part_base", "parent": "appliedenergistics2:item/part_base",
"textures": { "textures": {
"sides": "appliedenergistics2:parts/plane_sides", "sides": "appliedenergistics2:part/plane_sides",
"plane": "appliedenergistics2:item/part/annihilation_plane" "plane": "appliedenergistics2:part/annihilation_plane"
}, },
"elements": [ "elements": [
{ {
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/covered_cable_base", "parent": "appliedenergistics2:item/covered_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/covered/black" "base": "appliedenergistics2:part/cable/covered/black"
} }
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/covered_dense_cable_base", "parent": "appliedenergistics2:item/covered_dense_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/dense_covered/black" "base": "appliedenergistics2:part/cable/dense_covered/black"
} }
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/glass_cable_base", "parent": "appliedenergistics2:item/glass_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/glass/black" "base": "appliedenergistics2:part/cable/glass/black"
} }
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/smart_cable_base", "parent": "appliedenergistics2:item/smart_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/smart/black" "base": "appliedenergistics2:part/cable/smart/black"
} }
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/smart_dense_cable_base", "parent": "appliedenergistics2:item/smart_dense_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/dense_smart/black" "base": "appliedenergistics2:part/cable/dense_smart/black"
} }
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/covered_cable_base", "parent": "appliedenergistics2:item/covered_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/covered/blue" "base": "appliedenergistics2:part/cable/covered/blue"
} }
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/covered_dense_cable_base", "parent": "appliedenergistics2:item/covered_dense_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/dense_covered/blue" "base": "appliedenergistics2:part/cable/dense_covered/blue"
} }
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/glass_cable_base", "parent": "appliedenergistics2:item/glass_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/glass/blue" "base": "appliedenergistics2:part/cable/glass/blue"
} }
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/smart_cable_base", "parent": "appliedenergistics2:item/smart_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/smart/blue" "base": "appliedenergistics2:part/cable/smart/blue"
} }
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/smart_dense_cable_base", "parent": "appliedenergistics2:item/smart_dense_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/dense_smart/blue" "base": "appliedenergistics2:part/cable/dense_smart/blue"
} }
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/covered_cable_base", "parent": "appliedenergistics2:item/covered_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/covered/brown" "base": "appliedenergistics2:part/cable/covered/brown"
} }
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/covered_dense_cable_base", "parent": "appliedenergistics2:item/covered_dense_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/dense_covered/brown" "base": "appliedenergistics2:part/cable/dense_covered/brown"
} }
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/glass_cable_base", "parent": "appliedenergistics2:item/glass_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/glass/brown" "base": "appliedenergistics2:part/cable/glass/brown"
} }
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/smart_cable_base", "parent": "appliedenergistics2:item/smart_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/smart/brown" "base": "appliedenergistics2:part/cable/smart/brown"
} }
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/smart_dense_cable_base", "parent": "appliedenergistics2:item/smart_dense_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/dense_smart/brown" "base": "appliedenergistics2:part/cable/dense_smart/brown"
} }
} }
@@ -1,8 +1,8 @@
{ {
"parent": "appliedenergistics2:item/part_base", "parent": "appliedenergistics2:item/part_base",
"textures": { "textures": {
"all": "appliedenergistics2:parts/cable_anchor", "all": "appliedenergistics2:part/cable_anchor",
"particle": "appliedenergistics2:parts/cable_anchor" "particle": "appliedenergistics2:part/cable_anchor"
}, },
"elements": [ "elements": [
{ {
@@ -1,82 +1,8 @@
{ {
"parent": "appliedenergistics2:item/part_base", "parent": "appliedenergistics2:item/cable_interface",
"textures": { "textures": {
"sides": "appliedenergistics2:parts/monitor_sides", "sides": "appliedenergistics2:part/monitor_sides",
"back": "appliedenergistics2:parts/monitor_back", "back": "appliedenergistics2:part/monitor_back",
"front": "appliedenergistics2:item/part/fluid_interface" "front": "appliedenergistics2:part/fluid_interface"
}, }
"elements": [
{
"from": [2, 2, 7],
"to": [14, 14, 9],
"faces": {
"north": {
"texture": "#front"
},
"south": {
"texture": "#back"
},
"east": {
"texture": "#sides"
},
"west": {
"texture": "#sides"
},
"up": {
"texture": "#sides"
},
"down": {
"texture": "#sides"
}
}
},
{
"from": [5, 5, 10],
"to": [11, 11, 11],
"faces": {
"north": {
"texture": "#front"
},
"south": {
"texture": "#back"
},
"east": {
"texture": "#sides"
},
"west": {
"texture": "#sides"
},
"up": {
"texture": "#sides"
},
"down": {
"texture": "#sides"
}
}
},
{
"from": [5, 5, 9],
"to": [11, 11, 10],
"faces": {
"north": {
"texture": "#front"
},
"south": {
"texture": "#back"
},
"east": {
"texture": "#sides"
},
"west": {
"texture": "#sides"
},
"up": {
"texture": "#sides"
},
"down": {
"texture": "#sides"
}
}
}
]
} }
@@ -1,9 +1,9 @@
{ {
"parent": "appliedenergistics2:item/part_base", "parent": "appliedenergistics2:item/part_base",
"textures": { "textures": {
"sides": "appliedenergistics2:parts/monitor_sides", "sides": "appliedenergistics2:part/monitor_sides",
"back": "appliedenergistics2:parts/monitor_back", "back": "appliedenergistics2:part/monitor_back",
"front": "appliedenergistics2:item/part/interface" "front": "appliedenergistics2:part/interface"
}, },
"elements": [ "elements": [
{ {
@@ -1,9 +1,9 @@
{ {
"parent": "appliedenergistics2:item/display_base", "parent": "appliedenergistics2:item/display_base",
"textures": { "textures": {
"front": "appliedenergistics2:item/part/conversion_monitor", "front": "appliedenergistics2:part/conversion_monitor",
"front_bright": "appliedenergistics2:parts/conversion_monitor_bright", "front_bright": "appliedenergistics2:part/conversion_monitor_bright",
"front_medium": "appliedenergistics2:parts/conversion_monitor_medium", "front_medium": "appliedenergistics2:part/conversion_monitor_medium",
"front_dark": "appliedenergistics2:parts/conversion_monitor_dark" "front_dark": "appliedenergistics2:part/conversion_monitor_dark"
} }
} }
@@ -1,9 +1,9 @@
{ {
"parent": "appliedenergistics2:item/display_base", "parent": "appliedenergistics2:item/display_base",
"textures": { "textures": {
"front": "appliedenergistics2:item/part/crafting_terminal", "front": "appliedenergistics2:part/crafting_terminal",
"front_bright": "appliedenergistics2:parts/crafting_terminal_bright", "front_bright": "appliedenergistics2:part/crafting_terminal_bright",
"front_medium": "appliedenergistics2:parts/crafting_terminal_medium", "front_medium": "appliedenergistics2:part/crafting_terminal_medium",
"front_dark": "appliedenergistics2:parts/crafting_terminal_dark" "front_dark": "appliedenergistics2:part/crafting_terminal_dark"
} }
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/covered_cable_base", "parent": "appliedenergistics2:item/covered_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/covered/cyan" "base": "appliedenergistics2:part/cable/covered/cyan"
} }
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/covered_dense_cable_base", "parent": "appliedenergistics2:item/covered_dense_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/dense_covered/cyan" "base": "appliedenergistics2:part/cable/dense_covered/cyan"
} }
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/glass_cable_base", "parent": "appliedenergistics2:item/glass_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/glass/cyan" "base": "appliedenergistics2:part/cable/glass/cyan"
} }
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/smart_cable_base", "parent": "appliedenergistics2:item/smart_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/smart/cyan" "base": "appliedenergistics2:part/cable/smart/cyan"
} }
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/smart_dense_cable_base", "parent": "appliedenergistics2:item/smart_dense_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/dense_smart/cyan" "base": "appliedenergistics2:part/cable/dense_smart/cyan"
} }
} }
@@ -1,9 +1,9 @@
{ {
"parent": "appliedenergistics2:item/display_base", "parent": "appliedenergistics2:item/display_base",
"textures": { "textures": {
"front": "appliedenergistics2:parts/monitor_front", "front": "appliedenergistics2:part/monitor_front",
"front_bright": "appliedenergistics2:parts/monitor_colored", "front_bright": "appliedenergistics2:part/monitor_colored",
"front_medium": "appliedenergistics2:parts/monitor_bright", "front_medium": "appliedenergistics2:part/monitor_bright",
"front_dark": "appliedenergistics2:parts/monitor_colored" "front_dark": "appliedenergistics2:part/monitor_colored"
} }
} }
@@ -1,9 +1,9 @@
{ {
"parent": "appliedenergistics2:item/part_base", "parent": "appliedenergistics2:item/part_base",
"textures": { "textures": {
"sides": "appliedenergistics2:parts/monitor_sides", "sides": "appliedenergistics2:part/monitor_sides",
"back": "appliedenergistics2:parts/monitor_back", "back": "appliedenergistics2:part/monitor_back",
"front_medium_bright": "appliedenergistics2:parts/monitor_colored" "front_medium_bright": "appliedenergistics2:part/monitor_colored"
}, },
"elements": [ "elements": [
{ {
@@ -1,9 +1,9 @@
{ {
"parent": "appliedenergistics2:item/part_base", "parent": "appliedenergistics2:item/part_base",
"textures": { "textures": {
"sides": "appliedenergistics2:parts/export_bus_sides", "sides": "appliedenergistics2:part/export_bus_sides",
"back": "appliedenergistics2:parts/monitor_back", "back": "appliedenergistics2:part/monitor_back",
"front": "appliedenergistics2:item/part/export_bus" "front": "appliedenergistics2:part/export_bus"
}, },
"elements": [ "elements": [
{ {
@@ -1,8 +1,8 @@
{ {
"parent": "block/block", "parent": "block/block",
"textures": { "textures": {
"anchor": "appliedenergistics2:parts/cable_anchor", "anchor": "appliedenergistics2:part/cable_anchor",
"particle": "appliedenergistics2:parts/cable_anchor" "particle": "appliedenergistics2:part/cable_anchor"
}, },
"display": { "display": {
"gui": { "gui": {
@@ -1,56 +1,7 @@
{ {
"parent": "appliedenergistics2:item/part_base", "parent": "appliedenergistics2:item/annihilation_plane",
"textures": { "textures": {
"sides": "appliedenergistics2:parts/plane_sides", "sides": "appliedenergistics2:part/plane_sides",
"plane": "appliedenergistics2:item/part/fluid_annihilation_plane" "plane": "appliedenergistics2:part/fluid_annihilation_plane"
}, }
"elements": [
{
"name": "Front",
"from": [1, 1, 8],
"to": [15, 15, 9],
"faces": {
"north": {
"texture": "plane"
},
"south": {
"texture": "sides"
},
"east": {
"texture": "sides"
},
"west": {
"texture": "sides"
},
"up": {
"texture": "sides"
},
"down": {
"texture": "sides"
}
}
},
{
"name": "Back",
"from": [5, 5, 9],
"to": [11, 11, 10],
"faces": {
"east": {
"texture": "sides"
},
"south": {
"texture": "sides"
},
"west": {
"texture": "sides"
},
"up": {
"texture": "sides"
},
"down": {
"texture": "sides"
}
}
}
]
} }
@@ -1,82 +1,8 @@
{ {
"parent": "appliedenergistics2:item/part_base", "parent": "appliedenergistics2:item/export_bus",
"textures": { "textures": {
"sides": "appliedenergistics2:parts/export_bus_sides", "sides": "appliedenergistics2:part/export_bus_sides",
"back": "appliedenergistics2:parts/monitor_back", "back": "appliedenergistics2:part/monitor_back",
"front": "appliedenergistics2:item/part/fluid_export_bus" "front": "appliedenergistics2:part/fluid_export_bus"
}, }
"elements": [
{
"from": [4, 4, 8],
"to": [12, 12, 10],
"faces": {
"north": {
"texture": "#front"
},
"south": {
"texture": "#back"
},
"east": {
"texture": "#sides"
},
"west": {
"texture": "#sides"
},
"up": {
"texture": "#sides"
},
"down": {
"texture": "#sides"
}
}
},
{
"from": [5, 5, 7],
"to": [11, 11, 8],
"faces": {
"north": {
"texture": "#front"
},
"south": {
"texture": "#back"
},
"east": {
"texture": "#sides"
},
"west": {
"texture": "#sides"
},
"up": {
"texture": "#sides"
},
"down": {
"texture": "#sides"
}
}
},
{
"from": [6, 6, 6],
"to": [10, 10, 7],
"faces": {
"north": {
"texture": "#front"
},
"south": {
"texture": "#back"
},
"east": {
"texture": "#sides"
},
"west": {
"texture": "#sides"
},
"up": {
"texture": "#sides"
},
"down": {
"texture": "#sides"
}
}
}
]
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/annihilation_plane", "parent": "appliedenergistics2:item/annihilation_plane",
"textures": { "textures": {
"plane": "appliedenergistics2:item/part/fluid_formation_plane" "plane": "appliedenergistics2:part/fluid_formation_plane"
} }
} }
@@ -1,82 +1,8 @@
{ {
"parent": "appliedenergistics2:item/part_base", "parent": "appliedenergistics2:item/import_bus",
"textures": { "textures": {
"sides": "appliedenergistics2:parts/import_bus_sides", "sides": "appliedenergistics2:part/import_bus_sides",
"back": "appliedenergistics2:parts/monitor_back", "back": "appliedenergistics2:part/monitor_back",
"front": "appliedenergistics2:item/part/fluid_import_bus" "front": "appliedenergistics2:part/fluid_import_bus"
}, }
"elements": [
{
"from": [3, 3, 8],
"to": [13, 13, 9],
"faces": {
"north": {
"texture": "#front"
},
"south": {
"texture": "#back"
},
"east": {
"texture": "#sides"
},
"west": {
"texture": "#sides"
},
"up": {
"texture": "#sides"
},
"down": {
"texture": "#sides"
}
}
},
{
"from": [4, 4, 9],
"to": [12, 12, 10],
"faces": {
"north": {
"texture": "#front"
},
"south": {
"texture": "#back"
},
"east": {
"texture": "#sides"
},
"west": {
"texture": "#sides"
},
"up": {
"texture": "#sides"
},
"down": {
"texture": "#sides"
}
}
},
{
"from": [5, 5, 10],
"to": [11, 11, 11],
"faces": {
"north": {
"texture": "#front"
},
"south": {
"texture": "#back"
},
"east": {
"texture": "#sides"
},
"west": {
"texture": "#sides"
},
"up": {
"texture": "#sides"
},
"down": {
"texture": "#sides"
}
}
}
]
} }
@@ -1,38 +1,3 @@
{ {
"parent": "appliedenergistics2:item/part_base", "parent": "appliedenergistics2:item/level_emitter"
"textures": {
"emitter": "appliedenergistics2:item/part/level_emitter_off"
},
"elements": [
{
"from": [7, 6, 7],
"to": [9, 10, 9],
"faces": {
"north": {
"texture": "#emitter",
"uv": [7, 7, 9, 11]
},
"south": {
"texture": "#emitter",
"uv": [7, 7, 9, 11]
},
"east": {
"texture": "#emitter",
"uv": [7, 7, 9, 11]
},
"west": {
"texture": "#emitter",
"uv": [7, 7, 9, 11]
},
"up": {
"texture": "#emitter",
"uv": [7, 7, 9, 9]
},
"down": {
"texture": "#emitter",
"uv": [7, 9, 9, 11]
}
}
}
]
} }
@@ -1,82 +1,8 @@
{ {
"parent": "appliedenergistics2:item/part_base", "parent": "appliedenergistics2:item/storage_bus",
"textures": { "textures": {
"sides": "appliedenergistics2:parts/storage_bus_sides", "sides": "appliedenergistics2:part/storage_bus_sides",
"back": "appliedenergistics2:parts/storage_bus_back", "back": "appliedenergistics2:part/storage_bus_back",
"front": "appliedenergistics2:item/part/fluid_storage_bus" "front": "appliedenergistics2:part/fluid_storage_bus"
}, }
"elements": [
{
"from": [3, 3, 6],
"to": [13, 13, 7],
"faces": {
"north": {
"texture": "#front"
},
"south": {
"texture": "#back"
},
"east": {
"texture": "#sides"
},
"west": {
"texture": "#sides"
},
"up": {
"texture": "#sides"
},
"down": {
"texture": "#sides"
}
}
},
{
"from": [2, 2, 7],
"to": [14, 14, 8],
"faces": {
"north": {
"texture": "#front"
},
"south": {
"texture": "#back"
},
"east": {
"texture": "#sides"
},
"west": {
"texture": "#sides"
},
"up": {
"texture": "#sides"
},
"down": {
"texture": "#sides"
}
}
},
{
"from": [5, 5, 8],
"to": [11, 11, 10],
"faces": {
"north": {
"texture": "#front"
},
"south": {
"texture": "#back"
},
"east": {
"texture": "#sides"
},
"west": {
"texture": "#sides"
},
"up": {
"texture": "#sides"
},
"down": {
"texture": "#sides"
}
}
}
]
} }
@@ -1,9 +1,9 @@
{ {
"parent": "appliedenergistics2:item/display_base", "parent": "appliedenergistics2:item/display_base",
"textures": { "textures": {
"front": "appliedenergistics2:item/part/crafting_terminal", "front": "appliedenergistics2:part/crafting_terminal",
"front_bright": "appliedenergistics2:parts/fluid_terminal/lights_bright", "front_bright": "appliedenergistics2:part/fluid_terminal_bright",
"front_medium": "appliedenergistics2:parts/fluid_terminal/lights_medium", "front_medium": "appliedenergistics2:part/fluid_terminal_medium",
"front_dark": "appliedenergistics2:parts/fluid_terminal/lights_dark" "front_dark": "appliedenergistics2:part/fluid_terminal_dark"
} }
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/covered_cable_base", "parent": "appliedenergistics2:item/covered_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/covered/transparent" "base": "appliedenergistics2:part/cable/covered/transparent"
} }
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/covered_dense_cable_base", "parent": "appliedenergistics2:item/covered_dense_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/dense_covered/transparent" "base": "appliedenergistics2:part/cable/dense_covered/transparent"
} }
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/glass_cable_base", "parent": "appliedenergistics2:item/glass_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/glass/transparent" "base": "appliedenergistics2:part/cable/glass/transparent"
} }
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/smart_cable_base", "parent": "appliedenergistics2:item/smart_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/smart/transparent" "base": "appliedenergistics2:part/cable/smart/transparent"
} }
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/smart_dense_cable_base", "parent": "appliedenergistics2:item/smart_dense_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/dense_smart/transparent" "base": "appliedenergistics2:part/cable/dense_smart/transparent"
} }
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/annihilation_plane", "parent": "appliedenergistics2:item/annihilation_plane",
"textures": { "textures": {
"plane": "appliedenergistics2:item/part/formation_plane" "plane": "appliedenergistics2:part/formation_plane"
} }
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/covered_cable_base", "parent": "appliedenergistics2:item/covered_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/covered/gray" "base": "appliedenergistics2:part/cable/covered/gray"
} }
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/covered_dense_cable_base", "parent": "appliedenergistics2:item/covered_dense_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/dense_covered/gray" "base": "appliedenergistics2:part/cable/dense_covered/gray"
} }
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/glass_cable_base", "parent": "appliedenergistics2:item/glass_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/glass/gray" "base": "appliedenergistics2:part/cable/glass/gray"
} }
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/smart_cable_base", "parent": "appliedenergistics2:item/smart_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/smart/gray" "base": "appliedenergistics2:part/cable/smart/gray"
} }
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/smart_dense_cable_base", "parent": "appliedenergistics2:item/smart_dense_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/dense_smart/gray" "base": "appliedenergistics2:part/cable/dense_smart/gray"
} }
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/covered_cable_base", "parent": "appliedenergistics2:item/covered_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/covered/green" "base": "appliedenergistics2:part/cable/covered/green"
} }
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/covered_dense_cable_base", "parent": "appliedenergistics2:item/covered_dense_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/dense_covered/green" "base": "appliedenergistics2:part/cable/dense_covered/green"
} }
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/glass_cable_base", "parent": "appliedenergistics2:item/glass_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/glass/green" "base": "appliedenergistics2:part/cable/glass/green"
} }
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/smart_cable_base", "parent": "appliedenergistics2:item/smart_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/smart/green" "base": "appliedenergistics2:part/cable/smart/green"
} }
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/smart_dense_cable_base", "parent": "appliedenergistics2:item/smart_dense_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/dense_smart/green" "base": "appliedenergistics2:part/cable/dense_smart/green"
} }
} }
@@ -1,6 +1,6 @@
{ {
"parent": "appliedenergistics2:item/annihilation_plane", "parent": "appliedenergistics2:item/annihilation_plane",
"textures": { "textures": {
"plane": "appliedenergistics2:item/part/identity_annihilation_plane" "plane": "appliedenergistics2:part/identity_annihilation_plane"
} }
} }
@@ -1,9 +1,9 @@
{ {
"parent": "appliedenergistics2:item/part_base", "parent": "appliedenergistics2:item/part_base",
"textures": { "textures": {
"sides": "appliedenergistics2:parts/import_bus_sides", "sides": "appliedenergistics2:part/import_bus_sides",
"back": "appliedenergistics2:parts/monitor_back", "back": "appliedenergistics2:part/monitor_back",
"front": "appliedenergistics2:item/part/import_bus" "front": "appliedenergistics2:part/import_bus"
}, },
"elements": [ "elements": [
{ {

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