This commit is contained in:
Sebastian Hartte
2020-06-28 16:18:11 +02:00
parent f5412152a4
commit 3df93fc66d
52 changed files with 43 additions and 36 deletions
@@ -82,7 +82,7 @@ public enum ButtonToolTips {
@Deprecated @Deprecated
public String getLocal() { public String getLocal() {
return getTranslationKey().getFormattedText(); return getTranslationKey().getString();
} }
public Text getTranslationKey() { public Text getTranslationKey() {
@@ -18,7 +18,6 @@
package appeng.core.localization; package appeng.core.localization;
import net.minecraft.client.resources.I18n;
import net.minecraft.text.Text; import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText; import net.minecraft.text.TranslatableText;
@@ -44,7 +43,7 @@ public enum WailaText {
} }
public String getLocal() { public String getLocal() {
return I18n.format(this.getTranslationKey()); return textComponent().getString();
} }
public String getTranslationKey() { public String getTranslationKey() {
@@ -21,7 +21,7 @@ package appeng.decorative;
import appeng.block.AEBaseBlock; import appeng.block.AEBaseBlock;
public class AEDecorativeBlock extends AEBaseBlock { public class AEDecorativeBlock extends AEBaseBlock {
public AEDecorativeBlock(Properties props) { public AEDecorativeBlock(Settings props) {
super(props); super(props);
} }
} }
@@ -32,7 +32,7 @@ import appeng.core.AEConfig;
import appeng.core.AppEng; import appeng.core.AppEng;
public class ChargedQuartzOreBlock extends QuartzOreBlock { public class ChargedQuartzOreBlock extends QuartzOreBlock {
public ChargedQuartzOreBlock(Properties props) { public ChargedQuartzOreBlock(Settings props) {
super(props); super(props);
} }
@@ -27,7 +27,7 @@ import appeng.helpers.AEGlassMaterial;
public class QuartzGlassBlock extends AbstractGlassBlock { public class QuartzGlassBlock extends AbstractGlassBlock {
public QuartzGlassBlock(Properties props) { public QuartzGlassBlock(Settings props) {
super(props); super(props);
} }
@@ -32,7 +32,7 @@ import appeng.core.AppEng;
public class QuartzLampBlock extends QuartzGlassBlock { public class QuartzLampBlock extends QuartzGlassBlock {
public QuartzLampBlock(Properties props) { public QuartzLampBlock(Settings props) {
super(props); super(props);
} }
@@ -18,21 +18,29 @@
package appeng.decorative.solid; package appeng.decorative.solid;
import appeng.block.AEBaseBlock;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.enchantment.Enchantments;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import appeng.block.AEBaseBlock;
public class QuartzOreBlock extends AEBaseBlock { public class QuartzOreBlock extends AEBaseBlock {
public QuartzOreBlock(Properties props) { public QuartzOreBlock(Settings props) {
super(props); super(props);
} }
@Override @Override
public int getExpDrop(BlockState state, net.minecraft.world.WorldView reader, BlockPos pos, int fortune, public void onStacksDropped(BlockState state, World world, BlockPos pos, ItemStack stack) {
int silktouch) { super.onStacksDropped(state, world, pos, stack);
return silktouch == 0 ? MathHelper.nextInt(RANDOM, 2, 5) : 0; if (EnchantmentHelper.getLevel(Enchantments.SILK_TOUCH, stack) == 0) {
int i = MathHelper.nextInt(world.random, 2, 5);
if (i > 0) {
this.dropExperience(world, pos, i);
}
}
} }
} }
@@ -20,7 +20,7 @@ package appeng.decorative.solid;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.state.EnumProperty; import net.minecraft.state.property.EnumProperty;
import net.minecraft.state.StateManager; import net.minecraft.state.StateManager;
import net.minecraft.state.property.Properties; import net.minecraft.state.property.Properties;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
@@ -35,7 +35,7 @@ import appeng.helpers.MetaRotation;
public class QuartzPillarBlock extends AEDecorativeBlock implements IOrientableBlock { public class QuartzPillarBlock extends AEDecorativeBlock implements IOrientableBlock {
public static final EnumProperty<Direction.Axis> AXIS = Properties.AXIS; public static final EnumProperty<Direction.Axis> AXIS = Properties.AXIS;
public QuartzPillarBlock(Properties props) { public QuartzPillarBlock(Settings props) {
super(props); super(props);
// The upwards facing pillar is the default (i.e. for the item model) // The upwards facing pillar is the default (i.e. for the item model)
@@ -40,7 +40,7 @@ public class SkyStoneBlock extends AEBaseBlock {
private static final double BREAK_SPEAK_THRESHOLD = 7.0; private static final double BREAK_SPEAK_THRESHOLD = 7.0;
private final SkystoneType type; private final SkystoneType type;
public SkyStoneBlock(SkystoneType type, Properties props) { public SkyStoneBlock(SkystoneType type, Settings props) {
super(props); super(props);
this.type = type; this.type = type;
@@ -21,10 +21,10 @@ package appeng.block.networking;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.Material; import net.minecraft.block.Material;
import net.minecraft.state.EnumProperty; import net.minecraft.state.property.EnumProperty;
import net.minecraft.state.StateManager; import net.minecraft.state.StateManager;
import net.minecraft.util.StringIdentifiable;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.IStringSerializable;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.WorldAccess; import net.minecraft.world.WorldAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
@@ -34,11 +34,11 @@ import appeng.tile.networking.ControllerBlockEntity;
public class ControllerBlock extends AEBaseTileBlock<ControllerBlockEntity> { public class ControllerBlock extends AEBaseTileBlock<ControllerBlockEntity> {
public enum ControllerBlockState implements IStringSerializable { public enum ControllerBlockState implements StringIdentifiable {
offline, online, conflicted; offline, online, conflicted;
@Override @Override
public String getName() { public String asString() {
return this.name(); return this.name();
} }
@@ -50,11 +50,11 @@ public class ControllerBlock extends AEBaseTileBlock<ControllerBlockEntity> {
* enclosed by other controllers, and since they are always offline, they do not * enclosed by other controllers, and since they are always offline, they do not
* have the usual sub-states. * have the usual sub-states.
*/ */
public enum ControllerRenderType implements IStringSerializable { public enum ControllerRenderType implements StringIdentifiable {
block, column_x, column_y, column_z, inside_a, inside_b; block, column_x, column_y, column_z, inside_a, inside_b;
@Override @Override
public String getName() { public String asString() {
return this.name(); return this.name();
} }
@@ -21,13 +21,13 @@ package appeng.block.networking;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.state.EnumProperty; import net.minecraft.state.property.EnumProperty;
import net.minecraft.state.StateManager; import net.minecraft.state.StateManager;
import net.minecraft.util.ActionResult; import net.minecraft.util.ActionResult;
import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.IStringSerializable; import net.minecraft.util.StringIdentifiable;
import net.minecraft.util.math.Box; import net.minecraft.util.math.Box;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.block.ShapeContext; import net.minecraft.block.ShapeContext;
@@ -46,11 +46,11 @@ import appeng.util.Platform;
public class WirelessBlock extends AEBaseTileBlock<WirelessBlockEntity> { public class WirelessBlock extends AEBaseTileBlock<WirelessBlockEntity> {
enum State implements IStringSerializable { enum State implements StringIdentifiable {
OFF, ON, HAS_CHANNEL; OFF, ON, HAS_CHANNEL;
@Override @Override
public String getName() { public String asString() {
return this.name().toLowerCase(); return this.name().toLowerCase();
} }
} }
@@ -25,7 +25,7 @@ import net.minecraft.block.BlockState;
import net.minecraft.block.Material; import net.minecraft.block.Material;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.state.EnumProperty; import net.minecraft.state.property.EnumProperty;
import net.minecraft.state.StateManager; import net.minecraft.state.StateManager;
import net.minecraft.util.ActionResult; import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
@@ -18,12 +18,12 @@
package appeng.block.storage; package appeng.block.storage;
import net.minecraft.util.IStringSerializable; import net.minecraft.util.StringIdentifiable;
/** /**
* Describes the type of cell present in a slot. * Describes the type of cell present in a slot.
*/ */
public enum DriveSlotCellType implements IStringSerializable { public enum DriveSlotCellType implements StringIdentifiable {
EMPTY("empty"), EMPTY("empty"),
@@ -38,7 +38,7 @@ public enum DriveSlotCellType implements IStringSerializable {
} }
@Override @Override
public String getName() { public String asString() {
return this.name; return this.name;
} }
@@ -18,7 +18,7 @@
package appeng.block.storage; package appeng.block.storage;
import net.minecraft.util.IStringSerializable; import net.minecraft.util.StringIdentifiable;
import appeng.api.storage.cells.CellState; import appeng.api.storage.cells.CellState;
@@ -26,7 +26,7 @@ import appeng.api.storage.cells.CellState;
* Describes the different states a single slot of a BlockDrive can be in in * Describes the different states a single slot of a BlockDrive can be in in
* terms of rendering. * terms of rendering.
*/ */
public enum DriveSlotState implements IStringSerializable { public enum DriveSlotState implements StringIdentifiable {
// No cell in slot // No cell in slot
EMPTY("empty"), EMPTY("empty"),
@@ -50,7 +50,7 @@ public enum DriveSlotState implements IStringSerializable {
} }
@Override @Override
public String getName() { public String asString() {
return this.name; return this.name;
} }
@@ -24,14 +24,14 @@ import net.minecraft.client.renderer.Matrix4f;
import net.minecraft.client.renderer.Quaternion; import net.minecraft.client.renderer.Quaternion;
import net.minecraft.client.util.math.Vector3f; import net.minecraft.client.util.math.Vector3f;
import net.minecraft.client.renderer.Vector4f; import net.minecraft.client.renderer.Vector4f;
import net.minecraft.util.StringIdentifiable;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.IStringSerializable;
import net.minecraft.util.math.Vec3i; import net.minecraft.util.math.Vec3i;
/** /**
* TODO: Removed useless stuff. * TODO: Removed useless stuff.
*/ */
public enum FacingToRotation implements IStringSerializable { public enum FacingToRotation implements StringIdentifiable {
// DUNSWE // DUNSWE
// @formatter:off // @formatter:off
@@ -110,7 +110,7 @@ public enum FacingToRotation implements IStringSerializable {
} }
@Override @Override
public String getName() { public String asString() {
return name().toLowerCase(); return name().toLowerCase();
} }
} }