diff --git a/kfc/src/main/java/nmd/primal/forgecraft/blocks/CastingBlock.java b/kfc/src/main/java/nmd/primal/forgecraft/blocks/CastingBlock.java index 4f5a546d..a3c07b44 100644 --- a/kfc/src/main/java/nmd/primal/forgecraft/blocks/CastingBlock.java +++ b/kfc/src/main/java/nmd/primal/forgecraft/blocks/CastingBlock.java @@ -20,6 +20,7 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import nmd.primal.core.api.PrimalAPI; import nmd.primal.core.common.helper.CommonUtils; import nmd.primal.core.common.helper.PlayerHelper; import nmd.primal.forgecraft.ModInfo; @@ -107,7 +108,7 @@ public class CastingBlock extends CustomContainerFacing { PlayerHelper.spawnItemOnGround(world, pos, dropStack); PlayerHelper.spawnItemOnGround(world, pos, dropCrucible); pItem.getTagCompound().setInteger("type", 0); - if(CommonUtils.randomCheck(2)){ + if(PrimalAPI.randomCheck(2)){ tile.setSlotStack(0, ItemStack.EMPTY); } //makeEmbers(world, pos, world.rand); @@ -118,7 +119,7 @@ public class CastingBlock extends CustomContainerFacing { PlayerHelper.spawnItemOnGround(world, pos, dropStack); PlayerHelper.spawnItemOnGround(world, pos, dropCrucible); pItem.getTagCompound().setInteger("type", 0); - if(CommonUtils.randomCheck(2)){ + if(PrimalAPI.randomCheck(2)){ tile.setSlotStack(0, ItemStack.EMPTY); } return true; @@ -128,7 +129,7 @@ public class CastingBlock extends CustomContainerFacing { PlayerHelper.spawnItemOnGround(world, pos, dropStack); PlayerHelper.spawnItemOnGround(world, pos, dropCrucible); pItem.getTagCompound().setInteger("type", 0); - if(CommonUtils.randomCheck(2)){ + if(PrimalAPI.randomCheck(2)){ tile.setSlotStack(0, ItemStack.EMPTY); } return true; @@ -138,7 +139,7 @@ public class CastingBlock extends CustomContainerFacing { PlayerHelper.spawnItemOnGround(world, pos, dropStack); PlayerHelper.spawnItemOnGround(world, pos, dropCrucible); pItem.getTagCompound().setInteger("type", 0); - if(CommonUtils.randomCheck(2)){ + if(PrimalAPI.randomCheck(2)){ tile.setSlotStack(0, ItemStack.EMPTY); } return true; @@ -148,7 +149,7 @@ public class CastingBlock extends CustomContainerFacing { PlayerHelper.spawnItemOnGround(world, pos, dropStack); PlayerHelper.spawnItemOnGround(world, pos, dropCrucible); pItem.getTagCompound().setInteger("type", 0); - if(CommonUtils.randomCheck(2)){ + if(PrimalAPI.randomCheck(2)){ tile.setSlotStack(0, ItemStack.EMPTY); } return true; @@ -180,7 +181,7 @@ public class CastingBlock extends CustomContainerFacing { PlayerHelper.spawnItemOnGround(world, pos, dropStack); PlayerHelper.spawnItemOnGround(world, pos, dropCrucible); pItem.getTagCompound().setInteger("type", 0); - if(CommonUtils.randomCheck(2)){ + if(PrimalAPI.randomCheck(2)){ tile.setSlotStack(0, ItemStack.EMPTY); } return true; @@ -202,7 +203,7 @@ public class CastingBlock extends CustomContainerFacing { PlayerHelper.spawnItemOnGround(world, pos, dropStack); PlayerHelper.spawnItemOnGround(world, pos, dropCrucible); pItem.getTagCompound().setInteger("type", 0); - if(CommonUtils.randomCheck(2)){ + if(PrimalAPI.randomCheck(2)){ tile.setSlotStack(0, ItemStack.EMPTY); } return true; @@ -224,7 +225,7 @@ public class CastingBlock extends CustomContainerFacing { PlayerHelper.spawnItemOnGround(world, pos, dropStack); PlayerHelper.spawnItemOnGround(world, pos, dropCrucible); pItem.getTagCompound().setInteger("type", 0); - if(CommonUtils.randomCheck(2)){ + if(PrimalAPI.randomCheck(2)){ tile.setSlotStack(0, ItemStack.EMPTY); } return true; @@ -246,7 +247,7 @@ public class CastingBlock extends CustomContainerFacing { PlayerHelper.spawnItemOnGround(world, pos, dropStack); PlayerHelper.spawnItemOnGround(world, pos, dropCrucible); pItem.getTagCompound().setInteger("type", 0); - if(CommonUtils.randomCheck(2)){ + if(PrimalAPI.randomCheck(2)){ tile.setSlotStack(0, ItemStack.EMPTY); } return true; @@ -256,7 +257,7 @@ public class CastingBlock extends CustomContainerFacing { PlayerHelper.spawnItemOnGround(world, pos, dropStack); PlayerHelper.spawnItemOnGround(world, pos, dropCrucible); pItem.getTagCompound().setInteger("type", 0); - if(CommonUtils.randomCheck(2)){ + if(PrimalAPI.randomCheck(2)){ tile.setSlotStack(0, ItemStack.EMPTY); } return true; @@ -279,7 +280,7 @@ public class CastingBlock extends CustomContainerFacing { PlayerHelper.spawnItemOnGround(world, pos, dropStack); PlayerHelper.spawnItemOnGround(world, pos, dropCrucible); pItem.getTagCompound().setInteger("type", 0); - if (CommonUtils.randomCheck(2)) { + if (PrimalAPI.randomCheck(2)) { tile.setSlotStack(0, ItemStack.EMPTY); } return true; @@ -300,7 +301,7 @@ public class CastingBlock extends CustomContainerFacing { PlayerHelper.spawnItemOnGround(world, pos, dropStack); PlayerHelper.spawnItemOnGround(world, pos, dropCrucible); pItem.getTagCompound().setInteger("type", 0); - if (CommonUtils.randomCheck(2)) { + if (PrimalAPI.randomCheck(2)) { tile.setSlotStack(0, ItemStack.EMPTY); } return true; @@ -323,7 +324,7 @@ public class CastingBlock extends CustomContainerFacing { PlayerHelper.spawnItemOnGround(world, pos, dropStack); PlayerHelper.spawnItemOnGround(world, pos, dropCrucible); pItem.getTagCompound().setInteger("type", 0); - if (CommonUtils.randomCheck(2)) { + if (PrimalAPI.randomCheck(2)) { tile.setSlotStack(0, ItemStack.EMPTY); } return true; @@ -346,7 +347,7 @@ public class CastingBlock extends CustomContainerFacing { PlayerHelper.spawnItemOnGround(world, pos, dropStack); PlayerHelper.spawnItemOnGround(world, pos, dropCrucible); pItem.getTagCompound().setInteger("type", 0); - if (CommonUtils.randomCheck(2)) { + if (PrimalAPI.randomCheck(2)) { tile.setSlotStack(0, ItemStack.EMPTY); } return true; @@ -356,7 +357,7 @@ public class CastingBlock extends CustomContainerFacing { PlayerHelper.spawnItemOnGround(world, pos, dropStack); PlayerHelper.spawnItemOnGround(world, pos, dropCrucible); pItem.getTagCompound().setInteger("type", 0); - if (CommonUtils.randomCheck(2)) { + if (PrimalAPI.randomCheck(2)) { tile.setSlotStack(0, ItemStack.EMPTY); } return true; @@ -379,7 +380,7 @@ public class CastingBlock extends CustomContainerFacing { PlayerHelper.spawnItemOnGround(world, pos, dropStack); PlayerHelper.spawnItemOnGround(world, pos, dropCrucible); pItem.getTagCompound().setInteger("type", 0); - if(CommonUtils.randomCheck(2)){ + if(PrimalAPI.randomCheck(2)){ tile.setSlotStack(0, ItemStack.EMPTY); } return true; @@ -400,7 +401,7 @@ public class CastingBlock extends CustomContainerFacing { PlayerHelper.spawnItemOnGround(world, pos, dropStack); PlayerHelper.spawnItemOnGround(world, pos, dropCrucible); pItem.getTagCompound().setInteger("type", 0); - if(CommonUtils.randomCheck(2)){ + if(PrimalAPI.randomCheck(2)){ tile.setSlotStack(0, ItemStack.EMPTY); } return true; @@ -423,7 +424,7 @@ public class CastingBlock extends CustomContainerFacing { PlayerHelper.spawnItemOnGround(world, pos, dropStack); PlayerHelper.spawnItemOnGround(world, pos, dropCrucible); pItem.getTagCompound().setInteger("type", 0); - if(CommonUtils.randomCheck(2)){ + if(PrimalAPI.randomCheck(2)){ tile.setSlotStack(0, ItemStack.EMPTY); } return true; @@ -446,7 +447,7 @@ public class CastingBlock extends CustomContainerFacing { PlayerHelper.spawnItemOnGround(world, pos, dropStack); PlayerHelper.spawnItemOnGround(world, pos, dropCrucible); pItem.getTagCompound().setInteger("type", 0); - if(CommonUtils.randomCheck(2)){ + if(PrimalAPI.randomCheck(2)){ tile.setSlotStack(0, ItemStack.EMPTY); } return true; @@ -456,7 +457,7 @@ public class CastingBlock extends CustomContainerFacing { PlayerHelper.spawnItemOnGround(world, pos, dropStack); PlayerHelper.spawnItemOnGround(world, pos, dropCrucible); pItem.getTagCompound().setInteger("type", 0); - if(CommonUtils.randomCheck(2)){ + if(PrimalAPI.randomCheck(2)){ tile.setSlotStack(0, ItemStack.EMPTY); } return true; @@ -479,7 +480,7 @@ public class CastingBlock extends CustomContainerFacing { PlayerHelper.spawnItemOnGround(world, pos, dropStack); PlayerHelper.spawnItemOnGround(world, pos, dropCrucible); pItem.getTagCompound().setInteger("type", 0); - if(CommonUtils.randomCheck(2)){ + if(PrimalAPI.randomCheck(2)){ tile.setSlotStack(0, ItemStack.EMPTY); } return true; @@ -500,7 +501,7 @@ public class CastingBlock extends CustomContainerFacing { PlayerHelper.spawnItemOnGround(world, pos, dropStack); PlayerHelper.spawnItemOnGround(world, pos, dropCrucible); pItem.getTagCompound().setInteger("type", 0); - if(CommonUtils.randomCheck(2)){ + if(PrimalAPI.randomCheck(2)){ tile.setSlotStack(0, ItemStack.EMPTY); } return true; @@ -523,7 +524,7 @@ public class CastingBlock extends CustomContainerFacing { PlayerHelper.spawnItemOnGround(world, pos, dropStack); PlayerHelper.spawnItemOnGround(world, pos, dropCrucible); pItem.getTagCompound().setInteger("type", 0); - if(CommonUtils.randomCheck(2)){ + if(PrimalAPI.randomCheck(2)){ tile.setSlotStack(0, ItemStack.EMPTY); } return true; @@ -546,7 +547,7 @@ public class CastingBlock extends CustomContainerFacing { PlayerHelper.spawnItemOnGround(world, pos, dropStack); PlayerHelper.spawnItemOnGround(world, pos, dropCrucible); pItem.getTagCompound().setInteger("type", 0); - if(CommonUtils.randomCheck(2)){ + if(PrimalAPI.randomCheck(2)){ tile.setSlotStack(0, ItemStack.EMPTY); } return true; @@ -556,7 +557,7 @@ public class CastingBlock extends CustomContainerFacing { PlayerHelper.spawnItemOnGround(world, pos, dropStack); PlayerHelper.spawnItemOnGround(world, pos, dropCrucible); pItem.getTagCompound().setInteger("type", 0); - if(CommonUtils.randomCheck(2)){ + if(PrimalAPI.randomCheck(2)){ tile.setSlotStack(0, ItemStack.EMPTY); } return true; diff --git a/kfc/src/main/java/nmd/primal/forgecraft/blocks/CastingForm.java b/kfc/src/main/java/nmd/primal/forgecraft/blocks/CastingForm.java index 58e66a42..2171d081 100644 --- a/kfc/src/main/java/nmd/primal/forgecraft/blocks/CastingForm.java +++ b/kfc/src/main/java/nmd/primal/forgecraft/blocks/CastingForm.java @@ -18,6 +18,7 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import nmd.primal.core.api.PrimalAPI; import nmd.primal.core.common.helper.CommonUtils; import nmd.primal.forgecraft.ModInfo; import nmd.primal.forgecraft.tiles.TileCastingForm; @@ -58,7 +59,7 @@ public class CastingForm extends CustomContainerFacing implements CastingFormHan public void updateTick(World world, BlockPos pos, IBlockState state, Random random) { if (!world.isRemote) { - if(CommonUtils.randomCheck(4)) { + if(PrimalAPI.randomCheck(4)) { TileCastingForm tile = (TileCastingForm) world.getTileEntity(pos); String[] tempArray = new String[25]; for (int i = 0; i < 25; i++) { diff --git a/kfc/src/main/java/nmd/primal/forgecraft/blocks/YewStave.java b/kfc/src/main/java/nmd/primal/forgecraft/blocks/YewStave.java index 538d3e3a..65880c6d 100644 --- a/kfc/src/main/java/nmd/primal/forgecraft/blocks/YewStave.java +++ b/kfc/src/main/java/nmd/primal/forgecraft/blocks/YewStave.java @@ -48,7 +48,7 @@ public class YewStave extends BlockCustomBase { if(world.getBlockState(pos.up()).getBlock() instanceof YewStave ) { //world.playSound(player, player.posX, player.posY, player.posZ, PrimalSounds.TOOL_BLADE_SCRAPE, SoundCategory.PLAYERS, 1.0F, 1F); world.playSound(null, pos, PrimalAPI.Sounds.SOUND_TOOL_BLADE_SCRAPE, SoundCategory.PLAYERS, 1.0F, 1.0F); - if(CommonUtils.randomCheck(3) ) { + if(PrimalAPI.randomCheck(3) ) { PlayerHelper.spawnItemOnGround(world, pos, new ItemStack(ModItems.rawlongbow, 1)); world.setBlockState(pos, Blocks.AIR.getDefaultState(), 2); world.setBlockState(pos.up(), Blocks.AIR.getDefaultState(), 2); diff --git a/kfc/src/main/java/nmd/primal/forgecraft/init/ModCrafting.java b/kfc/src/main/java/nmd/primal/forgecraft/init/ModCrafting.java index 9eb4e688..3f976439 100644 --- a/kfc/src/main/java/nmd/primal/forgecraft/init/ModCrafting.java +++ b/kfc/src/main/java/nmd/primal/forgecraft/init/ModCrafting.java @@ -965,7 +965,7 @@ public class ModCrafting { empty,empty,diamond,empty,empty, empty,empty,empty,empty,empty, empty,empty,empty,empty,empty }, - new ItemStack(PrimalAPI.Items.DIAMOND_KNAPP, CommonUtils.randomChanceReturn(2, 2, 3)), + new ItemStack(PrimalAPI.Items.DIAMOND_KNAPP, PrimalAPI.randomChanceReturn(2, 2, 3)), "null" ); @@ -1072,7 +1072,7 @@ public class ModCrafting { empty,empty,emerald,empty,empty, empty,empty,empty,empty,empty, empty,empty,empty,empty,empty }, - new ItemStack(PrimalAPI.Items.EMERALD_KNAPP, CommonUtils.randomChanceReturn(3, 2, 3)), + new ItemStack(PrimalAPI.Items.EMERALD_KNAPP, PrimalAPI.randomChanceReturn(3, 2, 3)), "null" ); diff --git a/kfc/src/main/java/nmd/primal/forgecraft/items/weapons/Musket.java b/kfc/src/main/java/nmd/primal/forgecraft/items/weapons/Musket.java index 1fa8eb44..61194587 100644 --- a/kfc/src/main/java/nmd/primal/forgecraft/items/weapons/Musket.java +++ b/kfc/src/main/java/nmd/primal/forgecraft/items/weapons/Musket.java @@ -10,7 +10,7 @@ import net.minecraft.util.*; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import nmd.primal.core.common.entities.projectiles.EntityMud; +import nmd.primal.core.common.entities.projectiles.TypeMud; import nmd.primal.forgecraft.ModInfo; import nmd.primal.forgecraft.init.ModSounds; import nmd.primal.forgecraft.items.BaseItem; @@ -51,7 +51,7 @@ public class Musket extends BaseItem{ //if(player.getItemInUseCount() > 5) { world.playSound( null, player.posX, player.posY, player.posZ, ModSounds.MUSKET_SHOT, SoundCategory.BLOCKS, 0.5F, 0.3F / (itemRand.nextFloat() * 0.4F + 0.8F)); - EntityMud entity = new EntityMud(world, player); + TypeMud entity = new TypeMud(world, player); entity.setType("muck"); entity.shoot(player, player.rotationPitch, player.rotationYaw, 0.0F, 7.0F, 0.5F); world.spawnEntity(entity); diff --git a/kfc/src/main/java/nmd/primal/forgecraft/tiles/TileBloomery.java b/kfc/src/main/java/nmd/primal/forgecraft/tiles/TileBloomery.java index 6e901a7a..ae0c9372 100644 --- a/kfc/src/main/java/nmd/primal/forgecraft/tiles/TileBloomery.java +++ b/kfc/src/main/java/nmd/primal/forgecraft/tiles/TileBloomery.java @@ -42,13 +42,13 @@ public class TileBloomery extends TileBaseSlot implements ITickable { this.iteration++; if (this.iteration == 100) { RecipeHelper.fuelManager(world,this, this.getSlotStack(0)); - if(CommonUtils.randomCheck(1000)) { + if(PrimalAPI.randomCheck(1000)) { makeSmoke(world, pos); } } if (this.iteration == 200) { RecipeHelper.fuelManager(world, this, this.getSlotStack(0)); - if(CommonUtils.randomCheck(1000)) { + if(PrimalAPI.randomCheck(1000)) { makeSmoke(world, pos); } } @@ -63,7 +63,7 @@ public class TileBloomery extends TileBaseSlot implements ITickable { } this.heatManager(this.getHeat(), state, this.getSlotStack(0), world, pos); RecipeHelper.fuelManager(world, this, this.getSlotStack(0)); - if(CommonUtils.randomCheck(1000)) { + if(PrimalAPI.randomCheck(1000)) { makeSmoke(world, pos); } } @@ -152,7 +152,7 @@ public class TileBloomery extends TileBaseSlot implements ITickable { this.markDirty(); this.updateBlock(); } - if(CommonUtils.randomCheck(1000)) { + if(PrimalAPI.randomCheck(1000)) { makeSmoke(world, pos); } } diff --git a/kfc/src/main/java/nmd/primal/forgecraft/tiles/TileForge.java b/kfc/src/main/java/nmd/primal/forgecraft/tiles/TileForge.java index e1985bb3..ad6db667 100644 --- a/kfc/src/main/java/nmd/primal/forgecraft/tiles/TileForge.java +++ b/kfc/src/main/java/nmd/primal/forgecraft/tiles/TileForge.java @@ -44,13 +44,13 @@ public class TileForge extends TileBaseSlot implements ITickable, ToolNBT{ if (this.iteration == 100) { RecipeHelper.fuelManager(world, this, this.getSlotStack(0)); - if(CommonUtils.randomCheck(1000)) { + if(PrimalAPI.randomCheck(1000)) { makeSmoke(world, pos); } } if (this.iteration == 200) { RecipeHelper.fuelManager(world, this, this.getSlotStack(0)); - if(CommonUtils.randomCheck(1000)) { + if(PrimalAPI.randomCheck(1000)) { makeSmoke(world, pos); } } @@ -65,7 +65,7 @@ public class TileForge extends TileBaseSlot implements ITickable, ToolNBT{ world.notifyBlockUpdate(pos, state, state, 2); } RecipeHelper.fuelManager(world, this, this.getSlotStack(0)); - if(CommonUtils.randomCheck(1000)) { + if(PrimalAPI.randomCheck(1000)) { makeSmoke(world, pos); } this.heatManager(this.getHeat(), state, this.getSlotStack(0), world, pos); @@ -110,7 +110,7 @@ public class TileForge extends TileBaseSlot implements ITickable, ToolNBT{ this.markDirty(); this.updateBlock(); } - if(CommonUtils.randomCheck(1000)) { + if(PrimalAPI.randomCheck(1000)) { makeSmoke(world, pos); } } diff --git a/kfc/src/main/java/nmd/primal/forgecraft/util/BreakerHandler.java b/kfc/src/main/java/nmd/primal/forgecraft/util/BreakerHandler.java index 7be0aa8f..aafcfb94 100644 --- a/kfc/src/main/java/nmd/primal/forgecraft/util/BreakerHandler.java +++ b/kfc/src/main/java/nmd/primal/forgecraft/util/BreakerHandler.java @@ -13,7 +13,7 @@ import nmd.primal.core.common.helper.RecipeHelper; import nmd.primal.forgecraft.blocks.CustomContainerFacing; import nmd.primal.forgecraft.tiles.TileBreaker; -import static nmd.primal.core.common.helper.CommonUtils.randomChanceReturn; +import static nmd.primal.core.api.PrimalAPI.randomChanceReturn; //import nmd.primal.forgecraft.CommonUtils;