Merge pull request #2194 from abel1502/abel-misc-tweaks-2025-06

QoL changes in bulk
This commit is contained in:
HbmMods 2025-06-09 15:34:13 +02:00 committed by GitHub
commit 6b28649094
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
65 changed files with 797 additions and 203 deletions

View File

@ -68,9 +68,6 @@ public class BlockOre extends Block {
if(this == ModBlocks.ore_nether_fire) {
return rand.nextInt(10) == 0 ? ModItems.ingot_phosphorus : ModItems.powder_fire;
}
if(this == ModBlocks.block_meteor) {
return rand.nextInt(10) == 0 ? ModItems.plate_dalekanium : Item.getItemFromBlock(ModBlocks.block_meteor);
}
if(this == ModBlocks.block_meteor_cobble) {
return ModItems.fragment_meteorite;
}

View File

@ -6,6 +6,7 @@ import java.util.List;
import java.util.Random;
import com.hbm.blocks.IBlockMulti;
import com.hbm.blocks.ILookOverlay;
import com.hbm.blocks.ITooltipProvider;
import com.hbm.blocks.ModBlocks;
import com.hbm.config.ServerConfig;
@ -39,8 +40,9 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
public class BlockStorageCrate extends BlockContainer implements IBlockMulti, ITooltipProvider {
public class BlockStorageCrate extends BlockContainer implements IBlockMulti, ILookOverlay, ITooltipProvider {
@SideOnly(Side.CLIENT)
private IIcon iconTop;
@ -152,14 +154,28 @@ public class BlockStorageCrate extends BlockContainer implements IBlockMulti, IT
}
}
if(inv instanceof TileEntityCrateBase)
nbt.setBoolean("spiders", ((TileEntityCrateBase) inv).hasSpiders);
if(inv instanceof TileEntityCrateBase) {
TileEntityCrateBase crate = (TileEntityCrateBase) inv;
// Saves memory and ensures consistency between crafted crates and mined ones
if (crate.hasSpiders) {
nbt.setBoolean("spiders", true);
}
}
if(!nbt.hasNoTags()) {
drop.stackTagCompound = nbt;
}
if(inv instanceof TileEntityCrateBase) {
TileEntityCrateBase crate = (TileEntityCrateBase) inv;
if (crate.hasCustomInventoryName()) {
drop.setStackDisplayName(crate.getInventoryName());
}
}
if (drop.hasTagCompound()) {
try {
byte[] abyte = CompressedStreamTools.compress(nbt);
byte[] abyte = CompressedStreamTools.compress(drop.stackTagCompound);
if(abyte.length > 6000) {
player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.RED + "Warning: Container NBT exceeds 6kB, contents will be ejected!"));
@ -220,8 +236,14 @@ public class BlockStorageCrate extends BlockContainer implements IBlockMulti, IT
lockable.lock();
}
}
if(inv instanceof TileEntityCrateBase) {
((TileEntityCrateBase) inv).hasSpiders = stack.stackTagCompound.getBoolean("spiders");
TileEntityCrateBase crate = (TileEntityCrateBase) inv;
crate.hasSpiders = stack.stackTagCompound.getBoolean("spiders");
if (stack.hasDisplayName()) {
crate.setCustomName(stack.getDisplayName());
}
}
}
@ -354,4 +376,20 @@ public class BlockStorageCrate extends BlockContainer implements IBlockMulti, IT
}
}
}
@Override
public void printHook(RenderGameOverlayEvent.Pre event, World world, int x, int y, int z) {
TileEntity te = world.getTileEntity(x, y, z);
if (!(te instanceof IInventory))
return;
IInventory inv = (IInventory) te;
if (!inv.hasCustomInventoryName())
return;
ILookOverlay.printGeneric(event, inv.getInventoryName(), 0xffff00, 0x404000, new ArrayList<String>(0));
}
}

View File

@ -5,6 +5,7 @@ import java.util.List;
import org.lwjgl.opengl.GL11;
import com.hbm.blocks.BlockEnumMulti;
import com.hbm.extprop.HbmPlayerProps;
import com.hbm.render.block.ISBRHUniversal;
import com.hbm.render.util.RenderBlocksNT;
import com.hbm.util.EnumUtil;
@ -16,6 +17,7 @@ import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
@ -53,7 +55,7 @@ public class BlockWoodStructure extends BlockEnumMulti implements ISBRHUniversal
EnumWoodStructure type = EnumUtil.grabEnumSafely(EnumWoodStructure.class, world.getBlockMetadata(x, y, z));
setBlockBounds(0, 0, 0, 1, 1, 1);
if(type == type.ROOF) setBlockBounds(0F, 0F, 0F, 1F, 0.1875F, 1F);
if(type == type.SCAFFOLD) setBlockBounds(0F, 0F, 0F, 1F, 1F, 1F);
if(type == type.SCAFFOLD) setBlockBounds(0.0625F, 0F, 0.0625F, 1F - 0.0625F, 1F, 1F - 0.0625F);
if(type == type.CEILING) setBlockBounds(0F, 0.875F, 0F, 1F, 1F, 1F);
}
@ -63,6 +65,21 @@ public class BlockWoodStructure extends BlockEnumMulti implements ISBRHUniversal
super.addCollisionBoxesToList(world, x, y, z, aabb, list, collider);
}
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
setBlockBoundsBasedOnState(world, x, y, z);
return super.getCollisionBoundingBoxFromPool(world, x, y, z);
}
public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int i, int j, int k) {
int meta = world.getBlockMetadata(i, j, k);
EnumWoodStructure type = EnumUtil.grabEnumSafely(EnumWoodStructure.class, meta);
if (type == type.SCAFFOLD) return AxisAlignedBB.getBoundingBox(i, j, k, i + 1, j + 1, k + 1);
return super.getSelectedBoundingBoxFromPool(world, i, j, k);
}
@Override
public void renderInventoryBlock(Block block, int meta, int modelId, Object renderBlocks) {
@ -149,4 +166,18 @@ public class BlockWoodStructure extends BlockEnumMulti implements ISBRHUniversal
return true;
}
@Override
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) {
if (entity instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) entity;
int meta = world.getBlockMetadata(x, y, z);
EnumWoodStructure type = EnumUtil.grabEnumSafely(EnumWoodStructure.class,meta);
if (type != type.SCAFFOLD) return;
HbmPlayerProps props = HbmPlayerProps.getData(player);
props.isOnLadder = true;
}
}
}

View File

@ -10,6 +10,7 @@ import com.hbm.items.machine.IItemFluidIdentifier;
import com.hbm.tileentity.machine.TileEntityMachineAutosaw;
import com.hbm.util.i18n.I18nUtil;
import api.hbm.block.IToolable;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
@ -22,7 +23,7 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
public class MachineAutosaw extends BlockContainer implements ILookOverlay, ITooltipProvider {
public class MachineAutosaw extends BlockContainer implements ILookOverlay, ITooltipProvider, IToolable {
public MachineAutosaw() {
super(Material.iron);
@ -72,6 +73,24 @@ public class MachineAutosaw extends BlockContainer implements ILookOverlay, IToo
return true;
}
@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.SCREWDRIVER)
return false;
TileEntity te = world.getTileEntity(x, y, z);
if(!(te instanceof TileEntityMachineAutosaw))
return false;
TileEntityMachineAutosaw saw = (TileEntityMachineAutosaw) te;
saw.isSuspended = !saw.isSuspended;
saw.markDirty();
return true;
}
@Override
public void printHook(Pre event, World world, int x, int y, int z) {
@ -85,6 +104,10 @@ public class MachineAutosaw extends BlockContainer implements ILookOverlay, IToo
List<String> text = new ArrayList();
text.add(saw.tank.getTankType().getLocalizedName() + ": " + saw.tank.getFill() + "/" + saw.tank.getMaxFill() + "mB");
if (saw.isSuspended) {
text.add(EnumChatFormatting.RED + "! " + I18nUtil.resolveKey(getUnlocalizedName() + ".suspended") + " !");
}
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
}

View File

