-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
63 changed files
with
1,982 additions
and
1,572 deletions.
There are no files selected for viewing
17 changes: 0 additions & 17 deletions
17
1.10.2/sources/bootstrap/src/main/java/net/teamfruit/serverobserver/IProxy.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 0 additions & 45 deletions
45
1.10.2/sources/compat/src/main/java/net/teamfruit/serverobserver/ClientProxy.java
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
1.10.2/sources/compat/src/main/java/net/teamfruit/serverobserver/CommonProxy.java
This file was deleted.
Oops, something went wrong.
66 changes: 66 additions & 0 deletions
66
1.10.2/sources/compat/src/main/java/net/teamfruit/serverobserver/CompatConfigs.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package net.teamfruit.serverobserver; | ||
|
||
import java.util.List; | ||
import java.util.Set; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
import com.google.common.collect.Lists; | ||
|
||
import net.minecraft.client.gui.GuiScreen; | ||
import net.minecraftforge.common.config.ConfigCategory; | ||
import net.minecraftforge.common.config.ConfigElement; | ||
import net.minecraftforge.common.config.Property; | ||
import net.minecraftforge.fml.client.IModGuiFactory; | ||
import net.minecraftforge.fml.client.config.GuiConfig; | ||
import net.minecraftforge.fml.client.config.IConfigElement; | ||
|
||
public class CompatConfigs { | ||
public static class CompatGuiConfig extends GuiConfig { | ||
public CompatGuiConfig(final GuiScreen parentScreen, final List<CompatConfigElement> configElements, final String modID, final boolean allRequireWorldRestart, final boolean allRequireMcRestart, final String title) { | ||
super(parentScreen, CompatConfigElement.getConfigElements(configElements), modID, allRequireWorldRestart, allRequireMcRestart, GuiConfig.getAbridgedConfigPath(title)); | ||
} | ||
} | ||
|
||
public static class CompatConfigElement { | ||
public final IConfigElement element; | ||
|
||
public CompatConfigElement(final IConfigElement element) { | ||
this.element = element; | ||
} | ||
|
||
public static List<IConfigElement> getConfigElements(final List<CompatConfigElement> elements) { | ||
return Lists.transform(elements, t -> t==null ? null : t.element); | ||
} | ||
|
||
public static CompatConfigElement fromCategory(final ConfigCategory category) { | ||
return new CompatConfigElement(new ConfigElement(category)); | ||
} | ||
|
||
public static CompatConfigElement fromProperty(final Property prop) { | ||
return new CompatConfigElement(new ConfigElement(prop)); | ||
} | ||
} | ||
|
||
public static abstract class CompatModGuiFactory implements IModGuiFactory { | ||
@Override | ||
public Set<RuntimeOptionCategoryElement> runtimeGuiCategories() { | ||
return null; | ||
} | ||
|
||
@SuppressWarnings("deprecation") | ||
@Override | ||
public RuntimeOptionGuiHandler getHandlerFor(final RuntimeOptionCategoryElement element) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public @Nullable Class<? extends GuiScreen> mainConfigGuiClass() { | ||
return mainConfigGuiClassCompat(); | ||
} | ||
|
||
public abstract @Nullable Class<? extends GuiScreen> mainConfigGuiClassCompat(); | ||
|
||
public abstract GuiScreen createConfigGuiCompat(GuiScreen parentScreen); | ||
} | ||
} |
93 changes: 93 additions & 0 deletions
93
1.10.2/sources/compat/src/main/java/net/teamfruit/serverobserver/CompatHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
package net.teamfruit.serverobserver; | ||
|
||
import java.io.File; | ||
|
||
import javax.annotation.Nonnull; | ||
|
||
import net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent; | ||
import net.minecraftforge.client.event.GuiScreenEvent.DrawScreenEvent; | ||
import net.minecraftforge.client.event.GuiScreenEvent.InitGuiEvent; | ||
import net.minecraftforge.common.MinecraftForge; | ||
import net.minecraftforge.fml.client.event.ConfigChangedEvent; | ||
import net.minecraftforge.fml.common.eventhandler.Event; | ||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; | ||
import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent; | ||
|
||
public abstract class CompatHandler { | ||
public abstract void preInit(final File root); | ||
|
||
public void init() { | ||
// FMLCommonHandler.instance().bus().register(this); | ||
MinecraftForge.EVENT_BUS.register(this); | ||
} | ||
|
||
public static class CompatEvent<T extends Event> { | ||
protected final T event; | ||
|
||
public CompatEvent(final T event) { | ||
this.event = event; | ||
} | ||
|
||
public void setCanceled(final boolean cancel) { | ||
this.event.setCanceled(cancel); | ||
} | ||
} | ||
|
||
public static class CompatOnConfigChangedEvent extends CompatEvent<ConfigChangedEvent.OnConfigChangedEvent> { | ||
public CompatOnConfigChangedEvent(final ConfigChangedEvent.OnConfigChangedEvent event) { | ||
super(event); | ||
} | ||
|
||
public String getModID() { | ||
return this.event.getModID(); | ||
} | ||
} | ||
|
||
public static class CompatClientTickEvent extends CompatEvent<ClientTickEvent> { | ||
public CompatClientTickEvent(final ClientTickEvent event) { | ||
super(event); | ||
} | ||
} | ||
|
||
@SubscribeEvent | ||
public void onConfigChanged(final @Nonnull ConfigChangedEvent.OnConfigChangedEvent eventArgs) { | ||
onConfigChangedCompat(new CompatOnConfigChangedEvent(eventArgs)); | ||
} | ||
|
||
public abstract void onConfigChangedCompat(final @Nonnull CompatOnConfigChangedEvent eventArgs); | ||
|
||
@SubscribeEvent | ||
public void open(final InitGuiEvent.Post e) { | ||
openCompat(e); | ||
} | ||
|
||
public abstract void openCompat(final InitGuiEvent.Post e); | ||
|
||
@SubscribeEvent | ||
public void draw(final DrawScreenEvent.Post e) { | ||
drawCompat(e); | ||
} | ||
|
||
public abstract void drawCompat(final DrawScreenEvent.Post e); | ||
|
||
@SubscribeEvent | ||
public void action(final ActionPerformedEvent.Pre e) { | ||
actionCompat(e); | ||
} | ||
|
||
public abstract void actionCompat(final ActionPerformedEvent.Pre e); | ||
|
||
@SubscribeEvent | ||
public void action(final ActionPerformedEvent.Post e) { | ||
actionCompat(e); | ||
} | ||
|
||
public abstract void actionCompat(final ActionPerformedEvent.Post e); | ||
|
||
@SubscribeEvent | ||
public void tickclient(final @Nonnull ClientTickEvent e) { | ||
tickclientCompat(new CompatClientTickEvent(e)); | ||
} | ||
|
||
public abstract void tickclientCompat(final @Nonnull CompatClientTickEvent e); | ||
} |
Oops, something went wrong.