Skip to content

Commit

Permalink
fixed chute and grates. Fixed magnets not pulling breakable blocks. R…
Browse files Browse the repository at this point in the history
…emoved jei code that will be put into zeta
  • Loading branch information
MehVahdJukaar committed Aug 6, 2024
1 parent 8c9ec1b commit 2547e6c
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 79 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ dependencies {
runtimeOnly fg.deobf("curse.maven:spark-361579:${deps.spark}")

//implementation fg.deobf("org.violetmoon.zeta:Zeta:1.0-24f")
implementation fg.deobf("curse.maven:zeta-968868:5594814")
implementation fg.deobf("curse.maven:zeta-968868:5597406")
implementation fg.deobf("com.github.glitchfiend:TerraBlender-forge:${deps.terrablender}")
implementation fg.deobf("curse.maven:jei-238222:${deps.jei}")
implementation fg.deobf("curse.maven:flan-forge-493246:${deps.flan}")
Expand Down
3 changes: 2 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Re-built and published because for some arcane reason previous version didn't work?
- fixed grate blocking chute drops
- fixed magnets not pushing breakable blocks
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public static boolean canBlockBeMagneticallyMoved(BlockState state, BlockPos pos
Block block = state.getBlock();

//cant push stuff that pistons cant push
if(MagnetsModule.usePistonLogic && !PistonBaseBlock.isPushable(state, level, pos, moveDir, false, moveDir.getOpposite())){
if(MagnetsModule.usePistonLogic && !PistonBaseBlock.isPushable(state, level, pos, moveDir, true, moveDir.getOpposite())){
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ private boolean canDropItem() {
BlockPos below = worldPosition.below();
BlockState state = level.getBlockState(below);
if (state.isAir()) return true;
if (state.is(GrateModule.grate)) return true;
//this could be cached in a blockstate property. maybe micro optimization...
var shape = state.getCollisionShape(level, below);
if (shape.isEmpty() ) return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import org.violetmoon.zeta.config.Config;
import org.violetmoon.zeta.config.ConfigFlagManager;
import org.violetmoon.zeta.event.bus.LoadEvent;
import org.violetmoon.zeta.event.bus.PlayEvent;
import org.violetmoon.zeta.event.load.ZGatherAdditionalFlags;
import org.violetmoon.zeta.event.load.ZRegister;
import org.violetmoon.zeta.module.ZetaLoadModule;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,51 +88,6 @@ public void registerItemSubtypes(@NotNull ISubtypeRegistration registration) {
registration.useNbtForSubtypes(AncientTomesModule.ancient_tome);
}

@Override
public void onRuntimeAvailable(@NotNull final IJeiRuntime jeiRuntime) {
List<ItemStack> disabledItems = Quark.ZETA.requiredModTooltipHandler.disabledItems();
if(!disabledItems.isEmpty())
jeiRuntime.getIngredientManager().removeIngredientsAtRuntime(VanillaTypes.ITEM_STACK, disabledItems);

Quark.ZETA.configManager.setJeiReloadListener(configInternals -> {
if(Quark.ZETA.modules.isEnabled(DiamondRepairModule.class))
Minecraft.getInstance().submitAsync(() -> hideAnvilRepairRecipes(jeiRuntime.getRecipeManager()));

// TODO: This needs to be moved to zeta
if(!ZetaGeneralConfig.hideDisabledContent)
return;

Set<Potion> hidePotions = Sets.newHashSet();
for(Potion potion : BuiltInRegistries.POTION) {
ResourceLocation loc = BuiltInRegistries.POTION.getKey(potion);
if(loc != null && loc.getNamespace().equals("quark")) {
if(!Quark.ZETA.brewingRegistry.isEnabled(potion)) {
hidePotions.add(potion);
}
}
}

NonNullList<ItemStack> stacksToHide = NonNullList.create();
for(Item item : BuiltInRegistries.ITEM) {
ResourceLocation loc = BuiltInRegistries.ITEM.getKey(item);
if(loc.getNamespace().equals("quark") && !IDisableable.isEnabled(item)) {
//TODO 1.20: this just enumerated the item's variants
//item.fillItemCategory(CreativeModeTab.TAB_SEARCH, stacksToHide);
}

if(item instanceof PotionItem || item instanceof TippedArrowItem) {
NonNullList<ItemStack> potionStacks = NonNullList.create();
//TODO 1.20: this just enumerated the item's variants
//item.fillItemCategory(CreativeModeTab.TAB_SEARCH, potionStacks);
potionStacks.stream().filter(it -> hidePotions.contains(PotionUtils.getPotion(it))).forEach(stacksToHide::add);
}
}

if(!stacksToHide.isEmpty())
Minecraft.getInstance().submitAsync(() -> jeiRuntime.getIngredientManager().removeIngredientsAtRuntime(VanillaTypes.ITEM_STACK, stacksToHide));
});
}

@Override
public void registerVanillaCategoryExtensions(@NotNull IVanillaCategoryExtensionRegistration registration) {
registration.getCraftingCategory().addCategoryExtension(ElytraDuplicationRecipe.class, ElytraDuplicationExtension::new);
Expand Down Expand Up @@ -166,36 +121,6 @@ public void registerRecipes(@NotNull IRecipeRegistration registration) {

if(Quark.ZETA.modules.isEnabled(DiamondRepairModule.class))
registerCustomAnvilRecipes(registration, factory);

// TODO: This needs to be moved to zeta
if(ZetaGeneralConfig.enableJeiItemInfo) {
MutableComponent externalPreamble = Component.translatable("quark.jei.hint_preamble");
externalPreamble.setStyle(externalPreamble.getStyle().withColor(0x0b5d4b));

List<Item> blacklist = RegistryUtil.massRegistryGet(ZetaGeneralConfig.suppressedInfo, BuiltInRegistries.ITEM);

Quark.ZETA.playBus.fire(new ZGatherHints() {
@Override
public void accept(ItemLike itemLike, Component extra) {
Item item = itemLike.asItem();

if(blacklist.contains(item))
return;

MutableComponent compound = Component.literal("");
if(!BuiltInRegistries.ITEM.getKey(item).getNamespace().equals(Quark.MOD_ID))
compound = compound.append(externalPreamble);
compound = compound.append(extra);

registration.addItemStackInfo(new ItemStack(item), compound);
}

@Override
public RegistryAccess getRegistryAccess() {
return QuarkClient.ZETA_CLIENT.hackilyGetCurrentClientLevelRegistryAccess();
}
}, ZGatherHints.class);
}
}

@Override
Expand Down

0 comments on commit 2547e6c

Please sign in to comment.