@ -3,11 +3,17 @@ package com.hbm.blocks.machine;
import java.util.List;
import com.hbm.blocks.ITooltipProvider;
import com.hbm.main.MainRegistry;
import com.hbm.packet.PacketDispatcher;
import com.hbm.packet.toclient.PlayerInformPacket;
import com.hbm.tileentity.TileEntityLoadedBase;
import com.hbm.util.ChatBuilder;
import api.hbm.block.IBlowable;
import api.hbm.block.IToolable;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import io.netty.buffer.ByteBuf;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.BlockPistonBase;
@ -15,9 +21,12 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
@ -65,10 +74,11 @@ public class MachineFan extends BlockContainer implements IToolable, ITooltipPro
return false;
}
public static class TileEntityFan extends TileEntity {
public static class TileEntityFan extends TileEntityLoadedBase {
public float spin;
public float prevSpin;
public boolean falloff = true;
@Override
public void updateEntity() {
@ -104,9 +114,16 @@ public class MachineFan extends BlockContainer implements IToolable, ITooltipPro
for(Entity e : affected) {
e.motionX += dir.offsetX * push;
e.motionY += dir.offsetY * push;
e.motionZ += dir.offsetZ * push;
double coeff = push;
if(!falloff) {
double dist = e.getDistance(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5);
coeff *= 1.5 * (1 - dist / range / 2);
}
e.motionX += dir.offsetX * coeff;
e.motionY += dir.offsetY * coeff;
e.motionZ += dir.offsetZ * coeff;
}
if(worldObj.isRemote && worldObj.rand.nextInt(30) == 0) {
@ -121,6 +138,10 @@ public class MachineFan extends BlockContainer implements IToolable, ITooltipPro
this.prevSpin -= 360;
this.spin -= 360;
}
if(!worldObj.isRemote) {
networkPackNT(150);
}
}
@Override
@ -128,11 +149,33 @@ public class MachineFan extends BlockContainer implements IToolable, ITooltipPro
public double getMaxRenderDistanceSquared() {
return 65536.0D;
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
this.falloff = nbt.getBoolean("falloff");
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setBoolean("falloff", falloff);
}
@Override
public void serialize(ByteBuf buf) {
buf.writeBoolean(falloff);
}
@Override
public void deserialize(ByteBuf buf) {
falloff = buf.readBoolean();
}
}
@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.SCREWDRIVER) return false;
if(tool == ToolType.SCREWDRIVER) {
int meta = world.getBlockMetadata(x, y, z);
if(meta == 0) world.setBlockMetadataWithNotify(x, y, z, 1, 3);
@ -145,6 +188,26 @@ public class MachineFan extends BlockContainer implements IToolable, ITooltipPro
return true;
}
if(tool == ToolType.HAND_DRILL) {
TileEntityFan tile = (TileEntityFan) world.getTileEntity(x, y, z);
if(tile != null) {
tile.falloff = !tile.falloff;
tile.markDirty();
if(!world.isRemote) {
PacketDispatcher.wrapper.sendTo(new PlayerInformPacket(ChatBuilder.start("").nextTranslation(this.getUnlocalizedName() + (tile.falloff ? ".falloffOn" : ".falloffOff")).color(EnumChatFormatting.GOLD).flush(), MainRegistry.proxy.ID_FAN_MODE), (EntityPlayerMP) player);
world.playSoundEffect(x + 0.5, y + 0.5, z + 0.5, "random.click", 0.5F, 0.5F);
}
}
return true;
}
return false;
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
this.addStandardInfo(stack, player, list, ext);

View File

