Skip to content

Commit

Permalink
Merge pull request #295 from TheSlize/conveyor_update_try2
Browse files Browse the repository at this point in the history
Conveyor update + translation (try 3)
  • Loading branch information
Alcatergit authored Feb 8, 2024
2 parents 1f4fe54 + f2d2116 commit 065d2f9
Show file tree
Hide file tree
Showing 211 changed files with 9,658 additions and 7,593 deletions.
9 changes: 9 additions & 0 deletions src/main/java/api/hbm/block/IBlockSideRotation.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package api.hbm.block;

import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;

public interface IBlockSideRotation {
public int getRotationFromSide(IBlockAccess world, BlockPos pos, EnumFacing side);
}
13 changes: 13 additions & 0 deletions src/main/java/api/hbm/block/IConveyorBelt.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package api.hbm.block;

import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;

public interface IConveyorBelt {

/** Returns true if the item should stay on the conveyor, false if the item should drop off */
public boolean canItemStay(World world, int x, int y, int z, Vec3d itemPos);
public Vec3d getTravelLocation(World world, int x, int y, int z, Vec3d itemPos, double speed);
public Vec3d getClosestSnappingPosition(World world, BlockPos pos, Vec3d itemPos);
}
8 changes: 8 additions & 0 deletions src/main/java/api/hbm/block/IConveyorItem.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package api.hbm.block;

import net.minecraft.item.ItemStack;

public interface IConveyorItem {

public ItemStack getItemStack();
}
9 changes: 9 additions & 0 deletions src/main/java/api/hbm/block/IEnterableBlock.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package api.hbm.block;

import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;

public interface IEnterableBlock {
public boolean canItemEnter(World world, int x, int y, int z, EnumFacing dir, IConveyorItem entity);
public void onItemEnter(World world, int x, int y, int z, EnumFacing dir, IConveyorItem entity);
}
1 change: 1 addition & 0 deletions src/main/java/api/hbm/block/IToolable.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

