now with extra non-glooby slime

This commit is contained in:
Boblet 2026-07-09 11:59:11 +02:00
parent aff1d337ca
commit 55a40919cc
18 changed files with 253 additions and 81 deletions

View File

@ -11,7 +11,9 @@
* Filters can be set using items or RoR commands
* Requests can be configured to take as much as possible, to only take full stacks, or to only take full requests
* In combination with assembler recipe switching, using RoR logic, this means that on-demand recipe automation is now possible
* Still in testing, there's no recpes for any of the parts yet
* Still in testing, there's no recipes for any of the parts yet
* Cargo door
* Steel grate door which goes well with the cargo elevators
## Changed
* Updated chinese localization
@ -71,6 +73,15 @@
* Standard control units now use rubber instead of speed I upgrades
* Advanced control units now use hardplastics instead of speed III upgrades
* Quantum computers now use speed III upgrades instead of overdrive I
* Updated electric furnace GUI
* The RoR terminal can now accept RoR controller input, allowing the terminal screen to be written directly and RoR terminal commands to be executed via incoming RoR signals
* The last part seems redundant, why would you need to send RoR by sending RoR? The answer being, the terminal can be toggled to send polling signals, which will run independently of the source
* For AUTOCALs, this means that they can now send polling signals "in parallel", i.e. independently of the code that actually runs on said AUTOCAL, by simply toggling polling on a terminal
* Since AUTOCALs now have a proper screen to output things with, it is now theoretically possible to program a functioning arcade machine (with terminal graphics)
* Glyphids will now try to target new players every 5 seconds if their current target is farther away than any other potential target
* 1/3 of glyphids do not have this behavior, this means that larger groups of glyphids cannot be trapped indefinitely by triggering target changes on purpose
* Pedestal blocks fitted with charms now have a 200x200 block square area around them where the charm effect of repelling meteors applies to all players
* Pedestal blocks fitted with golden defusers now have a 50x50 block area around them where creepers are automatically defused
## Fixed
* Fixed AUTOCAL's number comparison functions not working with variable substitution as advertised
@ -85,3 +96,4 @@
* Fixed AUTOCAL's $buffer$ substitution not working
* Fixed meteorite sword localization still being broken
* Fixed missing localization on the FM radio
* Fixed mufflers not working on large doors

View File

@ -1,14 +1,19 @@
package com.hbm.blocks.generic;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import com.hbm.extprop.HbmPlayerProps;
import com.hbm.inventory.recipes.PedestalRecipes;
import com.hbm.inventory.recipes.PedestalRecipes.PedestalRecipe;
import com.hbm.items.ModItems;
import com.hbm.items.armor.ItemModDefuser;
import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry;
import com.hbm.particle.helper.ExplosionSmallCreator;
import com.hbm.util.Compat;
import com.hbm.util.fauxpointtwelve.BlockPos;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.relauncher.Side;
@ -18,6 +23,7 @@ import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@ -194,7 +200,23 @@ public class BlockPedestal extends BlockContainer {
public ItemStack item;
@Override public boolean canUpdate() { return false; }
@Override
public void updateEntity() {
if(!worldObj.isRemote && worldObj.getTotalWorldTime() % 20 == 0) {
if(this.item != null) {
if(item.getItem() == ModItems.protection_charm) pushPedestalEntry(worldObj, PedestalEntryType.CHARM_OF_PROTECTION, xCoord, yCoord, zCoord);
if(item.getItem() == ModItems.meteor_charm) pushPedestalEntry(worldObj, PedestalEntryType.METEORITE_CHARM, xCoord, yCoord, zCoord);
if(worldObj.getTotalWorldTime() % 60 == 0 && item.getItem() == ModItems.defuser) castrateCreepers();
}
}
}
public void castrateCreepers() {
List<EntityCreeper> creepers = worldObj.getEntitiesWithinAABB(EntityCreeper.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1).expand(25, 25, 25));
for(EntityCreeper creeper : creepers) ItemModDefuser.castrateCreeper(creeper, null, false);
}
@Override
public Packet getDescriptionPacket() {
@ -224,4 +246,48 @@ public class BlockPedestal extends BlockContainer {
}
}
}
public static HashMap<Integer, List<PedestalEntry>> pedestalEntries = new HashMap();
public static void pushPedestalEntry(World world, PedestalEntryType type, int x, int y, int z) {
PedestalEntry entry = new PedestalEntry(type, x, y, z, world.getTotalWorldTime());
int dim = world.provider.dimensionId;
List<PedestalEntry> entries = pedestalEntries.get(dim);
if(entries == null) {
entries = new ArrayList();
pedestalEntries.put(dim, entries);
}
entries.add(entry);
}
public static final int timeout = 60; //3 seconds
public static void checkPedestalEntries(int dim, long currentTime) {
List<PedestalEntry> entries = getEntriesForDimension(dim);
if(entries == null) return;
entries.removeIf(x -> { return x.timestamp < currentTime - timeout; });
}
public static List<PedestalEntry> getEntriesForDimension(int dim) {
return pedestalEntries.get(dim);
}
public static class PedestalEntry {
public PedestalEntryType type;
public BlockPos pos;
public long timestamp;
public PedestalEntry(PedestalEntryType type, int x, int y, int z, long timestamp) {
this.type = type;
this.pos = new BlockPos(x, y, z);
this.timestamp = timestamp;
}
}
public static enum PedestalEntryType {
CHARM_OF_PROTECTION,
METEORITE_CHARM
}
}