@ -5,15 +5,23 @@ import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class SlotPattern extends Slot {
protected boolean canHover = true;
protected boolean allowStackSize = false;
public SlotPattern(IInventory inv, int index, int x, int y) {
super(inv, index, x, y);
}
public SlotPattern(IInventory inv, int index, int x, int y, boolean allowStackSize) {
super(inv, index, x, y);
this.allowStackSize = allowStackSize;
}
@Override
public boolean canTakeStack(EntityPlayer player) {
return false;
@ -24,6 +32,17 @@ public class SlotPattern extends Slot {
return 1;
}
@Override
public void putStack(ItemStack stack) {
if (stack != null) {
stack = stack.copy();
if (!allowStackSize)
stack.stackSize = 1;
}
super.putStack(stack);
}
public SlotPattern disableHover() {
this.canHover = false;
return this;

View File

@ -24,7 +24,7 @@ public class ContainerAutocrafter extends ContainerBase {
this.addSlotToContainer(new SlotPattern(tedf, j + i * 3, 44 + j * 18, 22 + i * 18));
}
}
this.addSlotToContainer(new SlotPattern(tedf, 9, 116, 40));
this.addSlotToContainer(new SlotPattern(tedf, 9, 116, 40, true));
/* RECIPE */
addSlots(tedf,10, 44, 86, 3, 3);
@ -74,13 +74,7 @@ public class ContainerAutocrafter extends ContainerBase {
} else {
slot.putStack(held != null ? held.copy() : null);
if(slot.getHasStack()) {
slot.getStack().stackSize = 1;
}
slot.onSlotChanged();
slot.putStack(held);
autocrafter.matcher.initPatternSmart(autocrafter.getWorldObj(), slot.getStack(), index);
autocrafter.updateTemplateGrid();

View File

@ -66,13 +66,7 @@ public class ContainerCartDestroyer extends Container {
if(slot.getHasStack())
ret = slot.getStack().copy();
slot.putStack(held != null ? held.copy() : null);
if(slot.getHasStack()) {
slot.getStack().stackSize = 1;
}
slot.onSlotChanged();
slot.putStack(held);
return ret;
}

View File

@ -48,13 +48,7 @@ public class ContainerCounterTorch extends ContainerBase {
return ret;
} else {
slot.putStack(held != null ? held.copy() : null);
if(slot.getHasStack()) {
slot.getStack().stackSize = 1;
}
slot.onSlotChanged();
slot.putStack(held);
radio.matcher.initPatternStandard(radio.getWorldObj(), slot.getStack(), index);
return ret;

View File

@ -105,13 +105,7 @@ public class ContainerCraneExtractor extends ContainerBase {
return ret;
} else {
slot.putStack(held != null ? held.copy() : null);
if(slot.getHasStack()) {
slot.getStack().stackSize = 1;
}
slot.onSlotChanged();
slot.putStack(held);
extractor.matcher.initPatternStandard(extractor.getWorldObj(), slot.getStack(), index);
return ret;

View File

@ -100,13 +100,7 @@ public class ContainerCraneGrabber extends ContainerBase {
return ret;
} else {
slot.putStack(held != null ? held.copy() : null);
if(slot.getHasStack()) {
slot.getStack().stackSize = 1;
}
slot.onSlotChanged();
slot.putStack(held);
grabber.matcher.initPatternStandard(grabber.getWorldObj(), slot.getStack(), index);
return ret;

View File

@ -52,13 +52,7 @@ public class ContainerCraneRouter extends ContainerBase {
} else {
slot.putStack(held != null ? held.copy() : null);
if(slot.getHasStack()) {
slot.getStack().stackSize = 1;
}
slot.onSlotChanged();
slot.putStack(held);
router.initPattern(slot.getStack(), index);
return ret;

View File

@ -85,13 +85,7 @@ public class ContainerDroneRequester extends ContainerCrateBase {
return ret;
} else {
slot.putStack(held != null ? held.copy() : null);
if(slot.getHasStack()) {
slot.getStack().stackSize = 1;
}
slot.onSlotChanged();
slot.putStack(held);
requester.matcher.initPatternStandard(requester.getWorldObj(), slot.getStack(), index);
return ret;

View File

@ -94,13 +94,7 @@ public class ContainerMachineCustom extends Container {
} else {
slot.putStack(held != null ? held.copy() : null);
if(slot.getHasStack()) {
slot.getStack().stackSize = 1;
}
slot.onSlotChanged();
slot.putStack(held);
custom.matcher.initPatternSmart(player.worldObj, slot.getStack(), index - 10);
return ret;

View File

@ -27,32 +27,40 @@ public class ContainerMassStorage extends ContainerBase {
}
@Override
public ItemStack transferStackInSlot(EntityPlayer player, int par2) {
ItemStack var3 = null;
Slot var4 = (Slot) this.inventorySlots.get(par2);
public ItemStack transferStackInSlot(EntityPlayer player, int index) {
ItemStack result = null;
Slot slot = (Slot) this.inventorySlots.get(index);
if(var4 != null && var4.getHasStack()) {
ItemStack var5 = var4.getStack();
var3 = var5.copy();
if(par2 == 0 || par2 == 2) {
if(!this.mergeItemStack(var5, storage.getSizeInventory(), this.inventorySlots.size(), true)) {
return null;
}
} else if(!this.mergeItemStack(var5, 0, 1, false)) {
return null;
// Refill instantly if needed, then do regular slot behavior
if(index == 2 && slot != null && !slot.getHasStack()) {
slot.putStack(storage.quickExtract());
}
if(var5.stackSize == 0) {
var4.putStack((ItemStack) null);
if(slot != null && slot.getHasStack()) {
ItemStack initial = slot.getStack();
result = initial.copy();
if(index == 0 || index == 2) {
if(!this.mergeItemStack(initial, storage.getSizeInventory(), this.inventorySlots.size(), true)) {
return null;
}
} else {
var4.onSlotChanged();
// Try to insert instantly, then fall back to regular slot behavior
if(!storage.quickInsert(initial) && !this.mergeItemStack(initial, 0, 1, false)) {
return null;
}
}
var4.onPickupFromSlot(player, var5);
if(initial.stackSize == 0) {
slot.putStack((ItemStack) null);
} else {
slot.onSlotChanged();
}
return var3;
slot.onPickupFromSlot(player, initial);
}
return result;
}
@Override
@ -79,13 +87,7 @@ public class ContainerMassStorage extends ContainerBase {
if(storage.getStockpile() > 0)
return ret;
slot.putStack(held != null ? held.copy() : null);
if(slot.getHasStack()) {
slot.getStack().stackSize = 1;
}
slot.onSlotChanged();
slot.putStack(held);
return ret;
}

View File

@ -39,9 +39,7 @@ public class ContainerPneumoTube extends ContainerBase {
tube.nextMode(index);
return ret;
} else {
slot.putStack(held != null ? held.copy() : null);
if(slot.getHasStack()) slot.getStack().stackSize = 1;
slot.onSlotChanged();
slot.putStack(held);
tube.initPattern(slot.getStack(), index);
return ret;
}

View File

@ -6,6 +6,7 @@ import java.util.List;
import java.util.Locale;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
@ -153,6 +154,7 @@ public class GUIScreenTemplateFolder extends GuiScreen {
return (int) Math.ceil((stacks.size() - 1) / (5 * 7));
}
@Override
public void updateScreen() {
if(currentPage < 0)
currentPage = 0;
@ -160,6 +162,7 @@ public class GUIScreenTemplateFolder extends GuiScreen {
currentPage = getPageCount();
}
@Override
public void drawScreen(int mouseX, int mouseY, float f) {
this.drawDefaultBackground();
this.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
@ -168,6 +171,7 @@ public class GUIScreenTemplateFolder extends GuiScreen {
GL11.glEnable(GL11.GL_LIGHTING);
}
@Override
public void initGui() {
super.initGui();
this.guiLeft = (this.width - this.xSize) / 2;
@ -204,6 +208,26 @@ public class GUIScreenTemplateFolder extends GuiScreen {
buttons.add(new FolderButton(guiLeft + 25 + (27 * 4) + 18, guiTop + 26 + (27 * 3), 2, "Next"));
}
@Override
public void handleMouseInput() {
super.handleMouseInput();
if(Mouse.getEventButton() == -1) {
int scroll = Mouse.getEventDWheel();
if(scroll < 0) {
if(currentPage > 0)
currentPage--;
updateButtons();
} else if(scroll > 0) {
if(currentPage < getPageCount())
currentPage++;
updateButtons();
}
}
}
@Override
protected void mouseClicked(int i, int j, int k) {
if(i >= guiLeft + 45 && i < guiLeft + 117 && j >= guiTop + 211 && j < guiTop + 223) {
@ -251,6 +275,7 @@ public class GUIScreenTemplateFolder extends GuiScreen {
search.drawTextBox();
}
@Override
protected void keyTyped(char p_73869_1_, int p_73869_2_) {
if (this.search.textboxKeyTyped(p_73869_1_, p_73869_2_)) {

View File

@ -38,7 +38,10 @@ public abstract class ItemInventory implements IInventory {
}
public NBTTagCompound checkNBT(NBTTagCompound nbt) {
if(nbt != null && !nbt.hasNoTags()) {
if(nbt == null || nbt.hasNoTags())
return null;
Random random = new Random();
try {
@ -77,10 +80,10 @@ public abstract class ItemInventory implements IInventory {
}
}
return new NBTTagCompound(); // Reset.
return null; // Reset.
}
} catch (IOException ignored) {}
}
return nbt;
}

View File

@ -122,7 +122,11 @@ public class ItemBlockStorageCrate extends ItemBlockBase implements IGUIProvider
@Override
public String getInventoryName() {
return findCrateType(target.getItem()).getInventoryName();
TileEntityCrateBase tile = findCrateType(target.getItem());
if (hasCustomInventoryName()) {
tile.setCustomName(target.getDisplayName());
}
return tile.getInventoryName();
}
@Override
@ -150,6 +154,10 @@ public class ItemBlockStorageCrate extends ItemBlockBase implements IGUIProvider
nbt.setTag("slot" + i, slot);
}
if (nbt.hasNoTags()) {
nbt = null;
}
target.setTagCompound(nbt);
}

View File

@ -98,6 +98,7 @@ import net.minecraft.util.*;
import net.minecraft.world.World;
import net.minecraftforge.common.util.FakePlayer;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.event.AnvilUpdateEvent;
import net.minecraftforge.event.CommandEvent;
import net.minecraftforge.event.ServerChatEvent;
import net.minecraftforge.event.entity.EntityEvent;
@ -107,6 +108,7 @@ import net.minecraftforge.event.entity.item.ItemTossEvent;
import net.minecraftforge.event.entity.living.*;
import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent;
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
import net.minecraftforge.event.entity.player.AnvilRepairEvent;
import net.minecraftforge.event.entity.player.AttackEntityEvent;
import net.minecraftforge.event.entity.player.PlayerFlyableFallEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
@ -1248,6 +1250,26 @@ public class ModEventHandler {
}
}
@SubscribeEvent
public void onAnvilRepair(AnvilRepairEvent event) {
// Anvil renaming no longer increments the repair cost
// Note: Forge has a bug, the names are wrong. Right is output, output is left, left is right
if(event.left == null && event.right != null && event.output != null) {
int oldRepairCost = event.output.getRepairCost();
if (oldRepairCost > 0) {
event.right.setRepairCost(oldRepairCost);
} else if (event.right.hasTagCompound()) {
NBTTagCompound nbt = event.right.getTagCompound();
nbt.removeTag("RepairCost");
if (nbt.hasNoTags()) {
event.right.setTagCompound(null);
}
}
}
}
@SubscribeEvent
public void onClickSign(PlayerInteractEvent event) {

View File

@ -68,6 +68,7 @@ import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.InputEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent;
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent;
@ -86,6 +87,7 @@ import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.RenderPlayer;
import net.minecraft.client.settings.GameSettings;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
@ -1098,6 +1100,28 @@ public class ModEventHandlerClient {
}
}
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onPlayerTick(TickEvent.PlayerTickEvent event) {
EntityPlayer player = event.player;
int x = MathHelper.floor_double(player.posX);
int y = MathHelper.floor_double(player.posY);
int z = MathHelper.floor_double(player.posZ);
Block b = player.worldObj.getBlock(x, y, z);
// Support climbing freestanding vines and chains using spacebar
if (
b.isLadder(player.worldObj, x, y, z, player) &&
b.getCollisionBoundingBoxFromPool(player.worldObj, x, y, z) == null &&
!player.capabilities.isFlying &&
GameSettings.isKeyDown(Minecraft.getMinecraft().gameSettings.keyBindJump) &&
player.motionY < 0.15
) {
player.motionY = 0.15;
}
}
@SideOnly(Side.CLIENT)
@SubscribeEvent(priority = EventPriority.LOW)
public void onMouseClicked(InputEvent.MouseInputEvent event) {

View File

@ -30,9 +30,10 @@ public class ServerProxy {
public static final int ID_HUD = 7;
public static final int ID_DETONATOR = 8;
public static final int ID_FLUID_ID = 9;
public static final int ID_TOOLABILITY = 10;
public static final int ID_GUN_MODE = 11;
public static final int ID_GAS_HAZARD = 12;
public static final int ID_FAN_MODE = 10;
public static final int ID_TOOLABILITY = 11;
public static final int ID_GUN_MODE = 12;
public static final int ID_GAS_HAZARD = 13;
public ITranslate getI18n() { return I18N; }

View File

@ -62,6 +62,7 @@ public abstract class TileEntityInventoryBase extends TileEntity implements ISid
public void setCustomName(String name) {
this.customName = name;
markDirty();
}
@Override
@ -145,6 +146,8 @@ public abstract class TileEntityInventoryBase extends TileEntity implements ISid
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
}
}
customName = nbt.getString("name");
}
@Override
@ -163,5 +166,9 @@ public abstract class TileEntityInventoryBase extends TileEntity implements ISid
}
}
nbt.setTag("items", list);
if (customName != null) {
nbt.setString("name", customName);
}
}
}

View File

@ -71,6 +71,7 @@ public abstract class TileEntityMachineBase extends TileEntityLoadedBase impleme
public void setCustomName(String name) {
this.customName = name;
markDirty();
}
@Override
@ -161,6 +162,8 @@ public abstract class TileEntityMachineBase extends TileEntityLoadedBase impleme
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
}
}
customName = nbt.getString("name");
}
@Override
@ -179,6 +182,10 @@ public abstract class TileEntityMachineBase extends TileEntityLoadedBase impleme
}
}
nbt.setTag("items", list);
if (customName != null) {
nbt.setString("name", customName);
}
}
public void updateRedstoneConnection(DirPos pos) {

View File

@ -94,6 +94,7 @@ public class TileEntityBombMulti extends TileEntity implements ISidedInventory,
public void setCustomName(String name) {
this.customName = name;
markDirty();
}
@Override
@ -156,6 +157,8 @@ public class TileEntityBombMulti extends TileEntity implements ISidedInventory,
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
}
}
customName = nbt.getString("name");
}
@Override
@ -174,6 +177,10 @@ public class TileEntityBombMulti extends TileEntity implements ISidedInventory,
}
}
nbt.setTag("items", list);
if (customName != null) {
nbt.setString("name", customName);
}
}
public boolean isLoaded(){

View File

@ -109,6 +109,7 @@ public class TileEntityCompactLauncher extends TileEntityLoadedBase implements I
public void setCustomName(String name) {
this.customName = name;
markDirty();
}
@Override
@ -523,6 +524,8 @@ public class TileEntityCompactLauncher extends TileEntityLoadedBase implements I
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
}
}
customName = nbt.getString("name");
}
@Override
@ -545,6 +548,10 @@ public class TileEntityCompactLauncher extends TileEntityLoadedBase implements I
}
}
nbt.setTag("items", list);
if (customName != null) {
nbt.setString("name", customName);
}
}
@Override

