mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-18 11:19:19 +00:00
Bump patchouli and forge, fix floating flower in world render
This commit is contained in:
1 parent
9c23ff9257
commit
05fe2c195c
9 files changed
+43
-22
No files matched your search
@@ -16,9 +16,9 @@ import vazkii.botania.client.core.handler.HUDHandler;
|
||||
import vazkii.botania.common.block.tile.mana.TilePool;
|
||||
import vazkii.patchouli.api.IComponentRenderContext;
|
||||
import vazkii.patchouli.api.ICustomComponent;
|
||||
import vazkii.patchouli.api.VariableHolder;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* A custom component that renders a mana bar.
|
||||
@@ -29,7 +29,6 @@ public class ManaComponent implements ICustomComponent {
|
||||
private transient int x, y;
|
||||
private transient int[] manaValues;
|
||||
|
||||
@VariableHolder
|
||||
public String mana;
|
||||
|
||||
@Override
|
||||
@@ -60,4 +59,9 @@ public class ManaComponent implements ICustomComponent {
|
||||
String ratioString = I18n.format("botaniamisc.ratio", ratio);
|
||||
font.drawString(ratioString, x + 102 / 2 - font.getStringWidth(ratioString) / 2, y + 15, 0x99000000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVariablesAvailable(Function<String, String> lookup) {
|
||||
mana = lookup.apply(mana);
|
||||
}
|
||||
}
|
||||
+8
-2
@@ -12,20 +12,26 @@ package vazkii.botania.client.patchouli.component;
|
||||
|
||||
import net.minecraft.item.crafting.Ingredient;
|
||||
import vazkii.patchouli.api.PatchouliAPI;
|
||||
import vazkii.patchouli.api.VariableHolder;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Patchouli custom component that draws a rotating circle of items from a provided list.
|
||||
*/
|
||||
public class RotatingItemListComponent extends RotatingItemListComponentBase {
|
||||
@VariableHolder
|
||||
public List<String> ingredients;
|
||||
|
||||
@Override
|
||||
protected List<Ingredient> makeIngredients() {
|
||||
return ingredients.stream().map(PatchouliAPI.instance::deserializeIngredient).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVariablesAvailable(Function<String, String> lookup) {
|
||||
for (int i = 0; i < ingredients.size(); i++) {
|
||||
ingredients.set(i, lookup.apply(ingredients.get(i)));
|
||||
}
|
||||
}
|
||||
}
|
||||
+7
-3
@@ -15,20 +15,18 @@ import net.minecraft.item.crafting.Ingredient;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.recipe.IModRecipe;
|
||||
import vazkii.patchouli.api.VariableHolder;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* Patchouli custom component that draws a rotating circle of items from the defined recipe.
|
||||
*/
|
||||
public class RotatingRecipeComponent extends RotatingItemListComponentBase {
|
||||
@VariableHolder
|
||||
@SerializedName("recipe_name")
|
||||
public String recipeName;
|
||||
|
||||
@VariableHolder
|
||||
@SerializedName("recipe_type")
|
||||
public String recipeType;
|
||||
|
||||
@@ -45,4 +43,10 @@ public class RotatingRecipeComponent extends RotatingItemListComponentBase {
|
||||
IModRecipe recipe = map.get(new ResourceLocation(recipeName));
|
||||
return recipe.getInputs();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVariablesAvailable(Function<String, String> lookup) {
|
||||
recipeName = lookup.apply(recipeName);
|
||||
recipeType = lookup.apply(recipeType);
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,8 @@ import net.minecraft.item.ItemStack;
|
||||
import vazkii.patchouli.api.IComponentRenderContext;
|
||||
import vazkii.patchouli.api.ICustomComponent;
|
||||
import vazkii.patchouli.api.PatchouliAPI;
|
||||
import vazkii.patchouli.api.VariableHolder;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* Patchouli custom component that draws provided stacks arranged like the Terrestial Agglomeration Plate multiblock.
|
||||
@@ -24,13 +25,9 @@ import vazkii.patchouli.api.VariableHolder;
|
||||
* Parameters: corner, center, edge, plate can be provided to override default blocks.
|
||||
*/
|
||||
public class TerraPlateComponent implements ICustomComponent {
|
||||
@VariableHolder
|
||||
public String corner = "botania:livingrock";
|
||||
@VariableHolder
|
||||
public String center = "botania:livingrock";
|
||||
@VariableHolder
|
||||
public String edge = "minecraft:lapis_block";
|
||||
@VariableHolder
|
||||
public String plate = "botania:terra_plate";
|
||||
|
||||
private transient int x, y;
|
||||
@@ -74,4 +71,12 @@ public class TerraPlateComponent implements ICustomComponent {
|
||||
|
||||
RenderSystem.popMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVariablesAvailable(Function<String, String> lookup) {
|
||||
corner = lookup.apply(corner);
|
||||
center = lookup.apply(center);
|
||||
edge = lookup.apply(edge);
|
||||
plate = lookup.apply(plate);
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,7 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.BlockModelRenderer;
|
||||
import net.minecraft.client.renderer.BlockRendererDispatcher;
|
||||
import net.minecraft.client.renderer.IRenderTypeBuffer;
|
||||
import net.minecraft.client.renderer.RenderTypeLookup;
|
||||
import net.minecraft.client.renderer.Vector3f;
|
||||
import net.minecraft.client.renderer.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.texture.AtlasTexture;
|
||||
@@ -24,6 +25,8 @@ import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.ILightReader;
|
||||
import net.minecraftforge.client.model.data.IModelData;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
@@ -61,10 +64,10 @@ public class RenderTileFloatingFlower extends TileEntityRenderer {
|
||||
ms.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(90.0F));
|
||||
|
||||
BlockRendererDispatcher brd = Minecraft.getInstance().getBlockRendererDispatcher();
|
||||
BlockState state = tile.getWorld().getBlockState(tile.getPos());
|
||||
IBakedModel model = brd.getModelForState(state);
|
||||
// todo 1.15: won't work until MinecraftForge#6442 is merged
|
||||
brd.renderBlock(state, ms, buffers, light, overlay, data);
|
||||
BlockState state = tile.getBlockState();
|
||||
|
||||
IBakedModel ibakedmodel = brd.getModelForState(state);
|
||||
brd.getBlockModelRenderer().renderModel(ms.peek(), buffers.getBuffer(RenderTypeLookup.getEntityBlockLayer(state)), state, ibakedmodel, 1, 1, 1, light, overlay, data);
|
||||
|
||||
ms.pop();
|
||||
|
||||
|
||||
@@ -91,9 +91,9 @@ public class ItemLexicon extends Item implements IElvenItem {
|
||||
if(playerIn instanceof ServerPlayerEntity) {
|
||||
ServerPlayerEntity player= (ServerPlayerEntity) playerIn;
|
||||
UseItemSuccessTrigger.INSTANCE.trigger(player, stack, player.getServerWorld(), player.getX(), player.getY(), player.getZ());
|
||||
NetworkHandler.sendToPlayer(new MessageOpenBookGui(book.resourceLoc.toString()), (ServerPlayerEntity) playerIn);
|
||||
NetworkHandler.sendToPlayer(new MessageOpenBookGui(book.id), (ServerPlayerEntity) playerIn);
|
||||
SoundEvent sfx = PatchouliSounds.getSound(book.openSound, PatchouliSounds.book_open);
|
||||
worldIn.playSound(null, playerIn.getX(), playerIn.getY(), playerIn.getZ(), sfx, SoundCategory.PLAYERS, 1F, (float) (0.7 + Math.random() * 0.4));
|
||||
playerIn.playSound(sfx, 1F, (float) (0.7 + Math.random() * 0.4));
|
||||
}
|
||||
|
||||
return new ActionResult<>(ActionResultType.SUCCESS, stack);
|
||||
|
||||
@@ -121,7 +121,7 @@ public class ItemSextant extends Item {
|
||||
if((int) Math.floor(MathHelper.pointDistancePlane(xp, zp, x, z)) == iradius - 1)
|
||||
map.put(new BlockPos(xp - x, 0, zp - z), matcher);
|
||||
}
|
||||
AbstractMultiblock sparse = (AbstractMultiblock) PatchouliAPI.instance.makeSparseMultiblock(map).setResourceLocation(MULTIBLOCK_ID);
|
||||
AbstractMultiblock sparse = (AbstractMultiblock) PatchouliAPI.instance.makeSparseMultiblock(map).setId(MULTIBLOCK_ID);
|
||||
Botania.proxy.showMultiblock(sparse, "r = " + (int) radius, new BlockPos(x, y, z), Rotation.NONE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,6 @@ public class MysticalFlowerConfig implements IFeatureConfig {
|
||||
@Nonnull
|
||||
@Override
|
||||
public <T> Dynamic<T> serialize(@Nonnull DynamicOps<T> ops) {
|
||||
// todo 1.14
|
||||
return new Dynamic<>(ops);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user