1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-19 19:25:48 +00:00

Performance improvements for androids

This commit is contained in:
TheBusyBiscuit 2020-08-01 12:25:47 +02:00
parent 76362b2acb
commit c510a8708c
3 changed files with 19 additions and 7 deletions

View File

@ -2,6 +2,7 @@
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of contents**
- [Release Candidate 16 (TBD)](#release-candidate-16-tbd)
- [Release Candidate 15 (01 Aug 2020)](#release-candidate-15-01-aug-2020)
- [Release Candidate 14 (12 Jul 2020)](#release-candidate-14-12-jul-2020)
- [Release Candidate 13 (16 Jun 2020)](#release-candidate-13-16-jun-2020)
@ -20,6 +21,11 @@
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
## Release Candidate 16 (TBD)
#### Changes
* Performance improvement for Programmable Android rotations
## Release Candidate 15 (01 Aug 2020)
#### Additions
@ -46,6 +52,7 @@
* Optimized Cargo networks for Paper
* Optimized Multiblocks for Paper
* Optimized Enhanced Furnaces for Paper
* Optimized Programmable Androids for Paper
* General performance improvements for Talismans
* General performance improvements for GPS Emergency Transmitters
* General performance improvements for Infused Magnets

View File

@ -16,17 +16,17 @@ public enum AndroidFuelSource {
/**
* This {@link ProgrammableAndroid} runs on solid fuel, e.g. Wood or coal
*/
SOLID("", "&rThis Android runs on solid Fuel", "&re.g. Coal, Wood, etc..."),
SOLID("", "&fThis Android runs on solid Fuel", "&fe.g. Coal, Wood, etc..."),
/**
* This {@link ProgrammableAndroid} runs on liquid fuel, e.g. Fuel, Oil or Lava
*/
LIQUID("", "&rThis Android runs on liquid Fuel", "&re.g. Lava, Oil, Fuel, etc..."),
LIQUID("", "&fThis Android runs on liquid Fuel", "&fe.g. Lava, Oil, Fuel, etc..."),
/**
* This {@link ProgrammableAndroid} runs on nuclear fuel, e.g. Uranium
*/
NUCLEAR("", "&rThis Android runs on radioactive Fuel", "&re.g. Uranium, Neptunium or Boosted Uranium");
NUCLEAR("", "&fThis Android runs on radioactive Fuel", "&fe.g. Uranium, Neptunium or Boosted Uranium");
private final String[] lore;

View File

@ -500,7 +500,7 @@ public abstract class ProgrammableAndroid extends SlimefunItem implements Invent
ChestMenu menu = new ChestMenu(ChatColor.DARK_AQUA + SlimefunPlugin.getLocalization().getMessage(p, "android.scripts.editor"));
ChestMenuUtils.drawBackground(menu, 0, 1, 2, 3, 4, 5, 6, 7, 8);
menu.addItem(9, new CustomItem(SlimefunUtils.getCustomHead("16139fd1c5654e56e9e4e2c8be7eb2bd5b499d633616663feee99b74352ad64"), "&rDo nothing"), (pl, slot, item, action) -> {
menu.addItem(9, new CustomItem(SlimefunUtils.getCustomHead("16139fd1c5654e56e9e4e2c8be7eb2bd5b499d633616663feee99b74352ad64"), "&fDo nothing"), (pl, slot, item, action) -> {
String code = deleteInstruction(script, index);
setScript(b.getLocation(), code);
openScript(p, b, code);
@ -683,9 +683,14 @@ public abstract class ProgrammableAndroid extends SlimefunItem implements Invent
BlockFace rotation = POSSIBLE_ROTATIONS.get(index);
Rotatable rotatatable = (Rotatable) b.getBlockData();
rotatatable.setRotation(rotation.getOppositeFace());
b.setBlockData(rotatatable);
BlockData blockData = Material.PLAYER_HEAD.createBlockData(data -> {
if (data instanceof Rotatable) {
Rotatable rotatable = ((Rotatable) data);
rotatable.setRotation(rotation);
}
});
b.setBlockData(blockData);
BlockStorage.addBlockInfo(b, "rotation", rotation.name());
}