public interface IToolable {
Expand Down
8 changes: 5 additions & 3 deletions src/main/java/com/hbm/blocks/BlockBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import com.hbm.main.MainRegistry;

import com.hbm.util.I18nUtil;
import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
Expand All @@ -13,6 +14,7 @@
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World;

public class BlockBase extends Block {
Expand All @@ -35,14 +37,14 @@ public BlockBase(Material m, SoundType sound, String s){
}

@Override
public void addInformation(ItemStack stack, World player, List<String> tooltip, ITooltipFlag advanced) {
public void addInformation(ItemStack stack, World player, List<String> list, ITooltipFlag advanced) {
if(stack.getItem() == Item.getItemFromBlock(ModBlocks.meteor_battery)){
tooltip.add("Provides infinite charge to tesla coils");
list.add(I18nUtil.resolveKey("desc.teslacoils"));
}

float hardness = this.getExplosionResistance(null);
if(hardness > 50){
tooltip.add("§6Blast Resistance: "+hardness+"§r");
list.add(TextFormatting.GOLD + I18nUtil.resolveKey("trait.blastres") + " " + hardness);
}
}

Expand Down
170 changes: 85 additions & 85 deletions src/main/java/com/hbm/blocks/ModBlocks.java

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions src/main/java/com/hbm/blocks/bomb/NukeBalefire.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.hbm.interfaces.IBomb;
import com.hbm.tileentity.bomb.TileEntityNukeBalefire;

import com.hbm.util.I18nUtil;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
Expand All @@ -14,6 +15,7 @@
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;

Expand Down Expand Up @@ -82,7 +84,7 @@ public void explode(World world, BlockPos pos) {

@Override
public void addInformation(ItemStack stack, World player, List<String> tooltip, ITooltipFlag advanced) {
tooltip.add("§a[Balefire Bomb]§r");
tooltip.add(" §eRadius: 250m§r");
tooltip.add(TextFormatting.GREEN+"["+ I18nUtil.resolveKey("trait.balefirebomb")+"]"+"§r");
tooltip.add(TextFormatting.YELLOW+I18nUtil.resolveKey("desc.radius")+" 250m§r");
}
}
10 changes: 6 additions & 4 deletions src/main/java/com/hbm/blocks/bomb/NukeBoy.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.bomb.TileEntityNukeBoy;

import com.hbm.util.I18nUtil;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
Expand All @@ -34,6 +35,7 @@
import net.minecraft.util.Rotation;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;

Expand Down Expand Up @@ -190,11 +192,11 @@ public IBlockState withMirror(IBlockState state, Mirror mirrorIn)

@Override
public void addInformation(ItemStack stack, World player, List<String> tooltip, ITooltipFlag advanced) {
tooltip.add("§2[Nuclear Bomb]§r");
tooltip.add(" §eRadius: "+BombConfig.boyRadius+"m§r");
tooltip.add(TextFormatting.DARK_GREEN+"["+ I18nUtil.resolveKey("trait.nuclearbomb")+"]"+"§r");
tooltip.add(TextFormatting.YELLOW+I18nUtil.resolveKey("desc.radius")+" "+BombConfig.boyRadius+"m§r");
if(!BombConfig.disableNuclear){
tooltip.add("§2[Fallout]§r");
tooltip.add(" §aRadius: "+(int)BombConfig.boyRadius*(1+BombConfig.falloutRange/100)+"m§r");
tooltip.add(TextFormatting.DARK_GREEN+"["+ I18nUtil.resolveKey("trait.fallout")+"]"+"§r");
tooltip.add(TextFormatting.GREEN+I18nUtil.resolveKey("desc.radius")+" "+(int)BombConfig.boyRadius*(1+BombConfig.falloutRange/100)+"m§r");
}
}
}
4 changes: 3 additions & 1 deletion src/main/java/com/hbm/blocks/bomb/NukeCustom.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.bomb.TileEntityNukeCustom;

import com.hbm.util.I18nUtil;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
Expand All @@ -38,6 +39,7 @@
import net.minecraft.util.Mirror;
import net.minecraft.util.Rotation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;

Expand Down Expand Up @@ -271,6 +273,6 @@ public IBlockState withMirror(IBlockState state, Mirror mirrorIn) {

@Override
public void addInformation(ItemStack stack, World player, List<String> tooltip, ITooltipFlag advanced) {
tooltip.add("§d[Modular Bomb]§r");
tooltip.add(TextFormatting.LIGHT_PURPLE+"["+ I18nUtil.resolveKey("trait.modularbomb")+"]"+"§r");
}
}
6 changes: 4 additions & 2 deletions src/main/java/com/hbm/blocks/bomb/NukeFleija.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.bomb.TileEntityNukeFleija;

import com.hbm.util.I18nUtil;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
Expand All @@ -32,6 +33,7 @@
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;

Expand Down Expand Up @@ -223,7 +225,7 @@ protected BlockStateContainer createBlockState() {

@Override
public void addInformation(ItemStack stack, World player, List<String> tooltip, ITooltipFlag advanced) {
tooltip.add("§b[Schrabidium Bomb]§r");
tooltip.add(" §eRadius: "+BombConfig.fleijaRadius+"m§r");
tooltip.add(TextFormatting.AQUA+"["+ I18nUtil.resolveKey("trait.schrabbomb")+"]"+"§r");
tooltip.add(TextFormatting.YELLOW+I18nUtil.resolveKey("desc.radius")+" "+BombConfig.fleijaRadius+"m§r");
}
}
10 changes: 6 additions & 4 deletions src/main/java/com/hbm/blocks/bomb/NukeGadget.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.bomb.TileEntityNukeGadget;

import com.hbm.util.I18nUtil;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
Expand All @@ -34,6 +35,7 @@
import net.minecraft.util.Rotation;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;

Expand Down Expand Up @@ -198,11 +200,11 @@ public IBlockState withMirror(IBlockState state, Mirror mirrorIn)

@Override
public void addInformation(ItemStack stack, World player, List<String> tooltip, ITooltipFlag advanced) {
tooltip.add("§2[Nuclear Bomb]§r");
tooltip.add(" §eRadius: "+BombConfig.gadgetRadius+"m§r");
tooltip.add(TextFormatting.DARK_GREEN+"["+ I18nUtil.resolveKey("trait.nuclearbomb")+"]"+"§r");
tooltip.add(TextFormatting.YELLOW+I18nUtil.resolveKey("desc.radius")+" "+BombConfig.gadgetRadius+"m§r");
if(!BombConfig.disableNuclear){
tooltip.add("§2[Fallout]§r");
tooltip.add(" §aRadius: "+(int)BombConfig.gadgetRadius*(1+BombConfig.falloutRange/100)+"m§r");
tooltip.add(TextFormatting.DARK_GREEN+"["+ I18nUtil.resolveKey("trait.fallout")+"]"+"§r");
tooltip.add(TextFormatting.GREEN+I18nUtil.resolveKey("desc.radius")+" "+(int)BombConfig.gadgetRadius*(1+BombConfig.falloutRange/100)+"m§r");
}
}
}
10 changes: 6 additions & 4 deletions src/main/java/com/hbm/blocks/bomb/NukeMan.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.bomb.TileEntityNukeMan;

import com.hbm.util.I18nUtil;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
Expand All @@ -34,6 +35,7 @@
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;

Expand Down Expand Up @@ -228,11 +230,11 @@ public void explode(World world, BlockPos pos) {

@Override
public void addInformation(ItemStack stack, World player, List<String> tooltip, ITooltipFlag advanced) {
tooltip.add("§2[Nuclear Bomb]§r");
tooltip.add(" §eRadius: "+BombConfig.manRadius+"m§r");
tooltip.add(TextFormatting.DARK_GREEN+"["+ I18nUtil.resolveKey("trait.nuclearbomb")+"]"+"§r");
tooltip.add(TextFormatting.YELLOW+I18nUtil.resolveKey("desc.radius")+" "+BombConfig.manRadius+"m§r");
if(!BombConfig.disableNuclear){
tooltip.add("§2[Fallout]§r");
tooltip.add(" §aRadius: "+(int)BombConfig.manRadius*(1+BombConfig.falloutRange/100)+"m§r");
tooltip.add(TextFormatting.DARK_GREEN+"["+ I18nUtil.resolveKey("trait.fallout")+"]"+"§r");
tooltip.add(TextFormatting.GREEN+I18nUtil.resolveKey("desc.radius")+" "+(int)BombConfig.manRadius*(1+BombConfig.falloutRange/100)+"m§r");
}
}
}
10 changes: 6 additions & 4 deletions src/main/java/com/hbm/blocks/bomb/NukeMike.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.bomb.TileEntityNukeMike;

import com.hbm.util.I18nUtil;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
Expand All @@ -34,6 +35,7 @@
import net.minecraft.util.Rotation;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;

Expand Down Expand Up @@ -209,11 +211,11 @@ public IBlockState withMirror(IBlockState state, Mirror mirrorIn)

@Override
public void addInformation(ItemStack stack, World player, List<String> tooltip, ITooltipFlag advanced) {
tooltip.add("§6[Thermonuclear Bomb]§r");
tooltip.add(" §eRadius: "+BombConfig.mikeRadius+"m§r");
tooltip.add(TextFormatting.GOLD+"["+ I18nUtil.resolveKey("trait.thermobomb")+"]"+"§r");
tooltip.add(TextFormatting.YELLOW+I18nUtil.resolveKey("desc.radius")+" "+BombConfig.mikeRadius+"m§r");
if(!BombConfig.disableNuclear){
tooltip.add("§2[Fallout]§r");
tooltip.add(" §aRadius: "+(int)BombConfig.mikeRadius*(1+BombConfig.falloutRange/100)+"m§r");
tooltip.add(TextFormatting.DARK_GREEN+"["+ I18nUtil.resolveKey("trait.fallout")+"]"+"§r");
tooltip.add(TextFormatting.GREEN+ I18nUtil.resolveKey("desc.radius")+" "+(int)BombConfig.mikeRadius*(1+BombConfig.falloutRange/100)+"m§r");
}
}
}
8 changes: 5 additions & 3 deletions src/main/java/com/hbm/blocks/bomb/NukeN2.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.bomb.TileEntityNukeN2;

