lanterns, heating oven connection fix

This commit is contained in:
Bob 2023-08-12 22:46:59 +02:00
parent 1a3596f33d
commit 27648ca7a6
18 changed files with 385 additions and 5 deletions

View File

@ -336,6 +336,9 @@ public class ModBlocks {
public static Block lamp_uv_on;
public static Block lamp_demon;
public static Block lantern;
public static Block lantern_behemoth;
public static Block reinforced_stone;
public static Block concrete_smooth;
public static Block concrete_colored;
@ -1546,6 +1549,8 @@ public class ModBlocks {
lamp_uv_off = new UVLamp(false).setBlockName("lamp_uv_off").setCreativeTab(MainRegistry.blockTab);
lamp_uv_on = new UVLamp(true).setBlockName("lamp_uv_on").setCreativeTab(null);
lamp_demon = new DemonLamp().setBlockName("lamp_demon").setStepSound(Block.soundTypeMetal).setCreativeTab(MainRegistry.blockTab).setLightLevel(1F).setHardness(3.0F).setBlockTextureName(RefStrings.MODID + ":lamp_demon");
lantern = new BlockLantern().setBlockName("lantern").setStepSound(Block.soundTypeMetal).setCreativeTab(MainRegistry.blockTab).setLightLevel(1F).setHardness(3.0F).setBlockTextureName(RefStrings.MODID + ":lantern");
lantern_behemoth = new BlockLanternBehemoth().setBlockName("lantern_behemoth").setStepSound(Block.soundTypeMetal).setCreativeTab(MainRegistry.blockTab).setHardness(3.0F).setBlockTextureName(RefStrings.MODID + ":lantern");
reinforced_stone = new BlockGeneric(Material.rock).setBlockName("reinforced_stone").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(3000.0F).setBlockTextureName(RefStrings.MODID + ":reinforced_stone");
concrete_smooth = new BlockRadResistant(Material.rock).setBlockName("concrete_smooth").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(4000.0F).setBlockTextureName(RefStrings.MODID + ":concrete");
@ -2697,6 +2702,8 @@ public class ModBlocks {
GameRegistry.registerBlock(lamp_uv_off, lamp_uv_off.getUnlocalizedName());
GameRegistry.registerBlock(lamp_uv_on, lamp_uv_on.getUnlocalizedName());
GameRegistry.registerBlock(lamp_demon, lamp_demon.getUnlocalizedName());
GameRegistry.registerBlock(lantern, lantern.getUnlocalizedName());
GameRegistry.registerBlock(lantern_behemoth, lantern_behemoth.getUnlocalizedName());
//Reinforced Blocks
GameRegistry.registerBlock(asphalt, ItemBlockBlastInfo.class, asphalt.getUnlocalizedName());

View File

@ -0,0 +1,31 @@
package com.hbm.blocks.generic;
import com.hbm.blocks.BlockDummyable;
import com.hbm.tileentity.deco.TileEntityLantern;
import net.minecraft.block.material.Material;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class BlockLantern extends BlockDummyable {
public BlockLantern() {
super(Material.iron);
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
if(meta >= 12) return new TileEntityLantern();
return null;
}
@Override
public int[] getDimensions() {
return new int[] {4, 0, 0, 0, 0, 0};
}
@Override
public int getOffset() {
return 0;
}
}

View File

@ -0,0 +1,59 @@
package com.hbm.blocks.generic;
import java.util.Random;
import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ILookOverlay;
import com.hbm.tileentity.IRepairable;
import com.hbm.tileentity.deco.TileEntityLanternBehemoth;
import api.hbm.block.IToolable;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
public class BlockLanternBehemoth extends BlockDummyable implements IToolable, ILookOverlay {
public BlockLanternBehemoth() {
super(Material.iron);
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
if(meta >= 12) return new TileEntityLanternBehemoth();
return null;
}
@Override
public Item getItemDropped(int i, Random rand, int j) {
return null;
}
@Override
public int[] getDimensions() {
return new int[] {4, 0, 0, 0, 0, 0};
}
@Override
public int getOffset() {
return 0;
}
@Override
public boolean onScrew(World world, EntityPlayer player, int x, int y, int z, int side, float fX, float fY, float fZ, ToolType tool) {
if(tool != ToolType.TORCH) return false;
return IRepairable.tryRepairMultiblock(world, x, y, z, this, player);
}
@Override
@SideOnly(Side.CLIENT)
public void printHook(Pre event, World world, int x, int y, int z) {
IRepairable.addGenericOverlay(event, world, x, y, z, this);
}
}

View File

@ -23,7 +23,7 @@ public class HeaterOven extends BlockDummyable implements ITooltipProvider {
public TileEntity createNewTileEntity(World world, int meta) {
if(meta >= 12) return new TileEntityHeaterOven();
return new TileEntityProxyCombo(true, false, false);
return new TileEntityProxyCombo().inventory().fluid();
}
@Override

View File

@ -282,7 +282,7 @@ public class GunGrenadeFactory {
public static BulletConfiguration getGrenadeLeadbursterConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardRocketConfig();
BulletConfiguration bullet = BulletConfigFactory.standardGrenadeConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_grenade.stackFromEnum(AmmoGrenade.LEADBURSTER));
bullet.spread = 0.0F;

View File

@ -62,7 +62,7 @@ public class ItemKitNBT extends Item {
list.add("Contains:");
for(ItemStack item : stacks) {
list.add("-" + item.getDisplayName());
list.add("-" + item.getDisplayName() + (item.stackSize > 1 ? (" x" + item.stackSize) : ""));
}
}
}

View File

@ -169,6 +169,8 @@ public class ClientProxy extends ServerProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBobble.class, new RenderBobble());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySnowglobe.class, new RenderSnowglobe());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityEmitter.class, new RenderEmitter());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityLantern.class, new RenderLantern());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityLanternBehemoth.class, new RenderLanternBehemoth());
//bombs
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityNukeGadget.class, new RenderNukeGadget());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityNukeBoy.class, new RenderNukeBoy());

