Skip to content

Commit

Permalink
cleanup some code
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Sep 5, 2024
1 parent 48e0b1f commit aaf0fe6
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
@Mixin(InputWindowElement.class)
public interface AccessorInputWindowElement {
@Accessor("key")
ResourceLocation numsismaticsgetKey();
ResourceLocation numsismatics$getKey();

@Accessor("item")
ItemStack numsismatics$getItem();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,7 @@ public void write(FriendlyByteBuf buffer) {
public void handle(Minecraft mc) {
if (NumismaticsPackets.PACKETS.version == serverVersion)
return;
Component error = Components.literal(Numismatics.NAME+" on the client uses a different network format than the server.")
.append(" You should use the same version of the mod on both sides.");
Component error = Components.translatable("numismatics.packets.mismatched_format", Numismatics.NAME);
mc.getConnection().onDisconnect(error);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import com.simibubi.create.foundation.ponder.SceneBuildingUtil;
import com.simibubi.create.foundation.ponder.Selection;
import net.minecraft.core.Direction;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;

public class SalepointScenes {
public static void item(SceneBuilder scene, SceneBuildingUtil util) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import com.simibubi.create.foundation.ponder.PonderLocalization;
import com.simibubi.create.foundation.ponder.PonderPalette;
import com.simibubi.create.foundation.ponder.PonderScene;
import com.simibubi.create.foundation.ponder.element.AnimatedOverlayElement;
import com.simibubi.create.foundation.ponder.element.InputWindowElement;
import com.simibubi.create.foundation.ponder.ui.PonderUI;
import com.simibubi.create.foundation.utility.Pointing;
Expand Down Expand Up @@ -70,10 +69,10 @@ protected void render(PonderScene scene, PonderUI screen, GuiGraphics graphics,
AccessorInputWindowElement secondElementAccessor = (AccessorInputWindowElement) secondElement;

ItemStack item1 = firstElementAccessor.numsismatics$getItem();
ResourceLocation key1 = firstElementAccessor.numsismaticsgetKey();
ResourceLocation key1 = firstElementAccessor.numsismatics$getKey();
AllIcons icon1 = firstElementAccessor.numsismatics$getIcon();
ItemStack item2 = secondElementAccessor.numsismatics$getItem();
ResourceLocation key2 = secondElementAccessor.numsismaticsgetKey();
ResourceLocation key2 = secondElementAccessor.numsismatics$getKey();
AllIcons icon2 = secondElementAccessor.numsismatics$getIcon();

boolean hasItem1 = !item1.isEmpty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.resources.ResourceLocation;

/*
Copied from Create
*/
/* Copied from Create */
public enum NumismaticsGuiTextures implements ScreenElement {

ANDESITE_DEPOSITOR("andesite_depositor", 182, 79),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import java.util.function.UnaryOperator;

public class NumismaticsAdvancement {

static final ResourceLocation BACKGROUND = Numismatics.asResource("textures/gui/advancements.png");
static final String LANG = "advancement." + Numismatics.MOD_ID + ".";
static final String SECRET_SUFFIX = "\n\u00A77(Hidden Advancement)";
Expand Down Expand Up @@ -125,19 +124,16 @@ public void provideLang(BiConsumer<String, String> consumer) {

@ApiStatus.Internal
public enum TaskType {

SILENT(FrameType.TASK, false, false, false),
NORMAL(FrameType.TASK, true, false, false),
NOISY(FrameType.TASK, true, true, false),
EXPERT(FrameType.GOAL, true, true, false),
SECRET(FrameType.GOAL, true, true, true),

;
SECRET(FrameType.GOAL, true, true, true);

private FrameType frame;
private boolean toast;
private boolean announce;
private boolean hide;
private final FrameType frame;
private final boolean toast;
private final boolean announce;
private final boolean hide;

TaskType(FrameType frame, boolean toast, boolean announce, boolean hide) {
this.frame = frame;
Expand All @@ -149,7 +145,6 @@ public enum TaskType {

@ApiStatus.Internal
public class Builder {

private TaskType type = TaskType.NORMAL;
private boolean externalTrigger;
private int keyIndex;
Expand Down Expand Up @@ -235,7 +230,5 @@ public Builder externalTrigger(CriterionTriggerInstance trigger) {
keyIndex++;
return this;
}

}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"numismatics.packets.mismatched_format": "%s on the client uses a different network format than the server. You should use the same version of the mod on both sides.",

"numismatics.andesite_depositor.price": "Price",

"gui.numismatics.bank_terminal.balance": "Balance: %s %s, %s¤",
Expand Down

0 comments on commit aaf0fe6

Please sign in to comment.