Skip to content

Commit

Permalink
spotlessApply
Browse files Browse the repository at this point in the history
  • Loading branch information
miozune committed Sep 8, 2022
1 parent cbdd0ce commit 1ed7346
Show file tree
Hide file tree
Showing 110 changed files with 2,105 additions and 1,908 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ usesShadowedDependencies = false
# Uncomment this to disable spotless checks
# This should only be uncommented to keep it easier to sync with upstream/other forks.
# That is, if there is no other active fork/upstream, NEVER change this.
disableSpotless = true
disableSpotless =
6 changes: 3 additions & 3 deletions src/main/java/com/gtnewhorizons/modularui/ClientProxy.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.gtnewhorizons.modularui;


import codechicken.lib.math.MathHelper;
import com.gtnewhorizons.modularui.common.internal.JsonLoader;
import com.gtnewhorizons.modularui.common.internal.wrapper.ModularGui;
Expand All @@ -25,7 +24,8 @@ public void preInit(FMLPreInitializationEvent event) {

public void postInit() {
super.postInit();
((SimpleReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(this::onReload);
((SimpleReloadableResourceManager) Minecraft.getMinecraft().getResourceManager())
.registerReloadListener(this::onReload);
}

public void onReload(IResourceManager manager) {
Expand All @@ -37,7 +37,7 @@ public void onReload(IResourceManager manager) {
public void mouseScreenInput(GuiScreenEvent event) {
if (event.gui instanceof ModularGui) {
int w = Mouse.getEventDWheel();
int wheel = (int)MathHelper.clip(w, -1, 1);
int wheel = (int) MathHelper.clip(w, -1, 1);
if (wheel != 0) {
((ModularGui) event.gui).mouseScroll(wheel);
}
Expand Down
33 changes: 16 additions & 17 deletions src/main/java/com/gtnewhorizons/modularui/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ public class CommonProxy {
public void preInit(FMLPreInitializationEvent event) {

testBlock = new TestBlock(Material.rock)
.setBlockName("testBlock")
.setCreativeTab(CreativeTabs.tabBlock)
.setBlockTextureName("stone");
.setBlockName("testBlock")
.setCreativeTab(CreativeTabs.tabBlock)
.setBlockTextureName("stone");
GameRegistry.registerBlock(testBlock, "testBlock");
GameRegistry.registerTileEntity(TestTile.class, "TestTileEntity");

Expand All @@ -32,20 +32,19 @@ public void preInit(FMLPreInitializationEvent event) {
MinecraftForge.EVENT_BUS.register(this);
}

public void postInit() {
}

// @SubscribeEvent
// public static void registerBlocks(RegistryEvent.Register<Block> event) {
// IForgeRegistry<Block> registry = event.getRegistry();
// registry.register(testBlock);
// }
//
// @SubscribeEvent
// public static void registerItems(RegistryEvent.Register<Item> event) {
// IForgeRegistry<Item> registry = event.getRegistry();
// registry.register(testItemBlock);
// }
public void postInit() {}

// @SubscribeEvent
// public static void registerBlocks(RegistryEvent.Register<Block> event) {
// IForgeRegistry<Block> registry = event.getRegistry();
// registry.register(testBlock);
// }
//
// @SubscribeEvent
// public static void registerItems(RegistryEvent.Register<Item> event) {
// IForgeRegistry<Item> registry = event.getRegistry();
// registry.register(testItemBlock);
// }

@SubscribeEvent
public void onConfigChange(ConfigChangedEvent.OnConfigChangedEvent event) {
Expand Down
35 changes: 19 additions & 16 deletions src/main/java/com/gtnewhorizons/modularui/ModularUI.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.gtnewhorizons.modularui;

import com.gtnewhorizons.modularui.common.internal.JsonLoader;
import com.gtnewhorizons.modularui.common.internal.network.NetworkHandler;
import com.gtnewhorizons.modularui.common.internal.wrapper.ModularGui;
import com.gtnewhorizons.modularui.common.internal.wrapper.ModularUIContainer;
import com.gtnewhorizons.modularui.api.UIInfos;
import com.gtnewhorizons.modularui.api.screen.ModularUIContext;
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
import com.gtnewhorizons.modularui.common.internal.JsonLoader;
import com.gtnewhorizons.modularui.common.internal.network.NetworkHandler;
import com.gtnewhorizons.modularui.common.internal.wrapper.ModularGui;
import com.gtnewhorizons.modularui.common.internal.wrapper.ModularUIContainer;
import com.gtnewhorizons.modularui.common.widget.WidgetJsonRegistry;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Mod;
Expand All @@ -17,20 +17,18 @@
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.function.Function;
import net.minecraft.entity.player.EntityPlayer;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.function.Function;

@Mod(
modid = ModularUI.MODID,
version = Tags.VERSION,
name = Tags.MODNAME,
acceptedMinecraftVersions = "[1.7.10]",
dependencies = ModularUI.DEPENDENCIES,
guiFactory = ModularUI.GUI_FACTORY
)
modid = ModularUI.MODID,
version = Tags.VERSION,
name = Tags.MODNAME,
acceptedMinecraftVersions = "[1.7.10]",
dependencies = ModularUI.DEPENDENCIES,
guiFactory = ModularUI.GUI_FACTORY)
public class ModularUI {

public static final String MODID = "modularui";
Expand All @@ -42,7 +40,10 @@ public class ModularUI {
@Mod.Instance(ModularUI.MODID)
public static ModularUI INSTANCE;

@SidedProxy(modId = MODID, clientSide = Tags.GROUPNAME + ".ClientProxy", serverSide = Tags.GROUPNAME + ".CommonProxy")
@SidedProxy(
modId = MODID,
clientSide = Tags.GROUPNAME + ".ClientProxy",
serverSide = Tags.GROUPNAME + ".CommonProxy")
public static CommonProxy proxy;

@Mod.EventHandler
Expand All @@ -65,14 +66,16 @@ public void onPostInit(FMLPostInitializationEvent event) {
proxy.postInit();
}

public static ModularUIContainer createContainer(EntityPlayer player, Function<UIBuildContext, ModularWindow> windowCreator) {
public static ModularUIContainer createContainer(
EntityPlayer player, Function<UIBuildContext, ModularWindow> windowCreator) {
UIBuildContext buildContext = new UIBuildContext(player);
ModularWindow window = windowCreator.apply(buildContext);
return new ModularUIContainer(new ModularUIContext(buildContext), window);
}

@SideOnly(Side.CLIENT)
public static ModularGui createGuiScreen(EntityPlayer player, Function<UIBuildContext, ModularWindow> windowCreator) {
public static ModularGui createGuiScreen(
EntityPlayer player, Function<UIBuildContext, ModularWindow> windowCreator) {
return new ModularGui(createContainer(player, windowCreator));
}
}
Loading

0 comments on commit 1ed7346

Please sign in to comment.