Merge remote-tracking branch 'origin/master'

This commit is contained in:
BallOfEnergy1 2023-03-14 17:13:14 -05:00
commit 82cd509ec3
6 changed files with 42 additions and 17 deletions

View File

@ -430,6 +430,7 @@ public class ModBlocks {
public static Block steel_beam;
public static Block steel_scaffold;
public static Block steel_grate;
public static Block steel_grate_wide;
public static Block deco_pipe;
public static Block deco_pipe_rusted;
@ -1602,6 +1603,7 @@ public class ModBlocks {
steel_beam = new DecoBlock(Material.iron).setBlockName("steel_beam").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(15.0F).setBlockTextureName(RefStrings.MODID + ":steel_beam");
steel_scaffold = new BlockScaffold().setBlockName("steel_scaffold").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(15.0F).setBlockTextureName(RefStrings.MODID + ":deco_steel_orig");
steel_grate = new BlockGrate(Material.iron).setBlockName("steel_grate").setStepSound(soundTypeGrate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F);
steel_grate_wide = new BlockGrate(Material.iron).setBlockName("steel_grate_wide").setStepSound(soundTypeGrate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F);
deco_pipe = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side", 0).setBlockName("deco_pipe").setStepSound(soundTypeGrate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top");
deco_pipe_rusted = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_rusty", 0).setBlockName("deco_pipe_rusted").setStepSound(soundTypeGrate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_rusty");
@ -2737,6 +2739,7 @@ public class ModBlocks {
GameRegistry.registerBlock(steel_beam, steel_beam.getUnlocalizedName());
register(steel_scaffold);
GameRegistry.registerBlock(steel_grate, steel_grate.getUnlocalizedName());
register(steel_grate_wide);
GameRegistry.registerBlock(deco_pipe, ItemBlockBase.class, deco_pipe.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_rusted, ItemBlockBase.class, deco_pipe_rusted.getUnlocalizedName());
GameRegistry.registerBlock(deco_pipe_green, ItemBlockBase.class, deco_pipe_green.getUnlocalizedName());

View File

@ -1,5 +1,8 @@
package com.hbm.blocks.generic;
import java.util.List;
import com.hbm.blocks.ModBlocks;
import com.hbm.lib.RefStrings;
import cpw.mods.fml.client.registry.RenderingRegistry;
@ -8,6 +11,9 @@ import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.item.EntityXPOrb;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
@ -21,12 +27,14 @@ public class BlockGrate extends Block {
public BlockGrate(Material material) {
super(material);
//this.maxY = 0.999D;
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":grate_top");
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + (this == ModBlocks.steel_grate ? ":grate_top" : ":grate_wide_top"));
this.sideIcon = iconRegister.registerIcon(RefStrings.MODID + ":grate_side");
}
@ -56,13 +64,13 @@ public class BlockGrate extends Block {
@Override
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
int meta = world.getBlockMetadata(x, y, z);
this.setBlockBounds(0F, meta * 0.125F, 0F, 1F, meta * 0.125F + 0.125F, 1F);
this.setBlockBounds(0F, meta * 0.125F, 0F, 1F, meta * 0.125F + 0.125F - (this == ModBlocks.steel_grate_wide ? 0.001F : 0), 1F);
}
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
int meta = world.getBlockMetadata(x, y, z);
this.setBlockBounds(0F, meta * 0.125F, 0F, 1F, meta * 0.125F + 0.125F, 1F);
this.setBlockBounds(0F, meta * 0.125F, 0F, 1F, meta * 0.125F + 0.125F - (this == ModBlocks.steel_grate_wide ? 0.001F : 0), 1F);
return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ);
}
@ -83,4 +91,18 @@ public class BlockGrate extends Block {
return (int)Math.floor(hY * 8D);
}
@Override
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB entityBounding, List list, Entity entity) {
if(this != ModBlocks.steel_grate_wide || !(entity instanceof EntityItem || entity instanceof EntityXPOrb)) {
super.addCollisionBoxesToList(world, x, y, z, entityBounding, list, entity);
}
if((entity instanceof EntityItem || entity instanceof EntityXPOrb) && entity.posY < y + 1.5) {
entity.motionX = 0;
entity.motionZ = 0;
entity.setPosition(entity.posX, entity.posY - 0.125, entity.posZ);
}
}
}

View File