import com.hbm.util.I18nUtil;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
Expand All @@ -32,6 +33,7 @@
import net.minecraft.util.Rotation;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;

Expand Down Expand Up @@ -188,10 +190,10 @@ public IBlockState withMirror(IBlockState state, Mirror mirrorIn)

@Override
public void addInformation(ItemStack stack, World player, List<String> tooltip, ITooltipFlag advanced) {
tooltip.add("§c[Extreme Bomb]§r");
tooltip.add(" §eRadius: "+BombConfig.n2Radius+"m§r");
tooltip.add(TextFormatting.RED+"["+ I18nUtil.resolveKey("trait.extremebomb")+"]"+"§r");
tooltip.add(TextFormatting.YELLOW+I18nUtil.resolveKey("desc.radius")+" "+BombConfig.n2Radius+"m§r");
tooltip.add("");
tooltip.add("§eEach Charge Adds: "+(int)(BombConfig.n2Radius/12)+"m§r");
tooltip.add(TextFormatting.YELLOW+I18nUtil.resolveKey("desc.chargeadds")+" "+(int)(BombConfig.n2Radius/12)+"m§r");
}

}
4 changes: 3 additions & 1 deletion src/main/java/com/hbm/blocks/bomb/NukeN45.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.bomb.TileEntityNukeN45;

import com.hbm.util.I18nUtil;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
Expand All @@ -19,6 +20,7 @@
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;

Expand Down Expand Up @@ -106,6 +108,6 @@ public boolean isFullCube(IBlockState state) {

@Override
public void addInformation(ItemStack stack, World player, List<String> tooltip, ITooltipFlag advanced) {
tooltip.add("§d[Modular Bomb]§r");
tooltip.add(TextFormatting.LIGHT_PURPLE+"["+ I18nUtil.resolveKey("trait.modularbomb")+"]"+"§r");
}
}
6 changes: 4 additions & 2 deletions src/main/java/com/hbm/blocks/bomb/NukePrototype.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.bomb.TileEntityNukePrototype;

import com.hbm.util.I18nUtil;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
Expand All @@ -33,6 +34,7 @@
import net.minecraft.util.Rotation;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;

Expand Down Expand Up @@ -218,7 +220,7 @@ public IBlockState withMirror(IBlockState state, Mirror mirrorIn)

@Override
public void addInformation(ItemStack stack, World player, List<String> tooltip, ITooltipFlag advanced) {
tooltip.add("§b[Schrabidium Bomb]§r");
tooltip.add(" §eRadius: "+BombConfig.prototypeRadius+"m§r");
tooltip.add(TextFormatting.AQUA+"["+ I18nUtil.resolveKey("trait.schrabbomb")+"]"+"§r");
tooltip.add(TextFormatting.YELLOW+I18nUtil.resolveKey("desc.radius")+" "+BombConfig.prototypeRadius+"m§r");
}
}
Loading

0 comments on commit 065d2f9

Please sign in to comment.