View File

@ -306,6 +306,9 @@ public class ResourceManager {
public static Animation transition_seal_anim;
public static final WavefrontObjDisplayList fire_door = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/doors/fire_door.obj")).asDisplayList();
//Lantern
public static final IModelCustom lantern = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/trinkets/lantern.obj"));
//Tesla Coil
public static final IModelCustom tesla = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/tesla.obj"));
public static final IModelCustom teslacrab = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/mobs/teslacrab.obj"));
@ -664,6 +667,10 @@ public class ResourceManager {
public static final ResourceLocation transition_seal_tex = new ResourceLocation(RefStrings.MODID, "textures/models/doors/transition_seal.png");
public static final ResourceLocation fire_door_tex = new ResourceLocation(RefStrings.MODID, "textures/models/doors/fire_door.png");
//Lantern
public static final ResourceLocation lantern_tex = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/lantern.png");
public static final ResourceLocation lantern_rusty_tex = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/lantern_rusty.png");
//Tesla Coil
public static final ResourceLocation tesla_tex = new ResourceLocation(RefStrings.MODID, "textures/models/tesla.png");
public static final ResourceLocation teslacrab_tex = new ResourceLocation(RefStrings.MODID, "textures/entity/teslacrab.png");

View File

@ -0,0 +1,40 @@
package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
public class RenderLantern extends TileEntitySpecialRenderer {
@Override
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float interp) {
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
bindTexture(ResourceManager.lantern_tex);
ResourceManager.lantern.renderPart("Lantern");
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
GL11.glDisable(GL11.GL_LIGHTING);
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240F, 240F);
float mult = (float) (Math.sin(System.currentTimeMillis() / 200D) / 2 + 0.5) * 0.1F + 0.9F;
GL11.glColor3f(1F * mult, 1F * mult, 0.7F * mult);
ResourceManager.lantern.renderPart("Light");
GL11.glColor3f(1F, 1F, 1F);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopAttrib();
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glPopMatrix();
GL11.glPopMatrix();
}
}

View File

@ -0,0 +1,53 @@
package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import com.hbm.tileentity.deco.TileEntityLanternBehemoth;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
public class RenderLanternBehemoth extends TileEntitySpecialRenderer {
@Override
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float interp) {
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
TileEntityLanternBehemoth lantern = (TileEntityLanternBehemoth) tile;
if(lantern.isBroken) {
GL11.glRotated(5, 1, 0, 0);
GL11.glRotated(10, 0, 0, 1);
}
bindTexture(ResourceManager.lantern_rusty_tex);
ResourceManager.lantern.renderPart("Lantern");
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
GL11.glDisable(GL11.GL_LIGHTING);
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240F, 240F);
if(lantern.isBroken) {
float mult = (float) (Math.sin(System.currentTimeMillis() / 200D) / 2 + 0.5);
GL11.glColor3f(1F * mult, 0, 0);
} else {
float mult = (float) (Math.sin(System.currentTimeMillis() / 200D) / 2 + 0.5) * 0.5F + 0.5F;
GL11.glColor3f(0, 1F * mult, 0);
}
ResourceManager.lantern.renderPart("Light");
GL11.glColor3f(1F, 1F, 1F);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopAttrib();
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glPopMatrix();
GL11.glPopMatrix();
}
}

View File

