• Recently Browsing

    No registered users viewing this page.

  • Posts

    • 1/2: https://github.com/CAS-ual-TY/YgoDuelingMod/blob/8888405bdde4992838441b472d33f920c03b63b0/src/main/java/de/cas_ual_ty/ydm/YDM.java#L197 2/2 (the three DeckBox*** classes): https://github.com/CAS-ual-TY/YgoDuelingMod/tree/8888405bdde4992838441b472d33f920c03b63b0/src/main/java/de/cas_ual_ty/ydm/deckbox   This is how I implemented a deck box that can hold up to 90 card items. The only thing you will have to do different is to consider your slots to be the x/y size of 18; I used the size 16 for my slots because otherwise there would not be enough space (in container and screen class).
    • I know how the modding basics/advanced works (not really advanced, just a little bit). And my last mod was in the 1.15.2 Version. Why not? Why its bad? You can override methods that you implemented, so i not see why not…
    • I have been searching around in the code for a while and haven't found the variable that decides if the player is looking in f5 mode or not. Can somebody tell me if they know what it is because I need it for my mod.   Version 1.16.
    • The values saved in playerdata file. However, the values aren't imported when login. How do I fix?   Main: public static final ResourceLocation CAP_RESOURCE = new ResourceLocation(MODID, "capabilities"); public TestMod() { FMLJavaModLoadingContext.get().getModEventBus().addListener(TestMod::onFMLCommonSetup); } @SubscribeEvent public static void onFMLCommonSetup(FMLCommonSetupEvent event) { CapabilityManager.INSTANCE.register(IMyCapability.class, new MyCapabilityStorage(), () -> new MyCapability(2.0f)); } @SubscribeEvent public static void attachCapability(AttachCapabilitiesEvent<Entity> event) { if (!(event.getObject() instanceof PlayerEntity)) return; event.addCapability(CAP_RESOURCE, new MyCapabilityProvider()); }   Provider: public class MyCapabilityProvider implements ICapabilitySerializable<INBT> { @CapabilityInject(IMyCapability.class) public static final Capability<IMyCapability> CAP = null; private LazyOptional<IMyCapability> instance = LazyOptional.of(CAP::getDefaultInstance); @Nonnull @Override public <T> LazyOptional<T> getCapability(@Nonnull Capability<T> cap, @Nullable Direction side) { return CAP.orEmpty(cap, instance); } @Override public INBT serializeNBT() { return (INBT) CAP.getStorage().writeNBT(CAP, instance.orElseThrow(() -> new IllegalArgumentException("at serialize")), null); } @Override public void deserializeNBT(INBT nbt) { CAP.getStorage().readNBT(CAP, instance.orElseThrow(() -> new IllegalArgumentException("at deserialize")), null, nbt); } }   Storage: public class MyCapabilityStorage implements Capability.IStorage<IMyCapability> { @Override public INBT writeNBT(Capability<IMyCapability> capability, IMyCapability instance, Direction side) { CompoundNBT tag = new CompoundNBT(); tag.putFloat("cap1", instance.getCap1()); tag.putFloat("cap2", instance.getCap2()); tag.putFloat("cap3", instance.getCap3()); return tag; } @Override public void readNBT(Capability<IMyCapability> capability, IMyCapability instance, Direction side, INBT nbt) { CompoundNBT tag = (CompoundNBT) nbt; instance.setCap1(tag.getFloat("cap1")); instance.setCap2(tag.getFloat("cap2")); instance.setCap3(tag.getFloat("cap3")); } }  
  • Topics

  • Who's Online (See full list)