mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 11:29:15 +00:00
Small renames before bed.
This commit is contained in:
1 parent
636a89c195
commit
7fadb5aeb8
10 files changed
+59
-345
No files matched your search
@@ -1,289 +0,0 @@
|
||||
++++ REJECTED PATCH 10
|
||||
this.posX = d19 + d1 * d18;
|
||||
this.posZ = d20 + d2 * d18;
|
||||
this.setPosition(this.posX, this.posY, this.posZ);
|
||||
- double d22 = this.motionX;
|
||||
- double d23 = this.motionZ;
|
||||
+ this.moveMinecartOnRail(p_180460_1_);
|
||||
|
||||
- if (this.riddenByEntity != null)
|
||||
- {
|
||||
- d22 *= 0.75D;
|
||||
- d23 *= 0.75D;
|
||||
- }
|
||||
-
|
||||
- double d13 = this.getMaximumSpeed();
|
||||
- d22 = MathHelper.clamp_double(d22, -d13, d13);
|
||||
- d23 = MathHelper.clamp_double(d23, -d13, d13);
|
||||
- this.moveEntity(d22, 0.0D, d23);
|
||||
-
|
||||
if (aint[0][1] != 0 && MathHelper.floor_double(this.posX) - p_180460_1_.getX() == aint[0][0] && MathHelper.floor_double(this.posZ) - p_180460_1_.getZ() == aint[0][2])
|
||||
{
|
||||
this.setPosition(this.posX, this.posY + (double)aint[0][1], this.posZ);
|
||||
++++ END PATCH
|
||||
++++ REJECTED PATCH 12
|
||||
|
||||
public void applyEntityCollision(Entity entityIn)
|
||||
{
|
||||
+
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartCollisionEvent(this, entityIn));
|
||||
+ if (getCollisionHandler() != null)
|
||||
+ {
|
||||
+ getCollisionHandler().onEntityCollision(this, entityIn);
|
||||
+ return;
|
||||
+ }
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
if (!entityIn.noClip && !this.noClip)
|
||||
{
|
||||
if (entityIn != this.riddenByEntity)
|
||||
{
|
||||
- if (entityIn instanceof EntityLivingBase && !(entityIn instanceof EntityPlayer) && !(entityIn instanceof EntityIronGolem) && this.getMinecartType() == EntityMinecart.EnumMinecartType.RIDEABLE && this.motionX * this.motionX + this.motionZ * this.motionZ > 0.01D && this.riddenByEntity == null && entityIn.ridingEntity == null)
|
||||
+ if (entityIn instanceof EntityLivingBase && !(entityIn instanceof EntityPlayer) && !(entityIn instanceof EntityIronGolem) && canBeRidden() && this.motionX * this.motionX + this.motionZ * this.motionZ > 0.01D && this.riddenByEntity == null && entityIn.ridingEntity == null)
|
||||
{
|
||||
entityIn.mountEntity(this);
|
||||
}
|
||||
++++ END PATCH
|
||||
++++ REJECTED PATCH 13
|
||||
double d7 = entityIn.motionX + this.motionX;
|
||||
double d8 = entityIn.motionZ + this.motionZ;
|
||||
|
||||
- if (((EntityMinecart)entityIn).getMinecartType() == EntityMinecart.EnumMinecartType.FURNACE && this.getMinecartType() != EntityMinecart.EnumMinecartType.FURNACE)
|
||||
+ if (((EntityMinecart)entityIn).isPoweredCart() && !isPoweredCart())
|
||||
{
|
||||
this.motionX *= 0.20000000298023224D;
|
||||
this.motionZ *= 0.20000000298023224D;
|
||||
++++ END PATCH
|
||||
++++ REJECTED PATCH 14
|
||||
entityIn.motionX *= 0.949999988079071D;
|
||||
entityIn.motionZ *= 0.949999988079071D;
|
||||
}
|
||||
- else if (((EntityMinecart)entityIn).getMinecartType() != EntityMinecart.EnumMinecartType.FURNACE && this.getMinecartType() == EntityMinecart.EnumMinecartType.FURNACE)
|
||||
+ else if (((EntityMinecart)entityIn).isPoweredCart() && isPoweredCart())
|
||||
{
|
||||
entityIn.motionX *= 0.20000000298023224D;
|
||||
entityIn.motionZ *= 0.20000000298023224D;
|
||||
++++ END PATCH
|
||||
++++ REJECTED PATCH 15
|
||||
}
|
||||
}
|
||||
|
||||
+ /* =================================== FORGE START ===========================================*/
|
||||
+ private BlockPos getCurrentRailPosition()
|
||||
+ {
|
||||
+ int x = MathHelper.floor_double(this.posX);
|
||||
+ int y = MathHelper.floor_double(this.posY);
|
||||
+ int z = MathHelper.floor_double(this.posZ);
|
||||
+
|
||||
+ if (BlockRailBase.isRailBlock(this.worldObj, new BlockPos(x, y - 1, z))) y--;
|
||||
+ return new BlockPos(x, y, z);
|
||||
+ }
|
||||
+
|
||||
+ protected double getMaxSpeed()
|
||||
+ {
|
||||
+ if (!canUseRail()) return getMaximumSpeed();
|
||||
+ BlockPos pos = this.getCurrentRailPosition();
|
||||
+ IBlockState state = this.worldObj.getBlockState(pos);
|
||||
+ if (!BlockRailBase.isRailBlock(state)) return getMaximumSpeed();
|
||||
+
|
||||
+ float railMaxSpeed = ((BlockRailBase)state.getBlock()).getRailMaxSpeed(worldObj, this, pos);
|
||||
+ return Math.min(railMaxSpeed, getCurrentCartSpeedCapOnRail());
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Moved to allow overrides.
|
||||
+ * This code handles minecart movement and speed capping when on a rail.
|
||||
+ */
|
||||
+ public void moveMinecartOnRail(BlockPos pos)
|
||||
+ {
|
||||
+ double mX = this.motionX;
|
||||
+ double mZ = this.motionZ;
|
||||
+
|
||||
+ if (this.riddenByEntity != null)
|
||||
+ {
|
||||
+ mX *= 0.75D;
|
||||
+ mZ *= 0.75D;
|
||||
+ }
|
||||
+
|
||||
+ double max = this.getMaxSpeed();
|
||||
+ mX = MathHelper.clamp_double(mX, -max, max);
|
||||
+ mZ = MathHelper.clamp_double(mZ, -max, max);
|
||||
+ this.moveEntity(mX, 0.0D, mZ);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the current global Minecart Collision handler if none
|
||||
+ * is registered, returns null
|
||||
+ * @return The collision handler or null
|
||||
+ */
|
||||
+ public static net.minecraftforge.common.IMinecartCollisionHandler getCollisionHandler()
|
||||
+ {
|
||||
+ return collisionHandler;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the global Minecart Collision handler, overwrites any
|
||||
+ * that is currently set.
|
||||
+ * @param handler The new handler
|
||||
+ */
|
||||
+ public static void setCollisionHandler(net.minecraftforge.common.IMinecartCollisionHandler handler)
|
||||
+ {
|
||||
+ collisionHandler = handler;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * This function returns an ItemStack that represents this cart.
|
||||
+ * This should be an ItemStack that can be used by the player to place the cart,
|
||||
+ * but is not necessary the item the cart drops when destroyed.
|
||||
+ * @return An ItemStack that can be used to place the cart.
|
||||
+ */
|
||||
+ public ItemStack getCartItem()
|
||||
+ {
|
||||
+ if (this instanceof EntityMinecartFurnace)
|
||||
+ {
|
||||
+ return new ItemStack(Items.furnace_minecart);
|
||||
+ }
|
||||
+ else if (this instanceof EntityMinecartChest)
|
||||
+ {
|
||||
+ return new ItemStack(Items.chest_minecart);
|
||||
+ }
|
||||
+ else if (this instanceof EntityMinecartTNT)
|
||||
+ {
|
||||
+ return new ItemStack(Items.tnt_minecart);
|
||||
+ }
|
||||
+ else if (this instanceof EntityMinecartHopper)
|
||||
+ {
|
||||
+ return new ItemStack(Items.hopper_minecart);
|
||||
+ }
|
||||
+ else if (this instanceof EntityMinecartCommandBlock)
|
||||
+ {
|
||||
+ return new ItemStack(Items.command_block_minecart);
|
||||
+ }
|
||||
+ return new ItemStack(Items.minecart);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns true if this cart can currently use rails.
|
||||
+ * This function is mainly used to gracefully detach a minecart from a rail.
|
||||
+ * @return True if the minecart can use rails.
|
||||
+ */
|
||||
+ public boolean canUseRail()
|
||||
+ {
|
||||
+ return canUseRail;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Set whether the minecart can use rails.
|
||||
+ * This function is mainly used to gracefully detach a minecart from a rail.
|
||||
+ * @param use Whether the minecart can currently use rails.
|
||||
+ */
|
||||
+ public void setCanUseRail(boolean use)
|
||||
+ {
|
||||
+ canUseRail = use;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Return false if this cart should not call onMinecartPass() and should ignore Powered Rails.
|
||||
+ * @return True if this cart should call onMinecartPass().
|
||||
+ */
|
||||
+ public boolean shouldDoRailFunctions()
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns true if this cart is self propelled.
|
||||
+ * @return True if powered.
|
||||
+ */
|
||||
+ public boolean isPoweredCart()
|
||||
+ {
|
||||
+ return getMinecartType() == EntityMinecart.EnumMinecartType.FURNACE;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns true if this cart can be ridden by an Entity.
|
||||
+ * @return True if this cart can be ridden.
|
||||
+ */
|
||||
+ public boolean canBeRidden()
|
||||
+ {
|
||||
+ return this.getMinecartType() == EntityMinecart.EnumMinecartType.RIDEABLE;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Getters/setters for physics variables
|
||||
+ */
|
||||
+
|
||||
+ /**
|
||||
+ * Returns the carts max speed when traveling on rails. Carts going faster
|
||||
+ * than 1.1 cause issues with chunk loading. Carts cant traverse slopes or
|
||||
+ * corners at greater than 0.5 - 0.6. This value is compared with the rails
|
||||
+ * max speed and the carts current speed cap to determine the carts current
|
||||
+ * max speed. A normal rail's max speed is 0.4.
|
||||
+ *
|
||||
+ * @return Carts max speed.
|
||||
+ */
|
||||
+ public float getMaxCartSpeedOnRail()
|
||||
+ {
|
||||
+ return 1.2f;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns the current speed cap for the cart when traveling on rails. This
|
||||
+ * functions differs from getMaxCartSpeedOnRail() in that it controls
|
||||
+ * current movement and cannot be overridden. The value however can never be
|
||||
+ * higher than getMaxCartSpeedOnRail().
|
||||
+ *
|
||||
+ * @return
|
||||
+ */
|
||||
+ public final float getCurrentCartSpeedCapOnRail()
|
||||
+ {
|
||||
+ return currentSpeedRail;
|
||||
+ }
|
||||
+
|
||||
+ public final void setCurrentCartSpeedCapOnRail(float value)
|
||||
+ {
|
||||
+ value = Math.min(value, getMaxCartSpeedOnRail());
|
||||
+ currentSpeedRail = value;
|
||||
+ }
|
||||
+
|
||||
+ public float getMaxSpeedAirLateral()
|
||||
+ {
|
||||
+ return maxSpeedAirLateral;
|
||||
+ }
|
||||
+
|
||||
+ public void setMaxSpeedAirLateral(float value)
|
||||
+ {
|
||||
+ maxSpeedAirLateral = value;
|
||||
+ }
|
||||
+
|
||||
+ public float getMaxSpeedAirVertical()
|
||||
+ {
|
||||
+ return maxSpeedAirVertical;
|
||||
+ }
|
||||
+
|
||||
+ public void setMaxSpeedAirVertical(float value)
|
||||
+ {
|
||||
+ maxSpeedAirVertical = value;
|
||||
+ }
|
||||
+
|
||||
+ public double getDragAir()
|
||||
+ {
|
||||
+ return dragAir;
|
||||
+ }
|
||||
+
|
||||
+ public void setDragAir(double value)
|
||||
+ {
|
||||
+ dragAir = value;
|
||||
+ }
|
||||
+
|
||||
+ public double getSlopeAdjustment()
|
||||
+ {
|
||||
+ return 0.0078125D;
|
||||
+ }
|
||||
+
|
||||
+ /* =================================== FORGE END ===========================================*/
|
||||
+
|
||||
public static enum EnumMinecartType
|
||||
{
|
||||
RIDEABLE(0, "MinecartRideable"),
|
||||
++++ END PATCH
|
||||
@@ -56,7 +56,9 @@ import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.WeightedRandom;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package net.minecraftforge.common;
|
||||
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityMinecart;
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item.ToolMaterial;
|
||||
import net.minecraft.item.ItemArmor.ArmorMaterial;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.MovingObjectPosition.MovingObjectType;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.world.EnumSkyBlock;
|
||||
import net.minecraft.world.gen.structure.StructureStrongholdPieces.Stronghold.Door;
|
||||
import net.minecraftforge.classloading.FMLForgePlugin;
|
||||
@@ -42,11 +42,11 @@ public class EnumHelper
|
||||
{Door.class},
|
||||
{EnumEnchantmentType.class},
|
||||
{Sensitivity.class},
|
||||
{MovingObjectType.class},
|
||||
{RayTraceResult.Type.class},
|
||||
{EnumSkyBlock.class, int.class},
|
||||
{EnumStatus.class},
|
||||
{ToolMaterial.class, int.class, int.class, float.class, float.class, int.class},
|
||||
{EnumRarity.class, EnumChatFormatting.class, String.class}
|
||||
{EnumRarity.class, TextFormatting.class, String.class}
|
||||
};
|
||||
|
||||
public static EnumAction addAction(String name)
|
||||
@@ -82,9 +82,9 @@ public class EnumHelper
|
||||
{
|
||||
return addEnum(Sensitivity.class, name);
|
||||
}
|
||||
public static MovingObjectType addMovingObjectType(String name)
|
||||
public static RayTraceResult.Type addMovingObjectType(String name)
|
||||
{
|
||||
return addEnum(MovingObjectType.class, name);
|
||||
return addEnum(RayTraceResult.Type.class, name);
|
||||
}
|
||||
public static EnumSkyBlock addSkyBlock(String name, int lightValue)
|
||||
{
|
||||
@@ -98,7 +98,7 @@ public class EnumHelper
|
||||
{
|
||||
return addEnum(ToolMaterial.class, name, harvestLevel, maxUses, efficiency, damage, enchantability);
|
||||
}
|
||||
public static EnumRarity addRarity(String name, EnumChatFormatting color, String displayName)
|
||||
public static EnumRarity addRarity(String name, TextFormatting color, String displayName)
|
||||
{
|
||||
return addEnum(EnumRarity.class, name, color, displayName);
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ import net.minecraft.client.gui.GuiListExtended;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraftforge.fml.common.FMLLog;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.fml.common.ModContainer;
|
||||
@@ -1499,25 +1499,25 @@ public class GuiConfigEntries extends GuiListExtended
|
||||
|
||||
if (!comment.equals(configElement.getLanguageKey() + ".tooltip"))
|
||||
toolTip = new ArrayList<String>(this.mc.fontRendererObj.listFormattedStringToWidth(
|
||||
EnumChatFormatting.GREEN + name + "\n" + EnumChatFormatting.YELLOW + comment, 300));
|
||||
TextFormatting.GREEN + name + "\n" + TextFormatting.YELLOW + comment, 300));
|
||||
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));
|
||||
TextFormatting.GREEN + name + "\n" + TextFormatting.YELLOW + configElement.getComment(), 300));
|
||||
else
|
||||
toolTip = new ArrayList<String>(this.mc.fontRendererObj.listFormattedStringToWidth(
|
||||
EnumChatFormatting.GREEN + name + "\n" + EnumChatFormatting.RED + "No tooltip defined.", 300));
|
||||
TextFormatting.GREEN + name + "\n" + TextFormatting.RED + "No tooltip defined.", 300));
|
||||
|
||||
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));
|
||||
TextFormatting.AQUA + I18n.format("fml.configgui.tooltip.defaultNumeric", configElement.getMinValue(), configElement.getMaxValue(), configElement.getDefault()), 300));
|
||||
else if (configElement.getType() != ConfigGuiType.CONFIG_CATEGORY)
|
||||
toolTip.addAll(this.mc.fontRendererObj.listFormattedStringToWidth(EnumChatFormatting.AQUA + I18n.format("fml.configgui.tooltip.default", configElement.getDefault()),300));
|
||||
toolTip.addAll(this.mc.fontRendererObj.listFormattedStringToWidth(TextFormatting.AQUA + I18n.format("fml.configgui.tooltip.default", configElement.getDefault()),300));
|
||||
|
||||
if (configElement.requiresMcRestart() || owningScreen.allRequireMcRestart)
|
||||
toolTip.add(EnumChatFormatting.RED + "[" + I18n.format("fml.configgui.gameRestartTitle") + "]");
|
||||
toolTip.add(TextFormatting.RED + "[" + I18n.format("fml.configgui.gameRestartTitle") + "]");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1527,9 +1527,9 @@ public class GuiConfigEntries extends GuiListExtended
|
||||
|
||||
if (drawLabel)
|
||||
{
|
||||
String label = (!isValidValue ? EnumChatFormatting.RED.toString() :
|
||||
(isChanged ? EnumChatFormatting.WHITE.toString() : EnumChatFormatting.GRAY.toString()))
|
||||
+ (isChanged ? EnumChatFormatting.ITALIC.toString() : "") + this.name;
|
||||
String label = (!isValidValue ? TextFormatting.RED.toString() :
|
||||
(isChanged ? TextFormatting.WHITE.toString() : TextFormatting.GRAY.toString()))
|
||||
+ (isChanged ? TextFormatting.ITALIC.toString() : "") + this.name;
|
||||
this.mc.fontRendererObj.drawString(
|
||||
label,
|
||||
this.owningScreen.entryList.labelX,
|
||||
|
||||
@@ -21,7 +21,7 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import static net.minecraftforge.fml.client.config.GuiUtils.RESET_CHAR;
|
||||
import static net.minecraftforge.fml.client.config.GuiUtils.UNDO_CHAR;
|
||||
|
||||
@@ -63,17 +63,17 @@ public class GuiEditArray extends GuiScreen
|
||||
String comment;
|
||||
|
||||
comment = I18n.format(configElement.getLanguageKey() + ".tooltip",
|
||||
"\n" + EnumChatFormatting.AQUA, configElement.getDefault(), configElement.getMinValue(), configElement.getMaxValue());
|
||||
"\n" + TextFormatting.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);
|
||||
TextFormatting.GREEN + propName + "\n" + TextFormatting.YELLOW + comment, 300);
|
||||
else if (configElement.getComment() != null && !configElement.getComment().trim().isEmpty())
|
||||
toolTip = mc.fontRendererObj.listFormattedStringToWidth(
|
||||
EnumChatFormatting.GREEN + propName + "\n" + EnumChatFormatting.YELLOW + configElement.getComment(), 300);
|
||||
TextFormatting.GREEN + propName + "\n" + TextFormatting.YELLOW + configElement.getComment(), 300);
|
||||
else
|
||||
toolTip = mc.fontRendererObj.listFormattedStringToWidth(
|
||||
EnumChatFormatting.GREEN + propName + "\n" + EnumChatFormatting.RED + "No tooltip defined.", 300);
|
||||
TextFormatting.GREEN + propName + "\n" + TextFormatting.RED + "No tooltip defined.", 300);
|
||||
|
||||
if (parentScreen instanceof GuiConfig)
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiListExtended;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraftforge.fml.client.config.GuiConfigEntries.ArrayEntry;
|
||||
import net.minecraftforge.fml.common.FMLLog;
|
||||
|
||||
@@ -560,7 +560,7 @@ public class GuiEditArrayEntries extends GuiListExtended
|
||||
{
|
||||
if (this.getValue() != null && this.isValidated)
|
||||
owningEntryList.mc.fontRendererObj.drawString(
|
||||
isValidValue ? EnumChatFormatting.GREEN + VALID : EnumChatFormatting.RED + INVALID,
|
||||
isValidValue ? TextFormatting.GREEN + VALID : TextFormatting.RED + INVALID,
|
||||
listWidth / 4 - owningEntryList.mc.fontRendererObj.getStringWidth(VALID) - 2,
|
||||
y + slotHeight / 2 - owningEntryList.mc.fontRendererObj.FONT_HEIGHT / 2,
|
||||
16777215);
|
||||
|
||||
@@ -21,7 +21,8 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
|
||||
import static net.minecraftforge.fml.client.config.GuiUtils.RESET_CHAR;
|
||||
import static net.minecraftforge.fml.client.config.GuiUtils.UNDO_CHAR;
|
||||
|
||||
@@ -62,17 +63,17 @@ public class GuiSelectString extends GuiScreen
|
||||
String comment;
|
||||
|
||||
comment = I18n.format(configElement.getLanguageKey() + ".tooltip",
|
||||
"\n" + EnumChatFormatting.AQUA, configElement.getDefault(), configElement.getMinValue(), configElement.getMaxValue());
|
||||
"\n" + TextFormatting.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);
|
||||
TextFormatting.GREEN + propName + "\n" + TextFormatting.YELLOW + comment, 300);
|
||||
else if (configElement.getComment() != null && !configElement.getComment().trim().isEmpty())
|
||||
toolTip = mc.fontRendererObj.listFormattedStringToWidth(
|
||||
EnumChatFormatting.GREEN + propName + "\n" + EnumChatFormatting.YELLOW + configElement.getComment(), 300);
|
||||
TextFormatting.GREEN + propName + "\n" + TextFormatting.YELLOW + configElement.getComment(), 300);
|
||||
else
|
||||
toolTip = mc.fontRendererObj.listFormattedStringToWidth(
|
||||
EnumChatFormatting.GREEN + propName + "\n" + EnumChatFormatting.RED + "No tooltip defined.", 300);
|
||||
TextFormatting.GREEN + propName + "\n" + TextFormatting.RED + "No tooltip defined.", 300);
|
||||
|
||||
if (parentScreen instanceof GuiConfig)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ import org.fusesource.jansi.Ansi;
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
|
||||
public final class ConsoleFormatter implements Function<String, String>
|
||||
{
|
||||
@@ -20,31 +20,31 @@ public final class ConsoleFormatter implements Function<String, String>
|
||||
private static final String RESET = Ansi.ansi().reset().toString();
|
||||
|
||||
private static final ImmutableMap<Pattern, String> REPLACEMENTS = ImmutableMap.<Pattern, String> builder()
|
||||
.put(compile(EnumChatFormatting.BLACK), Ansi.ansi().reset().fg(Ansi.Color.BLACK).boldOff().toString())
|
||||
.put(compile(EnumChatFormatting.DARK_BLUE), Ansi.ansi().reset().fg(Ansi.Color.BLUE).boldOff().toString())
|
||||
.put(compile(EnumChatFormatting.DARK_GREEN), Ansi.ansi().reset().fg(Ansi.Color.GREEN).boldOff().toString())
|
||||
.put(compile(EnumChatFormatting.DARK_AQUA), Ansi.ansi().reset().fg(Ansi.Color.CYAN).boldOff().toString())
|
||||
.put(compile(EnumChatFormatting.DARK_RED), Ansi.ansi().reset().fg(Ansi.Color.RED).boldOff().toString())
|
||||
.put(compile(EnumChatFormatting.DARK_PURPLE), Ansi.ansi().reset().fg(Ansi.Color.MAGENTA).boldOff().toString())
|
||||
.put(compile(EnumChatFormatting.GOLD), Ansi.ansi().reset().fg(Ansi.Color.YELLOW).boldOff().toString())
|
||||
.put(compile(EnumChatFormatting.GRAY), Ansi.ansi().reset().fg(Ansi.Color.WHITE).boldOff().toString())
|
||||
.put(compile(EnumChatFormatting.DARK_GRAY), Ansi.ansi().reset().fg(Ansi.Color.BLACK).bold().toString())
|
||||
.put(compile(EnumChatFormatting.BLUE), Ansi.ansi().reset().fg(Ansi.Color.BLUE).bold().toString())
|
||||
.put(compile(EnumChatFormatting.GREEN), Ansi.ansi().reset().fg(Ansi.Color.GREEN).bold().toString())
|
||||
.put(compile(EnumChatFormatting.AQUA), Ansi.ansi().reset().fg(Ansi.Color.CYAN).bold().toString())
|
||||
.put(compile(EnumChatFormatting.RED), Ansi.ansi().reset().fg(Ansi.Color.RED).bold().toString())
|
||||
.put(compile(EnumChatFormatting.LIGHT_PURPLE), Ansi.ansi().reset().fg(Ansi.Color.MAGENTA).bold().toString())
|
||||
.put(compile(EnumChatFormatting.YELLOW), Ansi.ansi().reset().fg(Ansi.Color.YELLOW).bold().toString())
|
||||
.put(compile(EnumChatFormatting.WHITE), Ansi.ansi().reset().fg(Ansi.Color.WHITE).bold().toString())
|
||||
.put(compile(EnumChatFormatting.OBFUSCATED), Ansi.ansi().a(Ansi.Attribute.BLINK_SLOW).toString())
|
||||
.put(compile(EnumChatFormatting.BOLD), Ansi.ansi().a(Ansi.Attribute.UNDERLINE_DOUBLE).toString())
|
||||
.put(compile(EnumChatFormatting.STRIKETHROUGH), Ansi.ansi().a(Ansi.Attribute.STRIKETHROUGH_ON).toString())
|
||||
.put(compile(EnumChatFormatting.UNDERLINE), Ansi.ansi().a(Ansi.Attribute.UNDERLINE).toString())
|
||||
.put(compile(EnumChatFormatting.ITALIC), Ansi.ansi().a(Ansi.Attribute.ITALIC).toString())
|
||||
.put(compile(EnumChatFormatting.RESET), RESET)
|
||||
.put(compile(TextFormatting.BLACK), Ansi.ansi().reset().fg(Ansi.Color.BLACK).boldOff().toString())
|
||||
.put(compile(TextFormatting.DARK_BLUE), Ansi.ansi().reset().fg(Ansi.Color.BLUE).boldOff().toString())
|
||||
.put(compile(TextFormatting.DARK_GREEN), Ansi.ansi().reset().fg(Ansi.Color.GREEN).boldOff().toString())
|
||||
.put(compile(TextFormatting.DARK_AQUA), Ansi.ansi().reset().fg(Ansi.Color.CYAN).boldOff().toString())
|
||||
.put(compile(TextFormatting.DARK_RED), Ansi.ansi().reset().fg(Ansi.Color.RED).boldOff().toString())
|
||||
.put(compile(TextFormatting.DARK_PURPLE), Ansi.ansi().reset().fg(Ansi.Color.MAGENTA).boldOff().toString())
|
||||
.put(compile(TextFormatting.GOLD), Ansi.ansi().reset().fg(Ansi.Color.YELLOW).boldOff().toString())
|
||||
.put(compile(TextFormatting.GRAY), Ansi.ansi().reset().fg(Ansi.Color.WHITE).boldOff().toString())
|
||||
.put(compile(TextFormatting.DARK_GRAY), Ansi.ansi().reset().fg(Ansi.Color.BLACK).bold().toString())
|
||||
.put(compile(TextFormatting.BLUE), Ansi.ansi().reset().fg(Ansi.Color.BLUE).bold().toString())
|
||||
.put(compile(TextFormatting.GREEN), Ansi.ansi().reset().fg(Ansi.Color.GREEN).bold().toString())
|
||||
.put(compile(TextFormatting.AQUA), Ansi.ansi().reset().fg(Ansi.Color.CYAN).bold().toString())
|
||||
.put(compile(TextFormatting.RED), Ansi.ansi().reset().fg(Ansi.Color.RED).bold().toString())
|
||||
.put(compile(TextFormatting.LIGHT_PURPLE), Ansi.ansi().reset().fg(Ansi.Color.MAGENTA).bold().toString())
|
||||
.put(compile(TextFormatting.YELLOW), Ansi.ansi().reset().fg(Ansi.Color.YELLOW).bold().toString())
|
||||
.put(compile(TextFormatting.WHITE), Ansi.ansi().reset().fg(Ansi.Color.WHITE).bold().toString())
|
||||
.put(compile(TextFormatting.OBFUSCATED), Ansi.ansi().a(Ansi.Attribute.BLINK_SLOW).toString())
|
||||
.put(compile(TextFormatting.BOLD), Ansi.ansi().a(Ansi.Attribute.UNDERLINE_DOUBLE).toString())
|
||||
.put(compile(TextFormatting.STRIKETHROUGH), Ansi.ansi().a(Ansi.Attribute.STRIKETHROUGH_ON).toString())
|
||||
.put(compile(TextFormatting.UNDERLINE), Ansi.ansi().a(Ansi.Attribute.UNDERLINE).toString())
|
||||
.put(compile(TextFormatting.ITALIC), Ansi.ansi().a(Ansi.Attribute.ITALIC).toString())
|
||||
.put(compile(TextFormatting.RESET), RESET)
|
||||
.build();
|
||||
|
||||
private static Pattern compile(EnumChatFormatting formatting)
|
||||
private static Pattern compile(TextFormatting formatting)
|
||||
{
|
||||
return Pattern.compile(formatting.toString(), Pattern.LITERAL | Pattern.CASE_INSENSITIVE);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import com.google.common.base.Function;
|
||||
|
||||
import jline.console.ConsoleReader;
|
||||
import net.minecraft.server.dedicated.DedicatedServer;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
|
||||
public final class TerminalHandler
|
||||
{
|
||||
@@ -60,7 +60,7 @@ public final class TerminalHandler
|
||||
@Override
|
||||
public String apply(String text)
|
||||
{
|
||||
return EnumChatFormatting.getTextWithoutFormattingCodes(text);
|
||||
return TextFormatting.getTextWithoutFormattingCodes(text);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user