@ -182,6 +182,8 @@ public class TileMappings {
put(TileEntitySILEX.class, "tileentity_silex");
put(TileEntityFEL.class, "tileentity_fel");
put(TileEntityDemonLamp.class, "tileentity_demonlamp");
put(TileEntityLantern.class, "tileentity_lantern_ordinary");
put(TileEntityLanternBehemoth.class, "tileentity_lantern_behemoth");
put(TileEntityStorageDrum.class, "tileentity_waste_storage_drum");
put(TileEntityDeaerator.class, "tileentity_deaerator");
put(TileEntityCableBaseNT.class, "tileentity_ohgod"); // what?

View File

@ -0,0 +1,34 @@
package com.hbm.tileentity.deco;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
public class TileEntityLantern extends TileEntity {
AxisAlignedBB bb = null;
@Override
public AxisAlignedBB getRenderBoundingBox() {
if(bb == null) {
bb = AxisAlignedBB.getBoundingBox(
xCoord,
yCoord,
zCoord,
xCoord + 1,
yCoord + 6,
zCoord + 1
);
}
return bb;
}
@Override
@SideOnly(Side.CLIENT)
public double getMaxRenderDistanceSquared() {
return 65536.0D;
}
}

View File

@ -0,0 +1,138 @@
package com.hbm.tileentity.deco;
import java.util.ArrayList;
import java.util.List;
import com.hbm.entity.missile.EntityBobmazon;
import com.hbm.inventory.OreDictManager;
import com.hbm.inventory.RecipesCommon.AStack;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.inventory.RecipesCommon.OreDictStack;
import com.hbm.items.ModItems;
import com.hbm.items.special.ItemKitCustom;
import com.hbm.tileentity.INBTPacketReceiver;
import com.hbm.tileentity.IRepairable;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
public class TileEntityLanternBehemoth extends TileEntity implements INBTPacketReceiver, IRepairable {
public boolean isBroken = false;
public int comTimer = -1;
@Override
public void updateEntity() {
if(!worldObj.isRemote) {
if(comTimer == 360) worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:block.hornNearSingle", 10F, 1F);
if(comTimer == 280) worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:block.hornFarSingle", 10000F, 1F);
if(comTimer == 220) worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:block.hornNearDual", 10F, 1F);
if(comTimer == 100) worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:block.hornFarDual", 10000F, 1F);
if(comTimer == 0) {
EntityBobmazon shuttle = new EntityBobmazon(worldObj);
shuttle.posX = xCoord + 0.5 + worldObj.rand.nextGaussian() * 10;
shuttle.posY = 300;
shuttle.posZ = zCoord + 0.5 + worldObj.rand.nextGaussian() * 10;
ItemStack payload = ItemKitCustom.create("Supplies", null, 0xffffff, 0x008000,
new ItemStack(ModItems.circuit_aluminium, 4 + worldObj.rand.nextInt(4)),
new ItemStack(ModItems.circuit_copper, 4 + worldObj.rand.nextInt(2)),
new ItemStack(ModItems.circuit_red_copper, 2 + worldObj.rand.nextInt(3)),
new ItemStack(ModItems.circuit_gold, 1 + worldObj.rand.nextInt(2)),
new ItemStack(Items.diamond, 6 + worldObj.rand.nextInt(6)),
new ItemStack(Blocks.red_flower)/*,
ItemBookLore.createBook("beacon", 12, 0x808080, 0xDFBE26)*/);
shuttle.payload = payload;
worldObj.spawnEntityInWorld(shuttle);
}
if(comTimer >= 0) {
comTimer--;
}
NBTTagCompound data = new NBTTagCompound();
data.setBoolean("isBroken", isBroken);
INBTPacketReceiver.networkPack(this, data, 150);
}
}
@Override
public void networkUnpack(NBTTagCompound nbt) {
this.isBroken = nbt.getBoolean("isBroken");
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
isBroken = nbt.getBoolean("isBroken");
comTimer = nbt.getInteger("comTimer");
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setBoolean("isBroken", isBroken);
nbt.setInteger("comTimer", comTimer);
}
@Override
public boolean isDamaged() {
return isBroken;
}
List<AStack> repair = new ArrayList();
@Override
public List<AStack> getRepairMaterials() {
if(!repair.isEmpty())
return repair;
repair.add(new OreDictStack(OreDictManager.STEEL.plate(), 2));
repair.add(new ComparableStack(ModItems.circuit_copper, 1));
return repair;
}
@Override
public void repair() {
this.isBroken = false;
this.comTimer = 400;
this.markDirty();
}
@Override public void tryExtinguish(World world, int x, int y, int z, EnumExtinguishType type) { }
AxisAlignedBB bb = null;
@Override
public AxisAlignedBB getRenderBoundingBox() {
if(bb == null) {
bb = AxisAlignedBB.getBoundingBox(
xCoord,
yCoord,
zCoord,
xCoord + 1,
yCoord + 6,
zCoord + 1
);
}
return bb;
}
@Override
@SideOnly(Side.CLIENT)
public double getMaxRenderDistanceSquared() {
return 65536.0D;
}
}

View File

@ -1010,6 +1010,7 @@ item.ammo_grenade_finned.name=40mm Granate (Geflügelt)
item.ammo_grenade_he.name=40mm Granate (HE)
item.ammo_grenade_incendiary.name=40mm Granate (Brand)
item.ammo_grenade_kampf.name=40mm Rakete
item.ammo_grenade_leadburster.name=40mm Leadburster
item.ammo_grenade_nuclear.name=40mm Granate (Привет)
item.ammo_grenade_phosphorus.name=40mm Granate (WP)
item.ammo_grenade_sleek.name=40mm Granate (IF-F&E)

View File

@ -442,8 +442,8 @@ book_lore.beacon.page.5=light up red, otherwise it will light up green. Note tha
book_lore.beacon.page.6=Chapter 3: Fog Horn $ The fog horn is the primary communication device of the beacon. The beacon is designed for peer-to-peer (P2P) communication as well as for message broadcasting.
book_lore.beacon.page.7=Chapter 4: Peer-to-Peer $ For details on communication, refer to the communications handbook. A short rundown of establishing a P2P connection follows: First, the beacon has to give the "START CONNECTION" signal,
book_lore.beacon.page.8=being a single long tone. All available peers should respond with a single long tone as well (order specified by proximity, as well as the communication guidelines outlined in the handbook, section "Responding to a Connection")
book_lore.beacon.page.9=Once the desired peer has responded, give the "ACCEPT CONNECTION" signal, being two long tones, the peer will then also respond with two long tones. All communication afterwards has to happen using pre-negotiated signals,
book_lore.beacon.page.10=most commonly using the FAR-5M standard. Communication will end immediately if no standard has been negotiated, serving as a "ping". Should communication continue, the connection can be ended using another long single tone "END CONNECTION".
book_lore.beacon.page.9=Once the desired peer has responded, give the "ACCEPT CONNECTION" signal, being two long tones, the peer will then also respond with two long tones. All communication afterwards has to happen using pre-negotiated signals, most commonly
book_lore.beacon.page.10=using the FAR-5M standard. Communication will end immediately if no standard has been negotiated, serving as a "ping". Should communication continue, the connection can be ended using another long single tone "END CONNECTION".
book_lore.beacon.page.11=Chapter 5: Warranty $ [ page intentionally left blank ]
cannery.f1=[ Press F1 for help ]
@ -914,6 +914,7 @@ desc.item.ammo.neu_fun=* Fun for the whole family!
desc.item.ammo.neu_heavy_metal=* Heavy Metal
desc.item.ammo.neu_homing=* Homing
desc.item.ammo.neu_jolt=* Jolt
desc.item.ammo.neu_leadburster=* Attaches to surfaces and sprays bullets
desc.item.ammo.neu_less_bouncy=* Less bouncy
desc.item.ammo.neu_maskman_flechette=* Fires a tracer which summons a storm of DU-flechettes
desc.item.ammo.neu_maskman_meteorite=* Fires a high-damage round that summons a small meteorite
@ -1659,6 +1660,7 @@ item.ammo_grenade_finned.name=40mm Grenade (Finned)
item.ammo_grenade_he.name=40mm Grenade (HE)
item.ammo_grenade_incendiary.name=40mm Grenade (Incendiary)
item.ammo_grenade_kampf.name=40mm Rocket
item.ammo_grenade_leadburster.name=40mm Leadburster
item.ammo_grenade_nuclear.name=40mm Grenade (Привет)
item.ammo_grenade_phosphorus.name=40mm Grenade (WP)
item.ammo_grenade_sleek.name=40mm Grenade (IF-R&D)

View File

@ -54,6 +54,10 @@
"block.damage": {"category": "block", "sounds": ["block/dam1", "block/dam2", "block/dam3", "block/dam4"]},
"block.electricHum": {"category": "block", "sounds": [{"name": "block/electricHum", "stream": false}]},
"block.boiler": {"category": "block", "sounds": [{"name": "block/boiler", "stream": false}]},
"block.hornNearSingle": {"category": "block", "sounds": [{"name": "block/hornNearSingle", "stream": false}]},
"block.hornNearDual": {"category": "block", "sounds": [{"name": "block/hornNearDual", "stream": false}]},
"block.hornFarSingle": {"category": "block", "sounds": [{"name": "block/hornFarSingle", "stream": false}]},
"block.hornFarDual": {"category": "block", "sounds": [{"name": "block/hornFarDual", "stream": false}]},
"door.TransitionSealOpen": {"category": "block", "sounds": [{"name": "block/door/transition_seal_open", "stream": true}]},
"door.wghStart": {"category": "block", "sounds": [{"name": "block/door/wgh_start", "stream": true}]},

Binary file not shown.

Before

Width:  |  Height:  |  Size: 288 B

After

Width:  |  Height:  |  Size: 959 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB