Skip to content

Commit

Permalink
Removed Pattern Book while keep crashing on servers
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-Mendes committed Jan 4, 2024
1 parent 2672fd8 commit 6caab35
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 16 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

## [1.20.1-8.0.2] - 2024-01-03
## [1.20.1-8.0.2] - 2024-01-04

Removed the `Pattern Book` item, while keep crashing on servers.

### Fixed

Expand Down
6 changes: 5 additions & 1 deletion src/main/java/dev/the_fireplace/caterpillar/Caterpillar.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ public Caterpillar() {
CreativeModeTabRegistry.register(bus);
BlockRegistry.BLOCKS.register(bus);
BlockEntityRegistry.BLOCK_ENTITY_TYPES.register(bus);
ItemRegistry.ITEMS.register(bus);
/**
* TODO: Re-enable when fixed
*
* ItemRegistry.ITEMS.register(bus);
*/
MenuRegistry.MENU_TYPES.register(bus);
EntityRegistry.ENTITY_TYPES.register(bus);
RecipeRegistry.RECIPE_SERIALIZERS.register(bus);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import dev.the_fireplace.caterpillar.client.screen.*;
import dev.the_fireplace.caterpillar.config.ConfigHelper;
import dev.the_fireplace.caterpillar.config.ConfigHolder;
import dev.the_fireplace.caterpillar.network.packet.server.OpenBookGuiS2CPacket;
import dev.the_fireplace.caterpillar.registry.EntityRegistry;
import dev.the_fireplace.caterpillar.registry.MenuRegistry;
import net.minecraft.client.gui.screens.MenuScreens;
Expand Down Expand Up @@ -63,12 +64,16 @@ public static void onKeyRegister(RegisterKeyMappingsEvent event) {

@SubscribeEvent
public static void onInitialize(FMLCommonSetupEvent event) {
MinecraftForge.EVENT_BUS.addListener((PlayerInteractEvent.RightClickBlock e) -> {
var result = LecternEventHandler.rightClick(e.getEntity(), e.getLevel(), e.getHand(), e.getHitVec());
if (result.consumesAction()) {
e.setCanceled(true);
e.setCancellationResult(result);
}
});
/**
* TODO: Re-enable when fixed
*
* MinecraftForge.EVENT_BUS.addListener((PlayerInteractEvent.RightClickBlock e) -> {
* var result = LecternEventHandler.rightClick(e.getEntity(), e.getLevel(), e.getHand(), e.getHitVec());
* if (result.consumesAction()) {
* e.setCanceled(true);
* e.setCancellationResult(result);
* }
* });
*/
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,15 @@ public static void register() {
.consumerMainThread(PatternBookEditC2SPacket::handle)
.add();

CHANNEL.messageBuilder(OpenBookGuiS2CPacket.class, index++, NetworkDirection.PLAY_TO_CLIENT)
.decoder(OpenBookGuiS2CPacket::new)
.encoder(OpenBookGuiS2CPacket::toBytes)
.consumerMainThread(OpenBookGuiS2CPacket::handle)
.add();
/**
* TODO: Re-enable when fixed
*
* CHANNEL.messageBuilder(OpenBookGuiS2CPacket.class, index++, NetworkDirection.PLAY_TO_CLIENT)
* .decoder(OpenBookGuiS2CPacket::new)
* .encoder(OpenBookGuiS2CPacket::toBytes)
* .consumerMainThread(OpenBookGuiS2CPacket::handle)
* .add();
*/

Caterpillar.LOGGER.info("Registered {} packets!", index);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class CreativeModeTabRegistry {
public static final DeferredRegister<CreativeModeTab> CREATIVE_MODE_TABS =
DeferredRegister.create(Registries.CREATIVE_MODE_TAB, Caterpillar.MOD_ID);

public static final RegistryObject<CreativeModeTab> CATERPILLAR_TAB = CREATIVE_MODE_TABS.register("tutorial_tab",
public static final RegistryObject<CreativeModeTab> CATERPILLAR_TAB = CREATIVE_MODE_TABS.register(Caterpillar.MOD_ID,
() -> CreativeModeTab.builder()
.icon(() -> new ItemStack(BlockRegistry.DRILL_HEAD.get()))
.title(Component.translatable("itemGroup." + Caterpillar.MOD_ID))
Expand All @@ -28,7 +28,11 @@ public class CreativeModeTabRegistry {
output.accept(BlockRegistry.STORAGE.get());
output.accept(BlockRegistry.DECORATION.get());
output.accept(BlockRegistry.TRANSPORTER.get());
output.accept(ItemRegistry.WRITABLE_PATTERN_BOOK.get());
/**
* TODO: Re-enable when fixed
*
* output.accept(ItemRegistry.WRITABLE_PATTERN_BOOK.get());
*/
})
.build());

Expand Down

0 comments on commit 6caab35

Please sign in to comment.