本文整理汇总了Java中net.minecraft.tileentity.MobSpawnerBaseLogic类的典型用法代码示例。如果您正苦于以下问题:Java MobSpawnerBaseLogic类的具体用法?Java MobSpawnerBaseLogic怎么用?Java MobSpawnerBaseLogic使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MobSpawnerBaseLogic类属于net.minecraft.tileentity包,在下文中一共展示了MobSpawnerBaseLogic类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addInformation
import net.minecraft.tileentity.MobSpawnerBaseLogic; //导入依赖的package包/类
@Override
public void addInformation(World world, BlockPos pos, TileEntity te, List<String> infoList) {
if (te instanceof TileEntityMobSpawner) {
MobSpawnerBaseLogic spawner = ((TileEntityMobSpawner) te).getSpawnerBaseLogic();
ResourceLocation rl = Reflections.getEntityId(spawner);
// infoList.add("Spawner Type: " + I18n.format("entity." + spawner.getEntityNameToSpawn() + ".name"));
infoList.add("Spawner Type: " + (rl == null ? "?" : rl.toString()));
if (Reflections.isActivated(spawner) || SemiBlockManager.getInstance(world).getSemiBlock(SemiBlockSpawnerAgitator.class, world, pos) != null) {
infoList.add("Time until next spawn: " + PneumaticCraftUtils.convertTicksToMinutesAndSeconds(spawner.spawnDelay, false));
} else if (HackableMobSpawner.isHacked(world, pos)) {
infoList.add("Spawner is hacked");
} else {
infoList.add("Spawner is standing by");
}
}
}
示例2: update
import net.minecraft.tileentity.MobSpawnerBaseLogic; //导入依赖的package包/类
@Override
public void update() {
super.update();
if (!world.isRemote) {
TileEntityMobSpawner te = getTileEntity();
if(te != null){
MobSpawnerBaseLogic spawnerLogic = te.getSpawnerBaseLogic();
//Only tick the logic if it wasn't ticked already by the TE itself, to prevent double ticking.
if(!Reflections.isActivated(spawnerLogic)){
//Temporarily add a fake player to the world to trick the spawner into thinking there's a player nearby
EntityPlayer fakePlayer = FakePlayerFactory.get((WorldServer)world, FAKE_PLAYER_PROFILE);
fakePlayer.posX = getPos().getX();
fakePlayer.posY = getPos().getY();
fakePlayer.posZ = getPos().getZ();
world.playerEntities.add(fakePlayer);
spawnerLogic.updateSpawner();
world.playerEntities.remove(fakePlayer);
}
}
}
}
示例3: renderMob
import net.minecraft.tileentity.MobSpawnerBaseLogic; //导入依赖的package包/类
/**
* Render the mob inside the mob spawner.
*/
public static void renderMob(MobSpawnerBaseLogic mobSpawnerLogic, double posX, double posY, double posZ, float partialTicks)
{
Entity entity = mobSpawnerLogic.func_180612_a(mobSpawnerLogic.getSpawnerWorld());
if (entity != null)
{
float f = 0.4375F;
GlStateManager.translate(0.0F, 0.4F, 0.0F);
GlStateManager.rotate((float)(mobSpawnerLogic.getPrevMobRotation() + (mobSpawnerLogic.getMobRotation() - mobSpawnerLogic.getPrevMobRotation()) * (double)partialTicks) * 10.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(-30.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.translate(0.0F, -0.4F, 0.0F);
GlStateManager.scale(f, f, f);
entity.setLocationAndAngles(posX, posY, posZ, 0.0F, 0.0F);
Minecraft.getMinecraft().getRenderManager().renderEntityWithPosYaw(entity, 0.0D, 0.0D, 0.0D, 0.0F, partialTicks);
}
}
示例4: renderMob
import net.minecraft.tileentity.MobSpawnerBaseLogic; //导入依赖的package包/类
/**
* Render the mob inside the mob spawner.
*/
public static void renderMob(MobSpawnerBaseLogic mobSpawnerLogic, double posX, double posY, double posZ, float partialTicks)
{
Entity entity = mobSpawnerLogic.getCachedEntity();
if (entity != null)
{
float f = 0.53125F;
float f1 = Math.max(entity.width, entity.height);
if ((double)f1 > 1.0D)
{
f /= f1;
}
GlStateManager.translate(0.0F, 0.4F, 0.0F);
GlStateManager.rotate((float)(mobSpawnerLogic.getPrevMobRotation() + (mobSpawnerLogic.getMobRotation() - mobSpawnerLogic.getPrevMobRotation()) * (double)partialTicks) * 10.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.translate(0.0F, -0.2F, 0.0F);
GlStateManager.rotate(-30.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.scale(f, f, f);
entity.setLocationAndAngles(posX, posY, posZ, 0.0F, 0.0F);
Minecraft.getMinecraft().getRenderManager().doRenderEntity(entity, 0.0D, 0.0D, 0.0D, 0.0F, partialTicks, false);
}
}
示例5: resetTimer
import net.minecraft.tileentity.MobSpawnerBaseLogic; //导入依赖的package包/类
private void resetTimer()
{
if (this.maxSpawnDelay <= this.minSpawnDelay)
{
this.spawnDelay = this.minSpawnDelay;
}
else
{
int i = this.maxSpawnDelay - this.minSpawnDelay;
this.spawnDelay = this.minSpawnDelay + this.getSpawnerWorld().rand.nextInt(i);
}
if (this.potentialEntitySpawns != null && this.potentialEntitySpawns.size() > 0)
{
this.setRandomEntity((MobSpawnerBaseLogic.WeightedRandomMinecart)WeightedRandom.getRandomItem(this.getSpawnerWorld().rand, this.potentialEntitySpawns));
}
this.func_98267_a(1);
}
示例6: func_147517_a
import net.minecraft.tileentity.MobSpawnerBaseLogic; //导入依赖的package包/类
public static void func_147517_a(MobSpawnerBaseLogic p_147517_0_, double p_147517_1_, double p_147517_3_, double p_147517_5_, float p_147517_7_)
{
Entity var8 = p_147517_0_.func_98281_h();
if (var8 != null)
{
var8.setWorld(p_147517_0_.getSpawnerWorld());
float var9 = 0.4375F;
GL11.glTranslatef(0.0F, 0.4F, 0.0F);
GL11.glRotatef((float)(p_147517_0_.field_98284_d + (p_147517_0_.field_98287_c - p_147517_0_.field_98284_d) * (double)p_147517_7_) * 10.0F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-30.0F, 1.0F, 0.0F, 0.0F);
GL11.glTranslatef(0.0F, -0.4F, 0.0F);
GL11.glScalef(var9, var9, var9);
var8.setLocationAndAngles(p_147517_1_, p_147517_3_, p_147517_5_, 0.0F, 0.0F);
RenderManager.instance.func_147940_a(var8, 0.0D, 0.0D, 0.0D, 0.0F, p_147517_7_);
}
}
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:18,代码来源:TileEntityMobSpawnerRenderer.java
示例7: func_147517_a
import net.minecraft.tileentity.MobSpawnerBaseLogic; //导入依赖的package包/类
public static void func_147517_a(MobSpawnerBaseLogic p_147517_0_, double p_147517_1_, double p_147517_3_, double p_147517_5_, float p_147517_7_)
{
Entity entity = p_147517_0_.func_98281_h();
if (entity != null)
{
entity.setWorld(p_147517_0_.getSpawnerWorld());
float f1 = 0.4375F;
GL11.glTranslatef(0.0F, 0.4F, 0.0F);
GL11.glRotatef((float)(p_147517_0_.field_98284_d + (p_147517_0_.field_98287_c - p_147517_0_.field_98284_d) * (double)p_147517_7_) * 10.0F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-30.0F, 1.0F, 0.0F, 0.0F);
GL11.glTranslatef(0.0F, -0.4F, 0.0F);
GL11.glScalef(f1, f1, f1);
entity.setLocationAndAngles(p_147517_1_, p_147517_3_, p_147517_5_, 0.0F, 0.0F);
RenderManager.instance.renderEntityWithPosYaw(entity, 0.0D, 0.0D, 0.0D, 0.0F, p_147517_7_);
}
}
示例8: WeightedRandomMinecart
import net.minecraft.tileentity.MobSpawnerBaseLogic; //导入依赖的package包/类
public WeightedRandomMinecart(MobSpawnerBaseLogic p_i1945_1_, NBTTagCompound p_i1945_2_) {
super(p_i1945_2_.func_74762_e("Weight"));
this.field_98221_d = p_i1945_1_;
NBTTagCompound var3 = p_i1945_2_.func_74775_l("Properties");
String var4 = p_i1945_2_.func_74779_i("Type");
if(var4.equals("Minecart")) {
if(var3 != null) {
switch(var3.func_74762_e("Type")) {
case 0:
var4 = "MinecartRideable";
break;
case 1:
var4 = "MinecartChest";
break;
case 2:
var4 = "MinecartFurnace";
}
} else {
var4 = "MinecartRideable";
}
}
this.field_98222_b = var3;
this.field_98223_c = var4;
}
示例9: func_98144_a
import net.minecraft.tileentity.MobSpawnerBaseLogic; //导入依赖的package包/类
public static void func_98144_a(MobSpawnerBaseLogic par0MobSpawnerBaseLogic, double par1, double par3, double par5, float par7)
{
Entity entity = par0MobSpawnerBaseLogic.func_98281_h();
if (entity != null)
{
entity.setWorld(par0MobSpawnerBaseLogic.getSpawnerWorld());
float f1 = 0.4375F;
GL11.glTranslatef(0.0F, 0.4F, 0.0F);
GL11.glRotatef((float)(par0MobSpawnerBaseLogic.field_98284_d + (par0MobSpawnerBaseLogic.field_98287_c - par0MobSpawnerBaseLogic.field_98284_d) * (double)par7) * 10.0F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-30.0F, 1.0F, 0.0F, 0.0F);
GL11.glTranslatef(0.0F, -0.4F, 0.0F);
GL11.glScalef(f1, f1, f1);
entity.setLocationAndAngles(par1, par3, par5, 0.0F, 0.0F);
RenderManager.instance.renderEntityWithPosYaw(entity, 0.0D, 0.0D, 0.0D, 0.0F, par7);
}
}
示例10: getMobSpawnerLogic
import net.minecraft.tileentity.MobSpawnerBaseLogic; //导入依赖的package包/类
public static MobSpawnerBaseLogic getMobSpawnerLogic(Class<? extends TileEntity> clz, TileEntity instance)
{
try
{
Field field = mobSpawnerLogic.get(clz);
if(field != null)
{
field.setAccessible(true);
Object obj = field.get(instance);
if(obj instanceof MobSpawnerBaseLogic)
{
return (MobSpawnerBaseLogic)obj;
}
}
}
catch(Exception e)
{
}
return null;
}
示例11: generate
import net.minecraft.tileentity.MobSpawnerBaseLogic; //导入依赖的package包/类
public void generate(IWorldEditor editor, Random rand, Coord cursor, int level){
Coord pos = new Coord(cursor);
editor.setBlock(pos, new MetaBlock(Blocks.MOB_SPAWNER.getDefaultState()), true, true);
TileEntity tileentity = editor.getTileEntity(pos);
if (!(tileentity instanceof TileEntityMobSpawner)) return;
TileEntityMobSpawner spawner = (TileEntityMobSpawner)tileentity;
MobSpawnerBaseLogic spawnerLogic = spawner.getSpawnerBaseLogic();
NBTTagCompound nbt = new NBTTagCompound();
nbt.setInteger("x", pos.getX());
nbt.setInteger("y", pos.getY());
nbt.setInteger("z", pos.getZ());
nbt.setTag("SpawnPotentials", getSpawnPotentials(rand, level));
spawnerLogic.readFromNBT(nbt);
spawnerLogic.updateSpawner();
tileentity.markDirty();
}
示例12: afterHackTick
import net.minecraft.tileentity.MobSpawnerBaseLogic; //导入依赖的package包/类
@Override
public boolean afterHackTick(World world, BlockPos pos) {
MobSpawnerBaseLogic spawner = ((TileEntityMobSpawner) world.getTileEntity(pos)).getSpawnerBaseLogic();
spawner.prevMobRotation = spawner.getMobRotation();
spawner.spawnDelay = 10;
return false;
}
示例13: init
import net.minecraft.tileentity.MobSpawnerBaseLogic; //导入依赖的package包/类
public static void init() {
msbl_isActivated = ReflectionHelper.findMethod(MobSpawnerBaseLogic.class, "isActivated", "func_98279_f");
msbl_getEntityId = ReflectionHelper.findMethod(MobSpawnerBaseLogic.class, "getEntityId", "func_190895_g");
// access to non-public entity AI's for hacking purposes
blaze_aiFireballAttack = findEnclosedClass(EntityBlaze.class, "AIFireballAttack", "a");
ghast_aiFireballAttack = findEnclosedClass(EntityGhast.class, "AIFireballAttack", "c");
}
示例14: getEntityId
import net.minecraft.tileentity.MobSpawnerBaseLogic; //导入依赖的package包/类
public static ResourceLocation getEntityId(MobSpawnerBaseLogic msbl) {
try {
return (ResourceLocation) msbl_getEntityId.invoke(msbl);
} catch (IllegalAccessException | InvocationTargetException e) {
e.printStackTrace();
return null;
}
}
示例15: isActivated
import net.minecraft.tileentity.MobSpawnerBaseLogic; //导入依赖的package包/类
public static boolean isActivated(MobSpawnerBaseLogic msbl) {
try {
return (boolean) msbl_isActivated.invoke(msbl);
} catch (IllegalAccessException | InvocationTargetException e) {
e.printStackTrace();
return false;
}
}