mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-14 09:05:17 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d06e0ad71b | ||
|
|
8182c93525 | ||
|
|
23cdcb96a9 | ||
|
|
b53e53dcb7 | ||
|
|
7c6372202e | ||
|
|
b5bda7117a | ||
|
|
d31cf8ddbc | ||
|
|
ce4d31529d | ||
|
|
f4ca1f61b9 | ||
|
|
c7e54b8ecc | ||
|
|
eca3b900e0 | ||
|
|
1d21345dfd | ||
|
|
76efd93235 | ||
|
|
e349855688 | ||
|
|
b317d5d107 | ||
|
|
cd81cd0934 | ||
|
|
3930f6f8bd | ||
|
|
f61605c7af | ||
|
|
cc2895b793 | ||
|
|
c01e98e25f | ||
|
|
9ca3ede736 |
No files matched your search
+2
-1
@@ -29,7 +29,8 @@
|
||||
{
|
||||
"comment": "Force the downgrade on dedicated server to match client. Netty bug: https://github.com/MinecraftForge/MinecraftForge/issues/1848",
|
||||
"name": "io.netty:netty-all:4.0.15.Final",
|
||||
"serverreq":true
|
||||
"serverreq":true,
|
||||
"clientclasspath":false
|
||||
},
|
||||
{
|
||||
"name": "net.minecraft:launchwrapper:1.12",
|
||||
|
||||
@@ -26,11 +26,6 @@
|
||||
"name": "@artifact@",
|
||||
"url": "http://files.minecraftforge.net/maven/"
|
||||
},
|
||||
{
|
||||
"comment": "Force the downgrade on dedicated server to match client. Netty bug: https://github.com/MinecraftForge/MinecraftForge/issues/1848",
|
||||
"name": "io.netty:netty-all:4.0.23.Final",
|
||||
"serverreq":true
|
||||
},
|
||||
{
|
||||
"name": "net.minecraft:launchwrapper:1.12",
|
||||
"serverreq":true
|
||||
|
||||
@@ -26,11 +26,6 @@
|
||||
"name": "@artifact@",
|
||||
"url": "http://files.minecraftforge.net/maven/"
|
||||
},
|
||||
{
|
||||
"comment": "Force the downgrade on dedicated server to match client. Netty bug: https://github.com/MinecraftForge/MinecraftForge/issues/1848",
|
||||
"name": "io.netty:netty-all:4.0.23.Final",
|
||||
"serverreq":true
|
||||
},
|
||||
{
|
||||
"name": "net.minecraft:launchwrapper:1.12",
|
||||
"serverreq":true
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
}
|
||||
|
||||
protected BlockRailBase(boolean p_i45389_1_)
|
||||
@@ -175,6 +175,81 @@
|
||||
@@ -175,6 +175,98 @@
|
||||
|
||||
public abstract IProperty<BlockRailBase.EnumRailDirection> func_176560_l();
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
+ * Return true if the rail can make corners.
|
||||
+ * Used by placement logic.
|
||||
+ * @param world The world.
|
||||
+ * @param pod Block's position in world
|
||||
+ * @param pos Block's position in world
|
||||
+ * @return True if the rail can make corners.
|
||||
+ */
|
||||
+ public boolean isFlexibleRail(IBlockAccess world, BlockPos pos)
|
||||
@@ -30,7 +30,7 @@
|
||||
+ * Returns true if the rail can make up and down slopes.
|
||||
+ * Used by placement logic.
|
||||
+ * @param world The world.
|
||||
+ * @param pod Block's position in world
|
||||
+ * @param pos Block's position in world
|
||||
+ * @return True if the rail can make slopes.
|
||||
+ */
|
||||
+ public boolean canMakeSlopes(IBlockAccess world, BlockPos pos)
|
||||
@@ -39,10 +39,27 @@
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Return the rail's direction.
|
||||
+ * Can be used to make the cart think the rail is a different shape,
|
||||
+ * for example when making diamond junctions or switches.
|
||||
+ * The cart parameter will often be null unless it it called from EntityMinecart.
|
||||
+ *
|
||||
+ * @param world The world.
|
||||
+ * @param pos Block's position in world
|
||||
+ * @param state The BlockState
|
||||
+ * @param cart The cart asking for the metadata, null if it is not called by EntityMinecart.
|
||||
+ * @return The direction.
|
||||
+ */
|
||||
+ public EnumRailDirection getRailDirection(IBlockAccess world, BlockPos pos, IBlockState state, @javax.annotation.Nullable net.minecraft.entity.item.EntityMinecart cart)
|
||||
+ {
|
||||
+ return state.func_177229_b(func_176560_l());
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns the max speed of the rail at the specified position.
|
||||
+ * @param world The world.
|
||||
+ * @param cart The cart on the rail, may be null.
|
||||
+ * @param pod Block's position in world
|
||||
+ * @param pos Block's position in world
|
||||
+ * @return The max speed of the current rail.
|
||||
+ */
|
||||
+ public float getRailMaxSpeed(World world, net.minecraft.entity.item.EntityMinecart cart, BlockPos pos)
|
||||
@@ -55,7 +72,7 @@
|
||||
+ * It is called once per update tick that the minecart is on the rail.
|
||||
+ * @param world The world.
|
||||
+ * @param cart The cart on the rail.
|
||||
+ * @param pod Block's position in world
|
||||
+ * @param pos Block's position in world
|
||||
+ */
|
||||
+ public void onMinecartPass(World world, net.minecraft.entity.item.EntityMinecart cart, BlockPos pos)
|
||||
+ {
|
||||
@@ -91,7 +108,7 @@
|
||||
public static enum EnumRailDirection implements IStringSerializable
|
||||
{
|
||||
NORTH_SOUTH(0, "north_south"),
|
||||
@@ -245,6 +320,7 @@
|
||||
@@ -245,6 +337,7 @@
|
||||
private IBlockState field_180366_e;
|
||||
private final boolean field_150656_f;
|
||||
private final List<BlockPos> field_150657_g = Lists.<BlockPos>newArrayList();
|
||||
@@ -99,17 +116,19 @@
|
||||
|
||||
public Rail(World p_i45739_2_, BlockPos p_i45739_3_, IBlockState p_i45739_4_)
|
||||
{
|
||||
@@ -253,7 +329,8 @@
|
||||
@@ -252,8 +345,9 @@
|
||||
this.field_180367_c = p_i45739_3_;
|
||||
this.field_180366_e = p_i45739_4_;
|
||||
this.field_180365_d = (BlockRailBase)p_i45739_4_.func_177230_c();
|
||||
BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)p_i45739_4_.func_177229_b(BlockRailBase.this.func_176560_l());
|
||||
- BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)p_i45739_4_.func_177229_b(BlockRailBase.this.func_176560_l());
|
||||
- this.field_150656_f = this.field_180365_d.field_150053_a;
|
||||
+ BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = field_180365_d.getRailDirection(p_i45739_2_, p_i45739_3_, p_i45739_4_, null);
|
||||
+ this.field_150656_f = !this.field_180365_d.isFlexibleRail(p_i45739_2_, p_i45739_3_);
|
||||
+ canMakeSlopes = this.field_180365_d.canMakeSlopes(p_i45739_2_, p_i45739_3_);
|
||||
this.func_180360_a(blockrailbase$enumraildirection);
|
||||
}
|
||||
|
||||
@@ -439,7 +516,7 @@
|
||||
@@ -439,7 +533,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,7 +137,7 @@
|
||||
{
|
||||
if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos.func_177984_a()))
|
||||
{
|
||||
@@ -452,7 +529,7 @@
|
||||
@@ -452,7 +546,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,7 +146,7 @@
|
||||
{
|
||||
if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos3.func_177984_a()))
|
||||
{
|
||||
@@ -595,7 +672,7 @@
|
||||
@@ -595,7 +689,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,7 +155,7 @@
|
||||
{
|
||||
if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos.func_177984_a()))
|
||||
{
|
||||
@@ -608,7 +685,7 @@
|
||||
@@ -608,7 +702,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
+ {
|
||||
+ for (int y = 0; y < height; y++)
|
||||
+ {
|
||||
+ if (func_175162_d(pos.func_177982_a(0, y, 0))) return false;
|
||||
+ if (!func_175162_d(pos.func_177982_a(0, y, 0))) return false;
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
@@ -21,9 +21,9 @@
|
||||
double d1 = p_145771_5_ - (double)blockpos.func_177952_p();
|
||||
|
||||
- if (!this.func_175162_d(blockpos))
|
||||
+ int entHeight = Math.max(Math.round(this.field_70131_O), 1);
|
||||
+ int entHeight = Math.max((int)Math.ceil(this.field_70131_O), 1);
|
||||
+
|
||||
+ boolean inTranslucentBlock = this.isHeadspaceFree(blockpos, entHeight);
|
||||
+ boolean inTranslucentBlock = !this.isHeadspaceFree(blockpos, entHeight);
|
||||
+
|
||||
+ if (inTranslucentBlock)
|
||||
{
|
||||
@@ -31,31 +31,40 @@
|
||||
double d2 = 9999.0D;
|
||||
|
||||
- if (this.func_175162_d(blockpos.func_177976_e()) && d0 < d2)
|
||||
+ if (!this.isHeadspaceFree(blockpos.func_177976_e(), entHeight) && d0 < d2)
|
||||
+ if (this.isHeadspaceFree(blockpos.func_177976_e(), entHeight) && d0 < d2)
|
||||
{
|
||||
d2 = d0;
|
||||
i = 0;
|
||||
}
|
||||
|
||||
- if (this.func_175162_d(blockpos.func_177974_f()) && 1.0D - d0 < d2)
|
||||
+ if (!this.isHeadspaceFree(blockpos.func_177974_f(), entHeight) && 1.0D - d0 < d2)
|
||||
+ if (this.isHeadspaceFree(blockpos.func_177974_f(), entHeight) && 1.0D - d0 < d2)
|
||||
{
|
||||
d2 = 1.0D - d0;
|
||||
i = 1;
|
||||
}
|
||||
|
||||
- if (this.func_175162_d(blockpos.func_177978_c()) && d1 < d2)
|
||||
+ if (!this.isHeadspaceFree(blockpos.func_177978_c(), entHeight) && d1 < d2)
|
||||
+ if (this.isHeadspaceFree(blockpos.func_177978_c(), entHeight) && d1 < d2)
|
||||
{
|
||||
d2 = d1;
|
||||
i = 4;
|
||||
}
|
||||
|
||||
- if (this.func_175162_d(blockpos.func_177968_d()) && 1.0D - d1 < d2)
|
||||
+ if (!this.isHeadspaceFree(blockpos.func_177968_d(), entHeight) && 1.0D - d1 < d2)
|
||||
+ if (this.isHeadspaceFree(blockpos.func_177968_d(), entHeight) && 1.0D - d1 < d2)
|
||||
{
|
||||
d2 = 1.0D - d1;
|
||||
i = 5;
|
||||
@@ -415,7 +428,7 @@
|
||||
|
||||
private boolean func_175162_d(BlockPos p_175162_1_)
|
||||
{
|
||||
- return !this.field_70170_p.func_180495_p(p_175162_1_).func_177230_c().func_149721_r() && !this.field_70170_p.func_180495_p(p_175162_1_.func_177984_a()).func_177230_c().func_149721_r();
|
||||
+ return !this.field_70170_p.func_180495_p(p_175162_1_).func_177230_c().func_149721_r();
|
||||
}
|
||||
|
||||
public void func_70031_b(boolean p_70031_1_)
|
||||
@@ -448,6 +461,12 @@
|
||||
|
||||
public void func_85030_a(String p_85030_1_, float p_85030_2_, float p_85030_3_)
|
||||
|
||||
@@ -10,37 +10,22 @@
|
||||
}
|
||||
|
||||
protected void func_146279_a(String p_146279_1_, int p_146279_2_, int p_146279_3_)
|
||||
@@ -153,6 +154,11 @@
|
||||
@@ -153,7 +154,13 @@
|
||||
|
||||
protected void func_146283_a(List<String> p_146283_1_, int p_146283_2_, int p_146283_3_)
|
||||
{
|
||||
- if (!p_146283_1_.isEmpty())
|
||||
+ drawHoveringText(p_146283_1_, p_146283_2_, p_146283_3_, field_146289_q);
|
||||
+ }
|
||||
+
|
||||
+ protected void drawHoveringText(List<String> p_146283_1_, int p_146283_2_, int p_146283_3_, FontRenderer font)
|
||||
+ {
|
||||
if (!p_146283_1_.isEmpty())
|
||||
+ net.minecraftforge.fml.client.config.GuiUtils.drawHoveringText(p_146283_1_, p_146283_2_, p_146283_3_, field_146294_l, field_146295_m, -1, font);
|
||||
+ if (false && !p_146283_1_.isEmpty())
|
||||
{
|
||||
GlStateManager.func_179101_C();
|
||||
@@ -163,7 +169,7 @@
|
||||
|
||||
for (String s : p_146283_1_)
|
||||
{
|
||||
- int j = this.field_146289_q.func_78256_a(s);
|
||||
+ int j = font.func_78256_a(s);
|
||||
|
||||
if (j > i)
|
||||
{
|
||||
@@ -208,7 +214,7 @@
|
||||
for (int k1 = 0; k1 < p_146283_1_.size(); ++k1)
|
||||
{
|
||||
String s1 = (String)p_146283_1_.get(k1);
|
||||
- this.field_146289_q.func_175063_a(s1, (float)l1, (float)i2, -1);
|
||||
+ font.func_175063_a(s1, (float)l1, (float)i2, -1);
|
||||
|
||||
if (k1 == 0)
|
||||
{
|
||||
@@ -436,6 +442,7 @@
|
||||
RenderHelper.func_74518_a();
|
||||
@@ -436,6 +443,7 @@
|
||||
{
|
||||
this.field_146297_k.field_71456_v.func_146158_b().func_146239_a(p_175281_1_);
|
||||
}
|
||||
@@ -48,7 +33,7 @@
|
||||
|
||||
this.field_146297_k.field_71439_g.func_71165_d(p_175281_1_);
|
||||
}
|
||||
@@ -450,9 +457,15 @@
|
||||
@@ -450,9 +458,15 @@
|
||||
|
||||
if (guibutton.func_146116_c(this.field_146297_k, p_73864_1_, p_73864_2_))
|
||||
{
|
||||
@@ -64,7 +49,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -482,8 +495,12 @@
|
||||
@@ -482,8 +496,12 @@
|
||||
this.field_146289_q = p_146280_1_.field_71466_p;
|
||||
this.field_146294_l = p_146280_2_;
|
||||
this.field_146295_m = p_146280_3_;
|
||||
@@ -77,7 +62,7 @@
|
||||
}
|
||||
|
||||
public void func_183500_a(int p_183500_1_, int p_183500_2_)
|
||||
@@ -502,7 +519,9 @@
|
||||
@@ -502,7 +520,9 @@
|
||||
{
|
||||
while (Mouse.next())
|
||||
{
|
||||
@@ -87,7 +72,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -510,7 +529,9 @@
|
||||
@@ -510,7 +530,9 @@
|
||||
{
|
||||
while (Keyboard.next())
|
||||
{
|
||||
@@ -97,7 +82,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -570,6 +591,7 @@
|
||||
@@ -570,6 +592,7 @@
|
||||
public void func_146276_q_()
|
||||
{
|
||||
this.func_146270_b(0);
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
+ if (--this.field_75445_i <= 0)
|
||||
+ {
|
||||
+ this.field_75438_g = this.field_75441_b.func_70661_as().func_75494_a(entitylivingbase);
|
||||
+ this.field_151497_i = 4 + this.field_75441_b.func_70681_au().nextInt(7);
|
||||
+ this.field_75445_i = 4 + this.field_75441_b.func_70681_au().nextInt(7);
|
||||
+ return this.field_75438_g != null;
|
||||
+ }
|
||||
+ else
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
+ if (this.canPenalize)
|
||||
+ {
|
||||
+ this.field_151497_i += failedPathFindingPenalty;
|
||||
+ this.field_75445_i += failedPathFindingPenalty;
|
||||
+ if (this.field_75441_b.func_70661_as().func_75505_d() != null)
|
||||
+ {
|
||||
+ net.minecraft.pathfinding.PathPoint finalPathPoint = this.field_75441_b.func_70661_as().func_75505_d().func_75870_c();
|
||||
|
||||
@@ -117,8 +117,9 @@
|
||||
}
|
||||
|
||||
- double d0 = 0.0078125D;
|
||||
- BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)p_180460_2_.func_177229_b(blockrailbase.func_176560_l());
|
||||
+ double slopeAdjustment = getSlopeAdjustment();
|
||||
BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)p_180460_2_.func_177229_b(blockrailbase.func_176560_l());
|
||||
+ BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = blockrailbase.getRailDirection(field_70170_p, p_180460_1_, p_180460_2_, this);
|
||||
|
||||
switch (blockrailbase$enumraildirection)
|
||||
{
|
||||
@@ -190,6 +191,24 @@
|
||||
double d15 = Math.sqrt(this.field_70159_w * this.field_70159_w + this.field_70179_y * this.field_70179_y);
|
||||
|
||||
if (d15 > 0.01D)
|
||||
@@ -654,7 +679,7 @@
|
||||
|
||||
if (BlockRailBase.func_176563_d(iblockstate))
|
||||
{
|
||||
- BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)iblockstate.func_177229_b(((BlockRailBase)iblockstate.func_177230_c()).func_176560_l());
|
||||
+ BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = ((BlockRailBase)iblockstate.func_177230_c()).getRailDirection(field_70170_p, new BlockPos(i, j, k), iblockstate, this);
|
||||
p_70495_3_ = (double)j;
|
||||
|
||||
if (blockrailbase$enumraildirection.func_177018_c())
|
||||
@@ -703,7 +728,7 @@
|
||||
|
||||
if (BlockRailBase.func_176563_d(iblockstate))
|
||||
{
|
||||
- BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)iblockstate.func_177229_b(((BlockRailBase)iblockstate.func_177230_c()).func_176560_l());
|
||||
+ BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = ((BlockRailBase)iblockstate.func_177230_c()).getRailDirection(field_70170_p, new BlockPos(i, j, k), iblockstate, this);
|
||||
int[][] aint = field_70500_g[blockrailbase$enumraildirection.func_177015_a()];
|
||||
double d0 = 0.0D;
|
||||
double d1 = (double)i + 0.5D + (double)aint[0][0] * 0.5D;
|
||||
@@ -817,13 +842,20 @@
|
||||
|
||||
public void func_70108_f(Entity p_70108_1_)
|
||||
|
||||
@@ -141,7 +141,7 @@
|
||||
+ if (!this.field_72995_K && (flags & 1) != 0)
|
||||
{
|
||||
- this.func_175722_b(p_180501_1_, iblockstate.func_177230_c());
|
||||
+ this.func_175722_b(pos, new_.func_177230_c());
|
||||
+ this.func_175722_b(pos, old.func_177230_c());
|
||||
|
||||
- if (block.func_149740_M())
|
||||
+ if (new_.func_177230_c().func_149740_M())
|
||||
|
||||
@@ -64,12 +64,14 @@
|
||||
|
||||
if (j1 > 0)
|
||||
{
|
||||
@@ -668,28 +673,18 @@
|
||||
@@ -668,28 +673,19 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (block1 instanceof ITileEntityProvider)
|
||||
- {
|
||||
+ // If capturing blocks, only run block physics for TE's. Non-TE's are handled in ForgeHooks.onPlaceItemIntoWorld
|
||||
+ if (!this.field_76637_e.field_72995_K && block1 != block && (!this.field_76637_e.captureBlockSnapshots || block.hasTileEntity(p_177436_2_)))
|
||||
{
|
||||
- TileEntity tileentity = this.func_177424_a(p_177436_1_, Chunk.EnumCreateEntityType.CHECK);
|
||||
-
|
||||
- if (tileentity != null)
|
||||
@@ -78,8 +80,8 @@
|
||||
- }
|
||||
- }
|
||||
-
|
||||
if (!this.field_76637_e.field_72995_K && block1 != block)
|
||||
{
|
||||
- if (!this.field_76637_e.field_72995_K && block1 != block)
|
||||
- {
|
||||
block.func_176213_c(this.field_76637_e, p_177436_1_, p_177436_2_);
|
||||
}
|
||||
|
||||
@@ -95,7 +97,7 @@
|
||||
this.field_76637_e.func_175690_a(p_177436_1_, tileentity1);
|
||||
}
|
||||
|
||||
@@ -792,6 +787,7 @@
|
||||
@@ -792,6 +788,7 @@
|
||||
k = this.field_76645_j.length - 1;
|
||||
}
|
||||
|
||||
@@ -103,7 +105,7 @@
|
||||
p_76612_1_.field_70175_ag = true;
|
||||
p_76612_1_.field_70176_ah = this.field_76635_g;
|
||||
p_76612_1_.field_70162_ai = k;
|
||||
@@ -830,13 +826,20 @@
|
||||
@@ -830,13 +827,20 @@
|
||||
private TileEntity func_177422_i(BlockPos p_177422_1_)
|
||||
{
|
||||
Block block = this.func_177428_a(p_177422_1_);
|
||||
@@ -125,7 +127,7 @@
|
||||
if (tileentity == null)
|
||||
{
|
||||
if (p_177424_2_ == Chunk.EnumCreateEntityType.IMMEDIATE)
|
||||
@@ -846,14 +849,9 @@
|
||||
@@ -846,14 +850,9 @@
|
||||
}
|
||||
else if (p_177424_2_ == Chunk.EnumCreateEntityType.QUEUED)
|
||||
{
|
||||
@@ -141,7 +143,7 @@
|
||||
|
||||
return tileentity;
|
||||
}
|
||||
@@ -873,7 +871,7 @@
|
||||
@@ -873,7 +872,7 @@
|
||||
p_177426_2_.func_145834_a(this.field_76637_e);
|
||||
p_177426_2_.func_174878_a(p_177426_1_);
|
||||
|
||||
@@ -150,7 +152,7 @@
|
||||
{
|
||||
if (this.field_150816_i.containsKey(p_177426_1_))
|
||||
{
|
||||
@@ -882,6 +880,7 @@
|
||||
@@ -882,6 +881,7 @@
|
||||
|
||||
p_177426_2_.func_145829_t();
|
||||
this.field_150816_i.put(p_177426_1_, p_177426_2_);
|
||||
@@ -158,7 +160,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -910,8 +909,9 @@
|
||||
@@ -910,8 +910,9 @@
|
||||
entity.func_110123_P();
|
||||
}
|
||||
|
||||
@@ -169,7 +171,7 @@
|
||||
}
|
||||
|
||||
public void func_76623_d()
|
||||
@@ -927,6 +927,7 @@
|
||||
@@ -927,6 +928,7 @@
|
||||
{
|
||||
this.field_76637_e.func_175681_c(this.field_76645_j[i]);
|
||||
}
|
||||
@@ -177,7 +179,7 @@
|
||||
}
|
||||
|
||||
public void func_76630_e()
|
||||
@@ -936,8 +937,8 @@
|
||||
@@ -936,8 +938,8 @@
|
||||
|
||||
public void func_177414_a(Entity p_177414_1_, AxisAlignedBB p_177414_2_, List<Entity> p_177414_3_, Predicate <? super Entity > p_177414_4_)
|
||||
{
|
||||
@@ -188,7 +190,7 @@
|
||||
i = MathHelper.func_76125_a(i, 0, this.field_76645_j.length - 1);
|
||||
j = MathHelper.func_76125_a(j, 0, this.field_76645_j.length - 1);
|
||||
|
||||
@@ -976,8 +977,8 @@
|
||||
@@ -976,8 +978,8 @@
|
||||
|
||||
public <T extends Entity> void func_177430_a(Class <? extends T > p_177430_1_, AxisAlignedBB p_177430_2_, List<T> p_177430_3_, Predicate <? super T > p_177430_4_)
|
||||
{
|
||||
@@ -199,7 +201,7 @@
|
||||
i = MathHelper.func_76125_a(i, 0, this.field_76645_j.length - 1);
|
||||
j = MathHelper.func_76125_a(j, 0, this.field_76645_j.length - 1);
|
||||
|
||||
@@ -1137,8 +1138,10 @@
|
||||
@@ -1137,8 +1139,10 @@
|
||||
while (!this.field_177447_w.isEmpty())
|
||||
{
|
||||
BlockPos blockpos = (BlockPos)this.field_177447_w.poll();
|
||||
@@ -211,7 +213,7 @@
|
||||
{
|
||||
TileEntity tileentity = this.func_177422_i(blockpos);
|
||||
this.field_76637_e.func_175690_a(blockpos, tileentity);
|
||||
@@ -1200,6 +1203,13 @@
|
||||
@@ -1200,6 +1204,13 @@
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void func_177439_a(byte[] p_177439_1_, int p_177439_2_, boolean p_177439_3_)
|
||||
{
|
||||
@@ -225,7 +227,7 @@
|
||||
int i = 0;
|
||||
boolean flag = !this.field_76637_e.field_73011_w.func_177495_o();
|
||||
|
||||
@@ -1267,10 +1277,16 @@
|
||||
@@ -1267,10 +1278,16 @@
|
||||
this.field_76646_k = true;
|
||||
this.func_76590_a();
|
||||
|
||||
@@ -242,7 +244,7 @@
|
||||
}
|
||||
|
||||
public BiomeGenBase func_177411_a(BlockPos p_177411_1_, WorldChunkManager p_177411_2_)
|
||||
@@ -1583,4 +1599,20 @@
|
||||
@@ -1583,4 +1600,20 @@
|
||||
QUEUED,
|
||||
CHECK;
|
||||
}
|
||||
|
||||
@@ -178,6 +178,7 @@ public class BlockSnapshot implements Serializable
|
||||
if (te != null)
|
||||
{
|
||||
te.readFromNBT(nbt);
|
||||
te.markDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,6 +214,7 @@ public class BlockSnapshot implements Serializable
|
||||
if (te != null)
|
||||
{
|
||||
te.readFromNBT(nbt);
|
||||
te.markDirty();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -228,13 +228,15 @@ public class BlockFluidFinite extends BlockFluidBase
|
||||
@Override
|
||||
public FluidStack drain(World world, BlockPos pos, boolean doDrain)
|
||||
{
|
||||
final FluidStack fluidStack = new FluidStack(getFluid(),
|
||||
MathHelper.floor_float(getQuantaPercentage(world, pos) * FluidContainerRegistry.BUCKET_VOLUME));
|
||||
|
||||
if (doDrain)
|
||||
{
|
||||
world.setBlockToAir(pos);
|
||||
}
|
||||
|
||||
return new FluidStack(getFluid(),
|
||||
MathHelper.floor_float(getQuantaPercentage(world, pos) * FluidContainerRegistry.BUCKET_VOLUME));
|
||||
return fluidStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,6 +17,7 @@ import static net.minecraftforge.fml.client.config.GuiUtils.UNDO_CHAR;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -336,15 +337,15 @@ public class GuiConfig extends GuiScreen
|
||||
super.drawScreen(mouseX, mouseY, partialTicks);
|
||||
this.entryList.drawScreenPost(mouseX, mouseY, partialTicks);
|
||||
if (this.undoHoverChecker.checkHover(mouseX, mouseY))
|
||||
this.drawToolTip(this.mc.fontRendererObj.listFormattedStringToWidth(I18n.format("fml.configgui.tooltip.undoAll"), 300), mouseX, mouseY);
|
||||
this.drawToolTip(Arrays.asList(I18n.format("fml.configgui.tooltip.undoAll").split("\n")), mouseX, mouseY);
|
||||
if (this.resetHoverChecker.checkHover(mouseX, mouseY))
|
||||
this.drawToolTip(this.mc.fontRendererObj.listFormattedStringToWidth(I18n.format("fml.configgui.tooltip.resetAll"), 300), mouseX, mouseY);
|
||||
this.drawToolTip(Arrays.asList(I18n.format("fml.configgui.tooltip.resetAll").split("\n")), mouseX, mouseY);
|
||||
if (this.checkBoxHoverChecker.checkHover(mouseX, mouseY))
|
||||
this.drawToolTip(this.mc.fontRendererObj.listFormattedStringToWidth(I18n.format("fml.configgui.tooltip.applyGlobally"), 300), mouseX, mouseY);
|
||||
this.drawToolTip(Arrays.asList(I18n.format("fml.configgui.tooltip.applyGlobally").split("\n")), mouseX, mouseY);
|
||||
}
|
||||
|
||||
public void drawToolTip(List<String> stringList, int x, int y)
|
||||
{
|
||||
this.drawHoveringText(stringList, x, y);
|
||||
GuiUtils.drawHoveringText(stringList, x, y, width, height, 300, fontRendererObj);
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,7 @@ import static net.minecraftforge.fml.client.config.GuiUtils.UNDO_CHAR;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
@@ -1490,6 +1491,7 @@ public class GuiConfigEntries extends GuiListExtended
|
||||
this.defaultHoverChecker = new HoverChecker(this.btnDefault, 800);
|
||||
this.undoToolTip = Arrays.asList(new String[] { I18n.format("fml.configgui.tooltip.undoChanges") });
|
||||
this.defaultToolTip = Arrays.asList(new String[] { I18n.format("fml.configgui.tooltip.resetToDefault") });
|
||||
this.toolTip = new ArrayList<String>();
|
||||
|
||||
this.drawLabel = true;
|
||||
|
||||
@@ -1498,23 +1500,19 @@ public class GuiConfigEntries extends GuiListExtended
|
||||
comment = I18n.format(configElement.getLanguageKey() + ".tooltip").replace("\\n", "\n");
|
||||
|
||||
if (!comment.equals(configElement.getLanguageKey() + ".tooltip"))
|
||||
toolTip = new ArrayList<String>(this.mc.fontRendererObj.listFormattedStringToWidth(
|
||||
EnumChatFormatting.GREEN + name + "\n" + EnumChatFormatting.YELLOW + comment, 300));
|
||||
Collections.addAll(toolTip, (EnumChatFormatting.GREEN + name + "\n" + EnumChatFormatting.YELLOW + comment).split("\n"));
|
||||
else if (configElement.getComment() != null && !configElement.getComment().trim().isEmpty())
|
||||
toolTip = new ArrayList<String>(this.mc.fontRendererObj.listFormattedStringToWidth(
|
||||
EnumChatFormatting.GREEN + name + "\n" + EnumChatFormatting.YELLOW + configElement.getComment(), 300));
|
||||
Collections.addAll(toolTip, (EnumChatFormatting.GREEN + name + "\n" + EnumChatFormatting.YELLOW + configElement.getComment()).split("\n"));
|
||||
else
|
||||
toolTip = new ArrayList<String>(this.mc.fontRendererObj.listFormattedStringToWidth(
|
||||
EnumChatFormatting.GREEN + name + "\n" + EnumChatFormatting.RED + "No tooltip defined.", 300));
|
||||
Collections.addAll(toolTip, (EnumChatFormatting.GREEN + name + "\n" + EnumChatFormatting.RED + "No tooltip defined.").split("\n"));
|
||||
|
||||
if ((configElement.getType() == ConfigGuiType.INTEGER
|
||||
&& (Integer.valueOf(configElement.getMinValue().toString()) != Integer.MIN_VALUE || Integer.valueOf(configElement.getMaxValue().toString()) != Integer.MAX_VALUE))
|
||||
|| (configElement.getType() == ConfigGuiType.DOUBLE
|
||||
&& (Double.valueOf(configElement.getMinValue().toString()) != -Double.MAX_VALUE || Double.valueOf(configElement.getMaxValue().toString()) != Double.MAX_VALUE)))
|
||||
toolTip.addAll(this.mc.fontRendererObj.listFormattedStringToWidth(
|
||||
EnumChatFormatting.AQUA + I18n.format("fml.configgui.tooltip.defaultNumeric", configElement.getMinValue(), configElement.getMaxValue(), configElement.getDefault()), 300));
|
||||
Collections.addAll(toolTip, (EnumChatFormatting.AQUA + I18n.format("fml.configgui.tooltip.defaultNumeric", configElement.getMinValue(), configElement.getMaxValue(), configElement.getDefault())).split("\n"));
|
||||
else if (configElement.getType() != ConfigGuiType.CONFIG_CATEGORY)
|
||||
toolTip.addAll(this.mc.fontRendererObj.listFormattedStringToWidth(EnumChatFormatting.AQUA + I18n.format("fml.configgui.tooltip.default", configElement.getDefault()),300));
|
||||
Collections.addAll(toolTip, (EnumChatFormatting.AQUA + I18n.format("fml.configgui.tooltip.default", configElement.getDefault())).split("\n"));
|
||||
|
||||
if (configElement.requiresMcRestart() || owningScreen.allRequireMcRestart)
|
||||
toolTip.add(EnumChatFormatting.RED + "[" + I18n.format("fml.configgui.gameRestartTitle") + "]");
|
||||
|
||||
@@ -15,6 +15,7 @@ package net.minecraftforge.fml.client.config;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -66,14 +67,11 @@ public class GuiEditArray extends GuiScreen
|
||||
"\n" + EnumChatFormatting.AQUA, configElement.getDefault(), configElement.getMinValue(), configElement.getMaxValue());
|
||||
|
||||
if (!comment.equals(configElement.getLanguageKey() + ".tooltip"))
|
||||
toolTip = mc.fontRendererObj.listFormattedStringToWidth(
|
||||
EnumChatFormatting.GREEN + propName + "\n" + EnumChatFormatting.YELLOW + comment, 300);
|
||||
Collections.addAll(toolTip, (EnumChatFormatting.GREEN + propName + "\n" + EnumChatFormatting.YELLOW + comment).split("\n"));
|
||||
else if (configElement.getComment() != null && !configElement.getComment().trim().isEmpty())
|
||||
toolTip = mc.fontRendererObj.listFormattedStringToWidth(
|
||||
EnumChatFormatting.GREEN + propName + "\n" + EnumChatFormatting.YELLOW + configElement.getComment(), 300);
|
||||
Collections.addAll(toolTip, (EnumChatFormatting.GREEN + propName + "\n" + EnumChatFormatting.YELLOW + configElement.getComment()).split("\n"));
|
||||
else
|
||||
toolTip = mc.fontRendererObj.listFormattedStringToWidth(
|
||||
EnumChatFormatting.GREEN + propName + "\n" + EnumChatFormatting.RED + "No tooltip defined.", 300);
|
||||
Collections.addAll(toolTip, (EnumChatFormatting.GREEN + propName + "\n" + EnumChatFormatting.RED + "No tooltip defined.").split("\n"));
|
||||
|
||||
if (parentScreen instanceof GuiConfig)
|
||||
{
|
||||
@@ -205,6 +203,6 @@ public class GuiEditArray extends GuiScreen
|
||||
|
||||
public void drawToolTip(List<String> stringList, int x, int y)
|
||||
{
|
||||
this.drawHoveringText(stringList, x, y);
|
||||
GuiUtils.drawHoveringText(stringList, x, y, width, height, 300, fontRendererObj);
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,7 @@ package net.minecraftforge.fml.client.config;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -65,14 +66,11 @@ public class GuiSelectString extends GuiScreen
|
||||
"\n" + EnumChatFormatting.AQUA, configElement.getDefault(), configElement.getMinValue(), configElement.getMaxValue());
|
||||
|
||||
if (!comment.equals(configElement.getLanguageKey() + ".tooltip"))
|
||||
toolTip = mc.fontRendererObj.listFormattedStringToWidth(
|
||||
EnumChatFormatting.GREEN + propName + "\n" + EnumChatFormatting.YELLOW + comment, 300);
|
||||
Collections.addAll(toolTip, (EnumChatFormatting.GREEN + propName + "\n" + EnumChatFormatting.YELLOW + comment).split("\n"));
|
||||
else if (configElement.getComment() != null && !configElement.getComment().trim().isEmpty())
|
||||
toolTip = mc.fontRendererObj.listFormattedStringToWidth(
|
||||
EnumChatFormatting.GREEN + propName + "\n" + EnumChatFormatting.YELLOW + configElement.getComment(), 300);
|
||||
Collections.addAll(toolTip, (EnumChatFormatting.GREEN + propName + "\n" + EnumChatFormatting.YELLOW + configElement.getComment()).split("\n"));
|
||||
else
|
||||
toolTip = mc.fontRendererObj.listFormattedStringToWidth(
|
||||
EnumChatFormatting.GREEN + propName + "\n" + EnumChatFormatting.RED + "No tooltip defined.", 300);
|
||||
Collections.addAll(toolTip, (EnumChatFormatting.GREEN + propName + "\n" + EnumChatFormatting.RED + "No tooltip defined.").split("\n"));
|
||||
|
||||
if (parentScreen instanceof GuiConfig)
|
||||
{
|
||||
@@ -177,6 +175,6 @@ public class GuiSelectString extends GuiScreen
|
||||
|
||||
public void drawToolTip(List<String> stringList, int x, int y)
|
||||
{
|
||||
this.drawHoveringText(stringList, x, y);
|
||||
GuiUtils.drawHoveringText(stringList, x, y, width, height, 300, fontRendererObj);
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,9 @@
|
||||
package net.minecraftforge.fml.client.config;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.WorldRenderer;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
@@ -21,6 +23,9 @@ import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* This class provides several methods and constants used by the Config GUI classes.
|
||||
*
|
||||
@@ -193,4 +198,183 @@ public class GuiUtils
|
||||
tessellator.draw();
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws a tooltip box on the screen with text in it.
|
||||
* Automatically positions the box relative to the mouse to match Mojang's implementation.
|
||||
* Automatically wraps text when there is not enough space on the screen to display the text without wrapping.
|
||||
* Can have a maximum width set to avoid creating very wide tooltips.
|
||||
*
|
||||
* @param textLines the lines of text to be drawn in a hovering tooltip box.
|
||||
* @param mouseX the mouse X position
|
||||
* @param mouseY the mouse Y position
|
||||
* @param screenWidth the available screen width for the tooltip to drawn in
|
||||
* @param screenHeight the available screen height for the tooltip to drawn in
|
||||
* @param maxTextWidth the maximum width of the text in the tooltip box.
|
||||
* Set to a negative number to have no max width.
|
||||
* @param font the font for drawing the text in the tooltip box
|
||||
*/
|
||||
public static void drawHoveringText(List<String> textLines, final int mouseX, final int mouseY, final int screenWidth, final int screenHeight, final int maxTextWidth, FontRenderer font)
|
||||
{
|
||||
if (!textLines.isEmpty())
|
||||
{
|
||||
GlStateManager.disableRescaleNormal();
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GlStateManager.disableLighting();
|
||||
GlStateManager.disableDepth();
|
||||
int tooltipTextWidth = 0;
|
||||
|
||||
for (String textLine : textLines)
|
||||
{
|
||||
int textLineWidth = font.getStringWidth(textLine);
|
||||
|
||||
if (textLineWidth > tooltipTextWidth)
|
||||
{
|
||||
tooltipTextWidth = textLineWidth;
|
||||
}
|
||||
}
|
||||
|
||||
boolean needsWrap = false;
|
||||
|
||||
int titleLinesCount = 1;
|
||||
int tooltipX = mouseX + 12;
|
||||
if (tooltipX + tooltipTextWidth + 4 > screenWidth)
|
||||
{
|
||||
tooltipX = mouseX - 16 - tooltipTextWidth;
|
||||
if (tooltipX < 4) // if the tooltip doesn't fit on the screen
|
||||
{
|
||||
if (mouseX > screenWidth / 2)
|
||||
{
|
||||
tooltipTextWidth = mouseX - 12 - 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
tooltipTextWidth = screenWidth - 16 - mouseX;
|
||||
}
|
||||
needsWrap = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (maxTextWidth > 0 && tooltipTextWidth > maxTextWidth)
|
||||
{
|
||||
tooltipTextWidth = maxTextWidth;
|
||||
needsWrap = true;
|
||||
}
|
||||
|
||||
if (needsWrap)
|
||||
{
|
||||
int wrappedTooltipWidth = 0;
|
||||
List<String> wrappedTextLines = new ArrayList<String>();
|
||||
for (int i = 0; i < textLines.size(); i++)
|
||||
{
|
||||
String textLine = textLines.get(i);
|
||||
List<String> wrappedLine = font.listFormattedStringToWidth(textLine, tooltipTextWidth);
|
||||
if (i == 0)
|
||||
{
|
||||
titleLinesCount = wrappedLine.size();
|
||||
}
|
||||
|
||||
for (String line : wrappedLine)
|
||||
{
|
||||
int lineWidth = font.getStringWidth(line);
|
||||
if (lineWidth > wrappedTooltipWidth)
|
||||
{
|
||||
wrappedTooltipWidth = lineWidth;
|
||||
}
|
||||
wrappedTextLines.add(line);
|
||||
}
|
||||
}
|
||||
tooltipTextWidth = wrappedTooltipWidth;
|
||||
textLines = wrappedTextLines;
|
||||
|
||||
if (mouseX > screenWidth / 2)
|
||||
{
|
||||
tooltipX = mouseX - 16 - tooltipTextWidth;
|
||||
}
|
||||
else
|
||||
{
|
||||
tooltipX = mouseX + 12;
|
||||
}
|
||||
}
|
||||
|
||||
int tooltipY = mouseY - 12;
|
||||
int tooltipHeight = 8;
|
||||
|
||||
if (textLines.size() > 1)
|
||||
{
|
||||
tooltipHeight += (textLines.size() - 1) * 10;
|
||||
if (textLines.size() > titleLinesCount) {
|
||||
tooltipHeight += 2; // gap between title lines and next lines
|
||||
}
|
||||
}
|
||||
|
||||
if (tooltipY + tooltipHeight + 6 > screenHeight)
|
||||
{
|
||||
tooltipY = screenHeight - tooltipHeight - 6;
|
||||
}
|
||||
|
||||
final int zLevel = 300;
|
||||
final int backgroundColor = 0xF0100010;
|
||||
drawGradientRect(zLevel, tooltipX - 3, tooltipY - 4, tooltipX + tooltipTextWidth + 3, tooltipY - 3, backgroundColor, backgroundColor);
|
||||
drawGradientRect(zLevel, tooltipX - 3, tooltipY + tooltipHeight + 3, tooltipX + tooltipTextWidth + 3, tooltipY + tooltipHeight + 4, backgroundColor, backgroundColor);
|
||||
drawGradientRect(zLevel, tooltipX - 3, tooltipY - 3, tooltipX + tooltipTextWidth + 3, tooltipY + tooltipHeight + 3, backgroundColor, backgroundColor);
|
||||
drawGradientRect(zLevel, tooltipX - 4, tooltipY - 3, tooltipX - 3, tooltipY + tooltipHeight + 3, backgroundColor, backgroundColor);
|
||||
drawGradientRect(zLevel, tooltipX + tooltipTextWidth + 3, tooltipY - 3, tooltipX + tooltipTextWidth + 4, tooltipY + tooltipHeight + 3, backgroundColor, backgroundColor);
|
||||
final int borderColorStart = 0x505000FF;
|
||||
final int borderColorEnd = (borderColorStart & 0xFEFEFE) >> 1 | borderColorStart & 0xFF000000;
|
||||
drawGradientRect(zLevel, tooltipX - 3, tooltipY - 3 + 1, tooltipX - 3 + 1, tooltipY + tooltipHeight + 3 - 1, borderColorStart, borderColorEnd);
|
||||
drawGradientRect(zLevel, tooltipX + tooltipTextWidth + 2, tooltipY - 3 + 1, tooltipX + tooltipTextWidth + 3, tooltipY + tooltipHeight + 3 - 1, borderColorStart, borderColorEnd);
|
||||
drawGradientRect(zLevel, tooltipX - 3, tooltipY - 3, tooltipX + tooltipTextWidth + 3, tooltipY - 3 + 1, borderColorStart, borderColorStart);
|
||||
drawGradientRect(zLevel, tooltipX - 3, tooltipY + tooltipHeight + 2, tooltipX + tooltipTextWidth + 3, tooltipY + tooltipHeight + 3, borderColorEnd, borderColorEnd);
|
||||
|
||||
for (int lineNumber = 0; lineNumber < textLines.size(); ++lineNumber)
|
||||
{
|
||||
String line = textLines.get(lineNumber);
|
||||
font.drawStringWithShadow(line, (float)tooltipX, (float)tooltipY, -1);
|
||||
|
||||
if (lineNumber + 1 == titleLinesCount)
|
||||
{
|
||||
tooltipY += 2;
|
||||
}
|
||||
|
||||
tooltipY += 10;
|
||||
}
|
||||
|
||||
GlStateManager.enableLighting();
|
||||
GlStateManager.enableDepth();
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
}
|
||||
}
|
||||
|
||||
public static void drawGradientRect(int zLevel, int left, int top, int right, int bottom, int startColor, int endColor)
|
||||
{
|
||||
float startAlpha = (float)(startColor >> 24 & 255) / 255.0F;
|
||||
float startRed = (float)(startColor >> 16 & 255) / 255.0F;
|
||||
float startGreen = (float)(startColor >> 8 & 255) / 255.0F;
|
||||
float startBlue = (float)(startColor & 255) / 255.0F;
|
||||
float endAlpha = (float)(endColor >> 24 & 255) / 255.0F;
|
||||
float endRed = (float)(endColor >> 16 & 255) / 255.0F;
|
||||
float endGreen = (float)(endColor >> 8 & 255) / 255.0F;
|
||||
float endBlue = (float)(endColor & 255) / 255.0F;
|
||||
|
||||
GlStateManager.disableTexture2D();
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.disableAlpha();
|
||||
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
|
||||
GlStateManager.shadeModel(7425);
|
||||
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
|
||||
worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR);
|
||||
worldrenderer.pos(right, top, zLevel).color(startRed, startGreen, startBlue, startAlpha).endVertex();
|
||||
worldrenderer.pos(left, top, zLevel).color(startRed, startGreen, startBlue, startAlpha).endVertex();
|
||||
worldrenderer.pos(left, bottom, zLevel).color(endRed, endGreen, endBlue, endAlpha).endVertex();
|
||||
worldrenderer.pos(right, bottom, zLevel).color(endRed, endGreen, endBlue, endAlpha).endVertex();
|
||||
tessellator.draw();
|
||||
|
||||
GlStateManager.shadeModel(7424);
|
||||
GlStateManager.disableBlend();
|
||||
GlStateManager.enableAlpha();
|
||||
GlStateManager.enableTexture2D();
|
||||
}
|
||||
}
|
||||
@@ -51,7 +51,7 @@ public class CapabilityItemHandler
|
||||
NBTTagCompound itemTags = tagList.getCompoundTagAt(i);
|
||||
int j = itemTags.getInteger("Slot");
|
||||
|
||||
if (j > 0 && j < instance.getSlots())
|
||||
if (j >= 0 && j < instance.getSlots())
|
||||
{
|
||||
itemHandlerModifiable.setStackInSlot(j, ItemStack.loadItemStackFromNBT(itemTags));
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.block.BlockPrismarine;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
@@ -55,6 +56,7 @@ public class OreDictionary
|
||||
{
|
||||
if (!hasInit)
|
||||
{
|
||||
// tree- and wood-related things
|
||||
registerOre("logWood", new ItemStack(Blocks.log, 1, WILDCARD_VALUE));
|
||||
registerOre("logWood", new ItemStack(Blocks.log2, 1, WILDCARD_VALUE));
|
||||
registerOre("plankWood", new ItemStack(Blocks.planks, 1, WILDCARD_VALUE));
|
||||
@@ -69,6 +71,9 @@ public class OreDictionary
|
||||
registerOre("treeSapling", new ItemStack(Blocks.sapling, 1, WILDCARD_VALUE));
|
||||
registerOre("treeLeaves", new ItemStack(Blocks.leaves, 1, WILDCARD_VALUE));
|
||||
registerOre("treeLeaves", new ItemStack(Blocks.leaves2, 1, WILDCARD_VALUE));
|
||||
registerOre("vine", Blocks.vine);
|
||||
|
||||
// Ores
|
||||
registerOre("oreGold", Blocks.gold_ore);
|
||||
registerOre("oreIron", Blocks.iron_ore);
|
||||
registerOre("oreLapis", Blocks.lapis_ore);
|
||||
@@ -77,6 +82,25 @@ public class OreDictionary
|
||||
registerOre("oreEmerald", Blocks.emerald_ore);
|
||||
registerOre("oreQuartz", Blocks.quartz_ore);
|
||||
registerOre("oreCoal", Blocks.coal_ore);
|
||||
|
||||
// ingots/nuggets
|
||||
registerOre("ingotIron", Items.iron_ingot);
|
||||
registerOre("ingotGold", Items.gold_ingot);
|
||||
registerOre("ingotBrick", Items.brick);
|
||||
registerOre("ingotBrickNether", Items.netherbrick);
|
||||
registerOre("nuggetGold", Items.gold_nugget);
|
||||
|
||||
// gems and dusts
|
||||
registerOre("gemDiamond", Items.diamond);
|
||||
registerOre("gemEmerald", Items.emerald);
|
||||
registerOre("gemQuartz", Items.quartz);
|
||||
registerOre("gemPrismarine", Items.prismarine_shard);
|
||||
registerOre("dustPrismarine", Items.prismarine_crystals);
|
||||
registerOre("dustRedstone", Items.redstone);
|
||||
registerOre("dustGlowstone", Items.glowstone_dust);
|
||||
registerOre("gemLapis", new ItemStack(Items.dye, 1, 4));
|
||||
|
||||
// storage blocks
|
||||
registerOre("blockGold", Blocks.gold_block);
|
||||
registerOre("blockIron", Blocks.iron_block);
|
||||
registerOre("blockLapis", Blocks.lapis_block);
|
||||
@@ -85,35 +109,31 @@ public class OreDictionary
|
||||
registerOre("blockEmerald", Blocks.emerald_block);
|
||||
registerOre("blockQuartz", Blocks.quartz_block);
|
||||
registerOre("blockCoal", Blocks.coal_block);
|
||||
registerOre("blockGlassColorless", Blocks.glass);
|
||||
registerOre("blockGlass", Blocks.glass);
|
||||
registerOre("blockGlass", new ItemStack(Blocks.stained_glass, 1, WILDCARD_VALUE));
|
||||
//blockGlass{Color} is added below with dyes
|
||||
registerOre("paneGlassColorless", Blocks.glass_pane);
|
||||
registerOre("paneGlass", Blocks.glass_pane);
|
||||
registerOre("paneGlass", new ItemStack(Blocks.stained_glass_pane, 1, WILDCARD_VALUE));
|
||||
//paneGlass{Color} is added below with dyes
|
||||
registerOre("ingotIron", Items.iron_ingot);
|
||||
registerOre("ingotGold", Items.gold_ingot);
|
||||
registerOre("ingotBrick", Items.brick);
|
||||
registerOre("ingotBrickNether", Items.netherbrick);
|
||||
registerOre("nuggetGold", Items.gold_nugget);
|
||||
registerOre("gemDiamond", Items.diamond);
|
||||
registerOre("gemEmerald", Items.emerald);
|
||||
registerOre("gemQuartz", Items.quartz);
|
||||
registerOre("dustRedstone", Items.redstone);
|
||||
registerOre("dustGlowstone", Items.glowstone_dust);
|
||||
registerOre("gemLapis", new ItemStack(Items.dye, 1, 4));
|
||||
registerOre("slimeball", Items.slime_ball);
|
||||
registerOre("glowstone", Blocks.glowstone);
|
||||
|
||||
// crops
|
||||
registerOre("cropWheat", Items.wheat);
|
||||
registerOre("cropPotato", Items.potato);
|
||||
registerOre("cropCarrot", Items.carrot);
|
||||
registerOre("stone", Blocks.stone);
|
||||
registerOre("cobblestone", Blocks.cobblestone);
|
||||
registerOre("sandstone", new ItemStack(Blocks.sandstone, 1, WILDCARD_VALUE));
|
||||
registerOre("sand", new ItemStack(Blocks.sand, 1, WILDCARD_VALUE));
|
||||
registerOre("cropNetherWart", Items.nether_wart);
|
||||
registerOre("sugarcane", Items.reeds);
|
||||
registerOre("blockCactus", Blocks.cactus);
|
||||
|
||||
// misc materials
|
||||
registerOre("dye", new ItemStack(Items.dye, 1, WILDCARD_VALUE));
|
||||
registerOre("paper", new ItemStack(Items.paper));
|
||||
|
||||
// mob drops
|
||||
registerOre("slimeball", Items.slime_ball);
|
||||
registerOre("enderpearl", Items.ender_pearl);
|
||||
registerOre("bone", Items.bone);
|
||||
registerOre("gunpowder", Items.gunpowder);
|
||||
registerOre("string", Items.string);
|
||||
registerOre("netherStar", Items.nether_star);
|
||||
registerOre("leather", Items.leather);
|
||||
registerOre("feather", Items.feather);
|
||||
registerOre("egg", Items.egg);
|
||||
|
||||
// records
|
||||
registerOre("record", Items.record_13);
|
||||
registerOre("record", Items.record_cat);
|
||||
registerOre("record", Items.record_blocks);
|
||||
@@ -126,6 +146,42 @@ public class OreDictionary
|
||||
registerOre("record", Items.record_ward);
|
||||
registerOre("record", Items.record_11);
|
||||
registerOre("record", Items.record_wait);
|
||||
|
||||
// blocks
|
||||
registerOre("dirt", Blocks.dirt);
|
||||
registerOre("grass", Blocks.grass);
|
||||
registerOre("stone", Blocks.stone);
|
||||
registerOre("cobblestone", Blocks.cobblestone);
|
||||
registerOre("gravel", Blocks.gravel);
|
||||
registerOre("sand", new ItemStack(Blocks.sand, 1, WILDCARD_VALUE));
|
||||
registerOre("sandstone", new ItemStack(Blocks.sandstone, 1, WILDCARD_VALUE));
|
||||
registerOre("sandstone", new ItemStack(Blocks.red_sandstone, 1, WILDCARD_VALUE));
|
||||
registerOre("netherrack", Blocks.netherrack);
|
||||
registerOre("obsidian", Blocks.obsidian);
|
||||
registerOre("glowstone", Blocks.glowstone);
|
||||
registerOre("endstone", Blocks.end_stone);
|
||||
registerOre("torch", Blocks.torch);
|
||||
registerOre("workbench", Blocks.crafting_table);
|
||||
registerOre("blockSlime", Blocks.slime_block);
|
||||
registerOre("blockPrismarine", new ItemStack(Blocks.prismarine, 1, BlockPrismarine.EnumType.ROUGH.getMetadata()));
|
||||
registerOre("blockPrismarineBrick", new ItemStack(Blocks.prismarine, 1, BlockPrismarine.EnumType.BRICKS.getMetadata()));
|
||||
registerOre("blockPrismarineDark", new ItemStack(Blocks.prismarine, 1, BlockPrismarine.EnumType.DARK.getMetadata()));
|
||||
registerOre("stoneGranite", new ItemStack(Blocks.stone, 1, 1));
|
||||
registerOre("stoneGranitePolished", new ItemStack(Blocks.stone, 1, 2));
|
||||
registerOre("stoneDiorite", new ItemStack(Blocks.stone, 1, 3));
|
||||
registerOre("stoneDioritePolished", new ItemStack(Blocks.stone, 1, 4));
|
||||
registerOre("stoneAndesite", new ItemStack(Blocks.stone, 1, 5));
|
||||
registerOre("stoneAndesitePolished", new ItemStack(Blocks.stone, 1, 6));
|
||||
registerOre("blockGlassColorless", Blocks.glass);
|
||||
registerOre("blockGlass", Blocks.glass);
|
||||
registerOre("blockGlass", new ItemStack(Blocks.stained_glass, 1, WILDCARD_VALUE));
|
||||
//blockGlass{Color} is added below with dyes
|
||||
registerOre("paneGlassColorless", Blocks.glass_pane);
|
||||
registerOre("paneGlass", Blocks.glass_pane);
|
||||
registerOre("paneGlass", new ItemStack(Blocks.stained_glass_pane, 1, WILDCARD_VALUE));
|
||||
//paneGlass{Color} is added below with dyes
|
||||
|
||||
// chests
|
||||
registerOre("chest", Blocks.chest);
|
||||
registerOre("chest", Blocks.ender_chest);
|
||||
registerOre("chest", Blocks.trapped_chest);
|
||||
@@ -136,23 +192,58 @@ public class OreDictionary
|
||||
|
||||
// Build our list of items to replace with ore tags
|
||||
Map<ItemStack, String> replacements = new HashMap<ItemStack, String>();
|
||||
|
||||
// wood-related things
|
||||
replacements.put(new ItemStack(Items.stick), "stickWood");
|
||||
replacements.put(new ItemStack(Blocks.planks), "plankWood");
|
||||
replacements.put(new ItemStack(Blocks.planks, 1, WILDCARD_VALUE), "plankWood");
|
||||
replacements.put(new ItemStack(Blocks.wooden_slab, 1, WILDCARD_VALUE), "slabWood");
|
||||
replacements.put(new ItemStack(Blocks.stone), "stone");
|
||||
//replacements.put(new ItemStack(Blocks.stone, 1, WILDCARD_VALUE), "stone");
|
||||
replacements.put(new ItemStack(Blocks.cobblestone), "cobblestone");
|
||||
replacements.put(new ItemStack(Blocks.cobblestone, 1, WILDCARD_VALUE), "cobblestone");
|
||||
|
||||
// ingots/nuggets
|
||||
replacements.put(new ItemStack(Items.gold_ingot), "ingotGold");
|
||||
replacements.put(new ItemStack(Items.iron_ingot), "ingotIron");
|
||||
|
||||
// gems and dusts
|
||||
replacements.put(new ItemStack(Items.diamond), "gemDiamond");
|
||||
replacements.put(new ItemStack(Items.emerald), "gemEmerald");
|
||||
replacements.put(new ItemStack(Items.prismarine_shard), "gemPrismarine");
|
||||
replacements.put(new ItemStack(Items.prismarine_crystals), "dustPrismarine");
|
||||
replacements.put(new ItemStack(Items.redstone), "dustRedstone");
|
||||
replacements.put(new ItemStack(Items.glowstone_dust), "dustGlowstone");
|
||||
replacements.put(new ItemStack(Blocks.glowstone), "glowstone");
|
||||
|
||||
// crops
|
||||
replacements.put(new ItemStack(Items.reeds), "sugarcane");
|
||||
replacements.put(new ItemStack(Blocks.cactus), "blockCactus");
|
||||
|
||||
// misc materials
|
||||
replacements.put(new ItemStack(Items.paper), "paper");
|
||||
|
||||
// mob drops
|
||||
replacements.put(new ItemStack(Items.slime_ball), "slimeball");
|
||||
replacements.put(new ItemStack(Items.string), "string");
|
||||
replacements.put(new ItemStack(Items.leather), "leather");
|
||||
replacements.put(new ItemStack(Items.ender_pearl), "enderpearl");
|
||||
replacements.put(new ItemStack(Items.gunpowder), "gunpowder");
|
||||
replacements.put(new ItemStack(Items.nether_star), "netherStar");
|
||||
replacements.put(new ItemStack(Items.feather), "feather");
|
||||
replacements.put(new ItemStack(Items.bone), "bone");
|
||||
replacements.put(new ItemStack(Items.egg), "egg");
|
||||
|
||||
// blocks
|
||||
replacements.put(new ItemStack(Blocks.stone), "stone");
|
||||
replacements.put(new ItemStack(Blocks.cobblestone), "cobblestone");
|
||||
replacements.put(new ItemStack(Blocks.cobblestone, 1, WILDCARD_VALUE), "cobblestone");
|
||||
replacements.put(new ItemStack(Blocks.glowstone), "glowstone");
|
||||
replacements.put(new ItemStack(Blocks.glass), "blockGlassColorless");
|
||||
replacements.put(new ItemStack(Blocks.prismarine), "prismarine");
|
||||
replacements.put(new ItemStack(Blocks.stone, 1, 1), "stoneGranite");
|
||||
replacements.put(new ItemStack(Blocks.stone, 1, 2), "stoneGranitePolished");
|
||||
replacements.put(new ItemStack(Blocks.stone, 1, 3), "stoneDiorite");
|
||||
replacements.put(new ItemStack(Blocks.stone, 1, 4), "stoneDioritePolished");
|
||||
replacements.put(new ItemStack(Blocks.stone, 1, 5), "stoneAndesite");
|
||||
replacements.put(new ItemStack(Blocks.stone, 1, 6), "stoneAndesitePolished");
|
||||
|
||||
// chests
|
||||
replacements.put(new ItemStack(Blocks.chest), "chestWood");
|
||||
replacements.put(new ItemStack(Blocks.ender_chest), "chestEnder");
|
||||
replacements.put(new ItemStack(Blocks.trapped_chest), "chestTrapped");
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<Console name="SysOut" target="SYSTEM_OUT">
|
||||
<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level]: %msg%n" />
|
||||
</Console>
|
||||
<Queue name="ServerGuiConsole">
|
||||
<Queue name="ServerGuiConsole" ignoreExceptions="true">
|
||||
<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level] [%logger]: %msg%n" />
|
||||
</Queue>
|
||||
<RollingRandomAccessFile name="File" fileName="logs/latest.log" filePattern="logs/%d{yyyy-MM-dd}-%i.log.gz">
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</TerminalConsole>
|
||||
<!-- Keep a console appender open so log4j2 doesn't close our main out stream if we redirect System.out to the logger -->
|
||||
<Console name="SysOut" target="SYSTEM_OUT"/>
|
||||
<Queue name="ServerGuiConsole">
|
||||
<Queue name="ServerGuiConsole" ignoreExceptions="true">
|
||||
<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level] [%logger]: %replace{%msg}{(?i)\u00A7[0-9A-FK-OR]}{}%n" />
|
||||
</Queue>
|
||||
<RollingRandomAccessFile name="File" fileName="logs/latest.log" filePattern="logs/%d{yyyy-MM-dd}-%i.log.gz">
|
||||
|
||||
Reference in new issue
Block a user