This should be everything needed to separate blocks and items completely.
This commit is contained in:
parent
06a2af3386
commit
eb73c30b28
2 changed files with 138 additions and 40 deletions
|
@ -1,6 +1,55 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/gui/achievement/GuiStats.java
|
--- ../src-base/minecraft/net/minecraft/client/gui/achievement/GuiStats.java
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/gui/achievement/GuiStats.java
|
+++ ../src-work/minecraft/net/minecraft/client/gui/achievement/GuiStats.java
|
||||||
@@ -748,7 +748,7 @@
|
@@ -5,6 +5,8 @@
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.List;
|
||||||
|
+
|
||||||
|
+import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||||
|
import net.minecraft.client.gui.GuiButton;
|
||||||
|
@@ -443,17 +445,18 @@
|
||||||
|
for (StatCrafting statcrafting : StatList.objectMineStats)
|
||||||
|
{
|
||||||
|
boolean flag = false;
|
||||||
|
- int i = Item.getIdFromItem(statcrafting.func_150959_a());
|
||||||
|
+ int i = Block.getIdFromBlock(Block.getBlockFromItem(statcrafting.func_150959_a()));
|
||||||
|
+ int itemId = Item.getIdFromItem(statcrafting.func_150959_a());
|
||||||
|
|
||||||
|
if (GuiStats.this.field_146546_t.readStat(statcrafting) > 0)
|
||||||
|
{
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
- else if (StatList.objectUseStats[i] != null && GuiStats.this.field_146546_t.readStat(StatList.objectUseStats[i]) > 0)
|
||||||
|
+ else if (StatList.objectUseStats[itemId] != null && GuiStats.this.field_146546_t.readStat(StatList.objectUseStats[itemId]) > 0)
|
||||||
|
{
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
- else if (StatList.objectCraftStats[i] != null && GuiStats.this.field_146546_t.readStat(StatList.objectCraftStats[i]) > 0)
|
||||||
|
+ else if (StatList.objectCraftStats[itemId] != null && GuiStats.this.field_146546_t.readStat(StatList.objectCraftStats[itemId]) > 0)
|
||||||
|
{
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
@@ -468,8 +471,15 @@
|
||||||
|
{
|
||||||
|
public int compare(StatCrafting p_compare_1_, StatCrafting p_compare_2_)
|
||||||
|
{
|
||||||
|
- int j = Item.getIdFromItem(p_compare_1_.func_150959_a());
|
||||||
|
- int k = Item.getIdFromItem(p_compare_2_.func_150959_a());
|
||||||
|
+ int j;
|
||||||
|
+ int k;
|
||||||
|
+ if (StatsBlock.this.field_148217_o == 2) {
|
||||||
|
+ j = Block.getIdFromBlock(Block.getBlockFromItem(p_compare_1_.func_150959_a()));
|
||||||
|
+ k = Block.getIdFromBlock(Block.getBlockFromItem(p_compare_2_.func_150959_a()));
|
||||||
|
+ } else {
|
||||||
|
+ j = Item.getIdFromItem(p_compare_1_.func_150959_a());
|
||||||
|
+ k = Item.getIdFromItem(p_compare_2_.func_150959_a());
|
||||||
|
+ }
|
||||||
|
StatBase statbase = null;
|
||||||
|
StatBase statbase1 = null;
|
||||||
|
|
||||||
|
@@ -748,7 +758,7 @@
|
||||||
super(mcIn, GuiStats.this.width, GuiStats.this.height, 32, GuiStats.this.height - 64, GuiStats.this.fontRendererObj.FONT_HEIGHT * 4);
|
super(mcIn, GuiStats.this.width, GuiStats.this.height, 32, GuiStats.this.height - 64, GuiStats.this.fontRendererObj.FONT_HEIGHT * 4);
|
||||||
this.setShowSelectionBox(false);
|
this.setShowSelectionBox(false);
|
||||||
|
|
||||||
|
@ -9,7 +58,7 @@
|
||||||
{
|
{
|
||||||
if (GuiStats.this.field_146546_t.readStat(entitylist$entityegginfo.field_151512_d) > 0 || GuiStats.this.field_146546_t.readStat(entitylist$entityegginfo.field_151513_e) > 0)
|
if (GuiStats.this.field_146546_t.readStat(entitylist$entityegginfo.field_151512_d) > 0 || GuiStats.this.field_146546_t.readStat(entitylist$entityegginfo.field_151513_e) > 0)
|
||||||
{
|
{
|
||||||
@@ -784,7 +784,7 @@
|
@@ -784,7 +794,7 @@
|
||||||
protected void drawSlot(int entryID, int p_180791_2_, int p_180791_3_, int p_180791_4_, int p_180791_5_, int p_180791_6_)
|
protected void drawSlot(int entryID, int p_180791_2_, int p_180791_3_, int p_180791_4_, int p_180791_5_, int p_180791_6_)
|
||||||
{
|
{
|
||||||
EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo)this.field_148222_l.get(entryID);
|
EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo)this.field_148222_l.get(entryID);
|
||||||
|
|
|
@ -1,43 +1,92 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/stats/StatList.java
|
--- ../src-base/minecraft/net/minecraft/stats/StatList.java
|
||||||
+++ ../src-work/minecraft/net/minecraft/stats/StatList.java
|
+++ ../src-work/minecraft/net/minecraft/stats/StatList.java
|
||||||
@@ -109,7 +109,7 @@
|
@@ -119,7 +119,7 @@
|
||||||
{
|
}
|
||||||
if (item != null)
|
}
|
||||||
{
|
|
||||||
- int i = Item.getIdFromItem(item);
|
|
||||||
+ int i = Item.getIdFromItem(item); //TODO: Hook FML's stat change event and re-assign these
|
|
||||||
String s = func_180204_a(item);
|
|
||||||
|
|
||||||
if (s != null)
|
- replaceAllSimilarBlocks(objectCraftStats);
|
||||||
@@ -126,11 +126,11 @@
|
+ replaceAllSimilarBlocks(objectCraftStats, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void initMiningStats()
|
||||||
|
@@ -141,7 +141,7 @@
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- replaceAllSimilarBlocks(mineBlockStatArray);
|
||||||
|
+ replaceAllSimilarBlocks(mineBlockStatArray, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void initStats()
|
||||||
|
@@ -165,7 +165,7 @@
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- replaceAllSimilarBlocks(objectUseStats);
|
||||||
|
+ replaceAllSimilarBlocks(objectUseStats, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void initItemDepleteStats()
|
||||||
|
@@ -184,7 +184,7 @@
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- replaceAllSimilarBlocks(objectBreakStats);
|
||||||
|
+ replaceAllSimilarBlocks(objectBreakStats, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String func_180204_a(Item p_180204_0_)
|
||||||
|
@@ -193,28 +193,35 @@
|
||||||
|
return resourcelocation != null ? resourcelocation.toString().replace(':', '.') : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
- private static void replaceAllSimilarBlocks(StatBase[] p_75924_0_)
|
||||||
|
+ private static void replaceAllSimilarBlocks(StatBase[] p_75924_0_, boolean useItemIds)
|
||||||
{
|
{
|
||||||
for (Block block : Block.blockRegistry)
|
- func_151180_a(p_75924_0_, Blocks.water, Blocks.flowing_water);
|
||||||
|
- func_151180_a(p_75924_0_, Blocks.lava, Blocks.flowing_lava);
|
||||||
|
- func_151180_a(p_75924_0_, Blocks.lit_pumpkin, Blocks.pumpkin);
|
||||||
|
- func_151180_a(p_75924_0_, Blocks.lit_furnace, Blocks.furnace);
|
||||||
|
- func_151180_a(p_75924_0_, Blocks.lit_redstone_ore, Blocks.redstone_ore);
|
||||||
|
- func_151180_a(p_75924_0_, Blocks.powered_repeater, Blocks.unpowered_repeater);
|
||||||
|
- func_151180_a(p_75924_0_, Blocks.powered_comparator, Blocks.unpowered_comparator);
|
||||||
|
- func_151180_a(p_75924_0_, Blocks.redstone_torch, Blocks.unlit_redstone_torch);
|
||||||
|
- func_151180_a(p_75924_0_, Blocks.lit_redstone_lamp, Blocks.redstone_lamp);
|
||||||
|
- func_151180_a(p_75924_0_, Blocks.double_stone_slab, Blocks.stone_slab);
|
||||||
|
- func_151180_a(p_75924_0_, Blocks.double_wooden_slab, Blocks.wooden_slab);
|
||||||
|
- func_151180_a(p_75924_0_, Blocks.double_stone_slab2, Blocks.stone_slab2);
|
||||||
|
- func_151180_a(p_75924_0_, Blocks.grass, Blocks.dirt);
|
||||||
|
- func_151180_a(p_75924_0_, Blocks.farmland, Blocks.dirt);
|
||||||
|
+ func_151180_a(p_75924_0_, Blocks.water, Blocks.flowing_water, useItemIds);
|
||||||
|
+ func_151180_a(p_75924_0_, Blocks.lava, Blocks.flowing_lava, useItemIds);
|
||||||
|
+ func_151180_a(p_75924_0_, Blocks.lit_pumpkin, Blocks.pumpkin, useItemIds);
|
||||||
|
+ func_151180_a(p_75924_0_, Blocks.lit_furnace, Blocks.furnace, useItemIds);
|
||||||
|
+ func_151180_a(p_75924_0_, Blocks.lit_redstone_ore, Blocks.redstone_ore, useItemIds);
|
||||||
|
+ func_151180_a(p_75924_0_, Blocks.powered_repeater, Blocks.unpowered_repeater, useItemIds);
|
||||||
|
+ func_151180_a(p_75924_0_, Blocks.powered_comparator, Blocks.unpowered_comparator, useItemIds);
|
||||||
|
+ func_151180_a(p_75924_0_, Blocks.redstone_torch, Blocks.unlit_redstone_torch, useItemIds);
|
||||||
|
+ func_151180_a(p_75924_0_, Blocks.lit_redstone_lamp, Blocks.redstone_lamp, useItemIds);
|
||||||
|
+ func_151180_a(p_75924_0_, Blocks.double_stone_slab, Blocks.stone_slab, useItemIds);
|
||||||
|
+ func_151180_a(p_75924_0_, Blocks.double_wooden_slab, Blocks.wooden_slab, useItemIds);
|
||||||
|
+ func_151180_a(p_75924_0_, Blocks.double_stone_slab2, Blocks.stone_slab2, useItemIds);
|
||||||
|
+ func_151180_a(p_75924_0_, Blocks.grass, Blocks.dirt, useItemIds);
|
||||||
|
+ func_151180_a(p_75924_0_, Blocks.farmland, Blocks.dirt, useItemIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
- private static void func_151180_a(StatBase[] p_151180_0_, Block p_151180_1_, Block p_151180_2_)
|
||||||
|
+ private static void func_151180_a(StatBase[] p_151180_0_, Block p_151180_1_, Block p_151180_2_, boolean useItemIds)
|
||||||
|
{
|
||||||
|
- int i = Block.getIdFromBlock(p_151180_1_);
|
||||||
|
- int j = Block.getIdFromBlock(p_151180_2_);
|
||||||
|
+ int i;
|
||||||
|
+ int j;
|
||||||
|
+ if (useItemIds) {
|
||||||
|
+ i = Item.getIdFromItem(Item.getItemFromBlock(p_151180_1_));
|
||||||
|
+ j = Item.getIdFromItem(Item.getItemFromBlock(p_151180_2_));
|
||||||
|
+ } else {
|
||||||
|
+ i = Block.getIdFromBlock(p_151180_1_);
|
||||||
|
+ j = Block.getIdFromBlock(p_151180_2_);
|
||||||
|
+ }
|
||||||
|
|
||||||
|
if (p_151180_0_[i] != null && p_151180_0_[j] == null)
|
||||||
{
|
{
|
||||||
- Item item = Item.getItemFromBlock(block);
|
|
||||||
+ Item item = Item.getItemFromBlock(block); //TODO: Hook FML's stat change event and re-assign these
|
|
||||||
|
|
||||||
if (item != null)
|
|
||||||
{
|
|
||||||
- int i = Block.getIdFromBlock(block);
|
|
||||||
+ int i = Block.getIdFromBlock(block); //TODO: Hook FML's stat change event and re-assign these
|
|
||||||
String s = func_180204_a(item);
|
|
||||||
|
|
||||||
if (s != null && block.getEnableStats())
|
|
||||||
@@ -150,7 +150,7 @@
|
|
||||||
{
|
|
||||||
if (item != null)
|
|
||||||
{
|
|
||||||
- int i = Item.getIdFromItem(item);
|
|
||||||
+ int i = Item.getIdFromItem(item); //TODO: Hook FML's stat change event and re-assign these
|
|
||||||
String s = func_180204_a(item);
|
|
||||||
|
|
||||||
if (s != null)
|
|
||||||
@@ -174,7 +174,7 @@
|
|
||||||
{
|
|
||||||
if (item != null)
|
|
||||||
{
|
|
||||||
- int i = Item.getIdFromItem(item);
|
|
||||||
+ int i = Item.getIdFromItem(item); //TODO: Hook FML's stat change event and re-assign these
|
|
||||||
String s = func_180204_a(item);
|
|
||||||
|
|
||||||
if (s != null && item.isDamageable())
|
|
||||||
|
|
Loading…
Reference in a new issue