Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bconlon1 committed Jan 21, 2024
1 parent 20b1b3a commit 8192a2a
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 53 deletions.
35 changes: 2 additions & 33 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,56 +10,30 @@ plugins {
}

version = "${mc_version}-${mod_version}-neoforge"
group = 'com.aetherteam.nitrogen' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
group = 'com.aetherteam.nitrogen'

base {
archivesName = mod_id
}

// Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17.
java.toolchain.languageVersion = JavaLanguageVersion.of(17)

apply plugin: 'org.moddingx.modgradle.sourcejar'

minecraft {
mappings channel: 'sugarcane', version: project.mappings

// When true, this property will have all Eclipse/IntelliJ IDEA run configurations run the "prepareX" task for the given run configuration before launching the game.
// In most cases, it is not necessary to enable.
//enableEclipsePrepareRuns = true
//enableIdeaPrepareRuns = true

// This property allows configuring Gradle's ProcessResources task(s) to run on IDE output locations before launching the game.
// It is REQUIRED to be set to true for this template to function.
// See https://docs.gradle.org/current/dsl/org.gradle.language.jvm.tasks.ProcessResources.html
copyIdeResources = true

// When true, this property will add the folder name of all declared run configurations to generated IDE run configurations.
// The folder name can be set on a run configuration using the "folderName" property.
// By default, the folder name of a run configuration is the name of the Gradle project containing it.
//generateRunFolders = true

accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')

runs {
// applies to all the run configs below
configureEach {
workingDirectory project.file('run')

// Applies a JVM property which can be referenced in your code to check if you are running in IDE/Gradle.
property "${mod_id}.iside", 'true'

// Recommended logging data for a userdev environment
// The markers can be added/remove as needed separated by commas.
// "SCAN": For mods scan.
// "REGISTRIES": For firing of registry events.
// "REGISTRYDUMP": For getting the contents of all registries.
//property 'forge.logging.markers', 'REGISTRIES'

// Recommended logging level for the console
// You can set various levels here.
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
property 'forge.logging.console.level', 'info' // info is the default for production
property 'forge.logging.console.level', 'info'

mods {
"${mod_id}" {
Expand All @@ -69,7 +43,6 @@ minecraft {
}

client {
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
property 'forge.enabledGameTestNamespaces', mod_id
}

Expand All @@ -79,9 +52,6 @@ minecraft {
args '--nogui'
}

// This run config launches GameTestServer and runs all registered gametests, then exits.
// By default, the server will crash when no gametests are provided.
// The gametest system is also enabled by default for other run configs under the /test command.
gameTestServer {
property 'forge.enabledGameTestNamespaces', mod_id
}
Expand Down Expand Up @@ -132,7 +102,6 @@ tasks.named('jar', Jar).configure {
])
}

// This is the preferred method to reobfuscate your jar file
finalizedBy 'reobfJar'
}

Expand Down
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ mappings=2023.08.20-1.20.1

# Dependencies
jei_version=15.2.0.27

rei_version=12.0.684
cloth_config_version=11.1.118
architectury_version=9.1.12
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import net.minecraft.world.level.material.FluidState;

public class FluidStateRenderer implements EntryRenderer<FluidStack> {

@Override
public void render(EntryStack<FluidStack> entry, GuiGraphics guiGraphics, Rectangle bounds, int mouseX, int mouseY, float delta) {
PoseStack poseStack = guiGraphics.pose();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@
import java.util.function.Consumer;

public class REIClientUtils {

public static <T extends Display> Collection<EntryStack<?>> setupRendering(Collection<EntryStack<?>> entryStacks, BlockPropertyPair pair, @Nullable Consumer<Tooltip> processor){
public static <T extends Display> Collection<EntryStack<?>> setupRendering(Collection<EntryStack<?>> entryStacks, BlockPropertyPair pair, @Nullable Consumer<Tooltip> processor) {
return setupRendering(entryStacks, new BlockPropertyPair[]{pair}, processor);
}

public static <T extends Display> Collection<EntryStack<?>> setupRendering(Collection<EntryStack<?>> entryStacks, BlockPropertyPair[] pairs, @Nullable Consumer<Tooltip> processor){
public static <T extends Display> Collection<EntryStack<?>> setupRendering(Collection<EntryStack<?>> entryStacks, BlockPropertyPair[] pairs, @Nullable Consumer<Tooltip> processor) {
for (EntryStack<?> entry : entryStacks) {
if(processor != null) {
ClientEntryStacks.setTooltipProcessor(entry, (entryStack, tooltip) -> {
Expand All @@ -34,7 +33,7 @@ public static <T extends Display> Collection<EntryStack<?>> setupRendering(Colle
return entryStacks;
}

public static <T extends Display> Collection<EntryStack<?>> setupRendering(Collection<EntryStack<?>> entryStacks, Consumer<Tooltip> processor){
public static <T extends Display> Collection<EntryStack<?>> setupRendering(Collection<EntryStack<?>> entryStacks, Consumer<Tooltip> processor) {
for (EntryStack<?> entry : entryStacks) {
ClientEntryStacks.setTooltipProcessor(entry, (entryStack, tooltip) -> {
processor.accept(tooltip);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.util.Map;

public class REIUtils {

public static List<EntryIngredient> toIngredientList(BlockPropertyPair ...pairs) {
if (pairs == null) return List.of();
// Sets up input slots.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import me.shedaniel.math.Rectangle;
import me.shedaniel.rei.api.client.gui.Renderer;
import me.shedaniel.rei.api.client.gui.widgets.Widget;
import me.shedaniel.rei.api.client.gui.widgets.WidgetWithBounds;
import me.shedaniel.rei.api.client.gui.widgets.Widgets;
import me.shedaniel.rei.api.client.registry.display.DisplayCategory;
import me.shedaniel.rei.api.common.category.CategoryIdentifier;
Expand All @@ -14,7 +13,6 @@
import java.util.List;

public abstract class AbstractRecipeCategory<T extends Display> implements DisplayCategory<T> {

protected final String id;
protected final CategoryIdentifier<T> uid;

Expand Down Expand Up @@ -52,15 +50,15 @@ public List<Widget> setupDisplay(T display, Rectangle bounds) {

@Override
public int getDisplayHeight() {
return height + (padding * 2);
return this.height + (this.padding * 2);
}

@Override
public int getDisplayWidth(T display) {
return width + (padding * 2);
return this.width + (this.padding * 2);
}

protected Point startingOffset(Rectangle bounds){
return new Point(bounds.x + padding, bounds.y + padding);
protected Point startingOffset(Rectangle bounds) {
return new Point(bounds.x + this.padding, bounds.y + this.padding);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import java.util.List;

public abstract class AbstractBlockStateRecipeCategory<R extends AbstractBlockStateRecipe> extends AbstractRecipeCategory<BlockStateRecipeDisplay<R>> {

public AbstractBlockStateRecipeCategory(String id, CategoryIdentifier<BlockStateRecipeDisplay<R>> uid, int width, int height, Renderer icon) {
super(id, uid, width, height, icon);
}
Expand Down Expand Up @@ -51,5 +50,5 @@ public List<Widget> setupDisplay(BlockStateRecipeDisplay<R> display, Rectangle b
return widgets;
}

protected void populateTooltip(BlockStateRecipeDisplay<R> display, Tooltip tooltip) {}
protected void populateTooltip(BlockStateRecipeDisplay<R> display, Tooltip tooltip) { }
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import java.util.List;

public abstract class AbstractFuelCategory extends AbstractRecipeCategory<FuelDisplay> {

private final ResourceLocation texture;

public AbstractFuelCategory(CategoryIdentifier<FuelDisplay> categoryIdentifier, ResourceLocation texture) {
Expand All @@ -24,7 +23,7 @@ public AbstractFuelCategory(CategoryIdentifier<FuelDisplay> categoryIdentifier,
this.texture = texture;
}

public ResourceLocation getTexture(){
public ResourceLocation getTexture() {
return this.texture;
}

Expand All @@ -48,7 +47,9 @@ public List<Widget> setupDisplay(FuelDisplay display, Rectangle bounds) {
(graphics, bound, mouseX, mouseY, delta) -> {
lastTick.getAndAdd(delta);

if(lastTick.getValue() > burnTime) lastTick.setValue(0);
if (lastTick.getValue() > burnTime) {
lastTick.setValue(0);
}

var height = (int) Math.round(11 * (lastTick.getValue() / burnTime));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import java.util.List;

public class BlockStateRecipeDisplay<R extends AbstractBlockStateRecipe> extends BasicDisplay {

private final CategoryIdentifier<?> categoryIdentifier;

private final R recipe;
Expand Down Expand Up @@ -40,6 +39,6 @@ public R getRecipe() {

@Override
public CategoryIdentifier<?> getCategoryIdentifier() {
return categoryIdentifier;
return this.categoryIdentifier;
}
}

0 comments on commit 8192a2a

Please sign in to comment.