From b1fff97bffa0ab0ae38e72ac8f2df8346a718958 Mon Sep 17 00:00:00 2001 From: SquidDev Date: Thu, 11 Apr 2019 09:27:14 +0100 Subject: [PATCH] Bump to 1.14pr1 --- build.gradle | 8 ++++---- gradle.properties | 2 +- .../computercraft/client/gui/widgets/WidgetTerminal.java | 9 +++++++-- .../computercraft/client/gui/widgets/WidgetWrapper.java | 4 ++-- .../shared/mixin/MixinItemFrameEntityRenderer.java | 2 +- .../shared/peripheral/modem/wired/ItemBlockCable.java | 2 +- .../shared/peripheral/speaker/SpeakerPeripheral.java | 2 +- .../computercraft/shared/turtle/core/TurtlePlayer.java | 6 +++--- .../java/dan200/computercraft/shared/util/WorldUtil.java | 4 ++-- 9 files changed, 22 insertions(+), 17 deletions(-) diff --git a/build.gradle b/build.gradle index 141258105..df0eeeaf3 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ } plugins { - id 'fabric-loom' version '0.2.0-SNAPSHOT' + id 'fabric-loom' version '0.2.1-SNAPSHOT' id 'com.matthewprenger.cursegradle' version '1.2.0' id "com.github.breadmoirai.github-release" version "2.2.4" } @@ -52,9 +52,9 @@ dependencies { minecraft "com.mojang:minecraft:${mc_version}" - mappings "net.fabricmc:yarn:${mc_version}.${mappings_version}" - modCompile "net.fabricmc:fabric-loader:0.3.7.109" - modCompile "net.fabricmc:fabric:0.2.6.117" + mappings "net.fabricmc:yarn:${mc_version}+build.${mappings_version}" + modCompile "net.fabricmc:fabric-loader:0.4.0+build.119" + modCompile "net.fabricmc:fabric:0.2.7+build.122" // compileOnly "mezz.jei:jei-1.13.2:5.0.0.8:api" // deobfProvided "pl.asie:Charset-Lib:0.5.4.6" diff --git a/gradle.properties b/gradle.properties index 95c4436be..fc2936f60 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,5 +2,5 @@ mod_version=1.82.1 # Minecraft properties -mc_version=19w14a +mc_version=1.14 Pre-Release 1 mappings_version=3 diff --git a/src/main/java/dan200/computercraft/client/gui/widgets/WidgetTerminal.java b/src/main/java/dan200/computercraft/client/gui/widgets/WidgetTerminal.java index c01610cee..f5c0f6482 100644 --- a/src/main/java/dan200/computercraft/client/gui/widgets/WidgetTerminal.java +++ b/src/main/java/dan200/computercraft/client/gui/widgets/WidgetTerminal.java @@ -39,6 +39,8 @@ public class WidgetTerminal implements Element private final int termWidth; private final int termHeight; + private boolean focused; + private float terminateTimer = -1; private float rebootTimer = -1; private float shutdownTimer = -1; @@ -293,9 +295,9 @@ public void update() } @Override - public void onFocusChanged( boolean noClue, boolean focused ) + public boolean changeFocus( boolean reverse ) { - if( !focused ) + if( focused ) { // When blurring, we should make all keys go up for( int key = 0; key < keysDown.size(); key++ ) @@ -314,6 +316,9 @@ public void onFocusChanged( boolean noClue, boolean focused ) shutdownTimer = terminateTimer = rebootTimer = -1; } + + focused = !focused; + return true; } public void draw( int originX, int originY ) diff --git a/src/main/java/dan200/computercraft/client/gui/widgets/WidgetWrapper.java b/src/main/java/dan200/computercraft/client/gui/widgets/WidgetWrapper.java index 828b03fe6..b1a209f85 100644 --- a/src/main/java/dan200/computercraft/client/gui/widgets/WidgetWrapper.java +++ b/src/main/java/dan200/computercraft/client/gui/widgets/WidgetWrapper.java @@ -33,9 +33,9 @@ public void mouseMoved( double x, double y ) } @Override - public void onFocusChanged( boolean a, boolean b ) + public boolean changeFocus( boolean reverse ) { - listener.onFocusChanged( a, b ); + return listener.changeFocus( reverse ); } @Override diff --git a/src/main/java/dan200/computercraft/shared/mixin/MixinItemFrameEntityRenderer.java b/src/main/java/dan200/computercraft/shared/mixin/MixinItemFrameEntityRenderer.java index 7e3a284a3..88fe3940f 100644 --- a/src/main/java/dan200/computercraft/shared/mixin/MixinItemFrameEntityRenderer.java +++ b/src/main/java/dan200/computercraft/shared/mixin/MixinItemFrameEntityRenderer.java @@ -19,7 +19,7 @@ @Mixin( ItemFrameEntityRenderer.class ) public class MixinItemFrameEntityRenderer { - @Inject( method = "method_3992", at = @At( "HEAD" ), cancellable = true ) + @Inject( method = "hasLabel", at = @At( "HEAD" ), cancellable = true ) // TODO: This name is entirely wrong private void method_3992_Injected( ItemFrameEntity entity, CallbackInfo info ) { ItemStack stack = entity.getHeldItemStack(); diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/wired/ItemBlockCable.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/wired/ItemBlockCable.java index 2b2ecddf5..9275068e7 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/wired/ItemBlockCable.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/wired/ItemBlockCable.java @@ -43,7 +43,7 @@ boolean placeAt( World world, BlockPos pos, BlockState state ) world.setBlockState( pos, state, 3 ); BlockSoundGroup soundType = state.getBlock().getSoundGroup( state ); - world.playSound( null, pos, soundType.getPlaceSound(), SoundCategory.BLOCK, (soundType.getVolume() + 1.0F) / 2.0F, soundType.getPitch() * 0.8F ); + world.playSound( null, pos, soundType.getPlaceSound(), SoundCategory.BLOCKS, (soundType.getVolume() + 1.0F) / 2.0F, soundType.getPitch() * 0.8F ); BlockEntity tile = world.getBlockEntity( pos ); if( tile instanceof TileCable ) diff --git a/src/main/java/dan200/computercraft/shared/peripheral/speaker/SpeakerPeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/speaker/SpeakerPeripheral.java index ba852eb93..38c6d16a6 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/speaker/SpeakerPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/speaker/SpeakerPeripheral.java @@ -146,7 +146,7 @@ private synchronized boolean playSound( ILuaContext context, Identifier name, fl float adjVolume = Math.min( volume, 3.0f ); server.getPlayerManager().sendToAround( null, pos.x, pos.y, pos.z, adjVolume > 1.0f ? 16 * adjVolume : 16.0, world.getDimension().getType(), - new PlaySoundIdS2CPacket( name, SoundCategory.RECORD, pos, adjVolume, pitch ) + new PlaySoundIdS2CPacket( name, SoundCategory.RECORDS, pos, adjVolume, pitch ) ); return null; } ); diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlayer.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlayer.java index e47131d58..1340d18e4 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlayer.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlayer.java @@ -17,6 +17,7 @@ import net.minecraft.container.Container; import net.minecraft.entity.Entity; import net.minecraft.entity.passive.HorseBaseEntity; +import net.minecraft.entity.player.PlayerEntity; import net.minecraft.inventory.Inventory; import net.minecraft.item.ItemStack; import net.minecraft.server.world.ServerWorld; @@ -139,12 +140,11 @@ public Entity changeDimension( DimensionType dimensionType ) return null; } - @Nonnull @Override - public Either trySleep( @Nonnull BlockPos bedLocation ) + public Either trySleep( @Nonnull BlockPos bedLocation ) { - return Either.left( SleepResult.INVALID_ATTEMPT ); + return Either.left( PlayerEntity.SleepFailureReason.INVALID_ATTEMPT ); } @Override diff --git a/src/main/java/dan200/computercraft/shared/util/WorldUtil.java b/src/main/java/dan200/computercraft/shared/util/WorldUtil.java index 39b7227ef..bbfeae5d9 100644 --- a/src/main/java/dan200/computercraft/shared/util/WorldUtil.java +++ b/src/main/java/dan200/computercraft/shared/util/WorldUtil.java @@ -29,7 +29,7 @@ public final class WorldUtil { @SuppressWarnings( "Guava" ) - private static final Predicate CAN_COLLIDE = x -> x != null && x.isAlive() && x.doesCollide(); + private static final Predicate CAN_COLLIDE = x -> x != null && x.isAlive() && x.collides(); public static boolean isLiquidBlock( World world, BlockPos pos ) { @@ -73,7 +73,7 @@ public static Pair rayTraceEntities( World world, Vec3d vecStart, Entity closest = null; double closestDist = 99.0; - List list = world.getEntitiesInBox( Entity.class, bigBox, CAN_COLLIDE ); + List list = world.getEntities( Entity.class, bigBox, CAN_COLLIDE ); for( Entity entity : list ) { BoundingBox littleBox = entity.getBoundingBox();