Skip to content

Commit 9dbc155

Browse files
committed
Modify resource path to prevent resource pack conflicts; Fix tag(ComponentSelectorTag) effect not working.
1 parent abd667a commit 9dbc155

17 files changed

+47
-31
lines changed

src/main/java/hellfirepvp/modularmachinery/client/gui/GuiScreenBlueprint.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,17 @@
6868
*/
6969
public class GuiScreenBlueprint extends GuiScreen {
7070

71-
public static final ResourceLocation TEXTURE_BACKGROUND = new ResourceLocation(ModularMachinery.MODID, "textures/gui/guiblueprint.png");
71+
public static final ResourceLocation TEXTURE_BACKGROUND = new ResourceLocation(ModularMachinery.MODID, "textures/gui/guiblueprint_large.png");
72+
public static final int X_SIZE = 176;
73+
public static final int Y_SIZE = 184;
74+
7275
private static final ResourceLocation ic2TileBlock = new ResourceLocation("ic2", "te");
73-
protected final int xSize = 176;
74-
protected final int ySize = 184;
7576

7677
private final DynamicMachine machine;
7778
private final DynamicMachineRenderContext renderContext;
78-
private GuiScrollbar ingredientListScrollbar;
79-
8079
protected int guiLeft;
8180
protected int guiTop;
81+
private GuiScrollbar ingredientListScrollbar;
8282
private int frameCount = 0;
8383

8484
public GuiScreenBlueprint(DynamicMachine machine) {
@@ -89,8 +89,8 @@ public GuiScreenBlueprint(DynamicMachine machine) {
8989
@Override
9090
public void initGui() {
9191
super.initGui();
92-
this.guiLeft = (this.width - this.xSize) / 2;
93-
this.guiTop = (this.height - this.ySize) / 2;
92+
this.guiLeft = (this.width - X_SIZE) / 2;
93+
this.guiTop = (this.height - Y_SIZE) / 2;
9494
this.ingredientListScrollbar = new GuiScrollbar().setLeft(guiLeft + 156).setTop(guiTop + 142).setHeight(34);
9595
}
9696

@@ -106,9 +106,9 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks) {
106106

107107
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
108108
this.mc.getTextureManager().bindTexture(TEXTURE_BACKGROUND);
109-
int x = (this.width - this.xSize) / 2;
110-
int z = (this.height - this.ySize) / 2;
111-
this.drawTexturedModalRect(x, z, 0, 0, this.xSize, this.ySize);
109+
int x = (this.width - X_SIZE) / 2;
110+
int z = (this.height - Y_SIZE) / 2;
111+
this.drawTexturedModalRect(x, z, 0, 0, X_SIZE, Y_SIZE);
112112

113113
if (renderContext.doesRenderIn3D()) {
114114
if (Mouse.isButtonDown(0) && frameCount > 20) {

src/main/java/hellfirepvp/modularmachinery/common/crafting/helper/RecipeCraftingContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public Iterable<ProcessingComponent<?>> getComponentsFor(ComponentRequirement<?,
108108
continue;
109109
}
110110

111-
if (tag != null && typeComponent.tag.equals(requirement.tag)) {
111+
if (tag != null && tag.equals(requirement.tag)) {
112112
validComponents.addFirst(typeComponent);
113113
} else {
114114
validComponents.addLast(typeComponent);

src/main/java/hellfirepvp/modularmachinery/common/crafting/requirement/RequirementCatalyst.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ public RequirementCatalyst deepCopy() {
7272
catalyst = new RequirementCatalyst(this.required.copy());
7373
break;
7474
}
75+
catalyst.setTag(getTag());
7576
catalyst.triggerTime = this.triggerTime;
7677
catalyst.triggerRepeatable = this.triggerRepeatable;
7778
catalyst.chance = this.chance;
@@ -112,7 +113,7 @@ public RequirementCatalyst deepCopyModified(List<RecipeModifier> modifiers) {
112113
catalyst = new RequirementCatalyst(inReq);
113114
break;
114115
}
115-
116+
catalyst.setTag(getTag());
116117
catalyst.chance = RecipeModifier.applyModifiers(modifiers, this, this.chance, true);
117118
catalyst.parallelizeUnaffected = this.parallelizeUnaffected;
118119
if (this.tag != null) {

src/main/java/hellfirepvp/modularmachinery/common/crafting/requirement/RequirementEnergy.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public int getSortingWeight() {
5757
@Override
5858
public ComponentRequirement<Long, RequirementTypeEnergy> deepCopy() {
5959
RequirementEnergy energy = new RequirementEnergy(this.actionType, this.requirementPerTick);
60+
energy.setTag(getTag());
6061
energy.activeIO = this.activeIO;
6162
energy.parallelizeUnaffected = this.parallelizeUnaffected;
6263
return energy;
@@ -66,6 +67,7 @@ public ComponentRequirement<Long, RequirementTypeEnergy> deepCopy() {
6667
public ComponentRequirement<Long, RequirementTypeEnergy> deepCopyModified(List<RecipeModifier> modifiers) {
6768
long requirement = Math.round((double) RecipeModifier.applyModifiers(modifiers, this, this.requirementPerTick, false));
6869
RequirementEnergy energy = new RequirementEnergy(this.actionType, requirement);
70+
energy.setTag(getTag());
6971
energy.activeIO = this.activeIO;
7072
energy.parallelizeUnaffected = this.parallelizeUnaffected;
7173
return energy;

src/main/java/hellfirepvp/modularmachinery/common/crafting/requirement/RequirementFluid.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ public int getSortingWeight() {
7676
@Override
7777
public ComponentRequirement<HybridFluid, RequirementTypeFluid> deepCopy() {
7878
RequirementFluid fluid = new RequirementFluid(this.requirementType, this.actionType, this.required.copy());
79+
fluid.setTag(getTag());
7980
fluid.triggerTime = this.triggerTime;
8081
fluid.triggerRepeatable = this.triggerRepeatable;
8182
fluid.chance = this.chance;
@@ -90,7 +91,7 @@ public ComponentRequirement<HybridFluid, RequirementTypeFluid> deepCopyModified(
9091
HybridFluid hybrid = this.required.copy();
9192
hybrid.setAmount(Math.round(RecipeModifier.applyModifiers(modifiers, this, hybrid.getAmount(), false)));
9293
RequirementFluid fluid = new RequirementFluid(this.requirementType, this.actionType, hybrid);
93-
94+
fluid.setTag(getTag());
9495
fluid.chance = RecipeModifier.applyModifiers(modifiers, this, this.chance, true);
9596
fluid.tagMatch = getTagMatch();
9697
fluid.tagDisplay = getTagDisplay();

src/main/java/hellfirepvp/modularmachinery/common/crafting/requirement/RequirementFluidPerTick.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ public CraftCheck doFluidIO(ProcessingComponent<?> component, RecipeCraftingCont
128128
@Override
129129
public RequirementFluidPerTick deepCopy() {
130130
RequirementFluidPerTick fluid = new RequirementFluidPerTick(actionType, required.asFluidStack());
131+
fluid.setTag(getTag());
131132
fluid.tagMatch = tagMatch;
132133
fluid.tagDisplay = tagDisplay;
133134
return fluid;
@@ -138,7 +139,7 @@ public RequirementFluidPerTick deepCopyModified(List<RecipeModifier> modifiers)
138139
HybridFluid hybrid = this.required.copy();
139140
hybrid.setAmount(Math.round(RecipeModifier.applyModifiers(modifiers, this, hybrid.getAmount(), false)));
140141
RequirementFluidPerTick fluid = new RequirementFluidPerTick(actionType, hybrid.asFluidStack());
141-
142+
fluid.setTag(getTag());
142143
fluid.tagMatch = tagMatch;
143144
fluid.tagDisplay = tagDisplay;
144145
fluid.parallelizeUnaffected = parallelizeUnaffected;

src/main/java/hellfirepvp/modularmachinery/common/crafting/requirement/RequirementIngredientArray.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ public CraftCheck canStartCrafting(ProcessingComponent<?> component, RecipeCraft
148148
@Override
149149
public ComponentRequirement<ItemStack, RequirementTypeIngredientArray> deepCopy() {
150150
RequirementIngredientArray copied = new RequirementIngredientArray(this.itemArray);
151+
copied.setTag(getTag());
151152
copied.parallelizeUnaffected = this.parallelizeUnaffected;
152153
copied.triggerTime = this.triggerTime;
153154
copied.triggerRepeatable = this.triggerRepeatable;
@@ -174,6 +175,7 @@ public ComponentRequirement<ItemStack, RequirementTypeIngredientArray> deepCopyM
174175
item.chance = RecipeModifier.applyModifiers(modifiers, this, item.chance, true);
175176
});
176177
RequirementIngredientArray copied = new RequirementIngredientArray(newArray);
178+
copied.setTag(getTag());
177179
copied.parallelizeUnaffected = this.parallelizeUnaffected;
178180
return copied;
179181
}

src/main/java/hellfirepvp/modularmachinery/common/crafting/requirement/RequirementInterfaceNumInput.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ public CraftCheck canStartCrafting(ProcessingComponent<?> component, RecipeCraft
100100

101101
@Override
102102
public ComponentRequirement<Float, RequirementTypeInterfaceNumInput> deepCopy() {
103-
return new RequirementInterfaceNumInput(type, minValue, maxValue);
103+
RequirementInterfaceNumInput copied = new RequirementInterfaceNumInput(type, minValue, maxValue);
104+
copied.setTag(getTag());
105+
return copied;
104106
}
105107

106108
@Override

src/main/java/hellfirepvp/modularmachinery/common/crafting/requirement/RequirementItem.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ public ComponentRequirement<ItemStack, RequirementTypeItem> deepCopy() {
115115
item = new RequirementItem(this.actionType, this.required.copy());
116116
break;
117117
}
118+
// ComponentSelectorTag
119+
item.setTag(getTag());
118120
item.triggerTime = this.triggerTime;
119121
item.triggerRepeatable = this.triggerRepeatable;
120122
item.chance = this.chance;

src/main/java/hellfirepvp/modularmachinery/common/integration/preview/CategoryStructurePreview.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class CategoryStructurePreview implements IRecipeCategory<StructurePrevie
3232
private final String trTitle;
3333

3434
public CategoryStructurePreview() {
35-
ResourceLocation location = new ResourceLocation(ModularMachinery.MODID, "textures/gui/guiblueprint_jei.png");
35+
ResourceLocation location = new ResourceLocation(ModularMachinery.MODID, "textures/gui/guiblueprint_jei_large.png");
3636
this.background = ModIntegrationJEI.jeiHelpers.getGuiHelper()
3737
.drawableBuilder(location, 4, 4, 168, 180)
3838
.addPadding(6, 0, 0, 0)

0 commit comments

Comments
 (0)