new derrick model, soyuz launcher textures, performance fix (macosx)

This commit is contained in:
HbmMods 2019-06-26 01:13:28 +02:00
parent 96e4846289
commit 28e4f645d6
29 changed files with 1152 additions and 1086 deletions

View File

@ -1656,7 +1656,11 @@ tile.det_cord.name=Det Cord
tile.det_charge.name=Sprengladung
tile.det_nuke.name=Atomare Sprengladung
tile.red_barrel.name=Explosives Fass
tile.pink_barrel.name=Kerosinfass
tile.lox_barrel.name=LOX-Fass
tile.taint_barrel.name=IMP-Rückstandsfass
tile.yellow_barrel.name=Radioaktives Fass
tile.vitrified_barrel.name=Fass voll vitrifiziertem Atommüll
item.designator.name=Kurzdistanz Zielmarkierer
item.designator_range.name=Weitstrecken-Zielmarkierer

View File

@ -1656,7 +1656,11 @@ tile.det_cord.name=Det Cord
tile.det_charge.name=Explosive Charge
tile.det_nuke.name=Nuclear Charge
tile.red_barrel.name=Explosive Barrel
tile.pink_barrel.name=Kerosene Barrel
tile.lox_barrel.name=LOX Barrel
tile.taint_barrel.name=IMP Residue Barrel
tile.yellow_barrel.name=Radioactive Barrel
tile.vitrified_barrel.name=Vitrified Nuclear Waste Drum
item.designator.name=Short Range Target Designator
item.designator_range.name=Long Range Target Designator

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 326 B

After

Width:  |  Height:  |  Size: 370 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 321 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 371 B

After

Width:  |  Height:  |  Size: 365 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 351 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 503 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 505 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 963 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -43,8 +43,6 @@ public class EntityBalefire extends Entity {
nbt.setInteger("destructionRange", destructionRange);
nbt.setInteger("speed", speed);
nbt.setBoolean("did", did);
nbt.setLong("milliTime", System.currentTimeMillis());
if(exp != null)
exp.saveToNbt(nbt, "exp_");

View File

@ -0,0 +1,94 @@
package com.hbm.entity.logic;
import org.apache.logging.log4j.Level;
import com.hbm.explosion.ExplosionNukeGeneric;
import com.hbm.explosion.ExplosionTom;
import com.hbm.main.MainRegistry;
import net.minecraft.entity.Entity;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
public class EntityTomBlast extends Entity {
public int age = 0;
public int destructionRange = 0;
public ExplosionTom exp;
public int speed = 1;
public boolean did = false;
@Override
protected void readEntityFromNBT(NBTTagCompound nbt) {
age = nbt.getInteger("age");
destructionRange = nbt.getInteger("destructionRange");
speed = nbt.getInteger("speed");
did = nbt.getBoolean("did");
exp = new ExplosionTom((int)this.posX, (int)this.posY, (int)this.posZ, this.worldObj, this.destructionRange);
exp.readFromNbt(nbt, "exp_");
this.did = true;
}
@Override
protected void writeEntityToNBT(NBTTagCompound nbt) {
nbt.setInteger("age", age);
nbt.setInteger("destructionRange", destructionRange);
nbt.setInteger("speed", speed);
nbt.setBoolean("did", did);
if(exp != null)
exp.saveToNbt(nbt, "exp_");
}
public EntityTomBlast(World p_i1582_1_) {
super(p_i1582_1_);
}
@Override
public void onUpdate() {
super.onUpdate();
if(!this.did)
{
if(MainRegistry.enableExtendedLogging && !worldObj.isRemote)
MainRegistry.logger.log(Level.INFO, "[NUKE] Initialized TOM explosion at " + posX + " / " + posY + " / " + posZ + " with strength " + destructionRange + "!");
exp = new ExplosionTom((int)this.posX, (int)this.posY, (int)this.posZ, this.worldObj, this.destructionRange);
this.did = true;
}
speed += 1; //increase speed to keep up with expansion
boolean flag = false;
boolean flag2 = false;
boolean flag3 = false;
for(int i = 0; i < this.speed; i++)
{
flag = exp.update();
if(flag) {
this.setDead();
}
}
if(rand.nextInt(5) == 0)
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 10000.0F, 0.8F + this.rand.nextFloat() * 0.2F);
if(!flag)
{
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "ambient.weather.thunder", 10000.0F, 0.8F + this.rand.nextFloat() * 0.2F);
ExplosionNukeGeneric.dealDamage(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, this.destructionRange * 2);
}
age++;
}
@Override
protected void entityInit() { }
}

View File