View File

@ -224,6 +224,13 @@ public class EntityGlyphid extends EntityMob implements IResistanceProvider {
protected void updateEntityActionState() {
super.updateEntityActionState();
// re-scan for new targets every so often
// every third glyphid does not do this, so you cannot "juggle" hordes on purpose
if(this.getEntityId() % 3 > 0 && (this.getEntityId() + this.ticksExisted) % 100 == 0) {
Entity newTarget = this.findPlayerToAttack();
if(newTarget != null) this.setTarget(newTarget);
}
if(!this.isPotionActive(Potion.blindness)) {
if (!this.hasPath()) {

View File

@ -1,8 +1,12 @@
package com.hbm.handler;
import java.util.List;
import java.util.Random;
import com.hbm.blocks.ModBlocks;
import com.hbm.blocks.generic.BlockPedestal;
import com.hbm.blocks.generic.BlockPedestal.PedestalEntry;
import com.hbm.blocks.generic.BlockPedestal.PedestalEntryType;
import com.hbm.config.GeneralConfig;
import com.hbm.config.MobConfig;
import com.hbm.config.WorldConfig;
@ -232,8 +236,21 @@ public class BossSpawnHandler {
}
}
if(strike)
spawnMeteorAtPlayer(p, repell);
// only check if either charm is not present
if(!repell || strike) {
int x = (int) Math.floor(p.posX);
int z = (int) Math.floor(p.posZ);
List<PedestalEntry> entries = BlockPedestal.getEntriesForDimension(world.provider.dimensionId);
if(entries != null) for(PedestalEntry entry : entries) {
if(Math.abs(entry.pos.getX() - x) <= 100 && Math.abs(entry.pos.getZ() - z) <= 100) {
if(entry.type == PedestalEntryType.CHARM_OF_PROTECTION) repell = true;
if(entry.type == PedestalEntryType.METEORITE_CHARM) strike = false;
}
}
}
if(strike) spawnMeteorAtPlayer(p, repell);
}
}
}

View File

