Skip to content
Open
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
4 changes: 2 additions & 2 deletions src/minecraft/mcmod.info
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"modid": "IDResolverMod",
"name": "ID Resolver",
"description": "Utility designed to make BlockID and ItemID conflicts easy to find and resolve, without crashing!",
"version": "1.5.1.0",
"mcversion": "1.5.1",
"version": "1.6.2.0",
"mcversion": "1.6.2",
"url": "http://www.minecraftforum.net/topic/366377-IDResolver/",
"updateUrl": "http://www.minecraftforum.net/topic/366377-IDResolver/",
"authors": ["ShaRose"]
Expand Down
31 changes: 15 additions & 16 deletions src/minecraft/sharose/mods/idresolver/IDResolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public class IDResolver extends IDResolverBasic {
IDResolver.logger = Logger.getLogger("IDResolver");
try {
FileHandler logHandler = new FileHandler(new File(
Minecraft.getMinecraftDir(), "IDResolver.txt").getPath());
Minecraft.getMinecraft().mcDataDir, "IDResolver.txt").getPath());
logHandler.setFormatter(new SimpleFormatter());
IDResolver.logger.addHandler(logHandler);
IDResolver.logger.setLevel(Level.ALL);
Expand Down Expand Up @@ -217,7 +217,7 @@ private static void buildItemInfo(StringBuilder builder, int index,
}
try {
builder.append(String.format("\r\nDamage versus entities: %s",
item.getDamageVsEntity(null)));
item.getDamageVsEntity(null, null)));
} catch (Throwable e) {
builder.append("\r\nDamage versus entities: Error");
}
Expand Down Expand Up @@ -756,7 +756,7 @@ private static String generateIDStatusReport(int showFree) {
report.append("Generated on " + new Date().toString())
.append(linebreak).append(linebreak);

boolean checkClean = Block.blocksList.length != Item.shovelSteel.itemID;
boolean checkClean = Block.blocksList.length != Item.shovelIron.itemID;
int totalRegisteredBlocks = 1;
int totalUncleanBlockSlots = 0;
int totalRegisteredItems = 0;
Expand Down Expand Up @@ -876,7 +876,7 @@ private static String generateIDStatusReport(int showFree) {
report.append(
String.format("Item ID Status: %d/%d used. %d available.",
totalRegisteredItems, Item.itemsList.length,
(Item.itemsList.length - Item.shovelSteel.itemID)
(Item.itemsList.length - Item.shovelIron.itemID)
- totalRegisteredItems)).append(linebreak)
.append(linebreak);
report.append(
Expand Down Expand Up @@ -1188,7 +1188,7 @@ private int getLastOpenItem() {
{
start = lastOpenItemCache;
}
for (int i = start; i >= Item.shovelSteel.itemID; i--) {
for (int i = start; i >= Item.shovelIron.itemID; i--) {
if (!IDResolver.isSlotFree(i)) {
continue;
}
Expand Down Expand Up @@ -1249,7 +1249,7 @@ private static int getPosition(int i) {
if (i >= Block.blocksList.length) {
position = 2;
} else {
if (i >= Item.shovelSteel.itemID) {
if (i >= Item.shovelIron.itemID) {
position = 1;
}
}
Expand Down Expand Up @@ -1553,13 +1553,13 @@ protected static void reloadIDs() {
IDResolver.modPriorities = new Properties();
boolean forceSave = false;
try {
IDResolver.idPath = new File(Minecraft.getMinecraftDir()
IDResolver.idPath = new File(Minecraft.getMinecraft().mcDataDir
.getAbsolutePath()
+ "/config/IDResolverknownIDs.properties");

IDResolver.idPath.getParentFile().mkdirs();

IDResolver.priorityPath = new File(Minecraft.getMinecraftDir()
IDResolver.priorityPath = new File(Minecraft.getMinecraft().mcDataDir
.getAbsolutePath()
+ "/config/IDResolvermodPriorities.properties");
IDResolver.priorityPath.getParentFile().mkdirs();
Expand Down Expand Up @@ -2063,7 +2063,7 @@ private static void saveIDStatusToFile(Integer showFree,String fileName) {
Level.INFO,
"User pressed 'SaveIDStatusToFile' button. Mode: "
+ showFree.toString());
File savePath = new File(new File(Minecraft.getMinecraftDir(),
File savePath = new File(new File(Minecraft.getMinecraft().mcDataDir,
fileName).getAbsolutePath().replace("\\.\\", "\\"));
try {
FileOutputStream output = new FileOutputStream(savePath);
Expand Down Expand Up @@ -2218,8 +2218,8 @@ private static String exportMappings() {

private static void syncMinecraftScreen(Minecraft mc,
GuiWidgetScreen widgetscreen) {
mc.displayWidth = mc.mcCanvas.getWidth();
mc.displayHeight = mc.mcCanvas.getHeight();
mc.displayWidth = Display.getWidth();
mc.displayHeight = Display.getHeight();
widgetscreen.layout();
RenderScale.scale = widgetscreen.screenSize.getScaleFactor();
GL11.glViewport(0, 0, mc.displayWidth, mc.displayHeight);
Expand Down Expand Up @@ -3073,8 +3073,7 @@ private void runConflict() throws Exception {
boolean wasRunning = this.mc.running;
while (this.running) {

if (((this.mc.displayWidth != this.mc.mcCanvas.getWidth()) || (this.mc.displayHeight != this.mc.mcCanvas
.getHeight()))) {
if (((this.mc.displayWidth != Display.getWidth()) || (this.mc.displayHeight != Display.getHeight()))) {
IDResolver.syncMinecraftScreen(this.mc, this.widgetscreen);
}
this.widgetscreen.gui.update();
Expand Down Expand Up @@ -3224,8 +3223,8 @@ private void runConflictMenu() {
}
this.widgetscreen.layout();
while (this.running) {
if ((this.mc.displayWidth != this.mc.mcCanvas.getWidth())
|| (this.mc.displayHeight != this.mc.mcCanvas.getHeight())) {
if ((this.mc.displayWidth != Display.getWidth())
|| (this.mc.displayHeight != Display.getHeight())) {
syncMinecraftScreen(this.mc, this.widgetscreen);
}
modscreen.drawScreen(0, 0, 0);
Expand Down Expand Up @@ -3390,7 +3389,7 @@ private void setupGui(int RequestedID) {
.put(area, 0);
this.settingIntNewID = new SettingInt("New ID", RequestedID,
(this.isBlock || this.specialItem ? 1
: Item.shovelSteel.itemID), 1, getMaxID());
: Item.shovelIron.itemID), 1, getMaxID());
this.settingIntNewID.defaultValue = RequestedID;
WidgetInt intdisplay = new WidgetInt(this.settingIntNewID, "New ID");
this.subscreenIDSetter.add(intdisplay);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

import java.util.Map;

import cpw.mods.fml.relauncher.FMLRelauncher;
import cpw.mods.fml.relauncher.FMLLaunchHandler;
import cpw.mods.fml.relauncher.IFMLLoadingPlugin;

/**
* @author ShaRose
* The core plugin. Just tells FML to use the patcher class.
*/
@IFMLLoadingPlugin.MCVersion("1.5.1")
@IFMLLoadingPlugin.MCVersion("1.6.2")
public class IDResolverCorePlugin implements IFMLLoadingPlugin {

public static boolean isServer;
static
{
isServer = FMLRelauncher.side().equals("SERVER");
isServer = FMLLaunchHandler.side().equals("SERVER");
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/minecraft/sharose/mods/idresolver/IDResolverMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public static void updateUsed() {
continue;
IDResolverMod.totalFreeBlocks++;
}
for (int i = Item.shovelSteel.itemID; i < Item.itemsList.length; i++) {
for (int i = Item.shovelIron.itemID; i < Item.itemsList.length; i++) {
if(i < Block.blocksList.length)
{
if (Block.blocksList[i] != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.io.IOException;

import net.minecraft.client.Minecraft;
import net.minecraft.launchwrapper.IClassTransformer;

import org.objectweb.asm.*;
import org.objectweb.asm.tree.*;
Expand All @@ -14,7 +15,6 @@


import cpw.mods.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper;
import cpw.mods.fml.relauncher.IClassTransformer;

public class IDResolverPatcher implements IClassTransformer, Opcodes {

Expand Down