Skip to content

Commit fb75818

Browse files
authored
Merge pull request #332 from Mixinors/development-1.16.3
1.11.4
2 parents fff1e64 + 9ac941a commit fb75818

197 files changed

Lines changed: 745 additions & 3046 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

astromine-core/src/datagen/java/com/github/chainmailstudios/astromine/datagen/material/MaterialItemType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public enum MaterialItemType {
1515
DUST,
1616
TINY_DUST,
1717
GEAR,
18-
PLATES,
18+
PLATE,
1919
WIRE,
2020
PICKAXE,
2121
AXE,

astromine-core/src/datagen/java/com/github/chainmailstudios/astromine/datagen/material/MaterialSet.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public Builder metal() {
144144
ingot();
145145
nugget();
146146
block();
147-
plates();
147+
plate();
148148
return gear();
149149
}
150150

@@ -223,8 +223,8 @@ public Builder gear() {
223223
return addType(GEAR, new Identifier("c", name + "_gears"));
224224
}
225225

226-
public Builder plates() {
227-
return addType(PLATES, new Identifier("c", name + "_plates"));
226+
public Builder plate() {
227+
return addType(PLATE, new Identifier("c", name + "_plates"));
228228
}
229229

230230
public Builder wire() {

astromine-core/src/main/java/com/github/chainmailstudios/astromine/common/registry/IdentifierFixRegistry.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,10 @@ public String get(String oldPath) {
4141

4242
@Override
4343
public String register(String oldPath, String newPath) {
44-
if (this.containsKey(newPath)) {
44+
if(oldPath.equals(newPath)) throw new IllegalArgumentException("Invalid Identifier fix attempted with paths " + oldPath + " and " + newPath+", paths identical");
45+
else if (this.containsKey(newPath)) {
4546
if (this.get(newPath).equals(oldPath))
46-
throw new IllegalArgumentException("Recursive Identifier fix attempted with paths " + oldPath + " and " + newPath);
47+
throw new IllegalArgumentException("Invalid Identifier fix attempted with paths " + oldPath + " and " + newPath+", would cause recursion");
4748
else return this.register(oldPath, this.get(newPath));
4849
} else return super.register(oldPath, newPath);
4950
}

astromine-core/src/main/java/com/github/chainmailstudios/astromine/common/widget/blade/FluidFilterWidget.java

Lines changed: 78 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
import com.github.chainmailstudios.astromine.common.utilities.FluidUtilities;
77
import com.github.chainmailstudios.astromine.common.volume.handler.FluidHandler;
88
import com.github.vini2003.blade.client.utilities.Layers;
9-
import com.github.vini2003.blade.common.widget.base.AbstractWidget;
109
import com.github.vini2003.blade.common.widget.base.ButtonWidget;
11-
import com.github.vini2003.blade.common.widget.base.SlotWidget;
10+
import net.fabricmc.api.EnvType;
11+
import net.fabricmc.api.Environment;
1212
import net.minecraft.client.MinecraftClient;
1313
import net.minecraft.client.render.OverlayTexture;
1414
import net.minecraft.client.render.RenderLayer;
@@ -30,78 +30,80 @@
3030
import java.util.function.Supplier;
3131

3232
public class FluidFilterWidget extends ButtonWidget {
33-
private final Identifier FLUID_BACKGROUND = AstromineCommon.identifier("textures/widget/fluid_filter_background.png");
34-
35-
private Supplier<Fluid> fluidSupplier = () -> Fluids.EMPTY;
36-
37-
private Consumer<Fluid> fluidConsumer = fluid -> {};
38-
39-
public Supplier<Fluid> getFluidSupplier() {
40-
return fluidSupplier;
41-
}
42-
43-
public void setFluidSupplier(Supplier<Fluid> fluidSupplier) {
44-
this.fluidSupplier = fluidSupplier;
45-
}
46-
47-
public Consumer<Fluid> getFluidConsumer() {
48-
return fluidConsumer;
49-
}
50-
51-
public void setFluidConsumer(Consumer<Fluid> fluidConsumer) {
52-
this.fluidConsumer = fluidConsumer;
53-
}
54-
55-
public Identifier getBackgroundTexture() {
56-
return FLUID_BACKGROUND;
57-
}
58-
59-
@NotNull
60-
@Override
61-
public List<Text> getTooltip() {
62-
Identifier fluidId = Registry.FLUID.getId(fluidSupplier.get());
63-
64-
return Collections.singletonList(new TranslatableText(String.format("block.%s.%s", fluidId.getNamespace(), fluidId.getPath())));
65-
}
66-
67-
@Override
68-
public void onMouseClicked(float x, float y, int button) {
69-
super.onMouseClicked(x, y, button);
70-
71-
ItemStack stack = getHandler().getPlayer().inventory.getCursorStack();
72-
73-
if (isWithin(x, y)) {
74-
if (!stack.isEmpty()) {
75-
FluidHandler.ofOptional(stack).ifPresent(fluids -> {
76-
fluidSupplier = () -> fluids.getFirst().getFluid();
77-
fluidConsumer.accept(fluidSupplier.get());
78-
});
79-
} else if (button == 2) {
80-
fluidSupplier = () -> Fluids.EMPTY;
81-
fluidConsumer.accept(fluidSupplier.get());
82-
}
83-
}
84-
}
85-
86-
@Override
87-
public void drawWidget(@NotNull MatrixStack matrices, @NotNull VertexConsumerProvider provider) {
88-
if (getHidden()) {
89-
return;
90-
}
91-
92-
float x = getPosition().getX();
93-
float y = getPosition().getY();
94-
95-
float sX = getSize().getWidth();
96-
float sY = getSize().getHeight();
97-
98-
RenderLayer layer = Layers.get(getBackgroundTexture());
99-
100-
BaseRenderer.drawTexturedQuad(matrices, provider, layer, x, y, getSize().getWidth(), getSize().getHeight(), getBackgroundTexture());
101-
102-
if (fluidSupplier.get() != Fluids.EMPTY) {
103-
SpriteRenderer.beginPass().setup(provider, RenderLayer.getSolid()).sprite(FluidUtilities.texture(fluidSupplier.get())[0]).color(FluidUtilities.color(MinecraftClient.getInstance().player, fluidSupplier.get())).light(0x00f000f0).overlay(
104-
OverlayTexture.DEFAULT_UV).alpha(0xff).normal(matrices.peek().getNormal(), 0, 0, 0).position(matrices.peek().getModel(), x + 1, y + 1, x + sX - 1, y + sY - 1, 0F).next(PlayerScreenHandler.BLOCK_ATLAS_TEXTURE);
105-
}
106-
}
33+
private final Identifier FLUID_BACKGROUND = AstromineCommon.identifier("textures/widget/fluid_filter_background.png");
34+
35+
private Supplier<Fluid> fluidSupplier = () -> Fluids.EMPTY;
36+
37+
private Consumer<Fluid> fluidConsumer = fluid -> {};
38+
39+
public Supplier<Fluid> getFluidSupplier() {
40+
return fluidSupplier;
41+
}
42+
43+
public void setFluidSupplier(Supplier<Fluid> fluidSupplier) {
44+
this.fluidSupplier = fluidSupplier;
45+
}
46+
47+
public Consumer<Fluid> getFluidConsumer() {
48+
return fluidConsumer;
49+
}
50+
51+
public void setFluidConsumer(Consumer<Fluid> fluidConsumer) {
52+
this.fluidConsumer = fluidConsumer;
53+
}
54+
55+
public Identifier getBackgroundTexture() {
56+
return FLUID_BACKGROUND;
57+
}
58+
59+
@NotNull
60+
@Override
61+
public List<Text> getTooltip() {
62+
Identifier fluidId = Registry.FLUID.getId(fluidSupplier.get());
63+
64+
return Collections.singletonList(new TranslatableText(String.format("block.%s.%s", fluidId.getNamespace(), fluidId.getPath())));
65+
}
66+
67+
@Environment(EnvType.CLIENT)
68+
@Override
69+
public void onMouseClicked(float x, float y, int button) {
70+
super.onMouseClicked(x, y, button);
71+
72+
ItemStack stack = getHandler().getPlayer().inventory.getCursorStack();
73+
74+
if (isWithin(x, y)) {
75+
if (!stack.isEmpty()) {
76+
FluidHandler.ofOptional(stack).ifPresent(fluids -> {
77+
fluidSupplier = () -> fluids.getFirst().getFluid();
78+
fluidConsumer.accept(fluidSupplier.get());
79+
});
80+
} else if (button == 2) {
81+
fluidSupplier = () -> Fluids.EMPTY;
82+
fluidConsumer.accept(fluidSupplier.get());
83+
}
84+
}
85+
}
86+
87+
@Environment(EnvType.CLIENT)
88+
@Override
89+
public void drawWidget(@NotNull MatrixStack matrices, @NotNull VertexConsumerProvider provider) {
90+
if (getHidden()) {
91+
return;
92+
}
93+
94+
float x = getPosition().getX();
95+
float y = getPosition().getY();
96+
97+
float sX = getSize().getWidth();
98+
float sY = getSize().getHeight();
99+
100+
RenderLayer layer = Layers.get(getBackgroundTexture());
101+
102+
BaseRenderer.drawTexturedQuad(matrices, provider, layer, x, y, getSize().getWidth(), getSize().getHeight(), getBackgroundTexture());
103+
104+
if (fluidSupplier.get() != Fluids.EMPTY) {
105+
SpriteRenderer.beginPass().setup(provider, RenderLayer.getSolid()).sprite(FluidUtilities.texture(fluidSupplier.get())[0]).color(FluidUtilities.color(MinecraftClient.getInstance().player, fluidSupplier.get())).light(0x00f000f0).overlay(
106+
OverlayTexture.DEFAULT_UV).alpha(0xff).normal(matrices.peek().getNormal(), 0, 0, 0).position(matrices.peek().getModel(), x + 1, y + 1, x + sX - 1, y + sY - 1, 0F).next(PlayerScreenHandler.BLOCK_ATLAS_TEXTURE);
107+
}
108+
}
107109
}

astromine-core/src/main/java/com/github/chainmailstudios/astromine/mixin/IdentifierMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public class IdentifierMixin {
5050

5151
@Inject(method = "<init>([Ljava/lang/String;)V", at = @At("RETURN"))
5252
private void init(String[] strings, CallbackInfo ci) {
53-
if (AstromineConfig.get().compatibilityMode && namespace.equals(AstromineCommon.MOD_ID) && IdentifierFixRegistry.INSTANCE.containsKey(path)) {
53+
if (namespace.equals(AstromineCommon.MOD_ID) && AstromineConfig.get().compatibilityMode && IdentifierFixRegistry.INSTANCE.containsKey(path)) {
5454
String oldPath = path;
5555
path = IdentifierFixRegistry.INSTANCE.get(path);
5656
AstromineCommon.LOGGER.info("Fixed identifier path from " + oldPath + " to " + path);

astromine-core/src/main/java/com/github/chainmailstudios/astromine/registry/AstromineIdentifierFixes.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,14 @@
2424

2525
package com.github.chainmailstudios.astromine.registry;
2626

27+
import com.github.chainmailstudios.astromine.common.registry.IdentifierFixRegistry;
28+
2729
public class AstromineIdentifierFixes {
2830
public static void initialize() {
2931

3032
}
33+
34+
public static void register(String oldPath, String newPath) {
35+
IdentifierFixRegistry.INSTANCE.register(oldPath, newPath);
36+
}
3137
}

astromine-core/src/main/resources/assets/astromine/lang/en_au.json

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -318,24 +318,24 @@
318318
"item.astromine.fools_gold_tiny_dust": "Fool's Gold Tiny Dust",
319319
"item.astromine.glowstone_tiny_dust": "Glowstone Tiny Dust",
320320
"item.astromine.meteoric_steel_tiny_dust": "Meteoric Steel Tiny Dust",
321-
"item.astromine.iron_plates": "Iron Plates",
322-
"item.astromine.metite_plates": "Metite Plates",
323-
"item.astromine.gold_plates": "Gold Plates",
324-
"item.astromine.netherite_plates": "Netherite Plates",
325-
"item.astromine.stellum_plates": "Stellum Plates",
326-
"item.astromine.univite_plates": "Univite Plates",
327-
"item.astromine.tin_plates": "Tin Plates",
328-
"item.astromine.copper_plates": "Copper Plates",
329-
"item.astromine.silver_plates": "Silver Plates",
330-
"item.astromine.lead_plates": "Lead Plates",
331-
"item.astromine.bronze_plates": "Bronze Plates",
332-
"item.astromine.steel_plates": "Steel Plates",
333-
"item.astromine.electrum_plates": "Electrum Plates",
334-
"item.astromine.rose_gold_plates": "Rose Gold Plates",
335-
"item.astromine.sterling_silver_plates": "Sterling Silver Plates",
336-
"item.astromine.fools_gold_plates": "Fool's Gold Plates",
337-
"item.astromine.lunum_plates": "Lunum Plates",
338-
"item.astromine.meteoric_steel_plates": "Meteoric Steel Plates",
321+
"item.astromine.iron_plate": "Iron Plate",
322+
"item.astromine.metite_plate": "Metite Plate",
323+
"item.astromine.gold_plate": "Gold Plate",
324+
"item.astromine.netherite_plate": "Netherite Plate",
325+
"item.astromine.stellum_plate": "Stellum Plate",
326+
"item.astromine.univite_plate": "Univite Plate",
327+
"item.astromine.tin_plate": "Tin Plate",
328+
"item.astromine.copper_plate": "Copper Plate",
329+
"item.astromine.silver_plate": "Silver Plate",
330+
"item.astromine.lead_plate": "Lead Plate",
331+
"item.astromine.bronze_plate": "Bronze Plate",
332+
"item.astromine.steel_plate": "Steel Plate",
333+
"item.astromine.electrum_plate": "Electrum Plate",
334+
"item.astromine.rose_gold_plate": "Rose Gold Plate",
335+
"item.astromine.sterling_silver_plate": "Sterling Silver Plate",
336+
"item.astromine.fools_gold_plate": "Fool's Gold Plate",
337+
"item.astromine.lunum_plate": "Lunum Plate",
338+
"item.astromine.meteoric_steel_plate": "Meteoric Steel Plate",
339339
"item.astromine.iron_gear": "Iron Gear",
340340
"item.astromine.metite_gear": "Metite Gear",
341341
"item.astromine.gold_gear": "Gold Gear",
@@ -727,7 +727,7 @@
727727
"text.astromine.components.plates.page_one.title": "Plates",
728728
"text.astromine.components.plates.page_one.text": "Thin sheets of metal, plates are useful for constructing $(thing)housing$() for $(thing)machinery$().",
729729
"text.astromine.components.plates.page_two.title": "Recipe",
730-
"text.astromine.components.plates.page_two.text": "While the recipe shown is clearly for $(item)Iron Plates$(), simply substituting the $(item)Iron Ingots$() with any other $(thing)Ingots$() will create plates of that type.",
730+
"text.astromine.components.plates.page_two.text": "While the recipe shown is clearly for an $(item)Iron Plate$(), simply substituting the $(item)Iron Ingots$() with any other $(thing)Ingots$() will create a plate of that type.",
731731
"text.astromine.creatures.space_slime.title": "Space Slime",
732732
"text.astromine.creatures.space_slime.page_one.title": "Space Slime",
733733
"text.astromine.creatures.space_slime.page_one.text": "A fierce adversary which inhabits large sections of traversable space.",
@@ -1017,8 +1017,8 @@
10171017
"advancements.astromine.get_triturator.description": "Craft a Triturator",
10181018
"advancements.astromine.get_gear.title": "Grinds Your Gears",
10191019
"advancements.astromine.get_gear.description": "Craft a Gear",
1020-
"advancements.astromine.get_plates.title": "Flat Ingots",
1021-
"advancements.astromine.get_plates.description": "Craft some Plates",
1020+
"advancements.astromine.get_plate.title": "Flat Ingots",
1021+
"advancements.astromine.get_plate.description": "Craft a metal Plate",
10221022
"advancements.astromine.get_rose_gold_ingot.title": "Pretty in Pink",
10231023
"advancements.astromine.get_rose_gold_ingot.description": "Obtain a Rose Gold Ingot",
10241024
"advancements.astromine.get_basic_circuit.title": "Circuit Maker",

astromine-core/src/main/resources/assets/astromine/lang/en_ca.json

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -318,24 +318,24 @@
318318
"item.astromine.fools_gold_tiny_dust": "Fool's Gold Tiny Dust",
319319
"item.astromine.glowstone_tiny_dust": "Glowstone Tiny Dust",
320320
"item.astromine.meteoric_steel_tiny_dust": "Meteoric Steel Tiny Dust",
321-
"item.astromine.iron_plates": "Iron Plates",
322-
"item.astromine.metite_plates": "Metite Plates",
323-
"item.astromine.gold_plates": "Gold Plates",
324-
"item.astromine.netherite_plates": "Netherite Plates",
325-
"item.astromine.stellum_plates": "Stellum Plates",
326-
"item.astromine.univite_plates": "Univite Plates",
327-
"item.astromine.tin_plates": "Tin Plates",
328-
"item.astromine.copper_plates": "Copper Plates",
329-
"item.astromine.silver_plates": "Silver Plates",
330-
"item.astromine.lead_plates": "Lead Plates",
331-
"item.astromine.bronze_plates": "Bronze Plates",
332-
"item.astromine.steel_plates": "Steel Plates",
333-
"item.astromine.electrum_plates": "Electrum Plates",
334-
"item.astromine.rose_gold_plates": "Rose Gold Plates",
335-
"item.astromine.sterling_silver_plates": "Sterling Silver Plates",
336-
"item.astromine.fools_gold_plates": "Fool's Gold Plates",
337-
"item.astromine.lunum_plates": "Lunum Plates",
338-
"item.astromine.meteoric_steel_plates": "Meteoric Steel Plates",
321+
"item.astromine.iron_plate": "Iron Plate",
322+
"item.astromine.metite_plate": "Metite Plate",
323+
"item.astromine.gold_plate": "Gold Plate",
324+
"item.astromine.netherite_plate": "Netherite Plate",
325+
"item.astromine.stellum_plate": "Stellum Plate",
326+
"item.astromine.univite_plate": "Univite Plate",
327+
"item.astromine.tin_plate": "Tin Plate",
328+
"item.astromine.copper_plate": "Copper Plate",
329+
"item.astromine.silver_plate": "Silver Plate",
330+
"item.astromine.lead_plate": "Lead Plate",
331+
"item.astromine.bronze_plate": "Bronze Plate",
332+
"item.astromine.steel_plate": "Steel Plate",
333+
"item.astromine.electrum_plate": "Electrum Plate",
334+
"item.astromine.rose_gold_plate": "Rose Gold Plate",
335+
"item.astromine.sterling_silver_plate": "Sterling Silver Plate",
336+
"item.astromine.fools_gold_plate": "Fool's Gold Plate",
337+
"item.astromine.lunum_plate": "Lunum Plate",
338+
"item.astromine.meteoric_steel_plate": "Meteoric Steel Plate",
339339
"item.astromine.iron_gear": "Iron Gear",
340340
"item.astromine.metite_gear": "Metite Gear",
341341
"item.astromine.gold_gear": "Gold Gear",
@@ -727,7 +727,7 @@
727727
"text.astromine.components.plates.page_one.title": "Plates",
728728
"text.astromine.components.plates.page_one.text": "Thin sheets of metal, plates are useful for constructing $(thing)housing$() for $(thing)machinery$().",
729729
"text.astromine.components.plates.page_two.title": "Recipe",
730-
"text.astromine.components.plates.page_two.text": "While the recipe shown is clearly for $(item)Iron Plates$(), simply substituting the $(item)Iron Ingots$() with any other $(thing)Ingots$() will create plates of that type.",
730+
"text.astromine.components.plates.page_two.text": "While the recipe shown is clearly for an $(item)Iron Plate$(), simply substituting the $(item)Iron Ingots$() with any other $(thing)Ingots$() will create a plate of that type.",
731731
"text.astromine.creatures.space_slime.title": "Space Slime",
732732
"text.astromine.creatures.space_slime.page_one.title": "Space Slime",
733733
"text.astromine.creatures.space_slime.page_one.text": "A fierce adversary which inhabits large sections of traversable space.",
@@ -1017,8 +1017,8 @@
10171017
"advancements.astromine.get_triturator.description": "Craft a Triturator",
10181018
"advancements.astromine.get_gear.title": "Grinds Your Gears",
10191019
"advancements.astromine.get_gear.description": "Craft a Gear",
1020-
"advancements.astromine.get_plates.title": "Flat Ingots",
1021-
"advancements.astromine.get_plates.description": "Craft some Plates",
1020+
"advancements.astromine.get_plate.title": "Flat Ingots",
1021+
"advancements.astromine.get_plate.description": "Craft a metal Plate",
10221022
"advancements.astromine.get_rose_gold_ingot.title": "Pretty in Pink",
10231023
"advancements.astromine.get_rose_gold_ingot.description": "Obtain a Rose Gold Ingot",
10241024
"advancements.astromine.get_basic_circuit.title": "Circuit Maker",

0 commit comments

Comments
 (0)