@ -16,11 +16,11 @@ import com.hbm.util.i18n.I18nUtil;
public class GUIMachineElectricFurnace extends GuiInfoContainer {
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/GUIElectricFurnace.png");
private TileEntityMachineElectricFurnace diFurnace;
private TileEntityMachineElectricFurnace furnace;
public GUIMachineElectricFurnace(InventoryPlayer invPlayer, TileEntityMachineElectricFurnace tedf) {
super(new ContainerElectricFurnace(invPlayer, tedf));
diFurnace = tedf;
public GUIMachineElectricFurnace(InventoryPlayer invPlayer, TileEntityMachineElectricFurnace furnace) {
super(new ContainerElectricFurnace(invPlayer, furnace));
this.furnace = furnace;
this.xSize = 176;
this.ySize = 186;
@ -30,18 +30,18 @@ public class GUIMachineElectricFurnace extends GuiInfoContainer {
public void drawScreen(int mouseX, int mouseY, float f) {
super.drawScreen(mouseX, mouseY, f);
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 20, guiTop + 69 - 52, 16, 52, diFurnace.power, diFurnace.maxPower);
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 52 - 34, 16, 34, furnace.power, furnace.maxPower);
String[] upgradeText = new String[3];
upgradeText[0] = I18nUtil.resolveKey("desc.gui.upgrade");
upgradeText[1] = I18nUtil.resolveKey("desc.gui.upgrade.speed");
upgradeText[2] = I18nUtil.resolveKey("desc.gui.upgrade.power");
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 151, guiTop + 19, 8, 8, mouseX, mouseY, upgradeText);
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 116, guiTop + 20, 8, 8, mouseX, mouseY, upgradeText);
}
@Override
protected void drawGuiContainerForegroundLayer(int i, int j) {
String name = this.diFurnace.hasCustomInventoryName() ? this.diFurnace.getInventoryName() : I18n.format(this.diFurnace.getInventoryName());
String name = this.furnace.hasCustomInventoryName() ? this.furnace.getInventoryName() : I18n.format(this.furnace.getInventoryName());
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
@ -58,21 +58,21 @@ public class GUIMachineElectricFurnace extends GuiInfoContainer {
//if initial ZE is still present, it'll be used instead
//works so that container packets can still be used
//efficiency!
if(diFurnace.isInvalid() && diFurnace.getWorldObj().getTileEntity(diFurnace.xCoord, diFurnace.yCoord, diFurnace.zCoord) instanceof TileEntityMachineElectricFurnace)
diFurnace = (TileEntityMachineElectricFurnace) diFurnace.getWorldObj().getTileEntity(diFurnace.xCoord, diFurnace.yCoord, diFurnace.zCoord);
if(furnace.isInvalid() && furnace.getWorldObj().getTileEntity(furnace.xCoord, furnace.yCoord, furnace.zCoord) instanceof TileEntityMachineElectricFurnace)
furnace = (TileEntityMachineElectricFurnace) furnace.getWorldObj().getTileEntity(furnace.xCoord, furnace.yCoord, furnace.zCoord);
if(diFurnace.hasPower()) {
int i = (int)diFurnace.getPowerScaled(34);
drawTexturedModalRect(guiLeft + 152, guiTop + 52 - i, 176, 64 - i, 16, i);
if(furnace.hasPower()) {
int p = (int) furnace.getPowerScaled(34);
drawTexturedModalRect(guiLeft + 152, guiTop + 52 - p, 176, 64 - p, 16, p);
}
if(diFurnace.getWorldObj().getBlock(diFurnace.xCoord, diFurnace.yCoord, diFurnace.zCoord) == ModBlocks.machine_electric_furnace_on) {
if(furnace.getWorldObj().getBlock(furnace.xCoord, furnace.yCoord, furnace.zCoord) == ModBlocks.machine_electric_furnace_on) {
drawTexturedModalRect(guiLeft + 45, guiTop + 20, 192, 12, 18, 16);
drawTexturedModalRect(guiLeft + 45, guiTop + 47, 192, 36, 18, 16);
}
int j1 = diFurnace.getProgressScaled(28);
drawTexturedModalRect(guiLeft + 43, guiTop + 36, 176, 0, j1, 12);
int p = furnace.getProgressScaled(28);
drawTexturedModalRect(guiLeft + 43, guiTop + 36, 176, 0, p, 12);
this.drawInfoPanel(guiLeft + 116, guiTop + 20, 8, 8, 8);
}

View File

@ -42,10 +42,11 @@ public class ItemModDefuser extends ItemArmorMod {
List<EntityCreeper> creepers = entity.worldObj.getEntitiesWithinAABB(EntityCreeper.class, entity.boundingBox.expand(5, 5, 5));
for(EntityCreeper creeper : creepers) defuse(creeper, entity, true);
for(EntityCreeper creeper : creepers) castrateCreeper(creeper, entity, true);
}
public static boolean defuse(EntityCreeper creeper, EntityLivingBase entity, boolean dropItem) {
/** my bualls */
public static boolean castrateCreeper(EntityCreeper creeper, EntityLivingBase entity, boolean dropItem) {
creeper.setCreeperState(-1);
creeper.getDataWatcher().updateObject(18, new Byte((byte) 0));
@ -66,7 +67,7 @@ public class ItemModDefuser extends ItemArmorMod {
if(dropItem) {
creeper.worldObj.playSoundEffect(creeper.posX, creeper.posY, creeper.posZ, "hbm:item.pinBreak", 1.0F, 1.0F);
creeper.dropItem(ModItems.safety_fuse, 1);
creeper.attackEntityFrom(DamageSource.causeMobDamage(entity), 1.0F);
creeper.attackEntityFrom(entity != null ? DamageSource.causeMobDamage(entity) : DamageSource.magic, 1.0F);
creeper.addPotionEffect(new PotionEffect(Potion.weakness.id, 0, 200));
}
creeper.getEntityData().setBoolean("hfr_defused", true);

View File

@ -38,11 +38,9 @@ public class ItemModMilk extends ItemArmorMod {
public void modUpdate(EntityLivingBase entity, ItemStack armor) {
List<Integer> ints = new ArrayList();
Iterator iterator = ((Collection) entity.getActivePotionEffects()).iterator();
while(iterator.hasNext()) {
PotionEffect eff = (PotionEffect) iterator.next();
if(HbmPotion.getIsBadEffect(Potion.potionTypes[eff.getPotionID()])) {
@ -50,8 +48,6 @@ public class ItemModMilk extends ItemArmorMod {
}
}
for(Integer i : ints) {
entity.removePotionEffect(i);
}
for(Integer i : ints) entity.removePotionEffect(i);
}
}

View File

@ -27,7 +27,7 @@ public class ItemDefuser extends ItemTooling {
public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer player, EntityLivingBase entity) {
if(entity instanceof EntityCreeper) {
return ItemModDefuser.defuse((EntityCreeper) entity, player, true);
return ItemModDefuser.castrateCreeper((EntityCreeper) entity, player, true);
}
if(entity instanceof EntityGlyphidNuclear) {

View File

@ -5,6 +5,7 @@ import com.google.common.collect.Multimap;
import com.hbm.blocks.IStepTickReceiver;
import com.hbm.blocks.ModBlocks;
import com.hbm.blocks.generic.BlockAshes;
import com.hbm.blocks.generic.BlockPedestal;
import com.hbm.config.GeneralConfig;
import com.hbm.config.MobConfig;
import com.hbm.config.RadiationConfig;
@ -508,7 +509,7 @@ public class ModEventHandler {
public void onLivingUpdate(LivingUpdateEvent event) {
if(event.entityLiving instanceof EntityCreeper && event.entityLiving.getEntityData().getBoolean("hfr_defused")) {
ItemModDefuser.defuse((EntityCreeper) event.entityLiving, null, false);
ItemModDefuser.castrateCreeper((EntityCreeper) event.entityLiving, null, false);
}
ItemStack[] prevArmor = event.entityLiving.previousEquipment;
@ -587,11 +588,14 @@ public class ModEventHandler {
@SubscribeEvent
public void worldTick(WorldTickEvent event) {
if(event.world != null && !event.world.isRemote) {
World world = event.world;
long time = world.getTotalWorldTime();
if(world != null && !world.isRemote) {
if(reference != null) {
for(Object player : event.world.playerEntities) {
if(((EntityPlayer) player).ridingEntity != null && event.world.getTotalWorldTime() % (1 * 60 * 20) == 0) {
for(Object player : world.playerEntities) {
if(((EntityPlayer) player).ridingEntity != null && time % (1 * 60 * 20) == 0) {
((EntityPlayer) player).mountEntity(null);
didSit = true;
}
@ -605,7 +609,7 @@ public class ModEventHandler {
int tickrate = Math.max(1, ServerConfig.ITEM_HAZARD_DROP_TICKRATE.get());
if(event.world.getTotalWorldTime() % tickrate == 0) {
if(time % tickrate == 0) {
List loadedEntityList = new ArrayList();
loadedEntityList.addAll(event.world.loadedEntityList); // ConcurrentModificationException my balls
@ -618,13 +622,17 @@ public class ModEventHandler {
}
}
EntityRailCarBase.updateMotion(event.world);
EntityRailCarBase.updateMotion(world);
}
if(time % 20 == 0) {
BlockPedestal.checkPedestalEntries(world.provider.dimensionId, time);
}
}
if(event.phase == Phase.START) {
BossSpawnHandler.rollTheDice(event.world);
TimedGenerator.automaton(event.world, 100);
BossSpawnHandler.rollTheDice(world);
TimedGenerator.automaton(world, 100);
}
}

View File

@ -176,7 +176,7 @@ public class HbmPotion extends Potion {
public static boolean getIsBadEffect(Potion potion) {
try {
Field isBadEffect = ReflectionHelper.findField(Potion.class, "isBadEffect", "field_76418_K");
Field isBadEffect = ReflectionHelper.findField(Potion.class, "isBadEffect", "field_76418_K"); //TODO: use an AT for this
boolean ret = isBadEffect.getBoolean(potion);
return ret;

View File

@ -15,11 +15,6 @@ public interface IControlReceiverFilter extends IControlReceiver, ICopiable {
void nextMode(int i);
/*
default ModulePatternMatcher getMatcher(){
}*/
@Override
default void receiveControl(NBTTagCompound data) {
if(data.hasKey("slot")) {
@ -44,7 +39,7 @@ public interface IControlReceiverFilter extends IControlReceiver, ICopiable {
}
/**
* Used for the copy tool
* @return The start and end (start inclusive, end exclusive) of the filter slots of the TE
* @return The start and end (start inclusive, end exclusive) of the filter slots of the TE // seven, what the fuck?
*/
int[] getFilterSlots();

View File

@ -243,18 +243,18 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase {
}
if(doorType.getOpenSoundLoop() != null) {
audio = MainRegistry.proxy.getLoopedSound(doorType.getOpenSoundLoop(), xCoord, yCoord, zCoord, doorType.getSoundVolume(), 10F, 1F);
audio = MainRegistry.proxy.getLoopedSound(doorType.getOpenSoundLoop(), xCoord, yCoord, zCoord, getVolume(), 10F, 1F);
audio.startSound();
}
if(doorType.getOpenSoundStart() != null) {
worldObj.playSound(xCoord, yCoord, zCoord, doorType.getOpenSoundStart(), doorType.getSoundVolume(), 1F, false);
worldObj.playSound(xCoord, yCoord, zCoord, doorType.getOpenSoundStart(), getVolume(), 1F, false);
}
if(doorType.getSoundLoop2() != null) {
if(audio2 != null) audio2.stopSound();
audio2 = MainRegistry.proxy.getLoopedSound(doorType.getSoundLoop2(), xCoord, yCoord, zCoord, doorType.getSoundVolume(), 10F, 1F);
audio2 = MainRegistry.proxy.getLoopedSound(doorType.getSoundLoop2(), xCoord, yCoord, zCoord, getVolume(), 10F, 1F);
audio2.startSound();
}
}
@ -265,18 +265,18 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase {
}
if(doorType.getCloseSoundLoop() != null) {
audio = MainRegistry.proxy.getLoopedSound(doorType.getCloseSoundLoop(), xCoord, yCoord, zCoord, doorType.getSoundVolume(), 10F, 1F);
audio = MainRegistry.proxy.getLoopedSound(doorType.getCloseSoundLoop(), xCoord, yCoord, zCoord, getVolume(), 10F, 1F);
audio.startSound();
}
if(doorType.getCloseSoundStart() != null) {
worldObj.playSound(xCoord, yCoord, zCoord, doorType.getCloseSoundStart(), doorType.getSoundVolume(), 1F, false);
worldObj.playSound(xCoord, yCoord, zCoord, doorType.getCloseSoundStart(), getVolume(), 1F, false);
}
if(doorType.getSoundLoop2() != null) {
if(audio2 != null) audio2.stopSound();
audio2 = MainRegistry.proxy.getLoopedSound(doorType.getSoundLoop2(), xCoord, yCoord, zCoord, doorType.getSoundVolume(), 10F, 1F);
audio2 = MainRegistry.proxy.getLoopedSound(doorType.getSoundLoop2(), xCoord, yCoord, zCoord, getVolume(), 10F, 1F);
audio2.startSound();
}
}
@ -294,13 +294,13 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase {
if(this.state == STATE_OPENING && state == STATE_OPEN) { // Door finished transitioning to open
if(doorType.getOpenSoundEnd() != null) {
worldObj.playSound(xCoord, yCoord, zCoord, doorType.getOpenSoundEnd(), doorType.getSoundVolume(), 1F, false);
worldObj.playSound(xCoord, yCoord, zCoord, doorType.getOpenSoundEnd(), getVolume(), 1F, false);
}
}
if(this.state == STATE_CLOSING && state == STATE_CLOSED) { // Door finished transitioning to closed
if(doorType.getCloseSoundEnd() != null) {
worldObj.playSound(xCoord, yCoord, zCoord, doorType.getCloseSoundEnd(), doorType.getSoundVolume(), 1F, false);
worldObj.playSound(xCoord, yCoord, zCoord, doorType.getCloseSoundEnd(), getVolume(), 1F, false);
}
}
@ -314,6 +314,10 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase {
}
}
public float getVolume() {
return getVolume(doorType.getSoundVolume());
}
public int getSkinIndex() {
return skinIndex;
}

View File

@ -12,6 +12,7 @@ import com.hbm.tileentity.TileEntityLoadedBase;
import com.hbm.tileentity.network.RTTYSystem;
import com.hbm.util.BufferUtil;
import api.hbm.redstoneoverradio.IRORInteractive;
import cpw.mods.fml.common.Optional;
import io.netty.buffer.ByteBuf;
import li.cil.oc.api.machine.Arguments;
@ -24,7 +25,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
public class TileEntityRBMKTerminal extends TileEntityLoadedBase implements IGUIProvider, IControlReceiver, SimpleComponent, CompatHandler.OCComponent {
public class TileEntityRBMKTerminal extends TileEntityLoadedBase implements IGUIProvider, IControlReceiver, SimpleComponent, CompatHandler.OCComponent, IRORInteractive {
public String[] history = new String[17];
public String channel = "";
@ -249,4 +250,46 @@ public class TileEntityRBMKTerminal extends TileEntityLoadedBase implements IGUI
markDirty();
return new Object[] {true};
}
@Override
public String[] getFunctionInfo() {
return new String[] {
PREFIX_FUNCTION + "clear",
PREFIX_FUNCTION + "write" + NAME_SEPARATOR + "text",
PREFIX_FUNCTION + "set<line#>" + NAME_SEPARATOR + "text",
PREFIX_FUNCTION + "submit" + NAME_SEPARATOR + "command",
};
}
@Override
public String runRORFunction(String name, String[] params) {
if((PREFIX_FUNCTION + "clear").equals(name)) {
for(int i = 0; i < history.length; i++) history[i] = "";
this.markChanged();
return null;
}
String allParams = String.join(" ", params);
if((PREFIX_FUNCTION + "write").equals(name)) {
this.push(allParams);
this.markChanged();
return null;
}
if(name.startsWith(PREFIX_FUNCTION + "set")) {
int line = IRORInteractive.parseInt(name.substring(3), 1, 17) - 1;
this.history[line] = allParams;
this.markChanged();
return null;
}
if((PREFIX_FUNCTION + "submit").equals(name)) {
this.eval(allParams);
return null;
}
return null;
}
}

View File

@ -4,6 +4,7 @@ package com.hbm.tileentity.network.pneumatic;
import com.hbm.interfaces.IControlReceiver;
import com.hbm.inventory.container.ContainerPneumoStorageExporter;
import com.hbm.inventory.gui.GUIPneumoStorageExporter;
import com.hbm.tileentity.IControlReceiverFilter;
import com.hbm.tileentity.network.RTTYSystem;
import com.hbm.util.BobMathUtil;
@ -18,7 +19,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
public class TileEntityPneumoStorageExporter extends TileEntityPneumaticMachineBase implements IRORInteractive, IControlReceiver {
public class TileEntityPneumoStorageExporter extends TileEntityPneumaticMachineBase implements IRORInteractive, IControlReceiver, IControlReceiverFilter {
/** If requests should be pulled repeatedly every tick */
public boolean continuousRequest = false;
@ -303,9 +304,20 @@ public class TileEntityPneumoStorageExporter extends TileEntityPneumaticMachineB
if(data.hasKey("ror")) {
this.rorConfiguredMode = !this.rorConfiguredMode;
}
if(data.hasKey("slot")) {
setFilterContents(data);
}
this.markChanged();
}
@Override
public int[] getFilterSlots() {
return new int[] {0, 9};
}
@Override
public void nextMode(int i) { }
@Override
public String[] getFunctionInfo() {
return new String[] {

View File

@ -3,6 +3,7 @@ package com.hbm.tileentity.network.pneumatic;
import com.hbm.interfaces.IControlReceiver;
import com.hbm.inventory.container.ContainerPneumoStorageMono;
import com.hbm.inventory.gui.GUIPneumoStorageMono;
import com.hbm.tileentity.IControlReceiverFilter;
import com.hbm.tileentity.IGUIProvider;
import api.hbm.fluidmk2.IFluidStandardReceiverMK2;
@ -15,7 +16,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
public class TileEntityPneumoStorageMono extends TileEntityPneumaticStorageBase implements IPneumaticConnector, IFluidStandardReceiverMK2, ISlotMonitorProvider, IControlReceiver, IGUIProvider {
public class TileEntityPneumoStorageMono extends TileEntityPneumaticStorageBase implements IPneumaticConnector, IFluidStandardReceiverMK2, ISlotMonitorProvider, IControlReceiver, IGUIProvider, IControlReceiverFilter {
public static final int CAPACITY = 100_000;
public int[] amounts;
@ -86,4 +87,12 @@ public class TileEntityPneumoStorageMono extends TileEntityPneumaticStorageBase
}
@Override public long setupType(int index, ItemStack zeroStack, long amount) { return amount; }
@Override
public void nextMode(int i) { }
@Override
public int[] getFilterSlots() {
return new int[] {0, 3};
}
}

View File

@ -116,7 +116,5 @@ public class MapGenChainloader extends MapGenBase {
blockMetas = event.metaArray;
}
}
}
}

View File

@ -35,43 +35,45 @@ public class NTMWorldGenerator implements IWorldGenerator {
boolean regTest = false;
public static boolean isInvalidBiome(BiomeGenBase biome) {
return BiomeDictionary.isBiomeOfType(biome, Type.OCEAN) || BiomeDictionary.isBiomeOfType(biome, Type.RIVER);
/** Includes all biomes tagged as ocean or river */
public static boolean isWaterBiome(BiomeGenBase biome) {
return BiomeDictionary.isBiomeOfType(biome, Type.WATER);
}
/** Includes biomes with little height variation and sparse vegetation, excludes water biomes */
public static boolean isFlatBiome(BiomeGenBase biome) {
return biome.heightVariation <= 0.2F && !isInvalidBiome(biome) && BiomeDictionary.isBiomeOfType(biome, Type.SPARSE);
return biome.heightVariation <= 0.2F && !isWaterBiome(biome) && BiomeDictionary.isBiomeOfType(biome, Type.SPARSE);
}
public NTMWorldGenerator() {
/// SPIRE ///
NBTStructure.registerStructure(0, new SpawnCondition("spire") {{
canSpawn = biome -> biome.heightVariation <= 0.05F && !isInvalidBiome(biome);
canSpawn = biome -> biome.heightVariation <= 0.05F && !isWaterBiome(biome);
structure = new JigsawPiece("spire", StructureManager.spire, -1);
spawnWeight = StructureConfig.spireSpawnWeight;
}});
NBTStructure.registerStructure(0, new SpawnCondition("features") {{
canSpawn = biome -> !isInvalidBiome(biome);
canSpawn = biome -> !isWaterBiome(biome);
start = d -> new MapGenNTMFeatures.Start(d.getW(), d.getX(), d.getY(), d.getZ());
spawnWeight = StructureConfig.featuresSpawnWeight;
}});
NBTStructure.registerStructure(0, new SpawnCondition("bunker") {{
canSpawn = biome -> !isInvalidBiome(biome);
canSpawn = biome -> !isWaterBiome(biome);
start = d -> new BunkerStart(d.getW(), d.getX(), d.getY(), d.getZ());
spawnWeight = StructureConfig.bunkerSpawnWeight;
}});
NBTStructure.registerStructure(0, new SpawnCondition("vertibird") {{
canSpawn = biome -> !isInvalidBiome(biome) && BiomeDictionary.isBiomeOfType(biome, Type.SANDY);
canSpawn = biome -> !isWaterBiome(biome) && BiomeDictionary.isBiomeOfType(biome, Type.SANDY);
structure = new JigsawPiece("vertibird", StructureManager.vertibird, -3);
spawnWeight = StructureConfig.vertibirdSpawnWeight;
}});
NBTStructure.registerStructure(0, new SpawnCondition("crashed_vertibird") {{
canSpawn = biome -> !isInvalidBiome(biome) && BiomeDictionary.isBiomeOfType(biome, Type.SANDY);
canSpawn = biome -> !isWaterBiome(biome) && BiomeDictionary.isBiomeOfType(biome, Type.SANDY);
structure = new JigsawPiece("crashed_vertibird", StructureManager.crashed_vertibird, -10);
spawnWeight = StructureConfig.vertibirdCrashedSpawnWeight;
}});
@ -116,7 +118,7 @@ public class NTMWorldGenerator implements IWorldGenerator {
}});
NBTStructure.registerStructure(0, new SpawnCondition("forestchem") {{
canSpawn = biome -> biome.heightVariation <= 0.3F && !isInvalidBiome(biome);
canSpawn = biome -> biome.heightVariation <= 0.3F && !isWaterBiome(biome);
structure = new JigsawPiece("forest_chem", StructureManager.forest_chem, -9);
spawnWeight = StructureConfig.forestChemSpawnWeight;
}});
@ -130,7 +132,7 @@ public class NTMWorldGenerator implements IWorldGenerator {
}});
NBTStructure.registerStructure(0, new SpawnCondition("forest_post") {{
canSpawn = biome -> biome.heightVariation <= 0.3F && !isInvalidBiome(biome);
canSpawn = biome -> biome.heightVariation <= 0.3F && !isWaterBiome(biome);
structure = new JigsawPiece("forest_post", StructureManager.forest_post, -10);
spawnWeight = StructureConfig.forestPostSpawnWeight;
}});
@ -160,13 +162,13 @@ public class NTMWorldGenerator implements IWorldGenerator {
}});
NBTStructure.registerStructure(0, new SpawnCondition("plane1") {{
canSpawn = biome -> biome.heightVariation <= 0.3F && !isInvalidBiome(biome);
canSpawn = biome -> biome.heightVariation <= 0.3F && !isWaterBiome(biome);
structure = new JigsawPiece("crashed_plane_1", StructureManager.plane1, -5);
spawnWeight = StructureConfig.plane1SpawnWeight;
}});
NBTStructure.registerStructure(0, new SpawnCondition("plane2") {{
canSpawn = biome -> biome.heightVariation <= 0.3F && !isInvalidBiome(biome);
canSpawn = biome -> biome.heightVariation <= 0.3F && !isWaterBiome(biome);
structure = new JigsawPiece("crashed_plane_2", StructureManager.plane2, -8);
spawnWeight = StructureConfig.plane2SpawnWeight;
}});
@ -190,52 +192,52 @@ public class NTMWorldGenerator implements IWorldGenerator {
}});
NBTStructure.registerStructure(0, new SpawnCondition("ruinA") {{
canSpawn = biome -> !isInvalidBiome(biome) && biome.canSpawnLightningBolt();
canSpawn = biome -> !isWaterBiome(biome) && biome.canSpawnLightningBolt();
structure = new JigsawPiece("NTMRuinsA", StructureManager.ntmruinsA, -1) {{conformToTerrain = true;}};
spawnWeight = StructureConfig.enableRuins ? StructureConfig.ruinsASpawnWeight : 0;
}});
NBTStructure.registerStructure(0, new SpawnCondition("ruinB") {{
canSpawn = biome -> !isInvalidBiome(biome) && biome.canSpawnLightningBolt();
canSpawn = biome -> !isWaterBiome(biome) && biome.canSpawnLightningBolt();
structure = new JigsawPiece("NTMRuinsB", StructureManager.ntmruinsB, -1) {{conformToTerrain = true;}};
spawnWeight = StructureConfig.enableRuins ? StructureConfig.ruinsBSpawnWeight : 0;
}});
NBTStructure.registerStructure(0, new SpawnCondition("ruinC") {{
canSpawn = biome -> !isInvalidBiome(biome) && biome.canSpawnLightningBolt();
canSpawn = biome -> !isWaterBiome(biome) && biome.canSpawnLightningBolt();
structure = new JigsawPiece("NTMRuinsC", StructureManager.ntmruinsC, -1) {{conformToTerrain = true;}};
spawnWeight = StructureConfig.enableRuins ? StructureConfig.ruinsCSpawnWeight : 0;
}});
NBTStructure.registerStructure(0, new SpawnCondition("ruinD") {{
canSpawn = biome -> !isInvalidBiome(biome) && biome.canSpawnLightningBolt();
canSpawn = biome -> !isWaterBiome(biome) && biome.canSpawnLightningBolt();
structure = new JigsawPiece("NTMRuinsD", StructureManager.ntmruinsD, -1) {{conformToTerrain = true;}};
spawnWeight = StructureConfig.enableRuins ? StructureConfig.ruinsDSpawnWeight : 0;
}});
NBTStructure.registerStructure(0, new SpawnCondition("ruinE") {{
canSpawn = biome -> !isInvalidBiome(biome) && biome.canSpawnLightningBolt();
canSpawn = biome -> !isWaterBiome(biome) && biome.canSpawnLightningBolt();
structure = new JigsawPiece("NTMRuinsE", StructureManager.ntmruinsE, -1) {{conformToTerrain = true;}};
spawnWeight = StructureConfig.enableRuins ? StructureConfig.ruinsESpawnWeight : 0;
}});
NBTStructure.registerStructure(0, new SpawnCondition("ruinF") {{
canSpawn = biome -> !isInvalidBiome(biome) && biome.canSpawnLightningBolt();
canSpawn = biome -> !isWaterBiome(biome) && biome.canSpawnLightningBolt();
structure = new JigsawPiece("NTMRuinsF", StructureManager.ntmruinsF, -1) {{conformToTerrain = true;}};
spawnWeight = StructureConfig.enableRuins ? StructureConfig.ruinsFSpawnWeight : 0;
}});
NBTStructure.registerStructure(0, new SpawnCondition("ruinG") {{
canSpawn = biome -> !isInvalidBiome(biome) && biome.canSpawnLightningBolt();
canSpawn = biome -> !isWaterBiome(biome) && biome.canSpawnLightningBolt();
structure = new JigsawPiece("NTMRuinsG", StructureManager.ntmruinsG, -1) {{conformToTerrain = true;}};
spawnWeight = StructureConfig.enableRuins ? StructureConfig.ruinsGSpawnWeight : 0;
}});
NBTStructure.registerStructure(0, new SpawnCondition("ruinH") {{
canSpawn = biome -> !isInvalidBiome(biome) && biome.canSpawnLightningBolt();
canSpawn = biome -> !isWaterBiome(biome) && biome.canSpawnLightningBolt();
structure = new JigsawPiece("NTMRuinsH", StructureManager.ntmruinsH, -1) {{conformToTerrain = true;}};
spawnWeight = StructureConfig.enableRuins ? StructureConfig.ruinsHSpawnWeight : 0;
}});
NBTStructure.registerStructure(0, new SpawnCondition("ruinI") {{
canSpawn = biome -> !isInvalidBiome(biome) && biome.canSpawnLightningBolt();
canSpawn = biome -> !isWaterBiome(biome) && biome.canSpawnLightningBolt();
structure = new JigsawPiece("NTMRuinsI", StructureManager.ntmruinsI, -1) {{conformToTerrain = true;}};
spawnWeight = StructureConfig.enableRuins ? StructureConfig.ruinsISpawnWeight : 0;
}});
NBTStructure.registerStructure(0, new SpawnCondition("ruinJ") {{
canSpawn = biome -> !isInvalidBiome(biome) && biome.canSpawnLightningBolt();
canSpawn = biome -> !isWaterBiome(biome) && biome.canSpawnLightningBolt();
structure = new JigsawPiece("NTMRuinsJ", StructureManager.ntmruinsJ, -1) {{conformToTerrain = true;}};
spawnWeight = StructureConfig.enableRuins ? StructureConfig.ruinsJSpawnWeight : 0;
}});

View File

@ -3,10 +3,12 @@ package com.hbm.world.generator;
import java.util.ArrayList;
import java.util.HashMap;
import com.hbm.interfaces.NotableComments;
import com.hbm.interfaces.Spaghetti;
import net.minecraft.world.World;
@NotableComments
@Deprecated
@Spaghetti("this class should be destroyed")
public class TimedGenerator {
@ -46,7 +48,7 @@ public class TimedGenerator {
list.add(job);
}
//should i be doing this? probably not, but watch me go
//should i be doing this? probably not, but watch me go // no for the love of fucking god don't do this
public interface ITimedJob {
public void work();