View File

@ -118,6 +118,7 @@ public class TileEntityLaunchTable extends TileEntityLoadedBase implements ISide
public void setCustomName(String name) {
this.customName = name;
markDirty();
}
@Override
@ -520,6 +521,8 @@ public class TileEntityLaunchTable extends TileEntityLoadedBase implements ISide
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
}
}
customName = nbt.getString("name");
}
@Override
@ -543,6 +546,10 @@ public class TileEntityLaunchTable extends TileEntityLoadedBase implements ISide
}
}
nbt.setTag("items", list);
if (customName != null) {
nbt.setString("name", customName);
}
}
@Override

View File

@ -92,6 +92,7 @@ public class TileEntityNukeBoy extends TileEntity implements ISidedInventory, IG
public void setCustomName(String name) {
this.customName = name;
markDirty();
}
@Override
@ -154,6 +155,8 @@ public class TileEntityNukeBoy extends TileEntity implements ISidedInventory, IG
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
}
}
customName = nbt.getString("name");
}
@Override
@ -172,6 +175,10 @@ public class TileEntityNukeBoy extends TileEntity implements ISidedInventory, IG
}
}
nbt.setTag("items", list);
if (customName != null) {
nbt.setString("name", customName);
}
}
public boolean isReady() {

View File

@ -98,6 +98,7 @@ public class TileEntityNukeCustom extends TileEntity implements ISidedInventory,
public void setCustomName(String name) {
this.customName = name;
markDirty();
}
@Override
@ -161,6 +162,8 @@ public class TileEntityNukeCustom extends TileEntity implements ISidedInventory,
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
}
}
customName = nbt.getString("name");
}
@Override
@ -180,6 +183,10 @@ public class TileEntityNukeCustom extends TileEntity implements ISidedInventory,
}
}
nbt.setTag("items", list);
if (customName != null) {
nbt.setString("name", customName);
}
}
public static HashMap<ComparableStack, CustomNukeEntry> entries = new HashMap();

View File

