From 75919e5bf70bce2ecd6e52d1b00ff7e7cc510fee Mon Sep 17 00:00:00 2001 From: Niclas Klugmann Date: Fri, 18 Apr 2025 22:30:48 +0200 Subject: [PATCH 01/15] delete old unfinished and unused minecart code (#163) --- .../mechworks/model/CartRender.java | 132 -- .../mechworks/model/ModelPullcart.java | 278 ---- .../mechworks/model/ModelWagon.java | 455 ------ .../java/tconstruct/world/TinkerWorld.java | 25 - .../world/TinkerWorldProxyClient.java | 3 - .../tconstruct/world/blocks/WoodRail.java | 54 - .../tconstruct/world/entity/CartEntity.java | 1237 ----------------- .../resources/assets/tinker/lang/cs_CZ.lang | 2 - .../resources/assets/tinker/lang/de_DE.lang | 2 - .../resources/assets/tinker/lang/en_PT.lang | 2 - .../resources/assets/tinker/lang/en_US.lang | 2 - .../resources/assets/tinker/lang/fr_FR.lang | 2 - .../resources/assets/tinker/lang/it_IT.lang | 2 - .../resources/assets/tinker/lang/ja_JP.lang | 2 - .../resources/assets/tinker/lang/ko_KR.lang | 2 - .../resources/assets/tinker/lang/pt_BR.lang | 2 - .../resources/assets/tinker/lang/pt_PT.lang | 2 - .../resources/assets/tinker/lang/ru_RU.lang | 2 - .../resources/assets/tinker/lang/uk_UA.lang | 2 - .../resources/assets/tinker/lang/zh_CN.lang | 2 - .../resources/assets/tinker/lang/zh_TW.lang | 2 - .../assets/tinker/manuals/en_US/diary.xml | 31 +- 22 files changed, 8 insertions(+), 2235 deletions(-) delete mode 100644 src/main/java/tconstruct/mechworks/model/CartRender.java delete mode 100644 src/main/java/tconstruct/mechworks/model/ModelPullcart.java delete mode 100644 src/main/java/tconstruct/mechworks/model/ModelWagon.java delete mode 100644 src/main/java/tconstruct/world/blocks/WoodRail.java delete mode 100644 src/main/java/tconstruct/world/entity/CartEntity.java diff --git a/src/main/java/tconstruct/mechworks/model/CartRender.java b/src/main/java/tconstruct/mechworks/model/CartRender.java deleted file mode 100644 index 2bb38fb5..00000000 --- a/src/main/java/tconstruct/mechworks/model/CartRender.java +++ /dev/null @@ -1,132 +0,0 @@ -package tconstruct.mechworks.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.entity.Render; -import net.minecraft.entity.Entity; -import net.minecraft.init.Blocks; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.Vec3; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import tconstruct.world.entity.CartEntity; - -@SideOnly(Side.CLIENT) -public class CartRender extends Render { - - protected ModelBase modelCart; - RenderBlocks renderblocks; - - public CartRender() { - this.shadowSize = 0.5F; - this.modelCart = new ModelPullcart(); - renderblocks = new RenderBlocks(); - } - - public void renderPullcart(CartEntity cart, double posX, double posY, double posZ, float par8, float par9) { - GL11.glPushMatrix(); - long var10 = (long) cart.hashCode() * 493286711L; - var10 = var10 * var10 * 4392167121L + var10 * 98761L; - float var12 = (((float) (var10 >> 16 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; - float var13 = (((float) (var10 >> 20 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; - float var14 = (((float) (var10 >> 24 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; - GL11.glTranslatef(var12, var13, var14); - double var15 = cart.lastTickPosX + (cart.posX - cart.lastTickPosX) * (double) par9; - double var17 = cart.lastTickPosY + (cart.posY - cart.lastTickPosY) * (double) par9; - double var19 = cart.lastTickPosZ + (cart.posZ - cart.lastTickPosZ) * (double) par9; - double var21 = 0.30000001192092896D; - Vec3 var23 = cart.func_70489_a(var15, var17, var19); - float var24 = cart.prevRotationPitch + (cart.rotationPitch - cart.prevRotationPitch) * par9; - - if (var23 != null) { - Vec3 var25 = cart.func_70495_a(var15, var17, var19, var21); - Vec3 var26 = cart.func_70495_a(var15, var17, var19, -var21); - - if (var25 == null) { - var25 = var23; - } - - if (var26 == null) { - var26 = var23; - } - - posX += var23.xCoord - var15; - posY += (var25.yCoord + var26.yCoord) / 2.0D - var17; - posZ += var23.zCoord - var19; - Vec3 var27 = var26.addVector(-var25.xCoord, -var25.yCoord, -var25.zCoord); - - if (var27.lengthVector() != 0.0D) { - var27 = var27.normalize(); - par8 = (float) (Math.atan2(var27.zCoord, var27.xCoord) * 180.0D / Math.PI); - var24 = (float) (Math.atan(var27.yCoord) * 73.0D); - } - } - - GL11.glTranslatef((float) posX, (float) posY + 0.3125f, (float) posZ); - GL11.glRotatef(180.0F - par8, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-var24, 0.0F, 0.0F, 1.0F); - float var28 = (float) cart.getRollingAmplitude() - par9; - float var30 = (float) cart.getDamage() - par9; - - if (var30 < 0.0F) { - var30 = 0.0F; - } - - if (var28 > 0.0F) { - GL11.glRotatef( - MathHelper.sin(var28) * var28 * var30 / 10.0F * (float) cart.getRollingDirection(), - 1.0F, - 0.0F, - 0.0F); - } - - if (cart.getCartType() != 0) { - // this.loadTexture("/terrain.png"); - float var29 = 0.75F; - GL11.glScalef(var29, var29, var29); - - if (cart.getCartType() == 1) { - GL11.glTranslatef(0.0F, 0.5F, 0.0F); - renderblocks.renderBlockAsItem(Blocks.chest, 0, cart.getBrightness(par9)); - GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); - GL11.glTranslatef(0.5F, 0.0F, -0.5F); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - } else if (cart.getCartType() == 2) { - GL11.glTranslatef(0.0F, 0.3125F, 0.0F); - renderblocks.renderBlockAsItem(Blocks.furnace, 0, cart.getBrightness(par9)); - GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); - GL11.glTranslatef(0.0F, -0.3125F, 0.0F); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - } - - // GL11.glScalef(1.0F / var29, 1.0F / var29, 1.0F / var29); - } - - // this.loadTexture("/tinkertextures/entity/pullcart.png"); - GL11.glScalef(-1.0F, -1.0F, 1.0F); - this.modelCart.render(cart, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); - GL11.glPopMatrix(); - } - - /** - * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then - * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic - * (Render= 6 ? this.theIcon : this.blockIcon; - } - - @Override - @SideOnly(Side.CLIENT) - /** - * When this method is called, your block should register all the icons it needs with the given IconRegister. This - * is the only chance you get to register icons. - */ - public void registerBlockIcons(IIconRegister par1IconRegister) { - this.blockIcon = par1IconRegister.registerIcon("tinker:woodrail"); - this.theIcon = par1IconRegister.registerIcon("tinker:woodrail_turn"); - } - - protected void func_94358_a(World par1World, int par2, int par3, int par4, int par5, int par6, Block par7) { - if (par7 != Blocks.air && par7.canProvidePower() - && (new Rail(par1World, par2, par3, par4)).func_150650_a() == 3) { - this.func_150052_a(par1World, par2, par3, par4, false); - } - } - - @Override - public float getRailMaxSpeed(World world, EntityMinecart cart, int y, int x, int z) { - return 0.3f; - } -} diff --git a/src/main/java/tconstruct/world/entity/CartEntity.java b/src/main/java/tconstruct/world/entity/CartEntity.java deleted file mode 100644 index 97eb3f81..00000000 --- a/src/main/java/tconstruct/world/entity/CartEntity.java +++ /dev/null @@ -1,1237 +0,0 @@ -package tconstruct.world.entity; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockRail; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.monster.EntityIronGolem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import net.minecraft.world.WorldServer; - -import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import io.netty.buffer.ByteBuf; - -public class CartEntity extends Entity implements IInventory, IEntityAdditionalSpawnData { - - /** Array of item stacks stored in minecart (for storage minecarts). */ - protected ItemStack[] cargoItems; - - protected int fuel; - protected boolean isInReverse; - - /** The type of minecart, 2 for powered, 1 for storage. */ - private int pullcartType; - - public double pushX; - public double pushZ; - protected boolean field_82345_h; - - /** Minecart rotational logic matrix */ - protected static final int[][][] matrix = new int[][][] { { { 0, 0, -1 }, { 0, 0, 1 } }, - { { -1, 0, 0 }, { 1, 0, 0 } }, { { -1, -1, 0 }, { 1, 0, 0 } }, { { -1, 0, 0 }, { 1, -1, 0 } }, - { { 0, 0, -1 }, { 0, -1, 1 } }, { { 0, -1, -1 }, { 0, 0, 1 } }, { { 0, 0, 1 }, { 1, 0, 0 } }, - { { 0, 0, 1 }, { -1, 0, 0 } }, { { 0, 0, -1 }, { -1, 0, 0 } }, { { 0, 0, -1 }, { 1, 0, 0 } } }; - - /** appears to be the progress of the turn */ - protected int turnProgress; - - protected double minecartX; - protected double minecartY; - protected double minecartZ; - protected double minecartYaw; - protected double minecartPitch; - - @SideOnly(Side.CLIENT) - protected double velocityX; - - @SideOnly(Side.CLIENT) - protected double velocityY; - - @SideOnly(Side.CLIENT) - protected double velocityZ; - - /* Forge: Minecart Compatibility Layer Integration. */ - public static float defaultMaxSpeedRail = 0.4f; - public static float defaultMaxSpeedGround = 0.4f; - public static float defaultMaxSpeedAirLateral = 0.4f; - public static float defaultMaxSpeedAirVertical = -1f; - public static double defaultDragRidden = 0.996999979019165D; - public static double defaultDragEmpty = 0.9599999785423279D; - public static double defaultDragAir = 0.94999998807907104D; - protected boolean canUseRail = true; - protected boolean canBePushed = true; - - /* Instance versions of the above physics properties */ - protected float maxSpeedRail; - protected float maxSpeedGround; - protected float maxSpeedAirLateral; - protected float maxSpeedAirVertical; - protected double dragAir; - - Entity entityFollowing; - - public CartEntity(World par1World) { - super(par1World); - this.cargoItems = new ItemStack[36]; - this.fuel = 0; - this.isInReverse = false; - this.field_82345_h = true; - this.preventEntitySpawning = true; - this.setSize(0.98F, 0.7F); - this.yOffset = this.height / 2.0F; - this.stepHeight = 1.0f; - - maxSpeedRail = defaultMaxSpeedRail; - maxSpeedGround = defaultMaxSpeedGround; - maxSpeedAirLateral = defaultMaxSpeedAirLateral; - maxSpeedAirVertical = defaultMaxSpeedAirVertical; - dragAir = defaultDragAir; - } - - public CartEntity(World world, int type) { - this(world); - pullcartType = type; - } - - public CartEntity(World world, double x, double y, double z, int type) { - this(world); - this.setPosition(x, y + (double) this.yOffset, z); - this.motionX = 0.0D; - this.motionY = 0.0D; - this.motionZ = 0.0D; - this.prevPosX = x; - this.prevPosY = y; - this.prevPosZ = z; - this.pullcartType = type; - this.stepHeight = 1.0f; - } - - /** - * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to - * prevent them from trampling crops - */ - @Override - protected boolean canTriggerWalking() { - return false; - } - - @Override - protected void entityInit() { - this.dataWatcher.addObject(16, (byte) 0); - this.dataWatcher.addObject(17, 0); - this.dataWatcher.addObject(18, 1); - this.dataWatcher.addObject(19, 0); - } - - /** - * Returns a boundingBox used to collide the entity with other entities and blocks. This enables the entity to be - * pushable on contact, like boats or minecarts. - */ - @Override - public AxisAlignedBB getCollisionBox(Entity par1Entity) { - return par1Entity.boundingBox; - } - - /** - * returns the bounding box for this entity - */ - @Override - public AxisAlignedBB getBoundingBox() { - return this.boundingBox; - } - - /** - * Returns true if this entity should push and be pushed by other entities when colliding. - */ - @Override - public boolean canBePushed() { - return canBePushed; - } - - /** - * Returns the Y offset from the entity's position for any entity riding this one. - */ - @Override - public double getMountedYOffset() { - return (double) this.height * 0.0D - 0.30000001192092896D; - } - - /** - * Called when the entity is attacked. - */ - public boolean attackEntityFrom(DamageSource par1DamageSource, int par2) { - if (!this.worldObj.isRemote && !this.isDead) { - if (this.isEntityInvulnerable()) { - return false; - } else { - this.setRollingDirection(-this.getRollingDirection()); - this.setRollingAmplitude(10); - this.setBeenAttacked(); - this.setDamage(this.getDamage() + par2 * 10); - - if (par1DamageSource.getEntity() instanceof EntityPlayer - && ((EntityPlayer) par1DamageSource.getEntity()).capabilities.isCreativeMode) { - this.setDamage(100); - } - - if (this.getDamage() > 40) { - if (this.riddenByEntity != null) { - this.riddenByEntity.mountEntity(this); - } - - this.setDead(); - dropCartAsItem(); - } - - return true; - } - } else { - return true; - } - } - - @Override - @SideOnly(Side.CLIENT) - /** - * Setups the entity to do the hurt animation. Only used by packets in multiplayer. - */ - public void performHurtAnimation() { - this.setRollingDirection(-this.getRollingDirection()); - this.setRollingAmplitude(10); - this.setDamage(this.getDamage() + this.getDamage() * 10); - } - - /** - * Returns true if other Entities should be prevented from moving through this Entity. - */ - @Override - public boolean canBeCollidedWith() { - return !this.isDead; - } - - /** - * Will get destroyed next tick. - */ - @Override - public void setDead() { - if (this.field_82345_h) { - for (int var1 = 0; var1 < this.getSizeInventory(); ++var1) { - ItemStack var2 = this.getStackInSlot(var1); - - if (var2 != null) { - float var3 = this.rand.nextFloat() * 0.8F + 0.1F; - float var4 = this.rand.nextFloat() * 0.8F + 0.1F; - float var5 = this.rand.nextFloat() * 0.8F + 0.1F; - - while (var2.stackSize > 0) { - int var6 = this.rand.nextInt(21) + 10; - - if (var6 > var2.stackSize) { - var6 = var2.stackSize; - } - - var2.stackSize -= var6; - EntityItem entityitem = new EntityItem( - this.worldObj, - this.posX + (double) var3, - this.posY + (double) var4, - this.posZ + (double) var5, - new ItemStack(var2.getItem(), var6, var2.getItemDamage())); - - if (var2.hasTagCompound()) { - entityitem.getEntityItem().setTagCompound((NBTTagCompound) var2.getTagCompound().copy()); - } - - float var8 = 0.05F; - entityitem.motionX = (float) this.rand.nextGaussian() * var8; - entityitem.motionY = (float) this.rand.nextGaussian() * var8 + 0.2F; - entityitem.motionZ = (float) this.rand.nextGaussian() * var8; - this.worldObj.spawnEntityInWorld(entityitem); - } - } - } - } - - super.setDead(); - } - - /** - * Teleports the entity to another dimension. Params: Dimension number to teleport to - */ - @Override - public void travelToDimension(int par1) { - this.field_82345_h = false; - super.travelToDimension(par1); - } - - /** - * Called to update the entity's position/logic. - */ - @Override - public void onUpdate() { - if (this.getRollingAmplitude() > 0) { - this.setRollingAmplitude(this.getRollingAmplitude() - 1); - } - - if (this.getDamage() > 0) { - this.setDamage(this.getDamage() - 1); - } - - if (this.posY < -64.0D) { - this.kill(); - } - - if (this.isMinecartPowered() && this.rand.nextInt(4) == 0 - && pullcartType == 2 - && getClass() == CartEntity.class) { - this.worldObj.spawnParticle("largesmoke", this.posX, this.posY + 0.8D, this.posZ, 0.0D, 0.0D, 0.0D); - } - - int var2; - - if (!this.worldObj.isRemote && this.worldObj instanceof WorldServer) { - this.worldObj.theProfiler.startSection("portal"); - MinecraftServer var1 = ((WorldServer) this.worldObj).func_73046_m(); - var2 = this.getMaxInPortalTime(); - - // if (this.inPortal) { - // if (var1.getAllowNether()) { - // /* - // * if (this.ridingEntity == null && this.timeInPortal++ >= - // * var2) { this.timeInPortal = var2; this.timeUntilPortal = - // * this.getPortalCooldown(); byte var3; - // * - // * if (this.worldObj.provider.dimensionId == -1) { var3 = 0; - // * } else { var3 = -1; } - // * - // * this.travelToDimension(var3); } - // * - // * this.inPortal = false; - // */ - // } - // } else { - // /* - // * if (this.timeInPortal > 0) { this.timeInPortal -= 4; } - // * - // * if (this.timeInPortal < 0) { this.timeInPortal = 0; } - // */ - // } - - if (this.timeUntilPortal > 0) { - --this.timeUntilPortal; - } - - this.worldObj.theProfiler.endSection(); - } - - if (this.worldObj.isRemote) { - if (this.turnProgress > 0) { - double var46 = this.posX + (this.minecartX - this.posX) / (double) this.turnProgress; - double var48 = this.posY + (this.minecartY - this.posY) / (double) this.turnProgress; - double var5 = this.posZ + (this.minecartZ - this.posZ) / (double) this.turnProgress; - double var7 = MathHelper.wrapAngleTo180_double(this.minecartYaw - (double) this.rotationYaw); - this.rotationYaw = (float) ((double) this.rotationYaw + var7 / (double) this.turnProgress); - this.rotationPitch = (float) ((double) this.rotationPitch - + (this.minecartPitch - (double) this.rotationPitch) / (double) this.turnProgress); - --this.turnProgress; - this.setPosition(var46, var48, var5); - } else { - this.setPosition(this.posX, this.posY, this.posZ); - } - this.setRotation(this.rotationYaw, this.rotationPitch); - } else { - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; - this.motionY -= 0.03999999910593033D; - int var45 = MathHelper.floor_double(this.posX); - var2 = MathHelper.floor_double(this.posY); - int var47 = MathHelper.floor_double(this.posZ); - - if (BlockRail.func_150049_b_(this.worldObj, var45, var2 - 1, var47)) { - --var2; - } - - double var4 = 0.4D; - double var6 = 0.0078125D; - Block var8 = this.worldObj.getBlock(var45, var2, var47); - - moveMinecartOffRail(var45, var2, var47); - if (entityFollowing != null) moveTowardsEntity(entityFollowing); - - this.func_145775_I(); - this.rotationPitch = 0.0F; - double var49 = this.prevPosX - this.posX; - double var50 = this.prevPosZ - this.posZ; - - if (var49 * var49 + var50 * var50 > 0.001D) { - this.rotationYaw = (float) (Math.atan2(var50, var49) * 180.0D / Math.PI); - - if (this.isInReverse) { - this.rotationYaw += 180.0F; - } - } - - double var51 = MathHelper.wrapAngleTo180_float(this.rotationYaw - this.prevRotationYaw); - - if (var51 < -170.0D || var51 >= 170.0D) { - this.rotationYaw += 180.0F; - this.isInReverse = !this.isInReverse; - } - - this.setRotation(this.rotationYaw, this.rotationPitch); - - AxisAlignedBB box = boundingBox.expand(0.2D, 0.0D, 0.2D); - - List var15 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, box); - - if (var15 != null && !var15.isEmpty()) { - for (Entity var17 : var15) { - if (var17 != this.riddenByEntity && var17.canBePushed() && var17 instanceof CartEntity) { - var17.applyEntityCollision(this); - } - } - } - - if (this.riddenByEntity != null && this.riddenByEntity.isDead) { - if (this.riddenByEntity.ridingEntity == this) { - this.riddenByEntity.ridingEntity = null; - } - - this.riddenByEntity = null; - } - - updateFuel(); - } - } - - void moveTowardsEntity(Entity entity) { - // TConstruct.logger.info("Moving towards entity"); - /* - * double distX = this.posX - entity.posX; double distZ = this.posZ - entity.posZ; //posY = posY + 0.1; if - * (entity.posY > this.posY) motionY += 0.1; if (distX > 0.5 && distZ > 0.5) { motionX = -distX; motionZ = - * -distZ; } - */ - - double var15 = entity.posX; - double var19 = entity.posZ; - - if (this.calculateDistance(this.prevPosX, var15) > 1.5D - || this.calculateDistance(this.prevPosZ, var19) > 1.5D) { - double var28 = this.prevPosX; - double var30 = this.prevPosZ; - double var36 = this.calculateDistance(var28, var15); - double var38 = this.calculateDistance(var30, var19); - double var40 = 1.0D; - double var42 = 1.0D; - double var46; - double var44; - - if (var36 > var38) { - var46 = 1.0D; - var44 = var38 / var36; - var42 = var44 / 3.0D; - var40 = var46 / 3.0D; - } else if (var38 > var36) { - var44 = 1.0D; - var46 = var36 / var38; - var40 = var46 / 3.0D; - var42 = var44 / 3.0D; - } - - if (var15 > var28) { - this.motionX = var40; // * var26; - } else { - this.motionX = -var40; // * var26; - } - - if (var19 > var30) { - this.motionZ = var42; // * var26; - } else { - this.motionZ = -var42; // * var26; - } - } - - /* - * if (entity.posY > this.posY) motionY += 0.1; - */ - } - - public double calculateDistance(double pos1, double pos2) { - double distance = Math.abs(pos1 - pos2); // 0.0D; - /* - * double absPos1 = Math.abs(pos1); double absPos2 = Math.abs(pos2); if ((pos1 <= 0.0D || pos2 <= 0.0D) && (pos1 - * >= 0.0D || pos2 >= 0.0D)) { distance = absPos1 + absPos2; } else if (absPos1 > absPos2) { distance = absPos1 - * - absPos2; } else if (absPos2 > absPos1) { distance = absPos2 - absPos1; } - */ - - return distance; - } - - @SideOnly(Side.CLIENT) - public Vec3 func_70495_a(double par1, double par3, double par5, double par7) { - int var9 = MathHelper.floor_double(par1); - int var10 = MathHelper.floor_double(par3); - int var11 = MathHelper.floor_double(par5); - - if (BlockRail.func_150049_b_(this.worldObj, var9, var10 - 1, var11)) { - --var10; - } - - Block var12 = this.worldObj.getBlock(var9, var10, var11); - - return null; - } - - public Vec3 func_70489_a(double par1, double par3, double par5) { - int var7 = MathHelper.floor_double(par1); - int var8 = MathHelper.floor_double(par3); - int var9 = MathHelper.floor_double(par5); - - if (BlockRail.func_150049_b_(this.worldObj, var7, var8 - 1, var9)) { - --var8; - } - - Block var10 = this.worldObj.getBlock(var7, var8, var9); - - if (BlockRail.func_150051_a(var10)) { - int var11 = 0; - par3 = var8; - - if (var11 >= 2 && var11 <= 5) { - par3 = var8 + 1; - } - - int[][] var12 = matrix[var11]; - double var13; - double var15 = (double) var7 + 0.5D + (double) var12[0][0] * 0.5D; - double var17 = (double) var8 + 0.5D + (double) var12[0][1] * 0.5D; - double var19 = (double) var9 + 0.5D + (double) var12[0][2] * 0.5D; - double var21 = (double) var7 + 0.5D + (double) var12[1][0] * 0.5D; - double var23 = (double) var8 + 0.5D + (double) var12[1][1] * 0.5D; - double var25 = (double) var9 + 0.5D + (double) var12[1][2] * 0.5D; - double var27 = var21 - var15; - double var29 = (var23 - var17) * 2.0D; - double var31 = var25 - var19; - - if (var27 == 0.0D) { - par1 = (double) var7 + 0.5D; - var13 = par5 - (double) var9; - } else if (var31 == 0.0D) { - par5 = (double) var9 + 0.5D; - var13 = par1 - (double) var7; - } else { - double var33 = par1 - var15; - double var35 = par5 - var19; - var13 = (var33 * var27 + var35 * var31) * 2.0D; - } - - par1 = var15 + var27 * var13; - par3 = var17 + var29 * var13; - par5 = var19 + var31 * var13; - - if (var29 < 0.0D) { - ++par3; - } - - if (var29 > 0.0D) { - par3 += 0.5D; - } - - return Vec3.createVectorHelper(par1, par3, par5); - } else { - return null; - } - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { - par1NBTTagCompound.setInteger("Type", pullcartType); - - if (isPoweredCart()) { - par1NBTTagCompound.setDouble("PushX", this.pushX); - par1NBTTagCompound.setDouble("PushZ", this.pushZ); - par1NBTTagCompound.setInteger("Fuel", this.fuel); - } - - if (getSizeInventory() > 0) { - NBTTagList var2 = new NBTTagList(); - - for (int var3 = 0; var3 < this.cargoItems.length; ++var3) { - if (this.cargoItems[var3] != null) { - NBTTagCompound var4 = new NBTTagCompound(); - var4.setByte("Slot", (byte) var3); - this.cargoItems[var3].writeToNBT(var4); - var2.appendTag(var4); - } - } - - par1NBTTagCompound.setTag("Items", var2); - } - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { - pullcartType = par1NBTTagCompound.getInteger("Type"); - - if (isPoweredCart()) { - this.pushX = par1NBTTagCompound.getDouble("PushX"); - this.pushZ = par1NBTTagCompound.getDouble("PushZ"); - try { - this.fuel = par1NBTTagCompound.getInteger("Fuel"); - } catch (ClassCastException e) { - this.fuel = par1NBTTagCompound.getShort("Fuel"); - } - } - - if (getSizeInventory() > 0) { - NBTTagList var2 = par1NBTTagCompound.getTagList("Items", 10); - this.cargoItems = new ItemStack[this.getSizeInventory()]; - - for (int var3 = 0; var3 < var2.tagCount(); ++var3) { - NBTTagCompound var4 = var2.getCompoundTagAt(var3); - int var5 = var4.getByte("Slot") & 255; - - if (var5 >= 0 && var5 < this.cargoItems.length) { - this.cargoItems[var5] = ItemStack.loadItemStackFromNBT(var4); - } - } - } - } - - @Override - @SideOnly(Side.CLIENT) - public float getShadowSize() { - return 0.5F; - } - - /** - * Applies a velocity to each of the entities pushing them away from each other. Args: entity - */ - @Override - public void applyEntityCollision(Entity par1Entity) { - if (!this.worldObj.isRemote) { - if (par1Entity != this.riddenByEntity) { - if (par1Entity instanceof EntityLiving && !(par1Entity instanceof EntityIronGolem) - && canBeRidden() - && this.motionX * this.motionX + this.motionZ * this.motionZ > 0.01D - && this.riddenByEntity == null - && par1Entity.ridingEntity == null) { - par1Entity.mountEntity(this); - } - - double var2 = par1Entity.posX - this.posX; - double var4 = par1Entity.posZ - this.posZ; - double var6 = var2 * var2 + var4 * var4; - - if (var6 >= 9.999999747378752E-5D) { - var6 = MathHelper.sqrt_double(var6); - var2 /= var6; - var4 /= var6; - double var8 = 1.0D / var6; - - if (var8 > 1.0D) { - var8 = 1.0D; - } - - var2 *= var8; - var4 *= var8; - var2 *= 0.10000000149011612D; - var4 *= 0.10000000149011612D; - var2 *= 1.0F - this.entityCollisionReduction; - var4 *= 1.0F - this.entityCollisionReduction; - var2 *= 0.5D; - var4 *= 0.5D; - - if (par1Entity instanceof CartEntity) { - double var10 = par1Entity.posX - this.posX; - double var12 = par1Entity.posZ - this.posZ; - Vec3 var14 = Vec3.createVectorHelper(var10, 0.0D, var12).normalize(); - Vec3 var15 = Vec3.createVectorHelper( - MathHelper.cos(this.rotationYaw * (float) Math.PI / 180.0F), - 0.0D, - MathHelper.sin(this.rotationYaw * (float) Math.PI / 180.0F)).normalize(); - double var16 = Math.abs(var14.dotProduct(var15)); - - if (var16 < 0.8D) { - return; - } - - double var18 = par1Entity.motionX + this.motionX; - double var20 = par1Entity.motionZ + this.motionZ; - - if (((CartEntity) par1Entity).isPoweredCart() && !isPoweredCart()) { - this.motionX *= 0.20000000298023224D; - this.motionZ *= 0.20000000298023224D; - this.addVelocity(par1Entity.motionX - var2, 0.0D, par1Entity.motionZ - var4); - par1Entity.motionX *= 0.949999988079071D; - par1Entity.motionZ *= 0.949999988079071D; - } else if (!((CartEntity) par1Entity).isPoweredCart() && isPoweredCart()) { - par1Entity.motionX *= 0.20000000298023224D; - par1Entity.motionZ *= 0.20000000298023224D; - par1Entity.addVelocity(this.motionX + var2, 0.0D, this.motionZ + var4); - this.motionX *= 0.949999988079071D; - this.motionZ *= 0.949999988079071D; - } else { - var18 /= 2.0D; - var20 /= 2.0D; - this.motionX *= 0.20000000298023224D; - this.motionZ *= 0.20000000298023224D; - this.addVelocity(var18 - var2, 0.0D, var20 - var4); - par1Entity.motionX *= 0.20000000298023224D; - par1Entity.motionZ *= 0.20000000298023224D; - par1Entity.addVelocity(var18 + var2, 0.0D, var20 + var4); - } - } else { - this.addVelocity(-var2, 0.0D, -var4); - par1Entity.addVelocity(var2 / 4.0D, 0.0D, var4 / 4.0D); - } - } - } - } - } - - /** - * Returns the number of slots in the inventory. - */ - @Override - public int getSizeInventory() { - return (pullcartType == 1 && getClass() == CartEntity.class ? 27 : 0); - } - - /** - * Returns the stack in slot i - */ - @Override - public ItemStack getStackInSlot(int par1) { - return this.cargoItems[par1]; - } - - /** - * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a - * new stack. - */ - @Override - public ItemStack decrStackSize(int par1, int par2) { - if (this.cargoItems[par1] != null) { - ItemStack var3; - if (this.cargoItems[par1].stackSize <= par2) { - var3 = this.cargoItems[par1]; - this.cargoItems[par1] = null; - } else { - var3 = this.cargoItems[par1].splitStack(par2); - if (this.cargoItems[par1].stackSize == 0) { - this.cargoItems[par1] = null; - } - } - return var3; - } else { - return null; - } - } - - /** - * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - - * like when you close a workbench GUI. - */ - @Override - public ItemStack getStackInSlotOnClosing(int par1) { - if (this.cargoItems[par1] != null) { - ItemStack var2 = this.cargoItems[par1]; - this.cargoItems[par1] = null; - return var2; - } else { - return null; - } - } - - /** - * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). - */ - @Override - public void setInventorySlotContents(int par1, ItemStack par2ItemStack) { - this.cargoItems[par1] = par2ItemStack; - - if (par2ItemStack != null && par2ItemStack.stackSize > this.getInventoryStackLimit()) { - par2ItemStack.stackSize = this.getInventoryStackLimit(); - } - } - - /** - * Returns the name of the inventory. - */ - public String getInvName() { - return "container.minecart"; - } - - /** - * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't - * this more of a set than a get?* - */ - @Override - public int getInventoryStackLimit() { - return 64; - } - - /** - * Called when an the contents of an Inventory change, usually - */ - @Override - public void markDirty() {} - - /** - * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. - */ - public boolean interact(EntityPlayer player) { - if (player.isSneaking()) { - if (entityFollowing == null) { - entityFollowing = player; - } else { - entityFollowing = null; - } - return true; - } - if (canBeRidden()) { - if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer - && this.riddenByEntity != player) { - return true; - } - - if (!this.worldObj.isRemote) { - player.mountEntity(this); - } - } else if (getSizeInventory() > 0) { - if (!this.worldObj.isRemote) { - player.displayGUIChest(this); - } - } else if (this.pullcartType == 2 && getClass() == CartEntity.class) { - ItemStack var2 = player.inventory.getCurrentItem(); - - if (var2 != null && var2.getItem() == Items.coal) { - if (--var2.stackSize == 0) { - player.inventory.setInventorySlotContents(player.inventory.currentItem, null); - } - - this.fuel += 3600; - } - - this.pushX = this.posX - player.posX; - this.pushZ = this.posZ - player.posZ; - } - - return true; - } - - @Override - @SideOnly(Side.CLIENT) - /** - * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, - * posY, posZ, yaw, pitch - */ - public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) { - this.minecartX = par1; - this.minecartY = par3; - this.minecartZ = par5; - this.minecartYaw = par7; - this.minecartPitch = par8; - this.turnProgress = par9 + 2; - this.motionX = this.velocityX; - this.motionY = this.velocityY; - this.motionZ = this.velocityZ; - } - - @Override - @SideOnly(Side.CLIENT) - /** - * Sets the velocity to the args. Args: x, y, z - */ - public void setVelocity(double par1, double par3, double par5) { - this.velocityX = this.motionX = par1; - this.velocityY = this.motionY = par3; - this.velocityZ = this.motionZ = par5; - } - - /** - * Do not make give this method the name canInteractWith because it clashes with Container - */ - @Override - public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) { - return !this.isDead && par1EntityPlayer.getDistanceSqToEntity(this) <= 64.0D; - } - - /** - * Is this minecart powered (Fuel > 0) - */ - public boolean isMinecartPowered() { - return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; - } - - /** - * Set if this minecart is powered (Fuel > 0) - */ - protected void setMinecartPowered(boolean par1) { - if (par1) { - this.dataWatcher.updateObject(16, (byte) (this.dataWatcher.getWatchableObjectByte(16) | 1)); - } else { - this.dataWatcher.updateObject(16, (byte) (this.dataWatcher.getWatchableObjectByte(16) & -2)); - } - } - - public void openChest() {} - - public void closeChest() {} - - /** - * Sets the current amount of damage the minecart has taken. Decreases over time. The cart breaks when this is over - * 40. - */ - public void setDamage(int par1) { - this.dataWatcher.updateObject(19, par1); - } - - /** - * Gets the current amount of damage the minecart has taken. Decreases over time. The cart breaks when this is over - * 40. - */ - public int getDamage() { - return this.dataWatcher.getWatchableObjectInt(19); - } - - public void setRollingAmplitude(int par1) { - this.dataWatcher.updateObject(17, par1); - } - - public int getRollingAmplitude() { - return this.dataWatcher.getWatchableObjectInt(17); - } - - public void setRollingDirection(int par1) { - this.dataWatcher.updateObject(18, par1); - } - - public int getRollingDirection() { - return this.dataWatcher.getWatchableObjectInt(18); - } - - /** - * Drops the cart as a item. The exact item dropped is defined by getItemDropped(). - */ - public void dropCartAsItem() { - for (ItemStack item : getItemsDropped()) { - entityDropItem(item, 0); - } - } - - /** - * Override this to define which items your cart drops when broken. This does not include items contained in the - * inventory, that is handled elsewhere. - * - * @return A list of items dropped. - */ - public List getItemsDropped() { - /* - * List items = new ArrayList(); items.add(new ItemStack(Item.minecartEmpty)); - * switch(cartType) { case 1: items.add(new ItemStack(Block.chest)); break; case 2: items.add(new - * ItemStack(Block.stoneOvenIdle)); break; } return items; - */ - return new ArrayList<>(); - } - - /** - * This function returns an ItemStack that represents this cart. This should be an ItemStack that can be used by the - * player to place the cart. This is the item that was registered with the cart via the registerMinecart function, - * but is not necessary the item the cart drops when destroyed. - * - * @return An ItemStack that can be used to place the cart. - */ - public ItemStack getCartItem() { - return null; - // return MinecartRegistry.getItemForCart(this); - } - - /** - * Returns true if this cart is self propelled. - * - * @return True if powered. - */ - public boolean isPoweredCart() { - return pullcartType == 2 && getClass() == CartEntity.class; - } - - /** - * Returns true if this cart is a storage cart Some carts may have inventories but not be storage carts and some - * carts without inventories may be storage carts. - * - * @return True if this cart should be classified as a storage cart. - */ - public boolean isStorageCart() { - return pullcartType == 1 && getClass() == CartEntity.class; - } - - /** - * Returns true if this cart can be ridden by an Entity. - * - * @return True if this cart can be ridden. - */ - public boolean canBeRidden() { - return pullcartType == 0 && getClass() == CartEntity.class; - } - - /** - * Returns true if this cart can currently use rails. This function is mainly used to gracefully detach a minecart - * from a rail. - * - * @return True if the minecart can use rails. - */ - public boolean canUseRail() { - return false; - } - - /** - * Set whether the minecart can use rails. This function is mainly used to gracefully detach a minecart from a rail. - * - * @param use Whether the minecart can currently use rails. - */ - public void setCanUseRail(boolean use) { - canUseRail = use; - } - - /** - * Return false if this cart should not call IRail.onMinecartPass() and should ignore Powered Rails. - * - * @return True if this cart should call IRail.onMinecartPass(). - */ - public boolean shouldDoRailFunctions() { - return true; - } - - /** - * Simply returns the minecartType variable. - * - * @return minecartType - */ - public int getCartType() { - return pullcartType; - } - - /** - * Carts should return their drag factor here - * - * @return The drag rate. - */ - protected double getDrag() { - return riddenByEntity != null ? defaultDragRidden : defaultDragEmpty; - } - - /** - * Moved to allow overrides. This code applies drag and updates push forces. - */ - protected void applyDragAndPushForces() { - if (isPoweredCart()) { - double d27 = MathHelper.sqrt_double(pushX * pushX + pushZ * pushZ); - if (d27 > 0.01D) { - pushX /= d27; - pushZ /= d27; - double d29 = 0.04; - motionX *= 0.8D; - motionY *= 0.0D; - motionZ *= 0.8D; - motionX += pushX * d29; - motionZ += pushZ * d29; - } else { - motionX *= 0.9D; - motionY *= 0.0D; - motionZ *= 0.9D; - } - } - motionX *= getDrag(); - motionY *= 0.0D; - motionZ *= getDrag(); - } - - /** - * Moved to allow overrides. This code updates push forces. - */ - protected void updatePushForces() { - if (isPoweredCart()) { - double push = MathHelper.sqrt_double(pushX * pushX + pushZ * pushZ); - if (push > 0.01D && motionX * motionX + motionZ * motionZ > 0.001D) { - pushX /= push; - pushZ /= push; - if (pushX * motionX + pushZ * motionZ < 0.0D) { - pushX = 0.0D; - pushZ = 0.0D; - } else { - pushX = motionX; - pushZ = motionZ; - } - } - } - } - - /** - * Moved to allow overrides. This code handles minecart movement and speed capping when not on a rail. - */ - protected void moveMinecartOffRail(int i, int j, int k) { - double d2 = getMaxSpeedGround(); - if (!onGround) { - d2 = getMaxSpeedAirLateral(); - } - if (motionX < -d2) motionX = -d2; - if (motionX > d2) motionX = d2; - if (motionZ < -d2) motionZ = -d2; - if (motionZ > d2) motionZ = d2; - double moveY = motionY; - if (getMaxSpeedAirVertical() > 0 && motionY > getMaxSpeedAirVertical()) { - moveY = getMaxSpeedAirVertical(); - if (Math.abs(motionX) < 0.3f && Math.abs(motionZ) < 0.3f) { - moveY = 0.15f; - motionY = moveY; - } - } - if (onGround) { - motionX *= 0.5D; - motionY *= 0.5D; - motionZ *= 0.5D; - } - moveEntity(motionX, moveY, motionZ); - if (!onGround) { - motionX *= getDragAir(); - motionY *= getDragAir(); - motionZ *= getDragAir(); - } - } - - /** - * Moved to allow overrides. This code applies fuel consumption. - */ - protected void updateFuel() { - if (fuel > 0) fuel--; - if (fuel <= 0) pushX = pushZ = 0.0D; - setMinecartPowered(fuel > 0); - } - - /** - * Moved to allow overrides, This code handle slopes affecting velocity. - * - * @param metadata The blocks position metadata - */ - protected void adjustSlopeVelocities(int metadata) { - double acceleration = 0.0078125D; - if (metadata == 2) { - motionX -= acceleration; - } else if (metadata == 3) { - motionX += acceleration; - } else if (metadata == 4) { - motionZ += acceleration; - } else if (metadata == 5) { - motionZ -= acceleration; - } - } - - /** - * Getters/setters for physics variables - */ - - /** - * Returns the carts max speed. Carts going faster than 1.1 cause issues with chunk loading. Carts cant traverse - * slopes or corners at greater than 0.5 - 0.6. This value is compared with the rails max speed to determine the - * carts current max speed. A normal rails max speed is 0.4. - * - * @return Carts max speed. - */ - public float getMaxSpeedRail() { - return maxSpeedRail; - } - - public void setMaxSpeedRail(float value) { - maxSpeedRail = value; - } - - public float getMaxSpeedGround() { - return maxSpeedGround; - } - - public void setMaxSpeedGround(float value) { - maxSpeedGround = value; - } - - public float getMaxSpeedAirLateral() { - return maxSpeedAirLateral; - } - - public void setMaxSpeedAirLateral(float value) { - maxSpeedAirLateral = value; - } - - public float getMaxSpeedAirVertical() { - return maxSpeedAirVertical; - } - - public void setMaxSpeedAirVertical(float value) { - maxSpeedAirVertical = value; - } - - public double getDragAir() { - return dragAir; - } - - public void setDragAir(double value) { - dragAir = value; - } - - @Override - public void writeSpawnData(ByteBuf data) { - data.writeInt(pullcartType); - } - - @Override - public void readSpawnData(ByteBuf data) { - pullcartType = data.readInt(); - } - - @Override - public boolean isItemValidForSlot(int i, ItemStack itemstack) { - return false; - } - - @Override - public String getInventoryName() { - // TODO get inventory name - return null; - } - - @Override - public boolean hasCustomInventoryName() { - return false; - } - - @Override - public void openInventory() {} - - @Override - public void closeInventory() {} -} diff --git a/src/main/resources/assets/tinker/lang/cs_CZ.lang b/src/main/resources/assets/tinker/lang/cs_CZ.lang index a32afdc3..bd0238e0 100644 --- a/src/main/resources/assets/tinker/lang/cs_CZ.lang +++ b/src/main/resources/assets/tinker/lang/cs_CZ.lang @@ -114,8 +114,6 @@ block.fancybrick.ardite.name=Hezké arditové cihly block.fancybrick.cobalt.name=Hezké kobaltové cihly block.fancybrick.manyullyn.name=Hezké manyullynové cihly -tile.rail.wood.name=Dřevěná kolej - tile.cloth.white.slab.name=Vlnový půlblok tile.cloth.orange.slab.name=Oranžový vlnový půlblok tile.cloth.magenta.slab.name=Purporový vlnový půlblok diff --git a/src/main/resources/assets/tinker/lang/de_DE.lang b/src/main/resources/assets/tinker/lang/de_DE.lang index a94dd866..0e9df459 100644 --- a/src/main/resources/assets/tinker/lang/de_DE.lang +++ b/src/main/resources/assets/tinker/lang/de_DE.lang @@ -114,8 +114,6 @@ block.fancybrick.ardite.name=Schicke Arditeziegel block.fancybrick.cobalt.name=Schicke Kobaltziegel block.fancybrick.manyullyn.name=Schicke Manyullynziegel -tile.rail.wood.name=Hölzerne Schiene - tile.cloth.white.slab.name=Wollstufe tile.cloth.orange.slab.name=Orange Wollstufe tile.cloth.magenta.slab.name=Magenta Wollstufe diff --git a/src/main/resources/assets/tinker/lang/en_PT.lang b/src/main/resources/assets/tinker/lang/en_PT.lang index 3db7bb72..9e2cc1dc 100644 --- a/src/main/resources/assets/tinker/lang/en_PT.lang +++ b/src/main/resources/assets/tinker/lang/en_PT.lang @@ -105,8 +105,6 @@ block.fancybrick.obsidian.ingot.name=Fancy Obsidian Brick block.fancybrick.stone.road.name=Stone Road block.fancybrick.stone.name=Fancy Stone Brick -tile.rail.wood.name=Timbers Ta Shiver - tile.cloth.white.slab.name=Wool Slab tile.cloth.orange.slab.name=Orange Wool Slab tile.cloth.magenta.slab.name=Magenta Wool Slab diff --git a/src/main/resources/assets/tinker/lang/en_US.lang b/src/main/resources/assets/tinker/lang/en_US.lang index d8fd249a..36aaedfd 100644 --- a/src/main/resources/assets/tinker/lang/en_US.lang +++ b/src/main/resources/assets/tinker/lang/en_US.lang @@ -128,8 +128,6 @@ block.fancybrick.ardite.name=Fancy Ardite Brick block.fancybrick.cobalt.name=Fancy Cobalt Brick block.fancybrick.manyullyn.name=Fancy Manyullyn Brick -tile.rail.wood.name=Wooden Rail - tile.cloth.white.slab.name=Wool Slab tile.cloth.orange.slab.name=Orange Wool Slab tile.cloth.magenta.slab.name=Magenta Wool Slab diff --git a/src/main/resources/assets/tinker/lang/fr_FR.lang b/src/main/resources/assets/tinker/lang/fr_FR.lang index 56b08fc9..91ab36bd 100644 --- a/src/main/resources/assets/tinker/lang/fr_FR.lang +++ b/src/main/resources/assets/tinker/lang/fr_FR.lang @@ -114,8 +114,6 @@ block.fancybrick.ardite.name=Brique d'ardite chic block.fancybrick.cobalt.name=Brique de cobalt chic block.fancybrick.manyullyn.name=Brique de manyullyn chic -tile.rail.wood.name=Rail en bois - tile.cloth.white.slab.name=Dalle de laine tile.cloth.orange.slab.name=Dalle de laine orange tile.cloth.magenta.slab.name=Dalle de laine magenta diff --git a/src/main/resources/assets/tinker/lang/it_IT.lang b/src/main/resources/assets/tinker/lang/it_IT.lang index 9bb5509f..6081bf28 100644 --- a/src/main/resources/assets/tinker/lang/it_IT.lang +++ b/src/main/resources/assets/tinker/lang/it_IT.lang @@ -106,8 +106,6 @@ block.fancybrick.obsidian.ingot.name=Ossidiana concia decorativa block.fancybrick.stone.road.name=Strada di pietra block.fancybrick.stone.name=Pietra concia decorativa -tile.rail.wood.name=Rotaia di legno - tile.cloth.white.slab.name=Lastra di lana bianca tile.cloth.orange.slab.name=Lastra di lana arancione tile.cloth.magenta.slab.name=Lastra di lana magenta diff --git a/src/main/resources/assets/tinker/lang/ja_JP.lang b/src/main/resources/assets/tinker/lang/ja_JP.lang index c3044bd8..81e6153c 100644 --- a/src/main/resources/assets/tinker/lang/ja_JP.lang +++ b/src/main/resources/assets/tinker/lang/ja_JP.lang @@ -106,8 +106,6 @@ block.fancybrick.obsidian.ingot.name=Fancy Obsidian Brick block.fancybrick.stone.road.name=Stone Road block.fancybrick.stone.name=Fancy Stone Brick -tile.rail.wood.name=木のレール - tile.cloth.white.slab.name=羊毛ハーフブロック tile.cloth.orange.slab.name=橙色の羊毛ハーフブロック tile.cloth.magenta.slab.name=赤紫色の羊毛ハーフブロック diff --git a/src/main/resources/assets/tinker/lang/ko_KR.lang b/src/main/resources/assets/tinker/lang/ko_KR.lang index c2bf1e4c..0e3b8b7f 100644 --- a/src/main/resources/assets/tinker/lang/ko_KR.lang +++ b/src/main/resources/assets/tinker/lang/ko_KR.lang @@ -106,8 +106,6 @@ block.fancybrick.obsidian.ingot.name=화려한 흑요석 주괴 벽돌 block.fancybrick.stone.road.name=돌 도로 block.fancybrick.stone.name=화려한 석재 벽돌 -tile.rail.wood.name=나무 레일 - tile.cloth.white.slab.name=양털 반 블럭 tile.cloth.orange.slab.name=주황색 양털 반 블럭 tile.cloth.magenta.slab.name=다홍색 양털 반 블럭 diff --git a/src/main/resources/assets/tinker/lang/pt_BR.lang b/src/main/resources/assets/tinker/lang/pt_BR.lang index fc28adf9..3ad8bf72 100644 --- a/src/main/resources/assets/tinker/lang/pt_BR.lang +++ b/src/main/resources/assets/tinker/lang/pt_BR.lang @@ -106,8 +106,6 @@ block.fancybrick.obsidian.ingot.name=Tijolo Bonito de Obsidiana block.fancybrick.stone.road.name=Pavimento de Pedra block.fancybrick.stone.name=Tijolo Bonito de Pedra -tile.rail.wood.name=Trilho de Madeira - tile.cloth.white.slab.name=Laje de Lã tile.cloth.orange.slab.name=Laje de Lã Laranja tile.cloth.magenta.slab.name=Laje de Lã Magenta diff --git a/src/main/resources/assets/tinker/lang/pt_PT.lang b/src/main/resources/assets/tinker/lang/pt_PT.lang index 002ff886..23db1b89 100644 --- a/src/main/resources/assets/tinker/lang/pt_PT.lang +++ b/src/main/resources/assets/tinker/lang/pt_PT.lang @@ -106,8 +106,6 @@ block.fancybrick.obsidian.ingot.name=Tijolo Bonito de Obsidiana block.fancybrick.stone.road.name=Pavimento de Pedra block.fancybrick.stone.name=Tijolo Bonito de Pedra -tile.rail.wood.name=Trilho de Madeira - tile.cloth.white.slab.name=Laje de Lã tile.cloth.orange.slab.name=Laje de Lã Laranja tile.cloth.magenta.slab.name=Laje de Lã Magenta diff --git a/src/main/resources/assets/tinker/lang/ru_RU.lang b/src/main/resources/assets/tinker/lang/ru_RU.lang index 376e3b3c..8fa8987c 100644 --- a/src/main/resources/assets/tinker/lang/ru_RU.lang +++ b/src/main/resources/assets/tinker/lang/ru_RU.lang @@ -117,8 +117,6 @@ block.fancybrick.ardite.name=Красивый ардитовый кирпич block.fancybrick.cobalt.name=Красивый кобальтовый кирпич block.fancybrick.manyullyn.name=Красивый мануллиновый кирпич -tile.rail.wood.name=Деревянные рельсы - tile.cloth.white.slab.name=Плита из шерсти tile.cloth.orange.slab.name=Плита из оранжевой шерсти tile.cloth.magenta.slab.name=Плита из сиреневой шерсти diff --git a/src/main/resources/assets/tinker/lang/uk_UA.lang b/src/main/resources/assets/tinker/lang/uk_UA.lang index 89570308..b7ccea6d 100644 --- a/src/main/resources/assets/tinker/lang/uk_UA.lang +++ b/src/main/resources/assets/tinker/lang/uk_UA.lang @@ -116,8 +116,6 @@ block.fancybrick.ardite.name=Вишукана ардитова цегла block.fancybrick.cobalt.name=Вишукана кобальтова цегла block.fancybrick.manyullyn.name=Вишукана манулінова цегла -tile.rail.wood.name=Дерев'яні рейки - tile.cloth.white.slab.name=Вовняна плита tile.cloth.orange.slab.name=Помаранчева вовняна плита tile.cloth.magenta.slab.name=Пурпурова вовняна плита diff --git a/src/main/resources/assets/tinker/lang/zh_CN.lang b/src/main/resources/assets/tinker/lang/zh_CN.lang index 2b11b5c0..8314677b 100644 --- a/src/main/resources/assets/tinker/lang/zh_CN.lang +++ b/src/main/resources/assets/tinker/lang/zh_CN.lang @@ -116,8 +116,6 @@ block.fancybrick.ardite.name=平滑阿迪特砖块 block.fancybrick.cobalt.name=平滑钴砖块 block.fancybrick.manyullyn.name=平滑玛玉灵砖块 -tile.rail.wood.name=木轨道 - tile.cloth.white.slab.name=羊毛台阶 tile.cloth.orange.slab.name=橙色羊毛台阶 tile.cloth.magenta.slab.name=品红色羊毛台阶 diff --git a/src/main/resources/assets/tinker/lang/zh_TW.lang b/src/main/resources/assets/tinker/lang/zh_TW.lang index f777eb73..fdeb9cbf 100644 --- a/src/main/resources/assets/tinker/lang/zh_TW.lang +++ b/src/main/resources/assets/tinker/lang/zh_TW.lang @@ -105,8 +105,6 @@ block.fancybrick.obsidian.ingot.name=平滑黑曜石錠磚塊 block.fancybrick.stone.road.name=鋪路石塊 block.fancybrick.stone.name=平滑石磚塊 -tile.rail.wood.name=木軌道 - tile.cloth.white.slab.name=羊毛台階 tile.cloth.orange.slab.name=橙色羊毛台階 tile.cloth.magenta.slab.name=品紅色羊毛台階 diff --git a/src/main/resources/assets/tinker/manuals/en_US/diary.xml b/src/main/resources/assets/tinker/manuals/en_US/diary.xml index 01beed1c..5fc4d7e1 100644 --- a/src/main/resources/assets/tinker/manuals/en_US/diary.xml +++ b/src/main/resources/assets/tinker/manuals/en_US/diary.xml @@ -131,37 +131,22 @@ I have some ideas for creating tools, but for that I need a large place to creat Tinker's Log #23: - -Today I made something strange. It's round, wooden, and doesn't look like anything I've ever seen. Someone came by and said it was a "wheel" and that they were great fun to roll around. I wonder what else it could be used for? +I have all these tools laying around with little notes on what each one does. Instead of leaving them scattered about, I think I will create one place to store them. Tinker's Log #24: -I made a few more of the wheels to get some practice in. I had some fun rolling them around, rolling them in pairs, and then one ended up beside my boat. It just looked so natural I had to start putting them together. - - - -Tinker's Log #25: - -I think I'm on to something here. Combining the boat with the wheel made it work something like a minecart, only I can pull it around places. It feels a little small though. - -Tinker's Log #26: - -I have all these tools laying around with little notes on what each one does. Instead of leaving them scattered about, I think I will create one place to store them. - - - -Tinker's Log #27: - I went exploring and found some new ores today. They're colors I've never seen before, and they don't shatter on impact like iron does. I wonder what I can do with these? + + -Tinker's Log #28: + + +Tinker's Log #25: The normal furnace is nice for keeping warm, but it leaves something to be desired for processing metal. I've dug a pit and lined it with some clay, gathered lava nearby, and put ore in the center in an attempt to improve on the design. The results were quite interesting. - - -The more lava I fed into the pit the hotter the material became. Eventually the whole thing liquified. I broke open the side of the pit with a cauldron in an attempt to catch the material, but it went everywhere. There were some remnants left in the pit as well. +The more lava I fed into the pit the hotter the material became. Eventually the whole thing liquified. I broke open the side of the pit with a cauldron in an attempt to catch the material, but it went everywhere. There were some remnants left in the pit as well. -Raw ore still has parts of stone in it. There must be a way to remove the excess. +Raw ore still has parts of stone in it. There must be a way to remove the excess. \ No newline at end of file From d6d7a699fdc084680163d729aa8ac0611981a310 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8F=E3=81=81=E3=83=BC=E3=82=8A=E3=81=83?= <39122497+Quarri6343@users.noreply.github.com> Date: Sun, 20 Apr 2025 00:31:07 +0900 Subject: [PATCH 02/15] Fluids use still texture as fallback when flowing texture is missing (#168) Co-authored-by: Maya <10861407+serenibyss@users.noreply.github.com> --- src/main/java/tconstruct/client/BlockSkinRenderHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/tconstruct/client/BlockSkinRenderHelper.java b/src/main/java/tconstruct/client/BlockSkinRenderHelper.java index 11cf9eed..a18a85a6 100644 --- a/src/main/java/tconstruct/client/BlockSkinRenderHelper.java +++ b/src/main/java/tconstruct/client/BlockSkinRenderHelper.java @@ -981,8 +981,8 @@ public class BlockSkinRenderHelper { } // safety + if (flowingIcon == null) flowingIcon = stillIcon != null ? stillIcon : FluidRegistry.WATER.getFlowingIcon(); if (stillIcon == null) stillIcon = FluidRegistry.WATER.getStillIcon(); - if (flowingIcon == null) flowingIcon = FluidRegistry.WATER.getFlowingIcon(); boolean raf = renderer.renderAllFaces; renderer.renderAllFaces = true; From 2a7e9b350acad3f9435b5b5e87a40b1e690374f2 Mon Sep 17 00:00:00 2001 From: RiggZh Date: Mon, 21 Apr 2025 03:41:51 +0800 Subject: [PATCH 03/15] infinite loop fix & tool localization optimization (#167) --- .../library/crafting/ToolBuilder.java | 7 +--- .../tconstruct/library/tools/ToolCore.java | 6 +++ .../tools/logic/ToolForgeLogic.java | 12 ------ .../tools/logic/ToolStationLogic.java | 42 ++++++++++--------- .../assets/tinker/manuals/zh_CN/diary.xml | 30 ++++--------- 5 files changed, 39 insertions(+), 58 deletions(-) diff --git a/src/main/java/tconstruct/library/crafting/ToolBuilder.java b/src/main/java/tconstruct/library/crafting/ToolBuilder.java index 3d0ef5dc..8946f16a 100644 --- a/src/main/java/tconstruct/library/crafting/ToolBuilder.java +++ b/src/main/java/tconstruct/library/crafting/ToolBuilder.java @@ -268,12 +268,7 @@ public class ToolBuilder { if (name != null && !name.equals("")) { compound.setTag("display", new NBTTagCompound()); - compound.getCompoundTag("display").setString("Name", "\u00A7f" + name); - } - // set a nice default name - else { - compound.setTag("display", new NBTTagCompound()); - compound.getCompoundTag("display").setString("Name", "\u00A7f" + defaultToolName(headMat, item)); + compound.getCompoundTag("display").setString("Name", name); } ToolCraftEvent.NormalTool event = new ToolCraftEvent.NormalTool( diff --git a/src/main/java/tconstruct/library/tools/ToolCore.java b/src/main/java/tconstruct/library/tools/ToolCore.java index 10a9696f..7be6a814 100644 --- a/src/main/java/tconstruct/library/tools/ToolCore.java +++ b/src/main/java/tconstruct/library/tools/ToolCore.java @@ -822,4 +822,10 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IEq return curTags.equals(prevTags); } // end of TE support section + + @Override + public String getItemStackDisplayName(ItemStack stack) { + String name = ToolBuilder.defaultToolName(stack); + return name != null ? name : super.getItemStackDisplayName(stack); + } } diff --git a/src/main/java/tconstruct/tools/logic/ToolForgeLogic.java b/src/main/java/tconstruct/tools/logic/ToolForgeLogic.java index 5c85edd4..22d4a026 100644 --- a/src/main/java/tconstruct/tools/logic/ToolForgeLogic.java +++ b/src/main/java/tconstruct/tools/logic/ToolForgeLogic.java @@ -6,12 +6,10 @@ import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -import tconstruct.TConstruct; import tconstruct.library.crafting.ModifyBuilder; import tconstruct.library.crafting.ToolBuilder; import tconstruct.library.modifier.IModifyable; import tconstruct.tools.inventory.ToolForgeContainer; -import tconstruct.util.network.ToolStationPacket; /* * Simple class for storing items in the block @@ -67,15 +65,5 @@ public class ToolForgeLogic extends ToolStationLogic implements ISidedInventory output = tryRenameTool(output, name); } inventory[0] = output; - if (output != null && output.hasDisplayName()) { - TConstruct.packetPipeline - .sendToServer(new ToolStationPacket(xCoord, yCoord, zCoord, output.getDisplayName())); - } } - /* - * public void buildTool (String name) { toolName = name; ItemStack tool = - * ToolBuilder.instance.buildTool(inventory[1], inventory[2], inventory[3], inventory[4], name); if (inventory[0] == - * null) inventory[0] = tool; else { NBTTagCompound tags = inventory[0].getTagCompound(); if - * (!tags.getCompoundTag("InfiTool").hasKey("Built")) { inventory[0] = tool; } } } - */ } diff --git a/src/main/java/tconstruct/tools/logic/ToolStationLogic.java b/src/main/java/tconstruct/tools/logic/ToolStationLogic.java index 2e9c45ab..9a52bf1d 100644 --- a/src/main/java/tconstruct/tools/logic/ToolStationLogic.java +++ b/src/main/java/tconstruct/tools/logic/ToolStationLogic.java @@ -9,12 +9,10 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import mantle.blocks.abstracts.InventoryLogic; -import tconstruct.TConstruct; import tconstruct.library.crafting.ModifyBuilder; import tconstruct.library.crafting.ToolBuilder; import tconstruct.library.modifier.IModifyable; import tconstruct.tools.inventory.ToolStationContainer; -import tconstruct.util.network.ToolStationPacket; /* * Simple class for storing items in the block @@ -55,9 +53,25 @@ public class ToolStationLogic extends InventoryLogic implements ISidedInventory return new ToolStationContainer(inventoryplayer, this); } + @Override + public void setInventorySlotContents(int slot, ItemStack stack) { + super.setInventorySlotContents(slot, stack); + if (slot != 0) { + buildTool(toolName); + } + } + + @Override + public ItemStack decrStackSize(int slot, int amount) { + ItemStack itemstack = super.decrStackSize(slot, amount); + if (slot != 0) { + buildTool(toolName); + } + return itemstack; + } + @Override public void markDirty() { - buildTool(toolName); if (this.worldObj != null) { this.blockMetadata = this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord); this.worldObj.markTileEntityChunkModified(this.xCoord, this.yCoord, this.zCoord, this); @@ -91,10 +105,6 @@ public class ToolStationLogic extends InventoryLogic implements ISidedInventory output = tryRenameTool(output, name); } inventory[0] = output; - if (output != null && output.hasDisplayName()) { - TConstruct.packetPipeline - .sendToServer(new ToolStationPacket(xCoord, yCoord, zCoord, output.getDisplayName())); - } } public void setToolname(String name) { @@ -107,10 +117,6 @@ public class ToolStationLogic extends InventoryLogic implements ISidedInventory if (output != null) temp = output; else temp = inventory[1].copy(); - if (temp == null) { - return null; // output is null or not a tool :( - } - NBTTagCompound tags = temp.getTagCompound(); if (tags == null) { tags = new NBTTagCompound(); @@ -118,17 +124,16 @@ public class ToolStationLogic extends InventoryLogic implements ISidedInventory } NBTTagCompound display = null; - if (!(tags.hasKey("display"))) display = new NBTTagCompound(); - else if (tags.getCompoundTag("display").hasKey("Name")) display = tags.getCompoundTag("display"); - - if (display == null) return output; + if (tags.hasKey("display") && tags.getCompoundTag("display").hasKey("Name")) + display = tags.getCompoundTag("display"); boolean doRename = false; - if (canRename(display, temp)) { + if (display == null) { + display = new NBTTagCompound(); doRename = true; } // we only allow renaming with a nametag otherwise - else if (!("\u00A7f" + name).equals(display.getString("Name")) && !name.equals(display.getString("Name"))) { + else if (!name.equals(display.getString("Name"))) { int nametagCount = 0; for (ItemStack itemStack : inventory) if (itemStack != null && itemStack.getItem() == Items.name_tag) nametagCount++; @@ -138,8 +143,7 @@ public class ToolStationLogic extends InventoryLogic implements ISidedInventory if (!doRename) return output; - String dName = temp.getItem() instanceof IModifyable ? "\u00A7f" + name : name; - display.setString("Name", dName); + display.setString("Name", name); tags.setTag("display", display); temp.setRepairCost(2); output = temp; diff --git a/src/main/resources/assets/tinker/manuals/zh_CN/diary.xml b/src/main/resources/assets/tinker/manuals/zh_CN/diary.xml index b68368a3..9a10f665 100644 --- a/src/main/resources/assets/tinker/manuals/zh_CN/diary.xml +++ b/src/main/resources/assets/tinker/manuals/zh_CN/diary.xml @@ -123,6 +123,7 @@ 日记 #21: 有些工具比我想象中有用。给武器加上烈焰粉给予它燃烧的效果。青金石有能在同一区域找到更多材料的奇怪能力,即使我知道那里有多少。 + 日记 #22: 我有了一些做工具的点子,需要一块大的地方来试验。熔炉的能力有限,我需要许多石头。将岩浆煤炭和地狱岩结合似乎能立刻处理石头,已经不需要熔炉了。 @@ -130,35 +131,22 @@ 日记 #23: - -今天我做了个奇怪的东西。它是圆的木头的而且不像我所见过的任何东西。来的人说这是“轮子”,能轻松转动起来,我很好奇他还能做什么? +我的工具散的到处都是每个都标记了用途。为了不分散我决定做个地方来存放它们 日记 #24: -我多做了些轮子以实验。让它们到处转动着跑,成对的转动, 有一个停在了我的船边。我觉得真该将它们放在一起。 +我今天去探索发现了些新的矿物。他们有我未见过的颜色,而且不能像铁那样粉碎处理。我该怎么做? + -日记 #25: - -我觉得我在做些什么,将船和轮子结合使它看起来像辆矿车,只有我能驾驭它,虽然有点小。。 - -日记 #26: - -我的工具散的到处都是每个都标记了用途。为了不分散我决定做个地方来存放它们 - - -日记 #27: - -我今天去探索发现了些新的矿物。他们有我未见过的颜色,而且不能像铁那样粉碎处理。我该怎么做? - -日记 #28: + +日记 #25: 普通熔炉取暖很容易,但它产出的金属还需要加工。我挖了个坑铺上粘土,在附近弄了些岩浆,然后把矿物放在里面,在设计上做些改动,结果很有趣。 - - -我加的岩浆越多材料就越热。最终全都熔化, 我破坏了槽的一部分尝试得到材料,但它跑的到处都是。还有一些残留着。 -原矿中仍有部分是石头,一定有方法去除它们 +我加的岩浆越多材料就越热。最终全都熔化, 我破坏了槽的一部分尝试得到材料,但它跑的到处都是。还有一些残留着。 + +原矿中仍有部分是石头,一定有方法去除它们 From f88eed9dfaf89cc701cbbd91226be88e06b9979c Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Sun, 20 Apr 2025 21:42:47 +0200 Subject: [PATCH 04/15] update --- dependencies.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index af75f854..0fb97b19 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -4,7 +4,7 @@ dependencies { compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta40:api') api("com.github.GTNewHorizons:Mantle:0.5.0:dev") api("com.github.GTNewHorizons:ForgeMultipart:1.6.2:dev") - implementation("com.github.GTNewHorizons:NotEnoughItems:2.7.34-GTNH:dev") + implementation("com.github.GTNewHorizons:NotEnoughItems:2.7.38-GTNH:dev") compileOnlyApi("curse.maven:cofh-core-69162:2388751") compileOnly("com.github.GTNewHorizons:inventory-tweaks:1.7.1:api") compileOnly("com.github.GTNewHorizons:waila:1.8.4:api") @@ -16,13 +16,13 @@ dependencies { compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") compileOnly("com.github.GTNewHorizons:Mobs-Info:0.5.2-GTNH:dev") compileOnlyApi("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev") - compileOnlyApi("com.github.GTNewHorizons:Natura:2.8.5:dev") + compileOnlyApi("com.github.GTNewHorizons:Natura:2.8.7:dev") // For testing scythe crop harvesting // devOnlyNonPublishable("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev") // devOnlyNonPublishable("com.github.GTNewHorizons:harvestcraft:1.3.1-GTNH:dev") // devOnlyNonPublishable(deobfCurse("pams-harvest-the-nether-231262:2241397")) - // devOnlyNonPublishable("com.github.GTNewHorizons:Natura:2.8.5:dev") + // devOnlyNonPublishable("com.github.GTNewHorizons:Natura:2.8.7:dev") // devOnlyNonPublishable("com.github.GTNewHorizons:EnderCore:0.4.6") } From e43aa471d1666100dea1e88434ed1f0140856568 Mon Sep 17 00:00:00 2001 From: __felix__ <134875831+48a3efa65c881ef567345b17f3910e06@users.noreply.github.com> Date: Mon, 21 Apr 2025 00:57:34 -0400 Subject: [PATCH 05/15] Add "Disable All Recipes" config option (#169) Co-authored-by: Maya <10861407+serenibyss@users.noreply.github.com> --- .../java/tconstruct/armor/TinkerArmor.java | 9 +- .../tconstruct/gadgets/TinkerGadgets.java | 3 +- .../tconstruct/mechworks/TinkerMechworks.java | 107 +++++++++--------- .../tconstruct/plugins/gears/TinkerGears.java | 58 +++++----- .../tconstruct/plugins/ic2/TinkerIC2.java | 15 ++- .../tconstruct/plugins/te4/TinkerTE4.java | 21 ++-- .../tconstruct/smeltery/TinkerSmeltery.java | 12 +- .../java/tconstruct/tools/TinkerTools.java | 8 +- .../tconstruct/util/config/PHConstruct.java | 7 ++ .../tconstruct/weaponry/TinkerWeaponry.java | 6 +- .../java/tconstruct/world/TinkerWorld.java | 6 +- 11 files changed, 141 insertions(+), 111 deletions(-) diff --git a/src/main/java/tconstruct/armor/TinkerArmor.java b/src/main/java/tconstruct/armor/TinkerArmor.java index 16898475..547ec56c 100644 --- a/src/main/java/tconstruct/armor/TinkerArmor.java +++ b/src/main/java/tconstruct/armor/TinkerArmor.java @@ -50,6 +50,7 @@ import tconstruct.modifiers.armor.TravelModDoubleJump; import tconstruct.modifiers.armor.TravelModRepair; import tconstruct.modifiers.tools.ModAttack; import tconstruct.tools.TinkerTools; +import tconstruct.util.config.PHConstruct; import tconstruct.world.TinkerWorld; @ObjectHolder(TConstruct.modID) @@ -146,9 +147,11 @@ public class TinkerArmor { @Handler public void init(FMLInitializationEvent event) { - craftingTableRecipes(); - registerModifiers(); - addRecipesForDryingRack(); + if (!PHConstruct.disableAllRecipes) { + craftingTableRecipes(); + registerModifiers(); + addRecipesForDryingRack(); + } TConstructRegistry.equipableTab.init(travelGoggles.getDefaultItem()); proxy.initialize(); } diff --git a/src/main/java/tconstruct/gadgets/TinkerGadgets.java b/src/main/java/tconstruct/gadgets/TinkerGadgets.java index bee25e87..20a720f2 100644 --- a/src/main/java/tconstruct/gadgets/TinkerGadgets.java +++ b/src/main/java/tconstruct/gadgets/TinkerGadgets.java @@ -22,6 +22,7 @@ import tconstruct.TConstruct; import tconstruct.gadgets.item.ItemSlimeBoots; import tconstruct.gadgets.item.ItemSlimeSling; import tconstruct.library.TConstructRegistry; +import tconstruct.util.config.PHConstruct; import tconstruct.world.TinkerWorld; @Pulse(id = "Tinkers' Gadgets", description = "All the fun toys.", forced = true) @@ -42,7 +43,7 @@ public class TinkerGadgets { @Handler public void init(FMLInitializationEvent event) { - if (!Loader.isModLoaded("dreamcraft")) { + if (!(Loader.isModLoaded("dreamcraft") || PHConstruct.disableAllRecipes)) { ItemStack slimeBlockGreen = new ItemStack(TinkerWorld.slimeGel, 1, 1); GameRegistry.addShapedRecipe( diff --git a/src/main/java/tconstruct/mechworks/TinkerMechworks.java b/src/main/java/tconstruct/mechworks/TinkerMechworks.java index c311cb5b..901383b2 100644 --- a/src/main/java/tconstruct/mechworks/TinkerMechworks.java +++ b/src/main/java/tconstruct/mechworks/TinkerMechworks.java @@ -23,6 +23,7 @@ import tconstruct.mechworks.entity.item.ExplosivePrimed; import tconstruct.mechworks.itemblocks.ItemBlockLandmine; import tconstruct.mechworks.logic.TileEntityLandmine; import tconstruct.tools.TinkerTools; +import tconstruct.util.config.PHConstruct; @ObjectHolder(TConstruct.modID) // TODO handle migration of all items/blocks that were owned by the previously seperate mod @@ -46,58 +47,60 @@ public class TinkerMechworks { GameRegistry.registerTileEntity(TileEntityLandmine.class, "Landmine"); // Landmine Recipes - GameRegistry.addRecipe( - new ShapedOreRecipe( - new ItemStack(TinkerMechworks.landmine, 1, 0), - "mcm", - "rpr", - 'm', - "plankWood", - 'c', - new ItemStack(TinkerTools.blankPattern, 1, 1), - 'r', - "dustRedstone", - 'p', - Blocks.stone_pressure_plate)); - GameRegistry.addRecipe( - new ShapedOreRecipe( - new ItemStack(TinkerMechworks.landmine, 1, 1), - "mcm", - "rpr", - 'm', - Blocks.stone, - 'c', - new ItemStack(TinkerTools.blankPattern, 1, 1), - 'r', - "dustRedstone", - 'p', - Blocks.stone_pressure_plate)); - GameRegistry.addRecipe( - new ShapedOreRecipe( - new ItemStack(TinkerMechworks.landmine, 1, 2), - "mcm", - "rpr", - 'm', - Blocks.obsidian, - 'c', - new ItemStack(TinkerTools.blankPattern, 1, 1), - 'r', - "dustRedstone", - 'p', - Blocks.stone_pressure_plate)); - GameRegistry.addRecipe( - new ShapedOreRecipe( - new ItemStack(TinkerMechworks.landmine, 1, 3), - "mcm", - "rpr", - 'm', - Items.repeater, - 'c', - new ItemStack(TinkerTools.blankPattern, 1, 1), - 'r', - "dustRedstone", - 'p', - Blocks.stone_pressure_plate)); + if (!PHConstruct.disableAllRecipes) { + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(TinkerMechworks.landmine, 1, 0), + "mcm", + "rpr", + 'm', + "plankWood", + 'c', + new ItemStack(TinkerTools.blankPattern, 1, 1), + 'r', + "dustRedstone", + 'p', + Blocks.stone_pressure_plate)); + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(TinkerMechworks.landmine, 1, 1), + "mcm", + "rpr", + 'm', + Blocks.stone, + 'c', + new ItemStack(TinkerTools.blankPattern, 1, 1), + 'r', + "dustRedstone", + 'p', + Blocks.stone_pressure_plate)); + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(TinkerMechworks.landmine, 1, 2), + "mcm", + "rpr", + 'm', + Blocks.obsidian, + 'c', + new ItemStack(TinkerTools.blankPattern, 1, 1), + 'r', + "dustRedstone", + 'p', + Blocks.stone_pressure_plate)); + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(TinkerMechworks.landmine, 1, 3), + "mcm", + "rpr", + 'm', + Items.repeater, + 'c', + new ItemStack(TinkerTools.blankPattern, 1, 1), + 'r', + "dustRedstone", + 'p', + Blocks.stone_pressure_plate)); + } EntityRegistry.registerModEntity( EntityLandmineFirework.class, diff --git a/src/main/java/tconstruct/plugins/gears/TinkerGears.java b/src/main/java/tconstruct/plugins/gears/TinkerGears.java index 1299165f..40321025 100644 --- a/src/main/java/tconstruct/plugins/gears/TinkerGears.java +++ b/src/main/java/tconstruct/plugins/gears/TinkerGears.java @@ -47,39 +47,41 @@ public class TinkerGears { } // find all gears in the registry - for (String oreName : OreDictionary.getOreNames()) { - if (!oreName.startsWith("gear")) continue; + if (!PHConstruct.disableAllRecipes) { + for (String oreName : OreDictionary.getOreNames()) { + if (!oreName.startsWith("gear")) continue; - List gears = OreDictionary.getOres(oreName); + List gears = OreDictionary.getOres(oreName); - // register every gear besides wooden gear for creating a gear cast - if (!oreName.equals("gearWood")) { - for (ItemStack g : gears) { - TConstructRegistry.getTableCasting().addCastingRecipe(cast, aluCastLiquid, g, false, 50); - if (!PHConstruct.removeGoldCastRecipes) - TConstructRegistry.getTableCasting().addCastingRecipe(cast, goldCastLiquid, g, false, 50); + // register every gear besides wooden gear for creating a gear cast + if (!oreName.equals("gearWood")) { + for (ItemStack g : gears) { + TConstructRegistry.getTableCasting().addCastingRecipe(cast, aluCastLiquid, g, false, 50); + if (!PHConstruct.removeGoldCastRecipes) + TConstructRegistry.getTableCasting().addCastingRecipe(cast, goldCastLiquid, g, false, 50); + } } - } - // find a fluid that fits the gear - String material = oreName.substring(4); - // try the oredict name directly - Fluid fluid = FluidRegistry.getFluid(material); - // or lowercased - if (fluid == null) fluid = FluidRegistry.getFluid(material.toLowerCase()); - // or in the tinkers liquid format - if (fluid == null) fluid = FluidRegistry.getFluid(material.toLowerCase() + ".molten"); + // find a fluid that fits the gear + String material = oreName.substring(4); + // try the oredict name directly + Fluid fluid = FluidRegistry.getFluid(material); + // or lowercased + if (fluid == null) fluid = FluidRegistry.getFluid(material.toLowerCase()); + // or in the tinkers liquid format + if (fluid == null) fluid = FluidRegistry.getFluid(material.toLowerCase() + ".molten"); - // found one? - if (fluid != null) { - ItemStack gear = gears.get(0); - FluidStack liquid = new FluidStack(fluid.getID(), TConstruct.ingotLiquidValue * 4); - // gear casting - TConstructRegistry.getTableCasting().addCastingRecipe(gear, liquid, cast, 55); - // and melting it back - FluidType ft = FluidType.getFluidType(fluid); - if (ft != null) Smeltery.addMelting(ft, gear, 100, TConstruct.ingotLiquidValue * 4); - else Smeltery.addMelting(gear, TinkerSmeltery.glueBlock, 0, 100, liquid); + // found one? + if (fluid != null) { + ItemStack gear = gears.get(0); + FluidStack liquid = new FluidStack(fluid.getID(), TConstruct.ingotLiquidValue * 4); + // gear casting + TConstructRegistry.getTableCasting().addCastingRecipe(gear, liquid, cast, 55); + // and melting it back + FluidType ft = FluidType.getFluidType(fluid); + if (ft != null) Smeltery.addMelting(ft, gear, 100, TConstruct.ingotLiquidValue * 4); + else Smeltery.addMelting(gear, TinkerSmeltery.glueBlock, 0, 100, liquid); + } } } } diff --git a/src/main/java/tconstruct/plugins/ic2/TinkerIC2.java b/src/main/java/tconstruct/plugins/ic2/TinkerIC2.java index 2a67070c..cf8d2c61 100644 --- a/src/main/java/tconstruct/plugins/ic2/TinkerIC2.java +++ b/src/main/java/tconstruct/plugins/ic2/TinkerIC2.java @@ -14,6 +14,7 @@ import tconstruct.TConstruct; import tconstruct.api.harvesting.CropHarvestHandlers; import tconstruct.library.TConstructRegistry; import tconstruct.library.crafting.LiquidCasting; +import tconstruct.util.config.PHConstruct; @ObjectHolder(TConstruct.modID) @Pulse( @@ -38,11 +39,13 @@ public class TinkerIC2 { LiquidCasting basinCasting = TConstructRegistry.getBasinCasting(); // Block casting - basinCasting.addCastingRecipe( - new ItemStack(Blocks.diamond_block), - fluidStackBlock, - new ItemStack(Blocks.dirt), - true, - 50); + if (!PHConstruct.disableAllRecipes) { + basinCasting.addCastingRecipe( + new ItemStack(Blocks.diamond_block), + fluidStackBlock, + new ItemStack(Blocks.dirt), + true, + 50); + } } } diff --git a/src/main/java/tconstruct/plugins/te4/TinkerTE4.java b/src/main/java/tconstruct/plugins/te4/TinkerTE4.java index 2b53aaf0..67c75cc8 100644 --- a/src/main/java/tconstruct/plugins/te4/TinkerTE4.java +++ b/src/main/java/tconstruct/plugins/te4/TinkerTE4.java @@ -18,6 +18,7 @@ import tconstruct.TConstruct; import tconstruct.library.TConstructRegistry; import tconstruct.smeltery.TinkerSmeltery; import tconstruct.tools.TinkerTools; +import tconstruct.util.config.PHConstruct; import tconstruct.world.TinkerWorld; @ObjectHolder(TConstruct.modID) @@ -95,15 +96,17 @@ public class TinkerTE4 { 0); // Dust Recipes - GameRegistry.addRecipe( - new ShapelessOreRecipe(new ItemStack(TinkerTools.materials, 1, 41), "dustArdite", "dustCobalt")); - GameRegistry.addRecipe( - new ShapelessOreRecipe( - new ItemStack(TinkerTools.materials, 4, 42), - "dustAluminum", - "dustAluminum", - "dustAluminum", - "dustCopper")); + if (!PHConstruct.disableAllRecipes) { + GameRegistry.addRecipe( + new ShapelessOreRecipe(new ItemStack(TinkerTools.materials, 1, 41), "dustArdite", "dustCobalt")); + GameRegistry.addRecipe( + new ShapelessOreRecipe( + new ItemStack(TinkerTools.materials, 4, 42), + "dustAluminum", + "dustAluminum", + "dustAluminum", + "dustCopper")); + } } @Handler diff --git a/src/main/java/tconstruct/smeltery/TinkerSmeltery.java b/src/main/java/tconstruct/smeltery/TinkerSmeltery.java index d585ae95..f99a373d 100644 --- a/src/main/java/tconstruct/smeltery/TinkerSmeltery.java +++ b/src/main/java/tconstruct/smeltery/TinkerSmeltery.java @@ -610,11 +610,13 @@ public class TinkerSmeltery { public void init(FMLInitializationEvent event) { proxy.initialize(); loadMetalPatternMaterial(); - craftingTableRecipes(); - addRecipesForSmeltery(); - addRecipesForTableCasting(); - addRecipesForBasinCasting(); - addRecipesForFurnace(); + if (!PHConstruct.disableAllRecipes) { + craftingTableRecipes(); + addRecipesForSmeltery(); + addRecipesForTableCasting(); + addRecipesForBasinCasting(); + addRecipesForFurnace(); + } } @Handler diff --git a/src/main/java/tconstruct/tools/TinkerTools.java b/src/main/java/tconstruct/tools/TinkerTools.java index f078d15f..6be5689b 100644 --- a/src/main/java/tconstruct/tools/TinkerTools.java +++ b/src/main/java/tconstruct/tools/TinkerTools.java @@ -521,9 +521,11 @@ public class TinkerTools { @Handler public void init(FMLInitializationEvent event) { addPartMapping(); - addRecipesForToolBuilder(); - addRecipesForChisel(); - craftingTableRecipes(); + if (!PHConstruct.disableAllRecipes) { + addRecipesForToolBuilder(); + addRecipesForChisel(); + craftingTableRecipes(); + } setupToolTabs(); proxy.initialize(); } diff --git a/src/main/java/tconstruct/util/config/PHConstruct.java b/src/main/java/tconstruct/util/config/PHConstruct.java index 56e9d414..fcb1a698 100644 --- a/src/main/java/tconstruct/util/config/PHConstruct.java +++ b/src/main/java/tconstruct/util/config/PHConstruct.java @@ -226,6 +226,11 @@ public class PHConstruct { true, "Allow stacks of essence berries to be consumed at once when shifting (this does not spawn XP orbs in world).") .getBoolean(); + disableAllRecipes = config.get( + "general", + "Disable All Recipes", + false, + "Disable all TiC recipes (smeltery, drying rack, crafting, etc)").getBoolean(); enableHealthRegen = config.get("Ultra Hardcore Changes", "Passive Health Regen", true).getBoolean(true); goldAppleRecipe = config.get( @@ -431,6 +436,8 @@ public class PHConstruct { public static boolean consumeXPBerryStacks; + public static boolean disableAllRecipes; + // Mobs public static int naturalSlimeSpawn; diff --git a/src/main/java/tconstruct/weaponry/TinkerWeaponry.java b/src/main/java/tconstruct/weaponry/TinkerWeaponry.java index 61b8fdca..9774f723 100644 --- a/src/main/java/tconstruct/weaponry/TinkerWeaponry.java +++ b/src/main/java/tconstruct/weaponry/TinkerWeaponry.java @@ -135,8 +135,10 @@ public class TinkerWeaponry { @Handler public void init(FMLInitializationEvent event) { - addPartRecipies(); - addWeaponRecipies(); + if (!PHConstruct.disableAllRecipes) { + addPartRecipies(); + addWeaponRecipies(); + } setupCreativeTab(); // Modifiers diff --git a/src/main/java/tconstruct/world/TinkerWorld.java b/src/main/java/tconstruct/world/TinkerWorld.java index 09c9104e..d9a18974 100644 --- a/src/main/java/tconstruct/world/TinkerWorld.java +++ b/src/main/java/tconstruct/world/TinkerWorld.java @@ -319,8 +319,10 @@ public class TinkerWorld { @Handler public void init(FMLInitializationEvent event) { - craftingTableRecipes(); - addRecipesForFurnace(); + if (!PHConstruct.disableAllRecipes) { + craftingTableRecipes(); + addRecipesForFurnace(); + } addLoot(); createEntities(); proxy.initialize(); From 73e959955b26412b4b3f392b982218c052c04405 Mon Sep 17 00:00:00 2001 From: __felix__ <134875831+felixfour@users.noreply.github.com> Date: Sun, 4 May 2025 04:04:38 -0400 Subject: [PATCH 06/15] fix colored health bar not showing if disableAllRecipes is enabled (#174) --- src/main/java/tconstruct/armor/TinkerArmor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/tconstruct/armor/TinkerArmor.java b/src/main/java/tconstruct/armor/TinkerArmor.java index 547ec56c..afeebeb3 100644 --- a/src/main/java/tconstruct/armor/TinkerArmor.java +++ b/src/main/java/tconstruct/armor/TinkerArmor.java @@ -149,9 +149,9 @@ public class TinkerArmor { public void init(FMLInitializationEvent event) { if (!PHConstruct.disableAllRecipes) { craftingTableRecipes(); - registerModifiers(); addRecipesForDryingRack(); } + registerModifiers(); TConstructRegistry.equipableTab.init(travelGoggles.getDefaultItem()); proxy.initialize(); } From 9633ddce6e9c6ceeb7350e12a93cff30c7643caf Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Sun, 4 May 2025 14:45:18 +0200 Subject: [PATCH 07/15] update --- dependencies.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 0fb97b19..8f3aa251 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,10 +1,10 @@ // Add your dependencies here dependencies { - compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta40:api') + compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta41:api') api("com.github.GTNewHorizons:Mantle:0.5.0:dev") api("com.github.GTNewHorizons:ForgeMultipart:1.6.2:dev") - implementation("com.github.GTNewHorizons:NotEnoughItems:2.7.38-GTNH:dev") + implementation("com.github.GTNewHorizons:NotEnoughItems:2.7.40-GTNH:dev") compileOnlyApi("curse.maven:cofh-core-69162:2388751") compileOnly("com.github.GTNewHorizons:inventory-tweaks:1.7.1:api") compileOnly("com.github.GTNewHorizons:waila:1.8.4:api") From 937c322dd311b18aa990dccdcf85df4dc0f87e52 Mon Sep 17 00:00:00 2001 From: AnrDaemon Date: Wed, 7 May 2025 00:53:49 +0300 Subject: [PATCH 08/15] Restore the wooden rail (#171) Co-authored-by: Maya <10861407+serenibyss@users.noreply.github.com> --- .../java/tconstruct/world/TinkerWorld.java | 26 +++++++++ .../tconstruct/world/blocks/WoodRail.java | 54 +++++++++++++++++++ .../resources/assets/tinker/lang/cs_CZ.lang | 2 + .../resources/assets/tinker/lang/de_DE.lang | 2 + .../resources/assets/tinker/lang/en_PT.lang | 2 + .../resources/assets/tinker/lang/en_US.lang | 2 + .../resources/assets/tinker/lang/fr_FR.lang | 2 + .../resources/assets/tinker/lang/it_IT.lang | 2 + .../resources/assets/tinker/lang/ja_JP.lang | 2 + .../resources/assets/tinker/lang/ko_KR.lang | 2 + .../resources/assets/tinker/lang/pt_BR.lang | 2 + .../resources/assets/tinker/lang/pt_PT.lang | 2 + .../resources/assets/tinker/lang/ru_RU.lang | 2 + .../resources/assets/tinker/lang/uk_UA.lang | 2 + .../resources/assets/tinker/lang/zh_CN.lang | 2 + .../resources/assets/tinker/lang/zh_TW.lang | 2 + .../assets/tinker/manuals/en_US/diary.xml | 28 +++++----- 17 files changed, 123 insertions(+), 13 deletions(-) create mode 100644 src/main/java/tconstruct/world/blocks/WoodRail.java diff --git a/src/main/java/tconstruct/world/TinkerWorld.java b/src/main/java/tconstruct/world/TinkerWorld.java index d9a18974..3c7f3dad 100644 --- a/src/main/java/tconstruct/world/TinkerWorld.java +++ b/src/main/java/tconstruct/world/TinkerWorld.java @@ -72,6 +72,7 @@ import tconstruct.world.blocks.SlimePad; import tconstruct.world.blocks.StoneLadder; import tconstruct.world.blocks.StoneTorch; import tconstruct.world.blocks.TMetalBlock; +import tconstruct.world.blocks.WoodRail; import tconstruct.world.entity.BlueSlime; import tconstruct.world.entity.Crystal; import tconstruct.world.entity.KingBlueSlime; @@ -136,6 +137,8 @@ public class TinkerWorld { public static OreberryBush oreBerry; public static OreberryBush oreBerrySecond; public static Item oreBerries; + // Rail-related + public static Block woodenRail; // Chest hooks public static ChestGenHooks tinkerHouseChest; public static ChestGenHooks tinkerHousePatterns; @@ -238,6 +241,11 @@ public class TinkerWorld { TinkerWorld.oreGravel.setHarvestLevel("shovel", 1, 3); TinkerWorld.oreGravel.setHarvestLevel("shovel", 1, 4); TinkerWorld.oreGravel.setHarvestLevel("shovel", 4, 5); + // Rail + if (!Loader.isModLoaded("dreamcraft")) { + TinkerWorld.woodenRail = new WoodRail().setStepSound(Block.soundTypeWood) + .setCreativeTab(TConstructRegistry.blockTab).setBlockName("rail.wood"); + } GameRegistry.registerBlock(TinkerWorld.meatBlock, HamboneItemBlock.class, "MeatBlock"); OreDictionary.registerOre("hambone", new ItemStack(TinkerWorld.meatBlock)); @@ -284,6 +292,11 @@ public class TinkerWorld { GameRegistry.registerBlock(TinkerWorld.oreSlag, MetalOreItemBlock.class, "SearedBrick"); GameRegistry.registerBlock(TinkerWorld.oreGravel, GravelOreItem.class, "GravelOre"); + // Rail + if (TinkerWorld.woodenRail != null) { + GameRegistry.registerBlock(TinkerWorld.woodenRail, "rail.wood"); + } + // Items goldHead = new GoldenHead(4, 1.2F, false).setAlwaysEdible().setPotionEffect(Potion.regeneration.id, 10, 0, 1.0F) .setUnlocalizedName("goldenhead"); @@ -669,6 +682,19 @@ public class TinkerWorld { // Stone Ladder Recipe GameRegistry.addRecipe( new ShapedOreRecipe(new ItemStack(TinkerWorld.stoneLadder, 3), "w w", "www", "w w", 'w', "rodStone")); + // Wooden Rail (if registered) Recipe + if (TinkerWorld.woodenRail != null) { + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(TinkerWorld.woodenRail, 4, 0), + "b b", + "bxb", + "b b", + 'b', + "plankWood", + 'x', + "stickWood")); + } // Stonesticks Recipes GameRegistry.addRecipe(new ItemStack(TinkerTools.toolRod, 4, 1), "c", "c", 'c', new ItemStack(Blocks.stone)); GameRegistry diff --git a/src/main/java/tconstruct/world/blocks/WoodRail.java b/src/main/java/tconstruct/world/blocks/WoodRail.java new file mode 100644 index 00000000..e6453aa1 --- /dev/null +++ b/src/main/java/tconstruct/world/blocks/WoodRail.java @@ -0,0 +1,54 @@ +package tconstruct.world.blocks; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockRailBase; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.init.Blocks; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class WoodRail extends BlockRailBase { + + @SideOnly(Side.CLIENT) + private IIcon theIcon; + + public WoodRail() { + super(false); + } + + @Override + @SideOnly(Side.CLIENT) + /** + * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata + */ + public IIcon getIcon(int par1, int par2) { + return par2 >= 6 ? this.theIcon : this.blockIcon; + } + + @Override + @SideOnly(Side.CLIENT) + /** + * When this method is called, your block should register all the icons it needs with the given IconRegister. This + * is the only chance you get to register icons. + */ + public void registerBlockIcons(IIconRegister par1IconRegister) { + this.blockIcon = par1IconRegister.registerIcon("tinker:woodrail"); + this.theIcon = par1IconRegister.registerIcon("tinker:woodrail_turn"); + } + + protected void func_94358_a(World par1World, int par2, int par3, int par4, int par5, int par6, Block par7) { + if (par7 != Blocks.air && par7.canProvidePower() + && (new Rail(par1World, par2, par3, par4)).func_150650_a() == 3) { + this.func_150052_a(par1World, par2, par3, par4, false); + } + } + + @Override + public float getRailMaxSpeed(World world, EntityMinecart cart, int y, int x, int z) { + return 0.3f; + } +} diff --git a/src/main/resources/assets/tinker/lang/cs_CZ.lang b/src/main/resources/assets/tinker/lang/cs_CZ.lang index bd0238e0..a32afdc3 100644 --- a/src/main/resources/assets/tinker/lang/cs_CZ.lang +++ b/src/main/resources/assets/tinker/lang/cs_CZ.lang @@ -114,6 +114,8 @@ block.fancybrick.ardite.name=Hezké arditové cihly block.fancybrick.cobalt.name=Hezké kobaltové cihly block.fancybrick.manyullyn.name=Hezké manyullynové cihly +tile.rail.wood.name=Dřevěná kolej + tile.cloth.white.slab.name=Vlnový půlblok tile.cloth.orange.slab.name=Oranžový vlnový půlblok tile.cloth.magenta.slab.name=Purporový vlnový půlblok diff --git a/src/main/resources/assets/tinker/lang/de_DE.lang b/src/main/resources/assets/tinker/lang/de_DE.lang index 0e9df459..a94dd866 100644 --- a/src/main/resources/assets/tinker/lang/de_DE.lang +++ b/src/main/resources/assets/tinker/lang/de_DE.lang @@ -114,6 +114,8 @@ block.fancybrick.ardite.name=Schicke Arditeziegel block.fancybrick.cobalt.name=Schicke Kobaltziegel block.fancybrick.manyullyn.name=Schicke Manyullynziegel +tile.rail.wood.name=Hölzerne Schiene + tile.cloth.white.slab.name=Wollstufe tile.cloth.orange.slab.name=Orange Wollstufe tile.cloth.magenta.slab.name=Magenta Wollstufe diff --git a/src/main/resources/assets/tinker/lang/en_PT.lang b/src/main/resources/assets/tinker/lang/en_PT.lang index 9e2cc1dc..3db7bb72 100644 --- a/src/main/resources/assets/tinker/lang/en_PT.lang +++ b/src/main/resources/assets/tinker/lang/en_PT.lang @@ -105,6 +105,8 @@ block.fancybrick.obsidian.ingot.name=Fancy Obsidian Brick block.fancybrick.stone.road.name=Stone Road block.fancybrick.stone.name=Fancy Stone Brick +tile.rail.wood.name=Timbers Ta Shiver + tile.cloth.white.slab.name=Wool Slab tile.cloth.orange.slab.name=Orange Wool Slab tile.cloth.magenta.slab.name=Magenta Wool Slab diff --git a/src/main/resources/assets/tinker/lang/en_US.lang b/src/main/resources/assets/tinker/lang/en_US.lang index 36aaedfd..d8fd249a 100644 --- a/src/main/resources/assets/tinker/lang/en_US.lang +++ b/src/main/resources/assets/tinker/lang/en_US.lang @@ -128,6 +128,8 @@ block.fancybrick.ardite.name=Fancy Ardite Brick block.fancybrick.cobalt.name=Fancy Cobalt Brick block.fancybrick.manyullyn.name=Fancy Manyullyn Brick +tile.rail.wood.name=Wooden Rail + tile.cloth.white.slab.name=Wool Slab tile.cloth.orange.slab.name=Orange Wool Slab tile.cloth.magenta.slab.name=Magenta Wool Slab diff --git a/src/main/resources/assets/tinker/lang/fr_FR.lang b/src/main/resources/assets/tinker/lang/fr_FR.lang index 91ab36bd..56b08fc9 100644 --- a/src/main/resources/assets/tinker/lang/fr_FR.lang +++ b/src/main/resources/assets/tinker/lang/fr_FR.lang @@ -114,6 +114,8 @@ block.fancybrick.ardite.name=Brique d'ardite chic block.fancybrick.cobalt.name=Brique de cobalt chic block.fancybrick.manyullyn.name=Brique de manyullyn chic +tile.rail.wood.name=Rail en bois + tile.cloth.white.slab.name=Dalle de laine tile.cloth.orange.slab.name=Dalle de laine orange tile.cloth.magenta.slab.name=Dalle de laine magenta diff --git a/src/main/resources/assets/tinker/lang/it_IT.lang b/src/main/resources/assets/tinker/lang/it_IT.lang index 6081bf28..9bb5509f 100644 --- a/src/main/resources/assets/tinker/lang/it_IT.lang +++ b/src/main/resources/assets/tinker/lang/it_IT.lang @@ -106,6 +106,8 @@ block.fancybrick.obsidian.ingot.name=Ossidiana concia decorativa block.fancybrick.stone.road.name=Strada di pietra block.fancybrick.stone.name=Pietra concia decorativa +tile.rail.wood.name=Rotaia di legno + tile.cloth.white.slab.name=Lastra di lana bianca tile.cloth.orange.slab.name=Lastra di lana arancione tile.cloth.magenta.slab.name=Lastra di lana magenta diff --git a/src/main/resources/assets/tinker/lang/ja_JP.lang b/src/main/resources/assets/tinker/lang/ja_JP.lang index 81e6153c..c3044bd8 100644 --- a/src/main/resources/assets/tinker/lang/ja_JP.lang +++ b/src/main/resources/assets/tinker/lang/ja_JP.lang @@ -106,6 +106,8 @@ block.fancybrick.obsidian.ingot.name=Fancy Obsidian Brick block.fancybrick.stone.road.name=Stone Road block.fancybrick.stone.name=Fancy Stone Brick +tile.rail.wood.name=木のレール + tile.cloth.white.slab.name=羊毛ハーフブロック tile.cloth.orange.slab.name=橙色の羊毛ハーフブロック tile.cloth.magenta.slab.name=赤紫色の羊毛ハーフブロック diff --git a/src/main/resources/assets/tinker/lang/ko_KR.lang b/src/main/resources/assets/tinker/lang/ko_KR.lang index 0e3b8b7f..c2bf1e4c 100644 --- a/src/main/resources/assets/tinker/lang/ko_KR.lang +++ b/src/main/resources/assets/tinker/lang/ko_KR.lang @@ -106,6 +106,8 @@ block.fancybrick.obsidian.ingot.name=화려한 흑요석 주괴 벽돌 block.fancybrick.stone.road.name=돌 도로 block.fancybrick.stone.name=화려한 석재 벽돌 +tile.rail.wood.name=나무 레일 + tile.cloth.white.slab.name=양털 반 블럭 tile.cloth.orange.slab.name=주황색 양털 반 블럭 tile.cloth.magenta.slab.name=다홍색 양털 반 블럭 diff --git a/src/main/resources/assets/tinker/lang/pt_BR.lang b/src/main/resources/assets/tinker/lang/pt_BR.lang index 3ad8bf72..fc28adf9 100644 --- a/src/main/resources/assets/tinker/lang/pt_BR.lang +++ b/src/main/resources/assets/tinker/lang/pt_BR.lang @@ -106,6 +106,8 @@ block.fancybrick.obsidian.ingot.name=Tijolo Bonito de Obsidiana block.fancybrick.stone.road.name=Pavimento de Pedra block.fancybrick.stone.name=Tijolo Bonito de Pedra +tile.rail.wood.name=Trilho de Madeira + tile.cloth.white.slab.name=Laje de Lã tile.cloth.orange.slab.name=Laje de Lã Laranja tile.cloth.magenta.slab.name=Laje de Lã Magenta diff --git a/src/main/resources/assets/tinker/lang/pt_PT.lang b/src/main/resources/assets/tinker/lang/pt_PT.lang index 23db1b89..002ff886 100644 --- a/src/main/resources/assets/tinker/lang/pt_PT.lang +++ b/src/main/resources/assets/tinker/lang/pt_PT.lang @@ -106,6 +106,8 @@ block.fancybrick.obsidian.ingot.name=Tijolo Bonito de Obsidiana block.fancybrick.stone.road.name=Pavimento de Pedra block.fancybrick.stone.name=Tijolo Bonito de Pedra +tile.rail.wood.name=Trilho de Madeira + tile.cloth.white.slab.name=Laje de Lã tile.cloth.orange.slab.name=Laje de Lã Laranja tile.cloth.magenta.slab.name=Laje de Lã Magenta diff --git a/src/main/resources/assets/tinker/lang/ru_RU.lang b/src/main/resources/assets/tinker/lang/ru_RU.lang index 8fa8987c..376e3b3c 100644 --- a/src/main/resources/assets/tinker/lang/ru_RU.lang +++ b/src/main/resources/assets/tinker/lang/ru_RU.lang @@ -117,6 +117,8 @@ block.fancybrick.ardite.name=Красивый ардитовый кирпич block.fancybrick.cobalt.name=Красивый кобальтовый кирпич block.fancybrick.manyullyn.name=Красивый мануллиновый кирпич +tile.rail.wood.name=Деревянные рельсы + tile.cloth.white.slab.name=Плита из шерсти tile.cloth.orange.slab.name=Плита из оранжевой шерсти tile.cloth.magenta.slab.name=Плита из сиреневой шерсти diff --git a/src/main/resources/assets/tinker/lang/uk_UA.lang b/src/main/resources/assets/tinker/lang/uk_UA.lang index b7ccea6d..89570308 100644 --- a/src/main/resources/assets/tinker/lang/uk_UA.lang +++ b/src/main/resources/assets/tinker/lang/uk_UA.lang @@ -116,6 +116,8 @@ block.fancybrick.ardite.name=Вишукана ардитова цегла block.fancybrick.cobalt.name=Вишукана кобальтова цегла block.fancybrick.manyullyn.name=Вишукана манулінова цегла +tile.rail.wood.name=Дерев'яні рейки + tile.cloth.white.slab.name=Вовняна плита tile.cloth.orange.slab.name=Помаранчева вовняна плита tile.cloth.magenta.slab.name=Пурпурова вовняна плита diff --git a/src/main/resources/assets/tinker/lang/zh_CN.lang b/src/main/resources/assets/tinker/lang/zh_CN.lang index 8314677b..2b11b5c0 100644 --- a/src/main/resources/assets/tinker/lang/zh_CN.lang +++ b/src/main/resources/assets/tinker/lang/zh_CN.lang @@ -116,6 +116,8 @@ block.fancybrick.ardite.name=平滑阿迪特砖块 block.fancybrick.cobalt.name=平滑钴砖块 block.fancybrick.manyullyn.name=平滑玛玉灵砖块 +tile.rail.wood.name=木轨道 + tile.cloth.white.slab.name=羊毛台阶 tile.cloth.orange.slab.name=橙色羊毛台阶 tile.cloth.magenta.slab.name=品红色羊毛台阶 diff --git a/src/main/resources/assets/tinker/lang/zh_TW.lang b/src/main/resources/assets/tinker/lang/zh_TW.lang index fdeb9cbf..f777eb73 100644 --- a/src/main/resources/assets/tinker/lang/zh_TW.lang +++ b/src/main/resources/assets/tinker/lang/zh_TW.lang @@ -105,6 +105,8 @@ block.fancybrick.obsidian.ingot.name=平滑黑曜石錠磚塊 block.fancybrick.stone.road.name=鋪路石塊 block.fancybrick.stone.name=平滑石磚塊 +tile.rail.wood.name=木軌道 + tile.cloth.white.slab.name=羊毛台階 tile.cloth.orange.slab.name=橙色羊毛台階 tile.cloth.magenta.slab.name=品紅色羊毛台階 diff --git a/src/main/resources/assets/tinker/manuals/en_US/diary.xml b/src/main/resources/assets/tinker/manuals/en_US/diary.xml index 5fc4d7e1..2f6416e7 100644 --- a/src/main/resources/assets/tinker/manuals/en_US/diary.xml +++ b/src/main/resources/assets/tinker/manuals/en_US/diary.xml @@ -4,7 +4,7 @@ Tinker's Log #1: -Today is a new day. I finally left home and decided to wander around in the wilderness until I find a good place to call my home. +Today is a new day. I finally left home and decided to wander around in the wilderness until I find a good place to call my home. Tinker's Log #2: @@ -66,7 +66,7 @@ Perhaps making a tool completely out of stone wasn't the best idea. It didn't la Tinker's Log #13: -I wanted to make a few more tools, but the boards with tool shapes in them went everywhere! I ended up breaking a few out of frustration. They don't fit very well in my chest either. I took a few of them, added a few slots to the bottom of the chest, placed it by my table and called it good. +I wanted to make a few more tools, but the boards with tool shapes in them went everywhere! I ended up breaking a few out of frustration. They don't fit very well in my chest either. I took a few of them, added a few slots to the bottom of the chest, placed it by my table and called it good. I also named them "Patterns", the chest a "Pattern Chest". I'm still angry at them, and it took so long to make new ones... @@ -74,7 +74,7 @@ I also named them "Patterns", the chest a "Pattern Chest". I'm still angry at th Tinker's Log #14 -Today I learned just how hard it was to shape iron. First you have to dig it out of the earth. A wooden pickaxe will shatter the ore; this I found out the hard way. Once you do get that ore there isn't much to do with it besides throw it in the furnace. Melting the iron and the stone seems inefficient, but I do need the metal more than I care about the waste. +Today I learned just how hard it was to shape iron. First you have to dig it out of the earth. A wooden pickaxe will shatter the ore; this I found out the hard way. Once you do get that ore there isn't much to do with it besides throw it in the furnace. Melting the iron and the stone seems inefficient, but I do need the metal more than I care about the waste. I shaped a few of the bars into tools, and they felt strong. Much stronger, in fact, than the ones back at the village. I've named the pickaxe "Krug" after some of the stories Nana used to tell me at night. How I miss her... @@ -92,7 +92,7 @@ A week later and I've finally found some others to visit. Some of them seem nice Tinker's Log #17: -After three days and nights of fending off zombies, I've finally created a house. It has a few rooms, a basement, but most importantly a workshop. All of the tables and patterns I had before are here, as well as a few others I wanted to try out from the trip. +After three days and nights of fending off zombies, I've finally created a house. It has a few rooms, a basement, but most importantly a workshop. All of the tables and patterns I had before are here, as well as a few others I wanted to try out from the trip. There's a round one I can cook food with and one that's just as good as any hoe, but can chop trees or actually dig the ground up. The villagers tell me these are named "Frying Pan" and "Mattock". The Frying Pan seems heavy enough to smack creepers with. I have a sword named "Shimmer" that I want to alter somehow. @@ -106,7 +106,7 @@ One of the villagers was kind enough to give me some random things. Each one loo Tinker's Log #19: -After some heavy experimentation, I've ended up with some things that look amazing and others that look less useful than they actually are. A diamond tip on a pickaxe makes for a wonderfully hard mining tool, and an emerald on a sword hilt somehow makes it stay together longer, but some things don't do anything. +After some heavy experimentation, I've ended up with some things that look amazing and others that look less useful than they actually are. A diamond tip on a pickaxe makes for a wonderfully hard mining tool, and an emerald on a sword hilt somehow makes it stay together longer, but some things don't do anything. Adding flowers to a tool does nothing; they don't even stay on the thing. Mushrooms have a similar effect, and adding more material to a tool just makes it heavier. You wouldn't think redstone would do anything. I've coated a shovel so much that it looks deep red. However, it slides through dirt as if the dirt wasn't there. @@ -131,22 +131,24 @@ I have some ideas for creating tools, but for that I need a large place to creat Tinker's Log #23: + I have all these tools laying around with little notes on what each one does. Instead of leaving them scattered about, I think I will create one place to store them. Tinker's Log #24: -I went exploring and found some new ores today. They're colors I've never seen before, and they don't shatter on impact like iron does. I wonder what I can do with these? - +I went exploring and found some new ores today. They're colors I've never seen before, and they don't shatter on impact like iron does. I wonder what I can do with these? + + + +Tinker's Log #25: + +The normal furnace is nice for keeping warm, but it leaves something to be desired for processing metal. I've dug a pit and lined it with some clay, gathered lava nearby, and put ore in the center in an attempt to improve on the design. The results were quite interesting. -Tinker's Log #25: - -The normal furnace is nice for keeping warm, but it leaves something to be desired for processing metal. I've dug a pit and lined it with some clay, gathered lava nearby, and put ore in the center in an attempt to improve on the design. The results were quite interesting. - The more lava I fed into the pit the hotter the material became. Eventually the whole thing liquified. I broke open the side of the pit with a cauldron in an attempt to catch the material, but it went everywhere. There were some remnants left in the pit as well. -Raw ore still has parts of stone in it. There must be a way to remove the excess. +Raw ore still has parts of stone in it. There must be a way to remove the excess. - \ No newline at end of file + From e7fd95731efe0e101e233defa0c9c72833f34356 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Sat, 10 May 2025 13:25:17 +0200 Subject: [PATCH 09/15] update --- dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index 8f3aa251..7b8acb79 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -23,6 +23,6 @@ dependencies { // devOnlyNonPublishable("com.github.GTNewHorizons:harvestcraft:1.3.1-GTNH:dev") // devOnlyNonPublishable(deobfCurse("pams-harvest-the-nether-231262:2241397")) // devOnlyNonPublishable("com.github.GTNewHorizons:Natura:2.8.7:dev") - // devOnlyNonPublishable("com.github.GTNewHorizons:EnderCore:0.4.6") + // devOnlyNonPublishable("com.github.GTNewHorizons:EnderCore:0.4.8") } From 848656dbad9a31fec677ad425059833245907366 Mon Sep 17 00:00:00 2001 From: RiggZh Date: Mon, 12 May 2025 00:24:47 +0800 Subject: [PATCH 10/15] fix: tools registered to NEI that shouldn't has display NBT (#173) --- .../tconstruct/library/tools/ToolCore.java | 2 +- .../assets/tinker/manuals/zh_CN/diary.xml | 30 +++++++++++++------ 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/main/java/tconstruct/library/tools/ToolCore.java b/src/main/java/tconstruct/library/tools/ToolCore.java index 7be6a814..a97bce88 100644 --- a/src/main/java/tconstruct/library/tools/ToolCore.java +++ b/src/main/java/tconstruct/library/tools/ToolCore.java @@ -439,7 +439,7 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IEq for (Map.Entry integerToolMaterialEntry : TConstructRegistry.toolMaterials .entrySet()) { tconstruct.library.tools.ToolMaterial material = integerToolMaterialEntry.getValue(); - buildTool(integerToolMaterialEntry.getKey(), ToolBuilder.defaultToolName(material, this), list); + buildTool(integerToolMaterialEntry.getKey(), null, list); } } diff --git a/src/main/resources/assets/tinker/manuals/zh_CN/diary.xml b/src/main/resources/assets/tinker/manuals/zh_CN/diary.xml index 9a10f665..b68368a3 100644 --- a/src/main/resources/assets/tinker/manuals/zh_CN/diary.xml +++ b/src/main/resources/assets/tinker/manuals/zh_CN/diary.xml @@ -123,7 +123,6 @@ 日记 #21: 有些工具比我想象中有用。给武器加上烈焰粉给予它燃烧的效果。青金石有能在同一区域找到更多材料的奇怪能力,即使我知道那里有多少。 - 日记 #22: 我有了一些做工具的点子,需要一块大的地方来试验。熔炉的能力有限,我需要许多石头。将岩浆煤炭和地狱岩结合似乎能立刻处理石头,已经不需要熔炉了。 @@ -131,22 +130,35 @@ 日记 #23: -我的工具散的到处都是每个都标记了用途。为了不分散我决定做个地方来存放它们 + +今天我做了个奇怪的东西。它是圆的木头的而且不像我所见过的任何东西。来的人说这是“轮子”,能轻松转动起来,我很好奇他还能做什么? 日记 #24: -我今天去探索发现了些新的矿物。他们有我未见过的颜色,而且不能像铁那样粉碎处理。我该怎么做? - +我多做了些轮子以实验。让它们到处转动着跑,成对的转动, 有一个停在了我的船边。我觉得真该将它们放在一起。 - -日记 #25: +日记 #25: + +我觉得我在做些什么,将船和轮子结合使它看起来像辆矿车,只有我能驾驭它,虽然有点小。。 + +日记 #26: + +我的工具散的到处都是每个都标记了用途。为了不分散我决定做个地方来存放它们 + + +日记 #27: + +我今天去探索发现了些新的矿物。他们有我未见过的颜色,而且不能像铁那样粉碎处理。我该怎么做? + +日记 #28: 普通熔炉取暖很容易,但它产出的金属还需要加工。我挖了个坑铺上粘土,在附近弄了些岩浆,然后把矿物放在里面,在设计上做些改动,结果很有趣。 + + +我加的岩浆越多材料就越热。最终全都熔化, 我破坏了槽的一部分尝试得到材料,但它跑的到处都是。还有一些残留着。 -我加的岩浆越多材料就越热。最终全都熔化, 我破坏了槽的一部分尝试得到材料,但它跑的到处都是。还有一些残留着。 - -原矿中仍有部分是石头,一定有方法去除它们 +原矿中仍有部分是石头,一定有方法去除它们 From d450f1dc2763669fcce89d4c4700c04b852d12dc Mon Sep 17 00:00:00 2001 From: ceg Date: Sat, 17 May 2025 17:54:10 -0400 Subject: [PATCH 11/15] Add check for getCrop() being null (#176) --- .../java/tconstruct/plugins/ic2/Ic2CropHarvestHandler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/tconstruct/plugins/ic2/Ic2CropHarvestHandler.java b/src/main/java/tconstruct/plugins/ic2/Ic2CropHarvestHandler.java index 86d7dffb..b48ec469 100644 --- a/src/main/java/tconstruct/plugins/ic2/Ic2CropHarvestHandler.java +++ b/src/main/java/tconstruct/plugins/ic2/Ic2CropHarvestHandler.java @@ -16,7 +16,8 @@ public class Ic2CropHarvestHandler implements CropHarvestHandler { @Override public boolean tryHarvest(ItemStack stack, EntityPlayer player, World world, int x, int y, int z) { - return world.getTileEntity(x, y, z) instanceof ICropTile crop && crop.getCrop().canBeHarvested(crop) + return world.getTileEntity(x, y, z) instanceof ICropTile crop && crop.getCrop() != null + && crop.getCrop().canBeHarvested(crop) && crop.harvest(true); } } From 985e5fa7142b9a931dc11caac6ffef10afd110f9 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Sun, 18 May 2025 11:43:26 +0200 Subject: [PATCH 12/15] update --- dependencies.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 7b8acb79..ebea3a44 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,10 +1,10 @@ // Add your dependencies here dependencies { - compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta41:api') + compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta42:api') api("com.github.GTNewHorizons:Mantle:0.5.0:dev") api("com.github.GTNewHorizons:ForgeMultipart:1.6.2:dev") - implementation("com.github.GTNewHorizons:NotEnoughItems:2.7.40-GTNH:dev") + implementation("com.github.GTNewHorizons:NotEnoughItems:2.7.44-GTNH:dev") compileOnlyApi("curse.maven:cofh-core-69162:2388751") compileOnly("com.github.GTNewHorizons:inventory-tweaks:1.7.1:api") compileOnly("com.github.GTNewHorizons:waila:1.8.4:api") From cddcb7a95916b45ee77bf27b33cc2c4123f3641e Mon Sep 17 00:00:00 2001 From: Yannick Marcotte-Gourde Date: Fri, 30 May 2025 20:38:29 -0400 Subject: [PATCH 13/15] Battlegear 2 for Backhand compat (#178) --- .../tconstruct/compat/Battlegear2Compat.java | 17 +++++++++++++++++ .../library/weaponry/BowBaseAmmo.java | 8 +++++--- .../tconstruct/weaponry/weapons/Crossbow.java | 8 +++++--- 3 files changed, 27 insertions(+), 6 deletions(-) create mode 100644 src/main/java/tconstruct/compat/Battlegear2Compat.java diff --git a/src/main/java/tconstruct/compat/Battlegear2Compat.java b/src/main/java/tconstruct/compat/Battlegear2Compat.java new file mode 100644 index 00000000..f3ad7075 --- /dev/null +++ b/src/main/java/tconstruct/compat/Battlegear2Compat.java @@ -0,0 +1,17 @@ +package tconstruct.compat; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +import mods.battlegear2.api.core.IInventoryPlayerBattle; + +/** + * This class exists to isolate classes that exist in Battlegear 2 but not in Battlegear 2 for Backhand in order to + * avoid class loading exceptions. + */ +public class Battlegear2Compat { + + public static ItemStack getBattlegear2Offhand(EntityPlayer player) { + return ((IInventoryPlayerBattle) player.inventory).battlegear2$getCurrentOffhandWeapon(); + } +} diff --git a/src/main/java/tconstruct/library/weaponry/BowBaseAmmo.java b/src/main/java/tconstruct/library/weaponry/BowBaseAmmo.java index d234389b..40a39db2 100644 --- a/src/main/java/tconstruct/library/weaponry/BowBaseAmmo.java +++ b/src/main/java/tconstruct/library/weaponry/BowBaseAmmo.java @@ -13,7 +13,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.world.World; import cpw.mods.fml.common.Loader; -import mods.battlegear2.api.core.IInventoryPlayerBattle; +import mods.battlegear2.api.core.IBattlePlayer; +import tconstruct.compat.Battlegear2Compat; import tconstruct.library.TConstructRegistry; import tconstruct.library.crafting.ToolBuilder; import tconstruct.library.tools.BowstringMaterial; @@ -62,8 +63,9 @@ public abstract class BowBaseAmmo extends ProjectileWeapon { @Override public ItemStack searchForAmmo(EntityPlayer player, ItemStack weapon) { // arrow priority: hotbar > inventory, tinker arrows > regular arrows - if (isBattlegear2Loaded) { - ItemStack offhand = ((IInventoryPlayerBattle) player.inventory).battlegear2$getCurrentOffhandWeapon(); + if (isBattlegear2Loaded && player instanceof IBattlePlayer battlePlayer + && battlePlayer.battlegear2$isBattlemode()) { + ItemStack offhand = Battlegear2Compat.getBattlegear2Offhand(player); if (checkTinkerArrow(offhand) || checkVanillaArrow(offhand)) { return offhand; } diff --git a/src/main/java/tconstruct/weaponry/weapons/Crossbow.java b/src/main/java/tconstruct/weaponry/weapons/Crossbow.java index ae4d58b5..64fe325b 100644 --- a/src/main/java/tconstruct/weaponry/weapons/Crossbow.java +++ b/src/main/java/tconstruct/weaponry/weapons/Crossbow.java @@ -12,7 +12,8 @@ import net.minecraft.util.IIcon; import net.minecraft.world.World; import cpw.mods.fml.common.Loader; -import mods.battlegear2.api.core.IInventoryPlayerBattle; +import mods.battlegear2.api.core.IBattlePlayer; +import tconstruct.compat.Battlegear2Compat; import tconstruct.library.TConstructRegistry; import tconstruct.library.crafting.ToolBuilder; import tconstruct.library.tools.AbilityHelper; @@ -224,8 +225,9 @@ public class Crossbow extends ProjectileWeapon { @Override public ItemStack searchForAmmo(EntityPlayer player, ItemStack weapon) { // arrow priority: hotbar > inventory, tinker arrows > regular arrows - if (isBattlegear2Loaded) { - ItemStack offhand = ((IInventoryPlayerBattle) player.inventory).battlegear2$getCurrentOffhandWeapon(); + if (isBattlegear2Loaded && player instanceof IBattlePlayer battlePlayer + && battlePlayer.battlegear2$isBattlemode()) { + ItemStack offhand = Battlegear2Compat.getBattlegear2Offhand(player); if (offhand != null && (offhand.getItem() instanceof BoltAmmo) && ((IAmmo) offhand.getItem()).getAmmoCount(offhand) > 0) { return offhand; From 8b58c6dd35d79d18363bbd7127c988968b026193 Mon Sep 17 00:00:00 2001 From: koolkrafter5 Date: Sat, 31 May 2025 00:16:37 -0400 Subject: [PATCH 14/15] Casting Table/Basin Facing Directions (#177) Co-authored-by: Maya <10861407+serenibyss@users.noreply.github.com> --- .../smeltery/logic/CastingBlockLogic.java | 35 +++++++++++++++++-- .../smeltery/logic/FaucetLogic.java | 18 ++++++---- .../model/CastingBasinSpecialRender.java | 13 +++++-- .../model/CastingTableSpecialRenderer.java | 25 +++++++++++-- 4 files changed, 77 insertions(+), 14 deletions(-) diff --git a/src/main/java/tconstruct/smeltery/logic/CastingBlockLogic.java b/src/main/java/tconstruct/smeltery/logic/CastingBlockLogic.java index 521e843e..123b2097 100644 --- a/src/main/java/tconstruct/smeltery/logic/CastingBlockLogic.java +++ b/src/main/java/tconstruct/smeltery/logic/CastingBlockLogic.java @@ -1,5 +1,6 @@ package tconstruct.smeltery.logic; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; @@ -9,6 +10,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.NetworkManager; import net.minecraft.network.Packet; import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.ForgeDirection; @@ -21,6 +23,7 @@ import net.minecraftforge.fluids.IFluidTank; import cpw.mods.fml.common.eventhandler.Event; import mantle.blocks.abstracts.InventoryLogic; +import mantle.blocks.iface.IFacingLogic; import tconstruct.TConstruct; import tconstruct.library.crafting.CastingRecipe; import tconstruct.library.crafting.LiquidCasting; @@ -30,9 +33,11 @@ import tconstruct.library.event.SmelteryEvent; import tconstruct.library.tools.AbilityHelper; import tconstruct.library.util.IPattern; -public abstract class CastingBlockLogic extends InventoryLogic implements IFluidTank, IFluidHandler, ISidedInventory { +public abstract class CastingBlockLogic extends InventoryLogic + implements IFluidTank, IFluidHandler, ISidedInventory, IFacingLogic { public FluidStack liquid; + protected byte direction; protected int maxCastingDelay = 0; protected int castingDelay = 0; protected int renderOffset = 0; @@ -289,7 +294,7 @@ public abstract class CastingBlockLogic extends InventoryLogic implements IFluid player); MinecraftForge.EVENT_BUS.post(event); - // try to transfer thes tack to the player inventory + // try to transfer the stack to the player inventory ItemStack output = event.item; AbilityHelper.spawnItemAtPlayer(player, output); @@ -431,6 +436,7 @@ public abstract class CastingBlockLogic extends InventoryLogic implements IFluid this.castingDelay = tags.getInteger("castingDelay"); this.maxCastingDelay = tags.getInteger("maxCastingDelay"); this.renderOffset = tags.getInteger("RenderOffset"); + this.direction = tags.getByte("direction"); } @Override @@ -451,6 +457,7 @@ public abstract class CastingBlockLogic extends InventoryLogic implements IFluid tags.setInteger("castingDelay", castingDelay); tags.setInteger("maxCastingDelay", maxCastingDelay); tags.setInteger("RenderOffset", renderOffset); + tags.setByte("direction", direction); } /* Packets */ @@ -474,4 +481,28 @@ public abstract class CastingBlockLogic extends InventoryLogic implements IFluid return (int) (((maxCastingDelay - castingDelay) / (double) maxCastingDelay) * 100); } + + @Override + public byte getRenderDirection() { + return direction; + } + + @Override + public ForgeDirection getForgeDirection() { + return ForgeDirection.VALID_DIRECTIONS[direction]; + } + + @Override + public void setDirection(int side) {} + + @Override + public void setDirection(float yaw, float pitch, EntityLivingBase player) { + int facing = MathHelper.floor_double((double) (yaw / 360) + 0.5D) & 3; + switch (facing) { + case 1 -> direction = 5; + case 2 -> direction = 3; + case 3 -> direction = 4; + default -> direction = 2; + } + } } diff --git a/src/main/java/tconstruct/smeltery/logic/FaucetLogic.java b/src/main/java/tconstruct/smeltery/logic/FaucetLogic.java index f8610af4..a272ac71 100644 --- a/src/main/java/tconstruct/smeltery/logic/FaucetLogic.java +++ b/src/main/java/tconstruct/smeltery/logic/FaucetLogic.java @@ -6,6 +6,7 @@ import net.minecraft.network.NetworkManager; import net.minecraft.network.Packet; import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MathHelper; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; @@ -18,7 +19,7 @@ import tconstruct.TConstruct; public class FaucetLogic extends TileEntity implements IFacingLogic, IActiveLogic, IFluidHandler { - byte direction; + byte direction = 0; boolean active; public FluidStack liquid; public boolean hasRedstonePower = false; @@ -91,17 +92,20 @@ public class FaucetLogic extends TileEntity implements IFacingLogic, IActiveLogi public void setDirection(int side) { if (side != 0 && side != 1) { direction = (byte) side; - } else { - direction = 2; } } @Override public void setDirection(float yaw, float pitch, EntityLivingBase player) { - /* - * int facing = MathHelper.floor_double((double) (yaw / 360) + 0.5D) & 3; switch (facing) { case 0: direction = - * 2; break; case 1: direction = 5; break; case 2: direction = 3; break; case 3: direction = 4; break; } - */ + if (direction > 1) return; + + int facing = MathHelper.floor_double((double) (yaw / 360) + 0.5D) & 3; + switch (facing) { + case 1 -> direction = 5; + case 2 -> direction = 3; + case 3 -> direction = 4; + default -> direction = 2; + } } @Override diff --git a/src/main/java/tconstruct/smeltery/model/CastingBasinSpecialRender.java b/src/main/java/tconstruct/smeltery/model/CastingBasinSpecialRender.java index 14c68c9b..a8df2114 100644 --- a/src/main/java/tconstruct/smeltery/model/CastingBasinSpecialRender.java +++ b/src/main/java/tconstruct/smeltery/model/CastingBasinSpecialRender.java @@ -47,11 +47,20 @@ public class CastingBasinSpecialRender extends TileEntitySpecialRenderer { entityitem.hoverStart = 0.0F; GL11.glPushMatrix(); GL11.glTranslatef(1F, 0.675F, 1.0F); - // GL11.glRotatef(90F, 1, 0F, 0F); + + float rotationY = switch (logic.getRenderDirection()) { + case 2 -> 90F; + case 3 -> 270F; + case 4 -> 180F; + default -> 0F; + }; + + GL11.glRotatef(rotationY, 0F, 1F, 0F); GL11.glScalef(1.75F, 1.75F, 1.75F); + if (stack.getItem() instanceof ItemBlock) { GL11.glScalef(1.6F, 1.6F, 1.6F); - GL11.glTranslatef(0F, 0.045F, 0.0f); + GL11.glTranslatef(0F, 0.045F, 0F); } else if (!(stack.getItem() instanceof ItemBlocklike)) { GL11.glRotatef(90F, 1F, 0F, 0F); GL11.glRotatef(90F, 0F, 0F, 1F); diff --git a/src/main/java/tconstruct/smeltery/model/CastingTableSpecialRenderer.java b/src/main/java/tconstruct/smeltery/model/CastingTableSpecialRenderer.java index ac9d44c2..40376c4f 100644 --- a/src/main/java/tconstruct/smeltery/model/CastingTableSpecialRenderer.java +++ b/src/main/java/tconstruct/smeltery/model/CastingTableSpecialRenderer.java @@ -53,11 +53,30 @@ public class CastingTableSpecialRenderer extends TileEntitySpecialRenderer { entityitem.hoverStart = 0.0F; GL11.glPushMatrix(); GL11.glTranslatef(1F, 1.48F, 0.55F); - GL11.glRotatef(90F, 1, 0F, 0F); + + float rotationY = switch (logic.getRenderDirection()) { + case 3 -> 180F; + case 4 -> 90F; + case 5 -> 270F; + default -> 0F; + }; + GL11.glRotatef(rotationY, 0F, 1F, 0F); + + if (logic.getRenderDirection() == 3) { + GL11.glTranslatef(0F, 0F, -0.9F); + } else if (logic.getRenderDirection() == 4) { + GL11.glTranslatef(-0.45F, 0F, -0.45F); + } else if (logic.getRenderDirection() == 5) { + GL11.glTranslatef(0.45F, 0F, -0.45F); + } + + GL11.glRotatef(90F, 1F, 0F, 0F); GL11.glScalef(2F, 2F, 2F); + if (stack.getItem() instanceof ItemBlock || stack.getItem() instanceof ItemBlocklike) { - GL11.glRotatef(90F, -1, 0F, 0F); - GL11.glTranslatef(0F, -0.1F, 0.2275F); + GL11.glRotatef(-90F, 0F, 0F, 1F); + GL11.glRotatef(90F, -1F, 0F, 0F); + GL11.glTranslatef(-0.2275F, -0.1F, 0F); } if (stack.isItemEqual(new ItemStack(TinkerSmeltery.glassPane))) { From 8695b7f08a377d0803b12d5bc005d74f015bf072 Mon Sep 17 00:00:00 2001 From: Maya <10861407+serenibyss@users.noreply.github.com> Date: Fri, 30 May 2025 22:17:34 -0600 Subject: [PATCH 15/15] update --- dependencies.gradle | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index ebea3a44..6ac279fc 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,14 +1,14 @@ // Add your dependencies here dependencies { - compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta42:api') + compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta44:api') api("com.github.GTNewHorizons:Mantle:0.5.0:dev") - api("com.github.GTNewHorizons:ForgeMultipart:1.6.2:dev") - implementation("com.github.GTNewHorizons:NotEnoughItems:2.7.44-GTNH:dev") + api("com.github.GTNewHorizons:ForgeMultipart:1.6.3:dev") + implementation("com.github.GTNewHorizons:NotEnoughItems:2.7.49-GTNH:dev") compileOnlyApi("curse.maven:cofh-core-69162:2388751") compileOnly("com.github.GTNewHorizons:inventory-tweaks:1.7.1:api") - compileOnly("com.github.GTNewHorizons:waila:1.8.4:api") - compileOnly("com.github.GTNewHorizons:Battlegear2:1.4.2:api") + compileOnly("com.github.GTNewHorizons:waila:1.8.7:api") + compileOnly("com.github.GTNewHorizons:Battlegear2:1.4.3:api") compileOnly("curse.maven:minefactory-reloaded-66672:2366150") compileOnly("curse.maven:zelda-sword-skills-220540:2384889") compileOnly("curse.maven:dynamic-sword-skills-226360:2495462") @@ -20,7 +20,7 @@ dependencies { // For testing scythe crop harvesting // devOnlyNonPublishable("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev") - // devOnlyNonPublishable("com.github.GTNewHorizons:harvestcraft:1.3.1-GTNH:dev") + // devOnlyNonPublishable("com.github.GTNewHorizons:harvestcraft:1.3.2-GTNH:dev") // devOnlyNonPublishable(deobfCurse("pams-harvest-the-nether-231262:2241397")) // devOnlyNonPublishable("com.github.GTNewHorizons:Natura:2.8.7:dev") // devOnlyNonPublishable("com.github.GTNewHorizons:EnderCore:0.4.8")