- 1,057
- 50
- 234
Думаю многие знают Огненный блок в twilight forest.
Как воссоздать такой блок?
Только вместо огня, допустим вода или другая entity?
Как воссоздать такой блок?
Только вместо огня, допустим вода или другая entity?
Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
package twilightforest.tileentity;
import net.minecraft.tileentity.TileEntity;
import twilightforest.TwilightForestMod;
public class TileEntityTFSmoker extends TileEntity {
public long counter = 0L;
public void func_145845_h() {
if(++this.counter % 4L == 0L) {
TwilightForestMod.proxy.spawnParticle(this.field_145850_b, "hugesmoke", (double)this.field_145851_c + 0.5D, (double)this.field_145848_d + 0.95D, (double)this.field_145849_e + 0.5D, Math.cos((double)this.counter / 10.0D) * 0.05D, 0.25D, Math.sin((double)this.counter / 10.0D) * 0.05D);
}
}
}
public void spawnParticle(World world, String particleType, double x, double y, double z, double velX, double velY, double velZ) {
Minecraft mc = FMLClientHandler.instance().getClient();
if(mc != null && mc.renderViewEntity != null && mc.effectRenderer != null && mc.theWorld == world) {
double distX = mc.renderViewEntity.field_70165_t - x;
double distY = mc.renderViewEntity.field_70163_u - y;
double distZ = mc.renderViewEntity.field_70161_v - z;
Object particle = null;
double maxDist = 64.0D;
if(distX * distX + distY * distY + distZ * distZ < maxDist * maxDist) {
if(particleType.equals("largeflame")) {
particle = new EntityTFLargeFlameFX(world, x, y, z, velX, velY, velZ);
} else if(particleType.equals("hugesmoke")) {
particle = new EntitySmokeFX(world, x, y, z, velX, velY, velZ, 8.0F);
} else if(particleType.equals("leafrune")) {
particle = new EntityTFLeafRuneFX(world, x, y, z, velX, velY, velZ);
} else if(particleType.equals("bosstear")) {
particle = new EntityTFBossTearFX(world, x, y, z, velX, velY, velZ, Items.field_151073_bk);
} else if(particleType.equals("ghasttrap")) {
particle = new EntityTFGhastTrapFX(world, x, y, z, velX, velY, velZ);
} else if(particleType.equals("protection")) {
particle = new EntityTFProtectionFX(world, x, y, z, velX, velY, velZ);
} else if(particleType.equals("snowstuff")) {
particle = new EntityTFSnowFX(world, x, y, z, velX, velY, velZ);
} else if(particleType.equals("snowwarning")) {
particle = new EntityTFSnowWarningFX(world, x, y, z, velX, velY, velZ, 1.0F);
} else if(particleType.equals("snowguardian")) {
particle = new EntityTFSnowGuardianFX(world, x, y, z, velX, velY, velZ, 0.75F);
} else if(particleType.equals("icebeam")) {
particle = new EntityTFIceBeamFX(world, x, y, z, velX, velY, velZ, 0.75F);
}
if(particle != null) {
((Entity)particle).prevPosX = ((Entity)particle).posX;
((Entity)particle).prevPosY = ((Entity)particle).posY;
((Entity)particle).prevPosZ = ((Entity)particle).posZ;
mc.effectRenderer.addEffect((EntityFX)particle);
}
}
}
}
Ты сам код привел сообщением вышеBlesseNtumble написал(а):какие аргументы вместо this.field_145850_b, (double)this.field_145851_c и тд
public void spawnParticle(World world, String particleType, double x, double y, double z, double velX, double velY, double velZ) {
package blessentumble.moons.europajupiter.tile;
import java.util.Iterator;
import java.util.List;
import blessentumble.BlesseAddon;
import net.minecraft.entity.Entity;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
public class TileEntityIceWater extends TileEntity {
public TileEntityIceWater() {
}
public TileEntityIceWater(int parNextMeta) {
}
public void spawnParticle(World world, String particleType, double x, double y, double z, double velX, double velY, double velZ) {
//world.spawnParticle("largesmoke", (double)x + 0.5D, (double)y + 1.0D, (double)z + 0.5D, 0.0D, 0.0D, 0.0D);
BlesseAddon.proxy.spawnParticle(world, "largeflame", (double)x + 0.5D, (double)y + 1.0D, (double)z + 0.5D, 0.0D, 0.5D, 0.0D);
}
}