Cleanup: removed IEEP, removed redundant casts, fixed imports, fixed typos.

This commit is contained in:
RainWarrior 2016-03-23 17:34:48 +03:00
parent 7e4d7077a5
commit a9d23f5e78
133 changed files with 489 additions and 623 deletions

View File

@ -20,7 +20,7 @@
private void func_145940_l()
{
+ if (net.minecraftforge.event.ForgeEventFactory.onPotionAttemptBreaw(field_145945_j)) return;
+ if (net.minecraftforge.event.ForgeEventFactory.onPotionAttemptBrew(field_145945_j)) return;
ItemStack itemstack = this.field_145945_j[3];
- for (int i = 0; i < 3; ++i)

View File

@ -49,7 +49,7 @@ public class ClientCommandHandler extends CommandHandler
String[] args = new String[temp.length - 1];
String commandName = temp[0];
System.arraycopy(temp, 1, args, 0, args.length);
ICommand icommand = (ICommand) getCommands().get(commandName);
ICommand icommand = getCommands().get(commandName);
try
{

View File

@ -7,8 +7,7 @@ import net.minecraftforge.common.util.EnumHelper;
public class EnumHelperClient extends EnumHelper
{
@SuppressWarnings("rawtypes")
private static Class[][] clentTypes =
private static Class<?>[][] clientTypes =
{
{GameType.class, int.class, String.class},
{Options.class, String.class, boolean.class, boolean.class},
@ -32,6 +31,6 @@ public class EnumHelperClient extends EnumHelper
public static <T extends Enum<? >> T addEnum(Class<T> enumType, String enumName, Object... paramValues)
{
return addEnum(clentTypes, enumType, enumName, paramValues);
return addEnum(clientTypes, enumType, enumName, paramValues);
}
}

View File

@ -90,7 +90,6 @@ import net.minecraftforge.fml.common.FMLLog;
import org.apache.commons.lang3.tuple.Pair;
import org.lwjgl.BufferUtils;
import com.google.common.base.Objects;
import com.google.common.base.Optional;
import com.google.common.collect.Maps;
@ -110,7 +109,7 @@ public class ForgeHooksClient
}
//Optifine Helper Functions u.u, these are here specifically for Optifine
//Note: When using Optfine, these methods are invoked using reflection, which
//Note: When using Optifine, these methods are invoked using reflection, which
//incurs a major performance penalty.
public static void orientBedCamera(IBlockAccess world, BlockPos pos, IBlockState state, Entity entity)
{

View File

@ -148,7 +148,7 @@ public class GuiIngameForge extends GuiIngame
renderExperience(width, height);
}
renderToolHightlight(res);
renderToolHighlight(res);
renderHUDText(width, height);
renderPotionIcons(res);
renderRecordOverlay(width, height, partialTicks);
@ -466,21 +466,21 @@ public class GuiIngameForge extends GuiIngame
int x = left - i * 8 - 9;
int y = top;
int icon = 16;
byte backgound = 0;
byte background = 0;
if (mc.thePlayer.isPotionActive(MobEffects.hunger))
{
icon += 36;
backgound = 13;
background = 13;
}
if (unused) backgound = 1; //Probably should be a += 1 but vanilla never uses this
if (unused) background = 1; //Probably should be a += 1 but vanilla never uses this
if (player.getFoodStats().getSaturationLevel() <= 0.0F && updateCounter % (level * 3 + 1) == 0)
{
y = top + (rand.nextInt(3) - 1);
}
drawTexturedModalRect(x, y, 16 + backgound * 9, 27, 9, 9);
drawTexturedModalRect(x, y, 16 + background * 9, 27, 9, 9);
if (unused)
{
@ -602,7 +602,7 @@ public class GuiIngameForge extends GuiIngame
post(JUMPBAR);
}
protected void renderToolHightlight(ScaledResolution res)
protected void renderToolHighlight(ScaledResolution res)
{
if (this.mc.gameSettings.heldItemTooltips && !this.mc.playerController.isSpectator())
{

View File

@ -1,6 +1,5 @@
package net.minecraftforge.client.event;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.EntityRenderer;
import net.minecraft.entity.Entity;

View File

@ -33,7 +33,7 @@ public class Attributes
int padding = 0;
int j = 0;
for(VertexFormatElement firstAttr : (List<VertexFormatElement>)first.getElements())
for(VertexFormatElement firstAttr : first.getElements())
{
while(j < second.getElementCount() && second.getElement(j).getUsage() == EnumUsage.PADDING)
{

View File

@ -16,7 +16,6 @@ import net.minecraft.client.renderer.block.model.VariantList;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.model.IModelState;
import net.minecraftforge.common.model.TRSRTransformation;
import net.minecraftforge.fml.common.FMLLog;
import org.apache.commons.io.Charsets;
import org.apache.commons.io.IOUtils;
@ -159,7 +158,7 @@ public class BlockStateLoader
}
/**
* Used to replace the base model with a retextured model containing submodels.
* Used to replace the base model with a re-textured model containing sub-models.
*/
@Override
public IModel process(IModel base)
@ -176,9 +175,9 @@ public class BlockStateLoader
return base;
}
// Apply rotation of base model to submodels.
// Apply rotation of base model to sub-models.
// If baseRot is non-null, then that rotation will be applied instead of the base model's rotation.
// This is used to allow replacing base model with a submodel when there is no base model for a variant.
// This is used to allow replacing base model with a sub-model when there is no base model for a variant.
IModelState baseTr = getState();
ImmutableMap.Builder<String, Pair<IModel, IModelState>> models = ImmutableMap.builder();
for (Entry<String, SubModel> entry : parts.entrySet())

View File

@ -473,7 +473,7 @@ public class ForgeBlockStateV1 extends Marker
for (Entry<String, JsonElement> e : json.get("textures").getAsJsonObject().entrySet())
{
if (e.getValue().isJsonNull())
ret.textures.put(e.getKey(), ""); // We have to use "" because ImmutibleMaps don't allow nulls -.-
ret.textures.put(e.getKey(), ""); // We have to use "" because ImmutableMaps don't allow nulls -.-
else
ret.textures.put(e.getKey(), e.getValue().getAsString());
}

View File

@ -1,12 +0,0 @@
package net.minecraftforge.client.model;
import com.google.common.collect.ImmutableSet;
/**
* Created by rainwarrior on 2/2/16.
*/
public interface IModelWithSubmodels<M extends IModelWithSubmodels<M>> extends IModel
{
M setDefaultSubmodelEnabled (boolean value);
M setSubmodelsEnabled(ImmutableSet<String> submodelNames, boolean show);
}

View File

@ -31,7 +31,7 @@ public class MapModelState implements IModelState
public MapModelState(Map<Wrapper, IModelState> map, IModelState def)
{
this.map = ImmutableMap.<Wrapper, IModelState>copyOf(map);
this.map = ImmutableMap.copyOf(map);
this.def = def;
}

View File

@ -10,18 +10,17 @@ import javax.vecmath.Vector4f;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType;
import net.minecraft.client.renderer.block.model.ItemOverrideList;
import net.minecraft.client.renderer.block.model.ModelRotation;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.vertex.VertexFormat;
import net.minecraft.client.resources.IResourceManager;
import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraft.client.renderer.block.model.ModelRotation;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.client.model.pipeline.LightUtil;
import net.minecraftforge.client.model.pipeline.UnpackedBakedQuad;
import net.minecraftforge.common.model.IModelPart;
import net.minecraftforge.common.model.IModelState;

View File

@ -717,16 +717,13 @@ public final class ModelLoader extends ModelBakery
IModel model = ModelLoaderRegistry.getModel(loc);
// FIXME: is this the place? messes up dependency and texture resolution
if (v instanceof ISmartVariant)
model = v.process(model);
for(ResourceLocation location : model.getDependencies())
{
model = ((ISmartVariant)v).process(model);
for(ResourceLocation location : model.getDependencies())
{
ModelLoaderRegistry.getModelOrMissing(location);
}
//FMLLog.getLogger().error("Exception resolving indirect dependencies for model" + loc, e);
textures.addAll(model.getTextures()); // Kick this, just in case.
ModelLoaderRegistry.getModelOrMissing(location);
}
//FMLLog.getLogger().error("Exception resolving indirect dependencies for model" + loc, e);
textures.addAll(model.getTextures()); // Kick this, just in case.
models.add(model);
builder.add(Pair.of(model, v.getState()));

View File

@ -33,7 +33,7 @@ public enum Animation
}
/**
* Iternal hook, do not use.
* Internal hook, do not use.
*/
public static void setClientPartialTickTime(float clientPartialTickTime) {
Animation.INSTANCE.clientPartialTickTime = clientPartialTickTime;

View File

@ -551,12 +551,12 @@ public class ModelBlockAnimation
}
catch(IOException e)
{
FMLLog.log(Level.ERROR, e, "Exception loading vanilla model aniamtion %s, skipping", armatureLocation);
FMLLog.log(Level.ERROR, e, "Exception loading vanilla model animation %s, skipping", armatureLocation);
return defaultModelBlockAnimation;
}
catch(JsonParseException e)
{
FMLLog.log(Level.ERROR, e, "Exception loading vanilla model aniamtion %s, skipping", armatureLocation);
FMLLog.log(Level.ERROR, e, "Exception loading vanilla model animation %s, skipping", armatureLocation);
return defaultModelBlockAnimation;
}
}

View File

@ -60,7 +60,7 @@ public enum B3DClip implements IClip
{
ret = ret.compose(new TRSRTransformation(node.getPos(), node.getRot(), node.getScale(), null));
}
// TODO animated TRSR for speed?
// TODO animated TRSRTransformation for speed?
else
{
ret = ret.compose(endTr);

View File

@ -74,7 +74,7 @@ import com.google.gson.JsonParser;
/*
* Loader for Blitz3D models.
* To enable for your mod call instance.addDomain(modid).
* To enable for your mod call instance.addDomain(modId).
* If you need more control over accepted resources - extend the class, and register a new instance with ModelLoaderRegistry.
*/
public enum B3DLoader implements ICustomModelLoader
@ -139,7 +139,7 @@ public enum B3DLoader implements ICustomModelLoader
{
return new ModelWrapper(modelLocation, model, ImmutableSet.<String>of(), true, true, 1);
}
return new ModelWrapper(modelLocation, model, ImmutableSet.of(((Node<Mesh>)model.getRoot()).getName()), true, true, 1);
return new ModelWrapper(modelLocation, model, ImmutableSet.of(model.getRoot().getName()), true, true, 1);
}
public static final class B3DState implements IModelState
@ -208,7 +208,7 @@ public enum B3DLoader implements ICustomModelLoader
public Optional<TRSRTransformation> apply(Optional<? extends IModelPart> part)
{
// TODO optionify better
// TODO make more use of Optional
if(!part.isPresent()) return parent.apply(part);
if(!(part.get() instanceof NodeJoint))
{
@ -277,7 +277,7 @@ public enum B3DLoader implements ICustomModelLoader
// current node local pose
ret = ret.compose(new TRSRTransformation(key.getPos(), key.getRot(), key.getScale(), null));
// this part moved inside the model
// inverse bind of the curent node
// inverse bind of the current node
/*Matrix4f rm = new TRSRTransformation(node.getPos(), node.getRot(), node.getScale(), null).getMatrix();
rm.invert();
ret = ret.compose(new TRSRTransformation(rm));

View File

@ -60,7 +60,7 @@ public class B3DModel
public static class Parser
{
private static final int version = 0001;
private static final int version = 1;
private final ByteBuffer buf;
private byte[] tag = new byte[4];
@ -204,7 +204,7 @@ public class B3DModel
if(version / 100 > Parser.version / 100)
throw new IOException("Unsupported major model version: " + ((float)version / 100));
if(version % 100 > Parser.version % 100)
logger.warn(String.format("Minor version differnce in model: ", ((float)version / 100)));
logger.warn(String.format("Minor version difference in model: ", ((float)version / 100)));
List<Texture> textures = Collections.emptyList();
List<Brush> brushes = Collections.emptyList();
Node<?> root = null;

View File

@ -22,6 +22,7 @@ import javax.vecmath.Vector4f;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType;
import net.minecraft.client.renderer.block.model.ItemOverrideList;
@ -29,17 +30,17 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.vertex.VertexFormat;
import net.minecraft.client.resources.IResource;
import net.minecraft.client.resources.IResourceManager;
import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.*;
import net.minecraftforge.client.model.pipeline.LightUtil;
import net.minecraftforge.client.model.IModel;
import net.minecraftforge.client.model.IModelCustomData;
import net.minecraftforge.client.model.IPerspectiveAwareModel;
import net.minecraftforge.client.model.IRetexturableModel;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.client.model.pipeline.UnpackedBakedQuad;
import net.minecraftforge.common.model.IModelPart;
import net.minecraftforge.common.model.IModelState;
import net.minecraftforge.common.model.TRSRTransformation;
import net.minecraftforge.common.property.IExtendedBlockState;
import net.minecraftforge.common.property.IUnlistedProperty;
import net.minecraftforge.fml.common.FMLLog;
@ -1281,7 +1282,7 @@ public class OBJModel implements IRetexturableModel, IModelCustomData
INSTANCE;
public String getName()
{
return "OBJPropery";
return "OBJProperty";
}
@Override

View File

@ -71,8 +71,8 @@ public class BiomeDictionary
/**
* Retrieves a Type value by name,
* if one does not exist already it creates one.
* This can be used as interm measure for modders to
* add there own category of Biome.
* This can be used as intermediate measure for modders to
* add their own category of Biome.
*
* There are NO naming conventions besides:
* MUST be all upper case (enforced by name.toUpper())
@ -187,7 +187,7 @@ public class BiomeDictionary
{
if(typeInfoList[type.ordinal()] != null)
{
return (BiomeGenBase[])typeInfoList[type.ordinal()].toArray(new BiomeGenBase[0]);
return typeInfoList[type.ordinal()].toArray(new BiomeGenBase[0]);
}
return new BiomeGenBase[0];
@ -202,7 +202,7 @@ public class BiomeDictionary
public static Type[] getTypesForBiome(BiomeGenBase biome)
{
checkRegistration(biome);
return (Type[])getBiomeInfo(biome).typeList.toArray(new Type[0]);
return getBiomeInfo(biome).typeList.toArray(new Type[0]);
}
/**

View File

@ -136,7 +136,7 @@ public class DimensionManager
int leakCount = leakedWorlds.count(System.identityHashCode(w));
if (leakCount == 5)
{
FMLLog.fine("The world %x (%s) may have leaked: first encounter (5 occurences).\n", System.identityHashCode(w), w.getWorldInfo().getWorldName());
FMLLog.fine("The world %x (%s) may have leaked: first encounter (5 occurrences).\n", System.identityHashCode(w), w.getWorldInfo().getWorldName());
}
else if (leakCount % 5 == 0)
{
@ -259,7 +259,7 @@ public class DimensionManager
}
catch (Exception e)
{
FMLCommonHandler.instance().getFMLLogger().log(Level.ERROR, String.format("An error occured trying to create an instance of WorldProvider %d (%s)",
FMLCommonHandler.instance().getFMLLogger().log(Level.ERROR, String.format("An error occurred trying to create an instance of WorldProvider %d (%s)",
dim, getProviderType(dim)),e);
throw new RuntimeException(e);
}
@ -372,7 +372,7 @@ public class DimensionManager
{
if (DimensionManager.getWorld(0) != null)
{
return ((SaveHandler)DimensionManager.getWorld(0).getSaveHandler()).getWorldDirectory();
return DimensionManager.getWorld(0).getSaveHandler().getWorldDirectory();
}/*
else if (MinecraftServer.getServer() != null)
{

View File

@ -68,7 +68,7 @@ public class DungeonHooks
*/
public static String getRandomDungeonMob(Random rand)
{
DungeonMob mob = (DungeonMob)WeightedRandom.getRandomItem(rand, dungeonMobs);
DungeonMob mob = WeightedRandom.getRandomItem(rand, dungeonMobs);
if (mob == null)
{
return "";

View File

@ -15,10 +15,31 @@ import java.util.Map;
import java.util.Set;
import java.util.UUID;
import com.google.common.base.Function;
import com.google.common.collect.Iterables;
import com.google.common.collect.Iterators;
import javax.annotation.Nullable;
import net.minecraft.entity.Entity;
import net.minecraft.nbt.CompressedStreamTools;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.util.ClassInheritanceMultiMap;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.ChunkCoordIntPair;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
import net.minecraft.world.chunk.Chunk;
import net.minecraftforge.common.config.ConfigCategory;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;
import net.minecraftforge.common.util.Constants;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.FMLLog;
import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.common.ModContainer;
import net.minecraftforge.fml.common.eventhandler.Event;
import org.apache.logging.log4j.Level;
import com.google.common.base.Function;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.google.common.collect.ArrayListMultimap;
@ -29,6 +50,7 @@ import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableListMultimap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSetMultimap;
import com.google.common.collect.Iterators;
import com.google.common.collect.LinkedHashMultimap;
import com.google.common.collect.ListMultimap;
import com.google.common.collect.MapMaker;
@ -37,29 +59,6 @@ import com.google.common.collect.Multimap;
import com.google.common.collect.SetMultimap;
import com.google.common.collect.Sets;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.FMLLog;
import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.common.ModContainer;
import net.minecraftforge.fml.common.eventhandler.Event;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.ChunkCoordIntPair;
import net.minecraft.nbt.CompressedStreamTools;
import net.minecraft.entity.Entity;
import net.minecraft.util.ClassInheritanceMultiMap;
import net.minecraft.util.math.MathHelper;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
import net.minecraftforge.common.config.ConfigCategory;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;
import net.minecraftforge.common.util.Constants;
import javax.annotation.Nullable;
/**
* Manages chunkloading for mods.
*
@ -422,7 +421,7 @@ public class ForgeChunkManager
static void loadWorld(World world)
{
ArrayListMultimap<String, Ticket> newTickets = ArrayListMultimap.<String, Ticket>create();
ArrayListMultimap<String, Ticket> newTickets = ArrayListMultimap.create();
tickets.put(world, newTickets);
forcedChunks.put(world, ImmutableSetMultimap.<ChunkCoordIntPair,Ticket>of());
@ -439,7 +438,7 @@ public class ForgeChunkManager
if (chunkLoaderData.exists() && chunkLoaderData.isFile())
{
ArrayListMultimap<String, Ticket> loadedTickets = ArrayListMultimap.<String, Ticket>create();
ArrayListMultimap<String, Ticket> loadedTickets = ArrayListMultimap.create();
Map<String,ListMultimap<String,Ticket>> playerLoadedTickets = Maps.newHashMap();
NBTTagCompound forcedChunkData;
try
@ -454,7 +453,7 @@ public class ForgeChunkManager
NBTTagList ticketList = forcedChunkData.getTagList("TicketList", Constants.NBT.TAG_COMPOUND);
for (int i = 0; i < ticketList.tagCount(); i++)
{
NBTTagCompound ticketHolder = (NBTTagCompound)ticketList.getCompoundTagAt(i);
NBTTagCompound ticketHolder = ticketList.getCompoundTagAt(i);
String modId = ticketHolder.getString("Owner");
boolean isPlayer = "Forge".equals(modId);
@ -473,7 +472,7 @@ public class ForgeChunkManager
NBTTagList tickets = ticketHolder.getTagList("Tickets", Constants.NBT.TAG_COMPOUND);
for (int j = 0; j < tickets.tagCount(); j++)
{
NBTTagCompound ticket = (NBTTagCompound) tickets.getCompoundTagAt(j);
NBTTagCompound ticket = tickets.getCompoundTagAt(j);
modId = ticket.hasKey("ModId") ? ticket.getString("ModId") : modId;
Type type = Type.values()[ticket.getByte("Type")];
//byte ticketChunkDepth = ticket.getByte("ChunkListDepth");
@ -940,7 +939,7 @@ public class ForgeChunkManager
{
for (ClassInheritanceMultiMap<Entity> eList : chunk.getEntityLists())
{
Iterator<Entity> itr = (Iterator<Entity>)eList.iterator();
Iterator<Entity> itr = eList.iterator();
while (itr.hasNext())
{
(itr.next()).resetEntityId();
@ -966,7 +965,7 @@ public class ForgeChunkManager
dest.delete();
}
cfgFile.renameTo(dest);
FMLLog.log(Level.ERROR, e, "A critical error occured reading the forgeChunkLoading.cfg file, defaults will be used - the invalid file is backed up at forgeChunkLoading.cfg.bak");
FMLLog.log(Level.ERROR, e, "A critical error occurred reading the forgeChunkLoading.cfg file, defaults will be used - the invalid file is backed up at forgeChunkLoading.cfg.bak");
}
syncConfigDefaults();
}

View File

@ -20,23 +20,15 @@ import java.util.regex.Pattern;
import net.minecraft.block.Block;
import net.minecraft.block.BlockLiquid;
import net.minecraft.block.BlockTrapDoor;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLeashKnot;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityArmorStand;
import net.minecraft.entity.item.EntityBoat;
import net.minecraft.entity.item.EntityEnderCrystal;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.item.EntityItemFrame;
import net.minecraft.entity.item.EntityMinecart;
import net.minecraft.entity.item.EntityMinecartContainer;
import net.minecraft.entity.item.EntityPainting;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.InventoryPlayer;
@ -46,18 +38,14 @@ import net.minecraft.inventory.Container;
import net.minecraft.inventory.ContainerRepair;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemAxe;
import net.minecraft.item.ItemBucket;
import net.minecraft.item.ItemMonsterPlacer;
import net.minecraft.item.ItemPickaxe;
import net.minecraft.item.ItemSpade;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.nbt.NBTTagString;
import net.minecraft.network.NetHandlerPlayServer;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.SPacketBlockChange;
@ -83,7 +71,6 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraft.world.WorldSettings;
import net.minecraft.world.WorldSettings.GameType;
import net.minecraft.world.gen.feature.WorldGeneratorBonusChest;
import net.minecraftforge.common.util.BlockSnapshot;
import net.minecraftforge.event.AnvilUpdateEvent;
import net.minecraftforge.event.ForgeEventFactory;
@ -100,7 +87,6 @@ import net.minecraftforge.event.entity.living.LivingHurtEvent;
import net.minecraftforge.event.entity.living.LivingSetAttackTargetEvent;
import net.minecraftforge.event.entity.player.AnvilRepairEvent;
import net.minecraftforge.event.entity.player.AttackEntityEvent;
import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent;
import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent;
import net.minecraftforge.event.world.BlockEvent;
import net.minecraftforge.event.world.NoteBlockEvent;
@ -129,7 +115,7 @@ public class ForgeHooks
public static ItemStack getGrassSeed(Random rand, int fortune)
{
SeedEntry entry = (SeedEntry)WeightedRandom.getRandomItem(rand, seedList);
SeedEntry entry = WeightedRandom.getRandomItem(rand, seedList);
if (entry == null || entry.seed == null)
{
return null;
@ -426,7 +412,7 @@ public class ForgeHooks
if (target.typeOfHit == RayTraceResult.Type.BLOCK)
{
s1 = ((ResourceLocation)Block.blockRegistry.getNameForObject(world.getBlockState(target.getBlockPos()).getBlock())).toString();
s1 = Block.blockRegistry.getNameForObject(world.getBlockState(target.getBlockPos()).getBlock()).toString();
}
else if (target.typeOfHit == RayTraceResult.Type.ENTITY)
{
@ -461,7 +447,7 @@ public class ForgeHooks
}
//Optifine Helper Functions u.u, these are here specifically for Optifine
//Note: When using Optfine, these methods are invoked using reflection, which
//Note: When using Optifine, these methods are invoked using reflection, which
//incurs a major performance penalty.
public static void onLivingSetAttackTarget(EntityLivingBase entity, EntityLivingBase target)
{
@ -481,7 +467,7 @@ public class ForgeHooks
public static float onLivingHurt(EntityLivingBase entity, DamageSource src, float amount)
{
LivingHurtEvent event = new LivingHurtEvent(entity, src, amount);
return (MinecraftForge.EVENT_BUS.post(event) ? 0 : event.ammount);
return (MinecraftForge.EVENT_BUS.post(event) ? 0 : event.getAmount());
}
public static boolean onLivingDeath(EntityLivingBase entity, DamageSource src)
@ -568,7 +554,6 @@ public class ForgeHooks
return world.getBlockState(pos).getBlock().getEnchantPowerBonus(world, pos);
}
@SuppressWarnings("deprecation")
public static ITextComponent onServerChatEvent(NetHandlerPlayServer net, String raw, ITextComponent comp)
{
ServerChatEvent event = new ServerChatEvent(net.playerEntity, raw, comp);
@ -907,11 +892,11 @@ public class ForgeHooks
{
filled *= -1;
//filled -= 0.11111111F; //Why this is needed.. not sure...
return eyes > (double)(pos.getY() + 1 + (1 - filled));
return eyes > pos.getY() + 1 + (1 - filled);
}
else
{
return eyes < (double)(pos.getY() + 1 + filled);
return eyes < pos.getY() + 1 + filled;
}
}

View File

@ -1,18 +1,16 @@
package net.minecraftforge.common;
import com.google.common.base.Optional;
import net.minecraft.network.datasync.DataSerializers;
import net.minecraftforge.fml.common.FMLLog;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.WorldServer;
import net.minecraftforge.common.util.FakePlayerFactory;
import net.minecraftforge.event.entity.*;
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
import net.minecraftforge.event.world.WorldEvent;
import net.minecraftforge.fml.common.FMLLog;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
public class ForgeInternalHandler
{

View File

@ -170,7 +170,7 @@ public class ForgeModContainer extends DummyModContainer implements WorldAccessC
propOrder.add(prop.getName());
prop = config.get(CATEGORY_GENERAL, "sortRecipies", true);
prop.comment = "Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI.";
prop.comment = "Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipes. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI.";
prop.setLanguageKey("forge.configgui.sortRecipies").setRequiresMcRestart(true);
shouldSortRecipies = prop.getBoolean(shouldSortRecipies);
propOrder.add(prop.getName());
@ -202,7 +202,7 @@ public class ForgeModContainer extends DummyModContainer implements WorldAccessC
disableStitchedFileSaving = prop.getBoolean(true);
prop = config.get(Configuration.CATEGORY_GENERAL, "fullBoundingBoxLadders", false);
prop.comment = "Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticable differences in mechanics so default is vanilla behavior. Default: false";
prop.comment = "Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. Default: false";
prop.setLanguageKey("forge.configgui.fullBoundingBoxLadders").setRequiresWorldRestart(true);
fullBoundingBoxLadders = prop.getBoolean(false);
propOrder.add(prop.getName());
@ -226,7 +226,7 @@ public class ForgeModContainer extends DummyModContainer implements WorldAccessC
propOrder.add(prop.getName());
prop = config.get(Configuration.CATEGORY_GENERAL, "defaultSpawnFuzz", 20,
"The spawn fuzz when a player respawns in the world, this is controlable by WorldType, this config option is for the default overworld.",
"The spawn fuzz when a player respawns in the world, this is controllable by WorldType, this config option is for the default overworld.",
1, Integer.MAX_VALUE);
prop.setLanguageKey("forge.configgui.spawnfuzz").setRequiresWorldRestart(false);
defaultSpawnFuzz = prop.getInt(20);

View File

@ -119,7 +119,7 @@ public class ForgeVersion
{
if (!ForgeModContainer.getConfig().get(ForgeModContainer.VERSION_CHECK_CAT, "Global", true).getBoolean())
{
FMLLog.log("ForgeVersionCheck", Level.INFO, "Global Forge version check system disabeld, no futher processing.");
FMLLog.log("ForgeVersionCheck", Level.INFO, "Global Forge version check system disabled, no further processing.");
return;
}

View File

@ -1,39 +0,0 @@
package net.minecraftforge.common;
import net.minecraft.entity.Entity;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
/**
* Allows for custom entity data and logic to be hooked to existing entity classes.
*
* @author cpw, mithion
*
*/
public interface IExtendedEntityProperties {
/**
* Called when the entity that this class is attached to is saved.
* Any custom entity data that needs saving should be saved here.
* @param compound The compound to save to.
*/
public void saveNBTData(NBTTagCompound compound);
/**
* Called when the entity that this class is attached to is loaded.
* In order to hook into this, you will need to subscribe to the EntityConstructing event.
* Otherwise, you will need to initialize manually.
* @param compound The compound to load from.
*/
public void loadNBTData(NBTTagCompound compound);
/**
* Used to initialize the extended properties with the entity that this is attached to, as well
* as the world object.
* Called automatically if you register with the EntityConstructing event.
* May be called multiple times if the extended properties is moved over to a new entity.
* Such as when a player switches dimension {Minecraft re-creates the player entity}
* @param entity The entity that this extended properties is attached to
* @param world The world in which the entity exists
*/
public void init(Entity entity, World world);
}

View File

@ -14,7 +14,7 @@ public interface IMinecartCollisionHandler
{
/**
* This basically replaces the function of the same name in EnityMinecart.
* This basically replaces the function of the same name in EntityMinecart.
* Code in IMinecartHooks.applyEntityCollisionHook is still run.
* @param cart The cart that called the collision.
* @param other The object it collided with.

View File

@ -71,7 +71,7 @@ public interface ISpecialArmor
public int AbsorbMax = Integer.MAX_VALUE;
public double AbsorbRatio = 0;
public int Slot = 0;
private static final boolean DEBUG = false; //Only enable this if you wish to be spamed with debugging information.
private static final boolean DEBUG = false; //Only enable this if you wish to be spammed with debugging information.
//Left it in because I figured it'd be useful for modders developing custom armor.
public ArmorProperties(int priority, double ratio, int max)

View File

@ -44,7 +44,7 @@ public class WorldSpecificSaveHandler implements ISaveHandler
@Override
public File getMapFileFromName(String name)
{
if (dataDir == null) //Delayed down here do that world has time to be initalized first.
if (dataDir == null) //Delayed down here do that world has time to be initialized first.
{
dataDir = new File(world.getChunkSaveLocation(), "data");
dataDir.mkdirs();
@ -76,7 +76,7 @@ public class WorldSpecificSaveHandler implements ISaveHandler
}
catch (IOException e)
{
FMLLog.log(Level.ERROR, e, "A critical error occured copying %s to world specific dat folder - new file will be created.", parentFile.getName());
FMLLog.log(Level.ERROR, e, "A critical error occurred copying %s to world specific dat folder - new file will be created.", parentFile.getName());
}
}
}

View File

@ -84,7 +84,7 @@ public class BrewingRecipeRegistry {
/**
* Returns true if the passed input and ingredient have an output
*/
public static boolean hasOuput(ItemStack input, ItemStack ingredient)
public static boolean hasOutput(ItemStack input, ItemStack ingredient)
{
return getOutput(input, ingredient) != null;
}
@ -100,7 +100,7 @@ public class BrewingRecipeRegistry {
for (int i : inputIndexes)
{
if (hasOuput(inputs[i], ingredient))
if (hasOutput(inputs[i], ingredient))
{
return true;
}

View File

@ -42,7 +42,7 @@ public enum CapabilityManager
public T call() throws Exception
{
try {
return (T)implementation.newInstance();
return implementation.newInstance();
} catch (InstantiationException e) {
Throwables.propagate(e);
} catch (IllegalAccessException e) {

View File

@ -23,12 +23,12 @@ public class ConfigElement implements IConfigElement
private Property prop;
private Property.Type type;
private boolean isProperty;
private ConfigCategory ctgy;
private ConfigCategory category;
private boolean categoriesFirst = true;
public ConfigElement(ConfigCategory ctgy)
public ConfigElement(ConfigCategory category)
{
this.ctgy = ctgy;
this.category = category;
isProperty = false;
}
@ -51,8 +51,8 @@ public class ConfigElement implements IConfigElement
if (!isProperty)
{
List<IConfigElement> elements = new ArrayList<IConfigElement>();
Iterator<ConfigCategory> ccI = ctgy.getChildren().iterator();
Iterator<Property> pI = ctgy.getOrderedValues().iterator();
Iterator<ConfigCategory> ccI = category.getChildren().iterator();
Iterator<Property> pI = category.getOrderedValues().iterator();
@SuppressWarnings("unused")
int index = 0;
@ -87,7 +87,7 @@ public class ConfigElement implements IConfigElement
@Override
public String getName()
{
return isProperty ? prop.getName() : ctgy.getName();
return isProperty ? prop.getName() : category.getName();
}
@Override
@ -99,7 +99,7 @@ public class ConfigElement implements IConfigElement
@Override
public Class<? extends IConfigEntry> getConfigEntryClass()
{
return isProperty ? prop.getConfigEntryClass() : ctgy.getConfigEntryClass();
return isProperty ? prop.getConfigEntryClass() : category.getConfigEntryClass();
}
@Override
@ -111,7 +111,7 @@ public class ConfigElement implements IConfigElement
@Override
public String getQualifiedName()
{
return isProperty ? prop.getName() : ctgy.getQualifiedName();
return isProperty ? prop.getName() : category.getQualifiedName();
}
@Override
@ -148,7 +148,7 @@ public class ConfigElement implements IConfigElement
@Override
public String getComment()
{
return isProperty ? prop.comment : ctgy.getComment();
return isProperty ? prop.comment : category.getComment();
}
@Override
@ -167,19 +167,19 @@ public class ConfigElement implements IConfigElement
@Override
public boolean requiresWorldRestart()
{
return isProperty ? prop.requiresWorldRestart() : ctgy.requiresWorldRestart();
return isProperty ? prop.requiresWorldRestart() : category.requiresWorldRestart();
}
@Override
public boolean showInGui()
{
return isProperty ? prop.showInGui() : ctgy.showInGui();
return isProperty ? prop.showInGui() : category.showInGui();
}
@Override
public boolean requiresMcRestart()
{
return isProperty ? prop.requiresMcRestart() : ctgy.requiresMcRestart();
return isProperty ? prop.requiresMcRestart() : category.requiresMcRestart();
}
@Override
@ -191,7 +191,7 @@ public class ConfigElement implements IConfigElement
@Override
public String getLanguageKey()
{
return isProperty ? prop.getLanguageKey() : ctgy.getLanguagekey();
return isProperty ? prop.getLanguageKey() : category.getLanguagekey();
}
@Override

View File

@ -166,7 +166,7 @@ public class Configuration
*/
public Property get(String category, String key, boolean defaultValue)
{
return get(category, key, defaultValue, (String) null);
return get(category, key, defaultValue, null);
}
/**
@ -201,7 +201,7 @@ public class Configuration
*/
public Property get(String category, String key, boolean[] defaultValues)
{
return get(category, key, defaultValues, (String) null);
return get(category, key, defaultValues, null);
}
/**
@ -268,7 +268,7 @@ public class Configuration
*/
public Property get(String category, String key, int defaultValue)
{
return get(category, key, defaultValue, (String) null, Integer.MIN_VALUE, Integer.MAX_VALUE);
return get(category, key, defaultValue, null, Integer.MIN_VALUE, Integer.MAX_VALUE);
}
/**
@ -321,7 +321,7 @@ public class Configuration
*/
public Property get(String category, String key, int[] defaultValues)
{
return get(category, key, defaultValues, (String) null);
return get(category, key, defaultValues, null);
}
/**
@ -410,7 +410,7 @@ public class Configuration
*/
public Property get(String category, String key, double defaultValue)
{
return get(category, key, defaultValue, (String) null);
return get(category, key, defaultValue, null);
}
/**
@ -553,7 +553,7 @@ public class Configuration
*/
public Property get(String category, String key, String defaultValue)
{
return get(category, key, defaultValue, (String) null);
return get(category, key, defaultValue, null);
}
/**
@ -615,7 +615,7 @@ public class Configuration
*/
public Property get(String category, String key, String[] defaultValues)
{
return get(category, key, defaultValues, (String) null, false, -1, (Pattern) null);
return get(category, key, defaultValues, null, false, -1, null);
}
/**
@ -629,7 +629,7 @@ public class Configuration
*/
public Property get(String category, String key, String[] defaultValues, String comment)
{
return get(category, key, defaultValues, comment, false, -1, (Pattern) null);
return get(category, key, defaultValues, comment, false, -1, null);
}
/**
@ -877,7 +877,7 @@ public class Configuration
}
else if (Character.isWhitespace(line.charAt(i)))
{
// ignore space charaters
// ignore space characters
}
else
{
@ -927,7 +927,7 @@ public class Configuration
break;
if (currentCat == null)
{
throw new RuntimeException(String.format("Config file corrupt, attepted to close to many categories '%s:%d'", fileName, lineNum));
throw new RuntimeException(String.format("Config file corrupt, attempted to close to many categories '%s:%d'", fileName, lineNum));
}
currentCat = currentCat.parent;
break;
@ -1330,7 +1330,7 @@ public class Configuration
size = 4;
}
else if (bom32 == 0xFFFE0000) //This will never happen as it'll be caught by UTF-16LE,
{ //but if anyone ever runs across a 32LE file, i'd like to disect it.
{ //but if anyone ever runs across a 32LE file, i'd like to dissect it.
enc = "UTF-32LE";
size = 4;
}
@ -1567,7 +1567,7 @@ public class Configuration
*/
public String[] getStringList(String name, String category, String[] defaultValues, String comment)
{
return getStringList(name, category, defaultValues, comment, (String[]) null, name);
return getStringList(name, category, defaultValues, comment, null, name);
}
/**

View File

@ -30,7 +30,7 @@ import com.google.common.collect.Maps;
* If created with matrix, should successfully decompose it to a composition
* of easily interpolatable transformations (translation, first rotation, scale
* (with generally speaking different factors for each axis) and second rotation.
* If the inpit matrix is a composition of translation, rotation and scale (in
* If the input matrix is a composition of translation, rotation and scale (in
* any order), then the interpolation of the derived primitive transformations
* should result in the same transformation as the interpolation of the originals.
* Decomposition happens lazily (and is hopefully fast enough), so performance

View File

@ -25,7 +25,7 @@ public class ExtendedBlockState extends BlockStateContainer
public ExtendedBlockState(Block blockIn, IProperty<?>[] properties, IUnlistedProperty<?>[] unlistedProperties)
{
super(blockIn, properties, buildUnlistedMap(unlistedProperties));
ImmutableSet.Builder<IUnlistedProperty<?>> builder = ImmutableSet.<IUnlistedProperty<?>>builder();
ImmutableSet.Builder<IUnlistedProperty<?>> builder = ImmutableSet.builder();
for(IUnlistedProperty<?> property : unlistedProperties)
{
builder.add(property);
@ -40,7 +40,7 @@ public class ExtendedBlockState extends BlockStateContainer
private static ImmutableMap<IUnlistedProperty<?>, Optional<?>> buildUnlistedMap(IUnlistedProperty<?>[] unlistedProperties)
{
ImmutableMap.Builder<IUnlistedProperty<?>, Optional<?>> builder = ImmutableMap.<IUnlistedProperty<?>, Optional<?>>builder();
ImmutableMap.Builder<IUnlistedProperty<?>, Optional<?>> builder = ImmutableMap.builder();
for(IUnlistedProperty<?> p : unlistedProperties)
{
builder.put(p, Optional.absent());
@ -74,25 +74,27 @@ public class ExtendedBlockState extends BlockStateContainer
{
throw new IllegalArgumentException("Cannot set property " + property + " as it does not exist in " + getBlock().getBlockState());
}
else if (!property.getAllowedValues().contains(value))
{
throw new IllegalArgumentException("Cannot set property " + property + " to " + value + " on block " + Block.blockRegistry.getNameForObject(getBlock()) + ", it is not an allowed value");
}
else
{
if(this.getProperties().get(property) == value)
if (!property.getAllowedValues().contains(value))
{
return this;
throw new IllegalArgumentException("Cannot set property " + property + " to " + value + " on block " + Block.blockRegistry.getNameForObject(getBlock()) + ", it is not an allowed value");
} else
{
if (this.getProperties().get(property) == value)
{
return this;
}
Map<IProperty<?>, Comparable<?>> map = Maps.newHashMap(getProperties());
map.put(property, value);
if (Iterables.all(unlistedProperties.values(), Predicates.<Optional<?>>equalTo(Optional.absent())))
{ // no dynamic properties present, looking up in the normal table
return normalMap.get(map);
}
ImmutableTable<IProperty<?>, Comparable<?>, IBlockState> table = propertyValueTable;
table = ((StateImplementation) table.get(property, value)).getPropertyValueTable();
return new ExtendedStateImplementation(getBlock(), ImmutableMap.copyOf(map), unlistedProperties, table).setMap(this.normalMap);
}
Map<IProperty<?>, Comparable<?>> map = Maps.newHashMap(getProperties());
map.put(property, value);
if(Iterables.all(unlistedProperties.values(), Predicates.<Optional<?>>equalTo(Optional.absent())))
{ // no dynamic properties present, looking up in the normal table
return (IExtendedBlockState) normalMap.get(map);
}
ImmutableTable<IProperty<?>, Comparable<?>, IBlockState> table = propertyValueTable;
table = ((StateImplementation)table.get(property, value)).getPropertyValueTable();
return new ExtendedStateImplementation(getBlock(), ImmutableMap.copyOf(map), unlistedProperties, table).setMap(this.normalMap);
}
}

View File

@ -57,28 +57,27 @@ public final class AsynchronousExecutor<P, T, C, E extends Throwable> {
void callStage3(P parameter, T object, C callback) throws E;
}
@SuppressWarnings("rawtypes")
static final AtomicIntegerFieldUpdater STATE_FIELD = AtomicIntegerFieldUpdater.newUpdater(AsynchronousExecutor.Task.class, "state");
private static class StateHolder {
@SuppressWarnings({ "unchecked", "rawtypes" })
private static boolean set(AsynchronousExecutor.Task $this, int expected, int value) {
return STATE_FIELD.compareAndSet($this, expected, value);
protected static final int PENDING = 0x0;
protected static final int STAGE_1_ASYNC = PENDING + 1;
protected static final int STAGE_1_SYNC = STAGE_1_ASYNC + 1;
protected static final int STAGE_1_COMPLETE = STAGE_1_SYNC + 1;
protected static final int FINISHED = STAGE_1_COMPLETE + 1;
protected volatile int state = PENDING;
protected static final AtomicIntegerFieldUpdater<StateHolder> STATE = AtomicIntegerFieldUpdater.newUpdater(StateHolder.class, "state");
}
class Task implements Runnable {
static final int PENDING = 0x0;
static final int STAGE_1_ASYNC = PENDING + 1;
static final int STAGE_1_SYNC = STAGE_1_ASYNC + 1;
static final int STAGE_1_COMPLETE = STAGE_1_SYNC + 1;
static final int FINISHED = STAGE_1_COMPLETE + 1;
private class Task extends StateHolder implements Runnable {
volatile int state = PENDING;
final P parameter;
T object;
final List<C> callbacks = new LinkedList<C>();
E t = null;
private final P parameter;
private T object;
private final List<C> callbacks = new LinkedList<C>();
private E t = null;
Task(final P parameter) {
private Task(final P parameter) {
this.parameter = parameter;
}
@ -88,14 +87,14 @@ public final class AsynchronousExecutor<P, T, C, E extends Throwable> {
}
}
boolean initAsync() {
if (set(this, PENDING, STAGE_1_ASYNC)) {
private boolean initAsync() {
if (STATE.compareAndSet(this, PENDING, STAGE_1_ASYNC)) {
boolean ret = true;
try {
init();
} finally {
if (set(this, STAGE_1_ASYNC, STAGE_1_COMPLETE)) {
if (STATE.compareAndSet(this, STAGE_1_ASYNC, STAGE_1_COMPLETE)) {
// No one is/will be waiting
} else {
// We know that the sync thread will be waiting
@ -119,14 +118,14 @@ public final class AsynchronousExecutor<P, T, C, E extends Throwable> {
}
}
void initSync() {
if (set(this, PENDING, STAGE_1_COMPLETE)) {
private void initSync() {
if (STATE.compareAndSet(this, PENDING, STAGE_1_COMPLETE)) {
// If we succeed that variable switch, good as done
init();
} else if (set(this, STAGE_1_ASYNC, STAGE_1_SYNC)) {
} else if (STATE.compareAndSet(this, STAGE_1_ASYNC, STAGE_1_SYNC)) {
// Async thread is running, but this shouldn't be likely; we need to sync to wait on them because of it.
synchronized (this) {
if (set(this, STAGE_1_SYNC, PENDING)) { // They might NOT synchronized yet, atomic lock IS needed
if (STATE.compareAndSet(this, STAGE_1_SYNC, PENDING)) { // They might NOT synchronized yet, atomic lock IS needed
// We are the first into the lock
while (state != STAGE_1_COMPLETE) {
try {
@ -146,7 +145,7 @@ public final class AsynchronousExecutor<P, T, C, E extends Throwable> {
}
@SuppressWarnings("unchecked")
void init() {
private void init() {
try {
object = provider.callStage1(parameter);
} catch (final Throwable t) {
@ -155,7 +154,7 @@ public final class AsynchronousExecutor<P, T, C, E extends Throwable> {
}
@SuppressWarnings("unchecked")
T get() throws E {
private T get() throws E {
initSync();
if (callbacks.isEmpty()) {
// 'this' is a placeholder to prevent callbacks from being empty during finish call
@ -166,7 +165,7 @@ public final class AsynchronousExecutor<P, T, C, E extends Throwable> {
return object;
}
void finish() throws E {
private void finish() throws E {
switch (state) {
default:
case PENDING:
@ -203,8 +202,8 @@ public final class AsynchronousExecutor<P, T, C, E extends Throwable> {
}
}
boolean drop() {
if (set(this, PENDING, FINISHED)) {
private boolean drop() {
if (STATE.compareAndSet(this, PENDING, FINISHED)) {
// If we succeed that variable switch, good as forgotten
tasks.remove(parameter);
return true;
@ -215,10 +214,10 @@ public final class AsynchronousExecutor<P, T, C, E extends Throwable> {
}
}
final CallBackProvider<P, T, C, E> provider;
final Queue<Task> finished = new ConcurrentLinkedQueue<Task>();
final Map<P, Task> tasks = new HashMap<P, Task>();
final ThreadPoolExecutor pool;
private final CallBackProvider<P, T, C, E> provider;
private final Queue<Task> finished = new ConcurrentLinkedQueue<Task>();
private final Map<P, Task> tasks = new HashMap<P, Task>();
private final ThreadPoolExecutor pool;
/**
* Uses a thread pool to pass executions to the provider.
@ -314,7 +313,7 @@ public final class AsynchronousExecutor<P, T, C, E extends Throwable> {
/**
* Processes a parameter as if it was in the queue, without ever passing to another thread.
*/
public T getSkipQueue(P parameter, @SuppressWarnings("unchecked")C... callbacks) throws E {
public T getSkipQueue(P parameter, C... callbacks) throws E {
final CallBackProvider<P, T, C, E> provider = this.provider;
final T object = skipQueue(parameter);
for (C callback : callbacks) {

View File

@ -79,12 +79,12 @@ public class BlockSnapshot implements Serializable
/**
* Raw constructor designed for serialization usages.
*/
public BlockSnapshot(int dimension, BlockPos pos, String modid, String blockName, int meta, int flag, NBTTagCompound nbt)
public BlockSnapshot(int dimension, BlockPos pos, String modId, String blockName, int meta, int flag, NBTTagCompound nbt)
{
this.dimId = dimension;
this.pos = pos.getImmutable();
this.flag = flag;
this.blockIdentifier = new UniqueIdentifier(modid + ":" + blockName);
this.blockIdentifier = new UniqueIdentifier(modId + ":" + blockName);
this.meta = meta;
this.nbt = nbt;
}

View File

@ -35,8 +35,7 @@ public class EnumHelper
private static boolean isSetup = false;
//Some enums are decompiled with extra arguments, so lets check for that
@SuppressWarnings("rawtypes")
private static Class[][] commonTypes =
private static Class<?>[][] commonTypes =
{
{EnumAction.class},
{ArmorMaterial.class, String.class, int.class, int[].class, int.class, SoundEvent.class},
@ -69,8 +68,7 @@ public class EnumHelper
{
return addEnum(EnumCreatureAttribute.class, name);
}
@SuppressWarnings("rawtypes")
public static EnumCreatureType addCreatureType(String name, Class typeClass, int maxNumber, Material material, boolean peaceful, boolean animal)
public static EnumCreatureType addCreatureType(String name, Class<?> typeClass, int maxNumber, Material material, boolean peaceful, boolean animal)
{
return addEnum(EnumCreatureType.class, name, typeClass, maxNumber, material, peaceful, animal);
}
@ -147,11 +145,11 @@ public class EnumHelper
private static < T extends Enum<? >> T makeEnum(Class<T> enumClass, String value, int ordinal, Class<?>[] additionalTypes, Object[] additionalValues) throws Exception
{
Object[] parms = new Object[additionalValues.length + 2];
parms[0] = value;
parms[1] = Integer.valueOf(ordinal);
System.arraycopy(additionalValues, 0, parms, 2, additionalValues.length);
return enumClass.cast(newInstance.invoke(getConstructorAccessor(enumClass, additionalTypes), new Object[] {parms}));
Object[] params = new Object[additionalValues.length + 2];
params[0] = value;
params[1] = ordinal;
System.arraycopy(additionalValues, 0, params, 2, additionalValues.length);
return enumClass.cast(newInstance.invoke(getConstructorAccessor(enumClass, additionalTypes), new Object[] {params}));
}
public static void setFailsafeFieldValue(Field field, Object target, Object value) throws Exception
@ -189,10 +187,9 @@ public class EnumHelper
return addEnum(commonTypes, enumType, enumName, paramValues);
}
@SuppressWarnings("rawtypes")
public static <T extends Enum<? >> T addEnum(Class[][] map, Class<T> enumType, String enumName, Object... paramValues)
public static <T extends Enum<? >> T addEnum(Class<?>[][] map, Class<T> enumType, String enumName, Object... paramValues)
{
for (Class[] lookup : map)
for (Class<?>[] lookup : map)
{
if (lookup[0] == enumType)
{
@ -335,7 +332,7 @@ public class EnumHelper
{
T[] previousValues = (T[])valuesField.get(enumType);
List<T> values = new ArrayList<T>(Arrays.asList(previousValues));
T newValue = (T)makeEnum(enumType, enumName, values.size(), paramTypes, paramValues);
T newValue = makeEnum(enumType, enumName, values.size(), paramTypes, paramValues);
values.add(newValue);
setFailsafeFieldValue(valuesField, null, values.toArray((T[]) Array.newInstance(enumType, 0)));
cleanEnumCache(enumType);

View File

@ -26,16 +26,16 @@ public class JsonUtils
public ImmutableList<?> deserialize(JsonElement json, Type type, JsonDeserializationContext context) throws JsonParseException
{
final Type[] typeArguments = ((ParameterizedType) type).getActualTypeArguments();
final Type parameterizedType = listOf(typeArguments[0]).getType();
final List<?> list = context.deserialize(json, parameterizedType);
final Type parametrizedType = listOf(typeArguments[0]).getType();
final List<?> list = context.deserialize(json, parametrizedType);
return ImmutableList.copyOf(list);
}
public JsonElement serialize(ImmutableList<?> src, Type type, JsonSerializationContext context)
{
final Type[] typeArguments = ((ParameterizedType) type).getActualTypeArguments();
final Type parameterizedType = listOf(typeArguments[0]).getType();
return context.serialize(src, parameterizedType);
final Type parametrizedType = listOf(typeArguments[0]).getType();
return context.serialize(src, parametrizedType);
}
}

View File

@ -37,7 +37,7 @@ public class AttachCapabilitiesEvent extends Event
/**
* Adds a capability to be attached to this object.
* Keys MUST be unique, it is suggested that you set the domain to your mod ID.
* If the capability is an instance of INBTSerializeable, this key will be used when serializing this capability.
* If the capability is an instance of INBTSerializable, this key will be used when serializing this capability.
*
* @param key The name of owner of this capability provider.
* @param cap The capability provider

View File

@ -4,7 +4,6 @@ import java.io.File;
import java.util.EnumSet;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
@ -16,7 +15,6 @@ import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayer.EnumStatus;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
@ -81,8 +79,8 @@ import net.minecraftforge.event.entity.player.UseHoeEvent;
import net.minecraftforge.event.terraingen.ChunkGeneratorEvent;
import net.minecraftforge.event.terraingen.PopulateChunkEvent;
import net.minecraftforge.event.world.BlockEvent;
import net.minecraftforge.event.world.BlockEvent.NeighborNotifyEvent;
import net.minecraftforge.event.world.BlockEvent.MultiPlaceEvent;
import net.minecraftforge.event.world.BlockEvent.NeighborNotifyEvent;
import net.minecraftforge.event.world.BlockEvent.PlaceEvent;
import net.minecraftforge.event.world.ExplosionEvent;
import net.minecraftforge.event.world.WorldEvent;
@ -396,9 +394,9 @@ public class ForgeEventFactory
return event.result;
}
public static void onPlayerWakeup(EntityPlayer player, boolean wakeImmediatly, boolean updateWorldFlag, boolean setSpawn)
public static void onPlayerWakeup(EntityPlayer player, boolean wakeImmediately, boolean updateWorldFlag, boolean setSpawn)
{
MinecraftForge.EVENT_BUS.post(new PlayerWakeUpEvent(player, wakeImmediatly, updateWorldFlag, setSpawn));
MinecraftForge.EVENT_BUS.post(new PlayerWakeUpEvent(player, wakeImmediately, updateWorldFlag, setSpawn));
}
public static void onPlayerFall(EntityPlayer player, float distance, float multiplier)
@ -447,7 +445,7 @@ public class ForgeEventFactory
return (MinecraftForge.EVENT_BUS.post(event) ? 0 : event.amount);
}
public static boolean onPotionAttemptBreaw(ItemStack[] stacks)
public static boolean onPotionAttemptBrew(ItemStack[] stacks)
{
ItemStack[] tmp = new ItemStack[stacks.length];
for (int x = 0; x < tmp.length; x++)

View File

@ -7,7 +7,7 @@ import net.minecraft.entity.item.EntityItem;
* Event that is fired when an EntityItem's age has reached its maximum
* lifespan. Canceling this event will prevent the EntityItem from being
* flagged as dead, thus staying it's removal from the world. If canceled
* it will add more time to the entitie's life equal to extraLife.
* it will add more time to the entities life equal to extraLife.
*/
@Cancelable
public class ItemExpireEvent extends ItemEvent

View File

@ -25,12 +25,15 @@ import net.minecraft.entity.EntityLivingBase;
@Cancelable
public class LivingAttackEvent extends LivingEvent
{
public final DamageSource source;
public final float ammount;
public LivingAttackEvent(EntityLivingBase entity, DamageSource source, float ammount)
private final DamageSource source;
private final float amount;
public LivingAttackEvent(EntityLivingBase entity, DamageSource source, float amount)
{
super(entity);
this.source = source;
this.ammount = ammount;
this.amount = amount;
}
public DamageSource getSource() { return source; }
public float getAmount() { return amount; }
}

View File

@ -1,9 +1,8 @@
package net.minecraftforge.event.entity.living;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
public abstract class LivingEntityUseItemEvent extends LivingEvent
{

View File

@ -25,13 +25,18 @@ import net.minecraft.entity.EntityLivingBase;
@Cancelable
public class LivingHurtEvent extends LivingEvent
{
public final DamageSource source;
public float ammount;
public LivingHurtEvent(EntityLivingBase entity, DamageSource source, float ammount)
private final DamageSource source;
private float amount;
public LivingHurtEvent(EntityLivingBase entity, DamageSource source, float amount)
{
super(entity);
this.source = source;
this.ammount = ammount;
this.amount = amount;
}
public DamageSource getSource() { return source; }
public float getAmount() { return amount; }
public void setAmount(float amount) { this.amount = amount; }
}

View File

@ -38,6 +38,7 @@ public class ArrowLooseEvent extends PlayerEvent
}
public ItemStack getBow() { return this.bow; }
public World getWorld() { return this.world; }
public boolean hasAmmo() { return this.hasAmmo; }
public int getCharge() { return this.charge; }
public void setCharge(int charge) { this.charge = charge; }

View File

@ -31,6 +31,7 @@ public class ArrowNockEvent extends PlayerEvent
}
public ItemStack getBow() { return this.bow; }
public World getWorld() { return this.world; }
public EnumHand getHand() { return this.hand; }
public boolean hasAmmo() { return this.hasAmmo; }
public ActionResult<ItemStack> getAction()

View File

@ -18,7 +18,7 @@ public class BonemealEvent extends PlayerEvent
* You can also set the result to ALLOW to mark the event as processed
* and use up a bonemeal from the stack but do no further processing.
*
* setResult(ALLOW) is the same as the old setHandeled()
* setResult(ALLOW) is the same as the old setHandled()
*/
public final World world;

View File

@ -18,7 +18,7 @@ public class FillBucketEvent extends PlayerEvent
* If you set the result to 'ALLOW', it means that you have processed
* the event and wants the basic functionality of adding the new
* ItemStack to your inventory and reducing the stack size to process.
* setResult(ALLOW) is the same as the old setHandeled();
* setResult(ALLOW) is the same as the old setHandled();
*/
private final ItemStack current;

View File

@ -27,7 +27,7 @@ import net.minecraft.util.EnumHand;
public class PlayerDestroyItemEvent extends PlayerEvent
{
private final ItemStack original;
private final EnumHand hand; // May be null if this player destroies the item by any use besides holding it.
private final EnumHand hand; // May be null if this player destroys the item by any use besides holding it.
public PlayerDestroyItemEvent(EntityPlayer player, ItemStack original, EnumHand hand)
{
super(player);

View File

@ -9,13 +9,18 @@ import net.minecraft.entity.player.EntityPlayer;
*/
public class PlayerFlyableFallEvent extends PlayerEvent
{
public float distance;
public float multipler;
private float distance;
private float multiplier;
public PlayerFlyableFallEvent(EntityPlayer player, float distance, float multiplier)
{
super(player);
this.distance = distance;
this.multipler = multiplier;
this.multiplier = multiplier;
}
public float getDistance() { return distance;}
public void setDistance(float distance) { this.distance = distance; }
public float getMultiplier() { return multiplier; }
public void setMultiplier(float multiplier) { this.multiplier = multiplier; }
}

View File

@ -20,7 +20,7 @@ import net.minecraftforge.fml.common.eventhandler.Cancelable;
* <br>
* This event is fired via the {@link ForgeEventFactory#onPlayerInteract(EntityPlayer, Action, BlockPos, EnumFacing)}.
* <br>
* {@link #action} contains the Action the player performed durin this interaction. <br>
* {@link #action} contains the Action the player performed during this interaction. <br>
* {@link #pos} contains the coordinate of where this event occurred.<br>
* {@link #face} contains the face of the block that was interacted with. May be null if unknown. <br>
* {@link #world} contains the world in which this event is occurring. <br>

View File

@ -9,29 +9,35 @@ import net.minecraft.entity.player.EntityPlayer;
*/
public class PlayerWakeUpEvent extends PlayerEvent
{
private final boolean wakeImmediately;
private final boolean updateWorld;
private final boolean setSpawn;
public PlayerWakeUpEvent(EntityPlayer player, boolean wakeImmediately, boolean updateWorld, boolean setSpawn)
{
super(player);
this.wakeImmediately = wakeImmediately;
this.updateWorld = updateWorld;
this.setSpawn = setSpawn;
}
/**
* Used for the 'wake up animation'.
* This is false if the player is considered 'sleepy' and the overlay should slowly fade away.
*/
public final boolean wakeImmediatly;
public boolean wakeImmediately() { return wakeImmediately; }
/**
* Indicates if the server should be notified of sleeping changes.
* This will only be false if the server is considered 'up to date' already, because, for example, it initiated the call.
*/
public final boolean updateWorld;
public boolean updateWorld() { return updateWorld; }
/**
* Indicates if the player's sleep was considered successful.
* In vanilla, this is used to determine if the spawn chunk is to be set to the bed's position.
*/
public final boolean setSpawn;
public PlayerWakeUpEvent(EntityPlayer player, boolean wakeImmediatly, boolean updateWorld, boolean setSpawn)
{
super(player);
this.wakeImmediatly = wakeImmediatly;
this.updateWorld = updateWorld;
this.setSpawn = setSpawn;
}
public boolean shouldSetSpawn() { return setSpawn; }
}

View File

@ -18,7 +18,7 @@ public class UseHoeEvent extends PlayerEvent
* You can also set the result to ALLOW to mark the event as processed
* and damage the hoe.
*
* setResult(ALLOW) is the same as the old setHandeled();
* setResult(ALLOW) is the same as the old setHandled();
*/
public final ItemStack current;

View File

@ -2,11 +2,11 @@ package net.minecraftforge.event.terraingen;
import java.util.Random;
import net.minecraftforge.fml.common.eventhandler.Event;
import net.minecraftforge.fml.common.eventhandler.Event.HasResult;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkGenerator;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
import net.minecraftforge.fml.common.eventhandler.Event;
/**
* PopulateChunkEvent is fired when an event involving chunk terrain feature population occurs.<br>

View File

@ -1,18 +1,17 @@
package net.minecraftforge.event.terraingen;
import java.util.Random;
import net.minecraftforge.fml.common.eventhandler.Event.*;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkGenerator;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.MapGenBase;
import net.minecraft.world.gen.NoiseGenerator;
import net.minecraft.world.gen.feature.WorldGenerator;
import net.minecraftforge.common.*;
import net.minecraftforge.event.terraingen.DecorateBiomeEvent.*;
import net.minecraftforge.event.terraingen.OreGenEvent.*;
import net.minecraftforge.event.terraingen.PopulateChunkEvent.*;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate;
import net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable;
import net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate;
import net.minecraftforge.fml.common.eventhandler.Event.Result;
public abstract class TerrainGen
{

View File

@ -168,7 +168,7 @@ public class BlockEvent extends Event
}
/**
* Gets a list of blocksnapshots for all blocks which were replaced by the
* Gets a list of BlockSnapshots for all blocks which were replaced by the
* placement of the new blocks. Most of these blocks will just be of type AIR.
*
* @return immutable list of replaced BlockSnapshots

View File

@ -1,21 +1,16 @@
package net.minecraftforge.event.world;
import com.google.common.base.Preconditions;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.event.world.BlockEvent;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
import net.minecraftforge.fml.common.eventhandler.Event;
import com.google.common.base.Preconditions;
/**
* Base class for Noteblock Events
*
*/
@SuppressWarnings("unused")
public class NoteBlockEvent extends BlockEvent
{
private int noteId;

View File

@ -16,7 +16,7 @@ import net.minecraftforge.fml.common.eventhandler.Event;
* If a method utilizes this {@link Event} as its parameter, the method will
* receive every child event of this class.<br>
* <br>
* {@link #world} contains the World this event is occuring in.<br>
* {@link #world} contains the World this event is occurring in.<br>
* <br>
* All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}.<br>
**/

View File

@ -34,7 +34,6 @@ import com.google.common.collect.Maps;
* It is highly recommended that you extend this class or one of the Forge-provided child classes.
*
*/
@SuppressWarnings("unchecked")
public abstract class BlockFluidBase extends Block implements IFluidBlock
{
protected final static Map<Block, Boolean> defaultDisplacements = Maps.newHashMap();
@ -88,19 +87,18 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
public static final PropertyInteger LEVEL = PropertyInteger.create("level", 0, 15);
public static final PropertyFloat[] LEVEL_CORNERS = new PropertyFloat[4];
public static final PropertyFloat FLOW_DIRECTION = new PropertyFloat("flow_direction");
public static final IUnlistedProperty<Float>[] FLUID_RENDER_PROPS;
public static final ImmutableList<IUnlistedProperty<Float>> FLUID_RENDER_PROPS;
static
{
@SuppressWarnings("rawtypes")
ImmutableList.Builder<IUnlistedProperty> builder = ImmutableList.builder();
ImmutableList.Builder<IUnlistedProperty<Float>> builder = ImmutableList.builder();
builder.add(FLOW_DIRECTION);
for(int i = 0; i < 4; i++)
{
LEVEL_CORNERS[i] = new PropertyFloat("level_corner_" + i);
builder.add(LEVEL_CORNERS[i]);
}
FLUID_RENDER_PROPS = builder.build().toArray(new IUnlistedProperty[0]);
FLUID_RENDER_PROPS = builder.build();
}
protected int quantaPerBlock = 8;
@ -144,7 +142,7 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
@Override
protected BlockStateContainer createBlockState()
{
return new ExtendedBlockState(this, new IProperty[] { LEVEL }, FLUID_RENDER_PROPS);
return new ExtendedBlockState(this, new IProperty[] { LEVEL }, FLUID_RENDER_PROPS.toArray(new IUnlistedProperty<?>[0]));
}
@Override

View File

@ -81,7 +81,7 @@ public class BlockFluidFinite extends BlockFluidBase
}
// Flow out if possible
int lowerthan = quantaRemaining - 1;
int lowerThan = quantaRemaining - 1;
int total = quantaRemaining;
int count = 1;
@ -91,7 +91,7 @@ public class BlockFluidFinite extends BlockFluidBase
if (displaceIfPossible(world, off))
world.setBlockToAir(off);
int quanta = getQuantaValueBelow(world, off, lowerthan);
int quanta = getQuantaValueBelow(world, off, lowerThan);
if (quanta >= 0)
{
count++;
@ -114,25 +114,25 @@ public class BlockFluidFinite extends BlockFluidBase
for (EnumFacing side : EnumFacing.Plane.HORIZONTAL)
{
BlockPos off = pos.offset(side);
int quanta = getQuantaValueBelow(world, off, lowerthan);
int quanta = getQuantaValueBelow(world, off, lowerThan);
if (quanta >= 0)
{
int newquanta = each;
int newQuanta = each;
if (rem == count || rem > 1 && rand.nextInt(count - rem) != 0)
{
++newquanta;
++newQuanta;
--rem;
}
if (newquanta != quanta)
if (newQuanta != quanta)
{
if (newquanta == 0)
if (newQuanta == 0)
{
world.setBlockToAir(off);
}
else
{
world.setBlockState(off, getDefaultState().withProperty(LEVEL, newquanta - 1), 2);
world.setBlockState(off, getDefaultState().withProperty(LEVEL, newQuanta - 1), 2);
}
world.scheduleUpdate(off, this, tickRate);
}

View File

@ -20,7 +20,7 @@ import net.minecraftforge.common.MinecraftForge;
* For more complex items, use {@link IFluidContainerItem} instead.
*
* Deprecated: We will eventually be moving this ALL away from a registry and instead EVERYTHING will use IFluidContainerItem.
* We need to decide a way of swaping Items/Stacks.
* We need to decide a way of swapping Items/Stacks.
*/
@Deprecated
public abstract class FluidContainerRegistry

View File

@ -28,7 +28,7 @@ public class FluidUtil
{
}
/** Returns true if intercation was successful. */
/** Returns true if interaction was successful. */
public static boolean interactWithTank(ItemStack stack, EntityPlayer player, IFluidHandler tank, EnumFacing side)
{
if (stack == null || player.worldObj.isRemote)
@ -193,7 +193,7 @@ public class FluidUtil
* @param tank The tank to fill from
* @param side Side to access the tank from
* @param player The player that tries to fill the bucket. Needed if the input itemstack has a stacksize > 1 to determine where the filled container goes.
* @return True if the IFluidContainerItem was filled successfully, false otherwise. The passed container will have been modified to accomodate for anything done in this method. New Itemstacks might have been added to the players inventory.
* @return True if the IFluidContainerItem was filled successfully, false otherwise. The passed container will have been modified to accommodate for anything done in this method. New Itemstacks might have been added to the players inventory.
*/
public static boolean tryFillFluidContainerItem(ItemStack container, IFluidHandler tank, EnumFacing side, EntityPlayer player)
{
@ -219,7 +219,7 @@ public class FluidUtil
* @param inventory An inventory where any additionally created item (filled container if multiple empty are present) are put
* @param max Maximum amount to take from the tank. Uses IFluidContainerItem capacity if <= 0
* @param player The player that gets the items the inventory can't take. Can be null, only used if the inventory cannot take the filled stack.
* @return True if the IFluidContainerItem was filled successfully, false otherwise. The passed container will have been modified to accomodate for anything done in this method. New Itemstacks might have been added to the players inventory.
* @return True if the IFluidContainerItem was filled successfully, false otherwise. The passed container will have been modified to accommodate for anything done in this method. New Itemstacks might have been added to the players inventory.
*/
public static boolean tryFillFluidContainerItem(ItemStack container, IFluidHandler tank, EnumFacing side, IItemHandler inventory, int max, EntityPlayer player)
{
@ -392,7 +392,7 @@ public class FluidUtil
return false;
}
private static boolean insertItemIntoo(ItemStack stack, IInventory inventory, World world, BlockPos pos, boolean isCreative)
private static boolean insertItemInto(ItemStack stack, IInventory inventory, World world, BlockPos pos, boolean isCreative)
{
if (stack == null)
{
@ -545,8 +545,8 @@ public class FluidUtil
{
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Adding item to inventory");
CrashReportCategory crashreportcategory = crashreport.makeCategory("Item being added");
crashreportcategory.addCrashSection("Item ID", Integer.valueOf(Item.getIdFromItem(itemstack.getItem())));
crashreportcategory.addCrashSection("Item data", Integer.valueOf(itemstack.getMetadata()));
crashreportcategory.addCrashSection("Item ID", Item.getIdFromItem(itemstack.getItem()));
crashreportcategory.addCrashSection("Item data", itemstack.getMetadata());
crashreportcategory.addCrashSectionCallable("Item name", new Callable<String>()
{
public String call() throws Exception

View File

@ -43,7 +43,7 @@ public abstract class CustomModLoadingErrorDisplayException extends EnhancedRunt
private static final long serialVersionUID = 1L;
/**
* Called after the GUI is inited by the parent code. You can do extra stuff here, maybe?
* Called after the GUI is initialized by the parent code. You can do extra stuff here, maybe?
*
* @param errorScreen The error screen we're painting
* @param fontRenderer A font renderer for you

View File

@ -186,7 +186,7 @@ public class FMLClientHandler implements IFMLSidedHandler
* @param resourceManager The resource manager
*/
@SuppressWarnings("unchecked")
public void beginMinecraftLoading(Minecraft minecraft, @SuppressWarnings("rawtypes") List resourcePackList, IReloadableResourceManager resourceManager)
public void beginMinecraftLoading(Minecraft minecraft, List<IResourcePack> resourcePackList, IReloadableResourceManager resourceManager)
{
detectOptifine();
SplashProgress.start();
@ -626,7 +626,7 @@ public class FMLClientHandler implements IFMLSidedHandler
@Override
public void serverStopped()
{
// If the server crashes during startup, it might hang the client- reset the client so it can abend properly.
// If the server crashes during startup, it might hang the client - reset the client so it can abend properly.
MinecraftServer server = getServer();
if (server != null && !server.serverIsInRunLoop())
@ -693,7 +693,7 @@ public class FMLClientHandler implements IFMLSidedHandler
{
try
{
client.launchIntegratedServer(comparator.getFileName(), comparator.getDisplayName(), (WorldSettings)null);
client.launchIntegratedServer(comparator.getFileName(), comparator.getDisplayName(), null);
}
catch (StartupQuery.AbortedException e)
{
@ -735,7 +735,7 @@ public class FMLClientHandler implements IFMLSidedHandler
String type = jsonData.get("type").getAsString();
JsonArray modDataArray = jsonData.get("modList").getAsJsonArray();
boolean moddedClientAllowed = jsonData.has("clientModsAllowed") ? jsonData.get("clientModsAllowed").getAsBoolean() : true;
Builder<String, String> modListBldr = ImmutableMap.<String,String>builder();
Builder<String, String> modListBldr = ImmutableMap.builder();
for (JsonElement obj : modDataArray)
{
JsonObject modObj = obj.getAsJsonObject();

View File

@ -247,7 +247,7 @@ public class GuiModList extends GuiScreen
if (type != null)
{
for (GuiButton b : (List<GuiButton>)buttonList)
for (GuiButton b : buttonList)
{
if (SortType.getTypeForButton(b) != null)
{
@ -414,7 +414,7 @@ public class GuiModList extends GuiScreen
lines.add("Child mods: " + selectedMod.getMetadata().getChildModList());
if (vercheck.status == Status.OUTDATED || vercheck.status == Status.BETA_OUTDATED)
lines.add("Update Avalible: " + (vercheck.url == null ? "" : vercheck.url));
lines.add("Update Available: " + (vercheck.url == null ? "" : vercheck.url));
lines.add(null);
lines.add(selectedMod.getMetadata().description);
@ -567,7 +567,7 @@ public class GuiModList extends GuiScreen
if (line != null)
{
int k = -4;
for (ITextComponent part : (Iterable<ITextComponent>)line) {
for (ITextComponent part : line) {
if (!(part instanceof TextComponentString))
continue;
k += GuiModList.this.fontRendererObj.getStringWidth(((TextComponentString)part).getChatComponentText_TextValue());

View File

@ -6,12 +6,10 @@ import java.io.IOException;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiLabel;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiWorldSelection;
import net.minecraft.client.gui.GuiYesNo;
import net.minecraft.client.gui.GuiYesNoCallback;
import net.minecraft.world.WorldSettings;
import net.minecraftforge.fml.common.FMLLog;
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
import net.minecraftforge.fml.common.StartupQuery;
import net.minecraftforge.fml.common.ZipperUtil;
@ -44,12 +42,12 @@ public class GuiOldSaveLoadConfirm extends GuiYesNo implements GuiYesNoCallback
for (k = 0; k < this.buttonList.size(); ++k)
{
((GuiButton)this.buttonList.get(k)).drawButton(this.mc, mouseX, mouseY);
this.buttonList.get(k).drawButton(this.mc, mouseX, mouseY);
}
for (k = 0; k < this.labelList.size(); ++k)
{
((GuiLabel)this.labelList.get(k)).drawLabel(this.mc, mouseX, mouseY);
this.labelList.get(k).drawLabel(this.mc, mouseX, mouseY);
}
}
@Override
@ -84,7 +82,7 @@ public class GuiOldSaveLoadConfirm extends GuiYesNo implements GuiYesNoCallback
try
{
mc.launchIntegratedServer(dirName, saveName, (WorldSettings)null);
mc.launchIntegratedServer(dirName, saveName, null);
}
catch (StartupQuery.AbortedException e)
{

View File

@ -129,7 +129,8 @@ public abstract class GuiScrollingList
return x >= left && x <= right && entryIndex >= 0 && relativeY >= 0 && entryIndex < this.getSize() ? entryIndex : -1;
}
public void registerScrollButtons(@SuppressWarnings("rawtypes") List buttons, int upActionID, int downActionID)
// FIXME: is this correct/still needed?
public void registerScrollButtons(List<GuiButton> buttons, int upActionID, int downActionID)
{
this.scrollUpActionId = upActionID;
this.scrollDownActionId = downActionID;

View File

@ -1,55 +1,7 @@
package net.minecraftforge.fml.client;
import static org.lwjgl.opengl.GL11.GL_ALPHA_TEST;
import static org.lwjgl.opengl.GL11.GL_BLEND;
import static org.lwjgl.opengl.GL11.GL_COLOR_BUFFER_BIT;
import static org.lwjgl.opengl.GL11.GL_DEPTH_TEST;
import static org.lwjgl.opengl.GL11.GL_GREATER;
import static org.lwjgl.opengl.GL11.GL_LEQUAL;
import static org.lwjgl.opengl.GL11.GL_LIGHTING;
import static org.lwjgl.opengl.GL11.GL_MODELVIEW;
import static org.lwjgl.opengl.GL11.GL_NEAREST;
import static org.lwjgl.opengl.GL11.GL_ONE_MINUS_SRC_ALPHA;
import static org.lwjgl.opengl.GL11.GL_PROJECTION;
import static org.lwjgl.opengl.GL11.GL_QUADS;
import static org.lwjgl.opengl.GL11.GL_RENDERER;
import static org.lwjgl.opengl.GL11.GL_RGBA;
import static org.lwjgl.opengl.GL11.GL_SRC_ALPHA;
import static org.lwjgl.opengl.GL11.GL_TEXTURE_2D;
import static org.lwjgl.opengl.GL11.GL_TEXTURE_MAG_FILTER;
import static org.lwjgl.opengl.GL11.GL_TEXTURE_MIN_FILTER;
import static org.lwjgl.opengl.GL11.GL_VENDOR;
import static org.lwjgl.opengl.GL11.GL_VERSION;
import static org.lwjgl.opengl.GL11.glAlphaFunc;
import static org.lwjgl.opengl.GL11.glBegin;
import static org.lwjgl.opengl.GL11.glBindTexture;
import static org.lwjgl.opengl.GL11.glBlendFunc;
import static org.lwjgl.opengl.GL11.glClear;
import static org.lwjgl.opengl.GL11.glClearColor;
import static org.lwjgl.opengl.GL11.glColor3ub;
import static org.lwjgl.opengl.GL11.glDeleteTextures;
import static org.lwjgl.opengl.GL11.glDepthFunc;
import static org.lwjgl.opengl.GL11.glDisable;
import static org.lwjgl.opengl.GL11.glEnable;
import static org.lwjgl.opengl.GL11.glEnd;
import static org.lwjgl.opengl.GL11.glGenTextures;
import static org.lwjgl.opengl.GL11.glGetString;
import static org.lwjgl.opengl.GL11.glLoadIdentity;
import static org.lwjgl.opengl.GL11.glMatrixMode;
import static org.lwjgl.opengl.GL11.glOrtho;
import static org.lwjgl.opengl.GL11.glPopMatrix;
import static org.lwjgl.opengl.GL11.glPushMatrix;
import static org.lwjgl.opengl.GL11.glRotatef;
import static org.lwjgl.opengl.GL11.glScalef;
import static org.lwjgl.opengl.GL11.glTexCoord2f;
import static org.lwjgl.opengl.GL11.glTexImage2D;
import static org.lwjgl.opengl.GL11.glTexParameteri;
import static org.lwjgl.opengl.GL11.glTexSubImage2D;
import static org.lwjgl.opengl.GL11.glTranslatef;
import static org.lwjgl.opengl.GL11.glVertex2f;
import static org.lwjgl.opengl.GL11.glViewport;
import static org.lwjgl.opengl.GL12.GL_BGRA;
import static org.lwjgl.opengl.GL12.GL_UNSIGNED_INT_8_8_8_8_REV;
import static org.lwjgl.opengl.GL11.*;
import static org.lwjgl.opengl.GL12.*;
import java.awt.image.BufferedImage;
import java.io.File;
@ -60,7 +12,6 @@ import java.io.InputStream;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.lang.Thread.UncaughtExceptionHandler;
import java.nio.ByteBuffer;
import java.nio.IntBuffer;
import java.util.Iterator;
import java.util.Properties;
@ -99,7 +50,6 @@ import org.lwjgl.BufferUtils;
import org.lwjgl.LWJGLException;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.Drawable;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.SharedDrawable;
import org.lwjgl.util.glu.GLU;
@ -503,8 +453,8 @@ public class SplashProgress
if (max_texture_size != -1) return max_texture_size;
for (int i = 0x4000; i > 0; i >>= 1)
{
GlStateManager.glTexImage2D(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_RGBA, i, i, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (IntBuffer)null);
if (GlStateManager.glGetTexLevelParameteri(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_TEXTURE_WIDTH) != 0)
GlStateManager.glTexImage2D(GL_PROXY_TEXTURE_2D, 0, GL_RGBA, i, i, 0, GL_RGBA, GL_UNSIGNED_BYTE, null);
if (GlStateManager.glGetTexLevelParameteri(GL_PROXY_TEXTURE_2D, 0, GL_TEXTURE_WIDTH) != 0)
{
max_texture_size = i;
return i;
@ -599,7 +549,7 @@ public class SplashProgress
{
stream.println("SplashProgress has detected a error loading Minecraft.");
stream.println("This can sometimes be caused by bad video drivers.");
stream.println("We have automatically disabeled the new Splash Screen in config/splash.properties.");
stream.println("We have automatically disabled the new Splash Screen in config/splash.properties.");
stream.println("Try reloading minecraft before reporting any errors.");
}
};
@ -613,7 +563,7 @@ public class SplashProgress
{
stream.println("SplashProgress has detected a error loading Minecraft.");
stream.println("This can sometimes be caused by bad video drivers.");
stream.println("Please try disabeling the new Splash Screen in config/splash.properties.");
stream.println("Please try disabling the new Splash Screen in config/splash.properties.");
stream.println("After doing so, try reloading minecraft before reporting any errors.");
}
};
@ -835,7 +785,7 @@ public class SplashProgress
public static void checkGLError(String where)
{
int err = GL11.glGetError();
int err = glGetError();
if (err != 0)
{
throw new IllegalStateException(where + ": " + GLU.gluErrorString(err));

View File

@ -54,13 +54,13 @@ public class DummyConfigElement implements IConfigElement
/**
* This class provides a Dummy Category IConfigElement. It can be used to define a custom list of GUI entries that will
* appear on the child screen or to specify a custom IGuiConfigListEntryfor a special category.
* appear on the child screen or to specify a custom IGuiConfigListEntry for a special category.
*/
public static class DummyCategoryElement extends DummyConfigElement
{
public DummyCategoryElement(String name, String langKey, List<IConfigElement> childElements)
{
this(name, langKey, childElements, (Class<? extends IConfigEntry>) null);
this(name, langKey, childElements, null);
}
public DummyCategoryElement(String name, String langKey, Class<? extends IConfigEntry> customListEntryClass)
@ -70,7 +70,7 @@ public class DummyConfigElement implements IConfigElement
public DummyCategoryElement(String name, String langKey, List<IConfigElement> childElements, Class<? extends IConfigEntry> customListEntryClass)
{
super(name, (Object) null, ConfigGuiType.CONFIG_CATEGORY, langKey);
super(name, null, ConfigGuiType.CONFIG_CATEGORY, langKey);
this.childElements = childElements;
this.configEntryClass = customListEntryClass;
isProperty = false;
@ -84,7 +84,7 @@ public class DummyConfigElement implements IConfigElement
{
public DummyListElement(String name, Object[] defaultValues, ConfigGuiType type, String langKey, boolean isListFixedLength, int maxListLength, Pattern validStringPattern, Object minValue, Object maxValue)
{
super(name, (Object) null, type, langKey, minValue, maxValue);
super(name, null, type, langKey, minValue, maxValue);
this.defaultValues = defaultValues;
this.values = defaultValues;
this.isListFixedLength = isListFixedLength;
@ -95,52 +95,52 @@ public class DummyConfigElement implements IConfigElement
public DummyListElement(String name, Object[] defaultValues, ConfigGuiType type, String langKey)
{
this(name, defaultValues, type, langKey, false, -1, (Pattern) null, (Object) null, (Object) null);
this(name, defaultValues, type, langKey, false, -1, null, null, null);
}
public DummyListElement(String name, Object[] defaultValues, ConfigGuiType type, String langKey, boolean isListFixedLength)
{
this(name, defaultValues, type, langKey, isListFixedLength, -1, (Pattern) null, (Object) null, (Object) null);
this(name, defaultValues, type, langKey, isListFixedLength, -1, null, null, null);
}
public DummyListElement(String name, Object[] defaultValues, ConfigGuiType type, String langKey, int maxListLength)
{
this(name, defaultValues, type, langKey, false, maxListLength, (Pattern) null, (Object) null, (Object) null);
this(name, defaultValues, type, langKey, false, maxListLength, null, null, null);
}
public DummyListElement(String name, Object[] defaultValues, ConfigGuiType type, String langKey, Object minValue, Object maxValue)
{
this(name, defaultValues, type, langKey, false, -1, (Pattern) null, minValue, maxValue);
this(name, defaultValues, type, langKey, false, -1, null, minValue, maxValue);
}
public DummyListElement(String name, Object[] defaultValues, ConfigGuiType type, String langKey, boolean isListFixedLength, Object minValue, Object maxValue)
{
this(name, defaultValues, type, langKey, isListFixedLength, -1, (Pattern) null, minValue, maxValue);
this(name, defaultValues, type, langKey, isListFixedLength, -1, null, minValue, maxValue);
}
public DummyListElement(String name, Object[] defaultValues, ConfigGuiType type, String langKey, int maxListLength, Object minValue, Object maxValue)
{
this(name, defaultValues, type, langKey, false, maxListLength, (Pattern) null, minValue, maxValue);
this(name, defaultValues, type, langKey, false, maxListLength, null, minValue, maxValue);
}
public DummyListElement(String name, Object[] defaultValues, ConfigGuiType type, String langKey, boolean isListFixedLength, int maxListLength, Object minValue, Object maxValue)
{
this(name, defaultValues, type, langKey, isListFixedLength, maxListLength, (Pattern) null, minValue, maxValue);
this(name, defaultValues, type, langKey, isListFixedLength, maxListLength, null, minValue, maxValue);
}
public DummyListElement(String name, Object[] defaultValues, ConfigGuiType type, String langKey, Pattern validStringPattern)
{
this(name, defaultValues, type, langKey, false, -1, validStringPattern, (Object) null, (Object) null);
this(name, defaultValues, type, langKey, false, -1, validStringPattern, null, null);
}
public DummyListElement(String name, Object[] defaultValues, ConfigGuiType type, String langKey, boolean isListFixedLength, Pattern validStringPattern)
{
this(name, defaultValues, type, langKey, isListFixedLength, -1, validStringPattern, (Object) null, (Object) null);
this(name, defaultValues, type, langKey, isListFixedLength, -1, validStringPattern, null, null);
}
public DummyListElement(String name, Object[] defaultValues, ConfigGuiType type, String langKey, int maxListLength, Pattern validStringPattern)
{
this(name, defaultValues, type, langKey, false, maxListLength, validStringPattern, (Object) null, (Object) null);
this(name, defaultValues, type, langKey, false, maxListLength, validStringPattern, null, null);
}
public DummyListElement setCustomEditListEntryClass(Class<? extends IArrayEntry> clazz)
@ -168,18 +168,18 @@ public class DummyConfigElement implements IConfigElement
if (minValue == null)
{
if (type == ConfigGuiType.INTEGER)
this.minValue = (Integer) Integer.MIN_VALUE;
this.minValue = Integer.MIN_VALUE;
else if (type == ConfigGuiType.DOUBLE)
this.minValue = (Double) (-Double.MAX_VALUE);
this.minValue = -Double.MAX_VALUE;
}
else
this.minValue = minValue;
if (maxValue == null)
{
if (type == ConfigGuiType.INTEGER)
this.maxValue = (Integer) Integer.MAX_VALUE;
this.maxValue = Integer.MAX_VALUE;
else if (type == ConfigGuiType.DOUBLE)
this.maxValue = (Double) Double.MAX_VALUE;
this.maxValue = Double.MAX_VALUE;
}
else
this.maxValue = maxValue;
@ -187,22 +187,22 @@ public class DummyConfigElement implements IConfigElement
public DummyConfigElement(String name, Object defaultValue, ConfigGuiType type, String langKey, Pattern validStringPattern)
{
this(name, defaultValue, type, langKey, (String[]) null, validStringPattern, (Object) null, (Object) null);
this(name, defaultValue, type, langKey, null, validStringPattern, null, null);
}
public DummyConfigElement(String name, Object defaultValue, ConfigGuiType type, String langKey, String[] validValues)
{
this(name, defaultValue, type, langKey, validValues, (Pattern) null, (Object) null, (Object) null);
this(name, defaultValue, type, langKey, validValues, null, null, null);
}
public DummyConfigElement(String name, Object defaultValue, ConfigGuiType type, String langKey)
{
this(name, defaultValue, type, langKey, (String[]) null, (Pattern) null, (Object) null, (Object) null);
this(name, defaultValue, type, langKey, null, null, null, null);
}
public DummyConfigElement(String name, Object defaultValue, ConfigGuiType type, String langKey, Object minValue, Object maxValue)
{
this(name, defaultValue, type, langKey, (String[]) null, (Pattern) null, minValue, maxValue);
this(name, defaultValue, type, langKey, null, null, minValue, maxValue);
}
public DummyConfigElement setCustomListEntryClass(Class<? extends IConfigEntry> clazz)

View File

@ -325,9 +325,9 @@ public class GuiConfig extends GuiScreen
if (title2 != null)
{
int strWidth = mc.fontRendererObj.getStringWidth(title2);
int elipsisWidth = mc.fontRendererObj.getStringWidth("...");
if (strWidth > width - 6 && strWidth > elipsisWidth)
title2 = mc.fontRendererObj.trimStringToWidth(title2, width - 6 - elipsisWidth).trim() + "...";
int ellipsisWidth = mc.fontRendererObj.getStringWidth("...");
if (strWidth > width - 6 && strWidth > ellipsisWidth)
title2 = mc.fontRendererObj.trimStringToWidth(title2, width - 6 - ellipsisWidth).trim() + "...";
this.drawCenteredString(this.fontRendererObj, title2, this.width / 2, 18, 16777215);
}

View File

@ -114,7 +114,7 @@ public class GuiConfigEntries extends GuiListExtended
if (configElement.getConfigEntryClass() != null)
try
{
this.listEntries.add((IConfigEntry) configElement.getConfigEntryClass()
this.listEntries.add(configElement.getConfigEntryClass()
.getConstructor(GuiConfig.class, GuiConfigEntries.class, IConfigElement.class)
.newInstance(this.owningScreen, this, configElement));
}

View File

@ -128,7 +128,7 @@ public class GuiEditArrayEntries extends GuiListExtended
public void addNewEntry(int index)
{
if (configElement.isList() && configElement.getType() == ConfigGuiType.BOOLEAN)
listEntries.add(index, new BooleanEntry(this.owningGui, this, this.configElement, Boolean.valueOf(true)));
listEntries.add(index, new BooleanEntry(this.owningGui, this, this.configElement, true));
else if (configElement.isList() && configElement.getType() == ConfigGuiType.INTEGER)
listEntries.add(index, new IntegerEntry(this.owningGui, this, this.configElement, 0));
else if (configElement.isList() && configElement.getType() == ConfigGuiType.DOUBLE)
@ -519,7 +519,7 @@ public class GuiEditArrayEntries extends GuiListExtended
@Override
public Object getValue()
{
return Boolean.valueOf(value);
return value;
}
}

View File

@ -20,6 +20,6 @@ public class GuiMessageDialog extends GuiDisconnected
public void initGui()
{
super.initGui();
((GuiButton) buttonList.get(0)).displayString = I18n.format(buttonText);
buttonList.get(0).displayString = I18n.format(buttonText);
}
}

View File

@ -59,11 +59,11 @@ public class GuiUnicodeGlyphButton extends GuiButtonExt
String buttonText = this.displayString;
int glyphWidth = (int) (mc.fontRendererObj.getStringWidth(glyph) * glyphScale);
int strWidth = mc.fontRendererObj.getStringWidth(buttonText);
int elipsisWidth = mc.fontRendererObj.getStringWidth("...");
int ellipsisWidth = mc.fontRendererObj.getStringWidth("...");
int totalWidth = strWidth + glyphWidth;
if (totalWidth > width - 6 && totalWidth > elipsisWidth)
buttonText = mc.fontRendererObj.trimStringToWidth(buttonText, width - 6 - elipsisWidth).trim() + "...";
if (totalWidth > width - 6 && totalWidth > ellipsisWidth)
buttonText = mc.fontRendererObj.trimStringToWidth(buttonText, width - 6 - ellipsisWidth).trim() + "...";
strWidth = mc.fontRendererObj.getStringWidth(buttonText);
totalWidth = glyphWidth + strWidth;

View File

@ -57,7 +57,7 @@ public class ClientRegistry
/**
* Register a shader for an entity. This shader gets activated when a spectator begins spectating an entity.
* Vanilla examples of this are the green effect for creepers and the invert effect for endermans.
* Vanilla examples of this are the green effect for creepers and the invert effect for endermen.
*
* @param entityClass
* @param shader

View File

@ -215,7 +215,7 @@ public class FMLCommonHandler
{
if (brandings == null)
{
Builder<String> brd = ImmutableList.<String>builder();
Builder<String> brd = ImmutableList.builder();
brd.add(Loader.instance().getMCVersionString());
brd.add(Loader.instance().getMCPVersionString());
brd.add("Powered by Forge " + ForgeVersion.getVersion());
@ -691,7 +691,7 @@ public class FMLCommonHandler
}
/**
* Loads a lang file, first searching for a marker to enable the 'extended' format {escape charaters}
* Loads a lang file, first searching for a marker to enable the 'extended' format {escape characters}
* If the marker is not found it simply returns and let the vanilla code load things.
* The Marker is 'PARSE_ESCAPES' by itself on a line starting with '#' as such:
* #PARSE_ESCAPES

View File

@ -35,7 +35,6 @@ import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.network.NetworkCheckHandler;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.network.internal.FMLNetworkHandler;
import net.minecraftforge.fml.common.registry.GameData;
import net.minecraftforge.fml.common.registry.PersistentRegistryManager;
import net.minecraftforge.fml.common.registry.VillagerRegistry;
import net.minecraftforge.fml.relauncher.Side;

View File

@ -167,7 +167,7 @@ public class FMLModContainer implements ModContainer
if (descriptor.containsKey("useMetadata"))
{
overridesMetadata = !((Boolean)descriptor.get("useMetadata")).booleanValue();
overridesMetadata = !((Boolean)descriptor.get("useMetadata"));
}
if (overridesMetadata || !modMetadata.useDependencyInformation)
@ -400,7 +400,7 @@ public class FMLModContainer implements ModContainer
});
}
private void parseSimpleFieldAnnotation(SetMultimap<String, ASMData> annotations, String annotationClassName, Function<ModContainer, Object> retreiver) throws IllegalAccessException
private void parseSimpleFieldAnnotation(SetMultimap<String, ASMData> annotations, String annotationClassName, Function<ModContainer, Object> retriever) throws IllegalAccessException
{
String[] annName = annotationClassName.split("\\.");
String annotationName = annName[annName.length - 1];
@ -431,7 +431,7 @@ public class FMLModContainer implements ModContainer
f = clz.getDeclaredField(targets.getObjectName());
f.setAccessible(true);
isStatic = Modifier.isStatic(f.getModifiers());
injectedMod = retreiver.apply(mc);
injectedMod = retriever.apply(mc);
}
catch (Exception e)
{
@ -473,7 +473,7 @@ public class FMLModContainer implements ModContainer
{
len = certificates.length;
}
Builder<String> certBuilder = ImmutableList.<String>builder();
Builder<String> certBuilder = ImmutableList.builder();
for (int i = 0; i < len; i++)
{
certBuilder.add(CertificateHelper.getFingerprint(certificates[i]));
@ -508,7 +508,7 @@ public class FMLModContainer implements ModContainer
List<Map<String, Object>> props = (List<Map<String, Object>>)descriptor.get("customProperties");
if (props != null)
{
com.google.common.collect.ImmutableMap.Builder<String, String> builder = ImmutableMap.<String, String>builder();
com.google.common.collect.ImmutableMap.Builder<String, String> builder = ImmutableMap.builder();
for (Map<String, Object> p : props)
{
builder.put((String)p.get("k"), (String)p.get("v"));
@ -663,7 +663,7 @@ public class FMLModContainer implements ModContainer
{
return false;
}
return value.booleanValue();
return value;
}
@Override

View File

@ -55,7 +55,7 @@ public interface ILanguageAdapter {
catch (ClassNotFoundException e)
{
// Not a singleton, look for @Instance field as a fallback.
FMLLog.log(Level.INFO, e, "An error occured trying to load a proxy into %s.%s. Did you declare your mod as 'class' instead of 'object'?", proxyTarget.getSimpleName(), target.getName());
FMLLog.log(Level.INFO, e, "An error occurred trying to load a proxy into %s.%s. Did you declare your mod as 'class' instead of 'object'?", proxyTarget.getSimpleName(), target.getName());
return;
}
@ -91,7 +91,7 @@ public interface ILanguageAdapter {
}
catch (InvocationTargetException e)
{
FMLLog.log(Level.ERROR, e, "An error occured trying to load a proxy into %s.%s", proxyTarget.getSimpleName(), target.getName());
FMLLog.log(Level.ERROR, e, "An error occurred trying to load a proxy into %s.%s", proxyTarget.getSimpleName(), target.getName());
throw new LoaderException(e);
}
@ -148,7 +148,7 @@ public interface ILanguageAdapter {
setProxy(target, proxyTarget, proxy);
}
catch (Exception e) {
FMLLog.log(Level.ERROR, e, "An error occured trying to load a proxy into %s.%s", proxyTarget.getSimpleName(), target.getName());
FMLLog.log(Level.ERROR, e, "An error occurred trying to load a proxy into %s.%s", proxyTarget.getSimpleName(), target.getName());
throw new LoaderException(e);
}
}

View File

@ -237,7 +237,7 @@ public class LoadController
public ImmutableBiMap<ModContainer, Object> buildModObjectList()
{
ImmutableBiMap.Builder<ModContainer, Object> builder = ImmutableBiMap.<ModContainer, Object>builder();
ImmutableBiMap.Builder<ModContainer, Object> builder = ImmutableBiMap.builder();
for (ModContainer mc : activeModList)
{
if (!mc.isImmutable() && mc.getMod()!=null)
@ -265,7 +265,7 @@ public class LoadController
{
if (exception instanceof InvocationTargetException)
{
errors.put(modContainer.getModId(), ((InvocationTargetException)exception).getCause());
errors.put(modContainer.getModId(), exception.getCause());
}
else
{

View File

@ -340,7 +340,7 @@ public class Loader
}
catch (Exception e)
{
FMLLog.log(Level.ERROR, e, "A problem occured instantiating the injected mod container %s", cont);
FMLLog.log(Level.ERROR, e, "A problem occurred instantiating the injected mod container %s", cont);
throw new LoaderException(e);
}
mods.add(new InjectedModContainer(mc,mc.getSource()));

View File

@ -104,7 +104,7 @@ public @interface Mod
/**
* The acceptable range of minecraft versions that this mod will load and run in
* The default ("empty string") indicates that the currently RUNNING minecraft version is acceptable.
* This means ANY version that the end user adds the mod to. Modders PLEASS set this.
* This means ANY version that the end user adds the mod to. Modders PLEASE set this.
* FML will refuse to run with an error if the minecraft version is not in this range across all mods.
* @return A version range as specified by the maven version range specification or the empty string
*/

View File

@ -77,7 +77,7 @@ public class ProxyInjector
}
catch (Exception e)
{
FMLLog.log(Level.ERROR, e, "An error occured trying to load a proxy into %s.%s", targ.getAnnotationInfo(), targ.getClassName(), targ.getObjectName());
FMLLog.log(Level.ERROR, e, "An error occurred trying to load a proxy into %s.%s", targ.getAnnotationInfo(), targ.getClassName(), targ.getObjectName());
throw new LoaderException(e);
}
}

View File

@ -219,7 +219,7 @@ public class AccessTransformer implements IClassTransformer
}
else
{
List<MethodNode> nowOverridable = Lists.newArrayList();
List<MethodNode> nowOverrideable = Lists.newArrayList();
for (MethodNode n : classNode.methods)
{
if ((n.name.equals(m.name) && n.desc.equals(m.desc)) || m.name.equals("*"))
@ -236,7 +236,7 @@ public class AccessTransformer implements IClassTransformer
if (wasPrivate && !isNowPrivate)
{
nowOverridable.add(n);
nowOverrideable.add(n);
}
}
@ -253,7 +253,7 @@ public class AccessTransformer implements IClassTransformer
}
}
replaceInvokeSpecial(classNode, nowOverridable);
replaceInvokeSpecial(classNode, nowOverrideable);
}
}
@ -356,7 +356,7 @@ public class AccessTransformer implements IClassTransformer
if (!hasTransformer)
{
System.out.println("Culd not find a valid transformer to perform");
System.out.println("Could not find a valid transformer to perform");
System.exit(1);
}

View File

@ -27,7 +27,7 @@ public class DeobfuscationTransformer implements IClassTransformer, IClassNameTr
private static final int WRITER_FLAGS = ClassWriter.COMPUTE_MAXS | (RECALC_FRAMES ? ClassWriter.COMPUTE_FRAMES : 0);
private static final int READER_FLAGS = RECALC_FRAMES ? ClassReader.SKIP_FRAMES : ClassReader.EXPAND_FRAMES;
// COMPUTE_FRAMES causes classes to be loaded, which could cause issues if the classes do not exist.
// However in testing this has not happened. {As we run post SideTransfromer}
// However in testing this has not happened. {As we run post SideTransformer}
// If reported we need to add a custom implementation of ClassWriter.getCommonSuperClass
// that does not cause class loading.

View File

@ -35,7 +35,7 @@ public class EventSubscriberTransformer implements IClassTransformer
{
if (Modifier.isPrivate(methodNode.access))
{
String msg = "Cannot apply @SubsribeEvent to private method %s/%s%s";
String msg = "Cannot apply @SubscribeEvent to private method %s/%s%s";
throw new RuntimeException(String.format(msg, classNode.name, methodNode.name, methodNode.desc));
}

View File

@ -105,7 +105,7 @@ public class EventSubscriptionTransformer implements IClassTransformer
String listDesc = tList.getDescriptor();
String listDescM = Type.getMethodDescriptor(tList);
for (MethodNode method : (List<MethodNode>)classNode.methods)
for (MethodNode method : classNode.methods)
{
if (method.name.equals("setup") && method.desc.equals(voidDesc) && (method.access & ACC_PROTECTED) == ACC_PROTECTED) hasSetup = true;
if ((method.access & ACC_PUBLIC) == ACC_PUBLIC)
@ -195,10 +195,10 @@ public class EventSubscriptionTransformer implements IClassTransformer
method.instructions.add(new VarInsnNode(ALOAD, 0));
method.instructions.add(new MethodInsnNode(INVOKESPECIAL, tSuper.getInternalName(), "setup", voidDesc, false));
method.instructions.add(new FieldInsnNode(GETSTATIC, classNode.name, "LISTENER_LIST", listDesc));
LabelNode initLisitener = new LabelNode();
method.instructions.add(new JumpInsnNode(IFNULL, initLisitener));
LabelNode initListener = new LabelNode();
method.instructions.add(new JumpInsnNode(IFNULL, initListener));
method.instructions.add(new InsnNode(RETURN));
method.instructions.add(initLisitener);
method.instructions.add(initListener);
method.instructions.add(new FrameNode(F_SAME, 0, null, 0, null));
method.instructions.add(new TypeInsnNode(NEW, tList.getInternalName()));
method.instructions.add(new InsnNode(DUP));

View File

@ -143,7 +143,7 @@ public class MarkerTransformer implements IClassTransformer
if (!hasTransformer)
{
System.out.println("Culd not find a valid transformer to perform");
System.out.println("Could not find a valid transformer to perform");
return;
}

View File

@ -63,7 +63,7 @@ public class ModAPITransformer implements IClassTransformer {
}
else
{
stripMethod(classNode, (String)optional.getObjectName());
stripMethod(classNode, optional.getObjectName());
}
}

View File

@ -40,7 +40,7 @@ public class SideTransformer implements IClassTransformer
ClassReader classReader = new ClassReader(bytes);
classReader.accept(classNode, 0);
if (remove((List<AnnotationNode>)classNode.visibleAnnotations, SIDE))
if (remove(classNode.visibleAnnotations, SIDE))
{
if (DEBUG)
{
@ -53,7 +53,7 @@ public class SideTransformer implements IClassTransformer
while(fields.hasNext())
{
FieldNode field = fields.next();
if (remove((List<AnnotationNode>)field.visibleAnnotations, SIDE))
if (remove(field.visibleAnnotations, SIDE))
{
if (DEBUG)
{
@ -66,7 +66,7 @@ public class SideTransformer implements IClassTransformer
while(methods.hasNext())
{
MethodNode method = methods.next();
if (remove((List<AnnotationNode>)method.visibleAnnotations, SIDE))
if (remove(method.visibleAnnotations, SIDE))
{
if (DEBUG)
{

View File

@ -64,7 +64,7 @@ public class TerminalTransformer implements IClassTransformer
{
FMLRelaunchLog.warning("=============================================================");
FMLRelaunchLog.warning("MOD HAS DIRECT REFERENCE System.exit() THIS IS NOT ALLOWED REROUTING TO FML!");
FMLRelaunchLog.warning("Offendor: %s.%s%s", ExitVisitor.this.clsName, mName, mDesc);
FMLRelaunchLog.warning("Offender: %s.%s%s", ExitVisitor.this.clsName, mName, mDesc);
FMLRelaunchLog.warning("Use FMLCommonHandler.exitJava instead");
FMLRelaunchLog.warning("=============================================================");
}
@ -77,7 +77,7 @@ public class TerminalTransformer implements IClassTransformer
{
FMLRelaunchLog.warning("=============================================================");
FMLRelaunchLog.warning("MOD HAS DIRECT REFERENCE Runtime.exit() THIS IS NOT ALLOWED REROUTING TO FML!");
FMLRelaunchLog.warning("Offendor: %s.%s%s", ExitVisitor.this.clsName, mName, mDesc);
FMLRelaunchLog.warning("Offender: %s.%s%s", ExitVisitor.this.clsName, mName, mDesc);
FMLRelaunchLog.warning("Use FMLCommonHandler.exitJava instead");
FMLRelaunchLog.warning("=============================================================");
}

View File

@ -80,7 +80,7 @@ public class FMLDeobfuscatingRemapper extends Remapper {
List<String> srgList = srgSource.readLines();
rawMethodMaps = Maps.newHashMap();
rawFieldMaps = Maps.newHashMap();
Builder<String, String> builder = ImmutableBiMap.<String,String>builder();
Builder<String, String> builder = ImmutableBiMap.builder();
Splitter splitter = Splitter.on(CharMatcher.anyOf(": ")).omitEmptyStrings().trimResults();
for (String line : srgList)
{
@ -134,7 +134,7 @@ public class FMLDeobfuscatingRemapper extends Remapper {
rawMethodMaps = Maps.newHashMap();
rawFieldMaps = Maps.newHashMap();
Builder<String, String> builder = ImmutableBiMap.<String,String>builder();
Builder<String, String> builder = ImmutableBiMap.builder();
Splitter splitter = Splitter.on(CharMatcher.anyOf(": ")).omitEmptyStrings().trimResults();
for (String line : srgList)
{
@ -216,7 +216,7 @@ public class FMLDeobfuscatingRemapper extends Remapper {
ClassNode classNode = new ClassNode();
cr.accept(classNode, ClassReader.SKIP_CODE | ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES);
Map<String,String> resMap = Maps.newHashMap();
for (FieldNode fieldNode : (List<FieldNode>) classNode.fields) {
for (FieldNode fieldNode : classNode.fields) {
resMap.put(fieldNode.name, fieldNode.desc);
}
fieldDescriptions.put(owner, resMap);
@ -224,7 +224,7 @@ public class FMLDeobfuscatingRemapper extends Remapper {
}
catch (IOException e)
{
FMLRelaunchLog.log(Level.ERROR,e, "A critical exception occured reading a class file %s", owner);
FMLRelaunchLog.log(Level.ERROR,e, "A critical exception occurred reading a class file %s", owner);
}
return null;
}
@ -403,8 +403,8 @@ public class FMLDeobfuscatingRemapper extends Remapper {
findAndMergeSuperMaps(parentThing);
}
}
Map<String, String> methodMap = Maps.<String,String>newHashMap();
Map<String, String> fieldMap = Maps.<String,String>newHashMap();
Map<String, String> methodMap = Maps.newHashMap();
Map<String, String> fieldMap = Maps.newHashMap();
for (String parentThing : allParents)
{
if (methodNameMaps.containsKey(parentThing))

View File

@ -103,7 +103,7 @@ public class ASMDataTable
{
if (containerAnnotationData == null)
{
ImmutableMap.Builder<ModContainer, SetMultimap<String, ASMData>> mapBuilder = ImmutableMap.<ModContainer, SetMultimap<String,ASMData>>builder();
ImmutableMap.Builder<ModContainer, SetMultimap<String, ASMData>> mapBuilder = ImmutableMap.builder();
for (ModContainer cont : containers)
{
Multimap<String, ASMData> values = Multimaps.filterValues(globalAnnotationData, new ModContainerPredicate(cont));

View File

@ -35,7 +35,7 @@ import org.apache.logging.log4j.Level;
*
*/
public class FMLInterModComms {
private static final ImmutableList<IMCMessage> emptyIMCList = ImmutableList.<IMCMessage>of();
private static final ImmutableList<IMCMessage> emptyIMCList = ImmutableList.of();
private static ArrayListMultimap<String, IMCMessage> modMessages = ArrayListMultimap.create();
/**

View File

@ -71,7 +71,7 @@ public class Event
{
if (!isCancelable())
{
throw new IllegalArgumentException("Attempted to cancel a uncancelable event");
throw new IllegalArgumentException("Attempted to cancel a non cancellable event");
}
isCanceled = cancel;
}
@ -109,7 +109,7 @@ public class Event
}
/**
* Called by the base constructor, this is used by ASM generated
* event classes to setup various functionality such as the listenerlist.
* event classes to setup various functionality such as the listener list.
*/
protected void setup()
{

View File

@ -4,7 +4,7 @@ public interface IEventExceptionHandler
{
/**
* Fired when a EventListener throws an exception for the specified event on the event bus.
* After this function returns, the original Throwable will be propogated upwards.
* After this function returns, the original Throwable will be propagated upwards.
*
* @param bus The bus the event is being fired on
* @param event The event that is being fired

View File

@ -7,9 +7,9 @@ import com.google.common.collect.Lists;
public class CollectionWrapperFactory {
/**
* Return a read only cast view of the supplied ungeneric collection, based on the element type given
* Return a read only cast view of the supplied raw collection, based on the element type given
* @param coll The collection to cast
* @param elementType the supertype contained in the collection
* @param elementType the super type contained in the collection
* @return a collection asserting that type relationship
*/
public static <T> Collection<T> wrap(@SuppressWarnings("rawtypes") Collection coll, Class<T> elementType)
@ -19,9 +19,9 @@ public class CollectionWrapperFactory {
}
/**
* Return a read only cast view of the supplied ungeneric list, based on the element type given
* Return a read only cast view of the supplied raw list, based on the element type given
* @param list The list to cast
* @param elementType the supertype contained in the list
* @param elementType the super type contained in the list
* @return a list asserting that type relationship
*/
public static <T> List<T> wrap(@SuppressWarnings("rawtypes") List list, Class<T> elementType)

Some files were not shown because too many files have changed in this diff Show More