1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-08-29 08:42:17 +00:00

Merge remote-tracking branch 'origin/fabric' into fabric

This commit is contained in:
Jacob Farley 2020-09-06 16:50:36 -05:00
commit 1a21529499
3 changed files with 28 additions and 1 deletions

View File

@ -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;

View File

@ -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() {

View File

@ -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);
}
}
}