mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-20 04:09:51 +00:00
Compiler warnings pass, undeprecated SplashProgress related stuff.
This commit is contained in:
1 parent
e2818a2803
commit
5549b06f96
108 files changed
+261
-400
No files matched your search
@@ -10,7 +10,8 @@ public class Channel {
|
||||
private int[] global_volume, current_note;
|
||||
private boolean linear_periods, fast_volume_slides, key_on, silent;
|
||||
private int sample_idx, sample_frac, step, left_gain, right_gain;
|
||||
private int volume, panning, fine_tune, period, porta_period, key_add;
|
||||
@SuppressWarnings("unused") //Forge
|
||||
private int volume, panning, fine_tune, period, porta_period, key_add;
|
||||
private int tremolo_speed, tremolo_depth, tremolo_tick, tremolo_wave, tremolo_add;
|
||||
private int vibrato_speed, vibrato_depth, vibrato_tick, vibrato_wave, vibrato_add;
|
||||
private int volume_slide_param, portamento_param, retrig_param;
|
||||
|
||||
@@ -11,7 +11,7 @@ public class Envelope {
|
||||
}
|
||||
|
||||
public void set_num_points( int num_points ) {
|
||||
int point;
|
||||
//int point; Forge: Unused
|
||||
if( num_points <= 0 ) {
|
||||
num_points = 1;
|
||||
}
|
||||
|
||||
@@ -70,6 +70,7 @@ public class FastTracker2 {
|
||||
}
|
||||
|
||||
private static Pattern read_xm_pattern( DataInput data_input, int num_channels ) throws IOException {
|
||||
@SuppressWarnings("unused") //Forge
|
||||
int pattern_header_length, packing_type, num_rows, pattern_data_length;
|
||||
byte[] structure_header, pattern_header, pattern_data;
|
||||
Pattern pattern;
|
||||
|
||||
@@ -86,7 +86,7 @@ public class IBXM {
|
||||
}
|
||||
|
||||
public void seek( int sample_position ) {
|
||||
int idx;
|
||||
//int idx; Forge, Unused
|
||||
set_sequence_index( 0, 0 );
|
||||
next_tick();
|
||||
while( sample_position > tick_length_samples ) {
|
||||
|
||||
@@ -59,6 +59,7 @@ public class ScreamTracker3 {
|
||||
|
||||
public static Module load_s3m( byte[] header_96_bytes, DataInput data_input ) throws IOException {
|
||||
int num_pattern_orders, num_instruments, num_patterns, num_channels;
|
||||
@SuppressWarnings("unused") //Forge
|
||||
int flags, tracker_version, master_volume, panning, channel_config, sequence_length;
|
||||
int instrument_idx, pattern_idx, channel_idx, order_idx, panning_offset;
|
||||
boolean signed_samples, stereo_mode, default_panning;
|
||||
|
||||
@@ -113,7 +113,6 @@ public class ClientCommandHandler extends CommandHandler
|
||||
Minecraft mc = FMLClientHandler.instance().getClient();
|
||||
if (mc.currentScreen instanceof GuiChat)
|
||||
{
|
||||
@SuppressWarnings("unchecked")
|
||||
List<String> commands = getTabCompletionOptions(mc.thePlayer, leftOfCursor, mc.thePlayer.getPosition());
|
||||
if (commands != null && !commands.isEmpty())
|
||||
{
|
||||
|
||||
@@ -2,8 +2,7 @@ package net.minecraftforge.client;
|
||||
|
||||
import net.minecraft.util.Util.EnumOS;
|
||||
import net.minecraft.world.WorldSettings.GameType;
|
||||
import net.minecraft.client.settings.GameSettings.Options;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.client.settings.GameSettings.Options;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
|
||||
public class EnumHelperClient extends EnumHelper
|
||||
|
||||
@@ -16,19 +16,16 @@ import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.network.NetHandlerPlayClient;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.attributes.IAttributeInstance;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.scoreboard.Score;
|
||||
import net.minecraft.scoreboard.ScoreObjective;
|
||||
import net.minecraft.scoreboard.ScorePlayerTeam;
|
||||
import net.minecraft.scoreboard.Scoreboard;
|
||||
@@ -37,24 +34,17 @@ import net.minecraft.util.FoodStats;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StringUtils;
|
||||
import net.minecraft.world.EnumSkyBlock;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
|
||||
public class GuiIngameForge extends GuiIngame
|
||||
{
|
||||
//private static final ResourceLocation VIGNETTE = new ResourceLocation("textures/misc/vignette.png");
|
||||
private static final ResourceLocation WIDGITS = new ResourceLocation("textures/gui/widgets.png");
|
||||
//private static final ResourceLocation WIDGITS = new ResourceLocation("textures/gui/widgets.png");
|
||||
//private static final ResourceLocation PUMPKIN_BLUR = new ResourceLocation("textures/misc/pumpkinblur.png");
|
||||
|
||||
private static final int WHITE = 0xFFFFFF;
|
||||
@@ -82,7 +72,7 @@ public class GuiIngameForge extends GuiIngame
|
||||
private ScaledResolution res = null;
|
||||
private FontRenderer fontrenderer = null;
|
||||
private RenderGameOverlayEvent eventParent;
|
||||
private static final String MC_VERSION = MinecraftForge.MC_VERSION;
|
||||
//private static final String MC_VERSION = MinecraftForge.MC_VERSION;
|
||||
private GuiOverlayDebugForge debugOverlay;
|
||||
|
||||
public GuiIngameForge(Minecraft mc)
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
package net.minecraftforge.client;
|
||||
|
||||
import java.util.IdentityHashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
@@ -40,12 +38,12 @@ public class ItemModelMesherForge extends ItemModelMesher
|
||||
TIntObjectHashMap<IBakedModel> mods = models.get(item);
|
||||
if (locs == null)
|
||||
{
|
||||
locs = new TIntObjectHashMap();
|
||||
locs = new TIntObjectHashMap<ModelResourceLocation>();
|
||||
locations.put(item, locs);
|
||||
}
|
||||
if (mods == null)
|
||||
{
|
||||
mods = new TIntObjectHashMap();
|
||||
mods = new TIntObjectHashMap<IBakedModel>();
|
||||
models.put(item, mods);
|
||||
}
|
||||
locs.put(meta, location);
|
||||
@@ -64,7 +62,7 @@ public class ItemModelMesherForge extends ItemModelMesher
|
||||
}
|
||||
else
|
||||
{
|
||||
mods = new TIntObjectHashMap();
|
||||
mods = new TIntObjectHashMap<IBakedModel>();
|
||||
models.put(e.getKey(), mods);
|
||||
}
|
||||
final TIntObjectHashMap<IBakedModel> map = mods;
|
||||
|
||||
@@ -6,42 +6,10 @@
|
||||
package net.minecraftforge.client;
|
||||
|
||||
import java.util.BitSet;
|
||||
import java.util.IdentityHashMap;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumWorldBlockLayer;
|
||||
import net.minecraftforge.client.IItemRenderer.ItemRenderType;
|
||||
|
||||
public class MinecraftForgeClient
|
||||
{
|
||||
private static IdentityHashMap<Item, IItemRenderer> customItemRenderers = Maps.newIdentityHashMap();
|
||||
|
||||
/**
|
||||
* Register a custom renderer for a specific item. This can be used to
|
||||
* render the item in-world as an EntityItem, when the item is equipped, or
|
||||
* when the item is in an inventory slot.
|
||||
* @param itemID The item ID (shifted index) to handle rendering.
|
||||
* @param renderer The IItemRenderer interface that handles rendering for
|
||||
* this item.
|
||||
*/
|
||||
public static void registerItemRenderer(Item item, IItemRenderer renderer)
|
||||
{
|
||||
customItemRenderers.put(item, renderer);
|
||||
}
|
||||
|
||||
public static IItemRenderer getItemRenderer(ItemStack item, ItemRenderType type)
|
||||
{
|
||||
IItemRenderer renderer = customItemRenderers.get(item.getItem());
|
||||
if (renderer != null && renderer.handleRenderType(item, type))
|
||||
{
|
||||
return renderer;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static int getRenderPass()
|
||||
{
|
||||
return ForgeHooksClient.renderPass;
|
||||
|
||||
@@ -3,10 +3,8 @@ package net.minecraftforge.client.event;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.EntityRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event.Result;
|
||||
|
||||
/**
|
||||
* Event that hooks into EntityRenderer, allowing any feature to customize visual attributes of
|
||||
|
||||
@@ -33,9 +33,9 @@ public class GuiScreenEvent extends Event
|
||||
/**
|
||||
* The {@code buttonList} field from the GuiScreen object referenced by {@code gui}.
|
||||
*/
|
||||
public List buttonList;
|
||||
public List<GuiButton> buttonList;
|
||||
|
||||
public InitGuiEvent(GuiScreen gui, List buttonList)
|
||||
public InitGuiEvent(GuiScreen gui, List<GuiButton> buttonList)
|
||||
{
|
||||
super(gui);
|
||||
this.buttonList = buttonList;
|
||||
@@ -49,13 +49,11 @@ public class GuiScreenEvent extends Event
|
||||
* If canceled the following lines are skipped in {@code GuiScreen.setWorldAndResolution()}:<br/>
|
||||
* {@code this.buttonList.clear();}<br/>
|
||||
* {@code this.initGui();}<br/>
|
||||
*
|
||||
* @author bspkrs
|
||||
*/
|
||||
@Cancelable
|
||||
public static class Pre extends InitGuiEvent
|
||||
{
|
||||
public Pre(GuiScreen gui, List buttonList)
|
||||
public Pre(GuiScreen gui, List<GuiButton> buttonList)
|
||||
{
|
||||
super(gui, buttonList);
|
||||
}
|
||||
@@ -64,12 +62,10 @@ public class GuiScreenEvent extends Event
|
||||
/**
|
||||
* This event fires right after {@code GuiScreen.initGui()}.
|
||||
* This is a good place to alter a GuiScreen's component layout if desired.
|
||||
*
|
||||
* @author bspkrs
|
||||
*/
|
||||
public static class Post extends InitGuiEvent
|
||||
{
|
||||
public Post(GuiScreen gui, List buttonList)
|
||||
public Post(GuiScreen gui, List<GuiButton> buttonList)
|
||||
{
|
||||
super(gui, buttonList);
|
||||
}
|
||||
@@ -102,8 +98,6 @@ public class GuiScreenEvent extends Event
|
||||
/**
|
||||
* This event fires just before {@code GuiScreen.drawScreen()} is called.
|
||||
* Cancel this event to skip {@code GuiScreen.drawScreen()}.
|
||||
*
|
||||
* @author bspkrs
|
||||
*/
|
||||
@Cancelable
|
||||
public static class Pre extends DrawScreenEvent
|
||||
@@ -116,8 +110,6 @@ public class GuiScreenEvent extends Event
|
||||
|
||||
/**
|
||||
* This event fires just after {@code GuiScreen.drawScreen()} is called.
|
||||
*
|
||||
* @author bspkrs
|
||||
*/
|
||||
public static class Post extends DrawScreenEvent
|
||||
{
|
||||
@@ -137,26 +129,24 @@ public class GuiScreenEvent extends Event
|
||||
/**
|
||||
* A COPY of the {@code buttonList} field from the GuiScreen referenced by {@code gui}.
|
||||
*/
|
||||
public List buttonList;
|
||||
public List<GuiButton> buttonList;
|
||||
|
||||
public ActionPerformedEvent(GuiScreen gui, GuiButton button, List buttonList)
|
||||
public ActionPerformedEvent(GuiScreen gui, GuiButton button, List<GuiButton> buttonList)
|
||||
{
|
||||
super(gui);
|
||||
this.button = button;
|
||||
this.buttonList = new ArrayList(buttonList);
|
||||
this.buttonList = new ArrayList<GuiButton>(buttonList);
|
||||
}
|
||||
|
||||
/**
|
||||
* This event fires once it has been determined that a GuiButton object has been clicked.
|
||||
* Cancel this event to bypass {@code GuiScreen.actionPerformed()}.
|
||||
* Replace button with a different button from buttonList to have that button's action executed.
|
||||
*
|
||||
* @author bspkrs
|
||||
*/
|
||||
@Cancelable
|
||||
public static class Pre extends ActionPerformedEvent
|
||||
{
|
||||
public Pre(GuiScreen gui, GuiButton button, List buttonList)
|
||||
public Pre(GuiScreen gui, GuiButton button, List<GuiButton> buttonList)
|
||||
{
|
||||
super(gui, button, buttonList);
|
||||
}
|
||||
@@ -165,12 +155,10 @@ public class GuiScreenEvent extends Event
|
||||
/**
|
||||
* This event fires after {@code GuiScreen.actionPerformed()} provided that the active
|
||||
* screen has not been changed as a result of {@code GuiScreen.actionPerformed()}.
|
||||
*
|
||||
* @author bspkrs
|
||||
*/
|
||||
public static class Post extends ActionPerformedEvent
|
||||
{
|
||||
public Post(GuiScreen gui, GuiButton button, List buttonList)
|
||||
public Post(GuiScreen gui, GuiButton button, List<GuiButton> buttonList)
|
||||
{
|
||||
super(gui, button, buttonList);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package net.minecraftforge.client.event;
|
||||
|
||||
import net.minecraft.client.resources.model.IBakedModel;
|
||||
import net.minecraft.client.resources.model.ModelBakery;
|
||||
import net.minecraft.client.resources.model.ModelManager;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.util.IRegistry;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
@@ -13,18 +15,18 @@ import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
public class ModelBakeEvent extends Event
|
||||
{
|
||||
public final ModelManager modelManager;
|
||||
public final IRegistry modelRegistry;
|
||||
public final IRegistry<ModelResourceLocation, IBakedModel> modelRegistry;
|
||||
@Deprecated
|
||||
public final ModelBakery modelBakery;
|
||||
public final ModelLoader modelLoader;
|
||||
|
||||
@Deprecated
|
||||
public ModelBakeEvent(ModelManager modelManager, IRegistry modelRegistry, ModelBakery modelBakery)
|
||||
public ModelBakeEvent(ModelManager modelManager, IRegistry<ModelResourceLocation, IBakedModel> modelRegistry, ModelBakery modelBakery)
|
||||
{
|
||||
this(modelManager, modelRegistry, (ModelLoader)modelBakery);
|
||||
}
|
||||
|
||||
public ModelBakeEvent(ModelManager modelManager, IRegistry modelRegistry, ModelLoader modelLoader)
|
||||
public ModelBakeEvent(ModelManager modelManager, IRegistry<ModelResourceLocation, IBakedModel> modelRegistry, ModelLoader modelLoader)
|
||||
{
|
||||
this.modelManager = modelManager;
|
||||
this.modelRegistry = modelRegistry;
|
||||
|
||||
@@ -3,7 +3,6 @@ package net.minecraftforge.client.event;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
|
||||
@@ -5,15 +5,15 @@ import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
import net.minecraft.client.renderer.entity.RendererLivingEntity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
|
||||
public abstract class RenderLivingEvent extends Event
|
||||
public abstract class RenderLivingEvent<T extends EntityLivingBase> extends Event
|
||||
{
|
||||
public final EntityLivingBase entity;
|
||||
public final RendererLivingEntity renderer;
|
||||
public final RendererLivingEntity<T> renderer;
|
||||
public final double x;
|
||||
public final double y;
|
||||
public final double z;
|
||||
|
||||
public RenderLivingEvent(EntityLivingBase entity, RendererLivingEntity renderer, double x, double y, double z)
|
||||
public RenderLivingEvent(EntityLivingBase entity, RendererLivingEntity<T> renderer, double x, double y, double z)
|
||||
{
|
||||
this.entity = entity;
|
||||
this.renderer = renderer;
|
||||
@@ -23,27 +23,27 @@ public abstract class RenderLivingEvent extends Event
|
||||
}
|
||||
|
||||
@Cancelable
|
||||
public static class Pre extends RenderLivingEvent
|
||||
public static class Pre<T extends EntityLivingBase> extends RenderLivingEvent<T>
|
||||
{
|
||||
public Pre(EntityLivingBase entity, RendererLivingEntity renderer, double x, double y, double z){ super(entity, renderer, x, y, z); }
|
||||
public Pre(EntityLivingBase entity, RendererLivingEntity<T> renderer, double x, double y, double z){ super(entity, renderer, x, y, z); }
|
||||
}
|
||||
public static class Post extends RenderLivingEvent
|
||||
public static class Post<T extends EntityLivingBase> extends RenderLivingEvent<T>
|
||||
{
|
||||
public Post(EntityLivingBase entity, RendererLivingEntity renderer, double x, double y, double z){ super(entity, renderer, x, y, z); }
|
||||
public Post(EntityLivingBase entity, RendererLivingEntity<T> renderer, double x, double y, double z){ super(entity, renderer, x, y, z); }
|
||||
}
|
||||
|
||||
public abstract static class Specials extends RenderLivingEvent
|
||||
public abstract static class Specials<T extends EntityLivingBase> extends RenderLivingEvent<T>
|
||||
{
|
||||
public Specials(EntityLivingBase entity, RendererLivingEntity renderer, double x, double y, double z){ super(entity, renderer, x, y, z); }
|
||||
public Specials(EntityLivingBase entity, RendererLivingEntity<T> renderer, double x, double y, double z){ super(entity, renderer, x, y, z); }
|
||||
|
||||
@Cancelable
|
||||
public static class Pre extends Specials
|
||||
public static class Pre<T extends EntityLivingBase> extends Specials<T>
|
||||
{
|
||||
public Pre(EntityLivingBase entity, RendererLivingEntity renderer, double x, double y, double z){ super(entity, renderer, x, y, z); }
|
||||
public Pre(EntityLivingBase entity, RendererLivingEntity<T> renderer, double x, double y, double z){ super(entity, renderer, x, y, z); }
|
||||
}
|
||||
public static class Post extends Specials
|
||||
public static class Post<T extends EntityLivingBase> extends Specials<T>
|
||||
{
|
||||
public Post(EntityLivingBase entity, RendererLivingEntity renderer, double x, double y, double z){ super(entity, renderer, x, y, z); }
|
||||
public Post(EntityLivingBase entity, RendererLivingEntity<T> renderer, double x, double y, double z){ super(entity, renderer, x, y, z); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,6 @@ package net.minecraftforge.client.event.sound;
|
||||
import net.minecraft.client.audio.ISound;
|
||||
import net.minecraft.client.audio.SoundCategory;
|
||||
import net.minecraft.client.audio.SoundManager;
|
||||
import net.minecraft.client.audio.SoundPoolEntry;
|
||||
|
||||
/***
|
||||
* Raised when the SoundManager tries to play a normal sound.
|
||||
|
||||
@@ -23,7 +23,6 @@ import com.google.common.collect.Lists;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class BlockStateLoader
|
||||
{
|
||||
private static final Gson GSON = (new GsonBuilder())
|
||||
|
||||
@@ -37,6 +37,7 @@ import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParseException;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class ForgeBlockStateV1 extends Marker
|
||||
{
|
||||
ForgeBlockStateV1.Variant defaults;
|
||||
|
||||
@@ -12,6 +12,7 @@ import net.minecraft.util.EnumFacing;
|
||||
/*
|
||||
* Version of IBakedModel with less restriction on camera transformations and with explicit format of the baked array.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public interface IFlexibleBakedModel extends IBakedModel
|
||||
{
|
||||
/*
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.google.common.collect.ImmutableMap;
|
||||
* Model that changes based on the rendering perspective
|
||||
* (first-person, GUI, e.t.c - see TransformType)
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public interface IPerspectiveAwareModel extends IBakedModel
|
||||
{
|
||||
/*
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.google.common.collect.Maps;
|
||||
/**
|
||||
* IModelState that can change depending on the perspective.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public interface IPerspectiveState extends IModelState
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -27,6 +27,7 @@ import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class ItemLayerModel implements IRetexturableModel {
|
||||
|
||||
public static final ItemLayerModel instance = new ItemLayerModel(ImmutableList.<ResourceLocation>of());
|
||||
|
||||
@@ -33,6 +33,7 @@ import com.google.common.collect.Maps;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonParser;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class ModelFluid implements IModelCustomData
|
||||
{
|
||||
public static final ModelFluid waterModel = new ModelFluid(FluidRegistry.WATER);
|
||||
|
||||
@@ -63,6 +63,7 @@ import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class ModelLoader extends ModelBakery
|
||||
{
|
||||
private final Map<ModelResourceLocation, IModel> stateModels = new HashMap<ModelResourceLocation, IModel>();
|
||||
@@ -498,7 +499,7 @@ public class ModelLoader extends ModelBakery
|
||||
private final List<IModel> models = new ArrayList<IModel>();
|
||||
private final IModelState defaultState;
|
||||
|
||||
@Deprecated public WeightedRandomModel(Variants variants){ this(null, variants); } // Remove 1.9
|
||||
@Deprecated @SuppressWarnings("unused") public WeightedRandomModel(Variants variants){ this(null, variants); } // Remove 1.9
|
||||
public WeightedRandomModel(ModelResourceLocation parent, Variants variants)
|
||||
{
|
||||
this.variants = variants.getVariants();
|
||||
@@ -601,6 +602,7 @@ public class ModelLoader extends ModelBakery
|
||||
|
||||
private static class FlexibleWeightedBakedModel extends WeightedBakedModel implements IFlexibleBakedModel
|
||||
{
|
||||
@SuppressWarnings("unused")
|
||||
private final WeightedBakedModel parent;
|
||||
private final VertexFormat format;
|
||||
|
||||
@@ -617,6 +619,7 @@ public class ModelLoader extends ModelBakery
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private boolean isBuiltinModel(ModelBlock model)
|
||||
{
|
||||
return model == MODEL_GENERATED || model == MODEL_COMPASS || model == MODEL_CLOCK || model == MODEL_ENTITY;
|
||||
|
||||
@@ -29,6 +29,7 @@ import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class MultiModel implements IModel
|
||||
{
|
||||
public static class Baked implements IFlexibleBakedModel, IPerspectiveAwareModel
|
||||
|
||||
@@ -30,6 +30,7 @@ import com.google.common.base.Objects;
|
||||
* should be comparable to using Matrix4f directly.
|
||||
* Immutable.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public class TRSRTransformation implements IModelState, ITransformation
|
||||
{
|
||||
private final Matrix4f matrix;
|
||||
@@ -312,6 +313,7 @@ public class TRSRTransformation implements IModelState, ITransformation
|
||||
m.setColumn(i, t);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private static void sortSingularValues(Matrix3f b, Quat4f v)
|
||||
{
|
||||
float p0 = b.m00 * b.m00 + b.m10 * b.m10 + b.m20 * b.m20;
|
||||
|
||||
@@ -75,6 +75,7 @@ import com.google.gson.JsonParser;
|
||||
* 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.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public class B3DLoader implements ICustomModelLoader
|
||||
{
|
||||
public static final B3DLoader instance = new B3DLoader();
|
||||
|
||||
@@ -57,12 +57,11 @@ import com.google.common.base.Function;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class OBJModel implements IRetexturableModel, IModelCustomData
|
||||
{
|
||||
private Gson GSON = new GsonBuilder().create();
|
||||
//private Gson GSON = new GsonBuilder().create();
|
||||
private MaterialLibrary matLib;
|
||||
private final ResourceLocation modelLocation;
|
||||
private CustomData customData;
|
||||
@@ -832,6 +831,11 @@ public class OBJModel implements IRetexturableModel, IModelCustomData
|
||||
{
|
||||
return this.materialName;
|
||||
}
|
||||
|
||||
public boolean isTriangles()
|
||||
{
|
||||
return isTri;
|
||||
}
|
||||
|
||||
public boolean setVertices(Vertex[] verts)
|
||||
{
|
||||
|
||||
@@ -29,7 +29,6 @@ import net.minecraft.world.WorldProviderHell;
|
||||
import net.minecraft.world.WorldProviderSurface;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraft.world.WorldServerMulti;
|
||||
import net.minecraft.world.WorldSettings;
|
||||
import net.minecraft.world.storage.ISaveHandler;
|
||||
import net.minecraft.world.storage.SaveHandler;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
@@ -242,7 +241,7 @@ public class DimensionManager
|
||||
}
|
||||
MinecraftServer mcServer = overworld.getMinecraftServer();
|
||||
ISaveHandler savehandler = overworld.getSaveHandler();
|
||||
WorldSettings worldSettings = new WorldSettings(overworld.getWorldInfo());
|
||||
//WorldSettings worldSettings = new WorldSettings(overworld.getWorldInfo());
|
||||
|
||||
WorldServer world = (dim == 0 ? overworld : (WorldServer)(new WorldServerMulti(mcServer, savehandler, dim, overworld, mcServer.theProfiler).init()));
|
||||
world.addWorldAccess(new WorldManager(mcServer, world));
|
||||
|
||||
@@ -574,7 +574,6 @@ public class ForgeHooks
|
||||
IChatComponent ichat = null;
|
||||
Matcher matcher = URL_PATTERN.matcher(string);
|
||||
int lastEnd = 0;
|
||||
String remaining = string;
|
||||
|
||||
// Find all urls
|
||||
while (matcher.find())
|
||||
|
||||
@@ -37,7 +37,6 @@ import net.minecraftforge.fml.client.FMLFileResourcePack;
|
||||
import net.minecraftforge.fml.client.FMLFolderResourcePack;
|
||||
import net.minecraftforge.fml.client.event.ConfigChangedEvent.OnConfigChangedEvent;
|
||||
import net.minecraftforge.fml.common.DummyModContainer;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.common.FMLLog;
|
||||
import net.minecraftforge.fml.common.LoadController;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
@@ -79,7 +78,6 @@ public class ForgeModContainer extends DummyModContainer implements WorldAccessC
|
||||
|
||||
private URL updateJSONUrl = null;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public ForgeModContainer()
|
||||
{
|
||||
super(new ModMetadata());
|
||||
@@ -93,7 +91,6 @@ public class ForgeModContainer extends DummyModContainer implements WorldAccessC
|
||||
"to work cooperatively together. It allows many mods to be created without " +
|
||||
"them editing the main Minecraft code.";
|
||||
meta.url = "http://minecraftforge.net";
|
||||
meta.updateUrl = "http://minecraftforge.net/forum/index.php/topic,5.0.html";
|
||||
meta.screenshots = new String[0];
|
||||
meta.logoFile = "/forge_logo.png";
|
||||
try {
|
||||
@@ -303,7 +300,7 @@ public class ForgeModContainer extends DummyModContainer implements WorldAccessC
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.register(MinecraftForge.INTERNAL_HANDLER);
|
||||
ForgeChunkManager.captureConfig(evt.getModConfigurationDirectory());
|
||||
FMLCommonHandler.instance().bus().register(this);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
|
||||
if (!ForgeModContainer.disableVersionCheck)
|
||||
{
|
||||
|
||||
@@ -32,6 +32,11 @@ public class ExtendedBlockState extends BlockState
|
||||
}
|
||||
this.unlistedProperties = builder.build();
|
||||
}
|
||||
|
||||
public Collection<IUnlistedProperty<?>> getUnlistedProperties()
|
||||
{
|
||||
return unlistedProperties;
|
||||
}
|
||||
|
||||
private static ImmutableMap<IUnlistedProperty<?>, Optional<?>> buildUnlistedMap(IUnlistedProperty<?>[] unlistedProperties)
|
||||
{
|
||||
|
||||
@@ -314,7 +314,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, C...callbacks) throws E {
|
||||
public T getSkipQueue(P parameter, @SuppressWarnings("unchecked")C... callbacks) throws E {
|
||||
final CallBackProvider<P, T, C, E> provider = this.provider;
|
||||
final T object = skipQueue(parameter);
|
||||
for (C callback : callbacks) {
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
package net.minecraftforge.common.util;
|
||||
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -20,7 +18,7 @@ import net.minecraftforge.fml.common.registry.GameRegistry.UniqueIdentifier;
|
||||
* Unlike Block, which only one object can exist per coordinate, BlockSnapshot
|
||||
* can exist multiple times for any given Block.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
@SuppressWarnings({"serial", "deprecation"})
|
||||
public class BlockSnapshot implements Serializable
|
||||
{
|
||||
private static final boolean DEBUG = Boolean.parseBoolean(System.getProperty("forge.debugBlockSnapshot", "false"));
|
||||
|
||||
@@ -10,7 +10,6 @@ import com.google.common.collect.Maps;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
|
||||
//To be expanded for generic Mod fake players?
|
||||
public class FakePlayerFactory
|
||||
@@ -26,7 +25,7 @@ public class FakePlayerFactory
|
||||
if (ret == null)
|
||||
{
|
||||
ret = FakePlayerFactory.get(world, MINECRAFT);
|
||||
MINECRAFT_PLAYER = new WeakReference(ret);
|
||||
MINECRAFT_PLAYER = new WeakReference<FakePlayer>(ret);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
package net.minecraftforge.event;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -25,7 +22,6 @@ import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
@@ -36,8 +32,6 @@ import net.minecraft.world.storage.SaveHandler;
|
||||
import net.minecraftforge.client.event.ClientChatReceivedEvent;
|
||||
import net.minecraftforge.client.event.RenderBlockOverlayEvent;
|
||||
import net.minecraftforge.client.event.RenderBlockOverlayEvent.OverlayType;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import net.minecraftforge.common.IExtendedEntityProperties;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.BlockSnapshot;
|
||||
import net.minecraftforge.event.brewing.PotionBrewEvent;
|
||||
|
||||
@@ -73,6 +73,7 @@ public class PotionBrewEvent extends Event
|
||||
* <br>
|
||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
|
||||
**/
|
||||
@SuppressWarnings("deprecation")
|
||||
public static class Post extends PotionBrewedEvent
|
||||
{
|
||||
public Post(ItemStack[] stacks)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package net.minecraftforge.event.brewing;
|
||||
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
@@ -16,7 +15,7 @@ import net.minecraft.item.ItemStack;
|
||||
* <br>
|
||||
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
|
||||
**/
|
||||
@Deprecated
|
||||
@Deprecated // remove in 1.9
|
||||
public class PotionBrewedEvent extends PotionBrewEvent
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package net.minecraftforge.event.entity;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event.HasResult;
|
||||
|
||||
@@ -3,7 +3,6 @@ package net.minecraftforge.event.entity.player;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
|
||||
/**
|
||||
* When the player receives an achievement. If canceled the player will not receive anything.
|
||||
|
||||
@@ -2,7 +2,6 @@ package net.minecraftforge.event.entity.player;
|
||||
|
||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.BlockPos;
|
||||
|
||||
@@ -2,7 +2,6 @@ package net.minecraftforge.event.terraingen;
|
||||
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event.HasResult;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.world.biome.BiomeDecorator;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
package net.minecraftforge.event.terraingen;
|
||||
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.chunk.ChunkPrimer;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
package net.minecraftforge.event.world;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
@@ -15,6 +15,7 @@ import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
* Base class for Noteblock Events
|
||||
*
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public class NoteBlockEvent extends BlockEvent
|
||||
{
|
||||
private int noteId;
|
||||
|
||||
@@ -37,6 +37,7 @@ import com.google.common.collect.Maps;
|
||||
* @author King Lemming, OvermindDL1
|
||||
*
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public abstract class BlockFluidBase extends Block implements IFluidBlock
|
||||
{
|
||||
protected final static Map<Block, Boolean> defaultDisplacements = Maps.newHashMap();
|
||||
@@ -90,10 +91,11 @@ 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[] FLUID_RENDER_PROPS;
|
||||
public static final IUnlistedProperty<Float>[] FLUID_RENDER_PROPS;
|
||||
|
||||
static
|
||||
{
|
||||
@SuppressWarnings("rawtypes")
|
||||
ImmutableList.Builder<IUnlistedProperty> builder = ImmutableList.builder();
|
||||
builder.add(FLOW_DIRECTION);
|
||||
for(int i = 0; i < 4; i++)
|
||||
|
||||
@@ -1,19 +1,12 @@
|
||||
package net.minecraftforge.fluids;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeModContainer;
|
||||
import net.minecraftforge.fml.common.FMLLog;
|
||||
import net.minecraftforge.fml.common.LoaderException;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
|
||||
package net.minecraftforge.fluids;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -14,7 +10,6 @@ import com.google.common.collect.Sets;
|
||||
import net.minecraftforge.fml.common.FMLLog;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
|
||||
@@ -7,8 +7,6 @@ import java.util.Set;
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
|
||||
@@ -41,14 +41,12 @@ import net.minecraft.client.multiplayer.WorldClient;
|
||||
import net.minecraft.client.network.NetHandlerPlayClient;
|
||||
import net.minecraft.client.network.OldServerPinger;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.resources.AbstractResourcePack;
|
||||
import net.minecraft.client.resources.FallbackResourceManager;
|
||||
import net.minecraft.client.resources.IReloadableResourceManager;
|
||||
import net.minecraft.client.resources.IResourcePack;
|
||||
import net.minecraft.client.resources.SimpleReloadableResourceManager;
|
||||
import net.minecraft.crash.CrashReport;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.launchwrapper.Launch;
|
||||
import net.minecraft.nbt.CompressedStreamTools;
|
||||
@@ -154,10 +152,6 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||
|
||||
private DummyModContainer optifineContainer;
|
||||
|
||||
private boolean guiLoaded;
|
||||
|
||||
private boolean serverIsRunning;
|
||||
|
||||
private MissingModsException modsMissing;
|
||||
|
||||
private ModSortingException modSorting;
|
||||
@@ -174,8 +168,6 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||
|
||||
private List<IResourcePack> resourcePackList;
|
||||
|
||||
private IReloadableResourceManager resourceManager;
|
||||
|
||||
private Map<String, IResourcePack> resourcePackMap;
|
||||
|
||||
private BiMap<ModContainer, IModGuiFactory> guiFactories;
|
||||
@@ -199,7 +191,6 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||
SplashProgress.start();
|
||||
client = minecraft;
|
||||
this.resourcePackList = resourcePackList;
|
||||
this.resourceManager = resourceManager;
|
||||
this.resourcePackMap = Maps.newHashMap();
|
||||
if (minecraft.isDemo())
|
||||
{
|
||||
@@ -369,6 +360,7 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||
{
|
||||
continue;
|
||||
}
|
||||
/*
|
||||
Map<String, String> mod = modEntry.getValue();
|
||||
String modSystem = mod.get("modsystem"); // the modsystem (FML uses FML or ModLoader)
|
||||
String modId = mod.get("id"); // unique ID
|
||||
@@ -377,6 +369,7 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||
String modURL = mod.get("url"); // a URL for the mod (can be empty string)
|
||||
String modAuthors = mod.get("authors"); // a csv of authors (can be empty string)
|
||||
String modDescription = mod.get("description"); // a (potentially) multiline description (can be empty string)
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ public class GuiAccessDenied extends GuiScreen
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
|
||||
@@ -27,7 +27,6 @@ public class GuiBackupFailed extends GuiScreen
|
||||
this.zipName = zipName;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
|
||||
@@ -12,7 +12,6 @@ public class GuiConfirmation extends GuiNotification
|
||||
super(query);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
|
||||
@@ -150,7 +150,6 @@ public class GuiModList extends GuiScreen
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
@@ -476,11 +475,6 @@ public class GuiModList extends GuiScreen
|
||||
@Override protected void drawBackground() {}
|
||||
@Override protected void drawSlot(int slotIdx, int entryRight, int slotTop, int slotBuffer, Tessellator tess) { }
|
||||
|
||||
private List<String> splitLines(String line)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
private List<IChatComponent> resizeContent(List<String> lines)
|
||||
{
|
||||
List<IChatComponent> ret = new ArrayList<IChatComponent>();
|
||||
|
||||
@@ -27,7 +27,6 @@ public class GuiModsMissingForServer extends GuiScreen
|
||||
this.modsMissing = modsMissing;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
|
||||
@@ -12,7 +12,6 @@ public class GuiNotification extends GuiScreen
|
||||
this.query = query;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
|
||||
@@ -100,9 +100,9 @@ import org.lwjgl.opengl.SharedDrawable;
|
||||
import org.lwjgl.util.glu.GLU;
|
||||
|
||||
/**
|
||||
* @deprecated not a stable API, will break, don't use this yet
|
||||
* Not a fully fleshed out API, may change in future MC versions.
|
||||
* However feel free to use and suggest additions.
|
||||
*/
|
||||
@Deprecated
|
||||
@SuppressWarnings("serial")
|
||||
public class SplashProgress
|
||||
{
|
||||
|
||||
@@ -24,11 +24,11 @@ import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.client.config.GuiConfigEntries.IConfigEntry;
|
||||
import net.minecraftforge.fml.client.event.ConfigChangedEvent;
|
||||
import net.minecraftforge.fml.client.event.ConfigChangedEvent.OnConfigChangedEvent;
|
||||
import net.minecraftforge.fml.client.event.ConfigChangedEvent.PostConfigChangedEvent;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event.Result;
|
||||
|
||||
@@ -175,7 +175,6 @@ public class GuiConfig extends GuiScreen
|
||||
return path.replace("\\", "/").replace(mc.mcDataDir.getAbsolutePath().replace("\\", "/"), "/.minecraft");
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
@@ -240,9 +239,9 @@ public class GuiConfig extends GuiScreen
|
||||
if (Loader.isModLoaded(modID))
|
||||
{
|
||||
ConfigChangedEvent event = new OnConfigChangedEvent(modID, configID, isWorldRunning, requiresMcRestart);
|
||||
FMLCommonHandler.instance().bus().post(event);
|
||||
MinecraftForge.EVENT_BUS.post(event);
|
||||
if (!event.getResult().equals(Result.DENY))
|
||||
FMLCommonHandler.instance().bus().post(new PostConfigChangedEvent(modID, configID, isWorldRunning, requiresMcRestart));
|
||||
MinecraftForge.EVENT_BUS.post(new PostConfigChangedEvent(modID, configID, isWorldRunning, requiresMcRestart));
|
||||
|
||||
if (requiresMcRestart)
|
||||
{
|
||||
@@ -344,8 +343,7 @@ public class GuiConfig extends GuiScreen
|
||||
this.drawToolTip(this.mc.fontRendererObj.listFormattedStringToWidth(I18n.format("fml.configgui.tooltip.applyGlobally"), 300), mouseX, mouseY);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public void drawToolTip(List stringList, int x, int y)
|
||||
public void drawToolTip(List<String> stringList, int x, int y)
|
||||
{
|
||||
this.drawHoveringText(stringList, x, y);
|
||||
}
|
||||
|
||||
@@ -1454,7 +1454,6 @@ public class GuiConfigEntries extends GuiListExtended
|
||||
*
|
||||
* Provides a base entry for others to extend. Handles drawing the prop label (if drawLabel == true) and the Undo/Default buttons.
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
public static abstract class ListEntryBase implements IConfigEntry
|
||||
{
|
||||
protected final GuiConfig owningScreen;
|
||||
@@ -1464,16 +1463,15 @@ public class GuiConfigEntries extends GuiListExtended
|
||||
protected final String name;
|
||||
protected final GuiButtonExt btnUndoChanges;
|
||||
protected final GuiButtonExt btnDefault;
|
||||
protected List toolTip;
|
||||
protected List undoToolTip;
|
||||
protected List defaultToolTip;
|
||||
protected List<String> toolTip;
|
||||
protected List<String> undoToolTip;
|
||||
protected List<String> defaultToolTip;
|
||||
protected boolean isValidValue = true;
|
||||
protected HoverChecker tooltipHoverChecker;
|
||||
protected HoverChecker undoHoverChecker;
|
||||
protected HoverChecker defaultHoverChecker;
|
||||
protected boolean drawLabel;
|
||||
|
||||
@SuppressWarnings({ "unchecked" })
|
||||
public ListEntryBase(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement)
|
||||
{
|
||||
this.owningScreen = owningScreen;
|
||||
|
||||
@@ -46,11 +46,9 @@ public class GuiEditArray extends GuiScreen
|
||||
protected final Object[] beforeValues;
|
||||
protected Object[] currentValues;
|
||||
protected HoverChecker tooltipHoverChecker;
|
||||
@SuppressWarnings("rawtypes")
|
||||
protected List toolTip;
|
||||
protected List<String> toolTip;
|
||||
protected boolean enabled;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public GuiEditArray(GuiScreen parentScreen, IConfigElement configElement, int slotIndex, Object[] currentValues, boolean enabled)
|
||||
{
|
||||
this.mc = Minecraft.getMinecraft();
|
||||
@@ -59,7 +57,7 @@ public class GuiEditArray extends GuiScreen
|
||||
this.slotIndex = slotIndex;
|
||||
this.beforeValues = currentValues;
|
||||
this.currentValues = currentValues;
|
||||
this.toolTip = new ArrayList();
|
||||
this.toolTip = new ArrayList<String>();
|
||||
this.enabled = enabled;
|
||||
String propName = I18n.format(configElement.getLanguageKey());
|
||||
String comment;
|
||||
@@ -96,7 +94,6 @@ public class GuiEditArray extends GuiScreen
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
@@ -206,8 +203,7 @@ public class GuiEditArray extends GuiScreen
|
||||
drawToolTip(this.toolTip, par1, par2);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public void drawToolTip(List stringList, int x, int y)
|
||||
public void drawToolTip(List<String> stringList, int x, int y)
|
||||
{
|
||||
this.drawHoveringText(stringList, x, y);
|
||||
}
|
||||
|
||||
@@ -32,10 +32,7 @@ import static net.minecraftforge.fml.client.config.GuiUtils.VALID;
|
||||
/**
|
||||
* This class implements the scrolling list functionality of the GuiEditList screen. It also provides all the default controls
|
||||
* for editing array-type properties.
|
||||
*
|
||||
* @author bspkrs
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
public class GuiEditArrayEntries extends GuiListExtended
|
||||
{
|
||||
protected GuiEditArray owningGui;
|
||||
@@ -535,11 +532,10 @@ public class GuiEditArrayEntries extends GuiListExtended
|
||||
private final HoverChecker addNewEntryAboveHoverChecker;
|
||||
protected final GuiButtonExt btnRemoveEntry;
|
||||
private final HoverChecker removeEntryHoverChecker;
|
||||
private List addNewToolTip, removeToolTip;
|
||||
private List<String> addNewToolTip, removeToolTip;
|
||||
protected boolean isValidValue = true;
|
||||
protected boolean isValidated = false;
|
||||
|
||||
@SuppressWarnings({ "unchecked" })
|
||||
public BaseEntry(GuiEditArray owningScreen, GuiEditArrayEntries owningEntryList, IConfigElement configElement)
|
||||
{
|
||||
this.owningScreen = owningScreen;
|
||||
@@ -553,8 +549,8 @@ public class GuiEditArrayEntries extends GuiListExtended
|
||||
this.btnRemoveEntry.enabled = owningScreen.enabled;
|
||||
this.addNewEntryAboveHoverChecker = new HoverChecker(this.btnAddNewEntryAbove, 800);
|
||||
this.removeEntryHoverChecker = new HoverChecker(this.btnRemoveEntry, 800);
|
||||
this.addNewToolTip = new ArrayList();
|
||||
this.removeToolTip = new ArrayList();
|
||||
this.addNewToolTip = new ArrayList<String>();
|
||||
this.removeToolTip = new ArrayList<String>();
|
||||
addNewToolTip.add(I18n.format("fml.configgui.tooltip.addNewEntryAbove"));
|
||||
removeToolTip.add(I18n.format("fml.configgui.tooltip.removeEntry"));
|
||||
}
|
||||
|
||||
@@ -44,11 +44,9 @@ public class GuiSelectString extends GuiScreen
|
||||
public final Object beforeValue;
|
||||
public Object currentValue;
|
||||
protected HoverChecker tooltipHoverChecker;
|
||||
@SuppressWarnings("rawtypes")
|
||||
protected List toolTip;
|
||||
protected List<String> toolTip;
|
||||
protected boolean enabled;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public GuiSelectString(GuiScreen parentScreen, IConfigElement configElement, int slotIndex, Map<Object, String> selectableValues, Object currentValue, boolean enabled)
|
||||
{
|
||||
this.mc = Minecraft.getMinecraft();
|
||||
@@ -58,7 +56,7 @@ public class GuiSelectString extends GuiScreen
|
||||
this.selectableValues = selectableValues;
|
||||
this.beforeValue = currentValue;
|
||||
this.currentValue = currentValue;
|
||||
this.toolTip = new ArrayList();
|
||||
this.toolTip = new ArrayList<String>();
|
||||
this.enabled = enabled;
|
||||
String propName = I18n.format(configElement.getLanguageKey());
|
||||
String comment;
|
||||
@@ -95,7 +93,6 @@ public class GuiSelectString extends GuiScreen
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
@@ -178,8 +175,7 @@ public class GuiSelectString extends GuiScreen
|
||||
drawToolTip(this.toolTip, par1, par2);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public void drawToolTip(List stringList, int x, int y)
|
||||
public void drawToolTip(List<String> stringList, int x, int y)
|
||||
{
|
||||
this.drawHoveringText(stringList, x, y);
|
||||
}
|
||||
|
||||
@@ -3,8 +3,6 @@ package net.minecraftforge.fml.client.config;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
/**
|
||||
* This class is blatantly stolen from iChunUtils with permission.
|
||||
*
|
||||
|
||||
@@ -15,8 +15,6 @@ package net.minecraftforge.fml.client.config;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
/**
|
||||
* This class provides a button that shows a string glyph at the beginning. The glyph can be scaled using the glyphScale parameter.
|
||||
*
|
||||
|
||||
@@ -14,7 +14,6 @@ package net.minecraftforge.fml.client.config;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.WorldRenderer;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
|
||||
@@ -31,14 +31,13 @@ public class ClientRegistry
|
||||
* @param id
|
||||
* @param specialRenderer
|
||||
*/
|
||||
public static void registerTileEntity(Class <? extends TileEntity > tileEntityClass, String id, TileEntitySpecialRenderer specialRenderer)
|
||||
public static <T extends TileEntity> void registerTileEntity(Class<T> tileEntityClass, String id, TileEntitySpecialRenderer<T> specialRenderer)
|
||||
{
|
||||
GameRegistry.registerTileEntity(tileEntityClass, id);
|
||||
bindTileEntitySpecialRenderer(tileEntityClass, specialRenderer);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static void bindTileEntitySpecialRenderer(Class <? extends TileEntity> tileEntityClass, TileEntitySpecialRenderer specialRenderer)
|
||||
public static <T extends TileEntity> void bindTileEntitySpecialRenderer(Class<T> tileEntityClass, TileEntitySpecialRenderer<T> specialRenderer)
|
||||
{
|
||||
TileEntityRendererDispatcher.instance.mapSpecialRenderers.put(tileEntityClass, specialRenderer);
|
||||
specialRenderer.setRendererDispatcher(TileEntityRendererDispatcher.instance);
|
||||
|
||||
@@ -15,26 +15,24 @@ package net.minecraftforge.fml.common;
|
||||
import java.io.File;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import net.minecraftforge.fml.common.EnhancedRuntimeException.WrappedPrintStream;
|
||||
|
||||
import com.google.common.collect.SetMultimap;
|
||||
|
||||
public class DuplicateModsFoundException extends LoaderException {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public SetMultimap<ModContainer,File> dupes;
|
||||
|
||||
public DuplicateModsFoundException(SetMultimap<ModContainer, File> dupes) {
|
||||
this.dupes = dupes;
|
||||
}
|
||||
public DuplicateModsFoundException(SetMultimap<ModContainer, File> dupes) {
|
||||
this.dupes = dupes;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void printStackTrace(WrappedPrintStream stream)
|
||||
{
|
||||
stream.println("Duplicate Mods:");
|
||||
for (Entry<ModContainer, File> e : dupes.entries())
|
||||
{
|
||||
stream.println(String.format("\t%s : %s", e.getKey().getModId(), e.getValue().getAbsolutePath()));
|
||||
}
|
||||
stream.println("");
|
||||
}
|
||||
@Override
|
||||
protected void printStackTrace(WrappedPrintStream stream)
|
||||
{
|
||||
stream.println("Duplicate Mods:");
|
||||
for (Entry<ModContainer, File> e : dupes.entries())
|
||||
{
|
||||
stream.println(String.format("\t%s : %s", e.getKey().getModId(), e.getValue().getAbsolutePath()));
|
||||
}
|
||||
stream.println("");
|
||||
}
|
||||
}
|
||||
@@ -18,8 +18,6 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
@@ -67,8 +65,6 @@ import org.apache.logging.log4j.Level;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.common.base.Throwables;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableList.Builder;
|
||||
import com.google.common.collect.Lists;
|
||||
@@ -101,7 +97,6 @@ public class FMLCommonHandler
|
||||
*/
|
||||
private IFMLSidedHandler sidedDelegate;
|
||||
|
||||
private Class<?> forge;
|
||||
private boolean noForge;
|
||||
private List<String> brandings;
|
||||
private List<String> brandingsNoMC;
|
||||
@@ -676,7 +671,7 @@ public class FMLCommonHandler
|
||||
return sidedDelegate.getWorldThread(net);
|
||||
}
|
||||
|
||||
public static void callFuture(FutureTask task)
|
||||
public static void callFuture(FutureTask<?> task)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -726,7 +721,7 @@ public class FMLCommonHandler
|
||||
|
||||
Properties props = new Properties();
|
||||
props.load(new InputStreamReader(new ByteArrayInputStream(data), Charsets.UTF_8));
|
||||
for (Entry e : props.entrySet())
|
||||
for (Entry<Object, Object> e : props.entrySet())
|
||||
{
|
||||
table.put((String)e.getKey(), (String)e.getValue());
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@ package net.minecraftforge.fml.common;
|
||||
import java.io.File;
|
||||
import java.security.cert.Certificate;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -24,7 +23,6 @@ import java.util.Set;
|
||||
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagIntArray;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.world.storage.SaveHandler;
|
||||
import net.minecraft.world.storage.WorldInfo;
|
||||
@@ -42,9 +40,6 @@ import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.google.common.eventbus.EventBus;
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
|
||||
@@ -67,7 +62,6 @@ public class FMLContainer extends DummyModContainer implements WorldAccessContai
|
||||
"from the file system. It also provides key capabilities for mods to be able " +
|
||||
"to cooperate and provide a good modding environment. ";
|
||||
meta.url="https://github.com/MinecraftForge/FML/wiki";
|
||||
meta.updateUrl="https://github.com/MinecraftForge/FML/wiki";
|
||||
meta.screenshots=new String[0];
|
||||
meta.logoFile="";
|
||||
}
|
||||
|
||||
@@ -31,7 +31,6 @@ import net.minecraftforge.fml.common.versioning.ArtifactVersion;
|
||||
import org.apache.logging.log4j.Level;
|
||||
import org.apache.logging.log4j.ThreadContext;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.collect.ArrayListMultimap;
|
||||
import com.google.common.collect.BiMap;
|
||||
import com.google.common.collect.Collections2;
|
||||
|
||||
@@ -112,6 +112,7 @@ import com.google.gson.JsonParser;
|
||||
* @author cpw
|
||||
*
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public class Loader
|
||||
{
|
||||
public static final String MC_VERSION = "1.8.8";
|
||||
|
||||
@@ -92,6 +92,12 @@ public enum LoaderState
|
||||
if (this == NOINIT) return NOINIT;
|
||||
return LoaderState.values()[this.ordinal()-1];
|
||||
}
|
||||
|
||||
public String getPrettyName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public enum ModState
|
||||
{
|
||||
UNLOADED ("Unloaded", "U"),
|
||||
|
||||
@@ -14,7 +14,6 @@ package net.minecraftforge.fml.common;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraftforge.fml.common.EnhancedRuntimeException.WrappedPrintStream;
|
||||
import net.minecraftforge.fml.common.versioning.ArtifactVersion;
|
||||
|
||||
public class MissingModsException extends EnhancedRuntimeException
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.google.common.collect.Sets;
|
||||
|
||||
public class ModAPIManager {
|
||||
public static final ModAPIManager INSTANCE = new ModAPIManager();
|
||||
@SuppressWarnings("unused")
|
||||
private ModAPITransformer transformer;
|
||||
private ASMDataTable dataTable;
|
||||
private Map<String,APIContainer> apiContainers;
|
||||
|
||||
@@ -7,25 +7,25 @@ import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import com.google.common.base.Joiner;
|
||||
|
||||
/**
|
||||
* @deprecated not a stable API, will break, don't use this yet
|
||||
* Not a fully fleshed out API, may change in future MC versions.
|
||||
* However feel free to use and suggest additions.
|
||||
*/
|
||||
@Deprecated
|
||||
public class ProgressManager
|
||||
{
|
||||
private static final List<ProgressBar> bars = new CopyOnWriteArrayList<ProgressBar>();
|
||||
|
||||
/**
|
||||
* @deprecated not a stable API, will break, don't use this yet
|
||||
* Not a fully fleshed out API, may change in future MC versions.
|
||||
* However feel free to use and suggest additions.
|
||||
*/
|
||||
@Deprecated
|
||||
public static ProgressBar push(String title, int steps)
|
||||
{
|
||||
return push(title, steps, false);
|
||||
}
|
||||
/**
|
||||
* @deprecated not a stable API, will break, don't use this yet
|
||||
* Not a fully fleshed out API, may change in future MC versions.
|
||||
* However feel free to use and suggest additions.
|
||||
*/
|
||||
@Deprecated
|
||||
public static ProgressBar push(String title, int steps, boolean timeEachStep)
|
||||
{
|
||||
ProgressBar bar = new ProgressBar(title, steps);
|
||||
@@ -38,10 +38,11 @@ public class ProgressManager
|
||||
return bar;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated not a stable API, will break, don't use this yet
|
||||
* Not a fully fleshed out API, may change in future MC versions.
|
||||
* However feel free to use and suggest additions.
|
||||
*/
|
||||
@Deprecated
|
||||
public static void pop(ProgressBar bar)
|
||||
{
|
||||
if(bar.getSteps() != bar.getStep()) throw new IllegalStateException("can't pop unfinished ProgressBar " + bar.getTitle());
|
||||
@@ -67,10 +68,11 @@ public class ProgressManager
|
||||
return bars.iterator();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated not a stable API, will break, don't use this yet
|
||||
* Not a fully fleshed out API, may change in future MC versions.
|
||||
* However feel free to use and suggest additions.
|
||||
*/
|
||||
@Deprecated
|
||||
public static class ProgressBar
|
||||
{
|
||||
private final String title;
|
||||
|
||||
@@ -11,7 +11,6 @@ import java.net.URLConnection;
|
||||
import java.net.URLStreamHandler;
|
||||
import java.security.Permission;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
import net.minecraft.launchwrapper.IClassTransformer;
|
||||
import net.minecraft.launchwrapper.LaunchClassLoader;
|
||||
@@ -178,7 +177,8 @@ public class ASMTransformerWrapper
|
||||
return "$wrapper." + parentClass;
|
||||
}
|
||||
|
||||
private static class WrapperVisitor extends ClassVisitor
|
||||
@SuppressWarnings("unused")
|
||||
private static class WrapperVisitor extends ClassVisitor
|
||||
{
|
||||
private final String name;
|
||||
private final String parentClass;
|
||||
@@ -248,6 +248,8 @@ public class ASMTransformerWrapper
|
||||
|
||||
static class TransformerException extends RuntimeException
|
||||
{
|
||||
private static final long serialVersionUID = -6616232415696157218L;
|
||||
|
||||
public TransformerException(String message, Throwable cause)
|
||||
{
|
||||
super(message, cause);
|
||||
|
||||
+1
-6
@@ -1,11 +1,7 @@
|
||||
package net.minecraftforge.fml.common.asm.transformers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
@@ -17,7 +13,6 @@ import org.apache.commons.lang3.JavaVersion;
|
||||
import org.apache.commons.lang3.SystemUtils;
|
||||
import org.objectweb.asm.ClassReader;
|
||||
import org.objectweb.asm.ClassVisitor;
|
||||
import org.objectweb.asm.ClassWriter;
|
||||
import org.objectweb.asm.Opcodes;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
@@ -27,7 +22,7 @@ public class BlamingTransformer implements IClassTransformer
|
||||
private static final Map<String, String> classMap = new HashMap<String, String>();
|
||||
private static final Set<String> naughtyMods = new HashSet<String>();
|
||||
private static final Set<String> naughtyClasses = new TreeSet<String>();
|
||||
private static final Set<String> orphanNaughtyClasses = new HashSet();
|
||||
private static final Set<String> orphanNaughtyClasses = new HashSet<String>();
|
||||
|
||||
@Override
|
||||
public byte[] transform(String name, String transformedName, byte[] bytes)
|
||||
|
||||
-2
@@ -1,14 +1,12 @@
|
||||
package net.minecraftforge.fml.common.asm.transformers;
|
||||
|
||||
import static org.objectweb.asm.ClassWriter.COMPUTE_FRAMES;
|
||||
import static org.objectweb.asm.ClassWriter.COMPUTE_MAXS;
|
||||
import static org.objectweb.asm.Opcodes.ACC_PRIVATE;
|
||||
import static org.objectweb.asm.Opcodes.ACC_PROTECTED;
|
||||
import static org.objectweb.asm.Opcodes.ACC_PUBLIC;
|
||||
import static org.objectweb.asm.Opcodes.ACC_STATIC;
|
||||
import static org.objectweb.asm.Opcodes.ALOAD;
|
||||
import static org.objectweb.asm.Opcodes.ARETURN;
|
||||
import static org.objectweb.asm.Opcodes.ASM5;
|
||||
import static org.objectweb.asm.Opcodes.DUP;
|
||||
import static org.objectweb.asm.Opcodes.F_SAME;
|
||||
import static org.objectweb.asm.Opcodes.GETSTATIC;
|
||||
|
||||
@@ -161,6 +161,7 @@ public class FMLInterModComms {
|
||||
* @param <V> The result type
|
||||
* @return The function value or Optional.absent if it wasn't readable or isn't a function call
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T,V> Optional<Function<T,V>> getFunctionValue(Class<T> functionFrom, Class<V> functionTo) {
|
||||
if (!isFunction) {
|
||||
return Optional.absent();
|
||||
|
||||
@@ -19,10 +19,8 @@ import net.minecraftforge.fml.common.FMLLog;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.fml.common.LoaderState.ModState;
|
||||
|
||||
import com.google.common.base.Throwables;
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.lang.reflect.Constructor;
|
||||
|
||||
|
||||
@@ -44,11 +44,11 @@ public class FMLEmbeddedChannel extends EmbeddedChannel {
|
||||
* @param object The inbound packet
|
||||
* @return A Packet suitable for passing to vanilla network code.
|
||||
*/
|
||||
public Packet generatePacketFrom(Object object)
|
||||
public Packet<?> generatePacketFrom(Object object)
|
||||
{
|
||||
OutboundTarget outboundTarget = attr(FMLOutboundHandler.FML_MESSAGETARGET).getAndSet(OutboundTarget.NOWHERE);
|
||||
writeOutbound(object);
|
||||
Packet pkt = (Packet) outboundMessages().poll();
|
||||
Packet<?> pkt = (Packet<?>) outboundMessages().poll();
|
||||
attr(FMLOutboundHandler.FML_MESSAGETARGET).set(outboundTarget);
|
||||
return pkt;
|
||||
}
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ public abstract class FMLIndexedMessageToMessageCodec<A> extends MessageToMessag
|
||||
* Make this accessible to subclasses
|
||||
*/
|
||||
|
||||
public static final AttributeKey<ThreadLocal<WeakReference<FMLProxyPacket>>> INBOUNDPACKETTRACKER = new AttributeKey<ThreadLocal<WeakReference<FMLProxyPacket>>>("fml:inboundpacket");
|
||||
public static final AttributeKey<ThreadLocal<WeakReference<FMLProxyPacket>>> INBOUNDPACKETTRACKER = AttributeKey.valueOf("fml:inboundpacket");
|
||||
|
||||
@Override
|
||||
public void handlerAdded(ChannelHandlerContext ctx) throws Exception
|
||||
|
||||
@@ -23,10 +23,14 @@ public class FMLNetworkEvent<T extends INetHandler> extends Event {
|
||||
this.type = type;
|
||||
this.manager = manager;
|
||||
}
|
||||
|
||||
public Class<T> getHandlerType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fired at the client when a client connects to a server
|
||||
* @author cpw
|
||||
*
|
||||
*/
|
||||
public static class ClientConnectedToServerEvent extends FMLNetworkEvent<INetHandlerPlayClient> {
|
||||
public final boolean isLocal;
|
||||
|
||||
@@ -21,8 +21,8 @@ import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
public class FMLOutboundHandler extends ChannelOutboundHandlerAdapter {
|
||||
public static final AttributeKey<OutboundTarget> FML_MESSAGETARGET = new AttributeKey<OutboundTarget>("fml:outboundTarget");
|
||||
public static final AttributeKey<Object> FML_MESSAGETARGETARGS = new AttributeKey<Object>("fml:outboundTargetArgs");
|
||||
public static final AttributeKey<OutboundTarget> FML_MESSAGETARGET = AttributeKey.valueOf("fml:outboundTarget");
|
||||
public static final AttributeKey<Object> FML_MESSAGETARGETARGS = AttributeKey.valueOf("fml:outboundTargetArgs");
|
||||
public enum OutboundTarget {
|
||||
/**
|
||||
* The packet is sent nowhere. It will be on the {@link EmbeddedChannel#outboundMessages()} Queue.
|
||||
@@ -124,7 +124,6 @@ public class FMLOutboundHandler extends ChannelOutboundHandlerAdapter {
|
||||
public void validateArgs(Object args)
|
||||
{
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public List<NetworkDispatcher> selectNetworks(Object args, ChannelHandlerContext context, FMLProxyPacket packet)
|
||||
{
|
||||
@@ -152,7 +151,6 @@ public class FMLOutboundHandler extends ChannelOutboundHandlerAdapter {
|
||||
throw new RuntimeException("DIMENSION expects an integer argument");
|
||||
}
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public List<NetworkDispatcher> selectNetworks(Object args, ChannelHandlerContext context, FMLProxyPacket packet)
|
||||
{
|
||||
@@ -187,7 +185,6 @@ public class FMLOutboundHandler extends ChannelOutboundHandlerAdapter {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public List<NetworkDispatcher> selectNetworks(Object args, ChannelHandlerContext context, FMLProxyPacket packet)
|
||||
{
|
||||
|
||||
@@ -8,6 +8,7 @@ import io.netty.channel.ChannelPipeline;
|
||||
import io.netty.channel.ChannelPromise;
|
||||
import io.netty.channel.SimpleChannelInboundHandler;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
@@ -22,7 +23,8 @@ import net.minecraftforge.fml.common.FMLLog;
|
||||
|
||||
public class PacketLoggingHandler
|
||||
{
|
||||
public static void register(NetworkManager manager)
|
||||
@SuppressWarnings("rawtypes")
|
||||
public static void register(NetworkManager manager)
|
||||
{
|
||||
ChannelPipeline pipeline = manager.channel().pipeline();
|
||||
final EnumPacketDirection direction = manager.getDirection();
|
||||
@@ -62,11 +64,13 @@ public class PacketLoggingHandler
|
||||
{
|
||||
String prefix = (direction == EnumPacketDirection.SERVERBOUND ? "SERVER: C->S" : "CLIENT: S->C");
|
||||
@Override
|
||||
protected void decode(ChannelHandlerContext context, ByteBuf input, List output) throws Exception
|
||||
protected void decode(ChannelHandlerContext context, ByteBuf input, List<Object> output) throws Exception
|
||||
{
|
||||
super.decode(context, input, output);
|
||||
for (ByteBuf pkt : (List<ByteBuf>)output)
|
||||
Iterator<Object> itr = output.iterator();
|
||||
while (itr.hasNext())
|
||||
{
|
||||
ByteBuf pkt = (ByteBuf)itr.next();
|
||||
pkt.markReaderIndex();
|
||||
FMLLog.log(Level.DEBUG, "%s:\n%s", prefix, ByteBufUtils.getContentDump(pkt));
|
||||
pkt.resetReaderIndex();
|
||||
|
||||
-1
@@ -1,6 +1,5 @@
|
||||
package net.minecraftforge.fml.common.network.handshake;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraftforge.fml.common.FMLLog;
|
||||
|
||||
+15
-10
@@ -28,6 +28,7 @@ import net.minecraft.network.NetHandlerPlayServer;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.network.play.INetHandlerPlayClient;
|
||||
import net.minecraft.network.play.client.C17PacketCustomPayload;
|
||||
import net.minecraft.network.play.server.S01PacketJoinGame;
|
||||
import net.minecraft.network.play.server.S3FPacketCustomPayload;
|
||||
@@ -35,6 +36,7 @@ import net.minecraft.network.play.server.S40PacketDisconnect;
|
||||
import net.minecraft.server.management.ServerConfigurationManager;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.common.FMLLog;
|
||||
import net.minecraftforge.fml.common.network.FMLNetworkEvent;
|
||||
@@ -48,6 +50,7 @@ import net.minecraftforge.fml.common.network.internal.FMLProxyPacket;
|
||||
import net.minecraftforge.fml.common.registry.GameData;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> implements ChannelOutboundHandler {
|
||||
private static boolean DEBUG_HANDSHAKE = Boolean.parseBoolean(System.getProperty("fml.debugNetworkHandshake", "false"));
|
||||
private static enum ConnectionState {
|
||||
@@ -222,7 +225,7 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> imple
|
||||
this.connectionType = type;
|
||||
FMLLog.info("[%s] Client side %s connection established", Thread.currentThread().getName(), this.connectionType.name().toLowerCase(Locale.ENGLISH));
|
||||
this.state = ConnectionState.CONNECTED;
|
||||
FMLCommonHandler.instance().bus().post(new FMLNetworkEvent.ClientConnectedToServerEvent(manager, this.connectionType.name()));
|
||||
MinecraftForge.EVENT_BUS.post(new FMLNetworkEvent.ClientConnectedToServerEvent(manager, this.connectionType.name()));
|
||||
}
|
||||
|
||||
private synchronized void completeServerSideConnection(ConnectionType type)
|
||||
@@ -230,11 +233,12 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> imple
|
||||
this.connectionType = type;
|
||||
FMLLog.info("[%s] Server side %s connection established", Thread.currentThread().getName(), this.connectionType.name().toLowerCase(Locale.ENGLISH));
|
||||
this.state = ConnectionState.CONNECTED;
|
||||
FMLCommonHandler.instance().bus().post(new FMLNetworkEvent.ServerConnectionFromClientEvent(manager));
|
||||
MinecraftForge.EVENT_BUS.post(new FMLNetworkEvent.ServerConnectionFromClientEvent(manager));
|
||||
if (DEBUG_HANDSHAKE)
|
||||
manager.closeChannel(new ChatComponentText("Handshake Complete review log file for details."));
|
||||
scm.initializeConnectionToPlayer(manager, player, serverHandler);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void channelRead0(ChannelHandlerContext ctx, Packet msg) throws Exception
|
||||
{
|
||||
@@ -257,7 +261,7 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> imple
|
||||
}
|
||||
}
|
||||
|
||||
private boolean handleVanilla(Packet msg)
|
||||
private boolean handleVanilla(Packet<?> msg)
|
||||
{
|
||||
if (state == ConnectionState.AWAITING_HANDSHAKE && msg instanceof S01PacketJoinGame)
|
||||
{
|
||||
@@ -299,7 +303,8 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> imple
|
||||
{
|
||||
kickWithMessage("This is modded. No modded response received. Bye!");
|
||||
}
|
||||
private void kickWithMessage(String message)
|
||||
@SuppressWarnings("unchecked")
|
||||
private void kickWithMessage(String message)
|
||||
{
|
||||
final ChatComponentText chatcomponenttext = new ChatComponentText(message);
|
||||
if (side == Side.CLIENT)
|
||||
@@ -450,11 +455,11 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> imple
|
||||
{
|
||||
if (side == Side.CLIENT)
|
||||
{
|
||||
FMLCommonHandler.instance().bus().post(new FMLNetworkEvent.ClientDisconnectionFromServerEvent(manager));
|
||||
MinecraftForge.EVENT_BUS.post(new FMLNetworkEvent.ClientDisconnectionFromServerEvent(manager));
|
||||
}
|
||||
else
|
||||
{
|
||||
FMLCommonHandler.instance().bus().post(new FMLNetworkEvent.ServerDisconnectionFromClientEvent(manager));
|
||||
MinecraftForge.EVENT_BUS.post(new FMLNetworkEvent.ServerDisconnectionFromClientEvent(manager));
|
||||
}
|
||||
cleanAttributes(ctx);
|
||||
ctx.disconnect(promise);
|
||||
@@ -465,11 +470,11 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> imple
|
||||
{
|
||||
if (side == Side.CLIENT)
|
||||
{
|
||||
FMLCommonHandler.instance().bus().post(new FMLNetworkEvent.ClientDisconnectionFromServerEvent(manager));
|
||||
MinecraftForge.EVENT_BUS.post(new FMLNetworkEvent.ClientDisconnectionFromServerEvent(manager));
|
||||
}
|
||||
else
|
||||
{
|
||||
FMLCommonHandler.instance().bus().post(new FMLNetworkEvent.ServerDisconnectionFromClientEvent(manager));
|
||||
MinecraftForge.EVENT_BUS.post(new FMLNetworkEvent.ServerDisconnectionFromClientEvent(manager));
|
||||
}
|
||||
cleanAttributes(ctx);
|
||||
ctx.close(promise);
|
||||
@@ -500,8 +505,8 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> imple
|
||||
}
|
||||
else
|
||||
{
|
||||
List<Packet> parts = ((FMLProxyPacket)msg).toS3FPackets();
|
||||
for (Packet pkt : parts)
|
||||
List<Packet<INetHandlerPlayClient>> parts = ((FMLProxyPacket)msg).toS3FPackets();
|
||||
for (Packet<INetHandlerPlayClient> pkt : parts)
|
||||
{
|
||||
ctx.write(pkt, promise);
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ public class FMLNetworkHandler
|
||||
embeddedChannel.writeOutbound(new FMLMessage.EntityAdjustMessage(entity, serverX, serverY, serverZ));
|
||||
}
|
||||
|
||||
public static Packet getEntitySpawningPacket(Entity entity)
|
||||
public static Packet<?> getEntitySpawningPacket(Entity entity)
|
||||
{
|
||||
EntityRegistration er = EntityRegistry.instance().lookupModSpawn(entity.getClass(), false);
|
||||
if (er == null)
|
||||
|
||||
@@ -11,6 +11,8 @@ import net.minecraft.network.INetHandler;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.network.play.INetHandlerPlayClient;
|
||||
import net.minecraft.network.play.INetHandlerPlayServer;
|
||||
import net.minecraft.network.play.client.C17PacketCustomPayload;
|
||||
import net.minecraft.network.play.server.S3FPacketCustomPayload;
|
||||
import net.minecraftforge.fml.common.FMLLog;
|
||||
@@ -28,7 +30,7 @@ import com.google.common.collect.Multiset;
|
||||
import com.google.common.collect.Multiset.Entry;
|
||||
import com.google.common.collect.Multisets;
|
||||
|
||||
public class FMLProxyPacket implements Packet {
|
||||
public class FMLProxyPacket implements Packet<INetHandler> {
|
||||
final String channel;
|
||||
private Side target;
|
||||
private final PacketBuffer payload;
|
||||
@@ -117,16 +119,16 @@ public class FMLProxyPacket implements Packet {
|
||||
{
|
||||
return netHandler;
|
||||
}
|
||||
public Packet toC17Packet()
|
||||
public Packet<INetHandlerPlayServer> toC17Packet()
|
||||
{
|
||||
return new C17PacketCustomPayload(channel, payload);
|
||||
}
|
||||
|
||||
static final int PART_SIZE = 0x1000000 - 0x50; // Make it a constant so that it gets inlined below.
|
||||
public static final int MAX_LENGTH = PART_SIZE * 255;
|
||||
public List<Packet> toS3FPackets() throws IOException
|
||||
public List<Packet<INetHandlerPlayClient>> toS3FPackets() throws IOException
|
||||
{
|
||||
List<Packet> ret = Lists.newArrayList();
|
||||
List<Packet<INetHandlerPlayClient>> ret = Lists.newArrayList();
|
||||
byte[] data = payload.array();
|
||||
|
||||
if (data.length < PART_SIZE)
|
||||
|
||||
+1
-1
@@ -165,7 +165,7 @@ public class SimpleNetworkWrapper {
|
||||
* @param message The message to translate into packet form
|
||||
* @return A minecraft {@link Packet} suitable for use in minecraft APIs
|
||||
*/
|
||||
public Packet getPacketFrom(IMessage message)
|
||||
public Packet<?> getPacketFrom(IMessage message)
|
||||
{
|
||||
return channels.get(Side.SERVER).generatePacketFrom(message);
|
||||
}
|
||||
|
||||
@@ -172,7 +172,6 @@ public class EntityRegistry
|
||||
EntityRegistry.registerEgg(entityClass, eggPrimary, eggSecondary);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void doModEntityRegistration(Class<? extends Entity> entityClass, String entityName, int id, Object mod, int trackingRange, int updateFrequency, boolean sendsVelocityUpdates)
|
||||
{
|
||||
ModContainer mc = FMLCommonHandler.instance().findContainerFor(mod);
|
||||
@@ -367,6 +366,7 @@ public class EntityRegistry
|
||||
* @param typeOfCreature type of spawn
|
||||
* @param biomes List of biomes
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static void addSpawn(String entityName, int weightedProb, int min, int max, EnumCreatureType typeOfCreature, BiomeGenBase... biomes)
|
||||
{
|
||||
Class <? extends Entity > entityClazz = EntityList.stringToClassMapping.get(entityName);
|
||||
@@ -406,6 +406,7 @@ public class EntityRegistry
|
||||
* @param typeOfCreature type of spawn
|
||||
* @param biomes Biomes to remove from
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static void removeSpawn(String entityName, EnumCreatureType typeOfCreature, BiomeGenBase... biomes)
|
||||
{
|
||||
Class <? extends Entity > entityClazz = EntityList.stringToClassMapping.get(entityName);
|
||||
|
||||
+1
-5
@@ -17,7 +17,6 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBanner;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.util.ObjectIntIdentityMap;
|
||||
import net.minecraft.util.RegistryNamespaced;
|
||||
import net.minecraft.util.RegistryNamespacedDefaultedByKey;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.common.FMLLog;
|
||||
@@ -26,9 +25,9 @@ import net.minecraftforge.fml.common.registry.RegistryDelegate.Delegate;
|
||||
|
||||
import com.google.common.collect.BiMap;
|
||||
import com.google.common.collect.HashBiMap;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Iterators;
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"}) // cpw is working on these classes just shut them up for now.
|
||||
public class FMLControlledNamespacedRegistry<I> extends RegistryNamespacedDefaultedByKey {
|
||||
public static final boolean DEBUG = Boolean.parseBoolean(System.getProperty("fml.debugRegistryEntries", "false"));
|
||||
private final Class<I> superType;
|
||||
@@ -103,7 +102,6 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespacedDefaul
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
void setFrom(FMLControlledNamespacedRegistry<?> registry) {
|
||||
set((FMLControlledNamespacedRegistry<I>) registry);
|
||||
}
|
||||
@@ -259,7 +257,6 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespacedDefaul
|
||||
* @param obj
|
||||
* @return
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
private I cast(Object obj)
|
||||
{
|
||||
return (I)(obj);
|
||||
@@ -579,7 +576,6 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespacedDefaul
|
||||
* This iterator is used by some regular MC methods to visit all blocks, we need to include substitutions
|
||||
* Compare #typeSafeIterable()
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public Iterator<I> iterator()
|
||||
{
|
||||
|
||||
@@ -12,9 +12,7 @@
|
||||
|
||||
package net.minecraftforge.fml.common.registry;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.BitSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
@@ -30,7 +28,6 @@ import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBanner;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ObjectIntIdentityMap;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
@@ -44,27 +41,18 @@ import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent.MissingMappin
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry.Type;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry.UniqueIdentifier;
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.base.Joiner.MapJoiner;
|
||||
import com.google.common.collect.BiMap;
|
||||
import com.google.common.collect.HashBasedTable;
|
||||
import com.google.common.collect.HashBiMap;
|
||||
import com.google.common.collect.ImmutableBiMap;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableListMultimap;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.google.common.collect.Iterators;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.google.common.collect.Sets.SetView;
|
||||
import com.google.common.collect.Table;
|
||||
import com.google.common.io.Files;
|
||||
|
||||
@SuppressWarnings({"rawtypes", "deprecation", "unchecked", "static-access", "unused"}) // cpw is cleaning these classes up so just suppress everything for now.
|
||||
public class GameData {
|
||||
static final int MIN_BLOCK_ID = 0;
|
||||
static final int MAX_BLOCK_ID = 4095;
|
||||
@@ -965,7 +953,6 @@ public class GameData {
|
||||
|
||||
private BiMap<String, Item> itemSubstitutions = HashBiMap.create();
|
||||
private BiMap<String, Block> blockSubstitutions = HashBiMap.create();
|
||||
@SuppressWarnings("unchecked")
|
||||
<T> BiMap<String, T> getPersistentSubstitutionMap(Class<T> type)
|
||||
{
|
||||
if (type.equals(Item.class))
|
||||
@@ -1024,13 +1011,11 @@ public class GameData {
|
||||
findSuperTypes(type.getSuperclass(),types);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private <T> FMLControlledNamespacedRegistry<T> getGenericRegistry(String registryName, Class<T> type) {
|
||||
FMLControlledNamespacedRegistry<?> fmlControlledNamespacedRegistry = genericRegistries.get(registryName);
|
||||
return (FMLControlledNamespacedRegistry<T>) fmlControlledNamespacedRegistry;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private <T> FMLControlledNamespacedRegistry<T> createGenericRegistry(String registryName, Class<T> type, int minId, int maxId) {
|
||||
Set<Class<?>> parents = Sets.newHashSet();
|
||||
findSuperTypes(type, parents);
|
||||
|
||||
@@ -194,6 +194,7 @@ public class GameRegistry
|
||||
* @param name The mod-unique name to register it as, will get prefixed by your modid.
|
||||
* @param itemCtorArgs Arguments to pass (after the required {@code Block} parameter) to the ItemBlock constructor (optional).
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static Block registerBlock(Block block, Class<? extends ItemBlock> itemclass, String name, Object... itemCtorArgs)
|
||||
{
|
||||
if (Loader.instance().isInState(LoaderState.CONSTRUCTING))
|
||||
|
||||
@@ -49,6 +49,7 @@ class ObjectHolderRef {
|
||||
}
|
||||
else
|
||||
{
|
||||
@SuppressWarnings("unchecked")
|
||||
Object tmp = isBlock ? GameData.getBlockRegistry().getNameForObject(existing) :
|
||||
isItem ? GameData.getItemRegistry().getNameForObject(existing) : null;
|
||||
this.injectedObject = tmp != null ? tmp.toString() : null;
|
||||
|
||||
@@ -12,19 +12,13 @@
|
||||
|
||||
package net.minecraftforge.fml.common.registry;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang3.Validate;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.passive.EntityVillager;
|
||||
import net.minecraft.entity.passive.EntityVillager.*;
|
||||
import net.minecraft.init.Blocks;
|
||||
@@ -33,11 +27,7 @@ import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ObjectIntIdentityMap;
|
||||
import net.minecraft.util.RegistryNamespacedDefaultedByKey;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.Tuple;
|
||||
import net.minecraft.village.MerchantRecipeList;
|
||||
import net.minecraft.world.gen.structure.StructureComponent;
|
||||
import net.minecraft.world.gen.structure.StructureVillagePieces;
|
||||
import net.minecraft.world.gen.structure.StructureVillagePieces.PieceWeight;
|
||||
@@ -46,10 +36,8 @@ import net.minecraftforge.fml.common.FMLLog;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import com.google.common.collect.ArrayListMultimap;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
/**
|
||||
* Registry for villager trading control
|
||||
@@ -203,6 +191,7 @@ public class VillagerRegistry
|
||||
{
|
||||
register(prof, -1);
|
||||
}
|
||||
@SuppressWarnings("deprecation")
|
||||
private void register(VillagerProfession prof, int id)
|
||||
{
|
||||
professions.register(id, prof.name, prof);
|
||||
@@ -253,14 +242,14 @@ public class VillagerRegistry
|
||||
public static class VillagerProfession
|
||||
{
|
||||
private ResourceLocation name;
|
||||
private ResourceLocation texture;
|
||||
//private ResourceLocation texture;
|
||||
private List<VillagerCareer> careers = Lists.newArrayList();
|
||||
private RegistryDelegate<VillagerProfession> delegate = GameData.getRegistry("villagerprofessions", VillagerProfession.class).getDelegate(this, VillagerProfession.class);
|
||||
|
||||
public VillagerProfession(String name, String texture)
|
||||
{
|
||||
this.name = new ResourceLocation(name);
|
||||
this.texture = new ResourceLocation(texture);
|
||||
//this.texture = new ResourceLocation(texture);
|
||||
((RegistryDelegate.Delegate<VillagerProfession>)delegate).setName(name);
|
||||
}
|
||||
|
||||
@@ -268,7 +257,7 @@ public class VillagerRegistry
|
||||
{
|
||||
Validate.isTrue(!careers.contains(career), "Attempted to register career that is already registered.");
|
||||
Validate.isTrue(career.profession == this, "Attempted to register career for the wrong profession.");
|
||||
career.id = careers.size();
|
||||
//career.id = careers.size();
|
||||
careers.add(career);
|
||||
}
|
||||
}
|
||||
@@ -277,7 +266,7 @@ public class VillagerRegistry
|
||||
{
|
||||
private VillagerProfession profession;
|
||||
private String name;
|
||||
private int id;
|
||||
//private int id;
|
||||
public VillagerCareer(VillagerProfession parent, String name)
|
||||
{
|
||||
this.profession = parent;
|
||||
@@ -308,8 +297,8 @@ public class VillagerRegistry
|
||||
*/
|
||||
public static void setRandomProfession(EntityVillager entity, Random rand)
|
||||
{
|
||||
Set<String> entries = INSTANCE.professions.getKeys();
|
||||
int prof = rand.nextInt(entries.size());
|
||||
//int count = INSTANCE.professions.getKeys().size();
|
||||
//int prof = rand.nextInt(count);
|
||||
//TODO: Grab id range from internal registry
|
||||
entity.setProfession(rand.nextInt(5));
|
||||
}
|
||||
|
||||
@@ -25,12 +25,12 @@ public class ReflectionHelper
|
||||
public static class UnableToFindMethodException extends RuntimeException
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String[] methodNames;
|
||||
//private String[] methodNames;
|
||||
|
||||
public UnableToFindMethodException(String[] methodNames, Exception failed)
|
||||
{
|
||||
super(failed);
|
||||
this.methodNames = methodNames;
|
||||
//this.methodNames = methodNames;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -38,12 +38,12 @@ public class ReflectionHelper
|
||||
public static class UnableToFindClassException extends RuntimeException
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String[] classNames;
|
||||
//private String[] classNames;
|
||||
|
||||
public UnableToFindClassException(String[] classNames, Exception err)
|
||||
{
|
||||
super(err);
|
||||
this.classNames = classNames;
|
||||
//this.classNames = classNames;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -51,23 +51,23 @@ public class ReflectionHelper
|
||||
public static class UnableToAccessFieldException extends RuntimeException
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String[] fieldNameList;
|
||||
//private String[] fieldNameList;
|
||||
|
||||
public UnableToAccessFieldException(String[] fieldNames, Exception e)
|
||||
{
|
||||
super(e);
|
||||
this.fieldNameList = fieldNames;
|
||||
//this.fieldNameList = fieldNames;
|
||||
}
|
||||
}
|
||||
|
||||
public static class UnableToFindFieldException extends RuntimeException
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String[] fieldNameList;
|
||||
//private String[] fieldNameList;
|
||||
public UnableToFindFieldException(String[] fieldNameList, Exception e)
|
||||
{
|
||||
super(e);
|
||||
this.fieldNameList = fieldNameList;
|
||||
//this.fieldNameList = fieldNameList;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +1,11 @@
|
||||
package net.minecraftforge.oredict;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
import java.util.Map;
|
||||
import java.util.RandomAccess;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
@@ -55,7 +50,6 @@ public class OreDictionary
|
||||
initVanillaEntries();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static void initVanillaEntries()
|
||||
{
|
||||
if (!hasInit)
|
||||
@@ -406,7 +400,7 @@ public class OreDictionary
|
||||
return false;
|
||||
}
|
||||
|
||||
private static boolean containsMatch(boolean strict, List<ItemStack> inputs, ItemStack... targets)
|
||||
public static boolean containsMatch(boolean strict, List<ItemStack> inputs, ItemStack... targets)
|
||||
{
|
||||
for (ItemStack input : inputs)
|
||||
{
|
||||
|
||||
@@ -143,7 +143,6 @@ public class RecipeSorter implements Comparator<IRecipe>
|
||||
}
|
||||
|
||||
private static Set<Class> warned = Sets.newHashSet();
|
||||
@SuppressWarnings("unchecked")
|
||||
public static void sortCraftManager()
|
||||
{
|
||||
bake();
|
||||
|
||||
@@ -56,7 +56,6 @@ public class ShapelessOreRecipe implements IRecipe
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
ShapelessOreRecipe(ShapelessRecipes recipe, Map<ItemStack, String> replacements)
|
||||
{
|
||||
output = recipe.getRecipeOutput();
|
||||
|
||||
Loaded 100 of 108 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user