qmaw composing

This commit is contained in:
Boblet 2026-08-10 15:15:51 +02:00
parent f23fdda794
commit 31cfdcee59
18 changed files with 86 additions and 23 deletions

View File

@ -18,7 +18,11 @@
* Conveyor belts being destroyed due to item cramming can now be configured with the server config `CONVEYOR_CRAM_EXPLODE`, it is still on by default
* Conveyor items will no longer break any belts, even with the config enabled, if the conveyor item entities have existed for less than one cram check cycle
* This means that items that have piled up due to chunk loading should now safely self-destruct without breaking conveyor lines
* QMAW now has a composing feature, using double curly brackets and the internal name of another page, this page's contents can be imported
* This means that things like long "see also" lists can now be on a single shared page instead of being hand written for every article
* QMAW links for pages you're already on now have a special color
## Fixed
* Fixed pollution detector localization not working, showing only error messages instead of the pollution type names
* Fixed un-clamped gaussian random use on the wideband detector satellite, causing uncommon detections with inaccuracy exceeding the intended amount
* Fixed PSN bulk storage duping itself when broken

View File

@ -1,5 +1,7 @@
package com.hbm.blocks.network.pneumatic;
import java.util.Random;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.network.pneumatic.TileEntityPneumoStorageMono;
@ -9,6 +11,7 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
@ -35,6 +38,11 @@ public class PneumoStorageMono extends BlockContainer {
return false;
}
@Override
public Item getItemDropped(int i, Random rand, int j) {
return null;
}
@Override
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) {

View File

@ -27,6 +27,7 @@ public class ItemSatellite extends ItemEnumMulti implements ISatChip {
RELAY,
DETECTOR,
RAY_SCAN,
SCIENCE,
}
@Override

View File

@ -6,7 +6,6 @@ import com.hbm.handler.pollution.PollutionHandler.PollutionType;
import com.hbm.packet.PacketDispatcher;
import com.hbm.packet.toclient.PlayerInformPacket;
import com.hbm.util.ChatBuilder;
import com.hbm.util.i18n.I18nUtil;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayerMP;

View File

@ -51,6 +51,34 @@ public class GuiQMAW extends GuiScreen {
parseQMAW(qmaw);
}
/** Preprocessor before actual parsing begins, imports contents from other QMAWs using curly bracket notation */
protected String compose(String contents) {
LanguageManager lang = Minecraft.getMinecraft().getLanguageManager();
String langCode = lang.getCurrentLanguage().getLanguageCode();
int recursionBrake = 100;
while(contents.contains("{{") && recursionBrake > 0) {
int begin = contents.indexOf("{{");
int end = contents.indexOf("}}");
if(end < begin) break;
String composeTag = contents.substring(begin + 2, end);
QuickManualAndWiki qmaw = QMAWLoader.qmaw.get(composeTag);
String substitute = composeTag;
if(qmaw != null) {
if(qmaw.contents.containsKey(langCode)) substitute = qmaw.contents.get(langCode);
else if(qmaw.contents.containsKey(EN_US)) substitute = qmaw.contents.get(EN_US);
}
contents = contents.replace("{{" + composeTag + "}}", substitute);
recursionBrake--;
}
return contents;
}
protected void parseQMAW(QuickManualAndWiki qmaw) {
LanguageManager lang = Minecraft.getMinecraft().getLanguageManager();
@ -63,7 +91,8 @@ public class GuiQMAW extends GuiScreen {
String toParse = qmaw.contents.get(lang.getCurrentLanguage().getLanguageCode());
if(toParse == null) toParse = qmaw.contents.get(EN_US);
if(toParse == null) toParse = "Missing Localization!";
toParse = "" + toParse; // strings are reference types, no?
toParse = compose(toParse);
int maxLineLength = xSize - 29;
String prevToParse = "" + toParse;
@ -336,7 +365,7 @@ public class GuiQMAW extends GuiScreen {
int elementX = x + inset;
int elementY = y + (maxHeight - element.getHeight()) / 2;
boolean mouseOver = (elementX <= mouseX && elementX + element.getWidth() > mouseX && elementY < mouseY && elementY + element.getHeight() >= mouseY);
element.render(mouseOver, elementX, elementY, mouseX, mouseY);
element.render(mouseOver, elementX, elementY, mouseX, mouseY, this);
if(elementX <= lastClickX && elementX + element.getWidth() > lastClickX && elementY < lastClickY && elementY + element.getHeight() >= lastClickY)
element.onClick(this);
inset += element.getWidth();

View File

@ -4,6 +4,6 @@ public abstract class ManualElement {
public abstract int getWidth();
public abstract int getHeight();
public abstract void render(boolean isMouseOver, int x, int y, int mouseX, int mouseY);
public abstract void render(boolean isMouseOver, int x, int y, int mouseX, int mouseY, GuiQMAW parent);
public abstract void onClick(GuiQMAW gui);
}

View File

@ -25,6 +25,7 @@ public class QComponentLink extends ManualElement {
protected FontRenderer font;
protected int color = 0x0094FF;
protected int hoverColor = 0xFFD800;
protected int occupiedColor = 0xA0A0A0;
protected static RenderItem itemRender = new RenderItem();
@ -59,7 +60,7 @@ public class QComponentLink extends ManualElement {
}
@Override
public void render(boolean isMouseOver, int x, int y, int mouseX, int mouseY) {
public void render(boolean isMouseOver, int x, int y, int mouseX, int mouseY, GuiQMAW parent) {
if(this.icon != null) {
@ -81,10 +82,16 @@ public class QComponentLink extends ManualElement {
y += (16 - font.FONT_HEIGHT) / 2;
}
font.drawString(text, x, y, isMouseOver ? hoverColor : color);
int color = this.color;
if(isMouseOver) color = this.hoverColor;
if(parent.qmawID.equals(link)) color = this.occupiedColor;
font.drawString(text, x, y, color);
}
@Override public void onClick(GuiQMAW gui) {
if(gui.qmawID.equals(link)) return;
QuickManualAndWiki qmaw = QMAWLoader.qmaw.get(link);
if(qmaw != null) {
Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));

View File

@ -37,7 +37,7 @@ public class QComponentText extends ManualElement {
}
@Override
public void render(boolean isMouseOver, int x, int y, int mouseX, int mouseY) {
public void render(boolean isMouseOver, int x, int y, int mouseX, int mouseY, GuiQMAW parent) {
font.drawString(text, x, y, color);
}

View File

@ -0,0 +1,9 @@
package com.hbm.saveddata.satellites;
public class SatelliteScience extends SatelliteBase {
@Override
public String getType() {
return "SCIENCE_PROBE";
}
}

View File

@ -31,6 +31,7 @@ public class XSatelliteRegistry {
idToClass.put(9, SatellitePrecisionLaser.class);
idToClass.put(10, SatelliteDetector.class);
idToClass.put(11, SatelliteRayScan.class);
idToClass.put(12, SatelliteScience.class);
// item to sat type mapping
registerSatellite(SatelliteMapper.class, new ComparableStack(ModItems.satellite, 1, EnumSatType.SPY));
@ -45,6 +46,7 @@ public class XSatelliteRegistry {
registerSatellite(SatellitePrecisionLaser.class, new ComparableStack(ModItems.satellite, 1, EnumSatType.PRECISION_LASER));
registerSatellite(SatelliteDetector.class, new ComparableStack(ModItems.satellite, 1, EnumSatType.DETECTOR));
registerSatellite(SatelliteRayScan.class, new ComparableStack(ModItems.satellite, 1, EnumSatType.RAY_SCAN));
registerSatellite(SatelliteScience.class, new ComparableStack(ModItems.satellite, 1, EnumSatType.SCIENCE));
// and all the legacy crap
registerSatellite(SatelliteMapper.class, ModItems.sat_mapper);

View File

@ -5360,7 +5360,7 @@ tile.crane_grabber.desc=Takes items from passing conveyors and places them into
tile.crane_inserter.name=Conveyor Inserter
tile.crane_inserter.desc=Accepts items from conveyors and places them into containers$Right-click with screwdriver to set input side$Shift-click with screwdriver to set the output side$Click twice to set the opposite side
tile.crane_partitioner.name=Acidizer Input Partitioner
tile.crane_partitioner.desc=Receives and stores up to nine Ore Acidizer inputs$and releases them if they match the required input size.$Invalid items are also saved, and need to be extracted from the side.
tile.crane_partitioner.desc=Receives and stores up to 45 Ore Acidizer inputs$and releases them if they match the required input size.$Invalid items are also saved, and need to be extracted from the side.
tile.crane_router.name=Conveyor Sorter
tile.crane_router.desc=Sorts item based on defined criteria$Sides can be defined as blacklist, whitelist or wildcard$Wildcard sides are only chosen if no other filter matches
tile.crane_splitter.name=Conveyor Splitter

View File

@ -1,10 +0,0 @@
{
"name": "Fluid Identification",
"icon": ["hbm:item.fluid_icon", 1, 1],
"title": {
"en_US": "Concept: Fluid Handling"
},
"content": {
"en_US": ""
}
}

View File

@ -8,7 +8,7 @@
"ru_RU": "Дизельный генератор"
},
"content": {
"en_US": "A simple, early way of making power out of combustible fuels, like [[diesel|Diesel]] or [[gasoline|Gasoline]]. Can only hold 4,000mB of fuel, so explosive barrels cannot be emptied in them, as those carry 10,000mB. Can be stopped using a redstone signal.<br><br>See also:<br>[[Industrial Combustion Engine]]<br>[[Turbofan]]<br>[[Combined Cycle Gas Turbine]]",
"en_US": "A simple, early way of making power out of combustible fuels, like [[diesel|Diesel]] or [[gasoline|Gasoline]]. Can be stopped using a redstone signal.<br><br>See also:<br>[[Industrial Combustion Engine]]<br>[[Turbofan]]<br>[[Combined Cycle Gas Turbine]]",
"zh_CN": "一种简单且早期的燃烧[[柴油|Diesel]]、[[汽油|Gasoline]]等可燃流体的发电手段。只能储存4,000mB燃料所以并不能在其中放出装有 10,000mB流体的炸药桶中的燃料。收到红石信号时停止工作。<br><br>另见:<br>[[工业内燃机|Industrial Combustion Engine]]<br>[[涡扇发动机|Turbofan]]<br>[[联合循环燃气轮机|Combined Cycle Gas Turbine]]",
"ru_RU": "Простой ранний способ получения энергии из горючих видов топлива, таких как [[дизель|Diesel]] или [[газолин|Gasoline]]. Генератор вмещает только 4000 mB топлива, поэтому в него нельзя опорожнять взрывные бочки ввиду их содержимого в количестве 10 000 mB дизеля. Может быть остановлен с помощью сигнала красного камня.<br><br>Смотрите также:<br>[[Промышленный двигатель внутреннего сгорания|Industrial Combustion Engine]]<br>[[Турбовентилятор|Turbofan]]<br>[[Газовая турбина комбинированного цикла|Combined Cycle Gas Turbine]]"
}

View File

@ -7,7 +7,7 @@
"ru_RU": "Спутник"
},
"content": {
"en_US": "Satellites can be launched into earth orbit using a [[Soyuz]] rocket. Satellites communicate with items and blocks on earth using frequencies, so in order to actually use one, it's necessary to set a random frequency in the satellite ID manager, and then copying that ID to another item, for example a satellite chip.<br><br>Some satellites can perform minor tasks when linked with certain items, like the [[depth scanning satellite|Depth Scanning Satellite]] enabling the neutrino lens, or the [[xenium resonator satellite|Xenium Resonator Satellite]] connected to a satellite laser designator allowing for short range line of sight teleportation. Satellites however are the most powerful when paired with [[Redstone over Radio]] by linking them to a [[ground station|Satellite Ground Station]].<br><br>By using a [[RoR reader|Redstone-over-Radio Reader]], ground stations can receive the RX value, which is received from the connected satellite. Each satellite can only provide one RX value at a time, and the value persists until it changes. The contents of RX depend on what function the satellite has performed prior.<br><br>By using a ground station's TX command, commands can be relayed to the connected satellite. Most commands vary between satellite types, however all satellites have a ground target, i.e. the spot on the surface they are aiming at.<br><br>The common target commands are as follows:<br>* '§esettarget §ex §ez§r' (Example RoR: '§6tx!settarget §6200 §6300§r')<br>* '§egettarget§r' (Example RoR: '§6tx!gettarget§r'), writes the current target X and Z separated by semicolon to the ground station's RX<br>* '§egettargetx§r'<br>* '§egettargetz§r'<br><br>See also:<br>* [[Spy Satellite]]<br>* [[Depth Scanning Satellite]]<br>* [[Radar Satellite]]<br>* [[Asteroid Mining Ship]]<br>* [[Lunar Mining Ship]]<br>* [[Orbital Precision Laser]]<br>* [[Orbital Death Ray]]<br>* [[Xenium Resonator Satellite]]<br>* [[Relay Satellite]]<br>* [[Wideband Radio Emission Detector Satellite]]",
"ru_RU": "Спутники можно запускать на околоземную орбиту с помощью ракеты [[Союз|Soyuz]]. Спутники связываются с предметами и блоками на Земле с помощью частот, поэтому для использования спутника необходимо установить случайную частоту в менеджере ID спутников, а затем скопировать этот ID на другой предмет, например, на спутниковый чип.<br><br>Некоторые спутники могут выполнять небольшие задачи при связывании с определёнными предметами — например, [[спутник глубинного сканирования|Depth Scanning Satellite]]] активирует нейтринную линзу, а [[спутник с Зен-резонатором|Xenium Resonator Satellite]], подключённый к спутниковому лазерному целеуказателю, позволяет телепортироваться в пределах прямой видимости на небольшие расстояния. Однако спутники наиболее эффективны в связке с системой [[Редстоун-по-Радио|Redstone over Radio]], если подключить их к [[наземной станции|Satellite Ground Station]].<br><br>С помощью [[РпР считывателя|Redstone-over-Radio Reader]] наземные станции могут получать значение RX, поступающее с подключённого спутника. Каждый спутник может передавать только одно значение RX за раз, и оно сохраняется до тех пор, пока не изменится. Содержимое RX зависит от того, какую функцию спутник выполнил перед этим.<br><br>Используя команду TX на наземной станции, можно передавать команды подключённому спутнику. Большинство команд различаются в зависимости от типа спутника, однако у всех спутников есть наземная цель — то есть точка на поверхности, на которую они наведены.<br><br>Основные команды для управления целью:<br>* '§esettarget §ex §ez§r' (Пример RoR: '§6tx!settarget §6200 §6300§r')<br>* '§egettarget§r' (Пример РпР: '§6tx!gettarget§r') — записывает текущие X и Z цели через точку с запятой в RX наземной станции<br>* '§egettargetx§r'<br>* '§egettargetz§r'<br><br>См. также:<br>* [[Спутник-шпион|Spy Satellite]]<br>* [[Спутник глубинного сканирования|Depth Scanning Satellite]]<br>* [[Радиолокационный спутник|Radar Satellite]]<br>* [[Астероидный шахтёрский корабль|Asteroid Mining Ship]]<br>* [[Лунный шахтёрский корабль|Lunar Mining Ship]]<br>* [[Орбитальный прецизионный лазер|Orbital Precision Laser]]<br>* [[Орбитальный луч Смерти|Orbital Death Ray]]<br>* [[Cпутник с Зен-резонатором|Xenium Resonator Satellite]]<br>* [[Спутник-ретранслятор|Relay Satellite]]<br>* [[Спутник-детектор широкополосного радиоизлучения|Wideband Radio Emission Detector Satellite]]"
"en_US": "Satellites can be launched into earth orbit using a [[Soyuz]] rocket. Satellites communicate with items and blocks on earth using frequencies, so in order to actually use one, it's necessary to set a random frequency in the satellite ID manager, and then copying that ID to another item, for example a satellite chip.<br><br>Some satellites can perform minor tasks when linked with certain items, like the [[depth scanning satellite|Depth Scanning Satellite]] enabling the neutrino lens, or the [[xenium resonator satellite|Xenium Resonator Satellite]] connected to a satellite laser designator allowing for short range line of sight teleportation. Satellites however are the most powerful when paired with [[Redstone over Radio]] by linking them to a [[ground station|Satellite Ground Station]].<br><br>By using a [[RoR reader|Redstone-over-Radio Reader]], ground stations can receive the RX value, which is received from the connected satellite. Each satellite can only provide one RX value at a time, and the value persists until it changes. The contents of RX depend on what function the satellite has performed prior.<br><br>By using a ground station's TX command, commands can be relayed to the connected satellite. Most commands vary between satellite types, however all satellites have a ground target, i.e. the spot on the surface they are aiming at.<br><br>The common target commands are as follows:<br>* '§esettarget §ex §ez§r' (Example RoR: '§6tx!settarget §6200 §6300§r')<br>* '§egettarget§r' (Example RoR: '§6tx!gettarget§r'), writes the current target X and Z separated by semicolon to the ground station's RX<br>* '§egettargetx§r'<br>* '§egettargetz§r'<br><br>{{Template:Satellites}}",
"ru_RU": "Спутники можно запускать на околоземную орбиту с помощью ракеты [[Союз|Soyuz]]. Спутники связываются с предметами и блоками на Земле с помощью частот, поэтому для использования спутника необходимо установить случайную частоту в менеджере ID спутников, а затем скопировать этот ID на другой предмет, например, на спутниковый чип.<br><br>Некоторые спутники могут выполнять небольшие задачи при связывании с определёнными предметами — например, [[спутник глубинного сканирования|Depth Scanning Satellite]]] активирует нейтринную линзу, а [[спутник с Зен-резонатором|Xenium Resonator Satellite]], подключённый к спутниковому лазерному целеуказателю, позволяет телепортироваться в пределах прямой видимости на небольшие расстояния. Однако спутники наиболее эффективны в связке с системой [[Редстоун-по-Радио|Redstone over Radio]], если подключить их к [[наземной станции|Satellite Ground Station]].<br><br>С помощью [[РпР считывателя|Redstone-over-Radio Reader]] наземные станции могут получать значение RX, поступающее с подключённого спутника. Каждый спутник может передавать только одно значение RX за раз, и оно сохраняется до тех пор, пока не изменится. Содержимое RX зависит от того, какую функцию спутник выполнил перед этим.<br><br>Используя команду TX на наземной станции, можно передавать команды подключённому спутнику. Большинство команд различаются в зависимости от типа спутника, однако у всех спутников есть наземная цель — то есть точка на поверхности, на которую они наведены.<br><br>Основные команды для управления целью:<br>* '§esettarget §ex §ez§r' (Пример RoR: '§6tx!settarget §6200 §6300§r')<br>* '§egettarget§r' (Пример РпР: '§6tx!gettarget§r') — записывает текущие X и Z цели через точку с запятой в RX наземной станции<br>* '§egettargetx§r'<br>* '§egettargetz§r'<br><br>{{Template:Satellites}}"
}
}

View File

@ -9,4 +9,5 @@
"content": {
"en_US": "The depth scanning satellite is required for the neutrino lens to work. It does not yet have any special interactions with the ground station.<br><br>See also:<br>* [[Satellite]]<br>* [[Satellite Ground Station]]",
"ru_RU": "Спутник глубинного сканирования необходим для работы нейтринной линзы. На данный момент он не имеет никаких особых взаимодействий с наземной станцией.<br><br>См. также:<br>* [[Спутник|Satellite]]<br>* [[Спутниковая наземная станция|Satellite Ground Station]]"
}
}

View File

@ -7,7 +7,7 @@
"ru_RU": "Спутник-шпион"
},
"content": {
"en_US": "The spy satellite allows remote viewing of earth's surface. Due to RoR pixel displays not existing as of now, surface mapping functionality does not yet work. However, they can be used in detecting loaded chunks and spotting players in a small radius.<br><br>* '§etargetloaded§r' writes 'TRUE' or 'FALSE' to RX depending on if the chunk that the satellite is pointed at is loaded or not.<br>* '§egetsmog$r' writes the numeric value (rounded up) of the current target position's soot pollution to RX.<br>* '§espotplayers§r' detects surface players in a 250 block radius and writes all names separated by semicolon to RX.<br><br>See also:<br>* [[Satellite]]<br>* [[Satellite Ground Station]]",
"en_US": "The spy satellite allows remote viewing of earth's surface. Due to RoR pixel displays not existing as of now, surface mapping functionality does not yet work. However, they can be used in detecting loaded chunks and spotting players in a small radius.<br><br>* '§etargetloaded§r' writes 'TRUE' or 'FALSE' to RX depending on if the chunk that the satellite is pointed at is loaded or not.<br>* '§egetsmog§r' writes the numeric value (rounded up) of the current target position's soot pollution to RX.<br>* '§espotplayers§r' detects surface players in a 250 block radius and writes all names separated by semicolon to RX.<br><br>See also:<br>* [[Satellite]]<br>* [[Satellite Ground Station]]",
"ru_RU": "Спутник-шпион позволяет удаленно вести наблюдение за поверхностью Земли. Из-за отсутствия на данный момент пиксельных дисплеев РпР функция картографирования поверхности пока не работает. Однако их можно использовать для обнаружения прогруженных чанков и выслеживания игроков в небольшом радиусе.<br><br>* «§etargetloaded§r» записывает «TRUE» или «FALSE» в RX в зависимости от того, прогружен ли чанк, на который наведен спутник.<br>* «§egetsmog$r» записывает числовое значение (округленное в большую сторону) загрязнения сажей в текущей целевой позиции в RX.<br>* «§espotplayers§r» обнаруживает игроков на поверхности в радиусе 250 блоков и записывает все имена через точку с запятой в RX.<br><br>См. также:<br>* [[Спутник|Satellite]]<br>* [[Спутниковая наземная станция|Satellite Ground Station]]"
}
}

View File

@ -0,0 +1,13 @@
{
"name": "Template:Satellites",
"icon": ["hbm:item.nothing"],
"trigger": [],
"noindex": true,
"title": {
"en_US": "Template:Satellites"
},
"content": {
"en_US": "See also:<br>* [[Spy Satellite]]<br>* [[Depth Scanning Satellite]]<br>* [[Radar Satellite]]<br>* [[Asteroid Mining Ship]]<br>* [[Lunar Mining Ship]]<br>* [[Orbital Precision Laser]]<br>* [[Orbital Death Ray]]<br>* [[Xenium Resonator Satellite]]<br>* [[Relay Satellite]]<br>* [[Wideband Radio Emission Detector Satellite]]<br>* [[Narrowband Emission Scanning Satellite]]",
"ru_RU": "<br><br>См. также:<br>* [[Спутник-шпион|Spy Satellite]]<br>* [[Спутник глубинного сканирования|Depth Scanning Satellite]]<br>* [[Радиолокационный спутник|Radar Satellite]]<br>* [[Астероидный шахтёрский корабль|Asteroid Mining Ship]]<br>* [[Лунный шахтёрский корабль|Lunar Mining Ship]]<br>* [[Орбитальный прецизионный лазер|Orbital Precision Laser]]<br>* [[Орбитальный луч Смерти|Orbital Death Ray]]<br>* [[Cпутник с Зен-резонатором|Xenium Resonator Satellite]]<br>* [[Спутник-ретранслятор|Relay Satellite]]<br>* [[Спутник-детектор широкополосного радиоизлучения|Wideband Radio Emission Detector Satellite]]<br>* [[Narrowband Emission Scanning Satellite]]"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 429 B