Skip to content

Commit

Permalink
Addressing reviewer comments
Browse files Browse the repository at this point in the history
  • Loading branch information
0hwx committed Dec 29, 2024
1 parent cd522b2 commit ad65f23
Show file tree
Hide file tree
Showing 32 changed files with 124 additions and 204 deletions.
8 changes: 4 additions & 4 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ dependencies {



compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.6.51-GTNH:dev') { transitive = false }
compileOnly('curse.maven:journeymap-32274:5769353') { transitive = false }
compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.7.0-GTNH:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:VisualProspecting:1.3.28:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:Navigator:1.0.15:dev') { transitive = false }
compileOnly(deobfCurse('xaeros-minimap-263420:5637000'))
compileOnly(deobfCurse('xaeros-world-map-317780:5658209'))
compileOnly('curse.maven:journeymap-32274:5769353')
compileOnly('curse.maven:xaeros-minimap-263420:5637000')
compileOnly('curse.maven:xaeros-world-map-317780:5658209')


}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ mixinsPackage = mixins
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
# This parameter is for legacy compatibility only
# Example value: (coreModClass = asm.FMLPlugin) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.asm.FMLPlugin
coreModClass = core.ShareWhereIAmCore
coreModClass =

# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class
# that is annotated with @Mod) you want this to be true. When in doubt: leave it on false!
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.muxiu1997.sharewhereiam.client.key;

import net.minecraft.client.settings.KeyBinding;

import org.lwjgl.input.Keyboard;

import com.muxiu1997.sharewhereiam.localization.Lang;

import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
public final class KeyBindings {

public static final KeyBinding WaypointShare;

static {
WaypointShare = new KeyBinding(
Lang.KEYBINDING_SHARE_NAME.getKey(),
Keyboard.KEY_INSERT,
Lang.KEYBINDING_SHARE_CATEGORY.getKey());
}

private KeyBindings() {}

public static void init() {
ClientRegistry.registerKeyBinding(WaypointShare);
}
}
15 changes: 0 additions & 15 deletions src/main/java/com/muxiu1997/sharewhereiam/client/key/KeyShare.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@

import com.muxiu1997.sharewhereiam.command.base.CommandWaypointBase;
import com.muxiu1997.sharewhereiam.localization.Lang;
import com.muxiu1997.sharewhereiam.mixininterfaces.IMixinWaypointStore;
import com.muxiu1997.sharewhereiam.mixinplugin.interfaces.IMixinWaypointStore;

import journeymap.client.model.Waypoint;
import journeymap.client.ui.UIManager;
import journeymap.client.waypoint.WaypointStore;

