TomatoRoger 发表于 2024-5-3 08:31:35

我嘞个YZ31

MC西段 发表于 2024-5-3 11:29:57

崩铁官谷笑死(蚌

FuchuanMTR 发表于 2024-5-3 13:56:41

我嘞个猫跃我的世界

aftersans53228 发表于 2024-5-3 20:16:25

本帖最后由 aftersans53228 于 2024-5-3 20:17 编辑

我嘞个 MinecraftServer server =player.getServer();BlockPos boxPos =buf.readBlockPos(); int[] timeData= buf.readIntArray();Boolean enabled = buf.readBoolean();if (server != null) {server.execute(()-> {if (player.getEntityWorld().getBlockEntity(boxPos) != null && player.getEntityWorld().getBlockEntity(boxPos).getType() == AFRoadsBlockRegistry.TRAFFIC_LIGHTS_CONTROL_ENTITY) {TrafficLightsControlEntity blockEntity = (TrafficLightsControlEntity) player.getEntityWorld().getBlockEntity(boxPos);World world =player.getEntityWorld();world.setBlockState(boxPos,world.getBlockState(boxPos).with(BooleanProperty.of("is_enable"),enabled));blockEntity.setCachedState(blockEntity.getCachedState().with(BooleanProperty.of("is_enable"),enabled));ArrayList<Integer> timeForward = new ArrayList<>();ArrayList<Integer> timeTurn = new ArrayList<>(); timeForward.add(timeData);timeForward.add(timeData);timeTurn.add(timeData); timeTurn.add(timeData);blockEntity.setTimeData(timeForward,timeTurn); AFRoads.LOGGER.info("Set Traffic lights Control Box {"+ Arrays.toString(timeData) + "} ,"+enabled );} else if (player.getEntityWorld().getBlockEntity(boxPos) == null) {AFRoads.LOGGER.info("Invalid Block Entity.");}});}

a123456789 发表于 2024-5-4 14:12:41

我嘞个镭

TEY0089 发表于 2024-5-4 19:50:49

我嘞个轨道
页: 1 [2]
查看完整版本: [预热] “螃蟹杯”第一届MTR服务器模拟炒股大赛将在6月20日拉开帷幕!