mirror of
https://github.com/GoldChick/ExtraBotany.git
synced 2024-10-28 03:40:09 +08:00
v0.1.6.2
This commit is contained in:
parent
4c253d7d05
commit
3c19de95a6
@ -161,7 +161,7 @@ repositories {
|
||||
|
||||
}
|
||||
dependencies {
|
||||
minecraft 'net.minecraftforge:forge:1.18.2-40.1.51'
|
||||
minecraft "net.minecraftforge:forge:1.18.2-${forge_version}"
|
||||
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
|
||||
|
||||
runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:1.18.2-5.0.7.1")
|
||||
|
@ -4,6 +4,7 @@ org.gradle.jvmargs=-Xmx4G
|
||||
org.gradle.daemon=false
|
||||
|
||||
minecraft_version=1.18.2
|
||||
forge_version=40.1.68
|
||||
|
||||
botania_version=435
|
||||
|
||||
|
@ -35,19 +35,16 @@ public class PowerFrame extends BlockModWaterloggable implements EntityBlock
|
||||
ItemStack stack = player.getItemInHand(hand);
|
||||
if (frame != null)
|
||||
{
|
||||
if (!stack.isEmpty() && (IXplatAbstractions.INSTANCE.findManaItem(stack) != null || chick.extrabotany.xplat.IXplatAbstractions.INSTANCE.findNatureOrbItem(stack) != null))
|
||||
{
|
||||
if (frame.getItemHandler().isEmpty())
|
||||
{
|
||||
boolean result = frame.addItem(player, stack, hand);
|
||||
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(frame);
|
||||
return result ? InteractionResult.SUCCESS : InteractionResult.PASS;
|
||||
} else
|
||||
if (!frame.getItemHandler().isEmpty())
|
||||
{
|
||||
InventoryHelper.withdrawFromInventory(frame, player);
|
||||
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(frame);
|
||||
return InteractionResult.SUCCESS;
|
||||
}
|
||||
} else if (!stack.isEmpty() && (IXplatAbstractions.INSTANCE.findManaItem(stack) != null || chick.extrabotany.xplat.IXplatAbstractions.INSTANCE.findNatureOrbItem(stack) != null))
|
||||
{
|
||||
boolean result = frame.addItem(player, stack, hand);
|
||||
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(frame);
|
||||
return result ? InteractionResult.SUCCESS : InteractionResult.PASS;
|
||||
}
|
||||
}
|
||||
return InteractionResult.PASS;
|
||||
|
@ -65,6 +65,7 @@ public class SubTileStonesia extends TileEntityGeneratingFlower
|
||||
pos = getEffectivePos().offset(offset);
|
||||
var block = level.getBlockState(pos).getBlock();
|
||||
//TODO:OUTPUT
|
||||
/*
|
||||
int output = RecipeStonesia.getOutput(new ItemStack(block));
|
||||
if (output != 0)
|
||||
{
|
||||
@ -79,6 +80,8 @@ public class SubTileStonesia extends TileEntityGeneratingFlower
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
||||
}
|
||||
} else
|
||||
|
@ -1,5 +1,6 @@
|
||||
package chick.extrabotany.common.blocks.tile;
|
||||
|
||||
import chick.extrabotany.ExtraBotany;
|
||||
import chick.extrabotany.common.ModItems;
|
||||
import chick.extrabotany.common.baubles.NatureOrb;
|
||||
import chick.extrabotany.common.blocks.ModTiles;
|
||||
@ -70,7 +71,7 @@ public class TilePowerFrame extends TileSimpleInventory
|
||||
}
|
||||
};
|
||||
|
||||
public static final Supplier<IMultiblock> MULTIBLOCK_ADV = (() -> PatchouliAPI.get().makeMultiblock(
|
||||
public static final Supplier<IMultiblock> MULTIBLOCK_ADV = Suppliers.memoize(() -> PatchouliAPI.get().makeMultiblock(
|
||||
PATTERN_ADV,
|
||||
'P', ModBlocks.naturaPylon,
|
||||
'0', chick.extrabotany.common.ModBlocks.POWER_FRAME.get(),
|
||||
@ -176,7 +177,7 @@ public class TilePowerFrame extends TileSimpleInventory
|
||||
{
|
||||
boolean multi = MULTIBLOCK_ADV.get().validate(level, worldPosition) != null;
|
||||
|
||||
|
||||
ExtraBotany.LOGGER.debug("sb250 multi:" + multi);
|
||||
int redstoneSignal = 0;
|
||||
for (Direction dir : Direction.values())
|
||||
{
|
||||
@ -219,8 +220,12 @@ public class TilePowerFrame extends TileSimpleInventory
|
||||
var orb = chick.extrabotany.xplat.IXplatAbstractions.INSTANCE.findNatureOrbItem(stack);
|
||||
if (orb != null && multi && level.dayTime() % 20 == 0)
|
||||
{
|
||||
ExtraBotany.LOGGER.debug("sb250 1");
|
||||
|
||||
if (level.getBlockEntity(worldPosition.offset(0, 1, 0)) instanceof TilePool p)
|
||||
{
|
||||
ExtraBotany.LOGGER.debug("sb250 2");
|
||||
|
||||
int natureToGet;
|
||||
if (redstoneSignal == 0)
|
||||
{
|
||||
|
@ -0,0 +1,57 @@
|
||||
package chick.extrabotany.common.handler;
|
||||
|
||||
import com.google.common.collect.ArrayListMultimap;
|
||||
import com.google.common.collect.ListMultimap;
|
||||
import net.minecraft.server.packs.PackType;
|
||||
import net.minecraft.server.packs.resources.ResourceManager;
|
||||
import net.minecraft.server.packs.resources.ResourceManagerReloadListener;
|
||||
import net.minecraft.world.item.crafting.RecipeManager;
|
||||
import net.minecraft.world.item.crafting.RecipeType;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import chick.extrabotany.api.craft.IStonesiaRecipe;
|
||||
import vazkii.botania.api.recipe.StateIngredient;
|
||||
import vazkii.botania.common.handler.OrechidManager;
|
||||
import vazkii.botania.xplat.IXplatAbstractions;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static chick.extrabotany.ExtraBotany.prefixRl;
|
||||
|
||||
|
||||
public class StonesiaManager implements ResourceManagerReloadListener
|
||||
{
|
||||
private static final Map<RecipeType<? extends IStonesiaRecipe>, ListMultimap<StateIngredient, ? extends IStonesiaRecipe>> DATA = new HashMap<>();
|
||||
|
||||
public static void registerListener()
|
||||
{
|
||||
IXplatAbstractions.INSTANCE.registerReloadListener(PackType.SERVER_DATA, prefixRl("stonesia"), new StonesiaManager());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResourceManagerReload(@Nonnull ResourceManager manager)
|
||||
{
|
||||
DATA.clear();
|
||||
}
|
||||
|
||||
public static ListMultimap<StateIngredient, ? extends IStonesiaRecipe> getFor(RecipeManager manager,
|
||||
RecipeType<? extends IStonesiaRecipe> type)
|
||||
{
|
||||
return DATA.computeIfAbsent(type, t ->
|
||||
{
|
||||
ListMultimap<StateIngredient, IStonesiaRecipe> map = ArrayListMultimap.create();
|
||||
for (var recipe : manager.getAllRecipesFor(t))
|
||||
{
|
||||
map.put(recipe.getInput(), recipe);
|
||||
}
|
||||
for (var list : map.asMap().values())
|
||||
{
|
||||
// ((List<IStonesiaRecipe>) list).sort(Comparator.comparingInt(IStonesiaRecipe::getWeight));
|
||||
}
|
||||
return map;
|
||||
});
|
||||
}
|
||||
}
|
@ -9,6 +9,7 @@ import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.inventory.InventoryMenu;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraftforge.client.event.RenderLevelLastEvent;
|
||||
import net.minecraftforge.client.event.RenderLevelStageEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
import vazkii.botania.client.render.tile.RenderTileSpecialFlower;
|
||||
@ -26,7 +27,7 @@ public class RenderEGOLandmine extends EntityRenderer<EntityEGOLandmine>
|
||||
super(renderManager);
|
||||
}
|
||||
|
||||
public static void onWorldRenderLast(RenderLevelLastEvent evt)
|
||||
public static void onWorldRenderLast(RenderLevelStageEvent.Stage evt)
|
||||
{
|
||||
offY = INITIAL_OFFSET;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user