quick fix : Duplicate branches in 'switch'

This commit is contained in:
Alexdoru committed 2023-01-25 23:36:51 +01:00
1 parent efd18b873e
commit 106f238698
12 files changed
+20 -58

No files matched your search

@@ -66,7 +66,6 @@ public class TravelGear extends ArmorCore implements IRevealer, IGoggles {
case Chest:
return 4;
case Legs:
return 2;
case Feet:
return 2;
}
@@ -23,13 +23,9 @@ public class RenderArmorCast implements IItemRenderer {
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
switch (helper) {
case BLOCK_3D:
return true;
case ENTITY_BOBBING:
return true;
case ENTITY_ROTATION:
return true;
case EQUIPPED_BLOCK:
return true;
case INVENTORY_BLOCK:
return true;
default:
@@ -55,8 +51,6 @@ public class RenderArmorCast implements IItemRenderer {
GL11.glTranslatef(0F, -0.1F, 0F);
break;
case EQUIPPED:
GL11.glScalef(1F, 0.6F, 1F);
break;
case EQUIPPED_FIRST_PERSON:
GL11.glScalef(1F, 0.6F, 1F);
break;
@@ -33,13 +33,12 @@ public class ToolCoreRenderer implements IItemRenderer {
switch (type) {
case ENTITY:
case INVENTORY:
return true;
case EQUIPPED:
GL11.glTranslatef(0.03f, 0F, -0.09375F);
case EQUIPPED_FIRST_PERSON:
return !isEntity;
case INVENTORY:
return true;
default:
TConstruct.logger.warn("[TCon] Unhandled render case!");
case FIRST_PERSON_MAP:
@@ -169,10 +169,9 @@ public class Shortbow extends BowBase {
public String getBowstringName(int type) {
switch (type) {
case 0:
return "";
case 1:
return "\u00A7bEnchanted";
case 0:
default:
return "";
}
@@ -14,8 +14,10 @@ public class Helper {
public static ForgeDirection convertMetaToForgeOrientation(int metadata) {
switch (metadata) {
case 6:
case 5:
return ForgeDirection.DOWN;
case 7:
case 0:
return ForgeDirection.UP;
case 1:
return ForgeDirection.WEST;
@@ -25,10 +27,6 @@ public class Helper {
return ForgeDirection.EAST;
case 4:
return ForgeDirection.SOUTH;
case 5:
return ForgeDirection.DOWN;
case 0:
return ForgeDirection.UP;
}
return ForgeDirection.UNKNOWN;
@@ -134,8 +134,6 @@ public abstract class Behavior {
ForgeDirection dir = Helper.convertMetaToForgeOrientation(par1World.getBlockMetadata(par2, par3, par4));
switch (dir) {
case DOWN:
return EnumFacing.UP;
case UP:
return EnumFacing.DOWN;
case WEST:
@@ -146,6 +144,7 @@ public abstract class Behavior {
return EnumFacing.NORTH;
case NORTH:
return EnumFacing.SOUTH;
case DOWN:
default:
return EnumFacing.UP;
}
@@ -36,8 +36,6 @@ public abstract class SpecialStackHandler {
ForgeDirection dir = Helper.convertMetaToForgeOrientation(par1World.getBlockMetadata(par2, par3, par4));
switch (dir) {
case DOWN:
return EnumFacing.UP;
case UP:
return EnumFacing.DOWN;
case WEST:
@@ -48,6 +46,7 @@ public abstract class SpecialStackHandler {
return EnumFacing.NORTH;
case NORTH:
return EnumFacing.SOUTH;
case DOWN:
default:
return EnumFacing.UP;
}
@@ -36,6 +36,7 @@ public class MultiBrick extends TConstructBlock {
int meta = world.getBlockMetadata(x, y, z);
switch (meta) {
case 0:
case 13:
return Blocks.obsidian.getBlockHardness(world, x, y, z);
case 1:
return Blocks.sandstone.getBlockHardness(world, x, y, z);
@@ -56,13 +57,10 @@ public class MultiBrick extends TConstructBlock {
case 9:
return 1.0F;
case 10:
return 1.5F;
case 11:
return 1.5F;
case 12:
return Blocks.end_stone.getBlockHardness(world, x, y, z);
case 13:
return Blocks.obsidian.getBlockHardness(world, x, y, z);
default:
return blockHardness;
}
@@ -74,6 +72,7 @@ public class MultiBrick extends TConstructBlock {
int meta = world.getBlockMetadata(x, y, z);
switch (meta) {
case 0:
case 13:
return Blocks.obsidian.getExplosionResistance(
entity, world, meta, meta, meta, explosionZ, explosionZ, explosionZ);
case 1:
@@ -103,15 +102,11 @@ public class MultiBrick extends TConstructBlock {
case 9:
return 1.0F;
case 10:
return 1.5F;
case 11:
return 1.5F;
case 12:
return Blocks.end_stone.getExplosionResistance(
entity, world, meta, meta, meta, explosionZ, explosionZ, explosionZ);
case 13:
return Blocks.obsidian.getExplosionResistance(
entity, world, meta, meta, meta, explosionZ, explosionZ, explosionZ);
default:
return getExplosionResistance(entity, world, meta, meta, meta, explosionZ, explosionZ, explosionZ);
}
@@ -39,6 +39,7 @@ public class MultiBrickFancy extends TConstructBlock {
int meta = world.getBlockMetadata(x, y, z);
switch (meta) {
case 0:
case 13:
return Blocks.obsidian.getBlockHardness(world, x, y, z);
case 1:
return Blocks.sandstone.getBlockHardness(world, x, y, z);
@@ -57,13 +58,10 @@ public class MultiBrickFancy extends TConstructBlock {
case 9:
return 1.0F;
case 10:
return 1.5F;
case 11:
return 1.5F;
case 12:
return Blocks.end_stone.getBlockHardness(world, x, y, z);
case 13:
return Blocks.obsidian.getBlockHardness(world, x, y, z);
case 3:
case 14:
case 15:
@@ -79,6 +77,7 @@ public class MultiBrickFancy extends TConstructBlock {
int meta = world.getBlockMetadata(x, y, z);
switch (meta) {
case 0:
case 13:
return Blocks.obsidian.getExplosionResistance(
entity, world, meta, meta, meta, explosionZ, explosionZ, explosionZ);
case 1:
@@ -105,15 +104,11 @@ public class MultiBrickFancy extends TConstructBlock {
case 9:
return 1.0F;
case 10:
return 1.5F;
case 11:
return 1.5F;
case 12:
return Blocks.end_stone.getExplosionResistance(
entity, world, meta, meta, meta, explosionZ, explosionZ, explosionZ);
case 13:
return Blocks.obsidian.getExplosionResistance(
entity, world, meta, meta, meta, explosionZ, explosionZ, explosionZ);
case 3:
case 14:
case 15:
@@ -139,30 +139,20 @@ public class ToolStationBlock extends InventoryBlock {
case 0:
return new ToolStationLogic();
case 1:
return new PartBuilderLogic();
case 2:
return new PartBuilderLogic();
case 3:
return new PartBuilderLogic();
case 2:
case 4:
return new PartBuilderLogic();
case 5:
return new PatternChestLogic();
case 9:
case 8:
case 7:
case 6:
return new PatternChestLogic();
case 7:
return new PatternChestLogic();
case 8:
return new PatternChestLogic();
case 9:
return new PatternChestLogic();
case 10:
return new StencilTableLogic();
case 11:
return new StencilTableLogic();
case 12:
return new StencilTableLogic();
case 13:
case 12:
case 11:
return new StencilTableLogic();
/*case 14:
return new CastingTableLogic();*/
@@ -119,14 +119,12 @@ public class BattlesignGui extends GuiScreen {
break;
case 28:
case 208:
moveLine(1);
break;
case 200:
moveLine(-1);
break;
case 208:
moveLine(1);
break;
}
}
}
@@ -53,15 +53,12 @@ public class Shuriken extends AmmoWeapon {
public String getIconSuffix(int partType) {
switch (partType) {
case 0:
case 2:
case 3:
case 4:
return "_shuriken";
case 1:
return ""; // no broken, since it runs out of ammo
case 2:
return "_shuriken";
case 3:
return "_shuriken";
case 4:
return "_shuriken";
default:
return "";
}