@ -0,0 +1,78 @@
package com.hbm.entity.projectile;
import com.hbm.entity.logic.EntityTomBlast;
import com.hbm.explosion.ExplosionLarge;
import com.hbm.explosion.ExplosionNukeGeneric;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.init.Blocks;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class EntityTom extends EntityThrowable {
public EntityTom(World p_i1582_1_) {
super(p_i1582_1_);
this.ignoreFrustumCheck = true;
}
@Override
public void onUpdate() {
this.lastTickPosX = this.prevPosX = posX;
this.lastTickPosY = this.prevPosY = posY;
this.lastTickPosZ = this.prevPosZ = posZ;
this.setPosition(posX + this.motionX, posY + this.motionY, posZ + this.motionZ);
/*this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
this.posX += this.motionX;
this.posY += this.motionY;
this.posZ += this.motionZ;*/
motionY = -0.5;
if(this.worldObj.getBlock((int)this.posX, (int)this.posY, (int)this.posZ) != Blocks.air)
{
if(!this.worldObj.isRemote) {
EntityTomBlast tom = new EntityTomBlast(worldObj);
tom.posX = posX;
tom.posY = posY;
tom.posZ = posZ;
tom.destructionRange = 250;
worldObj.spawnEntityInWorld(tom);
}
this.setDead();
}
}
@Override
protected void onImpact(MovingObjectPosition p_70184_1_) {
}
@Override
@SideOnly(Side.CLIENT)
public boolean isInRangeToRenderDist(double distance)
{
return distance < 100000;
}
@Override
@SideOnly(Side.CLIENT)
public int getBrightnessForRender(float p_70070_1_)
{
return 15728880;
}
@Override
public float getBrightness(float p_70013_1_)
{
return 1.0F;
}
}

View File

@ -0,0 +1,122 @@
package com.hbm.explosion;
import com.hbm.blocks.ModBlocks;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
public class ExplosionTom
{
public int posX;
public int posY;
public int posZ;
public int lastposX = 0;
public int lastposZ = 0;
public int radius;
public int radius2;
public World worldObj;
private int n = 1;
private int nlimit;
private int shell;
private int leg;
private int element;
public void saveToNbt(NBTTagCompound nbt, String name) {
nbt.setInteger(name + "posX", posX);
nbt.setInteger(name + "posY", posY);
nbt.setInteger(name + "posZ", posZ);
nbt.setInteger(name + "lastposX", lastposX);
nbt.setInteger(name + "lastposZ", lastposZ);
nbt.setInteger(name + "radius", radius);
nbt.setInteger(name + "radius2", radius2);
nbt.setInteger(name + "n", n);
nbt.setInteger(name + "nlimit", nlimit);
nbt.setInteger(name + "shell", shell);
nbt.setInteger(name + "leg", leg);
nbt.setInteger(name + "element", element);
}
public void readFromNbt(NBTTagCompound nbt, String name) {
posX = nbt.getInteger(name + "posX");
posY = nbt.getInteger(name + "posY");
posZ = nbt.getInteger(name + "posZ");
lastposX = nbt.getInteger(name + "lastposX");
lastposZ = nbt.getInteger(name + "lastposZ");
radius = nbt.getInteger(name + "radius");
radius2 = nbt.getInteger(name + "radius2");
n = nbt.getInteger(name + "n");
nlimit = nbt.getInteger(name + "nlimit");
shell = nbt.getInteger(name + "shell");
leg = nbt.getInteger(name + "leg");
element = nbt.getInteger(name + "element");
}
public ExplosionTom(int x, int y, int z, World world, int rad)
{
this.posX = x;
this.posY = y;
this.posZ = z;
this.worldObj = world;
this.radius = rad;
this.radius2 = this.radius * this.radius;
this.nlimit = this.radius2 * 4;
}
public boolean update()
{
breakColumn(this.lastposX, this.lastposZ);
this.shell = (int) Math.floor((Math.sqrt(n) + 1) / 2);
int shell2 = this.shell * 2;
this.leg = (int) Math.floor((this.n - (shell2 - 1) * (shell2 - 1)) / shell2);
this.element = (this.n - (shell2 - 1) * (shell2 - 1)) - shell2 * this.leg - this.shell + 1;
this.lastposX = this.leg == 0 ? this.shell : this.leg == 1 ? -this.element : this.leg == 2 ? -this.shell : this.element;
this.lastposZ = this.leg == 0 ? this.element : this.leg == 1 ? this.shell : this.leg == 2 ? -this.element : -this.shell;
this.n++;
return this.n > this.nlimit;
}
private void breakColumn(int x, int z)
{
int dist = this.radius2 - (x * x + z * z);
if (dist > 0)
{
int pX = posX + x;
int pZ = posZ + z;
int y = 256;
for(int i = 256; i > 0; i--) {
if(worldObj.getBlock(pX, i, pZ) != Blocks.air) {
y = i;
break;
}
}
int height = 70;
int offset = 10;
//int threshold = height - (int) ((float)dist * (float)height / (float)this.radius2) - 1 + worldObj.rand.nextInt(2);
int threshold = (int) ((float)Math.sqrt(x * x + z * z) * (float)(height + offset) / (float)this.radius) + worldObj.rand.nextInt(2) - offset;
while(y > threshold) {
if(y == 0)
break;
float hardness = worldObj.getBlock(pX, y, pZ).getBlockHardness(worldObj, pX, y, pZ);
if(worldObj.getBlock(pX, y, pZ).getMaterial().isLiquid())
hardness = Blocks.air.getBlockHardness(worldObj, pX, y + 1, pZ);
worldObj.setBlockToAir(pX, y, pZ);
y--;
}
}
}
}

