mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
when the stairs (and slabs) are speedy
This commit is contained in:
parent
02b56d2eb5
commit
211beb1e4c
@ -360,6 +360,7 @@ public class ModBlocks {
|
||||
public static Block brick_compound_stairs;
|
||||
public static Block brick_asbestos_stairs;
|
||||
public static Block brick_fire_stairs;
|
||||
public static Block asphalt_stairs;
|
||||
|
||||
public static Block cmb_brick;
|
||||
public static Block cmb_brick_reinforced;
|
||||
@ -1529,8 +1530,8 @@ public class ModBlocks {
|
||||
brick_ducrete = new BlockGeneric(Material.rock).setBlockName("brick_ducrete").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(750.0F).setBlockTextureName(RefStrings.MODID + ":brick_ducrete");
|
||||
reinforced_ducrete = new BlockGeneric(Material.rock).setBlockName("reinforced_ducrete").setCreativeTab(MainRegistry.blockTab).setHardness(20.0F).setResistance(1000.0F).setBlockTextureName(RefStrings.MODID + ":reinforced_ducrete");
|
||||
|
||||
concrete_slab = new BlockMultiSlab(null, Material.rock, concrete_smooth, concrete, concrete_asbestos, ducrete_smooth, ducrete).setBlockName("concrete_slab").setCreativeTab(MainRegistry.blockTab);
|
||||
concrete_double_slab = new BlockMultiSlab(concrete_slab, Material.rock, concrete_smooth, concrete, concrete_asbestos, ducrete_smooth, ducrete).setBlockName("concrete_double_slab").setCreativeTab(MainRegistry.blockTab);
|
||||
concrete_slab = new BlockMultiSlab(null, Material.rock, concrete_smooth, concrete, concrete_asbestos, ducrete_smooth, ducrete, asphalt).setBlockName("concrete_slab").setCreativeTab(MainRegistry.blockTab);
|
||||
concrete_double_slab = new BlockMultiSlab(concrete_slab, Material.rock, concrete_smooth, concrete, concrete_asbestos, ducrete_smooth, ducrete, asphalt).setBlockName("concrete_double_slab").setCreativeTab(MainRegistry.blockTab);
|
||||
concrete_brick_slab = new BlockMultiSlab(null, Material.rock, brick_concrete, brick_concrete_mossy, brick_concrete_cracked, brick_concrete_broken, brick_ducrete).setBlockName("concrete_brick_slab").setCreativeTab(MainRegistry.blockTab);
|
||||
concrete_brick_double_slab = new BlockMultiSlab(concrete_brick_slab, Material.rock, brick_concrete, brick_concrete_mossy, brick_concrete_cracked, brick_concrete_broken, brick_ducrete).setBlockName("concrete_brick_double_slab").setCreativeTab(MainRegistry.blockTab);
|
||||
brick_slab = new BlockMultiSlab(null, Material.rock, reinforced_stone, reinforced_brick, brick_obsidian, brick_light, brick_compound, brick_asbestos, brick_fire).setBlockName("brick_slab").setCreativeTab(MainRegistry.blockTab);
|
||||
@ -1553,9 +1554,10 @@ public class ModBlocks {
|
||||
brick_compound_stairs = new BlockGenericStairs(brick_compound, 0).setBlockName("brick_compound_stairs").setCreativeTab(MainRegistry.blockTab);
|
||||
brick_asbestos_stairs = new BlockGenericStairs(brick_asbestos, 0).setBlockName("brick_asbestos_stairs").setCreativeTab(MainRegistry.blockTab);
|
||||
brick_fire_stairs = new BlockGenericStairs(brick_fire, 0).setBlockName("brick_fire_stairs").setCreativeTab(MainRegistry.blockTab);
|
||||
|
||||
asphalt_stairs = new BlockSpeedyStairs(asphalt, 0, 1.5).setBlockName("asphalt_stairs").setCreativeTab(MainRegistry.blockTab);
|
||||
|
||||
vinyl_tile = new BlockEnumMulti(Material.rock, TileType.class, true, true).setBlockName("vinyl_tile").setStepSound(Block.soundTypeGlass).setCreativeTab(MainRegistry.blockTab).setHardness(10.0F).setResistance(60.0F).setBlockTextureName(RefStrings.MODID + ":vinyl_tile");
|
||||
|
||||
|
||||
tile_lab = new BlockOutgas(Material.rock, false, 5, true).setBlockName("tile_lab").setStepSound(Block.soundTypeGlass).setCreativeTab(MainRegistry.blockTab).setHardness(1.0F).setResistance(20.0F).setBlockTextureName(RefStrings.MODID + ":tile_lab");
|
||||
tile_lab_cracked = new BlockOutgas(Material.rock, false, 5, true).setBlockName("tile_lab_cracked").setStepSound(Block.soundTypeGlass).setCreativeTab(MainRegistry.blockTab).setHardness(1.0F).setResistance(20.0F).setBlockTextureName(RefStrings.MODID + ":tile_lab_cracked");
|
||||
tile_lab_broken = new BlockOutgas(Material.rock, true, 5, true).setBlockName("tile_lab_broken").setStepSound(Block.soundTypeGlass).setCreativeTab(MainRegistry.blockTab).setHardness(1.0F).setResistance(20.0F).setBlockTextureName(RefStrings.MODID + ":tile_lab_broken");
|
||||
@ -2707,6 +2709,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(brick_asbestos_stairs, brick_asbestos_stairs.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(brick_fire_stairs, brick_fire_stairs.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(ducrete_stairs, ducrete_stairs.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(asphalt_stairs, asphalt_stairs.getUnlocalizedName());
|
||||
|
||||
//CMB Building Elements
|
||||
GameRegistry.registerBlock(cmb_brick, ItemBlockBlastInfo.class, cmb_brick.getUnlocalizedName());
|
||||
|
||||
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.IStepTickReceiver;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -13,12 +14,13 @@ import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockMultiSlab extends BlockSlab {
|
||||
public class BlockMultiSlab extends BlockSlab implements IStepTickReceiver {
|
||||
|
||||
public static List<Object[]> recipeGen = new ArrayList();
|
||||
|
||||
@ -100,4 +102,18 @@ public class BlockMultiSlab extends BlockSlab {
|
||||
Block block = slabMaterials[meta];
|
||||
return block.getBlockHardness(world, x, y, z); //relies on block not assuming that they are at that position
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerStep(World world, int x, int y, int z, EntityPlayer player) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
meta = (meta & 7) % slabMaterials.length;
|
||||
Block block = slabMaterials[meta];
|
||||
if(!world.isRemote || !(block instanceof BlockSpeedy))
|
||||
return;
|
||||
|
||||
if(player.moveForward != 0 || player.moveStrafing != 0) {
|
||||
player.motionX *= 1.5;
|
||||
player.motionZ *= 1.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
41
src/main/java/com/hbm/blocks/generic/BlockSpeedyStairs.java
Normal file
41
src/main/java/com/hbm/blocks/generic/BlockSpeedyStairs.java
Normal file
@ -0,0 +1,41 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import com.hbm.blocks.IStepTickReceiver;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockSpeedyStairs extends BlockGenericStairs implements IStepTickReceiver, ITooltipProvider {
|
||||
|
||||
double speed;
|
||||
|
||||
public BlockSpeedyStairs(Block block, int meta, double speed) {
|
||||
super(block, meta);
|
||||
this.speed = speed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerStep(World world, int x, int y, int z, EntityPlayer player) {
|
||||
|
||||
if(!world.isRemote)
|
||||
return;
|
||||
|
||||
if(player.moveForward != 0 || player.moveStrafing != 0) {
|
||||
player.motionX *= speed;
|
||||
player.motionZ *= speed;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
list.add(EnumChatFormatting.BLUE + "Increases speed by " + (MathHelper.floor_double((speed - 1) * 100)) + "%");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.inventory.SlotPattern;
|
||||
import com.hbm.inventory.SlotUpgrade;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.tileentity.network.TileEntityCraneGrabber;
|
||||
@ -20,7 +21,7 @@ public class ContainerCraneGrabber extends Container {
|
||||
//filter
|
||||
for(int i = 0; i < 3; i++) {
|
||||
for(int j = 0; j < 3; j++) {
|
||||
this.addSlotToContainer(new Slot(grabber, j + i * 3, 40 + j * 18, 17 + i * 18));
|
||||
this.addSlotToContainer(new SlotPattern(grabber, j + i * 3, 40 + j * 18, 17 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -4644,6 +4644,7 @@ tile.anvil_starmetal.name=Starmetal Anvil
|
||||
tile.anvil_steel.name=Steel Anvil
|
||||
tile.ash_digamma.name=Ash
|
||||
tile.asphalt.name=Asphalt
|
||||
tile.asphalt_stairs.name=Asphalt Stairs
|
||||
tile.asphalt_light.name=Glowing Asphalt
|
||||
tile.barbed_wire.name=Barbed Wire
|
||||
tile.barbed_wire_acid.name=Caustic Barbed Wire
|
||||
@ -4918,6 +4919,7 @@ tile.concrete_colored_ext.machine_stripe.name=Builder's Choice Concrete - Indust
|
||||
tile.concrete_colored_ext.pink.name=Builder's Choice Concrete - Manly Pink
|
||||
tile.concrete_colored_ext.purple.name=Builder's Choice Concrete - Mysterious Purple
|
||||
tile.concrete_pillar.name=Rebar Reinforced Concrete Pillar
|
||||
tile.concrete_slab.asphalt.name=Asphalt Slab
|
||||
tile.concrete_slab.concrete.name=Concrete Tile Slab
|
||||
tile.concrete_slab.concrete_asbestos.name=Asbestos Concrete Slab
|
||||
tile.concrete_slab.concrete_smooth.name=Concrete Slab
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user