Skip to content

Commit

Permalink
Spotless and Door Deprecated Method Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruling-0 committed Jan 16, 2025
1 parent 5a54630 commit ed7fb0a
Show file tree
Hide file tree
Showing 13 changed files with 55 additions and 38 deletions.
5 changes: 2 additions & 3 deletions src/main/java/mods/natura/blocks/GrassSlab.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import java.util.List;
import java.util.Random;

import mods.natura.common.NContent;
import net.minecraft.block.Block;
import net.minecraft.block.BlockSlab;
import net.minecraft.block.material.Material;
Expand All @@ -20,6 +19,7 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mods.natura.client.GrassColorizerAlternate;
import mods.natura.common.NContent;
import mods.natura.common.NaturaTab;

public class GrassSlab extends BlockSlab {
Expand All @@ -42,8 +42,7 @@ public void registerBlockIcons(IIconRegister iconRegister) {
}

@Override
public String func_150002_b(int meta)
{
public String func_150002_b(int meta) {
if (meta < 0 || meta >= blockType.length) meta = 0;
return "block.soil." + blockType[meta] + ".slab";
}
Expand Down
25 changes: 10 additions & 15 deletions src/main/java/mods/natura/blocks/NSlabBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@
import java.util.List;
import java.util.Random;

import mods.natura.common.NContent;
import net.minecraft.block.BlockWoodSlab;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.common.util.ForgeDirection;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mods.natura.common.NContent;
import mods.natura.common.NaturaTab;
import net.minecraftforge.common.util.ForgeDirection;

public class NSlabBase extends BlockWoodSlab {

public static String[] woodNames = new String[] { "eucalyptus", "sakura", "ghost", "redwood", "blood",
"bush", "maple", "silverbell", "purpleheart", "tiger", "willow", "darkwood", "fusewood" };
public static String[] woodNames = new String[] { "eucalyptus", "sakura", "ghost", "redwood", "blood", "bush",
"maple", "silverbell", "purpleheart", "tiger", "willow", "darkwood", "fusewood" };
private final int group;

public NSlabBase(boolean isDoubleSlab, int grp) {
Expand All @@ -45,13 +45,11 @@ public Item getItemDropped(int meta, Random random, int fortune) {
if (field_150004_a) {
if (this == NContent.plankSlab1Double) return Item.getItemFromBlock(NContent.plankSlab1);
else return Item.getItemFromBlock(NContent.plankSlab2);
}
else return Item.getItemFromBlock(this);
} else return Item.getItemFromBlock(this);
}

@Override
public String func_150002_b(int meta)
{
public String func_150002_b(int meta) {
return "block.wood." + woodNames[getWoodMeta(meta)] + ".slab";
}

Expand Down Expand Up @@ -85,8 +83,7 @@ public void getSubBlocks(Item id, CreativeTabs tab, List list) {
list.add(new ItemStack(id, 1, iter));
}
}
}
else {
} else {
if (id != Item.getItemFromBlock(NContent.plankSlab2Double)) {
for (int iter = 0; iter < 5; iter++) {
list.add(new ItemStack(id, 1, iter));
Expand All @@ -96,18 +93,16 @@ public void getSubBlocks(Item id, CreativeTabs tab, List list) {
}

@Override
protected ItemStack createStackedBlock(int meta)
{
protected ItemStack createStackedBlock(int meta) {
if (group == 1) {
return new ItemStack(Item.getItemFromBlock(NContent.plankSlab1), 2, meta & 7);
}
else {
} else {
return new ItemStack(Item.getItemFromBlock(NContent.plankSlab2), 2, meta & 7);
}
}

private int getWoodMeta(int meta) {
meta = (meta & 7) + (group-1) * 8;
meta = (meta & 7) + (group - 1) * 8;
if (meta < 0 || meta >= woodNames.length) meta = 0;
return meta;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mods.natura.common.NContent;
import net.minecraftforge.common.util.ForgeDirection;

public class AlternateBookshelf extends BlockBookshelf {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mods.natura.client.FenceRender;
import mods.natura.common.NContent;
import net.minecraftforge.common.util.ForgeDirection;

public class AlternateFence extends BlockFence {

Expand Down
1 change: 0 additions & 1 deletion src/main/java/mods/natura/blocks/trees/DarkTreeBlock.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package mods.natura.blocks.trees;

import java.util.List;
import java.util.Random;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
Expand Down
8 changes: 2 additions & 6 deletions src/main/java/mods/natura/blocks/trees/NDoor.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.IconFlipped;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
Expand Down Expand Up @@ -114,12 +115,7 @@ public IIcon getIcon(int par1, int par2) {
}

@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
return new ItemStack(NContent.doorItem, 1, meta);
}

@Override
public int getRenderType() {
return 7;
}
}
3 changes: 0 additions & 3 deletions src/main/java/mods/natura/blocks/trees/NLeaves.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import java.util.List;
import java.util.Random;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.BlockLeaves;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
Expand All @@ -21,7 +19,6 @@
import cpw.mods.fml.relauncher.SideOnly;
import mods.natura.common.NContent;
import mods.natura.common.NaturaTab;
import net.minecraftforge.common.util.ForgeDirection;

public class NLeaves extends BlockLeaves {

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/mods/natura/blocks/trees/NLeavesNocolor.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mods.natura.Natura;
import mods.natura.common.NContent;
import net.minecraftforge.common.util.ForgeDirection;

public class NLeavesNocolor extends NLeaves {

Expand Down
1 change: 0 additions & 1 deletion src/main/java/mods/natura/blocks/trees/Planks.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;

import cpw.mods.fml.relauncher.Side;
Expand Down
1 change: 0 additions & 1 deletion src/main/java/mods/natura/blocks/trees/SimpleLog.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;

import cpw.mods.fml.relauncher.Side;
Expand Down
36 changes: 34 additions & 2 deletions src/main/java/mods/natura/common/NContent.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import java.util.HashMap;
import java.util.List;

import mods.natura.blocks.*;
import mods.natura.items.blocks.*;
import net.minecraft.block.Block;
import net.minecraft.block.BlockDispenser;
import net.minecraft.block.BlockPressurePlate.Sensitivity;
Expand Down Expand Up @@ -37,6 +35,15 @@
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import mods.natura.Natura;
import mods.natura.blocks.CloudBlock;
import mods.natura.blocks.GrassBlock;
import mods.natura.blocks.GrassSlab;
import mods.natura.blocks.NButton;
import mods.natura.blocks.NFenceGate;
import mods.natura.blocks.NPressurePlate;
import mods.natura.blocks.NSlabBase;
import mods.natura.blocks.NStairs;
import mods.natura.blocks.NTrapdoor;
import mods.natura.blocks.crops.BerryBush;
import mods.natura.blocks.crops.CropBlock;
import mods.natura.blocks.crops.FlowerBlock;
Expand Down Expand Up @@ -97,6 +104,31 @@
import mods.natura.items.SeedFood;
import mods.natura.items.SpawnEgg;
import mods.natura.items.StickItem;
import mods.natura.items.blocks.BerryBushItem;
import mods.natura.items.blocks.CloudItem;
import mods.natura.items.blocks.DarkTreeItem;
import mods.natura.items.blocks.FenceItem;
import mods.natura.items.blocks.GlowshroomItem;
import mods.natura.items.blocks.GrassBlockItem;
import mods.natura.items.blocks.GrassSlabItem;
import mods.natura.items.blocks.LogTwoxTwoItem;
import mods.natura.items.blocks.NAlternateItem;
import mods.natura.items.blocks.NDoorItem;
import mods.natura.items.blocks.NLeavesDarkItem;
import mods.natura.items.blocks.NLeavesItem;
import mods.natura.items.blocks.NSaplingItem;
import mods.natura.items.blocks.NSlabBaseItem;
import mods.natura.items.blocks.NetherBerryBushItem;
import mods.natura.items.blocks.NetherGlassItem;
import mods.natura.items.blocks.NoColorLeavesItem;
import mods.natura.items.blocks.OverworldLeavesItem;
import mods.natura.items.blocks.OverworldSaplingItem;
import mods.natura.items.blocks.OverworldTreeItem;
import mods.natura.items.blocks.PlanksItem;
import mods.natura.items.blocks.RedwoodItem;
import mods.natura.items.blocks.SaguaroItem;
import mods.natura.items.blocks.TreeItem;
import mods.natura.items.blocks.WillowItem;
import mods.natura.items.tools.FlintAndBlaze;
import mods.natura.items.tools.NaturaArmor;
import mods.natura.items.tools.NaturaBow;
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/mods/natura/items/blocks/GrassSlabItem.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package mods.natura.items.blocks;

import mods.natura.blocks.GrassSlab;
import net.minecraft.block.Block;
import net.minecraft.item.ItemSlab;

import mods.natura.blocks.GrassSlab;

public class GrassSlabItem extends ItemSlab {

public GrassSlabItem(Block block, GrassSlab singleSlab, GrassSlab doubleSlab) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/mods/natura/items/blocks/NSlabBaseItem.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package mods.natura.items.blocks;

import mods.natura.blocks.NSlabBase;
import net.minecraft.block.Block;
import net.minecraft.item.ItemSlab;
import net.minecraft.item.ItemStack;

import mods.natura.blocks.NSlabBase;

public class NSlabBaseItem extends ItemSlab {

Expand Down

0 comments on commit ed7fb0a

Please sign in to comment.