mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-13 01:16:46 -04:00
fix crash in settings window, network: fix item stack writing
This commit is contained in:
parent
54777771e2
commit
b9ed5c4f45
@ -29,7 +29,7 @@ data class BlockEntityType(
|
||||
val factory: BlockEntityFactory<out BlockEntity>,
|
||||
) : RegistryItem {
|
||||
|
||||
fun build(connection: PlayConnection): BlockEntity? {
|
||||
fun build(connection: PlayConnection): BlockEntity {
|
||||
return DefaultBlockEntityMetaDataFactory.buildBlockEntity(factory, connection)
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,6 @@ import de.bixilon.minosoft.Minosoft;
|
||||
import de.bixilon.minosoft.data.mappings.ResourceLocation;
|
||||
import de.bixilon.minosoft.data.mappings.versions.Version;
|
||||
import de.bixilon.minosoft.data.mappings.versions.Versions;
|
||||
import de.bixilon.minosoft.util.logging.LogMessageType;
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
@ -31,14 +30,12 @@ import javafx.stage.Stage;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Base64;
|
||||
|
||||
public class GUITools {
|
||||
public static final Image MINOSOFT_LOGO = new Image(GUITools.class.getResourceAsStream("/assets/minosoft/textures/icons/window_icon.png"));
|
||||
public static final ObservableList<Version> VERSIONS = FXCollections.observableArrayList();
|
||||
public static final JFXComboBox<Version> VERSION_COMBO_BOX = new JFXComboBox<>(VERSIONS);
|
||||
public static final ObservableList<LogMessageType> LOG_LEVELS = FXCollections.observableList(Arrays.asList(LogMessageType.values().clone()));
|
||||
|
||||
static {
|
||||
VERSIONS.add(Versions.AUTOMATIC_VERSION);
|
||||
|
@ -13,12 +13,9 @@
|
||||
|
||||
package de.bixilon.minosoft.gui.main;
|
||||
|
||||
import com.jfoenix.controls.JFXComboBox;
|
||||
import de.bixilon.minosoft.data.locale.LocaleManager;
|
||||
import de.bixilon.minosoft.data.locale.Strings;
|
||||
import de.bixilon.minosoft.util.logging.LogMessageType;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.Tab;
|
||||
import javafx.scene.layout.GridPane;
|
||||
|
||||
@ -27,17 +24,13 @@ import java.util.ResourceBundle;
|
||||
|
||||
public class SettingsWindow implements Initializable {
|
||||
public GridPane tabGeneral;
|
||||
public JFXComboBox<LogMessageType> generalLogLevel;
|
||||
public Tab general;
|
||||
public Tab download;
|
||||
public Label generalLogLevelLabel;
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle resourceBundle) {
|
||||
this.generalLogLevel.setItems(GUITools.LOG_LEVELS);
|
||||
|
||||
this.general.setText(LocaleManager.translate(Strings.SETTINGS_GENERAL));
|
||||
this.generalLogLevelLabel.setText(LocaleManager.translate(Strings.SETTINGS_GENERAL_LOG_LEVEL));
|
||||
this.download.setText(LocaleManager.translate(Strings.SETTINGS_DOWNLOAD));
|
||||
}
|
||||
}
|
||||
|
@ -53,8 +53,8 @@ class PlayOutByteBuffer(override val connection: PlayConnection) : OutByteBuffer
|
||||
writeNBT(itemStack.nbtOut)
|
||||
return
|
||||
}
|
||||
writeBoolean(itemStack != null)
|
||||
if (itemStack == null) {
|
||||
writeBoolean(false)
|
||||
return
|
||||
}
|
||||
writeVarInt(connection.mapping.itemRegistry.getId(itemStack.item))
|
||||
|
Loading…
x
Reference in New Issue
Block a user