@ -92,6 +92,7 @@ public class TileEntityNukeFleija extends TileEntity implements ISidedInventory,
public void setCustomName(String name) {
this.customName = name;
markDirty();
}
@Override
@ -154,6 +155,8 @@ public class TileEntityNukeFleija extends TileEntity implements ISidedInventory,
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
}
}
customName = nbt.getString("name");
}
@Override
@ -172,6 +175,10 @@ public class TileEntityNukeFleija extends TileEntity implements ISidedInventory,
}
}
nbt.setTag("items", list);
if (customName != null) {
nbt.setString("name", customName);
}
}
public boolean isReady() {

View File

@ -92,6 +92,7 @@ public class TileEntityNukeGadget extends TileEntity implements ISidedInventory,
public void setCustomName(String name) {
this.customName = name;
markDirty();
}
@Override
@ -154,6 +155,8 @@ public class TileEntityNukeGadget extends TileEntity implements ISidedInventory,
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
}
}
customName = nbt.getString("name");
}
@Override
@ -172,6 +175,10 @@ public class TileEntityNukeGadget extends TileEntity implements ISidedInventory,
}
}
nbt.setTag("items", list);
if (customName != null) {
nbt.setString("name", customName);
}
}
/*public int getNukeTier() {

View File

@ -92,6 +92,7 @@ public class TileEntityNukeMan extends TileEntity implements ISidedInventory, IG
public void setCustomName(String name) {
this.customName = name;
markDirty();
}
@Override
@ -154,6 +155,8 @@ public class TileEntityNukeMan extends TileEntity implements ISidedInventory, IG
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
}
}
customName = nbt.getString("name");
}
@Override
@ -172,6 +175,10 @@ public class TileEntityNukeMan extends TileEntity implements ISidedInventory, IG
}
}
nbt.setTag("items", list);
if (customName != null) {
nbt.setString("name", customName);
}
}
public boolean exp1() {

View File

@ -92,6 +92,7 @@ public class TileEntityNukeMike extends TileEntity implements ISidedInventory, I
public void setCustomName(String name) {
this.customName = name;
markDirty();
}
@Override
@ -154,6 +155,8 @@ public class TileEntityNukeMike extends TileEntity implements ISidedInventory, I
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
}
}
customName = nbt.getString("name");
}
@Override
@ -172,6 +175,10 @@ public class TileEntityNukeMike extends TileEntity implements ISidedInventory, I
}
}
nbt.setTag("items", list);
if (customName != null) {
nbt.setString("name", customName);
}
}
public boolean isReady() {

View File

@ -92,6 +92,7 @@ public class TileEntityNukeN2 extends TileEntity implements ISidedInventory, IGU
public void setCustomName(String name) {
this.customName = name;
markDirty();
}
@Override
@ -154,6 +155,8 @@ public class TileEntityNukeN2 extends TileEntity implements ISidedInventory, IGU
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
}
}
customName = nbt.getString("name");
}
@Override
@ -172,6 +175,10 @@ public class TileEntityNukeN2 extends TileEntity implements ISidedInventory, IGU
}
}
nbt.setTag("items", list);
if (customName != null) {
nbt.setString("name", customName);
}
}
public boolean isReady() {

View File

@ -93,6 +93,7 @@ public class TileEntityNukePrototype extends TileEntity implements ISidedInvento
public void setCustomName(String name) {
this.customName = name;
markDirty();
}
@Override
@ -155,6 +156,8 @@ public class TileEntityNukePrototype extends TileEntity implements ISidedInvento
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
}
}
customName = nbt.getString("name");
}
@Override
@ -173,6 +176,10 @@ public class TileEntityNukePrototype extends TileEntity implements ISidedInvento
}
}
nbt.setTag("items", list);
if (customName != null) {
nbt.setString("name", customName);
}
}
public boolean isReady() {

View File

@ -92,6 +92,7 @@ public class TileEntityNukeSolinium extends TileEntity implements ISidedInventor
public void setCustomName(String name) {
this.customName = name;
markDirty();
}
@Override
@ -154,6 +155,8 @@ public class TileEntityNukeSolinium extends TileEntity implements ISidedInventor
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
}
}
customName = nbt.getString("name");
}
@Override
@ -172,6 +175,10 @@ public class TileEntityNukeSolinium extends TileEntity implements ISidedInventor
}
}
nbt.setTag("items", list);
if (customName != null) {
nbt.setString("name", customName);
}
}
public boolean isReady() {

View File

@ -92,6 +92,7 @@ public class TileEntityNukeTsar extends TileEntity implements ISidedInventory, I
public void setCustomName(String name) {
this.customName = name;
markDirty();
}
@Override
@ -154,6 +155,8 @@ public class TileEntityNukeTsar extends TileEntity implements ISidedInventory, I
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
}
}
customName = nbt.getString("name");
}
@Override
@ -172,6 +175,10 @@ public class TileEntityNukeTsar extends TileEntity implements ISidedInventory, I
}
}
nbt.setTag("items", list);
if (customName != null) {
nbt.setString("name", customName);
}
}
public boolean isReady() {

View File

@ -149,6 +149,7 @@ public class TileEntityDiFurnaceRTG extends TileEntityMachineBase implements IGU
@Override
public void setCustomName(String name) {
this.name = name;
markDirty();
}
public boolean hasPower() {

View File

@ -143,6 +143,7 @@ public class TileEntityForceField extends TileEntityLoadedBase implements ISided
public void setCustomName(String name) {
this.customName = name;
markDirty();
}
@Override
@ -224,6 +225,8 @@ public class TileEntityForceField extends TileEntityLoadedBase implements ISided
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
}
}
customName = nbt.getString("name");
}
@Override
@ -250,6 +253,10 @@ public class TileEntityForceField extends TileEntityLoadedBase implements ISided
}
}
nbt.setTag("items", list);
if (customName != null) {
nbt.setString("name", customName);
}
}
@Override

View File

@ -6,6 +6,7 @@ import com.hbm.main.MainRegistry;
import com.hbm.tileentity.TileEntityLoadedBase;
import com.hbm.util.ArmorUtil;
import io.netty.buffer.ByteBuf;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@ -25,11 +26,12 @@ public abstract class TileEntityLockableBase extends TileEntityLoadedBase {
MainRegistry.logger.error("A block has been set to locked state before setting pins, this should not happen and may cause errors! " + this.toString());
}
isLocked = true;
markDirty();
}
public void setPins(int pins) { lock = pins; }
public void setPins(int pins) { lock = pins; markDirty(); }
public int getPins() { return lock; }
public void setMod(double mod) { lockMod = mod; }
public void setMod(double mod) { lockMod = mod; markDirty(); }
public double getMod() { return lockMod; }
@Override
@ -50,6 +52,24 @@ public abstract class TileEntityLockableBase extends TileEntityLoadedBase {
nbt.setDouble("lockMod", lockMod);
}
@Override
public void serialize(ByteBuf buf) {
super.serialize(buf);
buf.writeInt(lock);
buf.writeBoolean(isLocked);
buf.writeDouble(lockMod);
}
@Override
public void deserialize(ByteBuf buf) {
super.deserialize(buf);
lock = buf.readInt();
isLocked = buf.readBoolean();
lockMod = buf.readDouble();
}
public boolean canAccess(EntityPlayer player) {
if(!isLocked) {

View File

@ -91,6 +91,7 @@ public class TileEntityMachineArcFurnace extends TileEntityLoadedBase implements
public void setCustomName(String name) {
this.customName = name;
markDirty();
}
@Override
@ -166,6 +167,8 @@ public class TileEntityMachineArcFurnace extends TileEntityLoadedBase implements
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
}
}
customName = nbt.getString("name");
}
@Override
@ -186,6 +189,10 @@ public class TileEntityMachineArcFurnace extends TileEntityLoadedBase implements
}
}
nbt.setTag("items", list);
if (customName != null) {
nbt.setString("name", customName);
}
}
@Override

View File

@ -1,5 +1,6 @@
package com.hbm.tileentity.machine;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
@ -22,14 +23,20 @@ import cpw.mods.fml.relauncher.SideOnly;
import io.netty.buffer.ByteBuf;
import net.minecraft.block.Block;
import net.minecraft.block.BlockLeaves;
import net.minecraft.block.IGrowable;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.common.IPlantable;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityMachineAutosaw extends TileEntityLoadedBase implements IBufPacketReceiver, IFluidStandardReceiver, IFluidCopiable {
@ -45,6 +52,8 @@ public class TileEntityMachineAutosaw extends TileEntityLoadedBase implements IB
public FluidTank tank;
public boolean isOn;
public boolean isSuspended;
private int forceSkip;
public float syncYaw;
public float rotationYaw;
public float prevRotationYaw;
@ -69,7 +78,7 @@ public class TileEntityMachineAutosaw extends TileEntityLoadedBase implements IB
if(!worldObj.isRemote) {
if(worldObj.getTotalWorldTime() % 20 == 0) {
if(!isSuspended && worldObj.getTotalWorldTime() % 20 == 0) {
if(tank.getFill() > 0) {
tank.setFill(tank.getFill() - 1);
this.isOn = true;
@ -80,7 +89,7 @@ public class TileEntityMachineAutosaw extends TileEntityLoadedBase implements IB
this.subscribeToAllAround(tank.getTankType(), this);
}
if(isOn) {
if(isOn && !isSuspended) {
Vec3 pivot = Vec3.createVectorHelper(xCoord + 0.5, yCoord + 1.75, zCoord + 0.5);
Vec3 upperArm = Vec3.createVectorHelper(0, 0, -4);
upperArm.rotateAroundX((float) Math.toRadians(80 - rotationPitch));
@ -119,28 +128,41 @@ public class TileEntityMachineAutosaw extends TileEntityLoadedBase implements IB
this.rotationYaw -= 360;
}
Vec3 grace = Vec3.createVectorHelper(0, 0, -3.5);
grace.rotateAroundY(-(float) Math.toRadians(rotationYaw));
grace.xCoord += pivot.xCoord;
grace.yCoord += pivot.yCoord;
grace.zCoord += pivot.zCoord;
if(forceSkip > 0) {
forceSkip--;
} else {
final double CUT_ANGLE = Math.toRadians(5);
double rotationYawRads = Math.toRadians((rotationYaw + 270) % 360);
Vec3 detector = Vec3.createVectorHelper(0, 0, -9);
detector.rotateAroundY(-(float) Math.toRadians(rotationYaw));
detector.xCoord += pivot.xCoord;
detector.yCoord += pivot.yCoord;
detector.zCoord += pivot.zCoord;
MovingObjectPosition pos = worldObj.func_147447_a(grace, detector, false, false, false);
outer:
for(int dx = -9; dx <= 9; dx++) {
for(int dz = -9; dz <= 9; dz++) {
int sqrDst = dx * dx + dz * dz;
if(pos != null && pos.typeOfHit == pos.typeOfHit.BLOCK) {
if(sqrDst <= 4 || sqrDst > 81)
continue;
Block b = worldObj.getBlock(pos.blockX, pos.blockY, pos.blockZ);
double angle = Math.atan2(dz, dx);
double relAngle = Math.abs(angle - rotationYawRads);
relAngle = Math.abs((relAngle + Math.PI) % (2 * Math.PI) - Math.PI);
if(b.getMaterial() == Material.wood || b.getMaterial() == Material.leaves || b.getMaterial() == Material.plants) {
if(relAngle > CUT_ANGLE)
continue;
int x = xCoord + dx;
int y = yCoord + 1;
int z = zCoord + dz;
Block b = worldObj.getBlock(x, y, z);
if(!(b.getMaterial() == Material.wood || b.getMaterial() == Material.leaves || b.getMaterial() == Material.plants))
continue;
int meta = worldObj.getBlockMetadata(x, y, z);
if(shouldIgnore(worldObj, x, y, z, b, meta))
continue;
int meta = worldObj.getBlockMetadata(pos.blockX, pos.blockY, pos.blockZ);
if(!shouldIgnore(b, meta)) {
state = 1;
break outer;
}
}
}
@ -181,7 +203,7 @@ public class TileEntityMachineAutosaw extends TileEntityLoadedBase implements IB
this.lastSpin = this.spin;
if(isOn) {
if(isOn && !isSuspended) {
this.spin += 15F;
Vec3 vec = Vec3.createVectorHelper(0.625, 0, 1.625);
@ -212,11 +234,15 @@ public class TileEntityMachineAutosaw extends TileEntityLoadedBase implements IB
}
/** Anything additionally that the detector nor the blades should pick up on, like non-mature willows */
public static boolean shouldIgnore(Block b, int meta) {
public static boolean shouldIgnore(World world, int x, int y, int z, Block b, int meta) {
if(b == ModBlocks.plant_tall) {
return meta == EnumTallFlower.CD2.ordinal() + 8 || meta == EnumTallFlower.CD3.ordinal() + 8;
}
if((b instanceof IGrowable)) {
return ((IGrowable) b).func_149851_a(world, x, y, z, world.isRemote);
}
return false;
}
@ -225,16 +251,10 @@ public class TileEntityMachineAutosaw extends TileEntityLoadedBase implements IB
Block b = worldObj.getBlock(x, y, z);
int meta = worldObj.getBlockMetadata(x, y, z);
if(shouldIgnore(b, meta)) {
return;
}
if(!shouldIgnore(worldObj, x, y, z, b, meta)) {
if(b.getMaterial() == Material.leaves || b.getMaterial() == Material.plants) {
worldObj.func_147480_a(x, y, z, true);
return;
}
if(b.getMaterial() == Material.wood) {
cutCrop(x, y, z);
} else if(b.getMaterial() == Material.wood) {
fellTree(x, y, z);
if(state == 1) {
state = 2;
@ -242,6 +262,55 @@ public class TileEntityMachineAutosaw extends TileEntityLoadedBase implements IB
}
}
// Return when hitting a wall
if(state == 1 && worldObj.getBlock(x, y, z).isNormalCube(worldObj, x, y, z)) {
state = 2;
forceSkip = 5;
}
}
protected void cutCrop(int x, int y, int z) {
Block soil = worldObj.getBlock(x, y - 1, z);
Block b = worldObj.getBlock(x, y, z);
int meta = worldObj.getBlockMetadata(x, y, z);
worldObj.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(b) + (meta << 12));
Block replacementBlock = Blocks.air;
int replacementMeta = 0;
if (!worldObj.isRemote && !worldObj.restoringBlockSnapshots) {
ArrayList<ItemStack> drops = b.getDrops(worldObj, x, y, z, meta, 0);
boolean replanted = false;
for (ItemStack drop : drops) {
if (!replanted && drop.getItem() instanceof IPlantable) {
IPlantable seed = (IPlantable) drop.getItem();
if(soil.canSustainPlant(worldObj, x, y - 1, z, ForgeDirection.UP, seed)) {
replacementBlock = seed.getPlant(worldObj, x, y, z);
replacementMeta = seed.getPlantMetadata(worldObj, x, y, z);
replanted = true;
drop.stackSize -= 1;
}
}
float delta = 0.7F;
double dx = (double)(worldObj.rand.nextFloat() * delta) + (double)(1.0F - delta) * 0.5D;
double dy = (double)(worldObj.rand.nextFloat() * delta) + (double)(1.0F - delta) * 0.5D;
double dz = (double)(worldObj.rand.nextFloat() * delta) + (double)(1.0F - delta) * 0.5D;
EntityItem entityItem = new EntityItem(worldObj, x + dx, y + dy, z + dz, drop);
entityItem.delayBeforeCanPickup = 10;
worldObj.spawnEntityInWorld(entityItem);
}
}
worldObj.setBlock(x, y, z, replacementBlock, replacementMeta, 3);
}
protected void fellTree(int x, int y, int z) {
if(worldObj.getBlock(x, y - 1, z).getMaterial() == Material.wood) {
@ -279,6 +348,7 @@ public class TileEntityMachineAutosaw extends TileEntityLoadedBase implements IB
@Override
public void serialize(ByteBuf buf) {
buf.writeBoolean(this.isOn);
buf.writeBoolean(this.isSuspended);
buf.writeFloat(this.rotationYaw);
buf.writeFloat(this.rotationPitch);
this.tank.serialize(buf);
@ -287,6 +357,7 @@ public class TileEntityMachineAutosaw extends TileEntityLoadedBase implements IB
@Override
public void deserialize(ByteBuf buf) {
this.isOn = buf.readBoolean();
this.isSuspended = buf.readBoolean();
this.syncYaw = buf.readFloat();
this.syncPitch = buf.readFloat();
this.turnProgress = 3; //use 3-ply for extra smoothness
@ -297,6 +368,8 @@ public class TileEntityMachineAutosaw extends TileEntityLoadedBase implements IB
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
this.isOn = nbt.getBoolean("isOn");
this.isSuspended = nbt.getBoolean("isSuspended");
this.forceSkip = nbt.getInteger("skip");
this.rotationYaw = nbt.getFloat("yaw");
this.rotationPitch = nbt.getFloat("pitch");
this.state = nbt.getInteger("state");
@ -307,6 +380,8 @@ public class TileEntityMachineAutosaw extends TileEntityLoadedBase implements IB
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setBoolean("isOn", this.isOn);
nbt.setBoolean("isSuspended", this.isSuspended);
nbt.setInteger("skip", this.forceSkip);
nbt.setFloat("yaw", this.rotationYaw);
nbt.setFloat("pitch", this.rotationPitch);
nbt.setInteger("state", this.state);

View File

@ -73,6 +73,7 @@ public class TileEntityMachineKeyForge extends TileEntity implements ISidedInven
public void setCustomName(String name) {
this.customName = name;
markDirty();
}
@Override
@ -138,6 +139,8 @@ public class TileEntityMachineKeyForge extends TileEntity implements ISidedInven
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
}
}
customName = nbt.getString("name");
}
@Override
@ -156,6 +159,10 @@ public class TileEntityMachineKeyForge extends TileEntity implements ISidedInven
}
}
nbt.setTag("items", list);
if (customName != null) {
nbt.setString("name", customName);
}
}
@Override

