forked from TAIGA/TAIGA
general code cleanup
removed some unused classes Signed-off-by: Giovanni Harting <539@idlegandalf.com>
This commit is contained in:
@@ -24,7 +24,6 @@ import static slimeknights.tconstruct.library.utils.HarvestLevels.*;
|
||||
|
||||
public class Blocks {
|
||||
|
||||
|
||||
// blocks and ores spawned via worldgen
|
||||
public static Block basaltBlock = new BasicBlock("basalt_block", Material.ROCK, 20.0f, 35.0f, IRON, PREFIX_BLOCK);
|
||||
public static Block tiberiumOre = new BlockTiberium();
|
||||
|
@@ -58,7 +58,6 @@ public class Fluids {
|
||||
public static BasicTinkerFluid nitroniteFluid = new BasicTinkerFluid("nitronite_fluid", 0xFFCCFF00, 3100, 10, 5000);
|
||||
|
||||
// Community
|
||||
|
||||
public static BasicTinkerFluid dilithiumFluid = new BasicTinkerFluid("dilithium_fluid", 0xFF79aea6, 1500, 10, 5000);
|
||||
|
||||
/**
|
||||
@@ -103,7 +102,6 @@ public class Fluids {
|
||||
TinkerRegistry.registerMelting(Items.dilithiumCrystal, dilithiumFluid, 72);
|
||||
TinkerRegistry.registerMelting(Items.tiberiumCrystal, tiberiumFluid, 72);
|
||||
|
||||
|
||||
TinkerRegistry.registerSmelteryFuel(new FluidStack(magmaFluid, 50), 100);
|
||||
TinkerRegistry.registerSmelteryFuel(new FluidStack(nitroniteFluid, 100), 500);
|
||||
TinkerRegistry.registerSmelteryFuel(new FluidStack(dilithiumFluid, 50), 100);
|
||||
|
@@ -5,5 +5,4 @@ import org.lwjgl.input.Keyboard;
|
||||
|
||||
public class Keybindings {
|
||||
public static KeyBinding altKey = new KeyBinding("key.taiga.alt_action", Keyboard.KEY_LCONTROL, "TAIGA");
|
||||
|
||||
}
|
||||
|
@@ -56,7 +56,7 @@ public class MaterialTraits {
|
||||
public static final AbstractTrait mutate = new TraitMutate();
|
||||
|
||||
|
||||
/**
|
||||
/*
|
||||
* Assign traits to related materials. <br>
|
||||
* <p>
|
||||
* <p> Example:
|
||||
|
@@ -1,34 +0,0 @@
|
||||
package com.sosnitzka.taiga.blocks;
|
||||
|
||||
import com.sosnitzka.taiga.generic.BasicBlock;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockLignite extends BasicBlock {
|
||||
|
||||
public BlockLignite() {
|
||||
super("lignite_ore", Material.ROCK, 4.0f, 5.0f, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getExpDrop(IBlockState state, IBlockAccess world, BlockPos pos, int fortune) {
|
||||
Random rand = world instanceof World ? ((World) world).rand : new Random();
|
||||
int r = RANDOM.nextInt(11);
|
||||
if (r > 7) {
|
||||
return MathHelper.getInt(rand, 0, 10) + fortune;
|
||||
} else return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ParametersAreNonnullByDefault
|
||||
public int quantityDropped(IBlockState state, int fortune, Random random) {
|
||||
return random.nextInt(3) + 1 + fortune;
|
||||
}
|
||||
}
|
@@ -1,68 +0,0 @@
|
||||
package com.sosnitzka.taiga.blocks;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import slimeknights.mantle.block.EnumBlock;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public class BlockMetal extends EnumBlock<BlockMetal.MetalTypes> {
|
||||
|
||||
public static final PropertyEnum<MetalTypes> TYPE = PropertyEnum.create("type", MetalTypes.class);
|
||||
|
||||
public BlockMetal() {
|
||||
super(Material.IRON, TYPE, MetalTypes.class);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
for (MetalTypes type : MetalTypes.values()) {
|
||||
list.add(new ItemStack(this, 1, type.getMeta()));
|
||||
}
|
||||
}
|
||||
|
||||
public enum MetalTypes implements IStringSerializable, EnumBlock.IEnumMeta {
|
||||
TIBERIUM,
|
||||
AURODIUM,
|
||||
PROMETHEUM,
|
||||
ARCANITE,
|
||||
TITANITE,
|
||||
MYTHRIL,
|
||||
URU,
|
||||
VIBRANIUM,
|
||||
ETERNITE,
|
||||
FRACTORYTE,
|
||||
PALLADIUM,
|
||||
IGNITITE,
|
||||
BISMUTH,
|
||||
JAUXITE,
|
||||
VIOLIUM,
|
||||
KARMESINE;
|
||||
|
||||
public final int meta;
|
||||
|
||||
MetalTypes() {
|
||||
meta = ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return this.toString().toLowerCase(Locale.US);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMeta() {
|
||||
return meta;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -1,68 +0,0 @@
|
||||
package com.sosnitzka.taiga.blocks;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import slimeknights.mantle.block.EnumBlock;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Locale;
|
||||
|
||||
public class BlockOre extends EnumBlock<BlockOre.OreTypes> {
|
||||
|
||||
public static final PropertyEnum<OreTypes> TYPE = PropertyEnum.create("type", OreTypes.class);
|
||||
|
||||
public BlockOre() {
|
||||
this(Material.ROCK);
|
||||
}
|
||||
|
||||
public BlockOre(Material material) {
|
||||
super(material, TYPE, OreTypes.class);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
return BlockRenderLayer.CUTOUT_MIPPED;
|
||||
}
|
||||
|
||||
public enum OreTypes implements IStringSerializable, EnumBlock.IEnumMeta {
|
||||
TIBERIUM,
|
||||
AURODIUM,
|
||||
PROMETHEUM,
|
||||
ARCANITE,
|
||||
TITANITE,
|
||||
MYTHRIL,
|
||||
URU,
|
||||
VIBRANIUM,
|
||||
ETERNITE,
|
||||
FRACTORYTE,
|
||||
PALLADIUM,
|
||||
IGNITITE,
|
||||
BISMUTH,
|
||||
JAUXITE,
|
||||
VIOLIUM,
|
||||
KARMESINE;
|
||||
|
||||
public final int meta;
|
||||
|
||||
OreTypes() {
|
||||
meta = ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return this.toString().toLowerCase(Locale.US);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMeta() {
|
||||
return meta;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@@ -1,18 +0,0 @@
|
||||
package com.sosnitzka.taiga.generic;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
public class BasicBlockGround extends Block {
|
||||
|
||||
public BasicBlockGround(String name, Material material, float hardness, float resistance, int harvest) {
|
||||
super(material);
|
||||
setUnlocalizedName(name);
|
||||
setRegistryName(name);
|
||||
setHardness(hardness);
|
||||
setResistance(resistance);
|
||||
setHarvestLevel("shovel", harvest);
|
||||
setSoundType(SoundType.GROUND);
|
||||
}
|
||||
}
|
@@ -14,16 +14,6 @@ public class BasicItem extends Item {
|
||||
this.oreDictPrefix = oreDictPrefix;
|
||||
}
|
||||
|
||||
public BasicItem(String name, String oreDictPrefix, String registryname) {
|
||||
setUnlocalizedName(name);
|
||||
setRegistryName(registryname);
|
||||
this.oreDictPrefix = oreDictPrefix;
|
||||
}
|
||||
|
||||
public BasicItem(String name) {
|
||||
this(name, null);
|
||||
}
|
||||
|
||||
public boolean isOreDict() {
|
||||
return this.oreDictPrefix != null;
|
||||
}
|
||||
|
@@ -8,9 +8,6 @@ import slimeknights.tconstruct.library.fluid.FluidMolten;
|
||||
* A "wrapper" for FluidMolten that makes construction and manipulation easier
|
||||
*/
|
||||
public class BasicTinkerFluid extends FluidMolten {
|
||||
|
||||
private boolean toolForge;
|
||||
|
||||
public BasicTinkerFluid(String fluidName, int color, int temp, int lumen, int visk) {
|
||||
// Constructs the FluidMolten with textures and color
|
||||
super(fluidName, color, new ResourceLocation("tconstruct:blocks/fluids/molten_metal"), new ResourceLocation
|
||||
@@ -21,11 +18,5 @@ public class BasicTinkerFluid extends FluidMolten {
|
||||
this.setLuminosity(lumen);
|
||||
this.setViscosity(visk);
|
||||
this.setDensity(2000);
|
||||
this.toolForge = true;
|
||||
}
|
||||
|
||||
|
||||
public boolean isToolForge() {
|
||||
return toolForge;
|
||||
}
|
||||
}
|
||||
|
@@ -48,15 +48,9 @@ public class CraftingRegistry {
|
||||
convertion(Item.getItemFromBlock(Blocks.blockMeteorite), Items.meteoriteIngot, Items.meteoriteNugget);
|
||||
convertion(Item.getItemFromBlock(Blocks.blockObsidiorite), Items.obsidioriteIngot, Items.obsidioriteNugget);
|
||||
convertion(Item.getItemFromBlock(Blocks.dilithiumBlock), Items.dilithiumIngot, Items.dilithiumNugget);
|
||||
//convertion(Item.getItemFromBlock(Blocks.), Items., Items.);
|
||||
|
||||
}
|
||||
|
||||
public static void convertion(Item block, Item ingot, Item nugget) {
|
||||
//GameData.register_impl(new ShapedOreRecipe());
|
||||
//GameData.register_impl(new ShapedOreRecipe(new ResourceLocation(""), new ItemStack(ingot), "###", "###",
|
||||
// "###", '#', new ItemStack(nugget)));
|
||||
//GameRegistry.addShapedRecipe(new ResourceLocation(TAIGA.MODID + ":recipe_ingot_from_block_" + block.getUnlocalizedName()), new ResourceLocation(""), new ItemStack(block), "###", "###", "###", '#', new ItemStack(ingot));
|
||||
GameRegistry.addShapelessRecipe(new ResourceLocation(TAIGA.MODID + ":recipe_ingot_from_block_" + block
|
||||
.getUnlocalizedName()), new ResourceLocation(""), new ItemStack(ingot, 9), Ingredient.fromStacks(new
|
||||
ItemStack(block)));
|
||||
|
@@ -3,6 +3,6 @@ package com.sosnitzka.taiga.recipes;
|
||||
|
||||
public class SmeltingRegistry {
|
||||
public static void register() {
|
||||
// OreDictionary.getOres("nuggetIron").get(OreDictionary.getOres("nuggetIron").size() - 1);
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -45,7 +45,6 @@ public class TraitBerserk extends TraitProgressiveStats {
|
||||
return newDamage * 4;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack tool, World world, Entity entity, int itemSlot, boolean isSelected) {
|
||||
if (!world.isRemote) {
|
||||
|
@@ -31,7 +31,6 @@ public class TraitBright extends AbstractTrait {
|
||||
return super.damage(tool, player, target, damage, newDamage, isCritical);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase
|
||||
player, boolean wasEffective) {
|
||||
|
@@ -64,7 +64,6 @@ public class TraitCatcher extends AbstractTrait {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack tool, World world, Entity entity, int itemSlot, boolean isSelected) {
|
||||
if (!world.isRemote) {
|
||||
@@ -77,7 +76,6 @@ public class TraitCatcher extends AbstractTrait {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onRightClickItem(PlayerInteractEvent.RightClickItem event) {
|
||||
World w = event.getWorld();
|
||||
|
@@ -20,8 +20,6 @@ import slimeknights.tconstruct.library.utils.TinkerUtil;
|
||||
|
||||
|
||||
public class TraitCongenial extends AbstractTrait {
|
||||
|
||||
|
||||
public TraitCongenial() {
|
||||
super(TraitCongenial.class.getSimpleName().toLowerCase().substring(5), TextFormatting.RED);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
|
@@ -13,7 +13,6 @@ public class TraitCrushing extends AbstractTrait {
|
||||
super(TraitCrushing.class.getSimpleName().toLowerCase().substring(5), TextFormatting.GRAY);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void blockHarvestDrops(ItemStack tool, BlockEvent.HarvestDropsEvent e) {
|
||||
if (!e.getWorld().isRemote) {
|
||||
|
@@ -20,8 +20,6 @@ import slimeknights.tconstruct.library.utils.TinkerUtil;
|
||||
|
||||
public class TraitCursed extends AbstractTrait {
|
||||
|
||||
private static int chance = 60 * 1000;
|
||||
|
||||
public TraitCursed() {
|
||||
super(TraitCursed.class.getSimpleName().toLowerCase().substring(5), TextFormatting.RED);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
@@ -31,6 +29,7 @@ public class TraitCursed extends AbstractTrait {
|
||||
public void onUpdate(ItemStack tool, World world, Entity entity, int itemSlot, boolean isSelected) {
|
||||
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
||||
Utils.GeneralNBTData data = Utils.GeneralNBTData.read(tag);
|
||||
int chance = 60 * 1000;
|
||||
if (random.nextInt((chance + data.curse) / (data.curse + 1)) == 1) {
|
||||
if (isSelected) data.curse += 10;
|
||||
else data.curse++;
|
||||
|
@@ -62,16 +62,7 @@ public class TraitDecay extends TraitProgressiveStats {
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack tool, World world, Entity entity, int itemSlot, boolean isSelected) {
|
||||
if (entity instanceof FakePlayer || entity.world.isRemote) {
|
||||
return;
|
||||
}
|
||||
// every 3.6 seconds we distribute one stat. This means 1h = 1000 applications
|
||||
if (entity.ticksExisted % TICK_PER_STAT > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// we don't update if the player is currently breaking a block because that'd reset it
|
||||
if (playerIsBreakingBlock(entity)) {
|
||||
if (entity instanceof FakePlayer || entity.world.isRemote || entity.ticksExisted % TICK_PER_STAT != 0 || playerIsBreakingBlock(entity)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -18,7 +18,6 @@ public class TraitDissolving extends AbstractTrait {
|
||||
}
|
||||
|
||||
// high chance to remove XP, low chance to double,triple or quatruple dropped Experience
|
||||
|
||||
@SubscribeEvent
|
||||
public void onXpDrop(LivingExperienceDropEvent event) {
|
||||
if (!event.getEntity().getEntityWorld().isRemote) {
|
||||
|
@@ -16,7 +16,6 @@ import slimeknights.tconstruct.library.utils.TinkerUtil;
|
||||
|
||||
public class TraitGlimmer extends AbstractTrait {
|
||||
|
||||
|
||||
public TraitGlimmer() {
|
||||
super("glimmer", TextFormatting.DARK_GRAY);
|
||||
}
|
||||
|
@@ -21,6 +21,7 @@ import slimeknights.tconstruct.library.utils.ToolHelper;
|
||||
|
||||
|
||||
public class TraitInstable extends AbstractTrait {
|
||||
|
||||
public TraitInstable() {
|
||||
super("instable", TextFormatting.DARK_RED);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
|
@@ -15,6 +15,7 @@ import static com.google.common.collect.Lists.newArrayList;
|
||||
|
||||
|
||||
public class TraitMutate extends AbstractTrait {
|
||||
|
||||
public TraitMutate() {
|
||||
super(TraitMutate.class.getSimpleName().toLowerCase().substring(5), TextFormatting.YELLOW);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
@@ -33,7 +34,6 @@ public class TraitMutate extends AbstractTrait {
|
||||
event.setCanceled(true);
|
||||
event.getWorld().setBlockState(event.getPos(), newState);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -12,6 +12,7 @@ import slimeknights.tconstruct.library.utils.ToolHelper;
|
||||
|
||||
|
||||
public class TraitNatureBound extends AbstractTrait {
|
||||
|
||||
public TraitNatureBound() {
|
||||
super("naturebound", TextFormatting.GREEN);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
|
@@ -19,6 +19,7 @@ import slimeknights.tconstruct.library.utils.ToolHelper;
|
||||
|
||||
|
||||
public class TraitPorted extends AbstractTrait {
|
||||
|
||||
public static int distance = 10;
|
||||
|
||||
public TraitPorted() {
|
||||
@@ -42,7 +43,6 @@ public class TraitPorted extends AbstractTrait {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void afterHit(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, boolean
|
||||
wasCritical, boolean wasHit) {
|
||||
|
@@ -29,13 +29,6 @@ public abstract class TraitProgressiveStats extends AbstractTrait {
|
||||
applied_key = identifier + "StatBonus";
|
||||
}
|
||||
|
||||
public TraitProgressiveStats(String identifier, int color) {
|
||||
super(identifier, color);
|
||||
|
||||
pool_key = identifier + "StatPool";
|
||||
applied_key = identifier + "StatBonus";
|
||||
}
|
||||
|
||||
/* Modifier management */
|
||||
|
||||
protected static StatNBT getStats(NBTTagCompound root, String key) {
|
||||
|
@@ -7,7 +7,6 @@ import slimeknights.tconstruct.library.traits.AbstractTrait;
|
||||
|
||||
public class TraitResonance extends AbstractTrait {
|
||||
|
||||
|
||||
public static float chance = 0.33f;
|
||||
|
||||
public TraitResonance() {
|
||||
|
@@ -18,7 +18,6 @@ import slimeknights.tconstruct.library.utils.TinkerUtil;
|
||||
|
||||
public class TraitReviving extends AbstractTrait {
|
||||
|
||||
|
||||
public final float chance = 0.15f;
|
||||
|
||||
public TraitReviving() {
|
||||
|
@@ -20,7 +20,6 @@ public class TraitSlaughtering extends AbstractTrait {
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onMobDrops(LivingDropsEvent event) {
|
||||
World w = event.getEntity().getEntityWorld();
|
||||
|
@@ -22,12 +22,11 @@ import slimeknights.tconstruct.library.utils.TinkerUtil;
|
||||
|
||||
import static com.sosnitzka.taiga.Blocks.tiberiumOre;
|
||||
|
||||
/*
|
||||
* Collects tiberium, to release it for an explosion
|
||||
*/
|
||||
public class TraitTantrum extends AbstractTrait {
|
||||
|
||||
/*
|
||||
* Collects tiberium, to release it for an explosion
|
||||
*/
|
||||
|
||||
public static float max_charges = 12f;
|
||||
public static float max_power = 5;
|
||||
|
||||
@@ -93,7 +92,6 @@ public class TraitTantrum extends AbstractTrait {
|
||||
}
|
||||
|
||||
public static class Data {
|
||||
|
||||
float amount;
|
||||
|
||||
public static Data read(NBTTagCompound tag) {
|
||||
|
@@ -34,11 +34,7 @@ public class TraitWhirl extends AbstractTrait {
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack tool, World world, Entity entity, int itemSlot, boolean isSelected) {
|
||||
|
||||
if (entity instanceof FakePlayer || entity.world.isRemote) {
|
||||
return;
|
||||
}
|
||||
if (entity.ticksExisted % TICK_PER_STAT > 0) {
|
||||
if (entity instanceof FakePlayer || entity.world.isRemote || entity.ticksExisted % TICK_PER_STAT != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -83,7 +79,6 @@ public class TraitWhirl extends AbstractTrait {
|
||||
TagUtil.setEnchantEffect(tool, false);
|
||||
ToolHelper.damageTool(tool, 2 * r, event.getEntityPlayer());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,99 +0,0 @@
|
||||
package com.sosnitzka.taiga.util;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityCreature;
|
||||
import net.minecraft.entity.ai.EntityAIBase;
|
||||
import net.minecraft.entity.ai.RandomPositionGenerator;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityAIPermanentPanic extends EntityAIBase {
|
||||
private EntityCreature theEntityCreature;
|
||||
private double speed;
|
||||
private double randPosX;
|
||||
private double randPosY;
|
||||
private double randPosZ;
|
||||
|
||||
public EntityAIPermanentPanic(EntityCreature creature, double speedIn) {
|
||||
this.theEntityCreature = creature;
|
||||
this.speed = speedIn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the EntityAIBase should begin execution.
|
||||
*/
|
||||
public boolean shouldExecute() {
|
||||
|
||||
Vec3d vec3d = RandomPositionGenerator.findRandomTarget(this.theEntityCreature, 5, 4);
|
||||
|
||||
if (vec3d == null) {
|
||||
return false;
|
||||
} else {
|
||||
this.randPosX = vec3d.x;
|
||||
this.randPosY = vec3d.y;
|
||||
this.randPosZ = vec3d.z;
|
||||
|
||||
if (this.theEntityCreature.isBurning()) {
|
||||
BlockPos blockpos = this.getRandPos(this.theEntityCreature.world, this.theEntityCreature, 5, 4);
|
||||
|
||||
if (blockpos != null) {
|
||||
this.randPosX = (double) blockpos.getX();
|
||||
this.randPosY = (double) blockpos.getY();
|
||||
this.randPosZ = (double) blockpos.getZ();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute a one shot task or start executing a continuous task
|
||||
*/
|
||||
public void startExecuting() {
|
||||
this.theEntityCreature.getNavigator().tryMoveToXYZ(this.randPosX, this.randPosY, this.randPosZ, this.speed);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether an in-progress EntityAIBase should continue executing
|
||||
*/
|
||||
public boolean continueExecuting() {
|
||||
return !this.theEntityCreature.getNavigator().noPath();
|
||||
}
|
||||
|
||||
private BlockPos getRandPos(World worldIn, Entity entityIn, int horizontalRange, int verticalRange) {
|
||||
BlockPos blockpos = new BlockPos(entityIn);
|
||||
BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
|
||||
int i = blockpos.getX();
|
||||
int j = blockpos.getY();
|
||||
int k = blockpos.getZ();
|
||||
float f = (float) (horizontalRange * horizontalRange * verticalRange * 2);
|
||||
BlockPos blockpos1 = null;
|
||||
|
||||
for (int l = i - horizontalRange; l <= i + horizontalRange; ++l) {
|
||||
for (int i1 = j - verticalRange; i1 <= j + verticalRange; ++i1) {
|
||||
for (int j1 = k - horizontalRange; j1 <= k + horizontalRange; ++j1) {
|
||||
blockpos$mutableblockpos.setPos(l, i1, j1);
|
||||
IBlockState iblockstate = worldIn.getBlockState(blockpos$mutableblockpos);
|
||||
Block block = iblockstate.getBlock();
|
||||
|
||||
if (block == Blocks.WATER || block == Blocks.FLOWING_WATER) {
|
||||
float f1 = (float) ((l - i) * (l - i) + (i1 - j) * (i1 - j) + (j1 - k) * (j1 - k));
|
||||
|
||||
if (f1 < f) {
|
||||
f = f1;
|
||||
blockpos1 = new BlockPos(blockpos$mutableblockpos);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return blockpos1;
|
||||
}
|
||||
}
|
@@ -54,7 +54,6 @@ public class Generator {
|
||||
.generate(world, random, new BlockPos(posX, posY, posZ));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +63,6 @@ public class Generator {
|
||||
generateOreDescending(replaceBlockList, replacementBlock, random, chunkX, chunkZ, world, count, minY, maxY);
|
||||
}
|
||||
|
||||
|
||||
public static void generateOreDescending(List<IBlockState> replaceBlockList, IBlockState replacementBlock, Random
|
||||
random, int chunkX, int chunkZ, World world, int count, int minY, int maxY) {
|
||||
for (int i = 0; i < count; i++) {
|
||||
@@ -195,7 +193,6 @@ public class Generator {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static int generateMeteor(IBlockState centerBlock, IBlockState hullBlock, Random random, int chunkX, int
|
||||
chunkZ, World world, int count, int chance, int minY, int maxY) {
|
||||
Set<Item> validSurface = new HashSet<Item>();
|
||||
|
@@ -26,10 +26,9 @@ public class StateMatcher implements Predicate<IBlockState> {
|
||||
if (state != null) {
|
||||
if (property != null && value != null) {
|
||||
if (state.getBlock() == this.state.getBlock())
|
||||
if (checkLayerForBlocks(3, 3, -1, world, pos) ||
|
||||
return checkLayerForBlocks(3, 3, -1, world, pos) ||
|
||||
checkLayerForBlocks(3, 3, 0, world, pos) ||
|
||||
checkLayerForBlocks(3, 3, 1, world, pos))
|
||||
return true;
|
||||
checkLayerForBlocks(3, 3, 1, world, pos);
|
||||
|
||||
} else
|
||||
return state.getBlock() == this.state.getBlock();
|
||||
|
Reference in New Issue
Block a user