Compare commits

...

5 Commits

Author SHA1 Message Date
NotMyWing 26bb5986c6 Temporary OreDict bus serialization fix
Fixes #542
2025-03-25 16:57:55 +11:00
NotMyWing e175bccace Fix Color Applicator model
Closes #518
2025-03-18 20:02:51 +11:00
NotMyWing 127872b310 Fix Wireless Interface Terminal hotkey
Closes #537
2025-03-18 18:37:00 +11:00
NotMyWing b030cb9f00 Fix slot OOB indexing 2025-03-18 18:30:44 +11:00
NotMyWing f1e5a33a6e Fix ME Portable Cell voiding/dupes & disabled slot idiocy
Fixes #383, fixes #299
2025-03-18 18:22:03 +11:00
8 changed files with 65 additions and 20 deletions
@@ -20,13 +20,14 @@ package appeng.client.gui.implementations;
import appeng.api.implementations.guiobjects.IPortableCell; import appeng.api.implementations.guiobjects.IPortableCell;
import appeng.container.implementations.ContainerMEPortableCell;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
public class GuiMEPortableCell extends GuiMEMonitorable { public class GuiMEPortableCell extends GuiMEMonitorable {
public GuiMEPortableCell(final InventoryPlayer inventoryPlayer, final IPortableCell te) { public GuiMEPortableCell(final InventoryPlayer inventoryPlayer, final IPortableCell te) {
super(inventoryPlayer, te); super(inventoryPlayer, te, new ContainerMEPortableCell(inventoryPlayer, te));
} }
@Override @Override
@@ -1,7 +1,6 @@
package appeng.client.render.model; package appeng.client.render.model;
import com.google.common.collect.ImmutableMap;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.BakedQuad; import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.renderer.block.model.IBakedModel; import net.minecraft.client.renderer.block.model.IBakedModel;
@@ -9,9 +8,8 @@ import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.block.model.ItemOverrideList; import net.minecraft.client.renderer.block.model.ItemOverrideList;
import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing;
import net.minecraftforge.client.model.PerspectiveMapWrapper;
import net.minecraftforge.common.model.TRSRTransformation;
import org.apache.commons.lang3.tuple.Pair; import org.apache.commons.lang3.tuple.Pair;
import org.jetbrains.annotations.NotNull;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import javax.vecmath.Matrix4f; import javax.vecmath.Matrix4f;
@@ -24,15 +22,12 @@ class ColorApplicatorBakedModel implements IBakedModel {
private final IBakedModel baseModel; private final IBakedModel baseModel;
private final ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> transforms;
private final EnumMap<EnumFacing, List<BakedQuad>> quadsBySide; private final EnumMap<EnumFacing, List<BakedQuad>> quadsBySide;
private final List<BakedQuad> generalQuads; private final List<BakedQuad> generalQuads;
ColorApplicatorBakedModel(IBakedModel baseModel, ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> map, TextureAtlasSprite texDark, TextureAtlasSprite texMedium, TextureAtlasSprite texBright) { ColorApplicatorBakedModel(IBakedModel baseModel, TextureAtlasSprite texDark, TextureAtlasSprite texMedium, TextureAtlasSprite texBright) {
this.baseModel = baseModel; this.baseModel = baseModel;
this.transforms = map;
// Put the tint indices in... Since this is an item model, we are ignoring rand // Put the tint indices in... Since this is an item model, we are ignoring rand
this.generalQuads = this.fixQuadTint(null, texDark, texMedium, texBright); this.generalQuads = this.fixQuadTint(null, texDark, texMedium, texBright);
@@ -68,7 +63,7 @@ class ColorApplicatorBakedModel implements IBakedModel {
} }
@Override @Override
public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, long rand) { public @NotNull List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, long rand) {
if (side == null) { if (side == null) {
return this.generalQuads; return this.generalQuads;
} }
@@ -91,22 +86,22 @@ class ColorApplicatorBakedModel implements IBakedModel {
} }
@Override @Override
public TextureAtlasSprite getParticleTexture() { public @NotNull TextureAtlasSprite getParticleTexture() {
return this.baseModel.getParticleTexture(); return this.baseModel.getParticleTexture();
} }
@Override @Override
public ItemCameraTransforms getItemCameraTransforms() { public @NotNull ItemCameraTransforms getItemCameraTransforms() {
return this.baseModel.getItemCameraTransforms(); return this.baseModel.getItemCameraTransforms();
} }
@Override @Override
public ItemOverrideList getOverrides() { public @NotNull ItemOverrideList getOverrides() {
return this.baseModel.getOverrides(); return this.baseModel.getOverrides();
} }
@Override @Override
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(ItemCameraTransforms.TransformType type) { public @NotNull Pair<? extends IBakedModel, Matrix4f> handlePerspective(@NotNull ItemCameraTransforms.TransformType type) {
return PerspectiveMapWrapper.handlePerspective(this, this.transforms, type); return this.baseModel.handlePerspective(type);
} }
} }
@@ -55,7 +55,7 @@ public class ColorApplicatorModel implements IModel {
ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> map = PerspectiveMapWrapper.getTransforms(state); ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> map = PerspectiveMapWrapper.getTransforms(state);
return new ColorApplicatorBakedModel(baseModel, map, texDark, texMedium, texBright); return new ColorApplicatorBakedModel(baseModel, texDark, texMedium, texBright);
} }
private IBakedModel getBaseModel(IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter) { private IBakedModel getBaseModel(IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter) {
@@ -961,9 +961,13 @@ public abstract class AEBaseContainer extends Container {
@Override @Override
public ItemStack slotClick(int slotId, int dragType, ClickType clickTypeIn, @NotNull EntityPlayer player) { public ItemStack slotClick(int slotId, int dragType, ClickType clickTypeIn, @NotNull EntityPlayer player) {
if (slotId >= 0 && clickTypeIn == ClickType.PICKUP) { if (slotId >= 0) {
final var slot = this.getSlot(slotId); final var slot = this.getSlot(slotId);
if (slot instanceof AppEngSlot appEngSlot) { if (slot instanceof SlotDisabled) {
return ItemStack.EMPTY;
}
if (slot instanceof AppEngSlot appEngSlot && clickTypeIn == ClickType.PICKUP) {
var slotStack = slot.getStack(); var slotStack = slot.getStack();
var draggedStack = this.invPlayer.getItemStack(); var draggedStack = this.invPlayer.getItemStack();
@@ -9,7 +9,7 @@ public enum Terminal {
WIRELESS_CRAFTING_TERMINAL(AEApi.instance().definitions().items().wirelessCraftingTerminal(), GuiBridge.GUI_WIRELESS_CRAFTING_TERMINAL), WIRELESS_CRAFTING_TERMINAL(AEApi.instance().definitions().items().wirelessCraftingTerminal(), GuiBridge.GUI_WIRELESS_CRAFTING_TERMINAL),
WIRELESS_PATTERN_TERMINAL(AEApi.instance().definitions().items().wirelessPatternTerminal(), GuiBridge.GUI_WIRELESS_PATTERN_TERMINAL), WIRELESS_PATTERN_TERMINAL(AEApi.instance().definitions().items().wirelessPatternTerminal(), GuiBridge.GUI_WIRELESS_PATTERN_TERMINAL),
WIRELESS_FLUID_TERMINAL(AEApi.instance().definitions().items().wirelessFluidTerminal(), GuiBridge.GUI_WIRELESS_FLUID_TERMINAL), WIRELESS_FLUID_TERMINAL(AEApi.instance().definitions().items().wirelessFluidTerminal(), GuiBridge.GUI_WIRELESS_FLUID_TERMINAL),
WIRELESS_INTERFACE_TERMINAL(AEApi.instance().definitions().items().wirelessInterfaceTerminal(),GuiBridge.GUI_INTERFACE_TERMINAL); WIRELESS_INTERFACE_TERMINAL(AEApi.instance().definitions().items().wirelessInterfaceTerminal(),GuiBridge.GUI_WIRELESS_INTERFACE_TERMINAL);
final GuiBridge bridge; final GuiBridge bridge;
final IItemDefinition itemDefinition; final IItemDefinition itemDefinition;
@@ -41,6 +41,7 @@ import appeng.items.tools.quartz.ToolQuartzCuttingKnife;
import appeng.me.helpers.AENetworkProxy; import appeng.me.helpers.AENetworkProxy;
import appeng.me.helpers.IGridProxyable; import appeng.me.helpers.IGridProxyable;
import appeng.parts.automation.PartLevelEmitter; import appeng.parts.automation.PartLevelEmitter;
import appeng.parts.misc.PartOreDicStorageBus;
import appeng.parts.networking.PartCable; import appeng.parts.networking.PartCable;
import appeng.tile.inventory.AppEngInternalAEInventory; import appeng.tile.inventory.AppEngInternalAEInventory;
import appeng.util.Platform; import appeng.util.Platform;
@@ -315,6 +316,10 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
if (cm != null) { if (cm != null) {
cm.readFromNBT(compound); cm.readFromNBT(compound);
} }
if (this instanceof PartOreDicStorageBus oreDicStorageBus) {
oreDicStorageBus.saveOreMatch(compound.getString("oreMatch"));
}
} }
if (this instanceof IPriorityHost) { if (this instanceof IPriorityHost) {
@@ -378,6 +383,10 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
cm.writeToNBT(output); cm.writeToNBT(output);
} }
if (this instanceof PartOreDicStorageBus oreDicStorageBus) {
output.setString("oreMatch", oreDicStorageBus.getOreExp());
}
if (this instanceof IPriorityHost) { if (this instanceof IPriorityHost) {
final IPriorityHost pHost = (IPriorityHost) this; final IPriorityHost pHost = (IPriorityHost) this;
output.setInteger("priority", pHost.getPriority()); output.setInteger("priority", pHost.getPriority());
@@ -1,5 +1,5 @@
{ {
"parent": "item/generated", "parent": "appliedenergistics2:item/color_applicator_uncolored",
"textures": { "textures": {
"layer0": "appliedenergistics2:items/color_applicator", "layer0": "appliedenergistics2:items/color_applicator",
"layer1": "appliedenergistics2:items/color_applicator_tip_dark", "layer1": "appliedenergistics2:items/color_applicator_tip_dark",
@@ -1,6 +1,42 @@
{ {
"parent": "item/generated", "parent": "item/handheld",
"textures": { "textures": {
"layer0": "appliedenergistics2:items/color_applicator" "layer0": "appliedenergistics2:items/color_applicator"
},
"display": {
"thirdperson_righthand": {
"rotation": [
0,
90,
-55
],
"translation": [
0,
4,
0.5
],
"scale": [
0.85,
0.85,
0.85
]
},
"thirdperson_lefthand": {
"rotation": [
0,
-90,
55
],
"translation": [
0,
4,
0.5
],
"scale": [
0.85,
0.85,
0.85
]
}
} }
} }