View File

@ -79,6 +79,7 @@ public class TileEntityMachineMissileAssembly extends TileEntity implements ISid
public void setCustomName(String name) {
this.customName = name;
markDirty();
}
@Override
@ -142,6 +143,8 @@ public class TileEntityMachineMissileAssembly extends TileEntity implements ISid
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
}
}
customName = nbt.getString("name");
}
@Override
@ -159,6 +162,10 @@ public class TileEntityMachineMissileAssembly extends TileEntity implements ISid
}
}
nbt.setTag("items", list);
if (customName != null) {
nbt.setString("name", customName);
}
}
@Override

View File

@ -83,6 +83,7 @@ public class TileEntityMachineRTG extends TileEntityLoadedBase implements ISided
public void setCustomName(String name) {
this.customName = name;
markDirty();
}
@Override
@ -151,6 +152,8 @@ public class TileEntityMachineRTG extends TileEntityLoadedBase implements ISided
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
}
}
customName = nbt.getString("name");
}
@Override
@ -169,6 +172,10 @@ public class TileEntityMachineRTG extends TileEntityLoadedBase implements ISided
}
}
nbt.setTag("items", list);
if (customName != null) {
nbt.setString("name", customName);
}
}
@Override

View File

@ -60,7 +60,7 @@ public class TileEntityMachineSatDock extends TileEntity implements ISidedInvent
@Override public String getInventoryName() { return this.hasCustomInventoryName() ? this.customName : "container.satDock"; }
@Override public boolean hasCustomInventoryName() { return this.customName != null && this.customName.length() > 0; }
public void setCustomName(String name) { this.customName = name; }
public void setCustomName(String name) { this.customName = name; markDirty(); }
@Override public int getInventoryStackLimit() { return 64; }
@Override
@ -111,6 +111,8 @@ public class TileEntityMachineSatDock extends TileEntity implements ISidedInvent
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
}
}
customName = nbt.getString("name");
}
@Override
@ -127,6 +129,10 @@ public class TileEntityMachineSatDock extends TileEntity implements ISidedInvent
}
}
nbt.setTag("items", list);
if (customName != null) {
nbt.setString("name", customName);
}
}
@Override public int[] getAccessibleSlotsFromSide(int p_94128_1_) { return access; }

View File

@ -73,6 +73,7 @@ public class TileEntityMachineSatLinker extends TileEntity implements ISidedInve
public void setCustomName(String name) {
this.customName = name;
markDirty();
}
@Override
@ -132,6 +133,8 @@ public class TileEntityMachineSatLinker extends TileEntity implements ISidedInve
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
}
}
customName = nbt.getString("name");
}
@Override
@ -148,6 +151,10 @@ public class TileEntityMachineSatLinker extends TileEntity implements ISidedInve
}
}
nbt.setTag("items", list);
if (customName != null) {
nbt.setString("name", customName);
}
}
@Override

View File

@ -83,6 +83,7 @@ public class TileEntityMachineShredder extends TileEntityLoadedBase implements I
public void setCustomName(String name) {
this.customName = name;
markDirty();
}
@Override
@ -154,6 +155,8 @@ public class TileEntityMachineShredder extends TileEntityLoadedBase implements I
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
}
}
customName = nbt.getString("name");
}
@Override
@ -173,6 +176,10 @@ public class TileEntityMachineShredder extends TileEntityLoadedBase implements I
}
}
nbt.setTag("items", list);
if (customName != null) {
nbt.setString("name", customName);
}
}
@Override

View File

@ -82,6 +82,7 @@ public class TileEntityMachineSiren extends TileEntity implements ISidedInventor
public void setCustomName(String name) {
this.customName = name;
markDirty();
}
@Override
@ -149,6 +150,8 @@ public class TileEntityMachineSiren extends TileEntity implements ISidedInventor
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
}
}
customName = nbt.getString("name");
}
@Override
@ -168,6 +171,10 @@ public class TileEntityMachineSiren extends TileEntity implements ISidedInventor
}
}
nbt.setTag("items", list);
if (customName != null) {
nbt.setString("name", customName);
}
}
@Override

View File

@ -32,7 +32,7 @@ public class TileEntityMachineStrandCaster extends TileEntityFoundryCastingBase
public FluidTank water;
public FluidTank steam;
private long lastCastTick = 0;
private long lastProgressTick = 0;
public String getName() {
return "container.machineStrandCaster";
@ -77,7 +77,7 @@ public class TileEntityMachineStrandCaster extends TileEntityFoundryCastingBase
int moldsToCast = maxProcessable();
// Makes it flush the buffers after 10 seconds of inactivity, or when they're full
if (moldsToCast > 0 && (moldsToCast >= 9 || worldObj.getWorldTime() >= lastCastTick + 200)) {
if (moldsToCast > 0 && (moldsToCast >= 9 || worldObj.getWorldTime() >= lastProgressTick + 200)) {
ItemMold.Mold mold = this.getInstalledMold();
@ -108,7 +108,7 @@ public class TileEntityMachineStrandCaster extends TileEntityFoundryCastingBase
water.setFill(water.getFill() - getWaterRequired() * moldsToCast);
steam.setFill(steam.getFill() + getWaterRequired() * moldsToCast);
lastCastTick = worldObj.getWorldTime();
lastProgressTick = worldObj.getWorldTime();
}
networkPackNT(150);
@ -226,6 +226,8 @@ public class TileEntityMachineStrandCaster extends TileEntityFoundryCastingBase
stack.amount -= required;
lastProgressTick = world.getWorldTime();
return stack;
}
@ -272,7 +274,7 @@ public class TileEntityMachineStrandCaster extends TileEntityFoundryCastingBase
super.writeToNBT(nbt);
water.writeToNBT(nbt, "w");
steam.writeToNBT(nbt, "s");
nbt.setLong("t", lastCastTick);
nbt.setLong("t", lastProgressTick);
}
@Override
@ -280,7 +282,7 @@ public class TileEntityMachineStrandCaster extends TileEntityFoundryCastingBase
super.readFromNBT(nbt);
water.readFromNBT(nbt, "w");
steam.readFromNBT(nbt, "s");
lastCastTick = nbt.getLong("t");
lastProgressTick = nbt.getLong("t");
}
@Override

