Skip to content

Commit

Permalink
Renamed common to mctcommon
Browse files Browse the repository at this point in the history
  • Loading branch information
ScribbleTAS committed Nov 27, 2023
1 parent 9c4e1db commit 6839746
Show file tree
Hide file tree
Showing 58 changed files with 270 additions and 234 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ configurations {
dependencies {
// tasmod dependencies
embed group: 'com.dselent', name: 'bigarraylist', version: '1.0'

compileOnly group: 'com.minecrafttas', name: 'killtherng', version: '2.0'
downloadMod group: 'com.minecrafttas', name: 'killtherng-full', version: '2.0' // for downloadKTRNG task

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ org.gradle.jvmargs=-Xmx3G
# Fabric properties
minecraft_version=1.12.2
loader_version=0.14.23
loom_version=1.3-SNAPSHOT
loom_version=1.4-SNAPSHOT

# Mod properties
mod_name=Tool-Assisted Speedrun Mod
Expand All @@ -16,4 +16,4 @@ mod_email=scribble@minecrafttas.com
# TASmod properties
group=com.minecrafttas
artifact=TASmod-1.12.2
version=Beta1-WorkInProgress
version=Beta1-SNAPHOT
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.minecrafttas.common;
package com.minecrafttas.mctcommon;

import net.minecraft.command.CommandHandler;
import net.minecraft.command.ICommand;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.minecrafttas.common;
package com.minecrafttas.mctcommon;

import java.io.File;
import java.io.FileInputStream;
Expand All @@ -10,6 +10,8 @@
import java.util.Map;
import java.util.Properties;

import org.apache.commons.io.FileUtils;

/**
* A <i>very</i> simple configuration class
* @author Scribble
Expand Down Expand Up @@ -45,13 +47,13 @@ public Properties load() {
newProp.loadFromXML(fis);
fis.close();
} catch (InvalidPropertiesFormatException e) {
Common.LOGGER.error("The config file could not be read", e);
MCTCommon.LOGGER.error("The config file could not be read", e);
return null;
} catch (FileNotFoundException e) {
Common.LOGGER.warn("No config file found: {}", file);
MCTCommon.LOGGER.warn("No config file found: {}", file);
return null;
} catch (IOException e) {
Common.LOGGER.error("An error occured while reading the config", e);
MCTCommon.LOGGER.error("An error occured while reading the config", e);
return null;
}
return newProp;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package com.minecrafttas.common;
package com.minecrafttas.mctcommon;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang3.ArrayUtils;

import com.minecrafttas.common.events.EventClient.EventClientGameLoop;
import com.minecrafttas.mctcommon.events.EventClient.EventClientGameLoop;
import com.minecrafttas.mctcommon.mixin.AccessorKeyBinding;

import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.GameSettings;
Expand Down Expand Up @@ -71,8 +72,8 @@ public KeyBinding registerKeybind(Keybind keybind) {

// add category
GameSettings options = Minecraft.getMinecraft().gameSettings;
if (!KeyBinding.CATEGORY_ORDER.containsKey(keybind.category))
KeyBinding.CATEGORY_ORDER.put(keybind.category, KeyBinding.CATEGORY_ORDER.size() + 1);
if (!AccessorKeyBinding.getCategoryOrder().containsKey(keybind.category))
AccessorKeyBinding.getCategoryOrder().put(keybind.category, AccessorKeyBinding.getCategoryOrder().size() + 1);

// add keybinding
options.keyBindings = ArrayUtils.add(options.keyBindings, keyBinding);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.minecrafttas.common;
package com.minecrafttas.mctcommon;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.Marker;
import org.apache.logging.log4j.MarkerManager;

public class Common {
public static final Logger LOGGER = LogManager.getLogger("Common");
public class MCTCommon {
public static final Logger LOGGER = LogManager.getLogger("MCTCommon");

public static final Marker Event = MarkerManager.getMarker("Event");

Expand All @@ -15,4 +15,5 @@ public class Common {
public static final Marker Client = MarkerManager.getMarker("Client");

public static final Marker Timeout = MarkerManager.getMarker("Timeout");

}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.minecrafttas.common.events;
package com.minecrafttas.mctcommon.events;

import java.nio.ByteBuffer;

import com.minecrafttas.common.server.exception.PacketNotImplementedException;
import com.minecrafttas.mctcommon.server.exception.PacketNotImplementedException;

@FunctionalInterface
public interface CompactPacketHandler {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.minecrafttas.common.events;
package com.minecrafttas.mctcommon.events;

import com.minecrafttas.common.Common;
import com.minecrafttas.common.events.EventListenerRegistry.EventBase;
import com.minecrafttas.common.server.Client;
import com.minecrafttas.mctcommon.MCTCommon;
import com.minecrafttas.mctcommon.events.EventListenerRegistry.EventBase;
import com.minecrafttas.mctcommon.server.Client;
import com.mojang.authlib.GameProfile;

import net.minecraft.client.Minecraft;
Expand All @@ -26,7 +26,7 @@ public static interface EventOpenGui extends EventBase {
public GuiScreen onOpenGui(GuiScreen gui);

public static GuiScreen fireOpenGuiEvent(GuiScreen gui) {
Common.LOGGER.trace(Common.Event, "Firing OpenGuiEvent");
MCTCommon.LOGGER.trace(MCTCommon.Event, "Firing OpenGuiEvent");
for (EventBase eventListener : EventListenerRegistry.getEventListeners()) {
if(eventListener instanceof EventOpenGui) {
EventOpenGui event = (EventOpenGui) eventListener;
Expand All @@ -53,7 +53,7 @@ public static interface EventLaunchIntegratedServer extends EventBase {
public void onLaunchIntegratedServer();

public static void fireOnLaunchIntegratedServer() {
Common.LOGGER.trace(Common.Event, "Firing LaunchIntegratedServer");
MCTCommon.LOGGER.trace(MCTCommon.Event, "Firing LaunchIntegratedServer");
for (EventBase eventListener : EventListenerRegistry.getEventListeners()) {
if(eventListener instanceof EventLaunchIntegratedServer) {
EventLaunchIntegratedServer event = (EventLaunchIntegratedServer) eventListener;
Expand All @@ -76,7 +76,7 @@ public static interface EventDoneLoadingWorld extends EventBase {
public void onDoneLoadingWorld();

public static void fireOnDoneLoadingWorld() {
Common.LOGGER.trace(Common.Event, "Firing DoneLoadingWorld");
MCTCommon.LOGGER.trace(MCTCommon.Event, "Firing DoneLoadingWorld");
for (EventBase eventListener : EventListenerRegistry.getEventListeners()) {
if(eventListener instanceof EventDoneLoadingWorld) {
EventDoneLoadingWorld event = (EventDoneLoadingWorld) eventListener;
Expand Down Expand Up @@ -123,7 +123,7 @@ public static interface EventClientInit extends EventBase {
public void onClientInit(Minecraft mc);

public static void fireOnClientInit(Minecraft mc) {
Common.LOGGER.trace(Common.Event, "Firing ClientInit");
MCTCommon.LOGGER.trace(MCTCommon.Event, "Firing ClientInit");
for (EventBase eventListener : EventListenerRegistry.getEventListeners()) {
if(eventListener instanceof EventClientInit) {
EventClientInit event = (EventClientInit) eventListener;
Expand Down Expand Up @@ -223,7 +223,7 @@ public static interface EventPlayerLeaveClientSide extends EventBase {
public void onPlayerLeaveClientSide(EntityPlayerSP player);

public static void firePlayerLeaveClientSide(EntityPlayerSP player) {
Common.LOGGER.trace(Common.Event, "Firing PlayerLeaveClientSideEvent");
MCTCommon.LOGGER.trace(MCTCommon.Event, "Firing PlayerLeaveClientSideEvent");
for (EventBase eventListener : EventListenerRegistry.getEventListeners()) {
if(eventListener instanceof EventPlayerLeaveClientSide) {
EventPlayerLeaveClientSide event = (EventPlayerLeaveClientSide) eventListener;
Expand All @@ -247,7 +247,7 @@ public static interface EventPlayerJoinedClientSide extends EventBase {
public void onPlayerJoinedClientSide(EntityPlayerSP player);

public static void firePlayerJoinedClientSide(EntityPlayerSP player) {
Common.LOGGER.trace(Common.Event, "Firing PlayerJoinedClientSide");
MCTCommon.LOGGER.trace(MCTCommon.Event, "Firing PlayerJoinedClientSide");
for (EventBase eventListener : EventListenerRegistry.getEventListeners()) {
if(eventListener instanceof EventPlayerJoinedClientSide) {
EventPlayerJoinedClientSide event = (EventPlayerJoinedClientSide) eventListener;
Expand All @@ -273,7 +273,7 @@ public static interface EventOtherPlayerJoinedClientSide extends EventBase {


public static void fireOtherPlayerJoinedClientSide(GameProfile profile) {
Common.LOGGER.trace(Common.Event, "Firing OtherPlayerJoinedClientSide");
MCTCommon.LOGGER.trace(MCTCommon.Event, "Firing OtherPlayerJoinedClientSide");
for (EventBase eventListener : EventListenerRegistry.getEventListeners()) {
if(eventListener instanceof EventOtherPlayerJoinedClientSide) {
EventOtherPlayerJoinedClientSide event = (EventOtherPlayerJoinedClientSide) eventListener;
Expand All @@ -296,7 +296,7 @@ public static interface EventDisconnectClient extends EventBase {
public void onDisconnectClient(Client client);

public static void fireDisconnectClient(Client client) {
Common.LOGGER.trace(Common.Event, "Firing EventDisconnectClient");
MCTCommon.LOGGER.trace(MCTCommon.Event, "Firing EventDisconnectClient");
for (EventBase eventListener : EventListenerRegistry.getEventListeners()) {
if(eventListener instanceof EventDisconnectClient) {
EventDisconnectClient event = (EventDisconnectClient) eventListener;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.minecrafttas.common.events;
package com.minecrafttas.mctcommon.events;

import java.util.ArrayList;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.minecrafttas.common.events;
package com.minecrafttas.mctcommon.events;

import com.minecrafttas.common.Common;
import com.minecrafttas.common.events.EventListenerRegistry.EventBase;
import com.minecrafttas.common.server.Client;
import com.minecrafttas.mctcommon.MCTCommon;
import com.minecrafttas.mctcommon.events.EventListenerRegistry.EventBase;
import com.minecrafttas.mctcommon.server.Client;

import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
Expand All @@ -23,7 +23,7 @@ public static interface EventServerInit extends EventBase {
public void onServerInit(MinecraftServer server);

public static void fireServerStartEvent(MinecraftServer server) {
Common.LOGGER.trace(Common.Event, "Firing ServerStartEvent");
MCTCommon.LOGGER.trace(MCTCommon.Event, "Firing ServerStartEvent");
for (EventBase eventListener : EventListenerRegistry.getEventListeners()) {
if (eventListener instanceof EventServerInit) {
EventServerInit event = (EventServerInit) eventListener;
Expand Down Expand Up @@ -73,7 +73,7 @@ public static interface EventServerStop extends EventBase {
public void onServerStop(MinecraftServer server);

public static void fireOnServerStop(MinecraftServer server) {
Common.LOGGER.trace(Common.Event, "Firing ServerStopEvent");
MCTCommon.LOGGER.trace(MCTCommon.Event, "Firing ServerStopEvent");
for (EventBase eventListener : EventListenerRegistry.getEventListeners()) {
if (eventListener instanceof EventServerStop) {
EventServerStop event = (EventServerStop) eventListener;
Expand Down Expand Up @@ -111,7 +111,7 @@ public static interface EventPlayerJoinedServerSide extends EventBase {
public void onPlayerJoinedServerSide(EntityPlayerMP player);

public static void firePlayerJoinedServerSide(EntityPlayerMP player) {
Common.LOGGER.trace(Common.Event, "Firing PlayerJoinedServerSide");
MCTCommon.LOGGER.trace(MCTCommon.Event, "Firing PlayerJoinedServerSide");
for (EventBase eventListener : EventListenerRegistry.getEventListeners()) {
if (eventListener instanceof EventPlayerJoinedServerSide) {
EventPlayerJoinedServerSide event = (EventPlayerJoinedServerSide) eventListener;
Expand All @@ -135,7 +135,7 @@ public static interface EventPlayerLeaveServerSide extends EventBase {
public void onPlayerLeaveServerSide(EntityPlayerMP player);

public static void firePlayerLeaveServerSide(EntityPlayerMP player) {
Common.LOGGER.trace(Common.Event, "Firing PlayerLeaveServerSideEvent");
MCTCommon.LOGGER.trace(MCTCommon.Event, "Firing PlayerLeaveServerSideEvent");
for (EventBase eventListener : EventListenerRegistry.getEventListeners()) {
if (eventListener instanceof EventPlayerLeaveServerSide) {
EventPlayerLeaveServerSide event = (EventPlayerLeaveServerSide) eventListener;
Expand All @@ -157,7 +157,7 @@ public static interface EventClientCompleteAuthentication extends EventBase {
public void onClientCompleteAuthentication(String username);

public static void fireClientCompleteAuthentication(String username) {
Common.LOGGER.trace(Common.Event, "Firing ClientCompleteAuthenticationEvent");
MCTCommon.LOGGER.trace(MCTCommon.Event, "Firing ClientCompleteAuthenticationEvent");
for (EventBase eventListener : EventListenerRegistry.getEventListeners()) {
if (eventListener instanceof EventClientCompleteAuthentication) {
EventClientCompleteAuthentication event = (EventClientCompleteAuthentication) eventListener;
Expand All @@ -179,7 +179,7 @@ public static interface EventDisconnectServer extends EventBase {
public void onDisconnectServer(Client client);

public static void fireDisconnectServer(Client client) {
Common.LOGGER.trace(Common.Event, "Firing CustomServerClientDisconnect");
MCTCommon.LOGGER.trace(MCTCommon.Event, "Firing CustomServerClientDisconnect");
for (EventBase eventListener : EventListenerRegistry.getEventListeners()) {
if(eventListener instanceof EventDisconnectServer) {
EventDisconnectServer event = (EventDisconnectServer) eventListener;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.minecrafttas.mctcommon.mixin;

import java.util.Map;

import org.apache.commons.lang3.NotImplementedException;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

import net.minecraft.client.settings.KeyBinding;

@Mixin(KeyBinding.class)
public interface AccessorKeyBinding{

@Accessor("CATEGORY_ORDER")
public static Map<String, Integer> getCategoryOrder() {
throw new NotImplementedException("WEE WOO");
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.minecrafttas.common.mixin;
package com.minecrafttas.mctcommon.mixin;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArg;

import com.minecrafttas.common.events.EventClient.EventCamera;
import com.minecrafttas.common.events.EventClient.EventCamera.CameraData;
import com.minecrafttas.mctcommon.events.EventClient.EventCamera;
import com.minecrafttas.mctcommon.events.EventClient.EventCamera.CameraData;

import net.minecraft.client.renderer.EntityRenderer;
import net.minecraft.client.renderer.GlStateManager;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.minecrafttas.common.mixin;
package com.minecrafttas.mctcommon.mixin;

import org.objectweb.asm.Opcodes;
import org.spongepowered.asm.mixin.Mixin;
Expand All @@ -8,12 +8,12 @@
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import com.minecrafttas.common.events.EventClient.EventClientGameLoop;
import com.minecrafttas.common.events.EventClient.EventClientInit;
import com.minecrafttas.common.events.EventClient.EventClientTick;
import com.minecrafttas.common.events.EventClient.EventDoneLoadingWorld;
import com.minecrafttas.common.events.EventClient.EventLaunchIntegratedServer;
import com.minecrafttas.common.events.EventClient.EventOpenGui;
import com.minecrafttas.mctcommon.events.EventClient.EventClientGameLoop;
import com.minecrafttas.mctcommon.events.EventClient.EventClientInit;
import com.minecrafttas.mctcommon.events.EventClient.EventClientTick;
import com.minecrafttas.mctcommon.events.EventClient.EventDoneLoadingWorld;
import com.minecrafttas.mctcommon.events.EventClient.EventLaunchIntegratedServer;
import com.minecrafttas.mctcommon.events.EventClient.EventOpenGui;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package com.minecrafttas.common.mixin;
package com.minecrafttas.mctcommon.mixin;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.At.Shift;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import com.minecrafttas.common.events.EventServer.EventServerGameLoop;
import com.minecrafttas.common.events.EventServer.EventServerInit;
import com.minecrafttas.common.events.EventServer.EventServerStop;
import com.minecrafttas.common.events.EventServer.EventServerTick;
import com.minecrafttas.mctcommon.events.EventServer.EventServerGameLoop;
import com.minecrafttas.mctcommon.events.EventServer.EventServerInit;
import com.minecrafttas.mctcommon.events.EventServer.EventServerStop;
import com.minecrafttas.mctcommon.events.EventServer.EventServerTick;

import net.minecraft.server.MinecraftServer;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.minecrafttas.common.mixin;
package com.minecrafttas.mctcommon.mixin;

import java.net.ConnectException;

Expand All @@ -8,8 +8,8 @@
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import com.minecrafttas.common.events.EventClient.EventOtherPlayerJoinedClientSide;
import com.minecrafttas.common.events.EventClient.EventPlayerJoinedClientSide;
import com.minecrafttas.mctcommon.events.EventClient.EventOtherPlayerJoinedClientSide;
import com.minecrafttas.mctcommon.events.EventClient.EventPlayerJoinedClientSide;

import net.minecraft.client.Minecraft;
import net.minecraft.client.network.NetHandlerPlayClient;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.minecrafttas.common.mixin;
package com.minecrafttas.mctcommon.mixin;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import com.minecrafttas.common.events.EventServer.EventPlayerJoinedServerSide;
import com.minecrafttas.common.events.EventServer.EventPlayerLeaveServerSide;
import com.minecrafttas.mctcommon.events.EventServer.EventPlayerJoinedServerSide;
import com.minecrafttas.mctcommon.events.EventServer.EventPlayerLeaveServerSide;

import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.network.NetworkManager;
Expand Down
Loading

0 comments on commit 6839746

Please sign in to comment.