More cleanup

This commit is contained in:
Electroblob
2018-02-16 22:26:28 +00:00
parent 2dd52ce6b1
commit bec52edce4
3 changed files with 32 additions and 41 deletions
@@ -25,43 +25,43 @@ public class BlockArcaneWorkbench extends BlockContainer {
private static final AxisAlignedBB AABB = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.75D, 1.0D); private static final AxisAlignedBB AABB = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.75D, 1.0D);
public BlockArcaneWorkbench() { public BlockArcaneWorkbench(){
super(Material.ROCK); super(Material.ROCK);
this.setLightLevel(0.8f); this.setLightLevel(0.8f);
} }
@Override @Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos){
return AABB; return AABB;
} }
@Override @Override
public TileEntity createNewTileEntity(World world, int metadata) { public TileEntity createNewTileEntity(World world, int metadata){
return new TileEntityArcaneWorkbench(); return new TileEntityArcaneWorkbench();
} }
@Override @Override
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) { public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos){
return false; return false;
} }
@Override @Override
public EnumBlockRenderType getRenderType(IBlockState state) { public EnumBlockRenderType getRenderType(IBlockState state){
return EnumBlockRenderType.MODEL; return EnumBlockRenderType.MODEL;
} }
@Override @Override
public boolean isOpaqueCube(IBlockState state) { public boolean isOpaqueCube(IBlockState state){
return false; return false;
} }
@Override @Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState block, EntityPlayer player, EnumHand hand, public boolean onBlockActivated(World world, BlockPos pos, IBlockState block, EntityPlayer player, EnumHand hand,
EnumFacing side, float hitX, float hitY, float hitZ) { EnumFacing side, float hitX, float hitY, float hitZ){
TileEntity tileEntity = world.getTileEntity(pos); TileEntity tileEntity = world.getTileEntity(pos);
if (tileEntity == null || player.isSneaking()) { if(tileEntity == null || player.isSneaking()){
return false; return false;
} }
@@ -71,44 +71,44 @@ public class BlockArcaneWorkbench extends BlockContainer {
} }
@Override @Override
public void breakBlock(World world, BlockPos pos, IBlockState block) { public void breakBlock(World world, BlockPos pos, IBlockState block){
Random random = new Random(); Random random = new Random();
TileEntityArcaneWorkbench tileentityarcaneworkbench = (TileEntityArcaneWorkbench) world.getTileEntity(pos); TileEntityArcaneWorkbench tileentityarcaneworkbench = (TileEntityArcaneWorkbench)world.getTileEntity(pos);
if (tileentityarcaneworkbench != null) { if(tileentityarcaneworkbench != null){
for (int j1 = 0; j1 < tileentityarcaneworkbench.getSizeInventory(); ++j1) { for(int j1 = 0; j1 < tileentityarcaneworkbench.getSizeInventory(); ++j1){
ItemStack itemstack = tileentityarcaneworkbench.getStackInSlot(j1); ItemStack itemstack = tileentityarcaneworkbench.getStackInSlot(j1);
if (!itemstack.isEmpty()) { if(!itemstack.isEmpty()){
float f = random.nextFloat() * 0.8F + 0.1F; float f = random.nextFloat() * 0.8F + 0.1F;
float f1 = random.nextFloat() * 0.8F + 0.1F; float f1 = random.nextFloat() * 0.8F + 0.1F;
EntityItem entityitem; EntityItem entityitem;
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.getCount() > 0; world for(float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.getCount() > 0; world
.spawnEntity(entityitem)) { .spawnEntity(entityitem)){
int k1 = random.nextInt(21) + 10; int k1 = random.nextInt(21) + 10;
if (k1 > itemstack.getCount()) { if(k1 > itemstack.getCount()){
k1 = itemstack.getCount(); k1 = itemstack.getCount();
} }
itemstack.shrink(k1); itemstack.shrink(k1);
entityitem = new EntityItem(world, (double) ((float) pos.getX() + f), entityitem = new EntityItem(world, (double)((float)pos.getX() + f),
(double) ((float) pos.getY() + f1), (double) ((float) pos.getZ() + f2), (double)((float)pos.getY() + f1), (double)((float)pos.getZ() + f2),
new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage())); new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
float f3 = 0.05F; float f3 = 0.05F;
entityitem.motionX = (double) ((float) random.nextGaussian() * f3); entityitem.motionX = (double)((float)random.nextGaussian() * f3);
entityitem.motionY = (double) ((float) random.nextGaussian() * f3 + 0.2F); entityitem.motionY = (double)((float)random.nextGaussian() * f3 + 0.2F);
entityitem.motionZ = (double) ((float) random.nextGaussian() * f3); entityitem.motionZ = (double)((float)random.nextGaussian() * f3);
if (itemstack.hasTagCompound()) { if(itemstack.hasTagCompound()){
entityitem.getItem().setTagCompound(((NBTTagCompound) itemstack.getTagCompound().copy())); entityitem.getItem().setTagCompound(((NBTTagCompound)itemstack.getTagCompound().copy()));
} }
} }
} }
@@ -229,8 +229,7 @@ public final class WizardryRegistry {
biomes.remove(Biomes.MUSHROOM_ISLAND); biomes.remove(Biomes.MUSHROOM_ISLAND);
biomes.remove(Biomes.MUSHROOM_ISLAND_SHORE); biomes.remove(Biomes.MUSHROOM_ISLAND_SHORE);
// For reference: 5, 1, 1 are the parameters for the witch in vanilla. // For reference: 5, 1, 1 are the parameters for the witch in vanilla.
EntityRegistry.addSpawn(EntityEvilWizard.class, 3, 1, 1, EnumCreatureType.MONSTER, EntityRegistry.addSpawn(EntityEvilWizard.class, 3, 1, 1, EnumCreatureType.MONSTER, biomes.toArray(new Biome[biomes.size()]));
biomes.toArray(new Biome[biomes.size()]));
} }
@@ -273,11 +272,9 @@ public final class WizardryRegistry {
ItemStack scrollStack = new ItemStack(WizardryItems.blank_scroll); ItemStack scrollStack = new ItemStack(WizardryItems.blank_scroll);
ItemStack paperStack = new ItemStack(Items.PAPER); ItemStack paperStack = new ItemStack(Items.PAPER);
GameRegistry.addRecipe(magicWandStack, " x", " y ", "z ", 'x', magicCrystalStack, 'y', stickStack, 'z', GameRegistry.addRecipe(magicWandStack, " x", " y ", "z ", 'x', magicCrystalStack, 'y', stickStack, 'z', goldNuggetStack);
goldNuggetStack);
GameRegistry.addRecipe(spellBookStack, " x ", "xyx", " x ", 'x', magicCrystalStack, 'y', bookStack); GameRegistry.addRecipe(spellBookStack, " x ", "xyx", " x ", 'x', magicCrystalStack, 'y', bookStack);
GameRegistry.addRecipe(arcaneWorkbenchStack, "vwv", "xyx", "zzz", 'v', goldNuggetStack, 'w', purpleCarpetStack, GameRegistry.addRecipe(arcaneWorkbenchStack, "vwv", "xyx", "zzz", 'v', goldNuggetStack, 'w', purpleCarpetStack, 'x', magicCrystalStack, 'y', lapisBlockStack, 'z', stoneStack);
'x', magicCrystalStack, 'y', lapisBlockStack, 'z', stoneStack);
GameRegistry.addRecipe(manaFlaskStack, "yyy", "yxy", "yyy", 'x', bottleStack, 'y', magicCrystalStack); GameRegistry.addRecipe(manaFlaskStack, "yyy", "yxy", "yyy", 'x', bottleStack, 'y', magicCrystalStack);
GameRegistry.addRecipe(transportationStoneStack, " x ", "xyx", " x ", 'x', stoneStack, 'y', magicCrystalStack); GameRegistry.addRecipe(transportationStoneStack, " x ", "xyx", " x ", 'x', stoneStack, 'y', magicCrystalStack);
GameRegistry.addRecipe(hatStack, "yyy", "y y", 'y', silkStack); GameRegistry.addRecipe(hatStack, "yyy", "y y", 'y', silkStack);
@@ -291,13 +288,9 @@ public final class WizardryRegistry {
GameRegistry.addShapelessRecipe(magicCrystalStack1, crystalFlowerStack); GameRegistry.addShapelessRecipe(magicCrystalStack1, crystalFlowerStack);
GameRegistry.addShapelessRecipe(magicCrystalStack2, crystalBlockStack); GameRegistry.addShapelessRecipe(magicCrystalStack2, crystalBlockStack);
if(Wizardry.settings.firebombIsCraftable) if(Wizardry.settings.firebombIsCraftable) GameRegistry.addShapelessRecipe(firebombStack, bottleStack, gunpowderStack, blazePowderStack, blazePowderStack);
GameRegistry.addShapelessRecipe(firebombStack, bottleStack, gunpowderStack, blazePowderStack, blazePowderStack); if(Wizardry.settings.poisonBombIsCraftable) GameRegistry.addShapelessRecipe(poisonBombStack, bottleStack, gunpowderStack, spiderEyeStack, spiderEyeStack);
if(Wizardry.settings.poisonBombIsCraftable) if(Wizardry.settings.smokeBombIsCraftable) GameRegistry.addShapelessRecipe(smokeBombStack, bottleStack, gunpowderStack, coalStack, coalStack);
GameRegistry.addShapelessRecipe(poisonBombStack, bottleStack, gunpowderStack, spiderEyeStack, spiderEyeStack);
if(Wizardry.settings.smokeBombIsCraftable)
GameRegistry.addShapelessRecipe(smokeBombStack, bottleStack, gunpowderStack, coalStack, coalStack);
if(Wizardry.settings.useAlternateScrollRecipe){ if(Wizardry.settings.useAlternateScrollRecipe){
GameRegistry.addShapelessRecipe(scrollStack, paperStack, stringStack, magicCrystalStack); GameRegistry.addShapelessRecipe(scrollStack, paperStack, stringStack, magicCrystalStack);
@@ -310,8 +303,7 @@ public final class WizardryRegistry {
for(Element element : Element.values()){ for(Element element : Element.values()){
for(Tier tier : Tier.values()){ for(Tier tier : Tier.values()){
miscWandStack = new ItemStack(WizardryUtilities.getWand(tier, element), 1, miscWandStack = new ItemStack(WizardryUtilities.getWand(tier, element), 1, OreDictionary.WILDCARD_VALUE);
OreDictionary.WILDCARD_VALUE);
GameRegistry.addShapelessRecipe(miscWandStack, miscWandStack, manaFlaskStack); GameRegistry.addShapelessRecipe(miscWandStack, miscWandStack, manaFlaskStack);
} }
} }
@@ -320,8 +312,7 @@ public final class WizardryRegistry {
for(Element element : Element.values()){ for(Element element : Element.values()){
for(EntityEquipmentSlot slot : WizardryUtilities.ARMOUR_SLOTS){ for(EntityEquipmentSlot slot : WizardryUtilities.ARMOUR_SLOTS){
miscArmourStack = new ItemStack(WizardryUtilities.getArmour(element, slot), 1, miscArmourStack = new ItemStack(WizardryUtilities.getArmour(element, slot), 1, OreDictionary.WILDCARD_VALUE);
OreDictionary.WILDCARD_VALUE);
GameRegistry.addShapelessRecipe(miscArmourStack, miscArmourStack, manaFlaskStack); GameRegistry.addShapelessRecipe(miscArmourStack, miscArmourStack, manaFlaskStack);
} }
} }
@@ -81,7 +81,7 @@ public class Clairvoyance extends Spell {
256 * modifiers.get(WizardryItems.range_upgrade)); 256 * modifiers.get(WizardryItems.range_upgrade));
if(path != null && path.getFinalPathPoint() != null){ if(path != null && path.getFinalPathPoint() != null){
// TODO Corail : is it normal to have x in each ???
int x = path.getFinalPathPoint().x; int x = path.getFinalPathPoint().x;
int y = path.getFinalPathPoint().y; int y = path.getFinalPathPoint().y;
int z = path.getFinalPathPoint().z; int z = path.getFinalPathPoint().z;