View File

@ -136,6 +136,7 @@ public class TileEntityMachineTurbine extends TileEntityLoadedBase implements IS
public void setCustomName(String name) {
this.customName = name;
markDirty();
}
@Override
@ -211,6 +212,8 @@ public class TileEntityMachineTurbine extends TileEntityLoadedBase implements IS
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
}
}
customName = nbt.getString("name");
}
@Override
@ -233,6 +236,10 @@ public class TileEntityMachineTurbine extends TileEntityLoadedBase implements IS
}
}
nbt.setTag("items", list);
if (customName != null) {
nbt.setString("name", customName);
}
}
@Override

View File

@ -79,6 +79,7 @@ public class TileEntityRtgFurnace extends TileEntity implements ISidedInventory,
public void setCustomName(String name) {
this.customName = name;
markDirty();
}
@Override
@ -150,6 +151,8 @@ public class TileEntityRtgFurnace extends TileEntity implements ISidedInventory,
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
}
}
customName = nbt.getString("name");
}
@Override
@ -169,6 +172,10 @@ public class TileEntityRtgFurnace extends TileEntity implements ISidedInventory,
}
}
nbt.setTag("items", list);
if (customName != null) {
nbt.setString("name", customName);
}
}
@Override

View File

@ -75,6 +75,7 @@ public class TileEntityWasteDrum extends TileEntity implements ISidedInventory,
public void setCustomName(String name) {
this.customName = name;
markDirty();
}
@Override
@ -141,6 +142,8 @@ public class TileEntityWasteDrum extends TileEntity implements ISidedInventory,
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
}
}
customName = nbt.getString("name");
}
@Override
@ -160,6 +163,10 @@ public class TileEntityWasteDrum extends TileEntity implements ISidedInventory,
}
}
nbt.setTag("items", list);
if (customName != null) {
nbt.setString("name", customName);
}
}
@Override

View File

@ -66,6 +66,7 @@ public abstract class TileEntityRBMKSlottedBase extends TileEntityRBMKActiveBase
public void setCustomName(String name) {
this.customName = name;
markDirty();
}
@Override
@ -134,6 +135,8 @@ public abstract class TileEntityRBMKSlottedBase extends TileEntityRBMKActiveBase
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
}
}
customName = nbt.getString("name");
}
}
@ -153,6 +156,10 @@ public abstract class TileEntityRBMKSlottedBase extends TileEntityRBMKActiveBase
}
}
nbt.setTag("items", list);
if (customName != null) {
nbt.setString("name", customName);
}
}
}
}

View File

@ -9,6 +9,9 @@ import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.world.World;
import java.util.Random;
@ -61,6 +64,7 @@ public abstract class TileEntityCrateBase extends TileEntityLockableBase impleme
public void setCustomName(String name) {
this.customName = name;
markDirty();
}
@Override
@ -127,6 +131,8 @@ public abstract class TileEntityCrateBase extends TileEntityLockableBase impleme
}
}
this.hasSpiders = nbt.getBoolean("spiders");
customName = nbt.getString("name");
}
@Override
@ -145,6 +151,22 @@ public abstract class TileEntityCrateBase extends TileEntityLockableBase impleme
}
nbt.setTag("items", list);
nbt.setBoolean("spiders", hasSpiders);
if (customName != null) {
nbt.setString("name", customName);
}
}
@Override
public Packet getDescriptionPacket() {
NBTTagCompound nbt = new NBTTagCompound();
writeToNBT(nbt);
return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 0, nbt);
}
@Override
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) {
readFromNBT(packet.func_148857_g());
}
@Override

View File

@ -91,6 +91,7 @@ public class TileEntityMachineBattery extends TileEntityMachineBase implements I
public void setCustomName(String name) {
this.customName = name;
markDirty();
}
@Override
@ -115,6 +116,8 @@ public class TileEntityMachineBattery extends TileEntityMachineBase implements I
this.redHigh = nbt.getShort("redHigh");
this.lastRedstone = nbt.getByte("lastRedstone");
this.priority = ConnectionPriority.values()[nbt.getByte("priority")];
customName = nbt.getString("name");
}
@Override
@ -126,6 +129,10 @@ public class TileEntityMachineBattery extends TileEntityMachineBase implements I
nbt.setShort("redHigh", redHigh);
nbt.setByte("lastRedstone", lastRedstone);
nbt.setByte("priority", (byte)this.priority.ordinal());
if (customName != null) {
nbt.setString("name", customName);
}
}
@Override

View File

@ -62,7 +62,7 @@ public class TileEntityMassStorage extends TileEntityCrateBase implements IBufPa
if(this.getType() == null)
this.stack = 0;
if(getType() != null && getStockpile() < getCapacity() && slots[0] != null && slots[0].isItemEqual(getType()) && ItemStack.areItemStackTagsEqual(slots[0], getType())) {
if(canInsert(slots[0])) {
int remaining = getCapacity() - getStockpile();
int toRemove = Math.min(remaining, slots[0].stackSize);
@ -95,6 +95,44 @@ public class TileEntityMassStorage extends TileEntityCrateBase implements IBufPa
}
}
public boolean canInsert(ItemStack stack) {
return getType() != null && getStockpile() < getCapacity() && stack != null && stack.isItemEqual(getType()) && ItemStack.areItemStackTagsEqual(stack, getType());
}
public boolean quickInsert(ItemStack stack) {
if (!canInsert(stack))
return false;
int remaining = getCapacity() - getStockpile();
if (remaining < stack.stackSize)
return false;
this.stack += stack.stackSize;
stack.stackSize = 0;
this.markDirty();
return true;
}
public ItemStack quickExtract() {
if (!output) {
return null;
}
int amount = getType().getMaxStackSize();
if (getStockpile() < amount)
return null;
ItemStack result = slots[1].copy();
result.stackSize = amount;
this.stack -= amount;
this.markDirty();
return result;
}
@Override
public void serialize(ByteBuf buf) {
buf.writeInt(this.stack);
@ -132,12 +170,12 @@ public class TileEntityMassStorage extends TileEntityCrateBase implements IBufPa
@Override
public void openInventory() {
this.worldObj.playSoundEffect(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, "hbm:block.storageOpen", 1.0F, 1.0F);
this.worldObj.playSoundEffect(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, "hbm:block.storageOpen", 0.5F, 1.0F);
}
@Override
public void closeInventory() {
this.worldObj.playSoundEffect(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, "hbm:block.storageClose", 1.0F, 1.0F);
this.worldObj.playSoundEffect(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, "hbm:block.storageClose", 0.5F, 1.0F);
}
@Override
@ -196,9 +234,9 @@ public class TileEntityMassStorage extends TileEntityCrateBase implements IBufPa
if(data.hasKey("toggle")) {
this.output = !output;
}
if(data.hasKey("slot") && this.getStockpile() <= 0){
setFilterContents(data);
if(slots[1] != null) slots[1].stackSize = 1;
}
}

View File

@ -70,7 +70,7 @@ public abstract class TileEntityRequestNetworkContainer extends TileEntityReques
@Override public String getInventoryName() { return this.hasCustomInventoryName() ? this.customName : getName(); }
public abstract String getName();
@Override public boolean hasCustomInventoryName() { return this.customName != null && this.customName.length() > 0; }
public void setCustomName(String name) { this.customName = name; }
public void setCustomName(String name) { this.customName = name; markDirty(); }
@Override public int getInventoryStackLimit() { return 64; }
@Override
@ -117,6 +117,8 @@ public abstract class TileEntityRequestNetworkContainer extends TileEntityReques
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
}
}
customName = nbt.getString("name");
}
@Override
@ -135,5 +137,9 @@ public abstract class TileEntityRequestNetworkContainer extends TileEntityReques
}
}
nbt.setTag("items", list);
if (customName != null) {
nbt.setString("name", customName);
}
}
}

View File

@ -4160,7 +4160,9 @@ tile.factory_titanium_furnace.name=Einfache Fabrikzugriffsluke
tile.factory_titanium_hull.name=Fabrikblock
tile.fallout.name=Fallout
tile.fan.name=Ventilator
tile.fan.desc=Kann mit Redstone aktiviert werden$Bewegt Entities bis zu 10 Blöcke$Rechtsclick mit Schraubenzieher um den Ventilator umzudrehen
tile.fan.desc=Kann mit Redstone aktiviert werden$Bewegt Entities bis zu 10 Blöcke$Rechtsclick mit Schraubenzieher um den Ventilator umzudrehen$Klicken Sie mit der rechten Maustaste mit der Handbohrmaschine um den Modus zu wechseln
tile.fan.falloffOn=Die Lüfterleistung nimmt mit der Entfernung ab
tile.fan.falloffOff=Konstante Lüfterleistung
tile.fence_metal.name=Maschendrahtzaun
tile.fence_metal_post.name=Maschendrahtzaun-Pfahl
tile.field_disturber.name=Hochenergiefeld-Jammer
@ -4341,6 +4343,7 @@ tile.machine_assemfac.name=Fertigungsfabrik
tile.machine_autocrafter.name=Automatische Werkbank
tile.machine_autosaw.name=Automatische Kreissäge
tile.machine_autosaw.desc=Schneidet Pflanzen nieder, pflanzt Bäume nach$Akzeptiert:$-Holzöl$-Ethanol$-Fischöl$-Schweröl
tile.machine_autosaw.suspended=Angehalten
tile.machine_bat9000.name=Big-Ass Tank 9000
tile.machine_battery.name=Energiespeicherblock
tile.machine_battery_potato.name=Kartoffelbatterieblock