@ -245,7 +245,7 @@ public class WeaponRecipes {
CraftingManager.addRecipeAuto(ModItems.ammo_stinger_rocket.stackFromEnum(AmmoStinger.BONES), new Object[] { " C ", "SKR", " P ", 'C', ModItems.fallout, 'S', SR90.dust(), 'K', ModItems.ammo_stinger_rocket, 'R', RA226.dust(), 'P', PU.dust() });
//40mm grenades
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_grenade, 2), new Object[] { " T ", "GCI", " P ", 'T', ANY_HIGHEXPLOSIVE.dust(), 'G', ANY_SMOKELESS.dust(), 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'I', IRON.plate() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_grenade, 2), new Object[] { " T ", "GCI", " P ", 'T', ANY_HIGHEXPLOSIVE.ingot(), 'G', ANY_SMOKELESS.dust(), 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'I', IRON.plate() });
CraftingManager.addRecipeAuto(ModItems.ammo_grenade.stackFromEnum(2, AmmoGrenade.TRACER), new Object[] { " T ", "GCI", " P ", 'T', LAPIS.dust(), 'G', ANY_SMOKELESS.dust(), 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'I', IRON.plate() });
CraftingManager.addRecipeAuto(ModItems.ammo_grenade.stackFromEnum(2, AmmoGrenade.HE), new Object[] { "GIG", 'G', ModItems.ammo_grenade, 'I', ANY_PLASTICEXPLOSIVE.ingot() });
CraftingManager.addRecipeAuto(ModItems.ammo_grenade.stackFromEnum(2, AmmoGrenade.INCENDIARY), new Object[] { "GIG", 'G', ModItems.ammo_grenade, 'I', P_RED.dust() });

View File

@ -25,6 +25,8 @@ public class TextureAtlasSpriteMutatable extends TextureAtlasSprite {
private RGBMutator mutator;
public String basePath = "textures/items";
private int mipmap = 0;
private int anisotropic = 0;
public TextureAtlasSpriteMutatable(String iconName, RGBMutator mutator) {
super(iconName);
@ -32,8 +34,8 @@ public class TextureAtlasSpriteMutatable extends TextureAtlasSprite {
}
public TextureAtlasSpriteMutatable setBlockAtlas() {
int mipmap = Minecraft.getMinecraft().gameSettings.mipmapLevels;
int anisotropic = Minecraft.getMinecraft().gameSettings.anisotropicFiltering;
this.mipmap = Minecraft.getMinecraft().gameSettings.mipmapLevels;
this.anisotropic = Minecraft.getMinecraft().gameSettings.anisotropicFiltering;
this.basePath = "textures/blocks";
return this;
}
@ -59,10 +61,6 @@ public class TextureAtlasSpriteMutatable extends TextureAtlasSprite {
@Override
public boolean load(IResourceManager man, ResourceLocation resourcelocation) {
//the system is currently only applicable to items - mipmaps and whatnot aren't needed
int mipmap = 0;//Minecraft.getMinecraft().gameSettings.mipmapLevels;
int anisotropic = 0;//Minecraft.getMinecraft().gameSettings.anisotropicFiltering;
String pathName = resourcelocation.getResourcePath();
String tunkatedPath = pathName.substring(0, pathName.indexOf('-')); //fuck regex
//so basically we remove the dash and everything trailing it (see ItemAutogen.java), this allows us to have unique icon names for what is actually the same icon file

View File

@ -2,6 +2,7 @@ package com.hbm.render.item;
import org.lwjgl.opengl.GL11;
import com.hbm.items.weapon.ItemMissile.PartType;
import com.hbm.render.util.MissilePart;
import net.minecraft.client.Minecraft;
@ -68,18 +69,19 @@ public class ItemRenderMissilePart implements IItemRenderer {
double scale = size / height;
GL11.glTranslated(height / 2 * scale, 0, 0);
GL11.glRotated(135, 0, 0, 1);
GL11.glRotated(145, 1, 0, 0);
if(part.type == PartType.WARHEAD) {
GL11.glTranslated(0, height / 8 * scale, 0);
}
if(part.type == PartType.FUSELAGE) {
GL11.glTranslated(0, height / 4 * scale, 0);
}
GL11.glTranslated(3.5, 14, 0);
GL11.glScaled(-scale, -scale, -scale);
/*if(part.type.name().equals(PartType.FINS.name())) {
GL11.glTranslated(0, 0, 0);
//GL11.glRotated(-45, 1, 0, 0);
}*/
GL11.glRotatef(System.currentTimeMillis() / 25 % 360, 0, -1, 0);
Minecraft.getMinecraft().renderEngine.bindTexture(part.texture);

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 B