Fixed the nuke rendering not being added
This commit is contained in:
32
.idea/workspace.xml
generated
32
.idea/workspace.xml
generated
@@ -1,17 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="21afa9bb-6936-4dba-b025-44007f88dd40" name="Changes" comment="added a nuke">
|
||||
<change afterPath="$PROJECT_DIR$/src/net/minecraft/src/mml/Blocks/BlockChunkDeleter.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/net/minecraft/src/mml/ImplSoundLoader.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/net/minecraft/src/mml/Items/Detonator.java" afterDir="false" />
|
||||
<list default="true" id="21afa9bb-6936-4dba-b025-44007f88dd40" name="Changes" comment="added an improved sound loader that can load from the .modsounds folder inside of the game directory. Added textures and sounds to the nuke!">
|
||||
<change afterPath="$PROJECT_DIR$/src/net/minecraft/src/mml/Render/RenderNukePrimed.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/lang/en_US_Mod.lang" beforeDir="false" afterPath="$PROJECT_DIR$/src/lang/en_US_Mod.lang" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/net/minecraft/src/Block.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/minecraft/src/Block.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/net/minecraft/src/EntityLargeFireball.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/minecraft/src/EntityLargeFireball.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/net/minecraft/src/EntityList.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/minecraft/src/EntityList.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/net/minecraft/src/EntityTracker.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/minecraft/src/EntityTracker.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/net/minecraft/src/EntityTrackerEntry.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/minecraft/src/EntityTrackerEntry.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/net/minecraft/src/Explosion.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/minecraft/src/Explosion.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/net/minecraft/src/Item.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/minecraft/src/Item.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/net/minecraft/src/SoundManager.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/minecraft/src/SoundManager.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/net/minecraft/src/NetClientHandler.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/minecraft/src/NetClientHandler.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/net/minecraft/src/RenderManager.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/minecraft/src/RenderManager.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/net/minecraft/src/World.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/minecraft/src/World.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/net/minecraft/src/mml/Blocks/BlockNuke.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/minecraft/src/mml/Blocks/BlockNuke.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/net/minecraft/src/mml/Entities/EntityNukePrimed.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/minecraft/src/mml/Entities/EntityNukePrimed.java" afterDir="false" />
|
||||
@@ -86,7 +84,8 @@
|
||||
<updated>1781711682567</updated>
|
||||
<workItem from="1781711683576" duration="10131000" />
|
||||
<workItem from="1781724230644" duration="29000" />
|
||||
<workItem from="1781839713575" duration="12598000" />
|
||||
<workItem from="1781839713575" duration="12853000" />
|
||||
<workItem from="1781883552661" duration="7561000" />
|
||||
</task>
|
||||
<task id="LOCAL-00001" summary="add a BlockRegister class to let rev not shoot himself trying to register blocks">
|
||||
<option name="closed" value="true" />
|
||||
@@ -104,7 +103,15 @@
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1781841566418</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="3" />
|
||||
<task id="LOCAL-00003" summary="added an improved sound loader that can load from the .modsounds folder inside of the game directory. Added textures and sounds to the nuke!">
|
||||
<option name="closed" value="true" />
|
||||
<created>1781853278308</created>
|
||||
<option name="number" value="00003" />
|
||||
<option name="presentableId" value="LOCAL-00003" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1781853278308</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="4" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
@@ -113,6 +120,7 @@
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="add a BlockRegister class to let rev not shoot himself trying to register blocks" />
|
||||
<MESSAGE value="added a nuke" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="added a nuke" />
|
||||
<MESSAGE value="added an improved sound loader that can load from the .modsounds folder inside of the game directory. Added textures and sounds to the nuke!" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="added an improved sound loader that can load from the .modsounds folder inside of the game directory. Added textures and sounds to the nuke!" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,5 +1,7 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import net.minecraft.src.mml.Entities.EntityNukePrimed;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
@@ -167,5 +169,7 @@ public class EntityList {
|
||||
addMapping(EntityIronGolem.class, "VillagerGolem", 99);
|
||||
addMapping(EntityVillager.class, "Villager", 120, 5651507, 12422002);
|
||||
addMapping(EntityEnderCrystal.class, "EnderCrystal", 200);
|
||||
|
||||
addMapping(EntityNukePrimed.class, "PrimedNuke", 100);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import net.minecraft.src.mml.Entities.EntityNukePrimed;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
@@ -78,6 +80,8 @@ public class EntityTracker {
|
||||
this.addEntityToTracker(var1, 256, Integer.MAX_VALUE, false);
|
||||
} else if(var1 instanceof EntityItemFrame) {
|
||||
this.addEntityToTracker(var1, 160, Integer.MAX_VALUE, false);
|
||||
} /*bmCustomEntity*/else if(var1 instanceof EntityNukePrimed) {
|
||||
this.addEntityToTracker(var1, 160, 3, true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import net.minecraft.src.mml.Entities.EntityNukePrimed;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
@@ -359,6 +361,8 @@ public class EntityTrackerEntry {
|
||||
return new Packet23VehicleSpawn(this.myEntity, 62);
|
||||
} else if(this.myEntity instanceof EntityTNTPrimed) {
|
||||
return new Packet23VehicleSpawn(this.myEntity, 50);
|
||||
} /*bmCustomEntity*/else if(this.myEntity instanceof EntityNukePrimed) {
|
||||
return new Packet23VehicleSpawn(this.myEntity, 300);
|
||||
} else if(this.myEntity instanceof EntityEnderCrystal) {
|
||||
return new Packet23VehicleSpawn(this.myEntity, 51);
|
||||
} else if(this.myEntity instanceof EntityFallingSand) {
|
||||
|
||||
@@ -16,7 +16,7 @@ public class Explosion {
|
||||
|
||||
public boolean isWasting = false;
|
||||
public boolean isWatering = false;
|
||||
|
||||
public boolean isCustomExplosion = false;
|
||||
|
||||
|
||||
|
||||
@@ -131,7 +131,12 @@ public class Explosion {
|
||||
}
|
||||
|
||||
public void doExplosionB(boolean var1) {
|
||||
this.worldObj.playSoundEffect(this.explosionX, this.explosionY, this.explosionZ, "random.explode", 4.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F);
|
||||
if (!this.isCustomExplosion) {
|
||||
this.worldObj.playSoundEffect(this.explosionX, this.explosionY, this.explosionZ, "random.explode", 4.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F);
|
||||
} else if (isCustomExplosion) {
|
||||
this.worldObj.playSoundEffect(this.explosionX, this.explosionY, this.explosionZ, "mod.boom", 4.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F);
|
||||
|
||||
}
|
||||
if(this.explosionSize >= 2.0F && this.isSmoking) {
|
||||
this.worldObj.spawnParticle("hugeexplosion", this.explosionX, this.explosionY, this.explosionZ, 1.0D, 0.0D, 0.0D);
|
||||
} else {
|
||||
|
||||
@@ -19,6 +19,7 @@ import java.util.Map;
|
||||
import java.util.Random;
|
||||
import javax.crypto.SecretKey;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.src.mml.Entities.EntityNukePrimed;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
public class NetClientHandler extends NetHandler {
|
||||
@@ -179,6 +180,8 @@ public class NetClientHandler extends NetHandler {
|
||||
} else if(var1.type == 70) {
|
||||
var8 = new EntityFallingSand(this.worldClient, var2, var4, var6, var1.throwerEntityId & '\uffff', var1.throwerEntityId >> 16);
|
||||
var1.throwerEntityId = 0;
|
||||
} /*bmCustomEntry*/else if(var1.type == 300) {
|
||||
var8 = new EntityNukePrimed(this.worldClient, var2, var4, var6, (EntityLiving)null);
|
||||
}
|
||||
|
||||
if(var8 != null) {
|
||||
|
||||
@@ -3,6 +3,9 @@ package net.minecraft.src;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.src.mml.Entities.EntityNukePrimed;
|
||||
import net.minecraft.src.mml.Render.RenderNukePrimed;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class RenderManager {
|
||||
@@ -80,6 +83,12 @@ public class RenderManager {
|
||||
this.entityRenderMap.put(EntityBoat.class, new RenderBoat());
|
||||
this.entityRenderMap.put(EntityFishHook.class, new RenderFish());
|
||||
this.entityRenderMap.put(EntityLightningBolt.class, new RenderLightningBolt());
|
||||
|
||||
|
||||
|
||||
this.entityRenderMap.put(EntityNukePrimed.class, new RenderNukePrimed());
|
||||
|
||||
|
||||
Iterator var1 = this.entityRenderMap.values().iterator();
|
||||
|
||||
while(var1.hasNext()) {
|
||||
|
||||
@@ -1677,6 +1677,7 @@ public abstract class World implements IBlockAccess {
|
||||
var11.isSmoking = var10;
|
||||
var11.isWasting = isWasting;
|
||||
var11.isWatering = isWatering;
|
||||
var11.isCustomExplosion = true;
|
||||
var11.doExplosionA();
|
||||
var11.doExplosionB(true);
|
||||
return var11;
|
||||
|
||||
@@ -16,7 +16,7 @@ public class BlockNuke extends Block {
|
||||
}
|
||||
|
||||
public Icon getIcon(int side, int var2) {
|
||||
return side == 0 ? this.TextureBottom : (side == 1 ? this.TextureTop : this.blockIcon);
|
||||
return side == 0 ? this.TextureBottom : (side == 1 ? this.TextureTop : (side == 2 ? this.TextureTop : this.blockIcon));
|
||||
}
|
||||
|
||||
public void onBlockAdded(World var1, int var2, int var3, int var4) {
|
||||
|
||||
@@ -60,13 +60,17 @@ public class EntityNukePrimed extends Entity {
|
||||
this.motionY *= -0.5D;
|
||||
}
|
||||
|
||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||
|
||||
// Spawn smoke fizz while ticking down on the client side
|
||||
if (this.worldObj.isRemote) {
|
||||
this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
|
||||
if (this.fuse-- <= 0) {
|
||||
this.setDead();
|
||||
|
||||
if (!this.worldObj.isRemote) {
|
||||
this.explode();
|
||||
} else {
|
||||
this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ , 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,9 +82,11 @@ public class EntityNukePrimed extends Entity {
|
||||
}
|
||||
|
||||
protected void writeEntityToNBT(NBTTagCompound var1) {
|
||||
var1.setByte("Fuse", (byte)this.fuse);
|
||||
}
|
||||
|
||||
protected void readEntityFromNBT(NBTTagCompound var1) {
|
||||
this.fuse = var1.getByte("Fuse");
|
||||
}
|
||||
|
||||
public float getShadowSize() {
|
||||
|
||||
59
src/net/minecraft/src/mml/Render/RenderNukePrimed.java
Normal file
59
src/net/minecraft/src/mml/Render/RenderNukePrimed.java
Normal file
@@ -0,0 +1,59 @@
|
||||
package net.minecraft.src.mml.Render;
|
||||
|
||||
import net.minecraft.src.Block;
|
||||
import net.minecraft.src.Entity;
|
||||
import net.minecraft.src.Render;
|
||||
import net.minecraft.src.RenderBlocks;
|
||||
import net.minecraft.src.mml.Entities.EntityNukePrimed;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class RenderNukePrimed extends Render {
|
||||
private RenderBlocks blockRenderer = new RenderBlocks();
|
||||
|
||||
public RenderNukePrimed() {
|
||||
this.shadowSize = 0.5F;
|
||||
}
|
||||
|
||||
public void renderPrimedNuke(EntityNukePrimed var1, double var2, double var4, double var6, float var8, float var9) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)var2, (float)var4, (float)var6);
|
||||
float var10;
|
||||
if((float)var1.fuse - var9 + 1.0F < 10.0F) {
|
||||
var10 = 1.0F - ((float)var1.fuse - var9 + 1.0F) / 10.0F;
|
||||
if(var10 < 0.0F) {
|
||||
var10 = 0.0F;
|
||||
}
|
||||
|
||||
if(var10 > 1.0F) {
|
||||
var10 = 1.0F;
|
||||
}
|
||||
|
||||
var10 *= var10;
|
||||
var10 *= var10;
|
||||
float var11 = 1.0F + var10 * 0.3F;
|
||||
GL11.glScalef(var11, var11, var11);
|
||||
}
|
||||
|
||||
var10 = (1.0F - ((float)var1.fuse - var9 + 1.0F) / 100.0F) * 0.8F;
|
||||
this.loadTexture("/terrain.png");
|
||||
this.blockRenderer.renderBlockAsItem(Block.nuke, 0, var1.getBrightness(var9));
|
||||
if(var1.fuse / 5 % 2 == 0) {
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, var10);
|
||||
this.blockRenderer.renderBlockAsItem(Block.tnt, 0, 1.0F);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
|
||||
this.renderPrimedNuke((EntityNukePrimed)var1, var2, var4, var6, var8, var9);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user