Some post-merge cleanup

This commit is contained in:
SquidDev 2020-04-22 11:04:29 +01:00
parent d7729337ac
commit 759d02a249
7 changed files with 31 additions and 44 deletions

View File

@ -47,7 +47,7 @@
} }
server { server {
workingDirectory project.file('run') workingDirectory project.file("run/server-${mc_version}")
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug' property 'forge.logging.console.level', 'debug'
@ -99,8 +99,8 @@ accessTransformer file('src/main/resources/META-INF/accesstransformer.cfg')
minecraft "net.minecraftforge:forge:${mc_version}-${forge_version}" minecraft "net.minecraftforge:forge:${mc_version}-${forge_version}"
compileOnly fg.deobf("mezz.jei:jei-1.15.2:6.0.0.2:api") compileOnly fg.deobf("mezz.jei:jei-1.15.2:6.0.0.3:api")
runtimeOnly fg.deobf("mezz.jei:jei-1.15.2:6.0.0.2") runtimeOnly fg.deobf("mezz.jei:jei-1.15.2:6.0.0.3")
shade 'org.squiddev:Cobalt:0.5.1-SNAPSHOT' shade 'org.squiddev:Cobalt:0.5.1-SNAPSHOT'

View File

@ -6,14 +6,15 @@
package dan200.computercraft.client.render; package dan200.computercraft.client.render;
import dan200.computercraft.ComputerCraft; import com.mojang.blaze3d.matrix.MatrixStack;
import dan200.computercraft.client.gui.GuiComputer;
import dan200.computercraft.shared.turtle.core.TurtlePlayer; import dan200.computercraft.shared.turtle.core.TurtlePlayer;
import net.minecraft.client.renderer.IRenderTypeBuffer;
import net.minecraft.client.renderer.entity.EntityRenderer; import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.client.renderer.entity.EntityRendererManager; import net.minecraft.client.renderer.entity.EntityRendererManager;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class TurtlePlayerRenderer extends EntityRenderer<TurtlePlayer> public class TurtlePlayerRenderer extends EntityRenderer<TurtlePlayer>
{ {
@ -22,16 +23,15 @@ public TurtlePlayerRenderer( EntityRendererManager renderManager )
super( renderManager ); super( renderManager );
} }
@Nonnull
@Override @Override
public void doRender( @Nonnull TurtlePlayer entity, double x, double y, double z, float entityYaw, float partialTicks ) public ResourceLocation getEntityTexture( @Nonnull TurtlePlayer entity )
{ {
ComputerCraft.log.error( "Rendering TurtlePlayer on the client side, at {}", entity.getPosition() ); return GuiComputer.BACKGROUND_NORMAL;
} }
@Nullable
@Override @Override
protected ResourceLocation getEntityTexture( @Nonnull TurtlePlayer entity ) public void render( @Nonnull TurtlePlayer entityIn, float entityYaw, float partialTicks, @Nonnull MatrixStack transform, @Nonnull IRenderTypeBuffer buffer, int packedLightIn )
{ {
return null;
} }
} }

View File

@ -103,7 +103,7 @@ public void update()
double t = alarm.m_day * 24.0 + alarm.m_time; double t = alarm.m_day * 24.0 + alarm.m_time;
if( now >= t ) if( now >= t )
{ {
queueLuaEvent( "alarm", new Object[] { entry.getKey() } ); queueLuaEvent( "alarm", new Object[] { entry.getIntKey() } );
it.remove(); it.remove();
} }
} }

View File

@ -20,11 +20,11 @@
class MountWrapper class MountWrapper
{ {
private String label; private final String label;
private String location; private final String location;
private IMount mount; private final IMount mount;
private IWritableMount writableMount; private final IWritableMount writableMount;
MountWrapper( String label, String location, IMount mount ) MountWrapper( String label, String location, IMount mount )
{ {
@ -36,7 +36,9 @@ class MountWrapper
MountWrapper( String label, String location, IWritableMount mount ) MountWrapper( String label, String location, IWritableMount mount )
{ {
this( label, location, (IMount) mount ); this.label = label;
this.location = location;
this.mount = mount;
writableMount = mount; writableMount = mount;
} }
@ -154,7 +156,7 @@ public ReadableByteChannel openForRead( String path ) throws FileSystemException
{ {
if( mount.exists( path ) && !mount.isDirectory( path ) ) if( mount.exists( path ) && !mount.isDirectory( path ) )
{ {
return mount.openChannelForRead( path ); return mount.openForRead( path );
} }
else else
{ {
@ -232,7 +234,7 @@ public WritableByteChannel openForWrite( String path ) throws FileSystemExceptio
writableMount.makeDirectory( dir ); writableMount.makeDirectory( dir );
} }
} }
return writableMount.openChannelForWrite( path ); return writableMount.openForWrite( path );
} }
} }
catch( AccessDeniedException e ) catch( AccessDeniedException e )
@ -262,7 +264,7 @@ public WritableByteChannel openForAppend( String path ) throws FileSystemExcepti
writableMount.makeDirectory( dir ); writableMount.makeDirectory( dir );
} }
} }
return writableMount.openChannelForWrite( path ); return writableMount.openForWrite( path );
} }
else if( mount.isDirectory( path ) ) else if( mount.isDirectory( path ) )
{ {
@ -270,7 +272,7 @@ else if( mount.isDirectory( path ) )
} }
else else
{ {
return writableMount.openChannelForAppend( path ); return writableMount.openForAppend( path );
} }
} }
catch( AccessDeniedException e ) catch( AccessDeniedException e )

