Skip to content

Commit

Permalink
fixed compile errors I missed
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed Oct 18, 2024
1 parent 228991f commit 5c182c3
Show file tree
Hide file tree
Showing 37 changed files with 70 additions and 70 deletions.
2 changes: 1 addition & 1 deletion common/src/main/java/muramasa/antimatter/Ref.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class Ref {
/**
* Fluid per Material Unit (Prime Factors: Forge: 3 * 3 * 2 * 2 * 2 * 2 Fabric: 5 * 5 * 5 * 3 * 3 * 2 * 2 * 2)
*/
public static final long L = AntimatterPlatformUtils.isForge() ? 144L : 9000L, L9 = L / 9;
public static final long L = AntimatterPlatformUtils.INSTANCE.isForge() ? 144L : 9000L, L9 = L / 9;


/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public int drawInfo(TankMachine.TankRenderWidget instance, PoseStack stack, Font
}
renderer.draw(stack, FluidPlatformUtils.INSTANCE.getFluidDisplayName(instance.stack).getString(), left, top, 0xFAFAFF);
StringBuilder fluidAmount = new StringBuilder().append(instance.stack.getFluidAmount() / TesseractGraphWrappers.dropletMultiplier);
if (AntimatterPlatformUtils.isFabric()){
if (AntimatterPlatformUtils.INSTANCE.isFabric()){
fluidAmount.append(" ").append(intToSuperScript((int) (instance.stack.getFluidAmount() % 81L))).append("/₈₁");
}
renderer.draw(stack, fluidAmount.toString() + " mb", left, top + 8, 16448255);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ public List<String> getInfo(boolean simple) {
fluidHandler.ifPresent(t -> {
for (int i = 0; i < t.getSize(); i++) {
FluidHolder stack = t.getFluidInTank(i);
String addition = AntimatterPlatformUtils.isFabric() && !stack.isEmpty() ? "/" + stack.getFluidAmount() + "droplets" : "";
String addition = AntimatterPlatformUtils.INSTANCE.isFabric() && !stack.isEmpty() ? "/" + stack.getFluidAmount() + "droplets" : "";
list.add(("Tank " + (i + 1) + ": " + (stack.isEmpty() ? "Empty" : (stack.getFluidAmount() / TesseractGraphWrappers.dropletMultiplier) + "mb" + addition + " of " + FluidPlatformUtils.INSTANCE.getFluidDisplayName(stack).getString())));
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public ItemEnergyHandler(TesseractItemContext context, long capacity, long volta
super(0, capacity, voltageIn, voltageOut, amperageIn, amperageOut);
this.maxEnergy = capacity;
this.context = context;
if (AntimatterPlatformUtils.isFabric()) readFromContextOnFabric();
if (AntimatterPlatformUtils.INSTANCE.isFabric()) readFromContextOnFabric();
}

private void readFromContextOnFabric(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,21 @@ public static Int2ObjectOpenHashMap<BakedModel[]> getStaticConfigMap(String stat
}

public static void put(Item item, IItemProviderOverride override) {
ITEM_OVERRIDES.put(AntimatterPlatformUtils.getIdFromItem(item), override);
ITEM_OVERRIDES.put(AntimatterPlatformUtils.INSTANCE.getIdFromItem(item), override);
}

public static void put(Block block, IBlockProviderOverride override) {
BLOCK_OVERRIDES.put(AntimatterPlatformUtils.getIdFromBlock(block), override);
BLOCK_OVERRIDES.put(AntimatterPlatformUtils.INSTANCE.getIdFromBlock(block), override);
}

public static void onItemModelBuild(ItemLike item, AntimatterItemModelProvider prov) {
IItemProviderOverride override = ITEM_OVERRIDES.get(AntimatterPlatformUtils.getIdFromItem(item.asItem()));
IItemProviderOverride override = ITEM_OVERRIDES.get(AntimatterPlatformUtils.INSTANCE.getIdFromItem(item.asItem()));
if (override != null) override.apply(item.asItem(), prov);
else if (item instanceof IModelProvider) ((IModelProvider) item).onItemModelBuild(item, prov);
}

public static void onBlockModelBuild(Block block, AntimatterBlockStateProvider prov) {
IBlockProviderOverride override = BLOCK_OVERRIDES.get(AntimatterPlatformUtils.getIdFromBlock(block));
IBlockProviderOverride override = BLOCK_OVERRIDES.get(AntimatterPlatformUtils.INSTANCE.getIdFromBlock(block));
if (override != null) override.apply(block, prov, prov.getBuilder(block));
else if (block instanceof IModelProvider) ((IModelProvider) block).onBlockModelBuild(block, prov);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public static BakedModel getBakedFromState(BlockState state) {
}

public static BakedModel getBakedFromItem(Item item) {
return Minecraft.getInstance().getItemRenderer().getItemModelShaper().getModelManager().getModel(new ModelResourceLocation(AntimatterPlatformUtils.getIdFromItem(item), "inventory"));
return Minecraft.getInstance().getItemRenderer().getItemModelShaper().getModelManager().getModel(new ModelResourceLocation(AntimatterPlatformUtils.INSTANCE.getIdFromItem(item), "inventory"));
}

public static TextureAtlasSprite getSprite(ResourceLocation loc) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public AntimatterShapedRecipeBuilder setGroup(String group) {
* Builds this recipe into an {@link FinishedRecipe}.
*/
public void build(Consumer<FinishedRecipe> consumer) {
this.build(consumer, AntimatterPlatformUtils.getIdFromItem(this.result.get(0).getItem()));
this.build(consumer, AntimatterPlatformUtils.INSTANCE.getIdFromItem(this.result.get(0).getItem()));
}

/**
Expand All @@ -154,7 +154,7 @@ public void build(Consumer<FinishedRecipe> consumer, ResourceLocation id) {
}

public void buildTool(Consumer<FinishedRecipe> consumer, String builder){
buildTool(consumer, builder, AntimatterPlatformUtils.getIdFromItem(this.result.get(0).getItem()));
buildTool(consumer, builder, AntimatterPlatformUtils.INSTANCE.getIdFromItem(this.result.get(0).getItem()));
}

public void buildTool(Consumer<FinishedRecipe> consumer, String builder, String id) {
Expand Down Expand Up @@ -238,7 +238,7 @@ public void serializeRecipeData(JsonObject json) {
}
json.add("key", jsonobject);
JsonObject resultObj = new JsonObject();
resultObj.addProperty("item", AntimatterPlatformUtils.getIdFromItem(this.result.getItem()).toString());
resultObj.addProperty("item", AntimatterPlatformUtils.INSTANCE.getIdFromItem(this.result.getItem()).toString());
if (this.result.getCount() > 1) {
resultObj.addProperty("count", this.result.getCount());
}
Expand Down Expand Up @@ -290,7 +290,7 @@ public void serializeRecipeData(JsonObject json) {
JsonArray arr = new JsonArray();
result.forEach(el -> {
JsonObject resultObj = new JsonObject();
resultObj.addProperty("item", AntimatterPlatformUtils.getIdFromItem(el.getItem()).toString());
resultObj.addProperty("item", AntimatterPlatformUtils.INSTANCE.getIdFromItem(el.getItem()).toString());
if (el.getCount() > 1) {
resultObj.addProperty("count", el.getCount());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ public AntimatterShapelessRecipeBuilder group(String groupIn) {
* Builds this recipe into an {@link IFinishedRecipe}.
*/
public void save(Consumer<FinishedRecipe> consumerIn) {
this.save(consumerIn, AntimatterPlatformUtils.getIdFromItem(this.result.getItem()));
this.save(consumerIn, AntimatterPlatformUtils.INSTANCE.getIdFromItem(this.result.getItem()));
}

/**
* Builds this recipe into an {@link IFinishedRecipe}. Use {@link #save(Consumer)} if save is the same as the ID for
* the result.
*/
public void save(Consumer<FinishedRecipe> consumerIn, String save) {
ResourceLocation resourcelocation = AntimatterPlatformUtils.getIdFromItem(this.result.getItem());
ResourceLocation resourcelocation = AntimatterPlatformUtils.INSTANCE.getIdFromItem(this.result.getItem());
if (new ResourceLocation(save).equals(resourcelocation)) {
throw new IllegalStateException("Shapeless Recipe " + save + " should remove its 'save' argument");
} else {
Expand Down Expand Up @@ -175,7 +175,7 @@ public void serializeRecipeData(JsonObject json) {
}
json.add("ingredients", jsonarray);
JsonObject resultObj = new JsonObject();
resultObj.addProperty("item", AntimatterPlatformUtils.getIdFromItem(this.result.getItem()).toString());
resultObj.addProperty("item", AntimatterPlatformUtils.INSTANCE.getIdFromItem(this.result.getItem()).toString());
if (this.result.getCount() > 1) {
resultObj.addProperty("count", this.result.getCount());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public void serializeRecipeData(JsonObject json) {
nestedRecipe.add("ingredients", ingredients);
JsonArray results = new JsonArray();
JsonObject item = new JsonObject();
item.addProperty("item", AntimatterPlatformUtils.getIdFromItem(s.result.asItem()).toString());
item.addProperty("item", AntimatterPlatformUtils.INSTANCE.getIdFromItem(s.result.asItem()).toString());
results.add(item);
nestedRecipe.add("results", results);
nestedRecipes.add(nestedRecipe);
Expand All @@ -157,7 +157,7 @@ public void serializeRecipeData(JsonObject json) {
for (Tuple<ItemStack, Float> result : results) {
JsonObject resultObject = new JsonObject();
ItemStack stack = result.getA();
resultObject.addProperty("item", AntimatterPlatformUtils.getIdFromItem(stack.getItem()).toString());
resultObject.addProperty("item", AntimatterPlatformUtils.INSTANCE.getIdFromItem(stack.getItem()).toString());
if (stack.getCount() != 1)
resultObject.addProperty("count", stack.getCount());
if (stack.hasTag())
Expand All @@ -171,7 +171,7 @@ public void serializeRecipeData(JsonObject json) {
json.add("sequence", nestedRecipes);
json.add("results", resultArray);
JsonObject transitionalItemObject = new JsonObject();
transitionalItemObject.addProperty("item", AntimatterPlatformUtils.getIdFromItem(transitionalItem.asItem()).toString());
transitionalItemObject.addProperty("item", AntimatterPlatformUtils.INSTANCE.getIdFromItem(transitionalItem.asItem()).toString());
json.add("transitionalItem", transitionalItemObject);
json.addProperty("loops", loops);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public void onCompletion() {
public static void afterCompletion(){
for (var e : GLOBAL_TABLES.entrySet()) {
LootTable table = e.getValue().apply(e.getKey()).setParamSet(LootContextParamSets.BLOCK).build();
AntimatterDynamics.RUNTIME_DATA_PACK.addData(AntimatterDynamics.fix(AntimatterPlatformUtils.getIdFromBlock(e.getKey()), "loot_tables/blocks", "json"), AntimatterDynamics.serialize(table));
AntimatterDynamics.RUNTIME_DATA_PACK.addData(AntimatterDynamics.fix(AntimatterPlatformUtils.INSTANCE.getIdFromBlock(e.getKey()), "loot_tables/blocks", "json"), AntimatterDynamics.serialize(table));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ public void run() {
public void onCompletion() {
models().buildAll();
registeredBlocks.forEach((b, s) -> {
if (AntimatterPlatformUtils.getIdFromBlock(b) == null) { //TODO ?
if (AntimatterPlatformUtils.INSTANCE.getIdFromBlock(b) == null) { //TODO ?
BlockBasic block = (BlockBasic) b;
} else {
AntimatterDynamics.DYNAMIC_RESOURCE_PACK.addBlockState(s.toState(), AntimatterPlatformUtils.getIdFromBlock(b));
AntimatterDynamics.DYNAMIC_RESOURCE_PACK.addBlockState(s.toState(), AntimatterPlatformUtils.INSTANCE.getIdFromBlock(b));
}
});
}
Expand All @@ -85,14 +85,14 @@ public void processBlocks(String domain) {
}

public AntimatterBlockModelBuilder getBuilder(Block block) {
if (AntimatterPlatformUtils.getIdFromBlock(block) == null) {
if (AntimatterPlatformUtils.INSTANCE.getIdFromBlock(block) == null) {
return models().getBuilder(((BlockBasic) block).getId());
}
return models().getBuilder(AntimatterPlatformUtils.getIdFromBlock(block).getPath());
return models().getBuilder(AntimatterPlatformUtils.INSTANCE.getIdFromBlock(block).getPath());
}

public AntimatterBlockModelBuilder cubeAll(Block block, ResourceLocation texture) {
return models().cubeAll(AntimatterPlatformUtils.getIdFromBlock(block).toString(), texture);
return models().cubeAll(AntimatterPlatformUtils.INSTANCE.getIdFromBlock(block).toString(), texture);
}

public void state(Block block, IModelLocation model) {
Expand Down Expand Up @@ -136,12 +136,12 @@ public ResourceLocation loc(String domain, String path) {
}

private String name(Block block) {
return AntimatterPlatformUtils.getIdFromBlock(block).getPath();
return AntimatterPlatformUtils.INSTANCE.getIdFromBlock(block).getPath();
}


public ResourceLocation blockTexture(Block block) {
ResourceLocation name = AntimatterPlatformUtils.getIdFromBlock(block);
ResourceLocation name = AntimatterPlatformUtils.INSTANCE.getIdFromBlock(block);
return new ResourceLocation(name.getNamespace(), AntimatterModelProvider.BLOCK_FOLDER + "/" + name.getPath());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void processItemModels(String domain) {
}

public AntimatterItemModelBuilder getBuilder(ItemLike item) {
return getBuilder(AntimatterPlatformUtils.getIdFromItem(item.asItem()).getPath());
return getBuilder(AntimatterPlatformUtils.INSTANCE.getIdFromItem(item.asItem()).getPath());
}

public AntimatterItemModelBuilder tex(ItemLike item, ResourceLocation... textures) {
Expand All @@ -83,15 +83,15 @@ public AntimatterItemModelBuilder blockItem(Block block) {
}

public AntimatterItemModelBuilder blockItem(ItemLike item) {
return withParent(AntimatterPlatformUtils.getIdFromItem(item.asItem()).getPath(), modLoc("block/" + AntimatterPlatformUtils.getIdFromItem(item.asItem()).getPath()));
return withParent(AntimatterPlatformUtils.INSTANCE.getIdFromItem(item.asItem()).getPath(), modLoc("block/" + AntimatterPlatformUtils.INSTANCE.getIdFromItem(item.asItem()).getPath()));
}

public ResourceLocation existing(String domain, String path) {
return new ResourceLocation(domain, path);
}

public AntimatterItemModelBuilder getAntimatterBuilder(ItemLike item) {
return getBuilder(AntimatterPlatformUtils.getIdFromItem(item.asItem()).getPath());
return getBuilder(AntimatterPlatformUtils.INSTANCE.getIdFromItem(item.asItem()).getPath());
}

public AntimatterItemModelBuilder modelAndTexture(ItemLike item, String namespace, String path) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ protected void processTags(String domain) {
});
});
//TODO move this to a felt api module
if (AntimatterPlatformUtils.isFabric()){
if (AntimatterPlatformUtils.INSTANCE.isFabric()){
for (DyeColor dyeColor : DyeColor.values()){
this.tag(TagUtils.getForgelikeItemTag("dyes/" + dyeColor.getName())).add(Registry.ITEM.get(new ResourceLocation(dyeColor.getName() + "_dye")));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public AntimatterShapedRecipeBuilder getStackRecipe(String groupName, boolean cu
recipeBuilder.addCriterion(id, hasSafeItem((TagKey<Item>) tag));
criteria.add(id);
} else if (o instanceof ItemLike itemLike){
String id = "has_" + AntimatterPlatformUtils.getIdFromItem(itemLike.asItem()).getPath();
String id = "has_" + AntimatterPlatformUtils.INSTANCE.getIdFromItem(itemLike.asItem()).getPath();
if (criteria.contains(id)) continue;
recipeBuilder.addCriterion(id, hasSafeItem(itemLike));
criteria.add(id);
Expand Down Expand Up @@ -129,7 +129,7 @@ public void shapeless(Consumer<FinishedRecipe> consumer, String domain, String r
try {
if (input instanceof ItemLike l) {
builder.requires(l);
String id = "has_" + AntimatterPlatformUtils.getIdFromItem(l.asItem()).getPath();
String id = "has_" + AntimatterPlatformUtils.INSTANCE.getIdFromItem(l.asItem()).getPath();
if (criteria.contains(id)) continue;
builder.unlockedBy(id, hasSafeItem(l));
criteria.add(id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public MenuType<T> getContainerType() {
}

static <T extends AbstractContainerMenu> MenuType<T> create(TriFunction<Integer, Inventory, FriendlyByteBuf, T> factory) {
return AntimatterPlatformUtils.create(factory);
return AntimatterPlatformUtils.INSTANCE.create(factory);
}

public abstract T onContainerCreate(int windowId, Inventory inv, FriendlyByteBuf data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public AntimatterContainer(IGuiHandler handler, MenuType<?> containerType, int w
this.handler = new GuiInstance(handler, this, handler.isRemote());
this.containerType = containerType;
//TODO move this to event
if (AntimatterPlatformUtils.isFabric()){
if (AntimatterPlatformUtils.INSTANCE.isFabric()){
CommonEvents.onContainerOpen(playerInv.player, this);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void mouseOver(PoseStack stack, double mouseX, double mouseY, float parti
List<Component> str = new ArrayList<>();
str.add(FluidPlatformUtils.INSTANCE.getFluidDisplayName(this.stack));
long mb = (this.stack.getFluidAmount() / TesseractGraphWrappers.dropletMultiplier);
if (AntimatterPlatformUtils.isFabric()){
if (AntimatterPlatformUtils.INSTANCE.isFabric()){
str.add(Utils.translatable("antimatter.tooltip.fluid.amount", Utils.literal(mb + " " + intToSuperScript(this.stack.getFluidAmount() % 81L) + "/₈₁ L")).withStyle(ChatFormatting.BLUE));
} else {
str.add(Utils.translatable("antimatter.tooltip.fluid.amount", mb + " L").withStyle(ChatFormatting.BLUE));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public RecipeMapCategory(IRecipeMap map, RecipeType<IRecipe> type, GuiData gui,
this.icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(item));
}
} else {
Item item = iconId == null ? Data.DEBUG_SCANNER : AntimatterPlatformUtils.getItemFromID(iconId);
Item item = iconId == null ? Data.DEBUG_SCANNER : AntimatterPlatformUtils.INSTANCE.getItemFromID(iconId);
if (item == Items.AIR) item = Data.DEBUG_SCANNER;
this.icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(item, 1));
}
Expand Down Expand Up @@ -239,7 +239,7 @@ private void createFluidTooltip(IRecipeSlotView ing, List<Component> list, Fluid
list.remove(2);
list.remove(1);
long mb = (stack.getFluidAmount() / TesseractGraphWrappers.dropletMultiplier);
if (AntimatterPlatformUtils.isFabric()){
if (AntimatterPlatformUtils.INSTANCE.isFabric()){
list.add(Utils.translatable("antimatter.tooltip.fluid.amount", Utils.literal(mb + " " + intToSuperScript(stack.getFluidAmount() % 81L) + "/₈₁ L")).withStyle(ChatFormatting.BLUE));
} else {
list.add(Utils.translatable("antimatter.tooltip.fluid.amount", mb + " L").withStyle(ChatFormatting.BLUE));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public StoneType createStoneType(String id, String material, String texture, Sou
}

public StoneType createStoneType(String id, String material, String texture, SoundType soundType, String stoneState) {
return AntimatterAPI.register(StoneType.class, new StoneType(Ref.MOD_KJS, id, Material.get(material), new Texture(texture), soundType, false).setStateSupplier(() -> AntimatterPlatformUtils.getBlockFromId(new ResourceLocation(stoneState)).defaultBlockState()));
return AntimatterAPI.register(StoneType.class, new StoneType(Ref.MOD_KJS, id, Material.get(material), new Texture(texture), soundType, false).setStateSupplier(() -> AntimatterPlatformUtils.INSTANCE.getBlockFromId(new ResourceLocation(stoneState)).defaultBlockState()));
}

public Material createMaterial(String id, int rgb, String textureSet, String textureSetDomain) {
Expand Down
Loading

0 comments on commit 5c182c3

Please sign in to comment.