View File

@ -5283,7 +5283,9 @@ tile.factory_titanium_furnace.name=Basic Factory Access Hatch
tile.factory_titanium_hull.name=Factory Block
tile.fallout.name=Fallout
tile.fan.name=Fan
tile.fan.desc=Activates using redstone$Will push entities up to 10 blocks$Right-click with screwdriver to flip
tile.fan.desc=Activates using redstone$Will push entities up to 10 blocks$Right-click with screwdriver to flip$Right-click with hand drill to switch mode
tile.fan.falloffOn=Fan power decreases with distance
tile.fan.falloffOff=Consistent fan power
tile.fence_metal.name=Chainlink Fence
tile.fence_metal_post.name=Chainlink Fence Post
tile.field_disturber.name=High Energy Field Jammer
@ -5475,6 +5477,7 @@ tile.machine_assemfac.name=Assembly Factory
tile.machine_autocrafter.name=Automatic Crafting Table
tile.machine_autosaw.name=Automatic Buzz Saw
tile.machine_autosaw.desc=Cuts down nearby plants, re-plants trees$Accepts:$-Wood oil$-Ethanol$-Fish oil$-Heavy oil
tile.machine_autosaw.suspended=Suspended
tile.machine_bat9000.name=Big-Ass Tank 9000
tile.machine_battery.name=Energy Storage Block
tile.machine_battery_potato.name=Potato Battery Block

View File

@ -5356,7 +5356,9 @@ tile.factory_titanium_furnace.name=Basic Factory Access Hatch
tile.factory_titanium_hull.name=Factory Block
tile.fallout.name=Fallout
tile.fan.name=Fan
tile.fan.desc=Activates using redstone$Will push entities up to 10 blocks$Right-click with screwdriver to flip
tile.fan.desc=Activates using redstone$Will push entities up to 10 blocks$Right-click with screwdriver to flip$Right-click with hand drill to switch mode
tile.fan.falloffOn=Fan power decreases with distance
tile.fan.falloffOff=Consistent fan power
tile.fence_metal.name=Chainlink Fence
tile.fence_metal_post.name=Chainlink Fence Post
tile.field_disturber.name=High Energy Field Jammer
@ -5537,6 +5539,7 @@ tile.machine_assemfac.name=Assembly Factory
tile.machine_autocrafter.name=Automatic Crafting Table
tile.machine_autosaw.name=Automatic Buzz Saw
tile.machine_autosaw.desc=Cuts down nearby plants, re-plants trees$Accepts:$-Wood oil$-Ethanol$-Fish oil$-Heavy oil
tile.machine_autosaw.suspended=Suspended
tile.machine_bat9000.name=Big-Ass Tank 9000
tile.machine_battery.name=Energy Storage Block
tile.machine_battery_potato.name=Potato Battery Block

View File

@ -4720,6 +4720,9 @@ tile.factory_titanium_furnace.name=Basic Factory Access Hatch
tile.factory_titanium_hull.name=Factory Block
tile.fallout.name=Fallout
tile.fan.name=Fan
tile.fan.desc=Activates using redstone$Will push entities up to 10 blocks$Right-click with screwdriver to flip$Right-click with hand drill to switch mode
tile.fan.falloffOn=Fan power decreases with distance
tile.fan.falloffOff=Consistent fan power
tile.fence_metal.name=Chainlink Fence
tile.field_disturber.name=High Energy Field Jammer
tile.filing_cabinet.green.name=Dusty Filing Cabinet
@ -4873,6 +4876,7 @@ tile.machine_assembler.name=Assembly Machine
tile.machine_assemfac.name=Assembly Factory
tile.machine_autocrafter.name=Automatic Crafting Table
tile.machine_autosaw.name=Automatic Buzz Saw
tile.machine_autosaw.suspended=Suspended
tile.machine_bat9000.name=Big-Ass Tank 9000
tile.machine_battery.name=Energy Storage Block
tile.machine_battery_potato.name=Potato Battery Block

View File

@ -5530,7 +5530,9 @@ tile.factory_titanium_furnace.name=Люк доступа базовой фабр
tile.factory_titanium_hull.name=Корпус базовой фабрики
tile.fallout.name=Радиоактивный осадок
tile.fan.name=Вентилятор
tile.fan.desc=Активируется редстоуном$Толкает существ до 10 блоков$ПКМ отвёрткой чтобы повернуть
tile.fan.desc=Активируется редстоуном$Толкает существ до 10 блоков$ПКМ отвёрткой чтобы повернуть$ПКМ ручным сверлом чтобы переключить режим
tile.fan.falloffOn=Сила вентилятора уменьшается с расстоянием
tile.fan.falloffOff=Постоянная сила вентилорая
tile.fence_metal.name=Проволочная сетка
tile.fence_metal_post.name=Столб проволочной сетки
tile.field_disturber.name=Подавитель высокоэнергитических полей
@ -5720,6 +5722,7 @@ tile.machine_assemfac.name=Сборочный завод
tile.machine_autocrafter.name=Автоматический верстак
tile.machine_autosaw.name=Автоматическая пила
tile.machine_autosaw.desc=Срубает ближайшие растения, пересаживает деревья$Принимает:$-Древесное масло$-Этанол$-Рыбное масло$-Тяжелую нефть
tile.machine_autosaw.suspended=Приостановлена
tile.machine_bat9000.name=Охереть-большая цистерна 9000
tile.machine_battery.name=Энергохранилище
tile.machine_battery_potato.name=Картофельная батарея

View File

@ -5267,7 +5267,9 @@ tile.factory_titanium_furnace.name=Basic Factory Access Hatch
tile.factory_titanium_hull.name=Заводський блок
tile.fallout.name=Радіоактивні опади
tile.fan.name=Вентилятор
tile.fan.desc=Активується за допомогою редстоуну$Піднімає об'єкти на 10 блоків$Клацніть правою кнопкою миші викруткою, щоб перевернути
tile.fan.desc=Активується за допомогою редстоуну$Піднімає об'єкти на 10 блоків$Клацніть правою кнопкою миші викруткою, щоб перевернути$ПКМ ручним свердлом, щоб переключити режим
tile.fan.falloffOn=Сила вентилятора зменшується з відстанню
tile.fan.falloffOff=Постійна сила вентилятора
tile.fence_metal.name=Огорожа рабиця
tile.fence_metal_post.name=Огорожа рабиця стовп
tile.field_disturber.name=Заглушник високоенергетичного поля
@ -5458,6 +5460,7 @@ tile.machine_assemfac.name=Збиральна фабрика
tile.machine_autocrafter.name=Автоматичний верстак
tile.machine_autosaw.name=Автоматична пила
tile.machine_autosaw.desc=Вирубує рослини поруч, заново висажує дерева$Приймає:$-Деревну смолу$-Етанол$-Риб'ячий жир$-Важку нафту
tile.machine_autosaw.suspended=Припинено
tile.machine_bat9000.name=Big-Ass цистерна 9000
tile.machine_battery.name=Блок накопичувач енергії
tile.machine_battery_potato.name=Блок картопляних батарейок

View File

@ -5005,7 +5005,9 @@ tile.factory_titanium_furnace.name=工厂端口
tile.factory_titanium_hull.name=工厂外壳
tile.fallout.name=辐射尘
tile.fan.name=风扇
tile.fan.desc=使用红石激活$将实体推至最多10个方块外$用螺丝刀右键点击即可翻转
tile.fan.desc=使用红石激活$将实体推至最多10个方块外$用螺丝刀右键点击即可翻转$使用手钻右键切换模式
tile.fan.falloffOn=风扇功率随距离增加而减小
tile.fan.falloffOff=风扇功率恒定
tile.fence_metal.name=铁丝网围栏
tile.fence_metal_post.name=铁丝网围栏立柱
tile.field_disturber.name=高能场干扰机
@ -5188,6 +5190,7 @@ tile.machine_assemfac.name=装配厂
tile.machine_autocrafter.name=自动工作台
tile.machine_autosaw.name=自动嗡嗡锯
tile.machine_autosaw.desc=砍伐附近的植物,重新种植树木$接受:$-木油$-乙醇$-鱼油$-重油
tile.machine_autosaw.suspended=暂停
tile.machine_bat9000.name=巨尻-9000 储罐
tile.machine_battery.name=蓄电池
tile.machine_battery_potato.name=马铃薯电池组