View File

@ -14,9 +14,10 @@
import net.minecraft.data.DirectoryCache; import net.minecraft.data.DirectoryCache;
import net.minecraft.data.IDataProvider; import net.minecraft.data.IDataProvider;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.world.storage.loot.LootParameterSets;
import net.minecraft.world.storage.loot.LootTable; import net.minecraft.world.storage.loot.LootTable;
import net.minecraft.world.storage.loot.LootTableManager; import net.minecraft.world.storage.loot.LootTableManager;
import net.minecraft.world.storage.loot.ValidationResults; import net.minecraft.world.storage.loot.ValidationTracker;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import java.io.IOException; import java.io.IOException;
@ -42,17 +43,17 @@ public LootTableProvider( DataGenerator generator )
@Override @Override
public void act( @Nonnull DirectoryCache cache ) public void act( @Nonnull DirectoryCache cache )
{ {
ValidationResults validation = new ValidationResults();
Map<ResourceLocation, LootTable> tables = new HashMap<>(); Map<ResourceLocation, LootTable> tables = new HashMap<>();
ValidationTracker validation = new ValidationTracker( LootParameterSets.GENERIC, x -> null, tables::get );
registerLoot( ( id, table ) -> { registerLoot( ( id, table ) -> {
if( tables.containsKey( id ) ) validation.addProblem( "Duplicate loot tables for " + id ); if( tables.containsKey( id ) ) validation.func_227530_a_( "Duplicate loot tables for " + id );
tables.put( id, table ); tables.put( id, table );
} ); } );
tables.forEach( ( key, value ) -> LootTableManager.func_215302_a( validation, key, value, tables::get ) ); tables.forEach( ( key, value ) -> LootTableManager.func_227508_a_( validation, key, value ) );
Multimap<String, String> problems = validation.getProblems(); Multimap<String, String> problems = validation.func_227527_a_();
if( !problems.isEmpty() ) if( !problems.isEmpty() )
{ {
problems.forEach( ( child, problem ) -> problems.forEach( ( child, problem ) ->

View File

@ -54,7 +54,7 @@ public boolean createBuffer( MonitorRenderer renderer )
if( buffer != null ) return false; if( buffer != null ) return false;
deleteBuffers(); deleteBuffers();
buffer = new VertexBuffer( FixedWidthFontRenderer.POSITION_COLOR_TEX ); buffer = new VertexBuffer( FixedWidthFontRenderer.TYPE.getVertexFormat() );
addMonitor(); addMonitor();
return true; return true;

View File

@ -6,7 +6,6 @@
package dan200.computercraft.shared.peripheral.monitor; package dan200.computercraft.shared.peripheral.monitor;
import com.mojang.blaze3d.platform.GLX;
import dan200.computercraft.ComputerCraft; import dan200.computercraft.ComputerCraft;
import dan200.computercraft.client.render.TileEntityMonitorRenderer; import dan200.computercraft.client.render.TileEntityMonitorRenderer;
@ -73,22 +72,7 @@ public static MonitorRenderer ofString( String name )
public static MonitorRenderer current() public static MonitorRenderer current()
{ {
MonitorRenderer current = ComputerCraft.monitorRenderer; MonitorRenderer current = ComputerCraft.monitorRenderer;
switch( current ) return current == MonitorRenderer.BEST ? best() : current;
{
case BEST:
return best();
case VBO:
if( !GLX.useVbo() )
{
ComputerCraft.log.warn( "VBOs are not supported on your graphics card. Falling back to default." );
ComputerCraft.monitorRenderer = BEST;
return best();
}
return VBO;
default:
return current;
}
} }
private static MonitorRenderer best() private static MonitorRenderer best()