Skip to content

Commit 4ad2494

Browse files
authored
Merge pull request #34 from TBoshoven/1.15.2-static-analysis
Several changes based on static analysis
2 parents c135b72 + da35338 commit 4ad2494

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+194
-171
lines changed

MagicDoorknob/src/main/java/com/tomboshoven/minecraft/magicdoorknob/MagicDoorknobMod.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
@ParametersAreNonnullByDefault
1919
@MethodsReturnNonnullByDefault
2020
@Mod(MagicDoorknobMod.MOD_ID)
21-
public class MagicDoorknobMod {
21+
public final class MagicDoorknobMod {
2222
public static final String MOD_ID = "magic_doorknob";
2323

2424
public MagicDoorknobMod() {

MagicDoorknob/src/main/java/com/tomboshoven/minecraft/magicdoorknob/blocks/Blocks.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public final class Blocks {
3030
* - Not replaceable
3131
* - Block pushes
3232
*/
33-
private static Material DOORWAY_MATERIAL = new Material(MaterialColor.AIR, false, true, true, true, true, false, false, PushReaction.BLOCK);
33+
private static final Material DOORWAY_MATERIAL = new Material(MaterialColor.AIR, false, true, true, true, true, false, false, PushReaction.BLOCK);
3434

3535
/**
3636
* A magic doorway block. Generated by a magic doorknob.

MagicDoorknob/src/main/java/com/tomboshoven/minecraft/magicdoorknob/blocks/MagicDoorBlock.java

+14-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.tomboshoven.minecraft.magicdoorknob.blocks;
22

33
import com.tomboshoven.minecraft.magicdoorknob.blocks.tileentities.MagicDoorTileEntity;
4+
import com.tomboshoven.minecraft.magicdoorknob.blocks.tileentities.MagicDoorwayPartBaseTileEntity;
45
import com.tomboshoven.minecraft.magicdoorknob.items.MagicDoorknobItem;
56
import mcp.MethodsReturnNonnullByDefault;
67
import net.minecraft.block.Block;
@@ -46,13 +47,18 @@ public class MagicDoorBlock extends MagicDoorwayPartBaseBlock {
4647
public static final EnumProperty<Direction> HORIZONTAL_FACING = BlockStateProperties.HORIZONTAL_FACING;
4748

4849
// Indexed by horizontal index
49-
private static final VoxelShape[] SHAPES = new VoxelShape[]{
50+
private static final VoxelShape[] SHAPES = {
5051
Block.makeCuboidShape(0, 0, 0, 1, 16, 16),
5152
Block.makeCuboidShape(0, 0, 0, 16, 16, 1),
5253
Block.makeCuboidShape(15, 0, 0, 16, 16, 16),
5354
Block.makeCuboidShape(0, 0, 15, 16, 16, 16),
5455
};
5556

57+
/**
58+
* Maximum number of doorway blocks to break when closing a doorway.
59+
*/
60+
private static final int DOORWAY_BREAK_MAX_DEPTH = 32;
61+
5662
MagicDoorBlock(Properties properties) {
5763
super(properties);
5864
}
@@ -62,7 +68,7 @@ public SoundType getSoundType(BlockState state, IWorldReader world, BlockPos pos
6268
// Return the sound type of the base block, except that placing and removing it are door open and close sounds.
6369
TileEntity tileEntity = world.getTileEntity(pos);
6470
if (tileEntity instanceof MagicDoorTileEntity) {
65-
BlockState textureBlock = ((MagicDoorTileEntity) tileEntity).getBaseBlockState();
71+
BlockState textureBlock = ((MagicDoorwayPartBaseTileEntity) tileEntity).getBaseBlockState();
6672
SoundType actualSoundType = textureBlock.getBlock().getSoundType(textureBlock, world, pos, null);
6773
return new SoundType(
6874
actualSoundType.volume,
@@ -85,10 +91,10 @@ public SoundType getSoundType(BlockState state, IWorldReader world, BlockPos pos
8591
* @return The doorknob if it can be found
8692
*/
8793
@Nullable
88-
private MagicDoorknobItem getDoorknob(World world, BlockPos pos) {
94+
private static MagicDoorknobItem getDoorknob(IBlockReader world, BlockPos pos) {
8995
TileEntity tileEntity = world.getTileEntity(pos);
9096
if (tileEntity instanceof MagicDoorTileEntity) {
91-
return ((MagicDoorTileEntity) tileEntity).getDoorknob();
97+
return ((MagicDoorwayPartBaseTileEntity) tileEntity).getDoorknob();
9298
}
9399
return null;
94100
}
@@ -122,12 +128,12 @@ public void onReplaced(BlockState state, World worldIn, BlockPos pos, BlockState
122128
* @param pos The position of the door block
123129
* @param facing The direction the door is facing in (opposite to doorway)
124130
*/
125-
private void breakDoorway(World world, BlockPos pos, Direction facing) {
131+
private static void breakDoorway(World world, BlockPos pos, Direction facing) {
126132
Direction doorwayFacing = facing.getOpposite();
127133

128134
MagicDoorknobItem doorknob = getDoorknob(world, pos);
129135
// If the doorknob can't be found, just go with some high number (32)
130-
float depth = doorknob == null ? 32 : doorknob.getTier().getEfficiency();
136+
float depth = doorknob == null ? DOORWAY_BREAK_MAX_DEPTH : doorknob.getTier().getEfficiency();
131137

132138
for (int i = 1; i <= depth; ++i) {
133139
BlockPos blockPos = pos.offset(doorwayFacing, i);
@@ -140,7 +146,7 @@ private void breakDoorway(World world, BlockPos pos, Direction facing) {
140146

141147
@SuppressWarnings("deprecation")
142148
@Override
143-
public VoxelShape getShape(BlockState state, IBlockReader world, BlockPos pos, ISelectionContext selectionContext) {
149+
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
144150
return SHAPES[state.get(HORIZONTAL_FACING).getHorizontalIndex()];
145151
}
146152

@@ -156,7 +162,7 @@ public TileEntity createTileEntity(BlockState state, IBlockReader world) {
156162

157163
@SuppressWarnings("deprecation")
158164
@Override
159-
public ActionResultType onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity playerIn, Hand hand, BlockRayTraceResult rayTraceResult) {
165+
public ActionResultType onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
160166
if (!worldIn.isRemote) {
161167
worldIn.destroyBlock(pos, false);
162168
}

MagicDoorknob/src/main/java/com/tomboshoven/minecraft/magicdoorknob/blocks/MagicDoorwayBlock.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.tomboshoven.minecraft.magicdoorknob.blocks;
22

3+
import com.tomboshoven.minecraft.magicdoorknob.blocks.tileentities.MagicDoorwayPartBaseTileEntity;
34
import com.tomboshoven.minecraft.magicdoorknob.blocks.tileentities.MagicDoorwayTileEntity;
45
import mcp.MethodsReturnNonnullByDefault;
56
import net.minecraft.block.Block;
@@ -91,16 +92,16 @@ public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos,
9192

9293
@SuppressWarnings("deprecation")
9394
@Override
94-
public void onReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean isMoving) {
95-
if (newState.isAir(world, pos)) {
95+
public void onReplaced(BlockState state, World worldIn, BlockPos pos, BlockState newState, boolean isMoving) {
96+
if (newState.isAir(worldIn, pos)) {
9697
// When this block is destroyed (manually or by closing the door), replace it by its base block.
97-
TileEntity tileEntity = world.getTileEntity(pos);
98+
TileEntity tileEntity = worldIn.getTileEntity(pos);
9899
if (tileEntity instanceof MagicDoorwayTileEntity) {
99-
world.setBlockState(pos, ((MagicDoorwayTileEntity) tileEntity).getBaseBlockState());
100+
worldIn.setBlockState(pos, ((MagicDoorwayPartBaseTileEntity) tileEntity).getBaseBlockState());
100101
}
101102
}
102103

103-
super.onReplaced(state, world, pos, newState, isMoving);
104+
super.onReplaced(state, worldIn, pos, newState, isMoving);
104105
}
105106

106107
@Override

MagicDoorknob/src/main/java/com/tomboshoven/minecraft/magicdoorknob/blocks/MagicDoorwayPartBaseBlock.java

+8-8
Original file line numberDiff line numberDiff line change
@@ -57,24 +57,24 @@ public int getLightValue(BlockState state, IBlockReader world, BlockPos pos) {
5757

5858
@SuppressWarnings("deprecation")
5959
@Override
60-
public int getOpacity(BlockState state, IBlockReader world, BlockPos pos) {
60+
public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) {
6161
// Use the base block's light opacity.
62-
TileEntity tileEntity = world.getTileEntity(pos);
62+
TileEntity tileEntity = worldIn.getTileEntity(pos);
6363
if (tileEntity instanceof MagicDoorwayPartBaseTileEntity) {
64-
return ((MagicDoorwayPartBaseTileEntity) tileEntity).getBaseBlockState().getOpacity(world, pos);
64+
return ((MagicDoorwayPartBaseTileEntity) tileEntity).getBaseBlockState().getOpacity(worldIn, pos);
6565
}
66-
return super.getOpacity(state, world, pos);
66+
return super.getOpacity(state, worldIn, pos);
6767
}
6868

6969
@SuppressWarnings("deprecation")
7070
@Override
71-
public float getBlockHardness(BlockState blockState, IBlockReader world, BlockPos pos) {
71+
public float getBlockHardness(BlockState blockState, IBlockReader worldIn, BlockPos pos) {
7272
// Use the base block's hardness.
73-
TileEntity tileEntity = world.getTileEntity(pos);
73+
TileEntity tileEntity = worldIn.getTileEntity(pos);
7474
if (tileEntity instanceof MagicDoorwayPartBaseTileEntity) {
75-
return ((MagicDoorwayPartBaseTileEntity) tileEntity).getBaseBlockState().getBlockHardness(world, pos);
75+
return ((MagicDoorwayPartBaseTileEntity) tileEntity).getBaseBlockState().getBlockHardness(worldIn, pos);
7676
}
77-
return super.getBlockHardness(blockState, world, pos);
77+
return super.getBlockHardness(blockState, worldIn, pos);
7878
}
7979

8080
@Override

MagicDoorknob/src/main/java/com/tomboshoven/minecraft/magicdoorknob/blocks/tileentities/MagicDoorwayPartBaseTileEntity.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ public abstract class MagicDoorwayPartBaseTileEntity extends TileEntity {
5353
/**
5454
* All parts of the model that need to be textured.
5555
*/
56-
private static final String[] SUBMODEL_NAMES = new String[] {"door", "doorknob", "top", "wall1", "wall2", "pillar1", "pillar2", "pillar3", "pillar4"};
56+
private static final String[] SUBMODEL_NAMES = {"door", "doorknob", "top", "wall1", "wall2", "pillar1", "pillar2", "pillar3", "pillar4"};
5757

5858
// The block we're basing the appearance of this block on.
5959
private BlockState baseBlockState = Blocks.AIR.getDefaultState();
6060
// The doorknob that caused this block to be created.
6161
private MagicDoorknobItem doorknob;
6262

63-
public MagicDoorwayPartBaseTileEntity(TileEntityType<? extends MagicDoorwayPartBaseTileEntity> tileEntityType) {
63+
MagicDoorwayPartBaseTileEntity(TileEntityType<? extends MagicDoorwayPartBaseTileEntity> tileEntityType) {
6464
super(tileEntityType);
6565
}
6666

@@ -115,7 +115,6 @@ public IModelData getModelData() {
115115

116116
// Get the base block texture
117117
World world = getWorld();
118-
BlockState baseBlockState = getBaseBlockState();
119118
TextureAtlasSprite blockTexture = world == null ? null : blockModelShapes.getTexture(baseBlockState, world, getPos());
120119
Material blockMaterial;
121120
if (blockTexture == null || blockTexture instanceof MissingTextureSprite) {
@@ -127,7 +126,6 @@ public IModelData getModelData() {
127126
}
128127

129128
// Get the highlight texture
130-
MagicDoorknobItem doorknob = getDoorknob();
131129
Material doorknobMaterial;
132130
if (doorknob != null) {
133131
doorknobMaterial = doorknob.getMainMaterial();

MagicDoorknob/src/main/java/com/tomboshoven/minecraft/magicdoorknob/blocks/tileentities/TileEntities.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
import net.minecraftforge.registries.IForgeRegistry;
99

1010
@SuppressWarnings("ConstantConditions")
11-
public class TileEntities {
12-
static TileEntityType<MagicDoorTileEntity> MAGIC_DOOR = TileEntityType.Builder.create(MagicDoorTileEntity::new, Blocks.MAGIC_DOOR).build(null);
13-
static TileEntityType<MagicDoorwayTileEntity> MAGIC_DOORWAY = TileEntityType.Builder.create(MagicDoorwayTileEntity::new, Blocks.MAGIC_DOORWAY).build(null);
11+
public final class TileEntities {
12+
static final TileEntityType<MagicDoorTileEntity> MAGIC_DOOR = TileEntityType.Builder.create(MagicDoorTileEntity::new, Blocks.MAGIC_DOOR).build(null);
13+
static final TileEntityType<MagicDoorwayTileEntity> MAGIC_DOORWAY = TileEntityType.Builder.create(MagicDoorwayTileEntity::new, Blocks.MAGIC_DOORWAY).build(null);
1414

1515
@SubscribeEvent
1616
public static void registerTileEntities(RegistryEvent.Register<TileEntityType<?>> evt) {

MagicDoorknob/src/main/java/com/tomboshoven/minecraft/magicdoorknob/data/BlockStates.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
@ParametersAreNonnullByDefault
2121
@MethodsReturnNonnullByDefault
22-
public class BlockStates extends BlockStateProvider {
23-
public BlockStates(DataGenerator gen, ExistingFileHelper existingFileHelper) {
22+
class BlockStates extends BlockStateProvider {
23+
BlockStates(DataGenerator gen, ExistingFileHelper existingFileHelper) {
2424
super(gen, MagicDoorknobMod.MOD_ID, existingFileHelper);
2525
}
2626

MagicDoorknob/src/main/java/com/tomboshoven/minecraft/magicdoorknob/data/DataGenerators.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
@ParametersAreNonnullByDefault
1212
@MethodsReturnNonnullByDefault
13-
public class DataGenerators {
13+
public final class DataGenerators {
1414
@SubscribeEvent
1515
public static void gatherData(GatherDataEvent event) {
1616
DataGenerator generator = event.getGenerator();

MagicDoorknob/src/main/java/com/tomboshoven/minecraft/magicdoorknob/data/ItemModels.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
@ParametersAreNonnullByDefault
1515
@MethodsReturnNonnullByDefault
16-
public class ItemModels extends ItemModelProvider {
17-
public ItemModels(DataGenerator gen, ExistingFileHelper helper) {
16+
class ItemModels extends ItemModelProvider {
17+
ItemModels(DataGenerator gen, ExistingFileHelper helper) {
1818
super(gen, MagicDoorknobMod.MOD_ID, helper);
1919
}
2020

MagicDoorknob/src/main/java/com/tomboshoven/minecraft/magicdoorknob/data/Language.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
@ParametersAreNonnullByDefault
1616
@MethodsReturnNonnullByDefault
17-
public class Language extends LanguageProvider {
18-
public Language(DataGenerator gen) {
17+
class Language extends LanguageProvider {
18+
Language(DataGenerator gen) {
1919
super(gen, MagicDoorknobMod.MOD_ID, "en_us");
2020
}
2121

@@ -31,11 +31,11 @@ protected void addTranslations() {
3131
addDoorknob("wood", "Wooden");
3232
}
3333

34-
protected void addDoorknob(String typeName) {
34+
private void addDoorknob(String typeName) {
3535
addDoorknob(typeName, StringUtils.capitalize(typeName));
3636
}
3737

38-
protected void addDoorknob(String typeName, String materialName) {
38+
private void addDoorknob(String typeName, String materialName) {
3939
MagicDoorknobItem doorknob = Items.DOORKNOBS.get(typeName);
4040
add(doorknob, String.format("%s Magic Doorknob", materialName));
4141
}

MagicDoorknob/src/main/java/com/tomboshoven/minecraft/magicdoorknob/data/Recipes.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818

1919
@ParametersAreNonnullByDefault
2020
@MethodsReturnNonnullByDefault
21-
public class Recipes extends RecipeProvider {
22-
public Recipes(DataGenerator generatorIn) {
21+
class Recipes extends RecipeProvider {
22+
Recipes(DataGenerator generatorIn) {
2323
super(generatorIn);
2424
}
2525

MagicDoorknob/src/main/java/com/tomboshoven/minecraft/magicdoorknob/items/Items.java

-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ private static void addDoorknob(String typeName, IItemTier tier, String blockNam
7171
addDoorknob(typeName, tier, new ResourceLocation("minecraft", String.format("block/%s", blockName)), recipeTag);
7272
}
7373

74-
@SuppressWarnings("BoundedWildcard")
7574
@SubscribeEvent
7675
public static void registerItems(Register<Item> event) {
7776
IForgeRegistry<Item> registry = event.getRegistry();

MagicDoorknob/src/main/java/com/tomboshoven/minecraft/magicdoorknob/items/MagicDoorknobItem.java

+11-11
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
import com.tomboshoven.minecraft.magicdoorknob.blocks.MagicDoorBlock;
55
import com.tomboshoven.minecraft.magicdoorknob.blocks.MagicDoorwayBlock;
66
import com.tomboshoven.minecraft.magicdoorknob.blocks.tileentities.MagicDoorTileEntity;
7+
import com.tomboshoven.minecraft.magicdoorknob.blocks.tileentities.MagicDoorwayPartBaseTileEntity;
78
import com.tomboshoven.minecraft.magicdoorknob.blocks.tileentities.MagicDoorwayTileEntity;
89
import mcp.MethodsReturnNonnullByDefault;
9-
import net.minecraft.block.Block;
1010
import net.minecraft.block.BlockState;
1111
import net.minecraft.client.renderer.model.Material;
1212
import net.minecraft.inventory.container.PlayerContainer;
@@ -38,11 +38,11 @@ public class MagicDoorknobItem extends Item {
3838
// The main material for rendering the item
3939
private final ResourceLocation mainTextureLocation;
4040
// The name of the type of item (used in NBT data; do not modify)
41-
private String typeName;
41+
private final String typeName;
4242
// The item material, used for determining doorway generation properties
43-
private IItemTier tier;
43+
private final IItemTier tier;
4444
// The item tag to use in recipes
45-
private Tag<Item> recipeTag;
45+
private final Tag<Item> recipeTag;
4646

4747
/**
4848
* @param properties The item properties
@@ -51,7 +51,7 @@ public class MagicDoorknobItem extends Item {
5151
* @param mainTextureLocation The main material for rendering the block
5252
* @param recipeTag The item tag to use in recipes
5353
*/
54-
public MagicDoorknobItem(Item.Properties properties, String typeName, IItemTier tier, ResourceLocation mainTextureLocation, Tag<Item> recipeTag) {
54+
MagicDoorknobItem(Item.Properties properties, String typeName, IItemTier tier, ResourceLocation mainTextureLocation, Tag<Item> recipeTag) {
5555
super(properties);
5656

5757
this.typeName = typeName;
@@ -117,8 +117,8 @@ private void placeDoor(World world, BlockPos pos, Direction facing) {
117117
);
118118
TileEntity topTileEntity = world.getTileEntity(doorPos);
119119
if (topTileEntity instanceof MagicDoorTileEntity) {
120-
((MagicDoorTileEntity) topTileEntity).setBaseBlockState(world.getBlockState(pos));
121-
((MagicDoorTileEntity) topTileEntity).setDoorknob(this);
120+
((MagicDoorwayPartBaseTileEntity) topTileEntity).setBaseBlockState(world.getBlockState(pos));
121+
((MagicDoorwayPartBaseTileEntity) topTileEntity).setDoorknob(this);
122122
}
123123
world.setBlockState(
124124
doorPos.down(),
@@ -128,8 +128,8 @@ private void placeDoor(World world, BlockPos pos, Direction facing) {
128128
);
129129
TileEntity bottomTileEntity = world.getTileEntity(doorPos.down());
130130
if (bottomTileEntity instanceof MagicDoorTileEntity) {
131-
((MagicDoorTileEntity) bottomTileEntity).setBaseBlockState(world.getBlockState(pos.down()));
132-
((MagicDoorTileEntity) bottomTileEntity).setDoorknob(this);
131+
((MagicDoorwayPartBaseTileEntity) bottomTileEntity).setBaseBlockState(world.getBlockState(pos.down()));
132+
((MagicDoorwayPartBaseTileEntity) bottomTileEntity).setDoorknob(this);
133133
}
134134
world.playSound(null, doorPos, SoundEvents.BLOCK_WOODEN_DOOR_OPEN, SoundCategory.BLOCKS, 1, 1);
135135
}
@@ -177,8 +177,8 @@ private void placeDoorwayElement(World world, BlockPos pos, boolean isNorthSouth
177177

178178
TileEntity tileEntity = world.getTileEntity(pos);
179179
if (tileEntity instanceof MagicDoorwayTileEntity) {
180-
((MagicDoorwayTileEntity) tileEntity).setBaseBlockState(state);
181-
((MagicDoorwayTileEntity) tileEntity).setDoorknob(this);
180+
((MagicDoorwayPartBaseTileEntity) tileEntity).setBaseBlockState(state);
181+
((MagicDoorwayPartBaseTileEntity) tileEntity).setDoorknob(this);
182182
}
183183
}
184184
}

MagicDoorknob/src/main/java/com/tomboshoven/minecraft/magicdoorknob/modelloaders/textured/ModelDataTextureMapper.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
@OnlyIn(Dist.CLIENT)
2323
class ModelDataTextureMapper implements ITextureMapper {
2424
@Override
25-
public Material mapSprite(PropertySprite spriteToMap, @Nullable BlockState blockState, @Nullable IModelData modelData) {
26-
if (modelData != null) {
25+
public Material mapSprite(PropertySprite spriteToMap, @Nullable BlockState blockState, @Nullable IModelData extraData) {
26+
if (extraData != null) {
2727
ResourceLocation name = spriteToMap.getName();
2828
ModelProperty<Material> modelProperty = ModelTextureProperty.get(name);
29-
Material material = modelData.getData(modelProperty);
29+
Material material = extraData.getData(modelProperty);
3030
if (material != null) {
3131
return material;
3232
}

MagicDoorknob/src/main/java/com/tomboshoven/minecraft/magicdoorknob/modelloaders/textured/ModelTextureProperty.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
*/
1616
@ParametersAreNonnullByDefault
1717
@MethodsReturnNonnullByDefault
18-
public class ModelTextureProperty extends ModelProperty<Material> {
18+
public final class ModelTextureProperty extends ModelProperty<Material> {
1919
// Lazily filled map of model texture properties.
2020
// Can't just use equality as they are used in an IdentityHashMap.
21-
private static Map<ResourceLocation, ModelTextureProperty> PROPERTIES = Maps.newHashMap();
21+
private static final Map<ResourceLocation, ModelTextureProperty> PROPERTIES = Maps.newHashMap();
2222

23-
private ResourceLocation name;
23+
private final ResourceLocation name;
2424

2525
/**
2626
* @param name The name of the property

MagicDoorknob/src/main/java/com/tomboshoven/minecraft/magicdoorknob/modelloaders/textured/PropertySprite.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33

44
import com.tomboshoven.minecraft.magicdoorknob.MagicDoorknobMod;
5-
import com.tomboshoven.minecraft.magicdoorknob.blocks.MagicDoorBlock;
65
import mcp.MethodsReturnNonnullByDefault;
76
import net.minecraft.client.renderer.texture.AtlasTexture;
87
import net.minecraft.client.renderer.texture.NativeImage;
@@ -21,7 +20,7 @@
2120
@ParametersAreNonnullByDefault
2221
@MethodsReturnNonnullByDefault
2322
@OnlyIn(Dist.CLIENT)
24-
public class PropertySprite extends TextureAtlasSprite {
23+
class PropertySprite extends TextureAtlasSprite {
2524
private final ResourceLocation name;
2625

2726
private static final AtlasTexture ATLAS_TEXTURE = new AtlasTexture(new ResourceLocation(MagicDoorknobMod.MOD_ID, "property_texture_atlas"));

0 commit comments

Comments
 (0)