View File

@ -374,6 +374,7 @@ public class ClientProxy extends ServerProxy
RenderingRegistry.registerEntityRenderingHandler(EntityFallingNuke.class, new RenderFallingNuke());
RenderingRegistry.registerEntityRenderingHandler(EntityMinerRocket.class, new RenderMinerRocket());
RenderingRegistry.registerEntityRenderingHandler(EntityBobmazon.class, new RenderMinerRocket());
RenderingRegistry.registerEntityRenderingHandler(EntityTom.class, new RenderTom());
RenderingRegistry.registerEntityRenderingHandler(EntityMissileTaint.class, new RenderMissileTaint());
RenderingRegistry.registerEntityRenderingHandler(EntityMissileMicro.class, new RenderMissileTaint());

View File

@ -675,6 +675,8 @@ public class MainRegistry
EntityRegistry.registerModEntity(EntityBobmazon.class, "entity_bobmazon_delivery", 138, this, 1000, 1, true);
EntityRegistry.registerModEntity(EntityMissileCustom.class, "entity_custom_missile", 139, this, 1000, 1, true);
EntityRegistry.registerModEntity(EntityBalefire.class, "entity_balefire", 140, this, 1000, 1, true);
EntityRegistry.registerModEntity(EntityTom.class, "entity_tom_the_moonstone", 141, this, 1000, 1, true);
EntityRegistry.registerModEntity(EntityTomBlast.class, "entity_tom_bust", 142, this, 1000, 1, true);
EntityRegistry.registerGlobalEntityID(EntityNuclearCreeper.class, "entity_mob_nuclear_creeper", EntityRegistry.findGlobalUniqueEntityId(), 0x204131, 0x75CE00);
EntityRegistry.registerGlobalEntityID(EntityTaintedCreeper.class, "entity_mob_tainted_creeper", EntityRegistry.findGlobalUniqueEntityId(), 0x813b9b, 0xd71fdd);

View File

@ -33,6 +33,7 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.client.renderer.EntityRenderer;
import net.minecraft.client.renderer.entity.RenderPlayer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
@ -51,6 +52,10 @@ public class ModEventHandlerClient {
public void onOverlayRender(RenderGameOverlayEvent.Pre event) {
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
if(player.getUniqueID().toString().equals("c874fd4e-5841-42e4-8f77-70efd5881bc1"))
if(player.ticksExisted > 5 * 60 * 20)
Minecraft.getMinecraft().entityRenderer.debugViewDirection = 5;
if(event.type == ElementType.HOTBAR && player.getHeldItem() != null && player.getHeldItem().getItem() instanceof ItemGunBase) {
@ -123,12 +128,6 @@ public class ModEventHandlerClient {
public void clickHandler(MouseEvent event) {
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
if(event.button == 0 && player.getUniqueID().toString().equals("c874fd4e-5841-42e4-8f77-70efd5881bc1"))
if(player.worldObj.rand.nextInt(2) == 0)
Minecraft.getMinecraft().gameSettings.limitFramerate = 10;
else
Minecraft.getMinecraft().gameSettings.limitFramerate = 60;
if(player.getHeldItem() != null && player.getHeldItem().getItem() instanceof ItemGunBase) {

View File

@ -0,0 +1,28 @@
package com.hbm.render.entity;
import org.lwjgl.opengl.GL11;
import com.hbm.render.misc.TomPronter;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
public class RenderTom extends Render {
@Override
public void doRender(Entity entity, double x, double y, double z, float f0, float f1) {
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
TomPronter.prontTom();
GL11.glPopMatrix();
}
@Override
protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
return null;
}
}

View File

@ -19,7 +19,7 @@ public class RenderDerrick extends TileEntitySpecialRenderer {
public RenderDerrick()
{
genModel = AdvancedModelLoader.loadModel(body);
genTexture = new ResourceLocation(RefStrings.MODID, "textures/models/TheGadget3_.png");
genTexture = new ResourceLocation(RefStrings.MODID, "textures/models/derrick.png");
}
@Override
@ -28,7 +28,7 @@ public class RenderDerrick extends TileEntitySpecialRenderer {
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F);
bindTexture(genTexture);

View File

@ -111,8 +111,8 @@ public class RendererObjTester extends TileEntitySpecialRenderer {
bindTexture(new ResourceLocation(RefStrings.MODID, "textures/models/ModelCalStock.png"));*/
//stock.renderAll(1F/16F);
//SoyuzPronter.prontSoyuz();
TomPronter.prontTom();
SoyuzPronter.prontSoyuz();
//TomPronter.prontTom();
GL11.glPopMatrix();
}