Merge branch '1.12.2' of https://github.com/Electroblob77/Wizardry into 1.12.2

This commit is contained in:
Electroblob77
2021-01-01 23:26:43 +00:00
2 changed files with 51 additions and 39 deletions
+3 -1
View File
@@ -49,9 +49,11 @@ Pull requests aren't just for code - if you would like to help translate Wizardr
- `#image tag` adds an image to the text with the given tag. Image tags are defined in the `"images": {...}` block at the start of the file. Each named entry in this block defines a single image with that name as its tag. Each entry is a JSON object containing a file location and optional caption/dimensions. - `#image tag` adds an image to the text with the given tag. Image tags are defined in the `"images": {...}` block at the start of the file. Each named entry in this block defines a single image with that name as its tag. Each entry is a JSON object containing a file location and optional caption/dimensions.
- `#recipe tag` adds a crafting recipe to the text with the given tag. Similar to image tags, recipe tags are defined in the `"recipes": {...}` block at the start of the file. Each named entry in this block defines a recipe with that name as its tag. Each entry contains a list of one or more locations or recipes to display (if more than one is specified, the display will cycle through the different recipes). - `#recipe tag` adds a crafting recipe to the text with the given tag. Similar to image tags, recipe tags are defined in the `"recipes": {...}` block at the start of the file. Each named entry in this block defines a recipe with that name as its tag. Each entry contains a list of one or more locations or recipes to display (if more than one is specified, the display will cycle through the different recipes).
- Anything else with a `#` directly before it (with no space) will be treated as a format argument if possible. This means everything between the `#` and the next space will be replaced with something else at runtime, similar to the `%X$s` bits in a normal .lang file. The current available format arguments can be found [here](https://github.com/Electroblob77/Wizardry/blob/1.12.2/src/main/java/electroblob/wizardry/client/gui/handbook/GuiWizardHandbook.java#L177-L203). - Anything else with a `#` directly before it (with no space) will be treated as a format argument if possible. This means the text after the `#` will be replaced with something else at runtime, similar to the `%X$s` bits in a normal .lang file, if it matches one of the available format arguments. The current format arguments can be found [here](https://github.com/Electroblob77/Wizardry/blob/1.12.2/src/main/java/electroblob/wizardry/client/gui/handbook/GuiWizardHandbook.java#L177-L203).
- `@section@` adds a hyperlink to the given section, which will display as the name of that section. `@section alt text@` is the same, except alt text is displayed instead of the section name (alt text may contain spaces). It is also possible to hyperlink to a webpage, simply replace the section name with the url (e.g. `@https://example.com/@` or `@https://example.com/ alt text@`). - `@section@` adds a hyperlink to the given section, which will display as the name of that section. `@section alt text@` is the same, except alt text is displayed instead of the section name (alt text may contain spaces). It is also possible to hyperlink to a webpage, simply replace the section name with the url (e.g. `@https://example.com/@` or `@https://example.com/ alt text@`).
> Translators for Chinese, Japanese, Korean and similar East Asian languages: Due to how Minecraft's word wrapping works, for best results you should _remove spaces before and after hyperlinks and formatting tags_, excluding images and recipes. However, do not remove the space between a hyperlink's destination and its alt text or the link will break!
If all of that confused you, the simple rule is: _Don't translate anything directly after an `@` symbol, directly after a `#`, or the first word after `#image` or `#recipe`_. However, you should translate the `"caption"` entries in the `images` block. If all of that confused you, the simple rule is: _Don't translate anything directly after an `@` symbol, directly after a `#`, or the first word after `#image` or `#recipe`_. However, you should translate the `"caption"` entries in the `images` block.
**Please ensure all translation files are encoded in UTF-8 format, otherwise they might crash the game!** **Please ensure all translation files are encoded in UTF-8 format, otherwise they might crash the game!**
@@ -64,35 +64,45 @@ public class LightningWeb extends SpellRay {
getProperty(SECONDARY_RANGE).floatValue(), target.posX, target.posY + target.height / 2, getProperty(SECONDARY_RANGE).floatValue(), target.posX, target.posY + target.height / 2,
target.posZ, world); target.posZ, world);
secondaryTargets.remove(target); secondaryTargets.stream()
secondaryTargets.removeIf(e -> !EntityUtils.isLiving(e)); .filter(entity -> !entity.equals(target))
secondaryTargets.removeIf(e -> !AllyDesignationSystem.isValidTarget(caster, e)); .filter(EntityUtils::isLiving)
if(secondaryTargets.size() > getProperty(SECONDARY_MAX_TARGETS).intValue()) .filter(e -> AllyDesignationSystem.isValidTarget(caster, e))
secondaryTargets = secondaryTargets.subList(0, getProperty(SECONDARY_MAX_TARGETS).intValue()); .limit(getProperty(SECONDARY_MAX_TARGETS).intValue())
.forEach(secondaryTarget -> {
for(EntityLivingBase secondaryTarget : secondaryTargets){ electrocute(world, caster,
target.getPositionVector().add(0, target.height / 2, 0),
electrocute(world, caster, target.getPositionVector().add(0, target.height/2, 0), secondaryTarget, secondaryTarget,
getProperty(SECONDARY_DAMAGE).floatValue() * modifiers.get(SpellModifiers.POTENCY), ticksInUse); getProperty(SECONDARY_DAMAGE).floatValue() * modifiers.get(SpellModifiers.POTENCY),
ticksInUse
);
// Tertiary chaining effect // Tertiary chaining effect
List<EntityLivingBase> tertiaryTargets = EntityUtils.getLivingWithinRadius( List<EntityLivingBase> tertiaryTargets =
getProperty(TERTIARY_RANGE).floatValue(), secondaryTarget.posX, EntityUtils.getLivingWithinRadius(
secondaryTarget.posY + secondaryTarget.height / 2, secondaryTarget.posZ, world); getProperty(TERTIARY_RANGE).floatValue(),
secondaryTarget.posX,
secondaryTarget.posY + secondaryTarget.height / 2,
secondaryTarget.posZ,
world
);
tertiaryTargets.remove(target); tertiaryTargets.stream()
tertiaryTargets.removeAll(secondaryTargets); .filter(entity -> !secondaryTargets.contains(entity))
tertiaryTargets.removeIf(e -> !EntityUtils.isLiving(e)); .filter(entity -> !entity.equals(target))
tertiaryTargets.removeIf(e -> !AllyDesignationSystem.isValidTarget(caster, e)); .filter(EntityUtils::isLiving)
if(tertiaryTargets.size() > getProperty(TERTIARY_MAX_TARGETS).intValue()) .filter(e -> AllyDesignationSystem.isValidTarget(caster, e))
tertiaryTargets = tertiaryTargets.subList(0, getProperty(TERTIARY_MAX_TARGETS).intValue()); .limit(getProperty(TERTIARY_MAX_TARGETS).intValue())
.forEach(tertiaryTarget ->
for(EntityLivingBase tertiaryTarget : tertiaryTargets){ electrocute(world, caster,
electrocute(world, caster, secondaryTarget.getPositionVector().add(0, secondaryTarget.height/2, 0), secondaryTarget.getPositionVector().add(0, secondaryTarget.height / 2, 0),
tertiaryTarget, getProperty(TERTIARY_DAMAGE).floatValue() * modifiers.get(SpellModifiers.POTENCY), ticksInUse); tertiaryTarget,
} getProperty(TERTIARY_DAMAGE).floatValue() * modifiers.get(SpellModifiers.POTENCY),
} ticksInUse
)
);
});
} }
return true; return true;