public class CommandWaypointSave extends CommandWaypointBase {

public static CommandWaypointSave INSTANCE = new CommandWaypointSave();

public CommandWaypointSave() {
super("savewaypoint");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@

public class CommandWaypointShareLocation extends CommandWaypointBase {

public static CommandWaypointShareLocation INSTANCE = new CommandWaypointShareLocation();

public CommandWaypointShareLocation() {
super("sharewhereiam");
}
Expand All @@ -27,7 +25,8 @@ public String getCommandUsage(ICommandSender sender) {
@Override
public void processCommand(ICommandSender sender, String[] args) throws CommandException {
ensureArgsLength(args, 0);
assert sender instanceof EntityPlayer;
network.sendToServer(new MessageShareWaypoint(WaypointUtil.waypointOfLocation()));
if (sender instanceof EntityPlayer) {
network.sendToServer(new MessageShareWaypoint(WaypointUtil.waypointOfLocation()));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

public class CommandWaypointToggleTempBeacon extends CommandWaypointBase {

public static CommandWaypointToggleTempBeacon INSTANCE = new CommandWaypointToggleTempBeacon();

public CommandWaypointToggleTempBeacon() {
super("toggletempbeacon");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
public abstract class CommandWaypointBase extends CommandBase {

final protected String commandName;
protected String commandUsage;

public CommandWaypointBase(@Nonnull String commandName) {
super();
Expand All @@ -44,7 +43,7 @@ public boolean canCommandSenderUseCommand(ICommandSender sender) {
@Override
@Nonnull
public String getCommandUsage(ICommandSender sender) {
return commandUsage;
return "";
}

@Nonnull
Expand All @@ -60,12 +59,16 @@ protected Waypoint parseWaypoint(@Nonnull String waypointCode) throws CommandExc

protected void ensureArgsLength(@Nullable String[] args, int min, int max) throws CommandException {
final int argsLength = args != null ? args.length : 0;
if (argsLength < min || argsLength > max) new CommandException(commandUsage);
if (argsLength < min || argsLength > max) throw getCommandException();
}

protected void ensureArgsLength(@Nullable String[] args, int length) throws CommandException {
final int argsLength = args != null ? args.length : 0;
if (argsLength != length) new CommandException(commandUsage);
if (argsLength != length) throw getCommandException();
}

@Nonnull
public CommandException getCommandException() {
return new CommandException("sharewhereiam.command." + this.getCommandName() + ".usage");
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import org.lwjgl.input.Keyboard;

import com.muxiu1997.sharewhereiam.client.key.KeyShare;
import com.muxiu1997.sharewhereiam.client.key.KeyBindings;
import com.muxiu1997.sharewhereiam.integration.Mods;
import com.muxiu1997.sharewhereiam.integration.journeymap.WaypointManager;
import com.muxiu1997.sharewhereiam.integration.journeymap.WaypointMarker;
Expand All @@ -25,8 +25,6 @@

public class EventHandler {

public static final EventHandler INSTANCE = new EventHandler();

@SubscribeEvent
@SideOnly(Side.CLIENT)
public void handleEntityJoinWorld(EntityJoinWorldEvent event) {
Expand All @@ -40,7 +38,7 @@ public void handleEntityJoinWorld(EntityJoinWorldEvent event) {
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void handleKeyInput(InputEvent.KeyInputEvent event) {
if (!KeyShare.INSTANCE.isPressed()) return;
if (!KeyBindings.WaypointShare.isPressed()) return;

if (Mods.JourneyMap.isLoaded()) {
// Determine the waypoint based on Shift key state
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,16 @@ public enum Mods {
;

public final String modid;
private boolean loaded;
private Boolean loaded;

Mods(String modid) {
this.modid = modid;
}

public boolean isLoaded() {
if (loaded == null) {
loaded = Loader.isModLoaded(modid);
}
return loaded;
}

public void check() {
this.loaded = Loader.isModLoaded(modid);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@
@SideOnly(Side.CLIENT)
public class WaypointManager {

public static WaypointManager INSTANCE = new WaypointManager();

public static Waypoint tempBeacon = null;
private static final Map<String, TransientBeacon> transientBeaconCache = new HashMap<>();

@Nullable
public Waypoint getTempBeacon() {
return this.tempBeacon;
public static Waypoint getTempBeacon() {
return tempBeacon;
}

public static boolean hasActiveTempBeacon() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
public class WaypointMarker {

public static void render(RenderWorldLastEvent event) {
List<Waypoint> transientBeacons = WaypointManager.INSTANCE.getTransientBeacons();
List<Waypoint> transientBeacons = WaypointManager.getTransientBeacons();
if (transientBeacons.isEmpty()) return;

float partialTicks = event.partialTicks;
Expand Down

This file was deleted.

17 changes: 0 additions & 17 deletions src/main/java/com/muxiu1997/sharewhereiam/loader/EventLoader.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@

public class IntegrationLoader {

public static final IntegrationLoader INSTANCE = new IntegrationLoader();

public void load() {
Arrays.stream(Mods.values()).forEach(Mods::check);
public static void load() {
Arrays.stream(Mods.values()).forEach(Mods::isLoaded);
}
}
17 changes: 0 additions & 17 deletions src/main/java/com/muxiu1997/sharewhereiam/loader/KeyLoader.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

public class NetworkLoader {

public static final NetworkLoader INSTANCE = new NetworkLoader();

private static int nextID = 0;

public static void load() {
Expand Down
Loading

0 comments on commit ad65f23

Please sign in to comment.