mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-17 02:45:13 +00:00
More cleaning
This commit is contained in:
1 parent
d6bd0c021b
commit
d159660115
27 files changed
+282
-286
No files matched your search
@@ -68,6 +68,7 @@ import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
|
||||
public final class BotaniaAPI {
|
||||
|
||||
@@ -95,7 +96,7 @@ public final class BotaniaAPI {
|
||||
public static final Map<ResourceLocation, Integer> oreWeights = new HashMap<>();
|
||||
public static final Map<ResourceLocation, Integer> oreWeightsNether = new HashMap<>();
|
||||
|
||||
public static final Map<Block, EnumProperty<EnumDyeColor>> paintableBlocks = new LinkedHashMap<>();
|
||||
public static final Map<Block, Function<EnumDyeColor, Block>> paintableBlocks = new LinkedHashMap<>();
|
||||
public static final Set<Class<? extends Entity>> gravityRodBlacklist = new LinkedHashSet<>();
|
||||
public static final Set<Block> gaiaBreakBlacklist = new HashSet<>();
|
||||
|
||||
@@ -464,11 +465,21 @@ public final class BotaniaAPI {
|
||||
registerModWiki("appliedenergistics2", new SimpleWikiProvider("AE2 Wiki", "http://ae-mod.info/%s"));
|
||||
registerModWiki("bigreactors", technicWiki);
|
||||
|
||||
registerPaintableBlock(Blocks.STAINED_GLASS, BlockStainedGlass.COLOR);
|
||||
registerPaintableBlock(Blocks.STAINED_GLASS_PANE, BlockStainedGlassPane.COLOR);
|
||||
registerPaintableBlock(Blocks.STAINED_HARDENED_CLAY, BlockColored.COLOR);
|
||||
registerPaintableBlock(Blocks.WOOL, BlockColored.COLOR);
|
||||
registerPaintableBlock(Blocks.CARPET, BlockCarpet.COLOR);
|
||||
registerPaintableBlock(ColorHelper.STAINED_GLASS, Blocks.WHITE_STAINED_GLASS, Blocks.ORANGE_STAINED_GLASS, Blocks.MAGENTA_STAINED_GLASS, Blocks.LIGHT_BLUE_STAINED_GLASS,
|
||||
Blocks.YELLOW_STAINED_GLASS, Blocks.LIME_STAINED_GLASS, Blocks.PINK_STAINED_GLASS, Blocks.GRAY_STAINED_GLASS, Blocks.LIGHT_GRAY_STAINED_GLASS,
|
||||
Blocks.CYAN_STAINED_GLASS, Blocks.PURPLE_STAINED_GLASS, Blocks.BLUE_STAINED_GLASS, Blocks.BROWN_STAINED_GLASS, Blocks.GREEN_STAINED_GLASS, Blocks.RED_STAINED_GLASS, Blocks.BLACK_STAINED_GLASS);
|
||||
registerPaintableBlock(ColorHelper.STAINED_GLASS_PANE, Blocks.WHITE_STAINED_GLASS_PANE, Blocks.ORANGE_STAINED_GLASS_PANE, Blocks.MAGENTA_STAINED_GLASS_PANE, Blocks.LIGHT_BLUE_STAINED_GLASS_PANE,
|
||||
Blocks.YELLOW_STAINED_GLASS_PANE, Blocks.LIME_STAINED_GLASS_PANE, Blocks.PINK_STAINED_GLASS_PANE, Blocks.GRAY_STAINED_GLASS_PANE, Blocks.LIGHT_GRAY_STAINED_GLASS_PANE,
|
||||
Blocks.CYAN_STAINED_GLASS_PANE, Blocks.PURPLE_STAINED_GLASS_PANE, Blocks.BLUE_STAINED_GLASS_PANE, Blocks.BROWN_STAINED_GLASS_PANE, Blocks.GREEN_STAINED_GLASS_PANE, Blocks.RED_STAINED_GLASS_PANE, Blocks.BLACK_STAINED_GLASS_PANE);
|
||||
registerPaintableBlock(ColorHelper.TERRACOTTA, Blocks.WHITE_TERRACOTTA, Blocks.ORANGE_TERRACOTTA, Blocks.MAGENTA_TERRACOTTA, Blocks.LIGHT_BLUE_TERRACOTTA,
|
||||
Blocks.YELLOW_TERRACOTTA, Blocks.LIME_TERRACOTTA, Blocks.PINK_TERRACOTTA, Blocks.GRAY_TERRACOTTA, Blocks.LIGHT_GRAY_TERRACOTTA,
|
||||
Blocks.CYAN_TERRACOTTA, Blocks.PURPLE_TERRACOTTA, Blocks.BLUE_TERRACOTTA, Blocks.BROWN_TERRACOTTA, Blocks.GREEN_TERRACOTTA, Blocks.RED_TERRACOTTA, Blocks.BLACK_TERRACOTTA);
|
||||
registerPaintableBlock(ColorHelper.WOOL, Blocks.WHITE_WOOL, Blocks.ORANGE_WOOL, Blocks.MAGENTA_WOOL, Blocks.LIGHT_BLUE_WOOL,
|
||||
Blocks.YELLOW_WOOL, Blocks.LIME_WOOL, Blocks.PINK_WOOL, Blocks.GRAY_WOOL, Blocks.LIGHT_GRAY_WOOL,
|
||||
Blocks.CYAN_WOOL, Blocks.PURPLE_WOOL, Blocks.BLUE_WOOL, Blocks.BROWN_WOOL, Blocks.GREEN_WOOL, Blocks.RED_WOOL, Blocks.BLACK_WOOL);
|
||||
registerPaintableBlock(ColorHelper.CARPET, Blocks.WHITE_CARPET, Blocks.ORANGE_CARPET, Blocks.MAGENTA_CARPET, Blocks.LIGHT_BLUE_CARPET,
|
||||
Blocks.YELLOW_CARPET, Blocks.LIME_CARPET, Blocks.PINK_CARPET, Blocks.GRAY_CARPET, Blocks.LIGHT_GRAY_CARPET,
|
||||
Blocks.CYAN_CARPET, Blocks.PURPLE_CARPET, Blocks.BLUE_CARPET, Blocks.BROWN_CARPET, Blocks.GREEN_CARPET, Blocks.RED_CARPET, Blocks.BLACK_CARPET);
|
||||
blacklistBlockFromGaiaGuardian(Blocks.BEACON);
|
||||
}
|
||||
|
||||
@@ -510,12 +521,12 @@ public final class BotaniaAPI {
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a paintableBlock and returns it.
|
||||
* You must also provide the PropertyEnum that this block uses to express its color
|
||||
* Registers a block as paintable under the paint lens
|
||||
*/
|
||||
public static Block registerPaintableBlock(Block paintable, PropertyEnum<EnumDyeColor> colorProp){
|
||||
paintableBlocks.put(paintable, colorProp);
|
||||
return paintable;
|
||||
public static void registerPaintableBlock(Function<EnumDyeColor, Block> transformer, Block... paintables) {
|
||||
for(Block b : paintables) {
|
||||
paintableBlocks.put(b, transformer);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -629,7 +640,7 @@ public final class BotaniaAPI {
|
||||
* @param inputs The items required, can be ItemStack or ore dictionary entry string.
|
||||
* @return The recipe created.
|
||||
*/
|
||||
public static RecipeElvenTrade registerElvenTradeRecipe(ItemStack[] outputs, Object... inputs) {
|
||||
public static RecipeElvenTrade registerElvenTradeRecipe(ItemStack[] outputs, Ingredient... inputs) {
|
||||
RecipeElvenTrade recipe = new RecipeElvenTrade(outputs, inputs);
|
||||
elvenTradeRecipes.add(recipe);
|
||||
return recipe;
|
||||
@@ -641,7 +652,7 @@ public final class BotaniaAPI {
|
||||
* @param inputs The items required, can be an ItemStack or an Ore Dictionary entry string.
|
||||
* @return The recipe created.
|
||||
*/
|
||||
public static RecipeElvenTrade registerElvenTradeRecipe(ItemStack output, Object... inputs) {
|
||||
public static RecipeElvenTrade registerElvenTradeRecipe(ItemStack output, Ingredient... inputs) {
|
||||
return registerElvenTradeRecipe(new ItemStack[]{ output }, inputs);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
package vazkii.botania.api;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
public final class ColorHelper {
|
||||
public static final Function<EnumDyeColor, Block> STAINED_GLASS = e -> {
|
||||
switch (e) {
|
||||
default:
|
||||
case WHITE: return Blocks.WHITE_STAINED_GLASS;
|
||||
case ORANGE: return Blocks.ORANGE_STAINED_GLASS;
|
||||
case MAGENTA: return Blocks.MAGENTA_STAINED_GLASS;
|
||||
case LIGHT_BLUE: return Blocks.LIGHT_BLUE_STAINED_GLASS;
|
||||
case YELLOW: return Blocks.YELLOW_STAINED_GLASS;
|
||||
case LIME: return Blocks.LIME_STAINED_GLASS;
|
||||
case PINK: return Blocks.PINK_STAINED_GLASS;
|
||||
case GRAY: return Blocks.GRAY_STAINED_GLASS;
|
||||
case LIGHT_GRAY: return Blocks.LIGHT_GRAY_STAINED_GLASS;
|
||||
case CYAN: return Blocks.CYAN_STAINED_GLASS;
|
||||
case PURPLE: return Blocks.PURPLE_STAINED_GLASS;
|
||||
case BLUE: return Blocks.BLUE_STAINED_GLASS;
|
||||
case BROWN: return Blocks.BROWN_STAINED_GLASS;
|
||||
case GREEN: return Blocks.GREEN_STAINED_GLASS;
|
||||
case RED: return Blocks.RED_STAINED_GLASS;
|
||||
case BLACK: return Blocks.BLACK_STAINED_GLASS;
|
||||
}
|
||||
};
|
||||
|
||||
public static final Function<EnumDyeColor, Block> STAINED_GLASS_PANE = e -> {
|
||||
switch (e) {
|
||||
default:
|
||||
case WHITE: return Blocks.WHITE_STAINED_GLASS_PANE;
|
||||
case ORANGE: return Blocks.ORANGE_STAINED_GLASS_PANE;
|
||||
case MAGENTA: return Blocks.MAGENTA_STAINED_GLASS_PANE;
|
||||
case LIGHT_BLUE: return Blocks.LIGHT_BLUE_STAINED_GLASS_PANE;
|
||||
case YELLOW: return Blocks.YELLOW_STAINED_GLASS_PANE;
|
||||
case LIME: return Blocks.LIME_STAINED_GLASS_PANE;
|
||||
case PINK: return Blocks.PINK_STAINED_GLASS_PANE;
|
||||
case GRAY: return Blocks.GRAY_STAINED_GLASS_PANE;
|
||||
case LIGHT_GRAY: return Blocks.LIGHT_GRAY_STAINED_GLASS_PANE;
|
||||
case CYAN: return Blocks.CYAN_STAINED_GLASS_PANE;
|
||||
case PURPLE: return Blocks.PURPLE_STAINED_GLASS_PANE;
|
||||
case BLUE: return Blocks.BLUE_STAINED_GLASS_PANE;
|
||||
case BROWN: return Blocks.BROWN_STAINED_GLASS_PANE;
|
||||
case GREEN: return Blocks.GREEN_STAINED_GLASS_PANE;
|
||||
case RED: return Blocks.RED_STAINED_GLASS_PANE;
|
||||
case BLACK: return Blocks.BLACK_STAINED_GLASS_PANE;
|
||||
}
|
||||
};
|
||||
|
||||
public static final Function<EnumDyeColor, Block> TERRACOTTA = e -> {
|
||||
switch (e) {
|
||||
default:
|
||||
case WHITE: return Blocks.WHITE_TERRACOTTA;
|
||||
case ORANGE: return Blocks.ORANGE_TERRACOTTA;
|
||||
case MAGENTA: return Blocks.MAGENTA_TERRACOTTA;
|
||||
case LIGHT_BLUE: return Blocks.LIGHT_BLUE_TERRACOTTA;
|
||||
case YELLOW: return Blocks.YELLOW_TERRACOTTA;
|
||||
case LIME: return Blocks.LIME_TERRACOTTA;
|
||||
case PINK: return Blocks.PINK_TERRACOTTA;
|
||||
case GRAY: return Blocks.GRAY_TERRACOTTA;
|
||||
case LIGHT_GRAY: return Blocks.LIGHT_GRAY_TERRACOTTA;
|
||||
case CYAN: return Blocks.CYAN_TERRACOTTA;
|
||||
case PURPLE: return Blocks.PURPLE_TERRACOTTA;
|
||||
case BLUE: return Blocks.BLUE_TERRACOTTA;
|
||||
case BROWN: return Blocks.BROWN_TERRACOTTA;
|
||||
case GREEN: return Blocks.GREEN_TERRACOTTA;
|
||||
case RED: return Blocks.RED_TERRACOTTA;
|
||||
case BLACK: return Blocks.BLACK_TERRACOTTA;
|
||||
}
|
||||
};
|
||||
|
||||
public static final Function<EnumDyeColor, Block> WOOL = e -> {
|
||||
switch (e) {
|
||||
default:
|
||||
case WHITE: return Blocks.WHITE_WOOL;
|
||||
case ORANGE: return Blocks.ORANGE_WOOL;
|
||||
case MAGENTA: return Blocks.MAGENTA_WOOL;
|
||||
case LIGHT_BLUE: return Blocks.LIGHT_BLUE_WOOL;
|
||||
case YELLOW: return Blocks.YELLOW_WOOL;
|
||||
case LIME: return Blocks.LIME_WOOL;
|
||||
case PINK: return Blocks.PINK_WOOL;
|
||||
case GRAY: return Blocks.GRAY_WOOL;
|
||||
case LIGHT_GRAY: return Blocks.LIGHT_GRAY_WOOL;
|
||||
case CYAN: return Blocks.CYAN_WOOL;
|
||||
case PURPLE: return Blocks.PURPLE_WOOL;
|
||||
case BLUE: return Blocks.BLUE_WOOL;
|
||||
case BROWN: return Blocks.BROWN_WOOL;
|
||||
case GREEN: return Blocks.GREEN_WOOL;
|
||||
case RED: return Blocks.RED_WOOL;
|
||||
case BLACK: return Blocks.BLACK_WOOL;
|
||||
}
|
||||
};
|
||||
|
||||
public static final Function<EnumDyeColor, Block> CARPET = e -> {
|
||||
switch (e) {
|
||||
default:
|
||||
case WHITE: return Blocks.WHITE_CARPET;
|
||||
case ORANGE: return Blocks.ORANGE_CARPET;
|
||||
case MAGENTA: return Blocks.MAGENTA_CARPET;
|
||||
case LIGHT_BLUE: return Blocks.LIGHT_BLUE_CARPET;
|
||||
case YELLOW: return Blocks.YELLOW_CARPET;
|
||||
case LIME: return Blocks.LIME_CARPET;
|
||||
case PINK: return Blocks.PINK_CARPET;
|
||||
case GRAY: return Blocks.GRAY_CARPET;
|
||||
case LIGHT_GRAY: return Blocks.LIGHT_GRAY_CARPET;
|
||||
case CYAN: return Blocks.CYAN_CARPET;
|
||||
case PURPLE: return Blocks.PURPLE_CARPET;
|
||||
case BLUE: return Blocks.BLUE_CARPET;
|
||||
case BROWN: return Blocks.BROWN_CARPET;
|
||||
case GREEN: return Blocks.GREEN_CARPET;
|
||||
case RED: return Blocks.RED_CARPET;
|
||||
case BLACK: return Blocks.BLACK_CARPET;
|
||||
}
|
||||
};
|
||||
|
||||
private ColorHelper() {}
|
||||
}
|
||||
@@ -14,7 +14,6 @@ import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraftforge.fml.relauncher.ReflectionHelper;
|
||||
import net.minecraftforge.registries.IRegistryDelegate;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.brew.Brew;
|
||||
@@ -176,13 +175,12 @@ public final class ColorHandler {
|
||||
|
||||
items.register((s, t) -> t == 1 && ItemTerraPick.isEnabled(s) ? Color.HSBtoRGB(0.375F, (float) Math.min(1F, Math.sin(System.currentTimeMillis() / 200D) * 0.5 + 1F), 1F) : -1, ModItems.terraPick);
|
||||
|
||||
// todo 1.13 use tags instead of looping registry
|
||||
handler = (s, t) -> t == 0 ? ((ItemLens) s.getItem()).getLensColor(s) : -1;
|
||||
for (Item i : Item.REGISTRY) {
|
||||
if(i instanceof ItemLens && i.getRegistryName().getNamespace().equals(LibMisc.MOD_ID)) {
|
||||
items.register(handler, i);
|
||||
}
|
||||
}
|
||||
items.register(handler, ModItems.lensNormal, ModItems.lensSpeed, ModItems.lensPower, ModItems.lensTime, ModItems.lensEfficiency, ModItems.lensBounce,
|
||||
ModItems.lensGravity, ModItems.lensMine, ModItems.lensDamage, ModItems.lensPhantom, ModItems.lensMagnet,
|
||||
ModItems.lensExplosive, ModItems.lensWeight, ModItems.lensPaint, ModItems.lensFire, ModItems.lensPiston,
|
||||
ModItems.lensLight, ModItems.lensWarp, ModItems.lensRedirect, ModItems.lensFirework, ModItems.lensFlare,
|
||||
ModItems.lensMessenger, ModItems.lensTripwire, ModItems.lensStorm);
|
||||
}
|
||||
|
||||
private ColorHandler() {}
|
||||
|
||||
@@ -14,7 +14,6 @@ import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.BlockRendererDispatcher;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -26,6 +25,7 @@ import net.minecraft.util.text.Style;
|
||||
import net.minecraft.util.text.TextComponentTranslation;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
@@ -47,7 +47,7 @@ public final class MultiblockRenderHandler {
|
||||
private MultiblockRenderHandler() {}
|
||||
|
||||
private static final MultiblockBlockAccess blockAccess = new MultiblockBlockAccess();
|
||||
private static int dimension;
|
||||
private static DimensionType dimension;
|
||||
|
||||
public static boolean rendering = false;
|
||||
public static MultiblockSet currentMultiblock;
|
||||
@@ -61,7 +61,7 @@ public final class MultiblockRenderHandler {
|
||||
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if(mc.world != null)
|
||||
dimension = mc.world.getDimension().getId();
|
||||
dimension = mc.world.getDimension().getType();
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@@ -83,7 +83,7 @@ public final class MultiblockRenderHandler {
|
||||
}
|
||||
|
||||
private static void renderPlayerLook(EntityPlayer player, RayTraceResult src) {
|
||||
if(currentMultiblock != null && dimension == player.world.getDimension().getId()) {
|
||||
if(currentMultiblock != null && dimension == player.world.getDimension().getType()) {
|
||||
BlockPos anchorPos = anchor != null ? anchor : src.getBlockPos();
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
|
||||
@@ -13,13 +13,12 @@ package vazkii.botania.client.core.proxy;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.entity.RenderPlayer;
|
||||
import net.minecraft.client.renderer.entity.RenderSnowball;
|
||||
import net.minecraft.client.renderer.entity.RenderSprite;
|
||||
import net.minecraft.client.renderer.entity.model.ModelBiped;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityItemStackRenderer;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.client.util.InputMappings;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -27,18 +26,17 @@ import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.model.animation.AnimationTESR;
|
||||
import net.minecraftforge.client.settings.KeyConflictContext;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.DeferredWorkQueue;
|
||||
import net.minecraftforge.fml.client.registry.ClientRegistry;
|
||||
import net.minecraftforge.fml.client.registry.RenderingRegistry;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.fml.common.thread.SidedThreadGroups;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent;
|
||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
import vazkii.botania.api.boss.IBotaniaBoss;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.lexicon.multiblock.IMultiblockRenderHook;
|
||||
@@ -138,10 +136,15 @@ public class ClientProxy implements IProxy {
|
||||
EMPTY_MODEL.setVisible(false);
|
||||
}
|
||||
|
||||
public static final KeyBinding CORPOREA_REQUEST = new KeyBinding("nei.options.keys.gui.botania_corporea_request", KeyConflictContext.GUI, Keyboard.KEY_C, LibMisc.MOD_NAME);
|
||||
public static KeyBinding CORPOREA_REQUEST;
|
||||
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
public void registerHandlers() {
|
||||
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::clientSetup);
|
||||
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::loadComplete);
|
||||
}
|
||||
|
||||
private void clientSetup(FMLClientSetupEvent event) {
|
||||
PersistentVariableHelper.setCacheFile(new File(Minecraft.getInstance().gameDir, "BotaniaVars.dat"));
|
||||
try {
|
||||
PersistentVariableHelper.load();
|
||||
@@ -151,10 +154,7 @@ public class ClientProxy implements IProxy {
|
||||
}
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(MiscellaneousIcons.INSTANCE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
ColorHandler.init();
|
||||
initAuxiliaryRender();
|
||||
|
||||
@@ -165,8 +165,6 @@ public class ClientProxy implements IProxy {
|
||||
|
||||
if(ConfigHandler.useAdaptativeConfig)
|
||||
MinecraftForge.EVENT_BUS.register(AdaptorNotifier.class);
|
||||
// if(ConfigHandler.versionCheckEnabled)
|
||||
// VersionChecker.init();
|
||||
|
||||
if(ConfigHandler.enableSeasonalFeatures) {
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
@@ -178,11 +176,13 @@ public class ClientProxy implements IProxy {
|
||||
|
||||
TileEntityItemStackRenderer.instance = new RenderTilePylon.ForwardingTEISR(TileEntityItemStackRenderer.instance);
|
||||
|
||||
ClientRegistry.registerKeyBinding(ClientProxy.CORPOREA_REQUEST);
|
||||
DeferredWorkQueue.runLater(() -> {
|
||||
CORPOREA_REQUEST = new KeyBinding("nei.options.keys.gui.botania_corporea_request", KeyConflictContext.GUI, InputMappings.getInputByCode(GLFW.GLFW_KEY_C, 0), LibMisc.MOD_NAME);
|
||||
ClientRegistry.registerKeyBinding(ClientProxy.CORPOREA_REQUEST);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
private void loadComplete(FMLLoadCompleteEvent event) {
|
||||
CorporeaAutoCompleteHandler.updateItemList();
|
||||
}
|
||||
|
||||
|
||||
@@ -33,17 +33,17 @@ public class ContainerFlowerBag extends Container {
|
||||
for(i = 0; i < 2; ++i)
|
||||
for(j = 0; j < 8; ++j) {
|
||||
int k = j + i * 8;
|
||||
addSlotToContainer(new SlotItemHandler(flowerBagInv, k, 17 + j * 18, 26 + i * 18));
|
||||
addSlot(new SlotItemHandler(flowerBagInv, k, 17 + j * 18, 26 + i * 18));
|
||||
}
|
||||
|
||||
for(i = 0; i < 3; ++i)
|
||||
for(j = 0; j < 9; ++j)
|
||||
addSlotToContainer(new Slot(playerInv, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
addSlot(new Slot(playerInv, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
|
||||
for(i = 0; i < 9; ++i) {
|
||||
if(playerInv.getStackInSlot(i) == flowerBagInv.bag)
|
||||
addSlotToContainer(new SlotLocked(playerInv, i, 8 + i * 18, 142));
|
||||
else addSlotToContainer(new Slot(playerInv, i, 8 + i * 18, 142));
|
||||
addSlot(new SlotLocked(playerInv, i, 8 + i * 18, 142));
|
||||
else addSlot(new Slot(playerInv, i, 8 + i * 18, 142));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@ import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.entity.RenderEntityItem;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityItemStackRenderer;
|
||||
|
||||
@@ -113,6 +113,7 @@ public class Botania {
|
||||
public Botania() {
|
||||
instance = this;
|
||||
proxy = DistExecutor.runForDist(() -> ClientProxy::new, () -> ServerProxy::new);
|
||||
proxy.registerHandlers();
|
||||
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::commonSetup);
|
||||
MinecraftForge.EVENT_BUS.addListener(this::serverAboutToStart);
|
||||
MinecraftForge.EVENT_BUS.addListener(this::serverStarting);
|
||||
@@ -146,8 +147,6 @@ public class Botania {
|
||||
ModCraftingRecipes.init();
|
||||
LexiconData.init();
|
||||
|
||||
proxy.preInit(event);
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(ManaNetworkHandler.instance);
|
||||
MinecraftForge.EVENT_BUS.register(TileCorporeaIndex.getInputHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new LootHandler());
|
||||
@@ -182,7 +181,6 @@ public class Botania {
|
||||
});
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void init(FMLInitializationEvent event) {
|
||||
|
||||
|
||||
@@ -205,10 +203,8 @@ public class Botania {
|
||||
|
||||
if(Botania.bcApiLoaded)
|
||||
new StatementAPIPlugin();
|
||||
proxy.init(event);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
if(Botania.thaumcraftLoaded) {
|
||||
try {
|
||||
@@ -232,7 +228,6 @@ public class Botania {
|
||||
Botania.LOGGER.info("The Lexica Botania has {} words.", words);
|
||||
|
||||
registerDefaultEntityBlacklist();
|
||||
proxy.postInit(event);
|
||||
}
|
||||
|
||||
// Overriding the internal method handler will break everything as it changes regularly.
|
||||
|
||||
@@ -10,15 +10,14 @@
|
||||
*/
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.state.BlockFaceShape;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.fluid.IFluidState;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
@@ -27,11 +26,10 @@ import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.ChunkCache;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraftforge.common.property.ExtendedBlockState;
|
||||
import net.minecraftforge.common.property.IExtendedBlockState;
|
||||
import net.minecraftforge.common.property.IUnlistedProperty;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
@@ -56,8 +54,8 @@ import java.util.Random;
|
||||
|
||||
public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements ISpecialFlower, IWandable, ILexiconable, IWandHUD {
|
||||
|
||||
public BlockFloatingSpecialFlower() {
|
||||
super(LibBlockNames.FLOATING_SPECIAL_FLOWER);
|
||||
public BlockFloatingSpecialFlower(Properties props) {
|
||||
super(EnumDyeColor.WHITE, props);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -78,7 +76,7 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLightValue(@Nonnull IBlockState state, IBlockReader world, @Nonnull BlockPos pos) {
|
||||
public int getLightValue(@Nonnull IBlockState state, IWorldReader world, @Nonnull BlockPos pos) {
|
||||
if(world.getBlockState(pos).getBlock() != this)
|
||||
return world.getBlockState(pos).getLightValue(world, pos);
|
||||
|
||||
@@ -113,10 +111,10 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {}
|
||||
public void animateTick(IBlockState state, World world, BlockPos pos, Random rand) {}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> stacks) {
|
||||
public void fillItemGroup(ItemGroup tab, NonNullList<ItemStack> stacks) {
|
||||
for(ResourceLocation s : BotaniaAPI.subtilesForCreativeMenu) {
|
||||
stacks.add(ItemBlockSpecialFlower.ofType(new ItemStack(this), s));
|
||||
if(BotaniaAPI.miniFlowers.containsKey(s))
|
||||
@@ -126,7 +124,7 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player) {
|
||||
public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull IBlockReader world, @Nonnull BlockPos pos, EntityPlayer player) {
|
||||
ResourceLocation name = ((TileSpecialFlower) world.getTileEntity(pos)).subTileName;
|
||||
return ItemBlockSpecialFlower.ofType(new ItemStack(state.getBlock()), name);
|
||||
}
|
||||
@@ -137,14 +135,14 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(@Nonnull IBlockState state, World world, @Nonnull BlockPos pos, @Nonnull EntityPlayer player, boolean willHarvest) {
|
||||
public boolean removedByPlayer(@Nonnull IBlockState state, World world, @Nonnull BlockPos pos, @Nonnull EntityPlayer player, boolean willHarvest, IFluidState fluid) {
|
||||
if (willHarvest) {
|
||||
// Copy of super.removedByPlayer but don't set to air yet
|
||||
// This is so getDrops below will have a TE to work with
|
||||
onBlockHarvested(world, pos, state, player);
|
||||
return true;
|
||||
} else {
|
||||
return super.removedByPlayer(state, world, pos, player, willHarvest);
|
||||
return super.removedByPlayer(state, world, pos, player, willHarvest, fluid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,11 +150,11 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
|
||||
public void harvestBlock(@Nonnull World world, EntityPlayer player, @Nonnull BlockPos pos, @Nonnull IBlockState state, TileEntity te, ItemStack stack) {
|
||||
super.harvestBlock(world, player, pos, state, te, stack);
|
||||
// Now delete the block and TE
|
||||
world.setBlockToAir(pos);
|
||||
world.removeBlock(pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDrops(NonNullList<ItemStack> list, IBlockReader world, BlockPos pos, @Nonnull IBlockState state, int fortune) {
|
||||
public void getDrops(@Nonnull IBlockState state, NonNullList<ItemStack> list, World world, BlockPos pos, int fortune) {
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
|
||||
if(tile != null) {
|
||||
@@ -177,24 +175,24 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
return ((TileSpecialFlower) world.getTileEntity(pos)).onBlockActivated(world, pos, state, player, hand, side, hitX, hitY, hitZ) || super.onBlockActivated(world, pos, state, player, hand, side, hitX, hitY, hitZ);
|
||||
public boolean onBlockActivated(IBlockState state, World world, BlockPos pos, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
return ((TileSpecialFlower) world.getTileEntity(pos)).onBlockActivated(world, pos, state, player, hand, side, hitX, hitY, hitZ) || super.onBlockActivated(state, world, pos, player, hand, side, hitX, hitY, hitZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockAdded(World world, BlockPos pos, IBlockState state) {
|
||||
public void onBlockAdded(IBlockState state, World world, BlockPos pos, IBlockState oldState) {
|
||||
((TileSpecialFlower) world.getTileEntity(pos)).onBlockAdded(world, pos, state);
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void renderHUD(Minecraft mc, ScaledResolution res, World world, BlockPos pos) {
|
||||
((TileSpecialFlower) world.getTileEntity(pos)).renderHUD(mc, res);
|
||||
public void renderHUD(Minecraft mc, World world, BlockPos pos) {
|
||||
((TileSpecialFlower) world.getTileEntity(pos)).renderHUD(mc);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) {
|
||||
public TileEntity createTileEntity(@Nonnull IBlockState state, @Nonnull IBlockReader world) {
|
||||
return new TileFloatingSpecialFlower();
|
||||
}
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ public class BlockGhostRail extends BlockRailBase implements ILexiconable {
|
||||
builder.add(BlockStateProperties.RAIL_SHAPE_STRAIGHT);
|
||||
}
|
||||
|
||||
/* todo 1.13
|
||||
@SubscribeEvent
|
||||
public static void onMinecartUpdate(MinecartUpdateEvent event) {
|
||||
BlockPos entPos = new BlockPos(event.getEntity());
|
||||
@@ -84,6 +85,7 @@ public class BlockGhostRail extends BlockRailBase implements ILexiconable {
|
||||
event.getEntity().world.playEvent(2000, entPos, 0);
|
||||
} else event.getEntity().noClip = false;
|
||||
}
|
||||
*/
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) {
|
||||
|
||||
@@ -12,13 +12,13 @@ package vazkii.botania.common.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.BlockFaceShape;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
@@ -52,10 +52,9 @@ public class BlockLightLauncher extends BlockMod implements ILexiconable {
|
||||
return SHAPE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, BotaniaStateProps.POWERED);
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, IBlockState> builder) {
|
||||
builder.add(BotaniaStateProps.POWERED);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -15,17 +15,14 @@ import net.minecraft.block.BlockDoublePlant;
|
||||
import net.minecraft.block.BlockTallFlower;
|
||||
import net.minecraft.block.IGrowable;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.statemap.StateMap;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.state.properties.DoubleBlockHalf;
|
||||
import net.minecraft.stats.StatList;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.NonNullList;
|
||||
@@ -75,12 +72,6 @@ public class BlockModDoubleFlower extends BlockTallFlower implements ILexiconabl
|
||||
return false;
|
||||
}
|
||||
|
||||
// todo 1.13 re-evaluate shearability of these
|
||||
@Override
|
||||
public boolean canHarvestBlock(IBlockReader world, @Nonnull BlockPos pos, @Nonnull EntityPlayer player) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isShearable(@Nonnull ItemStack item, IWorldReader world, BlockPos pos) {
|
||||
return true;
|
||||
@@ -89,18 +80,11 @@ public class BlockModDoubleFlower extends BlockTallFlower implements ILexiconabl
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> onSheared(@Nonnull ItemStack item, IWorld world, @Nonnull BlockPos pos, int fortune) {
|
||||
ArrayList<ItemStack> ret = new ArrayList<>();
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
IBlockState stateBelow = world.getBlockState(pos.down());
|
||||
|
||||
if (stateBelow.getBlock() == this && stateBelow.getValue(HALF) == EnumBlockHalf.LOWER && state.get(HALF) == EnumBlockHalf.UPPER) {
|
||||
ret.add(new ItemStack(this, 1, getMetaFromState(world.getBlockState(pos.down()))));
|
||||
}
|
||||
|
||||
if (state.get(HALF) == EnumBlockHalf.LOWER) {
|
||||
ret.add(new ItemStack(this, 1, getMetaFromState(state)));
|
||||
}
|
||||
|
||||
List<ItemStack> ret = new ArrayList<>();
|
||||
ret.add(new ItemStack(this));
|
||||
BlockPos other = world.getBlockState(pos).get(HALF) == DoubleBlockHalf.UPPER ? pos.down() : pos.up();
|
||||
world.removeBlock(pos);
|
||||
world.destroyBlock(other, false);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ package vazkii.botania.common.block;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.BannerPattern;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
|
||||
public final class ModBanners {
|
||||
@@ -31,7 +30,7 @@ public final class ModBanners {
|
||||
addPattern(clazz, "spark_recessive", "src", new ItemStack(ModItems.sparkUpgradeRecessive));
|
||||
addPattern(clazz, "spark_isolated", "sis", new ItemStack(ModItems.sparkUpgradeIsolated));
|
||||
|
||||
addPattern(clazz, "fish", "fis", new ItemStack(Items.FISH));
|
||||
addPattern(clazz, "fish", "fis", new ItemStack(Items.COD));
|
||||
addPattern(clazz, "axe", "axe", new ItemStack(Items.IRON_AXE));
|
||||
addPattern(clazz, "hoe", "hoe", new ItemStack(Items.IRON_HOE));
|
||||
addPattern(clazz, "pickaxe", "pik", new ItemStack(Items.IRON_PICKAXE));
|
||||
|
||||
@@ -114,7 +114,6 @@ import vazkii.botania.common.item.block.ItemBlockMod;
|
||||
import vazkii.botania.common.item.block.ItemBlockPool;
|
||||
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
|
||||
import vazkii.botania.common.item.block.ItemBlockTinyPotato;
|
||||
import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
@@ -246,7 +245,22 @@ public final class ModBlocks {
|
||||
@ObjectHolder("green" + LibBlockNames.BURIED_PETALS_SUFFIX) public static Block greenBuriedPetals;
|
||||
@ObjectHolder("red" + LibBlockNames.BURIED_PETALS_SUFFIX) public static Block redBuriedPetals;
|
||||
@ObjectHolder("black" + LibBlockNames.BURIED_PETALS_SUFFIX) public static Block blackBuriedPetals;
|
||||
public static final Block floatingFlower = new BlockFloatingFlower();
|
||||
@ObjectHolder("white" + LibBlockNames.FLOATING_FLOWER_SUFFIX) public static Block whiteFloatingFlower;
|
||||
@ObjectHolder("orange" + LibBlockNames.FLOATING_FLOWER_SUFFIX) public static Block orangeFloatingFlower;
|
||||
@ObjectHolder("magenta" + LibBlockNames.FLOATING_FLOWER_SUFFIX) public static Block magentaFloatingFlower;
|
||||
@ObjectHolder("light_blue" + LibBlockNames.FLOATING_FLOWER_SUFFIX) public static Block lightBlueFloatingFlower;
|
||||
@ObjectHolder("yellow" + LibBlockNames.FLOATING_FLOWER_SUFFIX) public static Block yellowFloatingFlower;
|
||||
@ObjectHolder("lime" + LibBlockNames.FLOATING_FLOWER_SUFFIX) public static Block limeFloatingFlower;
|
||||
@ObjectHolder("pink" + LibBlockNames.FLOATING_FLOWER_SUFFIX) public static Block pinkFloatingFlower;
|
||||
@ObjectHolder("gray" + LibBlockNames.FLOATING_FLOWER_SUFFIX) public static Block grayFloatingFlower;
|
||||
@ObjectHolder("light_gray" + LibBlockNames.FLOATING_FLOWER_SUFFIX) public static Block lightGrayFloatingFlower;
|
||||
@ObjectHolder("cyan" + LibBlockNames.FLOATING_FLOWER_SUFFIX) public static Block cyanFloatingFlower;
|
||||
@ObjectHolder("purple" + LibBlockNames.FLOATING_FLOWER_SUFFIX) public static Block purpleFloatingFlower;
|
||||
@ObjectHolder("blue" + LibBlockNames.FLOATING_FLOWER_SUFFIX) public static Block blueFloatingFlower;
|
||||
@ObjectHolder("brown" + LibBlockNames.FLOATING_FLOWER_SUFFIX) public static Block brownFloatingFlower;
|
||||
@ObjectHolder("green" + LibBlockNames.FLOATING_FLOWER_SUFFIX) public static Block greenFloatingFlower;
|
||||
@ObjectHolder("red" + LibBlockNames.FLOATING_FLOWER_SUFFIX) public static Block redFloatingFlower;
|
||||
@ObjectHolder("black" + LibBlockNames.FLOATING_FLOWER_SUFFIX) public static Block blackFloatingFlower;
|
||||
@ObjectHolder(LibBlockNames.TINY_POTATO) public static Block tinyPotato;
|
||||
@ObjectHolder(LibBlockNames.SPAWNER_CLAW) public static Block spawnerClaw;
|
||||
@ObjectHolder(LibBlockNames.AZULEJO_PREFIX + 0) public static Block azulejo0;
|
||||
@@ -277,7 +291,7 @@ public final class ModBlocks {
|
||||
@ObjectHolder(LibBlockNames.RED_STRING_FERTILIZER) public static Block redStringFertilizer;
|
||||
@ObjectHolder(LibBlockNames.RED_STRING_COMPARATOR) public static Block redStringComparator;
|
||||
@ObjectHolder(LibBlockNames.RED_STRING_RELAY) public static Block redStringRelay;
|
||||
public static final Block floatingSpecialFlower = new BlockFloatingSpecialFlower();
|
||||
@ObjectHolder(LibBlockNames.FLOATING_SPECIAL_FLOWER) public static Block floatingSpecialFlower;
|
||||
@ObjectHolder(LibBlockNames.MANA_FLAME) public static Block manaFlame;
|
||||
@ObjectHolder(LibBlockNames.PRISM) public static Block prism;
|
||||
@ObjectHolder(LibBlockNames.ENCHANTED_SOIL) public static Block enchantedSoil;
|
||||
@@ -486,8 +500,13 @@ public final class ModBlocks {
|
||||
for(EnumDyeColor color : EnumDyeColor.values()) {
|
||||
register(r, new BlockBuriedPetals(color, builder), color.getName() + LibBlockNames.BURIED_PETALS_SUFFIX);
|
||||
}
|
||||
|
||||
r.register(floatingFlower);
|
||||
|
||||
builder = Block.Properties.create(Material.GROUND).hardnessAndResistance(0.5F).sound(SoundType.GROUND).lightValue(15);
|
||||
register(r, new BlockFloatingSpecialFlower(builder), LibBlockNames.FLOATING_SPECIAL_FLOWER);
|
||||
for(EnumDyeColor color : EnumDyeColor.values()) {
|
||||
register(r, new BlockFloatingFlower(color, builder), color.getName() + LibBlockNames.FLOATING_FLOWER_SUFFIX);
|
||||
}
|
||||
|
||||
register(r, new BlockTinyPotato(Block.Properties.create(Material.CLOTH).hardnessAndResistance(0.25F)), LibBlockNames.TINY_POTATO);
|
||||
register(r, new BlockSpawnerClaw(Block.Properties.create(Material.IRON).hardnessAndResistance(3)), LibBlockNames.SPAWNER_CLAW);
|
||||
|
||||
@@ -511,8 +530,7 @@ public final class ModBlocks {
|
||||
register(r, new BlockRedStringFertilizer(builder), LibBlockNames.RED_STRING_FERTILIZER);
|
||||
register(r, new BlockRedStringComparator(builder), LibBlockNames.RED_STRING_COMPARATOR);
|
||||
register(r, new BlockRedStringRelay(builder), LibBlockNames.RED_STRING_RELAY);
|
||||
register(r, new BlockRedStringInterceptor(builder), LibBlockNames.RED_STRING_INTERCEPTOR);
|
||||
r.register(floatingSpecialFlower);
|
||||
register(r, new BlockRedStringInterceptor(builder), LibBlockNames.RED_STRING_INTERCEPTOR);
|
||||
register(r, new BlockManaFlame(Block.Properties.create(Material.CLOTH).sound(SoundType.CLOTH).lightValue(15).doesNotBlockMovement()), LibBlockNames.MANA_FLAME);
|
||||
register(r, new BlockPrism(Block.Properties.create(Material.GLASS).hardnessAndResistance(0.3F).sound(SoundType.GLASS).lightValue(15).doesNotBlockMovement()), LibBlockNames.PRISM);
|
||||
register(r, new BlockEnchantedSoil(Block.Properties.create(Material.GRASS).hardnessAndResistance(0.6F).sound(SoundType.PLANT)), LibBlockNames.ENCHANTED_SOIL);
|
||||
@@ -678,7 +696,22 @@ public final class ModBlocks {
|
||||
r.register(new ItemBlockDreamwood(dreamwood, props).setRegistryName(dreamwood.getRegistryName()));
|
||||
r.register(new ItemBlockMod(conjurationCatalyst, props).setRegistryName(conjurationCatalyst.getRegistryName()));
|
||||
r.register(new ItemBlockMod(bifrost, props).setRegistryName(bifrost.getRegistryName()));
|
||||
r.register(new ItemBlockWithMetadataAndName(floatingFlower).setRegistryName(floatingFlower.getRegistryName()));
|
||||
r.register(new ItemBlockMod(whiteFloatingFlower, props).setRegistryName(whiteFloatingFlower.getRegistryName()));
|
||||
r.register(new ItemBlockMod(orangeFloatingFlower, props).setRegistryName(orangeFloatingFlower.getRegistryName()));
|
||||
r.register(new ItemBlockMod(magentaFloatingFlower, props).setRegistryName(magentaFloatingFlower.getRegistryName()));
|
||||
r.register(new ItemBlockMod(lightBlueFloatingFlower, props).setRegistryName(lightBlueFloatingFlower.getRegistryName()));
|
||||
r.register(new ItemBlockMod(yellowFloatingFlower, props).setRegistryName(yellowFloatingFlower.getRegistryName()));
|
||||
r.register(new ItemBlockMod(limeFloatingFlower, props).setRegistryName(limeFloatingFlower.getRegistryName()));
|
||||
r.register(new ItemBlockMod(pinkFloatingFlower, props).setRegistryName(pinkFloatingFlower.getRegistryName()));
|
||||
r.register(new ItemBlockMod(grayFloatingFlower, props).setRegistryName(grayFloatingFlower.getRegistryName()));
|
||||
r.register(new ItemBlockMod(lightGrayFloatingFlower, props).setRegistryName(lightGrayFloatingFlower.getRegistryName()));
|
||||
r.register(new ItemBlockMod(cyanFloatingFlower, props).setRegistryName(cyanFloatingFlower.getRegistryName()));
|
||||
r.register(new ItemBlockMod(purpleFloatingFlower, props).setRegistryName(purpleFloatingFlower.getRegistryName()));
|
||||
r.register(new ItemBlockMod(blueFloatingFlower, props).setRegistryName(blueFloatingFlower.getRegistryName()));
|
||||
r.register(new ItemBlockMod(brownFloatingFlower, props).setRegistryName(brownFloatingFlower.getRegistryName()));
|
||||
r.register(new ItemBlockMod(greenFloatingFlower, props).setRegistryName(greenFloatingFlower.getRegistryName()));
|
||||
r.register(new ItemBlockMod(redFloatingFlower, props).setRegistryName(redFloatingFlower.getRegistryName()));
|
||||
r.register(new ItemBlockMod(blackFloatingFlower, props).setRegistryName(blackFloatingFlower.getRegistryName()));
|
||||
r.register(new ItemBlockTinyPotato(tinyPotato, props).setRegistryName(tinyPotato.getRegistryName()));
|
||||
r.register(new ItemBlockMod(spawnerClaw, props).setRegistryName(spawnerClaw.getRegistryName()));
|
||||
r.register(new ItemBlockMod(azulejo0, props).setRegistryName(azulejo0.getRegistryName()));
|
||||
|
||||
@@ -13,10 +13,10 @@ package vazkii.botania.common.block.corporea;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
@@ -37,10 +37,9 @@ public class BlockCorporeaFunnel extends BlockCorporeaBase implements ILexiconab
|
||||
setDefaultState(stateContainer.getBaseState().with(BotaniaStateProps.POWERED, false));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, BotaniaStateProps.POWERED);
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, IBlockState> builder) {
|
||||
builder.add(BotaniaStateProps.POWERED);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [Jan 29, 2015, 6:54:20 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.block.decor;
|
||||
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.common.block.BlockMod;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockBiomeStone extends BlockMod implements ILexiconable {
|
||||
|
||||
public BlockBiomeStone(Properties props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
for(int i = 0; i < 16; i++)
|
||||
list.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(IBlockState state) {
|
||||
return getMetaFromState(state);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player) {
|
||||
return new ItemStack(this, 1, getMetaFromState(world.getBlockState(pos)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) {
|
||||
return LexiconData.marimorphosis;
|
||||
}
|
||||
}
|
||||
@@ -12,34 +12,25 @@ package vazkii.botania.common.block.decor;
|
||||
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.state.BlockFaceShape;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.statemap.StateMap;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.EnumBlockRenderType;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.ChunkCache;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.common.property.ExtendedBlockState;
|
||||
import net.minecraftforge.common.property.IExtendedBlockState;
|
||||
import net.minecraftforge.common.property.IUnlistedProperty;
|
||||
import net.minecraftforge.fml.common.Optional;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import vazkii.botania.api.internal.VanillaPacketDispatcher;
|
||||
@@ -48,7 +39,6 @@ import vazkii.botania.api.item.IFloatingFlower.IslandType;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.client.core.handler.ModelHandler;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.BlockMod;
|
||||
import vazkii.botania.common.block.tile.TileFloatingFlower;
|
||||
@@ -63,24 +53,18 @@ import java.util.Random;
|
||||
|
||||
public class BlockFloatingFlower extends BlockMod implements ILexiconable {
|
||||
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(0.1, 0.1, 0.1, 0.9, 0.9, 0.9);
|
||||
private static final VoxelShape SHAPE = makeCuboidShape(1.6, 1.6, 1.6, 14.4, 14.4, 14.4);
|
||||
public final EnumDyeColor color;
|
||||
|
||||
public BlockFloatingFlower() {
|
||||
this(LibBlockNames.MINI_ISLAND);
|
||||
}
|
||||
|
||||
public BlockFloatingFlower(String name) {
|
||||
super(Material.GROUND, name);
|
||||
setHardness(0.5F);
|
||||
setSoundType(SoundType.GROUND);
|
||||
setLightLevel(1F);
|
||||
setDefaultState(blockState.getBaseState().with(BotaniaStateProps.COLOR, EnumDyeColor.WHITE));
|
||||
public BlockFloatingFlower(EnumDyeColor color, Properties props) {
|
||||
super(props);
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockReader world, BlockPos pos) {
|
||||
return AABB;
|
||||
public VoxelShape getShape(IBlockState state, IBlockReader world, BlockPos pos) {
|
||||
return SHAPE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -102,20 +86,6 @@ public class BlockFloatingFlower extends BlockMod implements ILexiconable {
|
||||
return new ExtendedBlockState(this, new IProperty[] { BotaniaStateProps.COLOR }, new IUnlistedProperty[] { BotaniaStateProps.ISLAND_TYPE });
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return state.get(BotaniaStateProps.COLOR).getMetadata();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
if (meta >= EnumDyeColor.values().length) {
|
||||
meta = 0;
|
||||
}
|
||||
return getDefaultState().with(BotaniaStateProps.COLOR, EnumDyeColor.byMetadata(meta));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState getExtendedState(@Nonnull IBlockState state, IBlockReader world, BlockPos pos) {
|
||||
@@ -131,8 +101,8 @@ public class BlockFloatingFlower extends BlockMod implements ILexiconable {
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
|
||||
int hex = state.get(BotaniaStateProps.COLOR).getColorValue();
|
||||
public void animateTick(IBlockState state, World world, BlockPos pos, Random rand) {
|
||||
int hex = state.get(BotaniaStateProps.COLOR).colorValue;
|
||||
int r = (hex & 0xFF0000) >> 16;
|
||||
int g = (hex & 0xFF00) >> 8;
|
||||
int b = hex & 0xFF;
|
||||
@@ -141,22 +111,6 @@ public class BlockFloatingFlower extends BlockMod implements ILexiconable {
|
||||
Botania.proxy.sparkleFX(pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.5 + rand.nextFloat() * 0.5, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(CreativeTabs par2, NonNullList<ItemStack> par3) {
|
||||
for(int i = 0; i < 16; i++)
|
||||
par3.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(IBlockState state) {
|
||||
return getMetaFromState(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(IBlockState state) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube(IBlockState state) {
|
||||
return false;
|
||||
@@ -197,7 +151,7 @@ public class BlockFloatingFlower extends BlockMod implements ILexiconable {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) {
|
||||
public TileEntity createTileEntity(@Nonnull IBlockState state, @Nonnull IBlockReader world) {
|
||||
return new TileFloatingFlower();
|
||||
}
|
||||
|
||||
@@ -206,14 +160,6 @@ public class BlockFloatingFlower extends BlockMod implements ILexiconable {
|
||||
return LexiconData.shinyFlowers;
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void registerModels() {
|
||||
ModelLoader.setCustomStateMapper(this, new StateMap.Builder().ignore(BotaniaStateProps.COLOR).build());
|
||||
// All to variant inventory so smartmodel can work
|
||||
ModelHandler.registerItemAllMeta(Item.getItemFromBlock(this), EnumDyeColor.values().length);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public BlockFaceShape getBlockFaceShape(IBlockReader world, IBlockState state, BlockPos pos, EnumFacing side) {
|
||||
|
||||
@@ -16,8 +16,6 @@ import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
|
||||
@@ -3,8 +3,8 @@ package vazkii.botania.common.core.handler;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.entity.player.PlayerSleepInBedEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import vazkii.botania.common.entity.EntityDoppleganger;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
@@ -12,7 +12,7 @@ import vazkii.botania.common.lib.LibMisc;
|
||||
public final class SleepingHandler {
|
||||
|
||||
private SleepingHandler() {}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public static void trySleep(PlayerSleepInBedEvent event) {
|
||||
World world = event.getEntityPlayer().world;
|
||||
|
||||
@@ -6,19 +6,12 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import vazkii.botania.api.boss.IBotaniaBoss;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
|
||||
public interface IProxy {
|
||||
void preInit(FMLPreInitializationEvent event);
|
||||
|
||||
void init(FMLInitializationEvent event);
|
||||
|
||||
void postInit(FMLPostInitializationEvent event);
|
||||
default void registerHandlers() {}
|
||||
|
||||
void setEntryToOpen(LexiconEntry entry);
|
||||
|
||||
|
||||
@@ -16,10 +16,8 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import net.minecraftforge.fml.server.ServerLifecycleHooks;
|
||||
import vazkii.botania.api.boss.IBotaniaBoss;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
@@ -27,15 +25,6 @@ import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
public class ServerProxy implements IProxy {
|
||||
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {}
|
||||
|
||||
@Override
|
||||
public void setEntryToOpen(LexiconEntry entry) {}
|
||||
|
||||
@@ -78,7 +67,7 @@ public class ServerProxy implements IProxy {
|
||||
|
||||
@Override
|
||||
public long getWorldElapsedTicks() {
|
||||
return FMLCommonHandler.instance().getMinecraftServerInstance().worlds[0].getTotalWorldTime();
|
||||
return ServerLifecycleHooks.getCurrentServer().getWorld(DimensionType.OVERWORLD).getGameTime();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,16 +16,15 @@ import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.Style;
|
||||
import net.minecraft.util.text.TextComponentTranslation;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.TickEvent.Phase;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
@Mod.EventBusSubscriber(value = Side.CLIENT, modid = LibMisc.MOD_ID)
|
||||
@Mod.EventBusSubscriber(value = Dist.CLIENT, modid = LibMisc.MOD_ID)
|
||||
public final class VersionChecker {
|
||||
|
||||
private VersionChecker() {}
|
||||
@@ -54,7 +53,7 @@ public final class VersionChecker {
|
||||
player.sendMessage(new TextComponentTranslation("botania.versioning.flavour" + player.world.rand.nextInt(FLAVOUR_MESSAGES)).setStyle(new Style().setColor(TextFormatting.LIGHT_PURPLE)));
|
||||
player.sendMessage(new TextComponentTranslation("botania.versioning.outdated", clientBuild, onlineBuild));
|
||||
|
||||
ITextComponent component = ITextComponent.Serializer.fromJsonLenient(I18n.translateToLocal("botania.versioning.updateMessage").replaceAll("%version%", onlineVersion));
|
||||
ITextComponent component = new TextComponentTranslation("botania.versioning.updateMessage").replaceAll("%version%", onlineVersion);
|
||||
player.sendMessage(component);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,8 +16,6 @@ import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.registries.IForgeRegistry;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
|
||||
-1
@@ -13,7 +13,6 @@ package vazkii.botania.common.item.interaction.thaumcraft;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.inventory.EntityEquipmentSlot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.common.Optional;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.item.equipment.armor.manasteel.ItemManasteelHelm;
|
||||
|
||||
@@ -27,6 +27,7 @@ import vazkii.botania.common.network.PacketHandler;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
|
||||
public class LensPaint extends Lens {
|
||||
|
||||
@@ -44,14 +45,12 @@ public class LensPaint extends Lens {
|
||||
}
|
||||
dead = true;
|
||||
} else {
|
||||
Block block = entity.world.getBlockState(pos.getBlockPos()).getBlock();
|
||||
IBlockState state = entity.world.getBlockState(pos.getBlockPos());
|
||||
Block block = state.getBlock();
|
||||
if(BotaniaAPI.paintableBlocks.containsKey(block)) {
|
||||
IBlockState state = entity.world.getBlockState(pos.getBlockPos());
|
||||
List<BlockPos> coordsToPaint = new ArrayList<>();
|
||||
List<BlockPos> coordsFound = new ArrayList<>();
|
||||
|
||||
BlockPos theseCoords = pos.getBlockPos();
|
||||
coordsFound.add(theseCoords);
|
||||
coordsFound.add(pos.getBlockPos());
|
||||
|
||||
do {
|
||||
List<BlockPos> iterCoords = new ArrayList<>(coordsFound);
|
||||
@@ -72,9 +71,10 @@ public class LensPaint extends Lens {
|
||||
EnumDyeColor placeColor = EnumDyeColor.byId(storedColor == 16 ? entity.world.rand.nextInt(16) : storedColor);
|
||||
IBlockState stateThere = entity.world.getBlockState(coords);
|
||||
|
||||
if(stateThere.get(BotaniaAPI.paintableBlocks.get(block)) != placeColor
|
||||
&& BotaniaAPI.paintableBlocks.get(block).getAllowedValues().contains(placeColor)) {
|
||||
entity.world.setBlockState(coords, stateThere.with(BotaniaAPI.paintableBlocks.get(block), placeColor), 2);
|
||||
Function<EnumDyeColor, Block> f = BotaniaAPI.paintableBlocks.get(block);
|
||||
Block newBlock = f.apply(placeColor);
|
||||
if(newBlock != stateThere.getBlock()) {
|
||||
entity.world.setBlockState(coords, newBlock.getDefaultState());
|
||||
PacketHandler.sendToNearby(entity.world, coords,
|
||||
new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.PAINT_LENS, coords.getX(), coords.getY(), coords.getZ(), placeColor.getId()));
|
||||
}
|
||||
|
||||
@@ -19,16 +19,10 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.Ingredient;
|
||||
import net.minecraft.item.crafting.ShapedRecipe;
|
||||
import net.minecraft.item.crafting.ShapedRecipes;
|
||||
import net.minecraft.item.crafting.ShapelessRecipe;
|
||||
import net.minecraft.item.crafting.ShapelessRecipes;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||
import net.minecraftforge.fml.relauncher.ReflectionHelper;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import vazkii.botania.api.internal.IGuiLexiconEntry;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
|
||||
@@ -78,6 +78,7 @@ public final class LibBlockNames {
|
||||
public static final String BURIED_PETALS_SUFFIX = "_buried_petals";
|
||||
public static final String PRISMARINE = "prismarine";
|
||||
public static final String MINI_ISLAND = "mini_island";
|
||||
public static final String FLOATING_FLOWER_SUFFIX = "_floating_flower";
|
||||
public static final String TINY_POTATO = "tiny_potato";
|
||||
public static final String SPAWNER_CLAW = "spawner_claw";
|
||||
public static final String AZULEJO_PREFIX = "azulejo_";
|
||||
|
||||
Reference in new issue
Block a user