Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/openblocks/client/SoundEventsManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public void tickUpdate() {
}
}

private ManualDisplayList notPumpkinOverlay = new ManualDisplayList();
private final ManualDisplayList notPumpkinOverlay = new ManualDisplayList();
private static final ResourceLocation notPumpkin = new ResourceLocation(
"openblocks:textures/misc/glasses_obsidian.png");

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/openblocks/client/SoundIconRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ private void registerIcons(int type, IIconRegister registry) {

private static class MobSounds implements ISoundCategory {

private Map<String, MobIcons> mobs = Maps.newHashMap();
private MobIcons unknownMob;
private final Map<String, MobIcons> mobs = Maps.newHashMap();
private final MobIcons unknownMob;

private static MobIcons createMobIcons(String innerIcon, int innerColor, int frameColor) {
IDrawableIcon frame = itemIcon(ICON_FRAME, frameColor);
Expand Down Expand Up @@ -205,7 +205,7 @@ public void registerIcons(int type, IIconRegister registry) {

private final Map<String, MappedCategory> roots = Maps.newHashMap();

private Map<ResourceLocation, IDrawableIcon> iconCache = Maps.newConcurrentMap();
private final Map<ResourceLocation, IDrawableIcon> iconCache = Maps.newConcurrentMap();

public static final int DEFAULT_COLOR = 0xFFFFFF;

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/openblocks/client/gui/GuiDonationStation.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ public class GuiDonationStation extends BaseGuiContainer<ContainerDonationStatio
private final int PROMPT_REPLY_ACTION = 0;

private URI displayedURI = null;
private GuiComponentLabel lblModName;
private GuiComponentTextButton buttonDonate;
private GuiComponentLabel lblAuthors;
private final GuiComponentLabel lblModName;
private final GuiComponentTextButton buttonDonate;
private final GuiComponentLabel lblAuthors;

public GuiDonationStation(ContainerDonationStation container) {
super(container, 176, 172, "openblocks.gui.donationstation");
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/openblocks/client/gui/GuiDrawingTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class GuiDrawingTable extends BaseGuiContainer<ContainerDrawingTable> {

public static final int BUTTON_DRAW = 0;

private GuiComponentSprite iconDisplay;
private final GuiComponentSprite iconDisplay;

private int patternIndex = 0;

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/openblocks/client/gui/GuiProjector.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class GuiProjector extends BaseGuiContainer<ContainerProjector> {

private static final int VIEW_HEIGHT = 138;
private static final int VIEW_WIDTH = 160;
private TrackballWrapper trackball = new TrackballWrapper(1, 150);
private final TrackballWrapper trackball = new TrackballWrapper(1, 150);

private static IMouseDownListener createRotationListener(final IRotatable proxy, final int direction) {
return new IMouseDownListener() {
Expand Down Expand Up @@ -69,7 +69,7 @@ protected BaseComposite createRoot() {
}

private boolean isInitialized;
private int scale = 90;
private final int scale = 90;
private double mapHeight = 2;

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/openblocks/client/gui/StandardPalette.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public enum StandardPalette {
red(0xc88a84),
purple(0xc884bf);

private int color;
private final int color;

StandardPalette(int col) {
this.color = col;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/openblocks/client/gui/page/IntroPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

public class IntroPage extends PageBase {

private GuiComponentSprite image;
private final GuiComponentSprite image;

private static final ResourceLocation texture = new ResourceLocation("openblocks:textures/gui/bookimage.png");
public static IIcon iconImage = new FakeIcon(0, 0.7421875f, 0, 0.546875f, 95, 70);
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/openblocks/client/model/ModelCannon.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@

public class ModelCannon extends ModelBase {

private double[] keyframes = new double[] { 0, 0.5, 1, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1, 0 };
private final double[] keyframes = new double[] { 0, 0.5, 1, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1, 0 };

ModelRenderer body;
ModelRenderer shooter;
ModelRenderer base;
ModelRenderer wheel;

private float deg30 = (float) Math.toRadians(30);
private float deg180 = (float) Math.toRadians(180);
private final float deg30 = (float) Math.toRadians(30);
private final float deg180 = (float) Math.toRadians(180);

public ModelCannon() {
textureWidth = 64;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/openblocks/client/model/ModelSleepingBag.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ public class ModelSleepingBag extends ModelBiped {

public static final ModelSleepingBag instance = new ModelSleepingBag();

private ModelRenderer main;
private ModelRenderer pillow;
private final ModelRenderer main;
private final ModelRenderer pillow;

public ModelSleepingBag() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

public class BlockCanvasRenderer implements IBlockRenderer<BlockCanvas> {

public FixedRenderBlocks renderBlocks = new FixedRenderBlocks();
private final FixedRenderBlocks renderBlocks = new FixedRenderBlocks();

@Override
public void renderInventoryBlock(BlockCanvas block, int metadata, int modelID, RenderBlocks renderer) {
Expand Down Expand Up @@ -71,6 +71,8 @@ public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, BlockCa
RenderUtils.resetFacesOnRenderer(renderBlocks);
}

renderBlocks.setWorld(null);

return visible;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

public class EntityGoldenEyeRenderer extends Render {

private Tessellator tes = new Tessellator();
private final Tessellator tes = new Tessellator();

@Override
public void doRender(Entity entity, double x, double y, double z, float f1, float partialTickTime) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

public class EntityLuggageRenderer extends RenderLiving {

private static ModelBase luggageModel = new ModelLuggage();
private static final ModelBase luggageModel = new ModelLuggage();

private static final ResourceLocation texture = new ResourceLocation("openblocks", "textures/models/luggage.png");
private static final ResourceLocation textureSpecial = new ResourceLocation(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected Counter initialValue() {
}
};

private DisplayListWrapper cube = new DisplayListWrapper() {
private final DisplayListWrapper cube = new DisplayListWrapper() {

@Override
public void compile() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,20 @@ public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
GL11.glPushMatrix();

EntityLuggage luggage = this.luggage.get();
luggage.worldObj = Minecraft.getMinecraft().theWorld;
try {
luggage.worldObj = Minecraft.getMinecraft().theWorld;

GL11.glTranslatef(0.5f, 0, 0.5f);
luggage.getInventory().clearAndSetSlotCount(27);
if (item.hasTagCompound()) {
luggage.getInventory().readFromNBT(item.getTagCompound());
}
Render renderer = RenderManager.instance.getEntityRenderObject(luggage);
if (renderer.getFontRendererFromRenderManager() != null) {
renderer.doRender(luggage, 0, 0, 0, 0, 0.5f);
GL11.glTranslatef(0.5f, 0, 0.5f);
luggage.getInventory().clearAndSetSlotCount(27);
if (item.hasTagCompound()) {
luggage.getInventory().readFromNBT(item.getTagCompound());
}
Render renderer = RenderManager.instance.getEntityRenderObject(luggage);
if (renderer.getFontRendererFromRenderManager() != null) {
renderer.doRender(luggage, 0, 0, 0, 0, 0.5f);
}
} finally {
luggage.worldObj = null;
}
GL11.glPopMatrix();
GL11.glEnable(GL11.GL_TEXTURE_2D);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

public class ItemRendererTank implements IItemRenderer {

private FluidTank tank = new FluidTank(TileEntityTank.getTankCapacity());
private final FluidTank tank = new FluidTank(TileEntityTank.getTankCapacity());

@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

public class TileEntityAutoAnvilRenderer extends TileEntitySpecialRenderer {

private ModelAutoAnvil model = new ModelAutoAnvil();
private final ModelAutoAnvil model = new ModelAutoAnvil();
private static final ResourceLocation texture = new ResourceLocation("openblocks", "textures/models/autoanvil.png");

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class TileEntityAutoEnchantmentTableRenderer extends TileEntitySpecialRen

private static final ResourceLocation enchantingTableBookTextures = new ResourceLocation(
"textures/entity/enchanting_table_book.png");
private ModelBook enchantmentBook = new ModelBook();
private final ModelBook enchantmentBook = new ModelBook();

@Override
public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

public class TileEntityBearTrapRenderer extends TileEntitySpecialRenderer {

private ModelBearTrap model = new ModelBearTrap();
private final ModelBearTrap model = new ModelBearTrap();

private static final ResourceLocation texture = new ResourceLocation("openblocks", "textures/models/beartrap.png");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

public class TileEntityCannonRenderer extends TileEntitySpecialRenderer {

private ModelCannon model = new ModelCannon();
private final ModelCannon model = new ModelCannon();
private static final ResourceLocation texture = new ResourceLocation("openblocks", "textures/models/cannon.png");

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

public class TileEntityDonationStationRenderer extends TileEntitySpecialRenderer {

private ModelPiggy model = new ModelPiggy();
private final ModelPiggy model = new ModelPiggy();
private static final ResourceLocation texture = new ResourceLocation("openblocks", "textures/models/piggy.png");

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

public class TileEntityFanRenderer extends TileEntitySpecialRenderer {

private ModelFan model = new ModelFan();
private final ModelFan model = new ModelFan();
private static final ResourceLocation texture = new ResourceLocation("openblocks", "textures/models/fan.png");

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

public class TileEntityGraveRenderer extends TileEntitySpecialRenderer {

private ModelGrave model = new ModelGrave();
private final ModelGrave model = new ModelGrave();
private static final ResourceLocation texture = new ResourceLocation("openblocks", "textures/models/grave.png");

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
public class TileEntityPaintMixerRenderer extends TileEntitySpecialRenderer {

RenderBlocks renderer = new RenderBlocks();
private ModelPaintMixer model = new ModelPaintMixer();
private final ModelPaintMixer model = new ModelPaintMixer();
private static final ResourceLocation texture = new ResourceLocation(
"openblocks",
"textures/models/paintmixer.png");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class TileEntityProjectorRenderer extends TileEntitySpecialRenderer {
private final static ResourceLocation TEXTURE = new ResourceLocation("openblocks", "textures/models/projector.png");
private static final float BLOCK_CENTRE_TRANSLATION = 0.5F;

private static ModelProjector model = new ModelProjector();
private static final ModelProjector model = new ModelProjector();

@Override
public void renderTileEntityAt(final TileEntity te, final double x, final double y, final double z,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

public class TileEntitySprinklerRenderer extends TileEntitySpecialRenderer {

private ModelSprinkler model = new ModelSprinkler();
private final ModelSprinkler model = new ModelSprinkler();
private static final ResourceLocation texture = new ResourceLocation("openblocks", "textures/models/sprinkler.png");

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package openblocks.client.renderer.tileentity;

import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
Expand All @@ -23,8 +22,6 @@

public class TileEntityTankRenderer extends TileEntitySpecialRenderer {

RenderBlocks renderBlocks = new RenderBlocks();

@Override
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float f) {
TileEntityTank tankTile = (TileEntityTank) te;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

public class TileEntityTargetRenderer extends TileEntitySpecialRenderer {

private ModelTarget model = new ModelTarget();
private final ModelTarget model = new ModelTarget();
private static final ResourceLocation texture = new ResourceLocation("openblocks", "textures/models/target.png");

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

public class TileEntityVacuumHopperRenderer extends TileEntitySpecialRenderer {

private ModelVacuumHopper model = new ModelVacuumHopper();
private final ModelVacuumHopper model = new ModelVacuumHopper();

private static final ResourceLocation texture = new ResourceLocation(
"openblocks",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
public class TileEntityVillageHighlighterRenderer extends TileEntitySpecialRenderer {

private static final AxisAlignedBB BOUNDING_BOX = AxisAlignedBB.getBoundingBox(-8, -3, -8, 8, 3, 8);
private ModelVillage model = new ModelVillage();
private final ModelVillage model = new ModelVillage();
private static final ResourceLocation texture = new ResourceLocation("openblocks", "textures/models/village.png");

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

public class TileEntityXPShowerRenderer extends TileEntitySpecialRenderer {

private ModelXPShower model = new ModelXPShower();
private final ModelXPShower model = new ModelXPShower();
private static final ResourceLocation texture = new ResourceLocation("openblocks", "textures/models/xpshower.png");

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

public class GuideLegacyRenderer implements IGuideRenderer {

private DisplayListWrapper wrapper;
private final DisplayListWrapper wrapper;

public GuideLegacyRenderer(final Runnable model) {
wrapper = new DisplayListWrapper() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class TileEntityBuilderGuideRenderer extends TileEntityGuideRenderer {
private static final float OMEGA_32 = 0.0351f;
private static final float DELTA_32 = 0.7635f;

private DisplayListWrapper cube = new DisplayListWrapper() {
private final DisplayListWrapper cube = new DisplayListWrapper() {

@Override
public void compile() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

public class NeighbourMap implements INeighbourMap {

private boolean[] neighbors = new boolean[64];
private final boolean[] neighbors = new boolean[64];

public NeighbourMap(World world, int x, int y, int z, FluidStack fluid) {
if (world == null) return;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/openblocks/common/CraneRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public void updateLength() {
}
}

private Map<EntityPlayer, Data> itemData = new MapMaker().weakKeys().makeMap();
private Map<EntityPlayer, EntityMagnet> playersMagnets = new MapMaker().weakKeys().weakValues().makeMap();
private final Map<EntityPlayer, Data> itemData = new MapMaker().weakKeys().makeMap();
private final Map<EntityPlayer, EntityMagnet> playersMagnets = new MapMaker().weakKeys().weakValues().makeMap();

public void ensureMagnetExists(EntityPlayer player) {
EntityMagnet magnet = playersMagnets.get(player);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/openblocks/common/DonationUrlManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static DonationUrlManager instance() {
return instance;
}

private HashMap<String, String> donationUrls = new HashMap<String, String>();
private final HashMap<String, String> donationUrls = new HashMap<String, String>();

public DonationUrlManager() {
addUrl(Mods.OPENBLOCKS, "https://www.patreon.com/openmods");
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/openblocks/common/MapDataManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ protected void writeToStream(DataOutput output) throws IOException {

private Set<Block> blockBlacklist;

private Set<Integer> mapsToUpdate = Sets.newHashSet();
private final Set<Integer> mapsToUpdate = Sets.newHashSet();

public static int createNewMap(World world, byte scale) {
int id = world.getUniqueDataId("height_map");
Expand Down
Loading
Loading