Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/main/java/com/minecrafttas/mctcommon/KeybindManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ public void registerKeybind(GameSettings options, KeybindID keybindID, Keybind k
this.keybindings.put(keybindID, keybind);
KeyBinding keyBinding = keybind.vanillaKeyBinding;

Map<String, Integer> categoryOrder = AccessorKeyBinding.getCategoryOrder();
//Map<String, Integer> categoryOrder = AccessorKeyBinding.getCategoryOrder();

if (!categoryOrder.containsKey(keybind.category))
categoryOrder.put(keybind.category, categoryOrder.size() + 1);
// if (!categoryOrder.containsKey(keybind.category))
// categoryOrder.put(keybind.category, categoryOrder.size() + 1);

// add keybinding
options.keyBindings = ArrayUtils.add(options.keyBindings, keyBinding);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

@Mixin(KeyBinding.class)
public interface AccessorKeyBinding {

@Accessor("CATEGORY_ORDER")
public static Map<String, Integer> getCategoryOrder() {
throw new NotImplementedException("WEE WOO");
}
//
// @Accessor("CATEGORY_ORDER")
// public static Map<String, Integer> getCategoryOrder() {
// throw new NotImplementedException("WEE WOO");
// }
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
@Mixin(NetHandlerPlayClient.class)
public class MixinNetHandlerPlayClient {
@Shadow
private Minecraft client;
private Minecraft gameController;

@Inject(method = "handleJoinGame", at = @At(value = "RETURN"))
public void clientJoinServerEvent(CallbackInfo ci) throws ConnectException {
EventListenerRegistry.fireEvent(EventPlayerJoinedClientSide.class, client.player);
EventListenerRegistry.fireEvent(EventPlayerJoinedClientSide.class, gameController.player);
}

@Inject(method = "handlePlayerListItem", at = @At(value = "HEAD"))
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/minecrafttas/tasmod/TASmodClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ public class TASmodClient implements ClientModInitializer, EventClientInit, Even

public static TickSyncClient ticksyncClient;

public final static Path tasfiledirectory = Minecraft.getMinecraft().gameDir.toPath().resolve("saves").resolve("tasfiles");
public final static Path tasfiledirectory = Minecraft.getMinecraft().mcDataDir.toPath().resolve("saves").resolve("tasfiles");

public final static Path savestatedirectory = Minecraft.getMinecraft().gameDir.toPath().resolve("saves").resolve("savestates");
public final static Path savestatedirectory = Minecraft.getMinecraft().mcDataDir.toPath().resolve("saves").resolve("savestates");

public static InfoHud hud;

Expand Down Expand Up @@ -354,7 +354,7 @@ private void registerConfigValues() {
}

private void loadConfig(Minecraft mc) {
Path configDir = mc.gameDir.toPath().resolve("config");
Path configDir = mc.mcDataDir.toPath().resolve("config");
if (!Files.exists(configDir)) {
try {
Files.createDirectory(configDir);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.ChatType;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextFormatting;

Expand Down Expand Up @@ -186,7 +185,7 @@ public void onClientPacket(PacketID id, ByteBuffer buf, String username) throws
boolean success = TASmodAPIRegistry.PLAYBACK_FILE_COMMAND.setEnabled(filecommand, enable);

String msg = success ? String.format("%s%s file command: %s", TextFormatting.GREEN, enable ? "Enabled" : "Disabled", filecommand) : String.format("%sFailed to %s file command: %s", TextFormatting.RED, enable ? "enable" : "disable", filecommand);
Minecraft.getMinecraft().ingameGUI.addChatMessage(ChatType.CHAT, new TextComponentString(msg));
Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(new TextComponentString(msg));
break;
default:
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public List<String> getTabCompletions(MinecraftServer server, ICommandSender sen

public List<String> getFilenames() {
List<String> tab = new ArrayList<String>();
File folder = new File(Minecraft.getMinecraft().gameDir, "saves" + File.separator + "tasfiles");
File folder = new File(Minecraft.getMinecraft().mcDataDir, "saves" + File.separator + "tasfiles");
File[] listOfFiles = folder.listFiles(new FileFilter() {
@Override
public boolean accept(File pathname) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.command.CommandBase;
import net.minecraft.util.text.ChatType;
import net.minecraft.util.text.TextComponentString;

public class ClientCommandRegistry extends AbstractRegistry<ClientCommandBase> {
Expand Down Expand Up @@ -38,7 +37,7 @@ public boolean runClientCommands(String chatMessage) {
try {
command.execute(null, player, args);
} catch (Exception e) {
mc.ingameGUI.addChatMessage(ChatType.CHAT, new TextComponentString(e.getMessage()));
mc.ingameGUI.getChatGUI().printChatMessage(new TextComponentString(e.getMessage()));
}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import net.minecraft.command.ICommandSender;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.ChatType;
import net.minecraft.util.text.Style;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextFormatting;
Expand Down Expand Up @@ -79,7 +78,7 @@ private void openSavestates() {
}

if (!Files.exists(file)) {
Minecraft.getMinecraft().ingameGUI.addChatMessage(ChatType.CHAT, new TextComponentString("Can't open savestates, as the directory doesn't exist").setStyle(new Style().setColor(TextFormatting.RED)));
Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(new TextComponentString("Can't open savestates, as the directory doesn't exist").setStyle(new Style().setColor(TextFormatting.RED)));
return;
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/minecrafttas/tasmod/gui/InfoHud.java
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ private void saveConfig() {
return;
}
try {
File tasmodDir = new File(Minecraft.getMinecraft().gameDir, "tasmod");
File tasmodDir = new File(Minecraft.getMinecraft().mcDataDir, "tasmod");
tasmodDir.mkdir();
File configFile = new File(tasmodDir, "infogui2.cfg");
if (!configFile.exists())
Expand Down Expand Up @@ -227,7 +227,7 @@ public boolean checkInit() {
try {
configuration = new Properties();
if (!resetLayout) {
File tasmodDir = new File(Minecraft.getMinecraft().gameDir, "tasmod");
File tasmodDir = new File(Minecraft.getMinecraft().mcDataDir, "tasmod");
tasmodDir.mkdir();
File configFile = new File(tasmodDir, "infogui2.cfg");
if (!configFile.exists())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ public void injectRunGameLoop(CallbackInfo ci) {
private EntityRenderer entityRenderer;
@Shadow
private boolean isGamePaused;
@Shadow
private float renderPartialTicksPaused;
//@Shadow
//private float renderPartialTicksPaused;
@Shadow
private Timer timer;

@Redirect(method = "runGameLoop", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;runTick()V"))
public void redirectRunTick(Minecraft mc) {
if (TASmodClient.tickratechanger.ticksPerSecond != 0) {
((SubtickDuck) this.entityRenderer).runUpdate(this.isGamePaused ? this.renderPartialTicksPaused : this.timer.renderPartialTicks);
((SubtickDuck) this.entityRenderer).runUpdate(this.timer.renderPartialTicks);
}
this.runTick();
TASmodClient.tickSchedulerClient.runAllTasks();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void playback_injectAtStartSection(float partialTicks, long nanoTime, Cal
this.smoothCamPitch = 0.0F;
}

mc.getTutorial().handleMouse(mc.mouseHelper);
//mc.getTutorial().handleMouse(mc.mouseHelper);
TASmodClient.virtual.CAMERA_ANGLE.updateNextCameraAngle((float) -((double) deltaPitch * 0.15D * invertMouse), (float) ((double) deltaYaw * 0.15D), TASmodClient.tickratechanger.ticksPerSecond != 0);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

import com.minecrafttas.tasmod.TASmodClient;

import net.minecraft.client.gui.advancements.GuiScreenAdvancements;
import net.minecraft.client.gui.achievement.GuiAchievements;

@Mixin(GuiScreenAdvancements.class)
public class MixinGuiScreenAdvancements {
@Mixin(GuiAchievements.class)
public class MixinGuiAchievements {
@Redirect(method = "drawScreen", at = @At(value = "INVOKE", target = "Lorg/lwjgl/input/Mouse;isButtonDown(I)Z", remap = false))
public boolean redirectIsButtonDown(int i) {
return TASmodClient.virtual.isKeyDown(-100);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private boolean redirectIsKeyDown2(int i) {
@Redirect(method = "keyTyped", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/entity/EntityPlayerSP;closeScreen()V"))
public void redirectCloseScreen(EntityPlayerSP player) {
Minecraft mc = Minecraft.getMinecraft();
if (TASmodClient.virtual.isKeyDown(mc.gameSettings.keyBindInventory.getKeyCode()) && ((GuiContainer) (Object) this).isFocused()) {
if (TASmodClient.virtual.isKeyDown(mc.gameSettings.keyBindInventory.getKeyCode()) && mc.inGameHasFocus) { //((GuiContainer) (Object) this).isFocused()
return;
}
player.closeScreen();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
public interface AccessorAnvilChunkLoader {

@Accessor
public Map<ChunkPos, NBTTagCompound> getChunksToSave();
public Map<ChunkPos, NBTTagCompound> getChunksToRemove();
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@
public class MixinChunkProviderClient implements ChunkProviderDuck {
@Shadow
@Final
private Long2ObjectMap<Chunk> loadedChunks;
private Long2ObjectMap<Chunk> chunkMapping;

/**
* <p>Unloads chunk data on the client.
* <p>This step is necessary as not doing this, will create phantom blocks on the client, with strange behaviour.
*/
@Override
public void unloadAllChunks() {
ObjectIterator<?> objectiterator = this.loadedChunks.values().iterator();
ObjectIterator<?> objectiterator = this.chunkMapping.values().iterator();

while (objectiterator.hasNext()) {
Chunk chunk = (Chunk) objectiterator.next();
chunk.onUnload();
}
loadedChunks.clear();
chunkMapping.clear();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public abstract class MixinChunkProviderServer implements ChunkProviderDuck {
*/
@Shadow
@Final
private Long2ObjectMap<Chunk> loadedChunks;
private Long2ObjectMap<Chunk> id2ChunkMap;

/**
* <p>Saves and unloads chunk data.
Expand All @@ -34,15 +34,15 @@ public abstract class MixinChunkProviderServer implements ChunkProviderDuck {
*/
@Override
public void unloadAllChunks() {
ObjectIterator<?> objectiterator = this.loadedChunks.values().iterator();
ObjectIterator<?> objectiterator = this.id2ChunkMap.values().iterator();

while (objectiterator.hasNext()) {
Chunk chunk = (Chunk) objectiterator.next();
this.saveChunkData(chunk);
this.saveChunkExtraData(chunk);
chunk.onUnload();
}
loadedChunks.clear();
id2ChunkMap.clear();
}

@Shadow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
@Mixin(TileEntityItemStackRenderer.class)
public class MixinTileEntityItemStackRenderer {

@Redirect(method = "Lnet/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer;renderByItem(Lnet/minecraft/item/ItemStack;F)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/texture/TextureManager;bindTexture(Lnet/minecraft/util/ResourceLocation;)V", ordinal = 1))
public void inject_renderByItem(TextureManager manager, ResourceLocation original, ItemStack shield, float partialTicks) {
@Redirect(method = "renderByItem", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/texture/TextureManager;bindTexture(Lnet/minecraft/util/ResourceLocation;)V", ordinal = 1))
public void inject_renderByItem(TextureManager manager, ResourceLocation original, ItemStack shield) {
EntityLivingBase entity = ShieldDownloader.renderedEntity;
if (entity != null && shield != null) {
// Dev Texture
Expand Down
Loading
Loading