mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-22 13:09:53 +00:00
cleanup after enabling modern & generic. Primarily changing raw lists to their correct type, changing to pattern variable & enhanced switch and removing unused/unreachable code + ancient comments.
This commit is contained in:
1 parent
e7dc1d9bd4
commit
a5bec6c22b
52 files changed
+273
-489
No files matched your search
@@ -67,7 +67,7 @@ public class GravelOre extends BlockSand {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item id, CreativeTabs tab, List list) {
|
||||
public void getSubBlocks(Item id, CreativeTabs tab, List<ItemStack> list) {
|
||||
for (int iter = 0; iter < 6; iter++) {
|
||||
list.add(new ItemStack(id, 1, iter));
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class SlimeExplosive extends TConstructBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item b, CreativeTabs tab, List list) {
|
||||
public void getSubBlocks(Item b, CreativeTabs tab, List<ItemStack> list) {
|
||||
for (int iter = 0; iter < 2; iter++) {
|
||||
list.add(new ItemStack(b, 1, iter * 2));
|
||||
}
|
||||
@@ -121,8 +121,7 @@ public class SlimeExplosive extends TConstructBlock {
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) {
|
||||
if (par5Entity instanceof EntityArrow && !par1World.isRemote) {
|
||||
EntityArrow entityarrow = (EntityArrow) par5Entity;
|
||||
if (par5Entity instanceof EntityArrow entityarrow && !par1World.isRemote) {
|
||||
|
||||
if (entityarrow.isBurning()) {
|
||||
this.primeTnt(
|
||||
|
||||
@@ -34,20 +34,16 @@ public class SoilSlab extends SlabBase {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
switch (meta % 8) {
|
||||
case 0:
|
||||
return this.blockIcon; // Block.grass.getIcon(1, 0);
|
||||
case 1:
|
||||
return Blocks.dirt.getIcon(side, 0);
|
||||
case 2:
|
||||
return Blocks.mycelium.getIcon(1, 0);
|
||||
default:
|
||||
return TinkerTools.craftedSoil.getIcon(side, meta - 3);
|
||||
}
|
||||
return switch (meta % 8) {
|
||||
case 0 -> this.blockIcon; // Block.grass.getIcon(1, 0);
|
||||
case 1 -> Blocks.dirt.getIcon(side, 0);
|
||||
case 2 -> Blocks.mycelium.getIcon(1, 0);
|
||||
default -> TinkerTools.craftedSoil.getIcon(side, meta - 3);
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item b, CreativeTabs tab, List list) {
|
||||
public void getSubBlocks(Item b, CreativeTabs tab, List<ItemStack> list) {
|
||||
for (int iter = 0; iter < 8; iter++) {
|
||||
list.add(new ItemStack(b, 1, iter));
|
||||
}
|
||||
|
||||
@@ -134,10 +134,10 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
|
||||
|
||||
@Override
|
||||
protected void entityInit() {
|
||||
this.dataWatcher.addObject(16, new Byte((byte) 0));
|
||||
this.dataWatcher.addObject(17, new Integer(0));
|
||||
this.dataWatcher.addObject(18, new Integer(1));
|
||||
this.dataWatcher.addObject(19, new Integer(0));
|
||||
this.dataWatcher.addObject(16, (byte) 0);
|
||||
this.dataWatcher.addObject(17, 0);
|
||||
this.dataWatcher.addObject(18, 1);
|
||||
this.dataWatcher.addObject(19, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -809,12 +809,8 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
|
||||
if (player.isSneaking()) {
|
||||
if (entityFollowing == null) {
|
||||
entityFollowing = player;
|
||||
// if (!worldObj.isRemote)
|
||||
// player.addChatMessage("The cart is following you");
|
||||
} else {
|
||||
entityFollowing = null;
|
||||
// if (!worldObj.isRemote)
|
||||
// player.addChatMessage("The cart has stopped following you");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -898,9 +894,9 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
|
||||
*/
|
||||
protected void setMinecartPowered(boolean par1) {
|
||||
if (par1) {
|
||||
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (this.dataWatcher.getWatchableObjectByte(16) | 1)));
|
||||
this.dataWatcher.updateObject(16, (byte) (this.dataWatcher.getWatchableObjectByte(16) | 1));
|
||||
} else {
|
||||
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (this.dataWatcher.getWatchableObjectByte(16) & -2)));
|
||||
this.dataWatcher.updateObject(16, (byte) (this.dataWatcher.getWatchableObjectByte(16) & -2));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -913,7 +909,7 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
|
||||
* 40.
|
||||
*/
|
||||
public void setDamage(int par1) {
|
||||
this.dataWatcher.updateObject(19, Integer.valueOf(par1));
|
||||
this.dataWatcher.updateObject(19, par1);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -925,7 +921,7 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
|
||||
}
|
||||
|
||||
public void setRollingAmplitude(int par1) {
|
||||
this.dataWatcher.updateObject(17, Integer.valueOf(par1));
|
||||
this.dataWatcher.updateObject(17, par1);
|
||||
}
|
||||
|
||||
public int getRollingAmplitude() {
|
||||
@@ -933,7 +929,7 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
|
||||
}
|
||||
|
||||
public void setRollingDirection(int par1) {
|
||||
this.dataWatcher.updateObject(18, Integer.valueOf(par1));
|
||||
this.dataWatcher.updateObject(18, par1);
|
||||
}
|
||||
|
||||
public int getRollingDirection() {
|
||||
|
||||
Reference in new issue
Block a user