mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-11-10 02:13:04 +00:00
Merge branch 'mc-1.14.x' into mc-1.15.x
# Conflicts: # gradle.properties # src/main/java/dan200/computercraft/client/render/MonitorTextureBufferShader.java # src/main/java/dan200/computercraft/client/render/TileEntityMonitorRenderer.java # src/main/java/dan200/computercraft/core/apis/handles/HandleGeneric.java # src/main/java/dan200/computercraft/shared/Config.java # src/main/java/dan200/computercraft/shared/network/NetworkHandler.java # src/main/java/dan200/computercraft/shared/peripheral/monitor/TileMonitor.java # src/main/java/dan200/computercraft/shared/turtle/apis/TurtleAPI.java # src/main/resources/data/computercraft/lua/rom/help/changelog.txt # src/main/resources/data/computercraft/lua/rom/help/whatsnew.txt
This commit is contained in:
@@ -17,6 +17,7 @@ import dan200.computercraft.core.tracking.TrackingField;
|
||||
import dan200.computercraft.shared.turtle.core.*;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
|
||||
@@ -325,6 +326,10 @@ public class TurtleAPI implements ILuaAPI
|
||||
table.put( "name", name );
|
||||
table.put( "count", count );
|
||||
|
||||
Map<String, Boolean> tags = new HashMap<>();
|
||||
for( ResourceLocation location : item.getTags() ) tags.put( location.toString(), true );
|
||||
table.put( "tags", tags );
|
||||
|
||||
TurtleActionEvent event = new TurtleInspectItemEvent( turtle, stack, table );
|
||||
if( MinecraftForge.EVENT_BUS.post( event ) ) return new Object[] { false, event.getFailureMessage() };
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.state.IProperty;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
@@ -64,6 +65,10 @@ public class TurtleInspectCommand implements ITurtleCommand
|
||||
}
|
||||
table.put( "state", stateTable );
|
||||
|
||||
Map<String, Boolean> tags = new HashMap<>();
|
||||
for( ResourceLocation location : block.getTags() ) tags.put( location.toString(), true );
|
||||
table.put( "tags", tags );
|
||||
|
||||
// Fire the event, exiting if it is cancelled
|
||||
TurtlePlayer turtlePlayer = TurtlePlaceCommand.createPlayer( turtle, oldPosition, direction );
|
||||
TurtleBlockEvent.Inspect event = new TurtleBlockEvent.Inspect( turtle, turtlePlayer, world, newPosition, state, table );
|
||||
|
||||
Reference in New Issue
Block a user