mirror of
				https://github.com/SquidDev-CC/CC-Tweaked
				synced 2025-10-30 13:13:00 +00:00 
			
		
		
		
	Merge remote-tracking branch 'origin/fabric' into fabric
This commit is contained in:
		| @@ -21,7 +21,7 @@ import net.minecraft.util.Identifier; | ||||
|  * @see dan200.computercraft.shared.command.CommandComputerCraft | ||||
|  */ | ||||
| public class ViewComputerContainerData extends ComputerContainerData { | ||||
|     private static final Identifier IDENTIFIER = new Identifier(ComputerCraft.MOD_ID, "viewComputerContainerData"); | ||||
|     private static final Identifier IDENTIFIER = new Identifier(ComputerCraft.MOD_ID, "view_computer_container_data"); | ||||
|     private int width; | ||||
|     private int height; | ||||
|  | ||||
|   | ||||
| @@ -25,6 +25,7 @@ import dan200.computercraft.shared.network.NetworkHandler; | ||||
| import dan200.computercraft.shared.peripheral.commandblock.CommandBlockPeripheral; | ||||
| import dan200.computercraft.shared.peripheral.modem.wireless.WirelessNetwork; | ||||
| import dan200.computercraft.shared.turtle.FurnaceRefuelHandler; | ||||
| import dan200.computercraft.shared.turtle.SignInspectHandler; | ||||
| import dan200.computercraft.shared.util.TickScheduler; | ||||
|  | ||||
| import net.minecraft.block.entity.BlockEntity; | ||||
| @@ -107,6 +108,7 @@ public final class ComputerCraftProxyCommon { | ||||
|  | ||||
|         TurtleEvent.EVENT_BUS.register(FurnaceRefuelHandler.INSTANCE); | ||||
|         TurtleEvent.EVENT_BUS.register(new TurtlePermissions()); | ||||
|         TurtleEvent.EVENT_BUS.register(new SignInspectHandler()); | ||||
|     } | ||||
|  | ||||
|     public static void registerLoot() { | ||||
|   | ||||
| @@ -0,0 +1,25 @@ | ||||
| package dan200.computercraft.shared.turtle; | ||||
|  | ||||
| import java.util.HashMap; | ||||
| import java.util.Map; | ||||
|  | ||||
| import com.google.common.eventbus.Subscribe; | ||||
|  | ||||
| import dan200.computercraft.api.turtle.event.TurtleBlockEvent; | ||||
| import net.minecraft.block.entity.BlockEntity; | ||||
| import net.minecraft.block.entity.SignBlockEntity; | ||||
|  | ||||
| public class SignInspectHandler { | ||||
|     @Subscribe | ||||
|     public void onTurtleInspect(TurtleBlockEvent.Inspect event) { | ||||
|         BlockEntity be = event.getWorld().getBlockEntity(event.getPos()); | ||||
|         if (be instanceof SignBlockEntity) { | ||||
|             SignBlockEntity sbe = (SignBlockEntity)be; | ||||
|             Map<Integer, String> textTable = new HashMap<>(); | ||||
|             for(int k = 0; k < 4; k++) { | ||||
|                 textTable.put(k+1, sbe.getTextOnRow(k).asString()); | ||||
|             } | ||||
|             event.getData().put("text", textTable); | ||||
|         } | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user
	 Jacob Farley
					Jacob Farley