diff --git a/src/main/java/micdoodle8/mods/galacticraft/api/prefab/entity/EntitySpaceshipBase.java b/src/main/java/micdoodle8/mods/galacticraft/api/prefab/entity/EntitySpaceshipBase.java index c888bd3baa..55b20d8a29 100644 --- a/src/main/java/micdoodle8/mods/galacticraft/api/prefab/entity/EntitySpaceshipBase.java +++ b/src/main/java/micdoodle8/mods/galacticraft/api/prefab/entity/EntitySpaceshipBase.java @@ -235,7 +235,7 @@ public void onUpdate() this.riddenByEntity.fallDistance = 0.0F; } - if (this.posY > (this.worldObj.provider instanceof IExitHeight ? ((IExitHeight) this.worldObj.provider).getYCoordinateToTeleport() : 1200)) + if (this.posY > (this.worldObj.provider instanceof IExitHeight ? ((IExitHeight) this.worldObj.provider).getYCoordinateToTeleport() : 1200) && this.launchPhase != EnumLaunchPhase.LANDING.ordinal()) { this.onReachAtmosphere(); // if (this.worldObj.isRemote) @@ -259,7 +259,7 @@ public void onUpdate() this.setDead(); } else - if (this.posY > (this.worldObj.provider instanceof IExitHeight ? ((IExitHeight) this.worldObj.provider).getYCoordinateToTeleport() : 1200) + 100) + if (this.posY > (this.worldObj.provider instanceof IExitHeight ? ((IExitHeight) this.worldObj.provider).getYCoordinateToTeleport() : 1200) + (this.launchPhase == EnumLaunchPhase.LANDING.ordinal() ? 355 : 100)) { if (this.riddenByEntity instanceof EntityPlayerMP) { diff --git a/src/main/java/micdoodle8/mods/galacticraft/core/GCBlocks.java b/src/main/java/micdoodle8/mods/galacticraft/core/GCBlocks.java index e26133a778..b5451f7dc1 100644 --- a/src/main/java/micdoodle8/mods/galacticraft/core/GCBlocks.java +++ b/src/main/java/micdoodle8/mods/galacticraft/core/GCBlocks.java @@ -97,6 +97,7 @@ public class GCBlocks public static Block concealedRepeater_Unpowered; public static Block concealedDetector; public static Block platform; + public static Block emergencyBox; public static final Material machine = new Material(MapColor.ironColor); @@ -172,6 +173,7 @@ public static void initBlocks() GCBlocks.concealedRepeater_Unpowered = new BlockConcealedRepeater("concealed_repeater", false); GCBlocks.concealedDetector = new BlockConcealedDetector("concealed_detector"); GCBlocks.platform = new BlockPlatform("platform"); + GCBlocks.emergencyBox = new BlockEmergencyBox("emergency_box"); // Hide certain items from NEI GCBlocks.hiddenBlocks.add(GCBlocks.airLockSeal); @@ -430,6 +432,7 @@ public static void registerBlocks() registerBlock(GCBlocks.concealedRepeater_Unpowered, ItemBlockGC.class); registerBlock(GCBlocks.concealedDetector, ItemBlockCreativeGC.class); registerBlock(GCBlocks.platform, ItemBlockDesc.class); + registerBlock(GCBlocks.emergencyBox, ItemBlockEmergencyBox.class); // GCCoreUtil.sortBlock(GCBlocks.aluminumWire, 0, new StackSorted(GCBlocks.landingPad, 1)); // GCCoreUtil.sortBlock(GCBlocks.aluminumWire, 1, new StackSorted(GCBlocks.aluminumWire, 0)); // GCCoreUtil.sortBlock(GCBlocks.oxygenPipe, 0, new StackSorted(GCBlocks.aluminumWire, 1)); diff --git a/src/main/java/micdoodle8/mods/galacticraft/core/GalacticraftCore.java b/src/main/java/micdoodle8/mods/galacticraft/core/GalacticraftCore.java index 2f22d02d43..ef2d961e10 100644 --- a/src/main/java/micdoodle8/mods/galacticraft/core/GalacticraftCore.java +++ b/src/main/java/micdoodle8/mods/galacticraft/core/GalacticraftCore.java @@ -574,6 +574,7 @@ private void registerTileEntities() GameRegistry.registerTileEntity(TileEntityFluidTank.class, "GC Fluid Tank"); GameRegistry.registerTileEntity(TileEntityPlayerDetector.class, "GC Player Detector"); GameRegistry.registerTileEntity(TileEntityPlatform.class, "GC Platform"); + GameRegistry.registerTileEntity(TileEntityEmergencyBox.class, "GC Emergency Post"); GameRegistry.registerTileEntity(TileEntityNull.class, "GC Null Tile"); } diff --git a/src/main/java/micdoodle8/mods/galacticraft/core/blocks/BlockAdvanced.java b/src/main/java/micdoodle8/mods/galacticraft/core/blocks/BlockAdvanced.java index 3cf097073f..39aac87707 100644 --- a/src/main/java/micdoodle8/mods/galacticraft/core/blocks/BlockAdvanced.java +++ b/src/main/java/micdoodle8/mods/galacticraft/core/blocks/BlockAdvanced.java @@ -10,6 +10,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import java.lang.reflect.Method; @@ -229,4 +230,9 @@ else if (metaDir == 5) world.setBlockState(pos, this.getStateFromMeta(metaDir), 3); } + @Override + public boolean isSideSolid(IBlockAccess world, BlockPos pos, EnumFacing side) + { + return this.isNormalCube(world, pos); + } } diff --git a/src/main/java/micdoodle8/mods/galacticraft/core/blocks/BlockEmergencyBox.java b/src/main/java/micdoodle8/mods/galacticraft/core/blocks/BlockEmergencyBox.java new file mode 100644 index 0000000000..5ed05cf80b --- /dev/null +++ b/src/main/java/micdoodle8/mods/galacticraft/core/blocks/BlockEmergencyBox.java @@ -0,0 +1,158 @@ +package micdoodle8.mods.galacticraft.core.blocks; + +import java.util.List; + +import micdoodle8.mods.galacticraft.api.block.IPartialSealableBlock; +import micdoodle8.mods.galacticraft.core.GalacticraftCore; +import micdoodle8.mods.galacticraft.core.items.IShiftDescription; +import micdoodle8.mods.galacticraft.core.tile.TileEntityEmergencyBox; +import micdoodle8.mods.galacticraft.core.util.EnumSortCategoryBlock; +import micdoodle8.mods.galacticraft.core.util.GCCoreUtil; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +public class BlockEmergencyBox extends BlockAdvancedTile implements IShiftDescription, ISortableBlock, IPartialSealableBlock +{ + public static final PropertyBool KIT = PropertyBool.create("kit"); + + public BlockEmergencyBox(String assetName) + { + super(Material.iron); + this.setHardness(4.0F); + this.setResistance(70F); + this.setStepSound(Block.soundTypeMetal); + this.setLightLevel(1.0F); + this.setUnlocalizedName(assetName); + this.setDefaultState(this.blockState.getBaseState().withProperty(KIT, false)); + } + + @Override + protected BlockState createBlockState() + { + return new BlockState(this, KIT); + } + + @Override + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(KIT, meta % 2 == 1); + } + + @Override + public int getMetaFromState(IBlockState state) + { + return (state.getValue(KIT) ? 1 : 0); + } + + @SideOnly(Side.CLIENT) + @Override + public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) + { + par3List.add(new ItemStack(par1, 1, 0)); + par3List.add(new ItemStack(par1, 1, 1)); + } + + @Override + public int damageDropped(IBlockState state) + { + return getMetaFromState(state); + } + + @Override + public ItemStack getPickBlock(MovingObjectPosition target, World world, BlockPos pos, EntityPlayer player) + { + return new ItemStack(this, 1, this.getDamageValue(world, pos)); + } + + @Override + @SideOnly(Side.CLIENT) + public EnumWorldBlockLayer getBlockLayer() + { + return EnumWorldBlockLayer.CUTOUT; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public boolean isFullCube() + { + return false; + } + + @Override + public TileEntity createNewTileEntity(World world, int meta) + { + return new TileEntityEmergencyBox(); + } + + @Override + public CreativeTabs getCreativeTabToDisplayOn() + { + return GalacticraftCore.galacticraftBlocksTab; + } + + @Override + public boolean onMachineActivated(World world, BlockPos pos, IBlockState state, EntityPlayer entityPlayer, EnumFacing side, float hitX, float hitY, float hitZ) + { + TileEntity tile = world.getTileEntity(pos); + if (tile instanceof TileEntityEmergencyBox) + { + if (!world.isRemote) + { + ((TileEntityEmergencyBox)tile).click(entityPlayer, side, state.getValue(KIT)); + } + return true; + } + return false; + } + + @Override + public String getShiftDescription(int meta) + { + return GCCoreUtil.translate(this.getUnlocalizedName() + ".description"); + } + + @Override + public boolean showDescription(int meta) + { + return true; + } + + @Override + public EnumSortCategoryBlock getCategory(int meta) + { + return EnumSortCategoryBlock.GENERAL; + } + + @Override + public boolean isSealed(World world, BlockPos pos, EnumFacing direction) + { + return direction.ordinal() < 2; + } + + @Override + public boolean isSideSolid(IBlockAccess world, BlockPos pos, EnumFacing direction) + { + return direction.ordinal() < 2; + } +} diff --git a/src/main/java/micdoodle8/mods/galacticraft/core/client/render/tile/TileEntityEmergencyBoxRenderer.java b/src/main/java/micdoodle8/mods/galacticraft/core/client/render/tile/TileEntityEmergencyBoxRenderer.java new file mode 100644 index 0000000000..af5860f86e --- /dev/null +++ b/src/main/java/micdoodle8/mods/galacticraft/core/client/render/tile/TileEntityEmergencyBoxRenderer.java @@ -0,0 +1,206 @@ +package micdoodle8.mods.galacticraft.core.client.render.tile; + +import micdoodle8.mods.galacticraft.core.Constants; +import micdoodle8.mods.galacticraft.core.blocks.BlockEmergencyBox; +import micdoodle8.mods.galacticraft.core.tile.TileEntityEmergencyBox; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.*; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.relauncher.SideOnly; +import net.minecraftforge.fml.relauncher.Side; + +@SideOnly(Side.CLIENT) +public class TileEntityEmergencyBoxRenderer extends TileEntitySpecialRenderer +{ + private static final float MASKSCALE = 3F; + + public class Flap extends ModelBase + { + ModelRenderer model; + protected float angle; + + public Flap() + { + this.angle = 0.0F; + this.textureWidth = 32; + this.textureHeight = 32; + this.model = new ModelRenderer(this, 0, 0); + this.model.addBox(-6F, -6F, 0F, 12, 6, 1); + this.model.setRotationPoint(0F, 6F, -7F); + this.model.setTextureSize(this.textureWidth, this.textureHeight); + this.model.mirror = true; + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void render() + { + this.setRotation(this.model, angle/Constants.RADIANS_TO_DEGREES, 0F, 0F); + this.model.render(1F/16F); + } + } + + public class Plinth extends ModelBase + { + ModelRenderer model; + + public Plinth() + { + this.textureWidth = 16; + this.textureHeight = 16; + this.model = new ModelRenderer(this, 0, 0); + this.model.addBox(-6F, -7F, -6F, 12, 1, 12); + this.model.setRotationPoint(0F, 0F, 0F); + this.model.setTextureSize(this.textureWidth, this.textureHeight); + this.model.mirror = true; + } + + public void render(float height) + { + this.model.setRotationPoint(0F, height, 0F); + this.model.render(1F/16F); + } + } + + public class Mask extends ModelBase + { + ModelRenderer model; + + public Mask() + { + this.textureWidth = 128; + this.textureHeight = 64; + this.model = new ModelRenderer(this, 0, 0); + this.model.addBox(-8.0F, -4F, -8.0F, 16, 16, 16, 1.0F); + this.model.setRotationPoint(0F, 0F, 0F); + this.model.setTextureSize(this.textureWidth, this.textureHeight); + this.model.mirror = true; + } + + public void render(float height) + { + this.model.setRotationPoint(0F, height * MASKSCALE, 0F); + this.model.render(1F/16F/MASKSCALE); + } + } + + public class Tank extends ModelBase + { + ModelRenderer model; + + public Tank() + { + this.textureWidth = 128; + this.textureHeight = 64; + this.model = new ModelRenderer(this, 0, 0); + this.model.setTextureOffset(4, 0); // Green tank + this.model.addBox(-1.5F, 0F, -1.5F, 3, 7, 3, 1.0F); + this.model.setRotationPoint(0F, 0F, 0F); + this.model.setTextureSize(this.textureWidth, this.textureHeight); + this.model.mirror = true; + } + + public void render(float height) + { + this.model.setRotationPoint(0F, height * MASKSCALE, 0F); + this.model.render(1F/16F/MASKSCALE); + } + } + + public class Pack extends ModelBase + { + ModelRenderer model; + + public Pack() + { + this.textureWidth = 256; + this.textureHeight = 256; + this.model = new ModelRenderer(this, 0, 0); + this.model.setTextureOffset(50, 50); + this.model.addBox(-6F, -11F, -10F, 12, 1, 20, 1.0F); + this.model.setRotationPoint(0F, 0F, 0F); + this.model.setTextureSize(this.textureWidth, this.textureHeight); + this.model.mirror = true; + } + + public void render(float height) + { + this.model.setRotationPoint(0F, height * 2F, 0F); + this.model.render(1F/32F); + } + } + + private static final ResourceLocation boxTexture = new ResourceLocation(Constants.ASSET_PREFIX, "textures/blocks/emergency_box.png"); + private static final ResourceLocation flapTexture = new ResourceLocation(Constants.ASSET_PREFIX, "textures/blocks/emergency_box_flap.png"); + private static final ResourceLocation packTexture = new ResourceLocation(Constants.ASSET_PREFIX, "textures/model/parachute/red.png"); + private static final ResourceLocation oxygenMaskTexture = new ResourceLocation(Constants.ASSET_PREFIX, "textures/model/oxygen.png"); + private static final ResourceLocation oxygenTankTexture = new ResourceLocation(Constants.ASSET_PREFIX, "textures/model/player.png"); + private Flap flapA = new Flap(); + private Flap flapB = new Flap(); + private Flap flapC = new Flap(); + private Flap flapD = new Flap(); + private Plinth plat = new Plinth(); + private Mask mask = new Mask(); + private Tank tank = new Tank(); + private Pack pack = new Pack(); + + @Override + public void renderTileEntityAt(TileEntityEmergencyBox tileEntity, double d, double d1, double d2, float f, int par9) + { + IBlockState b = tileEntity.getWorld().getBlockState(tileEntity.getPos()); + if (!(b.getBlock() instanceof BlockEmergencyBox)) return; + GlStateManager.pushMatrix(); + GlStateManager.translate((float) d + 0.5F, (float) d1 + 0.5F, (float) d2 + 0.5F); + + flapA.angle = tileEntity.getAngleA(f); + flapB.angle = tileEntity.getAngleB(f); + flapC.angle = tileEntity.getAngleC(f); + flapD.angle = tileEntity.getAngleD(f); + float height = Math.max(Math.max(flapA.angle, flapB.angle), Math.max(flapC.angle, flapD.angle)) / 90F; + + if (height > 0F && b.getValue(BlockEmergencyBox.KIT)) + { + GlStateManager.pushMatrix(); + this.bindTexture(packTexture); + this.pack.render(height); + GlStateManager.rotate(180F, 1F, 0F, 0F); + this.bindTexture(oxygenMaskTexture); + GlStateManager.translate(0.0F, 0.0F, -0.07F); + this.mask.render(-height); + this.bindTexture(oxygenTankTexture); + GlStateManager.translate(0.1F, 0.11F, 0.3F); + this.tank.render(-height); + GlStateManager.translate(-0.2F, 0F, 0F); + this.tank.render(-height); + GlStateManager.popMatrix(); + } + + this.bindTexture(boxTexture); + this.plat.render(height); + this.bindTexture(flapTexture); + this.flapA.render(); + GlStateManager.rotate(90F, 0, 1F, 0F); + this.flapB.render(); + GlStateManager.rotate(90F, 0, 1F, 0F); + this.flapC.render(); + GlStateManager.rotate(90F, 0, 1F, 0F); + this.flapD.render(); + GlStateManager.rotate(180F, 1F, 0F, 0F); + this.flapB.render(); + GlStateManager.rotate(90F, 0, 1F, 0F); + this.flapA.render(); + GlStateManager.rotate(90F, 0, 1F, 0F); + this.flapD.render(); + GlStateManager.rotate(90F, 0, 1F, 0F); + this.flapC.render(); + GlStateManager.popMatrix(); + } +} diff --git a/src/main/java/micdoodle8/mods/galacticraft/core/client/render/tile/TileEntityFluidTankRenderer.java b/src/main/java/micdoodle8/mods/galacticraft/core/client/render/tile/TileEntityFluidTankRenderer.java index 5626caed06..a560373a69 100644 --- a/src/main/java/micdoodle8/mods/galacticraft/core/client/render/tile/TileEntityFluidTankRenderer.java +++ b/src/main/java/micdoodle8/mods/galacticraft/core/client/render/tile/TileEntityFluidTankRenderer.java @@ -67,7 +67,14 @@ public void renderTileEntityAt(TileEntityFluidTank tank, double x, double y, dou else { level = tank.fluidTank.getFluidAmount() / 16400.0F; - levelInv = 0.988F - level; //1.2% inset from each end of the tank, to avoid z-fighting with blocks above/below + if (level <= 0.012F) + { + levelInv = 1.0F; //Empty tanks render empty - see #3222 + } + else + { + levelInv = 0.988F - level; //1.2% inset from each end of the tank, to avoid z-fighting with blocks above/below + } } GL11.glColor4f(1.0F, 1.0F, 1.0F, opacity); diff --git a/src/main/java/micdoodle8/mods/galacticraft/core/entities/EntityEvolvedZombie.java b/src/main/java/micdoodle8/mods/galacticraft/core/entities/EntityEvolvedZombie.java index 0f8477f1af..dd46d694f8 100644 --- a/src/main/java/micdoodle8/mods/galacticraft/core/entities/EntityEvolvedZombie.java +++ b/src/main/java/micdoodle8/mods/galacticraft/core/entities/EntityEvolvedZombie.java @@ -158,7 +158,6 @@ protected void addRandomDrop() @Override protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) { - super.dropFewItems(p_70628_1_, p_70628_2_); Item item = this.getDropItem(); //Less rotten flesh than vanilla diff --git a/src/main/java/micdoodle8/mods/galacticraft/core/entities/player/GCEntityClientPlayerMP.java b/src/main/java/micdoodle8/mods/galacticraft/core/entities/player/GCEntityClientPlayerMP.java index 2f2d1579f4..0633c3d685 100644 --- a/src/main/java/micdoodle8/mods/galacticraft/core/entities/player/GCEntityClientPlayerMP.java +++ b/src/main/java/micdoodle8/mods/galacticraft/core/entities/player/GCEntityClientPlayerMP.java @@ -410,7 +410,7 @@ public boolean isSneaking() } if (EventHandlerClient.sneakRenderOverride) { - if (this.movementInput.sneak != this.sneakLast) + if (this.movementInput != null && this.movementInput.sneak != this.sneakLast) { this.sneakLast = this.movementInput.sneak; return false; diff --git a/src/main/java/micdoodle8/mods/galacticraft/core/entities/player/GCPlayerHandler.java b/src/main/java/micdoodle8/mods/galacticraft/core/entities/player/GCPlayerHandler.java index cb3ccfd025..83baaae65e 100644 --- a/src/main/java/micdoodle8/mods/galacticraft/core/entities/player/GCPlayerHandler.java +++ b/src/main/java/micdoodle8/mods/galacticraft/core/entities/player/GCPlayerHandler.java @@ -34,6 +34,7 @@ import micdoodle8.mods.galacticraft.core.world.gen.dungeon.MapGenDungeon; import micdoodle8.mods.galacticraft.core.wrappers.Footprint; import micdoodle8.mods.galacticraft.planets.asteroids.dimension.WorldProviderAsteroids; +import micdoodle8.mods.galacticraft.planets.asteroids.items.ItemArmorAsteroids; import micdoodle8.mods.galacticraft.planets.venus.VenusItems; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; @@ -67,6 +68,7 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import java.lang.reflect.Field; import java.util.*; import java.util.Map.Entry; @@ -322,8 +324,11 @@ else if (stats.getLastTankInSlot1() == null || forceSend) { GCPlayerHandler.sendGearUpdatePacket(player, EnumModelPacketType.ADD, EnumExtendedInventorySlot.LEFT_TANK, gearID); } - stats.setAirRemaining(stats.getTankInSlot1().getMaxDamage() - stats.getTankInSlot1().getItemDamage()); - GCPlayerHandler.sendAirRemainingPacket(player, stats); + if (stats.getMaskInSlot() != null && stats.getGearInSlot() != null) + { + stats.setAirRemaining(stats.getTankInSlot1().getMaxDamage() - stats.getTankInSlot1().getItemDamage()); + GCPlayerHandler.sendAirRemainingPacket(player, stats); + } } //if the else is reached then both tankInSlot and lastTankInSlot are non-null else if (stats.getTankInSlot1().getItem() != stats.getLastTankInSlot1().getItem()) @@ -334,8 +339,11 @@ else if (stats.getTankInSlot1().getItem() != stats.getLastTankInSlot1().getItem( { GCPlayerHandler.sendGearUpdatePacket(player, EnumModelPacketType.ADD, EnumExtendedInventorySlot.LEFT_TANK, gearID); } - stats.setAirRemaining(stats.getTankInSlot1().getMaxDamage() - stats.getTankInSlot1().getItemDamage()); - GCPlayerHandler.sendAirRemainingPacket(player, stats); + if (stats.getMaskInSlot() != null && stats.getGearInSlot() != null) + { + stats.setAirRemaining(stats.getTankInSlot1().getMaxDamage() - stats.getTankInSlot1().getItemDamage()); + GCPlayerHandler.sendAirRemainingPacket(player, stats); + } } stats.setLastTankInSlot1(stats.getTankInSlot1()); @@ -359,8 +367,11 @@ else if (stats.getLastTankInSlot2() == null || forceSend) { GCPlayerHandler.sendGearUpdatePacket(player, EnumModelPacketType.ADD, EnumExtendedInventorySlot.RIGHT_TANK, gearID); } - stats.setAirRemaining2(stats.getTankInSlot2().getMaxDamage() - stats.getTankInSlot2().getItemDamage()); - GCPlayerHandler.sendAirRemainingPacket(player, stats); + if (stats.getMaskInSlot() != null && stats.getGearInSlot() != null) + { + stats.setAirRemaining2(stats.getTankInSlot2().getMaxDamage() - stats.getTankInSlot2().getItemDamage()); + GCPlayerHandler.sendAirRemainingPacket(player, stats); + } } //if the else is reached then both tankInSlot and lastTankInSlot are non-null else if (stats.getTankInSlot2().getItem() != stats.getLastTankInSlot2().getItem()) @@ -371,8 +382,11 @@ else if (stats.getTankInSlot2().getItem() != stats.getLastTankInSlot2().getItem( { GCPlayerHandler.sendGearUpdatePacket(player, EnumModelPacketType.ADD, EnumExtendedInventorySlot.RIGHT_TANK, gearID); } - stats.setAirRemaining2(stats.getTankInSlot2().getMaxDamage() - stats.getTankInSlot2().getItemDamage()); - GCPlayerHandler.sendAirRemainingPacket(player, stats); + if (stats.getMaskInSlot() != null && stats.getGearInSlot() != null) + { + stats.setAirRemaining2(stats.getTankInSlot2().getMaxDamage() - stats.getTankInSlot2().getItemDamage()); + GCPlayerHandler.sendAirRemainingPacket(player, stats); + } } stats.setLastTankInSlot2(stats.getTankInSlot2()); @@ -1457,6 +1471,45 @@ public void onPlayerUpdate(EntityPlayerMP player) player.addChatMessage(new ChatComponentText(EnumColor.YELLOW + GCCoreUtil.translate("gui.frequencymodule.warning0") + " " + EnumColor.AQUA + GCItems.basicItem.getItemStackDisplayName(new ItemStack(GCItems.basicItem, 1, 19)) + sb.toString())); stats.setReceivedSoundWarning(true); } + + // Player moves and sprints 18% faster with full set of Titanium Armor + if (GalacticraftCore.isPlanetsLoaded && tick % 40 == 1 && player.inventory != null) + { + int titaniumCount = 0; + for (int i = 0; i < 4; i++) + { + ItemStack armorPiece = player.getCurrentArmor(i); + if (armorPiece != null && armorPiece.getItem() instanceof ItemArmorAsteroids) + { + titaniumCount++; + } + } + if (stats.getSavedSpeed() == 0F) + { + if (titaniumCount == 4) + { + float speed = player.capabilities.getWalkSpeed(); + if (speed < 0.118F) + { + try { + Field f = player.capabilities.getClass().getDeclaredField(GCCoreUtil.isDeobfuscated() ? "walkSpeed" : "field_75097_g"); + f.setAccessible(true); + f.set(player.capabilities, 0.118F); + stats.setSavedSpeed(speed); + } catch (Exception e) { e.printStackTrace(); } + } + } + } + else if (titaniumCount < 4) + { + try { + Field f = player.capabilities.getClass().getDeclaredField(GCCoreUtil.isDeobfuscated() ? "walkSpeed" : "field_75097_g"); + f.setAccessible(true); + f.set(player.capabilities, stats.getSavedSpeed()); + stats.setSavedSpeed(0F); + } catch (Exception e) { e.printStackTrace(); } + } + } stats.setLastOxygenSetupValid(stats.isOxygenSetupValid()); stats.setLastUnlockedSchematics(stats.getUnlockedSchematics()); diff --git a/src/main/java/micdoodle8/mods/galacticraft/core/entities/player/GCPlayerStats.java b/src/main/java/micdoodle8/mods/galacticraft/core/entities/player/GCPlayerStats.java index e467a71a73..eea8cc5104 100644 --- a/src/main/java/micdoodle8/mods/galacticraft/core/entities/player/GCPlayerStats.java +++ b/src/main/java/micdoodle8/mods/galacticraft/core/entities/player/GCPlayerStats.java @@ -325,4 +325,7 @@ public static GCPlayerStats get(Entity entity) public abstract Object[] getMiscNetworkedStats(); + public abstract void setSavedSpeed(float value); + + public abstract float getSavedSpeed(); } diff --git a/src/main/java/micdoodle8/mods/galacticraft/core/entities/player/StatsCapability.java b/src/main/java/micdoodle8/mods/galacticraft/core/entities/player/StatsCapability.java index 26161db8c1..22a6e3b8db 100644 --- a/src/main/java/micdoodle8/mods/galacticraft/core/entities/player/StatsCapability.java +++ b/src/main/java/micdoodle8/mods/galacticraft/core/entities/player/StatsCapability.java @@ -137,6 +137,7 @@ public class StatsCapability extends GCPlayerStats public int buildFlags = 0; public int incrementalDamage = 0; + private float savedSpeed = 0F; // used by titanium armor public String startDimension = ""; public int glassColor1 = -1; @@ -1389,4 +1390,16 @@ public Object[] getMiscNetworkedStats() result[length - 1] = this.panelLightingColor; return result; } + + @Override + public void setSavedSpeed(float value) + { + this.savedSpeed = value; + } + + @Override + public float getSavedSpeed() + { + return this.savedSpeed; + } } diff --git a/src/main/java/micdoodle8/mods/galacticraft/core/items/ItemBlockEmergencyBox.java b/src/main/java/micdoodle8/mods/galacticraft/core/items/ItemBlockEmergencyBox.java new file mode 100644 index 0000000000..294944e271 --- /dev/null +++ b/src/main/java/micdoodle8/mods/galacticraft/core/items/ItemBlockEmergencyBox.java @@ -0,0 +1,31 @@ +package micdoodle8.mods.galacticraft.core.items; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; + +public class ItemBlockEmergencyBox extends ItemBlockDesc +{ + public ItemBlockEmergencyBox(Block block) + { + super(block); + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + @Override + public String getUnlocalizedName(ItemStack par1ItemStack) + { + if (par1ItemStack.getItemDamage() == 1) + { + return this.getBlock().getUnlocalizedName() + ".filled"; + } + + return this.getBlock().getUnlocalizedName(); + } + + @Override + public int getMetadata(int damage) + { + return damage; + } +} diff --git a/src/main/java/micdoodle8/mods/galacticraft/core/proxy/ClientProxyCore.java b/src/main/java/micdoodle8/mods/galacticraft/core/proxy/ClientProxyCore.java index a9d1bda0e0..e065820b1b 100644 --- a/src/main/java/micdoodle8/mods/galacticraft/core/proxy/ClientProxyCore.java +++ b/src/main/java/micdoodle8/mods/galacticraft/core/proxy/ClientProxyCore.java @@ -472,6 +472,7 @@ private static void registerTileEntityRenderers() ClientRegistry.bindTileEntitySpecialRenderer(TileEntityArclamp.class, new TileEntityArclampRenderer()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPanelLight.class, new TileEntityPanelLightRenderer()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPlatform.class, new TileEntityPlatformRenderer()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityEmergencyBox.class, new TileEntityEmergencyBoxRenderer()); // ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFluidPipe.class, new TileEntityOxygenPipeRenderer()); // ClientRegistry.bindTileEntitySpecialRenderer(TileEntityOxygenStorageModule.class, new TileEntityMachineRenderer()); // ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCircuitFabricator.class, new TileEntityMachineRenderer()); @@ -646,6 +647,8 @@ private static void registerInventoryJsons() ClientUtil.registerBlockJson(Constants.TEXTURE_PREFIX, GCBlocks.panelLighting, 3, "panel_lighting_3"); ClientUtil.registerBlockJson(Constants.TEXTURE_PREFIX, GCBlocks.panelLighting, 4, "panel_lighting_4"); ClientUtil.registerBlockJson(Constants.TEXTURE_PREFIX, GCBlocks.platform); + ClientUtil.registerBlockJson(Constants.TEXTURE_PREFIX, GCBlocks.emergencyBox, 0, "emergency_box"); + ClientUtil.registerBlockJson(Constants.TEXTURE_PREFIX, GCBlocks.emergencyBox, 1, "emergency_box_full"); ClientUtil.registerBlockJson(Constants.TEXTURE_PREFIX, GCBlocks.glowstoneTorch); ClientUtil.registerBlockJson(Constants.TEXTURE_PREFIX, GCBlocks.blockMoon, 0, "ore_copper_moon"); ClientUtil.registerBlockJson(Constants.TEXTURE_PREFIX, GCBlocks.blockMoon, 1, "ore_tin_moon"); @@ -708,6 +711,7 @@ private static void addVariants() addCoreVariant("space_glass_vanilla", "space_glass_vanilla", "space_glass_tin_vanilla"); addCoreVariant("space_glass_strong", "space_glass_strong", "space_glass_tin_strong"); addCoreVariant("panel_lighting", "panel_lighting", "panel_lighting_1", "panel_lighting_2", "panel_lighting_3", "panel_lighting_4"); + addCoreVariant("emergency_box", "emergency_box", "emergency_box_full"); //Item variants: best if the damage=0 variant has the registered item name, to avoid ModelLoader errors for the #inventory variant addCoreVariant("canister", "canister", "canister_copper"); diff --git a/src/main/java/micdoodle8/mods/galacticraft/core/recipe/CompatModuleIC2.java b/src/main/java/micdoodle8/mods/galacticraft/core/recipe/CompatModuleIC2.java index 9498c1a69f..e8a0103043 100644 --- a/src/main/java/micdoodle8/mods/galacticraft/core/recipe/CompatModuleIC2.java +++ b/src/main/java/micdoodle8/mods/galacticraft/core/recipe/CompatModuleIC2.java @@ -15,7 +15,6 @@ public class CompatModuleIC2 { public static void addIndustrialCraft2Recipes() { - FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(GCItems.ic2compat, 1, 0), new ItemStack(GCItems.basicItem, 1, 5), 1.0F); FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(GCItems.ic2compat, 1, 1), new ItemStack(GCItems.basicItem, 1, 5), 1.0F); FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(GCItems.ic2compat, 1, 2), new ItemStack(GCItems.basicItem, 1, 5), 1.0F); Recipes.macerator.addRecipe(new RecipeInputItemStack(new ItemStack(GCBlocks.basicBlock, 1, 7), 1), null, false, new ItemStack(GCItems.ic2compat, 2, 2)); diff --git a/src/main/java/micdoodle8/mods/galacticraft/core/recipe/RecipeManagerGC.java b/src/main/java/micdoodle8/mods/galacticraft/core/recipe/RecipeManagerGC.java index b3fe261552..5120eb73b6 100644 --- a/src/main/java/micdoodle8/mods/galacticraft/core/recipe/RecipeManagerGC.java +++ b/src/main/java/micdoodle8/mods/galacticraft/core/recipe/RecipeManagerGC.java @@ -101,6 +101,10 @@ private static void addUniversalRecipes() //Recycling: smelt tin/copper canisters back into ingots FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(GCItems.canister, 1, 0), new ItemStack(GCItems.basicItem, 3, 4), 1.0F); FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(GCItems.canister, 1, 1), new ItemStack(GCItems.basicItem, 3, 3), 1.0F); + if (CompatibilityManager.useAluDust()) + { + FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(GCItems.ic2compat, 1, 0), new ItemStack(GCItems.basicItem, 1, 5), 1.0F); + } RecipeUtil.addRecipeUpdatable(new ItemStack(GCItems.rocketEngine, 1, 1), new Object[] { "ZYZ", "ZWZ", "XVX", 'V', GCItems.oxygenVent, 'W', new ItemStack(GCItems.fuelCanister, 1, 1), 'X', GCItems.heavyPlatingTier1, 'Y', new ItemStack(Blocks.wool, 1, 4), 'Z', meteoricIronPlate }); @@ -556,6 +560,8 @@ private static void addUniversalRecipes() //EmergencyKit RecipeUtil.addRecipe(new ItemStack(GCItems.emergencyKit), ItemEmergencyKit.getRecipe()); + RecipeUtil.addRecipe(new ItemStack(GCBlocks.emergencyBox), new Object[] { "XYX", "Y Y", "XYX", 'X', GCBlocks.glowstoneTorch, 'Y', new ItemStack(GCItems.basicItem, 1, 7) }); + RecipeUtil.addShapelessOreRecipe(new ItemStack(GCBlocks.emergencyBox, 1, 1), new ItemStack(GCBlocks.emergencyBox, 1, 0), new ItemStack(GCItems.emergencyKit) ); RecipeUtil.addShapelessOreRecipe(new ItemStack(GCItems.meteorChunk, 3), new Object[] { GCItems.meteoricIronRaw }); diff --git a/src/main/java/micdoodle8/mods/galacticraft/core/tile/TileEntityArclamp.java b/src/main/java/micdoodle8/mods/galacticraft/core/tile/TileEntityArclamp.java index e1cbf58444..4e16288e6d 100644 --- a/src/main/java/micdoodle8/mods/galacticraft/core/tile/TileEntityArclamp.java +++ b/src/main/java/micdoodle8/mods/galacticraft/core/tile/TileEntityArclamp.java @@ -155,7 +155,7 @@ else if (!this.isActive && this.pos.getX() >= -30000000 + 32 && this.pos.getZ() this.lightArea(); } - if (!this.worldObj.isRemote && this.worldObj.rand.nextInt(10) == 0) + if (!this.worldObj.isRemote && this.worldObj.rand.nextInt(20) == 0) { List moblist = this.worldObj.getEntitiesInAABBexcluding(null, this.thisAABB, IMob.mobSelector); @@ -170,7 +170,7 @@ else if (!this.isActive && this.pos.getX() >= -30000000 + 32 && this.pos.getZ() } EntityCreature mob = (EntityCreature) entry; //Check whether the mob can actually *see* the arclamp tile - //if (this.worldObj.func_147447_a(thisPos, Vec3.createVectorHelper(e.posX, e.posY, e.posZ), true, true, false) != null) continue; + //if (this.worldObj.func_147447_a(thisPos, new Vec3(entry.posX, entry.posY, entry.posZ), true, true, false) != null) continue; PathNavigate nav = mob.getNavigator(); if (nav == null) @@ -183,7 +183,7 @@ else if (!this.isActive && this.pos.getX() >= -30000000 + 32 && this.pos.getZ() { continue; } - double distanceNew = vecNewTarget.distanceTo(thisVec3); + double distanceNew = vecNewTarget.squareDistanceTo(thisVec3); double distanceCurrent = thisVec3.squareDistanceTo(new Vec3(mob.posX, mob.posY, mob.posZ)); if (distanceNew > distanceCurrent) { diff --git a/src/main/java/micdoodle8/mods/galacticraft/core/tile/TileEntityEmergencyBox.java b/src/main/java/micdoodle8/mods/galacticraft/core/tile/TileEntityEmergencyBox.java new file mode 100644 index 0000000000..2d4f88df83 --- /dev/null +++ b/src/main/java/micdoodle8/mods/galacticraft/core/tile/TileEntityEmergencyBox.java @@ -0,0 +1,633 @@ +package micdoodle8.mods.galacticraft.core.tile; + +import io.netty.buffer.ByteBuf; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; + +import micdoodle8.mods.galacticraft.api.entity.IEntityBreathable; +import micdoodle8.mods.galacticraft.api.vector.BlockVec3; +import micdoodle8.mods.galacticraft.core.GCBlocks; +import micdoodle8.mods.galacticraft.core.GCItems; +import micdoodle8.mods.galacticraft.core.GalacticraftCore; +import micdoodle8.mods.galacticraft.core.items.ItemEmergencyKit; +import micdoodle8.mods.galacticraft.core.network.IPacketReceiver; +import micdoodle8.mods.galacticraft.core.network.PacketDynamic; +import micdoodle8.mods.galacticraft.core.util.GCCoreUtil; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.ai.RandomPositionGenerator; +import net.minecraft.entity.monster.IMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.pathfinding.PathNavigate; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ITickable; +import net.minecraft.util.Vec3; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.minecraftforge.fml.common.network.NetworkRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.items.ItemHandlerHelper; + +public class TileEntityEmergencyBox extends TileEntity implements ITickable, IPacketReceiver +{ + private static final float SPEED = 4F; + public float angleA = 0F; + public float angleB = 0F; + public float angleC = 0F; + public float angleD = 0F; + public float lastAngleA = 0F; + public float lastAngleB = 0F; + public float lastAngleC = 0F; + public float lastAngleD = 0F; + + private boolean openN = false; + private boolean openW = false; + private boolean openS = false; + private boolean openE = false; + private int cooldown = 0; + + private HashSet airToRestore = new HashSet<>(); + private boolean activated = false; + Vec3 vec3Centre; + Vec3 thisVec3; + AxisAlignedBB mobsAABB; + + @Override + public void update() + { + if (!this.activated) + { + this.activated = true; + this.setLightBlocks(); + this.thisVec3 = new Vec3(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ()); + this.vec3Centre = new Vec3(this.pos.getX() + 0.5D, this.pos.getY() + 0.5D, this.pos.getZ() + 0.5D); + this.mobsAABB = AxisAlignedBB.fromBounds(this.pos.getX() - 14, this.pos.getY() - 7, this.pos.getZ() - 14, this.pos.getX() + 14, this.pos.getY() + 7, this.pos.getZ() + 14); + } + + if (this.worldObj.isRemote) + { + if (this.openN && this.angleA < 90F) + { + this.lastAngleA = this.angleA; + this.angleA += SPEED; + if (this.angleA > 90F) this.angleA = 90F; + } + if (this.openW && this.angleB < 90F) + { + this.lastAngleB = this.angleB; + this.angleB += SPEED; + if (this.angleB > 90F) this.angleB = 90F; + } + if (this.openS && this.angleC < 90F) + { + this.lastAngleC = this.angleC; + this.angleC += SPEED; + if (this.angleC > 90F) this.angleC = 90F; + } + if (this.openE && this.angleD < 90F) + { + this.lastAngleD = this.angleD; + this.angleD += SPEED; + if (this.angleD > 90F) this.angleD = 90F; + } + + if (!this.openN && this.angleA > 0F) + { + this.lastAngleA = this.angleA; + this.angleA -= SPEED; + if (this.angleA < 0F) this.angleA = 0F; + } + if (!this.openW && this.angleB > 0F) + { + this.lastAngleB = this.angleB; + this.angleB -= SPEED; + if (this.angleB < 0F) this.angleB = 0F; + } + if (!this.openS && this.angleC > 0F) + { + this.lastAngleC = this.angleC; + this.angleC -= SPEED; + if (this.angleC < 0F) this.angleC = 0F; + } + if (!this.openE && this.angleD > 0F) + { + this.lastAngleD = this.angleD; + this.angleD -= SPEED; + if (this.angleD < 0F) this.angleD = 0F; + } + } + else + { + if (this.cooldown > 0) + { + this.cooldown--; + } + + if (this.openN) + { + boolean clash = false; + BlockPos testPos = this.pos.north(1); + IBlockState bs = this.worldObj.getBlockState(testPos); + if (!(bs.getBlock() instanceof BlockAir)) + { + if (bs.getBlock().isOpaqueCube()) + { + clash = true; + } + else + { + AxisAlignedBB check = AxisAlignedBB.fromBounds(this.pos.getX() + 0.125D, this.pos.getY() + 0.125D, this.pos.getZ() - 5/16D, this.pos.getX() + 0.875D, this.pos.getY() + 0.875D, this.pos.getZ()); + clash = check.intersectsWith(bs.getBlock().getCollisionBoundingBox(this.worldObj, testPos, bs)); + } + } + if (clash) + { + this.openN = false; + this.updateClients(); + } + } + if (this.openS) + { + boolean clash = false; + BlockPos testPos = this.pos.south(1); + IBlockState bs = this.worldObj.getBlockState(testPos); + if (!(bs.getBlock() instanceof BlockAir)) + { + if (bs.getBlock().isOpaqueCube()) + { + clash = true; + } + else + { + AxisAlignedBB check = AxisAlignedBB.fromBounds(this.pos.getX() + 0.125D, this.pos.getY() + 0.125D, this.pos.getZ() + 1D, this.pos.getX() + 0.875D, this.pos.getY() + 0.875D, this.pos.getZ() + 21/16D); + clash = check.intersectsWith(bs.getBlock().getCollisionBoundingBox(this.worldObj, testPos, bs)); + } + } + if (clash) + { + this.openS = false; + this.updateClients(); + } + } + if (this.openW) + { + boolean clash = false; + BlockPos testPos = this.pos.west(1); + IBlockState bs = this.worldObj.getBlockState(testPos); + if (!(bs.getBlock() instanceof BlockAir)) + { + if (bs.getBlock().isOpaqueCube()) + { + clash = true; + } + else + { + AxisAlignedBB check = AxisAlignedBB.fromBounds(this.pos.getX() - 5/16D, this.pos.getY() + 0.125D, this.pos.getZ() + 0.125D, this.pos.getX(), this.pos.getY() + 0.875D, this.pos.getZ() + 0.875D); + clash = check.intersectsWith(bs.getBlock().getCollisionBoundingBox(this.worldObj, testPos, bs)); + } + } + if (clash) + { + this.openW = false; + this.updateClients(); + } + } + if (this.openE) + { + boolean clash = false; + BlockPos testPos = this.pos.east(1); + IBlockState bs = this.worldObj.getBlockState(testPos); + if (!(bs.getBlock() instanceof BlockAir)) + { + if (bs.getBlock().isOpaqueCube()) + { + clash = true; + } + else + { + AxisAlignedBB check = AxisAlignedBB.fromBounds(this.pos.getX() + 1D, this.pos.getY() + 0.125D, this.pos.getZ() + 0.125D, this.pos.getX() + 21/16D, this.pos.getY() + 0.875D, this.pos.getZ() + 0.875D); + clash = check.intersectsWith(bs.getBlock().getCollisionBoundingBox(this.worldObj, testPos, bs)); + } + } + if (clash) + { + this.openE = false; + this.updateClients(); + } + } + + if (this.worldObj.rand.nextInt(15) == 0) + { + this.scareMobs(); + } + } + } + + private void scareMobs() + { + List moblist = this.worldObj.getEntitiesInAABBexcluding(null, mobsAABB, IMob.mobSelector); + if (!moblist.isEmpty()) + { + for (Entity entry : moblist) + { + if (!(entry instanceof EntityCreature && entry instanceof IEntityBreathable)) + { + continue; + } + EntityCreature mob = (EntityCreature) entry; + PathNavigate nav = mob.getNavigator(); + if (nav == null) + { + continue; + } + + Vec3 vecNewTarget = RandomPositionGenerator.findRandomTargetBlockAwayFrom(mob, 12, 5, vec3Centre); + if (vecNewTarget == null) + { + vecNewTarget = RandomPositionGenerator.findRandomTargetBlockAwayFrom(mob, 14, 7, vec3Centre); + if (vecNewTarget == null) continue; + } + double distanceNew = vecNewTarget.squareDistanceTo(thisVec3); + double distanceCurrent = thisVec3.squareDistanceTo(new Vec3(mob.posX, mob.posY, mob.posZ)); + if (distanceNew > distanceCurrent) + { + Vec3 vecOldTarget = null; + if (nav.getPath() != null && !nav.getPath().isFinished()) + { + vecOldTarget = nav.getPath().getPosition(mob); + } + if (vecOldTarget == null || distanceCurrent > vecOldTarget.squareDistanceTo(thisVec3)) + { + nav.tryMoveToXYZ(vecNewTarget.xCoord, vecNewTarget.yCoord, vecNewTarget.zCoord, 1.3D); + } + } + } + } + } + + public float getAngleA(float f) + { + float result = this.angleA + (this.angleA - this.lastAngleA) * f; + if (result > 90F) result = 90F; + if (result < 0F) result = 0F; + return result; + } + + public float getAngleB(float f) + { + float result = this.angleB + (this.angleB - this.lastAngleB) * f; + if (result > 90F) result = 90F; + if (result < 0F) result = 0F; + return result; + } + + public float getAngleC(float f) + { + float result = this.angleC + (this.angleC - this.lastAngleC) * f; + if (result > 90F) result = 90F; + if (result < 0F) result = 0F; + return result; + } + + public float getAngleD(float f) + { + float result = this.angleD + (this.angleD - this.lastAngleD) * f; + if (result > 90F) result = 90F; + if (result < 0F) result = 0F; + return result; + } + + public void click(EntityPlayer player, EnumFacing side, boolean kitted) + { + switch (side) + { + case NORTH: + if (this.openN && this.cooldown == 0) + { + if (kitted) + { + ItemHandlerHelper.giveItemToPlayer(player, new ItemStack(GCItems.emergencyKit), 0); + this.worldObj.setBlockState(this.pos, GCBlocks.emergencyBox.getDefaultState(), 3); + break; + } + else + { + ItemStack stack = player.inventory.getCurrentItem(); + if (stack != null && stack.getItem() instanceof ItemEmergencyKit) + { + player.inventory.setInventorySlotContents(player.inventory.currentItem, null); + this.worldObj.setBlockState(this.pos, GCBlocks.emergencyBox.getStateFromMeta(1), 3); + this.openW = false; + this.openS = false; + this.openE = false; + } + } + } + this.cooldown = 12; + this.openN = !this.openN; + this.updateClients(); + break; + case WEST: + if (this.openW && this.cooldown == 0) + { + if (kitted) + { + ItemHandlerHelper.giveItemToPlayer(player, new ItemStack(GCItems.emergencyKit), 0); + this.worldObj.setBlockState(this.pos, GCBlocks.emergencyBox.getDefaultState(), 3); + break; + } + else + { + ItemStack stack = player.inventory.getCurrentItem(); + if (stack != null && stack.getItem() instanceof ItemEmergencyKit) + { + player.inventory.setInventorySlotContents(player.inventory.currentItem, null); + this.worldObj.setBlockState(this.pos, GCBlocks.emergencyBox.getStateFromMeta(1), 3); + this.openN = false; + this.openS = false; + this.openE = false; + } + } + } + this.cooldown = 12; + this.openW = !this.openW; + this.updateClients(); + break; + case SOUTH: + if (this.openS && this.cooldown == 0) + { + if (kitted) + { + ItemHandlerHelper.giveItemToPlayer(player, new ItemStack(GCItems.emergencyKit), 0); + this.worldObj.setBlockState(this.pos, GCBlocks.emergencyBox.getDefaultState(), 3); + break; + } + else + { + ItemStack stack = player.inventory.getCurrentItem(); + if (stack != null && stack.getItem() instanceof ItemEmergencyKit) + { + player.inventory.setInventorySlotContents(player.inventory.currentItem, null); + this.worldObj.setBlockState(this.pos, GCBlocks.emergencyBox.getStateFromMeta(1), 3); + this.openN = false; + this.openW = false; + this.openE = false; + } + } + } + this.cooldown = 12; + this.openS = !this.openS; + this.updateClients(); + break; + case EAST: + if (this.openE && this.cooldown == 0) + { + if (kitted) + { + ItemHandlerHelper.giveItemToPlayer(player, new ItemStack(GCItems.emergencyKit), 0); + this.worldObj.setBlockState(this.pos, GCBlocks.emergencyBox.getDefaultState(), 3); + break; + } + else + { + ItemStack stack = player.inventory.getCurrentItem(); + if (stack != null && stack.getItem() instanceof ItemEmergencyKit) + { + player.inventory.setInventorySlotContents(player.inventory.currentItem, null); + this.worldObj.setBlockState(this.pos, GCBlocks.emergencyBox.getStateFromMeta(1), 3); + this.openN = false; + this.openW = false; + this.openS = false; + } + } + } + this.cooldown = 12; + this.openE = !this.openE; + this.updateClients(); + break; + default: + } + } + + @Override + public void readFromNBT(NBTTagCompound nbt) + { + super.readFromNBT(nbt); + int data = nbt.getInteger("open"); + this.openN = (data & 1) == 1; + this.openW = (data & 2) == 2; + this.openS = (data & 4) == 4; + this.openE = (data & 8) == 8; + if (GCCoreUtil.getEffectiveSide() == Side.SERVER) + { + this.airToRestore.clear(); + NBTTagList airBlocks = nbt.getTagList("air", 10); + if (airBlocks.tagCount() > 0) + { + for (int j = airBlocks.tagCount() - 1; j >= 0; j--) + { + NBTTagCompound tag1 = airBlocks.getCompoundTagAt(j); + if (tag1 != null) + { + this.airToRestore.add(BlockVec3.readFromNBT(tag1)); + } + } + } + } + } + + @Override + public void writeToNBT(NBTTagCompound nbt) + { + super.writeToNBT(nbt); + int data = (this.openN ? 1 : 0) + (this.openW ? 2 : 0) + (this.openS ? 4 : 0) + (this.openE ? 8 : 0); + nbt.setInteger("open", data); + + NBTTagList airBlocks = new NBTTagList(); + for (BlockVec3 vec : this.airToRestore) + { + NBTTagCompound tag = new NBTTagCompound(); + vec.writeToNBT(tag); + airBlocks.appendTag(tag); + } + nbt.setTag("air", airBlocks); + } + + @Override + public void getNetworkedData(ArrayList sendData) + { + if (this.worldObj.isRemote) + { + return; + } + + int data = (this.openN ? 1 : 0) + (this.openW ? 2 : 0) + (this.openS ? 4 : 0) + (this.openE ? 8 : 0); + sendData.add((byte)data); + for (BlockVec3 vec : this.airToRestore) + { + sendData.add(vec); + } + } + + @Override + public void decodePacketdata(ByteBuf buffer) + { + if (this.worldObj.isRemote) + { + try + { + int data = buffer.readByte(); + this.openN = (data & 1) == 1; + this.openW = (data & 2) == 2; + this.openS = (data & 4) == 4; + this.openE = (data & 8) == 8; + while (buffer.readableBytes() >= 12) + { + int x = buffer.readInt(); + int y = buffer.readInt(); + int z = buffer.readInt(); + this.airToRestore.add(new BlockVec3(x, y, z)); + } + } + catch (Exception e) + { + e.printStackTrace(); + } + } + } + + @Override + public void onLoad() + { + if (this.worldObj.isRemote) + { + //Request any networked information from server on first client update + GalacticraftCore.packetPipeline.sendToServer(new PacketDynamic(this)); + } + } + + private void updateClients() + { + GalacticraftCore.packetPipeline.sendToAllAround(new PacketDynamic(this), new NetworkRegistry.TargetPoint(GCCoreUtil.getDimensionID(this.worldObj), getPos().getX(), getPos().getY(), getPos().getZ(), 128)); + } + + @Override + public boolean shouldRefresh(World world, BlockPos pos, IBlockState oldState, IBlockState newState) + { + return oldState.getBlock() != newState.getBlock(); + } + + private void brightenAir(BlockPos blockpos, IBlockState newState) + { + Chunk chunk = this.worldObj.getChunkFromBlockCoords(blockpos); + IBlockState oldState = chunk.setBlockState(blockpos, newState); + if (this.worldObj.isRemote && oldState != null) + { + this.worldObj.markAndNotifyBlock(blockpos, chunk, oldState, newState, 2); + } + //No block update on server - not necessary for changing air to air (also must not trigger a sealer edge check!) + this.airToRestore.add(new BlockVec3(blockpos)); + this.worldObj.checkLightFor(EnumSkyBlock.BLOCK, blockpos); + this.markDirty(); + } + + private void setDarkerAir(BlockVec3 vec) + { + BlockPos blockpos = vec.toBlockPos(); + Block b = this.worldObj.getBlockState(blockpos).getBlock(); + IBlockState newState; + if (b == GCBlocks.brightAir) + { + newState = Blocks.air.getDefaultState(); + } + else if (b == GCBlocks.brightBreatheableAir) + { + newState = GCBlocks.breatheableAir.getDefaultState(); + } + else + { + return; + } + + Chunk chunk = this.worldObj.getChunkFromBlockCoords(blockpos); + IBlockState oldState = chunk.setBlockState(blockpos, newState); + if (this.worldObj.isRemote && oldState != null) this.worldObj.markAndNotifyBlock(blockpos, chunk, oldState, newState, 2); + this.worldObj.checkLightFor(EnumSkyBlock.BLOCK, blockpos); + } + + private void revertAir() + { + if (this.airToRestore.isEmpty()) + return; + + int index = 0; + for (BlockVec3 vec : this.airToRestore) + { + this.setDarkerAir(vec); + } + this.airToRestore.clear(); + this.markDirty(); + } + + @Override + public void invalidate() + { + this.revertAir(); + super.invalidate(); + } + + private void setLightBlocks() + { + this.setLightBlock(new BlockPos(this.pos.getX() - 6, this.pos.getY(), this.pos.getZ())); + this.setLightBlock(new BlockPos(this.pos.getX() + 6, this.pos.getY(), this.pos.getZ())); + this.setLightBlock(new BlockPos(this.pos.getX(), this.pos.getY(), this.pos.getZ() - 6)); + this.setLightBlock(new BlockPos(this.pos.getX(), this.pos.getY(), this.pos.getZ() + 6)); + this.setLightBlock(new BlockPos(this.pos.getX() - 5, this.pos.getY(), this.pos.getZ() - 5)); + this.setLightBlock(new BlockPos(this.pos.getX() - 5, this.pos.getY(), this.pos.getZ() + 5)); + this.setLightBlock(new BlockPos(this.pos.getX() + 5, this.pos.getY(), this.pos.getZ() + 5)); + this.setLightBlock(new BlockPos(this.pos.getX() + 5, this.pos.getY(), this.pos.getZ() - 5)); + } + + private boolean setLightBlock(BlockPos blockPos) + { + IBlockState bs = this.worldObj.getBlockState(blockPos); + if (bs.getBlock() == Blocks.air) + { + this.brightenAir(blockPos, GCBlocks.brightAir.getDefaultState()); + return true; + } + else if (bs.getBlock() == GCBlocks.breatheableAir) + { + this.brightenAir(blockPos, GCBlocks.brightBreatheableAir.getDefaultState()); + return true; + } + + blockPos = blockPos.up(1); + bs = this.worldObj.getBlockState(blockPos); + if (bs.getBlock() == Blocks.air) + { + this.brightenAir(blockPos, GCBlocks.brightAir.getDefaultState()); + return true; + } + else if (bs.getBlock() == GCBlocks.breatheableAir) + { + this.brightenAir(blockPos, GCBlocks.brightBreatheableAir.getDefaultState()); + return true; + } + + return false; + } +} diff --git a/src/main/java/micdoodle8/mods/galacticraft/core/util/ConfigManagerCore.java b/src/main/java/micdoodle8/mods/galacticraft/core/util/ConfigManagerCore.java index f685e6c0ed..6a6cd64d3c 100644 --- a/src/main/java/micdoodle8/mods/galacticraft/core/util/ConfigManagerCore.java +++ b/src/main/java/micdoodle8/mods/galacticraft/core/util/ConfigManagerCore.java @@ -212,7 +212,7 @@ public static void syncConfig(boolean load) staticLoadDimensions = prop.getIntList(); finishProp(prop); - prop = getConfig(Constants.CONFIG_CATEGORY_DIMENSIONS, "Set new Space Stations to be static loaded", false); + prop = getConfig(Constants.CONFIG_CATEGORY_DIMENSIONS, "Set new Space Stations to be static loaded", true); prop.comment = "Set this to true to have an automatic /gckeeploaded for any new Space Station created."; prop.setLanguageKey("gc.configgui.static_loaded_new_ss"); keepLoadedNewSpaceStations = prop.getBoolean(); diff --git a/src/main/resources/assets/galacticraftcore/blockstates/emergency_box.json b/src/main/resources/assets/galacticraftcore/blockstates/emergency_box.json new file mode 100644 index 0000000000..fdfc94ebb5 --- /dev/null +++ b/src/main/resources/assets/galacticraftcore/blockstates/emergency_box.json @@ -0,0 +1,7 @@ +{ + "variants": { + "normal": { "model": "galacticraftcore:emergency_box" }, + "kit=true": { "model": "galacticraftcore:emergency_box" }, + "kit=false": { "model": "galacticraftcore:emergency_box" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/galacticraftcore/lang/en_US.lang b/src/main/resources/assets/galacticraftcore/lang/en_US.lang index 806e948ad6..f90111b338 100644 --- a/src/main/resources/assets/galacticraftcore/lang/en_US.lang +++ b/src/main/resources/assets/galacticraftcore/lang/en_US.lang @@ -624,6 +624,9 @@ tile.dummyblock.solar.name=Solar Panel tile.dummyblock.space_station_base.name=Space Station Base tile.electric_furnace_tier1.description=Electric Furnace is used as a faster alternative to traditional coal furnaces. tile.electric_furnace_tier2.description=Electric Arc Furnace is used as a better and faster alternative to both traditional coal and electric furnaces: double output from ores! +tile.emergency_box.description=Place an Emergency Post close by your first landing place on a planet. Open to find Emergency Kit inside. Also repels mobs! +tile.emergency_box.filled.name=Emergency Post (with Kit) +tile.emergency_box.name=Emergency Post tile.enclosed.aluminum_wire.name=Sealable Aluminum Wire tile.enclosed.copper_cable.name=Sealable Copper Cable tile.enclosed.description=Sealable blocks should be used where air cannot pass, such as space base walls. diff --git a/src/main/resources/assets/galacticraftcore/lang/th_TH.lang b/src/main/resources/assets/galacticraftcore/lang/th_TH.lang index 4390599c59..cc76c1ecf8 100644 --- a/src/main/resources/assets/galacticraftcore/lang/th_TH.lang +++ b/src/main/resources/assets/galacticraftcore/lang/th_TH.lang @@ -2,10 +2,18 @@ checklist.create_grapple.key=สร้างตะขอเกี่ยว checklist.equip_oxygen_suit.key=สวมชุดออกซิเจน checklist.equip_parachute.key=ใส่ร่มชูชีพ command.gcastrominer.count=จำนวนแอสโทรไมน์เนอร์ของผู้เล่น %s คือ %s +commands.emergencykit=%s ได้ให้ชุดอุปกรณ์ฉุกเฉิน! commands.dimensionteleport=%s ถูกส่งไปยังชั้นบรรยากาศ %s commands.dimensiontp.too_many=การใช้คำสั่งมากเกินไป! การใช้: %s commands.gcenergyunits.invalid_units=ยูนิตไม่ถูกต้อง ในคำสั่ง /GCEnergyUnits การใช้: %s commands.gcenergyunits.no_units=ต้องระบุยูนิต! การใช้: %s +commands.gchouston.confirm.1=นี่ศูนย์ควบคุมภารกิจ พูดอีกครั้งได้ไหม? +commands.gchouston.confirm.2=(เพื่อยกเลิกภารกิจ, พิมพ์คำสั่ง /gchouston อีกครั้งเพื่อยืนยัน) +commands.gchouston.fail=คำสั่ง /gchouston ใช้ได้ต่อเมื่ออยู่บนอวกาศ (หรือโหมดสร้างสรรค์) +commands.gchouston.help.1=เอ่อ ฮูสตัน เรามีปัญหา.... +commands.gchouston.help.2=(พิมพ์คำสั่ง /gchouston เพื่อยกเลิกภารกิจและกลับโลก) +commands.gchouston.noop=ใช้คำสั่ง /gchouston กับผู้เล่นคนอื่นใช้ได้เฉพาะโอเปอเรเตอร์เท่านั้น +commands.gchouston.success=โอเค สแตนบาย %s กำลังเทเลพอร์ตกลับไปยังโลก commands.joinrace.no_team=ต้องการกำหนดรายละเอียดของทีม การใช้: %s commands.ssinvite.not_found=ไม่สามารถหาสถานีอวกาศของเราได้ คุณต้องเดินทางไปหาก่อน! commands.ssinvite.wrong_usage=การใช้คำสั่งไม่ถูกต้อง! การใช้: %s @@ -56,18 +64,23 @@ entity.para_chest.name=กล่องสัมภาระ entity.rocket_t1.name=จรวด เทียร์ 1 galaxy.milky_way=กาแลคซีทางช้างเผือก gc.configgui.alternate_canister_recipe=เปลี่ยนวิธีการคราฟกระป๋อง +gc.configgui.asteroids_flags=โหมดชาแลนจ์เก็บธง gc.configgui.asteroids_start=โหมดชาแลนจ์ (เกิดบนดาวเคราะห์น้อย) gc.configgui.biome_id_base=ID ไบโอมหลักของกาแลคติคคราฟต์ gc.configgui.detectable_i_ds=ชื่อของบล็อกที่ตรวจพบได้โดยแว่นเซนเซอร์ +gc.configgui.disable_biome_type_registrations=ปิดใช้งานการเรจิสเตอร์ชนิดของ Biome gc.configgui.disable_cheese_moon=ปิดใช้งานการเจนเนอเรทแร่ชีส gc.configgui.disable_copper_moon=ปิดใช้งานการเจนเนอเรทแร่ทองแดง gc.configgui.disable_lander=ปิดใช้งานยานลงจอดบนดวงจันทร์ gc.configgui.disable_moon_village_gen=ปิดใช้งานการเจนเนอเรทหมู่บ้านบนดวงจันทร์ +gc.configgui.disable_ore_dict_space_metals=ใช้แท่งเหล็กของ GC ในวิธีการคราฟ +gc.configgui.disable_sapphire_moon=ปิดใช้งานการเจนเนอเรทแร่ไพลินดวงจันทร์ gc.configgui.disable_space_station_creation=ปิดใช้งานการสร้างสถานีอวกาศ gc.configgui.disable_spaceship_grief=ปิดใช้งานการระเบิดของจรวด gc.configgui.disable_spaceship_particles=ปิดใช้งานควันจรวด gc.configgui.disable_tin_moon=ปิดใช้งานการเจนเนอเรทแร่ดีบุก gc.configgui.disable_update_check=ปิดการตรวจสอบเวอร์ชั่น +gc.configgui.disable_vehicle_camera_changes=Vivecraft: ปิดใช้งาน Third-Person และการซูม gc.configgui.dungeon_boss_health_mod=พลังชีวิตของบอส gc.configgui.enable_aluminum_ore_gen=เปิดใช้งานการเจนเนอเรทแร่อลูมิเนียม gc.configgui.enable_copper_ore_gen=เปิดใช้งานการเจนเนอเรทแร่ทองแดง @@ -76,6 +89,7 @@ gc.configgui.enable_other_mods_features=เปิดใช้งานการ gc.configgui.enable_retrogen_oil=เปิดใช้งานการเจนเนอเรทใหม่ของน้ำมันดิบบนโลก gc.configgui.enable_sealer_edge_checks=ตรวจสอบการผนึกแบบละเอียด gc.configgui.enable_silicon_ore_gen=เปิดใช้งานการเจนเนอเรทแร่ซิลิคอน +gc.configgui.enable_space_race_manager_popup=เปิดใช้งานป๊อปอัพของการแข่งขันอวกาศ gc.configgui.enable_thaum_craft_nodes=เปิดใช้งาน Thaumcraft Nodes บนดาวเคราะห์ gc.configgui.enable_tin_ore_gen=เปิดใช้งานการเจนเนอเรทแร่ดีบุก gc.configgui.external_oil_gen=ID มิติของการเจนเนอเรทน้ำมัน @@ -116,6 +130,8 @@ gc.configgui.static_loaded_new_ss=โหลดมิติสถานีอว gc.configgui.suffocation_cooldown=ระยะถอยหลังจากการหายใจไม่ออก gc.configgui.suffocation_damage=ค่า Damage จากการหายใจไม่ออก gc.configgui.title=ตั้งค่ากาแลคติคคราฟต์ +gc.configgui.use_old_fuel_fluid_i_d=ใช้การเรจิสเตอร์ของเหลว fuelgc แบบเก่า +gc.configgui.use_old_oil_fluid_i_d=ใช้การเรจิสเตอร์ของเหลว oilgc แบบเก่า gc.configgui.whitelist_co_f_h_core_gen=เปิดใช้งานการเจนเนอเรทของ CoFHCore gui.battery_slot.desc.0=ช่องแบตเตอรี่ วางแบตเตอรี่ที่นี่ gui.battery_slot.desc.1=หรือเชื่อมต่อจากแหล่งพลังงานอื่น ๆ @@ -446,6 +462,8 @@ item.cheese_curd.name=เศษชีส item.compressed_meteoric_iron.name=แผ่นเหล็กอุกกาบาต item.dungeonfinder.name=เครื่องหาดันเจี้ยน item.empty_liquid_canister.name=กระป๋องเปล่า +item.emergency_kit.description=คลิกขวาเพื่อสวมใส่เกียร์ออกซิเจนและของสำคัญ คำเตือน: ใช้ครั้งเดียว! +item.emergency_kit.name=ชุดอุปกรณ์ฉุกเฉิน item.engine.tier1booster.name=บูสเตอร์ เทียร์ 1 item.engine.tier1engine.name=เครื่องยนต์จรวด เทียร์ 1 item.flag.name=ธง diff --git a/src/main/resources/assets/galacticraftcore/models/block/emergency_box.json b/src/main/resources/assets/galacticraftcore/models/block/emergency_box.json new file mode 100644 index 0000000000..e0ca153f6c --- /dev/null +++ b/src/main/resources/assets/galacticraftcore/models/block/emergency_box.json @@ -0,0 +1,118 @@ +{ + "textures": { + "0": "galacticraftcore:blocks/emergency_box", + "particle": "galacticraftcore:blocks/emergency_box" + }, + "elements": [ + { + "name": "Cube", + "from": [ 0.0, 0.0, 0.0 ], + "to": [ 16.0, 2.0, 16.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 0.0, 14.0, 16.0, 16.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 14.0, 16.0, 16.0 ] }, + "south": { "texture": "#0", "uv": [ 0.0, 14.0, 16.0, 16.0 ] }, + "west": { "texture": "#0", "uv": [ 0.0, 14.0, 16.0, 16.0 ] }, + "up": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 16.0 ] }, + "down": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 16.0 ] } + } + }, + { + "name": "Cube", + "from": [ 0.0, 14.0, 0.0 ], + "to": [ 16.0, 16.0, 16.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 2.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 2.0 ] }, + "south": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 2.0 ] }, + "west": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 2.0 ] }, + "up": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 16.0 ] }, + "down": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 16.0 ] } + } + }, + { + "name": "Cube", + "from": [ 0.0, 2.0, 0.0 ], + "to": [ 1.0, 14.0, 2.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 15.0, 2.0, 16.0, 14.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 2.0, 2.0, 14.0 ] }, + "south": { "texture": "#0", "uv": [ 0.0, 2.0, 1.0, 14.0 ] }, + "west": { "texture": "#0", "uv": [ 0.0, 2.0, 2.0, 14.0 ] } + } + }, + { + "name": "Cube", + "from": [ 15.0, 2.0, 0.0 ], + "to": [ 16.0, 14.0, 2.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 0.0, 2.0, 1.0, 14.0 ] }, + "east": { "texture": "#0", "uv": [ 14.0, 2.0, 16.0, 14.0 ] }, + "south": { "texture": "#0", "uv": [ 14.0, 2.0, 15.0, 14.0 ] }, + "west": { "texture": "#0", "uv": [ 0.0, 2.0, 2.0, 14.0 ] } + } + }, + { + "name": "Cube", + "from": [ 15.0, 2.0, 14.0 ], + "to": [ 16.0, 14.0, 16.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 0.0, 2.0, 1.0, 14.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 2.0, 2.0, 14.0 ] }, + "south": { "texture": "#0", "uv": [ 15.0, 2.0, 16.0, 14.0 ] }, + "west": { "texture": "#0", "uv": [ 14.0, 2.0, 16.0, 14.0 ] } + } + }, + { + "name": "Cube", + "from": [ 0.0, 2.0, 14.0 ], + "to": [ 1.0, 14.0, 16.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 14.0, 2.0, 15.0, 14.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 2.0, 2.0, 14.0 ] }, + "south": { "texture": "#0", "uv": [ 0.0, 2.0, 1.0, 14.0 ] }, + "west": { "texture": "#0", "uv": [ 14.0, 2.0, 16.0, 14.0 ] } + } + }, + { + "name": "Cube", + "from": [ 1.0, 2.0, 0.0 ], + "to": [ 2.0, 14.0, 1.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 14.0, 2.0, 15.0, 14.0 ] }, + "east": { "texture": "#0", "uv": [ 14.0, 2.0, 15.0, 14.0 ] }, + "south": { "texture": "#0", "uv": [ 1.0, 2.0, 2.0, 14.0 ] } + } + }, + { + "name": "Cube", + "from": [ 14.0, 2.0, 0.0 ], + "to": [ 15.0, 14.0, 1.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 1.0, 2.0, 2.0, 14.0 ] }, + "south": { "texture": "#0", "uv": [ 14.0, 2.0, 15.0, 14.0 ] }, + "west": { "texture": "#0", "uv": [ 0.0, 2.0, 1.0, 14.0 ] } + } + }, + { + "name": "Cube", + "from": [ 14.0, 2.0, 15.0 ], + "to": [ 15.0, 14.0, 16.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 1.0, 2.0, 2.0, 14.0 ] }, + "south": { "texture": "#0", "uv": [ 14.0, 2.0, 15.0, 14.0 ] }, + "west": { "texture": "#0", "uv": [ 1.0, 2.0, 2.0, 14.0 ] } + } + }, + { + "name": "Cube", + "from": [ 1.0, 2.0, 15.0 ], + "to": [ 2.0, 14.0, 16.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 14.0, 2.0, 15.0, 14.0 ] }, + "east": { "texture": "#0", "uv": [ 14.0, 2.0, 15.0, 14.0 ] }, + "south": { "texture": "#0", "uv": [ 1.0, 2.0, 5.0, 1.0 ] } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/galacticraftcore/models/block/emergency_box_filled.json b/src/main/resources/assets/galacticraftcore/models/block/emergency_box_filled.json new file mode 100644 index 0000000000..b7a77b8345 --- /dev/null +++ b/src/main/resources/assets/galacticraftcore/models/block/emergency_box_filled.json @@ -0,0 +1,170 @@ +{ + "textures": { + "0": "galacticraftcore:blocks/emergency_box", + "1": "galacticraftcore:items/emergency_kit" + }, + "elements": [ + { + "name": "Cube", + "from": [ 0.0, 0.0, 0.0 ], + "to": [ 16.0, 2.0, 16.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 0.0, 14.0, 16.0, 16.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 14.0, 16.0, 16.0 ] }, + "south": { "texture": "#0", "uv": [ 0.0, 14.0, 16.0, 16.0 ] }, + "west": { "texture": "#0", "uv": [ 0.0, 14.0, 16.0, 16.0 ] }, + "up": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 16.0 ] }, + "down": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 16.0 ] } + } + }, + { + "name": "Cube", + "from": [ 0.0, 14.0, 0.0 ], + "to": [ 16.0, 16.0, 16.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 2.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 2.0 ] }, + "south": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 2.0 ] }, + "west": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 2.0 ] }, + "up": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 16.0 ] }, + "down": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 16.0 ] } + } + }, + { + "name": "Cube", + "from": [ 0.0, 2.0, 0.0 ], + "to": [ 1.0, 14.0, 2.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 15.0, 2.0, 16.0, 14.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 2.0, 2.0, 14.0 ] }, + "south": { "texture": "#0", "uv": [ 0.0, 2.0, 1.0, 14.0 ] }, + "west": { "texture": "#0", "uv": [ 0.0, 2.0, 2.0, 14.0 ] } + } + }, + { + "name": "Cube", + "from": [ 15.0, 2.0, 0.0 ], + "to": [ 16.0, 14.0, 2.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 0.0, 2.0, 1.0, 14.0 ] }, + "east": { "texture": "#0", "uv": [ 14.0, 2.0, 16.0, 14.0 ] }, + "south": { "texture": "#0", "uv": [ 14.0, 2.0, 15.0, 14.0 ] }, + "west": { "texture": "#0", "uv": [ 0.0, 2.0, 2.0, 14.0 ] } + } + }, + { + "name": "Cube", + "from": [ 15.0, 2.0, 14.0 ], + "to": [ 16.0, 14.0, 16.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 0.0, 2.0, 1.0, 14.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 2.0, 2.0, 14.0 ] }, + "south": { "texture": "#0", "uv": [ 15.0, 2.0, 16.0, 14.0 ] }, + "west": { "texture": "#0", "uv": [ 14.0, 2.0, 16.0, 14.0 ] } + } + }, + { + "name": "Cube", + "from": [ 0.0, 2.0, 14.0 ], + "to": [ 1.0, 14.0, 16.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 14.0, 2.0, 15.0, 14.0 ] }, + "east": { "texture": "#0", "uv": [ 0.0, 2.0, 2.0, 14.0 ] }, + "south": { "texture": "#0", "uv": [ 0.0, 2.0, 1.0, 14.0 ] }, + "west": { "texture": "#0", "uv": [ 14.0, 2.0, 16.0, 14.0 ] } + } + }, + { + "name": "Cube", + "from": [ 1.0, 2.0, 0.0 ], + "to": [ 2.0, 14.0, 1.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 14.0, 2.0, 15.0, 14.0 ] }, + "east": { "texture": "#0", "uv": [ 14.0, 2.0, 15.0, 14.0 ] }, + "south": { "texture": "#0", "uv": [ 1.0, 2.0, 2.0, 14.0 ] } + } + }, + { + "name": "Cube", + "from": [ 14.0, 2.0, 0.0 ], + "to": [ 15.0, 14.0, 1.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 1.0, 2.0, 2.0, 14.0 ] }, + "south": { "texture": "#0", "uv": [ 14.0, 2.0, 15.0, 14.0 ] }, + "west": { "texture": "#0", "uv": [ 0.0, 2.0, 1.0, 14.0 ] } + } + }, + { + "name": "Cube", + "from": [ 14.0, 2.0, 15.0 ], + "to": [ 15.0, 14.0, 16.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 1.0, 2.0, 2.0, 14.0 ] }, + "south": { "texture": "#0", "uv": [ 14.0, 2.0, 15.0, 14.0 ] }, + "west": { "texture": "#0", "uv": [ 1.0, 2.0, 2.0, 14.0 ] } + } + }, + { + "name": "Cube", + "from": [ 1.0, 2.0, 15.0 ], + "to": [ 2.0, 14.0, 16.0 ], + "faces": { + "north": { "texture": "#0", "uv": [ 14.0, 2.0, 15.0, 14.0 ] }, + "east": { "texture": "#0", "uv": [ 14.0, 2.0, 15.0, 14.0 ] }, + "south": { "texture": "#0", "uv": [ 1.0, 2.0, 5.0, 1.0 ] } + } + }, + { + "name": "Cube", + "from": [ 3.0, 3.0, 1.0 ], + "to": [ 13.0, 13.0, 2.0 ], + "faces": { + "north": { "texture": "#1", "uv": [ 3.0, 3.0, 13.0, 13.0 ] }, + "east": { "texture": "#1", "uv": [ 2.0, 3.0, 3.0, 13.0 ] }, + "south": { "texture": "#1", "uv": [ 3.0, 3.0, 13.0, 13.0 ] }, + "west": { "texture": "#1", "uv": [ 13.0, 3.0, 14.0, 13.0 ] }, + "up": { "texture": "#1", "uv": [ 3.0, 2.0, 13.0, 3.0 ] }, + "down": { "texture": "#1", "uv": [ 3.0, 13.0, 13.0, 14.0 ] } + } + }, + { + "name": "Cube", + "from": [ 3.0, 3.0, 14.0 ], + "to": [ 13.0, 13.0, 15.0 ], + "faces": { + "north": { "texture": "#1", "uv": [ 3.0, 3.0, 13.0, 13.0 ] }, + "east": { "texture": "#1", "uv": [ 2.0, 3.0, 3.0, 13.0 ] }, + "south": { "texture": "#1", "uv": [ 3.0, 3.0, 13.0, 13.0 ] }, + "west": { "texture": "#1", "uv": [ 13.0, 3.0, 14.0, 13.0 ] }, + "up": { "texture": "#1", "uv": [ 3.0, 2.0, 13.0, 3.0 ] }, + "down": { "texture": "#1", "uv": [ 3.0, 13.0, 13.0, 14.0 ] } + } + }, + { + "name": "Cube", + "from": [ 1.0, 3.0, 3.0 ], + "to": [ 2.0, 13.0, 13.0 ], + "faces": { + "north": { "texture": "#1", "uv": [ 13.0, 3.0, 14.0, 13.0 ] }, + "east": { "texture": "#1", "uv": [ 3.0, 3.0, 13.0, 13.0 ] }, + "south": { "texture": "#1", "uv": [ 2.0, 3.0, 3.0, 13.0 ] }, + "west": { "texture": "#1", "uv": [ 3.0, 3.0, 13.0, 13.0 ] }, + "up": { "texture": "#1", "uv": [ 13.0, 3.0, 14.0, 13.0 ] }, + "down": { "texture": "#1", "uv": [ 2.0, 3.0, 3.0, 13.0 ] } + } + }, + { + "name": "Cube", + "from": [ 14.0, 3.0, 3.0 ], + "to": [ 15.0, 13.0, 13.0 ], + "faces": { + "north": { "texture": "#1", "uv": [ 13.0, 3.0, 14.0, 13.0 ] }, + "east": { "texture": "#1", "uv": [ 3.0, 3.0, 13.0, 13.0 ] }, + "south": { "texture": "#1", "uv": [ 2.0, 3.0, 3.0, 13.0 ] }, + "west": { "texture": "#1", "uv": [ 3.0, 3.0, 13.0, 13.0 ] }, + "up": { "texture": "#1", "uv": [ 13.0, 3.0, 14.0, 13.0 ] }, + "down": { "texture": "#1", "uv": [ 2.0, 3.0, 3.0, 13.0 ] } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/galacticraftcore/models/item/emergency_box.json b/src/main/resources/assets/galacticraftcore/models/item/emergency_box.json new file mode 100644 index 0000000000..0d3cec7ae6 --- /dev/null +++ b/src/main/resources/assets/galacticraftcore/models/item/emergency_box.json @@ -0,0 +1,10 @@ +{ + "parent":"galacticraftcore:block/emergency_box", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/galacticraftcore/models/item/emergency_box_full.json b/src/main/resources/assets/galacticraftcore/models/item/emergency_box_full.json new file mode 100644 index 0000000000..d5b512c5cd --- /dev/null +++ b/src/main/resources/assets/galacticraftcore/models/item/emergency_box_full.json @@ -0,0 +1,10 @@ +{ + "parent":"galacticraftcore:block/emergency_box_filled", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/galacticraftcore/textures/blocks/emergency_box.png b/src/main/resources/assets/galacticraftcore/textures/blocks/emergency_box.png new file mode 100644 index 0000000000..2d57190e52 Binary files /dev/null and b/src/main/resources/assets/galacticraftcore/textures/blocks/emergency_box.png differ diff --git a/src/main/resources/assets/galacticraftcore/textures/blocks/emergency_box_flap.png b/src/main/resources/assets/galacticraftcore/textures/blocks/emergency_box_flap.png new file mode 100644 index 0000000000..23167e793d Binary files /dev/null and b/src/main/resources/assets/galacticraftcore/textures/blocks/emergency_box_flap.png differ diff --git a/src/main/resources/assets/galacticraftplanets/lang/th_TH.lang b/src/main/resources/assets/galacticraftplanets/lang/th_TH.lang index 3d7de7be84..5383313586 100644 --- a/src/main/resources/assets/galacticraftplanets/lang/th_TH.lang +++ b/src/main/resources/assets/galacticraftplanets/lang/th_TH.lang @@ -49,6 +49,7 @@ gas.oxygen.name=ออกซิเจน gc.configgui.astro_miners_max=จำนวนสูงสุดของแอสโทรไมเนอร์ต่อผู้เล่น gc.configgui.dimension_id_asteroids=ID มิติดาวเคราะห์น้อย gc.configgui.dimension_id_mars=ID มิติดาวอังคาร +gc.configgui.dimension_id_venus=ID มิติดาวศุกร์ gc.configgui.disable_aluminum_gen_asteroids=ปิดใช้งานการเจนเนอเรทแร่อลูมิเนียม (ดาวเคราะห์น้อย) gc.configgui.disable_ambient_lightning=ปิดใช้งานฟ้าแลบบนดาวศุกร์ gc.configgui.disable_copper_gen_mars=ปิดใช้งานการเจนเนอเรทแร่ทองแดง (ดาวอังคาร)