1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-12-13 19:50:31 +00:00

Initial update to 1.16.2

Seems to load fine, but not done any proper testing.
This commit is contained in:
SquidDev 2020-08-14 22:00:03 +01:00
parent 29646a7f61
commit 99581e1f40
8 changed files with 18 additions and 21 deletions

View File

@ -2,6 +2,6 @@
mod_version=1.90.3
# Minecraft properties (update mods.toml when changing)
mc_version=1.16.1
forge_version=32.0.75
mc_version=1.16.2
forge_version=33.0.3
mappings_version=20200723-1.16.1

View File

@ -25,6 +25,7 @@ import net.minecraft.util.Direction;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.World;
import net.minecraft.world.server.ServerWorld;
@ -138,6 +139,7 @@ public abstract class BlockComputerBase<T extends TileComputerBase> extends Bloc
public void onBlockHarvested( @Nonnull World world, @Nonnull BlockPos pos, @Nonnull BlockState state, @Nonnull PlayerEntity player )
{
if( !(world instanceof ServerWorld) ) return;
ServerWorld serverWorld = (ServerWorld) world;
// We drop the item here instead of doing it in the harvest method, as we should
// drop computers for creative players too.
@ -146,19 +148,19 @@ public abstract class BlockComputerBase<T extends TileComputerBase> extends Bloc
if( tile instanceof TileComputerBase )
{
TileComputerBase computer = (TileComputerBase) tile;
LootContext.Builder context = new LootContext.Builder( (ServerWorld) world )
LootContext.Builder context = new LootContext.Builder( serverWorld )
.withRandom( world.rand )
.withParameter( LootParameters.POSITION, pos )
.withParameter( LootParameters.field_237457_g_, Vector3d.copyCentered( pos ) )
.withParameter( LootParameters.TOOL, player.getHeldItemMainhand() )
.withParameter( LootParameters.THIS_ENTITY, player )
.withNullableParameter( LootParameters.BLOCK_ENTITY, tile )
.withParameter( LootParameters.BLOCK_ENTITY, tile )
.withDynamicDrop( DROP, ( ctx, out ) -> out.accept( getItem( computer ) ) );
for( ItemStack item : state.getDrops( context ) )
{
spawnAsEntity( world, pos, item );
}
state.spawnAdditionalDrops( world, pos, player.getHeldItemMainhand() );
state.spawnAdditionalDrops( serverWorld, pos, player.getHeldItemMainhand() );
}
}

View File

@ -207,9 +207,7 @@ public class BlockCable extends BlockGeneric implements IWaterLoggable
Direction facing = state.get( MODEM ).getFacing();
if( facing == null ) return true;
BlockPos offsetPos = pos.offset( facing );
BlockState offsetState = world.getBlockState( offsetPos );
return hasSolidSide( offsetState, world, offsetPos, facing.getOpposite() );
return hasEnoughSolidSide( world, pos.offset( facing ), facing.getOpposite() );
}
@Nullable

View File

@ -80,12 +80,10 @@ public class BlockWirelessModem extends BlockGeneric implements IWaterLoggable
@Override
@Deprecated
public boolean isValidPosition( BlockState state, IWorldReader world, BlockPos pos )
public boolean isValidPosition( BlockState state, @Nonnull IWorldReader world, BlockPos pos )
{
Direction facing = state.get( FACING );
BlockPos offsetPos = pos.offset( facing );
BlockState offsetState = world.getBlockState( offsetPos );
return hasSolidSide( offsetState, world, offsetPos, facing.getOpposite() );
return hasEnoughSolidSide( world, pos.offset( facing ), facing.getOpposite() );
}
@Nullable

View File

@ -65,11 +65,6 @@ public class FakeNetHandler extends ServerPlayNetHandler
{
}
@Override
public void handleRecipeBookUpdate( @Nonnull CRecipeInfoPacket packet )
{
}
@Override
public void handleSeenAdvancements( @Nonnull CSeenAdvancementsPacket packet )
{

View File

@ -2,3 +2,6 @@
public net.minecraft.client.renderer.FirstPersonRenderer func_178100_c(F)F # getMapAngleFromPitch
public net.minecraft.client.renderer.FirstPersonRenderer func_228401_a_(Lcom/mojang/blaze3d/matrix/MatrixStack;Lnet/minecraft/client/renderer/IRenderTypeBuffer;IFFLnet/minecraft/util/HandSide;)V # renderArmFirstPerson
public net.minecraft.client.renderer.FirstPersonRenderer func_228403_a_(Lcom/mojang/blaze3d/matrix/MatrixStack;Lnet/minecraft/client/renderer/IRenderTypeBuffer;ILnet/minecraft/util/HandSide;)V # renderArm
# ClientTableFormatter
public net.minecraft.client.gui.NewChatGui func_146234_a(Lnet/minecraft/util/text/ITextComponent;I)V # printChatMessageWithOptionalDeletion
public net.minecraft.client.gui.NewChatGui func_146242_c(I)V # deleteChatLine

View File

@ -1,5 +1,5 @@
modLoader="javafml"
loaderVersion="[32,33)"
loaderVersion="[33,34)"
issueTrackerURL="https://github.com/SquidDev-CC/CC-Tweaked/issues"
displayURL="https://github.com/SquidDev-CC/CC-Tweaked"
@ -7,6 +7,7 @@ logoFile="pack.png"
credits="Created by Daniel Ratcliffe (@DanTwoHundred)"
authors="Daniel Ratcliffe, Aaron Mills, SquidDev"
license="ComputerCraft Public License (https://raw.githubusercontent.com/dan200/ComputerCraft/master/LICENSE)"
[[mods]]
modId="computercraft"
@ -19,6 +20,6 @@ CC: Tweaked is a fork of ComputerCraft, adding programmable computers, turtles a
[[dependencies.computercraft]]
modId="forge"
mandatory=true
versionRange="[32.0.69,33)"
versionRange="[33.0.3,34)"
ordering="NONE"
side="BOTH"

View File

@ -1,6 +1,6 @@
{
"pack": {
"pack_format": 4,
"pack_format": 6,
"description": "CC: Tweaked"
}
}