Resolve some more compile errors

This commit is contained in:
zontreck 2023-11-20 02:38:10 -07:00
parent 222d78d401
commit 575e97d05c
8 changed files with 30 additions and 73 deletions

View file

@ -118,7 +118,6 @@ public class OTEMod
MinecraftForge.EVENT_BUS.register(new KeyBindings());
GeckoLib.initialize();
//MenuInitializer.register(bus);
}

View file

@ -36,13 +36,14 @@ public class FlyCommand {
p.getAbilities().mayfly=false;
p.getAbilities().flying=false;
p.onUpdateAbilities();
ctx.sendSuccess(Component.literal(OTEMod.OTEPrefix + ChatColor.DARK_PURPLE + " Your ability to fly has been disabled"), false);
ctx.sendSystemMessage(Component.literal(OTEMod.OTEPrefix + ChatColor.DARK_PURPLE + " Your ability to fly has been disabled"));
}else {
p.getAbilities().mayfly=true;
p.onUpdateAbilities();
ctx.sendSuccess(Component.literal(OTEMod.OTEPrefix + ChatColor.DARK_PURPLE + " You can now fly"), false);
ctx.sendSystemMessage(Component.literal(OTEMod.OTEPrefix + ChatColor.DARK_PURPLE + " You can now fly"));
}
return 0;

View file

@ -11,13 +11,13 @@ import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
public class ModEntityTypes {
public static final DeferredRegister<EntityType<?>> ENTITIES = DeferredRegister.create(ForgeRegistries.ENTITY_TYPES, OTEMod.MOD_ID);
//public static final DeferredRegister<EntityType<?>> ENTITIES = DeferredRegister.create(ForgeRegistries.ENTITY_TYPES, OTEMod.MOD_ID);
public static final RegistryObject<EntityType<? extends PossumEntity>> POSSUM = ENTITIES.register("possum", ()-> EntityType.Builder.of(PossumEntity::new, MobCategory.CREATURE).sized(1.5f, 0.5f).build(new ResourceLocation(OTEMod.MOD_ID, "possum").toString()));
//public static final RegistryObject<EntityType<? extends PossumEntity>> POSSUM = ENTITIES.register("possum", ()-> EntityType.Builder.of(PossumEntity::new, MobCategory.CREATURE).sized(1.5f, 0.5f).build(new ResourceLocation(OTEMod.MOD_ID, "possum").toString()));
public static void register(IEventBus bus){
ENTITIES.register(bus);
}
//public static void register(IEventBus bus){
// ENTITIES.register(bus);
//}
}

View file

@ -1,34 +1,9 @@
package dev.zontreck.otemod.entities.monsters;
import dev.zontreck.otemod.entities.ModEntityTypes;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.AgeableMob;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
import net.minecraft.world.entity.ai.attributes.Attributes;
import net.minecraft.world.entity.ai.goal.FloatGoal;
import net.minecraft.world.entity.ai.goal.WaterAvoidingRandomStrollGoal;
import net.minecraft.world.entity.animal.Animal;
import net.minecraft.world.entity.animal.Cat;
import net.minecraft.world.entity.animal.Cow;
import net.minecraft.world.entity.animal.Fox;
import net.minecraft.world.entity.monster.Monster;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.Level;
import software.bernie.geckolib3.core.IAnimatable;
import software.bernie.geckolib3.core.PlayState;
import software.bernie.geckolib3.core.builder.AnimationBuilder;
import software.bernie.geckolib3.core.builder.ILoopType;
import software.bernie.geckolib3.core.controller.AnimationController;
import software.bernie.geckolib3.core.event.predicate.AnimationEvent;
import software.bernie.geckolib3.core.manager.AnimationData;
import software.bernie.geckolib3.core.manager.AnimationFactory;
import software.bernie.geckolib3.util.GeckoLibUtil;
public class PossumEntity extends Animal implements IAnimatable
public class PossumEntity
{
/*
public PossumEntity(EntityType<? extends Animal> pEntityType, Level pLevel) {
super(pEntityType, pLevel);
//TODO Auto-generated constructor stub
@ -80,5 +55,5 @@ public class PossumEntity extends Animal implements IAnimatable
{
this.goalSelector.addGoal(0, new FloatGoal(this));
this.goalSelector.addGoal(1, new WaterAvoidingRandomStrollGoal(this, 1));
}
}*/
}

View file

