Skip to content

Instantly share code, notes, and snippets.

@ZornTaov
ZornTaov / DelegateTest.cpp
Created January 11, 2022 20:11
Delegate wrapper examples, might not be the best.
#include "DelegateTest.h"
void UDelegateTest::RegisterDelegate(FOnDelegate& Del)
{
if (!OnDelegate.IsBound())
{
OnDelegate = Del;
return;
}
UE_LOG(LogTemp, Warning, TEXT("OnComplete already Bound, ignoring as I can only have one binding."));
@Mod.EventBusSubscriber(modid = YOURMOD.MOD_ID)
public static class ServerEvents {
@SubscribeEvent
public static void onLivingUpdateEvent(LivingEvent.LivingUpdateEvent event) {
LivingEntity le = event.getEntityLiving();
if (le instanceof MobEntity) { // only MobEntity has a Navigator, so this includes most entities
PathNavigator navi = ((MobEntity) le).getNavigator();
if (le.world instanceof ServerWorld && le.world.getGameTime() % 10 == 0) { // only generate every 0.5 seconds, to try and cut back on packet spam
Path path = navi.getPath();
@ZornTaov
ZornTaov / errors
Last active February 20, 2017 06:40
[22:32:57] [Client thread/WARN]: File minecraft:sounds/ding.ogg does not exist, cannot add it to event foxtopia:ding
File Path:
.minecraft\resources\foxtopia\sounds\ding.ogg
[16:18:18] [Client thread/ERROR] [FML]: Exception loading model for variant bedcraftbeyond:grill#lit=false for blockstates ["bedcraftbeyond:grill[has_food=true,lit=false]", "bedcraftbeyond:grill[has_food=false,lit=false]"]
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model bedcraftbeyond:grill#lit=false with loader VariantLoader.INSTANCE, skipping
at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
at net.minecraftforge.client.model.ModelLoader.registerVariant(ModelLoader.java:241) ~[ModelLoader.class:?]
at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:145) ~[ModelBakery.class:?]
at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:229) ~[ModelLoader.class:?]
at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:146) ~[ModelLoader.class:?]
at net.minecraft.client.renderer.block.model.ModelManager.onResourc
package org.zornco.reploidcraft.proxy;
import java.util.ArrayList;
import java.util.List;
import org.zornco.reploidcraft.ReploidCraft;
import org.zornco.reploidcraft.client.render.RenderFloatingPlatform;
import org.zornco.reploidcraft.entities.EntityFloatingPlatform;
import org.zornco.reploidcraft.init.RCItems;
import org.zornco.reploidcraft.item.EnumEnergyPelletStr;
{
"forge_marker": 1,
"defaults": {
"textures": {
"texture": "blocks/wool_colored_white",
"particle": "#texture",
"wool": "#texture",
"bottom": "#texture",
"top": "#texture",
"side": "#texture"
package zornco.bedcraftbeyond.blocks;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.BlockSlab;
import net.minecraft.block.BlockSlab.EnumBlockHalf;
import net.minecraft.block.BlockStairs;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
buildscript {
repositories {
mavenCentral()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
x = y
x^2 = xy multiply both sides by x
x^2 - y^2 = xy - y^2 subtract y^2 from each side
(x + y) (x - y) = y(x - y) factor
x + y = y divide out x - y
2y = y substitute y for x from x = y
2 = 1 PROFIT
//constants, I forgot how to make them AS constants, this could also be an Enum instead
public const MODE_EMPTY = 0; // 00000
public const MODE_V = 1; // 00001
public const MODE_H = 2; // 00010
public const MODE_O = 4; // 00100
public const MODE_A = 8; // 01000
public const MODE_Q = 16; // 10000