mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
creeper defuser, heatex GUI
This commit is contained in:
parent
7b370075d7
commit
cafd78cb73
@ -1,13 +1,18 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.tileentity.machine.TileEntityHeaterHeatex;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class HeaterHeatex extends BlockDummyable {
|
||||
public class HeaterHeatex extends BlockDummyable implements ITooltipProvider {
|
||||
|
||||
public HeaterHeatex() {
|
||||
super(Material.iron);
|
||||
@ -30,4 +35,14 @@ public class HeaterHeatex extends BlockDummyable {
|
||||
public int getOffset() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
return this.standardOpenBehavior(world, x, y, z, player, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
this.addStandardInfo(stack, player, list, ext);
|
||||
}
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@ public class FalloutConfigJSON {
|
||||
entries.add(new FalloutEntry() .mB(Blocks.leaves2) .prim(new Triplet(Blocks.air, 0, 1)) .max(woodEffectRange));
|
||||
entries.add(new FalloutEntry() .mB(ModBlocks.waste_leaves) .prim(new Triplet(Blocks.air, 0, 1)) .max(woodEffectRange));
|
||||
entries.add(new FalloutEntry() .mB(Blocks.leaves) .prim(new Triplet(ModBlocks.waste_leaves, 0, 1)) .min(woodEffectRange));
|
||||
entries.add(new FalloutEntry( ).mB(Blocks.leaves2) .prim(new Triplet(ModBlocks.waste_leaves, 0, 1)) .min(woodEffectRange));
|
||||
entries.add(new FalloutEntry() .mB(Blocks.leaves2) .prim(new Triplet(ModBlocks.waste_leaves, 0, 1)) .min(woodEffectRange));
|
||||
|
||||
entries.add(new FalloutEntry() .mB(Blocks.log) .prim(new Triplet(ModBlocks.waste_log, 0, 1)) .max(woodEffectRange));
|
||||
entries.add(new FalloutEntry() .mB(Blocks.log2) .prim(new Triplet(ModBlocks.waste_log, 0, 1)) .max(woodEffectRange));
|
||||
@ -282,11 +282,16 @@ public class FalloutConfigJSON {
|
||||
writer.name("matchesMaterial").value(matName);
|
||||
}
|
||||
}
|
||||
if(isSolid) writer.name("restrictDepth").value(true);
|
||||
|
||||
if(primaryBlocks != null) { writer.name("primarySubstitution"); writeMetaArray(writer, primaryBlocks); }
|
||||
if(secondaryBlocks != null) { writer.name("secondarySubstitutions"); writeMetaArray(writer, secondaryBlocks); }
|
||||
|
||||
|
||||
if(primaryChance != 1D) writer.name("chance").value(primaryChance);
|
||||
|
||||
if(minDist != 0.0D) writer.name("minimumDistancePercent").value(minDist);
|
||||
if(maxDist != 100.0D) writer.name("maximumDistancePercent").value(maxDist);
|
||||
|
||||
}
|
||||
|
||||
private static FalloutEntry readEntry(JsonElement recipe) {
|
||||
@ -299,9 +304,15 @@ public class FalloutConfigJSON {
|
||||
if(obj.has("matchesMeta")) entry.mM(obj.get("matchesMeta").getAsInt());
|
||||
if(obj.has("mustBeOpaque")) entry.mO(obj.get("mustBeOpaque").getAsBoolean());
|
||||
if(obj.has("matchesMaterial")) entry.mMa(matNames.get(obj.get("mustBeOpaque").getAsString()));
|
||||
if(obj.has("restrictDepth")) entry.sol(obj.get("restrictDepth").getAsBoolean());
|
||||
|
||||
if(obj.has("primarySubstitution")) entry.prim(readMetaArray(obj.get("primarySubstitution")));
|
||||
if(obj.has("secondarySubstitutions")) entry.sec(readMetaArray(obj.get("secondarySubstitutions")));
|
||||
|
||||
if(obj.has("chance")) entry.c(obj.get("chance").getAsInt());
|
||||
|
||||
if(obj.has("minimumDistancePercent")) entry.min(obj.get("minimumDistancePercent").getAsDouble());
|
||||
if(obj.has("maximumDistancePercent")) entry.min(obj.get("maximumDistancePercent").getAsDouble());
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
@ -198,6 +198,7 @@ public class ConsumableRecipes {
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.meteor_charm, 1), new Object[] { " M ", "MDM", " M ", 'M', ModItems.fragment_meteorite, 'D', VOLCANIC.gem() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.neutrino_lens, 1), new Object[] { "PSP", "SCS", "PSP", 'P', ANY_PLASTIC.ingot(), 'S', STAR.ingot(), 'C', KEY_CIRCUIT_BISMUTH });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gas_tester, 1), new Object[] { "G", "C", "I", 'G', GOLD.plate(), 'C', ModItems.circuit_aluminium, 'I', IRON.plate() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.defuser_gold, 1), new Object[] { "GPG", "PRP", "GPG", 'G', Items.gunpowder, 'P', GOLD.plate(), 'R', "record" });
|
||||
|
||||
//Stealth boy
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.stealth_boy, 1), new Object[] { " B", "LI", "LC", 'B', Blocks.stone_button, 'L', Items.leather, 'I', STEEL.ingot(), 'C', ModItems.circuit_red_copper });
|
||||
|
||||
@ -0,0 +1,64 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.tileentity.machine.TileEntityHeaterHeatex;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerHeaterHeatex extends Container {
|
||||
|
||||
private TileEntityHeaterHeatex heater;
|
||||
|
||||
public ContainerHeaterHeatex(InventoryPlayer invPlayer, TileEntityHeaterHeatex tedf) {
|
||||
heater = tedf;
|
||||
|
||||
this.addSlotToContainer(new Slot(tedf, 0, 71, 73));
|
||||
|
||||
for(int i = 0; i < 3; i++) {
|
||||
for(int j = 0; j < 9; j++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 122 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 180));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) {
|
||||
ItemStack var3 = null;
|
||||
Slot var4 = (Slot) this.inventorySlots.get(par2);
|
||||
|
||||
if(var4 != null && var4.getHasStack()) {
|
||||
ItemStack var5 = var4.getStack();
|
||||
var3 = var5.copy();
|
||||
|
||||
if(par2 == 0) {
|
||||
if(!this.mergeItemStack(var5, 1, this.inventorySlots.size(), true)) {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
if(!this.mergeItemStack(var5, 0, 1, false)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
if(var5.stackSize == 0) {
|
||||
var4.putStack((ItemStack) null);
|
||||
} else {
|
||||
var4.onSlotChanged();
|
||||
}
|
||||
}
|
||||
|
||||
return var3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return heater.isUseableByPlayer(player);
|
||||
}
|
||||
}
|
||||
@ -2,29 +2,26 @@ package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.inventory.SlotMachineOutput;
|
||||
import com.hbm.items.machine.IItemFluidIdentifier;
|
||||
import com.hbm.items.machine.ItemMachineUpgrade;
|
||||
import com.hbm.tileentity.machine.TileEntityHeaterOilburner;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerOilburner extends Container {
|
||||
|
||||
private TileEntityHeaterOilburner testNuke;
|
||||
private TileEntityHeaterOilburner heater;
|
||||
|
||||
public ContainerOilburner(InventoryPlayer invPlayer, TileEntityHeaterOilburner tedf) {
|
||||
|
||||
testNuke = tedf;
|
||||
heater = tedf;
|
||||
|
||||
//In
|
||||
this.addSlotToContainer(new Slot(tedf, 0, 26, 17));
|
||||
//Out
|
||||
this.addSlotToContainer(new Slot(tedf, 1, 26, 53));
|
||||
this.addSlotToContainer(new SlotMachineOutput(tedf, 1, 26, 53));
|
||||
//Fluid ID
|
||||
this.addSlotToContainer(new Slot(tedf, 2, 44, 71));
|
||||
|
||||
@ -41,11 +38,6 @@ public class ContainerOilburner extends Container {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCraftingToCrafters(ICrafting crafting) {
|
||||
super.addCraftingToCrafters(crafting);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) {
|
||||
ItemStack var3 = null;
|
||||
@ -84,6 +76,6 @@ public class ContainerOilburner extends Container {
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return testNuke.isUseableByPlayer(player);
|
||||
return heater.isUseableByPlayer(player);
|
||||
}
|
||||
}
|
||||
|
||||
27
src/main/java/com/hbm/inventory/gui/GUIHeaterHeatex.java
Normal file
27
src/main/java/com/hbm/inventory/gui/GUIHeaterHeatex.java
Normal file
@ -0,0 +1,27 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import com.hbm.inventory.container.ContainerHeaterHeatex;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityHeaterHeatex;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIHeaterHeatex extends GuiInfoContainer {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/machine/gui_heatex.png");
|
||||
private TileEntityHeaterHeatex heater;
|
||||
|
||||
public GUIHeaterHeatex(InventoryPlayer invPlayer, TileEntityHeaterHeatex tedf) {
|
||||
super(new ContainerHeaterHeatex(invPlayer, tedf));
|
||||
heater = tedf;
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 203;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
|
||||
}
|
||||
}
|
||||
@ -2293,6 +2293,7 @@ public class ModItems {
|
||||
public static Item meteor_charm;
|
||||
public static Item neutrino_lens;
|
||||
public static Item gas_tester;
|
||||
public static Item defuser_gold;
|
||||
|
||||
public static Item hazmat_helmet;
|
||||
public static Item hazmat_plate;
|
||||
@ -3533,6 +3534,7 @@ public class ModItems {
|
||||
meteor_charm = new ItemModCharm().setUnlocalizedName("meteor_charm").setTextureName(RefStrings.MODID + ":meteor_charm");
|
||||
neutrino_lens = new ItemModLens().setUnlocalizedName("neutrino_lens").setTextureName(RefStrings.MODID + ":neutrino_lens");
|
||||
gas_tester = new ItemModSensor().setUnlocalizedName("gas_tester").setTextureName(RefStrings.MODID + ":gas_tester");
|
||||
defuser_gold = new ItemModDefuser().setUnlocalizedName("defuser_gold").setTextureName(RefStrings.MODID + ":defuser_gold");
|
||||
|
||||
cap_nuka = new Item().setUnlocalizedName("cap_nuka").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":cap_nuka");
|
||||
cap_quantum = new Item().setUnlocalizedName("cap_quantum").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":cap_quantum");
|
||||
@ -7831,6 +7833,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(meteor_charm, meteor_charm.getUnlocalizedName());
|
||||
GameRegistry.registerItem(neutrino_lens, neutrino_lens.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gas_tester, gas_tester.getUnlocalizedName());
|
||||
GameRegistry.registerItem(defuser_gold, defuser_gold.getUnlocalizedName());
|
||||
|
||||
//Chaos
|
||||
GameRegistry.registerItem(chocolate_milk, chocolate_milk.getUnlocalizedName());
|
||||
|
||||
70
src/main/java/com/hbm/items/armor/ItemModDefuser.java
Normal file
70
src/main/java/com/hbm/items/armor/ItemModDefuser.java
Normal file
@ -0,0 +1,70 @@
|
||||
package com.hbm.items.armor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.handler.ArmorModHandler;
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.ai.EntityAICreeperSwell;
|
||||
import net.minecraft.entity.ai.EntityAITasks.EntityAITaskEntry;
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
public class ItemModDefuser extends ItemArmorMod {
|
||||
|
||||
public ItemModDefuser() {
|
||||
super(ArmorModHandler.extra, true, true, true, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {
|
||||
|
||||
list.add(EnumChatFormatting.YELLOW + "Defuses nearby creepers");
|
||||
list.add("");
|
||||
super.addInformation(itemstack, player, list, bool);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDesc(List list, ItemStack stack, ItemStack armor) {
|
||||
list.add(EnumChatFormatting.YELLOW + " " + stack.getDisplayName() + " (Defuses creepers)");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void modUpdate(EntityLivingBase entity, ItemStack armor) {
|
||||
|
||||
if(entity.worldObj.isRemote || entity.worldObj.getTotalWorldTime() % 20 != 0) return;
|
||||
|
||||
List<EntityCreeper> creepers = entity.worldObj.getEntitiesWithinAABB(EntityCreeper.class, entity.boundingBox.expand(5, 5, 5));
|
||||
|
||||
for(EntityCreeper creeper : creepers) {
|
||||
|
||||
if(creeper.getCreeperState() == 1 ) {
|
||||
creeper.setCreeperState(-1);
|
||||
|
||||
EntityAICreeperSwell toRem = null;
|
||||
for(Object o : creeper.tasks.taskEntries) {
|
||||
EntityAITaskEntry entry = (EntityAITaskEntry) o;
|
||||
|
||||
if(entry.action instanceof EntityAICreeperSwell) {
|
||||
toRem = (EntityAICreeperSwell) entry.action;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(toRem != null) {
|
||||
creeper.tasks.removeTask(toRem);
|
||||
creeper.worldObj.playSoundEffect(creeper.posX, creeper.posY, creeper.posZ, "hbm:item.pinBreak", 1.0F, 1.0F);
|
||||
creeper.dropItem(creeper.getRNG().nextBoolean() ? ModItems.wire_copper : ModItems.safety_fuse, 1);
|
||||
creeper.attackEntityFrom(DamageSource.causeMobDamage(entity), 1.0F);
|
||||
creeper.addPotionEffect(new PotionEffect(Potion.weakness.id, 0, 200));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -40,6 +40,7 @@ import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.hbm.blocks.BlockEnums.EnumStoneType;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.generic.BlockMotherOfAllOres;
|
||||
import com.hbm.commands.CommandReloadRecipes;
|
||||
@ -807,6 +808,7 @@ public class MainRegistry {
|
||||
|
||||
new OreCave(ModBlocks.stone_resource, 0).setThreshold(1.5D).setRangeMult(20).setYLevel(30).setMaxRange(20).withFluid(ModBlocks.sulfuric_acid_block); //sulfur
|
||||
new OreCave(ModBlocks.stone_resource, 1).setThreshold(1.75D).setRangeMult(20).setYLevel(25).setMaxRange(20); //asbestos
|
||||
new OreLayer3D(ModBlocks.stone_resource, EnumStoneType.HEMATITE.ordinal());
|
||||
//new OreLayer(Blocks.coal_ore, 0.2F).setThreshold(4).setRangeMult(3).setYLevel(70);
|
||||
|
||||
SuicideThreadDump.register();
|
||||
|
||||
@ -1,20 +1,30 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.inventory.container.ContainerHeaterHeatex;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.fluid.trait.FT_Coolable;
|
||||
import com.hbm.inventory.fluid.trait.FT_Coolable.CoolingType;
|
||||
import com.hbm.inventory.gui.GUIHeaterHeatex;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.INBTPacketReceiver;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.fluid.IFluidStandardTransceiver;
|
||||
import api.hbm.tile.IHeatSource;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityHeaterHeatex extends TileEntityMachineBase implements IHeatSource, INBTPacketReceiver, IFluidStandardTransceiver {
|
||||
public class TileEntityHeaterHeatex extends TileEntityMachineBase implements IHeatSource, INBTPacketReceiver, IFluidStandardTransceiver, IGUIProvider {
|
||||
|
||||
public FluidTank[] tanks;
|
||||
public int amountToCool = 1;
|
||||
@ -125,4 +135,40 @@ public class TileEntityHeaterHeatex extends TileEntityMachineBase implements IHe
|
||||
public FluidTank[] getReceivingTanks() {
|
||||
return new FluidTank[] {tanks[0]};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerHeaterHeatex(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIHeaterHeatex(player.inventory, this);
|
||||
}
|
||||
|
||||
AxisAlignedBB bb = null;
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
|
||||
if(bb == null) {
|
||||
bb = AxisAlignedBB.getBoundingBox(
|
||||
xCoord - 1,
|
||||
yCoord,
|
||||
zCoord - 1,
|
||||
xCoord + 2,
|
||||
yCoord + 1,
|
||||
zCoord + 2
|
||||
);
|
||||
}
|
||||
|
||||
return bb;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
return 65536.0D;
|
||||
}
|
||||
}
|
||||
|
||||
69
src/main/java/com/hbm/world/feature/OreLayer3D.java
Normal file
69
src/main/java/com/hbm/world/feature/OreLayer3D.java
Normal file
@ -0,0 +1,69 @@
|
||||
package com.hbm.world.feature;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.NoiseGeneratorPerlin;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.terraingen.DecorateBiomeEvent;
|
||||
|
||||
public class OreLayer3D {
|
||||
|
||||
NoiseGeneratorPerlin noiseX;
|
||||
NoiseGeneratorPerlin noiseY;
|
||||
NoiseGeneratorPerlin noiseZ;
|
||||
|
||||
Block block;
|
||||
int meta;
|
||||
|
||||
public OreLayer3D(Block block, int meta) {
|
||||
this.block = block;
|
||||
this.meta = meta;
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onDecorate(DecorateBiomeEvent.Pre event) {
|
||||
|
||||
if(this.noiseX == null) this.noiseX = new NoiseGeneratorPerlin(new Random(event.world.getSeed() + 101), 4);
|
||||
if(this.noiseY == null) this.noiseY = new NoiseGeneratorPerlin(new Random(event.world.getSeed() + 102), 4);
|
||||
if(this.noiseZ == null) this.noiseZ = new NoiseGeneratorPerlin(new Random(event.world.getSeed() + 103), 4);
|
||||
|
||||
World world = event.world;
|
||||
|
||||
if(world.provider.dimensionId != 0)
|
||||
return;
|
||||
|
||||
int cX = event.chunkX;
|
||||
int cZ = event.chunkZ;
|
||||
|
||||
double scale = 0.01D;
|
||||
int threshold = 5;
|
||||
|
||||
for(int x = cX + 8; x < cX + 24; x++) {
|
||||
for(int z = cZ + 8; z < cZ + 24; z++) {
|
||||
|
||||
double nY = this.noiseY.func_151601_a(x, z);
|
||||
|
||||
if(nY > 3) {
|
||||
|
||||
for(int y = 64; y > 5; y--) {
|
||||
double nX = this.noiseY.func_151601_a(y, z);
|
||||
double nZ = this.noiseY.func_151601_a(x, y);
|
||||
|
||||
if(nX > 3 && nZ > 3) {
|
||||
Block target = world.getBlock(x, y, z);
|
||||
|
||||
if(target.isNormalCube() && target.getMaterial() == Material.rock) {
|
||||
world.setBlock(x, y, z, block, meta, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1458,6 +1458,7 @@ item.debris_metal.name=Gebrochene Metallleiste
|
||||
item.debris_shrapnel.name=Wartungssteg-Schrapnell
|
||||
item.definitelyfood.name=GarantiertKeinDreck-Marken Feldration
|
||||
item.defuser.name=High-Tech Bombenentschärfungsgerät
|
||||
item.defuser_gold.name=Goldener Seitenschneider
|
||||
item.demon_core_closed.name=Bedeckter Dämonenkern
|
||||
item.demon_core_open.name=Gehobener Dämonenkern
|
||||
item.desh_axe.name=Arbeitslegierungsaxt
|
||||
|
||||
@ -1799,6 +1799,7 @@ item.debris_metal.name=Broken Metal Bar
|
||||
item.debris_shrapnel.name=Walkway Shrapnel
|
||||
item.definitelyfood.name=TotallyNotDirt-Brand MRE
|
||||
item.defuser.name=High-Tech Bomb Defusing Device
|
||||
item.defuser_gold.name=Golden Wire Cutter
|
||||
item.demon_core_closed.name=Closed Demon Core
|
||||
item.demon_core_open.name=Suspended Demon Core
|
||||
item.desh_axe.name=Worker's Alloy Axe
|
||||
|
||||
BIN
src/main/resources/assets/hbm/textures/items/defuser_gold.png
Normal file
BIN
src/main/resources/assets/hbm/textures/items/defuser_gold.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 234 B |
Loading…
x
Reference in New Issue
Block a user