@ -1,13 +1,9 @@
package dev.zontreck.otemod.entities.monsters.client;
import dev.zontreck.otemod.OTEMod;
import dev.zontreck.otemod.entities.monsters.PossumEntity;
import net.minecraft.resources.ResourceLocation;
import software.bernie.geckolib3.model.AnimatedGeoModel;
public class PossumModel extends AnimatedGeoModel<PossumEntity>
public class PossumModel
{
/*
@Override
public ResourceLocation getAnimationFileLocation(PossumEntity animatable) {
return new ResourceLocation(OTEMod.MOD_ID, "animations/possum.animation.json");
@ -21,6 +17,6 @@ public class PossumModel extends AnimatedGeoModel<PossumEntity>
@Override
public ResourceLocation getTextureLocation(PossumEntity object) {
return new ResourceLocation(OTEMod.MOD_ID, "textures/entity/possum_texture.png");
}
}*/
}

View file

@ -1,20 +1,9 @@
package dev.zontreck.otemod.entities.monsters.client;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import dev.zontreck.otemod.OTEMod;
import dev.zontreck.otemod.entities.monsters.PossumEntity;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.client.renderer.entity.EntityRendererProvider.Context;
import net.minecraft.resources.ResourceLocation;
import software.bernie.geckolib3.renderers.geo.GeoEntityRenderer;
public class PossumRenderer extends GeoEntityRenderer<PossumEntity>
public class PossumRenderer
{
/*
public PossumRenderer(EntityRendererProvider.Context renderManager) {
super(renderManager, new PossumModel());
this.shadowRadius=0.3f;
@ -36,5 +25,5 @@ public class PossumRenderer extends GeoEntityRenderer<PossumEntity>
{
return super.getRenderType(animatable, partialTicks, stack, buffer, consumer, packed, loc);
}
*/
}

View file

@ -39,7 +39,7 @@ public class EnergyInfoArea extends InfoArea {
final int height = area.getHeight();
int stored = (int)(height*(energy.getEnergyStored()/(float)energy.getMaxEnergyStored()));
fillGradient(
transform,
area.getX(), area.getY()+(height-stored),
area.getX() + area.getWidth(), area.getY() +area.getHeight(),
0xffb51500, 0xff600b00

View file

@ -9,6 +9,7 @@ import dev.zontreck.otemod.OTEMod;
import dev.zontreck.otemod.commands.vaults.VaultCommand;
import dev.zontreck.otemod.networking.ModMessages;
import dev.zontreck.otemod.networking.packets.OpenVaultC2SPacket;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.components.Button;
import net.minecraft.client.gui.components.Button.OnPress;
import net.minecraft.client.gui.font.TextFieldHelper;
@ -45,7 +46,7 @@ public class VaultScreen extends AbstractContainerScreen <VaultMenu>
}
@Override
public void render(PoseStack stack, int mouseX, int mouseY, float partialTicks)
public void render(GuiGraphics stack, int mouseX, int mouseY, float partialTicks)
{
this.renderBackground(stack);
super.render(stack, mouseX, mouseY, partialTicks);
@ -53,20 +54,14 @@ public class VaultScreen extends AbstractContainerScreen <VaultMenu>
}
@Override
protected void renderLabels(PoseStack stack, int mouseX, int mouseY)
{
this.font.draw(stack, this.title, 63, 12, 0xFFFFFF);
this.font.draw(stack, this.playerInventoryTitle, 63, 146, 0xFFFFFF);
//this.font.draw(stack, this.title.getString(), this.leftPos + 17, this.topPos + 15, 0xFFFFFF);
//this.font.draw(stack, this.playerInventoryTitle.getString(), this.leftPos + 17, this.topPos + 123, 0xFFFFFF);
}
@Override
protected void init()
{
super.init();
this.inventoryLabelY = 12;
this.inventoryLabelX = 63;
// This is where custom controls would be added!
this.addWidget(Button.builder(Component.literal(""), (BTN)->{
@ -82,13 +77,15 @@ public class VaultScreen extends AbstractContainerScreen <VaultMenu>
}
@Override
protected void renderBg(PoseStack stack, float mouseX, int mouseY, int partialTicks)
protected void renderBg(GuiGraphics pGuiGraphics, float pPartialTick, int pMouseX, int pMouseY)
{
renderBackground(stack);
renderBackground(pGuiGraphics);
RenderSystem.setShader(GameRenderer::getPositionTexShader);
RenderSystem.setShaderColor (1.0f, 1.0f, 1.0f, 1.0f);
RenderSystem.setShaderTexture(0, TEXTURE);
blit(stack, this.leftPos, this.topPos, 0, 0, this.imageWidth, this.imageHeight);
pGuiGraphics.blit(TEXTURE, this.leftPos, this.topPos, 0, 0, this.imageWidth, this.imageHeight);
}
}